html_gen.go 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308
  1. package app
  2. // Code generated by go generate; DO NOT EDIT.
  3. import (
  4. "fmt"
  5. "strings"
  6. )
  7. // HTMLA is the interface that describes a "a" HTML element.
  8. type HTMLA interface {
  9. UI
  10. // Body set the content of the element.
  11. Body(elems ...UI) HTMLA
  12. // Text sets the content of the element with a text node containing the stringified given value.
  13. Text(v any) HTMLA
  14. // AccessKey specifies a shortcut key to activate/focus an element.
  15. AccessKey(v string) HTMLA
  16. // Aria stores accessible rich internet applications (ARIA) data.
  17. Aria(k string, v any) HTMLA
  18. // Attr sets the named attribute with the given value.
  19. Attr(n string, v any) HTMLA
  20. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  21. Class(v ...string) HTMLA
  22. // ContentEditable specifies whether the content of an element is editable or not.
  23. ContentEditable(v bool) HTMLA
  24. // DataSet stores custom data private to the page or application.
  25. DataSet(k string, v any) HTMLA
  26. // Dir specifies the text direction for the content in an element.
  27. Dir(v string) HTMLA
  28. // Download specifies that the target will be downloaded when a user clicks on the hyperlink.
  29. Download(v string) HTMLA
  30. // Draggable specifies whether an element is draggable or not.
  31. Draggable(v bool) HTMLA
  32. // Hidden specifies that an element is not yet, or is no longer relevant.
  33. Hidden(v bool) HTMLA
  34. // Href specifies the URL of the page the link goes to.
  35. Href(v string) HTMLA
  36. // HrefLang specifies the language of the linked document.
  37. HrefLang(v string) HTMLA
  38. // ID specifies a unique id for an element.
  39. ID(v string) HTMLA
  40. // Lang specifies the language of the element's content.
  41. Lang(v string) HTMLA
  42. // Media specifies what media/device the linked document is optimized for.
  43. Media(v string) HTMLA
  44. // Ping specifies a list of URLs to be notified if the user follows the hyperlink.
  45. Ping(v string) HTMLA
  46. // Rel specifies the relationship between the current document and the linked document.
  47. Rel(v string) HTMLA
  48. // Role specifies to parsing software the exact function of an element (and its children).
  49. Role(v string) HTMLA
  50. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  51. Spellcheck(v bool) HTMLA
  52. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  53. Style(k, v string) HTMLA
  54. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  55. Styles(s map[string]string) HTMLA
  56. // TabIndex specifies the tabbing order of an element.
  57. TabIndex(v int) HTMLA
  58. // Target specifies the target for where to open the linked document or where to submit the form.
  59. Target(v string) HTMLA
  60. // Title specifies extra information about an element.
  61. Title(v string) HTMLA
  62. // Type specifies the type of element.
  63. Type(v string) HTMLA
  64. // On registers the given event handler to the specified event.
  65. On(event string, h EventHandler, scope ...any) HTMLA
  66. // OnBlur calls the given handler when the element loses focus.
  67. OnBlur(h EventHandler, scope ...any) HTMLA
  68. // OnChange calls the given handler when the value of the element is changed.
  69. OnChange(h EventHandler, scope ...any) HTMLA
  70. // OnClick calls the given handler when there is a mouse click on the element.
  71. OnClick(h EventHandler, scope ...any) HTMLA
  72. // OnContextMenu calls the given handler when a context menu is triggered.
  73. OnContextMenu(h EventHandler, scope ...any) HTMLA
  74. // OnCopy calls the given handler when the user copies the content of an element.
  75. OnCopy(h EventHandler, scope ...any) HTMLA
  76. // OnCut calls the given handler when the user cuts the content of an element.
  77. OnCut(h EventHandler, scope ...any) HTMLA
  78. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  79. OnDblClick(h EventHandler, scope ...any) HTMLA
  80. // OnDrag calls the given handler when an element is dragged.
  81. OnDrag(h EventHandler, scope ...any) HTMLA
  82. // OnDragEnd calls the given handler at the end of a drag operation.
  83. OnDragEnd(h EventHandler, scope ...any) HTMLA
  84. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  85. OnDragEnter(h EventHandler, scope ...any) HTMLA
  86. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  87. OnDragLeave(h EventHandler, scope ...any) HTMLA
  88. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  89. OnDragOver(h EventHandler, scope ...any) HTMLA
  90. // OnDragStart calls the given handler at the start of a drag operation.
  91. OnDragStart(h EventHandler, scope ...any) HTMLA
  92. // OnDrop calls the given handler when dragged element is being dropped.
  93. OnDrop(h EventHandler, scope ...any) HTMLA
  94. // OnFocus calls the given handler when the element gets focus.
  95. OnFocus(h EventHandler, scope ...any) HTMLA
  96. // OnInput calls the given handler when an element gets user input.
  97. OnInput(h EventHandler, scope ...any) HTMLA
  98. // OnInvalid calls the given handler when an element is invalid.
  99. OnInvalid(h EventHandler, scope ...any) HTMLA
  100. // OnKeyDown calls the given handler when a user is pressing a key.
  101. OnKeyDown(h EventHandler, scope ...any) HTMLA
  102. // OnKeyPress calls the given handler when a user presses a key.
  103. OnKeyPress(h EventHandler, scope ...any) HTMLA
  104. // OnKeyUp calls the given handler when a user releases a key.
  105. OnKeyUp(h EventHandler, scope ...any) HTMLA
  106. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  107. OnMouseDown(h EventHandler, scope ...any) HTMLA
  108. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  109. OnMouseMove(h EventHandler, scope ...any) HTMLA
  110. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  111. OnMouseOut(h EventHandler, scope ...any) HTMLA
  112. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  113. OnMouseOver(h EventHandler, scope ...any) HTMLA
  114. // OnMouseUp calls the given handler when a mouse button is released over an element.
  115. OnMouseUp(h EventHandler, scope ...any) HTMLA
  116. // OnPaste calls the given handler when the user pastes some content in an element.
  117. OnPaste(h EventHandler, scope ...any) HTMLA
  118. // OnReset calls the given handler when the Reset button in a form is clicked.
  119. OnReset(h EventHandler, scope ...any) HTMLA
  120. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  121. OnScroll(h EventHandler, scope ...any) HTMLA
  122. // OnSearch calls the given handler when the user writes something in a search field.
  123. OnSearch(h EventHandler, scope ...any) HTMLA
  124. // OnSelect calls the given handler after some text has been selected in an element.
  125. OnSelect(h EventHandler, scope ...any) HTMLA
  126. // OnSubmit calls the given handler when a form is submitted.
  127. OnSubmit(h EventHandler, scope ...any) HTMLA
  128. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  129. OnWheel(h EventHandler, scope ...any) HTMLA
  130. }
  131. // A returns an HTML element that defines a hyperlink.
  132. func A() HTMLA {
  133. e := &htmlA{
  134. htmlElement: htmlElement{
  135. tag: "a",
  136. isSelfClosing: false,
  137. },
  138. }
  139. return e
  140. }
  141. type htmlA struct {
  142. htmlElement
  143. }
  144. func (e *htmlA) Body(v ...UI) HTMLA {
  145. e.setChildren(v...)
  146. return e
  147. }
  148. func (e *htmlA) Text(v any) HTMLA {
  149. return e.Body(Text(v))
  150. }
  151. func (e *htmlA) AccessKey(v string) HTMLA {
  152. e.setAttr("accesskey", v)
  153. return e
  154. }
  155. func (e *htmlA) Aria(k string, v any) HTMLA {
  156. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  157. return e
  158. }
  159. func (e *htmlA) Attr(n string, v any) HTMLA {
  160. e.setAttr(n, v)
  161. return e
  162. }
  163. func (e *htmlA) Class(v ...string) HTMLA {
  164. e.setAttr("class", strings.Join(v, " "))
  165. return e
  166. }
  167. func (e *htmlA) ContentEditable(v bool) HTMLA {
  168. e.setAttr("contenteditable", v)
  169. return e
  170. }
  171. func (e *htmlA) DataSet(k string, v any) HTMLA {
  172. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  173. return e
  174. }
  175. func (e *htmlA) Dir(v string) HTMLA {
  176. e.setAttr("dir", v)
  177. return e
  178. }
  179. func (e *htmlA) Download(v string) HTMLA {
  180. e.setAttr("download", v)
  181. return e
  182. }
  183. func (e *htmlA) Draggable(v bool) HTMLA {
  184. e.setAttr("draggable", v)
  185. return e
  186. }
  187. func (e *htmlA) Hidden(v bool) HTMLA {
  188. e.setAttr("hidden", v)
  189. return e
  190. }
  191. func (e *htmlA) Href(v string) HTMLA {
  192. e.setAttr("href", v)
  193. return e
  194. }
  195. func (e *htmlA) HrefLang(v string) HTMLA {
  196. e.setAttr("hreflang", v)
  197. return e
  198. }
  199. func (e *htmlA) ID(v string) HTMLA {
  200. e.setAttr("id", v)
  201. return e
  202. }
  203. func (e *htmlA) Lang(v string) HTMLA {
  204. e.setAttr("lang", v)
  205. return e
  206. }
  207. func (e *htmlA) Media(v string) HTMLA {
  208. e.setAttr("media", v)
  209. return e
  210. }
  211. func (e *htmlA) Ping(v string) HTMLA {
  212. e.setAttr("ping", v)
  213. return e
  214. }
  215. func (e *htmlA) Rel(v string) HTMLA {
  216. e.setAttr("rel", v)
  217. return e
  218. }
  219. func (e *htmlA) Role(v string) HTMLA {
  220. e.setAttr("role", v)
  221. return e
  222. }
  223. func (e *htmlA) Spellcheck(v bool) HTMLA {
  224. s := "false"
  225. if v {
  226. s = "true"
  227. }
  228. e.setAttr("spellcheck", s)
  229. return e
  230. }
  231. func (e *htmlA) Style(k, v string) HTMLA {
  232. e.setAttr("style", k+":"+v)
  233. return e
  234. }
  235. func (e *htmlA) Styles(s map[string]string) HTMLA {
  236. for k, v := range s {
  237. e.Style(k, v)
  238. }
  239. return e
  240. }
  241. func (e *htmlA) TabIndex(v int) HTMLA {
  242. e.setAttr("tabindex", v)
  243. return e
  244. }
  245. func (e *htmlA) Target(v string) HTMLA {
  246. e.setAttr("target", v)
  247. return e
  248. }
  249. func (e *htmlA) Title(v string) HTMLA {
  250. e.setAttr("title", v)
  251. return e
  252. }
  253. func (e *htmlA) Type(v string) HTMLA {
  254. e.setAttr("type", v)
  255. return e
  256. }
  257. func (e *htmlA) On(event string, h EventHandler, scope ...any) HTMLA {
  258. e.setEventHandler(event, h, scope...)
  259. return e
  260. }
  261. func (e *htmlA) OnBlur(h EventHandler, scope ...any) HTMLA {
  262. e.setEventHandler("blur", h, scope...)
  263. return e
  264. }
  265. func (e *htmlA) OnChange(h EventHandler, scope ...any) HTMLA {
  266. e.setEventHandler("change", h, scope...)
  267. return e
  268. }
  269. func (e *htmlA) OnClick(h EventHandler, scope ...any) HTMLA {
  270. e.setEventHandler("click", h, scope...)
  271. return e
  272. }
  273. func (e *htmlA) OnContextMenu(h EventHandler, scope ...any) HTMLA {
  274. e.setEventHandler("contextmenu", h, scope...)
  275. return e
  276. }
  277. func (e *htmlA) OnCopy(h EventHandler, scope ...any) HTMLA {
  278. e.setEventHandler("copy", h, scope...)
  279. return e
  280. }
  281. func (e *htmlA) OnCut(h EventHandler, scope ...any) HTMLA {
  282. e.setEventHandler("cut", h, scope...)
  283. return e
  284. }
  285. func (e *htmlA) OnDblClick(h EventHandler, scope ...any) HTMLA {
  286. e.setEventHandler("dblclick", h, scope...)
  287. return e
  288. }
  289. func (e *htmlA) OnDrag(h EventHandler, scope ...any) HTMLA {
  290. e.setEventHandler("drag", h, scope...)
  291. return e
  292. }
  293. func (e *htmlA) OnDragEnd(h EventHandler, scope ...any) HTMLA {
  294. e.setEventHandler("dragend", h, scope...)
  295. return e
  296. }
  297. func (e *htmlA) OnDragEnter(h EventHandler, scope ...any) HTMLA {
  298. e.setEventHandler("dragenter", h, scope...)
  299. return e
  300. }
  301. func (e *htmlA) OnDragLeave(h EventHandler, scope ...any) HTMLA {
  302. e.setEventHandler("dragleave", h, scope...)
  303. return e
  304. }
  305. func (e *htmlA) OnDragOver(h EventHandler, scope ...any) HTMLA {
  306. e.setEventHandler("dragover", h, scope...)
  307. return e
  308. }
  309. func (e *htmlA) OnDragStart(h EventHandler, scope ...any) HTMLA {
  310. e.setEventHandler("dragstart", h, scope...)
  311. return e
  312. }
  313. func (e *htmlA) OnDrop(h EventHandler, scope ...any) HTMLA {
  314. e.setEventHandler("drop", h, scope...)
  315. return e
  316. }
  317. func (e *htmlA) OnFocus(h EventHandler, scope ...any) HTMLA {
  318. e.setEventHandler("focus", h, scope...)
  319. return e
  320. }
  321. func (e *htmlA) OnInput(h EventHandler, scope ...any) HTMLA {
  322. e.setEventHandler("input", h, scope...)
  323. return e
  324. }
  325. func (e *htmlA) OnInvalid(h EventHandler, scope ...any) HTMLA {
  326. e.setEventHandler("invalid", h, scope...)
  327. return e
  328. }
  329. func (e *htmlA) OnKeyDown(h EventHandler, scope ...any) HTMLA {
  330. e.setEventHandler("keydown", h, scope...)
  331. return e
  332. }
  333. func (e *htmlA) OnKeyPress(h EventHandler, scope ...any) HTMLA {
  334. e.setEventHandler("keypress", h, scope...)
  335. return e
  336. }
  337. func (e *htmlA) OnKeyUp(h EventHandler, scope ...any) HTMLA {
  338. e.setEventHandler("keyup", h, scope...)
  339. return e
  340. }
  341. func (e *htmlA) OnMouseDown(h EventHandler, scope ...any) HTMLA {
  342. e.setEventHandler("mousedown", h, scope...)
  343. return e
  344. }
  345. func (e *htmlA) OnMouseMove(h EventHandler, scope ...any) HTMLA {
  346. e.setEventHandler("mousemove", h, scope...)
  347. return e
  348. }
  349. func (e *htmlA) OnMouseOut(h EventHandler, scope ...any) HTMLA {
  350. e.setEventHandler("mouseout", h, scope...)
  351. return e
  352. }
  353. func (e *htmlA) OnMouseOver(h EventHandler, scope ...any) HTMLA {
  354. e.setEventHandler("mouseover", h, scope...)
  355. return e
  356. }
  357. func (e *htmlA) OnMouseUp(h EventHandler, scope ...any) HTMLA {
  358. e.setEventHandler("mouseup", h, scope...)
  359. return e
  360. }
  361. func (e *htmlA) OnPaste(h EventHandler, scope ...any) HTMLA {
  362. e.setEventHandler("paste", h, scope...)
  363. return e
  364. }
  365. func (e *htmlA) OnReset(h EventHandler, scope ...any) HTMLA {
  366. e.setEventHandler("reset", h, scope...)
  367. return e
  368. }
  369. func (e *htmlA) OnScroll(h EventHandler, scope ...any) HTMLA {
  370. e.setEventHandler("scroll", h, scope...)
  371. return e
  372. }
  373. func (e *htmlA) OnSearch(h EventHandler, scope ...any) HTMLA {
  374. e.setEventHandler("search", h, scope...)
  375. return e
  376. }
  377. func (e *htmlA) OnSelect(h EventHandler, scope ...any) HTMLA {
  378. e.setEventHandler("select", h, scope...)
  379. return e
  380. }
  381. func (e *htmlA) OnSubmit(h EventHandler, scope ...any) HTMLA {
  382. e.setEventHandler("submit", h, scope...)
  383. return e
  384. }
  385. func (e *htmlA) OnWheel(h EventHandler, scope ...any) HTMLA {
  386. e.setEventHandler("wheel", h, scope...)
  387. return e
  388. }
  389. // HTMLAbbr is the interface that describes a "abbr" HTML element.
  390. type HTMLAbbr interface {
  391. UI
  392. // Body set the content of the element.
  393. Body(elems ...UI) HTMLAbbr
  394. // Text sets the content of the element with a text node containing the stringified given value.
  395. Text(v any) HTMLAbbr
  396. // AccessKey specifies a shortcut key to activate/focus an element.
  397. AccessKey(v string) HTMLAbbr
  398. // Aria stores accessible rich internet applications (ARIA) data.
  399. Aria(k string, v any) HTMLAbbr
  400. // Attr sets the named attribute with the given value.
  401. Attr(n string, v any) HTMLAbbr
  402. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  403. Class(v ...string) HTMLAbbr
  404. // ContentEditable specifies whether the content of an element is editable or not.
  405. ContentEditable(v bool) HTMLAbbr
  406. // DataSet stores custom data private to the page or application.
  407. DataSet(k string, v any) HTMLAbbr
  408. // Dir specifies the text direction for the content in an element.
  409. Dir(v string) HTMLAbbr
  410. // Draggable specifies whether an element is draggable or not.
  411. Draggable(v bool) HTMLAbbr
  412. // Hidden specifies that an element is not yet, or is no longer relevant.
  413. Hidden(v bool) HTMLAbbr
  414. // ID specifies a unique id for an element.
  415. ID(v string) HTMLAbbr
  416. // Lang specifies the language of the element's content.
  417. Lang(v string) HTMLAbbr
  418. // Role specifies to parsing software the exact function of an element (and its children).
  419. Role(v string) HTMLAbbr
  420. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  421. Spellcheck(v bool) HTMLAbbr
  422. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  423. Style(k, v string) HTMLAbbr
  424. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  425. Styles(s map[string]string) HTMLAbbr
  426. // TabIndex specifies the tabbing order of an element.
  427. TabIndex(v int) HTMLAbbr
  428. // Title specifies extra information about an element.
  429. Title(v string) HTMLAbbr
  430. // On registers the given event handler to the specified event.
  431. On(event string, h EventHandler, scope ...any) HTMLAbbr
  432. // OnBlur calls the given handler when the element loses focus.
  433. OnBlur(h EventHandler, scope ...any) HTMLAbbr
  434. // OnChange calls the given handler when the value of the element is changed.
  435. OnChange(h EventHandler, scope ...any) HTMLAbbr
  436. // OnClick calls the given handler when there is a mouse click on the element.
  437. OnClick(h EventHandler, scope ...any) HTMLAbbr
  438. // OnContextMenu calls the given handler when a context menu is triggered.
  439. OnContextMenu(h EventHandler, scope ...any) HTMLAbbr
  440. // OnCopy calls the given handler when the user copies the content of an element.
  441. OnCopy(h EventHandler, scope ...any) HTMLAbbr
  442. // OnCut calls the given handler when the user cuts the content of an element.
  443. OnCut(h EventHandler, scope ...any) HTMLAbbr
  444. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  445. OnDblClick(h EventHandler, scope ...any) HTMLAbbr
  446. // OnDrag calls the given handler when an element is dragged.
  447. OnDrag(h EventHandler, scope ...any) HTMLAbbr
  448. // OnDragEnd calls the given handler at the end of a drag operation.
  449. OnDragEnd(h EventHandler, scope ...any) HTMLAbbr
  450. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  451. OnDragEnter(h EventHandler, scope ...any) HTMLAbbr
  452. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  453. OnDragLeave(h EventHandler, scope ...any) HTMLAbbr
  454. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  455. OnDragOver(h EventHandler, scope ...any) HTMLAbbr
  456. // OnDragStart calls the given handler at the start of a drag operation.
  457. OnDragStart(h EventHandler, scope ...any) HTMLAbbr
  458. // OnDrop calls the given handler when dragged element is being dropped.
  459. OnDrop(h EventHandler, scope ...any) HTMLAbbr
  460. // OnFocus calls the given handler when the element gets focus.
  461. OnFocus(h EventHandler, scope ...any) HTMLAbbr
  462. // OnInput calls the given handler when an element gets user input.
  463. OnInput(h EventHandler, scope ...any) HTMLAbbr
  464. // OnInvalid calls the given handler when an element is invalid.
  465. OnInvalid(h EventHandler, scope ...any) HTMLAbbr
  466. // OnKeyDown calls the given handler when a user is pressing a key.
  467. OnKeyDown(h EventHandler, scope ...any) HTMLAbbr
  468. // OnKeyPress calls the given handler when a user presses a key.
  469. OnKeyPress(h EventHandler, scope ...any) HTMLAbbr
  470. // OnKeyUp calls the given handler when a user releases a key.
  471. OnKeyUp(h EventHandler, scope ...any) HTMLAbbr
  472. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  473. OnMouseDown(h EventHandler, scope ...any) HTMLAbbr
  474. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  475. OnMouseMove(h EventHandler, scope ...any) HTMLAbbr
  476. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  477. OnMouseOut(h EventHandler, scope ...any) HTMLAbbr
  478. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  479. OnMouseOver(h EventHandler, scope ...any) HTMLAbbr
  480. // OnMouseUp calls the given handler when a mouse button is released over an element.
  481. OnMouseUp(h EventHandler, scope ...any) HTMLAbbr
  482. // OnPaste calls the given handler when the user pastes some content in an element.
  483. OnPaste(h EventHandler, scope ...any) HTMLAbbr
  484. // OnReset calls the given handler when the Reset button in a form is clicked.
  485. OnReset(h EventHandler, scope ...any) HTMLAbbr
  486. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  487. OnScroll(h EventHandler, scope ...any) HTMLAbbr
  488. // OnSearch calls the given handler when the user writes something in a search field.
  489. OnSearch(h EventHandler, scope ...any) HTMLAbbr
  490. // OnSelect calls the given handler after some text has been selected in an element.
  491. OnSelect(h EventHandler, scope ...any) HTMLAbbr
  492. // OnSubmit calls the given handler when a form is submitted.
  493. OnSubmit(h EventHandler, scope ...any) HTMLAbbr
  494. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  495. OnWheel(h EventHandler, scope ...any) HTMLAbbr
  496. }
  497. // Abbr returns an HTML element that defines an abbreviation or an acronym.
  498. func Abbr() HTMLAbbr {
  499. e := &htmlAbbr{
  500. htmlElement: htmlElement{
  501. tag: "abbr",
  502. isSelfClosing: false,
  503. },
  504. }
  505. return e
  506. }
  507. type htmlAbbr struct {
  508. htmlElement
  509. }
  510. func (e *htmlAbbr) Body(v ...UI) HTMLAbbr {
  511. e.setChildren(v...)
  512. return e
  513. }
  514. func (e *htmlAbbr) Text(v any) HTMLAbbr {
  515. return e.Body(Text(v))
  516. }
  517. func (e *htmlAbbr) AccessKey(v string) HTMLAbbr {
  518. e.setAttr("accesskey", v)
  519. return e
  520. }
  521. func (e *htmlAbbr) Aria(k string, v any) HTMLAbbr {
  522. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  523. return e
  524. }
  525. func (e *htmlAbbr) Attr(n string, v any) HTMLAbbr {
  526. e.setAttr(n, v)
  527. return e
  528. }
  529. func (e *htmlAbbr) Class(v ...string) HTMLAbbr {
  530. e.setAttr("class", strings.Join(v, " "))
  531. return e
  532. }
  533. func (e *htmlAbbr) ContentEditable(v bool) HTMLAbbr {
  534. e.setAttr("contenteditable", v)
  535. return e
  536. }
  537. func (e *htmlAbbr) DataSet(k string, v any) HTMLAbbr {
  538. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  539. return e
  540. }
  541. func (e *htmlAbbr) Dir(v string) HTMLAbbr {
  542. e.setAttr("dir", v)
  543. return e
  544. }
  545. func (e *htmlAbbr) Draggable(v bool) HTMLAbbr {
  546. e.setAttr("draggable", v)
  547. return e
  548. }
  549. func (e *htmlAbbr) Hidden(v bool) HTMLAbbr {
  550. e.setAttr("hidden", v)
  551. return e
  552. }
  553. func (e *htmlAbbr) ID(v string) HTMLAbbr {
  554. e.setAttr("id", v)
  555. return e
  556. }
  557. func (e *htmlAbbr) Lang(v string) HTMLAbbr {
  558. e.setAttr("lang", v)
  559. return e
  560. }
  561. func (e *htmlAbbr) Role(v string) HTMLAbbr {
  562. e.setAttr("role", v)
  563. return e
  564. }
  565. func (e *htmlAbbr) Spellcheck(v bool) HTMLAbbr {
  566. s := "false"
  567. if v {
  568. s = "true"
  569. }
  570. e.setAttr("spellcheck", s)
  571. return e
  572. }
  573. func (e *htmlAbbr) Style(k, v string) HTMLAbbr {
  574. e.setAttr("style", k+":"+v)
  575. return e
  576. }
  577. func (e *htmlAbbr) Styles(s map[string]string) HTMLAbbr {
  578. for k, v := range s {
  579. e.Style(k, v)
  580. }
  581. return e
  582. }
  583. func (e *htmlAbbr) TabIndex(v int) HTMLAbbr {
  584. e.setAttr("tabindex", v)
  585. return e
  586. }
  587. func (e *htmlAbbr) Title(v string) HTMLAbbr {
  588. e.setAttr("title", v)
  589. return e
  590. }
  591. func (e *htmlAbbr) On(event string, h EventHandler, scope ...any) HTMLAbbr {
  592. e.setEventHandler(event, h, scope...)
  593. return e
  594. }
  595. func (e *htmlAbbr) OnBlur(h EventHandler, scope ...any) HTMLAbbr {
  596. e.setEventHandler("blur", h, scope...)
  597. return e
  598. }
  599. func (e *htmlAbbr) OnChange(h EventHandler, scope ...any) HTMLAbbr {
  600. e.setEventHandler("change", h, scope...)
  601. return e
  602. }
  603. func (e *htmlAbbr) OnClick(h EventHandler, scope ...any) HTMLAbbr {
  604. e.setEventHandler("click", h, scope...)
  605. return e
  606. }
  607. func (e *htmlAbbr) OnContextMenu(h EventHandler, scope ...any) HTMLAbbr {
  608. e.setEventHandler("contextmenu", h, scope...)
  609. return e
  610. }
  611. func (e *htmlAbbr) OnCopy(h EventHandler, scope ...any) HTMLAbbr {
  612. e.setEventHandler("copy", h, scope...)
  613. return e
  614. }
  615. func (e *htmlAbbr) OnCut(h EventHandler, scope ...any) HTMLAbbr {
  616. e.setEventHandler("cut", h, scope...)
  617. return e
  618. }
  619. func (e *htmlAbbr) OnDblClick(h EventHandler, scope ...any) HTMLAbbr {
  620. e.setEventHandler("dblclick", h, scope...)
  621. return e
  622. }
  623. func (e *htmlAbbr) OnDrag(h EventHandler, scope ...any) HTMLAbbr {
  624. e.setEventHandler("drag", h, scope...)
  625. return e
  626. }
  627. func (e *htmlAbbr) OnDragEnd(h EventHandler, scope ...any) HTMLAbbr {
  628. e.setEventHandler("dragend", h, scope...)
  629. return e
  630. }
  631. func (e *htmlAbbr) OnDragEnter(h EventHandler, scope ...any) HTMLAbbr {
  632. e.setEventHandler("dragenter", h, scope...)
  633. return e
  634. }
  635. func (e *htmlAbbr) OnDragLeave(h EventHandler, scope ...any) HTMLAbbr {
  636. e.setEventHandler("dragleave", h, scope...)
  637. return e
  638. }
  639. func (e *htmlAbbr) OnDragOver(h EventHandler, scope ...any) HTMLAbbr {
  640. e.setEventHandler("dragover", h, scope...)
  641. return e
  642. }
  643. func (e *htmlAbbr) OnDragStart(h EventHandler, scope ...any) HTMLAbbr {
  644. e.setEventHandler("dragstart", h, scope...)
  645. return e
  646. }
  647. func (e *htmlAbbr) OnDrop(h EventHandler, scope ...any) HTMLAbbr {
  648. e.setEventHandler("drop", h, scope...)
  649. return e
  650. }
  651. func (e *htmlAbbr) OnFocus(h EventHandler, scope ...any) HTMLAbbr {
  652. e.setEventHandler("focus", h, scope...)
  653. return e
  654. }
  655. func (e *htmlAbbr) OnInput(h EventHandler, scope ...any) HTMLAbbr {
  656. e.setEventHandler("input", h, scope...)
  657. return e
  658. }
  659. func (e *htmlAbbr) OnInvalid(h EventHandler, scope ...any) HTMLAbbr {
  660. e.setEventHandler("invalid", h, scope...)
  661. return e
  662. }
  663. func (e *htmlAbbr) OnKeyDown(h EventHandler, scope ...any) HTMLAbbr {
  664. e.setEventHandler("keydown", h, scope...)
  665. return e
  666. }
  667. func (e *htmlAbbr) OnKeyPress(h EventHandler, scope ...any) HTMLAbbr {
  668. e.setEventHandler("keypress", h, scope...)
  669. return e
  670. }
  671. func (e *htmlAbbr) OnKeyUp(h EventHandler, scope ...any) HTMLAbbr {
  672. e.setEventHandler("keyup", h, scope...)
  673. return e
  674. }
  675. func (e *htmlAbbr) OnMouseDown(h EventHandler, scope ...any) HTMLAbbr {
  676. e.setEventHandler("mousedown", h, scope...)
  677. return e
  678. }
  679. func (e *htmlAbbr) OnMouseMove(h EventHandler, scope ...any) HTMLAbbr {
  680. e.setEventHandler("mousemove", h, scope...)
  681. return e
  682. }
  683. func (e *htmlAbbr) OnMouseOut(h EventHandler, scope ...any) HTMLAbbr {
  684. e.setEventHandler("mouseout", h, scope...)
  685. return e
  686. }
  687. func (e *htmlAbbr) OnMouseOver(h EventHandler, scope ...any) HTMLAbbr {
  688. e.setEventHandler("mouseover", h, scope...)
  689. return e
  690. }
  691. func (e *htmlAbbr) OnMouseUp(h EventHandler, scope ...any) HTMLAbbr {
  692. e.setEventHandler("mouseup", h, scope...)
  693. return e
  694. }
  695. func (e *htmlAbbr) OnPaste(h EventHandler, scope ...any) HTMLAbbr {
  696. e.setEventHandler("paste", h, scope...)
  697. return e
  698. }
  699. func (e *htmlAbbr) OnReset(h EventHandler, scope ...any) HTMLAbbr {
  700. e.setEventHandler("reset", h, scope...)
  701. return e
  702. }
  703. func (e *htmlAbbr) OnScroll(h EventHandler, scope ...any) HTMLAbbr {
  704. e.setEventHandler("scroll", h, scope...)
  705. return e
  706. }
  707. func (e *htmlAbbr) OnSearch(h EventHandler, scope ...any) HTMLAbbr {
  708. e.setEventHandler("search", h, scope...)
  709. return e
  710. }
  711. func (e *htmlAbbr) OnSelect(h EventHandler, scope ...any) HTMLAbbr {
  712. e.setEventHandler("select", h, scope...)
  713. return e
  714. }
  715. func (e *htmlAbbr) OnSubmit(h EventHandler, scope ...any) HTMLAbbr {
  716. e.setEventHandler("submit", h, scope...)
  717. return e
  718. }
  719. func (e *htmlAbbr) OnWheel(h EventHandler, scope ...any) HTMLAbbr {
  720. e.setEventHandler("wheel", h, scope...)
  721. return e
  722. }
  723. // HTMLAddress is the interface that describes a "address" HTML element.
  724. type HTMLAddress interface {
  725. UI
  726. // Body set the content of the element.
  727. Body(elems ...UI) HTMLAddress
  728. // Text sets the content of the element with a text node containing the stringified given value.
  729. Text(v any) HTMLAddress
  730. // AccessKey specifies a shortcut key to activate/focus an element.
  731. AccessKey(v string) HTMLAddress
  732. // Aria stores accessible rich internet applications (ARIA) data.
  733. Aria(k string, v any) HTMLAddress
  734. // Attr sets the named attribute with the given value.
  735. Attr(n string, v any) HTMLAddress
  736. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  737. Class(v ...string) HTMLAddress
  738. // ContentEditable specifies whether the content of an element is editable or not.
  739. ContentEditable(v bool) HTMLAddress
  740. // DataSet stores custom data private to the page or application.
  741. DataSet(k string, v any) HTMLAddress
  742. // Dir specifies the text direction for the content in an element.
  743. Dir(v string) HTMLAddress
  744. // Draggable specifies whether an element is draggable or not.
  745. Draggable(v bool) HTMLAddress
  746. // Hidden specifies that an element is not yet, or is no longer relevant.
  747. Hidden(v bool) HTMLAddress
  748. // ID specifies a unique id for an element.
  749. ID(v string) HTMLAddress
  750. // Lang specifies the language of the element's content.
  751. Lang(v string) HTMLAddress
  752. // Role specifies to parsing software the exact function of an element (and its children).
  753. Role(v string) HTMLAddress
  754. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  755. Spellcheck(v bool) HTMLAddress
  756. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  757. Style(k, v string) HTMLAddress
  758. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  759. Styles(s map[string]string) HTMLAddress
  760. // TabIndex specifies the tabbing order of an element.
  761. TabIndex(v int) HTMLAddress
  762. // Title specifies extra information about an element.
  763. Title(v string) HTMLAddress
  764. // On registers the given event handler to the specified event.
  765. On(event string, h EventHandler, scope ...any) HTMLAddress
  766. // OnBlur calls the given handler when the element loses focus.
  767. OnBlur(h EventHandler, scope ...any) HTMLAddress
  768. // OnChange calls the given handler when the value of the element is changed.
  769. OnChange(h EventHandler, scope ...any) HTMLAddress
  770. // OnClick calls the given handler when there is a mouse click on the element.
  771. OnClick(h EventHandler, scope ...any) HTMLAddress
  772. // OnContextMenu calls the given handler when a context menu is triggered.
  773. OnContextMenu(h EventHandler, scope ...any) HTMLAddress
  774. // OnCopy calls the given handler when the user copies the content of an element.
  775. OnCopy(h EventHandler, scope ...any) HTMLAddress
  776. // OnCut calls the given handler when the user cuts the content of an element.
  777. OnCut(h EventHandler, scope ...any) HTMLAddress
  778. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  779. OnDblClick(h EventHandler, scope ...any) HTMLAddress
  780. // OnDrag calls the given handler when an element is dragged.
  781. OnDrag(h EventHandler, scope ...any) HTMLAddress
  782. // OnDragEnd calls the given handler at the end of a drag operation.
  783. OnDragEnd(h EventHandler, scope ...any) HTMLAddress
  784. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  785. OnDragEnter(h EventHandler, scope ...any) HTMLAddress
  786. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  787. OnDragLeave(h EventHandler, scope ...any) HTMLAddress
  788. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  789. OnDragOver(h EventHandler, scope ...any) HTMLAddress
  790. // OnDragStart calls the given handler at the start of a drag operation.
  791. OnDragStart(h EventHandler, scope ...any) HTMLAddress
  792. // OnDrop calls the given handler when dragged element is being dropped.
  793. OnDrop(h EventHandler, scope ...any) HTMLAddress
  794. // OnFocus calls the given handler when the element gets focus.
  795. OnFocus(h EventHandler, scope ...any) HTMLAddress
  796. // OnInput calls the given handler when an element gets user input.
  797. OnInput(h EventHandler, scope ...any) HTMLAddress
  798. // OnInvalid calls the given handler when an element is invalid.
  799. OnInvalid(h EventHandler, scope ...any) HTMLAddress
  800. // OnKeyDown calls the given handler when a user is pressing a key.
  801. OnKeyDown(h EventHandler, scope ...any) HTMLAddress
  802. // OnKeyPress calls the given handler when a user presses a key.
  803. OnKeyPress(h EventHandler, scope ...any) HTMLAddress
  804. // OnKeyUp calls the given handler when a user releases a key.
  805. OnKeyUp(h EventHandler, scope ...any) HTMLAddress
  806. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  807. OnMouseDown(h EventHandler, scope ...any) HTMLAddress
  808. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  809. OnMouseMove(h EventHandler, scope ...any) HTMLAddress
  810. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  811. OnMouseOut(h EventHandler, scope ...any) HTMLAddress
  812. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  813. OnMouseOver(h EventHandler, scope ...any) HTMLAddress
  814. // OnMouseUp calls the given handler when a mouse button is released over an element.
  815. OnMouseUp(h EventHandler, scope ...any) HTMLAddress
  816. // OnPaste calls the given handler when the user pastes some content in an element.
  817. OnPaste(h EventHandler, scope ...any) HTMLAddress
  818. // OnReset calls the given handler when the Reset button in a form is clicked.
  819. OnReset(h EventHandler, scope ...any) HTMLAddress
  820. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  821. OnScroll(h EventHandler, scope ...any) HTMLAddress
  822. // OnSearch calls the given handler when the user writes something in a search field.
  823. OnSearch(h EventHandler, scope ...any) HTMLAddress
  824. // OnSelect calls the given handler after some text has been selected in an element.
  825. OnSelect(h EventHandler, scope ...any) HTMLAddress
  826. // OnSubmit calls the given handler when a form is submitted.
  827. OnSubmit(h EventHandler, scope ...any) HTMLAddress
  828. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  829. OnWheel(h EventHandler, scope ...any) HTMLAddress
  830. }
  831. // Address returns an HTML element that defines contact information for the author/owner of a document.
  832. func Address() HTMLAddress {
  833. e := &htmlAddress{
  834. htmlElement: htmlElement{
  835. tag: "address",
  836. isSelfClosing: false,
  837. },
  838. }
  839. return e
  840. }
  841. type htmlAddress struct {
  842. htmlElement
  843. }
  844. func (e *htmlAddress) Body(v ...UI) HTMLAddress {
  845. e.setChildren(v...)
  846. return e
  847. }
  848. func (e *htmlAddress) Text(v any) HTMLAddress {
  849. return e.Body(Text(v))
  850. }
  851. func (e *htmlAddress) AccessKey(v string) HTMLAddress {
  852. e.setAttr("accesskey", v)
  853. return e
  854. }
  855. func (e *htmlAddress) Aria(k string, v any) HTMLAddress {
  856. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  857. return e
  858. }
  859. func (e *htmlAddress) Attr(n string, v any) HTMLAddress {
  860. e.setAttr(n, v)
  861. return e
  862. }
  863. func (e *htmlAddress) Class(v ...string) HTMLAddress {
  864. e.setAttr("class", strings.Join(v, " "))
  865. return e
  866. }
  867. func (e *htmlAddress) ContentEditable(v bool) HTMLAddress {
  868. e.setAttr("contenteditable", v)
  869. return e
  870. }
  871. func (e *htmlAddress) DataSet(k string, v any) HTMLAddress {
  872. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  873. return e
  874. }
  875. func (e *htmlAddress) Dir(v string) HTMLAddress {
  876. e.setAttr("dir", v)
  877. return e
  878. }
  879. func (e *htmlAddress) Draggable(v bool) HTMLAddress {
  880. e.setAttr("draggable", v)
  881. return e
  882. }
  883. func (e *htmlAddress) Hidden(v bool) HTMLAddress {
  884. e.setAttr("hidden", v)
  885. return e
  886. }
  887. func (e *htmlAddress) ID(v string) HTMLAddress {
  888. e.setAttr("id", v)
  889. return e
  890. }
  891. func (e *htmlAddress) Lang(v string) HTMLAddress {
  892. e.setAttr("lang", v)
  893. return e
  894. }
  895. func (e *htmlAddress) Role(v string) HTMLAddress {
  896. e.setAttr("role", v)
  897. return e
  898. }
  899. func (e *htmlAddress) Spellcheck(v bool) HTMLAddress {
  900. s := "false"
  901. if v {
  902. s = "true"
  903. }
  904. e.setAttr("spellcheck", s)
  905. return e
  906. }
  907. func (e *htmlAddress) Style(k, v string) HTMLAddress {
  908. e.setAttr("style", k+":"+v)
  909. return e
  910. }
  911. func (e *htmlAddress) Styles(s map[string]string) HTMLAddress {
  912. for k, v := range s {
  913. e.Style(k, v)
  914. }
  915. return e
  916. }
  917. func (e *htmlAddress) TabIndex(v int) HTMLAddress {
  918. e.setAttr("tabindex", v)
  919. return e
  920. }
  921. func (e *htmlAddress) Title(v string) HTMLAddress {
  922. e.setAttr("title", v)
  923. return e
  924. }
  925. func (e *htmlAddress) On(event string, h EventHandler, scope ...any) HTMLAddress {
  926. e.setEventHandler(event, h, scope...)
  927. return e
  928. }
  929. func (e *htmlAddress) OnBlur(h EventHandler, scope ...any) HTMLAddress {
  930. e.setEventHandler("blur", h, scope...)
  931. return e
  932. }
  933. func (e *htmlAddress) OnChange(h EventHandler, scope ...any) HTMLAddress {
  934. e.setEventHandler("change", h, scope...)
  935. return e
  936. }
  937. func (e *htmlAddress) OnClick(h EventHandler, scope ...any) HTMLAddress {
  938. e.setEventHandler("click", h, scope...)
  939. return e
  940. }
  941. func (e *htmlAddress) OnContextMenu(h EventHandler, scope ...any) HTMLAddress {
  942. e.setEventHandler("contextmenu", h, scope...)
  943. return e
  944. }
  945. func (e *htmlAddress) OnCopy(h EventHandler, scope ...any) HTMLAddress {
  946. e.setEventHandler("copy", h, scope...)
  947. return e
  948. }
  949. func (e *htmlAddress) OnCut(h EventHandler, scope ...any) HTMLAddress {
  950. e.setEventHandler("cut", h, scope...)
  951. return e
  952. }
  953. func (e *htmlAddress) OnDblClick(h EventHandler, scope ...any) HTMLAddress {
  954. e.setEventHandler("dblclick", h, scope...)
  955. return e
  956. }
  957. func (e *htmlAddress) OnDrag(h EventHandler, scope ...any) HTMLAddress {
  958. e.setEventHandler("drag", h, scope...)
  959. return e
  960. }
  961. func (e *htmlAddress) OnDragEnd(h EventHandler, scope ...any) HTMLAddress {
  962. e.setEventHandler("dragend", h, scope...)
  963. return e
  964. }
  965. func (e *htmlAddress) OnDragEnter(h EventHandler, scope ...any) HTMLAddress {
  966. e.setEventHandler("dragenter", h, scope...)
  967. return e
  968. }
  969. func (e *htmlAddress) OnDragLeave(h EventHandler, scope ...any) HTMLAddress {
  970. e.setEventHandler("dragleave", h, scope...)
  971. return e
  972. }
  973. func (e *htmlAddress) OnDragOver(h EventHandler, scope ...any) HTMLAddress {
  974. e.setEventHandler("dragover", h, scope...)
  975. return e
  976. }
  977. func (e *htmlAddress) OnDragStart(h EventHandler, scope ...any) HTMLAddress {
  978. e.setEventHandler("dragstart", h, scope...)
  979. return e
  980. }
  981. func (e *htmlAddress) OnDrop(h EventHandler, scope ...any) HTMLAddress {
  982. e.setEventHandler("drop", h, scope...)
  983. return e
  984. }
  985. func (e *htmlAddress) OnFocus(h EventHandler, scope ...any) HTMLAddress {
  986. e.setEventHandler("focus", h, scope...)
  987. return e
  988. }
  989. func (e *htmlAddress) OnInput(h EventHandler, scope ...any) HTMLAddress {
  990. e.setEventHandler("input", h, scope...)
  991. return e
  992. }
  993. func (e *htmlAddress) OnInvalid(h EventHandler, scope ...any) HTMLAddress {
  994. e.setEventHandler("invalid", h, scope...)
  995. return e
  996. }
  997. func (e *htmlAddress) OnKeyDown(h EventHandler, scope ...any) HTMLAddress {
  998. e.setEventHandler("keydown", h, scope...)
  999. return e
  1000. }
  1001. func (e *htmlAddress) OnKeyPress(h EventHandler, scope ...any) HTMLAddress {
  1002. e.setEventHandler("keypress", h, scope...)
  1003. return e
  1004. }
  1005. func (e *htmlAddress) OnKeyUp(h EventHandler, scope ...any) HTMLAddress {
  1006. e.setEventHandler("keyup", h, scope...)
  1007. return e
  1008. }
  1009. func (e *htmlAddress) OnMouseDown(h EventHandler, scope ...any) HTMLAddress {
  1010. e.setEventHandler("mousedown", h, scope...)
  1011. return e
  1012. }
  1013. func (e *htmlAddress) OnMouseMove(h EventHandler, scope ...any) HTMLAddress {
  1014. e.setEventHandler("mousemove", h, scope...)
  1015. return e
  1016. }
  1017. func (e *htmlAddress) OnMouseOut(h EventHandler, scope ...any) HTMLAddress {
  1018. e.setEventHandler("mouseout", h, scope...)
  1019. return e
  1020. }
  1021. func (e *htmlAddress) OnMouseOver(h EventHandler, scope ...any) HTMLAddress {
  1022. e.setEventHandler("mouseover", h, scope...)
  1023. return e
  1024. }
  1025. func (e *htmlAddress) OnMouseUp(h EventHandler, scope ...any) HTMLAddress {
  1026. e.setEventHandler("mouseup", h, scope...)
  1027. return e
  1028. }
  1029. func (e *htmlAddress) OnPaste(h EventHandler, scope ...any) HTMLAddress {
  1030. e.setEventHandler("paste", h, scope...)
  1031. return e
  1032. }
  1033. func (e *htmlAddress) OnReset(h EventHandler, scope ...any) HTMLAddress {
  1034. e.setEventHandler("reset", h, scope...)
  1035. return e
  1036. }
  1037. func (e *htmlAddress) OnScroll(h EventHandler, scope ...any) HTMLAddress {
  1038. e.setEventHandler("scroll", h, scope...)
  1039. return e
  1040. }
  1041. func (e *htmlAddress) OnSearch(h EventHandler, scope ...any) HTMLAddress {
  1042. e.setEventHandler("search", h, scope...)
  1043. return e
  1044. }
  1045. func (e *htmlAddress) OnSelect(h EventHandler, scope ...any) HTMLAddress {
  1046. e.setEventHandler("select", h, scope...)
  1047. return e
  1048. }
  1049. func (e *htmlAddress) OnSubmit(h EventHandler, scope ...any) HTMLAddress {
  1050. e.setEventHandler("submit", h, scope...)
  1051. return e
  1052. }
  1053. func (e *htmlAddress) OnWheel(h EventHandler, scope ...any) HTMLAddress {
  1054. e.setEventHandler("wheel", h, scope...)
  1055. return e
  1056. }
  1057. // HTMLArea is the interface that describes a "area" HTML element.
  1058. type HTMLArea interface {
  1059. UI
  1060. // AccessKey specifies a shortcut key to activate/focus an element.
  1061. AccessKey(v string) HTMLArea
  1062. // Alt specifies an alternate text when the original element fails to display.
  1063. Alt(v string) HTMLArea
  1064. // Aria stores accessible rich internet applications (ARIA) data.
  1065. Aria(k string, v any) HTMLArea
  1066. // Attr sets the named attribute with the given value.
  1067. Attr(n string, v any) HTMLArea
  1068. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  1069. Class(v ...string) HTMLArea
  1070. // ContentEditable specifies whether the content of an element is editable or not.
  1071. ContentEditable(v bool) HTMLArea
  1072. // Coords specifies the coordinates of the area.
  1073. Coords(v string) HTMLArea
  1074. // DataSet stores custom data private to the page or application.
  1075. DataSet(k string, v any) HTMLArea
  1076. // Dir specifies the text direction for the content in an element.
  1077. Dir(v string) HTMLArea
  1078. // Download specifies that the target will be downloaded when a user clicks on the hyperlink.
  1079. Download(v string) HTMLArea
  1080. // Draggable specifies whether an element is draggable or not.
  1081. Draggable(v bool) HTMLArea
  1082. // Hidden specifies that an element is not yet, or is no longer relevant.
  1083. Hidden(v bool) HTMLArea
  1084. // Href specifies the URL of the page the link goes to.
  1085. Href(v string) HTMLArea
  1086. // HrefLang specifies the language of the linked document.
  1087. HrefLang(v string) HTMLArea
  1088. // ID specifies a unique id for an element.
  1089. ID(v string) HTMLArea
  1090. // Lang specifies the language of the element's content.
  1091. Lang(v string) HTMLArea
  1092. // Media specifies what media/device the linked document is optimized for.
  1093. Media(v string) HTMLArea
  1094. // Rel specifies the relationship between the current document and the linked document.
  1095. Rel(v string) HTMLArea
  1096. // Role specifies to parsing software the exact function of an element (and its children).
  1097. Role(v string) HTMLArea
  1098. // Shape specifies the shape of the area.
  1099. Shape(v string) HTMLArea
  1100. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  1101. Spellcheck(v bool) HTMLArea
  1102. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  1103. Style(k, v string) HTMLArea
  1104. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  1105. Styles(s map[string]string) HTMLArea
  1106. // TabIndex specifies the tabbing order of an element.
  1107. TabIndex(v int) HTMLArea
  1108. // Target specifies the target for where to open the linked document or where to submit the form.
  1109. Target(v string) HTMLArea
  1110. // Title specifies extra information about an element.
  1111. Title(v string) HTMLArea
  1112. // Type specifies the type of element.
  1113. Type(v string) HTMLArea
  1114. // On registers the given event handler to the specified event.
  1115. On(event string, h EventHandler, scope ...any) HTMLArea
  1116. // OnBlur calls the given handler when the element loses focus.
  1117. OnBlur(h EventHandler, scope ...any) HTMLArea
  1118. // OnChange calls the given handler when the value of the element is changed.
  1119. OnChange(h EventHandler, scope ...any) HTMLArea
  1120. // OnClick calls the given handler when there is a mouse click on the element.
  1121. OnClick(h EventHandler, scope ...any) HTMLArea
  1122. // OnContextMenu calls the given handler when a context menu is triggered.
  1123. OnContextMenu(h EventHandler, scope ...any) HTMLArea
  1124. // OnCopy calls the given handler when the user copies the content of an element.
  1125. OnCopy(h EventHandler, scope ...any) HTMLArea
  1126. // OnCut calls the given handler when the user cuts the content of an element.
  1127. OnCut(h EventHandler, scope ...any) HTMLArea
  1128. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  1129. OnDblClick(h EventHandler, scope ...any) HTMLArea
  1130. // OnDrag calls the given handler when an element is dragged.
  1131. OnDrag(h EventHandler, scope ...any) HTMLArea
  1132. // OnDragEnd calls the given handler at the end of a drag operation.
  1133. OnDragEnd(h EventHandler, scope ...any) HTMLArea
  1134. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  1135. OnDragEnter(h EventHandler, scope ...any) HTMLArea
  1136. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  1137. OnDragLeave(h EventHandler, scope ...any) HTMLArea
  1138. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  1139. OnDragOver(h EventHandler, scope ...any) HTMLArea
  1140. // OnDragStart calls the given handler at the start of a drag operation.
  1141. OnDragStart(h EventHandler, scope ...any) HTMLArea
  1142. // OnDrop calls the given handler when dragged element is being dropped.
  1143. OnDrop(h EventHandler, scope ...any) HTMLArea
  1144. // OnFocus calls the given handler when the element gets focus.
  1145. OnFocus(h EventHandler, scope ...any) HTMLArea
  1146. // OnInput calls the given handler when an element gets user input.
  1147. OnInput(h EventHandler, scope ...any) HTMLArea
  1148. // OnInvalid calls the given handler when an element is invalid.
  1149. OnInvalid(h EventHandler, scope ...any) HTMLArea
  1150. // OnKeyDown calls the given handler when a user is pressing a key.
  1151. OnKeyDown(h EventHandler, scope ...any) HTMLArea
  1152. // OnKeyPress calls the given handler when a user presses a key.
  1153. OnKeyPress(h EventHandler, scope ...any) HTMLArea
  1154. // OnKeyUp calls the given handler when a user releases a key.
  1155. OnKeyUp(h EventHandler, scope ...any) HTMLArea
  1156. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  1157. OnMouseDown(h EventHandler, scope ...any) HTMLArea
  1158. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  1159. OnMouseMove(h EventHandler, scope ...any) HTMLArea
  1160. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  1161. OnMouseOut(h EventHandler, scope ...any) HTMLArea
  1162. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  1163. OnMouseOver(h EventHandler, scope ...any) HTMLArea
  1164. // OnMouseUp calls the given handler when a mouse button is released over an element.
  1165. OnMouseUp(h EventHandler, scope ...any) HTMLArea
  1166. // OnPaste calls the given handler when the user pastes some content in an element.
  1167. OnPaste(h EventHandler, scope ...any) HTMLArea
  1168. // OnReset calls the given handler when the Reset button in a form is clicked.
  1169. OnReset(h EventHandler, scope ...any) HTMLArea
  1170. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  1171. OnScroll(h EventHandler, scope ...any) HTMLArea
  1172. // OnSearch calls the given handler when the user writes something in a search field.
  1173. OnSearch(h EventHandler, scope ...any) HTMLArea
  1174. // OnSelect calls the given handler after some text has been selected in an element.
  1175. OnSelect(h EventHandler, scope ...any) HTMLArea
  1176. // OnSubmit calls the given handler when a form is submitted.
  1177. OnSubmit(h EventHandler, scope ...any) HTMLArea
  1178. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  1179. OnWheel(h EventHandler, scope ...any) HTMLArea
  1180. }
  1181. // Area returns an HTML element that defines an area inside an image-map.
  1182. func Area() HTMLArea {
  1183. e := &htmlArea{
  1184. htmlElement: htmlElement{
  1185. tag: "area",
  1186. isSelfClosing: true,
  1187. },
  1188. }
  1189. return e
  1190. }
  1191. type htmlArea struct {
  1192. htmlElement
  1193. }
  1194. func (e *htmlArea) AccessKey(v string) HTMLArea {
  1195. e.setAttr("accesskey", v)
  1196. return e
  1197. }
  1198. func (e *htmlArea) Alt(v string) HTMLArea {
  1199. e.setAttr("alt", v)
  1200. return e
  1201. }
  1202. func (e *htmlArea) Aria(k string, v any) HTMLArea {
  1203. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  1204. return e
  1205. }
  1206. func (e *htmlArea) Attr(n string, v any) HTMLArea {
  1207. e.setAttr(n, v)
  1208. return e
  1209. }
  1210. func (e *htmlArea) Class(v ...string) HTMLArea {
  1211. e.setAttr("class", strings.Join(v, " "))
  1212. return e
  1213. }
  1214. func (e *htmlArea) ContentEditable(v bool) HTMLArea {
  1215. e.setAttr("contenteditable", v)
  1216. return e
  1217. }
  1218. func (e *htmlArea) Coords(v string) HTMLArea {
  1219. e.setAttr("coords", v)
  1220. return e
  1221. }
  1222. func (e *htmlArea) DataSet(k string, v any) HTMLArea {
  1223. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  1224. return e
  1225. }
  1226. func (e *htmlArea) Dir(v string) HTMLArea {
  1227. e.setAttr("dir", v)
  1228. return e
  1229. }
  1230. func (e *htmlArea) Download(v string) HTMLArea {
  1231. e.setAttr("download", v)
  1232. return e
  1233. }
  1234. func (e *htmlArea) Draggable(v bool) HTMLArea {
  1235. e.setAttr("draggable", v)
  1236. return e
  1237. }
  1238. func (e *htmlArea) Hidden(v bool) HTMLArea {
  1239. e.setAttr("hidden", v)
  1240. return e
  1241. }
  1242. func (e *htmlArea) Href(v string) HTMLArea {
  1243. e.setAttr("href", v)
  1244. return e
  1245. }
  1246. func (e *htmlArea) HrefLang(v string) HTMLArea {
  1247. e.setAttr("hreflang", v)
  1248. return e
  1249. }
  1250. func (e *htmlArea) ID(v string) HTMLArea {
  1251. e.setAttr("id", v)
  1252. return e
  1253. }
  1254. func (e *htmlArea) Lang(v string) HTMLArea {
  1255. e.setAttr("lang", v)
  1256. return e
  1257. }
  1258. func (e *htmlArea) Media(v string) HTMLArea {
  1259. e.setAttr("media", v)
  1260. return e
  1261. }
  1262. func (e *htmlArea) Rel(v string) HTMLArea {
  1263. e.setAttr("rel", v)
  1264. return e
  1265. }
  1266. func (e *htmlArea) Role(v string) HTMLArea {
  1267. e.setAttr("role", v)
  1268. return e
  1269. }
  1270. func (e *htmlArea) Shape(v string) HTMLArea {
  1271. e.setAttr("shape", v)
  1272. return e
  1273. }
  1274. func (e *htmlArea) Spellcheck(v bool) HTMLArea {
  1275. s := "false"
  1276. if v {
  1277. s = "true"
  1278. }
  1279. e.setAttr("spellcheck", s)
  1280. return e
  1281. }
  1282. func (e *htmlArea) Style(k, v string) HTMLArea {
  1283. e.setAttr("style", k+":"+v)
  1284. return e
  1285. }
  1286. func (e *htmlArea) Styles(s map[string]string) HTMLArea {
  1287. for k, v := range s {
  1288. e.Style(k, v)
  1289. }
  1290. return e
  1291. }
  1292. func (e *htmlArea) TabIndex(v int) HTMLArea {
  1293. e.setAttr("tabindex", v)
  1294. return e
  1295. }
  1296. func (e *htmlArea) Target(v string) HTMLArea {
  1297. e.setAttr("target", v)
  1298. return e
  1299. }
  1300. func (e *htmlArea) Title(v string) HTMLArea {
  1301. e.setAttr("title", v)
  1302. return e
  1303. }
  1304. func (e *htmlArea) Type(v string) HTMLArea {
  1305. e.setAttr("type", v)
  1306. return e
  1307. }
  1308. func (e *htmlArea) On(event string, h EventHandler, scope ...any) HTMLArea {
  1309. e.setEventHandler(event, h, scope...)
  1310. return e
  1311. }
  1312. func (e *htmlArea) OnBlur(h EventHandler, scope ...any) HTMLArea {
  1313. e.setEventHandler("blur", h, scope...)
  1314. return e
  1315. }
  1316. func (e *htmlArea) OnChange(h EventHandler, scope ...any) HTMLArea {
  1317. e.setEventHandler("change", h, scope...)
  1318. return e
  1319. }
  1320. func (e *htmlArea) OnClick(h EventHandler, scope ...any) HTMLArea {
  1321. e.setEventHandler("click", h, scope...)
  1322. return e
  1323. }
  1324. func (e *htmlArea) OnContextMenu(h EventHandler, scope ...any) HTMLArea {
  1325. e.setEventHandler("contextmenu", h, scope...)
  1326. return e
  1327. }
  1328. func (e *htmlArea) OnCopy(h EventHandler, scope ...any) HTMLArea {
  1329. e.setEventHandler("copy", h, scope...)
  1330. return e
  1331. }
  1332. func (e *htmlArea) OnCut(h EventHandler, scope ...any) HTMLArea {
  1333. e.setEventHandler("cut", h, scope...)
  1334. return e
  1335. }
  1336. func (e *htmlArea) OnDblClick(h EventHandler, scope ...any) HTMLArea {
  1337. e.setEventHandler("dblclick", h, scope...)
  1338. return e
  1339. }
  1340. func (e *htmlArea) OnDrag(h EventHandler, scope ...any) HTMLArea {
  1341. e.setEventHandler("drag", h, scope...)
  1342. return e
  1343. }
  1344. func (e *htmlArea) OnDragEnd(h EventHandler, scope ...any) HTMLArea {
  1345. e.setEventHandler("dragend", h, scope...)
  1346. return e
  1347. }
  1348. func (e *htmlArea) OnDragEnter(h EventHandler, scope ...any) HTMLArea {
  1349. e.setEventHandler("dragenter", h, scope...)
  1350. return e
  1351. }
  1352. func (e *htmlArea) OnDragLeave(h EventHandler, scope ...any) HTMLArea {
  1353. e.setEventHandler("dragleave", h, scope...)
  1354. return e
  1355. }
  1356. func (e *htmlArea) OnDragOver(h EventHandler, scope ...any) HTMLArea {
  1357. e.setEventHandler("dragover", h, scope...)
  1358. return e
  1359. }
  1360. func (e *htmlArea) OnDragStart(h EventHandler, scope ...any) HTMLArea {
  1361. e.setEventHandler("dragstart", h, scope...)
  1362. return e
  1363. }
  1364. func (e *htmlArea) OnDrop(h EventHandler, scope ...any) HTMLArea {
  1365. e.setEventHandler("drop", h, scope...)
  1366. return e
  1367. }
  1368. func (e *htmlArea) OnFocus(h EventHandler, scope ...any) HTMLArea {
  1369. e.setEventHandler("focus", h, scope...)
  1370. return e
  1371. }
  1372. func (e *htmlArea) OnInput(h EventHandler, scope ...any) HTMLArea {
  1373. e.setEventHandler("input", h, scope...)
  1374. return e
  1375. }
  1376. func (e *htmlArea) OnInvalid(h EventHandler, scope ...any) HTMLArea {
  1377. e.setEventHandler("invalid", h, scope...)
  1378. return e
  1379. }
  1380. func (e *htmlArea) OnKeyDown(h EventHandler, scope ...any) HTMLArea {
  1381. e.setEventHandler("keydown", h, scope...)
  1382. return e
  1383. }
  1384. func (e *htmlArea) OnKeyPress(h EventHandler, scope ...any) HTMLArea {
  1385. e.setEventHandler("keypress", h, scope...)
  1386. return e
  1387. }
  1388. func (e *htmlArea) OnKeyUp(h EventHandler, scope ...any) HTMLArea {
  1389. e.setEventHandler("keyup", h, scope...)
  1390. return e
  1391. }
  1392. func (e *htmlArea) OnMouseDown(h EventHandler, scope ...any) HTMLArea {
  1393. e.setEventHandler("mousedown", h, scope...)
  1394. return e
  1395. }
  1396. func (e *htmlArea) OnMouseMove(h EventHandler, scope ...any) HTMLArea {
  1397. e.setEventHandler("mousemove", h, scope...)
  1398. return e
  1399. }
  1400. func (e *htmlArea) OnMouseOut(h EventHandler, scope ...any) HTMLArea {
  1401. e.setEventHandler("mouseout", h, scope...)
  1402. return e
  1403. }
  1404. func (e *htmlArea) OnMouseOver(h EventHandler, scope ...any) HTMLArea {
  1405. e.setEventHandler("mouseover", h, scope...)
  1406. return e
  1407. }
  1408. func (e *htmlArea) OnMouseUp(h EventHandler, scope ...any) HTMLArea {
  1409. e.setEventHandler("mouseup", h, scope...)
  1410. return e
  1411. }
  1412. func (e *htmlArea) OnPaste(h EventHandler, scope ...any) HTMLArea {
  1413. e.setEventHandler("paste", h, scope...)
  1414. return e
  1415. }
  1416. func (e *htmlArea) OnReset(h EventHandler, scope ...any) HTMLArea {
  1417. e.setEventHandler("reset", h, scope...)
  1418. return e
  1419. }
  1420. func (e *htmlArea) OnScroll(h EventHandler, scope ...any) HTMLArea {
  1421. e.setEventHandler("scroll", h, scope...)
  1422. return e
  1423. }
  1424. func (e *htmlArea) OnSearch(h EventHandler, scope ...any) HTMLArea {
  1425. e.setEventHandler("search", h, scope...)
  1426. return e
  1427. }
  1428. func (e *htmlArea) OnSelect(h EventHandler, scope ...any) HTMLArea {
  1429. e.setEventHandler("select", h, scope...)
  1430. return e
  1431. }
  1432. func (e *htmlArea) OnSubmit(h EventHandler, scope ...any) HTMLArea {
  1433. e.setEventHandler("submit", h, scope...)
  1434. return e
  1435. }
  1436. func (e *htmlArea) OnWheel(h EventHandler, scope ...any) HTMLArea {
  1437. e.setEventHandler("wheel", h, scope...)
  1438. return e
  1439. }
  1440. // HTMLArticle is the interface that describes a "article" HTML element.
  1441. type HTMLArticle interface {
  1442. UI
  1443. // Body set the content of the element.
  1444. Body(elems ...UI) HTMLArticle
  1445. // Text sets the content of the element with a text node containing the stringified given value.
  1446. Text(v any) HTMLArticle
  1447. // AccessKey specifies a shortcut key to activate/focus an element.
  1448. AccessKey(v string) HTMLArticle
  1449. // Aria stores accessible rich internet applications (ARIA) data.
  1450. Aria(k string, v any) HTMLArticle
  1451. // Attr sets the named attribute with the given value.
  1452. Attr(n string, v any) HTMLArticle
  1453. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  1454. Class(v ...string) HTMLArticle
  1455. // ContentEditable specifies whether the content of an element is editable or not.
  1456. ContentEditable(v bool) HTMLArticle
  1457. // DataSet stores custom data private to the page or application.
  1458. DataSet(k string, v any) HTMLArticle
  1459. // Dir specifies the text direction for the content in an element.
  1460. Dir(v string) HTMLArticle
  1461. // Draggable specifies whether an element is draggable or not.
  1462. Draggable(v bool) HTMLArticle
  1463. // Hidden specifies that an element is not yet, or is no longer relevant.
  1464. Hidden(v bool) HTMLArticle
  1465. // ID specifies a unique id for an element.
  1466. ID(v string) HTMLArticle
  1467. // Lang specifies the language of the element's content.
  1468. Lang(v string) HTMLArticle
  1469. // Role specifies to parsing software the exact function of an element (and its children).
  1470. Role(v string) HTMLArticle
  1471. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  1472. Spellcheck(v bool) HTMLArticle
  1473. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  1474. Style(k, v string) HTMLArticle
  1475. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  1476. Styles(s map[string]string) HTMLArticle
  1477. // TabIndex specifies the tabbing order of an element.
  1478. TabIndex(v int) HTMLArticle
  1479. // Title specifies extra information about an element.
  1480. Title(v string) HTMLArticle
  1481. // On registers the given event handler to the specified event.
  1482. On(event string, h EventHandler, scope ...any) HTMLArticle
  1483. // OnBlur calls the given handler when the element loses focus.
  1484. OnBlur(h EventHandler, scope ...any) HTMLArticle
  1485. // OnChange calls the given handler when the value of the element is changed.
  1486. OnChange(h EventHandler, scope ...any) HTMLArticle
  1487. // OnClick calls the given handler when there is a mouse click on the element.
  1488. OnClick(h EventHandler, scope ...any) HTMLArticle
  1489. // OnContextMenu calls the given handler when a context menu is triggered.
  1490. OnContextMenu(h EventHandler, scope ...any) HTMLArticle
  1491. // OnCopy calls the given handler when the user copies the content of an element.
  1492. OnCopy(h EventHandler, scope ...any) HTMLArticle
  1493. // OnCut calls the given handler when the user cuts the content of an element.
  1494. OnCut(h EventHandler, scope ...any) HTMLArticle
  1495. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  1496. OnDblClick(h EventHandler, scope ...any) HTMLArticle
  1497. // OnDrag calls the given handler when an element is dragged.
  1498. OnDrag(h EventHandler, scope ...any) HTMLArticle
  1499. // OnDragEnd calls the given handler at the end of a drag operation.
  1500. OnDragEnd(h EventHandler, scope ...any) HTMLArticle
  1501. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  1502. OnDragEnter(h EventHandler, scope ...any) HTMLArticle
  1503. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  1504. OnDragLeave(h EventHandler, scope ...any) HTMLArticle
  1505. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  1506. OnDragOver(h EventHandler, scope ...any) HTMLArticle
  1507. // OnDragStart calls the given handler at the start of a drag operation.
  1508. OnDragStart(h EventHandler, scope ...any) HTMLArticle
  1509. // OnDrop calls the given handler when dragged element is being dropped.
  1510. OnDrop(h EventHandler, scope ...any) HTMLArticle
  1511. // OnFocus calls the given handler when the element gets focus.
  1512. OnFocus(h EventHandler, scope ...any) HTMLArticle
  1513. // OnInput calls the given handler when an element gets user input.
  1514. OnInput(h EventHandler, scope ...any) HTMLArticle
  1515. // OnInvalid calls the given handler when an element is invalid.
  1516. OnInvalid(h EventHandler, scope ...any) HTMLArticle
  1517. // OnKeyDown calls the given handler when a user is pressing a key.
  1518. OnKeyDown(h EventHandler, scope ...any) HTMLArticle
  1519. // OnKeyPress calls the given handler when a user presses a key.
  1520. OnKeyPress(h EventHandler, scope ...any) HTMLArticle
  1521. // OnKeyUp calls the given handler when a user releases a key.
  1522. OnKeyUp(h EventHandler, scope ...any) HTMLArticle
  1523. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  1524. OnMouseDown(h EventHandler, scope ...any) HTMLArticle
  1525. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  1526. OnMouseMove(h EventHandler, scope ...any) HTMLArticle
  1527. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  1528. OnMouseOut(h EventHandler, scope ...any) HTMLArticle
  1529. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  1530. OnMouseOver(h EventHandler, scope ...any) HTMLArticle
  1531. // OnMouseUp calls the given handler when a mouse button is released over an element.
  1532. OnMouseUp(h EventHandler, scope ...any) HTMLArticle
  1533. // OnPaste calls the given handler when the user pastes some content in an element.
  1534. OnPaste(h EventHandler, scope ...any) HTMLArticle
  1535. // OnReset calls the given handler when the Reset button in a form is clicked.
  1536. OnReset(h EventHandler, scope ...any) HTMLArticle
  1537. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  1538. OnScroll(h EventHandler, scope ...any) HTMLArticle
  1539. // OnSearch calls the given handler when the user writes something in a search field.
  1540. OnSearch(h EventHandler, scope ...any) HTMLArticle
  1541. // OnSelect calls the given handler after some text has been selected in an element.
  1542. OnSelect(h EventHandler, scope ...any) HTMLArticle
  1543. // OnSubmit calls the given handler when a form is submitted.
  1544. OnSubmit(h EventHandler, scope ...any) HTMLArticle
  1545. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  1546. OnWheel(h EventHandler, scope ...any) HTMLArticle
  1547. }
  1548. // Article returns an HTML element that defines an article.
  1549. func Article() HTMLArticle {
  1550. e := &htmlArticle{
  1551. htmlElement: htmlElement{
  1552. tag: "article",
  1553. isSelfClosing: false,
  1554. },
  1555. }
  1556. return e
  1557. }
  1558. type htmlArticle struct {
  1559. htmlElement
  1560. }
  1561. func (e *htmlArticle) Body(v ...UI) HTMLArticle {
  1562. e.setChildren(v...)
  1563. return e
  1564. }
  1565. func (e *htmlArticle) Text(v any) HTMLArticle {
  1566. return e.Body(Text(v))
  1567. }
  1568. func (e *htmlArticle) AccessKey(v string) HTMLArticle {
  1569. e.setAttr("accesskey", v)
  1570. return e
  1571. }
  1572. func (e *htmlArticle) Aria(k string, v any) HTMLArticle {
  1573. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  1574. return e
  1575. }
  1576. func (e *htmlArticle) Attr(n string, v any) HTMLArticle {
  1577. e.setAttr(n, v)
  1578. return e
  1579. }
  1580. func (e *htmlArticle) Class(v ...string) HTMLArticle {
  1581. e.setAttr("class", strings.Join(v, " "))
  1582. return e
  1583. }
  1584. func (e *htmlArticle) ContentEditable(v bool) HTMLArticle {
  1585. e.setAttr("contenteditable", v)
  1586. return e
  1587. }
  1588. func (e *htmlArticle) DataSet(k string, v any) HTMLArticle {
  1589. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  1590. return e
  1591. }
  1592. func (e *htmlArticle) Dir(v string) HTMLArticle {
  1593. e.setAttr("dir", v)
  1594. return e
  1595. }
  1596. func (e *htmlArticle) Draggable(v bool) HTMLArticle {
  1597. e.setAttr("draggable", v)
  1598. return e
  1599. }
  1600. func (e *htmlArticle) Hidden(v bool) HTMLArticle {
  1601. e.setAttr("hidden", v)
  1602. return e
  1603. }
  1604. func (e *htmlArticle) ID(v string) HTMLArticle {
  1605. e.setAttr("id", v)
  1606. return e
  1607. }
  1608. func (e *htmlArticle) Lang(v string) HTMLArticle {
  1609. e.setAttr("lang", v)
  1610. return e
  1611. }
  1612. func (e *htmlArticle) Role(v string) HTMLArticle {
  1613. e.setAttr("role", v)
  1614. return e
  1615. }
  1616. func (e *htmlArticle) Spellcheck(v bool) HTMLArticle {
  1617. s := "false"
  1618. if v {
  1619. s = "true"
  1620. }
  1621. e.setAttr("spellcheck", s)
  1622. return e
  1623. }
  1624. func (e *htmlArticle) Style(k, v string) HTMLArticle {
  1625. e.setAttr("style", k+":"+v)
  1626. return e
  1627. }
  1628. func (e *htmlArticle) Styles(s map[string]string) HTMLArticle {
  1629. for k, v := range s {
  1630. e.Style(k, v)
  1631. }
  1632. return e
  1633. }
  1634. func (e *htmlArticle) TabIndex(v int) HTMLArticle {
  1635. e.setAttr("tabindex", v)
  1636. return e
  1637. }
  1638. func (e *htmlArticle) Title(v string) HTMLArticle {
  1639. e.setAttr("title", v)
  1640. return e
  1641. }
  1642. func (e *htmlArticle) On(event string, h EventHandler, scope ...any) HTMLArticle {
  1643. e.setEventHandler(event, h, scope...)
  1644. return e
  1645. }
  1646. func (e *htmlArticle) OnBlur(h EventHandler, scope ...any) HTMLArticle {
  1647. e.setEventHandler("blur", h, scope...)
  1648. return e
  1649. }
  1650. func (e *htmlArticle) OnChange(h EventHandler, scope ...any) HTMLArticle {
  1651. e.setEventHandler("change", h, scope...)
  1652. return e
  1653. }
  1654. func (e *htmlArticle) OnClick(h EventHandler, scope ...any) HTMLArticle {
  1655. e.setEventHandler("click", h, scope...)
  1656. return e
  1657. }
  1658. func (e *htmlArticle) OnContextMenu(h EventHandler, scope ...any) HTMLArticle {
  1659. e.setEventHandler("contextmenu", h, scope...)
  1660. return e
  1661. }
  1662. func (e *htmlArticle) OnCopy(h EventHandler, scope ...any) HTMLArticle {
  1663. e.setEventHandler("copy", h, scope...)
  1664. return e
  1665. }
  1666. func (e *htmlArticle) OnCut(h EventHandler, scope ...any) HTMLArticle {
  1667. e.setEventHandler("cut", h, scope...)
  1668. return e
  1669. }
  1670. func (e *htmlArticle) OnDblClick(h EventHandler, scope ...any) HTMLArticle {
  1671. e.setEventHandler("dblclick", h, scope...)
  1672. return e
  1673. }
  1674. func (e *htmlArticle) OnDrag(h EventHandler, scope ...any) HTMLArticle {
  1675. e.setEventHandler("drag", h, scope...)
  1676. return e
  1677. }
  1678. func (e *htmlArticle) OnDragEnd(h EventHandler, scope ...any) HTMLArticle {
  1679. e.setEventHandler("dragend", h, scope...)
  1680. return e
  1681. }
  1682. func (e *htmlArticle) OnDragEnter(h EventHandler, scope ...any) HTMLArticle {
  1683. e.setEventHandler("dragenter", h, scope...)
  1684. return e
  1685. }
  1686. func (e *htmlArticle) OnDragLeave(h EventHandler, scope ...any) HTMLArticle {
  1687. e.setEventHandler("dragleave", h, scope...)
  1688. return e
  1689. }
  1690. func (e *htmlArticle) OnDragOver(h EventHandler, scope ...any) HTMLArticle {
  1691. e.setEventHandler("dragover", h, scope...)
  1692. return e
  1693. }
  1694. func (e *htmlArticle) OnDragStart(h EventHandler, scope ...any) HTMLArticle {
  1695. e.setEventHandler("dragstart", h, scope...)
  1696. return e
  1697. }
  1698. func (e *htmlArticle) OnDrop(h EventHandler, scope ...any) HTMLArticle {
  1699. e.setEventHandler("drop", h, scope...)
  1700. return e
  1701. }
  1702. func (e *htmlArticle) OnFocus(h EventHandler, scope ...any) HTMLArticle {
  1703. e.setEventHandler("focus", h, scope...)
  1704. return e
  1705. }
  1706. func (e *htmlArticle) OnInput(h EventHandler, scope ...any) HTMLArticle {
  1707. e.setEventHandler("input", h, scope...)
  1708. return e
  1709. }
  1710. func (e *htmlArticle) OnInvalid(h EventHandler, scope ...any) HTMLArticle {
  1711. e.setEventHandler("invalid", h, scope...)
  1712. return e
  1713. }
  1714. func (e *htmlArticle) OnKeyDown(h EventHandler, scope ...any) HTMLArticle {
  1715. e.setEventHandler("keydown", h, scope...)
  1716. return e
  1717. }
  1718. func (e *htmlArticle) OnKeyPress(h EventHandler, scope ...any) HTMLArticle {
  1719. e.setEventHandler("keypress", h, scope...)
  1720. return e
  1721. }
  1722. func (e *htmlArticle) OnKeyUp(h EventHandler, scope ...any) HTMLArticle {
  1723. e.setEventHandler("keyup", h, scope...)
  1724. return e
  1725. }
  1726. func (e *htmlArticle) OnMouseDown(h EventHandler, scope ...any) HTMLArticle {
  1727. e.setEventHandler("mousedown", h, scope...)
  1728. return e
  1729. }
  1730. func (e *htmlArticle) OnMouseMove(h EventHandler, scope ...any) HTMLArticle {
  1731. e.setEventHandler("mousemove", h, scope...)
  1732. return e
  1733. }
  1734. func (e *htmlArticle) OnMouseOut(h EventHandler, scope ...any) HTMLArticle {
  1735. e.setEventHandler("mouseout", h, scope...)
  1736. return e
  1737. }
  1738. func (e *htmlArticle) OnMouseOver(h EventHandler, scope ...any) HTMLArticle {
  1739. e.setEventHandler("mouseover", h, scope...)
  1740. return e
  1741. }
  1742. func (e *htmlArticle) OnMouseUp(h EventHandler, scope ...any) HTMLArticle {
  1743. e.setEventHandler("mouseup", h, scope...)
  1744. return e
  1745. }
  1746. func (e *htmlArticle) OnPaste(h EventHandler, scope ...any) HTMLArticle {
  1747. e.setEventHandler("paste", h, scope...)
  1748. return e
  1749. }
  1750. func (e *htmlArticle) OnReset(h EventHandler, scope ...any) HTMLArticle {
  1751. e.setEventHandler("reset", h, scope...)
  1752. return e
  1753. }
  1754. func (e *htmlArticle) OnScroll(h EventHandler, scope ...any) HTMLArticle {
  1755. e.setEventHandler("scroll", h, scope...)
  1756. return e
  1757. }
  1758. func (e *htmlArticle) OnSearch(h EventHandler, scope ...any) HTMLArticle {
  1759. e.setEventHandler("search", h, scope...)
  1760. return e
  1761. }
  1762. func (e *htmlArticle) OnSelect(h EventHandler, scope ...any) HTMLArticle {
  1763. e.setEventHandler("select", h, scope...)
  1764. return e
  1765. }
  1766. func (e *htmlArticle) OnSubmit(h EventHandler, scope ...any) HTMLArticle {
  1767. e.setEventHandler("submit", h, scope...)
  1768. return e
  1769. }
  1770. func (e *htmlArticle) OnWheel(h EventHandler, scope ...any) HTMLArticle {
  1771. e.setEventHandler("wheel", h, scope...)
  1772. return e
  1773. }
  1774. // HTMLAside is the interface that describes a "aside" HTML element.
  1775. type HTMLAside interface {
  1776. UI
  1777. // Body set the content of the element.
  1778. Body(elems ...UI) HTMLAside
  1779. // Text sets the content of the element with a text node containing the stringified given value.
  1780. Text(v any) HTMLAside
  1781. // AccessKey specifies a shortcut key to activate/focus an element.
  1782. AccessKey(v string) HTMLAside
  1783. // Aria stores accessible rich internet applications (ARIA) data.
  1784. Aria(k string, v any) HTMLAside
  1785. // Attr sets the named attribute with the given value.
  1786. Attr(n string, v any) HTMLAside
  1787. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  1788. Class(v ...string) HTMLAside
  1789. // ContentEditable specifies whether the content of an element is editable or not.
  1790. ContentEditable(v bool) HTMLAside
  1791. // DataSet stores custom data private to the page or application.
  1792. DataSet(k string, v any) HTMLAside
  1793. // Dir specifies the text direction for the content in an element.
  1794. Dir(v string) HTMLAside
  1795. // Draggable specifies whether an element is draggable or not.
  1796. Draggable(v bool) HTMLAside
  1797. // Hidden specifies that an element is not yet, or is no longer relevant.
  1798. Hidden(v bool) HTMLAside
  1799. // ID specifies a unique id for an element.
  1800. ID(v string) HTMLAside
  1801. // Lang specifies the language of the element's content.
  1802. Lang(v string) HTMLAside
  1803. // Role specifies to parsing software the exact function of an element (and its children).
  1804. Role(v string) HTMLAside
  1805. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  1806. Spellcheck(v bool) HTMLAside
  1807. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  1808. Style(k, v string) HTMLAside
  1809. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  1810. Styles(s map[string]string) HTMLAside
  1811. // TabIndex specifies the tabbing order of an element.
  1812. TabIndex(v int) HTMLAside
  1813. // Title specifies extra information about an element.
  1814. Title(v string) HTMLAside
  1815. // On registers the given event handler to the specified event.
  1816. On(event string, h EventHandler, scope ...any) HTMLAside
  1817. // OnBlur calls the given handler when the element loses focus.
  1818. OnBlur(h EventHandler, scope ...any) HTMLAside
  1819. // OnChange calls the given handler when the value of the element is changed.
  1820. OnChange(h EventHandler, scope ...any) HTMLAside
  1821. // OnClick calls the given handler when there is a mouse click on the element.
  1822. OnClick(h EventHandler, scope ...any) HTMLAside
  1823. // OnContextMenu calls the given handler when a context menu is triggered.
  1824. OnContextMenu(h EventHandler, scope ...any) HTMLAside
  1825. // OnCopy calls the given handler when the user copies the content of an element.
  1826. OnCopy(h EventHandler, scope ...any) HTMLAside
  1827. // OnCut calls the given handler when the user cuts the content of an element.
  1828. OnCut(h EventHandler, scope ...any) HTMLAside
  1829. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  1830. OnDblClick(h EventHandler, scope ...any) HTMLAside
  1831. // OnDrag calls the given handler when an element is dragged.
  1832. OnDrag(h EventHandler, scope ...any) HTMLAside
  1833. // OnDragEnd calls the given handler at the end of a drag operation.
  1834. OnDragEnd(h EventHandler, scope ...any) HTMLAside
  1835. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  1836. OnDragEnter(h EventHandler, scope ...any) HTMLAside
  1837. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  1838. OnDragLeave(h EventHandler, scope ...any) HTMLAside
  1839. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  1840. OnDragOver(h EventHandler, scope ...any) HTMLAside
  1841. // OnDragStart calls the given handler at the start of a drag operation.
  1842. OnDragStart(h EventHandler, scope ...any) HTMLAside
  1843. // OnDrop calls the given handler when dragged element is being dropped.
  1844. OnDrop(h EventHandler, scope ...any) HTMLAside
  1845. // OnFocus calls the given handler when the element gets focus.
  1846. OnFocus(h EventHandler, scope ...any) HTMLAside
  1847. // OnInput calls the given handler when an element gets user input.
  1848. OnInput(h EventHandler, scope ...any) HTMLAside
  1849. // OnInvalid calls the given handler when an element is invalid.
  1850. OnInvalid(h EventHandler, scope ...any) HTMLAside
  1851. // OnKeyDown calls the given handler when a user is pressing a key.
  1852. OnKeyDown(h EventHandler, scope ...any) HTMLAside
  1853. // OnKeyPress calls the given handler when a user presses a key.
  1854. OnKeyPress(h EventHandler, scope ...any) HTMLAside
  1855. // OnKeyUp calls the given handler when a user releases a key.
  1856. OnKeyUp(h EventHandler, scope ...any) HTMLAside
  1857. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  1858. OnMouseDown(h EventHandler, scope ...any) HTMLAside
  1859. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  1860. OnMouseMove(h EventHandler, scope ...any) HTMLAside
  1861. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  1862. OnMouseOut(h EventHandler, scope ...any) HTMLAside
  1863. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  1864. OnMouseOver(h EventHandler, scope ...any) HTMLAside
  1865. // OnMouseUp calls the given handler when a mouse button is released over an element.
  1866. OnMouseUp(h EventHandler, scope ...any) HTMLAside
  1867. // OnPaste calls the given handler when the user pastes some content in an element.
  1868. OnPaste(h EventHandler, scope ...any) HTMLAside
  1869. // OnReset calls the given handler when the Reset button in a form is clicked.
  1870. OnReset(h EventHandler, scope ...any) HTMLAside
  1871. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  1872. OnScroll(h EventHandler, scope ...any) HTMLAside
  1873. // OnSearch calls the given handler when the user writes something in a search field.
  1874. OnSearch(h EventHandler, scope ...any) HTMLAside
  1875. // OnSelect calls the given handler after some text has been selected in an element.
  1876. OnSelect(h EventHandler, scope ...any) HTMLAside
  1877. // OnSubmit calls the given handler when a form is submitted.
  1878. OnSubmit(h EventHandler, scope ...any) HTMLAside
  1879. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  1880. OnWheel(h EventHandler, scope ...any) HTMLAside
  1881. }
  1882. // Aside returns an HTML element that defines content aside from the page content.
  1883. func Aside() HTMLAside {
  1884. e := &htmlAside{
  1885. htmlElement: htmlElement{
  1886. tag: "aside",
  1887. isSelfClosing: false,
  1888. },
  1889. }
  1890. return e
  1891. }
  1892. type htmlAside struct {
  1893. htmlElement
  1894. }
  1895. func (e *htmlAside) Body(v ...UI) HTMLAside {
  1896. e.setChildren(v...)
  1897. return e
  1898. }
  1899. func (e *htmlAside) Text(v any) HTMLAside {
  1900. return e.Body(Text(v))
  1901. }
  1902. func (e *htmlAside) AccessKey(v string) HTMLAside {
  1903. e.setAttr("accesskey", v)
  1904. return e
  1905. }
  1906. func (e *htmlAside) Aria(k string, v any) HTMLAside {
  1907. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  1908. return e
  1909. }
  1910. func (e *htmlAside) Attr(n string, v any) HTMLAside {
  1911. e.setAttr(n, v)
  1912. return e
  1913. }
  1914. func (e *htmlAside) Class(v ...string) HTMLAside {
  1915. e.setAttr("class", strings.Join(v, " "))
  1916. return e
  1917. }
  1918. func (e *htmlAside) ContentEditable(v bool) HTMLAside {
  1919. e.setAttr("contenteditable", v)
  1920. return e
  1921. }
  1922. func (e *htmlAside) DataSet(k string, v any) HTMLAside {
  1923. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  1924. return e
  1925. }
  1926. func (e *htmlAside) Dir(v string) HTMLAside {
  1927. e.setAttr("dir", v)
  1928. return e
  1929. }
  1930. func (e *htmlAside) Draggable(v bool) HTMLAside {
  1931. e.setAttr("draggable", v)
  1932. return e
  1933. }
  1934. func (e *htmlAside) Hidden(v bool) HTMLAside {
  1935. e.setAttr("hidden", v)
  1936. return e
  1937. }
  1938. func (e *htmlAside) ID(v string) HTMLAside {
  1939. e.setAttr("id", v)
  1940. return e
  1941. }
  1942. func (e *htmlAside) Lang(v string) HTMLAside {
  1943. e.setAttr("lang", v)
  1944. return e
  1945. }
  1946. func (e *htmlAside) Role(v string) HTMLAside {
  1947. e.setAttr("role", v)
  1948. return e
  1949. }
  1950. func (e *htmlAside) Spellcheck(v bool) HTMLAside {
  1951. s := "false"
  1952. if v {
  1953. s = "true"
  1954. }
  1955. e.setAttr("spellcheck", s)
  1956. return e
  1957. }
  1958. func (e *htmlAside) Style(k, v string) HTMLAside {
  1959. e.setAttr("style", k+":"+v)
  1960. return e
  1961. }
  1962. func (e *htmlAside) Styles(s map[string]string) HTMLAside {
  1963. for k, v := range s {
  1964. e.Style(k, v)
  1965. }
  1966. return e
  1967. }
  1968. func (e *htmlAside) TabIndex(v int) HTMLAside {
  1969. e.setAttr("tabindex", v)
  1970. return e
  1971. }
  1972. func (e *htmlAside) Title(v string) HTMLAside {
  1973. e.setAttr("title", v)
  1974. return e
  1975. }
  1976. func (e *htmlAside) On(event string, h EventHandler, scope ...any) HTMLAside {
  1977. e.setEventHandler(event, h, scope...)
  1978. return e
  1979. }
  1980. func (e *htmlAside) OnBlur(h EventHandler, scope ...any) HTMLAside {
  1981. e.setEventHandler("blur", h, scope...)
  1982. return e
  1983. }
  1984. func (e *htmlAside) OnChange(h EventHandler, scope ...any) HTMLAside {
  1985. e.setEventHandler("change", h, scope...)
  1986. return e
  1987. }
  1988. func (e *htmlAside) OnClick(h EventHandler, scope ...any) HTMLAside {
  1989. e.setEventHandler("click", h, scope...)
  1990. return e
  1991. }
  1992. func (e *htmlAside) OnContextMenu(h EventHandler, scope ...any) HTMLAside {
  1993. e.setEventHandler("contextmenu", h, scope...)
  1994. return e
  1995. }
  1996. func (e *htmlAside) OnCopy(h EventHandler, scope ...any) HTMLAside {
  1997. e.setEventHandler("copy", h, scope...)
  1998. return e
  1999. }
  2000. func (e *htmlAside) OnCut(h EventHandler, scope ...any) HTMLAside {
  2001. e.setEventHandler("cut", h, scope...)
  2002. return e
  2003. }
  2004. func (e *htmlAside) OnDblClick(h EventHandler, scope ...any) HTMLAside {
  2005. e.setEventHandler("dblclick", h, scope...)
  2006. return e
  2007. }
  2008. func (e *htmlAside) OnDrag(h EventHandler, scope ...any) HTMLAside {
  2009. e.setEventHandler("drag", h, scope...)
  2010. return e
  2011. }
  2012. func (e *htmlAside) OnDragEnd(h EventHandler, scope ...any) HTMLAside {
  2013. e.setEventHandler("dragend", h, scope...)
  2014. return e
  2015. }
  2016. func (e *htmlAside) OnDragEnter(h EventHandler, scope ...any) HTMLAside {
  2017. e.setEventHandler("dragenter", h, scope...)
  2018. return e
  2019. }
  2020. func (e *htmlAside) OnDragLeave(h EventHandler, scope ...any) HTMLAside {
  2021. e.setEventHandler("dragleave", h, scope...)
  2022. return e
  2023. }
  2024. func (e *htmlAside) OnDragOver(h EventHandler, scope ...any) HTMLAside {
  2025. e.setEventHandler("dragover", h, scope...)
  2026. return e
  2027. }
  2028. func (e *htmlAside) OnDragStart(h EventHandler, scope ...any) HTMLAside {
  2029. e.setEventHandler("dragstart", h, scope...)
  2030. return e
  2031. }
  2032. func (e *htmlAside) OnDrop(h EventHandler, scope ...any) HTMLAside {
  2033. e.setEventHandler("drop", h, scope...)
  2034. return e
  2035. }
  2036. func (e *htmlAside) OnFocus(h EventHandler, scope ...any) HTMLAside {
  2037. e.setEventHandler("focus", h, scope...)
  2038. return e
  2039. }
  2040. func (e *htmlAside) OnInput(h EventHandler, scope ...any) HTMLAside {
  2041. e.setEventHandler("input", h, scope...)
  2042. return e
  2043. }
  2044. func (e *htmlAside) OnInvalid(h EventHandler, scope ...any) HTMLAside {
  2045. e.setEventHandler("invalid", h, scope...)
  2046. return e
  2047. }
  2048. func (e *htmlAside) OnKeyDown(h EventHandler, scope ...any) HTMLAside {
  2049. e.setEventHandler("keydown", h, scope...)
  2050. return e
  2051. }
  2052. func (e *htmlAside) OnKeyPress(h EventHandler, scope ...any) HTMLAside {
  2053. e.setEventHandler("keypress", h, scope...)
  2054. return e
  2055. }
  2056. func (e *htmlAside) OnKeyUp(h EventHandler, scope ...any) HTMLAside {
  2057. e.setEventHandler("keyup", h, scope...)
  2058. return e
  2059. }
  2060. func (e *htmlAside) OnMouseDown(h EventHandler, scope ...any) HTMLAside {
  2061. e.setEventHandler("mousedown", h, scope...)
  2062. return e
  2063. }
  2064. func (e *htmlAside) OnMouseMove(h EventHandler, scope ...any) HTMLAside {
  2065. e.setEventHandler("mousemove", h, scope...)
  2066. return e
  2067. }
  2068. func (e *htmlAside) OnMouseOut(h EventHandler, scope ...any) HTMLAside {
  2069. e.setEventHandler("mouseout", h, scope...)
  2070. return e
  2071. }
  2072. func (e *htmlAside) OnMouseOver(h EventHandler, scope ...any) HTMLAside {
  2073. e.setEventHandler("mouseover", h, scope...)
  2074. return e
  2075. }
  2076. func (e *htmlAside) OnMouseUp(h EventHandler, scope ...any) HTMLAside {
  2077. e.setEventHandler("mouseup", h, scope...)
  2078. return e
  2079. }
  2080. func (e *htmlAside) OnPaste(h EventHandler, scope ...any) HTMLAside {
  2081. e.setEventHandler("paste", h, scope...)
  2082. return e
  2083. }
  2084. func (e *htmlAside) OnReset(h EventHandler, scope ...any) HTMLAside {
  2085. e.setEventHandler("reset", h, scope...)
  2086. return e
  2087. }
  2088. func (e *htmlAside) OnScroll(h EventHandler, scope ...any) HTMLAside {
  2089. e.setEventHandler("scroll", h, scope...)
  2090. return e
  2091. }
  2092. func (e *htmlAside) OnSearch(h EventHandler, scope ...any) HTMLAside {
  2093. e.setEventHandler("search", h, scope...)
  2094. return e
  2095. }
  2096. func (e *htmlAside) OnSelect(h EventHandler, scope ...any) HTMLAside {
  2097. e.setEventHandler("select", h, scope...)
  2098. return e
  2099. }
  2100. func (e *htmlAside) OnSubmit(h EventHandler, scope ...any) HTMLAside {
  2101. e.setEventHandler("submit", h, scope...)
  2102. return e
  2103. }
  2104. func (e *htmlAside) OnWheel(h EventHandler, scope ...any) HTMLAside {
  2105. e.setEventHandler("wheel", h, scope...)
  2106. return e
  2107. }
  2108. // HTMLAudio is the interface that describes a "audio" HTML element.
  2109. type HTMLAudio interface {
  2110. UI
  2111. // Body set the content of the element.
  2112. Body(elems ...UI) HTMLAudio
  2113. // Text sets the content of the element with a text node containing the stringified given value.
  2114. Text(v any) HTMLAudio
  2115. // AccessKey specifies a shortcut key to activate/focus an element.
  2116. AccessKey(v string) HTMLAudio
  2117. // Aria stores accessible rich internet applications (ARIA) data.
  2118. Aria(k string, v any) HTMLAudio
  2119. // Attr sets the named attribute with the given value.
  2120. Attr(n string, v any) HTMLAudio
  2121. // AutoPlay specifies that the audio/video will start playing as soon as it is ready.
  2122. AutoPlay(v bool) HTMLAudio
  2123. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  2124. Class(v ...string) HTMLAudio
  2125. // ContentEditable specifies whether the content of an element is editable or not.
  2126. ContentEditable(v bool) HTMLAudio
  2127. // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc).
  2128. Controls(v bool) HTMLAudio
  2129. // CrossOrigin sets the mode of the request to an HTTP CORS Request.
  2130. CrossOrigin(v string) HTMLAudio
  2131. // DataSet stores custom data private to the page or application.
  2132. DataSet(k string, v any) HTMLAudio
  2133. // Dir specifies the text direction for the content in an element.
  2134. Dir(v string) HTMLAudio
  2135. // Draggable specifies whether an element is draggable or not.
  2136. Draggable(v bool) HTMLAudio
  2137. // Hidden specifies that an element is not yet, or is no longer relevant.
  2138. Hidden(v bool) HTMLAudio
  2139. // ID specifies a unique id for an element.
  2140. ID(v string) HTMLAudio
  2141. // Lang specifies the language of the element's content.
  2142. Lang(v string) HTMLAudio
  2143. // Loop specifies that the audio/video will start over again, every time it is finished.
  2144. Loop(v bool) HTMLAudio
  2145. // Muted specifies that the audio output of the video should be muted.
  2146. Muted(v bool) HTMLAudio
  2147. // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads.
  2148. Preload(v string) HTMLAudio
  2149. // Role specifies to parsing software the exact function of an element (and its children).
  2150. Role(v string) HTMLAudio
  2151. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  2152. Spellcheck(v bool) HTMLAudio
  2153. // Src specifies the URL of the media file.
  2154. Src(v string) HTMLAudio
  2155. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  2156. Style(k, v string) HTMLAudio
  2157. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  2158. Styles(s map[string]string) HTMLAudio
  2159. // TabIndex specifies the tabbing order of an element.
  2160. TabIndex(v int) HTMLAudio
  2161. // Title specifies extra information about an element.
  2162. Title(v string) HTMLAudio
  2163. // On registers the given event handler to the specified event.
  2164. On(event string, h EventHandler, scope ...any) HTMLAudio
  2165. // OnAbort calls the given handler on abort.
  2166. OnAbort(h EventHandler, scope ...any) HTMLAudio
  2167. // OnBlur calls the given handler when the element loses focus.
  2168. OnBlur(h EventHandler, scope ...any) HTMLAudio
  2169. // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
  2170. OnCanPlay(h EventHandler, scope ...any) HTMLAudio
  2171. // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
  2172. OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio
  2173. // OnChange calls the given handler when the value of the element is changed.
  2174. OnChange(h EventHandler, scope ...any) HTMLAudio
  2175. // OnClick calls the given handler when there is a mouse click on the element.
  2176. OnClick(h EventHandler, scope ...any) HTMLAudio
  2177. // OnContextMenu calls the given handler when a context menu is triggered.
  2178. OnContextMenu(h EventHandler, scope ...any) HTMLAudio
  2179. // OnCopy calls the given handler when the user copies the content of an element.
  2180. OnCopy(h EventHandler, scope ...any) HTMLAudio
  2181. // OnCueChange calls the given handler when the cue changes in a track element.
  2182. OnCueChange(h EventHandler, scope ...any) HTMLAudio
  2183. // OnCut calls the given handler when the user cuts the content of an element.
  2184. OnCut(h EventHandler, scope ...any) HTMLAudio
  2185. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  2186. OnDblClick(h EventHandler, scope ...any) HTMLAudio
  2187. // OnDrag calls the given handler when an element is dragged.
  2188. OnDrag(h EventHandler, scope ...any) HTMLAudio
  2189. // OnDragEnd calls the given handler at the end of a drag operation.
  2190. OnDragEnd(h EventHandler, scope ...any) HTMLAudio
  2191. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  2192. OnDragEnter(h EventHandler, scope ...any) HTMLAudio
  2193. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  2194. OnDragLeave(h EventHandler, scope ...any) HTMLAudio
  2195. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  2196. OnDragOver(h EventHandler, scope ...any) HTMLAudio
  2197. // OnDragStart calls the given handler at the start of a drag operation.
  2198. OnDragStart(h EventHandler, scope ...any) HTMLAudio
  2199. // OnDrop calls the given handler when dragged element is being dropped.
  2200. OnDrop(h EventHandler, scope ...any) HTMLAudio
  2201. // OnDurationChange calls the given handler when the length of the media changes.
  2202. OnDurationChange(h EventHandler, scope ...any) HTMLAudio
  2203. // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
  2204. OnEmptied(h EventHandler, scope ...any) HTMLAudio
  2205. // OnEnded calls the given handler when the media has reach the end.
  2206. OnEnded(h EventHandler, scope ...any) HTMLAudio
  2207. // OnError calls the given handler when an error occurs.
  2208. OnError(h EventHandler, scope ...any) HTMLAudio
  2209. // OnFocus calls the given handler when the element gets focus.
  2210. OnFocus(h EventHandler, scope ...any) HTMLAudio
  2211. // OnInput calls the given handler when an element gets user input.
  2212. OnInput(h EventHandler, scope ...any) HTMLAudio
  2213. // OnInvalid calls the given handler when an element is invalid.
  2214. OnInvalid(h EventHandler, scope ...any) HTMLAudio
  2215. // OnKeyDown calls the given handler when a user is pressing a key.
  2216. OnKeyDown(h EventHandler, scope ...any) HTMLAudio
  2217. // OnKeyPress calls the given handler when a user presses a key.
  2218. OnKeyPress(h EventHandler, scope ...any) HTMLAudio
  2219. // OnKeyUp calls the given handler when a user releases a key.
  2220. OnKeyUp(h EventHandler, scope ...any) HTMLAudio
  2221. // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
  2222. OnLoadStart(h EventHandler, scope ...any) HTMLAudio
  2223. // OnLoadedData calls the given handler when media data is loaded.
  2224. OnLoadedData(h EventHandler, scope ...any) HTMLAudio
  2225. // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
  2226. OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio
  2227. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  2228. OnMouseDown(h EventHandler, scope ...any) HTMLAudio
  2229. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  2230. OnMouseMove(h EventHandler, scope ...any) HTMLAudio
  2231. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  2232. OnMouseOut(h EventHandler, scope ...any) HTMLAudio
  2233. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  2234. OnMouseOver(h EventHandler, scope ...any) HTMLAudio
  2235. // OnMouseUp calls the given handler when a mouse button is released over an element.
  2236. OnMouseUp(h EventHandler, scope ...any) HTMLAudio
  2237. // OnPaste calls the given handler when the user pastes some content in an element.
  2238. OnPaste(h EventHandler, scope ...any) HTMLAudio
  2239. // OnPause calls the given handler when the media is paused either by the user or programmatically.
  2240. OnPause(h EventHandler, scope ...any) HTMLAudio
  2241. // OnPlay calls the given handler when the media is ready to start playing.
  2242. OnPlay(h EventHandler, scope ...any) HTMLAudio
  2243. // OnPlaying calls the given handler when the media actually has started playing.
  2244. OnPlaying(h EventHandler, scope ...any) HTMLAudio
  2245. // OnProgress calls the given handler when the browser is in the process of getting the media data.
  2246. OnProgress(h EventHandler, scope ...any) HTMLAudio
  2247. // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
  2248. OnRateChange(h EventHandler, scope ...any) HTMLAudio
  2249. // OnReset calls the given handler when the Reset button in a form is clicked.
  2250. OnReset(h EventHandler, scope ...any) HTMLAudio
  2251. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  2252. OnScroll(h EventHandler, scope ...any) HTMLAudio
  2253. // OnSearch calls the given handler when the user writes something in a search field.
  2254. OnSearch(h EventHandler, scope ...any) HTMLAudio
  2255. // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
  2256. OnSeeked(h EventHandler, scope ...any) HTMLAudio
  2257. // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
  2258. OnSeeking(h EventHandler, scope ...any) HTMLAudio
  2259. // OnSelect calls the given handler after some text has been selected in an element.
  2260. OnSelect(h EventHandler, scope ...any) HTMLAudio
  2261. // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
  2262. OnStalled(h EventHandler, scope ...any) HTMLAudio
  2263. // OnSubmit calls the given handler when a form is submitted.
  2264. OnSubmit(h EventHandler, scope ...any) HTMLAudio
  2265. // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
  2266. OnSuspend(h EventHandler, scope ...any) HTMLAudio
  2267. // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
  2268. OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio
  2269. // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
  2270. OnVolumeChange(h EventHandler, scope ...any) HTMLAudio
  2271. // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
  2272. OnWaiting(h EventHandler, scope ...any) HTMLAudio
  2273. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  2274. OnWheel(h EventHandler, scope ...any) HTMLAudio
  2275. }
  2276. // Audio returns an HTML element that defines sound content.
  2277. func Audio() HTMLAudio {
  2278. e := &htmlAudio{
  2279. htmlElement: htmlElement{
  2280. tag: "audio",
  2281. isSelfClosing: false,
  2282. },
  2283. }
  2284. return e
  2285. }
  2286. type htmlAudio struct {
  2287. htmlElement
  2288. }
  2289. func (e *htmlAudio) Body(v ...UI) HTMLAudio {
  2290. e.setChildren(v...)
  2291. return e
  2292. }
  2293. func (e *htmlAudio) Text(v any) HTMLAudio {
  2294. return e.Body(Text(v))
  2295. }
  2296. func (e *htmlAudio) AccessKey(v string) HTMLAudio {
  2297. e.setAttr("accesskey", v)
  2298. return e
  2299. }
  2300. func (e *htmlAudio) Aria(k string, v any) HTMLAudio {
  2301. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  2302. return e
  2303. }
  2304. func (e *htmlAudio) Attr(n string, v any) HTMLAudio {
  2305. e.setAttr(n, v)
  2306. return e
  2307. }
  2308. func (e *htmlAudio) AutoPlay(v bool) HTMLAudio {
  2309. e.setAttr("autoplay", v)
  2310. return e
  2311. }
  2312. func (e *htmlAudio) Class(v ...string) HTMLAudio {
  2313. e.setAttr("class", strings.Join(v, " "))
  2314. return e
  2315. }
  2316. func (e *htmlAudio) ContentEditable(v bool) HTMLAudio {
  2317. e.setAttr("contenteditable", v)
  2318. return e
  2319. }
  2320. func (e *htmlAudio) Controls(v bool) HTMLAudio {
  2321. e.setAttr("controls", v)
  2322. return e
  2323. }
  2324. func (e *htmlAudio) CrossOrigin(v string) HTMLAudio {
  2325. e.setAttr("crossorigin", v)
  2326. return e
  2327. }
  2328. func (e *htmlAudio) DataSet(k string, v any) HTMLAudio {
  2329. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  2330. return e
  2331. }
  2332. func (e *htmlAudio) Dir(v string) HTMLAudio {
  2333. e.setAttr("dir", v)
  2334. return e
  2335. }
  2336. func (e *htmlAudio) Draggable(v bool) HTMLAudio {
  2337. e.setAttr("draggable", v)
  2338. return e
  2339. }
  2340. func (e *htmlAudio) Hidden(v bool) HTMLAudio {
  2341. e.setAttr("hidden", v)
  2342. return e
  2343. }
  2344. func (e *htmlAudio) ID(v string) HTMLAudio {
  2345. e.setAttr("id", v)
  2346. return e
  2347. }
  2348. func (e *htmlAudio) Lang(v string) HTMLAudio {
  2349. e.setAttr("lang", v)
  2350. return e
  2351. }
  2352. func (e *htmlAudio) Loop(v bool) HTMLAudio {
  2353. e.setAttr("loop", v)
  2354. return e
  2355. }
  2356. func (e *htmlAudio) Muted(v bool) HTMLAudio {
  2357. e.setAttr("muted", v)
  2358. return e
  2359. }
  2360. func (e *htmlAudio) Preload(v string) HTMLAudio {
  2361. e.setAttr("preload", v)
  2362. return e
  2363. }
  2364. func (e *htmlAudio) Role(v string) HTMLAudio {
  2365. e.setAttr("role", v)
  2366. return e
  2367. }
  2368. func (e *htmlAudio) Spellcheck(v bool) HTMLAudio {
  2369. s := "false"
  2370. if v {
  2371. s = "true"
  2372. }
  2373. e.setAttr("spellcheck", s)
  2374. return e
  2375. }
  2376. func (e *htmlAudio) Src(v string) HTMLAudio {
  2377. e.setAttr("src", v)
  2378. return e
  2379. }
  2380. func (e *htmlAudio) Style(k, v string) HTMLAudio {
  2381. e.setAttr("style", k+":"+v)
  2382. return e
  2383. }
  2384. func (e *htmlAudio) Styles(s map[string]string) HTMLAudio {
  2385. for k, v := range s {
  2386. e.Style(k, v)
  2387. }
  2388. return e
  2389. }
  2390. func (e *htmlAudio) TabIndex(v int) HTMLAudio {
  2391. e.setAttr("tabindex", v)
  2392. return e
  2393. }
  2394. func (e *htmlAudio) Title(v string) HTMLAudio {
  2395. e.setAttr("title", v)
  2396. return e
  2397. }
  2398. func (e *htmlAudio) On(event string, h EventHandler, scope ...any) HTMLAudio {
  2399. e.setEventHandler(event, h, scope...)
  2400. return e
  2401. }
  2402. func (e *htmlAudio) OnAbort(h EventHandler, scope ...any) HTMLAudio {
  2403. e.setEventHandler("abort", h, scope...)
  2404. return e
  2405. }
  2406. func (e *htmlAudio) OnBlur(h EventHandler, scope ...any) HTMLAudio {
  2407. e.setEventHandler("blur", h, scope...)
  2408. return e
  2409. }
  2410. func (e *htmlAudio) OnCanPlay(h EventHandler, scope ...any) HTMLAudio {
  2411. e.setEventHandler("canplay", h, scope...)
  2412. return e
  2413. }
  2414. func (e *htmlAudio) OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio {
  2415. e.setEventHandler("canplaythrough", h, scope...)
  2416. return e
  2417. }
  2418. func (e *htmlAudio) OnChange(h EventHandler, scope ...any) HTMLAudio {
  2419. e.setEventHandler("change", h, scope...)
  2420. return e
  2421. }
  2422. func (e *htmlAudio) OnClick(h EventHandler, scope ...any) HTMLAudio {
  2423. e.setEventHandler("click", h, scope...)
  2424. return e
  2425. }
  2426. func (e *htmlAudio) OnContextMenu(h EventHandler, scope ...any) HTMLAudio {
  2427. e.setEventHandler("contextmenu", h, scope...)
  2428. return e
  2429. }
  2430. func (e *htmlAudio) OnCopy(h EventHandler, scope ...any) HTMLAudio {
  2431. e.setEventHandler("copy", h, scope...)
  2432. return e
  2433. }
  2434. func (e *htmlAudio) OnCueChange(h EventHandler, scope ...any) HTMLAudio {
  2435. e.setEventHandler("cuechange", h, scope...)
  2436. return e
  2437. }
  2438. func (e *htmlAudio) OnCut(h EventHandler, scope ...any) HTMLAudio {
  2439. e.setEventHandler("cut", h, scope...)
  2440. return e
  2441. }
  2442. func (e *htmlAudio) OnDblClick(h EventHandler, scope ...any) HTMLAudio {
  2443. e.setEventHandler("dblclick", h, scope...)
  2444. return e
  2445. }
  2446. func (e *htmlAudio) OnDrag(h EventHandler, scope ...any) HTMLAudio {
  2447. e.setEventHandler("drag", h, scope...)
  2448. return e
  2449. }
  2450. func (e *htmlAudio) OnDragEnd(h EventHandler, scope ...any) HTMLAudio {
  2451. e.setEventHandler("dragend", h, scope...)
  2452. return e
  2453. }
  2454. func (e *htmlAudio) OnDragEnter(h EventHandler, scope ...any) HTMLAudio {
  2455. e.setEventHandler("dragenter", h, scope...)
  2456. return e
  2457. }
  2458. func (e *htmlAudio) OnDragLeave(h EventHandler, scope ...any) HTMLAudio {
  2459. e.setEventHandler("dragleave", h, scope...)
  2460. return e
  2461. }
  2462. func (e *htmlAudio) OnDragOver(h EventHandler, scope ...any) HTMLAudio {
  2463. e.setEventHandler("dragover", h, scope...)
  2464. return e
  2465. }
  2466. func (e *htmlAudio) OnDragStart(h EventHandler, scope ...any) HTMLAudio {
  2467. e.setEventHandler("dragstart", h, scope...)
  2468. return e
  2469. }
  2470. func (e *htmlAudio) OnDrop(h EventHandler, scope ...any) HTMLAudio {
  2471. e.setEventHandler("drop", h, scope...)
  2472. return e
  2473. }
  2474. func (e *htmlAudio) OnDurationChange(h EventHandler, scope ...any) HTMLAudio {
  2475. e.setEventHandler("durationchange", h, scope...)
  2476. return e
  2477. }
  2478. func (e *htmlAudio) OnEmptied(h EventHandler, scope ...any) HTMLAudio {
  2479. e.setEventHandler("emptied", h, scope...)
  2480. return e
  2481. }
  2482. func (e *htmlAudio) OnEnded(h EventHandler, scope ...any) HTMLAudio {
  2483. e.setEventHandler("ended", h, scope...)
  2484. return e
  2485. }
  2486. func (e *htmlAudio) OnError(h EventHandler, scope ...any) HTMLAudio {
  2487. e.setEventHandler("error", h, scope...)
  2488. return e
  2489. }
  2490. func (e *htmlAudio) OnFocus(h EventHandler, scope ...any) HTMLAudio {
  2491. e.setEventHandler("focus", h, scope...)
  2492. return e
  2493. }
  2494. func (e *htmlAudio) OnInput(h EventHandler, scope ...any) HTMLAudio {
  2495. e.setEventHandler("input", h, scope...)
  2496. return e
  2497. }
  2498. func (e *htmlAudio) OnInvalid(h EventHandler, scope ...any) HTMLAudio {
  2499. e.setEventHandler("invalid", h, scope...)
  2500. return e
  2501. }
  2502. func (e *htmlAudio) OnKeyDown(h EventHandler, scope ...any) HTMLAudio {
  2503. e.setEventHandler("keydown", h, scope...)
  2504. return e
  2505. }
  2506. func (e *htmlAudio) OnKeyPress(h EventHandler, scope ...any) HTMLAudio {
  2507. e.setEventHandler("keypress", h, scope...)
  2508. return e
  2509. }
  2510. func (e *htmlAudio) OnKeyUp(h EventHandler, scope ...any) HTMLAudio {
  2511. e.setEventHandler("keyup", h, scope...)
  2512. return e
  2513. }
  2514. func (e *htmlAudio) OnLoadStart(h EventHandler, scope ...any) HTMLAudio {
  2515. e.setEventHandler("loadstart", h, scope...)
  2516. return e
  2517. }
  2518. func (e *htmlAudio) OnLoadedData(h EventHandler, scope ...any) HTMLAudio {
  2519. e.setEventHandler("loadeddata", h, scope...)
  2520. return e
  2521. }
  2522. func (e *htmlAudio) OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio {
  2523. e.setEventHandler("loadedmetadata", h, scope...)
  2524. return e
  2525. }
  2526. func (e *htmlAudio) OnMouseDown(h EventHandler, scope ...any) HTMLAudio {
  2527. e.setEventHandler("mousedown", h, scope...)
  2528. return e
  2529. }
  2530. func (e *htmlAudio) OnMouseMove(h EventHandler, scope ...any) HTMLAudio {
  2531. e.setEventHandler("mousemove", h, scope...)
  2532. return e
  2533. }
  2534. func (e *htmlAudio) OnMouseOut(h EventHandler, scope ...any) HTMLAudio {
  2535. e.setEventHandler("mouseout", h, scope...)
  2536. return e
  2537. }
  2538. func (e *htmlAudio) OnMouseOver(h EventHandler, scope ...any) HTMLAudio {
  2539. e.setEventHandler("mouseover", h, scope...)
  2540. return e
  2541. }
  2542. func (e *htmlAudio) OnMouseUp(h EventHandler, scope ...any) HTMLAudio {
  2543. e.setEventHandler("mouseup", h, scope...)
  2544. return e
  2545. }
  2546. func (e *htmlAudio) OnPaste(h EventHandler, scope ...any) HTMLAudio {
  2547. e.setEventHandler("paste", h, scope...)
  2548. return e
  2549. }
  2550. func (e *htmlAudio) OnPause(h EventHandler, scope ...any) HTMLAudio {
  2551. e.setEventHandler("pause", h, scope...)
  2552. return e
  2553. }
  2554. func (e *htmlAudio) OnPlay(h EventHandler, scope ...any) HTMLAudio {
  2555. e.setEventHandler("play", h, scope...)
  2556. return e
  2557. }
  2558. func (e *htmlAudio) OnPlaying(h EventHandler, scope ...any) HTMLAudio {
  2559. e.setEventHandler("playing", h, scope...)
  2560. return e
  2561. }
  2562. func (e *htmlAudio) OnProgress(h EventHandler, scope ...any) HTMLAudio {
  2563. e.setEventHandler("progress", h, scope...)
  2564. return e
  2565. }
  2566. func (e *htmlAudio) OnRateChange(h EventHandler, scope ...any) HTMLAudio {
  2567. e.setEventHandler("ratechange", h, scope...)
  2568. return e
  2569. }
  2570. func (e *htmlAudio) OnReset(h EventHandler, scope ...any) HTMLAudio {
  2571. e.setEventHandler("reset", h, scope...)
  2572. return e
  2573. }
  2574. func (e *htmlAudio) OnScroll(h EventHandler, scope ...any) HTMLAudio {
  2575. e.setEventHandler("scroll", h, scope...)
  2576. return e
  2577. }
  2578. func (e *htmlAudio) OnSearch(h EventHandler, scope ...any) HTMLAudio {
  2579. e.setEventHandler("search", h, scope...)
  2580. return e
  2581. }
  2582. func (e *htmlAudio) OnSeeked(h EventHandler, scope ...any) HTMLAudio {
  2583. e.setEventHandler("seeked", h, scope...)
  2584. return e
  2585. }
  2586. func (e *htmlAudio) OnSeeking(h EventHandler, scope ...any) HTMLAudio {
  2587. e.setEventHandler("seeking", h, scope...)
  2588. return e
  2589. }
  2590. func (e *htmlAudio) OnSelect(h EventHandler, scope ...any) HTMLAudio {
  2591. e.setEventHandler("select", h, scope...)
  2592. return e
  2593. }
  2594. func (e *htmlAudio) OnStalled(h EventHandler, scope ...any) HTMLAudio {
  2595. e.setEventHandler("stalled", h, scope...)
  2596. return e
  2597. }
  2598. func (e *htmlAudio) OnSubmit(h EventHandler, scope ...any) HTMLAudio {
  2599. e.setEventHandler("submit", h, scope...)
  2600. return e
  2601. }
  2602. func (e *htmlAudio) OnSuspend(h EventHandler, scope ...any) HTMLAudio {
  2603. e.setEventHandler("suspend", h, scope...)
  2604. return e
  2605. }
  2606. func (e *htmlAudio) OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio {
  2607. e.setEventHandler("timeupdate", h, scope...)
  2608. return e
  2609. }
  2610. func (e *htmlAudio) OnVolumeChange(h EventHandler, scope ...any) HTMLAudio {
  2611. e.setEventHandler("volumechange", h, scope...)
  2612. return e
  2613. }
  2614. func (e *htmlAudio) OnWaiting(h EventHandler, scope ...any) HTMLAudio {
  2615. e.setEventHandler("waiting", h, scope...)
  2616. return e
  2617. }
  2618. func (e *htmlAudio) OnWheel(h EventHandler, scope ...any) HTMLAudio {
  2619. e.setEventHandler("wheel", h, scope...)
  2620. return e
  2621. }
  2622. // HTMLB is the interface that describes a "b" HTML element.
  2623. type HTMLB interface {
  2624. UI
  2625. // Body set the content of the element.
  2626. Body(elems ...UI) HTMLB
  2627. // Text sets the content of the element with a text node containing the stringified given value.
  2628. Text(v any) HTMLB
  2629. // AccessKey specifies a shortcut key to activate/focus an element.
  2630. AccessKey(v string) HTMLB
  2631. // Aria stores accessible rich internet applications (ARIA) data.
  2632. Aria(k string, v any) HTMLB
  2633. // Attr sets the named attribute with the given value.
  2634. Attr(n string, v any) HTMLB
  2635. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  2636. Class(v ...string) HTMLB
  2637. // ContentEditable specifies whether the content of an element is editable or not.
  2638. ContentEditable(v bool) HTMLB
  2639. // DataSet stores custom data private to the page or application.
  2640. DataSet(k string, v any) HTMLB
  2641. // Dir specifies the text direction for the content in an element.
  2642. Dir(v string) HTMLB
  2643. // Draggable specifies whether an element is draggable or not.
  2644. Draggable(v bool) HTMLB
  2645. // Hidden specifies that an element is not yet, or is no longer relevant.
  2646. Hidden(v bool) HTMLB
  2647. // ID specifies a unique id for an element.
  2648. ID(v string) HTMLB
  2649. // Lang specifies the language of the element's content.
  2650. Lang(v string) HTMLB
  2651. // Role specifies to parsing software the exact function of an element (and its children).
  2652. Role(v string) HTMLB
  2653. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  2654. Spellcheck(v bool) HTMLB
  2655. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  2656. Style(k, v string) HTMLB
  2657. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  2658. Styles(s map[string]string) HTMLB
  2659. // TabIndex specifies the tabbing order of an element.
  2660. TabIndex(v int) HTMLB
  2661. // Title specifies extra information about an element.
  2662. Title(v string) HTMLB
  2663. // On registers the given event handler to the specified event.
  2664. On(event string, h EventHandler, scope ...any) HTMLB
  2665. // OnBlur calls the given handler when the element loses focus.
  2666. OnBlur(h EventHandler, scope ...any) HTMLB
  2667. // OnChange calls the given handler when the value of the element is changed.
  2668. OnChange(h EventHandler, scope ...any) HTMLB
  2669. // OnClick calls the given handler when there is a mouse click on the element.
  2670. OnClick(h EventHandler, scope ...any) HTMLB
  2671. // OnContextMenu calls the given handler when a context menu is triggered.
  2672. OnContextMenu(h EventHandler, scope ...any) HTMLB
  2673. // OnCopy calls the given handler when the user copies the content of an element.
  2674. OnCopy(h EventHandler, scope ...any) HTMLB
  2675. // OnCut calls the given handler when the user cuts the content of an element.
  2676. OnCut(h EventHandler, scope ...any) HTMLB
  2677. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  2678. OnDblClick(h EventHandler, scope ...any) HTMLB
  2679. // OnDrag calls the given handler when an element is dragged.
  2680. OnDrag(h EventHandler, scope ...any) HTMLB
  2681. // OnDragEnd calls the given handler at the end of a drag operation.
  2682. OnDragEnd(h EventHandler, scope ...any) HTMLB
  2683. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  2684. OnDragEnter(h EventHandler, scope ...any) HTMLB
  2685. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  2686. OnDragLeave(h EventHandler, scope ...any) HTMLB
  2687. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  2688. OnDragOver(h EventHandler, scope ...any) HTMLB
  2689. // OnDragStart calls the given handler at the start of a drag operation.
  2690. OnDragStart(h EventHandler, scope ...any) HTMLB
  2691. // OnDrop calls the given handler when dragged element is being dropped.
  2692. OnDrop(h EventHandler, scope ...any) HTMLB
  2693. // OnFocus calls the given handler when the element gets focus.
  2694. OnFocus(h EventHandler, scope ...any) HTMLB
  2695. // OnInput calls the given handler when an element gets user input.
  2696. OnInput(h EventHandler, scope ...any) HTMLB
  2697. // OnInvalid calls the given handler when an element is invalid.
  2698. OnInvalid(h EventHandler, scope ...any) HTMLB
  2699. // OnKeyDown calls the given handler when a user is pressing a key.
  2700. OnKeyDown(h EventHandler, scope ...any) HTMLB
  2701. // OnKeyPress calls the given handler when a user presses a key.
  2702. OnKeyPress(h EventHandler, scope ...any) HTMLB
  2703. // OnKeyUp calls the given handler when a user releases a key.
  2704. OnKeyUp(h EventHandler, scope ...any) HTMLB
  2705. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  2706. OnMouseDown(h EventHandler, scope ...any) HTMLB
  2707. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  2708. OnMouseMove(h EventHandler, scope ...any) HTMLB
  2709. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  2710. OnMouseOut(h EventHandler, scope ...any) HTMLB
  2711. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  2712. OnMouseOver(h EventHandler, scope ...any) HTMLB
  2713. // OnMouseUp calls the given handler when a mouse button is released over an element.
  2714. OnMouseUp(h EventHandler, scope ...any) HTMLB
  2715. // OnPaste calls the given handler when the user pastes some content in an element.
  2716. OnPaste(h EventHandler, scope ...any) HTMLB
  2717. // OnReset calls the given handler when the Reset button in a form is clicked.
  2718. OnReset(h EventHandler, scope ...any) HTMLB
  2719. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  2720. OnScroll(h EventHandler, scope ...any) HTMLB
  2721. // OnSearch calls the given handler when the user writes something in a search field.
  2722. OnSearch(h EventHandler, scope ...any) HTMLB
  2723. // OnSelect calls the given handler after some text has been selected in an element.
  2724. OnSelect(h EventHandler, scope ...any) HTMLB
  2725. // OnSubmit calls the given handler when a form is submitted.
  2726. OnSubmit(h EventHandler, scope ...any) HTMLB
  2727. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  2728. OnWheel(h EventHandler, scope ...any) HTMLB
  2729. }
  2730. // B returns an HTML element that defines bold text.
  2731. func B() HTMLB {
  2732. e := &htmlB{
  2733. htmlElement: htmlElement{
  2734. tag: "b",
  2735. isSelfClosing: false,
  2736. },
  2737. }
  2738. return e
  2739. }
  2740. type htmlB struct {
  2741. htmlElement
  2742. }
  2743. func (e *htmlB) Body(v ...UI) HTMLB {
  2744. e.setChildren(v...)
  2745. return e
  2746. }
  2747. func (e *htmlB) Text(v any) HTMLB {
  2748. return e.Body(Text(v))
  2749. }
  2750. func (e *htmlB) AccessKey(v string) HTMLB {
  2751. e.setAttr("accesskey", v)
  2752. return e
  2753. }
  2754. func (e *htmlB) Aria(k string, v any) HTMLB {
  2755. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  2756. return e
  2757. }
  2758. func (e *htmlB) Attr(n string, v any) HTMLB {
  2759. e.setAttr(n, v)
  2760. return e
  2761. }
  2762. func (e *htmlB) Class(v ...string) HTMLB {
  2763. e.setAttr("class", strings.Join(v, " "))
  2764. return e
  2765. }
  2766. func (e *htmlB) ContentEditable(v bool) HTMLB {
  2767. e.setAttr("contenteditable", v)
  2768. return e
  2769. }
  2770. func (e *htmlB) DataSet(k string, v any) HTMLB {
  2771. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  2772. return e
  2773. }
  2774. func (e *htmlB) Dir(v string) HTMLB {
  2775. e.setAttr("dir", v)
  2776. return e
  2777. }
  2778. func (e *htmlB) Draggable(v bool) HTMLB {
  2779. e.setAttr("draggable", v)
  2780. return e
  2781. }
  2782. func (e *htmlB) Hidden(v bool) HTMLB {
  2783. e.setAttr("hidden", v)
  2784. return e
  2785. }
  2786. func (e *htmlB) ID(v string) HTMLB {
  2787. e.setAttr("id", v)
  2788. return e
  2789. }
  2790. func (e *htmlB) Lang(v string) HTMLB {
  2791. e.setAttr("lang", v)
  2792. return e
  2793. }
  2794. func (e *htmlB) Role(v string) HTMLB {
  2795. e.setAttr("role", v)
  2796. return e
  2797. }
  2798. func (e *htmlB) Spellcheck(v bool) HTMLB {
  2799. s := "false"
  2800. if v {
  2801. s = "true"
  2802. }
  2803. e.setAttr("spellcheck", s)
  2804. return e
  2805. }
  2806. func (e *htmlB) Style(k, v string) HTMLB {
  2807. e.setAttr("style", k+":"+v)
  2808. return e
  2809. }
  2810. func (e *htmlB) Styles(s map[string]string) HTMLB {
  2811. for k, v := range s {
  2812. e.Style(k, v)
  2813. }
  2814. return e
  2815. }
  2816. func (e *htmlB) TabIndex(v int) HTMLB {
  2817. e.setAttr("tabindex", v)
  2818. return e
  2819. }
  2820. func (e *htmlB) Title(v string) HTMLB {
  2821. e.setAttr("title", v)
  2822. return e
  2823. }
  2824. func (e *htmlB) On(event string, h EventHandler, scope ...any) HTMLB {
  2825. e.setEventHandler(event, h, scope...)
  2826. return e
  2827. }
  2828. func (e *htmlB) OnBlur(h EventHandler, scope ...any) HTMLB {
  2829. e.setEventHandler("blur", h, scope...)
  2830. return e
  2831. }
  2832. func (e *htmlB) OnChange(h EventHandler, scope ...any) HTMLB {
  2833. e.setEventHandler("change", h, scope...)
  2834. return e
  2835. }
  2836. func (e *htmlB) OnClick(h EventHandler, scope ...any) HTMLB {
  2837. e.setEventHandler("click", h, scope...)
  2838. return e
  2839. }
  2840. func (e *htmlB) OnContextMenu(h EventHandler, scope ...any) HTMLB {
  2841. e.setEventHandler("contextmenu", h, scope...)
  2842. return e
  2843. }
  2844. func (e *htmlB) OnCopy(h EventHandler, scope ...any) HTMLB {
  2845. e.setEventHandler("copy", h, scope...)
  2846. return e
  2847. }
  2848. func (e *htmlB) OnCut(h EventHandler, scope ...any) HTMLB {
  2849. e.setEventHandler("cut", h, scope...)
  2850. return e
  2851. }
  2852. func (e *htmlB) OnDblClick(h EventHandler, scope ...any) HTMLB {
  2853. e.setEventHandler("dblclick", h, scope...)
  2854. return e
  2855. }
  2856. func (e *htmlB) OnDrag(h EventHandler, scope ...any) HTMLB {
  2857. e.setEventHandler("drag", h, scope...)
  2858. return e
  2859. }
  2860. func (e *htmlB) OnDragEnd(h EventHandler, scope ...any) HTMLB {
  2861. e.setEventHandler("dragend", h, scope...)
  2862. return e
  2863. }
  2864. func (e *htmlB) OnDragEnter(h EventHandler, scope ...any) HTMLB {
  2865. e.setEventHandler("dragenter", h, scope...)
  2866. return e
  2867. }
  2868. func (e *htmlB) OnDragLeave(h EventHandler, scope ...any) HTMLB {
  2869. e.setEventHandler("dragleave", h, scope...)
  2870. return e
  2871. }
  2872. func (e *htmlB) OnDragOver(h EventHandler, scope ...any) HTMLB {
  2873. e.setEventHandler("dragover", h, scope...)
  2874. return e
  2875. }
  2876. func (e *htmlB) OnDragStart(h EventHandler, scope ...any) HTMLB {
  2877. e.setEventHandler("dragstart", h, scope...)
  2878. return e
  2879. }
  2880. func (e *htmlB) OnDrop(h EventHandler, scope ...any) HTMLB {
  2881. e.setEventHandler("drop", h, scope...)
  2882. return e
  2883. }
  2884. func (e *htmlB) OnFocus(h EventHandler, scope ...any) HTMLB {
  2885. e.setEventHandler("focus", h, scope...)
  2886. return e
  2887. }
  2888. func (e *htmlB) OnInput(h EventHandler, scope ...any) HTMLB {
  2889. e.setEventHandler("input", h, scope...)
  2890. return e
  2891. }
  2892. func (e *htmlB) OnInvalid(h EventHandler, scope ...any) HTMLB {
  2893. e.setEventHandler("invalid", h, scope...)
  2894. return e
  2895. }
  2896. func (e *htmlB) OnKeyDown(h EventHandler, scope ...any) HTMLB {
  2897. e.setEventHandler("keydown", h, scope...)
  2898. return e
  2899. }
  2900. func (e *htmlB) OnKeyPress(h EventHandler, scope ...any) HTMLB {
  2901. e.setEventHandler("keypress", h, scope...)
  2902. return e
  2903. }
  2904. func (e *htmlB) OnKeyUp(h EventHandler, scope ...any) HTMLB {
  2905. e.setEventHandler("keyup", h, scope...)
  2906. return e
  2907. }
  2908. func (e *htmlB) OnMouseDown(h EventHandler, scope ...any) HTMLB {
  2909. e.setEventHandler("mousedown", h, scope...)
  2910. return e
  2911. }
  2912. func (e *htmlB) OnMouseMove(h EventHandler, scope ...any) HTMLB {
  2913. e.setEventHandler("mousemove", h, scope...)
  2914. return e
  2915. }
  2916. func (e *htmlB) OnMouseOut(h EventHandler, scope ...any) HTMLB {
  2917. e.setEventHandler("mouseout", h, scope...)
  2918. return e
  2919. }
  2920. func (e *htmlB) OnMouseOver(h EventHandler, scope ...any) HTMLB {
  2921. e.setEventHandler("mouseover", h, scope...)
  2922. return e
  2923. }
  2924. func (e *htmlB) OnMouseUp(h EventHandler, scope ...any) HTMLB {
  2925. e.setEventHandler("mouseup", h, scope...)
  2926. return e
  2927. }
  2928. func (e *htmlB) OnPaste(h EventHandler, scope ...any) HTMLB {
  2929. e.setEventHandler("paste", h, scope...)
  2930. return e
  2931. }
  2932. func (e *htmlB) OnReset(h EventHandler, scope ...any) HTMLB {
  2933. e.setEventHandler("reset", h, scope...)
  2934. return e
  2935. }
  2936. func (e *htmlB) OnScroll(h EventHandler, scope ...any) HTMLB {
  2937. e.setEventHandler("scroll", h, scope...)
  2938. return e
  2939. }
  2940. func (e *htmlB) OnSearch(h EventHandler, scope ...any) HTMLB {
  2941. e.setEventHandler("search", h, scope...)
  2942. return e
  2943. }
  2944. func (e *htmlB) OnSelect(h EventHandler, scope ...any) HTMLB {
  2945. e.setEventHandler("select", h, scope...)
  2946. return e
  2947. }
  2948. func (e *htmlB) OnSubmit(h EventHandler, scope ...any) HTMLB {
  2949. e.setEventHandler("submit", h, scope...)
  2950. return e
  2951. }
  2952. func (e *htmlB) OnWheel(h EventHandler, scope ...any) HTMLB {
  2953. e.setEventHandler("wheel", h, scope...)
  2954. return e
  2955. }
  2956. // HTMLBase is the interface that describes a "base" HTML element.
  2957. type HTMLBase interface {
  2958. UI
  2959. // AccessKey specifies a shortcut key to activate/focus an element.
  2960. AccessKey(v string) HTMLBase
  2961. // Aria stores accessible rich internet applications (ARIA) data.
  2962. Aria(k string, v any) HTMLBase
  2963. // Attr sets the named attribute with the given value.
  2964. Attr(n string, v any) HTMLBase
  2965. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  2966. Class(v ...string) HTMLBase
  2967. // ContentEditable specifies whether the content of an element is editable or not.
  2968. ContentEditable(v bool) HTMLBase
  2969. // DataSet stores custom data private to the page or application.
  2970. DataSet(k string, v any) HTMLBase
  2971. // Dir specifies the text direction for the content in an element.
  2972. Dir(v string) HTMLBase
  2973. // Draggable specifies whether an element is draggable or not.
  2974. Draggable(v bool) HTMLBase
  2975. // Hidden specifies that an element is not yet, or is no longer relevant.
  2976. Hidden(v bool) HTMLBase
  2977. // Href specifies the URL of the page the link goes to.
  2978. Href(v string) HTMLBase
  2979. // ID specifies a unique id for an element.
  2980. ID(v string) HTMLBase
  2981. // Lang specifies the language of the element's content.
  2982. Lang(v string) HTMLBase
  2983. // Role specifies to parsing software the exact function of an element (and its children).
  2984. Role(v string) HTMLBase
  2985. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  2986. Spellcheck(v bool) HTMLBase
  2987. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  2988. Style(k, v string) HTMLBase
  2989. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  2990. Styles(s map[string]string) HTMLBase
  2991. // TabIndex specifies the tabbing order of an element.
  2992. TabIndex(v int) HTMLBase
  2993. // Target specifies the target for where to open the linked document or where to submit the form.
  2994. Target(v string) HTMLBase
  2995. // Title specifies extra information about an element.
  2996. Title(v string) HTMLBase
  2997. // On registers the given event handler to the specified event.
  2998. On(event string, h EventHandler, scope ...any) HTMLBase
  2999. // OnBlur calls the given handler when the element loses focus.
  3000. OnBlur(h EventHandler, scope ...any) HTMLBase
  3001. // OnChange calls the given handler when the value of the element is changed.
  3002. OnChange(h EventHandler, scope ...any) HTMLBase
  3003. // OnClick calls the given handler when there is a mouse click on the element.
  3004. OnClick(h EventHandler, scope ...any) HTMLBase
  3005. // OnContextMenu calls the given handler when a context menu is triggered.
  3006. OnContextMenu(h EventHandler, scope ...any) HTMLBase
  3007. // OnCopy calls the given handler when the user copies the content of an element.
  3008. OnCopy(h EventHandler, scope ...any) HTMLBase
  3009. // OnCut calls the given handler when the user cuts the content of an element.
  3010. OnCut(h EventHandler, scope ...any) HTMLBase
  3011. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  3012. OnDblClick(h EventHandler, scope ...any) HTMLBase
  3013. // OnDrag calls the given handler when an element is dragged.
  3014. OnDrag(h EventHandler, scope ...any) HTMLBase
  3015. // OnDragEnd calls the given handler at the end of a drag operation.
  3016. OnDragEnd(h EventHandler, scope ...any) HTMLBase
  3017. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  3018. OnDragEnter(h EventHandler, scope ...any) HTMLBase
  3019. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  3020. OnDragLeave(h EventHandler, scope ...any) HTMLBase
  3021. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  3022. OnDragOver(h EventHandler, scope ...any) HTMLBase
  3023. // OnDragStart calls the given handler at the start of a drag operation.
  3024. OnDragStart(h EventHandler, scope ...any) HTMLBase
  3025. // OnDrop calls the given handler when dragged element is being dropped.
  3026. OnDrop(h EventHandler, scope ...any) HTMLBase
  3027. // OnFocus calls the given handler when the element gets focus.
  3028. OnFocus(h EventHandler, scope ...any) HTMLBase
  3029. // OnInput calls the given handler when an element gets user input.
  3030. OnInput(h EventHandler, scope ...any) HTMLBase
  3031. // OnInvalid calls the given handler when an element is invalid.
  3032. OnInvalid(h EventHandler, scope ...any) HTMLBase
  3033. // OnKeyDown calls the given handler when a user is pressing a key.
  3034. OnKeyDown(h EventHandler, scope ...any) HTMLBase
  3035. // OnKeyPress calls the given handler when a user presses a key.
  3036. OnKeyPress(h EventHandler, scope ...any) HTMLBase
  3037. // OnKeyUp calls the given handler when a user releases a key.
  3038. OnKeyUp(h EventHandler, scope ...any) HTMLBase
  3039. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  3040. OnMouseDown(h EventHandler, scope ...any) HTMLBase
  3041. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  3042. OnMouseMove(h EventHandler, scope ...any) HTMLBase
  3043. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  3044. OnMouseOut(h EventHandler, scope ...any) HTMLBase
  3045. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  3046. OnMouseOver(h EventHandler, scope ...any) HTMLBase
  3047. // OnMouseUp calls the given handler when a mouse button is released over an element.
  3048. OnMouseUp(h EventHandler, scope ...any) HTMLBase
  3049. // OnPaste calls the given handler when the user pastes some content in an element.
  3050. OnPaste(h EventHandler, scope ...any) HTMLBase
  3051. // OnReset calls the given handler when the Reset button in a form is clicked.
  3052. OnReset(h EventHandler, scope ...any) HTMLBase
  3053. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  3054. OnScroll(h EventHandler, scope ...any) HTMLBase
  3055. // OnSearch calls the given handler when the user writes something in a search field.
  3056. OnSearch(h EventHandler, scope ...any) HTMLBase
  3057. // OnSelect calls the given handler after some text has been selected in an element.
  3058. OnSelect(h EventHandler, scope ...any) HTMLBase
  3059. // OnSubmit calls the given handler when a form is submitted.
  3060. OnSubmit(h EventHandler, scope ...any) HTMLBase
  3061. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  3062. OnWheel(h EventHandler, scope ...any) HTMLBase
  3063. }
  3064. // Base returns an HTML element that specifies the base URL/target for all relative URLs in a document.
  3065. func Base() HTMLBase {
  3066. e := &htmlBase{
  3067. htmlElement: htmlElement{
  3068. tag: "base",
  3069. isSelfClosing: true,
  3070. },
  3071. }
  3072. return e
  3073. }
  3074. type htmlBase struct {
  3075. htmlElement
  3076. }
  3077. func (e *htmlBase) AccessKey(v string) HTMLBase {
  3078. e.setAttr("accesskey", v)
  3079. return e
  3080. }
  3081. func (e *htmlBase) Aria(k string, v any) HTMLBase {
  3082. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  3083. return e
  3084. }
  3085. func (e *htmlBase) Attr(n string, v any) HTMLBase {
  3086. e.setAttr(n, v)
  3087. return e
  3088. }
  3089. func (e *htmlBase) Class(v ...string) HTMLBase {
  3090. e.setAttr("class", strings.Join(v, " "))
  3091. return e
  3092. }
  3093. func (e *htmlBase) ContentEditable(v bool) HTMLBase {
  3094. e.setAttr("contenteditable", v)
  3095. return e
  3096. }
  3097. func (e *htmlBase) DataSet(k string, v any) HTMLBase {
  3098. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  3099. return e
  3100. }
  3101. func (e *htmlBase) Dir(v string) HTMLBase {
  3102. e.setAttr("dir", v)
  3103. return e
  3104. }
  3105. func (e *htmlBase) Draggable(v bool) HTMLBase {
  3106. e.setAttr("draggable", v)
  3107. return e
  3108. }
  3109. func (e *htmlBase) Hidden(v bool) HTMLBase {
  3110. e.setAttr("hidden", v)
  3111. return e
  3112. }
  3113. func (e *htmlBase) Href(v string) HTMLBase {
  3114. e.setAttr("href", v)
  3115. return e
  3116. }
  3117. func (e *htmlBase) ID(v string) HTMLBase {
  3118. e.setAttr("id", v)
  3119. return e
  3120. }
  3121. func (e *htmlBase) Lang(v string) HTMLBase {
  3122. e.setAttr("lang", v)
  3123. return e
  3124. }
  3125. func (e *htmlBase) Role(v string) HTMLBase {
  3126. e.setAttr("role", v)
  3127. return e
  3128. }
  3129. func (e *htmlBase) Spellcheck(v bool) HTMLBase {
  3130. s := "false"
  3131. if v {
  3132. s = "true"
  3133. }
  3134. e.setAttr("spellcheck", s)
  3135. return e
  3136. }
  3137. func (e *htmlBase) Style(k, v string) HTMLBase {
  3138. e.setAttr("style", k+":"+v)
  3139. return e
  3140. }
  3141. func (e *htmlBase) Styles(s map[string]string) HTMLBase {
  3142. for k, v := range s {
  3143. e.Style(k, v)
  3144. }
  3145. return e
  3146. }
  3147. func (e *htmlBase) TabIndex(v int) HTMLBase {
  3148. e.setAttr("tabindex", v)
  3149. return e
  3150. }
  3151. func (e *htmlBase) Target(v string) HTMLBase {
  3152. e.setAttr("target", v)
  3153. return e
  3154. }
  3155. func (e *htmlBase) Title(v string) HTMLBase {
  3156. e.setAttr("title", v)
  3157. return e
  3158. }
  3159. func (e *htmlBase) On(event string, h EventHandler, scope ...any) HTMLBase {
  3160. e.setEventHandler(event, h, scope...)
  3161. return e
  3162. }
  3163. func (e *htmlBase) OnBlur(h EventHandler, scope ...any) HTMLBase {
  3164. e.setEventHandler("blur", h, scope...)
  3165. return e
  3166. }
  3167. func (e *htmlBase) OnChange(h EventHandler, scope ...any) HTMLBase {
  3168. e.setEventHandler("change", h, scope...)
  3169. return e
  3170. }
  3171. func (e *htmlBase) OnClick(h EventHandler, scope ...any) HTMLBase {
  3172. e.setEventHandler("click", h, scope...)
  3173. return e
  3174. }
  3175. func (e *htmlBase) OnContextMenu(h EventHandler, scope ...any) HTMLBase {
  3176. e.setEventHandler("contextmenu", h, scope...)
  3177. return e
  3178. }
  3179. func (e *htmlBase) OnCopy(h EventHandler, scope ...any) HTMLBase {
  3180. e.setEventHandler("copy", h, scope...)
  3181. return e
  3182. }
  3183. func (e *htmlBase) OnCut(h EventHandler, scope ...any) HTMLBase {
  3184. e.setEventHandler("cut", h, scope...)
  3185. return e
  3186. }
  3187. func (e *htmlBase) OnDblClick(h EventHandler, scope ...any) HTMLBase {
  3188. e.setEventHandler("dblclick", h, scope...)
  3189. return e
  3190. }
  3191. func (e *htmlBase) OnDrag(h EventHandler, scope ...any) HTMLBase {
  3192. e.setEventHandler("drag", h, scope...)
  3193. return e
  3194. }
  3195. func (e *htmlBase) OnDragEnd(h EventHandler, scope ...any) HTMLBase {
  3196. e.setEventHandler("dragend", h, scope...)
  3197. return e
  3198. }
  3199. func (e *htmlBase) OnDragEnter(h EventHandler, scope ...any) HTMLBase {
  3200. e.setEventHandler("dragenter", h, scope...)
  3201. return e
  3202. }
  3203. func (e *htmlBase) OnDragLeave(h EventHandler, scope ...any) HTMLBase {
  3204. e.setEventHandler("dragleave", h, scope...)
  3205. return e
  3206. }
  3207. func (e *htmlBase) OnDragOver(h EventHandler, scope ...any) HTMLBase {
  3208. e.setEventHandler("dragover", h, scope...)
  3209. return e
  3210. }
  3211. func (e *htmlBase) OnDragStart(h EventHandler, scope ...any) HTMLBase {
  3212. e.setEventHandler("dragstart", h, scope...)
  3213. return e
  3214. }
  3215. func (e *htmlBase) OnDrop(h EventHandler, scope ...any) HTMLBase {
  3216. e.setEventHandler("drop", h, scope...)
  3217. return e
  3218. }
  3219. func (e *htmlBase) OnFocus(h EventHandler, scope ...any) HTMLBase {
  3220. e.setEventHandler("focus", h, scope...)
  3221. return e
  3222. }
  3223. func (e *htmlBase) OnInput(h EventHandler, scope ...any) HTMLBase {
  3224. e.setEventHandler("input", h, scope...)
  3225. return e
  3226. }
  3227. func (e *htmlBase) OnInvalid(h EventHandler, scope ...any) HTMLBase {
  3228. e.setEventHandler("invalid", h, scope...)
  3229. return e
  3230. }
  3231. func (e *htmlBase) OnKeyDown(h EventHandler, scope ...any) HTMLBase {
  3232. e.setEventHandler("keydown", h, scope...)
  3233. return e
  3234. }
  3235. func (e *htmlBase) OnKeyPress(h EventHandler, scope ...any) HTMLBase {
  3236. e.setEventHandler("keypress", h, scope...)
  3237. return e
  3238. }
  3239. func (e *htmlBase) OnKeyUp(h EventHandler, scope ...any) HTMLBase {
  3240. e.setEventHandler("keyup", h, scope...)
  3241. return e
  3242. }
  3243. func (e *htmlBase) OnMouseDown(h EventHandler, scope ...any) HTMLBase {
  3244. e.setEventHandler("mousedown", h, scope...)
  3245. return e
  3246. }
  3247. func (e *htmlBase) OnMouseMove(h EventHandler, scope ...any) HTMLBase {
  3248. e.setEventHandler("mousemove", h, scope...)
  3249. return e
  3250. }
  3251. func (e *htmlBase) OnMouseOut(h EventHandler, scope ...any) HTMLBase {
  3252. e.setEventHandler("mouseout", h, scope...)
  3253. return e
  3254. }
  3255. func (e *htmlBase) OnMouseOver(h EventHandler, scope ...any) HTMLBase {
  3256. e.setEventHandler("mouseover", h, scope...)
  3257. return e
  3258. }
  3259. func (e *htmlBase) OnMouseUp(h EventHandler, scope ...any) HTMLBase {
  3260. e.setEventHandler("mouseup", h, scope...)
  3261. return e
  3262. }
  3263. func (e *htmlBase) OnPaste(h EventHandler, scope ...any) HTMLBase {
  3264. e.setEventHandler("paste", h, scope...)
  3265. return e
  3266. }
  3267. func (e *htmlBase) OnReset(h EventHandler, scope ...any) HTMLBase {
  3268. e.setEventHandler("reset", h, scope...)
  3269. return e
  3270. }
  3271. func (e *htmlBase) OnScroll(h EventHandler, scope ...any) HTMLBase {
  3272. e.setEventHandler("scroll", h, scope...)
  3273. return e
  3274. }
  3275. func (e *htmlBase) OnSearch(h EventHandler, scope ...any) HTMLBase {
  3276. e.setEventHandler("search", h, scope...)
  3277. return e
  3278. }
  3279. func (e *htmlBase) OnSelect(h EventHandler, scope ...any) HTMLBase {
  3280. e.setEventHandler("select", h, scope...)
  3281. return e
  3282. }
  3283. func (e *htmlBase) OnSubmit(h EventHandler, scope ...any) HTMLBase {
  3284. e.setEventHandler("submit", h, scope...)
  3285. return e
  3286. }
  3287. func (e *htmlBase) OnWheel(h EventHandler, scope ...any) HTMLBase {
  3288. e.setEventHandler("wheel", h, scope...)
  3289. return e
  3290. }
  3291. // HTMLBdi is the interface that describes a "bdi" HTML element.
  3292. type HTMLBdi interface {
  3293. UI
  3294. // Body set the content of the element.
  3295. Body(elems ...UI) HTMLBdi
  3296. // Text sets the content of the element with a text node containing the stringified given value.
  3297. Text(v any) HTMLBdi
  3298. // AccessKey specifies a shortcut key to activate/focus an element.
  3299. AccessKey(v string) HTMLBdi
  3300. // Aria stores accessible rich internet applications (ARIA) data.
  3301. Aria(k string, v any) HTMLBdi
  3302. // Attr sets the named attribute with the given value.
  3303. Attr(n string, v any) HTMLBdi
  3304. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  3305. Class(v ...string) HTMLBdi
  3306. // ContentEditable specifies whether the content of an element is editable or not.
  3307. ContentEditable(v bool) HTMLBdi
  3308. // DataSet stores custom data private to the page or application.
  3309. DataSet(k string, v any) HTMLBdi
  3310. // Dir specifies the text direction for the content in an element.
  3311. Dir(v string) HTMLBdi
  3312. // Draggable specifies whether an element is draggable or not.
  3313. Draggable(v bool) HTMLBdi
  3314. // Hidden specifies that an element is not yet, or is no longer relevant.
  3315. Hidden(v bool) HTMLBdi
  3316. // ID specifies a unique id for an element.
  3317. ID(v string) HTMLBdi
  3318. // Lang specifies the language of the element's content.
  3319. Lang(v string) HTMLBdi
  3320. // Role specifies to parsing software the exact function of an element (and its children).
  3321. Role(v string) HTMLBdi
  3322. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  3323. Spellcheck(v bool) HTMLBdi
  3324. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  3325. Style(k, v string) HTMLBdi
  3326. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  3327. Styles(s map[string]string) HTMLBdi
  3328. // TabIndex specifies the tabbing order of an element.
  3329. TabIndex(v int) HTMLBdi
  3330. // Title specifies extra information about an element.
  3331. Title(v string) HTMLBdi
  3332. // On registers the given event handler to the specified event.
  3333. On(event string, h EventHandler, scope ...any) HTMLBdi
  3334. // OnBlur calls the given handler when the element loses focus.
  3335. OnBlur(h EventHandler, scope ...any) HTMLBdi
  3336. // OnChange calls the given handler when the value of the element is changed.
  3337. OnChange(h EventHandler, scope ...any) HTMLBdi
  3338. // OnClick calls the given handler when there is a mouse click on the element.
  3339. OnClick(h EventHandler, scope ...any) HTMLBdi
  3340. // OnContextMenu calls the given handler when a context menu is triggered.
  3341. OnContextMenu(h EventHandler, scope ...any) HTMLBdi
  3342. // OnCopy calls the given handler when the user copies the content of an element.
  3343. OnCopy(h EventHandler, scope ...any) HTMLBdi
  3344. // OnCut calls the given handler when the user cuts the content of an element.
  3345. OnCut(h EventHandler, scope ...any) HTMLBdi
  3346. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  3347. OnDblClick(h EventHandler, scope ...any) HTMLBdi
  3348. // OnDrag calls the given handler when an element is dragged.
  3349. OnDrag(h EventHandler, scope ...any) HTMLBdi
  3350. // OnDragEnd calls the given handler at the end of a drag operation.
  3351. OnDragEnd(h EventHandler, scope ...any) HTMLBdi
  3352. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  3353. OnDragEnter(h EventHandler, scope ...any) HTMLBdi
  3354. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  3355. OnDragLeave(h EventHandler, scope ...any) HTMLBdi
  3356. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  3357. OnDragOver(h EventHandler, scope ...any) HTMLBdi
  3358. // OnDragStart calls the given handler at the start of a drag operation.
  3359. OnDragStart(h EventHandler, scope ...any) HTMLBdi
  3360. // OnDrop calls the given handler when dragged element is being dropped.
  3361. OnDrop(h EventHandler, scope ...any) HTMLBdi
  3362. // OnFocus calls the given handler when the element gets focus.
  3363. OnFocus(h EventHandler, scope ...any) HTMLBdi
  3364. // OnInput calls the given handler when an element gets user input.
  3365. OnInput(h EventHandler, scope ...any) HTMLBdi
  3366. // OnInvalid calls the given handler when an element is invalid.
  3367. OnInvalid(h EventHandler, scope ...any) HTMLBdi
  3368. // OnKeyDown calls the given handler when a user is pressing a key.
  3369. OnKeyDown(h EventHandler, scope ...any) HTMLBdi
  3370. // OnKeyPress calls the given handler when a user presses a key.
  3371. OnKeyPress(h EventHandler, scope ...any) HTMLBdi
  3372. // OnKeyUp calls the given handler when a user releases a key.
  3373. OnKeyUp(h EventHandler, scope ...any) HTMLBdi
  3374. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  3375. OnMouseDown(h EventHandler, scope ...any) HTMLBdi
  3376. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  3377. OnMouseMove(h EventHandler, scope ...any) HTMLBdi
  3378. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  3379. OnMouseOut(h EventHandler, scope ...any) HTMLBdi
  3380. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  3381. OnMouseOver(h EventHandler, scope ...any) HTMLBdi
  3382. // OnMouseUp calls the given handler when a mouse button is released over an element.
  3383. OnMouseUp(h EventHandler, scope ...any) HTMLBdi
  3384. // OnPaste calls the given handler when the user pastes some content in an element.
  3385. OnPaste(h EventHandler, scope ...any) HTMLBdi
  3386. // OnReset calls the given handler when the Reset button in a form is clicked.
  3387. OnReset(h EventHandler, scope ...any) HTMLBdi
  3388. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  3389. OnScroll(h EventHandler, scope ...any) HTMLBdi
  3390. // OnSearch calls the given handler when the user writes something in a search field.
  3391. OnSearch(h EventHandler, scope ...any) HTMLBdi
  3392. // OnSelect calls the given handler after some text has been selected in an element.
  3393. OnSelect(h EventHandler, scope ...any) HTMLBdi
  3394. // OnSubmit calls the given handler when a form is submitted.
  3395. OnSubmit(h EventHandler, scope ...any) HTMLBdi
  3396. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  3397. OnWheel(h EventHandler, scope ...any) HTMLBdi
  3398. }
  3399. // Bdi returns an HTML element that isolates a part of text that might be formatted in a different direction from other text outside it.
  3400. func Bdi() HTMLBdi {
  3401. e := &htmlBdi{
  3402. htmlElement: htmlElement{
  3403. tag: "bdi",
  3404. isSelfClosing: false,
  3405. },
  3406. }
  3407. return e
  3408. }
  3409. type htmlBdi struct {
  3410. htmlElement
  3411. }
  3412. func (e *htmlBdi) Body(v ...UI) HTMLBdi {
  3413. e.setChildren(v...)
  3414. return e
  3415. }
  3416. func (e *htmlBdi) Text(v any) HTMLBdi {
  3417. return e.Body(Text(v))
  3418. }
  3419. func (e *htmlBdi) AccessKey(v string) HTMLBdi {
  3420. e.setAttr("accesskey", v)
  3421. return e
  3422. }
  3423. func (e *htmlBdi) Aria(k string, v any) HTMLBdi {
  3424. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  3425. return e
  3426. }
  3427. func (e *htmlBdi) Attr(n string, v any) HTMLBdi {
  3428. e.setAttr(n, v)
  3429. return e
  3430. }
  3431. func (e *htmlBdi) Class(v ...string) HTMLBdi {
  3432. e.setAttr("class", strings.Join(v, " "))
  3433. return e
  3434. }
  3435. func (e *htmlBdi) ContentEditable(v bool) HTMLBdi {
  3436. e.setAttr("contenteditable", v)
  3437. return e
  3438. }
  3439. func (e *htmlBdi) DataSet(k string, v any) HTMLBdi {
  3440. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  3441. return e
  3442. }
  3443. func (e *htmlBdi) Dir(v string) HTMLBdi {
  3444. e.setAttr("dir", v)
  3445. return e
  3446. }
  3447. func (e *htmlBdi) Draggable(v bool) HTMLBdi {
  3448. e.setAttr("draggable", v)
  3449. return e
  3450. }
  3451. func (e *htmlBdi) Hidden(v bool) HTMLBdi {
  3452. e.setAttr("hidden", v)
  3453. return e
  3454. }
  3455. func (e *htmlBdi) ID(v string) HTMLBdi {
  3456. e.setAttr("id", v)
  3457. return e
  3458. }
  3459. func (e *htmlBdi) Lang(v string) HTMLBdi {
  3460. e.setAttr("lang", v)
  3461. return e
  3462. }
  3463. func (e *htmlBdi) Role(v string) HTMLBdi {
  3464. e.setAttr("role", v)
  3465. return e
  3466. }
  3467. func (e *htmlBdi) Spellcheck(v bool) HTMLBdi {
  3468. s := "false"
  3469. if v {
  3470. s = "true"
  3471. }
  3472. e.setAttr("spellcheck", s)
  3473. return e
  3474. }
  3475. func (e *htmlBdi) Style(k, v string) HTMLBdi {
  3476. e.setAttr("style", k+":"+v)
  3477. return e
  3478. }
  3479. func (e *htmlBdi) Styles(s map[string]string) HTMLBdi {
  3480. for k, v := range s {
  3481. e.Style(k, v)
  3482. }
  3483. return e
  3484. }
  3485. func (e *htmlBdi) TabIndex(v int) HTMLBdi {
  3486. e.setAttr("tabindex", v)
  3487. return e
  3488. }
  3489. func (e *htmlBdi) Title(v string) HTMLBdi {
  3490. e.setAttr("title", v)
  3491. return e
  3492. }
  3493. func (e *htmlBdi) On(event string, h EventHandler, scope ...any) HTMLBdi {
  3494. e.setEventHandler(event, h, scope...)
  3495. return e
  3496. }
  3497. func (e *htmlBdi) OnBlur(h EventHandler, scope ...any) HTMLBdi {
  3498. e.setEventHandler("blur", h, scope...)
  3499. return e
  3500. }
  3501. func (e *htmlBdi) OnChange(h EventHandler, scope ...any) HTMLBdi {
  3502. e.setEventHandler("change", h, scope...)
  3503. return e
  3504. }
  3505. func (e *htmlBdi) OnClick(h EventHandler, scope ...any) HTMLBdi {
  3506. e.setEventHandler("click", h, scope...)
  3507. return e
  3508. }
  3509. func (e *htmlBdi) OnContextMenu(h EventHandler, scope ...any) HTMLBdi {
  3510. e.setEventHandler("contextmenu", h, scope...)
  3511. return e
  3512. }
  3513. func (e *htmlBdi) OnCopy(h EventHandler, scope ...any) HTMLBdi {
  3514. e.setEventHandler("copy", h, scope...)
  3515. return e
  3516. }
  3517. func (e *htmlBdi) OnCut(h EventHandler, scope ...any) HTMLBdi {
  3518. e.setEventHandler("cut", h, scope...)
  3519. return e
  3520. }
  3521. func (e *htmlBdi) OnDblClick(h EventHandler, scope ...any) HTMLBdi {
  3522. e.setEventHandler("dblclick", h, scope...)
  3523. return e
  3524. }
  3525. func (e *htmlBdi) OnDrag(h EventHandler, scope ...any) HTMLBdi {
  3526. e.setEventHandler("drag", h, scope...)
  3527. return e
  3528. }
  3529. func (e *htmlBdi) OnDragEnd(h EventHandler, scope ...any) HTMLBdi {
  3530. e.setEventHandler("dragend", h, scope...)
  3531. return e
  3532. }
  3533. func (e *htmlBdi) OnDragEnter(h EventHandler, scope ...any) HTMLBdi {
  3534. e.setEventHandler("dragenter", h, scope...)
  3535. return e
  3536. }
  3537. func (e *htmlBdi) OnDragLeave(h EventHandler, scope ...any) HTMLBdi {
  3538. e.setEventHandler("dragleave", h, scope...)
  3539. return e
  3540. }
  3541. func (e *htmlBdi) OnDragOver(h EventHandler, scope ...any) HTMLBdi {
  3542. e.setEventHandler("dragover", h, scope...)
  3543. return e
  3544. }
  3545. func (e *htmlBdi) OnDragStart(h EventHandler, scope ...any) HTMLBdi {
  3546. e.setEventHandler("dragstart", h, scope...)
  3547. return e
  3548. }
  3549. func (e *htmlBdi) OnDrop(h EventHandler, scope ...any) HTMLBdi {
  3550. e.setEventHandler("drop", h, scope...)
  3551. return e
  3552. }
  3553. func (e *htmlBdi) OnFocus(h EventHandler, scope ...any) HTMLBdi {
  3554. e.setEventHandler("focus", h, scope...)
  3555. return e
  3556. }
  3557. func (e *htmlBdi) OnInput(h EventHandler, scope ...any) HTMLBdi {
  3558. e.setEventHandler("input", h, scope...)
  3559. return e
  3560. }
  3561. func (e *htmlBdi) OnInvalid(h EventHandler, scope ...any) HTMLBdi {
  3562. e.setEventHandler("invalid", h, scope...)
  3563. return e
  3564. }
  3565. func (e *htmlBdi) OnKeyDown(h EventHandler, scope ...any) HTMLBdi {
  3566. e.setEventHandler("keydown", h, scope...)
  3567. return e
  3568. }
  3569. func (e *htmlBdi) OnKeyPress(h EventHandler, scope ...any) HTMLBdi {
  3570. e.setEventHandler("keypress", h, scope...)
  3571. return e
  3572. }
  3573. func (e *htmlBdi) OnKeyUp(h EventHandler, scope ...any) HTMLBdi {
  3574. e.setEventHandler("keyup", h, scope...)
  3575. return e
  3576. }
  3577. func (e *htmlBdi) OnMouseDown(h EventHandler, scope ...any) HTMLBdi {
  3578. e.setEventHandler("mousedown", h, scope...)
  3579. return e
  3580. }
  3581. func (e *htmlBdi) OnMouseMove(h EventHandler, scope ...any) HTMLBdi {
  3582. e.setEventHandler("mousemove", h, scope...)
  3583. return e
  3584. }
  3585. func (e *htmlBdi) OnMouseOut(h EventHandler, scope ...any) HTMLBdi {
  3586. e.setEventHandler("mouseout", h, scope...)
  3587. return e
  3588. }
  3589. func (e *htmlBdi) OnMouseOver(h EventHandler, scope ...any) HTMLBdi {
  3590. e.setEventHandler("mouseover", h, scope...)
  3591. return e
  3592. }
  3593. func (e *htmlBdi) OnMouseUp(h EventHandler, scope ...any) HTMLBdi {
  3594. e.setEventHandler("mouseup", h, scope...)
  3595. return e
  3596. }
  3597. func (e *htmlBdi) OnPaste(h EventHandler, scope ...any) HTMLBdi {
  3598. e.setEventHandler("paste", h, scope...)
  3599. return e
  3600. }
  3601. func (e *htmlBdi) OnReset(h EventHandler, scope ...any) HTMLBdi {
  3602. e.setEventHandler("reset", h, scope...)
  3603. return e
  3604. }
  3605. func (e *htmlBdi) OnScroll(h EventHandler, scope ...any) HTMLBdi {
  3606. e.setEventHandler("scroll", h, scope...)
  3607. return e
  3608. }
  3609. func (e *htmlBdi) OnSearch(h EventHandler, scope ...any) HTMLBdi {
  3610. e.setEventHandler("search", h, scope...)
  3611. return e
  3612. }
  3613. func (e *htmlBdi) OnSelect(h EventHandler, scope ...any) HTMLBdi {
  3614. e.setEventHandler("select", h, scope...)
  3615. return e
  3616. }
  3617. func (e *htmlBdi) OnSubmit(h EventHandler, scope ...any) HTMLBdi {
  3618. e.setEventHandler("submit", h, scope...)
  3619. return e
  3620. }
  3621. func (e *htmlBdi) OnWheel(h EventHandler, scope ...any) HTMLBdi {
  3622. e.setEventHandler("wheel", h, scope...)
  3623. return e
  3624. }
  3625. // HTMLBdo is the interface that describes a "bdo" HTML element.
  3626. type HTMLBdo interface {
  3627. UI
  3628. // Body set the content of the element.
  3629. Body(elems ...UI) HTMLBdo
  3630. // Text sets the content of the element with a text node containing the stringified given value.
  3631. Text(v any) HTMLBdo
  3632. // AccessKey specifies a shortcut key to activate/focus an element.
  3633. AccessKey(v string) HTMLBdo
  3634. // Aria stores accessible rich internet applications (ARIA) data.
  3635. Aria(k string, v any) HTMLBdo
  3636. // Attr sets the named attribute with the given value.
  3637. Attr(n string, v any) HTMLBdo
  3638. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  3639. Class(v ...string) HTMLBdo
  3640. // ContentEditable specifies whether the content of an element is editable or not.
  3641. ContentEditable(v bool) HTMLBdo
  3642. // DataSet stores custom data private to the page or application.
  3643. DataSet(k string, v any) HTMLBdo
  3644. // Dir specifies the text direction for the content in an element.
  3645. Dir(v string) HTMLBdo
  3646. // Draggable specifies whether an element is draggable or not.
  3647. Draggable(v bool) HTMLBdo
  3648. // Hidden specifies that an element is not yet, or is no longer relevant.
  3649. Hidden(v bool) HTMLBdo
  3650. // ID specifies a unique id for an element.
  3651. ID(v string) HTMLBdo
  3652. // Lang specifies the language of the element's content.
  3653. Lang(v string) HTMLBdo
  3654. // Role specifies to parsing software the exact function of an element (and its children).
  3655. Role(v string) HTMLBdo
  3656. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  3657. Spellcheck(v bool) HTMLBdo
  3658. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  3659. Style(k, v string) HTMLBdo
  3660. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  3661. Styles(s map[string]string) HTMLBdo
  3662. // TabIndex specifies the tabbing order of an element.
  3663. TabIndex(v int) HTMLBdo
  3664. // Title specifies extra information about an element.
  3665. Title(v string) HTMLBdo
  3666. // On registers the given event handler to the specified event.
  3667. On(event string, h EventHandler, scope ...any) HTMLBdo
  3668. // OnBlur calls the given handler when the element loses focus.
  3669. OnBlur(h EventHandler, scope ...any) HTMLBdo
  3670. // OnChange calls the given handler when the value of the element is changed.
  3671. OnChange(h EventHandler, scope ...any) HTMLBdo
  3672. // OnClick calls the given handler when there is a mouse click on the element.
  3673. OnClick(h EventHandler, scope ...any) HTMLBdo
  3674. // OnContextMenu calls the given handler when a context menu is triggered.
  3675. OnContextMenu(h EventHandler, scope ...any) HTMLBdo
  3676. // OnCopy calls the given handler when the user copies the content of an element.
  3677. OnCopy(h EventHandler, scope ...any) HTMLBdo
  3678. // OnCut calls the given handler when the user cuts the content of an element.
  3679. OnCut(h EventHandler, scope ...any) HTMLBdo
  3680. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  3681. OnDblClick(h EventHandler, scope ...any) HTMLBdo
  3682. // OnDrag calls the given handler when an element is dragged.
  3683. OnDrag(h EventHandler, scope ...any) HTMLBdo
  3684. // OnDragEnd calls the given handler at the end of a drag operation.
  3685. OnDragEnd(h EventHandler, scope ...any) HTMLBdo
  3686. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  3687. OnDragEnter(h EventHandler, scope ...any) HTMLBdo
  3688. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  3689. OnDragLeave(h EventHandler, scope ...any) HTMLBdo
  3690. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  3691. OnDragOver(h EventHandler, scope ...any) HTMLBdo
  3692. // OnDragStart calls the given handler at the start of a drag operation.
  3693. OnDragStart(h EventHandler, scope ...any) HTMLBdo
  3694. // OnDrop calls the given handler when dragged element is being dropped.
  3695. OnDrop(h EventHandler, scope ...any) HTMLBdo
  3696. // OnFocus calls the given handler when the element gets focus.
  3697. OnFocus(h EventHandler, scope ...any) HTMLBdo
  3698. // OnInput calls the given handler when an element gets user input.
  3699. OnInput(h EventHandler, scope ...any) HTMLBdo
  3700. // OnInvalid calls the given handler when an element is invalid.
  3701. OnInvalid(h EventHandler, scope ...any) HTMLBdo
  3702. // OnKeyDown calls the given handler when a user is pressing a key.
  3703. OnKeyDown(h EventHandler, scope ...any) HTMLBdo
  3704. // OnKeyPress calls the given handler when a user presses a key.
  3705. OnKeyPress(h EventHandler, scope ...any) HTMLBdo
  3706. // OnKeyUp calls the given handler when a user releases a key.
  3707. OnKeyUp(h EventHandler, scope ...any) HTMLBdo
  3708. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  3709. OnMouseDown(h EventHandler, scope ...any) HTMLBdo
  3710. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  3711. OnMouseMove(h EventHandler, scope ...any) HTMLBdo
  3712. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  3713. OnMouseOut(h EventHandler, scope ...any) HTMLBdo
  3714. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  3715. OnMouseOver(h EventHandler, scope ...any) HTMLBdo
  3716. // OnMouseUp calls the given handler when a mouse button is released over an element.
  3717. OnMouseUp(h EventHandler, scope ...any) HTMLBdo
  3718. // OnPaste calls the given handler when the user pastes some content in an element.
  3719. OnPaste(h EventHandler, scope ...any) HTMLBdo
  3720. // OnReset calls the given handler when the Reset button in a form is clicked.
  3721. OnReset(h EventHandler, scope ...any) HTMLBdo
  3722. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  3723. OnScroll(h EventHandler, scope ...any) HTMLBdo
  3724. // OnSearch calls the given handler when the user writes something in a search field.
  3725. OnSearch(h EventHandler, scope ...any) HTMLBdo
  3726. // OnSelect calls the given handler after some text has been selected in an element.
  3727. OnSelect(h EventHandler, scope ...any) HTMLBdo
  3728. // OnSubmit calls the given handler when a form is submitted.
  3729. OnSubmit(h EventHandler, scope ...any) HTMLBdo
  3730. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  3731. OnWheel(h EventHandler, scope ...any) HTMLBdo
  3732. }
  3733. // Bdo returns an HTML element that overrides the current text direction.
  3734. func Bdo() HTMLBdo {
  3735. e := &htmlBdo{
  3736. htmlElement: htmlElement{
  3737. tag: "bdo",
  3738. isSelfClosing: false,
  3739. },
  3740. }
  3741. return e
  3742. }
  3743. type htmlBdo struct {
  3744. htmlElement
  3745. }
  3746. func (e *htmlBdo) Body(v ...UI) HTMLBdo {
  3747. e.setChildren(v...)
  3748. return e
  3749. }
  3750. func (e *htmlBdo) Text(v any) HTMLBdo {
  3751. return e.Body(Text(v))
  3752. }
  3753. func (e *htmlBdo) AccessKey(v string) HTMLBdo {
  3754. e.setAttr("accesskey", v)
  3755. return e
  3756. }
  3757. func (e *htmlBdo) Aria(k string, v any) HTMLBdo {
  3758. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  3759. return e
  3760. }
  3761. func (e *htmlBdo) Attr(n string, v any) HTMLBdo {
  3762. e.setAttr(n, v)
  3763. return e
  3764. }
  3765. func (e *htmlBdo) Class(v ...string) HTMLBdo {
  3766. e.setAttr("class", strings.Join(v, " "))
  3767. return e
  3768. }
  3769. func (e *htmlBdo) ContentEditable(v bool) HTMLBdo {
  3770. e.setAttr("contenteditable", v)
  3771. return e
  3772. }
  3773. func (e *htmlBdo) DataSet(k string, v any) HTMLBdo {
  3774. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  3775. return e
  3776. }
  3777. func (e *htmlBdo) Dir(v string) HTMLBdo {
  3778. e.setAttr("dir", v)
  3779. return e
  3780. }
  3781. func (e *htmlBdo) Draggable(v bool) HTMLBdo {
  3782. e.setAttr("draggable", v)
  3783. return e
  3784. }
  3785. func (e *htmlBdo) Hidden(v bool) HTMLBdo {
  3786. e.setAttr("hidden", v)
  3787. return e
  3788. }
  3789. func (e *htmlBdo) ID(v string) HTMLBdo {
  3790. e.setAttr("id", v)
  3791. return e
  3792. }
  3793. func (e *htmlBdo) Lang(v string) HTMLBdo {
  3794. e.setAttr("lang", v)
  3795. return e
  3796. }
  3797. func (e *htmlBdo) Role(v string) HTMLBdo {
  3798. e.setAttr("role", v)
  3799. return e
  3800. }
  3801. func (e *htmlBdo) Spellcheck(v bool) HTMLBdo {
  3802. s := "false"
  3803. if v {
  3804. s = "true"
  3805. }
  3806. e.setAttr("spellcheck", s)
  3807. return e
  3808. }
  3809. func (e *htmlBdo) Style(k, v string) HTMLBdo {
  3810. e.setAttr("style", k+":"+v)
  3811. return e
  3812. }
  3813. func (e *htmlBdo) Styles(s map[string]string) HTMLBdo {
  3814. for k, v := range s {
  3815. e.Style(k, v)
  3816. }
  3817. return e
  3818. }
  3819. func (e *htmlBdo) TabIndex(v int) HTMLBdo {
  3820. e.setAttr("tabindex", v)
  3821. return e
  3822. }
  3823. func (e *htmlBdo) Title(v string) HTMLBdo {
  3824. e.setAttr("title", v)
  3825. return e
  3826. }
  3827. func (e *htmlBdo) On(event string, h EventHandler, scope ...any) HTMLBdo {
  3828. e.setEventHandler(event, h, scope...)
  3829. return e
  3830. }
  3831. func (e *htmlBdo) OnBlur(h EventHandler, scope ...any) HTMLBdo {
  3832. e.setEventHandler("blur", h, scope...)
  3833. return e
  3834. }
  3835. func (e *htmlBdo) OnChange(h EventHandler, scope ...any) HTMLBdo {
  3836. e.setEventHandler("change", h, scope...)
  3837. return e
  3838. }
  3839. func (e *htmlBdo) OnClick(h EventHandler, scope ...any) HTMLBdo {
  3840. e.setEventHandler("click", h, scope...)
  3841. return e
  3842. }
  3843. func (e *htmlBdo) OnContextMenu(h EventHandler, scope ...any) HTMLBdo {
  3844. e.setEventHandler("contextmenu", h, scope...)
  3845. return e
  3846. }
  3847. func (e *htmlBdo) OnCopy(h EventHandler, scope ...any) HTMLBdo {
  3848. e.setEventHandler("copy", h, scope...)
  3849. return e
  3850. }
  3851. func (e *htmlBdo) OnCut(h EventHandler, scope ...any) HTMLBdo {
  3852. e.setEventHandler("cut", h, scope...)
  3853. return e
  3854. }
  3855. func (e *htmlBdo) OnDblClick(h EventHandler, scope ...any) HTMLBdo {
  3856. e.setEventHandler("dblclick", h, scope...)
  3857. return e
  3858. }
  3859. func (e *htmlBdo) OnDrag(h EventHandler, scope ...any) HTMLBdo {
  3860. e.setEventHandler("drag", h, scope...)
  3861. return e
  3862. }
  3863. func (e *htmlBdo) OnDragEnd(h EventHandler, scope ...any) HTMLBdo {
  3864. e.setEventHandler("dragend", h, scope...)
  3865. return e
  3866. }
  3867. func (e *htmlBdo) OnDragEnter(h EventHandler, scope ...any) HTMLBdo {
  3868. e.setEventHandler("dragenter", h, scope...)
  3869. return e
  3870. }
  3871. func (e *htmlBdo) OnDragLeave(h EventHandler, scope ...any) HTMLBdo {
  3872. e.setEventHandler("dragleave", h, scope...)
  3873. return e
  3874. }
  3875. func (e *htmlBdo) OnDragOver(h EventHandler, scope ...any) HTMLBdo {
  3876. e.setEventHandler("dragover", h, scope...)
  3877. return e
  3878. }
  3879. func (e *htmlBdo) OnDragStart(h EventHandler, scope ...any) HTMLBdo {
  3880. e.setEventHandler("dragstart", h, scope...)
  3881. return e
  3882. }
  3883. func (e *htmlBdo) OnDrop(h EventHandler, scope ...any) HTMLBdo {
  3884. e.setEventHandler("drop", h, scope...)
  3885. return e
  3886. }
  3887. func (e *htmlBdo) OnFocus(h EventHandler, scope ...any) HTMLBdo {
  3888. e.setEventHandler("focus", h, scope...)
  3889. return e
  3890. }
  3891. func (e *htmlBdo) OnInput(h EventHandler, scope ...any) HTMLBdo {
  3892. e.setEventHandler("input", h, scope...)
  3893. return e
  3894. }
  3895. func (e *htmlBdo) OnInvalid(h EventHandler, scope ...any) HTMLBdo {
  3896. e.setEventHandler("invalid", h, scope...)
  3897. return e
  3898. }
  3899. func (e *htmlBdo) OnKeyDown(h EventHandler, scope ...any) HTMLBdo {
  3900. e.setEventHandler("keydown", h, scope...)
  3901. return e
  3902. }
  3903. func (e *htmlBdo) OnKeyPress(h EventHandler, scope ...any) HTMLBdo {
  3904. e.setEventHandler("keypress", h, scope...)
  3905. return e
  3906. }
  3907. func (e *htmlBdo) OnKeyUp(h EventHandler, scope ...any) HTMLBdo {
  3908. e.setEventHandler("keyup", h, scope...)
  3909. return e
  3910. }
  3911. func (e *htmlBdo) OnMouseDown(h EventHandler, scope ...any) HTMLBdo {
  3912. e.setEventHandler("mousedown", h, scope...)
  3913. return e
  3914. }
  3915. func (e *htmlBdo) OnMouseMove(h EventHandler, scope ...any) HTMLBdo {
  3916. e.setEventHandler("mousemove", h, scope...)
  3917. return e
  3918. }
  3919. func (e *htmlBdo) OnMouseOut(h EventHandler, scope ...any) HTMLBdo {
  3920. e.setEventHandler("mouseout", h, scope...)
  3921. return e
  3922. }
  3923. func (e *htmlBdo) OnMouseOver(h EventHandler, scope ...any) HTMLBdo {
  3924. e.setEventHandler("mouseover", h, scope...)
  3925. return e
  3926. }
  3927. func (e *htmlBdo) OnMouseUp(h EventHandler, scope ...any) HTMLBdo {
  3928. e.setEventHandler("mouseup", h, scope...)
  3929. return e
  3930. }
  3931. func (e *htmlBdo) OnPaste(h EventHandler, scope ...any) HTMLBdo {
  3932. e.setEventHandler("paste", h, scope...)
  3933. return e
  3934. }
  3935. func (e *htmlBdo) OnReset(h EventHandler, scope ...any) HTMLBdo {
  3936. e.setEventHandler("reset", h, scope...)
  3937. return e
  3938. }
  3939. func (e *htmlBdo) OnScroll(h EventHandler, scope ...any) HTMLBdo {
  3940. e.setEventHandler("scroll", h, scope...)
  3941. return e
  3942. }
  3943. func (e *htmlBdo) OnSearch(h EventHandler, scope ...any) HTMLBdo {
  3944. e.setEventHandler("search", h, scope...)
  3945. return e
  3946. }
  3947. func (e *htmlBdo) OnSelect(h EventHandler, scope ...any) HTMLBdo {
  3948. e.setEventHandler("select", h, scope...)
  3949. return e
  3950. }
  3951. func (e *htmlBdo) OnSubmit(h EventHandler, scope ...any) HTMLBdo {
  3952. e.setEventHandler("submit", h, scope...)
  3953. return e
  3954. }
  3955. func (e *htmlBdo) OnWheel(h EventHandler, scope ...any) HTMLBdo {
  3956. e.setEventHandler("wheel", h, scope...)
  3957. return e
  3958. }
  3959. // HTMLBlockquote is the interface that describes a "blockquote" HTML element.
  3960. type HTMLBlockquote interface {
  3961. UI
  3962. // Body set the content of the element.
  3963. Body(elems ...UI) HTMLBlockquote
  3964. // Text sets the content of the element with a text node containing the stringified given value.
  3965. Text(v any) HTMLBlockquote
  3966. // AccessKey specifies a shortcut key to activate/focus an element.
  3967. AccessKey(v string) HTMLBlockquote
  3968. // Aria stores accessible rich internet applications (ARIA) data.
  3969. Aria(k string, v any) HTMLBlockquote
  3970. // Attr sets the named attribute with the given value.
  3971. Attr(n string, v any) HTMLBlockquote
  3972. // Cite specifies a URL which explains the quote/deleted/inserted text.
  3973. Cite(v string) HTMLBlockquote
  3974. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  3975. Class(v ...string) HTMLBlockquote
  3976. // ContentEditable specifies whether the content of an element is editable or not.
  3977. ContentEditable(v bool) HTMLBlockquote
  3978. // DataSet stores custom data private to the page or application.
  3979. DataSet(k string, v any) HTMLBlockquote
  3980. // Dir specifies the text direction for the content in an element.
  3981. Dir(v string) HTMLBlockquote
  3982. // Draggable specifies whether an element is draggable or not.
  3983. Draggable(v bool) HTMLBlockquote
  3984. // Hidden specifies that an element is not yet, or is no longer relevant.
  3985. Hidden(v bool) HTMLBlockquote
  3986. // ID specifies a unique id for an element.
  3987. ID(v string) HTMLBlockquote
  3988. // Lang specifies the language of the element's content.
  3989. Lang(v string) HTMLBlockquote
  3990. // Role specifies to parsing software the exact function of an element (and its children).
  3991. Role(v string) HTMLBlockquote
  3992. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  3993. Spellcheck(v bool) HTMLBlockquote
  3994. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  3995. Style(k, v string) HTMLBlockquote
  3996. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  3997. Styles(s map[string]string) HTMLBlockquote
  3998. // TabIndex specifies the tabbing order of an element.
  3999. TabIndex(v int) HTMLBlockquote
  4000. // Title specifies extra information about an element.
  4001. Title(v string) HTMLBlockquote
  4002. // On registers the given event handler to the specified event.
  4003. On(event string, h EventHandler, scope ...any) HTMLBlockquote
  4004. // OnBlur calls the given handler when the element loses focus.
  4005. OnBlur(h EventHandler, scope ...any) HTMLBlockquote
  4006. // OnChange calls the given handler when the value of the element is changed.
  4007. OnChange(h EventHandler, scope ...any) HTMLBlockquote
  4008. // OnClick calls the given handler when there is a mouse click on the element.
  4009. OnClick(h EventHandler, scope ...any) HTMLBlockquote
  4010. // OnContextMenu calls the given handler when a context menu is triggered.
  4011. OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote
  4012. // OnCopy calls the given handler when the user copies the content of an element.
  4013. OnCopy(h EventHandler, scope ...any) HTMLBlockquote
  4014. // OnCut calls the given handler when the user cuts the content of an element.
  4015. OnCut(h EventHandler, scope ...any) HTMLBlockquote
  4016. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  4017. OnDblClick(h EventHandler, scope ...any) HTMLBlockquote
  4018. // OnDrag calls the given handler when an element is dragged.
  4019. OnDrag(h EventHandler, scope ...any) HTMLBlockquote
  4020. // OnDragEnd calls the given handler at the end of a drag operation.
  4021. OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote
  4022. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  4023. OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote
  4024. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  4025. OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote
  4026. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  4027. OnDragOver(h EventHandler, scope ...any) HTMLBlockquote
  4028. // OnDragStart calls the given handler at the start of a drag operation.
  4029. OnDragStart(h EventHandler, scope ...any) HTMLBlockquote
  4030. // OnDrop calls the given handler when dragged element is being dropped.
  4031. OnDrop(h EventHandler, scope ...any) HTMLBlockquote
  4032. // OnFocus calls the given handler when the element gets focus.
  4033. OnFocus(h EventHandler, scope ...any) HTMLBlockquote
  4034. // OnInput calls the given handler when an element gets user input.
  4035. OnInput(h EventHandler, scope ...any) HTMLBlockquote
  4036. // OnInvalid calls the given handler when an element is invalid.
  4037. OnInvalid(h EventHandler, scope ...any) HTMLBlockquote
  4038. // OnKeyDown calls the given handler when a user is pressing a key.
  4039. OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote
  4040. // OnKeyPress calls the given handler when a user presses a key.
  4041. OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote
  4042. // OnKeyUp calls the given handler when a user releases a key.
  4043. OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote
  4044. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  4045. OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote
  4046. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  4047. OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote
  4048. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  4049. OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote
  4050. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  4051. OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote
  4052. // OnMouseUp calls the given handler when a mouse button is released over an element.
  4053. OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote
  4054. // OnPaste calls the given handler when the user pastes some content in an element.
  4055. OnPaste(h EventHandler, scope ...any) HTMLBlockquote
  4056. // OnReset calls the given handler when the Reset button in a form is clicked.
  4057. OnReset(h EventHandler, scope ...any) HTMLBlockquote
  4058. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  4059. OnScroll(h EventHandler, scope ...any) HTMLBlockquote
  4060. // OnSearch calls the given handler when the user writes something in a search field.
  4061. OnSearch(h EventHandler, scope ...any) HTMLBlockquote
  4062. // OnSelect calls the given handler after some text has been selected in an element.
  4063. OnSelect(h EventHandler, scope ...any) HTMLBlockquote
  4064. // OnSubmit calls the given handler when a form is submitted.
  4065. OnSubmit(h EventHandler, scope ...any) HTMLBlockquote
  4066. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  4067. OnWheel(h EventHandler, scope ...any) HTMLBlockquote
  4068. }
  4069. // Blockquote returns an HTML element that defines a section that is quoted from another source.
  4070. func Blockquote() HTMLBlockquote {
  4071. e := &htmlBlockquote{
  4072. htmlElement: htmlElement{
  4073. tag: "blockquote",
  4074. isSelfClosing: false,
  4075. },
  4076. }
  4077. return e
  4078. }
  4079. type htmlBlockquote struct {
  4080. htmlElement
  4081. }
  4082. func (e *htmlBlockquote) Body(v ...UI) HTMLBlockquote {
  4083. e.setChildren(v...)
  4084. return e
  4085. }
  4086. func (e *htmlBlockquote) Text(v any) HTMLBlockquote {
  4087. return e.Body(Text(v))
  4088. }
  4089. func (e *htmlBlockquote) AccessKey(v string) HTMLBlockquote {
  4090. e.setAttr("accesskey", v)
  4091. return e
  4092. }
  4093. func (e *htmlBlockquote) Aria(k string, v any) HTMLBlockquote {
  4094. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  4095. return e
  4096. }
  4097. func (e *htmlBlockquote) Attr(n string, v any) HTMLBlockquote {
  4098. e.setAttr(n, v)
  4099. return e
  4100. }
  4101. func (e *htmlBlockquote) Cite(v string) HTMLBlockquote {
  4102. e.setAttr("cite", v)
  4103. return e
  4104. }
  4105. func (e *htmlBlockquote) Class(v ...string) HTMLBlockquote {
  4106. e.setAttr("class", strings.Join(v, " "))
  4107. return e
  4108. }
  4109. func (e *htmlBlockquote) ContentEditable(v bool) HTMLBlockquote {
  4110. e.setAttr("contenteditable", v)
  4111. return e
  4112. }
  4113. func (e *htmlBlockquote) DataSet(k string, v any) HTMLBlockquote {
  4114. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  4115. return e
  4116. }
  4117. func (e *htmlBlockquote) Dir(v string) HTMLBlockquote {
  4118. e.setAttr("dir", v)
  4119. return e
  4120. }
  4121. func (e *htmlBlockquote) Draggable(v bool) HTMLBlockquote {
  4122. e.setAttr("draggable", v)
  4123. return e
  4124. }
  4125. func (e *htmlBlockquote) Hidden(v bool) HTMLBlockquote {
  4126. e.setAttr("hidden", v)
  4127. return e
  4128. }
  4129. func (e *htmlBlockquote) ID(v string) HTMLBlockquote {
  4130. e.setAttr("id", v)
  4131. return e
  4132. }
  4133. func (e *htmlBlockquote) Lang(v string) HTMLBlockquote {
  4134. e.setAttr("lang", v)
  4135. return e
  4136. }
  4137. func (e *htmlBlockquote) Role(v string) HTMLBlockquote {
  4138. e.setAttr("role", v)
  4139. return e
  4140. }
  4141. func (e *htmlBlockquote) Spellcheck(v bool) HTMLBlockquote {
  4142. s := "false"
  4143. if v {
  4144. s = "true"
  4145. }
  4146. e.setAttr("spellcheck", s)
  4147. return e
  4148. }
  4149. func (e *htmlBlockquote) Style(k, v string) HTMLBlockquote {
  4150. e.setAttr("style", k+":"+v)
  4151. return e
  4152. }
  4153. func (e *htmlBlockquote) Styles(s map[string]string) HTMLBlockquote {
  4154. for k, v := range s {
  4155. e.Style(k, v)
  4156. }
  4157. return e
  4158. }
  4159. func (e *htmlBlockquote) TabIndex(v int) HTMLBlockquote {
  4160. e.setAttr("tabindex", v)
  4161. return e
  4162. }
  4163. func (e *htmlBlockquote) Title(v string) HTMLBlockquote {
  4164. e.setAttr("title", v)
  4165. return e
  4166. }
  4167. func (e *htmlBlockquote) On(event string, h EventHandler, scope ...any) HTMLBlockquote {
  4168. e.setEventHandler(event, h, scope...)
  4169. return e
  4170. }
  4171. func (e *htmlBlockquote) OnBlur(h EventHandler, scope ...any) HTMLBlockquote {
  4172. e.setEventHandler("blur", h, scope...)
  4173. return e
  4174. }
  4175. func (e *htmlBlockquote) OnChange(h EventHandler, scope ...any) HTMLBlockquote {
  4176. e.setEventHandler("change", h, scope...)
  4177. return e
  4178. }
  4179. func (e *htmlBlockquote) OnClick(h EventHandler, scope ...any) HTMLBlockquote {
  4180. e.setEventHandler("click", h, scope...)
  4181. return e
  4182. }
  4183. func (e *htmlBlockquote) OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote {
  4184. e.setEventHandler("contextmenu", h, scope...)
  4185. return e
  4186. }
  4187. func (e *htmlBlockquote) OnCopy(h EventHandler, scope ...any) HTMLBlockquote {
  4188. e.setEventHandler("copy", h, scope...)
  4189. return e
  4190. }
  4191. func (e *htmlBlockquote) OnCut(h EventHandler, scope ...any) HTMLBlockquote {
  4192. e.setEventHandler("cut", h, scope...)
  4193. return e
  4194. }
  4195. func (e *htmlBlockquote) OnDblClick(h EventHandler, scope ...any) HTMLBlockquote {
  4196. e.setEventHandler("dblclick", h, scope...)
  4197. return e
  4198. }
  4199. func (e *htmlBlockquote) OnDrag(h EventHandler, scope ...any) HTMLBlockquote {
  4200. e.setEventHandler("drag", h, scope...)
  4201. return e
  4202. }
  4203. func (e *htmlBlockquote) OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote {
  4204. e.setEventHandler("dragend", h, scope...)
  4205. return e
  4206. }
  4207. func (e *htmlBlockquote) OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote {
  4208. e.setEventHandler("dragenter", h, scope...)
  4209. return e
  4210. }
  4211. func (e *htmlBlockquote) OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote {
  4212. e.setEventHandler("dragleave", h, scope...)
  4213. return e
  4214. }
  4215. func (e *htmlBlockquote) OnDragOver(h EventHandler, scope ...any) HTMLBlockquote {
  4216. e.setEventHandler("dragover", h, scope...)
  4217. return e
  4218. }
  4219. func (e *htmlBlockquote) OnDragStart(h EventHandler, scope ...any) HTMLBlockquote {
  4220. e.setEventHandler("dragstart", h, scope...)
  4221. return e
  4222. }
  4223. func (e *htmlBlockquote) OnDrop(h EventHandler, scope ...any) HTMLBlockquote {
  4224. e.setEventHandler("drop", h, scope...)
  4225. return e
  4226. }
  4227. func (e *htmlBlockquote) OnFocus(h EventHandler, scope ...any) HTMLBlockquote {
  4228. e.setEventHandler("focus", h, scope...)
  4229. return e
  4230. }
  4231. func (e *htmlBlockquote) OnInput(h EventHandler, scope ...any) HTMLBlockquote {
  4232. e.setEventHandler("input", h, scope...)
  4233. return e
  4234. }
  4235. func (e *htmlBlockquote) OnInvalid(h EventHandler, scope ...any) HTMLBlockquote {
  4236. e.setEventHandler("invalid", h, scope...)
  4237. return e
  4238. }
  4239. func (e *htmlBlockquote) OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote {
  4240. e.setEventHandler("keydown", h, scope...)
  4241. return e
  4242. }
  4243. func (e *htmlBlockquote) OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote {
  4244. e.setEventHandler("keypress", h, scope...)
  4245. return e
  4246. }
  4247. func (e *htmlBlockquote) OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote {
  4248. e.setEventHandler("keyup", h, scope...)
  4249. return e
  4250. }
  4251. func (e *htmlBlockquote) OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote {
  4252. e.setEventHandler("mousedown", h, scope...)
  4253. return e
  4254. }
  4255. func (e *htmlBlockquote) OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote {
  4256. e.setEventHandler("mousemove", h, scope...)
  4257. return e
  4258. }
  4259. func (e *htmlBlockquote) OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote {
  4260. e.setEventHandler("mouseout", h, scope...)
  4261. return e
  4262. }
  4263. func (e *htmlBlockquote) OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote {
  4264. e.setEventHandler("mouseover", h, scope...)
  4265. return e
  4266. }
  4267. func (e *htmlBlockquote) OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote {
  4268. e.setEventHandler("mouseup", h, scope...)
  4269. return e
  4270. }
  4271. func (e *htmlBlockquote) OnPaste(h EventHandler, scope ...any) HTMLBlockquote {
  4272. e.setEventHandler("paste", h, scope...)
  4273. return e
  4274. }
  4275. func (e *htmlBlockquote) OnReset(h EventHandler, scope ...any) HTMLBlockquote {
  4276. e.setEventHandler("reset", h, scope...)
  4277. return e
  4278. }
  4279. func (e *htmlBlockquote) OnScroll(h EventHandler, scope ...any) HTMLBlockquote {
  4280. e.setEventHandler("scroll", h, scope...)
  4281. return e
  4282. }
  4283. func (e *htmlBlockquote) OnSearch(h EventHandler, scope ...any) HTMLBlockquote {
  4284. e.setEventHandler("search", h, scope...)
  4285. return e
  4286. }
  4287. func (e *htmlBlockquote) OnSelect(h EventHandler, scope ...any) HTMLBlockquote {
  4288. e.setEventHandler("select", h, scope...)
  4289. return e
  4290. }
  4291. func (e *htmlBlockquote) OnSubmit(h EventHandler, scope ...any) HTMLBlockquote {
  4292. e.setEventHandler("submit", h, scope...)
  4293. return e
  4294. }
  4295. func (e *htmlBlockquote) OnWheel(h EventHandler, scope ...any) HTMLBlockquote {
  4296. e.setEventHandler("wheel", h, scope...)
  4297. return e
  4298. }
  4299. // HTMLBody is the interface that describes a "body" HTML element.
  4300. type HTMLBody interface {
  4301. UI
  4302. privateBody(elems ...UI) HTMLBody
  4303. // AccessKey specifies a shortcut key to activate/focus an element.
  4304. AccessKey(v string) HTMLBody
  4305. // Aria stores accessible rich internet applications (ARIA) data.
  4306. Aria(k string, v any) HTMLBody
  4307. // Attr sets the named attribute with the given value.
  4308. Attr(n string, v any) HTMLBody
  4309. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  4310. Class(v ...string) HTMLBody
  4311. // ContentEditable specifies whether the content of an element is editable or not.
  4312. ContentEditable(v bool) HTMLBody
  4313. // DataSet stores custom data private to the page or application.
  4314. DataSet(k string, v any) HTMLBody
  4315. // Dir specifies the text direction for the content in an element.
  4316. Dir(v string) HTMLBody
  4317. // Draggable specifies whether an element is draggable or not.
  4318. Draggable(v bool) HTMLBody
  4319. // Hidden specifies that an element is not yet, or is no longer relevant.
  4320. Hidden(v bool) HTMLBody
  4321. // ID specifies a unique id for an element.
  4322. ID(v string) HTMLBody
  4323. // Lang specifies the language of the element's content.
  4324. Lang(v string) HTMLBody
  4325. // Role specifies to parsing software the exact function of an element (and its children).
  4326. Role(v string) HTMLBody
  4327. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  4328. Spellcheck(v bool) HTMLBody
  4329. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  4330. Style(k, v string) HTMLBody
  4331. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  4332. Styles(s map[string]string) HTMLBody
  4333. // TabIndex specifies the tabbing order of an element.
  4334. TabIndex(v int) HTMLBody
  4335. // Title specifies extra information about an element.
  4336. Title(v string) HTMLBody
  4337. // On registers the given event handler to the specified event.
  4338. On(event string, h EventHandler, scope ...any) HTMLBody
  4339. // OnAfterPrint runs the given handler after the document is printed.
  4340. OnAfterPrint(h EventHandler, scope ...any) HTMLBody
  4341. // OnBeforePrint calls the given handler before the document is printed.
  4342. OnBeforePrint(h EventHandler, scope ...any) HTMLBody
  4343. // OnBeforeUnload calls the given handler when the document is about to be unloaded.
  4344. OnBeforeUnload(h EventHandler, scope ...any) HTMLBody
  4345. // OnBlur calls the given handler when the element loses focus.
  4346. OnBlur(h EventHandler, scope ...any) HTMLBody
  4347. // OnChange calls the given handler when the value of the element is changed.
  4348. OnChange(h EventHandler, scope ...any) HTMLBody
  4349. // OnClick calls the given handler when there is a mouse click on the element.
  4350. OnClick(h EventHandler, scope ...any) HTMLBody
  4351. // OnContextMenu calls the given handler when a context menu is triggered.
  4352. OnContextMenu(h EventHandler, scope ...any) HTMLBody
  4353. // OnCopy calls the given handler when the user copies the content of an element.
  4354. OnCopy(h EventHandler, scope ...any) HTMLBody
  4355. // OnCut calls the given handler when the user cuts the content of an element.
  4356. OnCut(h EventHandler, scope ...any) HTMLBody
  4357. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  4358. OnDblClick(h EventHandler, scope ...any) HTMLBody
  4359. // OnDrag calls the given handler when an element is dragged.
  4360. OnDrag(h EventHandler, scope ...any) HTMLBody
  4361. // OnDragEnd calls the given handler at the end of a drag operation.
  4362. OnDragEnd(h EventHandler, scope ...any) HTMLBody
  4363. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  4364. OnDragEnter(h EventHandler, scope ...any) HTMLBody
  4365. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  4366. OnDragLeave(h EventHandler, scope ...any) HTMLBody
  4367. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  4368. OnDragOver(h EventHandler, scope ...any) HTMLBody
  4369. // OnDragStart calls the given handler at the start of a drag operation.
  4370. OnDragStart(h EventHandler, scope ...any) HTMLBody
  4371. // OnDrop calls the given handler when dragged element is being dropped.
  4372. OnDrop(h EventHandler, scope ...any) HTMLBody
  4373. // OnError calls the given handler when an error occurs.
  4374. OnError(h EventHandler, scope ...any) HTMLBody
  4375. // OnFocus calls the given handler when the element gets focus.
  4376. OnFocus(h EventHandler, scope ...any) HTMLBody
  4377. // OnHashChange calls the given handler when there has been changes to the anchor part of the a URL.
  4378. OnHashChange(h EventHandler, scope ...any) HTMLBody
  4379. // OnInput calls the given handler when an element gets user input.
  4380. OnInput(h EventHandler, scope ...any) HTMLBody
  4381. // OnInvalid calls the given handler when an element is invalid.
  4382. OnInvalid(h EventHandler, scope ...any) HTMLBody
  4383. // OnKeyDown calls the given handler when a user is pressing a key.
  4384. OnKeyDown(h EventHandler, scope ...any) HTMLBody
  4385. // OnKeyPress calls the given handler when a user presses a key.
  4386. OnKeyPress(h EventHandler, scope ...any) HTMLBody
  4387. // OnKeyUp calls the given handler when a user releases a key.
  4388. OnKeyUp(h EventHandler, scope ...any) HTMLBody
  4389. // OnLoad calls the given handler after the element is finished loading.
  4390. OnLoad(h EventHandler, scope ...any) HTMLBody
  4391. // OnMessage calls then given handler when a message is triggered.
  4392. OnMessage(h EventHandler, scope ...any) HTMLBody
  4393. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  4394. OnMouseDown(h EventHandler, scope ...any) HTMLBody
  4395. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  4396. OnMouseMove(h EventHandler, scope ...any) HTMLBody
  4397. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  4398. OnMouseOut(h EventHandler, scope ...any) HTMLBody
  4399. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  4400. OnMouseOver(h EventHandler, scope ...any) HTMLBody
  4401. // OnMouseUp calls the given handler when a mouse button is released over an element.
  4402. OnMouseUp(h EventHandler, scope ...any) HTMLBody
  4403. // OnOffline calls the given handler when the browser starts to work offline.
  4404. OnOffline(h EventHandler, scope ...any) HTMLBody
  4405. // OnOnline calls the given handler when the browser starts to work online.
  4406. OnOnline(h EventHandler, scope ...any) HTMLBody
  4407. // OnPageHide calls the given handler when a user navigates away from a page.
  4408. OnPageHide(h EventHandler, scope ...any) HTMLBody
  4409. // OnPageShow calls the given handler when a user navigates to a page.
  4410. OnPageShow(h EventHandler, scope ...any) HTMLBody
  4411. // OnPaste calls the given handler when the user pastes some content in an element.
  4412. OnPaste(h EventHandler, scope ...any) HTMLBody
  4413. // OnPopState calls the given handler when the window's history changes.
  4414. OnPopState(h EventHandler, scope ...any) HTMLBody
  4415. // OnReset calls the given handler when the Reset button in a form is clicked.
  4416. OnReset(h EventHandler, scope ...any) HTMLBody
  4417. // OnResize calls the given handler when the browser window is resized.
  4418. OnResize(h EventHandler, scope ...any) HTMLBody
  4419. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  4420. OnScroll(h EventHandler, scope ...any) HTMLBody
  4421. // OnSearch calls the given handler when the user writes something in a search field.
  4422. OnSearch(h EventHandler, scope ...any) HTMLBody
  4423. // OnSelect calls the given handler after some text has been selected in an element.
  4424. OnSelect(h EventHandler, scope ...any) HTMLBody
  4425. // OnStorage calls the given handler when a Web Storage area is updated.
  4426. OnStorage(h EventHandler, scope ...any) HTMLBody
  4427. // OnSubmit calls the given handler when a form is submitted.
  4428. OnSubmit(h EventHandler, scope ...any) HTMLBody
  4429. // OnUnload calls the given handler once a page has unloaded (or the browser window has been closed).
  4430. OnUnload(h EventHandler, scope ...any) HTMLBody
  4431. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  4432. OnWheel(h EventHandler, scope ...any) HTMLBody
  4433. }
  4434. // Body returns an HTML element that defines the document's body.
  4435. func Body() HTMLBody {
  4436. e := &htmlBody{
  4437. htmlElement: htmlElement{
  4438. tag: "body",
  4439. isSelfClosing: false,
  4440. },
  4441. }
  4442. return e
  4443. }
  4444. type htmlBody struct {
  4445. htmlElement
  4446. }
  4447. func (e *htmlBody) privateBody(v ...UI) HTMLBody {
  4448. e.setChildren(v...)
  4449. return e
  4450. }
  4451. func (e *htmlBody) AccessKey(v string) HTMLBody {
  4452. e.setAttr("accesskey", v)
  4453. return e
  4454. }
  4455. func (e *htmlBody) Aria(k string, v any) HTMLBody {
  4456. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  4457. return e
  4458. }
  4459. func (e *htmlBody) Attr(n string, v any) HTMLBody {
  4460. e.setAttr(n, v)
  4461. return e
  4462. }
  4463. func (e *htmlBody) Class(v ...string) HTMLBody {
  4464. e.setAttr("class", strings.Join(v, " "))
  4465. return e
  4466. }
  4467. func (e *htmlBody) ContentEditable(v bool) HTMLBody {
  4468. e.setAttr("contenteditable", v)
  4469. return e
  4470. }
  4471. func (e *htmlBody) DataSet(k string, v any) HTMLBody {
  4472. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  4473. return e
  4474. }
  4475. func (e *htmlBody) Dir(v string) HTMLBody {
  4476. e.setAttr("dir", v)
  4477. return e
  4478. }
  4479. func (e *htmlBody) Draggable(v bool) HTMLBody {
  4480. e.setAttr("draggable", v)
  4481. return e
  4482. }
  4483. func (e *htmlBody) Hidden(v bool) HTMLBody {
  4484. e.setAttr("hidden", v)
  4485. return e
  4486. }
  4487. func (e *htmlBody) ID(v string) HTMLBody {
  4488. e.setAttr("id", v)
  4489. return e
  4490. }
  4491. func (e *htmlBody) Lang(v string) HTMLBody {
  4492. e.setAttr("lang", v)
  4493. return e
  4494. }
  4495. func (e *htmlBody) Role(v string) HTMLBody {
  4496. e.setAttr("role", v)
  4497. return e
  4498. }
  4499. func (e *htmlBody) Spellcheck(v bool) HTMLBody {
  4500. s := "false"
  4501. if v {
  4502. s = "true"
  4503. }
  4504. e.setAttr("spellcheck", s)
  4505. return e
  4506. }
  4507. func (e *htmlBody) Style(k, v string) HTMLBody {
  4508. e.setAttr("style", k+":"+v)
  4509. return e
  4510. }
  4511. func (e *htmlBody) Styles(s map[string]string) HTMLBody {
  4512. for k, v := range s {
  4513. e.Style(k, v)
  4514. }
  4515. return e
  4516. }
  4517. func (e *htmlBody) TabIndex(v int) HTMLBody {
  4518. e.setAttr("tabindex", v)
  4519. return e
  4520. }
  4521. func (e *htmlBody) Title(v string) HTMLBody {
  4522. e.setAttr("title", v)
  4523. return e
  4524. }
  4525. func (e *htmlBody) On(event string, h EventHandler, scope ...any) HTMLBody {
  4526. e.setEventHandler(event, h, scope...)
  4527. return e
  4528. }
  4529. func (e *htmlBody) OnAfterPrint(h EventHandler, scope ...any) HTMLBody {
  4530. e.setEventHandler("afterprint", h, scope...)
  4531. return e
  4532. }
  4533. func (e *htmlBody) OnBeforePrint(h EventHandler, scope ...any) HTMLBody {
  4534. e.setEventHandler("beforeprint", h, scope...)
  4535. return e
  4536. }
  4537. func (e *htmlBody) OnBeforeUnload(h EventHandler, scope ...any) HTMLBody {
  4538. e.setEventHandler("beforeunload", h, scope...)
  4539. return e
  4540. }
  4541. func (e *htmlBody) OnBlur(h EventHandler, scope ...any) HTMLBody {
  4542. e.setEventHandler("blur", h, scope...)
  4543. return e
  4544. }
  4545. func (e *htmlBody) OnChange(h EventHandler, scope ...any) HTMLBody {
  4546. e.setEventHandler("change", h, scope...)
  4547. return e
  4548. }
  4549. func (e *htmlBody) OnClick(h EventHandler, scope ...any) HTMLBody {
  4550. e.setEventHandler("click", h, scope...)
  4551. return e
  4552. }
  4553. func (e *htmlBody) OnContextMenu(h EventHandler, scope ...any) HTMLBody {
  4554. e.setEventHandler("contextmenu", h, scope...)
  4555. return e
  4556. }
  4557. func (e *htmlBody) OnCopy(h EventHandler, scope ...any) HTMLBody {
  4558. e.setEventHandler("copy", h, scope...)
  4559. return e
  4560. }
  4561. func (e *htmlBody) OnCut(h EventHandler, scope ...any) HTMLBody {
  4562. e.setEventHandler("cut", h, scope...)
  4563. return e
  4564. }
  4565. func (e *htmlBody) OnDblClick(h EventHandler, scope ...any) HTMLBody {
  4566. e.setEventHandler("dblclick", h, scope...)
  4567. return e
  4568. }
  4569. func (e *htmlBody) OnDrag(h EventHandler, scope ...any) HTMLBody {
  4570. e.setEventHandler("drag", h, scope...)
  4571. return e
  4572. }
  4573. func (e *htmlBody) OnDragEnd(h EventHandler, scope ...any) HTMLBody {
  4574. e.setEventHandler("dragend", h, scope...)
  4575. return e
  4576. }
  4577. func (e *htmlBody) OnDragEnter(h EventHandler, scope ...any) HTMLBody {
  4578. e.setEventHandler("dragenter", h, scope...)
  4579. return e
  4580. }
  4581. func (e *htmlBody) OnDragLeave(h EventHandler, scope ...any) HTMLBody {
  4582. e.setEventHandler("dragleave", h, scope...)
  4583. return e
  4584. }
  4585. func (e *htmlBody) OnDragOver(h EventHandler, scope ...any) HTMLBody {
  4586. e.setEventHandler("dragover", h, scope...)
  4587. return e
  4588. }
  4589. func (e *htmlBody) OnDragStart(h EventHandler, scope ...any) HTMLBody {
  4590. e.setEventHandler("dragstart", h, scope...)
  4591. return e
  4592. }
  4593. func (e *htmlBody) OnDrop(h EventHandler, scope ...any) HTMLBody {
  4594. e.setEventHandler("drop", h, scope...)
  4595. return e
  4596. }
  4597. func (e *htmlBody) OnError(h EventHandler, scope ...any) HTMLBody {
  4598. e.setEventHandler("error", h, scope...)
  4599. return e
  4600. }
  4601. func (e *htmlBody) OnFocus(h EventHandler, scope ...any) HTMLBody {
  4602. e.setEventHandler("focus", h, scope...)
  4603. return e
  4604. }
  4605. func (e *htmlBody) OnHashChange(h EventHandler, scope ...any) HTMLBody {
  4606. e.setEventHandler("hashchange", h, scope...)
  4607. return e
  4608. }
  4609. func (e *htmlBody) OnInput(h EventHandler, scope ...any) HTMLBody {
  4610. e.setEventHandler("input", h, scope...)
  4611. return e
  4612. }
  4613. func (e *htmlBody) OnInvalid(h EventHandler, scope ...any) HTMLBody {
  4614. e.setEventHandler("invalid", h, scope...)
  4615. return e
  4616. }
  4617. func (e *htmlBody) OnKeyDown(h EventHandler, scope ...any) HTMLBody {
  4618. e.setEventHandler("keydown", h, scope...)
  4619. return e
  4620. }
  4621. func (e *htmlBody) OnKeyPress(h EventHandler, scope ...any) HTMLBody {
  4622. e.setEventHandler("keypress", h, scope...)
  4623. return e
  4624. }
  4625. func (e *htmlBody) OnKeyUp(h EventHandler, scope ...any) HTMLBody {
  4626. e.setEventHandler("keyup", h, scope...)
  4627. return e
  4628. }
  4629. func (e *htmlBody) OnLoad(h EventHandler, scope ...any) HTMLBody {
  4630. e.setEventHandler("load", h, scope...)
  4631. return e
  4632. }
  4633. func (e *htmlBody) OnMessage(h EventHandler, scope ...any) HTMLBody {
  4634. e.setEventHandler("message", h, scope...)
  4635. return e
  4636. }
  4637. func (e *htmlBody) OnMouseDown(h EventHandler, scope ...any) HTMLBody {
  4638. e.setEventHandler("mousedown", h, scope...)
  4639. return e
  4640. }
  4641. func (e *htmlBody) OnMouseMove(h EventHandler, scope ...any) HTMLBody {
  4642. e.setEventHandler("mousemove", h, scope...)
  4643. return e
  4644. }
  4645. func (e *htmlBody) OnMouseOut(h EventHandler, scope ...any) HTMLBody {
  4646. e.setEventHandler("mouseout", h, scope...)
  4647. return e
  4648. }
  4649. func (e *htmlBody) OnMouseOver(h EventHandler, scope ...any) HTMLBody {
  4650. e.setEventHandler("mouseover", h, scope...)
  4651. return e
  4652. }
  4653. func (e *htmlBody) OnMouseUp(h EventHandler, scope ...any) HTMLBody {
  4654. e.setEventHandler("mouseup", h, scope...)
  4655. return e
  4656. }
  4657. func (e *htmlBody) OnOffline(h EventHandler, scope ...any) HTMLBody {
  4658. e.setEventHandler("offline", h, scope...)
  4659. return e
  4660. }
  4661. func (e *htmlBody) OnOnline(h EventHandler, scope ...any) HTMLBody {
  4662. e.setEventHandler("online", h, scope...)
  4663. return e
  4664. }
  4665. func (e *htmlBody) OnPageHide(h EventHandler, scope ...any) HTMLBody {
  4666. e.setEventHandler("pagehide", h, scope...)
  4667. return e
  4668. }
  4669. func (e *htmlBody) OnPageShow(h EventHandler, scope ...any) HTMLBody {
  4670. e.setEventHandler("pageshow", h, scope...)
  4671. return e
  4672. }
  4673. func (e *htmlBody) OnPaste(h EventHandler, scope ...any) HTMLBody {
  4674. e.setEventHandler("paste", h, scope...)
  4675. return e
  4676. }
  4677. func (e *htmlBody) OnPopState(h EventHandler, scope ...any) HTMLBody {
  4678. e.setEventHandler("popstate", h, scope...)
  4679. return e
  4680. }
  4681. func (e *htmlBody) OnReset(h EventHandler, scope ...any) HTMLBody {
  4682. e.setEventHandler("reset", h, scope...)
  4683. return e
  4684. }
  4685. func (e *htmlBody) OnResize(h EventHandler, scope ...any) HTMLBody {
  4686. e.setEventHandler("resize", h, scope...)
  4687. return e
  4688. }
  4689. func (e *htmlBody) OnScroll(h EventHandler, scope ...any) HTMLBody {
  4690. e.setEventHandler("scroll", h, scope...)
  4691. return e
  4692. }
  4693. func (e *htmlBody) OnSearch(h EventHandler, scope ...any) HTMLBody {
  4694. e.setEventHandler("search", h, scope...)
  4695. return e
  4696. }
  4697. func (e *htmlBody) OnSelect(h EventHandler, scope ...any) HTMLBody {
  4698. e.setEventHandler("select", h, scope...)
  4699. return e
  4700. }
  4701. func (e *htmlBody) OnStorage(h EventHandler, scope ...any) HTMLBody {
  4702. e.setEventHandler("storage", h, scope...)
  4703. return e
  4704. }
  4705. func (e *htmlBody) OnSubmit(h EventHandler, scope ...any) HTMLBody {
  4706. e.setEventHandler("submit", h, scope...)
  4707. return e
  4708. }
  4709. func (e *htmlBody) OnUnload(h EventHandler, scope ...any) HTMLBody {
  4710. e.setEventHandler("unload", h, scope...)
  4711. return e
  4712. }
  4713. func (e *htmlBody) OnWheel(h EventHandler, scope ...any) HTMLBody {
  4714. e.setEventHandler("wheel", h, scope...)
  4715. return e
  4716. }
  4717. // HTMLBr is the interface that describes a "br" HTML element.
  4718. type HTMLBr interface {
  4719. UI
  4720. // AccessKey specifies a shortcut key to activate/focus an element.
  4721. AccessKey(v string) HTMLBr
  4722. // Aria stores accessible rich internet applications (ARIA) data.
  4723. Aria(k string, v any) HTMLBr
  4724. // Attr sets the named attribute with the given value.
  4725. Attr(n string, v any) HTMLBr
  4726. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  4727. Class(v ...string) HTMLBr
  4728. // ContentEditable specifies whether the content of an element is editable or not.
  4729. ContentEditable(v bool) HTMLBr
  4730. // DataSet stores custom data private to the page or application.
  4731. DataSet(k string, v any) HTMLBr
  4732. // Dir specifies the text direction for the content in an element.
  4733. Dir(v string) HTMLBr
  4734. // Draggable specifies whether an element is draggable or not.
  4735. Draggable(v bool) HTMLBr
  4736. // Hidden specifies that an element is not yet, or is no longer relevant.
  4737. Hidden(v bool) HTMLBr
  4738. // ID specifies a unique id for an element.
  4739. ID(v string) HTMLBr
  4740. // Lang specifies the language of the element's content.
  4741. Lang(v string) HTMLBr
  4742. // Role specifies to parsing software the exact function of an element (and its children).
  4743. Role(v string) HTMLBr
  4744. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  4745. Spellcheck(v bool) HTMLBr
  4746. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  4747. Style(k, v string) HTMLBr
  4748. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  4749. Styles(s map[string]string) HTMLBr
  4750. // TabIndex specifies the tabbing order of an element.
  4751. TabIndex(v int) HTMLBr
  4752. // Title specifies extra information about an element.
  4753. Title(v string) HTMLBr
  4754. // On registers the given event handler to the specified event.
  4755. On(event string, h EventHandler, scope ...any) HTMLBr
  4756. // OnBlur calls the given handler when the element loses focus.
  4757. OnBlur(h EventHandler, scope ...any) HTMLBr
  4758. // OnChange calls the given handler when the value of the element is changed.
  4759. OnChange(h EventHandler, scope ...any) HTMLBr
  4760. // OnClick calls the given handler when there is a mouse click on the element.
  4761. OnClick(h EventHandler, scope ...any) HTMLBr
  4762. // OnContextMenu calls the given handler when a context menu is triggered.
  4763. OnContextMenu(h EventHandler, scope ...any) HTMLBr
  4764. // OnCopy calls the given handler when the user copies the content of an element.
  4765. OnCopy(h EventHandler, scope ...any) HTMLBr
  4766. // OnCut calls the given handler when the user cuts the content of an element.
  4767. OnCut(h EventHandler, scope ...any) HTMLBr
  4768. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  4769. OnDblClick(h EventHandler, scope ...any) HTMLBr
  4770. // OnDrag calls the given handler when an element is dragged.
  4771. OnDrag(h EventHandler, scope ...any) HTMLBr
  4772. // OnDragEnd calls the given handler at the end of a drag operation.
  4773. OnDragEnd(h EventHandler, scope ...any) HTMLBr
  4774. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  4775. OnDragEnter(h EventHandler, scope ...any) HTMLBr
  4776. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  4777. OnDragLeave(h EventHandler, scope ...any) HTMLBr
  4778. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  4779. OnDragOver(h EventHandler, scope ...any) HTMLBr
  4780. // OnDragStart calls the given handler at the start of a drag operation.
  4781. OnDragStart(h EventHandler, scope ...any) HTMLBr
  4782. // OnDrop calls the given handler when dragged element is being dropped.
  4783. OnDrop(h EventHandler, scope ...any) HTMLBr
  4784. // OnFocus calls the given handler when the element gets focus.
  4785. OnFocus(h EventHandler, scope ...any) HTMLBr
  4786. // OnInput calls the given handler when an element gets user input.
  4787. OnInput(h EventHandler, scope ...any) HTMLBr
  4788. // OnInvalid calls the given handler when an element is invalid.
  4789. OnInvalid(h EventHandler, scope ...any) HTMLBr
  4790. // OnKeyDown calls the given handler when a user is pressing a key.
  4791. OnKeyDown(h EventHandler, scope ...any) HTMLBr
  4792. // OnKeyPress calls the given handler when a user presses a key.
  4793. OnKeyPress(h EventHandler, scope ...any) HTMLBr
  4794. // OnKeyUp calls the given handler when a user releases a key.
  4795. OnKeyUp(h EventHandler, scope ...any) HTMLBr
  4796. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  4797. OnMouseDown(h EventHandler, scope ...any) HTMLBr
  4798. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  4799. OnMouseMove(h EventHandler, scope ...any) HTMLBr
  4800. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  4801. OnMouseOut(h EventHandler, scope ...any) HTMLBr
  4802. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  4803. OnMouseOver(h EventHandler, scope ...any) HTMLBr
  4804. // OnMouseUp calls the given handler when a mouse button is released over an element.
  4805. OnMouseUp(h EventHandler, scope ...any) HTMLBr
  4806. // OnPaste calls the given handler when the user pastes some content in an element.
  4807. OnPaste(h EventHandler, scope ...any) HTMLBr
  4808. // OnReset calls the given handler when the Reset button in a form is clicked.
  4809. OnReset(h EventHandler, scope ...any) HTMLBr
  4810. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  4811. OnScroll(h EventHandler, scope ...any) HTMLBr
  4812. // OnSearch calls the given handler when the user writes something in a search field.
  4813. OnSearch(h EventHandler, scope ...any) HTMLBr
  4814. // OnSelect calls the given handler after some text has been selected in an element.
  4815. OnSelect(h EventHandler, scope ...any) HTMLBr
  4816. // OnSubmit calls the given handler when a form is submitted.
  4817. OnSubmit(h EventHandler, scope ...any) HTMLBr
  4818. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  4819. OnWheel(h EventHandler, scope ...any) HTMLBr
  4820. }
  4821. // Br returns an HTML element that defines a single line break.
  4822. func Br() HTMLBr {
  4823. e := &htmlBr{
  4824. htmlElement: htmlElement{
  4825. tag: "br",
  4826. isSelfClosing: true,
  4827. },
  4828. }
  4829. return e
  4830. }
  4831. type htmlBr struct {
  4832. htmlElement
  4833. }
  4834. func (e *htmlBr) AccessKey(v string) HTMLBr {
  4835. e.setAttr("accesskey", v)
  4836. return e
  4837. }
  4838. func (e *htmlBr) Aria(k string, v any) HTMLBr {
  4839. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  4840. return e
  4841. }
  4842. func (e *htmlBr) Attr(n string, v any) HTMLBr {
  4843. e.setAttr(n, v)
  4844. return e
  4845. }
  4846. func (e *htmlBr) Class(v ...string) HTMLBr {
  4847. e.setAttr("class", strings.Join(v, " "))
  4848. return e
  4849. }
  4850. func (e *htmlBr) ContentEditable(v bool) HTMLBr {
  4851. e.setAttr("contenteditable", v)
  4852. return e
  4853. }
  4854. func (e *htmlBr) DataSet(k string, v any) HTMLBr {
  4855. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  4856. return e
  4857. }
  4858. func (e *htmlBr) Dir(v string) HTMLBr {
  4859. e.setAttr("dir", v)
  4860. return e
  4861. }
  4862. func (e *htmlBr) Draggable(v bool) HTMLBr {
  4863. e.setAttr("draggable", v)
  4864. return e
  4865. }
  4866. func (e *htmlBr) Hidden(v bool) HTMLBr {
  4867. e.setAttr("hidden", v)
  4868. return e
  4869. }
  4870. func (e *htmlBr) ID(v string) HTMLBr {
  4871. e.setAttr("id", v)
  4872. return e
  4873. }
  4874. func (e *htmlBr) Lang(v string) HTMLBr {
  4875. e.setAttr("lang", v)
  4876. return e
  4877. }
  4878. func (e *htmlBr) Role(v string) HTMLBr {
  4879. e.setAttr("role", v)
  4880. return e
  4881. }
  4882. func (e *htmlBr) Spellcheck(v bool) HTMLBr {
  4883. s := "false"
  4884. if v {
  4885. s = "true"
  4886. }
  4887. e.setAttr("spellcheck", s)
  4888. return e
  4889. }
  4890. func (e *htmlBr) Style(k, v string) HTMLBr {
  4891. e.setAttr("style", k+":"+v)
  4892. return e
  4893. }
  4894. func (e *htmlBr) Styles(s map[string]string) HTMLBr {
  4895. for k, v := range s {
  4896. e.Style(k, v)
  4897. }
  4898. return e
  4899. }
  4900. func (e *htmlBr) TabIndex(v int) HTMLBr {
  4901. e.setAttr("tabindex", v)
  4902. return e
  4903. }
  4904. func (e *htmlBr) Title(v string) HTMLBr {
  4905. e.setAttr("title", v)
  4906. return e
  4907. }
  4908. func (e *htmlBr) On(event string, h EventHandler, scope ...any) HTMLBr {
  4909. e.setEventHandler(event, h, scope...)
  4910. return e
  4911. }
  4912. func (e *htmlBr) OnBlur(h EventHandler, scope ...any) HTMLBr {
  4913. e.setEventHandler("blur", h, scope...)
  4914. return e
  4915. }
  4916. func (e *htmlBr) OnChange(h EventHandler, scope ...any) HTMLBr {
  4917. e.setEventHandler("change", h, scope...)
  4918. return e
  4919. }
  4920. func (e *htmlBr) OnClick(h EventHandler, scope ...any) HTMLBr {
  4921. e.setEventHandler("click", h, scope...)
  4922. return e
  4923. }
  4924. func (e *htmlBr) OnContextMenu(h EventHandler, scope ...any) HTMLBr {
  4925. e.setEventHandler("contextmenu", h, scope...)
  4926. return e
  4927. }
  4928. func (e *htmlBr) OnCopy(h EventHandler, scope ...any) HTMLBr {
  4929. e.setEventHandler("copy", h, scope...)
  4930. return e
  4931. }
  4932. func (e *htmlBr) OnCut(h EventHandler, scope ...any) HTMLBr {
  4933. e.setEventHandler("cut", h, scope...)
  4934. return e
  4935. }
  4936. func (e *htmlBr) OnDblClick(h EventHandler, scope ...any) HTMLBr {
  4937. e.setEventHandler("dblclick", h, scope...)
  4938. return e
  4939. }
  4940. func (e *htmlBr) OnDrag(h EventHandler, scope ...any) HTMLBr {
  4941. e.setEventHandler("drag", h, scope...)
  4942. return e
  4943. }
  4944. func (e *htmlBr) OnDragEnd(h EventHandler, scope ...any) HTMLBr {
  4945. e.setEventHandler("dragend", h, scope...)
  4946. return e
  4947. }
  4948. func (e *htmlBr) OnDragEnter(h EventHandler, scope ...any) HTMLBr {
  4949. e.setEventHandler("dragenter", h, scope...)
  4950. return e
  4951. }
  4952. func (e *htmlBr) OnDragLeave(h EventHandler, scope ...any) HTMLBr {
  4953. e.setEventHandler("dragleave", h, scope...)
  4954. return e
  4955. }
  4956. func (e *htmlBr) OnDragOver(h EventHandler, scope ...any) HTMLBr {
  4957. e.setEventHandler("dragover", h, scope...)
  4958. return e
  4959. }
  4960. func (e *htmlBr) OnDragStart(h EventHandler, scope ...any) HTMLBr {
  4961. e.setEventHandler("dragstart", h, scope...)
  4962. return e
  4963. }
  4964. func (e *htmlBr) OnDrop(h EventHandler, scope ...any) HTMLBr {
  4965. e.setEventHandler("drop", h, scope...)
  4966. return e
  4967. }
  4968. func (e *htmlBr) OnFocus(h EventHandler, scope ...any) HTMLBr {
  4969. e.setEventHandler("focus", h, scope...)
  4970. return e
  4971. }
  4972. func (e *htmlBr) OnInput(h EventHandler, scope ...any) HTMLBr {
  4973. e.setEventHandler("input", h, scope...)
  4974. return e
  4975. }
  4976. func (e *htmlBr) OnInvalid(h EventHandler, scope ...any) HTMLBr {
  4977. e.setEventHandler("invalid", h, scope...)
  4978. return e
  4979. }
  4980. func (e *htmlBr) OnKeyDown(h EventHandler, scope ...any) HTMLBr {
  4981. e.setEventHandler("keydown", h, scope...)
  4982. return e
  4983. }
  4984. func (e *htmlBr) OnKeyPress(h EventHandler, scope ...any) HTMLBr {
  4985. e.setEventHandler("keypress", h, scope...)
  4986. return e
  4987. }
  4988. func (e *htmlBr) OnKeyUp(h EventHandler, scope ...any) HTMLBr {
  4989. e.setEventHandler("keyup", h, scope...)
  4990. return e
  4991. }
  4992. func (e *htmlBr) OnMouseDown(h EventHandler, scope ...any) HTMLBr {
  4993. e.setEventHandler("mousedown", h, scope...)
  4994. return e
  4995. }
  4996. func (e *htmlBr) OnMouseMove(h EventHandler, scope ...any) HTMLBr {
  4997. e.setEventHandler("mousemove", h, scope...)
  4998. return e
  4999. }
  5000. func (e *htmlBr) OnMouseOut(h EventHandler, scope ...any) HTMLBr {
  5001. e.setEventHandler("mouseout", h, scope...)
  5002. return e
  5003. }
  5004. func (e *htmlBr) OnMouseOver(h EventHandler, scope ...any) HTMLBr {
  5005. e.setEventHandler("mouseover", h, scope...)
  5006. return e
  5007. }
  5008. func (e *htmlBr) OnMouseUp(h EventHandler, scope ...any) HTMLBr {
  5009. e.setEventHandler("mouseup", h, scope...)
  5010. return e
  5011. }
  5012. func (e *htmlBr) OnPaste(h EventHandler, scope ...any) HTMLBr {
  5013. e.setEventHandler("paste", h, scope...)
  5014. return e
  5015. }
  5016. func (e *htmlBr) OnReset(h EventHandler, scope ...any) HTMLBr {
  5017. e.setEventHandler("reset", h, scope...)
  5018. return e
  5019. }
  5020. func (e *htmlBr) OnScroll(h EventHandler, scope ...any) HTMLBr {
  5021. e.setEventHandler("scroll", h, scope...)
  5022. return e
  5023. }
  5024. func (e *htmlBr) OnSearch(h EventHandler, scope ...any) HTMLBr {
  5025. e.setEventHandler("search", h, scope...)
  5026. return e
  5027. }
  5028. func (e *htmlBr) OnSelect(h EventHandler, scope ...any) HTMLBr {
  5029. e.setEventHandler("select", h, scope...)
  5030. return e
  5031. }
  5032. func (e *htmlBr) OnSubmit(h EventHandler, scope ...any) HTMLBr {
  5033. e.setEventHandler("submit", h, scope...)
  5034. return e
  5035. }
  5036. func (e *htmlBr) OnWheel(h EventHandler, scope ...any) HTMLBr {
  5037. e.setEventHandler("wheel", h, scope...)
  5038. return e
  5039. }
  5040. // HTMLButton is the interface that describes a "button" HTML element.
  5041. type HTMLButton interface {
  5042. UI
  5043. // Body set the content of the element.
  5044. Body(elems ...UI) HTMLButton
  5045. // Text sets the content of the element with a text node containing the stringified given value.
  5046. Text(v any) HTMLButton
  5047. // AccessKey specifies a shortcut key to activate/focus an element.
  5048. AccessKey(v string) HTMLButton
  5049. // Aria stores accessible rich internet applications (ARIA) data.
  5050. Aria(k string, v any) HTMLButton
  5051. // Attr sets the named attribute with the given value.
  5052. Attr(n string, v any) HTMLButton
  5053. // AutoFocus specifies that the element should automatically get focus when the page loads.
  5054. AutoFocus(v bool) HTMLButton
  5055. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  5056. Class(v ...string) HTMLButton
  5057. // ContentEditable specifies whether the content of an element is editable or not.
  5058. ContentEditable(v bool) HTMLButton
  5059. // DataSet stores custom data private to the page or application.
  5060. DataSet(k string, v any) HTMLButton
  5061. // Dir specifies the text direction for the content in an element.
  5062. Dir(v string) HTMLButton
  5063. // Disabled specifies that the specified element/group of elements should be disabled.
  5064. Disabled(v bool) HTMLButton
  5065. // Draggable specifies whether an element is draggable or not.
  5066. Draggable(v bool) HTMLButton
  5067. // Form specifies the name of the form the element belongs to.
  5068. Form(v string) HTMLButton
  5069. // FormAction specifies where to send the form-data when a form is submitted. Only for submit type.
  5070. FormAction(v string) HTMLButton
  5071. // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type.
  5072. FormEncType(v string) HTMLButton
  5073. // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type.
  5074. FormMethod(v string) HTMLButton
  5075. // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type.
  5076. FormNoValidate(v bool) HTMLButton
  5077. // FormTarget specifies where to display the response after submitting the form. Only for submit type.
  5078. FormTarget(v string) HTMLButton
  5079. // Hidden specifies that an element is not yet, or is no longer relevant.
  5080. Hidden(v bool) HTMLButton
  5081. // ID specifies a unique id for an element.
  5082. ID(v string) HTMLButton
  5083. // Lang specifies the language of the element's content.
  5084. Lang(v string) HTMLButton
  5085. // Name specifies the name of the element.
  5086. Name(v string) HTMLButton
  5087. // Role specifies to parsing software the exact function of an element (and its children).
  5088. Role(v string) HTMLButton
  5089. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  5090. Spellcheck(v bool) HTMLButton
  5091. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  5092. Style(k, v string) HTMLButton
  5093. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  5094. Styles(s map[string]string) HTMLButton
  5095. // TabIndex specifies the tabbing order of an element.
  5096. TabIndex(v int) HTMLButton
  5097. // Title specifies extra information about an element.
  5098. Title(v string) HTMLButton
  5099. // Type specifies the type of element.
  5100. Type(v string) HTMLButton
  5101. // Value specifies the value of the element.
  5102. Value(v any) HTMLButton
  5103. // On registers the given event handler to the specified event.
  5104. On(event string, h EventHandler, scope ...any) HTMLButton
  5105. // OnBlur calls the given handler when the element loses focus.
  5106. OnBlur(h EventHandler, scope ...any) HTMLButton
  5107. // OnChange calls the given handler when the value of the element is changed.
  5108. OnChange(h EventHandler, scope ...any) HTMLButton
  5109. // OnClick calls the given handler when there is a mouse click on the element.
  5110. OnClick(h EventHandler, scope ...any) HTMLButton
  5111. // OnContextMenu calls the given handler when a context menu is triggered.
  5112. OnContextMenu(h EventHandler, scope ...any) HTMLButton
  5113. // OnCopy calls the given handler when the user copies the content of an element.
  5114. OnCopy(h EventHandler, scope ...any) HTMLButton
  5115. // OnCut calls the given handler when the user cuts the content of an element.
  5116. OnCut(h EventHandler, scope ...any) HTMLButton
  5117. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  5118. OnDblClick(h EventHandler, scope ...any) HTMLButton
  5119. // OnDrag calls the given handler when an element is dragged.
  5120. OnDrag(h EventHandler, scope ...any) HTMLButton
  5121. // OnDragEnd calls the given handler at the end of a drag operation.
  5122. OnDragEnd(h EventHandler, scope ...any) HTMLButton
  5123. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  5124. OnDragEnter(h EventHandler, scope ...any) HTMLButton
  5125. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  5126. OnDragLeave(h EventHandler, scope ...any) HTMLButton
  5127. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  5128. OnDragOver(h EventHandler, scope ...any) HTMLButton
  5129. // OnDragStart calls the given handler at the start of a drag operation.
  5130. OnDragStart(h EventHandler, scope ...any) HTMLButton
  5131. // OnDrop calls the given handler when dragged element is being dropped.
  5132. OnDrop(h EventHandler, scope ...any) HTMLButton
  5133. // OnFocus calls the given handler when the element gets focus.
  5134. OnFocus(h EventHandler, scope ...any) HTMLButton
  5135. // OnInput calls the given handler when an element gets user input.
  5136. OnInput(h EventHandler, scope ...any) HTMLButton
  5137. // OnInvalid calls the given handler when an element is invalid.
  5138. OnInvalid(h EventHandler, scope ...any) HTMLButton
  5139. // OnKeyDown calls the given handler when a user is pressing a key.
  5140. OnKeyDown(h EventHandler, scope ...any) HTMLButton
  5141. // OnKeyPress calls the given handler when a user presses a key.
  5142. OnKeyPress(h EventHandler, scope ...any) HTMLButton
  5143. // OnKeyUp calls the given handler when a user releases a key.
  5144. OnKeyUp(h EventHandler, scope ...any) HTMLButton
  5145. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  5146. OnMouseDown(h EventHandler, scope ...any) HTMLButton
  5147. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  5148. OnMouseMove(h EventHandler, scope ...any) HTMLButton
  5149. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  5150. OnMouseOut(h EventHandler, scope ...any) HTMLButton
  5151. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  5152. OnMouseOver(h EventHandler, scope ...any) HTMLButton
  5153. // OnMouseUp calls the given handler when a mouse button is released over an element.
  5154. OnMouseUp(h EventHandler, scope ...any) HTMLButton
  5155. // OnPaste calls the given handler when the user pastes some content in an element.
  5156. OnPaste(h EventHandler, scope ...any) HTMLButton
  5157. // OnReset calls the given handler when the Reset button in a form is clicked.
  5158. OnReset(h EventHandler, scope ...any) HTMLButton
  5159. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  5160. OnScroll(h EventHandler, scope ...any) HTMLButton
  5161. // OnSearch calls the given handler when the user writes something in a search field.
  5162. OnSearch(h EventHandler, scope ...any) HTMLButton
  5163. // OnSelect calls the given handler after some text has been selected in an element.
  5164. OnSelect(h EventHandler, scope ...any) HTMLButton
  5165. // OnSubmit calls the given handler when a form is submitted.
  5166. OnSubmit(h EventHandler, scope ...any) HTMLButton
  5167. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  5168. OnWheel(h EventHandler, scope ...any) HTMLButton
  5169. }
  5170. // Button returns an HTML element that defines a clickable button.
  5171. func Button() HTMLButton {
  5172. e := &htmlButton{
  5173. htmlElement: htmlElement{
  5174. tag: "button",
  5175. isSelfClosing: false,
  5176. },
  5177. }
  5178. return e
  5179. }
  5180. type htmlButton struct {
  5181. htmlElement
  5182. }
  5183. func (e *htmlButton) Body(v ...UI) HTMLButton {
  5184. e.setChildren(v...)
  5185. return e
  5186. }
  5187. func (e *htmlButton) Text(v any) HTMLButton {
  5188. return e.Body(Text(v))
  5189. }
  5190. func (e *htmlButton) AccessKey(v string) HTMLButton {
  5191. e.setAttr("accesskey", v)
  5192. return e
  5193. }
  5194. func (e *htmlButton) Aria(k string, v any) HTMLButton {
  5195. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  5196. return e
  5197. }
  5198. func (e *htmlButton) Attr(n string, v any) HTMLButton {
  5199. e.setAttr(n, v)
  5200. return e
  5201. }
  5202. func (e *htmlButton) AutoFocus(v bool) HTMLButton {
  5203. e.setAttr("autofocus", v)
  5204. return e
  5205. }
  5206. func (e *htmlButton) Class(v ...string) HTMLButton {
  5207. e.setAttr("class", strings.Join(v, " "))
  5208. return e
  5209. }
  5210. func (e *htmlButton) ContentEditable(v bool) HTMLButton {
  5211. e.setAttr("contenteditable", v)
  5212. return e
  5213. }
  5214. func (e *htmlButton) DataSet(k string, v any) HTMLButton {
  5215. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  5216. return e
  5217. }
  5218. func (e *htmlButton) Dir(v string) HTMLButton {
  5219. e.setAttr("dir", v)
  5220. return e
  5221. }
  5222. func (e *htmlButton) Disabled(v bool) HTMLButton {
  5223. e.setAttr("disabled", v)
  5224. return e
  5225. }
  5226. func (e *htmlButton) Draggable(v bool) HTMLButton {
  5227. e.setAttr("draggable", v)
  5228. return e
  5229. }
  5230. func (e *htmlButton) Form(v string) HTMLButton {
  5231. e.setAttr("form", v)
  5232. return e
  5233. }
  5234. func (e *htmlButton) FormAction(v string) HTMLButton {
  5235. e.setAttr("formaction", v)
  5236. return e
  5237. }
  5238. func (e *htmlButton) FormEncType(v string) HTMLButton {
  5239. e.setAttr("formenctype", v)
  5240. return e
  5241. }
  5242. func (e *htmlButton) FormMethod(v string) HTMLButton {
  5243. e.setAttr("formmethod", v)
  5244. return e
  5245. }
  5246. func (e *htmlButton) FormNoValidate(v bool) HTMLButton {
  5247. e.setAttr("formnovalidate", v)
  5248. return e
  5249. }
  5250. func (e *htmlButton) FormTarget(v string) HTMLButton {
  5251. e.setAttr("formtarget", v)
  5252. return e
  5253. }
  5254. func (e *htmlButton) Hidden(v bool) HTMLButton {
  5255. e.setAttr("hidden", v)
  5256. return e
  5257. }
  5258. func (e *htmlButton) ID(v string) HTMLButton {
  5259. e.setAttr("id", v)
  5260. return e
  5261. }
  5262. func (e *htmlButton) Lang(v string) HTMLButton {
  5263. e.setAttr("lang", v)
  5264. return e
  5265. }
  5266. func (e *htmlButton) Name(v string) HTMLButton {
  5267. e.setAttr("name", v)
  5268. return e
  5269. }
  5270. func (e *htmlButton) Role(v string) HTMLButton {
  5271. e.setAttr("role", v)
  5272. return e
  5273. }
  5274. func (e *htmlButton) Spellcheck(v bool) HTMLButton {
  5275. s := "false"
  5276. if v {
  5277. s = "true"
  5278. }
  5279. e.setAttr("spellcheck", s)
  5280. return e
  5281. }
  5282. func (e *htmlButton) Style(k, v string) HTMLButton {
  5283. e.setAttr("style", k+":"+v)
  5284. return e
  5285. }
  5286. func (e *htmlButton) Styles(s map[string]string) HTMLButton {
  5287. for k, v := range s {
  5288. e.Style(k, v)
  5289. }
  5290. return e
  5291. }
  5292. func (e *htmlButton) TabIndex(v int) HTMLButton {
  5293. e.setAttr("tabindex", v)
  5294. return e
  5295. }
  5296. func (e *htmlButton) Title(v string) HTMLButton {
  5297. e.setAttr("title", v)
  5298. return e
  5299. }
  5300. func (e *htmlButton) Type(v string) HTMLButton {
  5301. e.setAttr("type", v)
  5302. return e
  5303. }
  5304. func (e *htmlButton) Value(v any) HTMLButton {
  5305. e.setAttr("value", v)
  5306. return e
  5307. }
  5308. func (e *htmlButton) On(event string, h EventHandler, scope ...any) HTMLButton {
  5309. e.setEventHandler(event, h, scope...)
  5310. return e
  5311. }
  5312. func (e *htmlButton) OnBlur(h EventHandler, scope ...any) HTMLButton {
  5313. e.setEventHandler("blur", h, scope...)
  5314. return e
  5315. }
  5316. func (e *htmlButton) OnChange(h EventHandler, scope ...any) HTMLButton {
  5317. e.setEventHandler("change", h, scope...)
  5318. return e
  5319. }
  5320. func (e *htmlButton) OnClick(h EventHandler, scope ...any) HTMLButton {
  5321. e.setEventHandler("click", h, scope...)
  5322. return e
  5323. }
  5324. func (e *htmlButton) OnContextMenu(h EventHandler, scope ...any) HTMLButton {
  5325. e.setEventHandler("contextmenu", h, scope...)
  5326. return e
  5327. }
  5328. func (e *htmlButton) OnCopy(h EventHandler, scope ...any) HTMLButton {
  5329. e.setEventHandler("copy", h, scope...)
  5330. return e
  5331. }
  5332. func (e *htmlButton) OnCut(h EventHandler, scope ...any) HTMLButton {
  5333. e.setEventHandler("cut", h, scope...)
  5334. return e
  5335. }
  5336. func (e *htmlButton) OnDblClick(h EventHandler, scope ...any) HTMLButton {
  5337. e.setEventHandler("dblclick", h, scope...)
  5338. return e
  5339. }
  5340. func (e *htmlButton) OnDrag(h EventHandler, scope ...any) HTMLButton {
  5341. e.setEventHandler("drag", h, scope...)
  5342. return e
  5343. }
  5344. func (e *htmlButton) OnDragEnd(h EventHandler, scope ...any) HTMLButton {
  5345. e.setEventHandler("dragend", h, scope...)
  5346. return e
  5347. }
  5348. func (e *htmlButton) OnDragEnter(h EventHandler, scope ...any) HTMLButton {
  5349. e.setEventHandler("dragenter", h, scope...)
  5350. return e
  5351. }
  5352. func (e *htmlButton) OnDragLeave(h EventHandler, scope ...any) HTMLButton {
  5353. e.setEventHandler("dragleave", h, scope...)
  5354. return e
  5355. }
  5356. func (e *htmlButton) OnDragOver(h EventHandler, scope ...any) HTMLButton {
  5357. e.setEventHandler("dragover", h, scope...)
  5358. return e
  5359. }
  5360. func (e *htmlButton) OnDragStart(h EventHandler, scope ...any) HTMLButton {
  5361. e.setEventHandler("dragstart", h, scope...)
  5362. return e
  5363. }
  5364. func (e *htmlButton) OnDrop(h EventHandler, scope ...any) HTMLButton {
  5365. e.setEventHandler("drop", h, scope...)
  5366. return e
  5367. }
  5368. func (e *htmlButton) OnFocus(h EventHandler, scope ...any) HTMLButton {
  5369. e.setEventHandler("focus", h, scope...)
  5370. return e
  5371. }
  5372. func (e *htmlButton) OnInput(h EventHandler, scope ...any) HTMLButton {
  5373. e.setEventHandler("input", h, scope...)
  5374. return e
  5375. }
  5376. func (e *htmlButton) OnInvalid(h EventHandler, scope ...any) HTMLButton {
  5377. e.setEventHandler("invalid", h, scope...)
  5378. return e
  5379. }
  5380. func (e *htmlButton) OnKeyDown(h EventHandler, scope ...any) HTMLButton {
  5381. e.setEventHandler("keydown", h, scope...)
  5382. return e
  5383. }
  5384. func (e *htmlButton) OnKeyPress(h EventHandler, scope ...any) HTMLButton {
  5385. e.setEventHandler("keypress", h, scope...)
  5386. return e
  5387. }
  5388. func (e *htmlButton) OnKeyUp(h EventHandler, scope ...any) HTMLButton {
  5389. e.setEventHandler("keyup", h, scope...)
  5390. return e
  5391. }
  5392. func (e *htmlButton) OnMouseDown(h EventHandler, scope ...any) HTMLButton {
  5393. e.setEventHandler("mousedown", h, scope...)
  5394. return e
  5395. }
  5396. func (e *htmlButton) OnMouseMove(h EventHandler, scope ...any) HTMLButton {
  5397. e.setEventHandler("mousemove", h, scope...)
  5398. return e
  5399. }
  5400. func (e *htmlButton) OnMouseOut(h EventHandler, scope ...any) HTMLButton {
  5401. e.setEventHandler("mouseout", h, scope...)
  5402. return e
  5403. }
  5404. func (e *htmlButton) OnMouseOver(h EventHandler, scope ...any) HTMLButton {
  5405. e.setEventHandler("mouseover", h, scope...)
  5406. return e
  5407. }
  5408. func (e *htmlButton) OnMouseUp(h EventHandler, scope ...any) HTMLButton {
  5409. e.setEventHandler("mouseup", h, scope...)
  5410. return e
  5411. }
  5412. func (e *htmlButton) OnPaste(h EventHandler, scope ...any) HTMLButton {
  5413. e.setEventHandler("paste", h, scope...)
  5414. return e
  5415. }
  5416. func (e *htmlButton) OnReset(h EventHandler, scope ...any) HTMLButton {
  5417. e.setEventHandler("reset", h, scope...)
  5418. return e
  5419. }
  5420. func (e *htmlButton) OnScroll(h EventHandler, scope ...any) HTMLButton {
  5421. e.setEventHandler("scroll", h, scope...)
  5422. return e
  5423. }
  5424. func (e *htmlButton) OnSearch(h EventHandler, scope ...any) HTMLButton {
  5425. e.setEventHandler("search", h, scope...)
  5426. return e
  5427. }
  5428. func (e *htmlButton) OnSelect(h EventHandler, scope ...any) HTMLButton {
  5429. e.setEventHandler("select", h, scope...)
  5430. return e
  5431. }
  5432. func (e *htmlButton) OnSubmit(h EventHandler, scope ...any) HTMLButton {
  5433. e.setEventHandler("submit", h, scope...)
  5434. return e
  5435. }
  5436. func (e *htmlButton) OnWheel(h EventHandler, scope ...any) HTMLButton {
  5437. e.setEventHandler("wheel", h, scope...)
  5438. return e
  5439. }
  5440. // HTMLCanvas is the interface that describes a "canvas" HTML element.
  5441. type HTMLCanvas interface {
  5442. UI
  5443. // Body set the content of the element.
  5444. Body(elems ...UI) HTMLCanvas
  5445. // Text sets the content of the element with a text node containing the stringified given value.
  5446. Text(v any) HTMLCanvas
  5447. // AccessKey specifies a shortcut key to activate/focus an element.
  5448. AccessKey(v string) HTMLCanvas
  5449. // Aria stores accessible rich internet applications (ARIA) data.
  5450. Aria(k string, v any) HTMLCanvas
  5451. // Attr sets the named attribute with the given value.
  5452. Attr(n string, v any) HTMLCanvas
  5453. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  5454. Class(v ...string) HTMLCanvas
  5455. // ContentEditable specifies whether the content of an element is editable or not.
  5456. ContentEditable(v bool) HTMLCanvas
  5457. // DataSet stores custom data private to the page or application.
  5458. DataSet(k string, v any) HTMLCanvas
  5459. // Dir specifies the text direction for the content in an element.
  5460. Dir(v string) HTMLCanvas
  5461. // Draggable specifies whether an element is draggable or not.
  5462. Draggable(v bool) HTMLCanvas
  5463. // Height specifies the height of the element (in pixels).
  5464. Height(v int) HTMLCanvas
  5465. // Hidden specifies that an element is not yet, or is no longer relevant.
  5466. Hidden(v bool) HTMLCanvas
  5467. // ID specifies a unique id for an element.
  5468. ID(v string) HTMLCanvas
  5469. // Lang specifies the language of the element's content.
  5470. Lang(v string) HTMLCanvas
  5471. // Role specifies to parsing software the exact function of an element (and its children).
  5472. Role(v string) HTMLCanvas
  5473. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  5474. Spellcheck(v bool) HTMLCanvas
  5475. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  5476. Style(k, v string) HTMLCanvas
  5477. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  5478. Styles(s map[string]string) HTMLCanvas
  5479. // TabIndex specifies the tabbing order of an element.
  5480. TabIndex(v int) HTMLCanvas
  5481. // Title specifies extra information about an element.
  5482. Title(v string) HTMLCanvas
  5483. // Width specifies the width of the element.
  5484. Width(v int) HTMLCanvas
  5485. // On registers the given event handler to the specified event.
  5486. On(event string, h EventHandler, scope ...any) HTMLCanvas
  5487. // OnBlur calls the given handler when the element loses focus.
  5488. OnBlur(h EventHandler, scope ...any) HTMLCanvas
  5489. // OnChange calls the given handler when the value of the element is changed.
  5490. OnChange(h EventHandler, scope ...any) HTMLCanvas
  5491. // OnClick calls the given handler when there is a mouse click on the element.
  5492. OnClick(h EventHandler, scope ...any) HTMLCanvas
  5493. // OnContextMenu calls the given handler when a context menu is triggered.
  5494. OnContextMenu(h EventHandler, scope ...any) HTMLCanvas
  5495. // OnCopy calls the given handler when the user copies the content of an element.
  5496. OnCopy(h EventHandler, scope ...any) HTMLCanvas
  5497. // OnCut calls the given handler when the user cuts the content of an element.
  5498. OnCut(h EventHandler, scope ...any) HTMLCanvas
  5499. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  5500. OnDblClick(h EventHandler, scope ...any) HTMLCanvas
  5501. // OnDrag calls the given handler when an element is dragged.
  5502. OnDrag(h EventHandler, scope ...any) HTMLCanvas
  5503. // OnDragEnd calls the given handler at the end of a drag operation.
  5504. OnDragEnd(h EventHandler, scope ...any) HTMLCanvas
  5505. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  5506. OnDragEnter(h EventHandler, scope ...any) HTMLCanvas
  5507. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  5508. OnDragLeave(h EventHandler, scope ...any) HTMLCanvas
  5509. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  5510. OnDragOver(h EventHandler, scope ...any) HTMLCanvas
  5511. // OnDragStart calls the given handler at the start of a drag operation.
  5512. OnDragStart(h EventHandler, scope ...any) HTMLCanvas
  5513. // OnDrop calls the given handler when dragged element is being dropped.
  5514. OnDrop(h EventHandler, scope ...any) HTMLCanvas
  5515. // OnFocus calls the given handler when the element gets focus.
  5516. OnFocus(h EventHandler, scope ...any) HTMLCanvas
  5517. // OnInput calls the given handler when an element gets user input.
  5518. OnInput(h EventHandler, scope ...any) HTMLCanvas
  5519. // OnInvalid calls the given handler when an element is invalid.
  5520. OnInvalid(h EventHandler, scope ...any) HTMLCanvas
  5521. // OnKeyDown calls the given handler when a user is pressing a key.
  5522. OnKeyDown(h EventHandler, scope ...any) HTMLCanvas
  5523. // OnKeyPress calls the given handler when a user presses a key.
  5524. OnKeyPress(h EventHandler, scope ...any) HTMLCanvas
  5525. // OnKeyUp calls the given handler when a user releases a key.
  5526. OnKeyUp(h EventHandler, scope ...any) HTMLCanvas
  5527. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  5528. OnMouseDown(h EventHandler, scope ...any) HTMLCanvas
  5529. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  5530. OnMouseMove(h EventHandler, scope ...any) HTMLCanvas
  5531. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  5532. OnMouseOut(h EventHandler, scope ...any) HTMLCanvas
  5533. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  5534. OnMouseOver(h EventHandler, scope ...any) HTMLCanvas
  5535. // OnMouseUp calls the given handler when a mouse button is released over an element.
  5536. OnMouseUp(h EventHandler, scope ...any) HTMLCanvas
  5537. // OnPaste calls the given handler when the user pastes some content in an element.
  5538. OnPaste(h EventHandler, scope ...any) HTMLCanvas
  5539. // OnReset calls the given handler when the Reset button in a form is clicked.
  5540. OnReset(h EventHandler, scope ...any) HTMLCanvas
  5541. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  5542. OnScroll(h EventHandler, scope ...any) HTMLCanvas
  5543. // OnSearch calls the given handler when the user writes something in a search field.
  5544. OnSearch(h EventHandler, scope ...any) HTMLCanvas
  5545. // OnSelect calls the given handler after some text has been selected in an element.
  5546. OnSelect(h EventHandler, scope ...any) HTMLCanvas
  5547. // OnSubmit calls the given handler when a form is submitted.
  5548. OnSubmit(h EventHandler, scope ...any) HTMLCanvas
  5549. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  5550. OnWheel(h EventHandler, scope ...any) HTMLCanvas
  5551. }
  5552. // Canvas returns an HTML element that is used to draw graphics on the fly.
  5553. func Canvas() HTMLCanvas {
  5554. e := &htmlCanvas{
  5555. htmlElement: htmlElement{
  5556. tag: "canvas",
  5557. isSelfClosing: false,
  5558. },
  5559. }
  5560. return e
  5561. }
  5562. type htmlCanvas struct {
  5563. htmlElement
  5564. }
  5565. func (e *htmlCanvas) Body(v ...UI) HTMLCanvas {
  5566. e.setChildren(v...)
  5567. return e
  5568. }
  5569. func (e *htmlCanvas) Text(v any) HTMLCanvas {
  5570. return e.Body(Text(v))
  5571. }
  5572. func (e *htmlCanvas) AccessKey(v string) HTMLCanvas {
  5573. e.setAttr("accesskey", v)
  5574. return e
  5575. }
  5576. func (e *htmlCanvas) Aria(k string, v any) HTMLCanvas {
  5577. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  5578. return e
  5579. }
  5580. func (e *htmlCanvas) Attr(n string, v any) HTMLCanvas {
  5581. e.setAttr(n, v)
  5582. return e
  5583. }
  5584. func (e *htmlCanvas) Class(v ...string) HTMLCanvas {
  5585. e.setAttr("class", strings.Join(v, " "))
  5586. return e
  5587. }
  5588. func (e *htmlCanvas) ContentEditable(v bool) HTMLCanvas {
  5589. e.setAttr("contenteditable", v)
  5590. return e
  5591. }
  5592. func (e *htmlCanvas) DataSet(k string, v any) HTMLCanvas {
  5593. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  5594. return e
  5595. }
  5596. func (e *htmlCanvas) Dir(v string) HTMLCanvas {
  5597. e.setAttr("dir", v)
  5598. return e
  5599. }
  5600. func (e *htmlCanvas) Draggable(v bool) HTMLCanvas {
  5601. e.setAttr("draggable", v)
  5602. return e
  5603. }
  5604. func (e *htmlCanvas) Height(v int) HTMLCanvas {
  5605. e.setAttr("height", v)
  5606. return e
  5607. }
  5608. func (e *htmlCanvas) Hidden(v bool) HTMLCanvas {
  5609. e.setAttr("hidden", v)
  5610. return e
  5611. }
  5612. func (e *htmlCanvas) ID(v string) HTMLCanvas {
  5613. e.setAttr("id", v)
  5614. return e
  5615. }
  5616. func (e *htmlCanvas) Lang(v string) HTMLCanvas {
  5617. e.setAttr("lang", v)
  5618. return e
  5619. }
  5620. func (e *htmlCanvas) Role(v string) HTMLCanvas {
  5621. e.setAttr("role", v)
  5622. return e
  5623. }
  5624. func (e *htmlCanvas) Spellcheck(v bool) HTMLCanvas {
  5625. s := "false"
  5626. if v {
  5627. s = "true"
  5628. }
  5629. e.setAttr("spellcheck", s)
  5630. return e
  5631. }
  5632. func (e *htmlCanvas) Style(k, v string) HTMLCanvas {
  5633. e.setAttr("style", k+":"+v)
  5634. return e
  5635. }
  5636. func (e *htmlCanvas) Styles(s map[string]string) HTMLCanvas {
  5637. for k, v := range s {
  5638. e.Style(k, v)
  5639. }
  5640. return e
  5641. }
  5642. func (e *htmlCanvas) TabIndex(v int) HTMLCanvas {
  5643. e.setAttr("tabindex", v)
  5644. return e
  5645. }
  5646. func (e *htmlCanvas) Title(v string) HTMLCanvas {
  5647. e.setAttr("title", v)
  5648. return e
  5649. }
  5650. func (e *htmlCanvas) Width(v int) HTMLCanvas {
  5651. e.setAttr("width", v)
  5652. return e
  5653. }
  5654. func (e *htmlCanvas) On(event string, h EventHandler, scope ...any) HTMLCanvas {
  5655. e.setEventHandler(event, h, scope...)
  5656. return e
  5657. }
  5658. func (e *htmlCanvas) OnBlur(h EventHandler, scope ...any) HTMLCanvas {
  5659. e.setEventHandler("blur", h, scope...)
  5660. return e
  5661. }
  5662. func (e *htmlCanvas) OnChange(h EventHandler, scope ...any) HTMLCanvas {
  5663. e.setEventHandler("change", h, scope...)
  5664. return e
  5665. }
  5666. func (e *htmlCanvas) OnClick(h EventHandler, scope ...any) HTMLCanvas {
  5667. e.setEventHandler("click", h, scope...)
  5668. return e
  5669. }
  5670. func (e *htmlCanvas) OnContextMenu(h EventHandler, scope ...any) HTMLCanvas {
  5671. e.setEventHandler("contextmenu", h, scope...)
  5672. return e
  5673. }
  5674. func (e *htmlCanvas) OnCopy(h EventHandler, scope ...any) HTMLCanvas {
  5675. e.setEventHandler("copy", h, scope...)
  5676. return e
  5677. }
  5678. func (e *htmlCanvas) OnCut(h EventHandler, scope ...any) HTMLCanvas {
  5679. e.setEventHandler("cut", h, scope...)
  5680. return e
  5681. }
  5682. func (e *htmlCanvas) OnDblClick(h EventHandler, scope ...any) HTMLCanvas {
  5683. e.setEventHandler("dblclick", h, scope...)
  5684. return e
  5685. }
  5686. func (e *htmlCanvas) OnDrag(h EventHandler, scope ...any) HTMLCanvas {
  5687. e.setEventHandler("drag", h, scope...)
  5688. return e
  5689. }
  5690. func (e *htmlCanvas) OnDragEnd(h EventHandler, scope ...any) HTMLCanvas {
  5691. e.setEventHandler("dragend", h, scope...)
  5692. return e
  5693. }
  5694. func (e *htmlCanvas) OnDragEnter(h EventHandler, scope ...any) HTMLCanvas {
  5695. e.setEventHandler("dragenter", h, scope...)
  5696. return e
  5697. }
  5698. func (e *htmlCanvas) OnDragLeave(h EventHandler, scope ...any) HTMLCanvas {
  5699. e.setEventHandler("dragleave", h, scope...)
  5700. return e
  5701. }
  5702. func (e *htmlCanvas) OnDragOver(h EventHandler, scope ...any) HTMLCanvas {
  5703. e.setEventHandler("dragover", h, scope...)
  5704. return e
  5705. }
  5706. func (e *htmlCanvas) OnDragStart(h EventHandler, scope ...any) HTMLCanvas {
  5707. e.setEventHandler("dragstart", h, scope...)
  5708. return e
  5709. }
  5710. func (e *htmlCanvas) OnDrop(h EventHandler, scope ...any) HTMLCanvas {
  5711. e.setEventHandler("drop", h, scope...)
  5712. return e
  5713. }
  5714. func (e *htmlCanvas) OnFocus(h EventHandler, scope ...any) HTMLCanvas {
  5715. e.setEventHandler("focus", h, scope...)
  5716. return e
  5717. }
  5718. func (e *htmlCanvas) OnInput(h EventHandler, scope ...any) HTMLCanvas {
  5719. e.setEventHandler("input", h, scope...)
  5720. return e
  5721. }
  5722. func (e *htmlCanvas) OnInvalid(h EventHandler, scope ...any) HTMLCanvas {
  5723. e.setEventHandler("invalid", h, scope...)
  5724. return e
  5725. }
  5726. func (e *htmlCanvas) OnKeyDown(h EventHandler, scope ...any) HTMLCanvas {
  5727. e.setEventHandler("keydown", h, scope...)
  5728. return e
  5729. }
  5730. func (e *htmlCanvas) OnKeyPress(h EventHandler, scope ...any) HTMLCanvas {
  5731. e.setEventHandler("keypress", h, scope...)
  5732. return e
  5733. }
  5734. func (e *htmlCanvas) OnKeyUp(h EventHandler, scope ...any) HTMLCanvas {
  5735. e.setEventHandler("keyup", h, scope...)
  5736. return e
  5737. }
  5738. func (e *htmlCanvas) OnMouseDown(h EventHandler, scope ...any) HTMLCanvas {
  5739. e.setEventHandler("mousedown", h, scope...)
  5740. return e
  5741. }
  5742. func (e *htmlCanvas) OnMouseMove(h EventHandler, scope ...any) HTMLCanvas {
  5743. e.setEventHandler("mousemove", h, scope...)
  5744. return e
  5745. }
  5746. func (e *htmlCanvas) OnMouseOut(h EventHandler, scope ...any) HTMLCanvas {
  5747. e.setEventHandler("mouseout", h, scope...)
  5748. return e
  5749. }
  5750. func (e *htmlCanvas) OnMouseOver(h EventHandler, scope ...any) HTMLCanvas {
  5751. e.setEventHandler("mouseover", h, scope...)
  5752. return e
  5753. }
  5754. func (e *htmlCanvas) OnMouseUp(h EventHandler, scope ...any) HTMLCanvas {
  5755. e.setEventHandler("mouseup", h, scope...)
  5756. return e
  5757. }
  5758. func (e *htmlCanvas) OnPaste(h EventHandler, scope ...any) HTMLCanvas {
  5759. e.setEventHandler("paste", h, scope...)
  5760. return e
  5761. }
  5762. func (e *htmlCanvas) OnReset(h EventHandler, scope ...any) HTMLCanvas {
  5763. e.setEventHandler("reset", h, scope...)
  5764. return e
  5765. }
  5766. func (e *htmlCanvas) OnScroll(h EventHandler, scope ...any) HTMLCanvas {
  5767. e.setEventHandler("scroll", h, scope...)
  5768. return e
  5769. }
  5770. func (e *htmlCanvas) OnSearch(h EventHandler, scope ...any) HTMLCanvas {
  5771. e.setEventHandler("search", h, scope...)
  5772. return e
  5773. }
  5774. func (e *htmlCanvas) OnSelect(h EventHandler, scope ...any) HTMLCanvas {
  5775. e.setEventHandler("select", h, scope...)
  5776. return e
  5777. }
  5778. func (e *htmlCanvas) OnSubmit(h EventHandler, scope ...any) HTMLCanvas {
  5779. e.setEventHandler("submit", h, scope...)
  5780. return e
  5781. }
  5782. func (e *htmlCanvas) OnWheel(h EventHandler, scope ...any) HTMLCanvas {
  5783. e.setEventHandler("wheel", h, scope...)
  5784. return e
  5785. }
  5786. // HTMLCaption is the interface that describes a "caption" HTML element.
  5787. type HTMLCaption interface {
  5788. UI
  5789. // Body set the content of the element.
  5790. Body(elems ...UI) HTMLCaption
  5791. // Text sets the content of the element with a text node containing the stringified given value.
  5792. Text(v any) HTMLCaption
  5793. // AccessKey specifies a shortcut key to activate/focus an element.
  5794. AccessKey(v string) HTMLCaption
  5795. // Aria stores accessible rich internet applications (ARIA) data.
  5796. Aria(k string, v any) HTMLCaption
  5797. // Attr sets the named attribute with the given value.
  5798. Attr(n string, v any) HTMLCaption
  5799. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  5800. Class(v ...string) HTMLCaption
  5801. // ContentEditable specifies whether the content of an element is editable or not.
  5802. ContentEditable(v bool) HTMLCaption
  5803. // DataSet stores custom data private to the page or application.
  5804. DataSet(k string, v any) HTMLCaption
  5805. // Dir specifies the text direction for the content in an element.
  5806. Dir(v string) HTMLCaption
  5807. // Draggable specifies whether an element is draggable or not.
  5808. Draggable(v bool) HTMLCaption
  5809. // Hidden specifies that an element is not yet, or is no longer relevant.
  5810. Hidden(v bool) HTMLCaption
  5811. // ID specifies a unique id for an element.
  5812. ID(v string) HTMLCaption
  5813. // Lang specifies the language of the element's content.
  5814. Lang(v string) HTMLCaption
  5815. // Role specifies to parsing software the exact function of an element (and its children).
  5816. Role(v string) HTMLCaption
  5817. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  5818. Spellcheck(v bool) HTMLCaption
  5819. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  5820. Style(k, v string) HTMLCaption
  5821. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  5822. Styles(s map[string]string) HTMLCaption
  5823. // TabIndex specifies the tabbing order of an element.
  5824. TabIndex(v int) HTMLCaption
  5825. // Title specifies extra information about an element.
  5826. Title(v string) HTMLCaption
  5827. // On registers the given event handler to the specified event.
  5828. On(event string, h EventHandler, scope ...any) HTMLCaption
  5829. // OnBlur calls the given handler when the element loses focus.
  5830. OnBlur(h EventHandler, scope ...any) HTMLCaption
  5831. // OnChange calls the given handler when the value of the element is changed.
  5832. OnChange(h EventHandler, scope ...any) HTMLCaption
  5833. // OnClick calls the given handler when there is a mouse click on the element.
  5834. OnClick(h EventHandler, scope ...any) HTMLCaption
  5835. // OnContextMenu calls the given handler when a context menu is triggered.
  5836. OnContextMenu(h EventHandler, scope ...any) HTMLCaption
  5837. // OnCopy calls the given handler when the user copies the content of an element.
  5838. OnCopy(h EventHandler, scope ...any) HTMLCaption
  5839. // OnCut calls the given handler when the user cuts the content of an element.
  5840. OnCut(h EventHandler, scope ...any) HTMLCaption
  5841. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  5842. OnDblClick(h EventHandler, scope ...any) HTMLCaption
  5843. // OnDrag calls the given handler when an element is dragged.
  5844. OnDrag(h EventHandler, scope ...any) HTMLCaption
  5845. // OnDragEnd calls the given handler at the end of a drag operation.
  5846. OnDragEnd(h EventHandler, scope ...any) HTMLCaption
  5847. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  5848. OnDragEnter(h EventHandler, scope ...any) HTMLCaption
  5849. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  5850. OnDragLeave(h EventHandler, scope ...any) HTMLCaption
  5851. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  5852. OnDragOver(h EventHandler, scope ...any) HTMLCaption
  5853. // OnDragStart calls the given handler at the start of a drag operation.
  5854. OnDragStart(h EventHandler, scope ...any) HTMLCaption
  5855. // OnDrop calls the given handler when dragged element is being dropped.
  5856. OnDrop(h EventHandler, scope ...any) HTMLCaption
  5857. // OnFocus calls the given handler when the element gets focus.
  5858. OnFocus(h EventHandler, scope ...any) HTMLCaption
  5859. // OnInput calls the given handler when an element gets user input.
  5860. OnInput(h EventHandler, scope ...any) HTMLCaption
  5861. // OnInvalid calls the given handler when an element is invalid.
  5862. OnInvalid(h EventHandler, scope ...any) HTMLCaption
  5863. // OnKeyDown calls the given handler when a user is pressing a key.
  5864. OnKeyDown(h EventHandler, scope ...any) HTMLCaption
  5865. // OnKeyPress calls the given handler when a user presses a key.
  5866. OnKeyPress(h EventHandler, scope ...any) HTMLCaption
  5867. // OnKeyUp calls the given handler when a user releases a key.
  5868. OnKeyUp(h EventHandler, scope ...any) HTMLCaption
  5869. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  5870. OnMouseDown(h EventHandler, scope ...any) HTMLCaption
  5871. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  5872. OnMouseMove(h EventHandler, scope ...any) HTMLCaption
  5873. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  5874. OnMouseOut(h EventHandler, scope ...any) HTMLCaption
  5875. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  5876. OnMouseOver(h EventHandler, scope ...any) HTMLCaption
  5877. // OnMouseUp calls the given handler when a mouse button is released over an element.
  5878. OnMouseUp(h EventHandler, scope ...any) HTMLCaption
  5879. // OnPaste calls the given handler when the user pastes some content in an element.
  5880. OnPaste(h EventHandler, scope ...any) HTMLCaption
  5881. // OnReset calls the given handler when the Reset button in a form is clicked.
  5882. OnReset(h EventHandler, scope ...any) HTMLCaption
  5883. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  5884. OnScroll(h EventHandler, scope ...any) HTMLCaption
  5885. // OnSearch calls the given handler when the user writes something in a search field.
  5886. OnSearch(h EventHandler, scope ...any) HTMLCaption
  5887. // OnSelect calls the given handler after some text has been selected in an element.
  5888. OnSelect(h EventHandler, scope ...any) HTMLCaption
  5889. // OnSubmit calls the given handler when a form is submitted.
  5890. OnSubmit(h EventHandler, scope ...any) HTMLCaption
  5891. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  5892. OnWheel(h EventHandler, scope ...any) HTMLCaption
  5893. }
  5894. // Caption returns an HTML element that defines a table caption.
  5895. func Caption() HTMLCaption {
  5896. e := &htmlCaption{
  5897. htmlElement: htmlElement{
  5898. tag: "caption",
  5899. isSelfClosing: false,
  5900. },
  5901. }
  5902. return e
  5903. }
  5904. type htmlCaption struct {
  5905. htmlElement
  5906. }
  5907. func (e *htmlCaption) Body(v ...UI) HTMLCaption {
  5908. e.setChildren(v...)
  5909. return e
  5910. }
  5911. func (e *htmlCaption) Text(v any) HTMLCaption {
  5912. return e.Body(Text(v))
  5913. }
  5914. func (e *htmlCaption) AccessKey(v string) HTMLCaption {
  5915. e.setAttr("accesskey", v)
  5916. return e
  5917. }
  5918. func (e *htmlCaption) Aria(k string, v any) HTMLCaption {
  5919. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  5920. return e
  5921. }
  5922. func (e *htmlCaption) Attr(n string, v any) HTMLCaption {
  5923. e.setAttr(n, v)
  5924. return e
  5925. }
  5926. func (e *htmlCaption) Class(v ...string) HTMLCaption {
  5927. e.setAttr("class", strings.Join(v, " "))
  5928. return e
  5929. }
  5930. func (e *htmlCaption) ContentEditable(v bool) HTMLCaption {
  5931. e.setAttr("contenteditable", v)
  5932. return e
  5933. }
  5934. func (e *htmlCaption) DataSet(k string, v any) HTMLCaption {
  5935. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  5936. return e
  5937. }
  5938. func (e *htmlCaption) Dir(v string) HTMLCaption {
  5939. e.setAttr("dir", v)
  5940. return e
  5941. }
  5942. func (e *htmlCaption) Draggable(v bool) HTMLCaption {
  5943. e.setAttr("draggable", v)
  5944. return e
  5945. }
  5946. func (e *htmlCaption) Hidden(v bool) HTMLCaption {
  5947. e.setAttr("hidden", v)
  5948. return e
  5949. }
  5950. func (e *htmlCaption) ID(v string) HTMLCaption {
  5951. e.setAttr("id", v)
  5952. return e
  5953. }
  5954. func (e *htmlCaption) Lang(v string) HTMLCaption {
  5955. e.setAttr("lang", v)
  5956. return e
  5957. }
  5958. func (e *htmlCaption) Role(v string) HTMLCaption {
  5959. e.setAttr("role", v)
  5960. return e
  5961. }
  5962. func (e *htmlCaption) Spellcheck(v bool) HTMLCaption {
  5963. s := "false"
  5964. if v {
  5965. s = "true"
  5966. }
  5967. e.setAttr("spellcheck", s)
  5968. return e
  5969. }
  5970. func (e *htmlCaption) Style(k, v string) HTMLCaption {
  5971. e.setAttr("style", k+":"+v)
  5972. return e
  5973. }
  5974. func (e *htmlCaption) Styles(s map[string]string) HTMLCaption {
  5975. for k, v := range s {
  5976. e.Style(k, v)
  5977. }
  5978. return e
  5979. }
  5980. func (e *htmlCaption) TabIndex(v int) HTMLCaption {
  5981. e.setAttr("tabindex", v)
  5982. return e
  5983. }
  5984. func (e *htmlCaption) Title(v string) HTMLCaption {
  5985. e.setAttr("title", v)
  5986. return e
  5987. }
  5988. func (e *htmlCaption) On(event string, h EventHandler, scope ...any) HTMLCaption {
  5989. e.setEventHandler(event, h, scope...)
  5990. return e
  5991. }
  5992. func (e *htmlCaption) OnBlur(h EventHandler, scope ...any) HTMLCaption {
  5993. e.setEventHandler("blur", h, scope...)
  5994. return e
  5995. }
  5996. func (e *htmlCaption) OnChange(h EventHandler, scope ...any) HTMLCaption {
  5997. e.setEventHandler("change", h, scope...)
  5998. return e
  5999. }
  6000. func (e *htmlCaption) OnClick(h EventHandler, scope ...any) HTMLCaption {
  6001. e.setEventHandler("click", h, scope...)
  6002. return e
  6003. }
  6004. func (e *htmlCaption) OnContextMenu(h EventHandler, scope ...any) HTMLCaption {
  6005. e.setEventHandler("contextmenu", h, scope...)
  6006. return e
  6007. }
  6008. func (e *htmlCaption) OnCopy(h EventHandler, scope ...any) HTMLCaption {
  6009. e.setEventHandler("copy", h, scope...)
  6010. return e
  6011. }
  6012. func (e *htmlCaption) OnCut(h EventHandler, scope ...any) HTMLCaption {
  6013. e.setEventHandler("cut", h, scope...)
  6014. return e
  6015. }
  6016. func (e *htmlCaption) OnDblClick(h EventHandler, scope ...any) HTMLCaption {
  6017. e.setEventHandler("dblclick", h, scope...)
  6018. return e
  6019. }
  6020. func (e *htmlCaption) OnDrag(h EventHandler, scope ...any) HTMLCaption {
  6021. e.setEventHandler("drag", h, scope...)
  6022. return e
  6023. }
  6024. func (e *htmlCaption) OnDragEnd(h EventHandler, scope ...any) HTMLCaption {
  6025. e.setEventHandler("dragend", h, scope...)
  6026. return e
  6027. }
  6028. func (e *htmlCaption) OnDragEnter(h EventHandler, scope ...any) HTMLCaption {
  6029. e.setEventHandler("dragenter", h, scope...)
  6030. return e
  6031. }
  6032. func (e *htmlCaption) OnDragLeave(h EventHandler, scope ...any) HTMLCaption {
  6033. e.setEventHandler("dragleave", h, scope...)
  6034. return e
  6035. }
  6036. func (e *htmlCaption) OnDragOver(h EventHandler, scope ...any) HTMLCaption {
  6037. e.setEventHandler("dragover", h, scope...)
  6038. return e
  6039. }
  6040. func (e *htmlCaption) OnDragStart(h EventHandler, scope ...any) HTMLCaption {
  6041. e.setEventHandler("dragstart", h, scope...)
  6042. return e
  6043. }
  6044. func (e *htmlCaption) OnDrop(h EventHandler, scope ...any) HTMLCaption {
  6045. e.setEventHandler("drop", h, scope...)
  6046. return e
  6047. }
  6048. func (e *htmlCaption) OnFocus(h EventHandler, scope ...any) HTMLCaption {
  6049. e.setEventHandler("focus", h, scope...)
  6050. return e
  6051. }
  6052. func (e *htmlCaption) OnInput(h EventHandler, scope ...any) HTMLCaption {
  6053. e.setEventHandler("input", h, scope...)
  6054. return e
  6055. }
  6056. func (e *htmlCaption) OnInvalid(h EventHandler, scope ...any) HTMLCaption {
  6057. e.setEventHandler("invalid", h, scope...)
  6058. return e
  6059. }
  6060. func (e *htmlCaption) OnKeyDown(h EventHandler, scope ...any) HTMLCaption {
  6061. e.setEventHandler("keydown", h, scope...)
  6062. return e
  6063. }
  6064. func (e *htmlCaption) OnKeyPress(h EventHandler, scope ...any) HTMLCaption {
  6065. e.setEventHandler("keypress", h, scope...)
  6066. return e
  6067. }
  6068. func (e *htmlCaption) OnKeyUp(h EventHandler, scope ...any) HTMLCaption {
  6069. e.setEventHandler("keyup", h, scope...)
  6070. return e
  6071. }
  6072. func (e *htmlCaption) OnMouseDown(h EventHandler, scope ...any) HTMLCaption {
  6073. e.setEventHandler("mousedown", h, scope...)
  6074. return e
  6075. }
  6076. func (e *htmlCaption) OnMouseMove(h EventHandler, scope ...any) HTMLCaption {
  6077. e.setEventHandler("mousemove", h, scope...)
  6078. return e
  6079. }
  6080. func (e *htmlCaption) OnMouseOut(h EventHandler, scope ...any) HTMLCaption {
  6081. e.setEventHandler("mouseout", h, scope...)
  6082. return e
  6083. }
  6084. func (e *htmlCaption) OnMouseOver(h EventHandler, scope ...any) HTMLCaption {
  6085. e.setEventHandler("mouseover", h, scope...)
  6086. return e
  6087. }
  6088. func (e *htmlCaption) OnMouseUp(h EventHandler, scope ...any) HTMLCaption {
  6089. e.setEventHandler("mouseup", h, scope...)
  6090. return e
  6091. }
  6092. func (e *htmlCaption) OnPaste(h EventHandler, scope ...any) HTMLCaption {
  6093. e.setEventHandler("paste", h, scope...)
  6094. return e
  6095. }
  6096. func (e *htmlCaption) OnReset(h EventHandler, scope ...any) HTMLCaption {
  6097. e.setEventHandler("reset", h, scope...)
  6098. return e
  6099. }
  6100. func (e *htmlCaption) OnScroll(h EventHandler, scope ...any) HTMLCaption {
  6101. e.setEventHandler("scroll", h, scope...)
  6102. return e
  6103. }
  6104. func (e *htmlCaption) OnSearch(h EventHandler, scope ...any) HTMLCaption {
  6105. e.setEventHandler("search", h, scope...)
  6106. return e
  6107. }
  6108. func (e *htmlCaption) OnSelect(h EventHandler, scope ...any) HTMLCaption {
  6109. e.setEventHandler("select", h, scope...)
  6110. return e
  6111. }
  6112. func (e *htmlCaption) OnSubmit(h EventHandler, scope ...any) HTMLCaption {
  6113. e.setEventHandler("submit", h, scope...)
  6114. return e
  6115. }
  6116. func (e *htmlCaption) OnWheel(h EventHandler, scope ...any) HTMLCaption {
  6117. e.setEventHandler("wheel", h, scope...)
  6118. return e
  6119. }
  6120. // HTMLCite is the interface that describes a "cite" HTML element.
  6121. type HTMLCite interface {
  6122. UI
  6123. // Body set the content of the element.
  6124. Body(elems ...UI) HTMLCite
  6125. // Text sets the content of the element with a text node containing the stringified given value.
  6126. Text(v any) HTMLCite
  6127. // AccessKey specifies a shortcut key to activate/focus an element.
  6128. AccessKey(v string) HTMLCite
  6129. // Aria stores accessible rich internet applications (ARIA) data.
  6130. Aria(k string, v any) HTMLCite
  6131. // Attr sets the named attribute with the given value.
  6132. Attr(n string, v any) HTMLCite
  6133. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  6134. Class(v ...string) HTMLCite
  6135. // ContentEditable specifies whether the content of an element is editable or not.
  6136. ContentEditable(v bool) HTMLCite
  6137. // DataSet stores custom data private to the page or application.
  6138. DataSet(k string, v any) HTMLCite
  6139. // Dir specifies the text direction for the content in an element.
  6140. Dir(v string) HTMLCite
  6141. // Draggable specifies whether an element is draggable or not.
  6142. Draggable(v bool) HTMLCite
  6143. // Hidden specifies that an element is not yet, or is no longer relevant.
  6144. Hidden(v bool) HTMLCite
  6145. // ID specifies a unique id for an element.
  6146. ID(v string) HTMLCite
  6147. // Lang specifies the language of the element's content.
  6148. Lang(v string) HTMLCite
  6149. // Role specifies to parsing software the exact function of an element (and its children).
  6150. Role(v string) HTMLCite
  6151. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  6152. Spellcheck(v bool) HTMLCite
  6153. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  6154. Style(k, v string) HTMLCite
  6155. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  6156. Styles(s map[string]string) HTMLCite
  6157. // TabIndex specifies the tabbing order of an element.
  6158. TabIndex(v int) HTMLCite
  6159. // Title specifies extra information about an element.
  6160. Title(v string) HTMLCite
  6161. // On registers the given event handler to the specified event.
  6162. On(event string, h EventHandler, scope ...any) HTMLCite
  6163. // OnBlur calls the given handler when the element loses focus.
  6164. OnBlur(h EventHandler, scope ...any) HTMLCite
  6165. // OnChange calls the given handler when the value of the element is changed.
  6166. OnChange(h EventHandler, scope ...any) HTMLCite
  6167. // OnClick calls the given handler when there is a mouse click on the element.
  6168. OnClick(h EventHandler, scope ...any) HTMLCite
  6169. // OnContextMenu calls the given handler when a context menu is triggered.
  6170. OnContextMenu(h EventHandler, scope ...any) HTMLCite
  6171. // OnCopy calls the given handler when the user copies the content of an element.
  6172. OnCopy(h EventHandler, scope ...any) HTMLCite
  6173. // OnCut calls the given handler when the user cuts the content of an element.
  6174. OnCut(h EventHandler, scope ...any) HTMLCite
  6175. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  6176. OnDblClick(h EventHandler, scope ...any) HTMLCite
  6177. // OnDrag calls the given handler when an element is dragged.
  6178. OnDrag(h EventHandler, scope ...any) HTMLCite
  6179. // OnDragEnd calls the given handler at the end of a drag operation.
  6180. OnDragEnd(h EventHandler, scope ...any) HTMLCite
  6181. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  6182. OnDragEnter(h EventHandler, scope ...any) HTMLCite
  6183. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  6184. OnDragLeave(h EventHandler, scope ...any) HTMLCite
  6185. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  6186. OnDragOver(h EventHandler, scope ...any) HTMLCite
  6187. // OnDragStart calls the given handler at the start of a drag operation.
  6188. OnDragStart(h EventHandler, scope ...any) HTMLCite
  6189. // OnDrop calls the given handler when dragged element is being dropped.
  6190. OnDrop(h EventHandler, scope ...any) HTMLCite
  6191. // OnFocus calls the given handler when the element gets focus.
  6192. OnFocus(h EventHandler, scope ...any) HTMLCite
  6193. // OnInput calls the given handler when an element gets user input.
  6194. OnInput(h EventHandler, scope ...any) HTMLCite
  6195. // OnInvalid calls the given handler when an element is invalid.
  6196. OnInvalid(h EventHandler, scope ...any) HTMLCite
  6197. // OnKeyDown calls the given handler when a user is pressing a key.
  6198. OnKeyDown(h EventHandler, scope ...any) HTMLCite
  6199. // OnKeyPress calls the given handler when a user presses a key.
  6200. OnKeyPress(h EventHandler, scope ...any) HTMLCite
  6201. // OnKeyUp calls the given handler when a user releases a key.
  6202. OnKeyUp(h EventHandler, scope ...any) HTMLCite
  6203. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  6204. OnMouseDown(h EventHandler, scope ...any) HTMLCite
  6205. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  6206. OnMouseMove(h EventHandler, scope ...any) HTMLCite
  6207. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  6208. OnMouseOut(h EventHandler, scope ...any) HTMLCite
  6209. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  6210. OnMouseOver(h EventHandler, scope ...any) HTMLCite
  6211. // OnMouseUp calls the given handler when a mouse button is released over an element.
  6212. OnMouseUp(h EventHandler, scope ...any) HTMLCite
  6213. // OnPaste calls the given handler when the user pastes some content in an element.
  6214. OnPaste(h EventHandler, scope ...any) HTMLCite
  6215. // OnReset calls the given handler when the Reset button in a form is clicked.
  6216. OnReset(h EventHandler, scope ...any) HTMLCite
  6217. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  6218. OnScroll(h EventHandler, scope ...any) HTMLCite
  6219. // OnSearch calls the given handler when the user writes something in a search field.
  6220. OnSearch(h EventHandler, scope ...any) HTMLCite
  6221. // OnSelect calls the given handler after some text has been selected in an element.
  6222. OnSelect(h EventHandler, scope ...any) HTMLCite
  6223. // OnSubmit calls the given handler when a form is submitted.
  6224. OnSubmit(h EventHandler, scope ...any) HTMLCite
  6225. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  6226. OnWheel(h EventHandler, scope ...any) HTMLCite
  6227. }
  6228. // Cite returns an HTML element that defines the title of a work.
  6229. func Cite() HTMLCite {
  6230. e := &htmlCite{
  6231. htmlElement: htmlElement{
  6232. tag: "cite",
  6233. isSelfClosing: false,
  6234. },
  6235. }
  6236. return e
  6237. }
  6238. type htmlCite struct {
  6239. htmlElement
  6240. }
  6241. func (e *htmlCite) Body(v ...UI) HTMLCite {
  6242. e.setChildren(v...)
  6243. return e
  6244. }
  6245. func (e *htmlCite) Text(v any) HTMLCite {
  6246. return e.Body(Text(v))
  6247. }
  6248. func (e *htmlCite) AccessKey(v string) HTMLCite {
  6249. e.setAttr("accesskey", v)
  6250. return e
  6251. }
  6252. func (e *htmlCite) Aria(k string, v any) HTMLCite {
  6253. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  6254. return e
  6255. }
  6256. func (e *htmlCite) Attr(n string, v any) HTMLCite {
  6257. e.setAttr(n, v)
  6258. return e
  6259. }
  6260. func (e *htmlCite) Class(v ...string) HTMLCite {
  6261. e.setAttr("class", strings.Join(v, " "))
  6262. return e
  6263. }
  6264. func (e *htmlCite) ContentEditable(v bool) HTMLCite {
  6265. e.setAttr("contenteditable", v)
  6266. return e
  6267. }
  6268. func (e *htmlCite) DataSet(k string, v any) HTMLCite {
  6269. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  6270. return e
  6271. }
  6272. func (e *htmlCite) Dir(v string) HTMLCite {
  6273. e.setAttr("dir", v)
  6274. return e
  6275. }
  6276. func (e *htmlCite) Draggable(v bool) HTMLCite {
  6277. e.setAttr("draggable", v)
  6278. return e
  6279. }
  6280. func (e *htmlCite) Hidden(v bool) HTMLCite {
  6281. e.setAttr("hidden", v)
  6282. return e
  6283. }
  6284. func (e *htmlCite) ID(v string) HTMLCite {
  6285. e.setAttr("id", v)
  6286. return e
  6287. }
  6288. func (e *htmlCite) Lang(v string) HTMLCite {
  6289. e.setAttr("lang", v)
  6290. return e
  6291. }
  6292. func (e *htmlCite) Role(v string) HTMLCite {
  6293. e.setAttr("role", v)
  6294. return e
  6295. }
  6296. func (e *htmlCite) Spellcheck(v bool) HTMLCite {
  6297. s := "false"
  6298. if v {
  6299. s = "true"
  6300. }
  6301. e.setAttr("spellcheck", s)
  6302. return e
  6303. }
  6304. func (e *htmlCite) Style(k, v string) HTMLCite {
  6305. e.setAttr("style", k+":"+v)
  6306. return e
  6307. }
  6308. func (e *htmlCite) Styles(s map[string]string) HTMLCite {
  6309. for k, v := range s {
  6310. e.Style(k, v)
  6311. }
  6312. return e
  6313. }
  6314. func (e *htmlCite) TabIndex(v int) HTMLCite {
  6315. e.setAttr("tabindex", v)
  6316. return e
  6317. }
  6318. func (e *htmlCite) Title(v string) HTMLCite {
  6319. e.setAttr("title", v)
  6320. return e
  6321. }
  6322. func (e *htmlCite) On(event string, h EventHandler, scope ...any) HTMLCite {
  6323. e.setEventHandler(event, h, scope...)
  6324. return e
  6325. }
  6326. func (e *htmlCite) OnBlur(h EventHandler, scope ...any) HTMLCite {
  6327. e.setEventHandler("blur", h, scope...)
  6328. return e
  6329. }
  6330. func (e *htmlCite) OnChange(h EventHandler, scope ...any) HTMLCite {
  6331. e.setEventHandler("change", h, scope...)
  6332. return e
  6333. }
  6334. func (e *htmlCite) OnClick(h EventHandler, scope ...any) HTMLCite {
  6335. e.setEventHandler("click", h, scope...)
  6336. return e
  6337. }
  6338. func (e *htmlCite) OnContextMenu(h EventHandler, scope ...any) HTMLCite {
  6339. e.setEventHandler("contextmenu", h, scope...)
  6340. return e
  6341. }
  6342. func (e *htmlCite) OnCopy(h EventHandler, scope ...any) HTMLCite {
  6343. e.setEventHandler("copy", h, scope...)
  6344. return e
  6345. }
  6346. func (e *htmlCite) OnCut(h EventHandler, scope ...any) HTMLCite {
  6347. e.setEventHandler("cut", h, scope...)
  6348. return e
  6349. }
  6350. func (e *htmlCite) OnDblClick(h EventHandler, scope ...any) HTMLCite {
  6351. e.setEventHandler("dblclick", h, scope...)
  6352. return e
  6353. }
  6354. func (e *htmlCite) OnDrag(h EventHandler, scope ...any) HTMLCite {
  6355. e.setEventHandler("drag", h, scope...)
  6356. return e
  6357. }
  6358. func (e *htmlCite) OnDragEnd(h EventHandler, scope ...any) HTMLCite {
  6359. e.setEventHandler("dragend", h, scope...)
  6360. return e
  6361. }
  6362. func (e *htmlCite) OnDragEnter(h EventHandler, scope ...any) HTMLCite {
  6363. e.setEventHandler("dragenter", h, scope...)
  6364. return e
  6365. }
  6366. func (e *htmlCite) OnDragLeave(h EventHandler, scope ...any) HTMLCite {
  6367. e.setEventHandler("dragleave", h, scope...)
  6368. return e
  6369. }
  6370. func (e *htmlCite) OnDragOver(h EventHandler, scope ...any) HTMLCite {
  6371. e.setEventHandler("dragover", h, scope...)
  6372. return e
  6373. }
  6374. func (e *htmlCite) OnDragStart(h EventHandler, scope ...any) HTMLCite {
  6375. e.setEventHandler("dragstart", h, scope...)
  6376. return e
  6377. }
  6378. func (e *htmlCite) OnDrop(h EventHandler, scope ...any) HTMLCite {
  6379. e.setEventHandler("drop", h, scope...)
  6380. return e
  6381. }
  6382. func (e *htmlCite) OnFocus(h EventHandler, scope ...any) HTMLCite {
  6383. e.setEventHandler("focus", h, scope...)
  6384. return e
  6385. }
  6386. func (e *htmlCite) OnInput(h EventHandler, scope ...any) HTMLCite {
  6387. e.setEventHandler("input", h, scope...)
  6388. return e
  6389. }
  6390. func (e *htmlCite) OnInvalid(h EventHandler, scope ...any) HTMLCite {
  6391. e.setEventHandler("invalid", h, scope...)
  6392. return e
  6393. }
  6394. func (e *htmlCite) OnKeyDown(h EventHandler, scope ...any) HTMLCite {
  6395. e.setEventHandler("keydown", h, scope...)
  6396. return e
  6397. }
  6398. func (e *htmlCite) OnKeyPress(h EventHandler, scope ...any) HTMLCite {
  6399. e.setEventHandler("keypress", h, scope...)
  6400. return e
  6401. }
  6402. func (e *htmlCite) OnKeyUp(h EventHandler, scope ...any) HTMLCite {
  6403. e.setEventHandler("keyup", h, scope...)
  6404. return e
  6405. }
  6406. func (e *htmlCite) OnMouseDown(h EventHandler, scope ...any) HTMLCite {
  6407. e.setEventHandler("mousedown", h, scope...)
  6408. return e
  6409. }
  6410. func (e *htmlCite) OnMouseMove(h EventHandler, scope ...any) HTMLCite {
  6411. e.setEventHandler("mousemove", h, scope...)
  6412. return e
  6413. }
  6414. func (e *htmlCite) OnMouseOut(h EventHandler, scope ...any) HTMLCite {
  6415. e.setEventHandler("mouseout", h, scope...)
  6416. return e
  6417. }
  6418. func (e *htmlCite) OnMouseOver(h EventHandler, scope ...any) HTMLCite {
  6419. e.setEventHandler("mouseover", h, scope...)
  6420. return e
  6421. }
  6422. func (e *htmlCite) OnMouseUp(h EventHandler, scope ...any) HTMLCite {
  6423. e.setEventHandler("mouseup", h, scope...)
  6424. return e
  6425. }
  6426. func (e *htmlCite) OnPaste(h EventHandler, scope ...any) HTMLCite {
  6427. e.setEventHandler("paste", h, scope...)
  6428. return e
  6429. }
  6430. func (e *htmlCite) OnReset(h EventHandler, scope ...any) HTMLCite {
  6431. e.setEventHandler("reset", h, scope...)
  6432. return e
  6433. }
  6434. func (e *htmlCite) OnScroll(h EventHandler, scope ...any) HTMLCite {
  6435. e.setEventHandler("scroll", h, scope...)
  6436. return e
  6437. }
  6438. func (e *htmlCite) OnSearch(h EventHandler, scope ...any) HTMLCite {
  6439. e.setEventHandler("search", h, scope...)
  6440. return e
  6441. }
  6442. func (e *htmlCite) OnSelect(h EventHandler, scope ...any) HTMLCite {
  6443. e.setEventHandler("select", h, scope...)
  6444. return e
  6445. }
  6446. func (e *htmlCite) OnSubmit(h EventHandler, scope ...any) HTMLCite {
  6447. e.setEventHandler("submit", h, scope...)
  6448. return e
  6449. }
  6450. func (e *htmlCite) OnWheel(h EventHandler, scope ...any) HTMLCite {
  6451. e.setEventHandler("wheel", h, scope...)
  6452. return e
  6453. }
  6454. // HTMLCode is the interface that describes a "code" HTML element.
  6455. type HTMLCode interface {
  6456. UI
  6457. // Body set the content of the element.
  6458. Body(elems ...UI) HTMLCode
  6459. // Text sets the content of the element with a text node containing the stringified given value.
  6460. Text(v any) HTMLCode
  6461. // AccessKey specifies a shortcut key to activate/focus an element.
  6462. AccessKey(v string) HTMLCode
  6463. // Aria stores accessible rich internet applications (ARIA) data.
  6464. Aria(k string, v any) HTMLCode
  6465. // Attr sets the named attribute with the given value.
  6466. Attr(n string, v any) HTMLCode
  6467. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  6468. Class(v ...string) HTMLCode
  6469. // ContentEditable specifies whether the content of an element is editable or not.
  6470. ContentEditable(v bool) HTMLCode
  6471. // DataSet stores custom data private to the page or application.
  6472. DataSet(k string, v any) HTMLCode
  6473. // Dir specifies the text direction for the content in an element.
  6474. Dir(v string) HTMLCode
  6475. // Draggable specifies whether an element is draggable or not.
  6476. Draggable(v bool) HTMLCode
  6477. // Hidden specifies that an element is not yet, or is no longer relevant.
  6478. Hidden(v bool) HTMLCode
  6479. // ID specifies a unique id for an element.
  6480. ID(v string) HTMLCode
  6481. // Lang specifies the language of the element's content.
  6482. Lang(v string) HTMLCode
  6483. // Role specifies to parsing software the exact function of an element (and its children).
  6484. Role(v string) HTMLCode
  6485. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  6486. Spellcheck(v bool) HTMLCode
  6487. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  6488. Style(k, v string) HTMLCode
  6489. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  6490. Styles(s map[string]string) HTMLCode
  6491. // TabIndex specifies the tabbing order of an element.
  6492. TabIndex(v int) HTMLCode
  6493. // Title specifies extra information about an element.
  6494. Title(v string) HTMLCode
  6495. // On registers the given event handler to the specified event.
  6496. On(event string, h EventHandler, scope ...any) HTMLCode
  6497. // OnBlur calls the given handler when the element loses focus.
  6498. OnBlur(h EventHandler, scope ...any) HTMLCode
  6499. // OnChange calls the given handler when the value of the element is changed.
  6500. OnChange(h EventHandler, scope ...any) HTMLCode
  6501. // OnClick calls the given handler when there is a mouse click on the element.
  6502. OnClick(h EventHandler, scope ...any) HTMLCode
  6503. // OnContextMenu calls the given handler when a context menu is triggered.
  6504. OnContextMenu(h EventHandler, scope ...any) HTMLCode
  6505. // OnCopy calls the given handler when the user copies the content of an element.
  6506. OnCopy(h EventHandler, scope ...any) HTMLCode
  6507. // OnCut calls the given handler when the user cuts the content of an element.
  6508. OnCut(h EventHandler, scope ...any) HTMLCode
  6509. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  6510. OnDblClick(h EventHandler, scope ...any) HTMLCode
  6511. // OnDrag calls the given handler when an element is dragged.
  6512. OnDrag(h EventHandler, scope ...any) HTMLCode
  6513. // OnDragEnd calls the given handler at the end of a drag operation.
  6514. OnDragEnd(h EventHandler, scope ...any) HTMLCode
  6515. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  6516. OnDragEnter(h EventHandler, scope ...any) HTMLCode
  6517. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  6518. OnDragLeave(h EventHandler, scope ...any) HTMLCode
  6519. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  6520. OnDragOver(h EventHandler, scope ...any) HTMLCode
  6521. // OnDragStart calls the given handler at the start of a drag operation.
  6522. OnDragStart(h EventHandler, scope ...any) HTMLCode
  6523. // OnDrop calls the given handler when dragged element is being dropped.
  6524. OnDrop(h EventHandler, scope ...any) HTMLCode
  6525. // OnFocus calls the given handler when the element gets focus.
  6526. OnFocus(h EventHandler, scope ...any) HTMLCode
  6527. // OnInput calls the given handler when an element gets user input.
  6528. OnInput(h EventHandler, scope ...any) HTMLCode
  6529. // OnInvalid calls the given handler when an element is invalid.
  6530. OnInvalid(h EventHandler, scope ...any) HTMLCode
  6531. // OnKeyDown calls the given handler when a user is pressing a key.
  6532. OnKeyDown(h EventHandler, scope ...any) HTMLCode
  6533. // OnKeyPress calls the given handler when a user presses a key.
  6534. OnKeyPress(h EventHandler, scope ...any) HTMLCode
  6535. // OnKeyUp calls the given handler when a user releases a key.
  6536. OnKeyUp(h EventHandler, scope ...any) HTMLCode
  6537. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  6538. OnMouseDown(h EventHandler, scope ...any) HTMLCode
  6539. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  6540. OnMouseMove(h EventHandler, scope ...any) HTMLCode
  6541. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  6542. OnMouseOut(h EventHandler, scope ...any) HTMLCode
  6543. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  6544. OnMouseOver(h EventHandler, scope ...any) HTMLCode
  6545. // OnMouseUp calls the given handler when a mouse button is released over an element.
  6546. OnMouseUp(h EventHandler, scope ...any) HTMLCode
  6547. // OnPaste calls the given handler when the user pastes some content in an element.
  6548. OnPaste(h EventHandler, scope ...any) HTMLCode
  6549. // OnReset calls the given handler when the Reset button in a form is clicked.
  6550. OnReset(h EventHandler, scope ...any) HTMLCode
  6551. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  6552. OnScroll(h EventHandler, scope ...any) HTMLCode
  6553. // OnSearch calls the given handler when the user writes something in a search field.
  6554. OnSearch(h EventHandler, scope ...any) HTMLCode
  6555. // OnSelect calls the given handler after some text has been selected in an element.
  6556. OnSelect(h EventHandler, scope ...any) HTMLCode
  6557. // OnSubmit calls the given handler when a form is submitted.
  6558. OnSubmit(h EventHandler, scope ...any) HTMLCode
  6559. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  6560. OnWheel(h EventHandler, scope ...any) HTMLCode
  6561. }
  6562. // Code returns an HTML element that defines a piece of computer code.
  6563. func Code() HTMLCode {
  6564. e := &htmlCode{
  6565. htmlElement: htmlElement{
  6566. tag: "code",
  6567. isSelfClosing: false,
  6568. },
  6569. }
  6570. return e
  6571. }
  6572. type htmlCode struct {
  6573. htmlElement
  6574. }
  6575. func (e *htmlCode) Body(v ...UI) HTMLCode {
  6576. e.setChildren(v...)
  6577. return e
  6578. }
  6579. func (e *htmlCode) Text(v any) HTMLCode {
  6580. return e.Body(Text(v))
  6581. }
  6582. func (e *htmlCode) AccessKey(v string) HTMLCode {
  6583. e.setAttr("accesskey", v)
  6584. return e
  6585. }
  6586. func (e *htmlCode) Aria(k string, v any) HTMLCode {
  6587. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  6588. return e
  6589. }
  6590. func (e *htmlCode) Attr(n string, v any) HTMLCode {
  6591. e.setAttr(n, v)
  6592. return e
  6593. }
  6594. func (e *htmlCode) Class(v ...string) HTMLCode {
  6595. e.setAttr("class", strings.Join(v, " "))
  6596. return e
  6597. }
  6598. func (e *htmlCode) ContentEditable(v bool) HTMLCode {
  6599. e.setAttr("contenteditable", v)
  6600. return e
  6601. }
  6602. func (e *htmlCode) DataSet(k string, v any) HTMLCode {
  6603. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  6604. return e
  6605. }
  6606. func (e *htmlCode) Dir(v string) HTMLCode {
  6607. e.setAttr("dir", v)
  6608. return e
  6609. }
  6610. func (e *htmlCode) Draggable(v bool) HTMLCode {
  6611. e.setAttr("draggable", v)
  6612. return e
  6613. }
  6614. func (e *htmlCode) Hidden(v bool) HTMLCode {
  6615. e.setAttr("hidden", v)
  6616. return e
  6617. }
  6618. func (e *htmlCode) ID(v string) HTMLCode {
  6619. e.setAttr("id", v)
  6620. return e
  6621. }
  6622. func (e *htmlCode) Lang(v string) HTMLCode {
  6623. e.setAttr("lang", v)
  6624. return e
  6625. }
  6626. func (e *htmlCode) Role(v string) HTMLCode {
  6627. e.setAttr("role", v)
  6628. return e
  6629. }
  6630. func (e *htmlCode) Spellcheck(v bool) HTMLCode {
  6631. s := "false"
  6632. if v {
  6633. s = "true"
  6634. }
  6635. e.setAttr("spellcheck", s)
  6636. return e
  6637. }
  6638. func (e *htmlCode) Style(k, v string) HTMLCode {
  6639. e.setAttr("style", k+":"+v)
  6640. return e
  6641. }
  6642. func (e *htmlCode) Styles(s map[string]string) HTMLCode {
  6643. for k, v := range s {
  6644. e.Style(k, v)
  6645. }
  6646. return e
  6647. }
  6648. func (e *htmlCode) TabIndex(v int) HTMLCode {
  6649. e.setAttr("tabindex", v)
  6650. return e
  6651. }
  6652. func (e *htmlCode) Title(v string) HTMLCode {
  6653. e.setAttr("title", v)
  6654. return e
  6655. }
  6656. func (e *htmlCode) On(event string, h EventHandler, scope ...any) HTMLCode {
  6657. e.setEventHandler(event, h, scope...)
  6658. return e
  6659. }
  6660. func (e *htmlCode) OnBlur(h EventHandler, scope ...any) HTMLCode {
  6661. e.setEventHandler("blur", h, scope...)
  6662. return e
  6663. }
  6664. func (e *htmlCode) OnChange(h EventHandler, scope ...any) HTMLCode {
  6665. e.setEventHandler("change", h, scope...)
  6666. return e
  6667. }
  6668. func (e *htmlCode) OnClick(h EventHandler, scope ...any) HTMLCode {
  6669. e.setEventHandler("click", h, scope...)
  6670. return e
  6671. }
  6672. func (e *htmlCode) OnContextMenu(h EventHandler, scope ...any) HTMLCode {
  6673. e.setEventHandler("contextmenu", h, scope...)
  6674. return e
  6675. }
  6676. func (e *htmlCode) OnCopy(h EventHandler, scope ...any) HTMLCode {
  6677. e.setEventHandler("copy", h, scope...)
  6678. return e
  6679. }
  6680. func (e *htmlCode) OnCut(h EventHandler, scope ...any) HTMLCode {
  6681. e.setEventHandler("cut", h, scope...)
  6682. return e
  6683. }
  6684. func (e *htmlCode) OnDblClick(h EventHandler, scope ...any) HTMLCode {
  6685. e.setEventHandler("dblclick", h, scope...)
  6686. return e
  6687. }
  6688. func (e *htmlCode) OnDrag(h EventHandler, scope ...any) HTMLCode {
  6689. e.setEventHandler("drag", h, scope...)
  6690. return e
  6691. }
  6692. func (e *htmlCode) OnDragEnd(h EventHandler, scope ...any) HTMLCode {
  6693. e.setEventHandler("dragend", h, scope...)
  6694. return e
  6695. }
  6696. func (e *htmlCode) OnDragEnter(h EventHandler, scope ...any) HTMLCode {
  6697. e.setEventHandler("dragenter", h, scope...)
  6698. return e
  6699. }
  6700. func (e *htmlCode) OnDragLeave(h EventHandler, scope ...any) HTMLCode {
  6701. e.setEventHandler("dragleave", h, scope...)
  6702. return e
  6703. }
  6704. func (e *htmlCode) OnDragOver(h EventHandler, scope ...any) HTMLCode {
  6705. e.setEventHandler("dragover", h, scope...)
  6706. return e
  6707. }
  6708. func (e *htmlCode) OnDragStart(h EventHandler, scope ...any) HTMLCode {
  6709. e.setEventHandler("dragstart", h, scope...)
  6710. return e
  6711. }
  6712. func (e *htmlCode) OnDrop(h EventHandler, scope ...any) HTMLCode {
  6713. e.setEventHandler("drop", h, scope...)
  6714. return e
  6715. }
  6716. func (e *htmlCode) OnFocus(h EventHandler, scope ...any) HTMLCode {
  6717. e.setEventHandler("focus", h, scope...)
  6718. return e
  6719. }
  6720. func (e *htmlCode) OnInput(h EventHandler, scope ...any) HTMLCode {
  6721. e.setEventHandler("input", h, scope...)
  6722. return e
  6723. }
  6724. func (e *htmlCode) OnInvalid(h EventHandler, scope ...any) HTMLCode {
  6725. e.setEventHandler("invalid", h, scope...)
  6726. return e
  6727. }
  6728. func (e *htmlCode) OnKeyDown(h EventHandler, scope ...any) HTMLCode {
  6729. e.setEventHandler("keydown", h, scope...)
  6730. return e
  6731. }
  6732. func (e *htmlCode) OnKeyPress(h EventHandler, scope ...any) HTMLCode {
  6733. e.setEventHandler("keypress", h, scope...)
  6734. return e
  6735. }
  6736. func (e *htmlCode) OnKeyUp(h EventHandler, scope ...any) HTMLCode {
  6737. e.setEventHandler("keyup", h, scope...)
  6738. return e
  6739. }
  6740. func (e *htmlCode) OnMouseDown(h EventHandler, scope ...any) HTMLCode {
  6741. e.setEventHandler("mousedown", h, scope...)
  6742. return e
  6743. }
  6744. func (e *htmlCode) OnMouseMove(h EventHandler, scope ...any) HTMLCode {
  6745. e.setEventHandler("mousemove", h, scope...)
  6746. return e
  6747. }
  6748. func (e *htmlCode) OnMouseOut(h EventHandler, scope ...any) HTMLCode {
  6749. e.setEventHandler("mouseout", h, scope...)
  6750. return e
  6751. }
  6752. func (e *htmlCode) OnMouseOver(h EventHandler, scope ...any) HTMLCode {
  6753. e.setEventHandler("mouseover", h, scope...)
  6754. return e
  6755. }
  6756. func (e *htmlCode) OnMouseUp(h EventHandler, scope ...any) HTMLCode {
  6757. e.setEventHandler("mouseup", h, scope...)
  6758. return e
  6759. }
  6760. func (e *htmlCode) OnPaste(h EventHandler, scope ...any) HTMLCode {
  6761. e.setEventHandler("paste", h, scope...)
  6762. return e
  6763. }
  6764. func (e *htmlCode) OnReset(h EventHandler, scope ...any) HTMLCode {
  6765. e.setEventHandler("reset", h, scope...)
  6766. return e
  6767. }
  6768. func (e *htmlCode) OnScroll(h EventHandler, scope ...any) HTMLCode {
  6769. e.setEventHandler("scroll", h, scope...)
  6770. return e
  6771. }
  6772. func (e *htmlCode) OnSearch(h EventHandler, scope ...any) HTMLCode {
  6773. e.setEventHandler("search", h, scope...)
  6774. return e
  6775. }
  6776. func (e *htmlCode) OnSelect(h EventHandler, scope ...any) HTMLCode {
  6777. e.setEventHandler("select", h, scope...)
  6778. return e
  6779. }
  6780. func (e *htmlCode) OnSubmit(h EventHandler, scope ...any) HTMLCode {
  6781. e.setEventHandler("submit", h, scope...)
  6782. return e
  6783. }
  6784. func (e *htmlCode) OnWheel(h EventHandler, scope ...any) HTMLCode {
  6785. e.setEventHandler("wheel", h, scope...)
  6786. return e
  6787. }
  6788. // HTMLCol is the interface that describes a "col" HTML element.
  6789. type HTMLCol interface {
  6790. UI
  6791. // AccessKey specifies a shortcut key to activate/focus an element.
  6792. AccessKey(v string) HTMLCol
  6793. // Aria stores accessible rich internet applications (ARIA) data.
  6794. Aria(k string, v any) HTMLCol
  6795. // Attr sets the named attribute with the given value.
  6796. Attr(n string, v any) HTMLCol
  6797. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  6798. Class(v ...string) HTMLCol
  6799. // ContentEditable specifies whether the content of an element is editable or not.
  6800. ContentEditable(v bool) HTMLCol
  6801. // DataSet stores custom data private to the page or application.
  6802. DataSet(k string, v any) HTMLCol
  6803. // Dir specifies the text direction for the content in an element.
  6804. Dir(v string) HTMLCol
  6805. // Draggable specifies whether an element is draggable or not.
  6806. Draggable(v bool) HTMLCol
  6807. // Hidden specifies that an element is not yet, or is no longer relevant.
  6808. Hidden(v bool) HTMLCol
  6809. // ID specifies a unique id for an element.
  6810. ID(v string) HTMLCol
  6811. // Lang specifies the language of the element's content.
  6812. Lang(v string) HTMLCol
  6813. // Role specifies to parsing software the exact function of an element (and its children).
  6814. Role(v string) HTMLCol
  6815. // Span specifies the number of columns to span.
  6816. Span(v int) HTMLCol
  6817. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  6818. Spellcheck(v bool) HTMLCol
  6819. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  6820. Style(k, v string) HTMLCol
  6821. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  6822. Styles(s map[string]string) HTMLCol
  6823. // TabIndex specifies the tabbing order of an element.
  6824. TabIndex(v int) HTMLCol
  6825. // Title specifies extra information about an element.
  6826. Title(v string) HTMLCol
  6827. // On registers the given event handler to the specified event.
  6828. On(event string, h EventHandler, scope ...any) HTMLCol
  6829. // OnBlur calls the given handler when the element loses focus.
  6830. OnBlur(h EventHandler, scope ...any) HTMLCol
  6831. // OnChange calls the given handler when the value of the element is changed.
  6832. OnChange(h EventHandler, scope ...any) HTMLCol
  6833. // OnClick calls the given handler when there is a mouse click on the element.
  6834. OnClick(h EventHandler, scope ...any) HTMLCol
  6835. // OnContextMenu calls the given handler when a context menu is triggered.
  6836. OnContextMenu(h EventHandler, scope ...any) HTMLCol
  6837. // OnCopy calls the given handler when the user copies the content of an element.
  6838. OnCopy(h EventHandler, scope ...any) HTMLCol
  6839. // OnCut calls the given handler when the user cuts the content of an element.
  6840. OnCut(h EventHandler, scope ...any) HTMLCol
  6841. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  6842. OnDblClick(h EventHandler, scope ...any) HTMLCol
  6843. // OnDrag calls the given handler when an element is dragged.
  6844. OnDrag(h EventHandler, scope ...any) HTMLCol
  6845. // OnDragEnd calls the given handler at the end of a drag operation.
  6846. OnDragEnd(h EventHandler, scope ...any) HTMLCol
  6847. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  6848. OnDragEnter(h EventHandler, scope ...any) HTMLCol
  6849. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  6850. OnDragLeave(h EventHandler, scope ...any) HTMLCol
  6851. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  6852. OnDragOver(h EventHandler, scope ...any) HTMLCol
  6853. // OnDragStart calls the given handler at the start of a drag operation.
  6854. OnDragStart(h EventHandler, scope ...any) HTMLCol
  6855. // OnDrop calls the given handler when dragged element is being dropped.
  6856. OnDrop(h EventHandler, scope ...any) HTMLCol
  6857. // OnFocus calls the given handler when the element gets focus.
  6858. OnFocus(h EventHandler, scope ...any) HTMLCol
  6859. // OnInput calls the given handler when an element gets user input.
  6860. OnInput(h EventHandler, scope ...any) HTMLCol
  6861. // OnInvalid calls the given handler when an element is invalid.
  6862. OnInvalid(h EventHandler, scope ...any) HTMLCol
  6863. // OnKeyDown calls the given handler when a user is pressing a key.
  6864. OnKeyDown(h EventHandler, scope ...any) HTMLCol
  6865. // OnKeyPress calls the given handler when a user presses a key.
  6866. OnKeyPress(h EventHandler, scope ...any) HTMLCol
  6867. // OnKeyUp calls the given handler when a user releases a key.
  6868. OnKeyUp(h EventHandler, scope ...any) HTMLCol
  6869. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  6870. OnMouseDown(h EventHandler, scope ...any) HTMLCol
  6871. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  6872. OnMouseMove(h EventHandler, scope ...any) HTMLCol
  6873. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  6874. OnMouseOut(h EventHandler, scope ...any) HTMLCol
  6875. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  6876. OnMouseOver(h EventHandler, scope ...any) HTMLCol
  6877. // OnMouseUp calls the given handler when a mouse button is released over an element.
  6878. OnMouseUp(h EventHandler, scope ...any) HTMLCol
  6879. // OnPaste calls the given handler when the user pastes some content in an element.
  6880. OnPaste(h EventHandler, scope ...any) HTMLCol
  6881. // OnReset calls the given handler when the Reset button in a form is clicked.
  6882. OnReset(h EventHandler, scope ...any) HTMLCol
  6883. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  6884. OnScroll(h EventHandler, scope ...any) HTMLCol
  6885. // OnSearch calls the given handler when the user writes something in a search field.
  6886. OnSearch(h EventHandler, scope ...any) HTMLCol
  6887. // OnSelect calls the given handler after some text has been selected in an element.
  6888. OnSelect(h EventHandler, scope ...any) HTMLCol
  6889. // OnSubmit calls the given handler when a form is submitted.
  6890. OnSubmit(h EventHandler, scope ...any) HTMLCol
  6891. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  6892. OnWheel(h EventHandler, scope ...any) HTMLCol
  6893. }
  6894. // Col returns an HTML element that specifies column properties for each column within a colgroup element.
  6895. func Col() HTMLCol {
  6896. e := &htmlCol{
  6897. htmlElement: htmlElement{
  6898. tag: "col",
  6899. isSelfClosing: true,
  6900. },
  6901. }
  6902. return e
  6903. }
  6904. type htmlCol struct {
  6905. htmlElement
  6906. }
  6907. func (e *htmlCol) AccessKey(v string) HTMLCol {
  6908. e.setAttr("accesskey", v)
  6909. return e
  6910. }
  6911. func (e *htmlCol) Aria(k string, v any) HTMLCol {
  6912. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  6913. return e
  6914. }
  6915. func (e *htmlCol) Attr(n string, v any) HTMLCol {
  6916. e.setAttr(n, v)
  6917. return e
  6918. }
  6919. func (e *htmlCol) Class(v ...string) HTMLCol {
  6920. e.setAttr("class", strings.Join(v, " "))
  6921. return e
  6922. }
  6923. func (e *htmlCol) ContentEditable(v bool) HTMLCol {
  6924. e.setAttr("contenteditable", v)
  6925. return e
  6926. }
  6927. func (e *htmlCol) DataSet(k string, v any) HTMLCol {
  6928. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  6929. return e
  6930. }
  6931. func (e *htmlCol) Dir(v string) HTMLCol {
  6932. e.setAttr("dir", v)
  6933. return e
  6934. }
  6935. func (e *htmlCol) Draggable(v bool) HTMLCol {
  6936. e.setAttr("draggable", v)
  6937. return e
  6938. }
  6939. func (e *htmlCol) Hidden(v bool) HTMLCol {
  6940. e.setAttr("hidden", v)
  6941. return e
  6942. }
  6943. func (e *htmlCol) ID(v string) HTMLCol {
  6944. e.setAttr("id", v)
  6945. return e
  6946. }
  6947. func (e *htmlCol) Lang(v string) HTMLCol {
  6948. e.setAttr("lang", v)
  6949. return e
  6950. }
  6951. func (e *htmlCol) Role(v string) HTMLCol {
  6952. e.setAttr("role", v)
  6953. return e
  6954. }
  6955. func (e *htmlCol) Span(v int) HTMLCol {
  6956. e.setAttr("span", v)
  6957. return e
  6958. }
  6959. func (e *htmlCol) Spellcheck(v bool) HTMLCol {
  6960. s := "false"
  6961. if v {
  6962. s = "true"
  6963. }
  6964. e.setAttr("spellcheck", s)
  6965. return e
  6966. }
  6967. func (e *htmlCol) Style(k, v string) HTMLCol {
  6968. e.setAttr("style", k+":"+v)
  6969. return e
  6970. }
  6971. func (e *htmlCol) Styles(s map[string]string) HTMLCol {
  6972. for k, v := range s {
  6973. e.Style(k, v)
  6974. }
  6975. return e
  6976. }
  6977. func (e *htmlCol) TabIndex(v int) HTMLCol {
  6978. e.setAttr("tabindex", v)
  6979. return e
  6980. }
  6981. func (e *htmlCol) Title(v string) HTMLCol {
  6982. e.setAttr("title", v)
  6983. return e
  6984. }
  6985. func (e *htmlCol) On(event string, h EventHandler, scope ...any) HTMLCol {
  6986. e.setEventHandler(event, h, scope...)
  6987. return e
  6988. }
  6989. func (e *htmlCol) OnBlur(h EventHandler, scope ...any) HTMLCol {
  6990. e.setEventHandler("blur", h, scope...)
  6991. return e
  6992. }
  6993. func (e *htmlCol) OnChange(h EventHandler, scope ...any) HTMLCol {
  6994. e.setEventHandler("change", h, scope...)
  6995. return e
  6996. }
  6997. func (e *htmlCol) OnClick(h EventHandler, scope ...any) HTMLCol {
  6998. e.setEventHandler("click", h, scope...)
  6999. return e
  7000. }
  7001. func (e *htmlCol) OnContextMenu(h EventHandler, scope ...any) HTMLCol {
  7002. e.setEventHandler("contextmenu", h, scope...)
  7003. return e
  7004. }
  7005. func (e *htmlCol) OnCopy(h EventHandler, scope ...any) HTMLCol {
  7006. e.setEventHandler("copy", h, scope...)
  7007. return e
  7008. }
  7009. func (e *htmlCol) OnCut(h EventHandler, scope ...any) HTMLCol {
  7010. e.setEventHandler("cut", h, scope...)
  7011. return e
  7012. }
  7013. func (e *htmlCol) OnDblClick(h EventHandler, scope ...any) HTMLCol {
  7014. e.setEventHandler("dblclick", h, scope...)
  7015. return e
  7016. }
  7017. func (e *htmlCol) OnDrag(h EventHandler, scope ...any) HTMLCol {
  7018. e.setEventHandler("drag", h, scope...)
  7019. return e
  7020. }
  7021. func (e *htmlCol) OnDragEnd(h EventHandler, scope ...any) HTMLCol {
  7022. e.setEventHandler("dragend", h, scope...)
  7023. return e
  7024. }
  7025. func (e *htmlCol) OnDragEnter(h EventHandler, scope ...any) HTMLCol {
  7026. e.setEventHandler("dragenter", h, scope...)
  7027. return e
  7028. }
  7029. func (e *htmlCol) OnDragLeave(h EventHandler, scope ...any) HTMLCol {
  7030. e.setEventHandler("dragleave", h, scope...)
  7031. return e
  7032. }
  7033. func (e *htmlCol) OnDragOver(h EventHandler, scope ...any) HTMLCol {
  7034. e.setEventHandler("dragover", h, scope...)
  7035. return e
  7036. }
  7037. func (e *htmlCol) OnDragStart(h EventHandler, scope ...any) HTMLCol {
  7038. e.setEventHandler("dragstart", h, scope...)
  7039. return e
  7040. }
  7041. func (e *htmlCol) OnDrop(h EventHandler, scope ...any) HTMLCol {
  7042. e.setEventHandler("drop", h, scope...)
  7043. return e
  7044. }
  7045. func (e *htmlCol) OnFocus(h EventHandler, scope ...any) HTMLCol {
  7046. e.setEventHandler("focus", h, scope...)
  7047. return e
  7048. }
  7049. func (e *htmlCol) OnInput(h EventHandler, scope ...any) HTMLCol {
  7050. e.setEventHandler("input", h, scope...)
  7051. return e
  7052. }
  7053. func (e *htmlCol) OnInvalid(h EventHandler, scope ...any) HTMLCol {
  7054. e.setEventHandler("invalid", h, scope...)
  7055. return e
  7056. }
  7057. func (e *htmlCol) OnKeyDown(h EventHandler, scope ...any) HTMLCol {
  7058. e.setEventHandler("keydown", h, scope...)
  7059. return e
  7060. }
  7061. func (e *htmlCol) OnKeyPress(h EventHandler, scope ...any) HTMLCol {
  7062. e.setEventHandler("keypress", h, scope...)
  7063. return e
  7064. }
  7065. func (e *htmlCol) OnKeyUp(h EventHandler, scope ...any) HTMLCol {
  7066. e.setEventHandler("keyup", h, scope...)
  7067. return e
  7068. }
  7069. func (e *htmlCol) OnMouseDown(h EventHandler, scope ...any) HTMLCol {
  7070. e.setEventHandler("mousedown", h, scope...)
  7071. return e
  7072. }
  7073. func (e *htmlCol) OnMouseMove(h EventHandler, scope ...any) HTMLCol {
  7074. e.setEventHandler("mousemove", h, scope...)
  7075. return e
  7076. }
  7077. func (e *htmlCol) OnMouseOut(h EventHandler, scope ...any) HTMLCol {
  7078. e.setEventHandler("mouseout", h, scope...)
  7079. return e
  7080. }
  7081. func (e *htmlCol) OnMouseOver(h EventHandler, scope ...any) HTMLCol {
  7082. e.setEventHandler("mouseover", h, scope...)
  7083. return e
  7084. }
  7085. func (e *htmlCol) OnMouseUp(h EventHandler, scope ...any) HTMLCol {
  7086. e.setEventHandler("mouseup", h, scope...)
  7087. return e
  7088. }
  7089. func (e *htmlCol) OnPaste(h EventHandler, scope ...any) HTMLCol {
  7090. e.setEventHandler("paste", h, scope...)
  7091. return e
  7092. }
  7093. func (e *htmlCol) OnReset(h EventHandler, scope ...any) HTMLCol {
  7094. e.setEventHandler("reset", h, scope...)
  7095. return e
  7096. }
  7097. func (e *htmlCol) OnScroll(h EventHandler, scope ...any) HTMLCol {
  7098. e.setEventHandler("scroll", h, scope...)
  7099. return e
  7100. }
  7101. func (e *htmlCol) OnSearch(h EventHandler, scope ...any) HTMLCol {
  7102. e.setEventHandler("search", h, scope...)
  7103. return e
  7104. }
  7105. func (e *htmlCol) OnSelect(h EventHandler, scope ...any) HTMLCol {
  7106. e.setEventHandler("select", h, scope...)
  7107. return e
  7108. }
  7109. func (e *htmlCol) OnSubmit(h EventHandler, scope ...any) HTMLCol {
  7110. e.setEventHandler("submit", h, scope...)
  7111. return e
  7112. }
  7113. func (e *htmlCol) OnWheel(h EventHandler, scope ...any) HTMLCol {
  7114. e.setEventHandler("wheel", h, scope...)
  7115. return e
  7116. }
  7117. // HTMLColGroup is the interface that describes a "colgroup" HTML element.
  7118. type HTMLColGroup interface {
  7119. UI
  7120. // Body set the content of the element.
  7121. Body(elems ...UI) HTMLColGroup
  7122. // Text sets the content of the element with a text node containing the stringified given value.
  7123. Text(v any) HTMLColGroup
  7124. // AccessKey specifies a shortcut key to activate/focus an element.
  7125. AccessKey(v string) HTMLColGroup
  7126. // Aria stores accessible rich internet applications (ARIA) data.
  7127. Aria(k string, v any) HTMLColGroup
  7128. // Attr sets the named attribute with the given value.
  7129. Attr(n string, v any) HTMLColGroup
  7130. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  7131. Class(v ...string) HTMLColGroup
  7132. // ContentEditable specifies whether the content of an element is editable or not.
  7133. ContentEditable(v bool) HTMLColGroup
  7134. // DataSet stores custom data private to the page or application.
  7135. DataSet(k string, v any) HTMLColGroup
  7136. // Dir specifies the text direction for the content in an element.
  7137. Dir(v string) HTMLColGroup
  7138. // Draggable specifies whether an element is draggable or not.
  7139. Draggable(v bool) HTMLColGroup
  7140. // Hidden specifies that an element is not yet, or is no longer relevant.
  7141. Hidden(v bool) HTMLColGroup
  7142. // ID specifies a unique id for an element.
  7143. ID(v string) HTMLColGroup
  7144. // Lang specifies the language of the element's content.
  7145. Lang(v string) HTMLColGroup
  7146. // Role specifies to parsing software the exact function of an element (and its children).
  7147. Role(v string) HTMLColGroup
  7148. // Span specifies the number of columns to span.
  7149. Span(v int) HTMLColGroup
  7150. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  7151. Spellcheck(v bool) HTMLColGroup
  7152. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  7153. Style(k, v string) HTMLColGroup
  7154. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  7155. Styles(s map[string]string) HTMLColGroup
  7156. // TabIndex specifies the tabbing order of an element.
  7157. TabIndex(v int) HTMLColGroup
  7158. // Title specifies extra information about an element.
  7159. Title(v string) HTMLColGroup
  7160. // On registers the given event handler to the specified event.
  7161. On(event string, h EventHandler, scope ...any) HTMLColGroup
  7162. // OnBlur calls the given handler when the element loses focus.
  7163. OnBlur(h EventHandler, scope ...any) HTMLColGroup
  7164. // OnChange calls the given handler when the value of the element is changed.
  7165. OnChange(h EventHandler, scope ...any) HTMLColGroup
  7166. // OnClick calls the given handler when there is a mouse click on the element.
  7167. OnClick(h EventHandler, scope ...any) HTMLColGroup
  7168. // OnContextMenu calls the given handler when a context menu is triggered.
  7169. OnContextMenu(h EventHandler, scope ...any) HTMLColGroup
  7170. // OnCopy calls the given handler when the user copies the content of an element.
  7171. OnCopy(h EventHandler, scope ...any) HTMLColGroup
  7172. // OnCut calls the given handler when the user cuts the content of an element.
  7173. OnCut(h EventHandler, scope ...any) HTMLColGroup
  7174. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  7175. OnDblClick(h EventHandler, scope ...any) HTMLColGroup
  7176. // OnDrag calls the given handler when an element is dragged.
  7177. OnDrag(h EventHandler, scope ...any) HTMLColGroup
  7178. // OnDragEnd calls the given handler at the end of a drag operation.
  7179. OnDragEnd(h EventHandler, scope ...any) HTMLColGroup
  7180. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  7181. OnDragEnter(h EventHandler, scope ...any) HTMLColGroup
  7182. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  7183. OnDragLeave(h EventHandler, scope ...any) HTMLColGroup
  7184. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  7185. OnDragOver(h EventHandler, scope ...any) HTMLColGroup
  7186. // OnDragStart calls the given handler at the start of a drag operation.
  7187. OnDragStart(h EventHandler, scope ...any) HTMLColGroup
  7188. // OnDrop calls the given handler when dragged element is being dropped.
  7189. OnDrop(h EventHandler, scope ...any) HTMLColGroup
  7190. // OnFocus calls the given handler when the element gets focus.
  7191. OnFocus(h EventHandler, scope ...any) HTMLColGroup
  7192. // OnInput calls the given handler when an element gets user input.
  7193. OnInput(h EventHandler, scope ...any) HTMLColGroup
  7194. // OnInvalid calls the given handler when an element is invalid.
  7195. OnInvalid(h EventHandler, scope ...any) HTMLColGroup
  7196. // OnKeyDown calls the given handler when a user is pressing a key.
  7197. OnKeyDown(h EventHandler, scope ...any) HTMLColGroup
  7198. // OnKeyPress calls the given handler when a user presses a key.
  7199. OnKeyPress(h EventHandler, scope ...any) HTMLColGroup
  7200. // OnKeyUp calls the given handler when a user releases a key.
  7201. OnKeyUp(h EventHandler, scope ...any) HTMLColGroup
  7202. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  7203. OnMouseDown(h EventHandler, scope ...any) HTMLColGroup
  7204. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  7205. OnMouseMove(h EventHandler, scope ...any) HTMLColGroup
  7206. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  7207. OnMouseOut(h EventHandler, scope ...any) HTMLColGroup
  7208. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  7209. OnMouseOver(h EventHandler, scope ...any) HTMLColGroup
  7210. // OnMouseUp calls the given handler when a mouse button is released over an element.
  7211. OnMouseUp(h EventHandler, scope ...any) HTMLColGroup
  7212. // OnPaste calls the given handler when the user pastes some content in an element.
  7213. OnPaste(h EventHandler, scope ...any) HTMLColGroup
  7214. // OnReset calls the given handler when the Reset button in a form is clicked.
  7215. OnReset(h EventHandler, scope ...any) HTMLColGroup
  7216. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  7217. OnScroll(h EventHandler, scope ...any) HTMLColGroup
  7218. // OnSearch calls the given handler when the user writes something in a search field.
  7219. OnSearch(h EventHandler, scope ...any) HTMLColGroup
  7220. // OnSelect calls the given handler after some text has been selected in an element.
  7221. OnSelect(h EventHandler, scope ...any) HTMLColGroup
  7222. // OnSubmit calls the given handler when a form is submitted.
  7223. OnSubmit(h EventHandler, scope ...any) HTMLColGroup
  7224. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  7225. OnWheel(h EventHandler, scope ...any) HTMLColGroup
  7226. }
  7227. // ColGroup returns an HTML element that specifies a group of one or more columns in a table for formatting.
  7228. func ColGroup() HTMLColGroup {
  7229. e := &htmlColGroup{
  7230. htmlElement: htmlElement{
  7231. tag: "colgroup",
  7232. isSelfClosing: false,
  7233. },
  7234. }
  7235. return e
  7236. }
  7237. type htmlColGroup struct {
  7238. htmlElement
  7239. }
  7240. func (e *htmlColGroup) Body(v ...UI) HTMLColGroup {
  7241. e.setChildren(v...)
  7242. return e
  7243. }
  7244. func (e *htmlColGroup) Text(v any) HTMLColGroup {
  7245. return e.Body(Text(v))
  7246. }
  7247. func (e *htmlColGroup) AccessKey(v string) HTMLColGroup {
  7248. e.setAttr("accesskey", v)
  7249. return e
  7250. }
  7251. func (e *htmlColGroup) Aria(k string, v any) HTMLColGroup {
  7252. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  7253. return e
  7254. }
  7255. func (e *htmlColGroup) Attr(n string, v any) HTMLColGroup {
  7256. e.setAttr(n, v)
  7257. return e
  7258. }
  7259. func (e *htmlColGroup) Class(v ...string) HTMLColGroup {
  7260. e.setAttr("class", strings.Join(v, " "))
  7261. return e
  7262. }
  7263. func (e *htmlColGroup) ContentEditable(v bool) HTMLColGroup {
  7264. e.setAttr("contenteditable", v)
  7265. return e
  7266. }
  7267. func (e *htmlColGroup) DataSet(k string, v any) HTMLColGroup {
  7268. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  7269. return e
  7270. }
  7271. func (e *htmlColGroup) Dir(v string) HTMLColGroup {
  7272. e.setAttr("dir", v)
  7273. return e
  7274. }
  7275. func (e *htmlColGroup) Draggable(v bool) HTMLColGroup {
  7276. e.setAttr("draggable", v)
  7277. return e
  7278. }
  7279. func (e *htmlColGroup) Hidden(v bool) HTMLColGroup {
  7280. e.setAttr("hidden", v)
  7281. return e
  7282. }
  7283. func (e *htmlColGroup) ID(v string) HTMLColGroup {
  7284. e.setAttr("id", v)
  7285. return e
  7286. }
  7287. func (e *htmlColGroup) Lang(v string) HTMLColGroup {
  7288. e.setAttr("lang", v)
  7289. return e
  7290. }
  7291. func (e *htmlColGroup) Role(v string) HTMLColGroup {
  7292. e.setAttr("role", v)
  7293. return e
  7294. }
  7295. func (e *htmlColGroup) Span(v int) HTMLColGroup {
  7296. e.setAttr("span", v)
  7297. return e
  7298. }
  7299. func (e *htmlColGroup) Spellcheck(v bool) HTMLColGroup {
  7300. s := "false"
  7301. if v {
  7302. s = "true"
  7303. }
  7304. e.setAttr("spellcheck", s)
  7305. return e
  7306. }
  7307. func (e *htmlColGroup) Style(k, v string) HTMLColGroup {
  7308. e.setAttr("style", k+":"+v)
  7309. return e
  7310. }
  7311. func (e *htmlColGroup) Styles(s map[string]string) HTMLColGroup {
  7312. for k, v := range s {
  7313. e.Style(k, v)
  7314. }
  7315. return e
  7316. }
  7317. func (e *htmlColGroup) TabIndex(v int) HTMLColGroup {
  7318. e.setAttr("tabindex", v)
  7319. return e
  7320. }
  7321. func (e *htmlColGroup) Title(v string) HTMLColGroup {
  7322. e.setAttr("title", v)
  7323. return e
  7324. }
  7325. func (e *htmlColGroup) On(event string, h EventHandler, scope ...any) HTMLColGroup {
  7326. e.setEventHandler(event, h, scope...)
  7327. return e
  7328. }
  7329. func (e *htmlColGroup) OnBlur(h EventHandler, scope ...any) HTMLColGroup {
  7330. e.setEventHandler("blur", h, scope...)
  7331. return e
  7332. }
  7333. func (e *htmlColGroup) OnChange(h EventHandler, scope ...any) HTMLColGroup {
  7334. e.setEventHandler("change", h, scope...)
  7335. return e
  7336. }
  7337. func (e *htmlColGroup) OnClick(h EventHandler, scope ...any) HTMLColGroup {
  7338. e.setEventHandler("click", h, scope...)
  7339. return e
  7340. }
  7341. func (e *htmlColGroup) OnContextMenu(h EventHandler, scope ...any) HTMLColGroup {
  7342. e.setEventHandler("contextmenu", h, scope...)
  7343. return e
  7344. }
  7345. func (e *htmlColGroup) OnCopy(h EventHandler, scope ...any) HTMLColGroup {
  7346. e.setEventHandler("copy", h, scope...)
  7347. return e
  7348. }
  7349. func (e *htmlColGroup) OnCut(h EventHandler, scope ...any) HTMLColGroup {
  7350. e.setEventHandler("cut", h, scope...)
  7351. return e
  7352. }
  7353. func (e *htmlColGroup) OnDblClick(h EventHandler, scope ...any) HTMLColGroup {
  7354. e.setEventHandler("dblclick", h, scope...)
  7355. return e
  7356. }
  7357. func (e *htmlColGroup) OnDrag(h EventHandler, scope ...any) HTMLColGroup {
  7358. e.setEventHandler("drag", h, scope...)
  7359. return e
  7360. }
  7361. func (e *htmlColGroup) OnDragEnd(h EventHandler, scope ...any) HTMLColGroup {
  7362. e.setEventHandler("dragend", h, scope...)
  7363. return e
  7364. }
  7365. func (e *htmlColGroup) OnDragEnter(h EventHandler, scope ...any) HTMLColGroup {
  7366. e.setEventHandler("dragenter", h, scope...)
  7367. return e
  7368. }
  7369. func (e *htmlColGroup) OnDragLeave(h EventHandler, scope ...any) HTMLColGroup {
  7370. e.setEventHandler("dragleave", h, scope...)
  7371. return e
  7372. }
  7373. func (e *htmlColGroup) OnDragOver(h EventHandler, scope ...any) HTMLColGroup {
  7374. e.setEventHandler("dragover", h, scope...)
  7375. return e
  7376. }
  7377. func (e *htmlColGroup) OnDragStart(h EventHandler, scope ...any) HTMLColGroup {
  7378. e.setEventHandler("dragstart", h, scope...)
  7379. return e
  7380. }
  7381. func (e *htmlColGroup) OnDrop(h EventHandler, scope ...any) HTMLColGroup {
  7382. e.setEventHandler("drop", h, scope...)
  7383. return e
  7384. }
  7385. func (e *htmlColGroup) OnFocus(h EventHandler, scope ...any) HTMLColGroup {
  7386. e.setEventHandler("focus", h, scope...)
  7387. return e
  7388. }
  7389. func (e *htmlColGroup) OnInput(h EventHandler, scope ...any) HTMLColGroup {
  7390. e.setEventHandler("input", h, scope...)
  7391. return e
  7392. }
  7393. func (e *htmlColGroup) OnInvalid(h EventHandler, scope ...any) HTMLColGroup {
  7394. e.setEventHandler("invalid", h, scope...)
  7395. return e
  7396. }
  7397. func (e *htmlColGroup) OnKeyDown(h EventHandler, scope ...any) HTMLColGroup {
  7398. e.setEventHandler("keydown", h, scope...)
  7399. return e
  7400. }
  7401. func (e *htmlColGroup) OnKeyPress(h EventHandler, scope ...any) HTMLColGroup {
  7402. e.setEventHandler("keypress", h, scope...)
  7403. return e
  7404. }
  7405. func (e *htmlColGroup) OnKeyUp(h EventHandler, scope ...any) HTMLColGroup {
  7406. e.setEventHandler("keyup", h, scope...)
  7407. return e
  7408. }
  7409. func (e *htmlColGroup) OnMouseDown(h EventHandler, scope ...any) HTMLColGroup {
  7410. e.setEventHandler("mousedown", h, scope...)
  7411. return e
  7412. }
  7413. func (e *htmlColGroup) OnMouseMove(h EventHandler, scope ...any) HTMLColGroup {
  7414. e.setEventHandler("mousemove", h, scope...)
  7415. return e
  7416. }
  7417. func (e *htmlColGroup) OnMouseOut(h EventHandler, scope ...any) HTMLColGroup {
  7418. e.setEventHandler("mouseout", h, scope...)
  7419. return e
  7420. }
  7421. func (e *htmlColGroup) OnMouseOver(h EventHandler, scope ...any) HTMLColGroup {
  7422. e.setEventHandler("mouseover", h, scope...)
  7423. return e
  7424. }
  7425. func (e *htmlColGroup) OnMouseUp(h EventHandler, scope ...any) HTMLColGroup {
  7426. e.setEventHandler("mouseup", h, scope...)
  7427. return e
  7428. }
  7429. func (e *htmlColGroup) OnPaste(h EventHandler, scope ...any) HTMLColGroup {
  7430. e.setEventHandler("paste", h, scope...)
  7431. return e
  7432. }
  7433. func (e *htmlColGroup) OnReset(h EventHandler, scope ...any) HTMLColGroup {
  7434. e.setEventHandler("reset", h, scope...)
  7435. return e
  7436. }
  7437. func (e *htmlColGroup) OnScroll(h EventHandler, scope ...any) HTMLColGroup {
  7438. e.setEventHandler("scroll", h, scope...)
  7439. return e
  7440. }
  7441. func (e *htmlColGroup) OnSearch(h EventHandler, scope ...any) HTMLColGroup {
  7442. e.setEventHandler("search", h, scope...)
  7443. return e
  7444. }
  7445. func (e *htmlColGroup) OnSelect(h EventHandler, scope ...any) HTMLColGroup {
  7446. e.setEventHandler("select", h, scope...)
  7447. return e
  7448. }
  7449. func (e *htmlColGroup) OnSubmit(h EventHandler, scope ...any) HTMLColGroup {
  7450. e.setEventHandler("submit", h, scope...)
  7451. return e
  7452. }
  7453. func (e *htmlColGroup) OnWheel(h EventHandler, scope ...any) HTMLColGroup {
  7454. e.setEventHandler("wheel", h, scope...)
  7455. return e
  7456. }
  7457. // HTMLData is the interface that describes a "data" HTML element.
  7458. type HTMLData interface {
  7459. UI
  7460. // Body set the content of the element.
  7461. Body(elems ...UI) HTMLData
  7462. // Text sets the content of the element with a text node containing the stringified given value.
  7463. Text(v any) HTMLData
  7464. // AccessKey specifies a shortcut key to activate/focus an element.
  7465. AccessKey(v string) HTMLData
  7466. // Aria stores accessible rich internet applications (ARIA) data.
  7467. Aria(k string, v any) HTMLData
  7468. // Attr sets the named attribute with the given value.
  7469. Attr(n string, v any) HTMLData
  7470. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  7471. Class(v ...string) HTMLData
  7472. // ContentEditable specifies whether the content of an element is editable or not.
  7473. ContentEditable(v bool) HTMLData
  7474. // DataSet stores custom data private to the page or application.
  7475. DataSet(k string, v any) HTMLData
  7476. // Dir specifies the text direction for the content in an element.
  7477. Dir(v string) HTMLData
  7478. // Draggable specifies whether an element is draggable or not.
  7479. Draggable(v bool) HTMLData
  7480. // Hidden specifies that an element is not yet, or is no longer relevant.
  7481. Hidden(v bool) HTMLData
  7482. // ID specifies a unique id for an element.
  7483. ID(v string) HTMLData
  7484. // Lang specifies the language of the element's content.
  7485. Lang(v string) HTMLData
  7486. // Role specifies to parsing software the exact function of an element (and its children).
  7487. Role(v string) HTMLData
  7488. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  7489. Spellcheck(v bool) HTMLData
  7490. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  7491. Style(k, v string) HTMLData
  7492. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  7493. Styles(s map[string]string) HTMLData
  7494. // TabIndex specifies the tabbing order of an element.
  7495. TabIndex(v int) HTMLData
  7496. // Title specifies extra information about an element.
  7497. Title(v string) HTMLData
  7498. // Value specifies the value of the element.
  7499. Value(v any) HTMLData
  7500. // On registers the given event handler to the specified event.
  7501. On(event string, h EventHandler, scope ...any) HTMLData
  7502. }
  7503. // Data returns an HTML element that links the given content with a machine-readable translation.
  7504. func Data() HTMLData {
  7505. e := &htmlData{
  7506. htmlElement: htmlElement{
  7507. tag: "data",
  7508. isSelfClosing: false,
  7509. },
  7510. }
  7511. return e
  7512. }
  7513. type htmlData struct {
  7514. htmlElement
  7515. }
  7516. func (e *htmlData) Body(v ...UI) HTMLData {
  7517. e.setChildren(v...)
  7518. return e
  7519. }
  7520. func (e *htmlData) Text(v any) HTMLData {
  7521. return e.Body(Text(v))
  7522. }
  7523. func (e *htmlData) AccessKey(v string) HTMLData {
  7524. e.setAttr("accesskey", v)
  7525. return e
  7526. }
  7527. func (e *htmlData) Aria(k string, v any) HTMLData {
  7528. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  7529. return e
  7530. }
  7531. func (e *htmlData) Attr(n string, v any) HTMLData {
  7532. e.setAttr(n, v)
  7533. return e
  7534. }
  7535. func (e *htmlData) Class(v ...string) HTMLData {
  7536. e.setAttr("class", strings.Join(v, " "))
  7537. return e
  7538. }
  7539. func (e *htmlData) ContentEditable(v bool) HTMLData {
  7540. e.setAttr("contenteditable", v)
  7541. return e
  7542. }
  7543. func (e *htmlData) DataSet(k string, v any) HTMLData {
  7544. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  7545. return e
  7546. }
  7547. func (e *htmlData) Dir(v string) HTMLData {
  7548. e.setAttr("dir", v)
  7549. return e
  7550. }
  7551. func (e *htmlData) Draggable(v bool) HTMLData {
  7552. e.setAttr("draggable", v)
  7553. return e
  7554. }
  7555. func (e *htmlData) Hidden(v bool) HTMLData {
  7556. e.setAttr("hidden", v)
  7557. return e
  7558. }
  7559. func (e *htmlData) ID(v string) HTMLData {
  7560. e.setAttr("id", v)
  7561. return e
  7562. }
  7563. func (e *htmlData) Lang(v string) HTMLData {
  7564. e.setAttr("lang", v)
  7565. return e
  7566. }
  7567. func (e *htmlData) Role(v string) HTMLData {
  7568. e.setAttr("role", v)
  7569. return e
  7570. }
  7571. func (e *htmlData) Spellcheck(v bool) HTMLData {
  7572. s := "false"
  7573. if v {
  7574. s = "true"
  7575. }
  7576. e.setAttr("spellcheck", s)
  7577. return e
  7578. }
  7579. func (e *htmlData) Style(k, v string) HTMLData {
  7580. e.setAttr("style", k+":"+v)
  7581. return e
  7582. }
  7583. func (e *htmlData) Styles(s map[string]string) HTMLData {
  7584. for k, v := range s {
  7585. e.Style(k, v)
  7586. }
  7587. return e
  7588. }
  7589. func (e *htmlData) TabIndex(v int) HTMLData {
  7590. e.setAttr("tabindex", v)
  7591. return e
  7592. }
  7593. func (e *htmlData) Title(v string) HTMLData {
  7594. e.setAttr("title", v)
  7595. return e
  7596. }
  7597. func (e *htmlData) Value(v any) HTMLData {
  7598. e.setAttr("value", v)
  7599. return e
  7600. }
  7601. func (e *htmlData) On(event string, h EventHandler, scope ...any) HTMLData {
  7602. e.setEventHandler(event, h, scope...)
  7603. return e
  7604. }
  7605. // HTMLDataList is the interface that describes a "datalist" HTML element.
  7606. type HTMLDataList interface {
  7607. UI
  7608. // Body set the content of the element.
  7609. Body(elems ...UI) HTMLDataList
  7610. // Text sets the content of the element with a text node containing the stringified given value.
  7611. Text(v any) HTMLDataList
  7612. // AccessKey specifies a shortcut key to activate/focus an element.
  7613. AccessKey(v string) HTMLDataList
  7614. // Aria stores accessible rich internet applications (ARIA) data.
  7615. Aria(k string, v any) HTMLDataList
  7616. // Attr sets the named attribute with the given value.
  7617. Attr(n string, v any) HTMLDataList
  7618. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  7619. Class(v ...string) HTMLDataList
  7620. // ContentEditable specifies whether the content of an element is editable or not.
  7621. ContentEditable(v bool) HTMLDataList
  7622. // DataSet stores custom data private to the page or application.
  7623. DataSet(k string, v any) HTMLDataList
  7624. // Dir specifies the text direction for the content in an element.
  7625. Dir(v string) HTMLDataList
  7626. // Draggable specifies whether an element is draggable or not.
  7627. Draggable(v bool) HTMLDataList
  7628. // Hidden specifies that an element is not yet, or is no longer relevant.
  7629. Hidden(v bool) HTMLDataList
  7630. // ID specifies a unique id for an element.
  7631. ID(v string) HTMLDataList
  7632. // Lang specifies the language of the element's content.
  7633. Lang(v string) HTMLDataList
  7634. // Role specifies to parsing software the exact function of an element (and its children).
  7635. Role(v string) HTMLDataList
  7636. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  7637. Spellcheck(v bool) HTMLDataList
  7638. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  7639. Style(k, v string) HTMLDataList
  7640. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  7641. Styles(s map[string]string) HTMLDataList
  7642. // TabIndex specifies the tabbing order of an element.
  7643. TabIndex(v int) HTMLDataList
  7644. // Title specifies extra information about an element.
  7645. Title(v string) HTMLDataList
  7646. // On registers the given event handler to the specified event.
  7647. On(event string, h EventHandler, scope ...any) HTMLDataList
  7648. // OnBlur calls the given handler when the element loses focus.
  7649. OnBlur(h EventHandler, scope ...any) HTMLDataList
  7650. // OnChange calls the given handler when the value of the element is changed.
  7651. OnChange(h EventHandler, scope ...any) HTMLDataList
  7652. // OnClick calls the given handler when there is a mouse click on the element.
  7653. OnClick(h EventHandler, scope ...any) HTMLDataList
  7654. // OnContextMenu calls the given handler when a context menu is triggered.
  7655. OnContextMenu(h EventHandler, scope ...any) HTMLDataList
  7656. // OnCopy calls the given handler when the user copies the content of an element.
  7657. OnCopy(h EventHandler, scope ...any) HTMLDataList
  7658. // OnCut calls the given handler when the user cuts the content of an element.
  7659. OnCut(h EventHandler, scope ...any) HTMLDataList
  7660. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  7661. OnDblClick(h EventHandler, scope ...any) HTMLDataList
  7662. // OnDrag calls the given handler when an element is dragged.
  7663. OnDrag(h EventHandler, scope ...any) HTMLDataList
  7664. // OnDragEnd calls the given handler at the end of a drag operation.
  7665. OnDragEnd(h EventHandler, scope ...any) HTMLDataList
  7666. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  7667. OnDragEnter(h EventHandler, scope ...any) HTMLDataList
  7668. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  7669. OnDragLeave(h EventHandler, scope ...any) HTMLDataList
  7670. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  7671. OnDragOver(h EventHandler, scope ...any) HTMLDataList
  7672. // OnDragStart calls the given handler at the start of a drag operation.
  7673. OnDragStart(h EventHandler, scope ...any) HTMLDataList
  7674. // OnDrop calls the given handler when dragged element is being dropped.
  7675. OnDrop(h EventHandler, scope ...any) HTMLDataList
  7676. // OnFocus calls the given handler when the element gets focus.
  7677. OnFocus(h EventHandler, scope ...any) HTMLDataList
  7678. // OnInput calls the given handler when an element gets user input.
  7679. OnInput(h EventHandler, scope ...any) HTMLDataList
  7680. // OnInvalid calls the given handler when an element is invalid.
  7681. OnInvalid(h EventHandler, scope ...any) HTMLDataList
  7682. // OnKeyDown calls the given handler when a user is pressing a key.
  7683. OnKeyDown(h EventHandler, scope ...any) HTMLDataList
  7684. // OnKeyPress calls the given handler when a user presses a key.
  7685. OnKeyPress(h EventHandler, scope ...any) HTMLDataList
  7686. // OnKeyUp calls the given handler when a user releases a key.
  7687. OnKeyUp(h EventHandler, scope ...any) HTMLDataList
  7688. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  7689. OnMouseDown(h EventHandler, scope ...any) HTMLDataList
  7690. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  7691. OnMouseMove(h EventHandler, scope ...any) HTMLDataList
  7692. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  7693. OnMouseOut(h EventHandler, scope ...any) HTMLDataList
  7694. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  7695. OnMouseOver(h EventHandler, scope ...any) HTMLDataList
  7696. // OnMouseUp calls the given handler when a mouse button is released over an element.
  7697. OnMouseUp(h EventHandler, scope ...any) HTMLDataList
  7698. // OnPaste calls the given handler when the user pastes some content in an element.
  7699. OnPaste(h EventHandler, scope ...any) HTMLDataList
  7700. // OnReset calls the given handler when the Reset button in a form is clicked.
  7701. OnReset(h EventHandler, scope ...any) HTMLDataList
  7702. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  7703. OnScroll(h EventHandler, scope ...any) HTMLDataList
  7704. // OnSearch calls the given handler when the user writes something in a search field.
  7705. OnSearch(h EventHandler, scope ...any) HTMLDataList
  7706. // OnSelect calls the given handler after some text has been selected in an element.
  7707. OnSelect(h EventHandler, scope ...any) HTMLDataList
  7708. // OnSubmit calls the given handler when a form is submitted.
  7709. OnSubmit(h EventHandler, scope ...any) HTMLDataList
  7710. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  7711. OnWheel(h EventHandler, scope ...any) HTMLDataList
  7712. }
  7713. // DataList returns an HTML element that specifies a list of pre-defined options for input controls.
  7714. func DataList() HTMLDataList {
  7715. e := &htmlDataList{
  7716. htmlElement: htmlElement{
  7717. tag: "datalist",
  7718. isSelfClosing: false,
  7719. },
  7720. }
  7721. return e
  7722. }
  7723. type htmlDataList struct {
  7724. htmlElement
  7725. }
  7726. func (e *htmlDataList) Body(v ...UI) HTMLDataList {
  7727. e.setChildren(v...)
  7728. return e
  7729. }
  7730. func (e *htmlDataList) Text(v any) HTMLDataList {
  7731. return e.Body(Text(v))
  7732. }
  7733. func (e *htmlDataList) AccessKey(v string) HTMLDataList {
  7734. e.setAttr("accesskey", v)
  7735. return e
  7736. }
  7737. func (e *htmlDataList) Aria(k string, v any) HTMLDataList {
  7738. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  7739. return e
  7740. }
  7741. func (e *htmlDataList) Attr(n string, v any) HTMLDataList {
  7742. e.setAttr(n, v)
  7743. return e
  7744. }
  7745. func (e *htmlDataList) Class(v ...string) HTMLDataList {
  7746. e.setAttr("class", strings.Join(v, " "))
  7747. return e
  7748. }
  7749. func (e *htmlDataList) ContentEditable(v bool) HTMLDataList {
  7750. e.setAttr("contenteditable", v)
  7751. return e
  7752. }
  7753. func (e *htmlDataList) DataSet(k string, v any) HTMLDataList {
  7754. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  7755. return e
  7756. }
  7757. func (e *htmlDataList) Dir(v string) HTMLDataList {
  7758. e.setAttr("dir", v)
  7759. return e
  7760. }
  7761. func (e *htmlDataList) Draggable(v bool) HTMLDataList {
  7762. e.setAttr("draggable", v)
  7763. return e
  7764. }
  7765. func (e *htmlDataList) Hidden(v bool) HTMLDataList {
  7766. e.setAttr("hidden", v)
  7767. return e
  7768. }
  7769. func (e *htmlDataList) ID(v string) HTMLDataList {
  7770. e.setAttr("id", v)
  7771. return e
  7772. }
  7773. func (e *htmlDataList) Lang(v string) HTMLDataList {
  7774. e.setAttr("lang", v)
  7775. return e
  7776. }
  7777. func (e *htmlDataList) Role(v string) HTMLDataList {
  7778. e.setAttr("role", v)
  7779. return e
  7780. }
  7781. func (e *htmlDataList) Spellcheck(v bool) HTMLDataList {
  7782. s := "false"
  7783. if v {
  7784. s = "true"
  7785. }
  7786. e.setAttr("spellcheck", s)
  7787. return e
  7788. }
  7789. func (e *htmlDataList) Style(k, v string) HTMLDataList {
  7790. e.setAttr("style", k+":"+v)
  7791. return e
  7792. }
  7793. func (e *htmlDataList) Styles(s map[string]string) HTMLDataList {
  7794. for k, v := range s {
  7795. e.Style(k, v)
  7796. }
  7797. return e
  7798. }
  7799. func (e *htmlDataList) TabIndex(v int) HTMLDataList {
  7800. e.setAttr("tabindex", v)
  7801. return e
  7802. }
  7803. func (e *htmlDataList) Title(v string) HTMLDataList {
  7804. e.setAttr("title", v)
  7805. return e
  7806. }
  7807. func (e *htmlDataList) On(event string, h EventHandler, scope ...any) HTMLDataList {
  7808. e.setEventHandler(event, h, scope...)
  7809. return e
  7810. }
  7811. func (e *htmlDataList) OnBlur(h EventHandler, scope ...any) HTMLDataList {
  7812. e.setEventHandler("blur", h, scope...)
  7813. return e
  7814. }
  7815. func (e *htmlDataList) OnChange(h EventHandler, scope ...any) HTMLDataList {
  7816. e.setEventHandler("change", h, scope...)
  7817. return e
  7818. }
  7819. func (e *htmlDataList) OnClick(h EventHandler, scope ...any) HTMLDataList {
  7820. e.setEventHandler("click", h, scope...)
  7821. return e
  7822. }
  7823. func (e *htmlDataList) OnContextMenu(h EventHandler, scope ...any) HTMLDataList {
  7824. e.setEventHandler("contextmenu", h, scope...)
  7825. return e
  7826. }
  7827. func (e *htmlDataList) OnCopy(h EventHandler, scope ...any) HTMLDataList {
  7828. e.setEventHandler("copy", h, scope...)
  7829. return e
  7830. }
  7831. func (e *htmlDataList) OnCut(h EventHandler, scope ...any) HTMLDataList {
  7832. e.setEventHandler("cut", h, scope...)
  7833. return e
  7834. }
  7835. func (e *htmlDataList) OnDblClick(h EventHandler, scope ...any) HTMLDataList {
  7836. e.setEventHandler("dblclick", h, scope...)
  7837. return e
  7838. }
  7839. func (e *htmlDataList) OnDrag(h EventHandler, scope ...any) HTMLDataList {
  7840. e.setEventHandler("drag", h, scope...)
  7841. return e
  7842. }
  7843. func (e *htmlDataList) OnDragEnd(h EventHandler, scope ...any) HTMLDataList {
  7844. e.setEventHandler("dragend", h, scope...)
  7845. return e
  7846. }
  7847. func (e *htmlDataList) OnDragEnter(h EventHandler, scope ...any) HTMLDataList {
  7848. e.setEventHandler("dragenter", h, scope...)
  7849. return e
  7850. }
  7851. func (e *htmlDataList) OnDragLeave(h EventHandler, scope ...any) HTMLDataList {
  7852. e.setEventHandler("dragleave", h, scope...)
  7853. return e
  7854. }
  7855. func (e *htmlDataList) OnDragOver(h EventHandler, scope ...any) HTMLDataList {
  7856. e.setEventHandler("dragover", h, scope...)
  7857. return e
  7858. }
  7859. func (e *htmlDataList) OnDragStart(h EventHandler, scope ...any) HTMLDataList {
  7860. e.setEventHandler("dragstart", h, scope...)
  7861. return e
  7862. }
  7863. func (e *htmlDataList) OnDrop(h EventHandler, scope ...any) HTMLDataList {
  7864. e.setEventHandler("drop", h, scope...)
  7865. return e
  7866. }
  7867. func (e *htmlDataList) OnFocus(h EventHandler, scope ...any) HTMLDataList {
  7868. e.setEventHandler("focus", h, scope...)
  7869. return e
  7870. }
  7871. func (e *htmlDataList) OnInput(h EventHandler, scope ...any) HTMLDataList {
  7872. e.setEventHandler("input", h, scope...)
  7873. return e
  7874. }
  7875. func (e *htmlDataList) OnInvalid(h EventHandler, scope ...any) HTMLDataList {
  7876. e.setEventHandler("invalid", h, scope...)
  7877. return e
  7878. }
  7879. func (e *htmlDataList) OnKeyDown(h EventHandler, scope ...any) HTMLDataList {
  7880. e.setEventHandler("keydown", h, scope...)
  7881. return e
  7882. }
  7883. func (e *htmlDataList) OnKeyPress(h EventHandler, scope ...any) HTMLDataList {
  7884. e.setEventHandler("keypress", h, scope...)
  7885. return e
  7886. }
  7887. func (e *htmlDataList) OnKeyUp(h EventHandler, scope ...any) HTMLDataList {
  7888. e.setEventHandler("keyup", h, scope...)
  7889. return e
  7890. }
  7891. func (e *htmlDataList) OnMouseDown(h EventHandler, scope ...any) HTMLDataList {
  7892. e.setEventHandler("mousedown", h, scope...)
  7893. return e
  7894. }
  7895. func (e *htmlDataList) OnMouseMove(h EventHandler, scope ...any) HTMLDataList {
  7896. e.setEventHandler("mousemove", h, scope...)
  7897. return e
  7898. }
  7899. func (e *htmlDataList) OnMouseOut(h EventHandler, scope ...any) HTMLDataList {
  7900. e.setEventHandler("mouseout", h, scope...)
  7901. return e
  7902. }
  7903. func (e *htmlDataList) OnMouseOver(h EventHandler, scope ...any) HTMLDataList {
  7904. e.setEventHandler("mouseover", h, scope...)
  7905. return e
  7906. }
  7907. func (e *htmlDataList) OnMouseUp(h EventHandler, scope ...any) HTMLDataList {
  7908. e.setEventHandler("mouseup", h, scope...)
  7909. return e
  7910. }
  7911. func (e *htmlDataList) OnPaste(h EventHandler, scope ...any) HTMLDataList {
  7912. e.setEventHandler("paste", h, scope...)
  7913. return e
  7914. }
  7915. func (e *htmlDataList) OnReset(h EventHandler, scope ...any) HTMLDataList {
  7916. e.setEventHandler("reset", h, scope...)
  7917. return e
  7918. }
  7919. func (e *htmlDataList) OnScroll(h EventHandler, scope ...any) HTMLDataList {
  7920. e.setEventHandler("scroll", h, scope...)
  7921. return e
  7922. }
  7923. func (e *htmlDataList) OnSearch(h EventHandler, scope ...any) HTMLDataList {
  7924. e.setEventHandler("search", h, scope...)
  7925. return e
  7926. }
  7927. func (e *htmlDataList) OnSelect(h EventHandler, scope ...any) HTMLDataList {
  7928. e.setEventHandler("select", h, scope...)
  7929. return e
  7930. }
  7931. func (e *htmlDataList) OnSubmit(h EventHandler, scope ...any) HTMLDataList {
  7932. e.setEventHandler("submit", h, scope...)
  7933. return e
  7934. }
  7935. func (e *htmlDataList) OnWheel(h EventHandler, scope ...any) HTMLDataList {
  7936. e.setEventHandler("wheel", h, scope...)
  7937. return e
  7938. }
  7939. // HTMLDd is the interface that describes a "dd" HTML element.
  7940. type HTMLDd interface {
  7941. UI
  7942. // Body set the content of the element.
  7943. Body(elems ...UI) HTMLDd
  7944. // Text sets the content of the element with a text node containing the stringified given value.
  7945. Text(v any) HTMLDd
  7946. // AccessKey specifies a shortcut key to activate/focus an element.
  7947. AccessKey(v string) HTMLDd
  7948. // Aria stores accessible rich internet applications (ARIA) data.
  7949. Aria(k string, v any) HTMLDd
  7950. // Attr sets the named attribute with the given value.
  7951. Attr(n string, v any) HTMLDd
  7952. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  7953. Class(v ...string) HTMLDd
  7954. // ContentEditable specifies whether the content of an element is editable or not.
  7955. ContentEditable(v bool) HTMLDd
  7956. // DataSet stores custom data private to the page or application.
  7957. DataSet(k string, v any) HTMLDd
  7958. // Dir specifies the text direction for the content in an element.
  7959. Dir(v string) HTMLDd
  7960. // Draggable specifies whether an element is draggable or not.
  7961. Draggable(v bool) HTMLDd
  7962. // Hidden specifies that an element is not yet, or is no longer relevant.
  7963. Hidden(v bool) HTMLDd
  7964. // ID specifies a unique id for an element.
  7965. ID(v string) HTMLDd
  7966. // Lang specifies the language of the element's content.
  7967. Lang(v string) HTMLDd
  7968. // Role specifies to parsing software the exact function of an element (and its children).
  7969. Role(v string) HTMLDd
  7970. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  7971. Spellcheck(v bool) HTMLDd
  7972. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  7973. Style(k, v string) HTMLDd
  7974. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  7975. Styles(s map[string]string) HTMLDd
  7976. // TabIndex specifies the tabbing order of an element.
  7977. TabIndex(v int) HTMLDd
  7978. // Title specifies extra information about an element.
  7979. Title(v string) HTMLDd
  7980. // On registers the given event handler to the specified event.
  7981. On(event string, h EventHandler, scope ...any) HTMLDd
  7982. // OnBlur calls the given handler when the element loses focus.
  7983. OnBlur(h EventHandler, scope ...any) HTMLDd
  7984. // OnChange calls the given handler when the value of the element is changed.
  7985. OnChange(h EventHandler, scope ...any) HTMLDd
  7986. // OnClick calls the given handler when there is a mouse click on the element.
  7987. OnClick(h EventHandler, scope ...any) HTMLDd
  7988. // OnContextMenu calls the given handler when a context menu is triggered.
  7989. OnContextMenu(h EventHandler, scope ...any) HTMLDd
  7990. // OnCopy calls the given handler when the user copies the content of an element.
  7991. OnCopy(h EventHandler, scope ...any) HTMLDd
  7992. // OnCut calls the given handler when the user cuts the content of an element.
  7993. OnCut(h EventHandler, scope ...any) HTMLDd
  7994. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  7995. OnDblClick(h EventHandler, scope ...any) HTMLDd
  7996. // OnDrag calls the given handler when an element is dragged.
  7997. OnDrag(h EventHandler, scope ...any) HTMLDd
  7998. // OnDragEnd calls the given handler at the end of a drag operation.
  7999. OnDragEnd(h EventHandler, scope ...any) HTMLDd
  8000. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  8001. OnDragEnter(h EventHandler, scope ...any) HTMLDd
  8002. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  8003. OnDragLeave(h EventHandler, scope ...any) HTMLDd
  8004. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  8005. OnDragOver(h EventHandler, scope ...any) HTMLDd
  8006. // OnDragStart calls the given handler at the start of a drag operation.
  8007. OnDragStart(h EventHandler, scope ...any) HTMLDd
  8008. // OnDrop calls the given handler when dragged element is being dropped.
  8009. OnDrop(h EventHandler, scope ...any) HTMLDd
  8010. // OnFocus calls the given handler when the element gets focus.
  8011. OnFocus(h EventHandler, scope ...any) HTMLDd
  8012. // OnInput calls the given handler when an element gets user input.
  8013. OnInput(h EventHandler, scope ...any) HTMLDd
  8014. // OnInvalid calls the given handler when an element is invalid.
  8015. OnInvalid(h EventHandler, scope ...any) HTMLDd
  8016. // OnKeyDown calls the given handler when a user is pressing a key.
  8017. OnKeyDown(h EventHandler, scope ...any) HTMLDd
  8018. // OnKeyPress calls the given handler when a user presses a key.
  8019. OnKeyPress(h EventHandler, scope ...any) HTMLDd
  8020. // OnKeyUp calls the given handler when a user releases a key.
  8021. OnKeyUp(h EventHandler, scope ...any) HTMLDd
  8022. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  8023. OnMouseDown(h EventHandler, scope ...any) HTMLDd
  8024. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  8025. OnMouseMove(h EventHandler, scope ...any) HTMLDd
  8026. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  8027. OnMouseOut(h EventHandler, scope ...any) HTMLDd
  8028. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  8029. OnMouseOver(h EventHandler, scope ...any) HTMLDd
  8030. // OnMouseUp calls the given handler when a mouse button is released over an element.
  8031. OnMouseUp(h EventHandler, scope ...any) HTMLDd
  8032. // OnPaste calls the given handler when the user pastes some content in an element.
  8033. OnPaste(h EventHandler, scope ...any) HTMLDd
  8034. // OnReset calls the given handler when the Reset button in a form is clicked.
  8035. OnReset(h EventHandler, scope ...any) HTMLDd
  8036. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  8037. OnScroll(h EventHandler, scope ...any) HTMLDd
  8038. // OnSearch calls the given handler when the user writes something in a search field.
  8039. OnSearch(h EventHandler, scope ...any) HTMLDd
  8040. // OnSelect calls the given handler after some text has been selected in an element.
  8041. OnSelect(h EventHandler, scope ...any) HTMLDd
  8042. // OnSubmit calls the given handler when a form is submitted.
  8043. OnSubmit(h EventHandler, scope ...any) HTMLDd
  8044. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  8045. OnWheel(h EventHandler, scope ...any) HTMLDd
  8046. }
  8047. // Dd returns an HTML element that defines a description/value of a term in a description list.
  8048. func Dd() HTMLDd {
  8049. e := &htmlDd{
  8050. htmlElement: htmlElement{
  8051. tag: "dd",
  8052. isSelfClosing: false,
  8053. },
  8054. }
  8055. return e
  8056. }
  8057. type htmlDd struct {
  8058. htmlElement
  8059. }
  8060. func (e *htmlDd) Body(v ...UI) HTMLDd {
  8061. e.setChildren(v...)
  8062. return e
  8063. }
  8064. func (e *htmlDd) Text(v any) HTMLDd {
  8065. return e.Body(Text(v))
  8066. }
  8067. func (e *htmlDd) AccessKey(v string) HTMLDd {
  8068. e.setAttr("accesskey", v)
  8069. return e
  8070. }
  8071. func (e *htmlDd) Aria(k string, v any) HTMLDd {
  8072. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  8073. return e
  8074. }
  8075. func (e *htmlDd) Attr(n string, v any) HTMLDd {
  8076. e.setAttr(n, v)
  8077. return e
  8078. }
  8079. func (e *htmlDd) Class(v ...string) HTMLDd {
  8080. e.setAttr("class", strings.Join(v, " "))
  8081. return e
  8082. }
  8083. func (e *htmlDd) ContentEditable(v bool) HTMLDd {
  8084. e.setAttr("contenteditable", v)
  8085. return e
  8086. }
  8087. func (e *htmlDd) DataSet(k string, v any) HTMLDd {
  8088. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  8089. return e
  8090. }
  8091. func (e *htmlDd) Dir(v string) HTMLDd {
  8092. e.setAttr("dir", v)
  8093. return e
  8094. }
  8095. func (e *htmlDd) Draggable(v bool) HTMLDd {
  8096. e.setAttr("draggable", v)
  8097. return e
  8098. }
  8099. func (e *htmlDd) Hidden(v bool) HTMLDd {
  8100. e.setAttr("hidden", v)
  8101. return e
  8102. }
  8103. func (e *htmlDd) ID(v string) HTMLDd {
  8104. e.setAttr("id", v)
  8105. return e
  8106. }
  8107. func (e *htmlDd) Lang(v string) HTMLDd {
  8108. e.setAttr("lang", v)
  8109. return e
  8110. }
  8111. func (e *htmlDd) Role(v string) HTMLDd {
  8112. e.setAttr("role", v)
  8113. return e
  8114. }
  8115. func (e *htmlDd) Spellcheck(v bool) HTMLDd {
  8116. s := "false"
  8117. if v {
  8118. s = "true"
  8119. }
  8120. e.setAttr("spellcheck", s)
  8121. return e
  8122. }
  8123. func (e *htmlDd) Style(k, v string) HTMLDd {
  8124. e.setAttr("style", k+":"+v)
  8125. return e
  8126. }
  8127. func (e *htmlDd) Styles(s map[string]string) HTMLDd {
  8128. for k, v := range s {
  8129. e.Style(k, v)
  8130. }
  8131. return e
  8132. }
  8133. func (e *htmlDd) TabIndex(v int) HTMLDd {
  8134. e.setAttr("tabindex", v)
  8135. return e
  8136. }
  8137. func (e *htmlDd) Title(v string) HTMLDd {
  8138. e.setAttr("title", v)
  8139. return e
  8140. }
  8141. func (e *htmlDd) On(event string, h EventHandler, scope ...any) HTMLDd {
  8142. e.setEventHandler(event, h, scope...)
  8143. return e
  8144. }
  8145. func (e *htmlDd) OnBlur(h EventHandler, scope ...any) HTMLDd {
  8146. e.setEventHandler("blur", h, scope...)
  8147. return e
  8148. }
  8149. func (e *htmlDd) OnChange(h EventHandler, scope ...any) HTMLDd {
  8150. e.setEventHandler("change", h, scope...)
  8151. return e
  8152. }
  8153. func (e *htmlDd) OnClick(h EventHandler, scope ...any) HTMLDd {
  8154. e.setEventHandler("click", h, scope...)
  8155. return e
  8156. }
  8157. func (e *htmlDd) OnContextMenu(h EventHandler, scope ...any) HTMLDd {
  8158. e.setEventHandler("contextmenu", h, scope...)
  8159. return e
  8160. }
  8161. func (e *htmlDd) OnCopy(h EventHandler, scope ...any) HTMLDd {
  8162. e.setEventHandler("copy", h, scope...)
  8163. return e
  8164. }
  8165. func (e *htmlDd) OnCut(h EventHandler, scope ...any) HTMLDd {
  8166. e.setEventHandler("cut", h, scope...)
  8167. return e
  8168. }
  8169. func (e *htmlDd) OnDblClick(h EventHandler, scope ...any) HTMLDd {
  8170. e.setEventHandler("dblclick", h, scope...)
  8171. return e
  8172. }
  8173. func (e *htmlDd) OnDrag(h EventHandler, scope ...any) HTMLDd {
  8174. e.setEventHandler("drag", h, scope...)
  8175. return e
  8176. }
  8177. func (e *htmlDd) OnDragEnd(h EventHandler, scope ...any) HTMLDd {
  8178. e.setEventHandler("dragend", h, scope...)
  8179. return e
  8180. }
  8181. func (e *htmlDd) OnDragEnter(h EventHandler, scope ...any) HTMLDd {
  8182. e.setEventHandler("dragenter", h, scope...)
  8183. return e
  8184. }
  8185. func (e *htmlDd) OnDragLeave(h EventHandler, scope ...any) HTMLDd {
  8186. e.setEventHandler("dragleave", h, scope...)
  8187. return e
  8188. }
  8189. func (e *htmlDd) OnDragOver(h EventHandler, scope ...any) HTMLDd {
  8190. e.setEventHandler("dragover", h, scope...)
  8191. return e
  8192. }
  8193. func (e *htmlDd) OnDragStart(h EventHandler, scope ...any) HTMLDd {
  8194. e.setEventHandler("dragstart", h, scope...)
  8195. return e
  8196. }
  8197. func (e *htmlDd) OnDrop(h EventHandler, scope ...any) HTMLDd {
  8198. e.setEventHandler("drop", h, scope...)
  8199. return e
  8200. }
  8201. func (e *htmlDd) OnFocus(h EventHandler, scope ...any) HTMLDd {
  8202. e.setEventHandler("focus", h, scope...)
  8203. return e
  8204. }
  8205. func (e *htmlDd) OnInput(h EventHandler, scope ...any) HTMLDd {
  8206. e.setEventHandler("input", h, scope...)
  8207. return e
  8208. }
  8209. func (e *htmlDd) OnInvalid(h EventHandler, scope ...any) HTMLDd {
  8210. e.setEventHandler("invalid", h, scope...)
  8211. return e
  8212. }
  8213. func (e *htmlDd) OnKeyDown(h EventHandler, scope ...any) HTMLDd {
  8214. e.setEventHandler("keydown", h, scope...)
  8215. return e
  8216. }
  8217. func (e *htmlDd) OnKeyPress(h EventHandler, scope ...any) HTMLDd {
  8218. e.setEventHandler("keypress", h, scope...)
  8219. return e
  8220. }
  8221. func (e *htmlDd) OnKeyUp(h EventHandler, scope ...any) HTMLDd {
  8222. e.setEventHandler("keyup", h, scope...)
  8223. return e
  8224. }
  8225. func (e *htmlDd) OnMouseDown(h EventHandler, scope ...any) HTMLDd {
  8226. e.setEventHandler("mousedown", h, scope...)
  8227. return e
  8228. }
  8229. func (e *htmlDd) OnMouseMove(h EventHandler, scope ...any) HTMLDd {
  8230. e.setEventHandler("mousemove", h, scope...)
  8231. return e
  8232. }
  8233. func (e *htmlDd) OnMouseOut(h EventHandler, scope ...any) HTMLDd {
  8234. e.setEventHandler("mouseout", h, scope...)
  8235. return e
  8236. }
  8237. func (e *htmlDd) OnMouseOver(h EventHandler, scope ...any) HTMLDd {
  8238. e.setEventHandler("mouseover", h, scope...)
  8239. return e
  8240. }
  8241. func (e *htmlDd) OnMouseUp(h EventHandler, scope ...any) HTMLDd {
  8242. e.setEventHandler("mouseup", h, scope...)
  8243. return e
  8244. }
  8245. func (e *htmlDd) OnPaste(h EventHandler, scope ...any) HTMLDd {
  8246. e.setEventHandler("paste", h, scope...)
  8247. return e
  8248. }
  8249. func (e *htmlDd) OnReset(h EventHandler, scope ...any) HTMLDd {
  8250. e.setEventHandler("reset", h, scope...)
  8251. return e
  8252. }
  8253. func (e *htmlDd) OnScroll(h EventHandler, scope ...any) HTMLDd {
  8254. e.setEventHandler("scroll", h, scope...)
  8255. return e
  8256. }
  8257. func (e *htmlDd) OnSearch(h EventHandler, scope ...any) HTMLDd {
  8258. e.setEventHandler("search", h, scope...)
  8259. return e
  8260. }
  8261. func (e *htmlDd) OnSelect(h EventHandler, scope ...any) HTMLDd {
  8262. e.setEventHandler("select", h, scope...)
  8263. return e
  8264. }
  8265. func (e *htmlDd) OnSubmit(h EventHandler, scope ...any) HTMLDd {
  8266. e.setEventHandler("submit", h, scope...)
  8267. return e
  8268. }
  8269. func (e *htmlDd) OnWheel(h EventHandler, scope ...any) HTMLDd {
  8270. e.setEventHandler("wheel", h, scope...)
  8271. return e
  8272. }
  8273. // HTMLDel is the interface that describes a "del" HTML element.
  8274. type HTMLDel interface {
  8275. UI
  8276. // Body set the content of the element.
  8277. Body(elems ...UI) HTMLDel
  8278. // Text sets the content of the element with a text node containing the stringified given value.
  8279. Text(v any) HTMLDel
  8280. // AccessKey specifies a shortcut key to activate/focus an element.
  8281. AccessKey(v string) HTMLDel
  8282. // Aria stores accessible rich internet applications (ARIA) data.
  8283. Aria(k string, v any) HTMLDel
  8284. // Attr sets the named attribute with the given value.
  8285. Attr(n string, v any) HTMLDel
  8286. // Cite specifies a URL which explains the quote/deleted/inserted text.
  8287. Cite(v string) HTMLDel
  8288. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  8289. Class(v ...string) HTMLDel
  8290. // ContentEditable specifies whether the content of an element is editable or not.
  8291. ContentEditable(v bool) HTMLDel
  8292. // DataSet stores custom data private to the page or application.
  8293. DataSet(k string, v any) HTMLDel
  8294. // DateTime specifies the date and time.
  8295. DateTime(v string) HTMLDel
  8296. // Dir specifies the text direction for the content in an element.
  8297. Dir(v string) HTMLDel
  8298. // Draggable specifies whether an element is draggable or not.
  8299. Draggable(v bool) HTMLDel
  8300. // Hidden specifies that an element is not yet, or is no longer relevant.
  8301. Hidden(v bool) HTMLDel
  8302. // ID specifies a unique id for an element.
  8303. ID(v string) HTMLDel
  8304. // Lang specifies the language of the element's content.
  8305. Lang(v string) HTMLDel
  8306. // Role specifies to parsing software the exact function of an element (and its children).
  8307. Role(v string) HTMLDel
  8308. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  8309. Spellcheck(v bool) HTMLDel
  8310. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  8311. Style(k, v string) HTMLDel
  8312. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  8313. Styles(s map[string]string) HTMLDel
  8314. // TabIndex specifies the tabbing order of an element.
  8315. TabIndex(v int) HTMLDel
  8316. // Title specifies extra information about an element.
  8317. Title(v string) HTMLDel
  8318. // On registers the given event handler to the specified event.
  8319. On(event string, h EventHandler, scope ...any) HTMLDel
  8320. // OnBlur calls the given handler when the element loses focus.
  8321. OnBlur(h EventHandler, scope ...any) HTMLDel
  8322. // OnChange calls the given handler when the value of the element is changed.
  8323. OnChange(h EventHandler, scope ...any) HTMLDel
  8324. // OnClick calls the given handler when there is a mouse click on the element.
  8325. OnClick(h EventHandler, scope ...any) HTMLDel
  8326. // OnContextMenu calls the given handler when a context menu is triggered.
  8327. OnContextMenu(h EventHandler, scope ...any) HTMLDel
  8328. // OnCopy calls the given handler when the user copies the content of an element.
  8329. OnCopy(h EventHandler, scope ...any) HTMLDel
  8330. // OnCut calls the given handler when the user cuts the content of an element.
  8331. OnCut(h EventHandler, scope ...any) HTMLDel
  8332. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  8333. OnDblClick(h EventHandler, scope ...any) HTMLDel
  8334. // OnDrag calls the given handler when an element is dragged.
  8335. OnDrag(h EventHandler, scope ...any) HTMLDel
  8336. // OnDragEnd calls the given handler at the end of a drag operation.
  8337. OnDragEnd(h EventHandler, scope ...any) HTMLDel
  8338. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  8339. OnDragEnter(h EventHandler, scope ...any) HTMLDel
  8340. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  8341. OnDragLeave(h EventHandler, scope ...any) HTMLDel
  8342. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  8343. OnDragOver(h EventHandler, scope ...any) HTMLDel
  8344. // OnDragStart calls the given handler at the start of a drag operation.
  8345. OnDragStart(h EventHandler, scope ...any) HTMLDel
  8346. // OnDrop calls the given handler when dragged element is being dropped.
  8347. OnDrop(h EventHandler, scope ...any) HTMLDel
  8348. // OnFocus calls the given handler when the element gets focus.
  8349. OnFocus(h EventHandler, scope ...any) HTMLDel
  8350. // OnInput calls the given handler when an element gets user input.
  8351. OnInput(h EventHandler, scope ...any) HTMLDel
  8352. // OnInvalid calls the given handler when an element is invalid.
  8353. OnInvalid(h EventHandler, scope ...any) HTMLDel
  8354. // OnKeyDown calls the given handler when a user is pressing a key.
  8355. OnKeyDown(h EventHandler, scope ...any) HTMLDel
  8356. // OnKeyPress calls the given handler when a user presses a key.
  8357. OnKeyPress(h EventHandler, scope ...any) HTMLDel
  8358. // OnKeyUp calls the given handler when a user releases a key.
  8359. OnKeyUp(h EventHandler, scope ...any) HTMLDel
  8360. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  8361. OnMouseDown(h EventHandler, scope ...any) HTMLDel
  8362. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  8363. OnMouseMove(h EventHandler, scope ...any) HTMLDel
  8364. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  8365. OnMouseOut(h EventHandler, scope ...any) HTMLDel
  8366. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  8367. OnMouseOver(h EventHandler, scope ...any) HTMLDel
  8368. // OnMouseUp calls the given handler when a mouse button is released over an element.
  8369. OnMouseUp(h EventHandler, scope ...any) HTMLDel
  8370. // OnPaste calls the given handler when the user pastes some content in an element.
  8371. OnPaste(h EventHandler, scope ...any) HTMLDel
  8372. // OnReset calls the given handler when the Reset button in a form is clicked.
  8373. OnReset(h EventHandler, scope ...any) HTMLDel
  8374. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  8375. OnScroll(h EventHandler, scope ...any) HTMLDel
  8376. // OnSearch calls the given handler when the user writes something in a search field.
  8377. OnSearch(h EventHandler, scope ...any) HTMLDel
  8378. // OnSelect calls the given handler after some text has been selected in an element.
  8379. OnSelect(h EventHandler, scope ...any) HTMLDel
  8380. // OnSubmit calls the given handler when a form is submitted.
  8381. OnSubmit(h EventHandler, scope ...any) HTMLDel
  8382. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  8383. OnWheel(h EventHandler, scope ...any) HTMLDel
  8384. }
  8385. // Del returns an HTML element that defines text that has been deleted from a document.
  8386. func Del() HTMLDel {
  8387. e := &htmlDel{
  8388. htmlElement: htmlElement{
  8389. tag: "del",
  8390. isSelfClosing: false,
  8391. },
  8392. }
  8393. return e
  8394. }
  8395. type htmlDel struct {
  8396. htmlElement
  8397. }
  8398. func (e *htmlDel) Body(v ...UI) HTMLDel {
  8399. e.setChildren(v...)
  8400. return e
  8401. }
  8402. func (e *htmlDel) Text(v any) HTMLDel {
  8403. return e.Body(Text(v))
  8404. }
  8405. func (e *htmlDel) AccessKey(v string) HTMLDel {
  8406. e.setAttr("accesskey", v)
  8407. return e
  8408. }
  8409. func (e *htmlDel) Aria(k string, v any) HTMLDel {
  8410. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  8411. return e
  8412. }
  8413. func (e *htmlDel) Attr(n string, v any) HTMLDel {
  8414. e.setAttr(n, v)
  8415. return e
  8416. }
  8417. func (e *htmlDel) Cite(v string) HTMLDel {
  8418. e.setAttr("cite", v)
  8419. return e
  8420. }
  8421. func (e *htmlDel) Class(v ...string) HTMLDel {
  8422. e.setAttr("class", strings.Join(v, " "))
  8423. return e
  8424. }
  8425. func (e *htmlDel) ContentEditable(v bool) HTMLDel {
  8426. e.setAttr("contenteditable", v)
  8427. return e
  8428. }
  8429. func (e *htmlDel) DataSet(k string, v any) HTMLDel {
  8430. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  8431. return e
  8432. }
  8433. func (e *htmlDel) DateTime(v string) HTMLDel {
  8434. e.setAttr("datetime", v)
  8435. return e
  8436. }
  8437. func (e *htmlDel) Dir(v string) HTMLDel {
  8438. e.setAttr("dir", v)
  8439. return e
  8440. }
  8441. func (e *htmlDel) Draggable(v bool) HTMLDel {
  8442. e.setAttr("draggable", v)
  8443. return e
  8444. }
  8445. func (e *htmlDel) Hidden(v bool) HTMLDel {
  8446. e.setAttr("hidden", v)
  8447. return e
  8448. }
  8449. func (e *htmlDel) ID(v string) HTMLDel {
  8450. e.setAttr("id", v)
  8451. return e
  8452. }
  8453. func (e *htmlDel) Lang(v string) HTMLDel {
  8454. e.setAttr("lang", v)
  8455. return e
  8456. }
  8457. func (e *htmlDel) Role(v string) HTMLDel {
  8458. e.setAttr("role", v)
  8459. return e
  8460. }
  8461. func (e *htmlDel) Spellcheck(v bool) HTMLDel {
  8462. s := "false"
  8463. if v {
  8464. s = "true"
  8465. }
  8466. e.setAttr("spellcheck", s)
  8467. return e
  8468. }
  8469. func (e *htmlDel) Style(k, v string) HTMLDel {
  8470. e.setAttr("style", k+":"+v)
  8471. return e
  8472. }
  8473. func (e *htmlDel) Styles(s map[string]string) HTMLDel {
  8474. for k, v := range s {
  8475. e.Style(k, v)
  8476. }
  8477. return e
  8478. }
  8479. func (e *htmlDel) TabIndex(v int) HTMLDel {
  8480. e.setAttr("tabindex", v)
  8481. return e
  8482. }
  8483. func (e *htmlDel) Title(v string) HTMLDel {
  8484. e.setAttr("title", v)
  8485. return e
  8486. }
  8487. func (e *htmlDel) On(event string, h EventHandler, scope ...any) HTMLDel {
  8488. e.setEventHandler(event, h, scope...)
  8489. return e
  8490. }
  8491. func (e *htmlDel) OnBlur(h EventHandler, scope ...any) HTMLDel {
  8492. e.setEventHandler("blur", h, scope...)
  8493. return e
  8494. }
  8495. func (e *htmlDel) OnChange(h EventHandler, scope ...any) HTMLDel {
  8496. e.setEventHandler("change", h, scope...)
  8497. return e
  8498. }
  8499. func (e *htmlDel) OnClick(h EventHandler, scope ...any) HTMLDel {
  8500. e.setEventHandler("click", h, scope...)
  8501. return e
  8502. }
  8503. func (e *htmlDel) OnContextMenu(h EventHandler, scope ...any) HTMLDel {
  8504. e.setEventHandler("contextmenu", h, scope...)
  8505. return e
  8506. }
  8507. func (e *htmlDel) OnCopy(h EventHandler, scope ...any) HTMLDel {
  8508. e.setEventHandler("copy", h, scope...)
  8509. return e
  8510. }
  8511. func (e *htmlDel) OnCut(h EventHandler, scope ...any) HTMLDel {
  8512. e.setEventHandler("cut", h, scope...)
  8513. return e
  8514. }
  8515. func (e *htmlDel) OnDblClick(h EventHandler, scope ...any) HTMLDel {
  8516. e.setEventHandler("dblclick", h, scope...)
  8517. return e
  8518. }
  8519. func (e *htmlDel) OnDrag(h EventHandler, scope ...any) HTMLDel {
  8520. e.setEventHandler("drag", h, scope...)
  8521. return e
  8522. }
  8523. func (e *htmlDel) OnDragEnd(h EventHandler, scope ...any) HTMLDel {
  8524. e.setEventHandler("dragend", h, scope...)
  8525. return e
  8526. }
  8527. func (e *htmlDel) OnDragEnter(h EventHandler, scope ...any) HTMLDel {
  8528. e.setEventHandler("dragenter", h, scope...)
  8529. return e
  8530. }
  8531. func (e *htmlDel) OnDragLeave(h EventHandler, scope ...any) HTMLDel {
  8532. e.setEventHandler("dragleave", h, scope...)
  8533. return e
  8534. }
  8535. func (e *htmlDel) OnDragOver(h EventHandler, scope ...any) HTMLDel {
  8536. e.setEventHandler("dragover", h, scope...)
  8537. return e
  8538. }
  8539. func (e *htmlDel) OnDragStart(h EventHandler, scope ...any) HTMLDel {
  8540. e.setEventHandler("dragstart", h, scope...)
  8541. return e
  8542. }
  8543. func (e *htmlDel) OnDrop(h EventHandler, scope ...any) HTMLDel {
  8544. e.setEventHandler("drop", h, scope...)
  8545. return e
  8546. }
  8547. func (e *htmlDel) OnFocus(h EventHandler, scope ...any) HTMLDel {
  8548. e.setEventHandler("focus", h, scope...)
  8549. return e
  8550. }
  8551. func (e *htmlDel) OnInput(h EventHandler, scope ...any) HTMLDel {
  8552. e.setEventHandler("input", h, scope...)
  8553. return e
  8554. }
  8555. func (e *htmlDel) OnInvalid(h EventHandler, scope ...any) HTMLDel {
  8556. e.setEventHandler("invalid", h, scope...)
  8557. return e
  8558. }
  8559. func (e *htmlDel) OnKeyDown(h EventHandler, scope ...any) HTMLDel {
  8560. e.setEventHandler("keydown", h, scope...)
  8561. return e
  8562. }
  8563. func (e *htmlDel) OnKeyPress(h EventHandler, scope ...any) HTMLDel {
  8564. e.setEventHandler("keypress", h, scope...)
  8565. return e
  8566. }
  8567. func (e *htmlDel) OnKeyUp(h EventHandler, scope ...any) HTMLDel {
  8568. e.setEventHandler("keyup", h, scope...)
  8569. return e
  8570. }
  8571. func (e *htmlDel) OnMouseDown(h EventHandler, scope ...any) HTMLDel {
  8572. e.setEventHandler("mousedown", h, scope...)
  8573. return e
  8574. }
  8575. func (e *htmlDel) OnMouseMove(h EventHandler, scope ...any) HTMLDel {
  8576. e.setEventHandler("mousemove", h, scope...)
  8577. return e
  8578. }
  8579. func (e *htmlDel) OnMouseOut(h EventHandler, scope ...any) HTMLDel {
  8580. e.setEventHandler("mouseout", h, scope...)
  8581. return e
  8582. }
  8583. func (e *htmlDel) OnMouseOver(h EventHandler, scope ...any) HTMLDel {
  8584. e.setEventHandler("mouseover", h, scope...)
  8585. return e
  8586. }
  8587. func (e *htmlDel) OnMouseUp(h EventHandler, scope ...any) HTMLDel {
  8588. e.setEventHandler("mouseup", h, scope...)
  8589. return e
  8590. }
  8591. func (e *htmlDel) OnPaste(h EventHandler, scope ...any) HTMLDel {
  8592. e.setEventHandler("paste", h, scope...)
  8593. return e
  8594. }
  8595. func (e *htmlDel) OnReset(h EventHandler, scope ...any) HTMLDel {
  8596. e.setEventHandler("reset", h, scope...)
  8597. return e
  8598. }
  8599. func (e *htmlDel) OnScroll(h EventHandler, scope ...any) HTMLDel {
  8600. e.setEventHandler("scroll", h, scope...)
  8601. return e
  8602. }
  8603. func (e *htmlDel) OnSearch(h EventHandler, scope ...any) HTMLDel {
  8604. e.setEventHandler("search", h, scope...)
  8605. return e
  8606. }
  8607. func (e *htmlDel) OnSelect(h EventHandler, scope ...any) HTMLDel {
  8608. e.setEventHandler("select", h, scope...)
  8609. return e
  8610. }
  8611. func (e *htmlDel) OnSubmit(h EventHandler, scope ...any) HTMLDel {
  8612. e.setEventHandler("submit", h, scope...)
  8613. return e
  8614. }
  8615. func (e *htmlDel) OnWheel(h EventHandler, scope ...any) HTMLDel {
  8616. e.setEventHandler("wheel", h, scope...)
  8617. return e
  8618. }
  8619. // HTMLDetails is the interface that describes a "details" HTML element.
  8620. type HTMLDetails interface {
  8621. UI
  8622. // Body set the content of the element.
  8623. Body(elems ...UI) HTMLDetails
  8624. // Text sets the content of the element with a text node containing the stringified given value.
  8625. Text(v any) HTMLDetails
  8626. // AccessKey specifies a shortcut key to activate/focus an element.
  8627. AccessKey(v string) HTMLDetails
  8628. // Aria stores accessible rich internet applications (ARIA) data.
  8629. Aria(k string, v any) HTMLDetails
  8630. // Attr sets the named attribute with the given value.
  8631. Attr(n string, v any) HTMLDetails
  8632. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  8633. Class(v ...string) HTMLDetails
  8634. // ContentEditable specifies whether the content of an element is editable or not.
  8635. ContentEditable(v bool) HTMLDetails
  8636. // DataSet stores custom data private to the page or application.
  8637. DataSet(k string, v any) HTMLDetails
  8638. // Dir specifies the text direction for the content in an element.
  8639. Dir(v string) HTMLDetails
  8640. // Draggable specifies whether an element is draggable or not.
  8641. Draggable(v bool) HTMLDetails
  8642. // Hidden specifies that an element is not yet, or is no longer relevant.
  8643. Hidden(v bool) HTMLDetails
  8644. // ID specifies a unique id for an element.
  8645. ID(v string) HTMLDetails
  8646. // Lang specifies the language of the element's content.
  8647. Lang(v string) HTMLDetails
  8648. // Open specifies that the details should be visible (open) to the user.
  8649. Open(v bool) HTMLDetails
  8650. // Role specifies to parsing software the exact function of an element (and its children).
  8651. Role(v string) HTMLDetails
  8652. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  8653. Spellcheck(v bool) HTMLDetails
  8654. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  8655. Style(k, v string) HTMLDetails
  8656. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  8657. Styles(s map[string]string) HTMLDetails
  8658. // TabIndex specifies the tabbing order of an element.
  8659. TabIndex(v int) HTMLDetails
  8660. // Title specifies extra information about an element.
  8661. Title(v string) HTMLDetails
  8662. // On registers the given event handler to the specified event.
  8663. On(event string, h EventHandler, scope ...any) HTMLDetails
  8664. // OnBlur calls the given handler when the element loses focus.
  8665. OnBlur(h EventHandler, scope ...any) HTMLDetails
  8666. // OnChange calls the given handler when the value of the element is changed.
  8667. OnChange(h EventHandler, scope ...any) HTMLDetails
  8668. // OnClick calls the given handler when there is a mouse click on the element.
  8669. OnClick(h EventHandler, scope ...any) HTMLDetails
  8670. // OnContextMenu calls the given handler when a context menu is triggered.
  8671. OnContextMenu(h EventHandler, scope ...any) HTMLDetails
  8672. // OnCopy calls the given handler when the user copies the content of an element.
  8673. OnCopy(h EventHandler, scope ...any) HTMLDetails
  8674. // OnCut calls the given handler when the user cuts the content of an element.
  8675. OnCut(h EventHandler, scope ...any) HTMLDetails
  8676. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  8677. OnDblClick(h EventHandler, scope ...any) HTMLDetails
  8678. // OnDrag calls the given handler when an element is dragged.
  8679. OnDrag(h EventHandler, scope ...any) HTMLDetails
  8680. // OnDragEnd calls the given handler at the end of a drag operation.
  8681. OnDragEnd(h EventHandler, scope ...any) HTMLDetails
  8682. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  8683. OnDragEnter(h EventHandler, scope ...any) HTMLDetails
  8684. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  8685. OnDragLeave(h EventHandler, scope ...any) HTMLDetails
  8686. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  8687. OnDragOver(h EventHandler, scope ...any) HTMLDetails
  8688. // OnDragStart calls the given handler at the start of a drag operation.
  8689. OnDragStart(h EventHandler, scope ...any) HTMLDetails
  8690. // OnDrop calls the given handler when dragged element is being dropped.
  8691. OnDrop(h EventHandler, scope ...any) HTMLDetails
  8692. // OnFocus calls the given handler when the element gets focus.
  8693. OnFocus(h EventHandler, scope ...any) HTMLDetails
  8694. // OnInput calls the given handler when an element gets user input.
  8695. OnInput(h EventHandler, scope ...any) HTMLDetails
  8696. // OnInvalid calls the given handler when an element is invalid.
  8697. OnInvalid(h EventHandler, scope ...any) HTMLDetails
  8698. // OnKeyDown calls the given handler when a user is pressing a key.
  8699. OnKeyDown(h EventHandler, scope ...any) HTMLDetails
  8700. // OnKeyPress calls the given handler when a user presses a key.
  8701. OnKeyPress(h EventHandler, scope ...any) HTMLDetails
  8702. // OnKeyUp calls the given handler when a user releases a key.
  8703. OnKeyUp(h EventHandler, scope ...any) HTMLDetails
  8704. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  8705. OnMouseDown(h EventHandler, scope ...any) HTMLDetails
  8706. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  8707. OnMouseMove(h EventHandler, scope ...any) HTMLDetails
  8708. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  8709. OnMouseOut(h EventHandler, scope ...any) HTMLDetails
  8710. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  8711. OnMouseOver(h EventHandler, scope ...any) HTMLDetails
  8712. // OnMouseUp calls the given handler when a mouse button is released over an element.
  8713. OnMouseUp(h EventHandler, scope ...any) HTMLDetails
  8714. // OnPaste calls the given handler when the user pastes some content in an element.
  8715. OnPaste(h EventHandler, scope ...any) HTMLDetails
  8716. // OnReset calls the given handler when the Reset button in a form is clicked.
  8717. OnReset(h EventHandler, scope ...any) HTMLDetails
  8718. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  8719. OnScroll(h EventHandler, scope ...any) HTMLDetails
  8720. // OnSearch calls the given handler when the user writes something in a search field.
  8721. OnSearch(h EventHandler, scope ...any) HTMLDetails
  8722. // OnSelect calls the given handler after some text has been selected in an element.
  8723. OnSelect(h EventHandler, scope ...any) HTMLDetails
  8724. // OnSubmit calls the given handler when a form is submitted.
  8725. OnSubmit(h EventHandler, scope ...any) HTMLDetails
  8726. // OnToggle calls the given handler when the user opens or closes the details element.
  8727. OnToggle(h EventHandler, scope ...any) HTMLDetails
  8728. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  8729. OnWheel(h EventHandler, scope ...any) HTMLDetails
  8730. }
  8731. // Details returns an HTML element that defines additional details that the user can view or hide.
  8732. func Details() HTMLDetails {
  8733. e := &htmlDetails{
  8734. htmlElement: htmlElement{
  8735. tag: "details",
  8736. isSelfClosing: false,
  8737. },
  8738. }
  8739. return e
  8740. }
  8741. type htmlDetails struct {
  8742. htmlElement
  8743. }
  8744. func (e *htmlDetails) Body(v ...UI) HTMLDetails {
  8745. e.setChildren(v...)
  8746. return e
  8747. }
  8748. func (e *htmlDetails) Text(v any) HTMLDetails {
  8749. return e.Body(Text(v))
  8750. }
  8751. func (e *htmlDetails) AccessKey(v string) HTMLDetails {
  8752. e.setAttr("accesskey", v)
  8753. return e
  8754. }
  8755. func (e *htmlDetails) Aria(k string, v any) HTMLDetails {
  8756. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  8757. return e
  8758. }
  8759. func (e *htmlDetails) Attr(n string, v any) HTMLDetails {
  8760. e.setAttr(n, v)
  8761. return e
  8762. }
  8763. func (e *htmlDetails) Class(v ...string) HTMLDetails {
  8764. e.setAttr("class", strings.Join(v, " "))
  8765. return e
  8766. }
  8767. func (e *htmlDetails) ContentEditable(v bool) HTMLDetails {
  8768. e.setAttr("contenteditable", v)
  8769. return e
  8770. }
  8771. func (e *htmlDetails) DataSet(k string, v any) HTMLDetails {
  8772. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  8773. return e
  8774. }
  8775. func (e *htmlDetails) Dir(v string) HTMLDetails {
  8776. e.setAttr("dir", v)
  8777. return e
  8778. }
  8779. func (e *htmlDetails) Draggable(v bool) HTMLDetails {
  8780. e.setAttr("draggable", v)
  8781. return e
  8782. }
  8783. func (e *htmlDetails) Hidden(v bool) HTMLDetails {
  8784. e.setAttr("hidden", v)
  8785. return e
  8786. }
  8787. func (e *htmlDetails) ID(v string) HTMLDetails {
  8788. e.setAttr("id", v)
  8789. return e
  8790. }
  8791. func (e *htmlDetails) Lang(v string) HTMLDetails {
  8792. e.setAttr("lang", v)
  8793. return e
  8794. }
  8795. func (e *htmlDetails) Open(v bool) HTMLDetails {
  8796. e.setAttr("open", v)
  8797. return e
  8798. }
  8799. func (e *htmlDetails) Role(v string) HTMLDetails {
  8800. e.setAttr("role", v)
  8801. return e
  8802. }
  8803. func (e *htmlDetails) Spellcheck(v bool) HTMLDetails {
  8804. s := "false"
  8805. if v {
  8806. s = "true"
  8807. }
  8808. e.setAttr("spellcheck", s)
  8809. return e
  8810. }
  8811. func (e *htmlDetails) Style(k, v string) HTMLDetails {
  8812. e.setAttr("style", k+":"+v)
  8813. return e
  8814. }
  8815. func (e *htmlDetails) Styles(s map[string]string) HTMLDetails {
  8816. for k, v := range s {
  8817. e.Style(k, v)
  8818. }
  8819. return e
  8820. }
  8821. func (e *htmlDetails) TabIndex(v int) HTMLDetails {
  8822. e.setAttr("tabindex", v)
  8823. return e
  8824. }
  8825. func (e *htmlDetails) Title(v string) HTMLDetails {
  8826. e.setAttr("title", v)
  8827. return e
  8828. }
  8829. func (e *htmlDetails) On(event string, h EventHandler, scope ...any) HTMLDetails {
  8830. e.setEventHandler(event, h, scope...)
  8831. return e
  8832. }
  8833. func (e *htmlDetails) OnBlur(h EventHandler, scope ...any) HTMLDetails {
  8834. e.setEventHandler("blur", h, scope...)
  8835. return e
  8836. }
  8837. func (e *htmlDetails) OnChange(h EventHandler, scope ...any) HTMLDetails {
  8838. e.setEventHandler("change", h, scope...)
  8839. return e
  8840. }
  8841. func (e *htmlDetails) OnClick(h EventHandler, scope ...any) HTMLDetails {
  8842. e.setEventHandler("click", h, scope...)
  8843. return e
  8844. }
  8845. func (e *htmlDetails) OnContextMenu(h EventHandler, scope ...any) HTMLDetails {
  8846. e.setEventHandler("contextmenu", h, scope...)
  8847. return e
  8848. }
  8849. func (e *htmlDetails) OnCopy(h EventHandler, scope ...any) HTMLDetails {
  8850. e.setEventHandler("copy", h, scope...)
  8851. return e
  8852. }
  8853. func (e *htmlDetails) OnCut(h EventHandler, scope ...any) HTMLDetails {
  8854. e.setEventHandler("cut", h, scope...)
  8855. return e
  8856. }
  8857. func (e *htmlDetails) OnDblClick(h EventHandler, scope ...any) HTMLDetails {
  8858. e.setEventHandler("dblclick", h, scope...)
  8859. return e
  8860. }
  8861. func (e *htmlDetails) OnDrag(h EventHandler, scope ...any) HTMLDetails {
  8862. e.setEventHandler("drag", h, scope...)
  8863. return e
  8864. }
  8865. func (e *htmlDetails) OnDragEnd(h EventHandler, scope ...any) HTMLDetails {
  8866. e.setEventHandler("dragend", h, scope...)
  8867. return e
  8868. }
  8869. func (e *htmlDetails) OnDragEnter(h EventHandler, scope ...any) HTMLDetails {
  8870. e.setEventHandler("dragenter", h, scope...)
  8871. return e
  8872. }
  8873. func (e *htmlDetails) OnDragLeave(h EventHandler, scope ...any) HTMLDetails {
  8874. e.setEventHandler("dragleave", h, scope...)
  8875. return e
  8876. }
  8877. func (e *htmlDetails) OnDragOver(h EventHandler, scope ...any) HTMLDetails {
  8878. e.setEventHandler("dragover", h, scope...)
  8879. return e
  8880. }
  8881. func (e *htmlDetails) OnDragStart(h EventHandler, scope ...any) HTMLDetails {
  8882. e.setEventHandler("dragstart", h, scope...)
  8883. return e
  8884. }
  8885. func (e *htmlDetails) OnDrop(h EventHandler, scope ...any) HTMLDetails {
  8886. e.setEventHandler("drop", h, scope...)
  8887. return e
  8888. }
  8889. func (e *htmlDetails) OnFocus(h EventHandler, scope ...any) HTMLDetails {
  8890. e.setEventHandler("focus", h, scope...)
  8891. return e
  8892. }
  8893. func (e *htmlDetails) OnInput(h EventHandler, scope ...any) HTMLDetails {
  8894. e.setEventHandler("input", h, scope...)
  8895. return e
  8896. }
  8897. func (e *htmlDetails) OnInvalid(h EventHandler, scope ...any) HTMLDetails {
  8898. e.setEventHandler("invalid", h, scope...)
  8899. return e
  8900. }
  8901. func (e *htmlDetails) OnKeyDown(h EventHandler, scope ...any) HTMLDetails {
  8902. e.setEventHandler("keydown", h, scope...)
  8903. return e
  8904. }
  8905. func (e *htmlDetails) OnKeyPress(h EventHandler, scope ...any) HTMLDetails {
  8906. e.setEventHandler("keypress", h, scope...)
  8907. return e
  8908. }
  8909. func (e *htmlDetails) OnKeyUp(h EventHandler, scope ...any) HTMLDetails {
  8910. e.setEventHandler("keyup", h, scope...)
  8911. return e
  8912. }
  8913. func (e *htmlDetails) OnMouseDown(h EventHandler, scope ...any) HTMLDetails {
  8914. e.setEventHandler("mousedown", h, scope...)
  8915. return e
  8916. }
  8917. func (e *htmlDetails) OnMouseMove(h EventHandler, scope ...any) HTMLDetails {
  8918. e.setEventHandler("mousemove", h, scope...)
  8919. return e
  8920. }
  8921. func (e *htmlDetails) OnMouseOut(h EventHandler, scope ...any) HTMLDetails {
  8922. e.setEventHandler("mouseout", h, scope...)
  8923. return e
  8924. }
  8925. func (e *htmlDetails) OnMouseOver(h EventHandler, scope ...any) HTMLDetails {
  8926. e.setEventHandler("mouseover", h, scope...)
  8927. return e
  8928. }
  8929. func (e *htmlDetails) OnMouseUp(h EventHandler, scope ...any) HTMLDetails {
  8930. e.setEventHandler("mouseup", h, scope...)
  8931. return e
  8932. }
  8933. func (e *htmlDetails) OnPaste(h EventHandler, scope ...any) HTMLDetails {
  8934. e.setEventHandler("paste", h, scope...)
  8935. return e
  8936. }
  8937. func (e *htmlDetails) OnReset(h EventHandler, scope ...any) HTMLDetails {
  8938. e.setEventHandler("reset", h, scope...)
  8939. return e
  8940. }
  8941. func (e *htmlDetails) OnScroll(h EventHandler, scope ...any) HTMLDetails {
  8942. e.setEventHandler("scroll", h, scope...)
  8943. return e
  8944. }
  8945. func (e *htmlDetails) OnSearch(h EventHandler, scope ...any) HTMLDetails {
  8946. e.setEventHandler("search", h, scope...)
  8947. return e
  8948. }
  8949. func (e *htmlDetails) OnSelect(h EventHandler, scope ...any) HTMLDetails {
  8950. e.setEventHandler("select", h, scope...)
  8951. return e
  8952. }
  8953. func (e *htmlDetails) OnSubmit(h EventHandler, scope ...any) HTMLDetails {
  8954. e.setEventHandler("submit", h, scope...)
  8955. return e
  8956. }
  8957. func (e *htmlDetails) OnToggle(h EventHandler, scope ...any) HTMLDetails {
  8958. e.setEventHandler("toggle", h, scope...)
  8959. return e
  8960. }
  8961. func (e *htmlDetails) OnWheel(h EventHandler, scope ...any) HTMLDetails {
  8962. e.setEventHandler("wheel", h, scope...)
  8963. return e
  8964. }
  8965. // HTMLDfn is the interface that describes a "dfn" HTML element.
  8966. type HTMLDfn interface {
  8967. UI
  8968. // Body set the content of the element.
  8969. Body(elems ...UI) HTMLDfn
  8970. // Text sets the content of the element with a text node containing the stringified given value.
  8971. Text(v any) HTMLDfn
  8972. // AccessKey specifies a shortcut key to activate/focus an element.
  8973. AccessKey(v string) HTMLDfn
  8974. // Aria stores accessible rich internet applications (ARIA) data.
  8975. Aria(k string, v any) HTMLDfn
  8976. // Attr sets the named attribute with the given value.
  8977. Attr(n string, v any) HTMLDfn
  8978. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  8979. Class(v ...string) HTMLDfn
  8980. // ContentEditable specifies whether the content of an element is editable or not.
  8981. ContentEditable(v bool) HTMLDfn
  8982. // DataSet stores custom data private to the page or application.
  8983. DataSet(k string, v any) HTMLDfn
  8984. // Dir specifies the text direction for the content in an element.
  8985. Dir(v string) HTMLDfn
  8986. // Draggable specifies whether an element is draggable or not.
  8987. Draggable(v bool) HTMLDfn
  8988. // Hidden specifies that an element is not yet, or is no longer relevant.
  8989. Hidden(v bool) HTMLDfn
  8990. // ID specifies a unique id for an element.
  8991. ID(v string) HTMLDfn
  8992. // Lang specifies the language of the element's content.
  8993. Lang(v string) HTMLDfn
  8994. // Role specifies to parsing software the exact function of an element (and its children).
  8995. Role(v string) HTMLDfn
  8996. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  8997. Spellcheck(v bool) HTMLDfn
  8998. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  8999. Style(k, v string) HTMLDfn
  9000. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  9001. Styles(s map[string]string) HTMLDfn
  9002. // TabIndex specifies the tabbing order of an element.
  9003. TabIndex(v int) HTMLDfn
  9004. // Title specifies extra information about an element.
  9005. Title(v string) HTMLDfn
  9006. // On registers the given event handler to the specified event.
  9007. On(event string, h EventHandler, scope ...any) HTMLDfn
  9008. // OnBlur calls the given handler when the element loses focus.
  9009. OnBlur(h EventHandler, scope ...any) HTMLDfn
  9010. // OnChange calls the given handler when the value of the element is changed.
  9011. OnChange(h EventHandler, scope ...any) HTMLDfn
  9012. // OnClick calls the given handler when there is a mouse click on the element.
  9013. OnClick(h EventHandler, scope ...any) HTMLDfn
  9014. // OnContextMenu calls the given handler when a context menu is triggered.
  9015. OnContextMenu(h EventHandler, scope ...any) HTMLDfn
  9016. // OnCopy calls the given handler when the user copies the content of an element.
  9017. OnCopy(h EventHandler, scope ...any) HTMLDfn
  9018. // OnCut calls the given handler when the user cuts the content of an element.
  9019. OnCut(h EventHandler, scope ...any) HTMLDfn
  9020. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  9021. OnDblClick(h EventHandler, scope ...any) HTMLDfn
  9022. // OnDrag calls the given handler when an element is dragged.
  9023. OnDrag(h EventHandler, scope ...any) HTMLDfn
  9024. // OnDragEnd calls the given handler at the end of a drag operation.
  9025. OnDragEnd(h EventHandler, scope ...any) HTMLDfn
  9026. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  9027. OnDragEnter(h EventHandler, scope ...any) HTMLDfn
  9028. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  9029. OnDragLeave(h EventHandler, scope ...any) HTMLDfn
  9030. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  9031. OnDragOver(h EventHandler, scope ...any) HTMLDfn
  9032. // OnDragStart calls the given handler at the start of a drag operation.
  9033. OnDragStart(h EventHandler, scope ...any) HTMLDfn
  9034. // OnDrop calls the given handler when dragged element is being dropped.
  9035. OnDrop(h EventHandler, scope ...any) HTMLDfn
  9036. // OnFocus calls the given handler when the element gets focus.
  9037. OnFocus(h EventHandler, scope ...any) HTMLDfn
  9038. // OnInput calls the given handler when an element gets user input.
  9039. OnInput(h EventHandler, scope ...any) HTMLDfn
  9040. // OnInvalid calls the given handler when an element is invalid.
  9041. OnInvalid(h EventHandler, scope ...any) HTMLDfn
  9042. // OnKeyDown calls the given handler when a user is pressing a key.
  9043. OnKeyDown(h EventHandler, scope ...any) HTMLDfn
  9044. // OnKeyPress calls the given handler when a user presses a key.
  9045. OnKeyPress(h EventHandler, scope ...any) HTMLDfn
  9046. // OnKeyUp calls the given handler when a user releases a key.
  9047. OnKeyUp(h EventHandler, scope ...any) HTMLDfn
  9048. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  9049. OnMouseDown(h EventHandler, scope ...any) HTMLDfn
  9050. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  9051. OnMouseMove(h EventHandler, scope ...any) HTMLDfn
  9052. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  9053. OnMouseOut(h EventHandler, scope ...any) HTMLDfn
  9054. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  9055. OnMouseOver(h EventHandler, scope ...any) HTMLDfn
  9056. // OnMouseUp calls the given handler when a mouse button is released over an element.
  9057. OnMouseUp(h EventHandler, scope ...any) HTMLDfn
  9058. // OnPaste calls the given handler when the user pastes some content in an element.
  9059. OnPaste(h EventHandler, scope ...any) HTMLDfn
  9060. // OnReset calls the given handler when the Reset button in a form is clicked.
  9061. OnReset(h EventHandler, scope ...any) HTMLDfn
  9062. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  9063. OnScroll(h EventHandler, scope ...any) HTMLDfn
  9064. // OnSearch calls the given handler when the user writes something in a search field.
  9065. OnSearch(h EventHandler, scope ...any) HTMLDfn
  9066. // OnSelect calls the given handler after some text has been selected in an element.
  9067. OnSelect(h EventHandler, scope ...any) HTMLDfn
  9068. // OnSubmit calls the given handler when a form is submitted.
  9069. OnSubmit(h EventHandler, scope ...any) HTMLDfn
  9070. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  9071. OnWheel(h EventHandler, scope ...any) HTMLDfn
  9072. }
  9073. // Dfn returns an HTML element that represents the defining instance of a term.
  9074. func Dfn() HTMLDfn {
  9075. e := &htmlDfn{
  9076. htmlElement: htmlElement{
  9077. tag: "dfn",
  9078. isSelfClosing: false,
  9079. },
  9080. }
  9081. return e
  9082. }
  9083. type htmlDfn struct {
  9084. htmlElement
  9085. }
  9086. func (e *htmlDfn) Body(v ...UI) HTMLDfn {
  9087. e.setChildren(v...)
  9088. return e
  9089. }
  9090. func (e *htmlDfn) Text(v any) HTMLDfn {
  9091. return e.Body(Text(v))
  9092. }
  9093. func (e *htmlDfn) AccessKey(v string) HTMLDfn {
  9094. e.setAttr("accesskey", v)
  9095. return e
  9096. }
  9097. func (e *htmlDfn) Aria(k string, v any) HTMLDfn {
  9098. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  9099. return e
  9100. }
  9101. func (e *htmlDfn) Attr(n string, v any) HTMLDfn {
  9102. e.setAttr(n, v)
  9103. return e
  9104. }
  9105. func (e *htmlDfn) Class(v ...string) HTMLDfn {
  9106. e.setAttr("class", strings.Join(v, " "))
  9107. return e
  9108. }
  9109. func (e *htmlDfn) ContentEditable(v bool) HTMLDfn {
  9110. e.setAttr("contenteditable", v)
  9111. return e
  9112. }
  9113. func (e *htmlDfn) DataSet(k string, v any) HTMLDfn {
  9114. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  9115. return e
  9116. }
  9117. func (e *htmlDfn) Dir(v string) HTMLDfn {
  9118. e.setAttr("dir", v)
  9119. return e
  9120. }
  9121. func (e *htmlDfn) Draggable(v bool) HTMLDfn {
  9122. e.setAttr("draggable", v)
  9123. return e
  9124. }
  9125. func (e *htmlDfn) Hidden(v bool) HTMLDfn {
  9126. e.setAttr("hidden", v)
  9127. return e
  9128. }
  9129. func (e *htmlDfn) ID(v string) HTMLDfn {
  9130. e.setAttr("id", v)
  9131. return e
  9132. }
  9133. func (e *htmlDfn) Lang(v string) HTMLDfn {
  9134. e.setAttr("lang", v)
  9135. return e
  9136. }
  9137. func (e *htmlDfn) Role(v string) HTMLDfn {
  9138. e.setAttr("role", v)
  9139. return e
  9140. }
  9141. func (e *htmlDfn) Spellcheck(v bool) HTMLDfn {
  9142. s := "false"
  9143. if v {
  9144. s = "true"
  9145. }
  9146. e.setAttr("spellcheck", s)
  9147. return e
  9148. }
  9149. func (e *htmlDfn) Style(k, v string) HTMLDfn {
  9150. e.setAttr("style", k+":"+v)
  9151. return e
  9152. }
  9153. func (e *htmlDfn) Styles(s map[string]string) HTMLDfn {
  9154. for k, v := range s {
  9155. e.Style(k, v)
  9156. }
  9157. return e
  9158. }
  9159. func (e *htmlDfn) TabIndex(v int) HTMLDfn {
  9160. e.setAttr("tabindex", v)
  9161. return e
  9162. }
  9163. func (e *htmlDfn) Title(v string) HTMLDfn {
  9164. e.setAttr("title", v)
  9165. return e
  9166. }
  9167. func (e *htmlDfn) On(event string, h EventHandler, scope ...any) HTMLDfn {
  9168. e.setEventHandler(event, h, scope...)
  9169. return e
  9170. }
  9171. func (e *htmlDfn) OnBlur(h EventHandler, scope ...any) HTMLDfn {
  9172. e.setEventHandler("blur", h, scope...)
  9173. return e
  9174. }
  9175. func (e *htmlDfn) OnChange(h EventHandler, scope ...any) HTMLDfn {
  9176. e.setEventHandler("change", h, scope...)
  9177. return e
  9178. }
  9179. func (e *htmlDfn) OnClick(h EventHandler, scope ...any) HTMLDfn {
  9180. e.setEventHandler("click", h, scope...)
  9181. return e
  9182. }
  9183. func (e *htmlDfn) OnContextMenu(h EventHandler, scope ...any) HTMLDfn {
  9184. e.setEventHandler("contextmenu", h, scope...)
  9185. return e
  9186. }
  9187. func (e *htmlDfn) OnCopy(h EventHandler, scope ...any) HTMLDfn {
  9188. e.setEventHandler("copy", h, scope...)
  9189. return e
  9190. }
  9191. func (e *htmlDfn) OnCut(h EventHandler, scope ...any) HTMLDfn {
  9192. e.setEventHandler("cut", h, scope...)
  9193. return e
  9194. }
  9195. func (e *htmlDfn) OnDblClick(h EventHandler, scope ...any) HTMLDfn {
  9196. e.setEventHandler("dblclick", h, scope...)
  9197. return e
  9198. }
  9199. func (e *htmlDfn) OnDrag(h EventHandler, scope ...any) HTMLDfn {
  9200. e.setEventHandler("drag", h, scope...)
  9201. return e
  9202. }
  9203. func (e *htmlDfn) OnDragEnd(h EventHandler, scope ...any) HTMLDfn {
  9204. e.setEventHandler("dragend", h, scope...)
  9205. return e
  9206. }
  9207. func (e *htmlDfn) OnDragEnter(h EventHandler, scope ...any) HTMLDfn {
  9208. e.setEventHandler("dragenter", h, scope...)
  9209. return e
  9210. }
  9211. func (e *htmlDfn) OnDragLeave(h EventHandler, scope ...any) HTMLDfn {
  9212. e.setEventHandler("dragleave", h, scope...)
  9213. return e
  9214. }
  9215. func (e *htmlDfn) OnDragOver(h EventHandler, scope ...any) HTMLDfn {
  9216. e.setEventHandler("dragover", h, scope...)
  9217. return e
  9218. }
  9219. func (e *htmlDfn) OnDragStart(h EventHandler, scope ...any) HTMLDfn {
  9220. e.setEventHandler("dragstart", h, scope...)
  9221. return e
  9222. }
  9223. func (e *htmlDfn) OnDrop(h EventHandler, scope ...any) HTMLDfn {
  9224. e.setEventHandler("drop", h, scope...)
  9225. return e
  9226. }
  9227. func (e *htmlDfn) OnFocus(h EventHandler, scope ...any) HTMLDfn {
  9228. e.setEventHandler("focus", h, scope...)
  9229. return e
  9230. }
  9231. func (e *htmlDfn) OnInput(h EventHandler, scope ...any) HTMLDfn {
  9232. e.setEventHandler("input", h, scope...)
  9233. return e
  9234. }
  9235. func (e *htmlDfn) OnInvalid(h EventHandler, scope ...any) HTMLDfn {
  9236. e.setEventHandler("invalid", h, scope...)
  9237. return e
  9238. }
  9239. func (e *htmlDfn) OnKeyDown(h EventHandler, scope ...any) HTMLDfn {
  9240. e.setEventHandler("keydown", h, scope...)
  9241. return e
  9242. }
  9243. func (e *htmlDfn) OnKeyPress(h EventHandler, scope ...any) HTMLDfn {
  9244. e.setEventHandler("keypress", h, scope...)
  9245. return e
  9246. }
  9247. func (e *htmlDfn) OnKeyUp(h EventHandler, scope ...any) HTMLDfn {
  9248. e.setEventHandler("keyup", h, scope...)
  9249. return e
  9250. }
  9251. func (e *htmlDfn) OnMouseDown(h EventHandler, scope ...any) HTMLDfn {
  9252. e.setEventHandler("mousedown", h, scope...)
  9253. return e
  9254. }
  9255. func (e *htmlDfn) OnMouseMove(h EventHandler, scope ...any) HTMLDfn {
  9256. e.setEventHandler("mousemove", h, scope...)
  9257. return e
  9258. }
  9259. func (e *htmlDfn) OnMouseOut(h EventHandler, scope ...any) HTMLDfn {
  9260. e.setEventHandler("mouseout", h, scope...)
  9261. return e
  9262. }
  9263. func (e *htmlDfn) OnMouseOver(h EventHandler, scope ...any) HTMLDfn {
  9264. e.setEventHandler("mouseover", h, scope...)
  9265. return e
  9266. }
  9267. func (e *htmlDfn) OnMouseUp(h EventHandler, scope ...any) HTMLDfn {
  9268. e.setEventHandler("mouseup", h, scope...)
  9269. return e
  9270. }
  9271. func (e *htmlDfn) OnPaste(h EventHandler, scope ...any) HTMLDfn {
  9272. e.setEventHandler("paste", h, scope...)
  9273. return e
  9274. }
  9275. func (e *htmlDfn) OnReset(h EventHandler, scope ...any) HTMLDfn {
  9276. e.setEventHandler("reset", h, scope...)
  9277. return e
  9278. }
  9279. func (e *htmlDfn) OnScroll(h EventHandler, scope ...any) HTMLDfn {
  9280. e.setEventHandler("scroll", h, scope...)
  9281. return e
  9282. }
  9283. func (e *htmlDfn) OnSearch(h EventHandler, scope ...any) HTMLDfn {
  9284. e.setEventHandler("search", h, scope...)
  9285. return e
  9286. }
  9287. func (e *htmlDfn) OnSelect(h EventHandler, scope ...any) HTMLDfn {
  9288. e.setEventHandler("select", h, scope...)
  9289. return e
  9290. }
  9291. func (e *htmlDfn) OnSubmit(h EventHandler, scope ...any) HTMLDfn {
  9292. e.setEventHandler("submit", h, scope...)
  9293. return e
  9294. }
  9295. func (e *htmlDfn) OnWheel(h EventHandler, scope ...any) HTMLDfn {
  9296. e.setEventHandler("wheel", h, scope...)
  9297. return e
  9298. }
  9299. // HTMLDialog is the interface that describes a "dialog" HTML element.
  9300. type HTMLDialog interface {
  9301. UI
  9302. // Body set the content of the element.
  9303. Body(elems ...UI) HTMLDialog
  9304. // Text sets the content of the element with a text node containing the stringified given value.
  9305. Text(v any) HTMLDialog
  9306. // AccessKey specifies a shortcut key to activate/focus an element.
  9307. AccessKey(v string) HTMLDialog
  9308. // Aria stores accessible rich internet applications (ARIA) data.
  9309. Aria(k string, v any) HTMLDialog
  9310. // Attr sets the named attribute with the given value.
  9311. Attr(n string, v any) HTMLDialog
  9312. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  9313. Class(v ...string) HTMLDialog
  9314. // ContentEditable specifies whether the content of an element is editable or not.
  9315. ContentEditable(v bool) HTMLDialog
  9316. // DataSet stores custom data private to the page or application.
  9317. DataSet(k string, v any) HTMLDialog
  9318. // Dir specifies the text direction for the content in an element.
  9319. Dir(v string) HTMLDialog
  9320. // Draggable specifies whether an element is draggable or not.
  9321. Draggable(v bool) HTMLDialog
  9322. // Hidden specifies that an element is not yet, or is no longer relevant.
  9323. Hidden(v bool) HTMLDialog
  9324. // ID specifies a unique id for an element.
  9325. ID(v string) HTMLDialog
  9326. // Lang specifies the language of the element's content.
  9327. Lang(v string) HTMLDialog
  9328. // Open specifies that the details should be visible (open) to the user.
  9329. Open(v bool) HTMLDialog
  9330. // Role specifies to parsing software the exact function of an element (and its children).
  9331. Role(v string) HTMLDialog
  9332. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  9333. Spellcheck(v bool) HTMLDialog
  9334. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  9335. Style(k, v string) HTMLDialog
  9336. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  9337. Styles(s map[string]string) HTMLDialog
  9338. // TabIndex specifies the tabbing order of an element.
  9339. TabIndex(v int) HTMLDialog
  9340. // Title specifies extra information about an element.
  9341. Title(v string) HTMLDialog
  9342. // On registers the given event handler to the specified event.
  9343. On(event string, h EventHandler, scope ...any) HTMLDialog
  9344. // OnBlur calls the given handler when the element loses focus.
  9345. OnBlur(h EventHandler, scope ...any) HTMLDialog
  9346. // OnChange calls the given handler when the value of the element is changed.
  9347. OnChange(h EventHandler, scope ...any) HTMLDialog
  9348. // OnClick calls the given handler when there is a mouse click on the element.
  9349. OnClick(h EventHandler, scope ...any) HTMLDialog
  9350. // OnContextMenu calls the given handler when a context menu is triggered.
  9351. OnContextMenu(h EventHandler, scope ...any) HTMLDialog
  9352. // OnCopy calls the given handler when the user copies the content of an element.
  9353. OnCopy(h EventHandler, scope ...any) HTMLDialog
  9354. // OnCut calls the given handler when the user cuts the content of an element.
  9355. OnCut(h EventHandler, scope ...any) HTMLDialog
  9356. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  9357. OnDblClick(h EventHandler, scope ...any) HTMLDialog
  9358. // OnDrag calls the given handler when an element is dragged.
  9359. OnDrag(h EventHandler, scope ...any) HTMLDialog
  9360. // OnDragEnd calls the given handler at the end of a drag operation.
  9361. OnDragEnd(h EventHandler, scope ...any) HTMLDialog
  9362. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  9363. OnDragEnter(h EventHandler, scope ...any) HTMLDialog
  9364. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  9365. OnDragLeave(h EventHandler, scope ...any) HTMLDialog
  9366. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  9367. OnDragOver(h EventHandler, scope ...any) HTMLDialog
  9368. // OnDragStart calls the given handler at the start of a drag operation.
  9369. OnDragStart(h EventHandler, scope ...any) HTMLDialog
  9370. // OnDrop calls the given handler when dragged element is being dropped.
  9371. OnDrop(h EventHandler, scope ...any) HTMLDialog
  9372. // OnFocus calls the given handler when the element gets focus.
  9373. OnFocus(h EventHandler, scope ...any) HTMLDialog
  9374. // OnInput calls the given handler when an element gets user input.
  9375. OnInput(h EventHandler, scope ...any) HTMLDialog
  9376. // OnInvalid calls the given handler when an element is invalid.
  9377. OnInvalid(h EventHandler, scope ...any) HTMLDialog
  9378. // OnKeyDown calls the given handler when a user is pressing a key.
  9379. OnKeyDown(h EventHandler, scope ...any) HTMLDialog
  9380. // OnKeyPress calls the given handler when a user presses a key.
  9381. OnKeyPress(h EventHandler, scope ...any) HTMLDialog
  9382. // OnKeyUp calls the given handler when a user releases a key.
  9383. OnKeyUp(h EventHandler, scope ...any) HTMLDialog
  9384. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  9385. OnMouseDown(h EventHandler, scope ...any) HTMLDialog
  9386. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  9387. OnMouseMove(h EventHandler, scope ...any) HTMLDialog
  9388. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  9389. OnMouseOut(h EventHandler, scope ...any) HTMLDialog
  9390. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  9391. OnMouseOver(h EventHandler, scope ...any) HTMLDialog
  9392. // OnMouseUp calls the given handler when a mouse button is released over an element.
  9393. OnMouseUp(h EventHandler, scope ...any) HTMLDialog
  9394. // OnPaste calls the given handler when the user pastes some content in an element.
  9395. OnPaste(h EventHandler, scope ...any) HTMLDialog
  9396. // OnReset calls the given handler when the Reset button in a form is clicked.
  9397. OnReset(h EventHandler, scope ...any) HTMLDialog
  9398. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  9399. OnScroll(h EventHandler, scope ...any) HTMLDialog
  9400. // OnSearch calls the given handler when the user writes something in a search field.
  9401. OnSearch(h EventHandler, scope ...any) HTMLDialog
  9402. // OnSelect calls the given handler after some text has been selected in an element.
  9403. OnSelect(h EventHandler, scope ...any) HTMLDialog
  9404. // OnSubmit calls the given handler when a form is submitted.
  9405. OnSubmit(h EventHandler, scope ...any) HTMLDialog
  9406. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  9407. OnWheel(h EventHandler, scope ...any) HTMLDialog
  9408. }
  9409. // Dialog returns an HTML element that defines a dialog box or window.
  9410. func Dialog() HTMLDialog {
  9411. e := &htmlDialog{
  9412. htmlElement: htmlElement{
  9413. tag: "dialog",
  9414. isSelfClosing: false,
  9415. },
  9416. }
  9417. return e
  9418. }
  9419. type htmlDialog struct {
  9420. htmlElement
  9421. }
  9422. func (e *htmlDialog) Body(v ...UI) HTMLDialog {
  9423. e.setChildren(v...)
  9424. return e
  9425. }
  9426. func (e *htmlDialog) Text(v any) HTMLDialog {
  9427. return e.Body(Text(v))
  9428. }
  9429. func (e *htmlDialog) AccessKey(v string) HTMLDialog {
  9430. e.setAttr("accesskey", v)
  9431. return e
  9432. }
  9433. func (e *htmlDialog) Aria(k string, v any) HTMLDialog {
  9434. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  9435. return e
  9436. }
  9437. func (e *htmlDialog) Attr(n string, v any) HTMLDialog {
  9438. e.setAttr(n, v)
  9439. return e
  9440. }
  9441. func (e *htmlDialog) Class(v ...string) HTMLDialog {
  9442. e.setAttr("class", strings.Join(v, " "))
  9443. return e
  9444. }
  9445. func (e *htmlDialog) ContentEditable(v bool) HTMLDialog {
  9446. e.setAttr("contenteditable", v)
  9447. return e
  9448. }
  9449. func (e *htmlDialog) DataSet(k string, v any) HTMLDialog {
  9450. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  9451. return e
  9452. }
  9453. func (e *htmlDialog) Dir(v string) HTMLDialog {
  9454. e.setAttr("dir", v)
  9455. return e
  9456. }
  9457. func (e *htmlDialog) Draggable(v bool) HTMLDialog {
  9458. e.setAttr("draggable", v)
  9459. return e
  9460. }
  9461. func (e *htmlDialog) Hidden(v bool) HTMLDialog {
  9462. e.setAttr("hidden", v)
  9463. return e
  9464. }
  9465. func (e *htmlDialog) ID(v string) HTMLDialog {
  9466. e.setAttr("id", v)
  9467. return e
  9468. }
  9469. func (e *htmlDialog) Lang(v string) HTMLDialog {
  9470. e.setAttr("lang", v)
  9471. return e
  9472. }
  9473. func (e *htmlDialog) Open(v bool) HTMLDialog {
  9474. e.setAttr("open", v)
  9475. return e
  9476. }
  9477. func (e *htmlDialog) Role(v string) HTMLDialog {
  9478. e.setAttr("role", v)
  9479. return e
  9480. }
  9481. func (e *htmlDialog) Spellcheck(v bool) HTMLDialog {
  9482. s := "false"
  9483. if v {
  9484. s = "true"
  9485. }
  9486. e.setAttr("spellcheck", s)
  9487. return e
  9488. }
  9489. func (e *htmlDialog) Style(k, v string) HTMLDialog {
  9490. e.setAttr("style", k+":"+v)
  9491. return e
  9492. }
  9493. func (e *htmlDialog) Styles(s map[string]string) HTMLDialog {
  9494. for k, v := range s {
  9495. e.Style(k, v)
  9496. }
  9497. return e
  9498. }
  9499. func (e *htmlDialog) TabIndex(v int) HTMLDialog {
  9500. e.setAttr("tabindex", v)
  9501. return e
  9502. }
  9503. func (e *htmlDialog) Title(v string) HTMLDialog {
  9504. e.setAttr("title", v)
  9505. return e
  9506. }
  9507. func (e *htmlDialog) On(event string, h EventHandler, scope ...any) HTMLDialog {
  9508. e.setEventHandler(event, h, scope...)
  9509. return e
  9510. }
  9511. func (e *htmlDialog) OnBlur(h EventHandler, scope ...any) HTMLDialog {
  9512. e.setEventHandler("blur", h, scope...)
  9513. return e
  9514. }
  9515. func (e *htmlDialog) OnChange(h EventHandler, scope ...any) HTMLDialog {
  9516. e.setEventHandler("change", h, scope...)
  9517. return e
  9518. }
  9519. func (e *htmlDialog) OnClick(h EventHandler, scope ...any) HTMLDialog {
  9520. e.setEventHandler("click", h, scope...)
  9521. return e
  9522. }
  9523. func (e *htmlDialog) OnContextMenu(h EventHandler, scope ...any) HTMLDialog {
  9524. e.setEventHandler("contextmenu", h, scope...)
  9525. return e
  9526. }
  9527. func (e *htmlDialog) OnCopy(h EventHandler, scope ...any) HTMLDialog {
  9528. e.setEventHandler("copy", h, scope...)
  9529. return e
  9530. }
  9531. func (e *htmlDialog) OnCut(h EventHandler, scope ...any) HTMLDialog {
  9532. e.setEventHandler("cut", h, scope...)
  9533. return e
  9534. }
  9535. func (e *htmlDialog) OnDblClick(h EventHandler, scope ...any) HTMLDialog {
  9536. e.setEventHandler("dblclick", h, scope...)
  9537. return e
  9538. }
  9539. func (e *htmlDialog) OnDrag(h EventHandler, scope ...any) HTMLDialog {
  9540. e.setEventHandler("drag", h, scope...)
  9541. return e
  9542. }
  9543. func (e *htmlDialog) OnDragEnd(h EventHandler, scope ...any) HTMLDialog {
  9544. e.setEventHandler("dragend", h, scope...)
  9545. return e
  9546. }
  9547. func (e *htmlDialog) OnDragEnter(h EventHandler, scope ...any) HTMLDialog {
  9548. e.setEventHandler("dragenter", h, scope...)
  9549. return e
  9550. }
  9551. func (e *htmlDialog) OnDragLeave(h EventHandler, scope ...any) HTMLDialog {
  9552. e.setEventHandler("dragleave", h, scope...)
  9553. return e
  9554. }
  9555. func (e *htmlDialog) OnDragOver(h EventHandler, scope ...any) HTMLDialog {
  9556. e.setEventHandler("dragover", h, scope...)
  9557. return e
  9558. }
  9559. func (e *htmlDialog) OnDragStart(h EventHandler, scope ...any) HTMLDialog {
  9560. e.setEventHandler("dragstart", h, scope...)
  9561. return e
  9562. }
  9563. func (e *htmlDialog) OnDrop(h EventHandler, scope ...any) HTMLDialog {
  9564. e.setEventHandler("drop", h, scope...)
  9565. return e
  9566. }
  9567. func (e *htmlDialog) OnFocus(h EventHandler, scope ...any) HTMLDialog {
  9568. e.setEventHandler("focus", h, scope...)
  9569. return e
  9570. }
  9571. func (e *htmlDialog) OnInput(h EventHandler, scope ...any) HTMLDialog {
  9572. e.setEventHandler("input", h, scope...)
  9573. return e
  9574. }
  9575. func (e *htmlDialog) OnInvalid(h EventHandler, scope ...any) HTMLDialog {
  9576. e.setEventHandler("invalid", h, scope...)
  9577. return e
  9578. }
  9579. func (e *htmlDialog) OnKeyDown(h EventHandler, scope ...any) HTMLDialog {
  9580. e.setEventHandler("keydown", h, scope...)
  9581. return e
  9582. }
  9583. func (e *htmlDialog) OnKeyPress(h EventHandler, scope ...any) HTMLDialog {
  9584. e.setEventHandler("keypress", h, scope...)
  9585. return e
  9586. }
  9587. func (e *htmlDialog) OnKeyUp(h EventHandler, scope ...any) HTMLDialog {
  9588. e.setEventHandler("keyup", h, scope...)
  9589. return e
  9590. }
  9591. func (e *htmlDialog) OnMouseDown(h EventHandler, scope ...any) HTMLDialog {
  9592. e.setEventHandler("mousedown", h, scope...)
  9593. return e
  9594. }
  9595. func (e *htmlDialog) OnMouseMove(h EventHandler, scope ...any) HTMLDialog {
  9596. e.setEventHandler("mousemove", h, scope...)
  9597. return e
  9598. }
  9599. func (e *htmlDialog) OnMouseOut(h EventHandler, scope ...any) HTMLDialog {
  9600. e.setEventHandler("mouseout", h, scope...)
  9601. return e
  9602. }
  9603. func (e *htmlDialog) OnMouseOver(h EventHandler, scope ...any) HTMLDialog {
  9604. e.setEventHandler("mouseover", h, scope...)
  9605. return e
  9606. }
  9607. func (e *htmlDialog) OnMouseUp(h EventHandler, scope ...any) HTMLDialog {
  9608. e.setEventHandler("mouseup", h, scope...)
  9609. return e
  9610. }
  9611. func (e *htmlDialog) OnPaste(h EventHandler, scope ...any) HTMLDialog {
  9612. e.setEventHandler("paste", h, scope...)
  9613. return e
  9614. }
  9615. func (e *htmlDialog) OnReset(h EventHandler, scope ...any) HTMLDialog {
  9616. e.setEventHandler("reset", h, scope...)
  9617. return e
  9618. }
  9619. func (e *htmlDialog) OnScroll(h EventHandler, scope ...any) HTMLDialog {
  9620. e.setEventHandler("scroll", h, scope...)
  9621. return e
  9622. }
  9623. func (e *htmlDialog) OnSearch(h EventHandler, scope ...any) HTMLDialog {
  9624. e.setEventHandler("search", h, scope...)
  9625. return e
  9626. }
  9627. func (e *htmlDialog) OnSelect(h EventHandler, scope ...any) HTMLDialog {
  9628. e.setEventHandler("select", h, scope...)
  9629. return e
  9630. }
  9631. func (e *htmlDialog) OnSubmit(h EventHandler, scope ...any) HTMLDialog {
  9632. e.setEventHandler("submit", h, scope...)
  9633. return e
  9634. }
  9635. func (e *htmlDialog) OnWheel(h EventHandler, scope ...any) HTMLDialog {
  9636. e.setEventHandler("wheel", h, scope...)
  9637. return e
  9638. }
  9639. // HTMLDiv is the interface that describes a "div" HTML element.
  9640. type HTMLDiv interface {
  9641. UI
  9642. // Body set the content of the element.
  9643. Body(elems ...UI) HTMLDiv
  9644. // Text sets the content of the element with a text node containing the stringified given value.
  9645. Text(v any) HTMLDiv
  9646. // AccessKey specifies a shortcut key to activate/focus an element.
  9647. AccessKey(v string) HTMLDiv
  9648. // Aria stores accessible rich internet applications (ARIA) data.
  9649. Aria(k string, v any) HTMLDiv
  9650. // Attr sets the named attribute with the given value.
  9651. Attr(n string, v any) HTMLDiv
  9652. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  9653. Class(v ...string) HTMLDiv
  9654. // ContentEditable specifies whether the content of an element is editable or not.
  9655. ContentEditable(v bool) HTMLDiv
  9656. // DataSet stores custom data private to the page or application.
  9657. DataSet(k string, v any) HTMLDiv
  9658. // Dir specifies the text direction for the content in an element.
  9659. Dir(v string) HTMLDiv
  9660. // Draggable specifies whether an element is draggable or not.
  9661. Draggable(v bool) HTMLDiv
  9662. // Hidden specifies that an element is not yet, or is no longer relevant.
  9663. Hidden(v bool) HTMLDiv
  9664. // ID specifies a unique id for an element.
  9665. ID(v string) HTMLDiv
  9666. // Lang specifies the language of the element's content.
  9667. Lang(v string) HTMLDiv
  9668. // Role specifies to parsing software the exact function of an element (and its children).
  9669. Role(v string) HTMLDiv
  9670. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  9671. Spellcheck(v bool) HTMLDiv
  9672. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  9673. Style(k, v string) HTMLDiv
  9674. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  9675. Styles(s map[string]string) HTMLDiv
  9676. // TabIndex specifies the tabbing order of an element.
  9677. TabIndex(v int) HTMLDiv
  9678. // Title specifies extra information about an element.
  9679. Title(v string) HTMLDiv
  9680. // On registers the given event handler to the specified event.
  9681. On(event string, h EventHandler, scope ...any) HTMLDiv
  9682. // OnBlur calls the given handler when the element loses focus.
  9683. OnBlur(h EventHandler, scope ...any) HTMLDiv
  9684. // OnChange calls the given handler when the value of the element is changed.
  9685. OnChange(h EventHandler, scope ...any) HTMLDiv
  9686. // OnClick calls the given handler when there is a mouse click on the element.
  9687. OnClick(h EventHandler, scope ...any) HTMLDiv
  9688. // OnContextMenu calls the given handler when a context menu is triggered.
  9689. OnContextMenu(h EventHandler, scope ...any) HTMLDiv
  9690. // OnCopy calls the given handler when the user copies the content of an element.
  9691. OnCopy(h EventHandler, scope ...any) HTMLDiv
  9692. // OnCut calls the given handler when the user cuts the content of an element.
  9693. OnCut(h EventHandler, scope ...any) HTMLDiv
  9694. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  9695. OnDblClick(h EventHandler, scope ...any) HTMLDiv
  9696. // OnDrag calls the given handler when an element is dragged.
  9697. OnDrag(h EventHandler, scope ...any) HTMLDiv
  9698. // OnDragEnd calls the given handler at the end of a drag operation.
  9699. OnDragEnd(h EventHandler, scope ...any) HTMLDiv
  9700. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  9701. OnDragEnter(h EventHandler, scope ...any) HTMLDiv
  9702. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  9703. OnDragLeave(h EventHandler, scope ...any) HTMLDiv
  9704. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  9705. OnDragOver(h EventHandler, scope ...any) HTMLDiv
  9706. // OnDragStart calls the given handler at the start of a drag operation.
  9707. OnDragStart(h EventHandler, scope ...any) HTMLDiv
  9708. // OnDrop calls the given handler when dragged element is being dropped.
  9709. OnDrop(h EventHandler, scope ...any) HTMLDiv
  9710. // OnFocus calls the given handler when the element gets focus.
  9711. OnFocus(h EventHandler, scope ...any) HTMLDiv
  9712. // OnInput calls the given handler when an element gets user input.
  9713. OnInput(h EventHandler, scope ...any) HTMLDiv
  9714. // OnInvalid calls the given handler when an element is invalid.
  9715. OnInvalid(h EventHandler, scope ...any) HTMLDiv
  9716. // OnKeyDown calls the given handler when a user is pressing a key.
  9717. OnKeyDown(h EventHandler, scope ...any) HTMLDiv
  9718. // OnKeyPress calls the given handler when a user presses a key.
  9719. OnKeyPress(h EventHandler, scope ...any) HTMLDiv
  9720. // OnKeyUp calls the given handler when a user releases a key.
  9721. OnKeyUp(h EventHandler, scope ...any) HTMLDiv
  9722. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  9723. OnMouseDown(h EventHandler, scope ...any) HTMLDiv
  9724. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  9725. OnMouseMove(h EventHandler, scope ...any) HTMLDiv
  9726. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  9727. OnMouseOut(h EventHandler, scope ...any) HTMLDiv
  9728. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  9729. OnMouseOver(h EventHandler, scope ...any) HTMLDiv
  9730. // OnMouseUp calls the given handler when a mouse button is released over an element.
  9731. OnMouseUp(h EventHandler, scope ...any) HTMLDiv
  9732. // OnPaste calls the given handler when the user pastes some content in an element.
  9733. OnPaste(h EventHandler, scope ...any) HTMLDiv
  9734. // OnReset calls the given handler when the Reset button in a form is clicked.
  9735. OnReset(h EventHandler, scope ...any) HTMLDiv
  9736. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  9737. OnScroll(h EventHandler, scope ...any) HTMLDiv
  9738. // OnSearch calls the given handler when the user writes something in a search field.
  9739. OnSearch(h EventHandler, scope ...any) HTMLDiv
  9740. // OnSelect calls the given handler after some text has been selected in an element.
  9741. OnSelect(h EventHandler, scope ...any) HTMLDiv
  9742. // OnSubmit calls the given handler when a form is submitted.
  9743. OnSubmit(h EventHandler, scope ...any) HTMLDiv
  9744. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  9745. OnWheel(h EventHandler, scope ...any) HTMLDiv
  9746. }
  9747. // Div returns an HTML element that defines a section in a document.
  9748. func Div() HTMLDiv {
  9749. e := &htmlDiv{
  9750. htmlElement: htmlElement{
  9751. tag: "div",
  9752. isSelfClosing: false,
  9753. },
  9754. }
  9755. return e
  9756. }
  9757. type htmlDiv struct {
  9758. htmlElement
  9759. }
  9760. func (e *htmlDiv) Body(v ...UI) HTMLDiv {
  9761. e.setChildren(v...)
  9762. return e
  9763. }
  9764. func (e *htmlDiv) Text(v any) HTMLDiv {
  9765. return e.Body(Text(v))
  9766. }
  9767. func (e *htmlDiv) AccessKey(v string) HTMLDiv {
  9768. e.setAttr("accesskey", v)
  9769. return e
  9770. }
  9771. func (e *htmlDiv) Aria(k string, v any) HTMLDiv {
  9772. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  9773. return e
  9774. }
  9775. func (e *htmlDiv) Attr(n string, v any) HTMLDiv {
  9776. e.setAttr(n, v)
  9777. return e
  9778. }
  9779. func (e *htmlDiv) Class(v ...string) HTMLDiv {
  9780. e.setAttr("class", strings.Join(v, " "))
  9781. return e
  9782. }
  9783. func (e *htmlDiv) ContentEditable(v bool) HTMLDiv {
  9784. e.setAttr("contenteditable", v)
  9785. return e
  9786. }
  9787. func (e *htmlDiv) DataSet(k string, v any) HTMLDiv {
  9788. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  9789. return e
  9790. }
  9791. func (e *htmlDiv) Dir(v string) HTMLDiv {
  9792. e.setAttr("dir", v)
  9793. return e
  9794. }
  9795. func (e *htmlDiv) Draggable(v bool) HTMLDiv {
  9796. e.setAttr("draggable", v)
  9797. return e
  9798. }
  9799. func (e *htmlDiv) Hidden(v bool) HTMLDiv {
  9800. e.setAttr("hidden", v)
  9801. return e
  9802. }
  9803. func (e *htmlDiv) ID(v string) HTMLDiv {
  9804. e.setAttr("id", v)
  9805. return e
  9806. }
  9807. func (e *htmlDiv) Lang(v string) HTMLDiv {
  9808. e.setAttr("lang", v)
  9809. return e
  9810. }
  9811. func (e *htmlDiv) Role(v string) HTMLDiv {
  9812. e.setAttr("role", v)
  9813. return e
  9814. }
  9815. func (e *htmlDiv) Spellcheck(v bool) HTMLDiv {
  9816. s := "false"
  9817. if v {
  9818. s = "true"
  9819. }
  9820. e.setAttr("spellcheck", s)
  9821. return e
  9822. }
  9823. func (e *htmlDiv) Style(k, v string) HTMLDiv {
  9824. e.setAttr("style", k+":"+v)
  9825. return e
  9826. }
  9827. func (e *htmlDiv) Styles(s map[string]string) HTMLDiv {
  9828. for k, v := range s {
  9829. e.Style(k, v)
  9830. }
  9831. return e
  9832. }
  9833. func (e *htmlDiv) TabIndex(v int) HTMLDiv {
  9834. e.setAttr("tabindex", v)
  9835. return e
  9836. }
  9837. func (e *htmlDiv) Title(v string) HTMLDiv {
  9838. e.setAttr("title", v)
  9839. return e
  9840. }
  9841. func (e *htmlDiv) On(event string, h EventHandler, scope ...any) HTMLDiv {
  9842. e.setEventHandler(event, h, scope...)
  9843. return e
  9844. }
  9845. func (e *htmlDiv) OnBlur(h EventHandler, scope ...any) HTMLDiv {
  9846. e.setEventHandler("blur", h, scope...)
  9847. return e
  9848. }
  9849. func (e *htmlDiv) OnChange(h EventHandler, scope ...any) HTMLDiv {
  9850. e.setEventHandler("change", h, scope...)
  9851. return e
  9852. }
  9853. func (e *htmlDiv) OnClick(h EventHandler, scope ...any) HTMLDiv {
  9854. e.setEventHandler("click", h, scope...)
  9855. return e
  9856. }
  9857. func (e *htmlDiv) OnContextMenu(h EventHandler, scope ...any) HTMLDiv {
  9858. e.setEventHandler("contextmenu", h, scope...)
  9859. return e
  9860. }
  9861. func (e *htmlDiv) OnCopy(h EventHandler, scope ...any) HTMLDiv {
  9862. e.setEventHandler("copy", h, scope...)
  9863. return e
  9864. }
  9865. func (e *htmlDiv) OnCut(h EventHandler, scope ...any) HTMLDiv {
  9866. e.setEventHandler("cut", h, scope...)
  9867. return e
  9868. }
  9869. func (e *htmlDiv) OnDblClick(h EventHandler, scope ...any) HTMLDiv {
  9870. e.setEventHandler("dblclick", h, scope...)
  9871. return e
  9872. }
  9873. func (e *htmlDiv) OnDrag(h EventHandler, scope ...any) HTMLDiv {
  9874. e.setEventHandler("drag", h, scope...)
  9875. return e
  9876. }
  9877. func (e *htmlDiv) OnDragEnd(h EventHandler, scope ...any) HTMLDiv {
  9878. e.setEventHandler("dragend", h, scope...)
  9879. return e
  9880. }
  9881. func (e *htmlDiv) OnDragEnter(h EventHandler, scope ...any) HTMLDiv {
  9882. e.setEventHandler("dragenter", h, scope...)
  9883. return e
  9884. }
  9885. func (e *htmlDiv) OnDragLeave(h EventHandler, scope ...any) HTMLDiv {
  9886. e.setEventHandler("dragleave", h, scope...)
  9887. return e
  9888. }
  9889. func (e *htmlDiv) OnDragOver(h EventHandler, scope ...any) HTMLDiv {
  9890. e.setEventHandler("dragover", h, scope...)
  9891. return e
  9892. }
  9893. func (e *htmlDiv) OnDragStart(h EventHandler, scope ...any) HTMLDiv {
  9894. e.setEventHandler("dragstart", h, scope...)
  9895. return e
  9896. }
  9897. func (e *htmlDiv) OnDrop(h EventHandler, scope ...any) HTMLDiv {
  9898. e.setEventHandler("drop", h, scope...)
  9899. return e
  9900. }
  9901. func (e *htmlDiv) OnFocus(h EventHandler, scope ...any) HTMLDiv {
  9902. e.setEventHandler("focus", h, scope...)
  9903. return e
  9904. }
  9905. func (e *htmlDiv) OnInput(h EventHandler, scope ...any) HTMLDiv {
  9906. e.setEventHandler("input", h, scope...)
  9907. return e
  9908. }
  9909. func (e *htmlDiv) OnInvalid(h EventHandler, scope ...any) HTMLDiv {
  9910. e.setEventHandler("invalid", h, scope...)
  9911. return e
  9912. }
  9913. func (e *htmlDiv) OnKeyDown(h EventHandler, scope ...any) HTMLDiv {
  9914. e.setEventHandler("keydown", h, scope...)
  9915. return e
  9916. }
  9917. func (e *htmlDiv) OnKeyPress(h EventHandler, scope ...any) HTMLDiv {
  9918. e.setEventHandler("keypress", h, scope...)
  9919. return e
  9920. }
  9921. func (e *htmlDiv) OnKeyUp(h EventHandler, scope ...any) HTMLDiv {
  9922. e.setEventHandler("keyup", h, scope...)
  9923. return e
  9924. }
  9925. func (e *htmlDiv) OnMouseDown(h EventHandler, scope ...any) HTMLDiv {
  9926. e.setEventHandler("mousedown", h, scope...)
  9927. return e
  9928. }
  9929. func (e *htmlDiv) OnMouseMove(h EventHandler, scope ...any) HTMLDiv {
  9930. e.setEventHandler("mousemove", h, scope...)
  9931. return e
  9932. }
  9933. func (e *htmlDiv) OnMouseOut(h EventHandler, scope ...any) HTMLDiv {
  9934. e.setEventHandler("mouseout", h, scope...)
  9935. return e
  9936. }
  9937. func (e *htmlDiv) OnMouseOver(h EventHandler, scope ...any) HTMLDiv {
  9938. e.setEventHandler("mouseover", h, scope...)
  9939. return e
  9940. }
  9941. func (e *htmlDiv) OnMouseUp(h EventHandler, scope ...any) HTMLDiv {
  9942. e.setEventHandler("mouseup", h, scope...)
  9943. return e
  9944. }
  9945. func (e *htmlDiv) OnPaste(h EventHandler, scope ...any) HTMLDiv {
  9946. e.setEventHandler("paste", h, scope...)
  9947. return e
  9948. }
  9949. func (e *htmlDiv) OnReset(h EventHandler, scope ...any) HTMLDiv {
  9950. e.setEventHandler("reset", h, scope...)
  9951. return e
  9952. }
  9953. func (e *htmlDiv) OnScroll(h EventHandler, scope ...any) HTMLDiv {
  9954. e.setEventHandler("scroll", h, scope...)
  9955. return e
  9956. }
  9957. func (e *htmlDiv) OnSearch(h EventHandler, scope ...any) HTMLDiv {
  9958. e.setEventHandler("search", h, scope...)
  9959. return e
  9960. }
  9961. func (e *htmlDiv) OnSelect(h EventHandler, scope ...any) HTMLDiv {
  9962. e.setEventHandler("select", h, scope...)
  9963. return e
  9964. }
  9965. func (e *htmlDiv) OnSubmit(h EventHandler, scope ...any) HTMLDiv {
  9966. e.setEventHandler("submit", h, scope...)
  9967. return e
  9968. }
  9969. func (e *htmlDiv) OnWheel(h EventHandler, scope ...any) HTMLDiv {
  9970. e.setEventHandler("wheel", h, scope...)
  9971. return e
  9972. }
  9973. // HTMLDl is the interface that describes a "dl" HTML element.
  9974. type HTMLDl interface {
  9975. UI
  9976. // Body set the content of the element.
  9977. Body(elems ...UI) HTMLDl
  9978. // Text sets the content of the element with a text node containing the stringified given value.
  9979. Text(v any) HTMLDl
  9980. // AccessKey specifies a shortcut key to activate/focus an element.
  9981. AccessKey(v string) HTMLDl
  9982. // Aria stores accessible rich internet applications (ARIA) data.
  9983. Aria(k string, v any) HTMLDl
  9984. // Attr sets the named attribute with the given value.
  9985. Attr(n string, v any) HTMLDl
  9986. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  9987. Class(v ...string) HTMLDl
  9988. // ContentEditable specifies whether the content of an element is editable or not.
  9989. ContentEditable(v bool) HTMLDl
  9990. // DataSet stores custom data private to the page or application.
  9991. DataSet(k string, v any) HTMLDl
  9992. // Dir specifies the text direction for the content in an element.
  9993. Dir(v string) HTMLDl
  9994. // Draggable specifies whether an element is draggable or not.
  9995. Draggable(v bool) HTMLDl
  9996. // Hidden specifies that an element is not yet, or is no longer relevant.
  9997. Hidden(v bool) HTMLDl
  9998. // ID specifies a unique id for an element.
  9999. ID(v string) HTMLDl
  10000. // Lang specifies the language of the element's content.
  10001. Lang(v string) HTMLDl
  10002. // Role specifies to parsing software the exact function of an element (and its children).
  10003. Role(v string) HTMLDl
  10004. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  10005. Spellcheck(v bool) HTMLDl
  10006. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  10007. Style(k, v string) HTMLDl
  10008. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  10009. Styles(s map[string]string) HTMLDl
  10010. // TabIndex specifies the tabbing order of an element.
  10011. TabIndex(v int) HTMLDl
  10012. // Title specifies extra information about an element.
  10013. Title(v string) HTMLDl
  10014. // On registers the given event handler to the specified event.
  10015. On(event string, h EventHandler, scope ...any) HTMLDl
  10016. // OnBlur calls the given handler when the element loses focus.
  10017. OnBlur(h EventHandler, scope ...any) HTMLDl
  10018. // OnChange calls the given handler when the value of the element is changed.
  10019. OnChange(h EventHandler, scope ...any) HTMLDl
  10020. // OnClick calls the given handler when there is a mouse click on the element.
  10021. OnClick(h EventHandler, scope ...any) HTMLDl
  10022. // OnContextMenu calls the given handler when a context menu is triggered.
  10023. OnContextMenu(h EventHandler, scope ...any) HTMLDl
  10024. // OnCopy calls the given handler when the user copies the content of an element.
  10025. OnCopy(h EventHandler, scope ...any) HTMLDl
  10026. // OnCut calls the given handler when the user cuts the content of an element.
  10027. OnCut(h EventHandler, scope ...any) HTMLDl
  10028. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  10029. OnDblClick(h EventHandler, scope ...any) HTMLDl
  10030. // OnDrag calls the given handler when an element is dragged.
  10031. OnDrag(h EventHandler, scope ...any) HTMLDl
  10032. // OnDragEnd calls the given handler at the end of a drag operation.
  10033. OnDragEnd(h EventHandler, scope ...any) HTMLDl
  10034. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  10035. OnDragEnter(h EventHandler, scope ...any) HTMLDl
  10036. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  10037. OnDragLeave(h EventHandler, scope ...any) HTMLDl
  10038. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  10039. OnDragOver(h EventHandler, scope ...any) HTMLDl
  10040. // OnDragStart calls the given handler at the start of a drag operation.
  10041. OnDragStart(h EventHandler, scope ...any) HTMLDl
  10042. // OnDrop calls the given handler when dragged element is being dropped.
  10043. OnDrop(h EventHandler, scope ...any) HTMLDl
  10044. // OnFocus calls the given handler when the element gets focus.
  10045. OnFocus(h EventHandler, scope ...any) HTMLDl
  10046. // OnInput calls the given handler when an element gets user input.
  10047. OnInput(h EventHandler, scope ...any) HTMLDl
  10048. // OnInvalid calls the given handler when an element is invalid.
  10049. OnInvalid(h EventHandler, scope ...any) HTMLDl
  10050. // OnKeyDown calls the given handler when a user is pressing a key.
  10051. OnKeyDown(h EventHandler, scope ...any) HTMLDl
  10052. // OnKeyPress calls the given handler when a user presses a key.
  10053. OnKeyPress(h EventHandler, scope ...any) HTMLDl
  10054. // OnKeyUp calls the given handler when a user releases a key.
  10055. OnKeyUp(h EventHandler, scope ...any) HTMLDl
  10056. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  10057. OnMouseDown(h EventHandler, scope ...any) HTMLDl
  10058. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  10059. OnMouseMove(h EventHandler, scope ...any) HTMLDl
  10060. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  10061. OnMouseOut(h EventHandler, scope ...any) HTMLDl
  10062. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  10063. OnMouseOver(h EventHandler, scope ...any) HTMLDl
  10064. // OnMouseUp calls the given handler when a mouse button is released over an element.
  10065. OnMouseUp(h EventHandler, scope ...any) HTMLDl
  10066. // OnPaste calls the given handler when the user pastes some content in an element.
  10067. OnPaste(h EventHandler, scope ...any) HTMLDl
  10068. // OnReset calls the given handler when the Reset button in a form is clicked.
  10069. OnReset(h EventHandler, scope ...any) HTMLDl
  10070. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  10071. OnScroll(h EventHandler, scope ...any) HTMLDl
  10072. // OnSearch calls the given handler when the user writes something in a search field.
  10073. OnSearch(h EventHandler, scope ...any) HTMLDl
  10074. // OnSelect calls the given handler after some text has been selected in an element.
  10075. OnSelect(h EventHandler, scope ...any) HTMLDl
  10076. // OnSubmit calls the given handler when a form is submitted.
  10077. OnSubmit(h EventHandler, scope ...any) HTMLDl
  10078. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  10079. OnWheel(h EventHandler, scope ...any) HTMLDl
  10080. }
  10081. // Dl returns an HTML element that defines a description list.
  10082. func Dl() HTMLDl {
  10083. e := &htmlDl{
  10084. htmlElement: htmlElement{
  10085. tag: "dl",
  10086. isSelfClosing: false,
  10087. },
  10088. }
  10089. return e
  10090. }
  10091. type htmlDl struct {
  10092. htmlElement
  10093. }
  10094. func (e *htmlDl) Body(v ...UI) HTMLDl {
  10095. e.setChildren(v...)
  10096. return e
  10097. }
  10098. func (e *htmlDl) Text(v any) HTMLDl {
  10099. return e.Body(Text(v))
  10100. }
  10101. func (e *htmlDl) AccessKey(v string) HTMLDl {
  10102. e.setAttr("accesskey", v)
  10103. return e
  10104. }
  10105. func (e *htmlDl) Aria(k string, v any) HTMLDl {
  10106. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  10107. return e
  10108. }
  10109. func (e *htmlDl) Attr(n string, v any) HTMLDl {
  10110. e.setAttr(n, v)
  10111. return e
  10112. }
  10113. func (e *htmlDl) Class(v ...string) HTMLDl {
  10114. e.setAttr("class", strings.Join(v, " "))
  10115. return e
  10116. }
  10117. func (e *htmlDl) ContentEditable(v bool) HTMLDl {
  10118. e.setAttr("contenteditable", v)
  10119. return e
  10120. }
  10121. func (e *htmlDl) DataSet(k string, v any) HTMLDl {
  10122. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  10123. return e
  10124. }
  10125. func (e *htmlDl) Dir(v string) HTMLDl {
  10126. e.setAttr("dir", v)
  10127. return e
  10128. }
  10129. func (e *htmlDl) Draggable(v bool) HTMLDl {
  10130. e.setAttr("draggable", v)
  10131. return e
  10132. }
  10133. func (e *htmlDl) Hidden(v bool) HTMLDl {
  10134. e.setAttr("hidden", v)
  10135. return e
  10136. }
  10137. func (e *htmlDl) ID(v string) HTMLDl {
  10138. e.setAttr("id", v)
  10139. return e
  10140. }
  10141. func (e *htmlDl) Lang(v string) HTMLDl {
  10142. e.setAttr("lang", v)
  10143. return e
  10144. }
  10145. func (e *htmlDl) Role(v string) HTMLDl {
  10146. e.setAttr("role", v)
  10147. return e
  10148. }
  10149. func (e *htmlDl) Spellcheck(v bool) HTMLDl {
  10150. s := "false"
  10151. if v {
  10152. s = "true"
  10153. }
  10154. e.setAttr("spellcheck", s)
  10155. return e
  10156. }
  10157. func (e *htmlDl) Style(k, v string) HTMLDl {
  10158. e.setAttr("style", k+":"+v)
  10159. return e
  10160. }
  10161. func (e *htmlDl) Styles(s map[string]string) HTMLDl {
  10162. for k, v := range s {
  10163. e.Style(k, v)
  10164. }
  10165. return e
  10166. }
  10167. func (e *htmlDl) TabIndex(v int) HTMLDl {
  10168. e.setAttr("tabindex", v)
  10169. return e
  10170. }
  10171. func (e *htmlDl) Title(v string) HTMLDl {
  10172. e.setAttr("title", v)
  10173. return e
  10174. }
  10175. func (e *htmlDl) On(event string, h EventHandler, scope ...any) HTMLDl {
  10176. e.setEventHandler(event, h, scope...)
  10177. return e
  10178. }
  10179. func (e *htmlDl) OnBlur(h EventHandler, scope ...any) HTMLDl {
  10180. e.setEventHandler("blur", h, scope...)
  10181. return e
  10182. }
  10183. func (e *htmlDl) OnChange(h EventHandler, scope ...any) HTMLDl {
  10184. e.setEventHandler("change", h, scope...)
  10185. return e
  10186. }
  10187. func (e *htmlDl) OnClick(h EventHandler, scope ...any) HTMLDl {
  10188. e.setEventHandler("click", h, scope...)
  10189. return e
  10190. }
  10191. func (e *htmlDl) OnContextMenu(h EventHandler, scope ...any) HTMLDl {
  10192. e.setEventHandler("contextmenu", h, scope...)
  10193. return e
  10194. }
  10195. func (e *htmlDl) OnCopy(h EventHandler, scope ...any) HTMLDl {
  10196. e.setEventHandler("copy", h, scope...)
  10197. return e
  10198. }
  10199. func (e *htmlDl) OnCut(h EventHandler, scope ...any) HTMLDl {
  10200. e.setEventHandler("cut", h, scope...)
  10201. return e
  10202. }
  10203. func (e *htmlDl) OnDblClick(h EventHandler, scope ...any) HTMLDl {
  10204. e.setEventHandler("dblclick", h, scope...)
  10205. return e
  10206. }
  10207. func (e *htmlDl) OnDrag(h EventHandler, scope ...any) HTMLDl {
  10208. e.setEventHandler("drag", h, scope...)
  10209. return e
  10210. }
  10211. func (e *htmlDl) OnDragEnd(h EventHandler, scope ...any) HTMLDl {
  10212. e.setEventHandler("dragend", h, scope...)
  10213. return e
  10214. }
  10215. func (e *htmlDl) OnDragEnter(h EventHandler, scope ...any) HTMLDl {
  10216. e.setEventHandler("dragenter", h, scope...)
  10217. return e
  10218. }
  10219. func (e *htmlDl) OnDragLeave(h EventHandler, scope ...any) HTMLDl {
  10220. e.setEventHandler("dragleave", h, scope...)
  10221. return e
  10222. }
  10223. func (e *htmlDl) OnDragOver(h EventHandler, scope ...any) HTMLDl {
  10224. e.setEventHandler("dragover", h, scope...)
  10225. return e
  10226. }
  10227. func (e *htmlDl) OnDragStart(h EventHandler, scope ...any) HTMLDl {
  10228. e.setEventHandler("dragstart", h, scope...)
  10229. return e
  10230. }
  10231. func (e *htmlDl) OnDrop(h EventHandler, scope ...any) HTMLDl {
  10232. e.setEventHandler("drop", h, scope...)
  10233. return e
  10234. }
  10235. func (e *htmlDl) OnFocus(h EventHandler, scope ...any) HTMLDl {
  10236. e.setEventHandler("focus", h, scope...)
  10237. return e
  10238. }
  10239. func (e *htmlDl) OnInput(h EventHandler, scope ...any) HTMLDl {
  10240. e.setEventHandler("input", h, scope...)
  10241. return e
  10242. }
  10243. func (e *htmlDl) OnInvalid(h EventHandler, scope ...any) HTMLDl {
  10244. e.setEventHandler("invalid", h, scope...)
  10245. return e
  10246. }
  10247. func (e *htmlDl) OnKeyDown(h EventHandler, scope ...any) HTMLDl {
  10248. e.setEventHandler("keydown", h, scope...)
  10249. return e
  10250. }
  10251. func (e *htmlDl) OnKeyPress(h EventHandler, scope ...any) HTMLDl {
  10252. e.setEventHandler("keypress", h, scope...)
  10253. return e
  10254. }
  10255. func (e *htmlDl) OnKeyUp(h EventHandler, scope ...any) HTMLDl {
  10256. e.setEventHandler("keyup", h, scope...)
  10257. return e
  10258. }
  10259. func (e *htmlDl) OnMouseDown(h EventHandler, scope ...any) HTMLDl {
  10260. e.setEventHandler("mousedown", h, scope...)
  10261. return e
  10262. }
  10263. func (e *htmlDl) OnMouseMove(h EventHandler, scope ...any) HTMLDl {
  10264. e.setEventHandler("mousemove", h, scope...)
  10265. return e
  10266. }
  10267. func (e *htmlDl) OnMouseOut(h EventHandler, scope ...any) HTMLDl {
  10268. e.setEventHandler("mouseout", h, scope...)
  10269. return e
  10270. }
  10271. func (e *htmlDl) OnMouseOver(h EventHandler, scope ...any) HTMLDl {
  10272. e.setEventHandler("mouseover", h, scope...)
  10273. return e
  10274. }
  10275. func (e *htmlDl) OnMouseUp(h EventHandler, scope ...any) HTMLDl {
  10276. e.setEventHandler("mouseup", h, scope...)
  10277. return e
  10278. }
  10279. func (e *htmlDl) OnPaste(h EventHandler, scope ...any) HTMLDl {
  10280. e.setEventHandler("paste", h, scope...)
  10281. return e
  10282. }
  10283. func (e *htmlDl) OnReset(h EventHandler, scope ...any) HTMLDl {
  10284. e.setEventHandler("reset", h, scope...)
  10285. return e
  10286. }
  10287. func (e *htmlDl) OnScroll(h EventHandler, scope ...any) HTMLDl {
  10288. e.setEventHandler("scroll", h, scope...)
  10289. return e
  10290. }
  10291. func (e *htmlDl) OnSearch(h EventHandler, scope ...any) HTMLDl {
  10292. e.setEventHandler("search", h, scope...)
  10293. return e
  10294. }
  10295. func (e *htmlDl) OnSelect(h EventHandler, scope ...any) HTMLDl {
  10296. e.setEventHandler("select", h, scope...)
  10297. return e
  10298. }
  10299. func (e *htmlDl) OnSubmit(h EventHandler, scope ...any) HTMLDl {
  10300. e.setEventHandler("submit", h, scope...)
  10301. return e
  10302. }
  10303. func (e *htmlDl) OnWheel(h EventHandler, scope ...any) HTMLDl {
  10304. e.setEventHandler("wheel", h, scope...)
  10305. return e
  10306. }
  10307. // HTMLDt is the interface that describes a "dt" HTML element.
  10308. type HTMLDt interface {
  10309. UI
  10310. // Body set the content of the element.
  10311. Body(elems ...UI) HTMLDt
  10312. // Text sets the content of the element with a text node containing the stringified given value.
  10313. Text(v any) HTMLDt
  10314. // AccessKey specifies a shortcut key to activate/focus an element.
  10315. AccessKey(v string) HTMLDt
  10316. // Aria stores accessible rich internet applications (ARIA) data.
  10317. Aria(k string, v any) HTMLDt
  10318. // Attr sets the named attribute with the given value.
  10319. Attr(n string, v any) HTMLDt
  10320. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  10321. Class(v ...string) HTMLDt
  10322. // ContentEditable specifies whether the content of an element is editable or not.
  10323. ContentEditable(v bool) HTMLDt
  10324. // DataSet stores custom data private to the page or application.
  10325. DataSet(k string, v any) HTMLDt
  10326. // Dir specifies the text direction for the content in an element.
  10327. Dir(v string) HTMLDt
  10328. // Draggable specifies whether an element is draggable or not.
  10329. Draggable(v bool) HTMLDt
  10330. // Hidden specifies that an element is not yet, or is no longer relevant.
  10331. Hidden(v bool) HTMLDt
  10332. // ID specifies a unique id for an element.
  10333. ID(v string) HTMLDt
  10334. // Lang specifies the language of the element's content.
  10335. Lang(v string) HTMLDt
  10336. // Role specifies to parsing software the exact function of an element (and its children).
  10337. Role(v string) HTMLDt
  10338. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  10339. Spellcheck(v bool) HTMLDt
  10340. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  10341. Style(k, v string) HTMLDt
  10342. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  10343. Styles(s map[string]string) HTMLDt
  10344. // TabIndex specifies the tabbing order of an element.
  10345. TabIndex(v int) HTMLDt
  10346. // Title specifies extra information about an element.
  10347. Title(v string) HTMLDt
  10348. // On registers the given event handler to the specified event.
  10349. On(event string, h EventHandler, scope ...any) HTMLDt
  10350. // OnBlur calls the given handler when the element loses focus.
  10351. OnBlur(h EventHandler, scope ...any) HTMLDt
  10352. // OnChange calls the given handler when the value of the element is changed.
  10353. OnChange(h EventHandler, scope ...any) HTMLDt
  10354. // OnClick calls the given handler when there is a mouse click on the element.
  10355. OnClick(h EventHandler, scope ...any) HTMLDt
  10356. // OnContextMenu calls the given handler when a context menu is triggered.
  10357. OnContextMenu(h EventHandler, scope ...any) HTMLDt
  10358. // OnCopy calls the given handler when the user copies the content of an element.
  10359. OnCopy(h EventHandler, scope ...any) HTMLDt
  10360. // OnCut calls the given handler when the user cuts the content of an element.
  10361. OnCut(h EventHandler, scope ...any) HTMLDt
  10362. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  10363. OnDblClick(h EventHandler, scope ...any) HTMLDt
  10364. // OnDrag calls the given handler when an element is dragged.
  10365. OnDrag(h EventHandler, scope ...any) HTMLDt
  10366. // OnDragEnd calls the given handler at the end of a drag operation.
  10367. OnDragEnd(h EventHandler, scope ...any) HTMLDt
  10368. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  10369. OnDragEnter(h EventHandler, scope ...any) HTMLDt
  10370. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  10371. OnDragLeave(h EventHandler, scope ...any) HTMLDt
  10372. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  10373. OnDragOver(h EventHandler, scope ...any) HTMLDt
  10374. // OnDragStart calls the given handler at the start of a drag operation.
  10375. OnDragStart(h EventHandler, scope ...any) HTMLDt
  10376. // OnDrop calls the given handler when dragged element is being dropped.
  10377. OnDrop(h EventHandler, scope ...any) HTMLDt
  10378. // OnFocus calls the given handler when the element gets focus.
  10379. OnFocus(h EventHandler, scope ...any) HTMLDt
  10380. // OnInput calls the given handler when an element gets user input.
  10381. OnInput(h EventHandler, scope ...any) HTMLDt
  10382. // OnInvalid calls the given handler when an element is invalid.
  10383. OnInvalid(h EventHandler, scope ...any) HTMLDt
  10384. // OnKeyDown calls the given handler when a user is pressing a key.
  10385. OnKeyDown(h EventHandler, scope ...any) HTMLDt
  10386. // OnKeyPress calls the given handler when a user presses a key.
  10387. OnKeyPress(h EventHandler, scope ...any) HTMLDt
  10388. // OnKeyUp calls the given handler when a user releases a key.
  10389. OnKeyUp(h EventHandler, scope ...any) HTMLDt
  10390. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  10391. OnMouseDown(h EventHandler, scope ...any) HTMLDt
  10392. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  10393. OnMouseMove(h EventHandler, scope ...any) HTMLDt
  10394. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  10395. OnMouseOut(h EventHandler, scope ...any) HTMLDt
  10396. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  10397. OnMouseOver(h EventHandler, scope ...any) HTMLDt
  10398. // OnMouseUp calls the given handler when a mouse button is released over an element.
  10399. OnMouseUp(h EventHandler, scope ...any) HTMLDt
  10400. // OnPaste calls the given handler when the user pastes some content in an element.
  10401. OnPaste(h EventHandler, scope ...any) HTMLDt
  10402. // OnReset calls the given handler when the Reset button in a form is clicked.
  10403. OnReset(h EventHandler, scope ...any) HTMLDt
  10404. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  10405. OnScroll(h EventHandler, scope ...any) HTMLDt
  10406. // OnSearch calls the given handler when the user writes something in a search field.
  10407. OnSearch(h EventHandler, scope ...any) HTMLDt
  10408. // OnSelect calls the given handler after some text has been selected in an element.
  10409. OnSelect(h EventHandler, scope ...any) HTMLDt
  10410. // OnSubmit calls the given handler when a form is submitted.
  10411. OnSubmit(h EventHandler, scope ...any) HTMLDt
  10412. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  10413. OnWheel(h EventHandler, scope ...any) HTMLDt
  10414. }
  10415. // Dt returns an HTML element that defines a term/name in a description list.
  10416. func Dt() HTMLDt {
  10417. e := &htmlDt{
  10418. htmlElement: htmlElement{
  10419. tag: "dt",
  10420. isSelfClosing: false,
  10421. },
  10422. }
  10423. return e
  10424. }
  10425. type htmlDt struct {
  10426. htmlElement
  10427. }
  10428. func (e *htmlDt) Body(v ...UI) HTMLDt {
  10429. e.setChildren(v...)
  10430. return e
  10431. }
  10432. func (e *htmlDt) Text(v any) HTMLDt {
  10433. return e.Body(Text(v))
  10434. }
  10435. func (e *htmlDt) AccessKey(v string) HTMLDt {
  10436. e.setAttr("accesskey", v)
  10437. return e
  10438. }
  10439. func (e *htmlDt) Aria(k string, v any) HTMLDt {
  10440. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  10441. return e
  10442. }
  10443. func (e *htmlDt) Attr(n string, v any) HTMLDt {
  10444. e.setAttr(n, v)
  10445. return e
  10446. }
  10447. func (e *htmlDt) Class(v ...string) HTMLDt {
  10448. e.setAttr("class", strings.Join(v, " "))
  10449. return e
  10450. }
  10451. func (e *htmlDt) ContentEditable(v bool) HTMLDt {
  10452. e.setAttr("contenteditable", v)
  10453. return e
  10454. }
  10455. func (e *htmlDt) DataSet(k string, v any) HTMLDt {
  10456. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  10457. return e
  10458. }
  10459. func (e *htmlDt) Dir(v string) HTMLDt {
  10460. e.setAttr("dir", v)
  10461. return e
  10462. }
  10463. func (e *htmlDt) Draggable(v bool) HTMLDt {
  10464. e.setAttr("draggable", v)
  10465. return e
  10466. }
  10467. func (e *htmlDt) Hidden(v bool) HTMLDt {
  10468. e.setAttr("hidden", v)
  10469. return e
  10470. }
  10471. func (e *htmlDt) ID(v string) HTMLDt {
  10472. e.setAttr("id", v)
  10473. return e
  10474. }
  10475. func (e *htmlDt) Lang(v string) HTMLDt {
  10476. e.setAttr("lang", v)
  10477. return e
  10478. }
  10479. func (e *htmlDt) Role(v string) HTMLDt {
  10480. e.setAttr("role", v)
  10481. return e
  10482. }
  10483. func (e *htmlDt) Spellcheck(v bool) HTMLDt {
  10484. s := "false"
  10485. if v {
  10486. s = "true"
  10487. }
  10488. e.setAttr("spellcheck", s)
  10489. return e
  10490. }
  10491. func (e *htmlDt) Style(k, v string) HTMLDt {
  10492. e.setAttr("style", k+":"+v)
  10493. return e
  10494. }
  10495. func (e *htmlDt) Styles(s map[string]string) HTMLDt {
  10496. for k, v := range s {
  10497. e.Style(k, v)
  10498. }
  10499. return e
  10500. }
  10501. func (e *htmlDt) TabIndex(v int) HTMLDt {
  10502. e.setAttr("tabindex", v)
  10503. return e
  10504. }
  10505. func (e *htmlDt) Title(v string) HTMLDt {
  10506. e.setAttr("title", v)
  10507. return e
  10508. }
  10509. func (e *htmlDt) On(event string, h EventHandler, scope ...any) HTMLDt {
  10510. e.setEventHandler(event, h, scope...)
  10511. return e
  10512. }
  10513. func (e *htmlDt) OnBlur(h EventHandler, scope ...any) HTMLDt {
  10514. e.setEventHandler("blur", h, scope...)
  10515. return e
  10516. }
  10517. func (e *htmlDt) OnChange(h EventHandler, scope ...any) HTMLDt {
  10518. e.setEventHandler("change", h, scope...)
  10519. return e
  10520. }
  10521. func (e *htmlDt) OnClick(h EventHandler, scope ...any) HTMLDt {
  10522. e.setEventHandler("click", h, scope...)
  10523. return e
  10524. }
  10525. func (e *htmlDt) OnContextMenu(h EventHandler, scope ...any) HTMLDt {
  10526. e.setEventHandler("contextmenu", h, scope...)
  10527. return e
  10528. }
  10529. func (e *htmlDt) OnCopy(h EventHandler, scope ...any) HTMLDt {
  10530. e.setEventHandler("copy", h, scope...)
  10531. return e
  10532. }
  10533. func (e *htmlDt) OnCut(h EventHandler, scope ...any) HTMLDt {
  10534. e.setEventHandler("cut", h, scope...)
  10535. return e
  10536. }
  10537. func (e *htmlDt) OnDblClick(h EventHandler, scope ...any) HTMLDt {
  10538. e.setEventHandler("dblclick", h, scope...)
  10539. return e
  10540. }
  10541. func (e *htmlDt) OnDrag(h EventHandler, scope ...any) HTMLDt {
  10542. e.setEventHandler("drag", h, scope...)
  10543. return e
  10544. }
  10545. func (e *htmlDt) OnDragEnd(h EventHandler, scope ...any) HTMLDt {
  10546. e.setEventHandler("dragend", h, scope...)
  10547. return e
  10548. }
  10549. func (e *htmlDt) OnDragEnter(h EventHandler, scope ...any) HTMLDt {
  10550. e.setEventHandler("dragenter", h, scope...)
  10551. return e
  10552. }
  10553. func (e *htmlDt) OnDragLeave(h EventHandler, scope ...any) HTMLDt {
  10554. e.setEventHandler("dragleave", h, scope...)
  10555. return e
  10556. }
  10557. func (e *htmlDt) OnDragOver(h EventHandler, scope ...any) HTMLDt {
  10558. e.setEventHandler("dragover", h, scope...)
  10559. return e
  10560. }
  10561. func (e *htmlDt) OnDragStart(h EventHandler, scope ...any) HTMLDt {
  10562. e.setEventHandler("dragstart", h, scope...)
  10563. return e
  10564. }
  10565. func (e *htmlDt) OnDrop(h EventHandler, scope ...any) HTMLDt {
  10566. e.setEventHandler("drop", h, scope...)
  10567. return e
  10568. }
  10569. func (e *htmlDt) OnFocus(h EventHandler, scope ...any) HTMLDt {
  10570. e.setEventHandler("focus", h, scope...)
  10571. return e
  10572. }
  10573. func (e *htmlDt) OnInput(h EventHandler, scope ...any) HTMLDt {
  10574. e.setEventHandler("input", h, scope...)
  10575. return e
  10576. }
  10577. func (e *htmlDt) OnInvalid(h EventHandler, scope ...any) HTMLDt {
  10578. e.setEventHandler("invalid", h, scope...)
  10579. return e
  10580. }
  10581. func (e *htmlDt) OnKeyDown(h EventHandler, scope ...any) HTMLDt {
  10582. e.setEventHandler("keydown", h, scope...)
  10583. return e
  10584. }
  10585. func (e *htmlDt) OnKeyPress(h EventHandler, scope ...any) HTMLDt {
  10586. e.setEventHandler("keypress", h, scope...)
  10587. return e
  10588. }
  10589. func (e *htmlDt) OnKeyUp(h EventHandler, scope ...any) HTMLDt {
  10590. e.setEventHandler("keyup", h, scope...)
  10591. return e
  10592. }
  10593. func (e *htmlDt) OnMouseDown(h EventHandler, scope ...any) HTMLDt {
  10594. e.setEventHandler("mousedown", h, scope...)
  10595. return e
  10596. }
  10597. func (e *htmlDt) OnMouseMove(h EventHandler, scope ...any) HTMLDt {
  10598. e.setEventHandler("mousemove", h, scope...)
  10599. return e
  10600. }
  10601. func (e *htmlDt) OnMouseOut(h EventHandler, scope ...any) HTMLDt {
  10602. e.setEventHandler("mouseout", h, scope...)
  10603. return e
  10604. }
  10605. func (e *htmlDt) OnMouseOver(h EventHandler, scope ...any) HTMLDt {
  10606. e.setEventHandler("mouseover", h, scope...)
  10607. return e
  10608. }
  10609. func (e *htmlDt) OnMouseUp(h EventHandler, scope ...any) HTMLDt {
  10610. e.setEventHandler("mouseup", h, scope...)
  10611. return e
  10612. }
  10613. func (e *htmlDt) OnPaste(h EventHandler, scope ...any) HTMLDt {
  10614. e.setEventHandler("paste", h, scope...)
  10615. return e
  10616. }
  10617. func (e *htmlDt) OnReset(h EventHandler, scope ...any) HTMLDt {
  10618. e.setEventHandler("reset", h, scope...)
  10619. return e
  10620. }
  10621. func (e *htmlDt) OnScroll(h EventHandler, scope ...any) HTMLDt {
  10622. e.setEventHandler("scroll", h, scope...)
  10623. return e
  10624. }
  10625. func (e *htmlDt) OnSearch(h EventHandler, scope ...any) HTMLDt {
  10626. e.setEventHandler("search", h, scope...)
  10627. return e
  10628. }
  10629. func (e *htmlDt) OnSelect(h EventHandler, scope ...any) HTMLDt {
  10630. e.setEventHandler("select", h, scope...)
  10631. return e
  10632. }
  10633. func (e *htmlDt) OnSubmit(h EventHandler, scope ...any) HTMLDt {
  10634. e.setEventHandler("submit", h, scope...)
  10635. return e
  10636. }
  10637. func (e *htmlDt) OnWheel(h EventHandler, scope ...any) HTMLDt {
  10638. e.setEventHandler("wheel", h, scope...)
  10639. return e
  10640. }
  10641. // HTMLElem is the interface that describes a "elem" HTML element.
  10642. type HTMLElem interface {
  10643. UI
  10644. // Body set the content of the element.
  10645. Body(elems ...UI) HTMLElem
  10646. // Text sets the content of the element with a text node containing the stringified given value.
  10647. Text(v any) HTMLElem
  10648. // AccessKey specifies a shortcut key to activate/focus an element.
  10649. AccessKey(v string) HTMLElem
  10650. // Aria stores accessible rich internet applications (ARIA) data.
  10651. Aria(k string, v any) HTMLElem
  10652. // Attr sets the named attribute with the given value.
  10653. Attr(n string, v any) HTMLElem
  10654. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  10655. Class(v ...string) HTMLElem
  10656. // ContentEditable specifies whether the content of an element is editable or not.
  10657. ContentEditable(v bool) HTMLElem
  10658. // DataSet stores custom data private to the page or application.
  10659. DataSet(k string, v any) HTMLElem
  10660. // Dir specifies the text direction for the content in an element.
  10661. Dir(v string) HTMLElem
  10662. // Draggable specifies whether an element is draggable or not.
  10663. Draggable(v bool) HTMLElem
  10664. // Hidden specifies that an element is not yet, or is no longer relevant.
  10665. Hidden(v bool) HTMLElem
  10666. // ID specifies a unique id for an element.
  10667. ID(v string) HTMLElem
  10668. // Lang specifies the language of the element's content.
  10669. Lang(v string) HTMLElem
  10670. // Role specifies to parsing software the exact function of an element (and its children).
  10671. Role(v string) HTMLElem
  10672. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  10673. Spellcheck(v bool) HTMLElem
  10674. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  10675. Style(k, v string) HTMLElem
  10676. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  10677. Styles(s map[string]string) HTMLElem
  10678. // TabIndex specifies the tabbing order of an element.
  10679. TabIndex(v int) HTMLElem
  10680. // Title specifies extra information about an element.
  10681. Title(v string) HTMLElem
  10682. // XMLNS specifies the xml namespace of the element.
  10683. XMLNS(v string) HTMLElem
  10684. // On registers the given event handler to the specified event.
  10685. On(event string, h EventHandler, scope ...any) HTMLElem
  10686. // OnBlur calls the given handler when the element loses focus.
  10687. OnBlur(h EventHandler, scope ...any) HTMLElem
  10688. // OnChange calls the given handler when the value of the element is changed.
  10689. OnChange(h EventHandler, scope ...any) HTMLElem
  10690. // OnClick calls the given handler when there is a mouse click on the element.
  10691. OnClick(h EventHandler, scope ...any) HTMLElem
  10692. // OnContextMenu calls the given handler when a context menu is triggered.
  10693. OnContextMenu(h EventHandler, scope ...any) HTMLElem
  10694. // OnCopy calls the given handler when the user copies the content of an element.
  10695. OnCopy(h EventHandler, scope ...any) HTMLElem
  10696. // OnCut calls the given handler when the user cuts the content of an element.
  10697. OnCut(h EventHandler, scope ...any) HTMLElem
  10698. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  10699. OnDblClick(h EventHandler, scope ...any) HTMLElem
  10700. // OnDrag calls the given handler when an element is dragged.
  10701. OnDrag(h EventHandler, scope ...any) HTMLElem
  10702. // OnDragEnd calls the given handler at the end of a drag operation.
  10703. OnDragEnd(h EventHandler, scope ...any) HTMLElem
  10704. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  10705. OnDragEnter(h EventHandler, scope ...any) HTMLElem
  10706. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  10707. OnDragLeave(h EventHandler, scope ...any) HTMLElem
  10708. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  10709. OnDragOver(h EventHandler, scope ...any) HTMLElem
  10710. // OnDragStart calls the given handler at the start of a drag operation.
  10711. OnDragStart(h EventHandler, scope ...any) HTMLElem
  10712. // OnDrop calls the given handler when dragged element is being dropped.
  10713. OnDrop(h EventHandler, scope ...any) HTMLElem
  10714. // OnFocus calls the given handler when the element gets focus.
  10715. OnFocus(h EventHandler, scope ...any) HTMLElem
  10716. // OnInput calls the given handler when an element gets user input.
  10717. OnInput(h EventHandler, scope ...any) HTMLElem
  10718. // OnInvalid calls the given handler when an element is invalid.
  10719. OnInvalid(h EventHandler, scope ...any) HTMLElem
  10720. // OnKeyDown calls the given handler when a user is pressing a key.
  10721. OnKeyDown(h EventHandler, scope ...any) HTMLElem
  10722. // OnKeyPress calls the given handler when a user presses a key.
  10723. OnKeyPress(h EventHandler, scope ...any) HTMLElem
  10724. // OnKeyUp calls the given handler when a user releases a key.
  10725. OnKeyUp(h EventHandler, scope ...any) HTMLElem
  10726. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  10727. OnMouseDown(h EventHandler, scope ...any) HTMLElem
  10728. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  10729. OnMouseMove(h EventHandler, scope ...any) HTMLElem
  10730. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  10731. OnMouseOut(h EventHandler, scope ...any) HTMLElem
  10732. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  10733. OnMouseOver(h EventHandler, scope ...any) HTMLElem
  10734. // OnMouseUp calls the given handler when a mouse button is released over an element.
  10735. OnMouseUp(h EventHandler, scope ...any) HTMLElem
  10736. // OnPaste calls the given handler when the user pastes some content in an element.
  10737. OnPaste(h EventHandler, scope ...any) HTMLElem
  10738. // OnReset calls the given handler when the Reset button in a form is clicked.
  10739. OnReset(h EventHandler, scope ...any) HTMLElem
  10740. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  10741. OnScroll(h EventHandler, scope ...any) HTMLElem
  10742. // OnSearch calls the given handler when the user writes something in a search field.
  10743. OnSearch(h EventHandler, scope ...any) HTMLElem
  10744. // OnSelect calls the given handler after some text has been selected in an element.
  10745. OnSelect(h EventHandler, scope ...any) HTMLElem
  10746. // OnSubmit calls the given handler when a form is submitted.
  10747. OnSubmit(h EventHandler, scope ...any) HTMLElem
  10748. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  10749. OnWheel(h EventHandler, scope ...any) HTMLElem
  10750. }
  10751. // Elem returns an HTML element that represents an customizable HTML element.
  10752. func Elem(tag string) HTMLElem {
  10753. e := &htmlElem{
  10754. htmlElement: htmlElement{
  10755. tag: tag,
  10756. isSelfClosing: false,
  10757. },
  10758. }
  10759. return e
  10760. }
  10761. type htmlElem struct {
  10762. htmlElement
  10763. }
  10764. func (e *htmlElem) Body(v ...UI) HTMLElem {
  10765. e.setChildren(v...)
  10766. return e
  10767. }
  10768. func (e *htmlElem) Text(v any) HTMLElem {
  10769. return e.Body(Text(v))
  10770. }
  10771. func (e *htmlElem) AccessKey(v string) HTMLElem {
  10772. e.setAttr("accesskey", v)
  10773. return e
  10774. }
  10775. func (e *htmlElem) Aria(k string, v any) HTMLElem {
  10776. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  10777. return e
  10778. }
  10779. func (e *htmlElem) Attr(n string, v any) HTMLElem {
  10780. e.setAttr(n, v)
  10781. return e
  10782. }
  10783. func (e *htmlElem) Class(v ...string) HTMLElem {
  10784. e.setAttr("class", strings.Join(v, " "))
  10785. return e
  10786. }
  10787. func (e *htmlElem) ContentEditable(v bool) HTMLElem {
  10788. e.setAttr("contenteditable", v)
  10789. return e
  10790. }
  10791. func (e *htmlElem) DataSet(k string, v any) HTMLElem {
  10792. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  10793. return e
  10794. }
  10795. func (e *htmlElem) Dir(v string) HTMLElem {
  10796. e.setAttr("dir", v)
  10797. return e
  10798. }
  10799. func (e *htmlElem) Draggable(v bool) HTMLElem {
  10800. e.setAttr("draggable", v)
  10801. return e
  10802. }
  10803. func (e *htmlElem) Hidden(v bool) HTMLElem {
  10804. e.setAttr("hidden", v)
  10805. return e
  10806. }
  10807. func (e *htmlElem) ID(v string) HTMLElem {
  10808. e.setAttr("id", v)
  10809. return e
  10810. }
  10811. func (e *htmlElem) Lang(v string) HTMLElem {
  10812. e.setAttr("lang", v)
  10813. return e
  10814. }
  10815. func (e *htmlElem) Role(v string) HTMLElem {
  10816. e.setAttr("role", v)
  10817. return e
  10818. }
  10819. func (e *htmlElem) Spellcheck(v bool) HTMLElem {
  10820. s := "false"
  10821. if v {
  10822. s = "true"
  10823. }
  10824. e.setAttr("spellcheck", s)
  10825. return e
  10826. }
  10827. func (e *htmlElem) Style(k, v string) HTMLElem {
  10828. e.setAttr("style", k+":"+v)
  10829. return e
  10830. }
  10831. func (e *htmlElem) Styles(s map[string]string) HTMLElem {
  10832. for k, v := range s {
  10833. e.Style(k, v)
  10834. }
  10835. return e
  10836. }
  10837. func (e *htmlElem) TabIndex(v int) HTMLElem {
  10838. e.setAttr("tabindex", v)
  10839. return e
  10840. }
  10841. func (e *htmlElem) Title(v string) HTMLElem {
  10842. e.setAttr("title", v)
  10843. return e
  10844. }
  10845. func (e *htmlElem) XMLNS(v string) HTMLElem {
  10846. e.xmlns = v
  10847. return e
  10848. }
  10849. func (e *htmlElem) On(event string, h EventHandler, scope ...any) HTMLElem {
  10850. e.setEventHandler(event, h, scope...)
  10851. return e
  10852. }
  10853. func (e *htmlElem) OnBlur(h EventHandler, scope ...any) HTMLElem {
  10854. e.setEventHandler("blur", h, scope...)
  10855. return e
  10856. }
  10857. func (e *htmlElem) OnChange(h EventHandler, scope ...any) HTMLElem {
  10858. e.setEventHandler("change", h, scope...)
  10859. return e
  10860. }
  10861. func (e *htmlElem) OnClick(h EventHandler, scope ...any) HTMLElem {
  10862. e.setEventHandler("click", h, scope...)
  10863. return e
  10864. }
  10865. func (e *htmlElem) OnContextMenu(h EventHandler, scope ...any) HTMLElem {
  10866. e.setEventHandler("contextmenu", h, scope...)
  10867. return e
  10868. }
  10869. func (e *htmlElem) OnCopy(h EventHandler, scope ...any) HTMLElem {
  10870. e.setEventHandler("copy", h, scope...)
  10871. return e
  10872. }
  10873. func (e *htmlElem) OnCut(h EventHandler, scope ...any) HTMLElem {
  10874. e.setEventHandler("cut", h, scope...)
  10875. return e
  10876. }
  10877. func (e *htmlElem) OnDblClick(h EventHandler, scope ...any) HTMLElem {
  10878. e.setEventHandler("dblclick", h, scope...)
  10879. return e
  10880. }
  10881. func (e *htmlElem) OnDrag(h EventHandler, scope ...any) HTMLElem {
  10882. e.setEventHandler("drag", h, scope...)
  10883. return e
  10884. }
  10885. func (e *htmlElem) OnDragEnd(h EventHandler, scope ...any) HTMLElem {
  10886. e.setEventHandler("dragend", h, scope...)
  10887. return e
  10888. }
  10889. func (e *htmlElem) OnDragEnter(h EventHandler, scope ...any) HTMLElem {
  10890. e.setEventHandler("dragenter", h, scope...)
  10891. return e
  10892. }
  10893. func (e *htmlElem) OnDragLeave(h EventHandler, scope ...any) HTMLElem {
  10894. e.setEventHandler("dragleave", h, scope...)
  10895. return e
  10896. }
  10897. func (e *htmlElem) OnDragOver(h EventHandler, scope ...any) HTMLElem {
  10898. e.setEventHandler("dragover", h, scope...)
  10899. return e
  10900. }
  10901. func (e *htmlElem) OnDragStart(h EventHandler, scope ...any) HTMLElem {
  10902. e.setEventHandler("dragstart", h, scope...)
  10903. return e
  10904. }
  10905. func (e *htmlElem) OnDrop(h EventHandler, scope ...any) HTMLElem {
  10906. e.setEventHandler("drop", h, scope...)
  10907. return e
  10908. }
  10909. func (e *htmlElem) OnFocus(h EventHandler, scope ...any) HTMLElem {
  10910. e.setEventHandler("focus", h, scope...)
  10911. return e
  10912. }
  10913. func (e *htmlElem) OnInput(h EventHandler, scope ...any) HTMLElem {
  10914. e.setEventHandler("input", h, scope...)
  10915. return e
  10916. }
  10917. func (e *htmlElem) OnInvalid(h EventHandler, scope ...any) HTMLElem {
  10918. e.setEventHandler("invalid", h, scope...)
  10919. return e
  10920. }
  10921. func (e *htmlElem) OnKeyDown(h EventHandler, scope ...any) HTMLElem {
  10922. e.setEventHandler("keydown", h, scope...)
  10923. return e
  10924. }
  10925. func (e *htmlElem) OnKeyPress(h EventHandler, scope ...any) HTMLElem {
  10926. e.setEventHandler("keypress", h, scope...)
  10927. return e
  10928. }
  10929. func (e *htmlElem) OnKeyUp(h EventHandler, scope ...any) HTMLElem {
  10930. e.setEventHandler("keyup", h, scope...)
  10931. return e
  10932. }
  10933. func (e *htmlElem) OnMouseDown(h EventHandler, scope ...any) HTMLElem {
  10934. e.setEventHandler("mousedown", h, scope...)
  10935. return e
  10936. }
  10937. func (e *htmlElem) OnMouseMove(h EventHandler, scope ...any) HTMLElem {
  10938. e.setEventHandler("mousemove", h, scope...)
  10939. return e
  10940. }
  10941. func (e *htmlElem) OnMouseOut(h EventHandler, scope ...any) HTMLElem {
  10942. e.setEventHandler("mouseout", h, scope...)
  10943. return e
  10944. }
  10945. func (e *htmlElem) OnMouseOver(h EventHandler, scope ...any) HTMLElem {
  10946. e.setEventHandler("mouseover", h, scope...)
  10947. return e
  10948. }
  10949. func (e *htmlElem) OnMouseUp(h EventHandler, scope ...any) HTMLElem {
  10950. e.setEventHandler("mouseup", h, scope...)
  10951. return e
  10952. }
  10953. func (e *htmlElem) OnPaste(h EventHandler, scope ...any) HTMLElem {
  10954. e.setEventHandler("paste", h, scope...)
  10955. return e
  10956. }
  10957. func (e *htmlElem) OnReset(h EventHandler, scope ...any) HTMLElem {
  10958. e.setEventHandler("reset", h, scope...)
  10959. return e
  10960. }
  10961. func (e *htmlElem) OnScroll(h EventHandler, scope ...any) HTMLElem {
  10962. e.setEventHandler("scroll", h, scope...)
  10963. return e
  10964. }
  10965. func (e *htmlElem) OnSearch(h EventHandler, scope ...any) HTMLElem {
  10966. e.setEventHandler("search", h, scope...)
  10967. return e
  10968. }
  10969. func (e *htmlElem) OnSelect(h EventHandler, scope ...any) HTMLElem {
  10970. e.setEventHandler("select", h, scope...)
  10971. return e
  10972. }
  10973. func (e *htmlElem) OnSubmit(h EventHandler, scope ...any) HTMLElem {
  10974. e.setEventHandler("submit", h, scope...)
  10975. return e
  10976. }
  10977. func (e *htmlElem) OnWheel(h EventHandler, scope ...any) HTMLElem {
  10978. e.setEventHandler("wheel", h, scope...)
  10979. return e
  10980. }
  10981. // HTMLElemSelfClosing is the interface that describes a "elemselfclosing" HTML element.
  10982. type HTMLElemSelfClosing interface {
  10983. UI
  10984. // AccessKey specifies a shortcut key to activate/focus an element.
  10985. AccessKey(v string) HTMLElemSelfClosing
  10986. // Aria stores accessible rich internet applications (ARIA) data.
  10987. Aria(k string, v any) HTMLElemSelfClosing
  10988. // Attr sets the named attribute with the given value.
  10989. Attr(n string, v any) HTMLElemSelfClosing
  10990. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  10991. Class(v ...string) HTMLElemSelfClosing
  10992. // ContentEditable specifies whether the content of an element is editable or not.
  10993. ContentEditable(v bool) HTMLElemSelfClosing
  10994. // DataSet stores custom data private to the page or application.
  10995. DataSet(k string, v any) HTMLElemSelfClosing
  10996. // Dir specifies the text direction for the content in an element.
  10997. Dir(v string) HTMLElemSelfClosing
  10998. // Draggable specifies whether an element is draggable or not.
  10999. Draggable(v bool) HTMLElemSelfClosing
  11000. // Hidden specifies that an element is not yet, or is no longer relevant.
  11001. Hidden(v bool) HTMLElemSelfClosing
  11002. // ID specifies a unique id for an element.
  11003. ID(v string) HTMLElemSelfClosing
  11004. // Lang specifies the language of the element's content.
  11005. Lang(v string) HTMLElemSelfClosing
  11006. // Role specifies to parsing software the exact function of an element (and its children).
  11007. Role(v string) HTMLElemSelfClosing
  11008. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  11009. Spellcheck(v bool) HTMLElemSelfClosing
  11010. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  11011. Style(k, v string) HTMLElemSelfClosing
  11012. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  11013. Styles(s map[string]string) HTMLElemSelfClosing
  11014. // TabIndex specifies the tabbing order of an element.
  11015. TabIndex(v int) HTMLElemSelfClosing
  11016. // Title specifies extra information about an element.
  11017. Title(v string) HTMLElemSelfClosing
  11018. // XMLNS specifies the xml namespace of the element.
  11019. XMLNS(v string) HTMLElemSelfClosing
  11020. // On registers the given event handler to the specified event.
  11021. On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing
  11022. // OnBlur calls the given handler when the element loses focus.
  11023. OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing
  11024. // OnChange calls the given handler when the value of the element is changed.
  11025. OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing
  11026. // OnClick calls the given handler when there is a mouse click on the element.
  11027. OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing
  11028. // OnContextMenu calls the given handler when a context menu is triggered.
  11029. OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing
  11030. // OnCopy calls the given handler when the user copies the content of an element.
  11031. OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing
  11032. // OnCut calls the given handler when the user cuts the content of an element.
  11033. OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing
  11034. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  11035. OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing
  11036. // OnDrag calls the given handler when an element is dragged.
  11037. OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing
  11038. // OnDragEnd calls the given handler at the end of a drag operation.
  11039. OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing
  11040. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  11041. OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing
  11042. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  11043. OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing
  11044. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  11045. OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing
  11046. // OnDragStart calls the given handler at the start of a drag operation.
  11047. OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing
  11048. // OnDrop calls the given handler when dragged element is being dropped.
  11049. OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing
  11050. // OnFocus calls the given handler when the element gets focus.
  11051. OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing
  11052. // OnInput calls the given handler when an element gets user input.
  11053. OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing
  11054. // OnInvalid calls the given handler when an element is invalid.
  11055. OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing
  11056. // OnKeyDown calls the given handler when a user is pressing a key.
  11057. OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing
  11058. // OnKeyPress calls the given handler when a user presses a key.
  11059. OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing
  11060. // OnKeyUp calls the given handler when a user releases a key.
  11061. OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing
  11062. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  11063. OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing
  11064. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  11065. OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing
  11066. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  11067. OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing
  11068. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  11069. OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing
  11070. // OnMouseUp calls the given handler when a mouse button is released over an element.
  11071. OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing
  11072. // OnPaste calls the given handler when the user pastes some content in an element.
  11073. OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing
  11074. // OnReset calls the given handler when the Reset button in a form is clicked.
  11075. OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing
  11076. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  11077. OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing
  11078. // OnSearch calls the given handler when the user writes something in a search field.
  11079. OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing
  11080. // OnSelect calls the given handler after some text has been selected in an element.
  11081. OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing
  11082. // OnSubmit calls the given handler when a form is submitted.
  11083. OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing
  11084. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  11085. OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing
  11086. }
  11087. // ElemSelfClosing returns an HTML element that represents a self closing custom HTML element.
  11088. func ElemSelfClosing(tag string) HTMLElemSelfClosing {
  11089. e := &htmlElemSelfClosing{
  11090. htmlElement: htmlElement{
  11091. tag: tag,
  11092. isSelfClosing: true,
  11093. },
  11094. }
  11095. return e
  11096. }
  11097. type htmlElemSelfClosing struct {
  11098. htmlElement
  11099. }
  11100. func (e *htmlElemSelfClosing) AccessKey(v string) HTMLElemSelfClosing {
  11101. e.setAttr("accesskey", v)
  11102. return e
  11103. }
  11104. func (e *htmlElemSelfClosing) Aria(k string, v any) HTMLElemSelfClosing {
  11105. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  11106. return e
  11107. }
  11108. func (e *htmlElemSelfClosing) Attr(n string, v any) HTMLElemSelfClosing {
  11109. e.setAttr(n, v)
  11110. return e
  11111. }
  11112. func (e *htmlElemSelfClosing) Class(v ...string) HTMLElemSelfClosing {
  11113. e.setAttr("class", strings.Join(v, " "))
  11114. return e
  11115. }
  11116. func (e *htmlElemSelfClosing) ContentEditable(v bool) HTMLElemSelfClosing {
  11117. e.setAttr("contenteditable", v)
  11118. return e
  11119. }
  11120. func (e *htmlElemSelfClosing) DataSet(k string, v any) HTMLElemSelfClosing {
  11121. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  11122. return e
  11123. }
  11124. func (e *htmlElemSelfClosing) Dir(v string) HTMLElemSelfClosing {
  11125. e.setAttr("dir", v)
  11126. return e
  11127. }
  11128. func (e *htmlElemSelfClosing) Draggable(v bool) HTMLElemSelfClosing {
  11129. e.setAttr("draggable", v)
  11130. return e
  11131. }
  11132. func (e *htmlElemSelfClosing) Hidden(v bool) HTMLElemSelfClosing {
  11133. e.setAttr("hidden", v)
  11134. return e
  11135. }
  11136. func (e *htmlElemSelfClosing) ID(v string) HTMLElemSelfClosing {
  11137. e.setAttr("id", v)
  11138. return e
  11139. }
  11140. func (e *htmlElemSelfClosing) Lang(v string) HTMLElemSelfClosing {
  11141. e.setAttr("lang", v)
  11142. return e
  11143. }
  11144. func (e *htmlElemSelfClosing) Role(v string) HTMLElemSelfClosing {
  11145. e.setAttr("role", v)
  11146. return e
  11147. }
  11148. func (e *htmlElemSelfClosing) Spellcheck(v bool) HTMLElemSelfClosing {
  11149. s := "false"
  11150. if v {
  11151. s = "true"
  11152. }
  11153. e.setAttr("spellcheck", s)
  11154. return e
  11155. }
  11156. func (e *htmlElemSelfClosing) Style(k, v string) HTMLElemSelfClosing {
  11157. e.setAttr("style", k+":"+v)
  11158. return e
  11159. }
  11160. func (e *htmlElemSelfClosing) Styles(s map[string]string) HTMLElemSelfClosing {
  11161. for k, v := range s {
  11162. e.Style(k, v)
  11163. }
  11164. return e
  11165. }
  11166. func (e *htmlElemSelfClosing) TabIndex(v int) HTMLElemSelfClosing {
  11167. e.setAttr("tabindex", v)
  11168. return e
  11169. }
  11170. func (e *htmlElemSelfClosing) Title(v string) HTMLElemSelfClosing {
  11171. e.setAttr("title", v)
  11172. return e
  11173. }
  11174. func (e *htmlElemSelfClosing) XMLNS(v string) HTMLElemSelfClosing {
  11175. e.xmlns = v
  11176. return e
  11177. }
  11178. func (e *htmlElemSelfClosing) On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing {
  11179. e.setEventHandler(event, h, scope...)
  11180. return e
  11181. }
  11182. func (e *htmlElemSelfClosing) OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11183. e.setEventHandler("blur", h, scope...)
  11184. return e
  11185. }
  11186. func (e *htmlElemSelfClosing) OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11187. e.setEventHandler("change", h, scope...)
  11188. return e
  11189. }
  11190. func (e *htmlElemSelfClosing) OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11191. e.setEventHandler("click", h, scope...)
  11192. return e
  11193. }
  11194. func (e *htmlElemSelfClosing) OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11195. e.setEventHandler("contextmenu", h, scope...)
  11196. return e
  11197. }
  11198. func (e *htmlElemSelfClosing) OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11199. e.setEventHandler("copy", h, scope...)
  11200. return e
  11201. }
  11202. func (e *htmlElemSelfClosing) OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11203. e.setEventHandler("cut", h, scope...)
  11204. return e
  11205. }
  11206. func (e *htmlElemSelfClosing) OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11207. e.setEventHandler("dblclick", h, scope...)
  11208. return e
  11209. }
  11210. func (e *htmlElemSelfClosing) OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11211. e.setEventHandler("drag", h, scope...)
  11212. return e
  11213. }
  11214. func (e *htmlElemSelfClosing) OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11215. e.setEventHandler("dragend", h, scope...)
  11216. return e
  11217. }
  11218. func (e *htmlElemSelfClosing) OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11219. e.setEventHandler("dragenter", h, scope...)
  11220. return e
  11221. }
  11222. func (e *htmlElemSelfClosing) OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11223. e.setEventHandler("dragleave", h, scope...)
  11224. return e
  11225. }
  11226. func (e *htmlElemSelfClosing) OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11227. e.setEventHandler("dragover", h, scope...)
  11228. return e
  11229. }
  11230. func (e *htmlElemSelfClosing) OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11231. e.setEventHandler("dragstart", h, scope...)
  11232. return e
  11233. }
  11234. func (e *htmlElemSelfClosing) OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11235. e.setEventHandler("drop", h, scope...)
  11236. return e
  11237. }
  11238. func (e *htmlElemSelfClosing) OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11239. e.setEventHandler("focus", h, scope...)
  11240. return e
  11241. }
  11242. func (e *htmlElemSelfClosing) OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11243. e.setEventHandler("input", h, scope...)
  11244. return e
  11245. }
  11246. func (e *htmlElemSelfClosing) OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11247. e.setEventHandler("invalid", h, scope...)
  11248. return e
  11249. }
  11250. func (e *htmlElemSelfClosing) OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11251. e.setEventHandler("keydown", h, scope...)
  11252. return e
  11253. }
  11254. func (e *htmlElemSelfClosing) OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11255. e.setEventHandler("keypress", h, scope...)
  11256. return e
  11257. }
  11258. func (e *htmlElemSelfClosing) OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11259. e.setEventHandler("keyup", h, scope...)
  11260. return e
  11261. }
  11262. func (e *htmlElemSelfClosing) OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11263. e.setEventHandler("mousedown", h, scope...)
  11264. return e
  11265. }
  11266. func (e *htmlElemSelfClosing) OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11267. e.setEventHandler("mousemove", h, scope...)
  11268. return e
  11269. }
  11270. func (e *htmlElemSelfClosing) OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11271. e.setEventHandler("mouseout", h, scope...)
  11272. return e
  11273. }
  11274. func (e *htmlElemSelfClosing) OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11275. e.setEventHandler("mouseover", h, scope...)
  11276. return e
  11277. }
  11278. func (e *htmlElemSelfClosing) OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11279. e.setEventHandler("mouseup", h, scope...)
  11280. return e
  11281. }
  11282. func (e *htmlElemSelfClosing) OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11283. e.setEventHandler("paste", h, scope...)
  11284. return e
  11285. }
  11286. func (e *htmlElemSelfClosing) OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11287. e.setEventHandler("reset", h, scope...)
  11288. return e
  11289. }
  11290. func (e *htmlElemSelfClosing) OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11291. e.setEventHandler("scroll", h, scope...)
  11292. return e
  11293. }
  11294. func (e *htmlElemSelfClosing) OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11295. e.setEventHandler("search", h, scope...)
  11296. return e
  11297. }
  11298. func (e *htmlElemSelfClosing) OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11299. e.setEventHandler("select", h, scope...)
  11300. return e
  11301. }
  11302. func (e *htmlElemSelfClosing) OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11303. e.setEventHandler("submit", h, scope...)
  11304. return e
  11305. }
  11306. func (e *htmlElemSelfClosing) OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing {
  11307. e.setEventHandler("wheel", h, scope...)
  11308. return e
  11309. }
  11310. // HTMLEm is the interface that describes a "em" HTML element.
  11311. type HTMLEm interface {
  11312. UI
  11313. // Body set the content of the element.
  11314. Body(elems ...UI) HTMLEm
  11315. // Text sets the content of the element with a text node containing the stringified given value.
  11316. Text(v any) HTMLEm
  11317. // AccessKey specifies a shortcut key to activate/focus an element.
  11318. AccessKey(v string) HTMLEm
  11319. // Aria stores accessible rich internet applications (ARIA) data.
  11320. Aria(k string, v any) HTMLEm
  11321. // Attr sets the named attribute with the given value.
  11322. Attr(n string, v any) HTMLEm
  11323. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  11324. Class(v ...string) HTMLEm
  11325. // ContentEditable specifies whether the content of an element is editable or not.
  11326. ContentEditable(v bool) HTMLEm
  11327. // DataSet stores custom data private to the page or application.
  11328. DataSet(k string, v any) HTMLEm
  11329. // Dir specifies the text direction for the content in an element.
  11330. Dir(v string) HTMLEm
  11331. // Draggable specifies whether an element is draggable or not.
  11332. Draggable(v bool) HTMLEm
  11333. // Hidden specifies that an element is not yet, or is no longer relevant.
  11334. Hidden(v bool) HTMLEm
  11335. // ID specifies a unique id for an element.
  11336. ID(v string) HTMLEm
  11337. // Lang specifies the language of the element's content.
  11338. Lang(v string) HTMLEm
  11339. // Role specifies to parsing software the exact function of an element (and its children).
  11340. Role(v string) HTMLEm
  11341. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  11342. Spellcheck(v bool) HTMLEm
  11343. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  11344. Style(k, v string) HTMLEm
  11345. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  11346. Styles(s map[string]string) HTMLEm
  11347. // TabIndex specifies the tabbing order of an element.
  11348. TabIndex(v int) HTMLEm
  11349. // Title specifies extra information about an element.
  11350. Title(v string) HTMLEm
  11351. // On registers the given event handler to the specified event.
  11352. On(event string, h EventHandler, scope ...any) HTMLEm
  11353. // OnBlur calls the given handler when the element loses focus.
  11354. OnBlur(h EventHandler, scope ...any) HTMLEm
  11355. // OnChange calls the given handler when the value of the element is changed.
  11356. OnChange(h EventHandler, scope ...any) HTMLEm
  11357. // OnClick calls the given handler when there is a mouse click on the element.
  11358. OnClick(h EventHandler, scope ...any) HTMLEm
  11359. // OnContextMenu calls the given handler when a context menu is triggered.
  11360. OnContextMenu(h EventHandler, scope ...any) HTMLEm
  11361. // OnCopy calls the given handler when the user copies the content of an element.
  11362. OnCopy(h EventHandler, scope ...any) HTMLEm
  11363. // OnCut calls the given handler when the user cuts the content of an element.
  11364. OnCut(h EventHandler, scope ...any) HTMLEm
  11365. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  11366. OnDblClick(h EventHandler, scope ...any) HTMLEm
  11367. // OnDrag calls the given handler when an element is dragged.
  11368. OnDrag(h EventHandler, scope ...any) HTMLEm
  11369. // OnDragEnd calls the given handler at the end of a drag operation.
  11370. OnDragEnd(h EventHandler, scope ...any) HTMLEm
  11371. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  11372. OnDragEnter(h EventHandler, scope ...any) HTMLEm
  11373. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  11374. OnDragLeave(h EventHandler, scope ...any) HTMLEm
  11375. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  11376. OnDragOver(h EventHandler, scope ...any) HTMLEm
  11377. // OnDragStart calls the given handler at the start of a drag operation.
  11378. OnDragStart(h EventHandler, scope ...any) HTMLEm
  11379. // OnDrop calls the given handler when dragged element is being dropped.
  11380. OnDrop(h EventHandler, scope ...any) HTMLEm
  11381. // OnFocus calls the given handler when the element gets focus.
  11382. OnFocus(h EventHandler, scope ...any) HTMLEm
  11383. // OnInput calls the given handler when an element gets user input.
  11384. OnInput(h EventHandler, scope ...any) HTMLEm
  11385. // OnInvalid calls the given handler when an element is invalid.
  11386. OnInvalid(h EventHandler, scope ...any) HTMLEm
  11387. // OnKeyDown calls the given handler when a user is pressing a key.
  11388. OnKeyDown(h EventHandler, scope ...any) HTMLEm
  11389. // OnKeyPress calls the given handler when a user presses a key.
  11390. OnKeyPress(h EventHandler, scope ...any) HTMLEm
  11391. // OnKeyUp calls the given handler when a user releases a key.
  11392. OnKeyUp(h EventHandler, scope ...any) HTMLEm
  11393. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  11394. OnMouseDown(h EventHandler, scope ...any) HTMLEm
  11395. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  11396. OnMouseMove(h EventHandler, scope ...any) HTMLEm
  11397. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  11398. OnMouseOut(h EventHandler, scope ...any) HTMLEm
  11399. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  11400. OnMouseOver(h EventHandler, scope ...any) HTMLEm
  11401. // OnMouseUp calls the given handler when a mouse button is released over an element.
  11402. OnMouseUp(h EventHandler, scope ...any) HTMLEm
  11403. // OnPaste calls the given handler when the user pastes some content in an element.
  11404. OnPaste(h EventHandler, scope ...any) HTMLEm
  11405. // OnReset calls the given handler when the Reset button in a form is clicked.
  11406. OnReset(h EventHandler, scope ...any) HTMLEm
  11407. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  11408. OnScroll(h EventHandler, scope ...any) HTMLEm
  11409. // OnSearch calls the given handler when the user writes something in a search field.
  11410. OnSearch(h EventHandler, scope ...any) HTMLEm
  11411. // OnSelect calls the given handler after some text has been selected in an element.
  11412. OnSelect(h EventHandler, scope ...any) HTMLEm
  11413. // OnSubmit calls the given handler when a form is submitted.
  11414. OnSubmit(h EventHandler, scope ...any) HTMLEm
  11415. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  11416. OnWheel(h EventHandler, scope ...any) HTMLEm
  11417. }
  11418. // Em returns an HTML element that defines emphasized text.
  11419. func Em() HTMLEm {
  11420. e := &htmlEm{
  11421. htmlElement: htmlElement{
  11422. tag: "em",
  11423. isSelfClosing: false,
  11424. },
  11425. }
  11426. return e
  11427. }
  11428. type htmlEm struct {
  11429. htmlElement
  11430. }
  11431. func (e *htmlEm) Body(v ...UI) HTMLEm {
  11432. e.setChildren(v...)
  11433. return e
  11434. }
  11435. func (e *htmlEm) Text(v any) HTMLEm {
  11436. return e.Body(Text(v))
  11437. }
  11438. func (e *htmlEm) AccessKey(v string) HTMLEm {
  11439. e.setAttr("accesskey", v)
  11440. return e
  11441. }
  11442. func (e *htmlEm) Aria(k string, v any) HTMLEm {
  11443. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  11444. return e
  11445. }
  11446. func (e *htmlEm) Attr(n string, v any) HTMLEm {
  11447. e.setAttr(n, v)
  11448. return e
  11449. }
  11450. func (e *htmlEm) Class(v ...string) HTMLEm {
  11451. e.setAttr("class", strings.Join(v, " "))
  11452. return e
  11453. }
  11454. func (e *htmlEm) ContentEditable(v bool) HTMLEm {
  11455. e.setAttr("contenteditable", v)
  11456. return e
  11457. }
  11458. func (e *htmlEm) DataSet(k string, v any) HTMLEm {
  11459. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  11460. return e
  11461. }
  11462. func (e *htmlEm) Dir(v string) HTMLEm {
  11463. e.setAttr("dir", v)
  11464. return e
  11465. }
  11466. func (e *htmlEm) Draggable(v bool) HTMLEm {
  11467. e.setAttr("draggable", v)
  11468. return e
  11469. }
  11470. func (e *htmlEm) Hidden(v bool) HTMLEm {
  11471. e.setAttr("hidden", v)
  11472. return e
  11473. }
  11474. func (e *htmlEm) ID(v string) HTMLEm {
  11475. e.setAttr("id", v)
  11476. return e
  11477. }
  11478. func (e *htmlEm) Lang(v string) HTMLEm {
  11479. e.setAttr("lang", v)
  11480. return e
  11481. }
  11482. func (e *htmlEm) Role(v string) HTMLEm {
  11483. e.setAttr("role", v)
  11484. return e
  11485. }
  11486. func (e *htmlEm) Spellcheck(v bool) HTMLEm {
  11487. s := "false"
  11488. if v {
  11489. s = "true"
  11490. }
  11491. e.setAttr("spellcheck", s)
  11492. return e
  11493. }
  11494. func (e *htmlEm) Style(k, v string) HTMLEm {
  11495. e.setAttr("style", k+":"+v)
  11496. return e
  11497. }
  11498. func (e *htmlEm) Styles(s map[string]string) HTMLEm {
  11499. for k, v := range s {
  11500. e.Style(k, v)
  11501. }
  11502. return e
  11503. }
  11504. func (e *htmlEm) TabIndex(v int) HTMLEm {
  11505. e.setAttr("tabindex", v)
  11506. return e
  11507. }
  11508. func (e *htmlEm) Title(v string) HTMLEm {
  11509. e.setAttr("title", v)
  11510. return e
  11511. }
  11512. func (e *htmlEm) On(event string, h EventHandler, scope ...any) HTMLEm {
  11513. e.setEventHandler(event, h, scope...)
  11514. return e
  11515. }
  11516. func (e *htmlEm) OnBlur(h EventHandler, scope ...any) HTMLEm {
  11517. e.setEventHandler("blur", h, scope...)
  11518. return e
  11519. }
  11520. func (e *htmlEm) OnChange(h EventHandler, scope ...any) HTMLEm {
  11521. e.setEventHandler("change", h, scope...)
  11522. return e
  11523. }
  11524. func (e *htmlEm) OnClick(h EventHandler, scope ...any) HTMLEm {
  11525. e.setEventHandler("click", h, scope...)
  11526. return e
  11527. }
  11528. func (e *htmlEm) OnContextMenu(h EventHandler, scope ...any) HTMLEm {
  11529. e.setEventHandler("contextmenu", h, scope...)
  11530. return e
  11531. }
  11532. func (e *htmlEm) OnCopy(h EventHandler, scope ...any) HTMLEm {
  11533. e.setEventHandler("copy", h, scope...)
  11534. return e
  11535. }
  11536. func (e *htmlEm) OnCut(h EventHandler, scope ...any) HTMLEm {
  11537. e.setEventHandler("cut", h, scope...)
  11538. return e
  11539. }
  11540. func (e *htmlEm) OnDblClick(h EventHandler, scope ...any) HTMLEm {
  11541. e.setEventHandler("dblclick", h, scope...)
  11542. return e
  11543. }
  11544. func (e *htmlEm) OnDrag(h EventHandler, scope ...any) HTMLEm {
  11545. e.setEventHandler("drag", h, scope...)
  11546. return e
  11547. }
  11548. func (e *htmlEm) OnDragEnd(h EventHandler, scope ...any) HTMLEm {
  11549. e.setEventHandler("dragend", h, scope...)
  11550. return e
  11551. }
  11552. func (e *htmlEm) OnDragEnter(h EventHandler, scope ...any) HTMLEm {
  11553. e.setEventHandler("dragenter", h, scope...)
  11554. return e
  11555. }
  11556. func (e *htmlEm) OnDragLeave(h EventHandler, scope ...any) HTMLEm {
  11557. e.setEventHandler("dragleave", h, scope...)
  11558. return e
  11559. }
  11560. func (e *htmlEm) OnDragOver(h EventHandler, scope ...any) HTMLEm {
  11561. e.setEventHandler("dragover", h, scope...)
  11562. return e
  11563. }
  11564. func (e *htmlEm) OnDragStart(h EventHandler, scope ...any) HTMLEm {
  11565. e.setEventHandler("dragstart", h, scope...)
  11566. return e
  11567. }
  11568. func (e *htmlEm) OnDrop(h EventHandler, scope ...any) HTMLEm {
  11569. e.setEventHandler("drop", h, scope...)
  11570. return e
  11571. }
  11572. func (e *htmlEm) OnFocus(h EventHandler, scope ...any) HTMLEm {
  11573. e.setEventHandler("focus", h, scope...)
  11574. return e
  11575. }
  11576. func (e *htmlEm) OnInput(h EventHandler, scope ...any) HTMLEm {
  11577. e.setEventHandler("input", h, scope...)
  11578. return e
  11579. }
  11580. func (e *htmlEm) OnInvalid(h EventHandler, scope ...any) HTMLEm {
  11581. e.setEventHandler("invalid", h, scope...)
  11582. return e
  11583. }
  11584. func (e *htmlEm) OnKeyDown(h EventHandler, scope ...any) HTMLEm {
  11585. e.setEventHandler("keydown", h, scope...)
  11586. return e
  11587. }
  11588. func (e *htmlEm) OnKeyPress(h EventHandler, scope ...any) HTMLEm {
  11589. e.setEventHandler("keypress", h, scope...)
  11590. return e
  11591. }
  11592. func (e *htmlEm) OnKeyUp(h EventHandler, scope ...any) HTMLEm {
  11593. e.setEventHandler("keyup", h, scope...)
  11594. return e
  11595. }
  11596. func (e *htmlEm) OnMouseDown(h EventHandler, scope ...any) HTMLEm {
  11597. e.setEventHandler("mousedown", h, scope...)
  11598. return e
  11599. }
  11600. func (e *htmlEm) OnMouseMove(h EventHandler, scope ...any) HTMLEm {
  11601. e.setEventHandler("mousemove", h, scope...)
  11602. return e
  11603. }
  11604. func (e *htmlEm) OnMouseOut(h EventHandler, scope ...any) HTMLEm {
  11605. e.setEventHandler("mouseout", h, scope...)
  11606. return e
  11607. }
  11608. func (e *htmlEm) OnMouseOver(h EventHandler, scope ...any) HTMLEm {
  11609. e.setEventHandler("mouseover", h, scope...)
  11610. return e
  11611. }
  11612. func (e *htmlEm) OnMouseUp(h EventHandler, scope ...any) HTMLEm {
  11613. e.setEventHandler("mouseup", h, scope...)
  11614. return e
  11615. }
  11616. func (e *htmlEm) OnPaste(h EventHandler, scope ...any) HTMLEm {
  11617. e.setEventHandler("paste", h, scope...)
  11618. return e
  11619. }
  11620. func (e *htmlEm) OnReset(h EventHandler, scope ...any) HTMLEm {
  11621. e.setEventHandler("reset", h, scope...)
  11622. return e
  11623. }
  11624. func (e *htmlEm) OnScroll(h EventHandler, scope ...any) HTMLEm {
  11625. e.setEventHandler("scroll", h, scope...)
  11626. return e
  11627. }
  11628. func (e *htmlEm) OnSearch(h EventHandler, scope ...any) HTMLEm {
  11629. e.setEventHandler("search", h, scope...)
  11630. return e
  11631. }
  11632. func (e *htmlEm) OnSelect(h EventHandler, scope ...any) HTMLEm {
  11633. e.setEventHandler("select", h, scope...)
  11634. return e
  11635. }
  11636. func (e *htmlEm) OnSubmit(h EventHandler, scope ...any) HTMLEm {
  11637. e.setEventHandler("submit", h, scope...)
  11638. return e
  11639. }
  11640. func (e *htmlEm) OnWheel(h EventHandler, scope ...any) HTMLEm {
  11641. e.setEventHandler("wheel", h, scope...)
  11642. return e
  11643. }
  11644. // HTMLEmbed is the interface that describes a "embed" HTML element.
  11645. type HTMLEmbed interface {
  11646. UI
  11647. // AccessKey specifies a shortcut key to activate/focus an element.
  11648. AccessKey(v string) HTMLEmbed
  11649. // Aria stores accessible rich internet applications (ARIA) data.
  11650. Aria(k string, v any) HTMLEmbed
  11651. // Attr sets the named attribute with the given value.
  11652. Attr(n string, v any) HTMLEmbed
  11653. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  11654. Class(v ...string) HTMLEmbed
  11655. // ContentEditable specifies whether the content of an element is editable or not.
  11656. ContentEditable(v bool) HTMLEmbed
  11657. // DataSet stores custom data private to the page or application.
  11658. DataSet(k string, v any) HTMLEmbed
  11659. // Dir specifies the text direction for the content in an element.
  11660. Dir(v string) HTMLEmbed
  11661. // Draggable specifies whether an element is draggable or not.
  11662. Draggable(v bool) HTMLEmbed
  11663. // Height specifies the height of the element (in pixels).
  11664. Height(v int) HTMLEmbed
  11665. // Hidden specifies that an element is not yet, or is no longer relevant.
  11666. Hidden(v bool) HTMLEmbed
  11667. // ID specifies a unique id for an element.
  11668. ID(v string) HTMLEmbed
  11669. // Lang specifies the language of the element's content.
  11670. Lang(v string) HTMLEmbed
  11671. // Role specifies to parsing software the exact function of an element (and its children).
  11672. Role(v string) HTMLEmbed
  11673. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  11674. Spellcheck(v bool) HTMLEmbed
  11675. // Src specifies the URL of the media file.
  11676. Src(v string) HTMLEmbed
  11677. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  11678. Style(k, v string) HTMLEmbed
  11679. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  11680. Styles(s map[string]string) HTMLEmbed
  11681. // TabIndex specifies the tabbing order of an element.
  11682. TabIndex(v int) HTMLEmbed
  11683. // Title specifies extra information about an element.
  11684. Title(v string) HTMLEmbed
  11685. // Type specifies the type of element.
  11686. Type(v string) HTMLEmbed
  11687. // Width specifies the width of the element.
  11688. Width(v int) HTMLEmbed
  11689. // On registers the given event handler to the specified event.
  11690. On(event string, h EventHandler, scope ...any) HTMLEmbed
  11691. // OnAbort calls the given handler on abort.
  11692. OnAbort(h EventHandler, scope ...any) HTMLEmbed
  11693. // OnBlur calls the given handler when the element loses focus.
  11694. OnBlur(h EventHandler, scope ...any) HTMLEmbed
  11695. // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
  11696. OnCanPlay(h EventHandler, scope ...any) HTMLEmbed
  11697. // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
  11698. OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed
  11699. // OnChange calls the given handler when the value of the element is changed.
  11700. OnChange(h EventHandler, scope ...any) HTMLEmbed
  11701. // OnClick calls the given handler when there is a mouse click on the element.
  11702. OnClick(h EventHandler, scope ...any) HTMLEmbed
  11703. // OnContextMenu calls the given handler when a context menu is triggered.
  11704. OnContextMenu(h EventHandler, scope ...any) HTMLEmbed
  11705. // OnCopy calls the given handler when the user copies the content of an element.
  11706. OnCopy(h EventHandler, scope ...any) HTMLEmbed
  11707. // OnCueChange calls the given handler when the cue changes in a track element.
  11708. OnCueChange(h EventHandler, scope ...any) HTMLEmbed
  11709. // OnCut calls the given handler when the user cuts the content of an element.
  11710. OnCut(h EventHandler, scope ...any) HTMLEmbed
  11711. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  11712. OnDblClick(h EventHandler, scope ...any) HTMLEmbed
  11713. // OnDrag calls the given handler when an element is dragged.
  11714. OnDrag(h EventHandler, scope ...any) HTMLEmbed
  11715. // OnDragEnd calls the given handler at the end of a drag operation.
  11716. OnDragEnd(h EventHandler, scope ...any) HTMLEmbed
  11717. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  11718. OnDragEnter(h EventHandler, scope ...any) HTMLEmbed
  11719. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  11720. OnDragLeave(h EventHandler, scope ...any) HTMLEmbed
  11721. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  11722. OnDragOver(h EventHandler, scope ...any) HTMLEmbed
  11723. // OnDragStart calls the given handler at the start of a drag operation.
  11724. OnDragStart(h EventHandler, scope ...any) HTMLEmbed
  11725. // OnDrop calls the given handler when dragged element is being dropped.
  11726. OnDrop(h EventHandler, scope ...any) HTMLEmbed
  11727. // OnDurationChange calls the given handler when the length of the media changes.
  11728. OnDurationChange(h EventHandler, scope ...any) HTMLEmbed
  11729. // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
  11730. OnEmptied(h EventHandler, scope ...any) HTMLEmbed
  11731. // OnEnded calls the given handler when the media has reach the end.
  11732. OnEnded(h EventHandler, scope ...any) HTMLEmbed
  11733. // OnError calls the given handler when an error occurs.
  11734. OnError(h EventHandler, scope ...any) HTMLEmbed
  11735. // OnFocus calls the given handler when the element gets focus.
  11736. OnFocus(h EventHandler, scope ...any) HTMLEmbed
  11737. // OnInput calls the given handler when an element gets user input.
  11738. OnInput(h EventHandler, scope ...any) HTMLEmbed
  11739. // OnInvalid calls the given handler when an element is invalid.
  11740. OnInvalid(h EventHandler, scope ...any) HTMLEmbed
  11741. // OnKeyDown calls the given handler when a user is pressing a key.
  11742. OnKeyDown(h EventHandler, scope ...any) HTMLEmbed
  11743. // OnKeyPress calls the given handler when a user presses a key.
  11744. OnKeyPress(h EventHandler, scope ...any) HTMLEmbed
  11745. // OnKeyUp calls the given handler when a user releases a key.
  11746. OnKeyUp(h EventHandler, scope ...any) HTMLEmbed
  11747. // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
  11748. OnLoadStart(h EventHandler, scope ...any) HTMLEmbed
  11749. // OnLoadedData calls the given handler when media data is loaded.
  11750. OnLoadedData(h EventHandler, scope ...any) HTMLEmbed
  11751. // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
  11752. OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed
  11753. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  11754. OnMouseDown(h EventHandler, scope ...any) HTMLEmbed
  11755. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  11756. OnMouseMove(h EventHandler, scope ...any) HTMLEmbed
  11757. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  11758. OnMouseOut(h EventHandler, scope ...any) HTMLEmbed
  11759. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  11760. OnMouseOver(h EventHandler, scope ...any) HTMLEmbed
  11761. // OnMouseUp calls the given handler when a mouse button is released over an element.
  11762. OnMouseUp(h EventHandler, scope ...any) HTMLEmbed
  11763. // OnPaste calls the given handler when the user pastes some content in an element.
  11764. OnPaste(h EventHandler, scope ...any) HTMLEmbed
  11765. // OnPause calls the given handler when the media is paused either by the user or programmatically.
  11766. OnPause(h EventHandler, scope ...any) HTMLEmbed
  11767. // OnPlay calls the given handler when the media is ready to start playing.
  11768. OnPlay(h EventHandler, scope ...any) HTMLEmbed
  11769. // OnPlaying calls the given handler when the media actually has started playing.
  11770. OnPlaying(h EventHandler, scope ...any) HTMLEmbed
  11771. // OnProgress calls the given handler when the browser is in the process of getting the media data.
  11772. OnProgress(h EventHandler, scope ...any) HTMLEmbed
  11773. // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
  11774. OnRateChange(h EventHandler, scope ...any) HTMLEmbed
  11775. // OnReset calls the given handler when the Reset button in a form is clicked.
  11776. OnReset(h EventHandler, scope ...any) HTMLEmbed
  11777. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  11778. OnScroll(h EventHandler, scope ...any) HTMLEmbed
  11779. // OnSearch calls the given handler when the user writes something in a search field.
  11780. OnSearch(h EventHandler, scope ...any) HTMLEmbed
  11781. // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
  11782. OnSeeked(h EventHandler, scope ...any) HTMLEmbed
  11783. // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
  11784. OnSeeking(h EventHandler, scope ...any) HTMLEmbed
  11785. // OnSelect calls the given handler after some text has been selected in an element.
  11786. OnSelect(h EventHandler, scope ...any) HTMLEmbed
  11787. // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
  11788. OnStalled(h EventHandler, scope ...any) HTMLEmbed
  11789. // OnSubmit calls the given handler when a form is submitted.
  11790. OnSubmit(h EventHandler, scope ...any) HTMLEmbed
  11791. // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
  11792. OnSuspend(h EventHandler, scope ...any) HTMLEmbed
  11793. // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
  11794. OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed
  11795. // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
  11796. OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed
  11797. // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
  11798. OnWaiting(h EventHandler, scope ...any) HTMLEmbed
  11799. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  11800. OnWheel(h EventHandler, scope ...any) HTMLEmbed
  11801. }
  11802. // Embed returns an HTML element that defines a container for an external (non-HTML) application.
  11803. func Embed() HTMLEmbed {
  11804. e := &htmlEmbed{
  11805. htmlElement: htmlElement{
  11806. tag: "embed",
  11807. isSelfClosing: true,
  11808. },
  11809. }
  11810. return e
  11811. }
  11812. type htmlEmbed struct {
  11813. htmlElement
  11814. }
  11815. func (e *htmlEmbed) AccessKey(v string) HTMLEmbed {
  11816. e.setAttr("accesskey", v)
  11817. return e
  11818. }
  11819. func (e *htmlEmbed) Aria(k string, v any) HTMLEmbed {
  11820. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  11821. return e
  11822. }
  11823. func (e *htmlEmbed) Attr(n string, v any) HTMLEmbed {
  11824. e.setAttr(n, v)
  11825. return e
  11826. }
  11827. func (e *htmlEmbed) Class(v ...string) HTMLEmbed {
  11828. e.setAttr("class", strings.Join(v, " "))
  11829. return e
  11830. }
  11831. func (e *htmlEmbed) ContentEditable(v bool) HTMLEmbed {
  11832. e.setAttr("contenteditable", v)
  11833. return e
  11834. }
  11835. func (e *htmlEmbed) DataSet(k string, v any) HTMLEmbed {
  11836. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  11837. return e
  11838. }
  11839. func (e *htmlEmbed) Dir(v string) HTMLEmbed {
  11840. e.setAttr("dir", v)
  11841. return e
  11842. }
  11843. func (e *htmlEmbed) Draggable(v bool) HTMLEmbed {
  11844. e.setAttr("draggable", v)
  11845. return e
  11846. }
  11847. func (e *htmlEmbed) Height(v int) HTMLEmbed {
  11848. e.setAttr("height", v)
  11849. return e
  11850. }
  11851. func (e *htmlEmbed) Hidden(v bool) HTMLEmbed {
  11852. e.setAttr("hidden", v)
  11853. return e
  11854. }
  11855. func (e *htmlEmbed) ID(v string) HTMLEmbed {
  11856. e.setAttr("id", v)
  11857. return e
  11858. }
  11859. func (e *htmlEmbed) Lang(v string) HTMLEmbed {
  11860. e.setAttr("lang", v)
  11861. return e
  11862. }
  11863. func (e *htmlEmbed) Role(v string) HTMLEmbed {
  11864. e.setAttr("role", v)
  11865. return e
  11866. }
  11867. func (e *htmlEmbed) Spellcheck(v bool) HTMLEmbed {
  11868. s := "false"
  11869. if v {
  11870. s = "true"
  11871. }
  11872. e.setAttr("spellcheck", s)
  11873. return e
  11874. }
  11875. func (e *htmlEmbed) Src(v string) HTMLEmbed {
  11876. e.setAttr("src", v)
  11877. return e
  11878. }
  11879. func (e *htmlEmbed) Style(k, v string) HTMLEmbed {
  11880. e.setAttr("style", k+":"+v)
  11881. return e
  11882. }
  11883. func (e *htmlEmbed) Styles(s map[string]string) HTMLEmbed {
  11884. for k, v := range s {
  11885. e.Style(k, v)
  11886. }
  11887. return e
  11888. }
  11889. func (e *htmlEmbed) TabIndex(v int) HTMLEmbed {
  11890. e.setAttr("tabindex", v)
  11891. return e
  11892. }
  11893. func (e *htmlEmbed) Title(v string) HTMLEmbed {
  11894. e.setAttr("title", v)
  11895. return e
  11896. }
  11897. func (e *htmlEmbed) Type(v string) HTMLEmbed {
  11898. e.setAttr("type", v)
  11899. return e
  11900. }
  11901. func (e *htmlEmbed) Width(v int) HTMLEmbed {
  11902. e.setAttr("width", v)
  11903. return e
  11904. }
  11905. func (e *htmlEmbed) On(event string, h EventHandler, scope ...any) HTMLEmbed {
  11906. e.setEventHandler(event, h, scope...)
  11907. return e
  11908. }
  11909. func (e *htmlEmbed) OnAbort(h EventHandler, scope ...any) HTMLEmbed {
  11910. e.setEventHandler("abort", h, scope...)
  11911. return e
  11912. }
  11913. func (e *htmlEmbed) OnBlur(h EventHandler, scope ...any) HTMLEmbed {
  11914. e.setEventHandler("blur", h, scope...)
  11915. return e
  11916. }
  11917. func (e *htmlEmbed) OnCanPlay(h EventHandler, scope ...any) HTMLEmbed {
  11918. e.setEventHandler("canplay", h, scope...)
  11919. return e
  11920. }
  11921. func (e *htmlEmbed) OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed {
  11922. e.setEventHandler("canplaythrough", h, scope...)
  11923. return e
  11924. }
  11925. func (e *htmlEmbed) OnChange(h EventHandler, scope ...any) HTMLEmbed {
  11926. e.setEventHandler("change", h, scope...)
  11927. return e
  11928. }
  11929. func (e *htmlEmbed) OnClick(h EventHandler, scope ...any) HTMLEmbed {
  11930. e.setEventHandler("click", h, scope...)
  11931. return e
  11932. }
  11933. func (e *htmlEmbed) OnContextMenu(h EventHandler, scope ...any) HTMLEmbed {
  11934. e.setEventHandler("contextmenu", h, scope...)
  11935. return e
  11936. }
  11937. func (e *htmlEmbed) OnCopy(h EventHandler, scope ...any) HTMLEmbed {
  11938. e.setEventHandler("copy", h, scope...)
  11939. return e
  11940. }
  11941. func (e *htmlEmbed) OnCueChange(h EventHandler, scope ...any) HTMLEmbed {
  11942. e.setEventHandler("cuechange", h, scope...)
  11943. return e
  11944. }
  11945. func (e *htmlEmbed) OnCut(h EventHandler, scope ...any) HTMLEmbed {
  11946. e.setEventHandler("cut", h, scope...)
  11947. return e
  11948. }
  11949. func (e *htmlEmbed) OnDblClick(h EventHandler, scope ...any) HTMLEmbed {
  11950. e.setEventHandler("dblclick", h, scope...)
  11951. return e
  11952. }
  11953. func (e *htmlEmbed) OnDrag(h EventHandler, scope ...any) HTMLEmbed {
  11954. e.setEventHandler("drag", h, scope...)
  11955. return e
  11956. }
  11957. func (e *htmlEmbed) OnDragEnd(h EventHandler, scope ...any) HTMLEmbed {
  11958. e.setEventHandler("dragend", h, scope...)
  11959. return e
  11960. }
  11961. func (e *htmlEmbed) OnDragEnter(h EventHandler, scope ...any) HTMLEmbed {
  11962. e.setEventHandler("dragenter", h, scope...)
  11963. return e
  11964. }
  11965. func (e *htmlEmbed) OnDragLeave(h EventHandler, scope ...any) HTMLEmbed {
  11966. e.setEventHandler("dragleave", h, scope...)
  11967. return e
  11968. }
  11969. func (e *htmlEmbed) OnDragOver(h EventHandler, scope ...any) HTMLEmbed {
  11970. e.setEventHandler("dragover", h, scope...)
  11971. return e
  11972. }
  11973. func (e *htmlEmbed) OnDragStart(h EventHandler, scope ...any) HTMLEmbed {
  11974. e.setEventHandler("dragstart", h, scope...)
  11975. return e
  11976. }
  11977. func (e *htmlEmbed) OnDrop(h EventHandler, scope ...any) HTMLEmbed {
  11978. e.setEventHandler("drop", h, scope...)
  11979. return e
  11980. }
  11981. func (e *htmlEmbed) OnDurationChange(h EventHandler, scope ...any) HTMLEmbed {
  11982. e.setEventHandler("durationchange", h, scope...)
  11983. return e
  11984. }
  11985. func (e *htmlEmbed) OnEmptied(h EventHandler, scope ...any) HTMLEmbed {
  11986. e.setEventHandler("emptied", h, scope...)
  11987. return e
  11988. }
  11989. func (e *htmlEmbed) OnEnded(h EventHandler, scope ...any) HTMLEmbed {
  11990. e.setEventHandler("ended", h, scope...)
  11991. return e
  11992. }
  11993. func (e *htmlEmbed) OnError(h EventHandler, scope ...any) HTMLEmbed {
  11994. e.setEventHandler("error", h, scope...)
  11995. return e
  11996. }
  11997. func (e *htmlEmbed) OnFocus(h EventHandler, scope ...any) HTMLEmbed {
  11998. e.setEventHandler("focus", h, scope...)
  11999. return e
  12000. }
  12001. func (e *htmlEmbed) OnInput(h EventHandler, scope ...any) HTMLEmbed {
  12002. e.setEventHandler("input", h, scope...)
  12003. return e
  12004. }
  12005. func (e *htmlEmbed) OnInvalid(h EventHandler, scope ...any) HTMLEmbed {
  12006. e.setEventHandler("invalid", h, scope...)
  12007. return e
  12008. }
  12009. func (e *htmlEmbed) OnKeyDown(h EventHandler, scope ...any) HTMLEmbed {
  12010. e.setEventHandler("keydown", h, scope...)
  12011. return e
  12012. }
  12013. func (e *htmlEmbed) OnKeyPress(h EventHandler, scope ...any) HTMLEmbed {
  12014. e.setEventHandler("keypress", h, scope...)
  12015. return e
  12016. }
  12017. func (e *htmlEmbed) OnKeyUp(h EventHandler, scope ...any) HTMLEmbed {
  12018. e.setEventHandler("keyup", h, scope...)
  12019. return e
  12020. }
  12021. func (e *htmlEmbed) OnLoadStart(h EventHandler, scope ...any) HTMLEmbed {
  12022. e.setEventHandler("loadstart", h, scope...)
  12023. return e
  12024. }
  12025. func (e *htmlEmbed) OnLoadedData(h EventHandler, scope ...any) HTMLEmbed {
  12026. e.setEventHandler("loadeddata", h, scope...)
  12027. return e
  12028. }
  12029. func (e *htmlEmbed) OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed {
  12030. e.setEventHandler("loadedmetadata", h, scope...)
  12031. return e
  12032. }
  12033. func (e *htmlEmbed) OnMouseDown(h EventHandler, scope ...any) HTMLEmbed {
  12034. e.setEventHandler("mousedown", h, scope...)
  12035. return e
  12036. }
  12037. func (e *htmlEmbed) OnMouseMove(h EventHandler, scope ...any) HTMLEmbed {
  12038. e.setEventHandler("mousemove", h, scope...)
  12039. return e
  12040. }
  12041. func (e *htmlEmbed) OnMouseOut(h EventHandler, scope ...any) HTMLEmbed {
  12042. e.setEventHandler("mouseout", h, scope...)
  12043. return e
  12044. }
  12045. func (e *htmlEmbed) OnMouseOver(h EventHandler, scope ...any) HTMLEmbed {
  12046. e.setEventHandler("mouseover", h, scope...)
  12047. return e
  12048. }
  12049. func (e *htmlEmbed) OnMouseUp(h EventHandler, scope ...any) HTMLEmbed {
  12050. e.setEventHandler("mouseup", h, scope...)
  12051. return e
  12052. }
  12053. func (e *htmlEmbed) OnPaste(h EventHandler, scope ...any) HTMLEmbed {
  12054. e.setEventHandler("paste", h, scope...)
  12055. return e
  12056. }
  12057. func (e *htmlEmbed) OnPause(h EventHandler, scope ...any) HTMLEmbed {
  12058. e.setEventHandler("pause", h, scope...)
  12059. return e
  12060. }
  12061. func (e *htmlEmbed) OnPlay(h EventHandler, scope ...any) HTMLEmbed {
  12062. e.setEventHandler("play", h, scope...)
  12063. return e
  12064. }
  12065. func (e *htmlEmbed) OnPlaying(h EventHandler, scope ...any) HTMLEmbed {
  12066. e.setEventHandler("playing", h, scope...)
  12067. return e
  12068. }
  12069. func (e *htmlEmbed) OnProgress(h EventHandler, scope ...any) HTMLEmbed {
  12070. e.setEventHandler("progress", h, scope...)
  12071. return e
  12072. }
  12073. func (e *htmlEmbed) OnRateChange(h EventHandler, scope ...any) HTMLEmbed {
  12074. e.setEventHandler("ratechange", h, scope...)
  12075. return e
  12076. }
  12077. func (e *htmlEmbed) OnReset(h EventHandler, scope ...any) HTMLEmbed {
  12078. e.setEventHandler("reset", h, scope...)
  12079. return e
  12080. }
  12081. func (e *htmlEmbed) OnScroll(h EventHandler, scope ...any) HTMLEmbed {
  12082. e.setEventHandler("scroll", h, scope...)
  12083. return e
  12084. }
  12085. func (e *htmlEmbed) OnSearch(h EventHandler, scope ...any) HTMLEmbed {
  12086. e.setEventHandler("search", h, scope...)
  12087. return e
  12088. }
  12089. func (e *htmlEmbed) OnSeeked(h EventHandler, scope ...any) HTMLEmbed {
  12090. e.setEventHandler("seeked", h, scope...)
  12091. return e
  12092. }
  12093. func (e *htmlEmbed) OnSeeking(h EventHandler, scope ...any) HTMLEmbed {
  12094. e.setEventHandler("seeking", h, scope...)
  12095. return e
  12096. }
  12097. func (e *htmlEmbed) OnSelect(h EventHandler, scope ...any) HTMLEmbed {
  12098. e.setEventHandler("select", h, scope...)
  12099. return e
  12100. }
  12101. func (e *htmlEmbed) OnStalled(h EventHandler, scope ...any) HTMLEmbed {
  12102. e.setEventHandler("stalled", h, scope...)
  12103. return e
  12104. }
  12105. func (e *htmlEmbed) OnSubmit(h EventHandler, scope ...any) HTMLEmbed {
  12106. e.setEventHandler("submit", h, scope...)
  12107. return e
  12108. }
  12109. func (e *htmlEmbed) OnSuspend(h EventHandler, scope ...any) HTMLEmbed {
  12110. e.setEventHandler("suspend", h, scope...)
  12111. return e
  12112. }
  12113. func (e *htmlEmbed) OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed {
  12114. e.setEventHandler("timeupdate", h, scope...)
  12115. return e
  12116. }
  12117. func (e *htmlEmbed) OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed {
  12118. e.setEventHandler("volumechange", h, scope...)
  12119. return e
  12120. }
  12121. func (e *htmlEmbed) OnWaiting(h EventHandler, scope ...any) HTMLEmbed {
  12122. e.setEventHandler("waiting", h, scope...)
  12123. return e
  12124. }
  12125. func (e *htmlEmbed) OnWheel(h EventHandler, scope ...any) HTMLEmbed {
  12126. e.setEventHandler("wheel", h, scope...)
  12127. return e
  12128. }
  12129. // HTMLFieldSet is the interface that describes a "fieldset" HTML element.
  12130. type HTMLFieldSet interface {
  12131. UI
  12132. // Body set the content of the element.
  12133. Body(elems ...UI) HTMLFieldSet
  12134. // Text sets the content of the element with a text node containing the stringified given value.
  12135. Text(v any) HTMLFieldSet
  12136. // AccessKey specifies a shortcut key to activate/focus an element.
  12137. AccessKey(v string) HTMLFieldSet
  12138. // Aria stores accessible rich internet applications (ARIA) data.
  12139. Aria(k string, v any) HTMLFieldSet
  12140. // Attr sets the named attribute with the given value.
  12141. Attr(n string, v any) HTMLFieldSet
  12142. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  12143. Class(v ...string) HTMLFieldSet
  12144. // ContentEditable specifies whether the content of an element is editable or not.
  12145. ContentEditable(v bool) HTMLFieldSet
  12146. // DataSet stores custom data private to the page or application.
  12147. DataSet(k string, v any) HTMLFieldSet
  12148. // Dir specifies the text direction for the content in an element.
  12149. Dir(v string) HTMLFieldSet
  12150. // Disabled specifies that the specified element/group of elements should be disabled.
  12151. Disabled(v bool) HTMLFieldSet
  12152. // Draggable specifies whether an element is draggable or not.
  12153. Draggable(v bool) HTMLFieldSet
  12154. // Form specifies the name of the form the element belongs to.
  12155. Form(v string) HTMLFieldSet
  12156. // Hidden specifies that an element is not yet, or is no longer relevant.
  12157. Hidden(v bool) HTMLFieldSet
  12158. // ID specifies a unique id for an element.
  12159. ID(v string) HTMLFieldSet
  12160. // Lang specifies the language of the element's content.
  12161. Lang(v string) HTMLFieldSet
  12162. // Name specifies the name of the element.
  12163. Name(v string) HTMLFieldSet
  12164. // Role specifies to parsing software the exact function of an element (and its children).
  12165. Role(v string) HTMLFieldSet
  12166. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  12167. Spellcheck(v bool) HTMLFieldSet
  12168. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  12169. Style(k, v string) HTMLFieldSet
  12170. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  12171. Styles(s map[string]string) HTMLFieldSet
  12172. // TabIndex specifies the tabbing order of an element.
  12173. TabIndex(v int) HTMLFieldSet
  12174. // Title specifies extra information about an element.
  12175. Title(v string) HTMLFieldSet
  12176. // On registers the given event handler to the specified event.
  12177. On(event string, h EventHandler, scope ...any) HTMLFieldSet
  12178. // OnBlur calls the given handler when the element loses focus.
  12179. OnBlur(h EventHandler, scope ...any) HTMLFieldSet
  12180. // OnChange calls the given handler when the value of the element is changed.
  12181. OnChange(h EventHandler, scope ...any) HTMLFieldSet
  12182. // OnClick calls the given handler when there is a mouse click on the element.
  12183. OnClick(h EventHandler, scope ...any) HTMLFieldSet
  12184. // OnContextMenu calls the given handler when a context menu is triggered.
  12185. OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet
  12186. // OnCopy calls the given handler when the user copies the content of an element.
  12187. OnCopy(h EventHandler, scope ...any) HTMLFieldSet
  12188. // OnCut calls the given handler when the user cuts the content of an element.
  12189. OnCut(h EventHandler, scope ...any) HTMLFieldSet
  12190. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  12191. OnDblClick(h EventHandler, scope ...any) HTMLFieldSet
  12192. // OnDrag calls the given handler when an element is dragged.
  12193. OnDrag(h EventHandler, scope ...any) HTMLFieldSet
  12194. // OnDragEnd calls the given handler at the end of a drag operation.
  12195. OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet
  12196. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  12197. OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet
  12198. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  12199. OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet
  12200. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  12201. OnDragOver(h EventHandler, scope ...any) HTMLFieldSet
  12202. // OnDragStart calls the given handler at the start of a drag operation.
  12203. OnDragStart(h EventHandler, scope ...any) HTMLFieldSet
  12204. // OnDrop calls the given handler when dragged element is being dropped.
  12205. OnDrop(h EventHandler, scope ...any) HTMLFieldSet
  12206. // OnFocus calls the given handler when the element gets focus.
  12207. OnFocus(h EventHandler, scope ...any) HTMLFieldSet
  12208. // OnInput calls the given handler when an element gets user input.
  12209. OnInput(h EventHandler, scope ...any) HTMLFieldSet
  12210. // OnInvalid calls the given handler when an element is invalid.
  12211. OnInvalid(h EventHandler, scope ...any) HTMLFieldSet
  12212. // OnKeyDown calls the given handler when a user is pressing a key.
  12213. OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet
  12214. // OnKeyPress calls the given handler when a user presses a key.
  12215. OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet
  12216. // OnKeyUp calls the given handler when a user releases a key.
  12217. OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet
  12218. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  12219. OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet
  12220. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  12221. OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet
  12222. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  12223. OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet
  12224. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  12225. OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet
  12226. // OnMouseUp calls the given handler when a mouse button is released over an element.
  12227. OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet
  12228. // OnPaste calls the given handler when the user pastes some content in an element.
  12229. OnPaste(h EventHandler, scope ...any) HTMLFieldSet
  12230. // OnReset calls the given handler when the Reset button in a form is clicked.
  12231. OnReset(h EventHandler, scope ...any) HTMLFieldSet
  12232. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  12233. OnScroll(h EventHandler, scope ...any) HTMLFieldSet
  12234. // OnSearch calls the given handler when the user writes something in a search field.
  12235. OnSearch(h EventHandler, scope ...any) HTMLFieldSet
  12236. // OnSelect calls the given handler after some text has been selected in an element.
  12237. OnSelect(h EventHandler, scope ...any) HTMLFieldSet
  12238. // OnSubmit calls the given handler when a form is submitted.
  12239. OnSubmit(h EventHandler, scope ...any) HTMLFieldSet
  12240. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  12241. OnWheel(h EventHandler, scope ...any) HTMLFieldSet
  12242. }
  12243. // FieldSet returns an HTML element that groups related elements in a form.
  12244. func FieldSet() HTMLFieldSet {
  12245. e := &htmlFieldSet{
  12246. htmlElement: htmlElement{
  12247. tag: "fieldset",
  12248. isSelfClosing: false,
  12249. },
  12250. }
  12251. return e
  12252. }
  12253. type htmlFieldSet struct {
  12254. htmlElement
  12255. }
  12256. func (e *htmlFieldSet) Body(v ...UI) HTMLFieldSet {
  12257. e.setChildren(v...)
  12258. return e
  12259. }
  12260. func (e *htmlFieldSet) Text(v any) HTMLFieldSet {
  12261. return e.Body(Text(v))
  12262. }
  12263. func (e *htmlFieldSet) AccessKey(v string) HTMLFieldSet {
  12264. e.setAttr("accesskey", v)
  12265. return e
  12266. }
  12267. func (e *htmlFieldSet) Aria(k string, v any) HTMLFieldSet {
  12268. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  12269. return e
  12270. }
  12271. func (e *htmlFieldSet) Attr(n string, v any) HTMLFieldSet {
  12272. e.setAttr(n, v)
  12273. return e
  12274. }
  12275. func (e *htmlFieldSet) Class(v ...string) HTMLFieldSet {
  12276. e.setAttr("class", strings.Join(v, " "))
  12277. return e
  12278. }
  12279. func (e *htmlFieldSet) ContentEditable(v bool) HTMLFieldSet {
  12280. e.setAttr("contenteditable", v)
  12281. return e
  12282. }
  12283. func (e *htmlFieldSet) DataSet(k string, v any) HTMLFieldSet {
  12284. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  12285. return e
  12286. }
  12287. func (e *htmlFieldSet) Dir(v string) HTMLFieldSet {
  12288. e.setAttr("dir", v)
  12289. return e
  12290. }
  12291. func (e *htmlFieldSet) Disabled(v bool) HTMLFieldSet {
  12292. e.setAttr("disabled", v)
  12293. return e
  12294. }
  12295. func (e *htmlFieldSet) Draggable(v bool) HTMLFieldSet {
  12296. e.setAttr("draggable", v)
  12297. return e
  12298. }
  12299. func (e *htmlFieldSet) Form(v string) HTMLFieldSet {
  12300. e.setAttr("form", v)
  12301. return e
  12302. }
  12303. func (e *htmlFieldSet) Hidden(v bool) HTMLFieldSet {
  12304. e.setAttr("hidden", v)
  12305. return e
  12306. }
  12307. func (e *htmlFieldSet) ID(v string) HTMLFieldSet {
  12308. e.setAttr("id", v)
  12309. return e
  12310. }
  12311. func (e *htmlFieldSet) Lang(v string) HTMLFieldSet {
  12312. e.setAttr("lang", v)
  12313. return e
  12314. }
  12315. func (e *htmlFieldSet) Name(v string) HTMLFieldSet {
  12316. e.setAttr("name", v)
  12317. return e
  12318. }
  12319. func (e *htmlFieldSet) Role(v string) HTMLFieldSet {
  12320. e.setAttr("role", v)
  12321. return e
  12322. }
  12323. func (e *htmlFieldSet) Spellcheck(v bool) HTMLFieldSet {
  12324. s := "false"
  12325. if v {
  12326. s = "true"
  12327. }
  12328. e.setAttr("spellcheck", s)
  12329. return e
  12330. }
  12331. func (e *htmlFieldSet) Style(k, v string) HTMLFieldSet {
  12332. e.setAttr("style", k+":"+v)
  12333. return e
  12334. }
  12335. func (e *htmlFieldSet) Styles(s map[string]string) HTMLFieldSet {
  12336. for k, v := range s {
  12337. e.Style(k, v)
  12338. }
  12339. return e
  12340. }
  12341. func (e *htmlFieldSet) TabIndex(v int) HTMLFieldSet {
  12342. e.setAttr("tabindex", v)
  12343. return e
  12344. }
  12345. func (e *htmlFieldSet) Title(v string) HTMLFieldSet {
  12346. e.setAttr("title", v)
  12347. return e
  12348. }
  12349. func (e *htmlFieldSet) On(event string, h EventHandler, scope ...any) HTMLFieldSet {
  12350. e.setEventHandler(event, h, scope...)
  12351. return e
  12352. }
  12353. func (e *htmlFieldSet) OnBlur(h EventHandler, scope ...any) HTMLFieldSet {
  12354. e.setEventHandler("blur", h, scope...)
  12355. return e
  12356. }
  12357. func (e *htmlFieldSet) OnChange(h EventHandler, scope ...any) HTMLFieldSet {
  12358. e.setEventHandler("change", h, scope...)
  12359. return e
  12360. }
  12361. func (e *htmlFieldSet) OnClick(h EventHandler, scope ...any) HTMLFieldSet {
  12362. e.setEventHandler("click", h, scope...)
  12363. return e
  12364. }
  12365. func (e *htmlFieldSet) OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet {
  12366. e.setEventHandler("contextmenu", h, scope...)
  12367. return e
  12368. }
  12369. func (e *htmlFieldSet) OnCopy(h EventHandler, scope ...any) HTMLFieldSet {
  12370. e.setEventHandler("copy", h, scope...)
  12371. return e
  12372. }
  12373. func (e *htmlFieldSet) OnCut(h EventHandler, scope ...any) HTMLFieldSet {
  12374. e.setEventHandler("cut", h, scope...)
  12375. return e
  12376. }
  12377. func (e *htmlFieldSet) OnDblClick(h EventHandler, scope ...any) HTMLFieldSet {
  12378. e.setEventHandler("dblclick", h, scope...)
  12379. return e
  12380. }
  12381. func (e *htmlFieldSet) OnDrag(h EventHandler, scope ...any) HTMLFieldSet {
  12382. e.setEventHandler("drag", h, scope...)
  12383. return e
  12384. }
  12385. func (e *htmlFieldSet) OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet {
  12386. e.setEventHandler("dragend", h, scope...)
  12387. return e
  12388. }
  12389. func (e *htmlFieldSet) OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet {
  12390. e.setEventHandler("dragenter", h, scope...)
  12391. return e
  12392. }
  12393. func (e *htmlFieldSet) OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet {
  12394. e.setEventHandler("dragleave", h, scope...)
  12395. return e
  12396. }
  12397. func (e *htmlFieldSet) OnDragOver(h EventHandler, scope ...any) HTMLFieldSet {
  12398. e.setEventHandler("dragover", h, scope...)
  12399. return e
  12400. }
  12401. func (e *htmlFieldSet) OnDragStart(h EventHandler, scope ...any) HTMLFieldSet {
  12402. e.setEventHandler("dragstart", h, scope...)
  12403. return e
  12404. }
  12405. func (e *htmlFieldSet) OnDrop(h EventHandler, scope ...any) HTMLFieldSet {
  12406. e.setEventHandler("drop", h, scope...)
  12407. return e
  12408. }
  12409. func (e *htmlFieldSet) OnFocus(h EventHandler, scope ...any) HTMLFieldSet {
  12410. e.setEventHandler("focus", h, scope...)
  12411. return e
  12412. }
  12413. func (e *htmlFieldSet) OnInput(h EventHandler, scope ...any) HTMLFieldSet {
  12414. e.setEventHandler("input", h, scope...)
  12415. return e
  12416. }
  12417. func (e *htmlFieldSet) OnInvalid(h EventHandler, scope ...any) HTMLFieldSet {
  12418. e.setEventHandler("invalid", h, scope...)
  12419. return e
  12420. }
  12421. func (e *htmlFieldSet) OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet {
  12422. e.setEventHandler("keydown", h, scope...)
  12423. return e
  12424. }
  12425. func (e *htmlFieldSet) OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet {
  12426. e.setEventHandler("keypress", h, scope...)
  12427. return e
  12428. }
  12429. func (e *htmlFieldSet) OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet {
  12430. e.setEventHandler("keyup", h, scope...)
  12431. return e
  12432. }
  12433. func (e *htmlFieldSet) OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet {
  12434. e.setEventHandler("mousedown", h, scope...)
  12435. return e
  12436. }
  12437. func (e *htmlFieldSet) OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet {
  12438. e.setEventHandler("mousemove", h, scope...)
  12439. return e
  12440. }
  12441. func (e *htmlFieldSet) OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet {
  12442. e.setEventHandler("mouseout", h, scope...)
  12443. return e
  12444. }
  12445. func (e *htmlFieldSet) OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet {
  12446. e.setEventHandler("mouseover", h, scope...)
  12447. return e
  12448. }
  12449. func (e *htmlFieldSet) OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet {
  12450. e.setEventHandler("mouseup", h, scope...)
  12451. return e
  12452. }
  12453. func (e *htmlFieldSet) OnPaste(h EventHandler, scope ...any) HTMLFieldSet {
  12454. e.setEventHandler("paste", h, scope...)
  12455. return e
  12456. }
  12457. func (e *htmlFieldSet) OnReset(h EventHandler, scope ...any) HTMLFieldSet {
  12458. e.setEventHandler("reset", h, scope...)
  12459. return e
  12460. }
  12461. func (e *htmlFieldSet) OnScroll(h EventHandler, scope ...any) HTMLFieldSet {
  12462. e.setEventHandler("scroll", h, scope...)
  12463. return e
  12464. }
  12465. func (e *htmlFieldSet) OnSearch(h EventHandler, scope ...any) HTMLFieldSet {
  12466. e.setEventHandler("search", h, scope...)
  12467. return e
  12468. }
  12469. func (e *htmlFieldSet) OnSelect(h EventHandler, scope ...any) HTMLFieldSet {
  12470. e.setEventHandler("select", h, scope...)
  12471. return e
  12472. }
  12473. func (e *htmlFieldSet) OnSubmit(h EventHandler, scope ...any) HTMLFieldSet {
  12474. e.setEventHandler("submit", h, scope...)
  12475. return e
  12476. }
  12477. func (e *htmlFieldSet) OnWheel(h EventHandler, scope ...any) HTMLFieldSet {
  12478. e.setEventHandler("wheel", h, scope...)
  12479. return e
  12480. }
  12481. // HTMLFigCaption is the interface that describes a "figcaption" HTML element.
  12482. type HTMLFigCaption interface {
  12483. UI
  12484. // Body set the content of the element.
  12485. Body(elems ...UI) HTMLFigCaption
  12486. // Text sets the content of the element with a text node containing the stringified given value.
  12487. Text(v any) HTMLFigCaption
  12488. // AccessKey specifies a shortcut key to activate/focus an element.
  12489. AccessKey(v string) HTMLFigCaption
  12490. // Aria stores accessible rich internet applications (ARIA) data.
  12491. Aria(k string, v any) HTMLFigCaption
  12492. // Attr sets the named attribute with the given value.
  12493. Attr(n string, v any) HTMLFigCaption
  12494. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  12495. Class(v ...string) HTMLFigCaption
  12496. // ContentEditable specifies whether the content of an element is editable or not.
  12497. ContentEditable(v bool) HTMLFigCaption
  12498. // DataSet stores custom data private to the page or application.
  12499. DataSet(k string, v any) HTMLFigCaption
  12500. // Dir specifies the text direction for the content in an element.
  12501. Dir(v string) HTMLFigCaption
  12502. // Draggable specifies whether an element is draggable or not.
  12503. Draggable(v bool) HTMLFigCaption
  12504. // Hidden specifies that an element is not yet, or is no longer relevant.
  12505. Hidden(v bool) HTMLFigCaption
  12506. // ID specifies a unique id for an element.
  12507. ID(v string) HTMLFigCaption
  12508. // Lang specifies the language of the element's content.
  12509. Lang(v string) HTMLFigCaption
  12510. // Role specifies to parsing software the exact function of an element (and its children).
  12511. Role(v string) HTMLFigCaption
  12512. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  12513. Spellcheck(v bool) HTMLFigCaption
  12514. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  12515. Style(k, v string) HTMLFigCaption
  12516. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  12517. Styles(s map[string]string) HTMLFigCaption
  12518. // TabIndex specifies the tabbing order of an element.
  12519. TabIndex(v int) HTMLFigCaption
  12520. // Title specifies extra information about an element.
  12521. Title(v string) HTMLFigCaption
  12522. // On registers the given event handler to the specified event.
  12523. On(event string, h EventHandler, scope ...any) HTMLFigCaption
  12524. // OnBlur calls the given handler when the element loses focus.
  12525. OnBlur(h EventHandler, scope ...any) HTMLFigCaption
  12526. // OnChange calls the given handler when the value of the element is changed.
  12527. OnChange(h EventHandler, scope ...any) HTMLFigCaption
  12528. // OnClick calls the given handler when there is a mouse click on the element.
  12529. OnClick(h EventHandler, scope ...any) HTMLFigCaption
  12530. // OnContextMenu calls the given handler when a context menu is triggered.
  12531. OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption
  12532. // OnCopy calls the given handler when the user copies the content of an element.
  12533. OnCopy(h EventHandler, scope ...any) HTMLFigCaption
  12534. // OnCut calls the given handler when the user cuts the content of an element.
  12535. OnCut(h EventHandler, scope ...any) HTMLFigCaption
  12536. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  12537. OnDblClick(h EventHandler, scope ...any) HTMLFigCaption
  12538. // OnDrag calls the given handler when an element is dragged.
  12539. OnDrag(h EventHandler, scope ...any) HTMLFigCaption
  12540. // OnDragEnd calls the given handler at the end of a drag operation.
  12541. OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption
  12542. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  12543. OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption
  12544. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  12545. OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption
  12546. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  12547. OnDragOver(h EventHandler, scope ...any) HTMLFigCaption
  12548. // OnDragStart calls the given handler at the start of a drag operation.
  12549. OnDragStart(h EventHandler, scope ...any) HTMLFigCaption
  12550. // OnDrop calls the given handler when dragged element is being dropped.
  12551. OnDrop(h EventHandler, scope ...any) HTMLFigCaption
  12552. // OnFocus calls the given handler when the element gets focus.
  12553. OnFocus(h EventHandler, scope ...any) HTMLFigCaption
  12554. // OnInput calls the given handler when an element gets user input.
  12555. OnInput(h EventHandler, scope ...any) HTMLFigCaption
  12556. // OnInvalid calls the given handler when an element is invalid.
  12557. OnInvalid(h EventHandler, scope ...any) HTMLFigCaption
  12558. // OnKeyDown calls the given handler when a user is pressing a key.
  12559. OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption
  12560. // OnKeyPress calls the given handler when a user presses a key.
  12561. OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption
  12562. // OnKeyUp calls the given handler when a user releases a key.
  12563. OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption
  12564. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  12565. OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption
  12566. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  12567. OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption
  12568. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  12569. OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption
  12570. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  12571. OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption
  12572. // OnMouseUp calls the given handler when a mouse button is released over an element.
  12573. OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption
  12574. // OnPaste calls the given handler when the user pastes some content in an element.
  12575. OnPaste(h EventHandler, scope ...any) HTMLFigCaption
  12576. // OnReset calls the given handler when the Reset button in a form is clicked.
  12577. OnReset(h EventHandler, scope ...any) HTMLFigCaption
  12578. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  12579. OnScroll(h EventHandler, scope ...any) HTMLFigCaption
  12580. // OnSearch calls the given handler when the user writes something in a search field.
  12581. OnSearch(h EventHandler, scope ...any) HTMLFigCaption
  12582. // OnSelect calls the given handler after some text has been selected in an element.
  12583. OnSelect(h EventHandler, scope ...any) HTMLFigCaption
  12584. // OnSubmit calls the given handler when a form is submitted.
  12585. OnSubmit(h EventHandler, scope ...any) HTMLFigCaption
  12586. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  12587. OnWheel(h EventHandler, scope ...any) HTMLFigCaption
  12588. }
  12589. // FigCaption returns an HTML element that defines a caption for a figure element.
  12590. func FigCaption() HTMLFigCaption {
  12591. e := &htmlFigCaption{
  12592. htmlElement: htmlElement{
  12593. tag: "figcaption",
  12594. isSelfClosing: false,
  12595. },
  12596. }
  12597. return e
  12598. }
  12599. type htmlFigCaption struct {
  12600. htmlElement
  12601. }
  12602. func (e *htmlFigCaption) Body(v ...UI) HTMLFigCaption {
  12603. e.setChildren(v...)
  12604. return e
  12605. }
  12606. func (e *htmlFigCaption) Text(v any) HTMLFigCaption {
  12607. return e.Body(Text(v))
  12608. }
  12609. func (e *htmlFigCaption) AccessKey(v string) HTMLFigCaption {
  12610. e.setAttr("accesskey", v)
  12611. return e
  12612. }
  12613. func (e *htmlFigCaption) Aria(k string, v any) HTMLFigCaption {
  12614. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  12615. return e
  12616. }
  12617. func (e *htmlFigCaption) Attr(n string, v any) HTMLFigCaption {
  12618. e.setAttr(n, v)
  12619. return e
  12620. }
  12621. func (e *htmlFigCaption) Class(v ...string) HTMLFigCaption {
  12622. e.setAttr("class", strings.Join(v, " "))
  12623. return e
  12624. }
  12625. func (e *htmlFigCaption) ContentEditable(v bool) HTMLFigCaption {
  12626. e.setAttr("contenteditable", v)
  12627. return e
  12628. }
  12629. func (e *htmlFigCaption) DataSet(k string, v any) HTMLFigCaption {
  12630. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  12631. return e
  12632. }
  12633. func (e *htmlFigCaption) Dir(v string) HTMLFigCaption {
  12634. e.setAttr("dir", v)
  12635. return e
  12636. }
  12637. func (e *htmlFigCaption) Draggable(v bool) HTMLFigCaption {
  12638. e.setAttr("draggable", v)
  12639. return e
  12640. }
  12641. func (e *htmlFigCaption) Hidden(v bool) HTMLFigCaption {
  12642. e.setAttr("hidden", v)
  12643. return e
  12644. }
  12645. func (e *htmlFigCaption) ID(v string) HTMLFigCaption {
  12646. e.setAttr("id", v)
  12647. return e
  12648. }
  12649. func (e *htmlFigCaption) Lang(v string) HTMLFigCaption {
  12650. e.setAttr("lang", v)
  12651. return e
  12652. }
  12653. func (e *htmlFigCaption) Role(v string) HTMLFigCaption {
  12654. e.setAttr("role", v)
  12655. return e
  12656. }
  12657. func (e *htmlFigCaption) Spellcheck(v bool) HTMLFigCaption {
  12658. s := "false"
  12659. if v {
  12660. s = "true"
  12661. }
  12662. e.setAttr("spellcheck", s)
  12663. return e
  12664. }
  12665. func (e *htmlFigCaption) Style(k, v string) HTMLFigCaption {
  12666. e.setAttr("style", k+":"+v)
  12667. return e
  12668. }
  12669. func (e *htmlFigCaption) Styles(s map[string]string) HTMLFigCaption {
  12670. for k, v := range s {
  12671. e.Style(k, v)
  12672. }
  12673. return e
  12674. }
  12675. func (e *htmlFigCaption) TabIndex(v int) HTMLFigCaption {
  12676. e.setAttr("tabindex", v)
  12677. return e
  12678. }
  12679. func (e *htmlFigCaption) Title(v string) HTMLFigCaption {
  12680. e.setAttr("title", v)
  12681. return e
  12682. }
  12683. func (e *htmlFigCaption) On(event string, h EventHandler, scope ...any) HTMLFigCaption {
  12684. e.setEventHandler(event, h, scope...)
  12685. return e
  12686. }
  12687. func (e *htmlFigCaption) OnBlur(h EventHandler, scope ...any) HTMLFigCaption {
  12688. e.setEventHandler("blur", h, scope...)
  12689. return e
  12690. }
  12691. func (e *htmlFigCaption) OnChange(h EventHandler, scope ...any) HTMLFigCaption {
  12692. e.setEventHandler("change", h, scope...)
  12693. return e
  12694. }
  12695. func (e *htmlFigCaption) OnClick(h EventHandler, scope ...any) HTMLFigCaption {
  12696. e.setEventHandler("click", h, scope...)
  12697. return e
  12698. }
  12699. func (e *htmlFigCaption) OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption {
  12700. e.setEventHandler("contextmenu", h, scope...)
  12701. return e
  12702. }
  12703. func (e *htmlFigCaption) OnCopy(h EventHandler, scope ...any) HTMLFigCaption {
  12704. e.setEventHandler("copy", h, scope...)
  12705. return e
  12706. }
  12707. func (e *htmlFigCaption) OnCut(h EventHandler, scope ...any) HTMLFigCaption {
  12708. e.setEventHandler("cut", h, scope...)
  12709. return e
  12710. }
  12711. func (e *htmlFigCaption) OnDblClick(h EventHandler, scope ...any) HTMLFigCaption {
  12712. e.setEventHandler("dblclick", h, scope...)
  12713. return e
  12714. }
  12715. func (e *htmlFigCaption) OnDrag(h EventHandler, scope ...any) HTMLFigCaption {
  12716. e.setEventHandler("drag", h, scope...)
  12717. return e
  12718. }
  12719. func (e *htmlFigCaption) OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption {
  12720. e.setEventHandler("dragend", h, scope...)
  12721. return e
  12722. }
  12723. func (e *htmlFigCaption) OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption {
  12724. e.setEventHandler("dragenter", h, scope...)
  12725. return e
  12726. }
  12727. func (e *htmlFigCaption) OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption {
  12728. e.setEventHandler("dragleave", h, scope...)
  12729. return e
  12730. }
  12731. func (e *htmlFigCaption) OnDragOver(h EventHandler, scope ...any) HTMLFigCaption {
  12732. e.setEventHandler("dragover", h, scope...)
  12733. return e
  12734. }
  12735. func (e *htmlFigCaption) OnDragStart(h EventHandler, scope ...any) HTMLFigCaption {
  12736. e.setEventHandler("dragstart", h, scope...)
  12737. return e
  12738. }
  12739. func (e *htmlFigCaption) OnDrop(h EventHandler, scope ...any) HTMLFigCaption {
  12740. e.setEventHandler("drop", h, scope...)
  12741. return e
  12742. }
  12743. func (e *htmlFigCaption) OnFocus(h EventHandler, scope ...any) HTMLFigCaption {
  12744. e.setEventHandler("focus", h, scope...)
  12745. return e
  12746. }
  12747. func (e *htmlFigCaption) OnInput(h EventHandler, scope ...any) HTMLFigCaption {
  12748. e.setEventHandler("input", h, scope...)
  12749. return e
  12750. }
  12751. func (e *htmlFigCaption) OnInvalid(h EventHandler, scope ...any) HTMLFigCaption {
  12752. e.setEventHandler("invalid", h, scope...)
  12753. return e
  12754. }
  12755. func (e *htmlFigCaption) OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption {
  12756. e.setEventHandler("keydown", h, scope...)
  12757. return e
  12758. }
  12759. func (e *htmlFigCaption) OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption {
  12760. e.setEventHandler("keypress", h, scope...)
  12761. return e
  12762. }
  12763. func (e *htmlFigCaption) OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption {
  12764. e.setEventHandler("keyup", h, scope...)
  12765. return e
  12766. }
  12767. func (e *htmlFigCaption) OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption {
  12768. e.setEventHandler("mousedown", h, scope...)
  12769. return e
  12770. }
  12771. func (e *htmlFigCaption) OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption {
  12772. e.setEventHandler("mousemove", h, scope...)
  12773. return e
  12774. }
  12775. func (e *htmlFigCaption) OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption {
  12776. e.setEventHandler("mouseout", h, scope...)
  12777. return e
  12778. }
  12779. func (e *htmlFigCaption) OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption {
  12780. e.setEventHandler("mouseover", h, scope...)
  12781. return e
  12782. }
  12783. func (e *htmlFigCaption) OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption {
  12784. e.setEventHandler("mouseup", h, scope...)
  12785. return e
  12786. }
  12787. func (e *htmlFigCaption) OnPaste(h EventHandler, scope ...any) HTMLFigCaption {
  12788. e.setEventHandler("paste", h, scope...)
  12789. return e
  12790. }
  12791. func (e *htmlFigCaption) OnReset(h EventHandler, scope ...any) HTMLFigCaption {
  12792. e.setEventHandler("reset", h, scope...)
  12793. return e
  12794. }
  12795. func (e *htmlFigCaption) OnScroll(h EventHandler, scope ...any) HTMLFigCaption {
  12796. e.setEventHandler("scroll", h, scope...)
  12797. return e
  12798. }
  12799. func (e *htmlFigCaption) OnSearch(h EventHandler, scope ...any) HTMLFigCaption {
  12800. e.setEventHandler("search", h, scope...)
  12801. return e
  12802. }
  12803. func (e *htmlFigCaption) OnSelect(h EventHandler, scope ...any) HTMLFigCaption {
  12804. e.setEventHandler("select", h, scope...)
  12805. return e
  12806. }
  12807. func (e *htmlFigCaption) OnSubmit(h EventHandler, scope ...any) HTMLFigCaption {
  12808. e.setEventHandler("submit", h, scope...)
  12809. return e
  12810. }
  12811. func (e *htmlFigCaption) OnWheel(h EventHandler, scope ...any) HTMLFigCaption {
  12812. e.setEventHandler("wheel", h, scope...)
  12813. return e
  12814. }
  12815. // HTMLFigure is the interface that describes a "figure" HTML element.
  12816. type HTMLFigure interface {
  12817. UI
  12818. // Body set the content of the element.
  12819. Body(elems ...UI) HTMLFigure
  12820. // Text sets the content of the element with a text node containing the stringified given value.
  12821. Text(v any) HTMLFigure
  12822. // AccessKey specifies a shortcut key to activate/focus an element.
  12823. AccessKey(v string) HTMLFigure
  12824. // Aria stores accessible rich internet applications (ARIA) data.
  12825. Aria(k string, v any) HTMLFigure
  12826. // Attr sets the named attribute with the given value.
  12827. Attr(n string, v any) HTMLFigure
  12828. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  12829. Class(v ...string) HTMLFigure
  12830. // ContentEditable specifies whether the content of an element is editable or not.
  12831. ContentEditable(v bool) HTMLFigure
  12832. // DataSet stores custom data private to the page or application.
  12833. DataSet(k string, v any) HTMLFigure
  12834. // Dir specifies the text direction for the content in an element.
  12835. Dir(v string) HTMLFigure
  12836. // Draggable specifies whether an element is draggable or not.
  12837. Draggable(v bool) HTMLFigure
  12838. // Hidden specifies that an element is not yet, or is no longer relevant.
  12839. Hidden(v bool) HTMLFigure
  12840. // ID specifies a unique id for an element.
  12841. ID(v string) HTMLFigure
  12842. // Lang specifies the language of the element's content.
  12843. Lang(v string) HTMLFigure
  12844. // Role specifies to parsing software the exact function of an element (and its children).
  12845. Role(v string) HTMLFigure
  12846. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  12847. Spellcheck(v bool) HTMLFigure
  12848. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  12849. Style(k, v string) HTMLFigure
  12850. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  12851. Styles(s map[string]string) HTMLFigure
  12852. // TabIndex specifies the tabbing order of an element.
  12853. TabIndex(v int) HTMLFigure
  12854. // Title specifies extra information about an element.
  12855. Title(v string) HTMLFigure
  12856. // On registers the given event handler to the specified event.
  12857. On(event string, h EventHandler, scope ...any) HTMLFigure
  12858. // OnBlur calls the given handler when the element loses focus.
  12859. OnBlur(h EventHandler, scope ...any) HTMLFigure
  12860. // OnChange calls the given handler when the value of the element is changed.
  12861. OnChange(h EventHandler, scope ...any) HTMLFigure
  12862. // OnClick calls the given handler when there is a mouse click on the element.
  12863. OnClick(h EventHandler, scope ...any) HTMLFigure
  12864. // OnContextMenu calls the given handler when a context menu is triggered.
  12865. OnContextMenu(h EventHandler, scope ...any) HTMLFigure
  12866. // OnCopy calls the given handler when the user copies the content of an element.
  12867. OnCopy(h EventHandler, scope ...any) HTMLFigure
  12868. // OnCut calls the given handler when the user cuts the content of an element.
  12869. OnCut(h EventHandler, scope ...any) HTMLFigure
  12870. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  12871. OnDblClick(h EventHandler, scope ...any) HTMLFigure
  12872. // OnDrag calls the given handler when an element is dragged.
  12873. OnDrag(h EventHandler, scope ...any) HTMLFigure
  12874. // OnDragEnd calls the given handler at the end of a drag operation.
  12875. OnDragEnd(h EventHandler, scope ...any) HTMLFigure
  12876. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  12877. OnDragEnter(h EventHandler, scope ...any) HTMLFigure
  12878. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  12879. OnDragLeave(h EventHandler, scope ...any) HTMLFigure
  12880. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  12881. OnDragOver(h EventHandler, scope ...any) HTMLFigure
  12882. // OnDragStart calls the given handler at the start of a drag operation.
  12883. OnDragStart(h EventHandler, scope ...any) HTMLFigure
  12884. // OnDrop calls the given handler when dragged element is being dropped.
  12885. OnDrop(h EventHandler, scope ...any) HTMLFigure
  12886. // OnFocus calls the given handler when the element gets focus.
  12887. OnFocus(h EventHandler, scope ...any) HTMLFigure
  12888. // OnInput calls the given handler when an element gets user input.
  12889. OnInput(h EventHandler, scope ...any) HTMLFigure
  12890. // OnInvalid calls the given handler when an element is invalid.
  12891. OnInvalid(h EventHandler, scope ...any) HTMLFigure
  12892. // OnKeyDown calls the given handler when a user is pressing a key.
  12893. OnKeyDown(h EventHandler, scope ...any) HTMLFigure
  12894. // OnKeyPress calls the given handler when a user presses a key.
  12895. OnKeyPress(h EventHandler, scope ...any) HTMLFigure
  12896. // OnKeyUp calls the given handler when a user releases a key.
  12897. OnKeyUp(h EventHandler, scope ...any) HTMLFigure
  12898. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  12899. OnMouseDown(h EventHandler, scope ...any) HTMLFigure
  12900. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  12901. OnMouseMove(h EventHandler, scope ...any) HTMLFigure
  12902. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  12903. OnMouseOut(h EventHandler, scope ...any) HTMLFigure
  12904. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  12905. OnMouseOver(h EventHandler, scope ...any) HTMLFigure
  12906. // OnMouseUp calls the given handler when a mouse button is released over an element.
  12907. OnMouseUp(h EventHandler, scope ...any) HTMLFigure
  12908. // OnPaste calls the given handler when the user pastes some content in an element.
  12909. OnPaste(h EventHandler, scope ...any) HTMLFigure
  12910. // OnReset calls the given handler when the Reset button in a form is clicked.
  12911. OnReset(h EventHandler, scope ...any) HTMLFigure
  12912. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  12913. OnScroll(h EventHandler, scope ...any) HTMLFigure
  12914. // OnSearch calls the given handler when the user writes something in a search field.
  12915. OnSearch(h EventHandler, scope ...any) HTMLFigure
  12916. // OnSelect calls the given handler after some text has been selected in an element.
  12917. OnSelect(h EventHandler, scope ...any) HTMLFigure
  12918. // OnSubmit calls the given handler when a form is submitted.
  12919. OnSubmit(h EventHandler, scope ...any) HTMLFigure
  12920. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  12921. OnWheel(h EventHandler, scope ...any) HTMLFigure
  12922. }
  12923. // Figure returns an HTML element that specifies self-contained content.
  12924. func Figure() HTMLFigure {
  12925. e := &htmlFigure{
  12926. htmlElement: htmlElement{
  12927. tag: "figure",
  12928. isSelfClosing: false,
  12929. },
  12930. }
  12931. return e
  12932. }
  12933. type htmlFigure struct {
  12934. htmlElement
  12935. }
  12936. func (e *htmlFigure) Body(v ...UI) HTMLFigure {
  12937. e.setChildren(v...)
  12938. return e
  12939. }
  12940. func (e *htmlFigure) Text(v any) HTMLFigure {
  12941. return e.Body(Text(v))
  12942. }
  12943. func (e *htmlFigure) AccessKey(v string) HTMLFigure {
  12944. e.setAttr("accesskey", v)
  12945. return e
  12946. }
  12947. func (e *htmlFigure) Aria(k string, v any) HTMLFigure {
  12948. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  12949. return e
  12950. }
  12951. func (e *htmlFigure) Attr(n string, v any) HTMLFigure {
  12952. e.setAttr(n, v)
  12953. return e
  12954. }
  12955. func (e *htmlFigure) Class(v ...string) HTMLFigure {
  12956. e.setAttr("class", strings.Join(v, " "))
  12957. return e
  12958. }
  12959. func (e *htmlFigure) ContentEditable(v bool) HTMLFigure {
  12960. e.setAttr("contenteditable", v)
  12961. return e
  12962. }
  12963. func (e *htmlFigure) DataSet(k string, v any) HTMLFigure {
  12964. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  12965. return e
  12966. }
  12967. func (e *htmlFigure) Dir(v string) HTMLFigure {
  12968. e.setAttr("dir", v)
  12969. return e
  12970. }
  12971. func (e *htmlFigure) Draggable(v bool) HTMLFigure {
  12972. e.setAttr("draggable", v)
  12973. return e
  12974. }
  12975. func (e *htmlFigure) Hidden(v bool) HTMLFigure {
  12976. e.setAttr("hidden", v)
  12977. return e
  12978. }
  12979. func (e *htmlFigure) ID(v string) HTMLFigure {
  12980. e.setAttr("id", v)
  12981. return e
  12982. }
  12983. func (e *htmlFigure) Lang(v string) HTMLFigure {
  12984. e.setAttr("lang", v)
  12985. return e
  12986. }
  12987. func (e *htmlFigure) Role(v string) HTMLFigure {
  12988. e.setAttr("role", v)
  12989. return e
  12990. }
  12991. func (e *htmlFigure) Spellcheck(v bool) HTMLFigure {
  12992. s := "false"
  12993. if v {
  12994. s = "true"
  12995. }
  12996. e.setAttr("spellcheck", s)
  12997. return e
  12998. }
  12999. func (e *htmlFigure) Style(k, v string) HTMLFigure {
  13000. e.setAttr("style", k+":"+v)
  13001. return e
  13002. }
  13003. func (e *htmlFigure) Styles(s map[string]string) HTMLFigure {
  13004. for k, v := range s {
  13005. e.Style(k, v)
  13006. }
  13007. return e
  13008. }
  13009. func (e *htmlFigure) TabIndex(v int) HTMLFigure {
  13010. e.setAttr("tabindex", v)
  13011. return e
  13012. }
  13013. func (e *htmlFigure) Title(v string) HTMLFigure {
  13014. e.setAttr("title", v)
  13015. return e
  13016. }
  13017. func (e *htmlFigure) On(event string, h EventHandler, scope ...any) HTMLFigure {
  13018. e.setEventHandler(event, h, scope...)
  13019. return e
  13020. }
  13021. func (e *htmlFigure) OnBlur(h EventHandler, scope ...any) HTMLFigure {
  13022. e.setEventHandler("blur", h, scope...)
  13023. return e
  13024. }
  13025. func (e *htmlFigure) OnChange(h EventHandler, scope ...any) HTMLFigure {
  13026. e.setEventHandler("change", h, scope...)
  13027. return e
  13028. }
  13029. func (e *htmlFigure) OnClick(h EventHandler, scope ...any) HTMLFigure {
  13030. e.setEventHandler("click", h, scope...)
  13031. return e
  13032. }
  13033. func (e *htmlFigure) OnContextMenu(h EventHandler, scope ...any) HTMLFigure {
  13034. e.setEventHandler("contextmenu", h, scope...)
  13035. return e
  13036. }
  13037. func (e *htmlFigure) OnCopy(h EventHandler, scope ...any) HTMLFigure {
  13038. e.setEventHandler("copy", h, scope...)
  13039. return e
  13040. }
  13041. func (e *htmlFigure) OnCut(h EventHandler, scope ...any) HTMLFigure {
  13042. e.setEventHandler("cut", h, scope...)
  13043. return e
  13044. }
  13045. func (e *htmlFigure) OnDblClick(h EventHandler, scope ...any) HTMLFigure {
  13046. e.setEventHandler("dblclick", h, scope...)
  13047. return e
  13048. }
  13049. func (e *htmlFigure) OnDrag(h EventHandler, scope ...any) HTMLFigure {
  13050. e.setEventHandler("drag", h, scope...)
  13051. return e
  13052. }
  13053. func (e *htmlFigure) OnDragEnd(h EventHandler, scope ...any) HTMLFigure {
  13054. e.setEventHandler("dragend", h, scope...)
  13055. return e
  13056. }
  13057. func (e *htmlFigure) OnDragEnter(h EventHandler, scope ...any) HTMLFigure {
  13058. e.setEventHandler("dragenter", h, scope...)
  13059. return e
  13060. }
  13061. func (e *htmlFigure) OnDragLeave(h EventHandler, scope ...any) HTMLFigure {
  13062. e.setEventHandler("dragleave", h, scope...)
  13063. return e
  13064. }
  13065. func (e *htmlFigure) OnDragOver(h EventHandler, scope ...any) HTMLFigure {
  13066. e.setEventHandler("dragover", h, scope...)
  13067. return e
  13068. }
  13069. func (e *htmlFigure) OnDragStart(h EventHandler, scope ...any) HTMLFigure {
  13070. e.setEventHandler("dragstart", h, scope...)
  13071. return e
  13072. }
  13073. func (e *htmlFigure) OnDrop(h EventHandler, scope ...any) HTMLFigure {
  13074. e.setEventHandler("drop", h, scope...)
  13075. return e
  13076. }
  13077. func (e *htmlFigure) OnFocus(h EventHandler, scope ...any) HTMLFigure {
  13078. e.setEventHandler("focus", h, scope...)
  13079. return e
  13080. }
  13081. func (e *htmlFigure) OnInput(h EventHandler, scope ...any) HTMLFigure {
  13082. e.setEventHandler("input", h, scope...)
  13083. return e
  13084. }
  13085. func (e *htmlFigure) OnInvalid(h EventHandler, scope ...any) HTMLFigure {
  13086. e.setEventHandler("invalid", h, scope...)
  13087. return e
  13088. }
  13089. func (e *htmlFigure) OnKeyDown(h EventHandler, scope ...any) HTMLFigure {
  13090. e.setEventHandler("keydown", h, scope...)
  13091. return e
  13092. }
  13093. func (e *htmlFigure) OnKeyPress(h EventHandler, scope ...any) HTMLFigure {
  13094. e.setEventHandler("keypress", h, scope...)
  13095. return e
  13096. }
  13097. func (e *htmlFigure) OnKeyUp(h EventHandler, scope ...any) HTMLFigure {
  13098. e.setEventHandler("keyup", h, scope...)
  13099. return e
  13100. }
  13101. func (e *htmlFigure) OnMouseDown(h EventHandler, scope ...any) HTMLFigure {
  13102. e.setEventHandler("mousedown", h, scope...)
  13103. return e
  13104. }
  13105. func (e *htmlFigure) OnMouseMove(h EventHandler, scope ...any) HTMLFigure {
  13106. e.setEventHandler("mousemove", h, scope...)
  13107. return e
  13108. }
  13109. func (e *htmlFigure) OnMouseOut(h EventHandler, scope ...any) HTMLFigure {
  13110. e.setEventHandler("mouseout", h, scope...)
  13111. return e
  13112. }
  13113. func (e *htmlFigure) OnMouseOver(h EventHandler, scope ...any) HTMLFigure {
  13114. e.setEventHandler("mouseover", h, scope...)
  13115. return e
  13116. }
  13117. func (e *htmlFigure) OnMouseUp(h EventHandler, scope ...any) HTMLFigure {
  13118. e.setEventHandler("mouseup", h, scope...)
  13119. return e
  13120. }
  13121. func (e *htmlFigure) OnPaste(h EventHandler, scope ...any) HTMLFigure {
  13122. e.setEventHandler("paste", h, scope...)
  13123. return e
  13124. }
  13125. func (e *htmlFigure) OnReset(h EventHandler, scope ...any) HTMLFigure {
  13126. e.setEventHandler("reset", h, scope...)
  13127. return e
  13128. }
  13129. func (e *htmlFigure) OnScroll(h EventHandler, scope ...any) HTMLFigure {
  13130. e.setEventHandler("scroll", h, scope...)
  13131. return e
  13132. }
  13133. func (e *htmlFigure) OnSearch(h EventHandler, scope ...any) HTMLFigure {
  13134. e.setEventHandler("search", h, scope...)
  13135. return e
  13136. }
  13137. func (e *htmlFigure) OnSelect(h EventHandler, scope ...any) HTMLFigure {
  13138. e.setEventHandler("select", h, scope...)
  13139. return e
  13140. }
  13141. func (e *htmlFigure) OnSubmit(h EventHandler, scope ...any) HTMLFigure {
  13142. e.setEventHandler("submit", h, scope...)
  13143. return e
  13144. }
  13145. func (e *htmlFigure) OnWheel(h EventHandler, scope ...any) HTMLFigure {
  13146. e.setEventHandler("wheel", h, scope...)
  13147. return e
  13148. }
  13149. // HTMLFooter is the interface that describes a "footer" HTML element.
  13150. type HTMLFooter interface {
  13151. UI
  13152. // Body set the content of the element.
  13153. Body(elems ...UI) HTMLFooter
  13154. // Text sets the content of the element with a text node containing the stringified given value.
  13155. Text(v any) HTMLFooter
  13156. // AccessKey specifies a shortcut key to activate/focus an element.
  13157. AccessKey(v string) HTMLFooter
  13158. // Aria stores accessible rich internet applications (ARIA) data.
  13159. Aria(k string, v any) HTMLFooter
  13160. // Attr sets the named attribute with the given value.
  13161. Attr(n string, v any) HTMLFooter
  13162. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  13163. Class(v ...string) HTMLFooter
  13164. // ContentEditable specifies whether the content of an element is editable or not.
  13165. ContentEditable(v bool) HTMLFooter
  13166. // DataSet stores custom data private to the page or application.
  13167. DataSet(k string, v any) HTMLFooter
  13168. // Dir specifies the text direction for the content in an element.
  13169. Dir(v string) HTMLFooter
  13170. // Draggable specifies whether an element is draggable or not.
  13171. Draggable(v bool) HTMLFooter
  13172. // Hidden specifies that an element is not yet, or is no longer relevant.
  13173. Hidden(v bool) HTMLFooter
  13174. // ID specifies a unique id for an element.
  13175. ID(v string) HTMLFooter
  13176. // Lang specifies the language of the element's content.
  13177. Lang(v string) HTMLFooter
  13178. // Role specifies to parsing software the exact function of an element (and its children).
  13179. Role(v string) HTMLFooter
  13180. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  13181. Spellcheck(v bool) HTMLFooter
  13182. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  13183. Style(k, v string) HTMLFooter
  13184. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  13185. Styles(s map[string]string) HTMLFooter
  13186. // TabIndex specifies the tabbing order of an element.
  13187. TabIndex(v int) HTMLFooter
  13188. // Title specifies extra information about an element.
  13189. Title(v string) HTMLFooter
  13190. // On registers the given event handler to the specified event.
  13191. On(event string, h EventHandler, scope ...any) HTMLFooter
  13192. // OnBlur calls the given handler when the element loses focus.
  13193. OnBlur(h EventHandler, scope ...any) HTMLFooter
  13194. // OnChange calls the given handler when the value of the element is changed.
  13195. OnChange(h EventHandler, scope ...any) HTMLFooter
  13196. // OnClick calls the given handler when there is a mouse click on the element.
  13197. OnClick(h EventHandler, scope ...any) HTMLFooter
  13198. // OnContextMenu calls the given handler when a context menu is triggered.
  13199. OnContextMenu(h EventHandler, scope ...any) HTMLFooter
  13200. // OnCopy calls the given handler when the user copies the content of an element.
  13201. OnCopy(h EventHandler, scope ...any) HTMLFooter
  13202. // OnCut calls the given handler when the user cuts the content of an element.
  13203. OnCut(h EventHandler, scope ...any) HTMLFooter
  13204. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  13205. OnDblClick(h EventHandler, scope ...any) HTMLFooter
  13206. // OnDrag calls the given handler when an element is dragged.
  13207. OnDrag(h EventHandler, scope ...any) HTMLFooter
  13208. // OnDragEnd calls the given handler at the end of a drag operation.
  13209. OnDragEnd(h EventHandler, scope ...any) HTMLFooter
  13210. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  13211. OnDragEnter(h EventHandler, scope ...any) HTMLFooter
  13212. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  13213. OnDragLeave(h EventHandler, scope ...any) HTMLFooter
  13214. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  13215. OnDragOver(h EventHandler, scope ...any) HTMLFooter
  13216. // OnDragStart calls the given handler at the start of a drag operation.
  13217. OnDragStart(h EventHandler, scope ...any) HTMLFooter
  13218. // OnDrop calls the given handler when dragged element is being dropped.
  13219. OnDrop(h EventHandler, scope ...any) HTMLFooter
  13220. // OnFocus calls the given handler when the element gets focus.
  13221. OnFocus(h EventHandler, scope ...any) HTMLFooter
  13222. // OnInput calls the given handler when an element gets user input.
  13223. OnInput(h EventHandler, scope ...any) HTMLFooter
  13224. // OnInvalid calls the given handler when an element is invalid.
  13225. OnInvalid(h EventHandler, scope ...any) HTMLFooter
  13226. // OnKeyDown calls the given handler when a user is pressing a key.
  13227. OnKeyDown(h EventHandler, scope ...any) HTMLFooter
  13228. // OnKeyPress calls the given handler when a user presses a key.
  13229. OnKeyPress(h EventHandler, scope ...any) HTMLFooter
  13230. // OnKeyUp calls the given handler when a user releases a key.
  13231. OnKeyUp(h EventHandler, scope ...any) HTMLFooter
  13232. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  13233. OnMouseDown(h EventHandler, scope ...any) HTMLFooter
  13234. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  13235. OnMouseMove(h EventHandler, scope ...any) HTMLFooter
  13236. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  13237. OnMouseOut(h EventHandler, scope ...any) HTMLFooter
  13238. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  13239. OnMouseOver(h EventHandler, scope ...any) HTMLFooter
  13240. // OnMouseUp calls the given handler when a mouse button is released over an element.
  13241. OnMouseUp(h EventHandler, scope ...any) HTMLFooter
  13242. // OnPaste calls the given handler when the user pastes some content in an element.
  13243. OnPaste(h EventHandler, scope ...any) HTMLFooter
  13244. // OnReset calls the given handler when the Reset button in a form is clicked.
  13245. OnReset(h EventHandler, scope ...any) HTMLFooter
  13246. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  13247. OnScroll(h EventHandler, scope ...any) HTMLFooter
  13248. // OnSearch calls the given handler when the user writes something in a search field.
  13249. OnSearch(h EventHandler, scope ...any) HTMLFooter
  13250. // OnSelect calls the given handler after some text has been selected in an element.
  13251. OnSelect(h EventHandler, scope ...any) HTMLFooter
  13252. // OnSubmit calls the given handler when a form is submitted.
  13253. OnSubmit(h EventHandler, scope ...any) HTMLFooter
  13254. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  13255. OnWheel(h EventHandler, scope ...any) HTMLFooter
  13256. }
  13257. // Footer returns an HTML element that defines a footer for a document or section.
  13258. func Footer() HTMLFooter {
  13259. e := &htmlFooter{
  13260. htmlElement: htmlElement{
  13261. tag: "footer",
  13262. isSelfClosing: false,
  13263. },
  13264. }
  13265. return e
  13266. }
  13267. type htmlFooter struct {
  13268. htmlElement
  13269. }
  13270. func (e *htmlFooter) Body(v ...UI) HTMLFooter {
  13271. e.setChildren(v...)
  13272. return e
  13273. }
  13274. func (e *htmlFooter) Text(v any) HTMLFooter {
  13275. return e.Body(Text(v))
  13276. }
  13277. func (e *htmlFooter) AccessKey(v string) HTMLFooter {
  13278. e.setAttr("accesskey", v)
  13279. return e
  13280. }
  13281. func (e *htmlFooter) Aria(k string, v any) HTMLFooter {
  13282. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  13283. return e
  13284. }
  13285. func (e *htmlFooter) Attr(n string, v any) HTMLFooter {
  13286. e.setAttr(n, v)
  13287. return e
  13288. }
  13289. func (e *htmlFooter) Class(v ...string) HTMLFooter {
  13290. e.setAttr("class", strings.Join(v, " "))
  13291. return e
  13292. }
  13293. func (e *htmlFooter) ContentEditable(v bool) HTMLFooter {
  13294. e.setAttr("contenteditable", v)
  13295. return e
  13296. }
  13297. func (e *htmlFooter) DataSet(k string, v any) HTMLFooter {
  13298. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  13299. return e
  13300. }
  13301. func (e *htmlFooter) Dir(v string) HTMLFooter {
  13302. e.setAttr("dir", v)
  13303. return e
  13304. }
  13305. func (e *htmlFooter) Draggable(v bool) HTMLFooter {
  13306. e.setAttr("draggable", v)
  13307. return e
  13308. }
  13309. func (e *htmlFooter) Hidden(v bool) HTMLFooter {
  13310. e.setAttr("hidden", v)
  13311. return e
  13312. }
  13313. func (e *htmlFooter) ID(v string) HTMLFooter {
  13314. e.setAttr("id", v)
  13315. return e
  13316. }
  13317. func (e *htmlFooter) Lang(v string) HTMLFooter {
  13318. e.setAttr("lang", v)
  13319. return e
  13320. }
  13321. func (e *htmlFooter) Role(v string) HTMLFooter {
  13322. e.setAttr("role", v)
  13323. return e
  13324. }
  13325. func (e *htmlFooter) Spellcheck(v bool) HTMLFooter {
  13326. s := "false"
  13327. if v {
  13328. s = "true"
  13329. }
  13330. e.setAttr("spellcheck", s)
  13331. return e
  13332. }
  13333. func (e *htmlFooter) Style(k, v string) HTMLFooter {
  13334. e.setAttr("style", k+":"+v)
  13335. return e
  13336. }
  13337. func (e *htmlFooter) Styles(s map[string]string) HTMLFooter {
  13338. for k, v := range s {
  13339. e.Style(k, v)
  13340. }
  13341. return e
  13342. }
  13343. func (e *htmlFooter) TabIndex(v int) HTMLFooter {
  13344. e.setAttr("tabindex", v)
  13345. return e
  13346. }
  13347. func (e *htmlFooter) Title(v string) HTMLFooter {
  13348. e.setAttr("title", v)
  13349. return e
  13350. }
  13351. func (e *htmlFooter) On(event string, h EventHandler, scope ...any) HTMLFooter {
  13352. e.setEventHandler(event, h, scope...)
  13353. return e
  13354. }
  13355. func (e *htmlFooter) OnBlur(h EventHandler, scope ...any) HTMLFooter {
  13356. e.setEventHandler("blur", h, scope...)
  13357. return e
  13358. }
  13359. func (e *htmlFooter) OnChange(h EventHandler, scope ...any) HTMLFooter {
  13360. e.setEventHandler("change", h, scope...)
  13361. return e
  13362. }
  13363. func (e *htmlFooter) OnClick(h EventHandler, scope ...any) HTMLFooter {
  13364. e.setEventHandler("click", h, scope...)
  13365. return e
  13366. }
  13367. func (e *htmlFooter) OnContextMenu(h EventHandler, scope ...any) HTMLFooter {
  13368. e.setEventHandler("contextmenu", h, scope...)
  13369. return e
  13370. }
  13371. func (e *htmlFooter) OnCopy(h EventHandler, scope ...any) HTMLFooter {
  13372. e.setEventHandler("copy", h, scope...)
  13373. return e
  13374. }
  13375. func (e *htmlFooter) OnCut(h EventHandler, scope ...any) HTMLFooter {
  13376. e.setEventHandler("cut", h, scope...)
  13377. return e
  13378. }
  13379. func (e *htmlFooter) OnDblClick(h EventHandler, scope ...any) HTMLFooter {
  13380. e.setEventHandler("dblclick", h, scope...)
  13381. return e
  13382. }
  13383. func (e *htmlFooter) OnDrag(h EventHandler, scope ...any) HTMLFooter {
  13384. e.setEventHandler("drag", h, scope...)
  13385. return e
  13386. }
  13387. func (e *htmlFooter) OnDragEnd(h EventHandler, scope ...any) HTMLFooter {
  13388. e.setEventHandler("dragend", h, scope...)
  13389. return e
  13390. }
  13391. func (e *htmlFooter) OnDragEnter(h EventHandler, scope ...any) HTMLFooter {
  13392. e.setEventHandler("dragenter", h, scope...)
  13393. return e
  13394. }
  13395. func (e *htmlFooter) OnDragLeave(h EventHandler, scope ...any) HTMLFooter {
  13396. e.setEventHandler("dragleave", h, scope...)
  13397. return e
  13398. }
  13399. func (e *htmlFooter) OnDragOver(h EventHandler, scope ...any) HTMLFooter {
  13400. e.setEventHandler("dragover", h, scope...)
  13401. return e
  13402. }
  13403. func (e *htmlFooter) OnDragStart(h EventHandler, scope ...any) HTMLFooter {
  13404. e.setEventHandler("dragstart", h, scope...)
  13405. return e
  13406. }
  13407. func (e *htmlFooter) OnDrop(h EventHandler, scope ...any) HTMLFooter {
  13408. e.setEventHandler("drop", h, scope...)
  13409. return e
  13410. }
  13411. func (e *htmlFooter) OnFocus(h EventHandler, scope ...any) HTMLFooter {
  13412. e.setEventHandler("focus", h, scope...)
  13413. return e
  13414. }
  13415. func (e *htmlFooter) OnInput(h EventHandler, scope ...any) HTMLFooter {
  13416. e.setEventHandler("input", h, scope...)
  13417. return e
  13418. }
  13419. func (e *htmlFooter) OnInvalid(h EventHandler, scope ...any) HTMLFooter {
  13420. e.setEventHandler("invalid", h, scope...)
  13421. return e
  13422. }
  13423. func (e *htmlFooter) OnKeyDown(h EventHandler, scope ...any) HTMLFooter {
  13424. e.setEventHandler("keydown", h, scope...)
  13425. return e
  13426. }
  13427. func (e *htmlFooter) OnKeyPress(h EventHandler, scope ...any) HTMLFooter {
  13428. e.setEventHandler("keypress", h, scope...)
  13429. return e
  13430. }
  13431. func (e *htmlFooter) OnKeyUp(h EventHandler, scope ...any) HTMLFooter {
  13432. e.setEventHandler("keyup", h, scope...)
  13433. return e
  13434. }
  13435. func (e *htmlFooter) OnMouseDown(h EventHandler, scope ...any) HTMLFooter {
  13436. e.setEventHandler("mousedown", h, scope...)
  13437. return e
  13438. }
  13439. func (e *htmlFooter) OnMouseMove(h EventHandler, scope ...any) HTMLFooter {
  13440. e.setEventHandler("mousemove", h, scope...)
  13441. return e
  13442. }
  13443. func (e *htmlFooter) OnMouseOut(h EventHandler, scope ...any) HTMLFooter {
  13444. e.setEventHandler("mouseout", h, scope...)
  13445. return e
  13446. }
  13447. func (e *htmlFooter) OnMouseOver(h EventHandler, scope ...any) HTMLFooter {
  13448. e.setEventHandler("mouseover", h, scope...)
  13449. return e
  13450. }
  13451. func (e *htmlFooter) OnMouseUp(h EventHandler, scope ...any) HTMLFooter {
  13452. e.setEventHandler("mouseup", h, scope...)
  13453. return e
  13454. }
  13455. func (e *htmlFooter) OnPaste(h EventHandler, scope ...any) HTMLFooter {
  13456. e.setEventHandler("paste", h, scope...)
  13457. return e
  13458. }
  13459. func (e *htmlFooter) OnReset(h EventHandler, scope ...any) HTMLFooter {
  13460. e.setEventHandler("reset", h, scope...)
  13461. return e
  13462. }
  13463. func (e *htmlFooter) OnScroll(h EventHandler, scope ...any) HTMLFooter {
  13464. e.setEventHandler("scroll", h, scope...)
  13465. return e
  13466. }
  13467. func (e *htmlFooter) OnSearch(h EventHandler, scope ...any) HTMLFooter {
  13468. e.setEventHandler("search", h, scope...)
  13469. return e
  13470. }
  13471. func (e *htmlFooter) OnSelect(h EventHandler, scope ...any) HTMLFooter {
  13472. e.setEventHandler("select", h, scope...)
  13473. return e
  13474. }
  13475. func (e *htmlFooter) OnSubmit(h EventHandler, scope ...any) HTMLFooter {
  13476. e.setEventHandler("submit", h, scope...)
  13477. return e
  13478. }
  13479. func (e *htmlFooter) OnWheel(h EventHandler, scope ...any) HTMLFooter {
  13480. e.setEventHandler("wheel", h, scope...)
  13481. return e
  13482. }
  13483. // HTMLForm is the interface that describes a "form" HTML element.
  13484. type HTMLForm interface {
  13485. UI
  13486. // Body set the content of the element.
  13487. Body(elems ...UI) HTMLForm
  13488. // Text sets the content of the element with a text node containing the stringified given value.
  13489. Text(v any) HTMLForm
  13490. // AcceptCharset specifies the character encodings that are to be used for the form submission.
  13491. AcceptCharset(v string) HTMLForm
  13492. // AccessKey specifies a shortcut key to activate/focus an element.
  13493. AccessKey(v string) HTMLForm
  13494. // Action specifies where to send the form-data when a form is submitted.
  13495. Action(v string) HTMLForm
  13496. // Aria stores accessible rich internet applications (ARIA) data.
  13497. Aria(k string, v any) HTMLForm
  13498. // Attr sets the named attribute with the given value.
  13499. Attr(n string, v any) HTMLForm
  13500. // AutoComplete specifies whether the element should have autocomplete enabled.
  13501. AutoComplete(v bool) HTMLForm
  13502. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  13503. Class(v ...string) HTMLForm
  13504. // ContentEditable specifies whether the content of an element is editable or not.
  13505. ContentEditable(v bool) HTMLForm
  13506. // DataSet stores custom data private to the page or application.
  13507. DataSet(k string, v any) HTMLForm
  13508. // Dir specifies the text direction for the content in an element.
  13509. Dir(v string) HTMLForm
  13510. // Draggable specifies whether an element is draggable or not.
  13511. Draggable(v bool) HTMLForm
  13512. // EncType specifies how the form-data should be encoded when submitting it to the server (only for post method).
  13513. EncType(v string) HTMLForm
  13514. // Hidden specifies that an element is not yet, or is no longer relevant.
  13515. Hidden(v bool) HTMLForm
  13516. // ID specifies a unique id for an element.
  13517. ID(v string) HTMLForm
  13518. // Lang specifies the language of the element's content.
  13519. Lang(v string) HTMLForm
  13520. // Method specifies the HTTP method to use when sending form-data.
  13521. Method(v string) HTMLForm
  13522. // Name specifies the name of the element.
  13523. Name(v string) HTMLForm
  13524. // NoValidate specifies that the form should not be validated when submitted.
  13525. NoValidate(v bool) HTMLForm
  13526. // Role specifies to parsing software the exact function of an element (and its children).
  13527. Role(v string) HTMLForm
  13528. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  13529. Spellcheck(v bool) HTMLForm
  13530. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  13531. Style(k, v string) HTMLForm
  13532. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  13533. Styles(s map[string]string) HTMLForm
  13534. // TabIndex specifies the tabbing order of an element.
  13535. TabIndex(v int) HTMLForm
  13536. // Target specifies the target for where to open the linked document or where to submit the form.
  13537. Target(v string) HTMLForm
  13538. // Title specifies extra information about an element.
  13539. Title(v string) HTMLForm
  13540. // On registers the given event handler to the specified event.
  13541. On(event string, h EventHandler, scope ...any) HTMLForm
  13542. // OnBlur calls the given handler when the element loses focus.
  13543. OnBlur(h EventHandler, scope ...any) HTMLForm
  13544. // OnChange calls the given handler when the value of the element is changed.
  13545. OnChange(h EventHandler, scope ...any) HTMLForm
  13546. // OnClick calls the given handler when there is a mouse click on the element.
  13547. OnClick(h EventHandler, scope ...any) HTMLForm
  13548. // OnContextMenu calls the given handler when a context menu is triggered.
  13549. OnContextMenu(h EventHandler, scope ...any) HTMLForm
  13550. // OnCopy calls the given handler when the user copies the content of an element.
  13551. OnCopy(h EventHandler, scope ...any) HTMLForm
  13552. // OnCut calls the given handler when the user cuts the content of an element.
  13553. OnCut(h EventHandler, scope ...any) HTMLForm
  13554. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  13555. OnDblClick(h EventHandler, scope ...any) HTMLForm
  13556. // OnDrag calls the given handler when an element is dragged.
  13557. OnDrag(h EventHandler, scope ...any) HTMLForm
  13558. // OnDragEnd calls the given handler at the end of a drag operation.
  13559. OnDragEnd(h EventHandler, scope ...any) HTMLForm
  13560. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  13561. OnDragEnter(h EventHandler, scope ...any) HTMLForm
  13562. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  13563. OnDragLeave(h EventHandler, scope ...any) HTMLForm
  13564. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  13565. OnDragOver(h EventHandler, scope ...any) HTMLForm
  13566. // OnDragStart calls the given handler at the start of a drag operation.
  13567. OnDragStart(h EventHandler, scope ...any) HTMLForm
  13568. // OnDrop calls the given handler when dragged element is being dropped.
  13569. OnDrop(h EventHandler, scope ...any) HTMLForm
  13570. // OnFocus calls the given handler when the element gets focus.
  13571. OnFocus(h EventHandler, scope ...any) HTMLForm
  13572. // OnInput calls the given handler when an element gets user input.
  13573. OnInput(h EventHandler, scope ...any) HTMLForm
  13574. // OnInvalid calls the given handler when an element is invalid.
  13575. OnInvalid(h EventHandler, scope ...any) HTMLForm
  13576. // OnKeyDown calls the given handler when a user is pressing a key.
  13577. OnKeyDown(h EventHandler, scope ...any) HTMLForm
  13578. // OnKeyPress calls the given handler when a user presses a key.
  13579. OnKeyPress(h EventHandler, scope ...any) HTMLForm
  13580. // OnKeyUp calls the given handler when a user releases a key.
  13581. OnKeyUp(h EventHandler, scope ...any) HTMLForm
  13582. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  13583. OnMouseDown(h EventHandler, scope ...any) HTMLForm
  13584. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  13585. OnMouseMove(h EventHandler, scope ...any) HTMLForm
  13586. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  13587. OnMouseOut(h EventHandler, scope ...any) HTMLForm
  13588. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  13589. OnMouseOver(h EventHandler, scope ...any) HTMLForm
  13590. // OnMouseUp calls the given handler when a mouse button is released over an element.
  13591. OnMouseUp(h EventHandler, scope ...any) HTMLForm
  13592. // OnPaste calls the given handler when the user pastes some content in an element.
  13593. OnPaste(h EventHandler, scope ...any) HTMLForm
  13594. // OnReset calls the given handler when the Reset button in a form is clicked.
  13595. OnReset(h EventHandler, scope ...any) HTMLForm
  13596. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  13597. OnScroll(h EventHandler, scope ...any) HTMLForm
  13598. // OnSearch calls the given handler when the user writes something in a search field.
  13599. OnSearch(h EventHandler, scope ...any) HTMLForm
  13600. // OnSelect calls the given handler after some text has been selected in an element.
  13601. OnSelect(h EventHandler, scope ...any) HTMLForm
  13602. // OnSubmit calls the given handler when a form is submitted.
  13603. OnSubmit(h EventHandler, scope ...any) HTMLForm
  13604. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  13605. OnWheel(h EventHandler, scope ...any) HTMLForm
  13606. }
  13607. // Form returns an HTML element that defines an HTML form for user input.
  13608. func Form() HTMLForm {
  13609. e := &htmlForm{
  13610. htmlElement: htmlElement{
  13611. tag: "form",
  13612. isSelfClosing: false,
  13613. },
  13614. }
  13615. return e
  13616. }
  13617. type htmlForm struct {
  13618. htmlElement
  13619. }
  13620. func (e *htmlForm) Body(v ...UI) HTMLForm {
  13621. e.setChildren(v...)
  13622. return e
  13623. }
  13624. func (e *htmlForm) Text(v any) HTMLForm {
  13625. return e.Body(Text(v))
  13626. }
  13627. func (e *htmlForm) AcceptCharset(v string) HTMLForm {
  13628. e.setAttr("accept-charset", v)
  13629. return e
  13630. }
  13631. func (e *htmlForm) AccessKey(v string) HTMLForm {
  13632. e.setAttr("accesskey", v)
  13633. return e
  13634. }
  13635. func (e *htmlForm) Action(v string) HTMLForm {
  13636. e.setAttr("action", v)
  13637. return e
  13638. }
  13639. func (e *htmlForm) Aria(k string, v any) HTMLForm {
  13640. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  13641. return e
  13642. }
  13643. func (e *htmlForm) Attr(n string, v any) HTMLForm {
  13644. e.setAttr(n, v)
  13645. return e
  13646. }
  13647. func (e *htmlForm) AutoComplete(v bool) HTMLForm {
  13648. s := "off"
  13649. if v {
  13650. s = "on"
  13651. }
  13652. e.setAttr("autocomplete", s)
  13653. return e
  13654. }
  13655. func (e *htmlForm) Class(v ...string) HTMLForm {
  13656. e.setAttr("class", strings.Join(v, " "))
  13657. return e
  13658. }
  13659. func (e *htmlForm) ContentEditable(v bool) HTMLForm {
  13660. e.setAttr("contenteditable", v)
  13661. return e
  13662. }
  13663. func (e *htmlForm) DataSet(k string, v any) HTMLForm {
  13664. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  13665. return e
  13666. }
  13667. func (e *htmlForm) Dir(v string) HTMLForm {
  13668. e.setAttr("dir", v)
  13669. return e
  13670. }
  13671. func (e *htmlForm) Draggable(v bool) HTMLForm {
  13672. e.setAttr("draggable", v)
  13673. return e
  13674. }
  13675. func (e *htmlForm) EncType(v string) HTMLForm {
  13676. e.setAttr("enctype", v)
  13677. return e
  13678. }
  13679. func (e *htmlForm) Hidden(v bool) HTMLForm {
  13680. e.setAttr("hidden", v)
  13681. return e
  13682. }
  13683. func (e *htmlForm) ID(v string) HTMLForm {
  13684. e.setAttr("id", v)
  13685. return e
  13686. }
  13687. func (e *htmlForm) Lang(v string) HTMLForm {
  13688. e.setAttr("lang", v)
  13689. return e
  13690. }
  13691. func (e *htmlForm) Method(v string) HTMLForm {
  13692. e.setAttr("method", v)
  13693. return e
  13694. }
  13695. func (e *htmlForm) Name(v string) HTMLForm {
  13696. e.setAttr("name", v)
  13697. return e
  13698. }
  13699. func (e *htmlForm) NoValidate(v bool) HTMLForm {
  13700. e.setAttr("novalidate", v)
  13701. return e
  13702. }
  13703. func (e *htmlForm) Role(v string) HTMLForm {
  13704. e.setAttr("role", v)
  13705. return e
  13706. }
  13707. func (e *htmlForm) Spellcheck(v bool) HTMLForm {
  13708. s := "false"
  13709. if v {
  13710. s = "true"
  13711. }
  13712. e.setAttr("spellcheck", s)
  13713. return e
  13714. }
  13715. func (e *htmlForm) Style(k, v string) HTMLForm {
  13716. e.setAttr("style", k+":"+v)
  13717. return e
  13718. }
  13719. func (e *htmlForm) Styles(s map[string]string) HTMLForm {
  13720. for k, v := range s {
  13721. e.Style(k, v)
  13722. }
  13723. return e
  13724. }
  13725. func (e *htmlForm) TabIndex(v int) HTMLForm {
  13726. e.setAttr("tabindex", v)
  13727. return e
  13728. }
  13729. func (e *htmlForm) Target(v string) HTMLForm {
  13730. e.setAttr("target", v)
  13731. return e
  13732. }
  13733. func (e *htmlForm) Title(v string) HTMLForm {
  13734. e.setAttr("title", v)
  13735. return e
  13736. }
  13737. func (e *htmlForm) On(event string, h EventHandler, scope ...any) HTMLForm {
  13738. e.setEventHandler(event, h, scope...)
  13739. return e
  13740. }
  13741. func (e *htmlForm) OnBlur(h EventHandler, scope ...any) HTMLForm {
  13742. e.setEventHandler("blur", h, scope...)
  13743. return e
  13744. }
  13745. func (e *htmlForm) OnChange(h EventHandler, scope ...any) HTMLForm {
  13746. e.setEventHandler("change", h, scope...)
  13747. return e
  13748. }
  13749. func (e *htmlForm) OnClick(h EventHandler, scope ...any) HTMLForm {
  13750. e.setEventHandler("click", h, scope...)
  13751. return e
  13752. }
  13753. func (e *htmlForm) OnContextMenu(h EventHandler, scope ...any) HTMLForm {
  13754. e.setEventHandler("contextmenu", h, scope...)
  13755. return e
  13756. }
  13757. func (e *htmlForm) OnCopy(h EventHandler, scope ...any) HTMLForm {
  13758. e.setEventHandler("copy", h, scope...)
  13759. return e
  13760. }
  13761. func (e *htmlForm) OnCut(h EventHandler, scope ...any) HTMLForm {
  13762. e.setEventHandler("cut", h, scope...)
  13763. return e
  13764. }
  13765. func (e *htmlForm) OnDblClick(h EventHandler, scope ...any) HTMLForm {
  13766. e.setEventHandler("dblclick", h, scope...)
  13767. return e
  13768. }
  13769. func (e *htmlForm) OnDrag(h EventHandler, scope ...any) HTMLForm {
  13770. e.setEventHandler("drag", h, scope...)
  13771. return e
  13772. }
  13773. func (e *htmlForm) OnDragEnd(h EventHandler, scope ...any) HTMLForm {
  13774. e.setEventHandler("dragend", h, scope...)
  13775. return e
  13776. }
  13777. func (e *htmlForm) OnDragEnter(h EventHandler, scope ...any) HTMLForm {
  13778. e.setEventHandler("dragenter", h, scope...)
  13779. return e
  13780. }
  13781. func (e *htmlForm) OnDragLeave(h EventHandler, scope ...any) HTMLForm {
  13782. e.setEventHandler("dragleave", h, scope...)
  13783. return e
  13784. }
  13785. func (e *htmlForm) OnDragOver(h EventHandler, scope ...any) HTMLForm {
  13786. e.setEventHandler("dragover", h, scope...)
  13787. return e
  13788. }
  13789. func (e *htmlForm) OnDragStart(h EventHandler, scope ...any) HTMLForm {
  13790. e.setEventHandler("dragstart", h, scope...)
  13791. return e
  13792. }
  13793. func (e *htmlForm) OnDrop(h EventHandler, scope ...any) HTMLForm {
  13794. e.setEventHandler("drop", h, scope...)
  13795. return e
  13796. }
  13797. func (e *htmlForm) OnFocus(h EventHandler, scope ...any) HTMLForm {
  13798. e.setEventHandler("focus", h, scope...)
  13799. return e
  13800. }
  13801. func (e *htmlForm) OnInput(h EventHandler, scope ...any) HTMLForm {
  13802. e.setEventHandler("input", h, scope...)
  13803. return e
  13804. }
  13805. func (e *htmlForm) OnInvalid(h EventHandler, scope ...any) HTMLForm {
  13806. e.setEventHandler("invalid", h, scope...)
  13807. return e
  13808. }
  13809. func (e *htmlForm) OnKeyDown(h EventHandler, scope ...any) HTMLForm {
  13810. e.setEventHandler("keydown", h, scope...)
  13811. return e
  13812. }
  13813. func (e *htmlForm) OnKeyPress(h EventHandler, scope ...any) HTMLForm {
  13814. e.setEventHandler("keypress", h, scope...)
  13815. return e
  13816. }
  13817. func (e *htmlForm) OnKeyUp(h EventHandler, scope ...any) HTMLForm {
  13818. e.setEventHandler("keyup", h, scope...)
  13819. return e
  13820. }
  13821. func (e *htmlForm) OnMouseDown(h EventHandler, scope ...any) HTMLForm {
  13822. e.setEventHandler("mousedown", h, scope...)
  13823. return e
  13824. }
  13825. func (e *htmlForm) OnMouseMove(h EventHandler, scope ...any) HTMLForm {
  13826. e.setEventHandler("mousemove", h, scope...)
  13827. return e
  13828. }
  13829. func (e *htmlForm) OnMouseOut(h EventHandler, scope ...any) HTMLForm {
  13830. e.setEventHandler("mouseout", h, scope...)
  13831. return e
  13832. }
  13833. func (e *htmlForm) OnMouseOver(h EventHandler, scope ...any) HTMLForm {
  13834. e.setEventHandler("mouseover", h, scope...)
  13835. return e
  13836. }
  13837. func (e *htmlForm) OnMouseUp(h EventHandler, scope ...any) HTMLForm {
  13838. e.setEventHandler("mouseup", h, scope...)
  13839. return e
  13840. }
  13841. func (e *htmlForm) OnPaste(h EventHandler, scope ...any) HTMLForm {
  13842. e.setEventHandler("paste", h, scope...)
  13843. return e
  13844. }
  13845. func (e *htmlForm) OnReset(h EventHandler, scope ...any) HTMLForm {
  13846. e.setEventHandler("reset", h, scope...)
  13847. return e
  13848. }
  13849. func (e *htmlForm) OnScroll(h EventHandler, scope ...any) HTMLForm {
  13850. e.setEventHandler("scroll", h, scope...)
  13851. return e
  13852. }
  13853. func (e *htmlForm) OnSearch(h EventHandler, scope ...any) HTMLForm {
  13854. e.setEventHandler("search", h, scope...)
  13855. return e
  13856. }
  13857. func (e *htmlForm) OnSelect(h EventHandler, scope ...any) HTMLForm {
  13858. e.setEventHandler("select", h, scope...)
  13859. return e
  13860. }
  13861. func (e *htmlForm) OnSubmit(h EventHandler, scope ...any) HTMLForm {
  13862. e.setEventHandler("submit", h, scope...)
  13863. return e
  13864. }
  13865. func (e *htmlForm) OnWheel(h EventHandler, scope ...any) HTMLForm {
  13866. e.setEventHandler("wheel", h, scope...)
  13867. return e
  13868. }
  13869. // HTMLH1 is the interface that describes a "h1" HTML element.
  13870. type HTMLH1 interface {
  13871. UI
  13872. // Body set the content of the element.
  13873. Body(elems ...UI) HTMLH1
  13874. // Text sets the content of the element with a text node containing the stringified given value.
  13875. Text(v any) HTMLH1
  13876. // AccessKey specifies a shortcut key to activate/focus an element.
  13877. AccessKey(v string) HTMLH1
  13878. // Aria stores accessible rich internet applications (ARIA) data.
  13879. Aria(k string, v any) HTMLH1
  13880. // Attr sets the named attribute with the given value.
  13881. Attr(n string, v any) HTMLH1
  13882. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  13883. Class(v ...string) HTMLH1
  13884. // ContentEditable specifies whether the content of an element is editable or not.
  13885. ContentEditable(v bool) HTMLH1
  13886. // DataSet stores custom data private to the page or application.
  13887. DataSet(k string, v any) HTMLH1
  13888. // Dir specifies the text direction for the content in an element.
  13889. Dir(v string) HTMLH1
  13890. // Draggable specifies whether an element is draggable or not.
  13891. Draggable(v bool) HTMLH1
  13892. // Hidden specifies that an element is not yet, or is no longer relevant.
  13893. Hidden(v bool) HTMLH1
  13894. // ID specifies a unique id for an element.
  13895. ID(v string) HTMLH1
  13896. // Lang specifies the language of the element's content.
  13897. Lang(v string) HTMLH1
  13898. // Role specifies to parsing software the exact function of an element (and its children).
  13899. Role(v string) HTMLH1
  13900. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  13901. Spellcheck(v bool) HTMLH1
  13902. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  13903. Style(k, v string) HTMLH1
  13904. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  13905. Styles(s map[string]string) HTMLH1
  13906. // TabIndex specifies the tabbing order of an element.
  13907. TabIndex(v int) HTMLH1
  13908. // Title specifies extra information about an element.
  13909. Title(v string) HTMLH1
  13910. // On registers the given event handler to the specified event.
  13911. On(event string, h EventHandler, scope ...any) HTMLH1
  13912. // OnBlur calls the given handler when the element loses focus.
  13913. OnBlur(h EventHandler, scope ...any) HTMLH1
  13914. // OnChange calls the given handler when the value of the element is changed.
  13915. OnChange(h EventHandler, scope ...any) HTMLH1
  13916. // OnClick calls the given handler when there is a mouse click on the element.
  13917. OnClick(h EventHandler, scope ...any) HTMLH1
  13918. // OnContextMenu calls the given handler when a context menu is triggered.
  13919. OnContextMenu(h EventHandler, scope ...any) HTMLH1
  13920. // OnCopy calls the given handler when the user copies the content of an element.
  13921. OnCopy(h EventHandler, scope ...any) HTMLH1
  13922. // OnCut calls the given handler when the user cuts the content of an element.
  13923. OnCut(h EventHandler, scope ...any) HTMLH1
  13924. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  13925. OnDblClick(h EventHandler, scope ...any) HTMLH1
  13926. // OnDrag calls the given handler when an element is dragged.
  13927. OnDrag(h EventHandler, scope ...any) HTMLH1
  13928. // OnDragEnd calls the given handler at the end of a drag operation.
  13929. OnDragEnd(h EventHandler, scope ...any) HTMLH1
  13930. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  13931. OnDragEnter(h EventHandler, scope ...any) HTMLH1
  13932. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  13933. OnDragLeave(h EventHandler, scope ...any) HTMLH1
  13934. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  13935. OnDragOver(h EventHandler, scope ...any) HTMLH1
  13936. // OnDragStart calls the given handler at the start of a drag operation.
  13937. OnDragStart(h EventHandler, scope ...any) HTMLH1
  13938. // OnDrop calls the given handler when dragged element is being dropped.
  13939. OnDrop(h EventHandler, scope ...any) HTMLH1
  13940. // OnFocus calls the given handler when the element gets focus.
  13941. OnFocus(h EventHandler, scope ...any) HTMLH1
  13942. // OnInput calls the given handler when an element gets user input.
  13943. OnInput(h EventHandler, scope ...any) HTMLH1
  13944. // OnInvalid calls the given handler when an element is invalid.
  13945. OnInvalid(h EventHandler, scope ...any) HTMLH1
  13946. // OnKeyDown calls the given handler when a user is pressing a key.
  13947. OnKeyDown(h EventHandler, scope ...any) HTMLH1
  13948. // OnKeyPress calls the given handler when a user presses a key.
  13949. OnKeyPress(h EventHandler, scope ...any) HTMLH1
  13950. // OnKeyUp calls the given handler when a user releases a key.
  13951. OnKeyUp(h EventHandler, scope ...any) HTMLH1
  13952. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  13953. OnMouseDown(h EventHandler, scope ...any) HTMLH1
  13954. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  13955. OnMouseMove(h EventHandler, scope ...any) HTMLH1
  13956. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  13957. OnMouseOut(h EventHandler, scope ...any) HTMLH1
  13958. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  13959. OnMouseOver(h EventHandler, scope ...any) HTMLH1
  13960. // OnMouseUp calls the given handler when a mouse button is released over an element.
  13961. OnMouseUp(h EventHandler, scope ...any) HTMLH1
  13962. // OnPaste calls the given handler when the user pastes some content in an element.
  13963. OnPaste(h EventHandler, scope ...any) HTMLH1
  13964. // OnReset calls the given handler when the Reset button in a form is clicked.
  13965. OnReset(h EventHandler, scope ...any) HTMLH1
  13966. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  13967. OnScroll(h EventHandler, scope ...any) HTMLH1
  13968. // OnSearch calls the given handler when the user writes something in a search field.
  13969. OnSearch(h EventHandler, scope ...any) HTMLH1
  13970. // OnSelect calls the given handler after some text has been selected in an element.
  13971. OnSelect(h EventHandler, scope ...any) HTMLH1
  13972. // OnSubmit calls the given handler when a form is submitted.
  13973. OnSubmit(h EventHandler, scope ...any) HTMLH1
  13974. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  13975. OnWheel(h EventHandler, scope ...any) HTMLH1
  13976. }
  13977. // H1 returns an HTML element that defines HTML heading.
  13978. func H1() HTMLH1 {
  13979. e := &htmlH1{
  13980. htmlElement: htmlElement{
  13981. tag: "h1",
  13982. isSelfClosing: false,
  13983. },
  13984. }
  13985. return e
  13986. }
  13987. type htmlH1 struct {
  13988. htmlElement
  13989. }
  13990. func (e *htmlH1) Body(v ...UI) HTMLH1 {
  13991. e.setChildren(v...)
  13992. return e
  13993. }
  13994. func (e *htmlH1) Text(v any) HTMLH1 {
  13995. return e.Body(Text(v))
  13996. }
  13997. func (e *htmlH1) AccessKey(v string) HTMLH1 {
  13998. e.setAttr("accesskey", v)
  13999. return e
  14000. }
  14001. func (e *htmlH1) Aria(k string, v any) HTMLH1 {
  14002. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  14003. return e
  14004. }
  14005. func (e *htmlH1) Attr(n string, v any) HTMLH1 {
  14006. e.setAttr(n, v)
  14007. return e
  14008. }
  14009. func (e *htmlH1) Class(v ...string) HTMLH1 {
  14010. e.setAttr("class", strings.Join(v, " "))
  14011. return e
  14012. }
  14013. func (e *htmlH1) ContentEditable(v bool) HTMLH1 {
  14014. e.setAttr("contenteditable", v)
  14015. return e
  14016. }
  14017. func (e *htmlH1) DataSet(k string, v any) HTMLH1 {
  14018. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  14019. return e
  14020. }
  14021. func (e *htmlH1) Dir(v string) HTMLH1 {
  14022. e.setAttr("dir", v)
  14023. return e
  14024. }
  14025. func (e *htmlH1) Draggable(v bool) HTMLH1 {
  14026. e.setAttr("draggable", v)
  14027. return e
  14028. }
  14029. func (e *htmlH1) Hidden(v bool) HTMLH1 {
  14030. e.setAttr("hidden", v)
  14031. return e
  14032. }
  14033. func (e *htmlH1) ID(v string) HTMLH1 {
  14034. e.setAttr("id", v)
  14035. return e
  14036. }
  14037. func (e *htmlH1) Lang(v string) HTMLH1 {
  14038. e.setAttr("lang", v)
  14039. return e
  14040. }
  14041. func (e *htmlH1) Role(v string) HTMLH1 {
  14042. e.setAttr("role", v)
  14043. return e
  14044. }
  14045. func (e *htmlH1) Spellcheck(v bool) HTMLH1 {
  14046. s := "false"
  14047. if v {
  14048. s = "true"
  14049. }
  14050. e.setAttr("spellcheck", s)
  14051. return e
  14052. }
  14053. func (e *htmlH1) Style(k, v string) HTMLH1 {
  14054. e.setAttr("style", k+":"+v)
  14055. return e
  14056. }
  14057. func (e *htmlH1) Styles(s map[string]string) HTMLH1 {
  14058. for k, v := range s {
  14059. e.Style(k, v)
  14060. }
  14061. return e
  14062. }
  14063. func (e *htmlH1) TabIndex(v int) HTMLH1 {
  14064. e.setAttr("tabindex", v)
  14065. return e
  14066. }
  14067. func (e *htmlH1) Title(v string) HTMLH1 {
  14068. e.setAttr("title", v)
  14069. return e
  14070. }
  14071. func (e *htmlH1) On(event string, h EventHandler, scope ...any) HTMLH1 {
  14072. e.setEventHandler(event, h, scope...)
  14073. return e
  14074. }
  14075. func (e *htmlH1) OnBlur(h EventHandler, scope ...any) HTMLH1 {
  14076. e.setEventHandler("blur", h, scope...)
  14077. return e
  14078. }
  14079. func (e *htmlH1) OnChange(h EventHandler, scope ...any) HTMLH1 {
  14080. e.setEventHandler("change", h, scope...)
  14081. return e
  14082. }
  14083. func (e *htmlH1) OnClick(h EventHandler, scope ...any) HTMLH1 {
  14084. e.setEventHandler("click", h, scope...)
  14085. return e
  14086. }
  14087. func (e *htmlH1) OnContextMenu(h EventHandler, scope ...any) HTMLH1 {
  14088. e.setEventHandler("contextmenu", h, scope...)
  14089. return e
  14090. }
  14091. func (e *htmlH1) OnCopy(h EventHandler, scope ...any) HTMLH1 {
  14092. e.setEventHandler("copy", h, scope...)
  14093. return e
  14094. }
  14095. func (e *htmlH1) OnCut(h EventHandler, scope ...any) HTMLH1 {
  14096. e.setEventHandler("cut", h, scope...)
  14097. return e
  14098. }
  14099. func (e *htmlH1) OnDblClick(h EventHandler, scope ...any) HTMLH1 {
  14100. e.setEventHandler("dblclick", h, scope...)
  14101. return e
  14102. }
  14103. func (e *htmlH1) OnDrag(h EventHandler, scope ...any) HTMLH1 {
  14104. e.setEventHandler("drag", h, scope...)
  14105. return e
  14106. }
  14107. func (e *htmlH1) OnDragEnd(h EventHandler, scope ...any) HTMLH1 {
  14108. e.setEventHandler("dragend", h, scope...)
  14109. return e
  14110. }
  14111. func (e *htmlH1) OnDragEnter(h EventHandler, scope ...any) HTMLH1 {
  14112. e.setEventHandler("dragenter", h, scope...)
  14113. return e
  14114. }
  14115. func (e *htmlH1) OnDragLeave(h EventHandler, scope ...any) HTMLH1 {
  14116. e.setEventHandler("dragleave", h, scope...)
  14117. return e
  14118. }
  14119. func (e *htmlH1) OnDragOver(h EventHandler, scope ...any) HTMLH1 {
  14120. e.setEventHandler("dragover", h, scope...)
  14121. return e
  14122. }
  14123. func (e *htmlH1) OnDragStart(h EventHandler, scope ...any) HTMLH1 {
  14124. e.setEventHandler("dragstart", h, scope...)
  14125. return e
  14126. }
  14127. func (e *htmlH1) OnDrop(h EventHandler, scope ...any) HTMLH1 {
  14128. e.setEventHandler("drop", h, scope...)
  14129. return e
  14130. }
  14131. func (e *htmlH1) OnFocus(h EventHandler, scope ...any) HTMLH1 {
  14132. e.setEventHandler("focus", h, scope...)
  14133. return e
  14134. }
  14135. func (e *htmlH1) OnInput(h EventHandler, scope ...any) HTMLH1 {
  14136. e.setEventHandler("input", h, scope...)
  14137. return e
  14138. }
  14139. func (e *htmlH1) OnInvalid(h EventHandler, scope ...any) HTMLH1 {
  14140. e.setEventHandler("invalid", h, scope...)
  14141. return e
  14142. }
  14143. func (e *htmlH1) OnKeyDown(h EventHandler, scope ...any) HTMLH1 {
  14144. e.setEventHandler("keydown", h, scope...)
  14145. return e
  14146. }
  14147. func (e *htmlH1) OnKeyPress(h EventHandler, scope ...any) HTMLH1 {
  14148. e.setEventHandler("keypress", h, scope...)
  14149. return e
  14150. }
  14151. func (e *htmlH1) OnKeyUp(h EventHandler, scope ...any) HTMLH1 {
  14152. e.setEventHandler("keyup", h, scope...)
  14153. return e
  14154. }
  14155. func (e *htmlH1) OnMouseDown(h EventHandler, scope ...any) HTMLH1 {
  14156. e.setEventHandler("mousedown", h, scope...)
  14157. return e
  14158. }
  14159. func (e *htmlH1) OnMouseMove(h EventHandler, scope ...any) HTMLH1 {
  14160. e.setEventHandler("mousemove", h, scope...)
  14161. return e
  14162. }
  14163. func (e *htmlH1) OnMouseOut(h EventHandler, scope ...any) HTMLH1 {
  14164. e.setEventHandler("mouseout", h, scope...)
  14165. return e
  14166. }
  14167. func (e *htmlH1) OnMouseOver(h EventHandler, scope ...any) HTMLH1 {
  14168. e.setEventHandler("mouseover", h, scope...)
  14169. return e
  14170. }
  14171. func (e *htmlH1) OnMouseUp(h EventHandler, scope ...any) HTMLH1 {
  14172. e.setEventHandler("mouseup", h, scope...)
  14173. return e
  14174. }
  14175. func (e *htmlH1) OnPaste(h EventHandler, scope ...any) HTMLH1 {
  14176. e.setEventHandler("paste", h, scope...)
  14177. return e
  14178. }
  14179. func (e *htmlH1) OnReset(h EventHandler, scope ...any) HTMLH1 {
  14180. e.setEventHandler("reset", h, scope...)
  14181. return e
  14182. }
  14183. func (e *htmlH1) OnScroll(h EventHandler, scope ...any) HTMLH1 {
  14184. e.setEventHandler("scroll", h, scope...)
  14185. return e
  14186. }
  14187. func (e *htmlH1) OnSearch(h EventHandler, scope ...any) HTMLH1 {
  14188. e.setEventHandler("search", h, scope...)
  14189. return e
  14190. }
  14191. func (e *htmlH1) OnSelect(h EventHandler, scope ...any) HTMLH1 {
  14192. e.setEventHandler("select", h, scope...)
  14193. return e
  14194. }
  14195. func (e *htmlH1) OnSubmit(h EventHandler, scope ...any) HTMLH1 {
  14196. e.setEventHandler("submit", h, scope...)
  14197. return e
  14198. }
  14199. func (e *htmlH1) OnWheel(h EventHandler, scope ...any) HTMLH1 {
  14200. e.setEventHandler("wheel", h, scope...)
  14201. return e
  14202. }
  14203. // HTMLH2 is the interface that describes a "h2" HTML element.
  14204. type HTMLH2 interface {
  14205. UI
  14206. // Body set the content of the element.
  14207. Body(elems ...UI) HTMLH2
  14208. // Text sets the content of the element with a text node containing the stringified given value.
  14209. Text(v any) HTMLH2
  14210. // AccessKey specifies a shortcut key to activate/focus an element.
  14211. AccessKey(v string) HTMLH2
  14212. // Aria stores accessible rich internet applications (ARIA) data.
  14213. Aria(k string, v any) HTMLH2
  14214. // Attr sets the named attribute with the given value.
  14215. Attr(n string, v any) HTMLH2
  14216. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  14217. Class(v ...string) HTMLH2
  14218. // ContentEditable specifies whether the content of an element is editable or not.
  14219. ContentEditable(v bool) HTMLH2
  14220. // DataSet stores custom data private to the page or application.
  14221. DataSet(k string, v any) HTMLH2
  14222. // Dir specifies the text direction for the content in an element.
  14223. Dir(v string) HTMLH2
  14224. // Draggable specifies whether an element is draggable or not.
  14225. Draggable(v bool) HTMLH2
  14226. // Hidden specifies that an element is not yet, or is no longer relevant.
  14227. Hidden(v bool) HTMLH2
  14228. // ID specifies a unique id for an element.
  14229. ID(v string) HTMLH2
  14230. // Lang specifies the language of the element's content.
  14231. Lang(v string) HTMLH2
  14232. // Role specifies to parsing software the exact function of an element (and its children).
  14233. Role(v string) HTMLH2
  14234. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  14235. Spellcheck(v bool) HTMLH2
  14236. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  14237. Style(k, v string) HTMLH2
  14238. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  14239. Styles(s map[string]string) HTMLH2
  14240. // TabIndex specifies the tabbing order of an element.
  14241. TabIndex(v int) HTMLH2
  14242. // Title specifies extra information about an element.
  14243. Title(v string) HTMLH2
  14244. // On registers the given event handler to the specified event.
  14245. On(event string, h EventHandler, scope ...any) HTMLH2
  14246. // OnBlur calls the given handler when the element loses focus.
  14247. OnBlur(h EventHandler, scope ...any) HTMLH2
  14248. // OnChange calls the given handler when the value of the element is changed.
  14249. OnChange(h EventHandler, scope ...any) HTMLH2
  14250. // OnClick calls the given handler when there is a mouse click on the element.
  14251. OnClick(h EventHandler, scope ...any) HTMLH2
  14252. // OnContextMenu calls the given handler when a context menu is triggered.
  14253. OnContextMenu(h EventHandler, scope ...any) HTMLH2
  14254. // OnCopy calls the given handler when the user copies the content of an element.
  14255. OnCopy(h EventHandler, scope ...any) HTMLH2
  14256. // OnCut calls the given handler when the user cuts the content of an element.
  14257. OnCut(h EventHandler, scope ...any) HTMLH2
  14258. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  14259. OnDblClick(h EventHandler, scope ...any) HTMLH2
  14260. // OnDrag calls the given handler when an element is dragged.
  14261. OnDrag(h EventHandler, scope ...any) HTMLH2
  14262. // OnDragEnd calls the given handler at the end of a drag operation.
  14263. OnDragEnd(h EventHandler, scope ...any) HTMLH2
  14264. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  14265. OnDragEnter(h EventHandler, scope ...any) HTMLH2
  14266. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  14267. OnDragLeave(h EventHandler, scope ...any) HTMLH2
  14268. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  14269. OnDragOver(h EventHandler, scope ...any) HTMLH2
  14270. // OnDragStart calls the given handler at the start of a drag operation.
  14271. OnDragStart(h EventHandler, scope ...any) HTMLH2
  14272. // OnDrop calls the given handler when dragged element is being dropped.
  14273. OnDrop(h EventHandler, scope ...any) HTMLH2
  14274. // OnFocus calls the given handler when the element gets focus.
  14275. OnFocus(h EventHandler, scope ...any) HTMLH2
  14276. // OnInput calls the given handler when an element gets user input.
  14277. OnInput(h EventHandler, scope ...any) HTMLH2
  14278. // OnInvalid calls the given handler when an element is invalid.
  14279. OnInvalid(h EventHandler, scope ...any) HTMLH2
  14280. // OnKeyDown calls the given handler when a user is pressing a key.
  14281. OnKeyDown(h EventHandler, scope ...any) HTMLH2
  14282. // OnKeyPress calls the given handler when a user presses a key.
  14283. OnKeyPress(h EventHandler, scope ...any) HTMLH2
  14284. // OnKeyUp calls the given handler when a user releases a key.
  14285. OnKeyUp(h EventHandler, scope ...any) HTMLH2
  14286. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  14287. OnMouseDown(h EventHandler, scope ...any) HTMLH2
  14288. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  14289. OnMouseMove(h EventHandler, scope ...any) HTMLH2
  14290. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  14291. OnMouseOut(h EventHandler, scope ...any) HTMLH2
  14292. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  14293. OnMouseOver(h EventHandler, scope ...any) HTMLH2
  14294. // OnMouseUp calls the given handler when a mouse button is released over an element.
  14295. OnMouseUp(h EventHandler, scope ...any) HTMLH2
  14296. // OnPaste calls the given handler when the user pastes some content in an element.
  14297. OnPaste(h EventHandler, scope ...any) HTMLH2
  14298. // OnReset calls the given handler when the Reset button in a form is clicked.
  14299. OnReset(h EventHandler, scope ...any) HTMLH2
  14300. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  14301. OnScroll(h EventHandler, scope ...any) HTMLH2
  14302. // OnSearch calls the given handler when the user writes something in a search field.
  14303. OnSearch(h EventHandler, scope ...any) HTMLH2
  14304. // OnSelect calls the given handler after some text has been selected in an element.
  14305. OnSelect(h EventHandler, scope ...any) HTMLH2
  14306. // OnSubmit calls the given handler when a form is submitted.
  14307. OnSubmit(h EventHandler, scope ...any) HTMLH2
  14308. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  14309. OnWheel(h EventHandler, scope ...any) HTMLH2
  14310. }
  14311. // H2 returns an HTML element that defines HTML heading.
  14312. func H2() HTMLH2 {
  14313. e := &htmlH2{
  14314. htmlElement: htmlElement{
  14315. tag: "h2",
  14316. isSelfClosing: false,
  14317. },
  14318. }
  14319. return e
  14320. }
  14321. type htmlH2 struct {
  14322. htmlElement
  14323. }
  14324. func (e *htmlH2) Body(v ...UI) HTMLH2 {
  14325. e.setChildren(v...)
  14326. return e
  14327. }
  14328. func (e *htmlH2) Text(v any) HTMLH2 {
  14329. return e.Body(Text(v))
  14330. }
  14331. func (e *htmlH2) AccessKey(v string) HTMLH2 {
  14332. e.setAttr("accesskey", v)
  14333. return e
  14334. }
  14335. func (e *htmlH2) Aria(k string, v any) HTMLH2 {
  14336. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  14337. return e
  14338. }
  14339. func (e *htmlH2) Attr(n string, v any) HTMLH2 {
  14340. e.setAttr(n, v)
  14341. return e
  14342. }
  14343. func (e *htmlH2) Class(v ...string) HTMLH2 {
  14344. e.setAttr("class", strings.Join(v, " "))
  14345. return e
  14346. }
  14347. func (e *htmlH2) ContentEditable(v bool) HTMLH2 {
  14348. e.setAttr("contenteditable", v)
  14349. return e
  14350. }
  14351. func (e *htmlH2) DataSet(k string, v any) HTMLH2 {
  14352. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  14353. return e
  14354. }
  14355. func (e *htmlH2) Dir(v string) HTMLH2 {
  14356. e.setAttr("dir", v)
  14357. return e
  14358. }
  14359. func (e *htmlH2) Draggable(v bool) HTMLH2 {
  14360. e.setAttr("draggable", v)
  14361. return e
  14362. }
  14363. func (e *htmlH2) Hidden(v bool) HTMLH2 {
  14364. e.setAttr("hidden", v)
  14365. return e
  14366. }
  14367. func (e *htmlH2) ID(v string) HTMLH2 {
  14368. e.setAttr("id", v)
  14369. return e
  14370. }
  14371. func (e *htmlH2) Lang(v string) HTMLH2 {
  14372. e.setAttr("lang", v)
  14373. return e
  14374. }
  14375. func (e *htmlH2) Role(v string) HTMLH2 {
  14376. e.setAttr("role", v)
  14377. return e
  14378. }
  14379. func (e *htmlH2) Spellcheck(v bool) HTMLH2 {
  14380. s := "false"
  14381. if v {
  14382. s = "true"
  14383. }
  14384. e.setAttr("spellcheck", s)
  14385. return e
  14386. }
  14387. func (e *htmlH2) Style(k, v string) HTMLH2 {
  14388. e.setAttr("style", k+":"+v)
  14389. return e
  14390. }
  14391. func (e *htmlH2) Styles(s map[string]string) HTMLH2 {
  14392. for k, v := range s {
  14393. e.Style(k, v)
  14394. }
  14395. return e
  14396. }
  14397. func (e *htmlH2) TabIndex(v int) HTMLH2 {
  14398. e.setAttr("tabindex", v)
  14399. return e
  14400. }
  14401. func (e *htmlH2) Title(v string) HTMLH2 {
  14402. e.setAttr("title", v)
  14403. return e
  14404. }
  14405. func (e *htmlH2) On(event string, h EventHandler, scope ...any) HTMLH2 {
  14406. e.setEventHandler(event, h, scope...)
  14407. return e
  14408. }
  14409. func (e *htmlH2) OnBlur(h EventHandler, scope ...any) HTMLH2 {
  14410. e.setEventHandler("blur", h, scope...)
  14411. return e
  14412. }
  14413. func (e *htmlH2) OnChange(h EventHandler, scope ...any) HTMLH2 {
  14414. e.setEventHandler("change", h, scope...)
  14415. return e
  14416. }
  14417. func (e *htmlH2) OnClick(h EventHandler, scope ...any) HTMLH2 {
  14418. e.setEventHandler("click", h, scope...)
  14419. return e
  14420. }
  14421. func (e *htmlH2) OnContextMenu(h EventHandler, scope ...any) HTMLH2 {
  14422. e.setEventHandler("contextmenu", h, scope...)
  14423. return e
  14424. }
  14425. func (e *htmlH2) OnCopy(h EventHandler, scope ...any) HTMLH2 {
  14426. e.setEventHandler("copy", h, scope...)
  14427. return e
  14428. }
  14429. func (e *htmlH2) OnCut(h EventHandler, scope ...any) HTMLH2 {
  14430. e.setEventHandler("cut", h, scope...)
  14431. return e
  14432. }
  14433. func (e *htmlH2) OnDblClick(h EventHandler, scope ...any) HTMLH2 {
  14434. e.setEventHandler("dblclick", h, scope...)
  14435. return e
  14436. }
  14437. func (e *htmlH2) OnDrag(h EventHandler, scope ...any) HTMLH2 {
  14438. e.setEventHandler("drag", h, scope...)
  14439. return e
  14440. }
  14441. func (e *htmlH2) OnDragEnd(h EventHandler, scope ...any) HTMLH2 {
  14442. e.setEventHandler("dragend", h, scope...)
  14443. return e
  14444. }
  14445. func (e *htmlH2) OnDragEnter(h EventHandler, scope ...any) HTMLH2 {
  14446. e.setEventHandler("dragenter", h, scope...)
  14447. return e
  14448. }
  14449. func (e *htmlH2) OnDragLeave(h EventHandler, scope ...any) HTMLH2 {
  14450. e.setEventHandler("dragleave", h, scope...)
  14451. return e
  14452. }
  14453. func (e *htmlH2) OnDragOver(h EventHandler, scope ...any) HTMLH2 {
  14454. e.setEventHandler("dragover", h, scope...)
  14455. return e
  14456. }
  14457. func (e *htmlH2) OnDragStart(h EventHandler, scope ...any) HTMLH2 {
  14458. e.setEventHandler("dragstart", h, scope...)
  14459. return e
  14460. }
  14461. func (e *htmlH2) OnDrop(h EventHandler, scope ...any) HTMLH2 {
  14462. e.setEventHandler("drop", h, scope...)
  14463. return e
  14464. }
  14465. func (e *htmlH2) OnFocus(h EventHandler, scope ...any) HTMLH2 {
  14466. e.setEventHandler("focus", h, scope...)
  14467. return e
  14468. }
  14469. func (e *htmlH2) OnInput(h EventHandler, scope ...any) HTMLH2 {
  14470. e.setEventHandler("input", h, scope...)
  14471. return e
  14472. }
  14473. func (e *htmlH2) OnInvalid(h EventHandler, scope ...any) HTMLH2 {
  14474. e.setEventHandler("invalid", h, scope...)
  14475. return e
  14476. }
  14477. func (e *htmlH2) OnKeyDown(h EventHandler, scope ...any) HTMLH2 {
  14478. e.setEventHandler("keydown", h, scope...)
  14479. return e
  14480. }
  14481. func (e *htmlH2) OnKeyPress(h EventHandler, scope ...any) HTMLH2 {
  14482. e.setEventHandler("keypress", h, scope...)
  14483. return e
  14484. }
  14485. func (e *htmlH2) OnKeyUp(h EventHandler, scope ...any) HTMLH2 {
  14486. e.setEventHandler("keyup", h, scope...)
  14487. return e
  14488. }
  14489. func (e *htmlH2) OnMouseDown(h EventHandler, scope ...any) HTMLH2 {
  14490. e.setEventHandler("mousedown", h, scope...)
  14491. return e
  14492. }
  14493. func (e *htmlH2) OnMouseMove(h EventHandler, scope ...any) HTMLH2 {
  14494. e.setEventHandler("mousemove", h, scope...)
  14495. return e
  14496. }
  14497. func (e *htmlH2) OnMouseOut(h EventHandler, scope ...any) HTMLH2 {
  14498. e.setEventHandler("mouseout", h, scope...)
  14499. return e
  14500. }
  14501. func (e *htmlH2) OnMouseOver(h EventHandler, scope ...any) HTMLH2 {
  14502. e.setEventHandler("mouseover", h, scope...)
  14503. return e
  14504. }
  14505. func (e *htmlH2) OnMouseUp(h EventHandler, scope ...any) HTMLH2 {
  14506. e.setEventHandler("mouseup", h, scope...)
  14507. return e
  14508. }
  14509. func (e *htmlH2) OnPaste(h EventHandler, scope ...any) HTMLH2 {
  14510. e.setEventHandler("paste", h, scope...)
  14511. return e
  14512. }
  14513. func (e *htmlH2) OnReset(h EventHandler, scope ...any) HTMLH2 {
  14514. e.setEventHandler("reset", h, scope...)
  14515. return e
  14516. }
  14517. func (e *htmlH2) OnScroll(h EventHandler, scope ...any) HTMLH2 {
  14518. e.setEventHandler("scroll", h, scope...)
  14519. return e
  14520. }
  14521. func (e *htmlH2) OnSearch(h EventHandler, scope ...any) HTMLH2 {
  14522. e.setEventHandler("search", h, scope...)
  14523. return e
  14524. }
  14525. func (e *htmlH2) OnSelect(h EventHandler, scope ...any) HTMLH2 {
  14526. e.setEventHandler("select", h, scope...)
  14527. return e
  14528. }
  14529. func (e *htmlH2) OnSubmit(h EventHandler, scope ...any) HTMLH2 {
  14530. e.setEventHandler("submit", h, scope...)
  14531. return e
  14532. }
  14533. func (e *htmlH2) OnWheel(h EventHandler, scope ...any) HTMLH2 {
  14534. e.setEventHandler("wheel", h, scope...)
  14535. return e
  14536. }
  14537. // HTMLH3 is the interface that describes a "h3" HTML element.
  14538. type HTMLH3 interface {
  14539. UI
  14540. // Body set the content of the element.
  14541. Body(elems ...UI) HTMLH3
  14542. // Text sets the content of the element with a text node containing the stringified given value.
  14543. Text(v any) HTMLH3
  14544. // AccessKey specifies a shortcut key to activate/focus an element.
  14545. AccessKey(v string) HTMLH3
  14546. // Aria stores accessible rich internet applications (ARIA) data.
  14547. Aria(k string, v any) HTMLH3
  14548. // Attr sets the named attribute with the given value.
  14549. Attr(n string, v any) HTMLH3
  14550. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  14551. Class(v ...string) HTMLH3
  14552. // ContentEditable specifies whether the content of an element is editable or not.
  14553. ContentEditable(v bool) HTMLH3
  14554. // DataSet stores custom data private to the page or application.
  14555. DataSet(k string, v any) HTMLH3
  14556. // Dir specifies the text direction for the content in an element.
  14557. Dir(v string) HTMLH3
  14558. // Draggable specifies whether an element is draggable or not.
  14559. Draggable(v bool) HTMLH3
  14560. // Hidden specifies that an element is not yet, or is no longer relevant.
  14561. Hidden(v bool) HTMLH3
  14562. // ID specifies a unique id for an element.
  14563. ID(v string) HTMLH3
  14564. // Lang specifies the language of the element's content.
  14565. Lang(v string) HTMLH3
  14566. // Role specifies to parsing software the exact function of an element (and its children).
  14567. Role(v string) HTMLH3
  14568. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  14569. Spellcheck(v bool) HTMLH3
  14570. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  14571. Style(k, v string) HTMLH3
  14572. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  14573. Styles(s map[string]string) HTMLH3
  14574. // TabIndex specifies the tabbing order of an element.
  14575. TabIndex(v int) HTMLH3
  14576. // Title specifies extra information about an element.
  14577. Title(v string) HTMLH3
  14578. // On registers the given event handler to the specified event.
  14579. On(event string, h EventHandler, scope ...any) HTMLH3
  14580. // OnBlur calls the given handler when the element loses focus.
  14581. OnBlur(h EventHandler, scope ...any) HTMLH3
  14582. // OnChange calls the given handler when the value of the element is changed.
  14583. OnChange(h EventHandler, scope ...any) HTMLH3
  14584. // OnClick calls the given handler when there is a mouse click on the element.
  14585. OnClick(h EventHandler, scope ...any) HTMLH3
  14586. // OnContextMenu calls the given handler when a context menu is triggered.
  14587. OnContextMenu(h EventHandler, scope ...any) HTMLH3
  14588. // OnCopy calls the given handler when the user copies the content of an element.
  14589. OnCopy(h EventHandler, scope ...any) HTMLH3
  14590. // OnCut calls the given handler when the user cuts the content of an element.
  14591. OnCut(h EventHandler, scope ...any) HTMLH3
  14592. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  14593. OnDblClick(h EventHandler, scope ...any) HTMLH3
  14594. // OnDrag calls the given handler when an element is dragged.
  14595. OnDrag(h EventHandler, scope ...any) HTMLH3
  14596. // OnDragEnd calls the given handler at the end of a drag operation.
  14597. OnDragEnd(h EventHandler, scope ...any) HTMLH3
  14598. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  14599. OnDragEnter(h EventHandler, scope ...any) HTMLH3
  14600. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  14601. OnDragLeave(h EventHandler, scope ...any) HTMLH3
  14602. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  14603. OnDragOver(h EventHandler, scope ...any) HTMLH3
  14604. // OnDragStart calls the given handler at the start of a drag operation.
  14605. OnDragStart(h EventHandler, scope ...any) HTMLH3
  14606. // OnDrop calls the given handler when dragged element is being dropped.
  14607. OnDrop(h EventHandler, scope ...any) HTMLH3
  14608. // OnFocus calls the given handler when the element gets focus.
  14609. OnFocus(h EventHandler, scope ...any) HTMLH3
  14610. // OnInput calls the given handler when an element gets user input.
  14611. OnInput(h EventHandler, scope ...any) HTMLH3
  14612. // OnInvalid calls the given handler when an element is invalid.
  14613. OnInvalid(h EventHandler, scope ...any) HTMLH3
  14614. // OnKeyDown calls the given handler when a user is pressing a key.
  14615. OnKeyDown(h EventHandler, scope ...any) HTMLH3
  14616. // OnKeyPress calls the given handler when a user presses a key.
  14617. OnKeyPress(h EventHandler, scope ...any) HTMLH3
  14618. // OnKeyUp calls the given handler when a user releases a key.
  14619. OnKeyUp(h EventHandler, scope ...any) HTMLH3
  14620. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  14621. OnMouseDown(h EventHandler, scope ...any) HTMLH3
  14622. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  14623. OnMouseMove(h EventHandler, scope ...any) HTMLH3
  14624. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  14625. OnMouseOut(h EventHandler, scope ...any) HTMLH3
  14626. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  14627. OnMouseOver(h EventHandler, scope ...any) HTMLH3
  14628. // OnMouseUp calls the given handler when a mouse button is released over an element.
  14629. OnMouseUp(h EventHandler, scope ...any) HTMLH3
  14630. // OnPaste calls the given handler when the user pastes some content in an element.
  14631. OnPaste(h EventHandler, scope ...any) HTMLH3
  14632. // OnReset calls the given handler when the Reset button in a form is clicked.
  14633. OnReset(h EventHandler, scope ...any) HTMLH3
  14634. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  14635. OnScroll(h EventHandler, scope ...any) HTMLH3
  14636. // OnSearch calls the given handler when the user writes something in a search field.
  14637. OnSearch(h EventHandler, scope ...any) HTMLH3
  14638. // OnSelect calls the given handler after some text has been selected in an element.
  14639. OnSelect(h EventHandler, scope ...any) HTMLH3
  14640. // OnSubmit calls the given handler when a form is submitted.
  14641. OnSubmit(h EventHandler, scope ...any) HTMLH3
  14642. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  14643. OnWheel(h EventHandler, scope ...any) HTMLH3
  14644. }
  14645. // H3 returns an HTML element that defines HTML heading.
  14646. func H3() HTMLH3 {
  14647. e := &htmlH3{
  14648. htmlElement: htmlElement{
  14649. tag: "h3",
  14650. isSelfClosing: false,
  14651. },
  14652. }
  14653. return e
  14654. }
  14655. type htmlH3 struct {
  14656. htmlElement
  14657. }
  14658. func (e *htmlH3) Body(v ...UI) HTMLH3 {
  14659. e.setChildren(v...)
  14660. return e
  14661. }
  14662. func (e *htmlH3) Text(v any) HTMLH3 {
  14663. return e.Body(Text(v))
  14664. }
  14665. func (e *htmlH3) AccessKey(v string) HTMLH3 {
  14666. e.setAttr("accesskey", v)
  14667. return e
  14668. }
  14669. func (e *htmlH3) Aria(k string, v any) HTMLH3 {
  14670. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  14671. return e
  14672. }
  14673. func (e *htmlH3) Attr(n string, v any) HTMLH3 {
  14674. e.setAttr(n, v)
  14675. return e
  14676. }
  14677. func (e *htmlH3) Class(v ...string) HTMLH3 {
  14678. e.setAttr("class", strings.Join(v, " "))
  14679. return e
  14680. }
  14681. func (e *htmlH3) ContentEditable(v bool) HTMLH3 {
  14682. e.setAttr("contenteditable", v)
  14683. return e
  14684. }
  14685. func (e *htmlH3) DataSet(k string, v any) HTMLH3 {
  14686. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  14687. return e
  14688. }
  14689. func (e *htmlH3) Dir(v string) HTMLH3 {
  14690. e.setAttr("dir", v)
  14691. return e
  14692. }
  14693. func (e *htmlH3) Draggable(v bool) HTMLH3 {
  14694. e.setAttr("draggable", v)
  14695. return e
  14696. }
  14697. func (e *htmlH3) Hidden(v bool) HTMLH3 {
  14698. e.setAttr("hidden", v)
  14699. return e
  14700. }
  14701. func (e *htmlH3) ID(v string) HTMLH3 {
  14702. e.setAttr("id", v)
  14703. return e
  14704. }
  14705. func (e *htmlH3) Lang(v string) HTMLH3 {
  14706. e.setAttr("lang", v)
  14707. return e
  14708. }
  14709. func (e *htmlH3) Role(v string) HTMLH3 {
  14710. e.setAttr("role", v)
  14711. return e
  14712. }
  14713. func (e *htmlH3) Spellcheck(v bool) HTMLH3 {
  14714. s := "false"
  14715. if v {
  14716. s = "true"
  14717. }
  14718. e.setAttr("spellcheck", s)
  14719. return e
  14720. }
  14721. func (e *htmlH3) Style(k, v string) HTMLH3 {
  14722. e.setAttr("style", k+":"+v)
  14723. return e
  14724. }
  14725. func (e *htmlH3) Styles(s map[string]string) HTMLH3 {
  14726. for k, v := range s {
  14727. e.Style(k, v)
  14728. }
  14729. return e
  14730. }
  14731. func (e *htmlH3) TabIndex(v int) HTMLH3 {
  14732. e.setAttr("tabindex", v)
  14733. return e
  14734. }
  14735. func (e *htmlH3) Title(v string) HTMLH3 {
  14736. e.setAttr("title", v)
  14737. return e
  14738. }
  14739. func (e *htmlH3) On(event string, h EventHandler, scope ...any) HTMLH3 {
  14740. e.setEventHandler(event, h, scope...)
  14741. return e
  14742. }
  14743. func (e *htmlH3) OnBlur(h EventHandler, scope ...any) HTMLH3 {
  14744. e.setEventHandler("blur", h, scope...)
  14745. return e
  14746. }
  14747. func (e *htmlH3) OnChange(h EventHandler, scope ...any) HTMLH3 {
  14748. e.setEventHandler("change", h, scope...)
  14749. return e
  14750. }
  14751. func (e *htmlH3) OnClick(h EventHandler, scope ...any) HTMLH3 {
  14752. e.setEventHandler("click", h, scope...)
  14753. return e
  14754. }
  14755. func (e *htmlH3) OnContextMenu(h EventHandler, scope ...any) HTMLH3 {
  14756. e.setEventHandler("contextmenu", h, scope...)
  14757. return e
  14758. }
  14759. func (e *htmlH3) OnCopy(h EventHandler, scope ...any) HTMLH3 {
  14760. e.setEventHandler("copy", h, scope...)
  14761. return e
  14762. }
  14763. func (e *htmlH3) OnCut(h EventHandler, scope ...any) HTMLH3 {
  14764. e.setEventHandler("cut", h, scope...)
  14765. return e
  14766. }
  14767. func (e *htmlH3) OnDblClick(h EventHandler, scope ...any) HTMLH3 {
  14768. e.setEventHandler("dblclick", h, scope...)
  14769. return e
  14770. }
  14771. func (e *htmlH3) OnDrag(h EventHandler, scope ...any) HTMLH3 {
  14772. e.setEventHandler("drag", h, scope...)
  14773. return e
  14774. }
  14775. func (e *htmlH3) OnDragEnd(h EventHandler, scope ...any) HTMLH3 {
  14776. e.setEventHandler("dragend", h, scope...)
  14777. return e
  14778. }
  14779. func (e *htmlH3) OnDragEnter(h EventHandler, scope ...any) HTMLH3 {
  14780. e.setEventHandler("dragenter", h, scope...)
  14781. return e
  14782. }
  14783. func (e *htmlH3) OnDragLeave(h EventHandler, scope ...any) HTMLH3 {
  14784. e.setEventHandler("dragleave", h, scope...)
  14785. return e
  14786. }
  14787. func (e *htmlH3) OnDragOver(h EventHandler, scope ...any) HTMLH3 {
  14788. e.setEventHandler("dragover", h, scope...)
  14789. return e
  14790. }
  14791. func (e *htmlH3) OnDragStart(h EventHandler, scope ...any) HTMLH3 {
  14792. e.setEventHandler("dragstart", h, scope...)
  14793. return e
  14794. }
  14795. func (e *htmlH3) OnDrop(h EventHandler, scope ...any) HTMLH3 {
  14796. e.setEventHandler("drop", h, scope...)
  14797. return e
  14798. }
  14799. func (e *htmlH3) OnFocus(h EventHandler, scope ...any) HTMLH3 {
  14800. e.setEventHandler("focus", h, scope...)
  14801. return e
  14802. }
  14803. func (e *htmlH3) OnInput(h EventHandler, scope ...any) HTMLH3 {
  14804. e.setEventHandler("input", h, scope...)
  14805. return e
  14806. }
  14807. func (e *htmlH3) OnInvalid(h EventHandler, scope ...any) HTMLH3 {
  14808. e.setEventHandler("invalid", h, scope...)
  14809. return e
  14810. }
  14811. func (e *htmlH3) OnKeyDown(h EventHandler, scope ...any) HTMLH3 {
  14812. e.setEventHandler("keydown", h, scope...)
  14813. return e
  14814. }
  14815. func (e *htmlH3) OnKeyPress(h EventHandler, scope ...any) HTMLH3 {
  14816. e.setEventHandler("keypress", h, scope...)
  14817. return e
  14818. }
  14819. func (e *htmlH3) OnKeyUp(h EventHandler, scope ...any) HTMLH3 {
  14820. e.setEventHandler("keyup", h, scope...)
  14821. return e
  14822. }
  14823. func (e *htmlH3) OnMouseDown(h EventHandler, scope ...any) HTMLH3 {
  14824. e.setEventHandler("mousedown", h, scope...)
  14825. return e
  14826. }
  14827. func (e *htmlH3) OnMouseMove(h EventHandler, scope ...any) HTMLH3 {
  14828. e.setEventHandler("mousemove", h, scope...)
  14829. return e
  14830. }
  14831. func (e *htmlH3) OnMouseOut(h EventHandler, scope ...any) HTMLH3 {
  14832. e.setEventHandler("mouseout", h, scope...)
  14833. return e
  14834. }
  14835. func (e *htmlH3) OnMouseOver(h EventHandler, scope ...any) HTMLH3 {
  14836. e.setEventHandler("mouseover", h, scope...)
  14837. return e
  14838. }
  14839. func (e *htmlH3) OnMouseUp(h EventHandler, scope ...any) HTMLH3 {
  14840. e.setEventHandler("mouseup", h, scope...)
  14841. return e
  14842. }
  14843. func (e *htmlH3) OnPaste(h EventHandler, scope ...any) HTMLH3 {
  14844. e.setEventHandler("paste", h, scope...)
  14845. return e
  14846. }
  14847. func (e *htmlH3) OnReset(h EventHandler, scope ...any) HTMLH3 {
  14848. e.setEventHandler("reset", h, scope...)
  14849. return e
  14850. }
  14851. func (e *htmlH3) OnScroll(h EventHandler, scope ...any) HTMLH3 {
  14852. e.setEventHandler("scroll", h, scope...)
  14853. return e
  14854. }
  14855. func (e *htmlH3) OnSearch(h EventHandler, scope ...any) HTMLH3 {
  14856. e.setEventHandler("search", h, scope...)
  14857. return e
  14858. }
  14859. func (e *htmlH3) OnSelect(h EventHandler, scope ...any) HTMLH3 {
  14860. e.setEventHandler("select", h, scope...)
  14861. return e
  14862. }
  14863. func (e *htmlH3) OnSubmit(h EventHandler, scope ...any) HTMLH3 {
  14864. e.setEventHandler("submit", h, scope...)
  14865. return e
  14866. }
  14867. func (e *htmlH3) OnWheel(h EventHandler, scope ...any) HTMLH3 {
  14868. e.setEventHandler("wheel", h, scope...)
  14869. return e
  14870. }
  14871. // HTMLH4 is the interface that describes a "h4" HTML element.
  14872. type HTMLH4 interface {
  14873. UI
  14874. // Body set the content of the element.
  14875. Body(elems ...UI) HTMLH4
  14876. // Text sets the content of the element with a text node containing the stringified given value.
  14877. Text(v any) HTMLH4
  14878. // AccessKey specifies a shortcut key to activate/focus an element.
  14879. AccessKey(v string) HTMLH4
  14880. // Aria stores accessible rich internet applications (ARIA) data.
  14881. Aria(k string, v any) HTMLH4
  14882. // Attr sets the named attribute with the given value.
  14883. Attr(n string, v any) HTMLH4
  14884. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  14885. Class(v ...string) HTMLH4
  14886. // ContentEditable specifies whether the content of an element is editable or not.
  14887. ContentEditable(v bool) HTMLH4
  14888. // DataSet stores custom data private to the page or application.
  14889. DataSet(k string, v any) HTMLH4
  14890. // Dir specifies the text direction for the content in an element.
  14891. Dir(v string) HTMLH4
  14892. // Draggable specifies whether an element is draggable or not.
  14893. Draggable(v bool) HTMLH4
  14894. // Hidden specifies that an element is not yet, or is no longer relevant.
  14895. Hidden(v bool) HTMLH4
  14896. // ID specifies a unique id for an element.
  14897. ID(v string) HTMLH4
  14898. // Lang specifies the language of the element's content.
  14899. Lang(v string) HTMLH4
  14900. // Role specifies to parsing software the exact function of an element (and its children).
  14901. Role(v string) HTMLH4
  14902. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  14903. Spellcheck(v bool) HTMLH4
  14904. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  14905. Style(k, v string) HTMLH4
  14906. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  14907. Styles(s map[string]string) HTMLH4
  14908. // TabIndex specifies the tabbing order of an element.
  14909. TabIndex(v int) HTMLH4
  14910. // Title specifies extra information about an element.
  14911. Title(v string) HTMLH4
  14912. // On registers the given event handler to the specified event.
  14913. On(event string, h EventHandler, scope ...any) HTMLH4
  14914. // OnBlur calls the given handler when the element loses focus.
  14915. OnBlur(h EventHandler, scope ...any) HTMLH4
  14916. // OnChange calls the given handler when the value of the element is changed.
  14917. OnChange(h EventHandler, scope ...any) HTMLH4
  14918. // OnClick calls the given handler when there is a mouse click on the element.
  14919. OnClick(h EventHandler, scope ...any) HTMLH4
  14920. // OnContextMenu calls the given handler when a context menu is triggered.
  14921. OnContextMenu(h EventHandler, scope ...any) HTMLH4
  14922. // OnCopy calls the given handler when the user copies the content of an element.
  14923. OnCopy(h EventHandler, scope ...any) HTMLH4
  14924. // OnCut calls the given handler when the user cuts the content of an element.
  14925. OnCut(h EventHandler, scope ...any) HTMLH4
  14926. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  14927. OnDblClick(h EventHandler, scope ...any) HTMLH4
  14928. // OnDrag calls the given handler when an element is dragged.
  14929. OnDrag(h EventHandler, scope ...any) HTMLH4
  14930. // OnDragEnd calls the given handler at the end of a drag operation.
  14931. OnDragEnd(h EventHandler, scope ...any) HTMLH4
  14932. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  14933. OnDragEnter(h EventHandler, scope ...any) HTMLH4
  14934. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  14935. OnDragLeave(h EventHandler, scope ...any) HTMLH4
  14936. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  14937. OnDragOver(h EventHandler, scope ...any) HTMLH4
  14938. // OnDragStart calls the given handler at the start of a drag operation.
  14939. OnDragStart(h EventHandler, scope ...any) HTMLH4
  14940. // OnDrop calls the given handler when dragged element is being dropped.
  14941. OnDrop(h EventHandler, scope ...any) HTMLH4
  14942. // OnFocus calls the given handler when the element gets focus.
  14943. OnFocus(h EventHandler, scope ...any) HTMLH4
  14944. // OnInput calls the given handler when an element gets user input.
  14945. OnInput(h EventHandler, scope ...any) HTMLH4
  14946. // OnInvalid calls the given handler when an element is invalid.
  14947. OnInvalid(h EventHandler, scope ...any) HTMLH4
  14948. // OnKeyDown calls the given handler when a user is pressing a key.
  14949. OnKeyDown(h EventHandler, scope ...any) HTMLH4
  14950. // OnKeyPress calls the given handler when a user presses a key.
  14951. OnKeyPress(h EventHandler, scope ...any) HTMLH4
  14952. // OnKeyUp calls the given handler when a user releases a key.
  14953. OnKeyUp(h EventHandler, scope ...any) HTMLH4
  14954. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  14955. OnMouseDown(h EventHandler, scope ...any) HTMLH4
  14956. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  14957. OnMouseMove(h EventHandler, scope ...any) HTMLH4
  14958. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  14959. OnMouseOut(h EventHandler, scope ...any) HTMLH4
  14960. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  14961. OnMouseOver(h EventHandler, scope ...any) HTMLH4
  14962. // OnMouseUp calls the given handler when a mouse button is released over an element.
  14963. OnMouseUp(h EventHandler, scope ...any) HTMLH4
  14964. // OnPaste calls the given handler when the user pastes some content in an element.
  14965. OnPaste(h EventHandler, scope ...any) HTMLH4
  14966. // OnReset calls the given handler when the Reset button in a form is clicked.
  14967. OnReset(h EventHandler, scope ...any) HTMLH4
  14968. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  14969. OnScroll(h EventHandler, scope ...any) HTMLH4
  14970. // OnSearch calls the given handler when the user writes something in a search field.
  14971. OnSearch(h EventHandler, scope ...any) HTMLH4
  14972. // OnSelect calls the given handler after some text has been selected in an element.
  14973. OnSelect(h EventHandler, scope ...any) HTMLH4
  14974. // OnSubmit calls the given handler when a form is submitted.
  14975. OnSubmit(h EventHandler, scope ...any) HTMLH4
  14976. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  14977. OnWheel(h EventHandler, scope ...any) HTMLH4
  14978. }
  14979. // H4 returns an HTML element that defines HTML heading.
  14980. func H4() HTMLH4 {
  14981. e := &htmlH4{
  14982. htmlElement: htmlElement{
  14983. tag: "h4",
  14984. isSelfClosing: false,
  14985. },
  14986. }
  14987. return e
  14988. }
  14989. type htmlH4 struct {
  14990. htmlElement
  14991. }
  14992. func (e *htmlH4) Body(v ...UI) HTMLH4 {
  14993. e.setChildren(v...)
  14994. return e
  14995. }
  14996. func (e *htmlH4) Text(v any) HTMLH4 {
  14997. return e.Body(Text(v))
  14998. }
  14999. func (e *htmlH4) AccessKey(v string) HTMLH4 {
  15000. e.setAttr("accesskey", v)
  15001. return e
  15002. }
  15003. func (e *htmlH4) Aria(k string, v any) HTMLH4 {
  15004. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  15005. return e
  15006. }
  15007. func (e *htmlH4) Attr(n string, v any) HTMLH4 {
  15008. e.setAttr(n, v)
  15009. return e
  15010. }
  15011. func (e *htmlH4) Class(v ...string) HTMLH4 {
  15012. e.setAttr("class", strings.Join(v, " "))
  15013. return e
  15014. }
  15015. func (e *htmlH4) ContentEditable(v bool) HTMLH4 {
  15016. e.setAttr("contenteditable", v)
  15017. return e
  15018. }
  15019. func (e *htmlH4) DataSet(k string, v any) HTMLH4 {
  15020. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  15021. return e
  15022. }
  15023. func (e *htmlH4) Dir(v string) HTMLH4 {
  15024. e.setAttr("dir", v)
  15025. return e
  15026. }
  15027. func (e *htmlH4) Draggable(v bool) HTMLH4 {
  15028. e.setAttr("draggable", v)
  15029. return e
  15030. }
  15031. func (e *htmlH4) Hidden(v bool) HTMLH4 {
  15032. e.setAttr("hidden", v)
  15033. return e
  15034. }
  15035. func (e *htmlH4) ID(v string) HTMLH4 {
  15036. e.setAttr("id", v)
  15037. return e
  15038. }
  15039. func (e *htmlH4) Lang(v string) HTMLH4 {
  15040. e.setAttr("lang", v)
  15041. return e
  15042. }
  15043. func (e *htmlH4) Role(v string) HTMLH4 {
  15044. e.setAttr("role", v)
  15045. return e
  15046. }
  15047. func (e *htmlH4) Spellcheck(v bool) HTMLH4 {
  15048. s := "false"
  15049. if v {
  15050. s = "true"
  15051. }
  15052. e.setAttr("spellcheck", s)
  15053. return e
  15054. }
  15055. func (e *htmlH4) Style(k, v string) HTMLH4 {
  15056. e.setAttr("style", k+":"+v)
  15057. return e
  15058. }
  15059. func (e *htmlH4) Styles(s map[string]string) HTMLH4 {
  15060. for k, v := range s {
  15061. e.Style(k, v)
  15062. }
  15063. return e
  15064. }
  15065. func (e *htmlH4) TabIndex(v int) HTMLH4 {
  15066. e.setAttr("tabindex", v)
  15067. return e
  15068. }
  15069. func (e *htmlH4) Title(v string) HTMLH4 {
  15070. e.setAttr("title", v)
  15071. return e
  15072. }
  15073. func (e *htmlH4) On(event string, h EventHandler, scope ...any) HTMLH4 {
  15074. e.setEventHandler(event, h, scope...)
  15075. return e
  15076. }
  15077. func (e *htmlH4) OnBlur(h EventHandler, scope ...any) HTMLH4 {
  15078. e.setEventHandler("blur", h, scope...)
  15079. return e
  15080. }
  15081. func (e *htmlH4) OnChange(h EventHandler, scope ...any) HTMLH4 {
  15082. e.setEventHandler("change", h, scope...)
  15083. return e
  15084. }
  15085. func (e *htmlH4) OnClick(h EventHandler, scope ...any) HTMLH4 {
  15086. e.setEventHandler("click", h, scope...)
  15087. return e
  15088. }
  15089. func (e *htmlH4) OnContextMenu(h EventHandler, scope ...any) HTMLH4 {
  15090. e.setEventHandler("contextmenu", h, scope...)
  15091. return e
  15092. }
  15093. func (e *htmlH4) OnCopy(h EventHandler, scope ...any) HTMLH4 {
  15094. e.setEventHandler("copy", h, scope...)
  15095. return e
  15096. }
  15097. func (e *htmlH4) OnCut(h EventHandler, scope ...any) HTMLH4 {
  15098. e.setEventHandler("cut", h, scope...)
  15099. return e
  15100. }
  15101. func (e *htmlH4) OnDblClick(h EventHandler, scope ...any) HTMLH4 {
  15102. e.setEventHandler("dblclick", h, scope...)
  15103. return e
  15104. }
  15105. func (e *htmlH4) OnDrag(h EventHandler, scope ...any) HTMLH4 {
  15106. e.setEventHandler("drag", h, scope...)
  15107. return e
  15108. }
  15109. func (e *htmlH4) OnDragEnd(h EventHandler, scope ...any) HTMLH4 {
  15110. e.setEventHandler("dragend", h, scope...)
  15111. return e
  15112. }
  15113. func (e *htmlH4) OnDragEnter(h EventHandler, scope ...any) HTMLH4 {
  15114. e.setEventHandler("dragenter", h, scope...)
  15115. return e
  15116. }
  15117. func (e *htmlH4) OnDragLeave(h EventHandler, scope ...any) HTMLH4 {
  15118. e.setEventHandler("dragleave", h, scope...)
  15119. return e
  15120. }
  15121. func (e *htmlH4) OnDragOver(h EventHandler, scope ...any) HTMLH4 {
  15122. e.setEventHandler("dragover", h, scope...)
  15123. return e
  15124. }
  15125. func (e *htmlH4) OnDragStart(h EventHandler, scope ...any) HTMLH4 {
  15126. e.setEventHandler("dragstart", h, scope...)
  15127. return e
  15128. }
  15129. func (e *htmlH4) OnDrop(h EventHandler, scope ...any) HTMLH4 {
  15130. e.setEventHandler("drop", h, scope...)
  15131. return e
  15132. }
  15133. func (e *htmlH4) OnFocus(h EventHandler, scope ...any) HTMLH4 {
  15134. e.setEventHandler("focus", h, scope...)
  15135. return e
  15136. }
  15137. func (e *htmlH4) OnInput(h EventHandler, scope ...any) HTMLH4 {
  15138. e.setEventHandler("input", h, scope...)
  15139. return e
  15140. }
  15141. func (e *htmlH4) OnInvalid(h EventHandler, scope ...any) HTMLH4 {
  15142. e.setEventHandler("invalid", h, scope...)
  15143. return e
  15144. }
  15145. func (e *htmlH4) OnKeyDown(h EventHandler, scope ...any) HTMLH4 {
  15146. e.setEventHandler("keydown", h, scope...)
  15147. return e
  15148. }
  15149. func (e *htmlH4) OnKeyPress(h EventHandler, scope ...any) HTMLH4 {
  15150. e.setEventHandler("keypress", h, scope...)
  15151. return e
  15152. }
  15153. func (e *htmlH4) OnKeyUp(h EventHandler, scope ...any) HTMLH4 {
  15154. e.setEventHandler("keyup", h, scope...)
  15155. return e
  15156. }
  15157. func (e *htmlH4) OnMouseDown(h EventHandler, scope ...any) HTMLH4 {
  15158. e.setEventHandler("mousedown", h, scope...)
  15159. return e
  15160. }
  15161. func (e *htmlH4) OnMouseMove(h EventHandler, scope ...any) HTMLH4 {
  15162. e.setEventHandler("mousemove", h, scope...)
  15163. return e
  15164. }
  15165. func (e *htmlH4) OnMouseOut(h EventHandler, scope ...any) HTMLH4 {
  15166. e.setEventHandler("mouseout", h, scope...)
  15167. return e
  15168. }
  15169. func (e *htmlH4) OnMouseOver(h EventHandler, scope ...any) HTMLH4 {
  15170. e.setEventHandler("mouseover", h, scope...)
  15171. return e
  15172. }
  15173. func (e *htmlH4) OnMouseUp(h EventHandler, scope ...any) HTMLH4 {
  15174. e.setEventHandler("mouseup", h, scope...)
  15175. return e
  15176. }
  15177. func (e *htmlH4) OnPaste(h EventHandler, scope ...any) HTMLH4 {
  15178. e.setEventHandler("paste", h, scope...)
  15179. return e
  15180. }
  15181. func (e *htmlH4) OnReset(h EventHandler, scope ...any) HTMLH4 {
  15182. e.setEventHandler("reset", h, scope...)
  15183. return e
  15184. }
  15185. func (e *htmlH4) OnScroll(h EventHandler, scope ...any) HTMLH4 {
  15186. e.setEventHandler("scroll", h, scope...)
  15187. return e
  15188. }
  15189. func (e *htmlH4) OnSearch(h EventHandler, scope ...any) HTMLH4 {
  15190. e.setEventHandler("search", h, scope...)
  15191. return e
  15192. }
  15193. func (e *htmlH4) OnSelect(h EventHandler, scope ...any) HTMLH4 {
  15194. e.setEventHandler("select", h, scope...)
  15195. return e
  15196. }
  15197. func (e *htmlH4) OnSubmit(h EventHandler, scope ...any) HTMLH4 {
  15198. e.setEventHandler("submit", h, scope...)
  15199. return e
  15200. }
  15201. func (e *htmlH4) OnWheel(h EventHandler, scope ...any) HTMLH4 {
  15202. e.setEventHandler("wheel", h, scope...)
  15203. return e
  15204. }
  15205. // HTMLH5 is the interface that describes a "h5" HTML element.
  15206. type HTMLH5 interface {
  15207. UI
  15208. // Body set the content of the element.
  15209. Body(elems ...UI) HTMLH5
  15210. // Text sets the content of the element with a text node containing the stringified given value.
  15211. Text(v any) HTMLH5
  15212. // AccessKey specifies a shortcut key to activate/focus an element.
  15213. AccessKey(v string) HTMLH5
  15214. // Aria stores accessible rich internet applications (ARIA) data.
  15215. Aria(k string, v any) HTMLH5
  15216. // Attr sets the named attribute with the given value.
  15217. Attr(n string, v any) HTMLH5
  15218. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  15219. Class(v ...string) HTMLH5
  15220. // ContentEditable specifies whether the content of an element is editable or not.
  15221. ContentEditable(v bool) HTMLH5
  15222. // DataSet stores custom data private to the page or application.
  15223. DataSet(k string, v any) HTMLH5
  15224. // Dir specifies the text direction for the content in an element.
  15225. Dir(v string) HTMLH5
  15226. // Draggable specifies whether an element is draggable or not.
  15227. Draggable(v bool) HTMLH5
  15228. // Hidden specifies that an element is not yet, or is no longer relevant.
  15229. Hidden(v bool) HTMLH5
  15230. // ID specifies a unique id for an element.
  15231. ID(v string) HTMLH5
  15232. // Lang specifies the language of the element's content.
  15233. Lang(v string) HTMLH5
  15234. // Role specifies to parsing software the exact function of an element (and its children).
  15235. Role(v string) HTMLH5
  15236. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  15237. Spellcheck(v bool) HTMLH5
  15238. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  15239. Style(k, v string) HTMLH5
  15240. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  15241. Styles(s map[string]string) HTMLH5
  15242. // TabIndex specifies the tabbing order of an element.
  15243. TabIndex(v int) HTMLH5
  15244. // Title specifies extra information about an element.
  15245. Title(v string) HTMLH5
  15246. // On registers the given event handler to the specified event.
  15247. On(event string, h EventHandler, scope ...any) HTMLH5
  15248. // OnBlur calls the given handler when the element loses focus.
  15249. OnBlur(h EventHandler, scope ...any) HTMLH5
  15250. // OnChange calls the given handler when the value of the element is changed.
  15251. OnChange(h EventHandler, scope ...any) HTMLH5
  15252. // OnClick calls the given handler when there is a mouse click on the element.
  15253. OnClick(h EventHandler, scope ...any) HTMLH5
  15254. // OnContextMenu calls the given handler when a context menu is triggered.
  15255. OnContextMenu(h EventHandler, scope ...any) HTMLH5
  15256. // OnCopy calls the given handler when the user copies the content of an element.
  15257. OnCopy(h EventHandler, scope ...any) HTMLH5
  15258. // OnCut calls the given handler when the user cuts the content of an element.
  15259. OnCut(h EventHandler, scope ...any) HTMLH5
  15260. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  15261. OnDblClick(h EventHandler, scope ...any) HTMLH5
  15262. // OnDrag calls the given handler when an element is dragged.
  15263. OnDrag(h EventHandler, scope ...any) HTMLH5
  15264. // OnDragEnd calls the given handler at the end of a drag operation.
  15265. OnDragEnd(h EventHandler, scope ...any) HTMLH5
  15266. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  15267. OnDragEnter(h EventHandler, scope ...any) HTMLH5
  15268. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  15269. OnDragLeave(h EventHandler, scope ...any) HTMLH5
  15270. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  15271. OnDragOver(h EventHandler, scope ...any) HTMLH5
  15272. // OnDragStart calls the given handler at the start of a drag operation.
  15273. OnDragStart(h EventHandler, scope ...any) HTMLH5
  15274. // OnDrop calls the given handler when dragged element is being dropped.
  15275. OnDrop(h EventHandler, scope ...any) HTMLH5
  15276. // OnFocus calls the given handler when the element gets focus.
  15277. OnFocus(h EventHandler, scope ...any) HTMLH5
  15278. // OnInput calls the given handler when an element gets user input.
  15279. OnInput(h EventHandler, scope ...any) HTMLH5
  15280. // OnInvalid calls the given handler when an element is invalid.
  15281. OnInvalid(h EventHandler, scope ...any) HTMLH5
  15282. // OnKeyDown calls the given handler when a user is pressing a key.
  15283. OnKeyDown(h EventHandler, scope ...any) HTMLH5
  15284. // OnKeyPress calls the given handler when a user presses a key.
  15285. OnKeyPress(h EventHandler, scope ...any) HTMLH5
  15286. // OnKeyUp calls the given handler when a user releases a key.
  15287. OnKeyUp(h EventHandler, scope ...any) HTMLH5
  15288. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  15289. OnMouseDown(h EventHandler, scope ...any) HTMLH5
  15290. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  15291. OnMouseMove(h EventHandler, scope ...any) HTMLH5
  15292. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  15293. OnMouseOut(h EventHandler, scope ...any) HTMLH5
  15294. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  15295. OnMouseOver(h EventHandler, scope ...any) HTMLH5
  15296. // OnMouseUp calls the given handler when a mouse button is released over an element.
  15297. OnMouseUp(h EventHandler, scope ...any) HTMLH5
  15298. // OnPaste calls the given handler when the user pastes some content in an element.
  15299. OnPaste(h EventHandler, scope ...any) HTMLH5
  15300. // OnReset calls the given handler when the Reset button in a form is clicked.
  15301. OnReset(h EventHandler, scope ...any) HTMLH5
  15302. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  15303. OnScroll(h EventHandler, scope ...any) HTMLH5
  15304. // OnSearch calls the given handler when the user writes something in a search field.
  15305. OnSearch(h EventHandler, scope ...any) HTMLH5
  15306. // OnSelect calls the given handler after some text has been selected in an element.
  15307. OnSelect(h EventHandler, scope ...any) HTMLH5
  15308. // OnSubmit calls the given handler when a form is submitted.
  15309. OnSubmit(h EventHandler, scope ...any) HTMLH5
  15310. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  15311. OnWheel(h EventHandler, scope ...any) HTMLH5
  15312. }
  15313. // H5 returns an HTML element that defines HTML heading.
  15314. func H5() HTMLH5 {
  15315. e := &htmlH5{
  15316. htmlElement: htmlElement{
  15317. tag: "h5",
  15318. isSelfClosing: false,
  15319. },
  15320. }
  15321. return e
  15322. }
  15323. type htmlH5 struct {
  15324. htmlElement
  15325. }
  15326. func (e *htmlH5) Body(v ...UI) HTMLH5 {
  15327. e.setChildren(v...)
  15328. return e
  15329. }
  15330. func (e *htmlH5) Text(v any) HTMLH5 {
  15331. return e.Body(Text(v))
  15332. }
  15333. func (e *htmlH5) AccessKey(v string) HTMLH5 {
  15334. e.setAttr("accesskey", v)
  15335. return e
  15336. }
  15337. func (e *htmlH5) Aria(k string, v any) HTMLH5 {
  15338. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  15339. return e
  15340. }
  15341. func (e *htmlH5) Attr(n string, v any) HTMLH5 {
  15342. e.setAttr(n, v)
  15343. return e
  15344. }
  15345. func (e *htmlH5) Class(v ...string) HTMLH5 {
  15346. e.setAttr("class", strings.Join(v, " "))
  15347. return e
  15348. }
  15349. func (e *htmlH5) ContentEditable(v bool) HTMLH5 {
  15350. e.setAttr("contenteditable", v)
  15351. return e
  15352. }
  15353. func (e *htmlH5) DataSet(k string, v any) HTMLH5 {
  15354. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  15355. return e
  15356. }
  15357. func (e *htmlH5) Dir(v string) HTMLH5 {
  15358. e.setAttr("dir", v)
  15359. return e
  15360. }
  15361. func (e *htmlH5) Draggable(v bool) HTMLH5 {
  15362. e.setAttr("draggable", v)
  15363. return e
  15364. }
  15365. func (e *htmlH5) Hidden(v bool) HTMLH5 {
  15366. e.setAttr("hidden", v)
  15367. return e
  15368. }
  15369. func (e *htmlH5) ID(v string) HTMLH5 {
  15370. e.setAttr("id", v)
  15371. return e
  15372. }
  15373. func (e *htmlH5) Lang(v string) HTMLH5 {
  15374. e.setAttr("lang", v)
  15375. return e
  15376. }
  15377. func (e *htmlH5) Role(v string) HTMLH5 {
  15378. e.setAttr("role", v)
  15379. return e
  15380. }
  15381. func (e *htmlH5) Spellcheck(v bool) HTMLH5 {
  15382. s := "false"
  15383. if v {
  15384. s = "true"
  15385. }
  15386. e.setAttr("spellcheck", s)
  15387. return e
  15388. }
  15389. func (e *htmlH5) Style(k, v string) HTMLH5 {
  15390. e.setAttr("style", k+":"+v)
  15391. return e
  15392. }
  15393. func (e *htmlH5) Styles(s map[string]string) HTMLH5 {
  15394. for k, v := range s {
  15395. e.Style(k, v)
  15396. }
  15397. return e
  15398. }
  15399. func (e *htmlH5) TabIndex(v int) HTMLH5 {
  15400. e.setAttr("tabindex", v)
  15401. return e
  15402. }
  15403. func (e *htmlH5) Title(v string) HTMLH5 {
  15404. e.setAttr("title", v)
  15405. return e
  15406. }
  15407. func (e *htmlH5) On(event string, h EventHandler, scope ...any) HTMLH5 {
  15408. e.setEventHandler(event, h, scope...)
  15409. return e
  15410. }
  15411. func (e *htmlH5) OnBlur(h EventHandler, scope ...any) HTMLH5 {
  15412. e.setEventHandler("blur", h, scope...)
  15413. return e
  15414. }
  15415. func (e *htmlH5) OnChange(h EventHandler, scope ...any) HTMLH5 {
  15416. e.setEventHandler("change", h, scope...)
  15417. return e
  15418. }
  15419. func (e *htmlH5) OnClick(h EventHandler, scope ...any) HTMLH5 {
  15420. e.setEventHandler("click", h, scope...)
  15421. return e
  15422. }
  15423. func (e *htmlH5) OnContextMenu(h EventHandler, scope ...any) HTMLH5 {
  15424. e.setEventHandler("contextmenu", h, scope...)
  15425. return e
  15426. }
  15427. func (e *htmlH5) OnCopy(h EventHandler, scope ...any) HTMLH5 {
  15428. e.setEventHandler("copy", h, scope...)
  15429. return e
  15430. }
  15431. func (e *htmlH5) OnCut(h EventHandler, scope ...any) HTMLH5 {
  15432. e.setEventHandler("cut", h, scope...)
  15433. return e
  15434. }
  15435. func (e *htmlH5) OnDblClick(h EventHandler, scope ...any) HTMLH5 {
  15436. e.setEventHandler("dblclick", h, scope...)
  15437. return e
  15438. }
  15439. func (e *htmlH5) OnDrag(h EventHandler, scope ...any) HTMLH5 {
  15440. e.setEventHandler("drag", h, scope...)
  15441. return e
  15442. }
  15443. func (e *htmlH5) OnDragEnd(h EventHandler, scope ...any) HTMLH5 {
  15444. e.setEventHandler("dragend", h, scope...)
  15445. return e
  15446. }
  15447. func (e *htmlH5) OnDragEnter(h EventHandler, scope ...any) HTMLH5 {
  15448. e.setEventHandler("dragenter", h, scope...)
  15449. return e
  15450. }
  15451. func (e *htmlH5) OnDragLeave(h EventHandler, scope ...any) HTMLH5 {
  15452. e.setEventHandler("dragleave", h, scope...)
  15453. return e
  15454. }
  15455. func (e *htmlH5) OnDragOver(h EventHandler, scope ...any) HTMLH5 {
  15456. e.setEventHandler("dragover", h, scope...)
  15457. return e
  15458. }
  15459. func (e *htmlH5) OnDragStart(h EventHandler, scope ...any) HTMLH5 {
  15460. e.setEventHandler("dragstart", h, scope...)
  15461. return e
  15462. }
  15463. func (e *htmlH5) OnDrop(h EventHandler, scope ...any) HTMLH5 {
  15464. e.setEventHandler("drop", h, scope...)
  15465. return e
  15466. }
  15467. func (e *htmlH5) OnFocus(h EventHandler, scope ...any) HTMLH5 {
  15468. e.setEventHandler("focus", h, scope...)
  15469. return e
  15470. }
  15471. func (e *htmlH5) OnInput(h EventHandler, scope ...any) HTMLH5 {
  15472. e.setEventHandler("input", h, scope...)
  15473. return e
  15474. }
  15475. func (e *htmlH5) OnInvalid(h EventHandler, scope ...any) HTMLH5 {
  15476. e.setEventHandler("invalid", h, scope...)
  15477. return e
  15478. }
  15479. func (e *htmlH5) OnKeyDown(h EventHandler, scope ...any) HTMLH5 {
  15480. e.setEventHandler("keydown", h, scope...)
  15481. return e
  15482. }
  15483. func (e *htmlH5) OnKeyPress(h EventHandler, scope ...any) HTMLH5 {
  15484. e.setEventHandler("keypress", h, scope...)
  15485. return e
  15486. }
  15487. func (e *htmlH5) OnKeyUp(h EventHandler, scope ...any) HTMLH5 {
  15488. e.setEventHandler("keyup", h, scope...)
  15489. return e
  15490. }
  15491. func (e *htmlH5) OnMouseDown(h EventHandler, scope ...any) HTMLH5 {
  15492. e.setEventHandler("mousedown", h, scope...)
  15493. return e
  15494. }
  15495. func (e *htmlH5) OnMouseMove(h EventHandler, scope ...any) HTMLH5 {
  15496. e.setEventHandler("mousemove", h, scope...)
  15497. return e
  15498. }
  15499. func (e *htmlH5) OnMouseOut(h EventHandler, scope ...any) HTMLH5 {
  15500. e.setEventHandler("mouseout", h, scope...)
  15501. return e
  15502. }
  15503. func (e *htmlH5) OnMouseOver(h EventHandler, scope ...any) HTMLH5 {
  15504. e.setEventHandler("mouseover", h, scope...)
  15505. return e
  15506. }
  15507. func (e *htmlH5) OnMouseUp(h EventHandler, scope ...any) HTMLH5 {
  15508. e.setEventHandler("mouseup", h, scope...)
  15509. return e
  15510. }
  15511. func (e *htmlH5) OnPaste(h EventHandler, scope ...any) HTMLH5 {
  15512. e.setEventHandler("paste", h, scope...)
  15513. return e
  15514. }
  15515. func (e *htmlH5) OnReset(h EventHandler, scope ...any) HTMLH5 {
  15516. e.setEventHandler("reset", h, scope...)
  15517. return e
  15518. }
  15519. func (e *htmlH5) OnScroll(h EventHandler, scope ...any) HTMLH5 {
  15520. e.setEventHandler("scroll", h, scope...)
  15521. return e
  15522. }
  15523. func (e *htmlH5) OnSearch(h EventHandler, scope ...any) HTMLH5 {
  15524. e.setEventHandler("search", h, scope...)
  15525. return e
  15526. }
  15527. func (e *htmlH5) OnSelect(h EventHandler, scope ...any) HTMLH5 {
  15528. e.setEventHandler("select", h, scope...)
  15529. return e
  15530. }
  15531. func (e *htmlH5) OnSubmit(h EventHandler, scope ...any) HTMLH5 {
  15532. e.setEventHandler("submit", h, scope...)
  15533. return e
  15534. }
  15535. func (e *htmlH5) OnWheel(h EventHandler, scope ...any) HTMLH5 {
  15536. e.setEventHandler("wheel", h, scope...)
  15537. return e
  15538. }
  15539. // HTMLH6 is the interface that describes a "h6" HTML element.
  15540. type HTMLH6 interface {
  15541. UI
  15542. // Body set the content of the element.
  15543. Body(elems ...UI) HTMLH6
  15544. // Text sets the content of the element with a text node containing the stringified given value.
  15545. Text(v any) HTMLH6
  15546. // AccessKey specifies a shortcut key to activate/focus an element.
  15547. AccessKey(v string) HTMLH6
  15548. // Aria stores accessible rich internet applications (ARIA) data.
  15549. Aria(k string, v any) HTMLH6
  15550. // Attr sets the named attribute with the given value.
  15551. Attr(n string, v any) HTMLH6
  15552. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  15553. Class(v ...string) HTMLH6
  15554. // ContentEditable specifies whether the content of an element is editable or not.
  15555. ContentEditable(v bool) HTMLH6
  15556. // DataSet stores custom data private to the page or application.
  15557. DataSet(k string, v any) HTMLH6
  15558. // Dir specifies the text direction for the content in an element.
  15559. Dir(v string) HTMLH6
  15560. // Draggable specifies whether an element is draggable or not.
  15561. Draggable(v bool) HTMLH6
  15562. // Hidden specifies that an element is not yet, or is no longer relevant.
  15563. Hidden(v bool) HTMLH6
  15564. // ID specifies a unique id for an element.
  15565. ID(v string) HTMLH6
  15566. // Lang specifies the language of the element's content.
  15567. Lang(v string) HTMLH6
  15568. // Role specifies to parsing software the exact function of an element (and its children).
  15569. Role(v string) HTMLH6
  15570. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  15571. Spellcheck(v bool) HTMLH6
  15572. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  15573. Style(k, v string) HTMLH6
  15574. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  15575. Styles(s map[string]string) HTMLH6
  15576. // TabIndex specifies the tabbing order of an element.
  15577. TabIndex(v int) HTMLH6
  15578. // Title specifies extra information about an element.
  15579. Title(v string) HTMLH6
  15580. // On registers the given event handler to the specified event.
  15581. On(event string, h EventHandler, scope ...any) HTMLH6
  15582. // OnBlur calls the given handler when the element loses focus.
  15583. OnBlur(h EventHandler, scope ...any) HTMLH6
  15584. // OnChange calls the given handler when the value of the element is changed.
  15585. OnChange(h EventHandler, scope ...any) HTMLH6
  15586. // OnClick calls the given handler when there is a mouse click on the element.
  15587. OnClick(h EventHandler, scope ...any) HTMLH6
  15588. // OnContextMenu calls the given handler when a context menu is triggered.
  15589. OnContextMenu(h EventHandler, scope ...any) HTMLH6
  15590. // OnCopy calls the given handler when the user copies the content of an element.
  15591. OnCopy(h EventHandler, scope ...any) HTMLH6
  15592. // OnCut calls the given handler when the user cuts the content of an element.
  15593. OnCut(h EventHandler, scope ...any) HTMLH6
  15594. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  15595. OnDblClick(h EventHandler, scope ...any) HTMLH6
  15596. // OnDrag calls the given handler when an element is dragged.
  15597. OnDrag(h EventHandler, scope ...any) HTMLH6
  15598. // OnDragEnd calls the given handler at the end of a drag operation.
  15599. OnDragEnd(h EventHandler, scope ...any) HTMLH6
  15600. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  15601. OnDragEnter(h EventHandler, scope ...any) HTMLH6
  15602. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  15603. OnDragLeave(h EventHandler, scope ...any) HTMLH6
  15604. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  15605. OnDragOver(h EventHandler, scope ...any) HTMLH6
  15606. // OnDragStart calls the given handler at the start of a drag operation.
  15607. OnDragStart(h EventHandler, scope ...any) HTMLH6
  15608. // OnDrop calls the given handler when dragged element is being dropped.
  15609. OnDrop(h EventHandler, scope ...any) HTMLH6
  15610. // OnFocus calls the given handler when the element gets focus.
  15611. OnFocus(h EventHandler, scope ...any) HTMLH6
  15612. // OnInput calls the given handler when an element gets user input.
  15613. OnInput(h EventHandler, scope ...any) HTMLH6
  15614. // OnInvalid calls the given handler when an element is invalid.
  15615. OnInvalid(h EventHandler, scope ...any) HTMLH6
  15616. // OnKeyDown calls the given handler when a user is pressing a key.
  15617. OnKeyDown(h EventHandler, scope ...any) HTMLH6
  15618. // OnKeyPress calls the given handler when a user presses a key.
  15619. OnKeyPress(h EventHandler, scope ...any) HTMLH6
  15620. // OnKeyUp calls the given handler when a user releases a key.
  15621. OnKeyUp(h EventHandler, scope ...any) HTMLH6
  15622. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  15623. OnMouseDown(h EventHandler, scope ...any) HTMLH6
  15624. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  15625. OnMouseMove(h EventHandler, scope ...any) HTMLH6
  15626. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  15627. OnMouseOut(h EventHandler, scope ...any) HTMLH6
  15628. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  15629. OnMouseOver(h EventHandler, scope ...any) HTMLH6
  15630. // OnMouseUp calls the given handler when a mouse button is released over an element.
  15631. OnMouseUp(h EventHandler, scope ...any) HTMLH6
  15632. // OnPaste calls the given handler when the user pastes some content in an element.
  15633. OnPaste(h EventHandler, scope ...any) HTMLH6
  15634. // OnReset calls the given handler when the Reset button in a form is clicked.
  15635. OnReset(h EventHandler, scope ...any) HTMLH6
  15636. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  15637. OnScroll(h EventHandler, scope ...any) HTMLH6
  15638. // OnSearch calls the given handler when the user writes something in a search field.
  15639. OnSearch(h EventHandler, scope ...any) HTMLH6
  15640. // OnSelect calls the given handler after some text has been selected in an element.
  15641. OnSelect(h EventHandler, scope ...any) HTMLH6
  15642. // OnSubmit calls the given handler when a form is submitted.
  15643. OnSubmit(h EventHandler, scope ...any) HTMLH6
  15644. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  15645. OnWheel(h EventHandler, scope ...any) HTMLH6
  15646. }
  15647. // H6 returns an HTML element that defines HTML heading.
  15648. func H6() HTMLH6 {
  15649. e := &htmlH6{
  15650. htmlElement: htmlElement{
  15651. tag: "h6",
  15652. isSelfClosing: false,
  15653. },
  15654. }
  15655. return e
  15656. }
  15657. type htmlH6 struct {
  15658. htmlElement
  15659. }
  15660. func (e *htmlH6) Body(v ...UI) HTMLH6 {
  15661. e.setChildren(v...)
  15662. return e
  15663. }
  15664. func (e *htmlH6) Text(v any) HTMLH6 {
  15665. return e.Body(Text(v))
  15666. }
  15667. func (e *htmlH6) AccessKey(v string) HTMLH6 {
  15668. e.setAttr("accesskey", v)
  15669. return e
  15670. }
  15671. func (e *htmlH6) Aria(k string, v any) HTMLH6 {
  15672. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  15673. return e
  15674. }
  15675. func (e *htmlH6) Attr(n string, v any) HTMLH6 {
  15676. e.setAttr(n, v)
  15677. return e
  15678. }
  15679. func (e *htmlH6) Class(v ...string) HTMLH6 {
  15680. e.setAttr("class", strings.Join(v, " "))
  15681. return e
  15682. }
  15683. func (e *htmlH6) ContentEditable(v bool) HTMLH6 {
  15684. e.setAttr("contenteditable", v)
  15685. return e
  15686. }
  15687. func (e *htmlH6) DataSet(k string, v any) HTMLH6 {
  15688. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  15689. return e
  15690. }
  15691. func (e *htmlH6) Dir(v string) HTMLH6 {
  15692. e.setAttr("dir", v)
  15693. return e
  15694. }
  15695. func (e *htmlH6) Draggable(v bool) HTMLH6 {
  15696. e.setAttr("draggable", v)
  15697. return e
  15698. }
  15699. func (e *htmlH6) Hidden(v bool) HTMLH6 {
  15700. e.setAttr("hidden", v)
  15701. return e
  15702. }
  15703. func (e *htmlH6) ID(v string) HTMLH6 {
  15704. e.setAttr("id", v)
  15705. return e
  15706. }
  15707. func (e *htmlH6) Lang(v string) HTMLH6 {
  15708. e.setAttr("lang", v)
  15709. return e
  15710. }
  15711. func (e *htmlH6) Role(v string) HTMLH6 {
  15712. e.setAttr("role", v)
  15713. return e
  15714. }
  15715. func (e *htmlH6) Spellcheck(v bool) HTMLH6 {
  15716. s := "false"
  15717. if v {
  15718. s = "true"
  15719. }
  15720. e.setAttr("spellcheck", s)
  15721. return e
  15722. }
  15723. func (e *htmlH6) Style(k, v string) HTMLH6 {
  15724. e.setAttr("style", k+":"+v)
  15725. return e
  15726. }
  15727. func (e *htmlH6) Styles(s map[string]string) HTMLH6 {
  15728. for k, v := range s {
  15729. e.Style(k, v)
  15730. }
  15731. return e
  15732. }
  15733. func (e *htmlH6) TabIndex(v int) HTMLH6 {
  15734. e.setAttr("tabindex", v)
  15735. return e
  15736. }
  15737. func (e *htmlH6) Title(v string) HTMLH6 {
  15738. e.setAttr("title", v)
  15739. return e
  15740. }
  15741. func (e *htmlH6) On(event string, h EventHandler, scope ...any) HTMLH6 {
  15742. e.setEventHandler(event, h, scope...)
  15743. return e
  15744. }
  15745. func (e *htmlH6) OnBlur(h EventHandler, scope ...any) HTMLH6 {
  15746. e.setEventHandler("blur", h, scope...)
  15747. return e
  15748. }
  15749. func (e *htmlH6) OnChange(h EventHandler, scope ...any) HTMLH6 {
  15750. e.setEventHandler("change", h, scope...)
  15751. return e
  15752. }
  15753. func (e *htmlH6) OnClick(h EventHandler, scope ...any) HTMLH6 {
  15754. e.setEventHandler("click", h, scope...)
  15755. return e
  15756. }
  15757. func (e *htmlH6) OnContextMenu(h EventHandler, scope ...any) HTMLH6 {
  15758. e.setEventHandler("contextmenu", h, scope...)
  15759. return e
  15760. }
  15761. func (e *htmlH6) OnCopy(h EventHandler, scope ...any) HTMLH6 {
  15762. e.setEventHandler("copy", h, scope...)
  15763. return e
  15764. }
  15765. func (e *htmlH6) OnCut(h EventHandler, scope ...any) HTMLH6 {
  15766. e.setEventHandler("cut", h, scope...)
  15767. return e
  15768. }
  15769. func (e *htmlH6) OnDblClick(h EventHandler, scope ...any) HTMLH6 {
  15770. e.setEventHandler("dblclick", h, scope...)
  15771. return e
  15772. }
  15773. func (e *htmlH6) OnDrag(h EventHandler, scope ...any) HTMLH6 {
  15774. e.setEventHandler("drag", h, scope...)
  15775. return e
  15776. }
  15777. func (e *htmlH6) OnDragEnd(h EventHandler, scope ...any) HTMLH6 {
  15778. e.setEventHandler("dragend", h, scope...)
  15779. return e
  15780. }
  15781. func (e *htmlH6) OnDragEnter(h EventHandler, scope ...any) HTMLH6 {
  15782. e.setEventHandler("dragenter", h, scope...)
  15783. return e
  15784. }
  15785. func (e *htmlH6) OnDragLeave(h EventHandler, scope ...any) HTMLH6 {
  15786. e.setEventHandler("dragleave", h, scope...)
  15787. return e
  15788. }
  15789. func (e *htmlH6) OnDragOver(h EventHandler, scope ...any) HTMLH6 {
  15790. e.setEventHandler("dragover", h, scope...)
  15791. return e
  15792. }
  15793. func (e *htmlH6) OnDragStart(h EventHandler, scope ...any) HTMLH6 {
  15794. e.setEventHandler("dragstart", h, scope...)
  15795. return e
  15796. }
  15797. func (e *htmlH6) OnDrop(h EventHandler, scope ...any) HTMLH6 {
  15798. e.setEventHandler("drop", h, scope...)
  15799. return e
  15800. }
  15801. func (e *htmlH6) OnFocus(h EventHandler, scope ...any) HTMLH6 {
  15802. e.setEventHandler("focus", h, scope...)
  15803. return e
  15804. }
  15805. func (e *htmlH6) OnInput(h EventHandler, scope ...any) HTMLH6 {
  15806. e.setEventHandler("input", h, scope...)
  15807. return e
  15808. }
  15809. func (e *htmlH6) OnInvalid(h EventHandler, scope ...any) HTMLH6 {
  15810. e.setEventHandler("invalid", h, scope...)
  15811. return e
  15812. }
  15813. func (e *htmlH6) OnKeyDown(h EventHandler, scope ...any) HTMLH6 {
  15814. e.setEventHandler("keydown", h, scope...)
  15815. return e
  15816. }
  15817. func (e *htmlH6) OnKeyPress(h EventHandler, scope ...any) HTMLH6 {
  15818. e.setEventHandler("keypress", h, scope...)
  15819. return e
  15820. }
  15821. func (e *htmlH6) OnKeyUp(h EventHandler, scope ...any) HTMLH6 {
  15822. e.setEventHandler("keyup", h, scope...)
  15823. return e
  15824. }
  15825. func (e *htmlH6) OnMouseDown(h EventHandler, scope ...any) HTMLH6 {
  15826. e.setEventHandler("mousedown", h, scope...)
  15827. return e
  15828. }
  15829. func (e *htmlH6) OnMouseMove(h EventHandler, scope ...any) HTMLH6 {
  15830. e.setEventHandler("mousemove", h, scope...)
  15831. return e
  15832. }
  15833. func (e *htmlH6) OnMouseOut(h EventHandler, scope ...any) HTMLH6 {
  15834. e.setEventHandler("mouseout", h, scope...)
  15835. return e
  15836. }
  15837. func (e *htmlH6) OnMouseOver(h EventHandler, scope ...any) HTMLH6 {
  15838. e.setEventHandler("mouseover", h, scope...)
  15839. return e
  15840. }
  15841. func (e *htmlH6) OnMouseUp(h EventHandler, scope ...any) HTMLH6 {
  15842. e.setEventHandler("mouseup", h, scope...)
  15843. return e
  15844. }
  15845. func (e *htmlH6) OnPaste(h EventHandler, scope ...any) HTMLH6 {
  15846. e.setEventHandler("paste", h, scope...)
  15847. return e
  15848. }
  15849. func (e *htmlH6) OnReset(h EventHandler, scope ...any) HTMLH6 {
  15850. e.setEventHandler("reset", h, scope...)
  15851. return e
  15852. }
  15853. func (e *htmlH6) OnScroll(h EventHandler, scope ...any) HTMLH6 {
  15854. e.setEventHandler("scroll", h, scope...)
  15855. return e
  15856. }
  15857. func (e *htmlH6) OnSearch(h EventHandler, scope ...any) HTMLH6 {
  15858. e.setEventHandler("search", h, scope...)
  15859. return e
  15860. }
  15861. func (e *htmlH6) OnSelect(h EventHandler, scope ...any) HTMLH6 {
  15862. e.setEventHandler("select", h, scope...)
  15863. return e
  15864. }
  15865. func (e *htmlH6) OnSubmit(h EventHandler, scope ...any) HTMLH6 {
  15866. e.setEventHandler("submit", h, scope...)
  15867. return e
  15868. }
  15869. func (e *htmlH6) OnWheel(h EventHandler, scope ...any) HTMLH6 {
  15870. e.setEventHandler("wheel", h, scope...)
  15871. return e
  15872. }
  15873. // HTMLHead is the interface that describes a "head" HTML element.
  15874. type HTMLHead interface {
  15875. UI
  15876. // Body set the content of the element.
  15877. Body(elems ...UI) HTMLHead
  15878. // Text sets the content of the element with a text node containing the stringified given value.
  15879. Text(v any) HTMLHead
  15880. // AccessKey specifies a shortcut key to activate/focus an element.
  15881. AccessKey(v string) HTMLHead
  15882. // Aria stores accessible rich internet applications (ARIA) data.
  15883. Aria(k string, v any) HTMLHead
  15884. // Attr sets the named attribute with the given value.
  15885. Attr(n string, v any) HTMLHead
  15886. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  15887. Class(v ...string) HTMLHead
  15888. // ContentEditable specifies whether the content of an element is editable or not.
  15889. ContentEditable(v bool) HTMLHead
  15890. // DataSet stores custom data private to the page or application.
  15891. DataSet(k string, v any) HTMLHead
  15892. // Dir specifies the text direction for the content in an element.
  15893. Dir(v string) HTMLHead
  15894. // Draggable specifies whether an element is draggable or not.
  15895. Draggable(v bool) HTMLHead
  15896. // Hidden specifies that an element is not yet, or is no longer relevant.
  15897. Hidden(v bool) HTMLHead
  15898. // ID specifies a unique id for an element.
  15899. ID(v string) HTMLHead
  15900. // Lang specifies the language of the element's content.
  15901. Lang(v string) HTMLHead
  15902. // Role specifies to parsing software the exact function of an element (and its children).
  15903. Role(v string) HTMLHead
  15904. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  15905. Spellcheck(v bool) HTMLHead
  15906. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  15907. Style(k, v string) HTMLHead
  15908. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  15909. Styles(s map[string]string) HTMLHead
  15910. // TabIndex specifies the tabbing order of an element.
  15911. TabIndex(v int) HTMLHead
  15912. // Title specifies extra information about an element.
  15913. Title(v string) HTMLHead
  15914. // On registers the given event handler to the specified event.
  15915. On(event string, h EventHandler, scope ...any) HTMLHead
  15916. }
  15917. // Head returns an HTML element that defines information about the document.
  15918. func Head() HTMLHead {
  15919. e := &htmlHead{
  15920. htmlElement: htmlElement{
  15921. tag: "head",
  15922. isSelfClosing: false,
  15923. },
  15924. }
  15925. return e
  15926. }
  15927. type htmlHead struct {
  15928. htmlElement
  15929. }
  15930. func (e *htmlHead) Body(v ...UI) HTMLHead {
  15931. e.setChildren(v...)
  15932. return e
  15933. }
  15934. func (e *htmlHead) Text(v any) HTMLHead {
  15935. return e.Body(Text(v))
  15936. }
  15937. func (e *htmlHead) AccessKey(v string) HTMLHead {
  15938. e.setAttr("accesskey", v)
  15939. return e
  15940. }
  15941. func (e *htmlHead) Aria(k string, v any) HTMLHead {
  15942. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  15943. return e
  15944. }
  15945. func (e *htmlHead) Attr(n string, v any) HTMLHead {
  15946. e.setAttr(n, v)
  15947. return e
  15948. }
  15949. func (e *htmlHead) Class(v ...string) HTMLHead {
  15950. e.setAttr("class", strings.Join(v, " "))
  15951. return e
  15952. }
  15953. func (e *htmlHead) ContentEditable(v bool) HTMLHead {
  15954. e.setAttr("contenteditable", v)
  15955. return e
  15956. }
  15957. func (e *htmlHead) DataSet(k string, v any) HTMLHead {
  15958. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  15959. return e
  15960. }
  15961. func (e *htmlHead) Dir(v string) HTMLHead {
  15962. e.setAttr("dir", v)
  15963. return e
  15964. }
  15965. func (e *htmlHead) Draggable(v bool) HTMLHead {
  15966. e.setAttr("draggable", v)
  15967. return e
  15968. }
  15969. func (e *htmlHead) Hidden(v bool) HTMLHead {
  15970. e.setAttr("hidden", v)
  15971. return e
  15972. }
  15973. func (e *htmlHead) ID(v string) HTMLHead {
  15974. e.setAttr("id", v)
  15975. return e
  15976. }
  15977. func (e *htmlHead) Lang(v string) HTMLHead {
  15978. e.setAttr("lang", v)
  15979. return e
  15980. }
  15981. func (e *htmlHead) Role(v string) HTMLHead {
  15982. e.setAttr("role", v)
  15983. return e
  15984. }
  15985. func (e *htmlHead) Spellcheck(v bool) HTMLHead {
  15986. s := "false"
  15987. if v {
  15988. s = "true"
  15989. }
  15990. e.setAttr("spellcheck", s)
  15991. return e
  15992. }
  15993. func (e *htmlHead) Style(k, v string) HTMLHead {
  15994. e.setAttr("style", k+":"+v)
  15995. return e
  15996. }
  15997. func (e *htmlHead) Styles(s map[string]string) HTMLHead {
  15998. for k, v := range s {
  15999. e.Style(k, v)
  16000. }
  16001. return e
  16002. }
  16003. func (e *htmlHead) TabIndex(v int) HTMLHead {
  16004. e.setAttr("tabindex", v)
  16005. return e
  16006. }
  16007. func (e *htmlHead) Title(v string) HTMLHead {
  16008. e.setAttr("title", v)
  16009. return e
  16010. }
  16011. func (e *htmlHead) On(event string, h EventHandler, scope ...any) HTMLHead {
  16012. e.setEventHandler(event, h, scope...)
  16013. return e
  16014. }
  16015. // HTMLHeader is the interface that describes a "header" HTML element.
  16016. type HTMLHeader interface {
  16017. UI
  16018. // Body set the content of the element.
  16019. Body(elems ...UI) HTMLHeader
  16020. // Text sets the content of the element with a text node containing the stringified given value.
  16021. Text(v any) HTMLHeader
  16022. // AccessKey specifies a shortcut key to activate/focus an element.
  16023. AccessKey(v string) HTMLHeader
  16024. // Aria stores accessible rich internet applications (ARIA) data.
  16025. Aria(k string, v any) HTMLHeader
  16026. // Attr sets the named attribute with the given value.
  16027. Attr(n string, v any) HTMLHeader
  16028. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  16029. Class(v ...string) HTMLHeader
  16030. // ContentEditable specifies whether the content of an element is editable or not.
  16031. ContentEditable(v bool) HTMLHeader
  16032. // DataSet stores custom data private to the page or application.
  16033. DataSet(k string, v any) HTMLHeader
  16034. // Dir specifies the text direction for the content in an element.
  16035. Dir(v string) HTMLHeader
  16036. // Draggable specifies whether an element is draggable or not.
  16037. Draggable(v bool) HTMLHeader
  16038. // Hidden specifies that an element is not yet, or is no longer relevant.
  16039. Hidden(v bool) HTMLHeader
  16040. // ID specifies a unique id for an element.
  16041. ID(v string) HTMLHeader
  16042. // Lang specifies the language of the element's content.
  16043. Lang(v string) HTMLHeader
  16044. // Role specifies to parsing software the exact function of an element (and its children).
  16045. Role(v string) HTMLHeader
  16046. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  16047. Spellcheck(v bool) HTMLHeader
  16048. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  16049. Style(k, v string) HTMLHeader
  16050. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  16051. Styles(s map[string]string) HTMLHeader
  16052. // TabIndex specifies the tabbing order of an element.
  16053. TabIndex(v int) HTMLHeader
  16054. // Title specifies extra information about an element.
  16055. Title(v string) HTMLHeader
  16056. // On registers the given event handler to the specified event.
  16057. On(event string, h EventHandler, scope ...any) HTMLHeader
  16058. // OnBlur calls the given handler when the element loses focus.
  16059. OnBlur(h EventHandler, scope ...any) HTMLHeader
  16060. // OnChange calls the given handler when the value of the element is changed.
  16061. OnChange(h EventHandler, scope ...any) HTMLHeader
  16062. // OnClick calls the given handler when there is a mouse click on the element.
  16063. OnClick(h EventHandler, scope ...any) HTMLHeader
  16064. // OnContextMenu calls the given handler when a context menu is triggered.
  16065. OnContextMenu(h EventHandler, scope ...any) HTMLHeader
  16066. // OnCopy calls the given handler when the user copies the content of an element.
  16067. OnCopy(h EventHandler, scope ...any) HTMLHeader
  16068. // OnCut calls the given handler when the user cuts the content of an element.
  16069. OnCut(h EventHandler, scope ...any) HTMLHeader
  16070. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  16071. OnDblClick(h EventHandler, scope ...any) HTMLHeader
  16072. // OnDrag calls the given handler when an element is dragged.
  16073. OnDrag(h EventHandler, scope ...any) HTMLHeader
  16074. // OnDragEnd calls the given handler at the end of a drag operation.
  16075. OnDragEnd(h EventHandler, scope ...any) HTMLHeader
  16076. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  16077. OnDragEnter(h EventHandler, scope ...any) HTMLHeader
  16078. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  16079. OnDragLeave(h EventHandler, scope ...any) HTMLHeader
  16080. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  16081. OnDragOver(h EventHandler, scope ...any) HTMLHeader
  16082. // OnDragStart calls the given handler at the start of a drag operation.
  16083. OnDragStart(h EventHandler, scope ...any) HTMLHeader
  16084. // OnDrop calls the given handler when dragged element is being dropped.
  16085. OnDrop(h EventHandler, scope ...any) HTMLHeader
  16086. // OnFocus calls the given handler when the element gets focus.
  16087. OnFocus(h EventHandler, scope ...any) HTMLHeader
  16088. // OnInput calls the given handler when an element gets user input.
  16089. OnInput(h EventHandler, scope ...any) HTMLHeader
  16090. // OnInvalid calls the given handler when an element is invalid.
  16091. OnInvalid(h EventHandler, scope ...any) HTMLHeader
  16092. // OnKeyDown calls the given handler when a user is pressing a key.
  16093. OnKeyDown(h EventHandler, scope ...any) HTMLHeader
  16094. // OnKeyPress calls the given handler when a user presses a key.
  16095. OnKeyPress(h EventHandler, scope ...any) HTMLHeader
  16096. // OnKeyUp calls the given handler when a user releases a key.
  16097. OnKeyUp(h EventHandler, scope ...any) HTMLHeader
  16098. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  16099. OnMouseDown(h EventHandler, scope ...any) HTMLHeader
  16100. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  16101. OnMouseMove(h EventHandler, scope ...any) HTMLHeader
  16102. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  16103. OnMouseOut(h EventHandler, scope ...any) HTMLHeader
  16104. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  16105. OnMouseOver(h EventHandler, scope ...any) HTMLHeader
  16106. // OnMouseUp calls the given handler when a mouse button is released over an element.
  16107. OnMouseUp(h EventHandler, scope ...any) HTMLHeader
  16108. // OnPaste calls the given handler when the user pastes some content in an element.
  16109. OnPaste(h EventHandler, scope ...any) HTMLHeader
  16110. // OnReset calls the given handler when the Reset button in a form is clicked.
  16111. OnReset(h EventHandler, scope ...any) HTMLHeader
  16112. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  16113. OnScroll(h EventHandler, scope ...any) HTMLHeader
  16114. // OnSearch calls the given handler when the user writes something in a search field.
  16115. OnSearch(h EventHandler, scope ...any) HTMLHeader
  16116. // OnSelect calls the given handler after some text has been selected in an element.
  16117. OnSelect(h EventHandler, scope ...any) HTMLHeader
  16118. // OnSubmit calls the given handler when a form is submitted.
  16119. OnSubmit(h EventHandler, scope ...any) HTMLHeader
  16120. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  16121. OnWheel(h EventHandler, scope ...any) HTMLHeader
  16122. }
  16123. // Header returns an HTML element that defines a header for a document or section.
  16124. func Header() HTMLHeader {
  16125. e := &htmlHeader{
  16126. htmlElement: htmlElement{
  16127. tag: "header",
  16128. isSelfClosing: false,
  16129. },
  16130. }
  16131. return e
  16132. }
  16133. type htmlHeader struct {
  16134. htmlElement
  16135. }
  16136. func (e *htmlHeader) Body(v ...UI) HTMLHeader {
  16137. e.setChildren(v...)
  16138. return e
  16139. }
  16140. func (e *htmlHeader) Text(v any) HTMLHeader {
  16141. return e.Body(Text(v))
  16142. }
  16143. func (e *htmlHeader) AccessKey(v string) HTMLHeader {
  16144. e.setAttr("accesskey", v)
  16145. return e
  16146. }
  16147. func (e *htmlHeader) Aria(k string, v any) HTMLHeader {
  16148. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  16149. return e
  16150. }
  16151. func (e *htmlHeader) Attr(n string, v any) HTMLHeader {
  16152. e.setAttr(n, v)
  16153. return e
  16154. }
  16155. func (e *htmlHeader) Class(v ...string) HTMLHeader {
  16156. e.setAttr("class", strings.Join(v, " "))
  16157. return e
  16158. }
  16159. func (e *htmlHeader) ContentEditable(v bool) HTMLHeader {
  16160. e.setAttr("contenteditable", v)
  16161. return e
  16162. }
  16163. func (e *htmlHeader) DataSet(k string, v any) HTMLHeader {
  16164. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  16165. return e
  16166. }
  16167. func (e *htmlHeader) Dir(v string) HTMLHeader {
  16168. e.setAttr("dir", v)
  16169. return e
  16170. }
  16171. func (e *htmlHeader) Draggable(v bool) HTMLHeader {
  16172. e.setAttr("draggable", v)
  16173. return e
  16174. }
  16175. func (e *htmlHeader) Hidden(v bool) HTMLHeader {
  16176. e.setAttr("hidden", v)
  16177. return e
  16178. }
  16179. func (e *htmlHeader) ID(v string) HTMLHeader {
  16180. e.setAttr("id", v)
  16181. return e
  16182. }
  16183. func (e *htmlHeader) Lang(v string) HTMLHeader {
  16184. e.setAttr("lang", v)
  16185. return e
  16186. }
  16187. func (e *htmlHeader) Role(v string) HTMLHeader {
  16188. e.setAttr("role", v)
  16189. return e
  16190. }
  16191. func (e *htmlHeader) Spellcheck(v bool) HTMLHeader {
  16192. s := "false"
  16193. if v {
  16194. s = "true"
  16195. }
  16196. e.setAttr("spellcheck", s)
  16197. return e
  16198. }
  16199. func (e *htmlHeader) Style(k, v string) HTMLHeader {
  16200. e.setAttr("style", k+":"+v)
  16201. return e
  16202. }
  16203. func (e *htmlHeader) Styles(s map[string]string) HTMLHeader {
  16204. for k, v := range s {
  16205. e.Style(k, v)
  16206. }
  16207. return e
  16208. }
  16209. func (e *htmlHeader) TabIndex(v int) HTMLHeader {
  16210. e.setAttr("tabindex", v)
  16211. return e
  16212. }
  16213. func (e *htmlHeader) Title(v string) HTMLHeader {
  16214. e.setAttr("title", v)
  16215. return e
  16216. }
  16217. func (e *htmlHeader) On(event string, h EventHandler, scope ...any) HTMLHeader {
  16218. e.setEventHandler(event, h, scope...)
  16219. return e
  16220. }
  16221. func (e *htmlHeader) OnBlur(h EventHandler, scope ...any) HTMLHeader {
  16222. e.setEventHandler("blur", h, scope...)
  16223. return e
  16224. }
  16225. func (e *htmlHeader) OnChange(h EventHandler, scope ...any) HTMLHeader {
  16226. e.setEventHandler("change", h, scope...)
  16227. return e
  16228. }
  16229. func (e *htmlHeader) OnClick(h EventHandler, scope ...any) HTMLHeader {
  16230. e.setEventHandler("click", h, scope...)
  16231. return e
  16232. }
  16233. func (e *htmlHeader) OnContextMenu(h EventHandler, scope ...any) HTMLHeader {
  16234. e.setEventHandler("contextmenu", h, scope...)
  16235. return e
  16236. }
  16237. func (e *htmlHeader) OnCopy(h EventHandler, scope ...any) HTMLHeader {
  16238. e.setEventHandler("copy", h, scope...)
  16239. return e
  16240. }
  16241. func (e *htmlHeader) OnCut(h EventHandler, scope ...any) HTMLHeader {
  16242. e.setEventHandler("cut", h, scope...)
  16243. return e
  16244. }
  16245. func (e *htmlHeader) OnDblClick(h EventHandler, scope ...any) HTMLHeader {
  16246. e.setEventHandler("dblclick", h, scope...)
  16247. return e
  16248. }
  16249. func (e *htmlHeader) OnDrag(h EventHandler, scope ...any) HTMLHeader {
  16250. e.setEventHandler("drag", h, scope...)
  16251. return e
  16252. }
  16253. func (e *htmlHeader) OnDragEnd(h EventHandler, scope ...any) HTMLHeader {
  16254. e.setEventHandler("dragend", h, scope...)
  16255. return e
  16256. }
  16257. func (e *htmlHeader) OnDragEnter(h EventHandler, scope ...any) HTMLHeader {
  16258. e.setEventHandler("dragenter", h, scope...)
  16259. return e
  16260. }
  16261. func (e *htmlHeader) OnDragLeave(h EventHandler, scope ...any) HTMLHeader {
  16262. e.setEventHandler("dragleave", h, scope...)
  16263. return e
  16264. }
  16265. func (e *htmlHeader) OnDragOver(h EventHandler, scope ...any) HTMLHeader {
  16266. e.setEventHandler("dragover", h, scope...)
  16267. return e
  16268. }
  16269. func (e *htmlHeader) OnDragStart(h EventHandler, scope ...any) HTMLHeader {
  16270. e.setEventHandler("dragstart", h, scope...)
  16271. return e
  16272. }
  16273. func (e *htmlHeader) OnDrop(h EventHandler, scope ...any) HTMLHeader {
  16274. e.setEventHandler("drop", h, scope...)
  16275. return e
  16276. }
  16277. func (e *htmlHeader) OnFocus(h EventHandler, scope ...any) HTMLHeader {
  16278. e.setEventHandler("focus", h, scope...)
  16279. return e
  16280. }
  16281. func (e *htmlHeader) OnInput(h EventHandler, scope ...any) HTMLHeader {
  16282. e.setEventHandler("input", h, scope...)
  16283. return e
  16284. }
  16285. func (e *htmlHeader) OnInvalid(h EventHandler, scope ...any) HTMLHeader {
  16286. e.setEventHandler("invalid", h, scope...)
  16287. return e
  16288. }
  16289. func (e *htmlHeader) OnKeyDown(h EventHandler, scope ...any) HTMLHeader {
  16290. e.setEventHandler("keydown", h, scope...)
  16291. return e
  16292. }
  16293. func (e *htmlHeader) OnKeyPress(h EventHandler, scope ...any) HTMLHeader {
  16294. e.setEventHandler("keypress", h, scope...)
  16295. return e
  16296. }
  16297. func (e *htmlHeader) OnKeyUp(h EventHandler, scope ...any) HTMLHeader {
  16298. e.setEventHandler("keyup", h, scope...)
  16299. return e
  16300. }
  16301. func (e *htmlHeader) OnMouseDown(h EventHandler, scope ...any) HTMLHeader {
  16302. e.setEventHandler("mousedown", h, scope...)
  16303. return e
  16304. }
  16305. func (e *htmlHeader) OnMouseMove(h EventHandler, scope ...any) HTMLHeader {
  16306. e.setEventHandler("mousemove", h, scope...)
  16307. return e
  16308. }
  16309. func (e *htmlHeader) OnMouseOut(h EventHandler, scope ...any) HTMLHeader {
  16310. e.setEventHandler("mouseout", h, scope...)
  16311. return e
  16312. }
  16313. func (e *htmlHeader) OnMouseOver(h EventHandler, scope ...any) HTMLHeader {
  16314. e.setEventHandler("mouseover", h, scope...)
  16315. return e
  16316. }
  16317. func (e *htmlHeader) OnMouseUp(h EventHandler, scope ...any) HTMLHeader {
  16318. e.setEventHandler("mouseup", h, scope...)
  16319. return e
  16320. }
  16321. func (e *htmlHeader) OnPaste(h EventHandler, scope ...any) HTMLHeader {
  16322. e.setEventHandler("paste", h, scope...)
  16323. return e
  16324. }
  16325. func (e *htmlHeader) OnReset(h EventHandler, scope ...any) HTMLHeader {
  16326. e.setEventHandler("reset", h, scope...)
  16327. return e
  16328. }
  16329. func (e *htmlHeader) OnScroll(h EventHandler, scope ...any) HTMLHeader {
  16330. e.setEventHandler("scroll", h, scope...)
  16331. return e
  16332. }
  16333. func (e *htmlHeader) OnSearch(h EventHandler, scope ...any) HTMLHeader {
  16334. e.setEventHandler("search", h, scope...)
  16335. return e
  16336. }
  16337. func (e *htmlHeader) OnSelect(h EventHandler, scope ...any) HTMLHeader {
  16338. e.setEventHandler("select", h, scope...)
  16339. return e
  16340. }
  16341. func (e *htmlHeader) OnSubmit(h EventHandler, scope ...any) HTMLHeader {
  16342. e.setEventHandler("submit", h, scope...)
  16343. return e
  16344. }
  16345. func (e *htmlHeader) OnWheel(h EventHandler, scope ...any) HTMLHeader {
  16346. e.setEventHandler("wheel", h, scope...)
  16347. return e
  16348. }
  16349. // HTMLHr is the interface that describes a "hr" HTML element.
  16350. type HTMLHr interface {
  16351. UI
  16352. // AccessKey specifies a shortcut key to activate/focus an element.
  16353. AccessKey(v string) HTMLHr
  16354. // Aria stores accessible rich internet applications (ARIA) data.
  16355. Aria(k string, v any) HTMLHr
  16356. // Attr sets the named attribute with the given value.
  16357. Attr(n string, v any) HTMLHr
  16358. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  16359. Class(v ...string) HTMLHr
  16360. // ContentEditable specifies whether the content of an element is editable or not.
  16361. ContentEditable(v bool) HTMLHr
  16362. // DataSet stores custom data private to the page or application.
  16363. DataSet(k string, v any) HTMLHr
  16364. // Dir specifies the text direction for the content in an element.
  16365. Dir(v string) HTMLHr
  16366. // Draggable specifies whether an element is draggable or not.
  16367. Draggable(v bool) HTMLHr
  16368. // Hidden specifies that an element is not yet, or is no longer relevant.
  16369. Hidden(v bool) HTMLHr
  16370. // ID specifies a unique id for an element.
  16371. ID(v string) HTMLHr
  16372. // Lang specifies the language of the element's content.
  16373. Lang(v string) HTMLHr
  16374. // Role specifies to parsing software the exact function of an element (and its children).
  16375. Role(v string) HTMLHr
  16376. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  16377. Spellcheck(v bool) HTMLHr
  16378. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  16379. Style(k, v string) HTMLHr
  16380. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  16381. Styles(s map[string]string) HTMLHr
  16382. // TabIndex specifies the tabbing order of an element.
  16383. TabIndex(v int) HTMLHr
  16384. // Title specifies extra information about an element.
  16385. Title(v string) HTMLHr
  16386. // On registers the given event handler to the specified event.
  16387. On(event string, h EventHandler, scope ...any) HTMLHr
  16388. // OnBlur calls the given handler when the element loses focus.
  16389. OnBlur(h EventHandler, scope ...any) HTMLHr
  16390. // OnChange calls the given handler when the value of the element is changed.
  16391. OnChange(h EventHandler, scope ...any) HTMLHr
  16392. // OnClick calls the given handler when there is a mouse click on the element.
  16393. OnClick(h EventHandler, scope ...any) HTMLHr
  16394. // OnContextMenu calls the given handler when a context menu is triggered.
  16395. OnContextMenu(h EventHandler, scope ...any) HTMLHr
  16396. // OnCopy calls the given handler when the user copies the content of an element.
  16397. OnCopy(h EventHandler, scope ...any) HTMLHr
  16398. // OnCut calls the given handler when the user cuts the content of an element.
  16399. OnCut(h EventHandler, scope ...any) HTMLHr
  16400. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  16401. OnDblClick(h EventHandler, scope ...any) HTMLHr
  16402. // OnDrag calls the given handler when an element is dragged.
  16403. OnDrag(h EventHandler, scope ...any) HTMLHr
  16404. // OnDragEnd calls the given handler at the end of a drag operation.
  16405. OnDragEnd(h EventHandler, scope ...any) HTMLHr
  16406. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  16407. OnDragEnter(h EventHandler, scope ...any) HTMLHr
  16408. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  16409. OnDragLeave(h EventHandler, scope ...any) HTMLHr
  16410. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  16411. OnDragOver(h EventHandler, scope ...any) HTMLHr
  16412. // OnDragStart calls the given handler at the start of a drag operation.
  16413. OnDragStart(h EventHandler, scope ...any) HTMLHr
  16414. // OnDrop calls the given handler when dragged element is being dropped.
  16415. OnDrop(h EventHandler, scope ...any) HTMLHr
  16416. // OnFocus calls the given handler when the element gets focus.
  16417. OnFocus(h EventHandler, scope ...any) HTMLHr
  16418. // OnInput calls the given handler when an element gets user input.
  16419. OnInput(h EventHandler, scope ...any) HTMLHr
  16420. // OnInvalid calls the given handler when an element is invalid.
  16421. OnInvalid(h EventHandler, scope ...any) HTMLHr
  16422. // OnKeyDown calls the given handler when a user is pressing a key.
  16423. OnKeyDown(h EventHandler, scope ...any) HTMLHr
  16424. // OnKeyPress calls the given handler when a user presses a key.
  16425. OnKeyPress(h EventHandler, scope ...any) HTMLHr
  16426. // OnKeyUp calls the given handler when a user releases a key.
  16427. OnKeyUp(h EventHandler, scope ...any) HTMLHr
  16428. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  16429. OnMouseDown(h EventHandler, scope ...any) HTMLHr
  16430. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  16431. OnMouseMove(h EventHandler, scope ...any) HTMLHr
  16432. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  16433. OnMouseOut(h EventHandler, scope ...any) HTMLHr
  16434. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  16435. OnMouseOver(h EventHandler, scope ...any) HTMLHr
  16436. // OnMouseUp calls the given handler when a mouse button is released over an element.
  16437. OnMouseUp(h EventHandler, scope ...any) HTMLHr
  16438. // OnPaste calls the given handler when the user pastes some content in an element.
  16439. OnPaste(h EventHandler, scope ...any) HTMLHr
  16440. // OnReset calls the given handler when the Reset button in a form is clicked.
  16441. OnReset(h EventHandler, scope ...any) HTMLHr
  16442. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  16443. OnScroll(h EventHandler, scope ...any) HTMLHr
  16444. // OnSearch calls the given handler when the user writes something in a search field.
  16445. OnSearch(h EventHandler, scope ...any) HTMLHr
  16446. // OnSelect calls the given handler after some text has been selected in an element.
  16447. OnSelect(h EventHandler, scope ...any) HTMLHr
  16448. // OnSubmit calls the given handler when a form is submitted.
  16449. OnSubmit(h EventHandler, scope ...any) HTMLHr
  16450. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  16451. OnWheel(h EventHandler, scope ...any) HTMLHr
  16452. }
  16453. // Hr returns an HTML element that defines a thematic change in the content.
  16454. func Hr() HTMLHr {
  16455. e := &htmlHr{
  16456. htmlElement: htmlElement{
  16457. tag: "hr",
  16458. isSelfClosing: true,
  16459. },
  16460. }
  16461. return e
  16462. }
  16463. type htmlHr struct {
  16464. htmlElement
  16465. }
  16466. func (e *htmlHr) AccessKey(v string) HTMLHr {
  16467. e.setAttr("accesskey", v)
  16468. return e
  16469. }
  16470. func (e *htmlHr) Aria(k string, v any) HTMLHr {
  16471. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  16472. return e
  16473. }
  16474. func (e *htmlHr) Attr(n string, v any) HTMLHr {
  16475. e.setAttr(n, v)
  16476. return e
  16477. }
  16478. func (e *htmlHr) Class(v ...string) HTMLHr {
  16479. e.setAttr("class", strings.Join(v, " "))
  16480. return e
  16481. }
  16482. func (e *htmlHr) ContentEditable(v bool) HTMLHr {
  16483. e.setAttr("contenteditable", v)
  16484. return e
  16485. }
  16486. func (e *htmlHr) DataSet(k string, v any) HTMLHr {
  16487. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  16488. return e
  16489. }
  16490. func (e *htmlHr) Dir(v string) HTMLHr {
  16491. e.setAttr("dir", v)
  16492. return e
  16493. }
  16494. func (e *htmlHr) Draggable(v bool) HTMLHr {
  16495. e.setAttr("draggable", v)
  16496. return e
  16497. }
  16498. func (e *htmlHr) Hidden(v bool) HTMLHr {
  16499. e.setAttr("hidden", v)
  16500. return e
  16501. }
  16502. func (e *htmlHr) ID(v string) HTMLHr {
  16503. e.setAttr("id", v)
  16504. return e
  16505. }
  16506. func (e *htmlHr) Lang(v string) HTMLHr {
  16507. e.setAttr("lang", v)
  16508. return e
  16509. }
  16510. func (e *htmlHr) Role(v string) HTMLHr {
  16511. e.setAttr("role", v)
  16512. return e
  16513. }
  16514. func (e *htmlHr) Spellcheck(v bool) HTMLHr {
  16515. s := "false"
  16516. if v {
  16517. s = "true"
  16518. }
  16519. e.setAttr("spellcheck", s)
  16520. return e
  16521. }
  16522. func (e *htmlHr) Style(k, v string) HTMLHr {
  16523. e.setAttr("style", k+":"+v)
  16524. return e
  16525. }
  16526. func (e *htmlHr) Styles(s map[string]string) HTMLHr {
  16527. for k, v := range s {
  16528. e.Style(k, v)
  16529. }
  16530. return e
  16531. }
  16532. func (e *htmlHr) TabIndex(v int) HTMLHr {
  16533. e.setAttr("tabindex", v)
  16534. return e
  16535. }
  16536. func (e *htmlHr) Title(v string) HTMLHr {
  16537. e.setAttr("title", v)
  16538. return e
  16539. }
  16540. func (e *htmlHr) On(event string, h EventHandler, scope ...any) HTMLHr {
  16541. e.setEventHandler(event, h, scope...)
  16542. return e
  16543. }
  16544. func (e *htmlHr) OnBlur(h EventHandler, scope ...any) HTMLHr {
  16545. e.setEventHandler("blur", h, scope...)
  16546. return e
  16547. }
  16548. func (e *htmlHr) OnChange(h EventHandler, scope ...any) HTMLHr {
  16549. e.setEventHandler("change", h, scope...)
  16550. return e
  16551. }
  16552. func (e *htmlHr) OnClick(h EventHandler, scope ...any) HTMLHr {
  16553. e.setEventHandler("click", h, scope...)
  16554. return e
  16555. }
  16556. func (e *htmlHr) OnContextMenu(h EventHandler, scope ...any) HTMLHr {
  16557. e.setEventHandler("contextmenu", h, scope...)
  16558. return e
  16559. }
  16560. func (e *htmlHr) OnCopy(h EventHandler, scope ...any) HTMLHr {
  16561. e.setEventHandler("copy", h, scope...)
  16562. return e
  16563. }
  16564. func (e *htmlHr) OnCut(h EventHandler, scope ...any) HTMLHr {
  16565. e.setEventHandler("cut", h, scope...)
  16566. return e
  16567. }
  16568. func (e *htmlHr) OnDblClick(h EventHandler, scope ...any) HTMLHr {
  16569. e.setEventHandler("dblclick", h, scope...)
  16570. return e
  16571. }
  16572. func (e *htmlHr) OnDrag(h EventHandler, scope ...any) HTMLHr {
  16573. e.setEventHandler("drag", h, scope...)
  16574. return e
  16575. }
  16576. func (e *htmlHr) OnDragEnd(h EventHandler, scope ...any) HTMLHr {
  16577. e.setEventHandler("dragend", h, scope...)
  16578. return e
  16579. }
  16580. func (e *htmlHr) OnDragEnter(h EventHandler, scope ...any) HTMLHr {
  16581. e.setEventHandler("dragenter", h, scope...)
  16582. return e
  16583. }
  16584. func (e *htmlHr) OnDragLeave(h EventHandler, scope ...any) HTMLHr {
  16585. e.setEventHandler("dragleave", h, scope...)
  16586. return e
  16587. }
  16588. func (e *htmlHr) OnDragOver(h EventHandler, scope ...any) HTMLHr {
  16589. e.setEventHandler("dragover", h, scope...)
  16590. return e
  16591. }
  16592. func (e *htmlHr) OnDragStart(h EventHandler, scope ...any) HTMLHr {
  16593. e.setEventHandler("dragstart", h, scope...)
  16594. return e
  16595. }
  16596. func (e *htmlHr) OnDrop(h EventHandler, scope ...any) HTMLHr {
  16597. e.setEventHandler("drop", h, scope...)
  16598. return e
  16599. }
  16600. func (e *htmlHr) OnFocus(h EventHandler, scope ...any) HTMLHr {
  16601. e.setEventHandler("focus", h, scope...)
  16602. return e
  16603. }
  16604. func (e *htmlHr) OnInput(h EventHandler, scope ...any) HTMLHr {
  16605. e.setEventHandler("input", h, scope...)
  16606. return e
  16607. }
  16608. func (e *htmlHr) OnInvalid(h EventHandler, scope ...any) HTMLHr {
  16609. e.setEventHandler("invalid", h, scope...)
  16610. return e
  16611. }
  16612. func (e *htmlHr) OnKeyDown(h EventHandler, scope ...any) HTMLHr {
  16613. e.setEventHandler("keydown", h, scope...)
  16614. return e
  16615. }
  16616. func (e *htmlHr) OnKeyPress(h EventHandler, scope ...any) HTMLHr {
  16617. e.setEventHandler("keypress", h, scope...)
  16618. return e
  16619. }
  16620. func (e *htmlHr) OnKeyUp(h EventHandler, scope ...any) HTMLHr {
  16621. e.setEventHandler("keyup", h, scope...)
  16622. return e
  16623. }
  16624. func (e *htmlHr) OnMouseDown(h EventHandler, scope ...any) HTMLHr {
  16625. e.setEventHandler("mousedown", h, scope...)
  16626. return e
  16627. }
  16628. func (e *htmlHr) OnMouseMove(h EventHandler, scope ...any) HTMLHr {
  16629. e.setEventHandler("mousemove", h, scope...)
  16630. return e
  16631. }
  16632. func (e *htmlHr) OnMouseOut(h EventHandler, scope ...any) HTMLHr {
  16633. e.setEventHandler("mouseout", h, scope...)
  16634. return e
  16635. }
  16636. func (e *htmlHr) OnMouseOver(h EventHandler, scope ...any) HTMLHr {
  16637. e.setEventHandler("mouseover", h, scope...)
  16638. return e
  16639. }
  16640. func (e *htmlHr) OnMouseUp(h EventHandler, scope ...any) HTMLHr {
  16641. e.setEventHandler("mouseup", h, scope...)
  16642. return e
  16643. }
  16644. func (e *htmlHr) OnPaste(h EventHandler, scope ...any) HTMLHr {
  16645. e.setEventHandler("paste", h, scope...)
  16646. return e
  16647. }
  16648. func (e *htmlHr) OnReset(h EventHandler, scope ...any) HTMLHr {
  16649. e.setEventHandler("reset", h, scope...)
  16650. return e
  16651. }
  16652. func (e *htmlHr) OnScroll(h EventHandler, scope ...any) HTMLHr {
  16653. e.setEventHandler("scroll", h, scope...)
  16654. return e
  16655. }
  16656. func (e *htmlHr) OnSearch(h EventHandler, scope ...any) HTMLHr {
  16657. e.setEventHandler("search", h, scope...)
  16658. return e
  16659. }
  16660. func (e *htmlHr) OnSelect(h EventHandler, scope ...any) HTMLHr {
  16661. e.setEventHandler("select", h, scope...)
  16662. return e
  16663. }
  16664. func (e *htmlHr) OnSubmit(h EventHandler, scope ...any) HTMLHr {
  16665. e.setEventHandler("submit", h, scope...)
  16666. return e
  16667. }
  16668. func (e *htmlHr) OnWheel(h EventHandler, scope ...any) HTMLHr {
  16669. e.setEventHandler("wheel", h, scope...)
  16670. return e
  16671. }
  16672. // HTMLHtml is the interface that describes a "html" HTML element.
  16673. type HTMLHtml interface {
  16674. UI
  16675. privateBody(elems ...UI) HTMLHtml
  16676. // AccessKey specifies a shortcut key to activate/focus an element.
  16677. AccessKey(v string) HTMLHtml
  16678. // Aria stores accessible rich internet applications (ARIA) data.
  16679. Aria(k string, v any) HTMLHtml
  16680. // Attr sets the named attribute with the given value.
  16681. Attr(n string, v any) HTMLHtml
  16682. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  16683. Class(v ...string) HTMLHtml
  16684. // ContentEditable specifies whether the content of an element is editable or not.
  16685. ContentEditable(v bool) HTMLHtml
  16686. // DataSet stores custom data private to the page or application.
  16687. DataSet(k string, v any) HTMLHtml
  16688. // Dir specifies the text direction for the content in an element.
  16689. Dir(v string) HTMLHtml
  16690. // Draggable specifies whether an element is draggable or not.
  16691. Draggable(v bool) HTMLHtml
  16692. // Hidden specifies that an element is not yet, or is no longer relevant.
  16693. Hidden(v bool) HTMLHtml
  16694. // ID specifies a unique id for an element.
  16695. ID(v string) HTMLHtml
  16696. // Lang specifies the language of the element's content.
  16697. Lang(v string) HTMLHtml
  16698. // Role specifies to parsing software the exact function of an element (and its children).
  16699. Role(v string) HTMLHtml
  16700. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  16701. Spellcheck(v bool) HTMLHtml
  16702. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  16703. Style(k, v string) HTMLHtml
  16704. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  16705. Styles(s map[string]string) HTMLHtml
  16706. // TabIndex specifies the tabbing order of an element.
  16707. TabIndex(v int) HTMLHtml
  16708. // Title specifies extra information about an element.
  16709. Title(v string) HTMLHtml
  16710. // On registers the given event handler to the specified event.
  16711. On(event string, h EventHandler, scope ...any) HTMLHtml
  16712. }
  16713. // Html returns an HTML element that defines the root of an HTML document.
  16714. func Html() HTMLHtml {
  16715. e := &htmlHtml{
  16716. htmlElement: htmlElement{
  16717. tag: "html",
  16718. isSelfClosing: false,
  16719. },
  16720. }
  16721. return e
  16722. }
  16723. type htmlHtml struct {
  16724. htmlElement
  16725. }
  16726. func (e *htmlHtml) privateBody(v ...UI) HTMLHtml {
  16727. e.setChildren(v...)
  16728. return e
  16729. }
  16730. func (e *htmlHtml) AccessKey(v string) HTMLHtml {
  16731. e.setAttr("accesskey", v)
  16732. return e
  16733. }
  16734. func (e *htmlHtml) Aria(k string, v any) HTMLHtml {
  16735. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  16736. return e
  16737. }
  16738. func (e *htmlHtml) Attr(n string, v any) HTMLHtml {
  16739. e.setAttr(n, v)
  16740. return e
  16741. }
  16742. func (e *htmlHtml) Class(v ...string) HTMLHtml {
  16743. e.setAttr("class", strings.Join(v, " "))
  16744. return e
  16745. }
  16746. func (e *htmlHtml) ContentEditable(v bool) HTMLHtml {
  16747. e.setAttr("contenteditable", v)
  16748. return e
  16749. }
  16750. func (e *htmlHtml) DataSet(k string, v any) HTMLHtml {
  16751. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  16752. return e
  16753. }
  16754. func (e *htmlHtml) Dir(v string) HTMLHtml {
  16755. e.setAttr("dir", v)
  16756. return e
  16757. }
  16758. func (e *htmlHtml) Draggable(v bool) HTMLHtml {
  16759. e.setAttr("draggable", v)
  16760. return e
  16761. }
  16762. func (e *htmlHtml) Hidden(v bool) HTMLHtml {
  16763. e.setAttr("hidden", v)
  16764. return e
  16765. }
  16766. func (e *htmlHtml) ID(v string) HTMLHtml {
  16767. e.setAttr("id", v)
  16768. return e
  16769. }
  16770. func (e *htmlHtml) Lang(v string) HTMLHtml {
  16771. e.setAttr("lang", v)
  16772. return e
  16773. }
  16774. func (e *htmlHtml) Role(v string) HTMLHtml {
  16775. e.setAttr("role", v)
  16776. return e
  16777. }
  16778. func (e *htmlHtml) Spellcheck(v bool) HTMLHtml {
  16779. s := "false"
  16780. if v {
  16781. s = "true"
  16782. }
  16783. e.setAttr("spellcheck", s)
  16784. return e
  16785. }
  16786. func (e *htmlHtml) Style(k, v string) HTMLHtml {
  16787. e.setAttr("style", k+":"+v)
  16788. return e
  16789. }
  16790. func (e *htmlHtml) Styles(s map[string]string) HTMLHtml {
  16791. for k, v := range s {
  16792. e.Style(k, v)
  16793. }
  16794. return e
  16795. }
  16796. func (e *htmlHtml) TabIndex(v int) HTMLHtml {
  16797. e.setAttr("tabindex", v)
  16798. return e
  16799. }
  16800. func (e *htmlHtml) Title(v string) HTMLHtml {
  16801. e.setAttr("title", v)
  16802. return e
  16803. }
  16804. func (e *htmlHtml) On(event string, h EventHandler, scope ...any) HTMLHtml {
  16805. e.setEventHandler(event, h, scope...)
  16806. return e
  16807. }
  16808. // HTMLI is the interface that describes a "i" HTML element.
  16809. type HTMLI interface {
  16810. UI
  16811. // Body set the content of the element.
  16812. Body(elems ...UI) HTMLI
  16813. // Text sets the content of the element with a text node containing the stringified given value.
  16814. Text(v any) HTMLI
  16815. // AccessKey specifies a shortcut key to activate/focus an element.
  16816. AccessKey(v string) HTMLI
  16817. // Aria stores accessible rich internet applications (ARIA) data.
  16818. Aria(k string, v any) HTMLI
  16819. // Attr sets the named attribute with the given value.
  16820. Attr(n string, v any) HTMLI
  16821. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  16822. Class(v ...string) HTMLI
  16823. // ContentEditable specifies whether the content of an element is editable or not.
  16824. ContentEditable(v bool) HTMLI
  16825. // DataSet stores custom data private to the page or application.
  16826. DataSet(k string, v any) HTMLI
  16827. // Dir specifies the text direction for the content in an element.
  16828. Dir(v string) HTMLI
  16829. // Draggable specifies whether an element is draggable or not.
  16830. Draggable(v bool) HTMLI
  16831. // Hidden specifies that an element is not yet, or is no longer relevant.
  16832. Hidden(v bool) HTMLI
  16833. // ID specifies a unique id for an element.
  16834. ID(v string) HTMLI
  16835. // Lang specifies the language of the element's content.
  16836. Lang(v string) HTMLI
  16837. // Role specifies to parsing software the exact function of an element (and its children).
  16838. Role(v string) HTMLI
  16839. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  16840. Spellcheck(v bool) HTMLI
  16841. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  16842. Style(k, v string) HTMLI
  16843. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  16844. Styles(s map[string]string) HTMLI
  16845. // TabIndex specifies the tabbing order of an element.
  16846. TabIndex(v int) HTMLI
  16847. // Title specifies extra information about an element.
  16848. Title(v string) HTMLI
  16849. // On registers the given event handler to the specified event.
  16850. On(event string, h EventHandler, scope ...any) HTMLI
  16851. // OnBlur calls the given handler when the element loses focus.
  16852. OnBlur(h EventHandler, scope ...any) HTMLI
  16853. // OnChange calls the given handler when the value of the element is changed.
  16854. OnChange(h EventHandler, scope ...any) HTMLI
  16855. // OnClick calls the given handler when there is a mouse click on the element.
  16856. OnClick(h EventHandler, scope ...any) HTMLI
  16857. // OnContextMenu calls the given handler when a context menu is triggered.
  16858. OnContextMenu(h EventHandler, scope ...any) HTMLI
  16859. // OnCopy calls the given handler when the user copies the content of an element.
  16860. OnCopy(h EventHandler, scope ...any) HTMLI
  16861. // OnCut calls the given handler when the user cuts the content of an element.
  16862. OnCut(h EventHandler, scope ...any) HTMLI
  16863. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  16864. OnDblClick(h EventHandler, scope ...any) HTMLI
  16865. // OnDrag calls the given handler when an element is dragged.
  16866. OnDrag(h EventHandler, scope ...any) HTMLI
  16867. // OnDragEnd calls the given handler at the end of a drag operation.
  16868. OnDragEnd(h EventHandler, scope ...any) HTMLI
  16869. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  16870. OnDragEnter(h EventHandler, scope ...any) HTMLI
  16871. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  16872. OnDragLeave(h EventHandler, scope ...any) HTMLI
  16873. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  16874. OnDragOver(h EventHandler, scope ...any) HTMLI
  16875. // OnDragStart calls the given handler at the start of a drag operation.
  16876. OnDragStart(h EventHandler, scope ...any) HTMLI
  16877. // OnDrop calls the given handler when dragged element is being dropped.
  16878. OnDrop(h EventHandler, scope ...any) HTMLI
  16879. // OnFocus calls the given handler when the element gets focus.
  16880. OnFocus(h EventHandler, scope ...any) HTMLI
  16881. // OnInput calls the given handler when an element gets user input.
  16882. OnInput(h EventHandler, scope ...any) HTMLI
  16883. // OnInvalid calls the given handler when an element is invalid.
  16884. OnInvalid(h EventHandler, scope ...any) HTMLI
  16885. // OnKeyDown calls the given handler when a user is pressing a key.
  16886. OnKeyDown(h EventHandler, scope ...any) HTMLI
  16887. // OnKeyPress calls the given handler when a user presses a key.
  16888. OnKeyPress(h EventHandler, scope ...any) HTMLI
  16889. // OnKeyUp calls the given handler when a user releases a key.
  16890. OnKeyUp(h EventHandler, scope ...any) HTMLI
  16891. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  16892. OnMouseDown(h EventHandler, scope ...any) HTMLI
  16893. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  16894. OnMouseMove(h EventHandler, scope ...any) HTMLI
  16895. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  16896. OnMouseOut(h EventHandler, scope ...any) HTMLI
  16897. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  16898. OnMouseOver(h EventHandler, scope ...any) HTMLI
  16899. // OnMouseUp calls the given handler when a mouse button is released over an element.
  16900. OnMouseUp(h EventHandler, scope ...any) HTMLI
  16901. // OnPaste calls the given handler when the user pastes some content in an element.
  16902. OnPaste(h EventHandler, scope ...any) HTMLI
  16903. // OnReset calls the given handler when the Reset button in a form is clicked.
  16904. OnReset(h EventHandler, scope ...any) HTMLI
  16905. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  16906. OnScroll(h EventHandler, scope ...any) HTMLI
  16907. // OnSearch calls the given handler when the user writes something in a search field.
  16908. OnSearch(h EventHandler, scope ...any) HTMLI
  16909. // OnSelect calls the given handler after some text has been selected in an element.
  16910. OnSelect(h EventHandler, scope ...any) HTMLI
  16911. // OnSubmit calls the given handler when a form is submitted.
  16912. OnSubmit(h EventHandler, scope ...any) HTMLI
  16913. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  16914. OnWheel(h EventHandler, scope ...any) HTMLI
  16915. }
  16916. // I returns an HTML element that defines a part of text in an alternate voice or mood.
  16917. func I() HTMLI {
  16918. e := &htmlI{
  16919. htmlElement: htmlElement{
  16920. tag: "i",
  16921. isSelfClosing: false,
  16922. },
  16923. }
  16924. return e
  16925. }
  16926. type htmlI struct {
  16927. htmlElement
  16928. }
  16929. func (e *htmlI) Body(v ...UI) HTMLI {
  16930. e.setChildren(v...)
  16931. return e
  16932. }
  16933. func (e *htmlI) Text(v any) HTMLI {
  16934. return e.Body(Text(v))
  16935. }
  16936. func (e *htmlI) AccessKey(v string) HTMLI {
  16937. e.setAttr("accesskey", v)
  16938. return e
  16939. }
  16940. func (e *htmlI) Aria(k string, v any) HTMLI {
  16941. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  16942. return e
  16943. }
  16944. func (e *htmlI) Attr(n string, v any) HTMLI {
  16945. e.setAttr(n, v)
  16946. return e
  16947. }
  16948. func (e *htmlI) Class(v ...string) HTMLI {
  16949. e.setAttr("class", strings.Join(v, " "))
  16950. return e
  16951. }
  16952. func (e *htmlI) ContentEditable(v bool) HTMLI {
  16953. e.setAttr("contenteditable", v)
  16954. return e
  16955. }
  16956. func (e *htmlI) DataSet(k string, v any) HTMLI {
  16957. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  16958. return e
  16959. }
  16960. func (e *htmlI) Dir(v string) HTMLI {
  16961. e.setAttr("dir", v)
  16962. return e
  16963. }
  16964. func (e *htmlI) Draggable(v bool) HTMLI {
  16965. e.setAttr("draggable", v)
  16966. return e
  16967. }
  16968. func (e *htmlI) Hidden(v bool) HTMLI {
  16969. e.setAttr("hidden", v)
  16970. return e
  16971. }
  16972. func (e *htmlI) ID(v string) HTMLI {
  16973. e.setAttr("id", v)
  16974. return e
  16975. }
  16976. func (e *htmlI) Lang(v string) HTMLI {
  16977. e.setAttr("lang", v)
  16978. return e
  16979. }
  16980. func (e *htmlI) Role(v string) HTMLI {
  16981. e.setAttr("role", v)
  16982. return e
  16983. }
  16984. func (e *htmlI) Spellcheck(v bool) HTMLI {
  16985. s := "false"
  16986. if v {
  16987. s = "true"
  16988. }
  16989. e.setAttr("spellcheck", s)
  16990. return e
  16991. }
  16992. func (e *htmlI) Style(k, v string) HTMLI {
  16993. e.setAttr("style", k+":"+v)
  16994. return e
  16995. }
  16996. func (e *htmlI) Styles(s map[string]string) HTMLI {
  16997. for k, v := range s {
  16998. e.Style(k, v)
  16999. }
  17000. return e
  17001. }
  17002. func (e *htmlI) TabIndex(v int) HTMLI {
  17003. e.setAttr("tabindex", v)
  17004. return e
  17005. }
  17006. func (e *htmlI) Title(v string) HTMLI {
  17007. e.setAttr("title", v)
  17008. return e
  17009. }
  17010. func (e *htmlI) On(event string, h EventHandler, scope ...any) HTMLI {
  17011. e.setEventHandler(event, h, scope...)
  17012. return e
  17013. }
  17014. func (e *htmlI) OnBlur(h EventHandler, scope ...any) HTMLI {
  17015. e.setEventHandler("blur", h, scope...)
  17016. return e
  17017. }
  17018. func (e *htmlI) OnChange(h EventHandler, scope ...any) HTMLI {
  17019. e.setEventHandler("change", h, scope...)
  17020. return e
  17021. }
  17022. func (e *htmlI) OnClick(h EventHandler, scope ...any) HTMLI {
  17023. e.setEventHandler("click", h, scope...)
  17024. return e
  17025. }
  17026. func (e *htmlI) OnContextMenu(h EventHandler, scope ...any) HTMLI {
  17027. e.setEventHandler("contextmenu", h, scope...)
  17028. return e
  17029. }
  17030. func (e *htmlI) OnCopy(h EventHandler, scope ...any) HTMLI {
  17031. e.setEventHandler("copy", h, scope...)
  17032. return e
  17033. }
  17034. func (e *htmlI) OnCut(h EventHandler, scope ...any) HTMLI {
  17035. e.setEventHandler("cut", h, scope...)
  17036. return e
  17037. }
  17038. func (e *htmlI) OnDblClick(h EventHandler, scope ...any) HTMLI {
  17039. e.setEventHandler("dblclick", h, scope...)
  17040. return e
  17041. }
  17042. func (e *htmlI) OnDrag(h EventHandler, scope ...any) HTMLI {
  17043. e.setEventHandler("drag", h, scope...)
  17044. return e
  17045. }
  17046. func (e *htmlI) OnDragEnd(h EventHandler, scope ...any) HTMLI {
  17047. e.setEventHandler("dragend", h, scope...)
  17048. return e
  17049. }
  17050. func (e *htmlI) OnDragEnter(h EventHandler, scope ...any) HTMLI {
  17051. e.setEventHandler("dragenter", h, scope...)
  17052. return e
  17053. }
  17054. func (e *htmlI) OnDragLeave(h EventHandler, scope ...any) HTMLI {
  17055. e.setEventHandler("dragleave", h, scope...)
  17056. return e
  17057. }
  17058. func (e *htmlI) OnDragOver(h EventHandler, scope ...any) HTMLI {
  17059. e.setEventHandler("dragover", h, scope...)
  17060. return e
  17061. }
  17062. func (e *htmlI) OnDragStart(h EventHandler, scope ...any) HTMLI {
  17063. e.setEventHandler("dragstart", h, scope...)
  17064. return e
  17065. }
  17066. func (e *htmlI) OnDrop(h EventHandler, scope ...any) HTMLI {
  17067. e.setEventHandler("drop", h, scope...)
  17068. return e
  17069. }
  17070. func (e *htmlI) OnFocus(h EventHandler, scope ...any) HTMLI {
  17071. e.setEventHandler("focus", h, scope...)
  17072. return e
  17073. }
  17074. func (e *htmlI) OnInput(h EventHandler, scope ...any) HTMLI {
  17075. e.setEventHandler("input", h, scope...)
  17076. return e
  17077. }
  17078. func (e *htmlI) OnInvalid(h EventHandler, scope ...any) HTMLI {
  17079. e.setEventHandler("invalid", h, scope...)
  17080. return e
  17081. }
  17082. func (e *htmlI) OnKeyDown(h EventHandler, scope ...any) HTMLI {
  17083. e.setEventHandler("keydown", h, scope...)
  17084. return e
  17085. }
  17086. func (e *htmlI) OnKeyPress(h EventHandler, scope ...any) HTMLI {
  17087. e.setEventHandler("keypress", h, scope...)
  17088. return e
  17089. }
  17090. func (e *htmlI) OnKeyUp(h EventHandler, scope ...any) HTMLI {
  17091. e.setEventHandler("keyup", h, scope...)
  17092. return e
  17093. }
  17094. func (e *htmlI) OnMouseDown(h EventHandler, scope ...any) HTMLI {
  17095. e.setEventHandler("mousedown", h, scope...)
  17096. return e
  17097. }
  17098. func (e *htmlI) OnMouseMove(h EventHandler, scope ...any) HTMLI {
  17099. e.setEventHandler("mousemove", h, scope...)
  17100. return e
  17101. }
  17102. func (e *htmlI) OnMouseOut(h EventHandler, scope ...any) HTMLI {
  17103. e.setEventHandler("mouseout", h, scope...)
  17104. return e
  17105. }
  17106. func (e *htmlI) OnMouseOver(h EventHandler, scope ...any) HTMLI {
  17107. e.setEventHandler("mouseover", h, scope...)
  17108. return e
  17109. }
  17110. func (e *htmlI) OnMouseUp(h EventHandler, scope ...any) HTMLI {
  17111. e.setEventHandler("mouseup", h, scope...)
  17112. return e
  17113. }
  17114. func (e *htmlI) OnPaste(h EventHandler, scope ...any) HTMLI {
  17115. e.setEventHandler("paste", h, scope...)
  17116. return e
  17117. }
  17118. func (e *htmlI) OnReset(h EventHandler, scope ...any) HTMLI {
  17119. e.setEventHandler("reset", h, scope...)
  17120. return e
  17121. }
  17122. func (e *htmlI) OnScroll(h EventHandler, scope ...any) HTMLI {
  17123. e.setEventHandler("scroll", h, scope...)
  17124. return e
  17125. }
  17126. func (e *htmlI) OnSearch(h EventHandler, scope ...any) HTMLI {
  17127. e.setEventHandler("search", h, scope...)
  17128. return e
  17129. }
  17130. func (e *htmlI) OnSelect(h EventHandler, scope ...any) HTMLI {
  17131. e.setEventHandler("select", h, scope...)
  17132. return e
  17133. }
  17134. func (e *htmlI) OnSubmit(h EventHandler, scope ...any) HTMLI {
  17135. e.setEventHandler("submit", h, scope...)
  17136. return e
  17137. }
  17138. func (e *htmlI) OnWheel(h EventHandler, scope ...any) HTMLI {
  17139. e.setEventHandler("wheel", h, scope...)
  17140. return e
  17141. }
  17142. // HTMLIFrame is the interface that describes a "iframe" HTML element.
  17143. type HTMLIFrame interface {
  17144. UI
  17145. // Body set the content of the element.
  17146. Body(elems ...UI) HTMLIFrame
  17147. // Text sets the content of the element with a text node containing the stringified given value.
  17148. Text(v any) HTMLIFrame
  17149. // AccessKey specifies a shortcut key to activate/focus an element.
  17150. AccessKey(v string) HTMLIFrame
  17151. // Allow specifies a feature policy. Can be called multiple times to set multiple policies.
  17152. Allow(v string) HTMLIFrame
  17153. // AllowFullscreen reports whether an iframe can activate fullscreen mode.
  17154. AllowFullscreen(v bool) HTMLIFrame
  17155. // AllowPaymentRequest reports whether an iframe should be allowed to invoke the Payment Request API
  17156. AllowPaymentRequest(v bool) HTMLIFrame
  17157. // Aria stores accessible rich internet applications (ARIA) data.
  17158. Aria(k string, v any) HTMLIFrame
  17159. // Attr sets the named attribute with the given value.
  17160. Attr(n string, v any) HTMLIFrame
  17161. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  17162. Class(v ...string) HTMLIFrame
  17163. // ContentEditable specifies whether the content of an element is editable or not.
  17164. ContentEditable(v bool) HTMLIFrame
  17165. // DataSet stores custom data private to the page or application.
  17166. DataSet(k string, v any) HTMLIFrame
  17167. // Dir specifies the text direction for the content in an element.
  17168. Dir(v string) HTMLIFrame
  17169. // Draggable specifies whether an element is draggable or not.
  17170. Draggable(v bool) HTMLIFrame
  17171. // Height specifies the height of the element (in pixels).
  17172. Height(v int) HTMLIFrame
  17173. // Hidden specifies that an element is not yet, or is no longer relevant.
  17174. Hidden(v bool) HTMLIFrame
  17175. // ID specifies a unique id for an element.
  17176. ID(v string) HTMLIFrame
  17177. // Lang specifies the language of the element's content.
  17178. Lang(v string) HTMLIFrame
  17179. // Loading indicates how the browser should load the iframe (eager|lazy).
  17180. Loading(v string) HTMLIFrame
  17181. // Name specifies the name of the element.
  17182. Name(v string) HTMLIFrame
  17183. // ReferrerPolicy specifies how much/which referrer information that will be sent when processing the iframe attributes
  17184. ReferrerPolicy(v string) HTMLIFrame
  17185. // Role specifies to parsing software the exact function of an element (and its children).
  17186. Role(v string) HTMLIFrame
  17187. // Sandbox enables an extra set of restrictions for the content in an iframe.
  17188. Sandbox(v any) HTMLIFrame
  17189. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  17190. Spellcheck(v bool) HTMLIFrame
  17191. // Src specifies the URL of the media file.
  17192. Src(v string) HTMLIFrame
  17193. // SrcDoc specifies the HTML content of the page to show in the iframe.
  17194. SrcDoc(v string) HTMLIFrame
  17195. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  17196. Style(k, v string) HTMLIFrame
  17197. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  17198. Styles(s map[string]string) HTMLIFrame
  17199. // TabIndex specifies the tabbing order of an element.
  17200. TabIndex(v int) HTMLIFrame
  17201. // Title specifies extra information about an element.
  17202. Title(v string) HTMLIFrame
  17203. // Width specifies the width of the element.
  17204. Width(v int) HTMLIFrame
  17205. // On registers the given event handler to the specified event.
  17206. On(event string, h EventHandler, scope ...any) HTMLIFrame
  17207. // OnBlur calls the given handler when the element loses focus.
  17208. OnBlur(h EventHandler, scope ...any) HTMLIFrame
  17209. // OnChange calls the given handler when the value of the element is changed.
  17210. OnChange(h EventHandler, scope ...any) HTMLIFrame
  17211. // OnClick calls the given handler when there is a mouse click on the element.
  17212. OnClick(h EventHandler, scope ...any) HTMLIFrame
  17213. // OnContextMenu calls the given handler when a context menu is triggered.
  17214. OnContextMenu(h EventHandler, scope ...any) HTMLIFrame
  17215. // OnCopy calls the given handler when the user copies the content of an element.
  17216. OnCopy(h EventHandler, scope ...any) HTMLIFrame
  17217. // OnCut calls the given handler when the user cuts the content of an element.
  17218. OnCut(h EventHandler, scope ...any) HTMLIFrame
  17219. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  17220. OnDblClick(h EventHandler, scope ...any) HTMLIFrame
  17221. // OnDrag calls the given handler when an element is dragged.
  17222. OnDrag(h EventHandler, scope ...any) HTMLIFrame
  17223. // OnDragEnd calls the given handler at the end of a drag operation.
  17224. OnDragEnd(h EventHandler, scope ...any) HTMLIFrame
  17225. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  17226. OnDragEnter(h EventHandler, scope ...any) HTMLIFrame
  17227. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  17228. OnDragLeave(h EventHandler, scope ...any) HTMLIFrame
  17229. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  17230. OnDragOver(h EventHandler, scope ...any) HTMLIFrame
  17231. // OnDragStart calls the given handler at the start of a drag operation.
  17232. OnDragStart(h EventHandler, scope ...any) HTMLIFrame
  17233. // OnDrop calls the given handler when dragged element is being dropped.
  17234. OnDrop(h EventHandler, scope ...any) HTMLIFrame
  17235. // OnFocus calls the given handler when the element gets focus.
  17236. OnFocus(h EventHandler, scope ...any) HTMLIFrame
  17237. // OnInput calls the given handler when an element gets user input.
  17238. OnInput(h EventHandler, scope ...any) HTMLIFrame
  17239. // OnInvalid calls the given handler when an element is invalid.
  17240. OnInvalid(h EventHandler, scope ...any) HTMLIFrame
  17241. // OnKeyDown calls the given handler when a user is pressing a key.
  17242. OnKeyDown(h EventHandler, scope ...any) HTMLIFrame
  17243. // OnKeyPress calls the given handler when a user presses a key.
  17244. OnKeyPress(h EventHandler, scope ...any) HTMLIFrame
  17245. // OnKeyUp calls the given handler when a user releases a key.
  17246. OnKeyUp(h EventHandler, scope ...any) HTMLIFrame
  17247. // OnLoad calls the given handler after the element is finished loading.
  17248. OnLoad(h EventHandler, scope ...any) HTMLIFrame
  17249. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  17250. OnMouseDown(h EventHandler, scope ...any) HTMLIFrame
  17251. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  17252. OnMouseMove(h EventHandler, scope ...any) HTMLIFrame
  17253. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  17254. OnMouseOut(h EventHandler, scope ...any) HTMLIFrame
  17255. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  17256. OnMouseOver(h EventHandler, scope ...any) HTMLIFrame
  17257. // OnMouseUp calls the given handler when a mouse button is released over an element.
  17258. OnMouseUp(h EventHandler, scope ...any) HTMLIFrame
  17259. // OnPaste calls the given handler when the user pastes some content in an element.
  17260. OnPaste(h EventHandler, scope ...any) HTMLIFrame
  17261. // OnReset calls the given handler when the Reset button in a form is clicked.
  17262. OnReset(h EventHandler, scope ...any) HTMLIFrame
  17263. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  17264. OnScroll(h EventHandler, scope ...any) HTMLIFrame
  17265. // OnSearch calls the given handler when the user writes something in a search field.
  17266. OnSearch(h EventHandler, scope ...any) HTMLIFrame
  17267. // OnSelect calls the given handler after some text has been selected in an element.
  17268. OnSelect(h EventHandler, scope ...any) HTMLIFrame
  17269. // OnSubmit calls the given handler when a form is submitted.
  17270. OnSubmit(h EventHandler, scope ...any) HTMLIFrame
  17271. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  17272. OnWheel(h EventHandler, scope ...any) HTMLIFrame
  17273. }
  17274. // IFrame returns an HTML element that defines an inline frame.
  17275. func IFrame() HTMLIFrame {
  17276. e := &htmlIFrame{
  17277. htmlElement: htmlElement{
  17278. tag: "iframe",
  17279. isSelfClosing: false,
  17280. },
  17281. }
  17282. return e
  17283. }
  17284. type htmlIFrame struct {
  17285. htmlElement
  17286. }
  17287. func (e *htmlIFrame) Body(v ...UI) HTMLIFrame {
  17288. e.setChildren(v...)
  17289. return e
  17290. }
  17291. func (e *htmlIFrame) Text(v any) HTMLIFrame {
  17292. return e.Body(Text(v))
  17293. }
  17294. func (e *htmlIFrame) AccessKey(v string) HTMLIFrame {
  17295. e.setAttr("accesskey", v)
  17296. return e
  17297. }
  17298. func (e *htmlIFrame) Allow(v string) HTMLIFrame {
  17299. e.setAttr("allow", v)
  17300. return e
  17301. }
  17302. func (e *htmlIFrame) AllowFullscreen(v bool) HTMLIFrame {
  17303. s := "false"
  17304. if v {
  17305. s = "true"
  17306. }
  17307. e.setAttr("allowfullscreen", s)
  17308. return e
  17309. }
  17310. func (e *htmlIFrame) AllowPaymentRequest(v bool) HTMLIFrame {
  17311. s := "false"
  17312. if v {
  17313. s = "true"
  17314. }
  17315. e.setAttr("allowpaymentrequest", s)
  17316. return e
  17317. }
  17318. func (e *htmlIFrame) Aria(k string, v any) HTMLIFrame {
  17319. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  17320. return e
  17321. }
  17322. func (e *htmlIFrame) Attr(n string, v any) HTMLIFrame {
  17323. e.setAttr(n, v)
  17324. return e
  17325. }
  17326. func (e *htmlIFrame) Class(v ...string) HTMLIFrame {
  17327. e.setAttr("class", strings.Join(v, " "))
  17328. return e
  17329. }
  17330. func (e *htmlIFrame) ContentEditable(v bool) HTMLIFrame {
  17331. e.setAttr("contenteditable", v)
  17332. return e
  17333. }
  17334. func (e *htmlIFrame) DataSet(k string, v any) HTMLIFrame {
  17335. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  17336. return e
  17337. }
  17338. func (e *htmlIFrame) Dir(v string) HTMLIFrame {
  17339. e.setAttr("dir", v)
  17340. return e
  17341. }
  17342. func (e *htmlIFrame) Draggable(v bool) HTMLIFrame {
  17343. e.setAttr("draggable", v)
  17344. return e
  17345. }
  17346. func (e *htmlIFrame) Height(v int) HTMLIFrame {
  17347. e.setAttr("height", v)
  17348. return e
  17349. }
  17350. func (e *htmlIFrame) Hidden(v bool) HTMLIFrame {
  17351. e.setAttr("hidden", v)
  17352. return e
  17353. }
  17354. func (e *htmlIFrame) ID(v string) HTMLIFrame {
  17355. e.setAttr("id", v)
  17356. return e
  17357. }
  17358. func (e *htmlIFrame) Lang(v string) HTMLIFrame {
  17359. e.setAttr("lang", v)
  17360. return e
  17361. }
  17362. func (e *htmlIFrame) Loading(v string) HTMLIFrame {
  17363. e.setAttr("loading", v)
  17364. return e
  17365. }
  17366. func (e *htmlIFrame) Name(v string) HTMLIFrame {
  17367. e.setAttr("name", v)
  17368. return e
  17369. }
  17370. func (e *htmlIFrame) ReferrerPolicy(v string) HTMLIFrame {
  17371. e.setAttr("referrerpolicy", v)
  17372. return e
  17373. }
  17374. func (e *htmlIFrame) Role(v string) HTMLIFrame {
  17375. e.setAttr("role", v)
  17376. return e
  17377. }
  17378. func (e *htmlIFrame) Sandbox(v any) HTMLIFrame {
  17379. e.setAttr("sandbox", v)
  17380. return e
  17381. }
  17382. func (e *htmlIFrame) Spellcheck(v bool) HTMLIFrame {
  17383. s := "false"
  17384. if v {
  17385. s = "true"
  17386. }
  17387. e.setAttr("spellcheck", s)
  17388. return e
  17389. }
  17390. func (e *htmlIFrame) Src(v string) HTMLIFrame {
  17391. e.setAttr("src", v)
  17392. return e
  17393. }
  17394. func (e *htmlIFrame) SrcDoc(v string) HTMLIFrame {
  17395. e.setAttr("srcdoc", v)
  17396. return e
  17397. }
  17398. func (e *htmlIFrame) Style(k, v string) HTMLIFrame {
  17399. e.setAttr("style", k+":"+v)
  17400. return e
  17401. }
  17402. func (e *htmlIFrame) Styles(s map[string]string) HTMLIFrame {
  17403. for k, v := range s {
  17404. e.Style(k, v)
  17405. }
  17406. return e
  17407. }
  17408. func (e *htmlIFrame) TabIndex(v int) HTMLIFrame {
  17409. e.setAttr("tabindex", v)
  17410. return e
  17411. }
  17412. func (e *htmlIFrame) Title(v string) HTMLIFrame {
  17413. e.setAttr("title", v)
  17414. return e
  17415. }
  17416. func (e *htmlIFrame) Width(v int) HTMLIFrame {
  17417. e.setAttr("width", v)
  17418. return e
  17419. }
  17420. func (e *htmlIFrame) On(event string, h EventHandler, scope ...any) HTMLIFrame {
  17421. e.setEventHandler(event, h, scope...)
  17422. return e
  17423. }
  17424. func (e *htmlIFrame) OnBlur(h EventHandler, scope ...any) HTMLIFrame {
  17425. e.setEventHandler("blur", h, scope...)
  17426. return e
  17427. }
  17428. func (e *htmlIFrame) OnChange(h EventHandler, scope ...any) HTMLIFrame {
  17429. e.setEventHandler("change", h, scope...)
  17430. return e
  17431. }
  17432. func (e *htmlIFrame) OnClick(h EventHandler, scope ...any) HTMLIFrame {
  17433. e.setEventHandler("click", h, scope...)
  17434. return e
  17435. }
  17436. func (e *htmlIFrame) OnContextMenu(h EventHandler, scope ...any) HTMLIFrame {
  17437. e.setEventHandler("contextmenu", h, scope...)
  17438. return e
  17439. }
  17440. func (e *htmlIFrame) OnCopy(h EventHandler, scope ...any) HTMLIFrame {
  17441. e.setEventHandler("copy", h, scope...)
  17442. return e
  17443. }
  17444. func (e *htmlIFrame) OnCut(h EventHandler, scope ...any) HTMLIFrame {
  17445. e.setEventHandler("cut", h, scope...)
  17446. return e
  17447. }
  17448. func (e *htmlIFrame) OnDblClick(h EventHandler, scope ...any) HTMLIFrame {
  17449. e.setEventHandler("dblclick", h, scope...)
  17450. return e
  17451. }
  17452. func (e *htmlIFrame) OnDrag(h EventHandler, scope ...any) HTMLIFrame {
  17453. e.setEventHandler("drag", h, scope...)
  17454. return e
  17455. }
  17456. func (e *htmlIFrame) OnDragEnd(h EventHandler, scope ...any) HTMLIFrame {
  17457. e.setEventHandler("dragend", h, scope...)
  17458. return e
  17459. }
  17460. func (e *htmlIFrame) OnDragEnter(h EventHandler, scope ...any) HTMLIFrame {
  17461. e.setEventHandler("dragenter", h, scope...)
  17462. return e
  17463. }
  17464. func (e *htmlIFrame) OnDragLeave(h EventHandler, scope ...any) HTMLIFrame {
  17465. e.setEventHandler("dragleave", h, scope...)
  17466. return e
  17467. }
  17468. func (e *htmlIFrame) OnDragOver(h EventHandler, scope ...any) HTMLIFrame {
  17469. e.setEventHandler("dragover", h, scope...)
  17470. return e
  17471. }
  17472. func (e *htmlIFrame) OnDragStart(h EventHandler, scope ...any) HTMLIFrame {
  17473. e.setEventHandler("dragstart", h, scope...)
  17474. return e
  17475. }
  17476. func (e *htmlIFrame) OnDrop(h EventHandler, scope ...any) HTMLIFrame {
  17477. e.setEventHandler("drop", h, scope...)
  17478. return e
  17479. }
  17480. func (e *htmlIFrame) OnFocus(h EventHandler, scope ...any) HTMLIFrame {
  17481. e.setEventHandler("focus", h, scope...)
  17482. return e
  17483. }
  17484. func (e *htmlIFrame) OnInput(h EventHandler, scope ...any) HTMLIFrame {
  17485. e.setEventHandler("input", h, scope...)
  17486. return e
  17487. }
  17488. func (e *htmlIFrame) OnInvalid(h EventHandler, scope ...any) HTMLIFrame {
  17489. e.setEventHandler("invalid", h, scope...)
  17490. return e
  17491. }
  17492. func (e *htmlIFrame) OnKeyDown(h EventHandler, scope ...any) HTMLIFrame {
  17493. e.setEventHandler("keydown", h, scope...)
  17494. return e
  17495. }
  17496. func (e *htmlIFrame) OnKeyPress(h EventHandler, scope ...any) HTMLIFrame {
  17497. e.setEventHandler("keypress", h, scope...)
  17498. return e
  17499. }
  17500. func (e *htmlIFrame) OnKeyUp(h EventHandler, scope ...any) HTMLIFrame {
  17501. e.setEventHandler("keyup", h, scope...)
  17502. return e
  17503. }
  17504. func (e *htmlIFrame) OnLoad(h EventHandler, scope ...any) HTMLIFrame {
  17505. e.setEventHandler("load", h, scope...)
  17506. return e
  17507. }
  17508. func (e *htmlIFrame) OnMouseDown(h EventHandler, scope ...any) HTMLIFrame {
  17509. e.setEventHandler("mousedown", h, scope...)
  17510. return e
  17511. }
  17512. func (e *htmlIFrame) OnMouseMove(h EventHandler, scope ...any) HTMLIFrame {
  17513. e.setEventHandler("mousemove", h, scope...)
  17514. return e
  17515. }
  17516. func (e *htmlIFrame) OnMouseOut(h EventHandler, scope ...any) HTMLIFrame {
  17517. e.setEventHandler("mouseout", h, scope...)
  17518. return e
  17519. }
  17520. func (e *htmlIFrame) OnMouseOver(h EventHandler, scope ...any) HTMLIFrame {
  17521. e.setEventHandler("mouseover", h, scope...)
  17522. return e
  17523. }
  17524. func (e *htmlIFrame) OnMouseUp(h EventHandler, scope ...any) HTMLIFrame {
  17525. e.setEventHandler("mouseup", h, scope...)
  17526. return e
  17527. }
  17528. func (e *htmlIFrame) OnPaste(h EventHandler, scope ...any) HTMLIFrame {
  17529. e.setEventHandler("paste", h, scope...)
  17530. return e
  17531. }
  17532. func (e *htmlIFrame) OnReset(h EventHandler, scope ...any) HTMLIFrame {
  17533. e.setEventHandler("reset", h, scope...)
  17534. return e
  17535. }
  17536. func (e *htmlIFrame) OnScroll(h EventHandler, scope ...any) HTMLIFrame {
  17537. e.setEventHandler("scroll", h, scope...)
  17538. return e
  17539. }
  17540. func (e *htmlIFrame) OnSearch(h EventHandler, scope ...any) HTMLIFrame {
  17541. e.setEventHandler("search", h, scope...)
  17542. return e
  17543. }
  17544. func (e *htmlIFrame) OnSelect(h EventHandler, scope ...any) HTMLIFrame {
  17545. e.setEventHandler("select", h, scope...)
  17546. return e
  17547. }
  17548. func (e *htmlIFrame) OnSubmit(h EventHandler, scope ...any) HTMLIFrame {
  17549. e.setEventHandler("submit", h, scope...)
  17550. return e
  17551. }
  17552. func (e *htmlIFrame) OnWheel(h EventHandler, scope ...any) HTMLIFrame {
  17553. e.setEventHandler("wheel", h, scope...)
  17554. return e
  17555. }
  17556. // HTMLImg is the interface that describes a "img" HTML element.
  17557. type HTMLImg interface {
  17558. UI
  17559. // AccessKey specifies a shortcut key to activate/focus an element.
  17560. AccessKey(v string) HTMLImg
  17561. // Alt specifies an alternate text when the original element fails to display.
  17562. Alt(v string) HTMLImg
  17563. // Aria stores accessible rich internet applications (ARIA) data.
  17564. Aria(k string, v any) HTMLImg
  17565. // Attr sets the named attribute with the given value.
  17566. Attr(n string, v any) HTMLImg
  17567. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  17568. Class(v ...string) HTMLImg
  17569. // ContentEditable specifies whether the content of an element is editable or not.
  17570. ContentEditable(v bool) HTMLImg
  17571. // CrossOrigin sets the mode of the request to an HTTP CORS Request.
  17572. CrossOrigin(v string) HTMLImg
  17573. // DataSet stores custom data private to the page or application.
  17574. DataSet(k string, v any) HTMLImg
  17575. // Dir specifies the text direction for the content in an element.
  17576. Dir(v string) HTMLImg
  17577. // Draggable specifies whether an element is draggable or not.
  17578. Draggable(v bool) HTMLImg
  17579. // Height specifies the height of the element (in pixels).
  17580. Height(v int) HTMLImg
  17581. // Hidden specifies that an element is not yet, or is no longer relevant.
  17582. Hidden(v bool) HTMLImg
  17583. // ID specifies a unique id for an element.
  17584. ID(v string) HTMLImg
  17585. // IsMap specifies an image as a server-side image-map.
  17586. IsMap(v bool) HTMLImg
  17587. // Lang specifies the language of the element's content.
  17588. Lang(v string) HTMLImg
  17589. // Role specifies to parsing software the exact function of an element (and its children).
  17590. Role(v string) HTMLImg
  17591. // Sizes specifies the size of the linked resource.
  17592. Sizes(v string) HTMLImg
  17593. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  17594. Spellcheck(v bool) HTMLImg
  17595. // Src specifies the URL of the media file.
  17596. Src(v string) HTMLImg
  17597. // SrcSet specifies the URL of the image to use in different situations.
  17598. SrcSet(v string) HTMLImg
  17599. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  17600. Style(k, v string) HTMLImg
  17601. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  17602. Styles(s map[string]string) HTMLImg
  17603. // TabIndex specifies the tabbing order of an element.
  17604. TabIndex(v int) HTMLImg
  17605. // Title specifies extra information about an element.
  17606. Title(v string) HTMLImg
  17607. // UseMap specifies an image as a client-side image-map.
  17608. UseMap(v string) HTMLImg
  17609. // Width specifies the width of the element.
  17610. Width(v int) HTMLImg
  17611. // On registers the given event handler to the specified event.
  17612. On(event string, h EventHandler, scope ...any) HTMLImg
  17613. // OnAbort calls the given handler on abort.
  17614. OnAbort(h EventHandler, scope ...any) HTMLImg
  17615. // OnBlur calls the given handler when the element loses focus.
  17616. OnBlur(h EventHandler, scope ...any) HTMLImg
  17617. // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
  17618. OnCanPlay(h EventHandler, scope ...any) HTMLImg
  17619. // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
  17620. OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg
  17621. // OnChange calls the given handler when the value of the element is changed.
  17622. OnChange(h EventHandler, scope ...any) HTMLImg
  17623. // OnClick calls the given handler when there is a mouse click on the element.
  17624. OnClick(h EventHandler, scope ...any) HTMLImg
  17625. // OnContextMenu calls the given handler when a context menu is triggered.
  17626. OnContextMenu(h EventHandler, scope ...any) HTMLImg
  17627. // OnCopy calls the given handler when the user copies the content of an element.
  17628. OnCopy(h EventHandler, scope ...any) HTMLImg
  17629. // OnCueChange calls the given handler when the cue changes in a track element.
  17630. OnCueChange(h EventHandler, scope ...any) HTMLImg
  17631. // OnCut calls the given handler when the user cuts the content of an element.
  17632. OnCut(h EventHandler, scope ...any) HTMLImg
  17633. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  17634. OnDblClick(h EventHandler, scope ...any) HTMLImg
  17635. // OnDrag calls the given handler when an element is dragged.
  17636. OnDrag(h EventHandler, scope ...any) HTMLImg
  17637. // OnDragEnd calls the given handler at the end of a drag operation.
  17638. OnDragEnd(h EventHandler, scope ...any) HTMLImg
  17639. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  17640. OnDragEnter(h EventHandler, scope ...any) HTMLImg
  17641. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  17642. OnDragLeave(h EventHandler, scope ...any) HTMLImg
  17643. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  17644. OnDragOver(h EventHandler, scope ...any) HTMLImg
  17645. // OnDragStart calls the given handler at the start of a drag operation.
  17646. OnDragStart(h EventHandler, scope ...any) HTMLImg
  17647. // OnDrop calls the given handler when dragged element is being dropped.
  17648. OnDrop(h EventHandler, scope ...any) HTMLImg
  17649. // OnDurationChange calls the given handler when the length of the media changes.
  17650. OnDurationChange(h EventHandler, scope ...any) HTMLImg
  17651. // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
  17652. OnEmptied(h EventHandler, scope ...any) HTMLImg
  17653. // OnEnded calls the given handler when the media has reach the end.
  17654. OnEnded(h EventHandler, scope ...any) HTMLImg
  17655. // OnError calls the given handler when an error occurs.
  17656. OnError(h EventHandler, scope ...any) HTMLImg
  17657. // OnFocus calls the given handler when the element gets focus.
  17658. OnFocus(h EventHandler, scope ...any) HTMLImg
  17659. // OnInput calls the given handler when an element gets user input.
  17660. OnInput(h EventHandler, scope ...any) HTMLImg
  17661. // OnInvalid calls the given handler when an element is invalid.
  17662. OnInvalid(h EventHandler, scope ...any) HTMLImg
  17663. // OnKeyDown calls the given handler when a user is pressing a key.
  17664. OnKeyDown(h EventHandler, scope ...any) HTMLImg
  17665. // OnKeyPress calls the given handler when a user presses a key.
  17666. OnKeyPress(h EventHandler, scope ...any) HTMLImg
  17667. // OnKeyUp calls the given handler when a user releases a key.
  17668. OnKeyUp(h EventHandler, scope ...any) HTMLImg
  17669. // OnLoad calls the given handler after the element is finished loading.
  17670. OnLoad(h EventHandler, scope ...any) HTMLImg
  17671. // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
  17672. OnLoadStart(h EventHandler, scope ...any) HTMLImg
  17673. // OnLoadedData calls the given handler when media data is loaded.
  17674. OnLoadedData(h EventHandler, scope ...any) HTMLImg
  17675. // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
  17676. OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg
  17677. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  17678. OnMouseDown(h EventHandler, scope ...any) HTMLImg
  17679. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  17680. OnMouseMove(h EventHandler, scope ...any) HTMLImg
  17681. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  17682. OnMouseOut(h EventHandler, scope ...any) HTMLImg
  17683. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  17684. OnMouseOver(h EventHandler, scope ...any) HTMLImg
  17685. // OnMouseUp calls the given handler when a mouse button is released over an element.
  17686. OnMouseUp(h EventHandler, scope ...any) HTMLImg
  17687. // OnPaste calls the given handler when the user pastes some content in an element.
  17688. OnPaste(h EventHandler, scope ...any) HTMLImg
  17689. // OnPause calls the given handler when the media is paused either by the user or programmatically.
  17690. OnPause(h EventHandler, scope ...any) HTMLImg
  17691. // OnPlay calls the given handler when the media is ready to start playing.
  17692. OnPlay(h EventHandler, scope ...any) HTMLImg
  17693. // OnPlaying calls the given handler when the media actually has started playing.
  17694. OnPlaying(h EventHandler, scope ...any) HTMLImg
  17695. // OnProgress calls the given handler when the browser is in the process of getting the media data.
  17696. OnProgress(h EventHandler, scope ...any) HTMLImg
  17697. // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
  17698. OnRateChange(h EventHandler, scope ...any) HTMLImg
  17699. // OnReset calls the given handler when the Reset button in a form is clicked.
  17700. OnReset(h EventHandler, scope ...any) HTMLImg
  17701. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  17702. OnScroll(h EventHandler, scope ...any) HTMLImg
  17703. // OnSearch calls the given handler when the user writes something in a search field.
  17704. OnSearch(h EventHandler, scope ...any) HTMLImg
  17705. // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
  17706. OnSeeked(h EventHandler, scope ...any) HTMLImg
  17707. // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
  17708. OnSeeking(h EventHandler, scope ...any) HTMLImg
  17709. // OnSelect calls the given handler after some text has been selected in an element.
  17710. OnSelect(h EventHandler, scope ...any) HTMLImg
  17711. // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
  17712. OnStalled(h EventHandler, scope ...any) HTMLImg
  17713. // OnSubmit calls the given handler when a form is submitted.
  17714. OnSubmit(h EventHandler, scope ...any) HTMLImg
  17715. // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
  17716. OnSuspend(h EventHandler, scope ...any) HTMLImg
  17717. // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
  17718. OnTimeUpdate(h EventHandler, scope ...any) HTMLImg
  17719. // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
  17720. OnVolumeChange(h EventHandler, scope ...any) HTMLImg
  17721. // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
  17722. OnWaiting(h EventHandler, scope ...any) HTMLImg
  17723. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  17724. OnWheel(h EventHandler, scope ...any) HTMLImg
  17725. }
  17726. // Img returns an HTML element that defines an image.
  17727. func Img() HTMLImg {
  17728. e := &htmlImg{
  17729. htmlElement: htmlElement{
  17730. tag: "img",
  17731. isSelfClosing: true,
  17732. },
  17733. }
  17734. return e
  17735. }
  17736. type htmlImg struct {
  17737. htmlElement
  17738. }
  17739. func (e *htmlImg) AccessKey(v string) HTMLImg {
  17740. e.setAttr("accesskey", v)
  17741. return e
  17742. }
  17743. func (e *htmlImg) Alt(v string) HTMLImg {
  17744. e.setAttr("alt", v)
  17745. return e
  17746. }
  17747. func (e *htmlImg) Aria(k string, v any) HTMLImg {
  17748. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  17749. return e
  17750. }
  17751. func (e *htmlImg) Attr(n string, v any) HTMLImg {
  17752. e.setAttr(n, v)
  17753. return e
  17754. }
  17755. func (e *htmlImg) Class(v ...string) HTMLImg {
  17756. e.setAttr("class", strings.Join(v, " "))
  17757. return e
  17758. }
  17759. func (e *htmlImg) ContentEditable(v bool) HTMLImg {
  17760. e.setAttr("contenteditable", v)
  17761. return e
  17762. }
  17763. func (e *htmlImg) CrossOrigin(v string) HTMLImg {
  17764. e.setAttr("crossorigin", v)
  17765. return e
  17766. }
  17767. func (e *htmlImg) DataSet(k string, v any) HTMLImg {
  17768. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  17769. return e
  17770. }
  17771. func (e *htmlImg) Dir(v string) HTMLImg {
  17772. e.setAttr("dir", v)
  17773. return e
  17774. }
  17775. func (e *htmlImg) Draggable(v bool) HTMLImg {
  17776. e.setAttr("draggable", v)
  17777. return e
  17778. }
  17779. func (e *htmlImg) Height(v int) HTMLImg {
  17780. e.setAttr("height", v)
  17781. return e
  17782. }
  17783. func (e *htmlImg) Hidden(v bool) HTMLImg {
  17784. e.setAttr("hidden", v)
  17785. return e
  17786. }
  17787. func (e *htmlImg) ID(v string) HTMLImg {
  17788. e.setAttr("id", v)
  17789. return e
  17790. }
  17791. func (e *htmlImg) IsMap(v bool) HTMLImg {
  17792. e.setAttr("ismap", v)
  17793. return e
  17794. }
  17795. func (e *htmlImg) Lang(v string) HTMLImg {
  17796. e.setAttr("lang", v)
  17797. return e
  17798. }
  17799. func (e *htmlImg) Role(v string) HTMLImg {
  17800. e.setAttr("role", v)
  17801. return e
  17802. }
  17803. func (e *htmlImg) Sizes(v string) HTMLImg {
  17804. e.setAttr("sizes", v)
  17805. return e
  17806. }
  17807. func (e *htmlImg) Spellcheck(v bool) HTMLImg {
  17808. s := "false"
  17809. if v {
  17810. s = "true"
  17811. }
  17812. e.setAttr("spellcheck", s)
  17813. return e
  17814. }
  17815. func (e *htmlImg) Src(v string) HTMLImg {
  17816. e.setAttr("src", v)
  17817. return e
  17818. }
  17819. func (e *htmlImg) SrcSet(v string) HTMLImg {
  17820. e.setAttr("srcset", v)
  17821. return e
  17822. }
  17823. func (e *htmlImg) Style(k, v string) HTMLImg {
  17824. e.setAttr("style", k+":"+v)
  17825. return e
  17826. }
  17827. func (e *htmlImg) Styles(s map[string]string) HTMLImg {
  17828. for k, v := range s {
  17829. e.Style(k, v)
  17830. }
  17831. return e
  17832. }
  17833. func (e *htmlImg) TabIndex(v int) HTMLImg {
  17834. e.setAttr("tabindex", v)
  17835. return e
  17836. }
  17837. func (e *htmlImg) Title(v string) HTMLImg {
  17838. e.setAttr("title", v)
  17839. return e
  17840. }
  17841. func (e *htmlImg) UseMap(v string) HTMLImg {
  17842. e.setAttr("usemap", v)
  17843. return e
  17844. }
  17845. func (e *htmlImg) Width(v int) HTMLImg {
  17846. e.setAttr("width", v)
  17847. return e
  17848. }
  17849. func (e *htmlImg) On(event string, h EventHandler, scope ...any) HTMLImg {
  17850. e.setEventHandler(event, h, scope...)
  17851. return e
  17852. }
  17853. func (e *htmlImg) OnAbort(h EventHandler, scope ...any) HTMLImg {
  17854. e.setEventHandler("abort", h, scope...)
  17855. return e
  17856. }
  17857. func (e *htmlImg) OnBlur(h EventHandler, scope ...any) HTMLImg {
  17858. e.setEventHandler("blur", h, scope...)
  17859. return e
  17860. }
  17861. func (e *htmlImg) OnCanPlay(h EventHandler, scope ...any) HTMLImg {
  17862. e.setEventHandler("canplay", h, scope...)
  17863. return e
  17864. }
  17865. func (e *htmlImg) OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg {
  17866. e.setEventHandler("canplaythrough", h, scope...)
  17867. return e
  17868. }
  17869. func (e *htmlImg) OnChange(h EventHandler, scope ...any) HTMLImg {
  17870. e.setEventHandler("change", h, scope...)
  17871. return e
  17872. }
  17873. func (e *htmlImg) OnClick(h EventHandler, scope ...any) HTMLImg {
  17874. e.setEventHandler("click", h, scope...)
  17875. return e
  17876. }
  17877. func (e *htmlImg) OnContextMenu(h EventHandler, scope ...any) HTMLImg {
  17878. e.setEventHandler("contextmenu", h, scope...)
  17879. return e
  17880. }
  17881. func (e *htmlImg) OnCopy(h EventHandler, scope ...any) HTMLImg {
  17882. e.setEventHandler("copy", h, scope...)
  17883. return e
  17884. }
  17885. func (e *htmlImg) OnCueChange(h EventHandler, scope ...any) HTMLImg {
  17886. e.setEventHandler("cuechange", h, scope...)
  17887. return e
  17888. }
  17889. func (e *htmlImg) OnCut(h EventHandler, scope ...any) HTMLImg {
  17890. e.setEventHandler("cut", h, scope...)
  17891. return e
  17892. }
  17893. func (e *htmlImg) OnDblClick(h EventHandler, scope ...any) HTMLImg {
  17894. e.setEventHandler("dblclick", h, scope...)
  17895. return e
  17896. }
  17897. func (e *htmlImg) OnDrag(h EventHandler, scope ...any) HTMLImg {
  17898. e.setEventHandler("drag", h, scope...)
  17899. return e
  17900. }
  17901. func (e *htmlImg) OnDragEnd(h EventHandler, scope ...any) HTMLImg {
  17902. e.setEventHandler("dragend", h, scope...)
  17903. return e
  17904. }
  17905. func (e *htmlImg) OnDragEnter(h EventHandler, scope ...any) HTMLImg {
  17906. e.setEventHandler("dragenter", h, scope...)
  17907. return e
  17908. }
  17909. func (e *htmlImg) OnDragLeave(h EventHandler, scope ...any) HTMLImg {
  17910. e.setEventHandler("dragleave", h, scope...)
  17911. return e
  17912. }
  17913. func (e *htmlImg) OnDragOver(h EventHandler, scope ...any) HTMLImg {
  17914. e.setEventHandler("dragover", h, scope...)
  17915. return e
  17916. }
  17917. func (e *htmlImg) OnDragStart(h EventHandler, scope ...any) HTMLImg {
  17918. e.setEventHandler("dragstart", h, scope...)
  17919. return e
  17920. }
  17921. func (e *htmlImg) OnDrop(h EventHandler, scope ...any) HTMLImg {
  17922. e.setEventHandler("drop", h, scope...)
  17923. return e
  17924. }
  17925. func (e *htmlImg) OnDurationChange(h EventHandler, scope ...any) HTMLImg {
  17926. e.setEventHandler("durationchange", h, scope...)
  17927. return e
  17928. }
  17929. func (e *htmlImg) OnEmptied(h EventHandler, scope ...any) HTMLImg {
  17930. e.setEventHandler("emptied", h, scope...)
  17931. return e
  17932. }
  17933. func (e *htmlImg) OnEnded(h EventHandler, scope ...any) HTMLImg {
  17934. e.setEventHandler("ended", h, scope...)
  17935. return e
  17936. }
  17937. func (e *htmlImg) OnError(h EventHandler, scope ...any) HTMLImg {
  17938. e.setEventHandler("error", h, scope...)
  17939. return e
  17940. }
  17941. func (e *htmlImg) OnFocus(h EventHandler, scope ...any) HTMLImg {
  17942. e.setEventHandler("focus", h, scope...)
  17943. return e
  17944. }
  17945. func (e *htmlImg) OnInput(h EventHandler, scope ...any) HTMLImg {
  17946. e.setEventHandler("input", h, scope...)
  17947. return e
  17948. }
  17949. func (e *htmlImg) OnInvalid(h EventHandler, scope ...any) HTMLImg {
  17950. e.setEventHandler("invalid", h, scope...)
  17951. return e
  17952. }
  17953. func (e *htmlImg) OnKeyDown(h EventHandler, scope ...any) HTMLImg {
  17954. e.setEventHandler("keydown", h, scope...)
  17955. return e
  17956. }
  17957. func (e *htmlImg) OnKeyPress(h EventHandler, scope ...any) HTMLImg {
  17958. e.setEventHandler("keypress", h, scope...)
  17959. return e
  17960. }
  17961. func (e *htmlImg) OnKeyUp(h EventHandler, scope ...any) HTMLImg {
  17962. e.setEventHandler("keyup", h, scope...)
  17963. return e
  17964. }
  17965. func (e *htmlImg) OnLoad(h EventHandler, scope ...any) HTMLImg {
  17966. e.setEventHandler("load", h, scope...)
  17967. return e
  17968. }
  17969. func (e *htmlImg) OnLoadStart(h EventHandler, scope ...any) HTMLImg {
  17970. e.setEventHandler("loadstart", h, scope...)
  17971. return e
  17972. }
  17973. func (e *htmlImg) OnLoadedData(h EventHandler, scope ...any) HTMLImg {
  17974. e.setEventHandler("loadeddata", h, scope...)
  17975. return e
  17976. }
  17977. func (e *htmlImg) OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg {
  17978. e.setEventHandler("loadedmetadata", h, scope...)
  17979. return e
  17980. }
  17981. func (e *htmlImg) OnMouseDown(h EventHandler, scope ...any) HTMLImg {
  17982. e.setEventHandler("mousedown", h, scope...)
  17983. return e
  17984. }
  17985. func (e *htmlImg) OnMouseMove(h EventHandler, scope ...any) HTMLImg {
  17986. e.setEventHandler("mousemove", h, scope...)
  17987. return e
  17988. }
  17989. func (e *htmlImg) OnMouseOut(h EventHandler, scope ...any) HTMLImg {
  17990. e.setEventHandler("mouseout", h, scope...)
  17991. return e
  17992. }
  17993. func (e *htmlImg) OnMouseOver(h EventHandler, scope ...any) HTMLImg {
  17994. e.setEventHandler("mouseover", h, scope...)
  17995. return e
  17996. }
  17997. func (e *htmlImg) OnMouseUp(h EventHandler, scope ...any) HTMLImg {
  17998. e.setEventHandler("mouseup", h, scope...)
  17999. return e
  18000. }
  18001. func (e *htmlImg) OnPaste(h EventHandler, scope ...any) HTMLImg {
  18002. e.setEventHandler("paste", h, scope...)
  18003. return e
  18004. }
  18005. func (e *htmlImg) OnPause(h EventHandler, scope ...any) HTMLImg {
  18006. e.setEventHandler("pause", h, scope...)
  18007. return e
  18008. }
  18009. func (e *htmlImg) OnPlay(h EventHandler, scope ...any) HTMLImg {
  18010. e.setEventHandler("play", h, scope...)
  18011. return e
  18012. }
  18013. func (e *htmlImg) OnPlaying(h EventHandler, scope ...any) HTMLImg {
  18014. e.setEventHandler("playing", h, scope...)
  18015. return e
  18016. }
  18017. func (e *htmlImg) OnProgress(h EventHandler, scope ...any) HTMLImg {
  18018. e.setEventHandler("progress", h, scope...)
  18019. return e
  18020. }
  18021. func (e *htmlImg) OnRateChange(h EventHandler, scope ...any) HTMLImg {
  18022. e.setEventHandler("ratechange", h, scope...)
  18023. return e
  18024. }
  18025. func (e *htmlImg) OnReset(h EventHandler, scope ...any) HTMLImg {
  18026. e.setEventHandler("reset", h, scope...)
  18027. return e
  18028. }
  18029. func (e *htmlImg) OnScroll(h EventHandler, scope ...any) HTMLImg {
  18030. e.setEventHandler("scroll", h, scope...)
  18031. return e
  18032. }
  18033. func (e *htmlImg) OnSearch(h EventHandler, scope ...any) HTMLImg {
  18034. e.setEventHandler("search", h, scope...)
  18035. return e
  18036. }
  18037. func (e *htmlImg) OnSeeked(h EventHandler, scope ...any) HTMLImg {
  18038. e.setEventHandler("seeked", h, scope...)
  18039. return e
  18040. }
  18041. func (e *htmlImg) OnSeeking(h EventHandler, scope ...any) HTMLImg {
  18042. e.setEventHandler("seeking", h, scope...)
  18043. return e
  18044. }
  18045. func (e *htmlImg) OnSelect(h EventHandler, scope ...any) HTMLImg {
  18046. e.setEventHandler("select", h, scope...)
  18047. return e
  18048. }
  18049. func (e *htmlImg) OnStalled(h EventHandler, scope ...any) HTMLImg {
  18050. e.setEventHandler("stalled", h, scope...)
  18051. return e
  18052. }
  18053. func (e *htmlImg) OnSubmit(h EventHandler, scope ...any) HTMLImg {
  18054. e.setEventHandler("submit", h, scope...)
  18055. return e
  18056. }
  18057. func (e *htmlImg) OnSuspend(h EventHandler, scope ...any) HTMLImg {
  18058. e.setEventHandler("suspend", h, scope...)
  18059. return e
  18060. }
  18061. func (e *htmlImg) OnTimeUpdate(h EventHandler, scope ...any) HTMLImg {
  18062. e.setEventHandler("timeupdate", h, scope...)
  18063. return e
  18064. }
  18065. func (e *htmlImg) OnVolumeChange(h EventHandler, scope ...any) HTMLImg {
  18066. e.setEventHandler("volumechange", h, scope...)
  18067. return e
  18068. }
  18069. func (e *htmlImg) OnWaiting(h EventHandler, scope ...any) HTMLImg {
  18070. e.setEventHandler("waiting", h, scope...)
  18071. return e
  18072. }
  18073. func (e *htmlImg) OnWheel(h EventHandler, scope ...any) HTMLImg {
  18074. e.setEventHandler("wheel", h, scope...)
  18075. return e
  18076. }
  18077. // HTMLInput is the interface that describes a "input" HTML element.
  18078. type HTMLInput interface {
  18079. UI
  18080. // Accept specifies the types of files that the server accepts (only for file type).
  18081. Accept(v string) HTMLInput
  18082. // AccessKey specifies a shortcut key to activate/focus an element.
  18083. AccessKey(v string) HTMLInput
  18084. // Alt specifies an alternate text when the original element fails to display.
  18085. Alt(v string) HTMLInput
  18086. // Aria stores accessible rich internet applications (ARIA) data.
  18087. Aria(k string, v any) HTMLInput
  18088. // Attr sets the named attribute with the given value.
  18089. Attr(n string, v any) HTMLInput
  18090. // AutoComplete specifies whether the element should have autocomplete enabled.
  18091. AutoComplete(v bool) HTMLInput
  18092. // AutoFocus specifies that the element should automatically get focus when the page loads.
  18093. AutoFocus(v bool) HTMLInput
  18094. // Capture specifies the capture input method in file upload controls
  18095. Capture(v string) HTMLInput
  18096. // Checked specifies that an input element should be pre-selected when the page loads (for checkbox or radio types).
  18097. Checked(v bool) HTMLInput
  18098. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  18099. Class(v ...string) HTMLInput
  18100. // ContentEditable specifies whether the content of an element is editable or not.
  18101. ContentEditable(v bool) HTMLInput
  18102. // DataSet stores custom data private to the page or application.
  18103. DataSet(k string, v any) HTMLInput
  18104. // Dir specifies the text direction for the content in an element.
  18105. Dir(v string) HTMLInput
  18106. // DirName specifies that the text direction will be submitted.
  18107. DirName(v string) HTMLInput
  18108. // Disabled specifies that the specified element/group of elements should be disabled.
  18109. Disabled(v bool) HTMLInput
  18110. // Draggable specifies whether an element is draggable or not.
  18111. Draggable(v bool) HTMLInput
  18112. // Form specifies the name of the form the element belongs to.
  18113. Form(v string) HTMLInput
  18114. // FormAction specifies where to send the form-data when a form is submitted. Only for submit type.
  18115. FormAction(v string) HTMLInput
  18116. // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type.
  18117. FormEncType(v string) HTMLInput
  18118. // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type.
  18119. FormMethod(v string) HTMLInput
  18120. // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type.
  18121. FormNoValidate(v bool) HTMLInput
  18122. // FormTarget specifies where to display the response after submitting the form. Only for submit type.
  18123. FormTarget(v string) HTMLInput
  18124. // Height specifies the height of the element (in pixels).
  18125. Height(v int) HTMLInput
  18126. // Hidden specifies that an element is not yet, or is no longer relevant.
  18127. Hidden(v bool) HTMLInput
  18128. // ID specifies a unique id for an element.
  18129. ID(v string) HTMLInput
  18130. // Lang specifies the language of the element's content.
  18131. Lang(v string) HTMLInput
  18132. // List refers to a datalist element that contains pre-defined options for an input element.
  18133. List(v string) HTMLInput
  18134. // Max Specifies the maximum value.
  18135. Max(v any) HTMLInput
  18136. // MaxLength specifies the maximum number of characters allowed in an element.
  18137. MaxLength(v int) HTMLInput
  18138. // Min specifies a minimum value.
  18139. Min(v any) HTMLInput
  18140. // Multiple specifies that a user can enter more than one value.
  18141. Multiple(v bool) HTMLInput
  18142. // Name specifies the name of the element.
  18143. Name(v string) HTMLInput
  18144. // Pattern specifies a regular expression that an input element's value is checked against.
  18145. Pattern(v string) HTMLInput
  18146. // Placeholder specifies a short hint that describes the expected value of the element.
  18147. Placeholder(v string) HTMLInput
  18148. // ReadOnly specifies that the element is read-only.
  18149. ReadOnly(v bool) HTMLInput
  18150. // Required specifies that the element must be filled out before submitting the form.
  18151. Required(v bool) HTMLInput
  18152. // Role specifies to parsing software the exact function of an element (and its children).
  18153. Role(v string) HTMLInput
  18154. // Size specifies the width.
  18155. Size(v int) HTMLInput
  18156. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  18157. Spellcheck(v bool) HTMLInput
  18158. // Src specifies the URL of the media file.
  18159. Src(v string) HTMLInput
  18160. // Step specifies the legal number intervals for an input field.
  18161. Step(v float64) HTMLInput
  18162. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  18163. Style(k, v string) HTMLInput
  18164. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  18165. Styles(s map[string]string) HTMLInput
  18166. // TabIndex specifies the tabbing order of an element.
  18167. TabIndex(v int) HTMLInput
  18168. // Title specifies extra information about an element.
  18169. Title(v string) HTMLInput
  18170. // Type specifies the type of element.
  18171. Type(v string) HTMLInput
  18172. // Value specifies the value of the element.
  18173. Value(v any) HTMLInput
  18174. // Width specifies the width of the element.
  18175. Width(v int) HTMLInput
  18176. // On registers the given event handler to the specified event.
  18177. On(event string, h EventHandler, scope ...any) HTMLInput
  18178. // OnBlur calls the given handler when the element loses focus.
  18179. OnBlur(h EventHandler, scope ...any) HTMLInput
  18180. // OnChange calls the given handler when the value of the element is changed.
  18181. OnChange(h EventHandler, scope ...any) HTMLInput
  18182. // OnClick calls the given handler when there is a mouse click on the element.
  18183. OnClick(h EventHandler, scope ...any) HTMLInput
  18184. // OnContextMenu calls the given handler when a context menu is triggered.
  18185. OnContextMenu(h EventHandler, scope ...any) HTMLInput
  18186. // OnCopy calls the given handler when the user copies the content of an element.
  18187. OnCopy(h EventHandler, scope ...any) HTMLInput
  18188. // OnCut calls the given handler when the user cuts the content of an element.
  18189. OnCut(h EventHandler, scope ...any) HTMLInput
  18190. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  18191. OnDblClick(h EventHandler, scope ...any) HTMLInput
  18192. // OnDrag calls the given handler when an element is dragged.
  18193. OnDrag(h EventHandler, scope ...any) HTMLInput
  18194. // OnDragEnd calls the given handler at the end of a drag operation.
  18195. OnDragEnd(h EventHandler, scope ...any) HTMLInput
  18196. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  18197. OnDragEnter(h EventHandler, scope ...any) HTMLInput
  18198. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  18199. OnDragLeave(h EventHandler, scope ...any) HTMLInput
  18200. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  18201. OnDragOver(h EventHandler, scope ...any) HTMLInput
  18202. // OnDragStart calls the given handler at the start of a drag operation.
  18203. OnDragStart(h EventHandler, scope ...any) HTMLInput
  18204. // OnDrop calls the given handler when dragged element is being dropped.
  18205. OnDrop(h EventHandler, scope ...any) HTMLInput
  18206. // OnFocus calls the given handler when the element gets focus.
  18207. OnFocus(h EventHandler, scope ...any) HTMLInput
  18208. // OnInput calls the given handler when an element gets user input.
  18209. OnInput(h EventHandler, scope ...any) HTMLInput
  18210. // OnInvalid calls the given handler when an element is invalid.
  18211. OnInvalid(h EventHandler, scope ...any) HTMLInput
  18212. // OnKeyDown calls the given handler when a user is pressing a key.
  18213. OnKeyDown(h EventHandler, scope ...any) HTMLInput
  18214. // OnKeyPress calls the given handler when a user presses a key.
  18215. OnKeyPress(h EventHandler, scope ...any) HTMLInput
  18216. // OnKeyUp calls the given handler when a user releases a key.
  18217. OnKeyUp(h EventHandler, scope ...any) HTMLInput
  18218. // OnLoad calls the given handler after the element is finished loading.
  18219. OnLoad(h EventHandler, scope ...any) HTMLInput
  18220. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  18221. OnMouseDown(h EventHandler, scope ...any) HTMLInput
  18222. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  18223. OnMouseMove(h EventHandler, scope ...any) HTMLInput
  18224. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  18225. OnMouseOut(h EventHandler, scope ...any) HTMLInput
  18226. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  18227. OnMouseOver(h EventHandler, scope ...any) HTMLInput
  18228. // OnMouseUp calls the given handler when a mouse button is released over an element.
  18229. OnMouseUp(h EventHandler, scope ...any) HTMLInput
  18230. // OnPaste calls the given handler when the user pastes some content in an element.
  18231. OnPaste(h EventHandler, scope ...any) HTMLInput
  18232. // OnReset calls the given handler when the Reset button in a form is clicked.
  18233. OnReset(h EventHandler, scope ...any) HTMLInput
  18234. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  18235. OnScroll(h EventHandler, scope ...any) HTMLInput
  18236. // OnSearch calls the given handler when the user writes something in a search field.
  18237. OnSearch(h EventHandler, scope ...any) HTMLInput
  18238. // OnSelect calls the given handler after some text has been selected in an element.
  18239. OnSelect(h EventHandler, scope ...any) HTMLInput
  18240. // OnSubmit calls the given handler when a form is submitted.
  18241. OnSubmit(h EventHandler, scope ...any) HTMLInput
  18242. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  18243. OnWheel(h EventHandler, scope ...any) HTMLInput
  18244. }
  18245. // Input returns an HTML element that defines an input control.
  18246. func Input() HTMLInput {
  18247. e := &htmlInput{
  18248. htmlElement: htmlElement{
  18249. tag: "input",
  18250. isSelfClosing: true,
  18251. },
  18252. }
  18253. return e
  18254. }
  18255. type htmlInput struct {
  18256. htmlElement
  18257. }
  18258. func (e *htmlInput) Accept(v string) HTMLInput {
  18259. e.setAttr("accept", v)
  18260. return e
  18261. }
  18262. func (e *htmlInput) AccessKey(v string) HTMLInput {
  18263. e.setAttr("accesskey", v)
  18264. return e
  18265. }
  18266. func (e *htmlInput) Alt(v string) HTMLInput {
  18267. e.setAttr("alt", v)
  18268. return e
  18269. }
  18270. func (e *htmlInput) Aria(k string, v any) HTMLInput {
  18271. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  18272. return e
  18273. }
  18274. func (e *htmlInput) Attr(n string, v any) HTMLInput {
  18275. e.setAttr(n, v)
  18276. return e
  18277. }
  18278. func (e *htmlInput) AutoComplete(v bool) HTMLInput {
  18279. s := "off"
  18280. if v {
  18281. s = "on"
  18282. }
  18283. e.setAttr("autocomplete", s)
  18284. return e
  18285. }
  18286. func (e *htmlInput) AutoFocus(v bool) HTMLInput {
  18287. e.setAttr("autofocus", v)
  18288. return e
  18289. }
  18290. func (e *htmlInput) Capture(v string) HTMLInput {
  18291. e.setAttr("capture", v)
  18292. return e
  18293. }
  18294. func (e *htmlInput) Checked(v bool) HTMLInput {
  18295. e.setAttr("checked", v)
  18296. return e
  18297. }
  18298. func (e *htmlInput) Class(v ...string) HTMLInput {
  18299. e.setAttr("class", strings.Join(v, " "))
  18300. return e
  18301. }
  18302. func (e *htmlInput) ContentEditable(v bool) HTMLInput {
  18303. e.setAttr("contenteditable", v)
  18304. return e
  18305. }
  18306. func (e *htmlInput) DataSet(k string, v any) HTMLInput {
  18307. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  18308. return e
  18309. }
  18310. func (e *htmlInput) Dir(v string) HTMLInput {
  18311. e.setAttr("dir", v)
  18312. return e
  18313. }
  18314. func (e *htmlInput) DirName(v string) HTMLInput {
  18315. e.setAttr("dirname", v)
  18316. return e
  18317. }
  18318. func (e *htmlInput) Disabled(v bool) HTMLInput {
  18319. e.setAttr("disabled", v)
  18320. return e
  18321. }
  18322. func (e *htmlInput) Draggable(v bool) HTMLInput {
  18323. e.setAttr("draggable", v)
  18324. return e
  18325. }
  18326. func (e *htmlInput) Form(v string) HTMLInput {
  18327. e.setAttr("form", v)
  18328. return e
  18329. }
  18330. func (e *htmlInput) FormAction(v string) HTMLInput {
  18331. e.setAttr("formaction", v)
  18332. return e
  18333. }
  18334. func (e *htmlInput) FormEncType(v string) HTMLInput {
  18335. e.setAttr("formenctype", v)
  18336. return e
  18337. }
  18338. func (e *htmlInput) FormMethod(v string) HTMLInput {
  18339. e.setAttr("formmethod", v)
  18340. return e
  18341. }
  18342. func (e *htmlInput) FormNoValidate(v bool) HTMLInput {
  18343. e.setAttr("formnovalidate", v)
  18344. return e
  18345. }
  18346. func (e *htmlInput) FormTarget(v string) HTMLInput {
  18347. e.setAttr("formtarget", v)
  18348. return e
  18349. }
  18350. func (e *htmlInput) Height(v int) HTMLInput {
  18351. e.setAttr("height", v)
  18352. return e
  18353. }
  18354. func (e *htmlInput) Hidden(v bool) HTMLInput {
  18355. e.setAttr("hidden", v)
  18356. return e
  18357. }
  18358. func (e *htmlInput) ID(v string) HTMLInput {
  18359. e.setAttr("id", v)
  18360. return e
  18361. }
  18362. func (e *htmlInput) Lang(v string) HTMLInput {
  18363. e.setAttr("lang", v)
  18364. return e
  18365. }
  18366. func (e *htmlInput) List(v string) HTMLInput {
  18367. e.setAttr("list", v)
  18368. return e
  18369. }
  18370. func (e *htmlInput) Max(v any) HTMLInput {
  18371. e.setAttr("max", v)
  18372. return e
  18373. }
  18374. func (e *htmlInput) MaxLength(v int) HTMLInput {
  18375. e.setAttr("maxlength", v)
  18376. return e
  18377. }
  18378. func (e *htmlInput) Min(v any) HTMLInput {
  18379. e.setAttr("min", v)
  18380. return e
  18381. }
  18382. func (e *htmlInput) Multiple(v bool) HTMLInput {
  18383. e.setAttr("multiple", v)
  18384. return e
  18385. }
  18386. func (e *htmlInput) Name(v string) HTMLInput {
  18387. e.setAttr("name", v)
  18388. return e
  18389. }
  18390. func (e *htmlInput) Pattern(v string) HTMLInput {
  18391. e.setAttr("pattern", v)
  18392. return e
  18393. }
  18394. func (e *htmlInput) Placeholder(v string) HTMLInput {
  18395. e.setAttr("placeholder", v)
  18396. return e
  18397. }
  18398. func (e *htmlInput) ReadOnly(v bool) HTMLInput {
  18399. e.setAttr("readonly", v)
  18400. return e
  18401. }
  18402. func (e *htmlInput) Required(v bool) HTMLInput {
  18403. e.setAttr("required", v)
  18404. return e
  18405. }
  18406. func (e *htmlInput) Role(v string) HTMLInput {
  18407. e.setAttr("role", v)
  18408. return e
  18409. }
  18410. func (e *htmlInput) Size(v int) HTMLInput {
  18411. e.setAttr("size", v)
  18412. return e
  18413. }
  18414. func (e *htmlInput) Spellcheck(v bool) HTMLInput {
  18415. s := "false"
  18416. if v {
  18417. s = "true"
  18418. }
  18419. e.setAttr("spellcheck", s)
  18420. return e
  18421. }
  18422. func (e *htmlInput) Src(v string) HTMLInput {
  18423. e.setAttr("src", v)
  18424. return e
  18425. }
  18426. func (e *htmlInput) Step(v float64) HTMLInput {
  18427. e.setAttr("step", v)
  18428. return e
  18429. }
  18430. func (e *htmlInput) Style(k, v string) HTMLInput {
  18431. e.setAttr("style", k+":"+v)
  18432. return e
  18433. }
  18434. func (e *htmlInput) Styles(s map[string]string) HTMLInput {
  18435. for k, v := range s {
  18436. e.Style(k, v)
  18437. }
  18438. return e
  18439. }
  18440. func (e *htmlInput) TabIndex(v int) HTMLInput {
  18441. e.setAttr("tabindex", v)
  18442. return e
  18443. }
  18444. func (e *htmlInput) Title(v string) HTMLInput {
  18445. e.setAttr("title", v)
  18446. return e
  18447. }
  18448. func (e *htmlInput) Type(v string) HTMLInput {
  18449. e.setAttr("type", v)
  18450. return e
  18451. }
  18452. func (e *htmlInput) Value(v any) HTMLInput {
  18453. e.setAttr("value", v)
  18454. return e
  18455. }
  18456. func (e *htmlInput) Width(v int) HTMLInput {
  18457. e.setAttr("width", v)
  18458. return e
  18459. }
  18460. func (e *htmlInput) On(event string, h EventHandler, scope ...any) HTMLInput {
  18461. e.setEventHandler(event, h, scope...)
  18462. return e
  18463. }
  18464. func (e *htmlInput) OnBlur(h EventHandler, scope ...any) HTMLInput {
  18465. e.setEventHandler("blur", h, scope...)
  18466. return e
  18467. }
  18468. func (e *htmlInput) OnChange(h EventHandler, scope ...any) HTMLInput {
  18469. e.setEventHandler("change", h, scope...)
  18470. return e
  18471. }
  18472. func (e *htmlInput) OnClick(h EventHandler, scope ...any) HTMLInput {
  18473. e.setEventHandler("click", h, scope...)
  18474. return e
  18475. }
  18476. func (e *htmlInput) OnContextMenu(h EventHandler, scope ...any) HTMLInput {
  18477. e.setEventHandler("contextmenu", h, scope...)
  18478. return e
  18479. }
  18480. func (e *htmlInput) OnCopy(h EventHandler, scope ...any) HTMLInput {
  18481. e.setEventHandler("copy", h, scope...)
  18482. return e
  18483. }
  18484. func (e *htmlInput) OnCut(h EventHandler, scope ...any) HTMLInput {
  18485. e.setEventHandler("cut", h, scope...)
  18486. return e
  18487. }
  18488. func (e *htmlInput) OnDblClick(h EventHandler, scope ...any) HTMLInput {
  18489. e.setEventHandler("dblclick", h, scope...)
  18490. return e
  18491. }
  18492. func (e *htmlInput) OnDrag(h EventHandler, scope ...any) HTMLInput {
  18493. e.setEventHandler("drag", h, scope...)
  18494. return e
  18495. }
  18496. func (e *htmlInput) OnDragEnd(h EventHandler, scope ...any) HTMLInput {
  18497. e.setEventHandler("dragend", h, scope...)
  18498. return e
  18499. }
  18500. func (e *htmlInput) OnDragEnter(h EventHandler, scope ...any) HTMLInput {
  18501. e.setEventHandler("dragenter", h, scope...)
  18502. return e
  18503. }
  18504. func (e *htmlInput) OnDragLeave(h EventHandler, scope ...any) HTMLInput {
  18505. e.setEventHandler("dragleave", h, scope...)
  18506. return e
  18507. }
  18508. func (e *htmlInput) OnDragOver(h EventHandler, scope ...any) HTMLInput {
  18509. e.setEventHandler("dragover", h, scope...)
  18510. return e
  18511. }
  18512. func (e *htmlInput) OnDragStart(h EventHandler, scope ...any) HTMLInput {
  18513. e.setEventHandler("dragstart", h, scope...)
  18514. return e
  18515. }
  18516. func (e *htmlInput) OnDrop(h EventHandler, scope ...any) HTMLInput {
  18517. e.setEventHandler("drop", h, scope...)
  18518. return e
  18519. }
  18520. func (e *htmlInput) OnFocus(h EventHandler, scope ...any) HTMLInput {
  18521. e.setEventHandler("focus", h, scope...)
  18522. return e
  18523. }
  18524. func (e *htmlInput) OnInput(h EventHandler, scope ...any) HTMLInput {
  18525. e.setEventHandler("input", h, scope...)
  18526. return e
  18527. }
  18528. func (e *htmlInput) OnInvalid(h EventHandler, scope ...any) HTMLInput {
  18529. e.setEventHandler("invalid", h, scope...)
  18530. return e
  18531. }
  18532. func (e *htmlInput) OnKeyDown(h EventHandler, scope ...any) HTMLInput {
  18533. e.setEventHandler("keydown", h, scope...)
  18534. return e
  18535. }
  18536. func (e *htmlInput) OnKeyPress(h EventHandler, scope ...any) HTMLInput {
  18537. e.setEventHandler("keypress", h, scope...)
  18538. return e
  18539. }
  18540. func (e *htmlInput) OnKeyUp(h EventHandler, scope ...any) HTMLInput {
  18541. e.setEventHandler("keyup", h, scope...)
  18542. return e
  18543. }
  18544. func (e *htmlInput) OnLoad(h EventHandler, scope ...any) HTMLInput {
  18545. e.setEventHandler("load", h, scope...)
  18546. return e
  18547. }
  18548. func (e *htmlInput) OnMouseDown(h EventHandler, scope ...any) HTMLInput {
  18549. e.setEventHandler("mousedown", h, scope...)
  18550. return e
  18551. }
  18552. func (e *htmlInput) OnMouseMove(h EventHandler, scope ...any) HTMLInput {
  18553. e.setEventHandler("mousemove", h, scope...)
  18554. return e
  18555. }
  18556. func (e *htmlInput) OnMouseOut(h EventHandler, scope ...any) HTMLInput {
  18557. e.setEventHandler("mouseout", h, scope...)
  18558. return e
  18559. }
  18560. func (e *htmlInput) OnMouseOver(h EventHandler, scope ...any) HTMLInput {
  18561. e.setEventHandler("mouseover", h, scope...)
  18562. return e
  18563. }
  18564. func (e *htmlInput) OnMouseUp(h EventHandler, scope ...any) HTMLInput {
  18565. e.setEventHandler("mouseup", h, scope...)
  18566. return e
  18567. }
  18568. func (e *htmlInput) OnPaste(h EventHandler, scope ...any) HTMLInput {
  18569. e.setEventHandler("paste", h, scope...)
  18570. return e
  18571. }
  18572. func (e *htmlInput) OnReset(h EventHandler, scope ...any) HTMLInput {
  18573. e.setEventHandler("reset", h, scope...)
  18574. return e
  18575. }
  18576. func (e *htmlInput) OnScroll(h EventHandler, scope ...any) HTMLInput {
  18577. e.setEventHandler("scroll", h, scope...)
  18578. return e
  18579. }
  18580. func (e *htmlInput) OnSearch(h EventHandler, scope ...any) HTMLInput {
  18581. e.setEventHandler("search", h, scope...)
  18582. return e
  18583. }
  18584. func (e *htmlInput) OnSelect(h EventHandler, scope ...any) HTMLInput {
  18585. e.setEventHandler("select", h, scope...)
  18586. return e
  18587. }
  18588. func (e *htmlInput) OnSubmit(h EventHandler, scope ...any) HTMLInput {
  18589. e.setEventHandler("submit", h, scope...)
  18590. return e
  18591. }
  18592. func (e *htmlInput) OnWheel(h EventHandler, scope ...any) HTMLInput {
  18593. e.setEventHandler("wheel", h, scope...)
  18594. return e
  18595. }
  18596. // HTMLIns is the interface that describes a "ins" HTML element.
  18597. type HTMLIns interface {
  18598. UI
  18599. // Body set the content of the element.
  18600. Body(elems ...UI) HTMLIns
  18601. // Text sets the content of the element with a text node containing the stringified given value.
  18602. Text(v any) HTMLIns
  18603. // AccessKey specifies a shortcut key to activate/focus an element.
  18604. AccessKey(v string) HTMLIns
  18605. // Aria stores accessible rich internet applications (ARIA) data.
  18606. Aria(k string, v any) HTMLIns
  18607. // Attr sets the named attribute with the given value.
  18608. Attr(n string, v any) HTMLIns
  18609. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  18610. Class(v ...string) HTMLIns
  18611. // ContentEditable specifies whether the content of an element is editable or not.
  18612. ContentEditable(v bool) HTMLIns
  18613. // DataSet stores custom data private to the page or application.
  18614. DataSet(k string, v any) HTMLIns
  18615. // Dir specifies the text direction for the content in an element.
  18616. Dir(v string) HTMLIns
  18617. // Draggable specifies whether an element is draggable or not.
  18618. Draggable(v bool) HTMLIns
  18619. // Hidden specifies that an element is not yet, or is no longer relevant.
  18620. Hidden(v bool) HTMLIns
  18621. // ID specifies a unique id for an element.
  18622. ID(v string) HTMLIns
  18623. // Lang specifies the language of the element's content.
  18624. Lang(v string) HTMLIns
  18625. // Role specifies to parsing software the exact function of an element (and its children).
  18626. Role(v string) HTMLIns
  18627. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  18628. Spellcheck(v bool) HTMLIns
  18629. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  18630. Style(k, v string) HTMLIns
  18631. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  18632. Styles(s map[string]string) HTMLIns
  18633. // TabIndex specifies the tabbing order of an element.
  18634. TabIndex(v int) HTMLIns
  18635. // Title specifies extra information about an element.
  18636. Title(v string) HTMLIns
  18637. // On registers the given event handler to the specified event.
  18638. On(event string, h EventHandler, scope ...any) HTMLIns
  18639. // OnBlur calls the given handler when the element loses focus.
  18640. OnBlur(h EventHandler, scope ...any) HTMLIns
  18641. // OnChange calls the given handler when the value of the element is changed.
  18642. OnChange(h EventHandler, scope ...any) HTMLIns
  18643. // OnClick calls the given handler when there is a mouse click on the element.
  18644. OnClick(h EventHandler, scope ...any) HTMLIns
  18645. // OnContextMenu calls the given handler when a context menu is triggered.
  18646. OnContextMenu(h EventHandler, scope ...any) HTMLIns
  18647. // OnCopy calls the given handler when the user copies the content of an element.
  18648. OnCopy(h EventHandler, scope ...any) HTMLIns
  18649. // OnCut calls the given handler when the user cuts the content of an element.
  18650. OnCut(h EventHandler, scope ...any) HTMLIns
  18651. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  18652. OnDblClick(h EventHandler, scope ...any) HTMLIns
  18653. // OnDrag calls the given handler when an element is dragged.
  18654. OnDrag(h EventHandler, scope ...any) HTMLIns
  18655. // OnDragEnd calls the given handler at the end of a drag operation.
  18656. OnDragEnd(h EventHandler, scope ...any) HTMLIns
  18657. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  18658. OnDragEnter(h EventHandler, scope ...any) HTMLIns
  18659. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  18660. OnDragLeave(h EventHandler, scope ...any) HTMLIns
  18661. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  18662. OnDragOver(h EventHandler, scope ...any) HTMLIns
  18663. // OnDragStart calls the given handler at the start of a drag operation.
  18664. OnDragStart(h EventHandler, scope ...any) HTMLIns
  18665. // OnDrop calls the given handler when dragged element is being dropped.
  18666. OnDrop(h EventHandler, scope ...any) HTMLIns
  18667. // OnFocus calls the given handler when the element gets focus.
  18668. OnFocus(h EventHandler, scope ...any) HTMLIns
  18669. // OnInput calls the given handler when an element gets user input.
  18670. OnInput(h EventHandler, scope ...any) HTMLIns
  18671. // OnInvalid calls the given handler when an element is invalid.
  18672. OnInvalid(h EventHandler, scope ...any) HTMLIns
  18673. // OnKeyDown calls the given handler when a user is pressing a key.
  18674. OnKeyDown(h EventHandler, scope ...any) HTMLIns
  18675. // OnKeyPress calls the given handler when a user presses a key.
  18676. OnKeyPress(h EventHandler, scope ...any) HTMLIns
  18677. // OnKeyUp calls the given handler when a user releases a key.
  18678. OnKeyUp(h EventHandler, scope ...any) HTMLIns
  18679. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  18680. OnMouseDown(h EventHandler, scope ...any) HTMLIns
  18681. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  18682. OnMouseMove(h EventHandler, scope ...any) HTMLIns
  18683. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  18684. OnMouseOut(h EventHandler, scope ...any) HTMLIns
  18685. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  18686. OnMouseOver(h EventHandler, scope ...any) HTMLIns
  18687. // OnMouseUp calls the given handler when a mouse button is released over an element.
  18688. OnMouseUp(h EventHandler, scope ...any) HTMLIns
  18689. // OnPaste calls the given handler when the user pastes some content in an element.
  18690. OnPaste(h EventHandler, scope ...any) HTMLIns
  18691. // OnReset calls the given handler when the Reset button in a form is clicked.
  18692. OnReset(h EventHandler, scope ...any) HTMLIns
  18693. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  18694. OnScroll(h EventHandler, scope ...any) HTMLIns
  18695. // OnSearch calls the given handler when the user writes something in a search field.
  18696. OnSearch(h EventHandler, scope ...any) HTMLIns
  18697. // OnSelect calls the given handler after some text has been selected in an element.
  18698. OnSelect(h EventHandler, scope ...any) HTMLIns
  18699. // OnSubmit calls the given handler when a form is submitted.
  18700. OnSubmit(h EventHandler, scope ...any) HTMLIns
  18701. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  18702. OnWheel(h EventHandler, scope ...any) HTMLIns
  18703. }
  18704. // Ins returns an HTML element that defines a text that has been inserted into a document.
  18705. func Ins() HTMLIns {
  18706. e := &htmlIns{
  18707. htmlElement: htmlElement{
  18708. tag: "ins",
  18709. isSelfClosing: false,
  18710. },
  18711. }
  18712. return e
  18713. }
  18714. type htmlIns struct {
  18715. htmlElement
  18716. }
  18717. func (e *htmlIns) Body(v ...UI) HTMLIns {
  18718. e.setChildren(v...)
  18719. return e
  18720. }
  18721. func (e *htmlIns) Text(v any) HTMLIns {
  18722. return e.Body(Text(v))
  18723. }
  18724. func (e *htmlIns) AccessKey(v string) HTMLIns {
  18725. e.setAttr("accesskey", v)
  18726. return e
  18727. }
  18728. func (e *htmlIns) Aria(k string, v any) HTMLIns {
  18729. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  18730. return e
  18731. }
  18732. func (e *htmlIns) Attr(n string, v any) HTMLIns {
  18733. e.setAttr(n, v)
  18734. return e
  18735. }
  18736. func (e *htmlIns) Class(v ...string) HTMLIns {
  18737. e.setAttr("class", strings.Join(v, " "))
  18738. return e
  18739. }
  18740. func (e *htmlIns) ContentEditable(v bool) HTMLIns {
  18741. e.setAttr("contenteditable", v)
  18742. return e
  18743. }
  18744. func (e *htmlIns) DataSet(k string, v any) HTMLIns {
  18745. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  18746. return e
  18747. }
  18748. func (e *htmlIns) Dir(v string) HTMLIns {
  18749. e.setAttr("dir", v)
  18750. return e
  18751. }
  18752. func (e *htmlIns) Draggable(v bool) HTMLIns {
  18753. e.setAttr("draggable", v)
  18754. return e
  18755. }
  18756. func (e *htmlIns) Hidden(v bool) HTMLIns {
  18757. e.setAttr("hidden", v)
  18758. return e
  18759. }
  18760. func (e *htmlIns) ID(v string) HTMLIns {
  18761. e.setAttr("id", v)
  18762. return e
  18763. }
  18764. func (e *htmlIns) Lang(v string) HTMLIns {
  18765. e.setAttr("lang", v)
  18766. return e
  18767. }
  18768. func (e *htmlIns) Role(v string) HTMLIns {
  18769. e.setAttr("role", v)
  18770. return e
  18771. }
  18772. func (e *htmlIns) Spellcheck(v bool) HTMLIns {
  18773. s := "false"
  18774. if v {
  18775. s = "true"
  18776. }
  18777. e.setAttr("spellcheck", s)
  18778. return e
  18779. }
  18780. func (e *htmlIns) Style(k, v string) HTMLIns {
  18781. e.setAttr("style", k+":"+v)
  18782. return e
  18783. }
  18784. func (e *htmlIns) Styles(s map[string]string) HTMLIns {
  18785. for k, v := range s {
  18786. e.Style(k, v)
  18787. }
  18788. return e
  18789. }
  18790. func (e *htmlIns) TabIndex(v int) HTMLIns {
  18791. e.setAttr("tabindex", v)
  18792. return e
  18793. }
  18794. func (e *htmlIns) Title(v string) HTMLIns {
  18795. e.setAttr("title", v)
  18796. return e
  18797. }
  18798. func (e *htmlIns) On(event string, h EventHandler, scope ...any) HTMLIns {
  18799. e.setEventHandler(event, h, scope...)
  18800. return e
  18801. }
  18802. func (e *htmlIns) OnBlur(h EventHandler, scope ...any) HTMLIns {
  18803. e.setEventHandler("blur", h, scope...)
  18804. return e
  18805. }
  18806. func (e *htmlIns) OnChange(h EventHandler, scope ...any) HTMLIns {
  18807. e.setEventHandler("change", h, scope...)
  18808. return e
  18809. }
  18810. func (e *htmlIns) OnClick(h EventHandler, scope ...any) HTMLIns {
  18811. e.setEventHandler("click", h, scope...)
  18812. return e
  18813. }
  18814. func (e *htmlIns) OnContextMenu(h EventHandler, scope ...any) HTMLIns {
  18815. e.setEventHandler("contextmenu", h, scope...)
  18816. return e
  18817. }
  18818. func (e *htmlIns) OnCopy(h EventHandler, scope ...any) HTMLIns {
  18819. e.setEventHandler("copy", h, scope...)
  18820. return e
  18821. }
  18822. func (e *htmlIns) OnCut(h EventHandler, scope ...any) HTMLIns {
  18823. e.setEventHandler("cut", h, scope...)
  18824. return e
  18825. }
  18826. func (e *htmlIns) OnDblClick(h EventHandler, scope ...any) HTMLIns {
  18827. e.setEventHandler("dblclick", h, scope...)
  18828. return e
  18829. }
  18830. func (e *htmlIns) OnDrag(h EventHandler, scope ...any) HTMLIns {
  18831. e.setEventHandler("drag", h, scope...)
  18832. return e
  18833. }
  18834. func (e *htmlIns) OnDragEnd(h EventHandler, scope ...any) HTMLIns {
  18835. e.setEventHandler("dragend", h, scope...)
  18836. return e
  18837. }
  18838. func (e *htmlIns) OnDragEnter(h EventHandler, scope ...any) HTMLIns {
  18839. e.setEventHandler("dragenter", h, scope...)
  18840. return e
  18841. }
  18842. func (e *htmlIns) OnDragLeave(h EventHandler, scope ...any) HTMLIns {
  18843. e.setEventHandler("dragleave", h, scope...)
  18844. return e
  18845. }
  18846. func (e *htmlIns) OnDragOver(h EventHandler, scope ...any) HTMLIns {
  18847. e.setEventHandler("dragover", h, scope...)
  18848. return e
  18849. }
  18850. func (e *htmlIns) OnDragStart(h EventHandler, scope ...any) HTMLIns {
  18851. e.setEventHandler("dragstart", h, scope...)
  18852. return e
  18853. }
  18854. func (e *htmlIns) OnDrop(h EventHandler, scope ...any) HTMLIns {
  18855. e.setEventHandler("drop", h, scope...)
  18856. return e
  18857. }
  18858. func (e *htmlIns) OnFocus(h EventHandler, scope ...any) HTMLIns {
  18859. e.setEventHandler("focus", h, scope...)
  18860. return e
  18861. }
  18862. func (e *htmlIns) OnInput(h EventHandler, scope ...any) HTMLIns {
  18863. e.setEventHandler("input", h, scope...)
  18864. return e
  18865. }
  18866. func (e *htmlIns) OnInvalid(h EventHandler, scope ...any) HTMLIns {
  18867. e.setEventHandler("invalid", h, scope...)
  18868. return e
  18869. }
  18870. func (e *htmlIns) OnKeyDown(h EventHandler, scope ...any) HTMLIns {
  18871. e.setEventHandler("keydown", h, scope...)
  18872. return e
  18873. }
  18874. func (e *htmlIns) OnKeyPress(h EventHandler, scope ...any) HTMLIns {
  18875. e.setEventHandler("keypress", h, scope...)
  18876. return e
  18877. }
  18878. func (e *htmlIns) OnKeyUp(h EventHandler, scope ...any) HTMLIns {
  18879. e.setEventHandler("keyup", h, scope...)
  18880. return e
  18881. }
  18882. func (e *htmlIns) OnMouseDown(h EventHandler, scope ...any) HTMLIns {
  18883. e.setEventHandler("mousedown", h, scope...)
  18884. return e
  18885. }
  18886. func (e *htmlIns) OnMouseMove(h EventHandler, scope ...any) HTMLIns {
  18887. e.setEventHandler("mousemove", h, scope...)
  18888. return e
  18889. }
  18890. func (e *htmlIns) OnMouseOut(h EventHandler, scope ...any) HTMLIns {
  18891. e.setEventHandler("mouseout", h, scope...)
  18892. return e
  18893. }
  18894. func (e *htmlIns) OnMouseOver(h EventHandler, scope ...any) HTMLIns {
  18895. e.setEventHandler("mouseover", h, scope...)
  18896. return e
  18897. }
  18898. func (e *htmlIns) OnMouseUp(h EventHandler, scope ...any) HTMLIns {
  18899. e.setEventHandler("mouseup", h, scope...)
  18900. return e
  18901. }
  18902. func (e *htmlIns) OnPaste(h EventHandler, scope ...any) HTMLIns {
  18903. e.setEventHandler("paste", h, scope...)
  18904. return e
  18905. }
  18906. func (e *htmlIns) OnReset(h EventHandler, scope ...any) HTMLIns {
  18907. e.setEventHandler("reset", h, scope...)
  18908. return e
  18909. }
  18910. func (e *htmlIns) OnScroll(h EventHandler, scope ...any) HTMLIns {
  18911. e.setEventHandler("scroll", h, scope...)
  18912. return e
  18913. }
  18914. func (e *htmlIns) OnSearch(h EventHandler, scope ...any) HTMLIns {
  18915. e.setEventHandler("search", h, scope...)
  18916. return e
  18917. }
  18918. func (e *htmlIns) OnSelect(h EventHandler, scope ...any) HTMLIns {
  18919. e.setEventHandler("select", h, scope...)
  18920. return e
  18921. }
  18922. func (e *htmlIns) OnSubmit(h EventHandler, scope ...any) HTMLIns {
  18923. e.setEventHandler("submit", h, scope...)
  18924. return e
  18925. }
  18926. func (e *htmlIns) OnWheel(h EventHandler, scope ...any) HTMLIns {
  18927. e.setEventHandler("wheel", h, scope...)
  18928. return e
  18929. }
  18930. // HTMLKbd is the interface that describes a "kbd" HTML element.
  18931. type HTMLKbd interface {
  18932. UI
  18933. // Body set the content of the element.
  18934. Body(elems ...UI) HTMLKbd
  18935. // Text sets the content of the element with a text node containing the stringified given value.
  18936. Text(v any) HTMLKbd
  18937. // AccessKey specifies a shortcut key to activate/focus an element.
  18938. AccessKey(v string) HTMLKbd
  18939. // Aria stores accessible rich internet applications (ARIA) data.
  18940. Aria(k string, v any) HTMLKbd
  18941. // Attr sets the named attribute with the given value.
  18942. Attr(n string, v any) HTMLKbd
  18943. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  18944. Class(v ...string) HTMLKbd
  18945. // ContentEditable specifies whether the content of an element is editable or not.
  18946. ContentEditable(v bool) HTMLKbd
  18947. // DataSet stores custom data private to the page or application.
  18948. DataSet(k string, v any) HTMLKbd
  18949. // Dir specifies the text direction for the content in an element.
  18950. Dir(v string) HTMLKbd
  18951. // Draggable specifies whether an element is draggable or not.
  18952. Draggable(v bool) HTMLKbd
  18953. // Hidden specifies that an element is not yet, or is no longer relevant.
  18954. Hidden(v bool) HTMLKbd
  18955. // ID specifies a unique id for an element.
  18956. ID(v string) HTMLKbd
  18957. // Lang specifies the language of the element's content.
  18958. Lang(v string) HTMLKbd
  18959. // Role specifies to parsing software the exact function of an element (and its children).
  18960. Role(v string) HTMLKbd
  18961. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  18962. Spellcheck(v bool) HTMLKbd
  18963. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  18964. Style(k, v string) HTMLKbd
  18965. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  18966. Styles(s map[string]string) HTMLKbd
  18967. // TabIndex specifies the tabbing order of an element.
  18968. TabIndex(v int) HTMLKbd
  18969. // Title specifies extra information about an element.
  18970. Title(v string) HTMLKbd
  18971. // On registers the given event handler to the specified event.
  18972. On(event string, h EventHandler, scope ...any) HTMLKbd
  18973. // OnBlur calls the given handler when the element loses focus.
  18974. OnBlur(h EventHandler, scope ...any) HTMLKbd
  18975. // OnChange calls the given handler when the value of the element is changed.
  18976. OnChange(h EventHandler, scope ...any) HTMLKbd
  18977. // OnClick calls the given handler when there is a mouse click on the element.
  18978. OnClick(h EventHandler, scope ...any) HTMLKbd
  18979. // OnContextMenu calls the given handler when a context menu is triggered.
  18980. OnContextMenu(h EventHandler, scope ...any) HTMLKbd
  18981. // OnCopy calls the given handler when the user copies the content of an element.
  18982. OnCopy(h EventHandler, scope ...any) HTMLKbd
  18983. // OnCut calls the given handler when the user cuts the content of an element.
  18984. OnCut(h EventHandler, scope ...any) HTMLKbd
  18985. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  18986. OnDblClick(h EventHandler, scope ...any) HTMLKbd
  18987. // OnDrag calls the given handler when an element is dragged.
  18988. OnDrag(h EventHandler, scope ...any) HTMLKbd
  18989. // OnDragEnd calls the given handler at the end of a drag operation.
  18990. OnDragEnd(h EventHandler, scope ...any) HTMLKbd
  18991. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  18992. OnDragEnter(h EventHandler, scope ...any) HTMLKbd
  18993. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  18994. OnDragLeave(h EventHandler, scope ...any) HTMLKbd
  18995. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  18996. OnDragOver(h EventHandler, scope ...any) HTMLKbd
  18997. // OnDragStart calls the given handler at the start of a drag operation.
  18998. OnDragStart(h EventHandler, scope ...any) HTMLKbd
  18999. // OnDrop calls the given handler when dragged element is being dropped.
  19000. OnDrop(h EventHandler, scope ...any) HTMLKbd
  19001. // OnFocus calls the given handler when the element gets focus.
  19002. OnFocus(h EventHandler, scope ...any) HTMLKbd
  19003. // OnInput calls the given handler when an element gets user input.
  19004. OnInput(h EventHandler, scope ...any) HTMLKbd
  19005. // OnInvalid calls the given handler when an element is invalid.
  19006. OnInvalid(h EventHandler, scope ...any) HTMLKbd
  19007. // OnKeyDown calls the given handler when a user is pressing a key.
  19008. OnKeyDown(h EventHandler, scope ...any) HTMLKbd
  19009. // OnKeyPress calls the given handler when a user presses a key.
  19010. OnKeyPress(h EventHandler, scope ...any) HTMLKbd
  19011. // OnKeyUp calls the given handler when a user releases a key.
  19012. OnKeyUp(h EventHandler, scope ...any) HTMLKbd
  19013. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  19014. OnMouseDown(h EventHandler, scope ...any) HTMLKbd
  19015. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  19016. OnMouseMove(h EventHandler, scope ...any) HTMLKbd
  19017. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  19018. OnMouseOut(h EventHandler, scope ...any) HTMLKbd
  19019. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  19020. OnMouseOver(h EventHandler, scope ...any) HTMLKbd
  19021. // OnMouseUp calls the given handler when a mouse button is released over an element.
  19022. OnMouseUp(h EventHandler, scope ...any) HTMLKbd
  19023. // OnPaste calls the given handler when the user pastes some content in an element.
  19024. OnPaste(h EventHandler, scope ...any) HTMLKbd
  19025. // OnReset calls the given handler when the Reset button in a form is clicked.
  19026. OnReset(h EventHandler, scope ...any) HTMLKbd
  19027. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  19028. OnScroll(h EventHandler, scope ...any) HTMLKbd
  19029. // OnSearch calls the given handler when the user writes something in a search field.
  19030. OnSearch(h EventHandler, scope ...any) HTMLKbd
  19031. // OnSelect calls the given handler after some text has been selected in an element.
  19032. OnSelect(h EventHandler, scope ...any) HTMLKbd
  19033. // OnSubmit calls the given handler when a form is submitted.
  19034. OnSubmit(h EventHandler, scope ...any) HTMLKbd
  19035. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  19036. OnWheel(h EventHandler, scope ...any) HTMLKbd
  19037. }
  19038. // Kbd returns an HTML element that defines keyboard input.
  19039. func Kbd() HTMLKbd {
  19040. e := &htmlKbd{
  19041. htmlElement: htmlElement{
  19042. tag: "kbd",
  19043. isSelfClosing: false,
  19044. },
  19045. }
  19046. return e
  19047. }
  19048. type htmlKbd struct {
  19049. htmlElement
  19050. }
  19051. func (e *htmlKbd) Body(v ...UI) HTMLKbd {
  19052. e.setChildren(v...)
  19053. return e
  19054. }
  19055. func (e *htmlKbd) Text(v any) HTMLKbd {
  19056. return e.Body(Text(v))
  19057. }
  19058. func (e *htmlKbd) AccessKey(v string) HTMLKbd {
  19059. e.setAttr("accesskey", v)
  19060. return e
  19061. }
  19062. func (e *htmlKbd) Aria(k string, v any) HTMLKbd {
  19063. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  19064. return e
  19065. }
  19066. func (e *htmlKbd) Attr(n string, v any) HTMLKbd {
  19067. e.setAttr(n, v)
  19068. return e
  19069. }
  19070. func (e *htmlKbd) Class(v ...string) HTMLKbd {
  19071. e.setAttr("class", strings.Join(v, " "))
  19072. return e
  19073. }
  19074. func (e *htmlKbd) ContentEditable(v bool) HTMLKbd {
  19075. e.setAttr("contenteditable", v)
  19076. return e
  19077. }
  19078. func (e *htmlKbd) DataSet(k string, v any) HTMLKbd {
  19079. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  19080. return e
  19081. }
  19082. func (e *htmlKbd) Dir(v string) HTMLKbd {
  19083. e.setAttr("dir", v)
  19084. return e
  19085. }
  19086. func (e *htmlKbd) Draggable(v bool) HTMLKbd {
  19087. e.setAttr("draggable", v)
  19088. return e
  19089. }
  19090. func (e *htmlKbd) Hidden(v bool) HTMLKbd {
  19091. e.setAttr("hidden", v)
  19092. return e
  19093. }
  19094. func (e *htmlKbd) ID(v string) HTMLKbd {
  19095. e.setAttr("id", v)
  19096. return e
  19097. }
  19098. func (e *htmlKbd) Lang(v string) HTMLKbd {
  19099. e.setAttr("lang", v)
  19100. return e
  19101. }
  19102. func (e *htmlKbd) Role(v string) HTMLKbd {
  19103. e.setAttr("role", v)
  19104. return e
  19105. }
  19106. func (e *htmlKbd) Spellcheck(v bool) HTMLKbd {
  19107. s := "false"
  19108. if v {
  19109. s = "true"
  19110. }
  19111. e.setAttr("spellcheck", s)
  19112. return e
  19113. }
  19114. func (e *htmlKbd) Style(k, v string) HTMLKbd {
  19115. e.setAttr("style", k+":"+v)
  19116. return e
  19117. }
  19118. func (e *htmlKbd) Styles(s map[string]string) HTMLKbd {
  19119. for k, v := range s {
  19120. e.Style(k, v)
  19121. }
  19122. return e
  19123. }
  19124. func (e *htmlKbd) TabIndex(v int) HTMLKbd {
  19125. e.setAttr("tabindex", v)
  19126. return e
  19127. }
  19128. func (e *htmlKbd) Title(v string) HTMLKbd {
  19129. e.setAttr("title", v)
  19130. return e
  19131. }
  19132. func (e *htmlKbd) On(event string, h EventHandler, scope ...any) HTMLKbd {
  19133. e.setEventHandler(event, h, scope...)
  19134. return e
  19135. }
  19136. func (e *htmlKbd) OnBlur(h EventHandler, scope ...any) HTMLKbd {
  19137. e.setEventHandler("blur", h, scope...)
  19138. return e
  19139. }
  19140. func (e *htmlKbd) OnChange(h EventHandler, scope ...any) HTMLKbd {
  19141. e.setEventHandler("change", h, scope...)
  19142. return e
  19143. }
  19144. func (e *htmlKbd) OnClick(h EventHandler, scope ...any) HTMLKbd {
  19145. e.setEventHandler("click", h, scope...)
  19146. return e
  19147. }
  19148. func (e *htmlKbd) OnContextMenu(h EventHandler, scope ...any) HTMLKbd {
  19149. e.setEventHandler("contextmenu", h, scope...)
  19150. return e
  19151. }
  19152. func (e *htmlKbd) OnCopy(h EventHandler, scope ...any) HTMLKbd {
  19153. e.setEventHandler("copy", h, scope...)
  19154. return e
  19155. }
  19156. func (e *htmlKbd) OnCut(h EventHandler, scope ...any) HTMLKbd {
  19157. e.setEventHandler("cut", h, scope...)
  19158. return e
  19159. }
  19160. func (e *htmlKbd) OnDblClick(h EventHandler, scope ...any) HTMLKbd {
  19161. e.setEventHandler("dblclick", h, scope...)
  19162. return e
  19163. }
  19164. func (e *htmlKbd) OnDrag(h EventHandler, scope ...any) HTMLKbd {
  19165. e.setEventHandler("drag", h, scope...)
  19166. return e
  19167. }
  19168. func (e *htmlKbd) OnDragEnd(h EventHandler, scope ...any) HTMLKbd {
  19169. e.setEventHandler("dragend", h, scope...)
  19170. return e
  19171. }
  19172. func (e *htmlKbd) OnDragEnter(h EventHandler, scope ...any) HTMLKbd {
  19173. e.setEventHandler("dragenter", h, scope...)
  19174. return e
  19175. }
  19176. func (e *htmlKbd) OnDragLeave(h EventHandler, scope ...any) HTMLKbd {
  19177. e.setEventHandler("dragleave", h, scope...)
  19178. return e
  19179. }
  19180. func (e *htmlKbd) OnDragOver(h EventHandler, scope ...any) HTMLKbd {
  19181. e.setEventHandler("dragover", h, scope...)
  19182. return e
  19183. }
  19184. func (e *htmlKbd) OnDragStart(h EventHandler, scope ...any) HTMLKbd {
  19185. e.setEventHandler("dragstart", h, scope...)
  19186. return e
  19187. }
  19188. func (e *htmlKbd) OnDrop(h EventHandler, scope ...any) HTMLKbd {
  19189. e.setEventHandler("drop", h, scope...)
  19190. return e
  19191. }
  19192. func (e *htmlKbd) OnFocus(h EventHandler, scope ...any) HTMLKbd {
  19193. e.setEventHandler("focus", h, scope...)
  19194. return e
  19195. }
  19196. func (e *htmlKbd) OnInput(h EventHandler, scope ...any) HTMLKbd {
  19197. e.setEventHandler("input", h, scope...)
  19198. return e
  19199. }
  19200. func (e *htmlKbd) OnInvalid(h EventHandler, scope ...any) HTMLKbd {
  19201. e.setEventHandler("invalid", h, scope...)
  19202. return e
  19203. }
  19204. func (e *htmlKbd) OnKeyDown(h EventHandler, scope ...any) HTMLKbd {
  19205. e.setEventHandler("keydown", h, scope...)
  19206. return e
  19207. }
  19208. func (e *htmlKbd) OnKeyPress(h EventHandler, scope ...any) HTMLKbd {
  19209. e.setEventHandler("keypress", h, scope...)
  19210. return e
  19211. }
  19212. func (e *htmlKbd) OnKeyUp(h EventHandler, scope ...any) HTMLKbd {
  19213. e.setEventHandler("keyup", h, scope...)
  19214. return e
  19215. }
  19216. func (e *htmlKbd) OnMouseDown(h EventHandler, scope ...any) HTMLKbd {
  19217. e.setEventHandler("mousedown", h, scope...)
  19218. return e
  19219. }
  19220. func (e *htmlKbd) OnMouseMove(h EventHandler, scope ...any) HTMLKbd {
  19221. e.setEventHandler("mousemove", h, scope...)
  19222. return e
  19223. }
  19224. func (e *htmlKbd) OnMouseOut(h EventHandler, scope ...any) HTMLKbd {
  19225. e.setEventHandler("mouseout", h, scope...)
  19226. return e
  19227. }
  19228. func (e *htmlKbd) OnMouseOver(h EventHandler, scope ...any) HTMLKbd {
  19229. e.setEventHandler("mouseover", h, scope...)
  19230. return e
  19231. }
  19232. func (e *htmlKbd) OnMouseUp(h EventHandler, scope ...any) HTMLKbd {
  19233. e.setEventHandler("mouseup", h, scope...)
  19234. return e
  19235. }
  19236. func (e *htmlKbd) OnPaste(h EventHandler, scope ...any) HTMLKbd {
  19237. e.setEventHandler("paste", h, scope...)
  19238. return e
  19239. }
  19240. func (e *htmlKbd) OnReset(h EventHandler, scope ...any) HTMLKbd {
  19241. e.setEventHandler("reset", h, scope...)
  19242. return e
  19243. }
  19244. func (e *htmlKbd) OnScroll(h EventHandler, scope ...any) HTMLKbd {
  19245. e.setEventHandler("scroll", h, scope...)
  19246. return e
  19247. }
  19248. func (e *htmlKbd) OnSearch(h EventHandler, scope ...any) HTMLKbd {
  19249. e.setEventHandler("search", h, scope...)
  19250. return e
  19251. }
  19252. func (e *htmlKbd) OnSelect(h EventHandler, scope ...any) HTMLKbd {
  19253. e.setEventHandler("select", h, scope...)
  19254. return e
  19255. }
  19256. func (e *htmlKbd) OnSubmit(h EventHandler, scope ...any) HTMLKbd {
  19257. e.setEventHandler("submit", h, scope...)
  19258. return e
  19259. }
  19260. func (e *htmlKbd) OnWheel(h EventHandler, scope ...any) HTMLKbd {
  19261. e.setEventHandler("wheel", h, scope...)
  19262. return e
  19263. }
  19264. // HTMLLabel is the interface that describes a "label" HTML element.
  19265. type HTMLLabel interface {
  19266. UI
  19267. // Body set the content of the element.
  19268. Body(elems ...UI) HTMLLabel
  19269. // Text sets the content of the element with a text node containing the stringified given value.
  19270. Text(v any) HTMLLabel
  19271. // AccessKey specifies a shortcut key to activate/focus an element.
  19272. AccessKey(v string) HTMLLabel
  19273. // Aria stores accessible rich internet applications (ARIA) data.
  19274. Aria(k string, v any) HTMLLabel
  19275. // Attr sets the named attribute with the given value.
  19276. Attr(n string, v any) HTMLLabel
  19277. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  19278. Class(v ...string) HTMLLabel
  19279. // ContentEditable specifies whether the content of an element is editable or not.
  19280. ContentEditable(v bool) HTMLLabel
  19281. // DataSet stores custom data private to the page or application.
  19282. DataSet(k string, v any) HTMLLabel
  19283. // Dir specifies the text direction for the content in an element.
  19284. Dir(v string) HTMLLabel
  19285. // Draggable specifies whether an element is draggable or not.
  19286. Draggable(v bool) HTMLLabel
  19287. // For specifies which form element(s) a label/calculation is bound to.
  19288. For(v string) HTMLLabel
  19289. // Form specifies the name of the form the element belongs to.
  19290. Form(v string) HTMLLabel
  19291. // Hidden specifies that an element is not yet, or is no longer relevant.
  19292. Hidden(v bool) HTMLLabel
  19293. // ID specifies a unique id for an element.
  19294. ID(v string) HTMLLabel
  19295. // Lang specifies the language of the element's content.
  19296. Lang(v string) HTMLLabel
  19297. // Role specifies to parsing software the exact function of an element (and its children).
  19298. Role(v string) HTMLLabel
  19299. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  19300. Spellcheck(v bool) HTMLLabel
  19301. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  19302. Style(k, v string) HTMLLabel
  19303. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  19304. Styles(s map[string]string) HTMLLabel
  19305. // TabIndex specifies the tabbing order of an element.
  19306. TabIndex(v int) HTMLLabel
  19307. // Title specifies extra information about an element.
  19308. Title(v string) HTMLLabel
  19309. // On registers the given event handler to the specified event.
  19310. On(event string, h EventHandler, scope ...any) HTMLLabel
  19311. // OnBlur calls the given handler when the element loses focus.
  19312. OnBlur(h EventHandler, scope ...any) HTMLLabel
  19313. // OnChange calls the given handler when the value of the element is changed.
  19314. OnChange(h EventHandler, scope ...any) HTMLLabel
  19315. // OnClick calls the given handler when there is a mouse click on the element.
  19316. OnClick(h EventHandler, scope ...any) HTMLLabel
  19317. // OnContextMenu calls the given handler when a context menu is triggered.
  19318. OnContextMenu(h EventHandler, scope ...any) HTMLLabel
  19319. // OnCopy calls the given handler when the user copies the content of an element.
  19320. OnCopy(h EventHandler, scope ...any) HTMLLabel
  19321. // OnCut calls the given handler when the user cuts the content of an element.
  19322. OnCut(h EventHandler, scope ...any) HTMLLabel
  19323. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  19324. OnDblClick(h EventHandler, scope ...any) HTMLLabel
  19325. // OnDrag calls the given handler when an element is dragged.
  19326. OnDrag(h EventHandler, scope ...any) HTMLLabel
  19327. // OnDragEnd calls the given handler at the end of a drag operation.
  19328. OnDragEnd(h EventHandler, scope ...any) HTMLLabel
  19329. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  19330. OnDragEnter(h EventHandler, scope ...any) HTMLLabel
  19331. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  19332. OnDragLeave(h EventHandler, scope ...any) HTMLLabel
  19333. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  19334. OnDragOver(h EventHandler, scope ...any) HTMLLabel
  19335. // OnDragStart calls the given handler at the start of a drag operation.
  19336. OnDragStart(h EventHandler, scope ...any) HTMLLabel
  19337. // OnDrop calls the given handler when dragged element is being dropped.
  19338. OnDrop(h EventHandler, scope ...any) HTMLLabel
  19339. // OnFocus calls the given handler when the element gets focus.
  19340. OnFocus(h EventHandler, scope ...any) HTMLLabel
  19341. // OnInput calls the given handler when an element gets user input.
  19342. OnInput(h EventHandler, scope ...any) HTMLLabel
  19343. // OnInvalid calls the given handler when an element is invalid.
  19344. OnInvalid(h EventHandler, scope ...any) HTMLLabel
  19345. // OnKeyDown calls the given handler when a user is pressing a key.
  19346. OnKeyDown(h EventHandler, scope ...any) HTMLLabel
  19347. // OnKeyPress calls the given handler when a user presses a key.
  19348. OnKeyPress(h EventHandler, scope ...any) HTMLLabel
  19349. // OnKeyUp calls the given handler when a user releases a key.
  19350. OnKeyUp(h EventHandler, scope ...any) HTMLLabel
  19351. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  19352. OnMouseDown(h EventHandler, scope ...any) HTMLLabel
  19353. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  19354. OnMouseMove(h EventHandler, scope ...any) HTMLLabel
  19355. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  19356. OnMouseOut(h EventHandler, scope ...any) HTMLLabel
  19357. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  19358. OnMouseOver(h EventHandler, scope ...any) HTMLLabel
  19359. // OnMouseUp calls the given handler when a mouse button is released over an element.
  19360. OnMouseUp(h EventHandler, scope ...any) HTMLLabel
  19361. // OnPaste calls the given handler when the user pastes some content in an element.
  19362. OnPaste(h EventHandler, scope ...any) HTMLLabel
  19363. // OnReset calls the given handler when the Reset button in a form is clicked.
  19364. OnReset(h EventHandler, scope ...any) HTMLLabel
  19365. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  19366. OnScroll(h EventHandler, scope ...any) HTMLLabel
  19367. // OnSearch calls the given handler when the user writes something in a search field.
  19368. OnSearch(h EventHandler, scope ...any) HTMLLabel
  19369. // OnSelect calls the given handler after some text has been selected in an element.
  19370. OnSelect(h EventHandler, scope ...any) HTMLLabel
  19371. // OnSubmit calls the given handler when a form is submitted.
  19372. OnSubmit(h EventHandler, scope ...any) HTMLLabel
  19373. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  19374. OnWheel(h EventHandler, scope ...any) HTMLLabel
  19375. }
  19376. // Label returns an HTML element that defines a label for an input element.
  19377. func Label() HTMLLabel {
  19378. e := &htmlLabel{
  19379. htmlElement: htmlElement{
  19380. tag: "label",
  19381. isSelfClosing: false,
  19382. },
  19383. }
  19384. return e
  19385. }
  19386. type htmlLabel struct {
  19387. htmlElement
  19388. }
  19389. func (e *htmlLabel) Body(v ...UI) HTMLLabel {
  19390. e.setChildren(v...)
  19391. return e
  19392. }
  19393. func (e *htmlLabel) Text(v any) HTMLLabel {
  19394. return e.Body(Text(v))
  19395. }
  19396. func (e *htmlLabel) AccessKey(v string) HTMLLabel {
  19397. e.setAttr("accesskey", v)
  19398. return e
  19399. }
  19400. func (e *htmlLabel) Aria(k string, v any) HTMLLabel {
  19401. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  19402. return e
  19403. }
  19404. func (e *htmlLabel) Attr(n string, v any) HTMLLabel {
  19405. e.setAttr(n, v)
  19406. return e
  19407. }
  19408. func (e *htmlLabel) Class(v ...string) HTMLLabel {
  19409. e.setAttr("class", strings.Join(v, " "))
  19410. return e
  19411. }
  19412. func (e *htmlLabel) ContentEditable(v bool) HTMLLabel {
  19413. e.setAttr("contenteditable", v)
  19414. return e
  19415. }
  19416. func (e *htmlLabel) DataSet(k string, v any) HTMLLabel {
  19417. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  19418. return e
  19419. }
  19420. func (e *htmlLabel) Dir(v string) HTMLLabel {
  19421. e.setAttr("dir", v)
  19422. return e
  19423. }
  19424. func (e *htmlLabel) Draggable(v bool) HTMLLabel {
  19425. e.setAttr("draggable", v)
  19426. return e
  19427. }
  19428. func (e *htmlLabel) For(v string) HTMLLabel {
  19429. e.setAttr("for", v)
  19430. return e
  19431. }
  19432. func (e *htmlLabel) Form(v string) HTMLLabel {
  19433. e.setAttr("form", v)
  19434. return e
  19435. }
  19436. func (e *htmlLabel) Hidden(v bool) HTMLLabel {
  19437. e.setAttr("hidden", v)
  19438. return e
  19439. }
  19440. func (e *htmlLabel) ID(v string) HTMLLabel {
  19441. e.setAttr("id", v)
  19442. return e
  19443. }
  19444. func (e *htmlLabel) Lang(v string) HTMLLabel {
  19445. e.setAttr("lang", v)
  19446. return e
  19447. }
  19448. func (e *htmlLabel) Role(v string) HTMLLabel {
  19449. e.setAttr("role", v)
  19450. return e
  19451. }
  19452. func (e *htmlLabel) Spellcheck(v bool) HTMLLabel {
  19453. s := "false"
  19454. if v {
  19455. s = "true"
  19456. }
  19457. e.setAttr("spellcheck", s)
  19458. return e
  19459. }
  19460. func (e *htmlLabel) Style(k, v string) HTMLLabel {
  19461. e.setAttr("style", k+":"+v)
  19462. return e
  19463. }
  19464. func (e *htmlLabel) Styles(s map[string]string) HTMLLabel {
  19465. for k, v := range s {
  19466. e.Style(k, v)
  19467. }
  19468. return e
  19469. }
  19470. func (e *htmlLabel) TabIndex(v int) HTMLLabel {
  19471. e.setAttr("tabindex", v)
  19472. return e
  19473. }
  19474. func (e *htmlLabel) Title(v string) HTMLLabel {
  19475. e.setAttr("title", v)
  19476. return e
  19477. }
  19478. func (e *htmlLabel) On(event string, h EventHandler, scope ...any) HTMLLabel {
  19479. e.setEventHandler(event, h, scope...)
  19480. return e
  19481. }
  19482. func (e *htmlLabel) OnBlur(h EventHandler, scope ...any) HTMLLabel {
  19483. e.setEventHandler("blur", h, scope...)
  19484. return e
  19485. }
  19486. func (e *htmlLabel) OnChange(h EventHandler, scope ...any) HTMLLabel {
  19487. e.setEventHandler("change", h, scope...)
  19488. return e
  19489. }
  19490. func (e *htmlLabel) OnClick(h EventHandler, scope ...any) HTMLLabel {
  19491. e.setEventHandler("click", h, scope...)
  19492. return e
  19493. }
  19494. func (e *htmlLabel) OnContextMenu(h EventHandler, scope ...any) HTMLLabel {
  19495. e.setEventHandler("contextmenu", h, scope...)
  19496. return e
  19497. }
  19498. func (e *htmlLabel) OnCopy(h EventHandler, scope ...any) HTMLLabel {
  19499. e.setEventHandler("copy", h, scope...)
  19500. return e
  19501. }
  19502. func (e *htmlLabel) OnCut(h EventHandler, scope ...any) HTMLLabel {
  19503. e.setEventHandler("cut", h, scope...)
  19504. return e
  19505. }
  19506. func (e *htmlLabel) OnDblClick(h EventHandler, scope ...any) HTMLLabel {
  19507. e.setEventHandler("dblclick", h, scope...)
  19508. return e
  19509. }
  19510. func (e *htmlLabel) OnDrag(h EventHandler, scope ...any) HTMLLabel {
  19511. e.setEventHandler("drag", h, scope...)
  19512. return e
  19513. }
  19514. func (e *htmlLabel) OnDragEnd(h EventHandler, scope ...any) HTMLLabel {
  19515. e.setEventHandler("dragend", h, scope...)
  19516. return e
  19517. }
  19518. func (e *htmlLabel) OnDragEnter(h EventHandler, scope ...any) HTMLLabel {
  19519. e.setEventHandler("dragenter", h, scope...)
  19520. return e
  19521. }
  19522. func (e *htmlLabel) OnDragLeave(h EventHandler, scope ...any) HTMLLabel {
  19523. e.setEventHandler("dragleave", h, scope...)
  19524. return e
  19525. }
  19526. func (e *htmlLabel) OnDragOver(h EventHandler, scope ...any) HTMLLabel {
  19527. e.setEventHandler("dragover", h, scope...)
  19528. return e
  19529. }
  19530. func (e *htmlLabel) OnDragStart(h EventHandler, scope ...any) HTMLLabel {
  19531. e.setEventHandler("dragstart", h, scope...)
  19532. return e
  19533. }
  19534. func (e *htmlLabel) OnDrop(h EventHandler, scope ...any) HTMLLabel {
  19535. e.setEventHandler("drop", h, scope...)
  19536. return e
  19537. }
  19538. func (e *htmlLabel) OnFocus(h EventHandler, scope ...any) HTMLLabel {
  19539. e.setEventHandler("focus", h, scope...)
  19540. return e
  19541. }
  19542. func (e *htmlLabel) OnInput(h EventHandler, scope ...any) HTMLLabel {
  19543. e.setEventHandler("input", h, scope...)
  19544. return e
  19545. }
  19546. func (e *htmlLabel) OnInvalid(h EventHandler, scope ...any) HTMLLabel {
  19547. e.setEventHandler("invalid", h, scope...)
  19548. return e
  19549. }
  19550. func (e *htmlLabel) OnKeyDown(h EventHandler, scope ...any) HTMLLabel {
  19551. e.setEventHandler("keydown", h, scope...)
  19552. return e
  19553. }
  19554. func (e *htmlLabel) OnKeyPress(h EventHandler, scope ...any) HTMLLabel {
  19555. e.setEventHandler("keypress", h, scope...)
  19556. return e
  19557. }
  19558. func (e *htmlLabel) OnKeyUp(h EventHandler, scope ...any) HTMLLabel {
  19559. e.setEventHandler("keyup", h, scope...)
  19560. return e
  19561. }
  19562. func (e *htmlLabel) OnMouseDown(h EventHandler, scope ...any) HTMLLabel {
  19563. e.setEventHandler("mousedown", h, scope...)
  19564. return e
  19565. }
  19566. func (e *htmlLabel) OnMouseMove(h EventHandler, scope ...any) HTMLLabel {
  19567. e.setEventHandler("mousemove", h, scope...)
  19568. return e
  19569. }
  19570. func (e *htmlLabel) OnMouseOut(h EventHandler, scope ...any) HTMLLabel {
  19571. e.setEventHandler("mouseout", h, scope...)
  19572. return e
  19573. }
  19574. func (e *htmlLabel) OnMouseOver(h EventHandler, scope ...any) HTMLLabel {
  19575. e.setEventHandler("mouseover", h, scope...)
  19576. return e
  19577. }
  19578. func (e *htmlLabel) OnMouseUp(h EventHandler, scope ...any) HTMLLabel {
  19579. e.setEventHandler("mouseup", h, scope...)
  19580. return e
  19581. }
  19582. func (e *htmlLabel) OnPaste(h EventHandler, scope ...any) HTMLLabel {
  19583. e.setEventHandler("paste", h, scope...)
  19584. return e
  19585. }
  19586. func (e *htmlLabel) OnReset(h EventHandler, scope ...any) HTMLLabel {
  19587. e.setEventHandler("reset", h, scope...)
  19588. return e
  19589. }
  19590. func (e *htmlLabel) OnScroll(h EventHandler, scope ...any) HTMLLabel {
  19591. e.setEventHandler("scroll", h, scope...)
  19592. return e
  19593. }
  19594. func (e *htmlLabel) OnSearch(h EventHandler, scope ...any) HTMLLabel {
  19595. e.setEventHandler("search", h, scope...)
  19596. return e
  19597. }
  19598. func (e *htmlLabel) OnSelect(h EventHandler, scope ...any) HTMLLabel {
  19599. e.setEventHandler("select", h, scope...)
  19600. return e
  19601. }
  19602. func (e *htmlLabel) OnSubmit(h EventHandler, scope ...any) HTMLLabel {
  19603. e.setEventHandler("submit", h, scope...)
  19604. return e
  19605. }
  19606. func (e *htmlLabel) OnWheel(h EventHandler, scope ...any) HTMLLabel {
  19607. e.setEventHandler("wheel", h, scope...)
  19608. return e
  19609. }
  19610. // HTMLLegend is the interface that describes a "legend" HTML element.
  19611. type HTMLLegend interface {
  19612. UI
  19613. // Body set the content of the element.
  19614. Body(elems ...UI) HTMLLegend
  19615. // Text sets the content of the element with a text node containing the stringified given value.
  19616. Text(v any) HTMLLegend
  19617. // AccessKey specifies a shortcut key to activate/focus an element.
  19618. AccessKey(v string) HTMLLegend
  19619. // Aria stores accessible rich internet applications (ARIA) data.
  19620. Aria(k string, v any) HTMLLegend
  19621. // Attr sets the named attribute with the given value.
  19622. Attr(n string, v any) HTMLLegend
  19623. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  19624. Class(v ...string) HTMLLegend
  19625. // ContentEditable specifies whether the content of an element is editable or not.
  19626. ContentEditable(v bool) HTMLLegend
  19627. // DataSet stores custom data private to the page or application.
  19628. DataSet(k string, v any) HTMLLegend
  19629. // Dir specifies the text direction for the content in an element.
  19630. Dir(v string) HTMLLegend
  19631. // Draggable specifies whether an element is draggable or not.
  19632. Draggable(v bool) HTMLLegend
  19633. // Hidden specifies that an element is not yet, or is no longer relevant.
  19634. Hidden(v bool) HTMLLegend
  19635. // ID specifies a unique id for an element.
  19636. ID(v string) HTMLLegend
  19637. // Lang specifies the language of the element's content.
  19638. Lang(v string) HTMLLegend
  19639. // Role specifies to parsing software the exact function of an element (and its children).
  19640. Role(v string) HTMLLegend
  19641. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  19642. Spellcheck(v bool) HTMLLegend
  19643. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  19644. Style(k, v string) HTMLLegend
  19645. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  19646. Styles(s map[string]string) HTMLLegend
  19647. // TabIndex specifies the tabbing order of an element.
  19648. TabIndex(v int) HTMLLegend
  19649. // Title specifies extra information about an element.
  19650. Title(v string) HTMLLegend
  19651. // On registers the given event handler to the specified event.
  19652. On(event string, h EventHandler, scope ...any) HTMLLegend
  19653. // OnBlur calls the given handler when the element loses focus.
  19654. OnBlur(h EventHandler, scope ...any) HTMLLegend
  19655. // OnChange calls the given handler when the value of the element is changed.
  19656. OnChange(h EventHandler, scope ...any) HTMLLegend
  19657. // OnClick calls the given handler when there is a mouse click on the element.
  19658. OnClick(h EventHandler, scope ...any) HTMLLegend
  19659. // OnContextMenu calls the given handler when a context menu is triggered.
  19660. OnContextMenu(h EventHandler, scope ...any) HTMLLegend
  19661. // OnCopy calls the given handler when the user copies the content of an element.
  19662. OnCopy(h EventHandler, scope ...any) HTMLLegend
  19663. // OnCut calls the given handler when the user cuts the content of an element.
  19664. OnCut(h EventHandler, scope ...any) HTMLLegend
  19665. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  19666. OnDblClick(h EventHandler, scope ...any) HTMLLegend
  19667. // OnDrag calls the given handler when an element is dragged.
  19668. OnDrag(h EventHandler, scope ...any) HTMLLegend
  19669. // OnDragEnd calls the given handler at the end of a drag operation.
  19670. OnDragEnd(h EventHandler, scope ...any) HTMLLegend
  19671. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  19672. OnDragEnter(h EventHandler, scope ...any) HTMLLegend
  19673. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  19674. OnDragLeave(h EventHandler, scope ...any) HTMLLegend
  19675. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  19676. OnDragOver(h EventHandler, scope ...any) HTMLLegend
  19677. // OnDragStart calls the given handler at the start of a drag operation.
  19678. OnDragStart(h EventHandler, scope ...any) HTMLLegend
  19679. // OnDrop calls the given handler when dragged element is being dropped.
  19680. OnDrop(h EventHandler, scope ...any) HTMLLegend
  19681. // OnFocus calls the given handler when the element gets focus.
  19682. OnFocus(h EventHandler, scope ...any) HTMLLegend
  19683. // OnInput calls the given handler when an element gets user input.
  19684. OnInput(h EventHandler, scope ...any) HTMLLegend
  19685. // OnInvalid calls the given handler when an element is invalid.
  19686. OnInvalid(h EventHandler, scope ...any) HTMLLegend
  19687. // OnKeyDown calls the given handler when a user is pressing a key.
  19688. OnKeyDown(h EventHandler, scope ...any) HTMLLegend
  19689. // OnKeyPress calls the given handler when a user presses a key.
  19690. OnKeyPress(h EventHandler, scope ...any) HTMLLegend
  19691. // OnKeyUp calls the given handler when a user releases a key.
  19692. OnKeyUp(h EventHandler, scope ...any) HTMLLegend
  19693. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  19694. OnMouseDown(h EventHandler, scope ...any) HTMLLegend
  19695. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  19696. OnMouseMove(h EventHandler, scope ...any) HTMLLegend
  19697. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  19698. OnMouseOut(h EventHandler, scope ...any) HTMLLegend
  19699. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  19700. OnMouseOver(h EventHandler, scope ...any) HTMLLegend
  19701. // OnMouseUp calls the given handler when a mouse button is released over an element.
  19702. OnMouseUp(h EventHandler, scope ...any) HTMLLegend
  19703. // OnPaste calls the given handler when the user pastes some content in an element.
  19704. OnPaste(h EventHandler, scope ...any) HTMLLegend
  19705. // OnReset calls the given handler when the Reset button in a form is clicked.
  19706. OnReset(h EventHandler, scope ...any) HTMLLegend
  19707. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  19708. OnScroll(h EventHandler, scope ...any) HTMLLegend
  19709. // OnSearch calls the given handler when the user writes something in a search field.
  19710. OnSearch(h EventHandler, scope ...any) HTMLLegend
  19711. // OnSelect calls the given handler after some text has been selected in an element.
  19712. OnSelect(h EventHandler, scope ...any) HTMLLegend
  19713. // OnSubmit calls the given handler when a form is submitted.
  19714. OnSubmit(h EventHandler, scope ...any) HTMLLegend
  19715. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  19716. OnWheel(h EventHandler, scope ...any) HTMLLegend
  19717. }
  19718. // Legend returns an HTML element that defines a caption for a fieldset element.
  19719. func Legend() HTMLLegend {
  19720. e := &htmlLegend{
  19721. htmlElement: htmlElement{
  19722. tag: "legend",
  19723. isSelfClosing: false,
  19724. },
  19725. }
  19726. return e
  19727. }
  19728. type htmlLegend struct {
  19729. htmlElement
  19730. }
  19731. func (e *htmlLegend) Body(v ...UI) HTMLLegend {
  19732. e.setChildren(v...)
  19733. return e
  19734. }
  19735. func (e *htmlLegend) Text(v any) HTMLLegend {
  19736. return e.Body(Text(v))
  19737. }
  19738. func (e *htmlLegend) AccessKey(v string) HTMLLegend {
  19739. e.setAttr("accesskey", v)
  19740. return e
  19741. }
  19742. func (e *htmlLegend) Aria(k string, v any) HTMLLegend {
  19743. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  19744. return e
  19745. }
  19746. func (e *htmlLegend) Attr(n string, v any) HTMLLegend {
  19747. e.setAttr(n, v)
  19748. return e
  19749. }
  19750. func (e *htmlLegend) Class(v ...string) HTMLLegend {
  19751. e.setAttr("class", strings.Join(v, " "))
  19752. return e
  19753. }
  19754. func (e *htmlLegend) ContentEditable(v bool) HTMLLegend {
  19755. e.setAttr("contenteditable", v)
  19756. return e
  19757. }
  19758. func (e *htmlLegend) DataSet(k string, v any) HTMLLegend {
  19759. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  19760. return e
  19761. }
  19762. func (e *htmlLegend) Dir(v string) HTMLLegend {
  19763. e.setAttr("dir", v)
  19764. return e
  19765. }
  19766. func (e *htmlLegend) Draggable(v bool) HTMLLegend {
  19767. e.setAttr("draggable", v)
  19768. return e
  19769. }
  19770. func (e *htmlLegend) Hidden(v bool) HTMLLegend {
  19771. e.setAttr("hidden", v)
  19772. return e
  19773. }
  19774. func (e *htmlLegend) ID(v string) HTMLLegend {
  19775. e.setAttr("id", v)
  19776. return e
  19777. }
  19778. func (e *htmlLegend) Lang(v string) HTMLLegend {
  19779. e.setAttr("lang", v)
  19780. return e
  19781. }
  19782. func (e *htmlLegend) Role(v string) HTMLLegend {
  19783. e.setAttr("role", v)
  19784. return e
  19785. }
  19786. func (e *htmlLegend) Spellcheck(v bool) HTMLLegend {
  19787. s := "false"
  19788. if v {
  19789. s = "true"
  19790. }
  19791. e.setAttr("spellcheck", s)
  19792. return e
  19793. }
  19794. func (e *htmlLegend) Style(k, v string) HTMLLegend {
  19795. e.setAttr("style", k+":"+v)
  19796. return e
  19797. }
  19798. func (e *htmlLegend) Styles(s map[string]string) HTMLLegend {
  19799. for k, v := range s {
  19800. e.Style(k, v)
  19801. }
  19802. return e
  19803. }
  19804. func (e *htmlLegend) TabIndex(v int) HTMLLegend {
  19805. e.setAttr("tabindex", v)
  19806. return e
  19807. }
  19808. func (e *htmlLegend) Title(v string) HTMLLegend {
  19809. e.setAttr("title", v)
  19810. return e
  19811. }
  19812. func (e *htmlLegend) On(event string, h EventHandler, scope ...any) HTMLLegend {
  19813. e.setEventHandler(event, h, scope...)
  19814. return e
  19815. }
  19816. func (e *htmlLegend) OnBlur(h EventHandler, scope ...any) HTMLLegend {
  19817. e.setEventHandler("blur", h, scope...)
  19818. return e
  19819. }
  19820. func (e *htmlLegend) OnChange(h EventHandler, scope ...any) HTMLLegend {
  19821. e.setEventHandler("change", h, scope...)
  19822. return e
  19823. }
  19824. func (e *htmlLegend) OnClick(h EventHandler, scope ...any) HTMLLegend {
  19825. e.setEventHandler("click", h, scope...)
  19826. return e
  19827. }
  19828. func (e *htmlLegend) OnContextMenu(h EventHandler, scope ...any) HTMLLegend {
  19829. e.setEventHandler("contextmenu", h, scope...)
  19830. return e
  19831. }
  19832. func (e *htmlLegend) OnCopy(h EventHandler, scope ...any) HTMLLegend {
  19833. e.setEventHandler("copy", h, scope...)
  19834. return e
  19835. }
  19836. func (e *htmlLegend) OnCut(h EventHandler, scope ...any) HTMLLegend {
  19837. e.setEventHandler("cut", h, scope...)
  19838. return e
  19839. }
  19840. func (e *htmlLegend) OnDblClick(h EventHandler, scope ...any) HTMLLegend {
  19841. e.setEventHandler("dblclick", h, scope...)
  19842. return e
  19843. }
  19844. func (e *htmlLegend) OnDrag(h EventHandler, scope ...any) HTMLLegend {
  19845. e.setEventHandler("drag", h, scope...)
  19846. return e
  19847. }
  19848. func (e *htmlLegend) OnDragEnd(h EventHandler, scope ...any) HTMLLegend {
  19849. e.setEventHandler("dragend", h, scope...)
  19850. return e
  19851. }
  19852. func (e *htmlLegend) OnDragEnter(h EventHandler, scope ...any) HTMLLegend {
  19853. e.setEventHandler("dragenter", h, scope...)
  19854. return e
  19855. }
  19856. func (e *htmlLegend) OnDragLeave(h EventHandler, scope ...any) HTMLLegend {
  19857. e.setEventHandler("dragleave", h, scope...)
  19858. return e
  19859. }
  19860. func (e *htmlLegend) OnDragOver(h EventHandler, scope ...any) HTMLLegend {
  19861. e.setEventHandler("dragover", h, scope...)
  19862. return e
  19863. }
  19864. func (e *htmlLegend) OnDragStart(h EventHandler, scope ...any) HTMLLegend {
  19865. e.setEventHandler("dragstart", h, scope...)
  19866. return e
  19867. }
  19868. func (e *htmlLegend) OnDrop(h EventHandler, scope ...any) HTMLLegend {
  19869. e.setEventHandler("drop", h, scope...)
  19870. return e
  19871. }
  19872. func (e *htmlLegend) OnFocus(h EventHandler, scope ...any) HTMLLegend {
  19873. e.setEventHandler("focus", h, scope...)
  19874. return e
  19875. }
  19876. func (e *htmlLegend) OnInput(h EventHandler, scope ...any) HTMLLegend {
  19877. e.setEventHandler("input", h, scope...)
  19878. return e
  19879. }
  19880. func (e *htmlLegend) OnInvalid(h EventHandler, scope ...any) HTMLLegend {
  19881. e.setEventHandler("invalid", h, scope...)
  19882. return e
  19883. }
  19884. func (e *htmlLegend) OnKeyDown(h EventHandler, scope ...any) HTMLLegend {
  19885. e.setEventHandler("keydown", h, scope...)
  19886. return e
  19887. }
  19888. func (e *htmlLegend) OnKeyPress(h EventHandler, scope ...any) HTMLLegend {
  19889. e.setEventHandler("keypress", h, scope...)
  19890. return e
  19891. }
  19892. func (e *htmlLegend) OnKeyUp(h EventHandler, scope ...any) HTMLLegend {
  19893. e.setEventHandler("keyup", h, scope...)
  19894. return e
  19895. }
  19896. func (e *htmlLegend) OnMouseDown(h EventHandler, scope ...any) HTMLLegend {
  19897. e.setEventHandler("mousedown", h, scope...)
  19898. return e
  19899. }
  19900. func (e *htmlLegend) OnMouseMove(h EventHandler, scope ...any) HTMLLegend {
  19901. e.setEventHandler("mousemove", h, scope...)
  19902. return e
  19903. }
  19904. func (e *htmlLegend) OnMouseOut(h EventHandler, scope ...any) HTMLLegend {
  19905. e.setEventHandler("mouseout", h, scope...)
  19906. return e
  19907. }
  19908. func (e *htmlLegend) OnMouseOver(h EventHandler, scope ...any) HTMLLegend {
  19909. e.setEventHandler("mouseover", h, scope...)
  19910. return e
  19911. }
  19912. func (e *htmlLegend) OnMouseUp(h EventHandler, scope ...any) HTMLLegend {
  19913. e.setEventHandler("mouseup", h, scope...)
  19914. return e
  19915. }
  19916. func (e *htmlLegend) OnPaste(h EventHandler, scope ...any) HTMLLegend {
  19917. e.setEventHandler("paste", h, scope...)
  19918. return e
  19919. }
  19920. func (e *htmlLegend) OnReset(h EventHandler, scope ...any) HTMLLegend {
  19921. e.setEventHandler("reset", h, scope...)
  19922. return e
  19923. }
  19924. func (e *htmlLegend) OnScroll(h EventHandler, scope ...any) HTMLLegend {
  19925. e.setEventHandler("scroll", h, scope...)
  19926. return e
  19927. }
  19928. func (e *htmlLegend) OnSearch(h EventHandler, scope ...any) HTMLLegend {
  19929. e.setEventHandler("search", h, scope...)
  19930. return e
  19931. }
  19932. func (e *htmlLegend) OnSelect(h EventHandler, scope ...any) HTMLLegend {
  19933. e.setEventHandler("select", h, scope...)
  19934. return e
  19935. }
  19936. func (e *htmlLegend) OnSubmit(h EventHandler, scope ...any) HTMLLegend {
  19937. e.setEventHandler("submit", h, scope...)
  19938. return e
  19939. }
  19940. func (e *htmlLegend) OnWheel(h EventHandler, scope ...any) HTMLLegend {
  19941. e.setEventHandler("wheel", h, scope...)
  19942. return e
  19943. }
  19944. // HTMLLi is the interface that describes a "li" HTML element.
  19945. type HTMLLi interface {
  19946. UI
  19947. // Body set the content of the element.
  19948. Body(elems ...UI) HTMLLi
  19949. // Text sets the content of the element with a text node containing the stringified given value.
  19950. Text(v any) HTMLLi
  19951. // AccessKey specifies a shortcut key to activate/focus an element.
  19952. AccessKey(v string) HTMLLi
  19953. // Aria stores accessible rich internet applications (ARIA) data.
  19954. Aria(k string, v any) HTMLLi
  19955. // Attr sets the named attribute with the given value.
  19956. Attr(n string, v any) HTMLLi
  19957. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  19958. Class(v ...string) HTMLLi
  19959. // ContentEditable specifies whether the content of an element is editable or not.
  19960. ContentEditable(v bool) HTMLLi
  19961. // DataSet stores custom data private to the page or application.
  19962. DataSet(k string, v any) HTMLLi
  19963. // Dir specifies the text direction for the content in an element.
  19964. Dir(v string) HTMLLi
  19965. // Draggable specifies whether an element is draggable or not.
  19966. Draggable(v bool) HTMLLi
  19967. // Hidden specifies that an element is not yet, or is no longer relevant.
  19968. Hidden(v bool) HTMLLi
  19969. // ID specifies a unique id for an element.
  19970. ID(v string) HTMLLi
  19971. // Lang specifies the language of the element's content.
  19972. Lang(v string) HTMLLi
  19973. // Role specifies to parsing software the exact function of an element (and its children).
  19974. Role(v string) HTMLLi
  19975. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  19976. Spellcheck(v bool) HTMLLi
  19977. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  19978. Style(k, v string) HTMLLi
  19979. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  19980. Styles(s map[string]string) HTMLLi
  19981. // TabIndex specifies the tabbing order of an element.
  19982. TabIndex(v int) HTMLLi
  19983. // Title specifies extra information about an element.
  19984. Title(v string) HTMLLi
  19985. // Value specifies the value of the element.
  19986. Value(v any) HTMLLi
  19987. // On registers the given event handler to the specified event.
  19988. On(event string, h EventHandler, scope ...any) HTMLLi
  19989. // OnBlur calls the given handler when the element loses focus.
  19990. OnBlur(h EventHandler, scope ...any) HTMLLi
  19991. // OnChange calls the given handler when the value of the element is changed.
  19992. OnChange(h EventHandler, scope ...any) HTMLLi
  19993. // OnClick calls the given handler when there is a mouse click on the element.
  19994. OnClick(h EventHandler, scope ...any) HTMLLi
  19995. // OnContextMenu calls the given handler when a context menu is triggered.
  19996. OnContextMenu(h EventHandler, scope ...any) HTMLLi
  19997. // OnCopy calls the given handler when the user copies the content of an element.
  19998. OnCopy(h EventHandler, scope ...any) HTMLLi
  19999. // OnCut calls the given handler when the user cuts the content of an element.
  20000. OnCut(h EventHandler, scope ...any) HTMLLi
  20001. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  20002. OnDblClick(h EventHandler, scope ...any) HTMLLi
  20003. // OnDrag calls the given handler when an element is dragged.
  20004. OnDrag(h EventHandler, scope ...any) HTMLLi
  20005. // OnDragEnd calls the given handler at the end of a drag operation.
  20006. OnDragEnd(h EventHandler, scope ...any) HTMLLi
  20007. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  20008. OnDragEnter(h EventHandler, scope ...any) HTMLLi
  20009. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  20010. OnDragLeave(h EventHandler, scope ...any) HTMLLi
  20011. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  20012. OnDragOver(h EventHandler, scope ...any) HTMLLi
  20013. // OnDragStart calls the given handler at the start of a drag operation.
  20014. OnDragStart(h EventHandler, scope ...any) HTMLLi
  20015. // OnDrop calls the given handler when dragged element is being dropped.
  20016. OnDrop(h EventHandler, scope ...any) HTMLLi
  20017. // OnFocus calls the given handler when the element gets focus.
  20018. OnFocus(h EventHandler, scope ...any) HTMLLi
  20019. // OnInput calls the given handler when an element gets user input.
  20020. OnInput(h EventHandler, scope ...any) HTMLLi
  20021. // OnInvalid calls the given handler when an element is invalid.
  20022. OnInvalid(h EventHandler, scope ...any) HTMLLi
  20023. // OnKeyDown calls the given handler when a user is pressing a key.
  20024. OnKeyDown(h EventHandler, scope ...any) HTMLLi
  20025. // OnKeyPress calls the given handler when a user presses a key.
  20026. OnKeyPress(h EventHandler, scope ...any) HTMLLi
  20027. // OnKeyUp calls the given handler when a user releases a key.
  20028. OnKeyUp(h EventHandler, scope ...any) HTMLLi
  20029. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  20030. OnMouseDown(h EventHandler, scope ...any) HTMLLi
  20031. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  20032. OnMouseMove(h EventHandler, scope ...any) HTMLLi
  20033. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  20034. OnMouseOut(h EventHandler, scope ...any) HTMLLi
  20035. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  20036. OnMouseOver(h EventHandler, scope ...any) HTMLLi
  20037. // OnMouseUp calls the given handler when a mouse button is released over an element.
  20038. OnMouseUp(h EventHandler, scope ...any) HTMLLi
  20039. // OnPaste calls the given handler when the user pastes some content in an element.
  20040. OnPaste(h EventHandler, scope ...any) HTMLLi
  20041. // OnReset calls the given handler when the Reset button in a form is clicked.
  20042. OnReset(h EventHandler, scope ...any) HTMLLi
  20043. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  20044. OnScroll(h EventHandler, scope ...any) HTMLLi
  20045. // OnSearch calls the given handler when the user writes something in a search field.
  20046. OnSearch(h EventHandler, scope ...any) HTMLLi
  20047. // OnSelect calls the given handler after some text has been selected in an element.
  20048. OnSelect(h EventHandler, scope ...any) HTMLLi
  20049. // OnSubmit calls the given handler when a form is submitted.
  20050. OnSubmit(h EventHandler, scope ...any) HTMLLi
  20051. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  20052. OnWheel(h EventHandler, scope ...any) HTMLLi
  20053. }
  20054. // Li returns an HTML element that defines a list item.
  20055. func Li() HTMLLi {
  20056. e := &htmlLi{
  20057. htmlElement: htmlElement{
  20058. tag: "li",
  20059. isSelfClosing: false,
  20060. },
  20061. }
  20062. return e
  20063. }
  20064. type htmlLi struct {
  20065. htmlElement
  20066. }
  20067. func (e *htmlLi) Body(v ...UI) HTMLLi {
  20068. e.setChildren(v...)
  20069. return e
  20070. }
  20071. func (e *htmlLi) Text(v any) HTMLLi {
  20072. return e.Body(Text(v))
  20073. }
  20074. func (e *htmlLi) AccessKey(v string) HTMLLi {
  20075. e.setAttr("accesskey", v)
  20076. return e
  20077. }
  20078. func (e *htmlLi) Aria(k string, v any) HTMLLi {
  20079. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  20080. return e
  20081. }
  20082. func (e *htmlLi) Attr(n string, v any) HTMLLi {
  20083. e.setAttr(n, v)
  20084. return e
  20085. }
  20086. func (e *htmlLi) Class(v ...string) HTMLLi {
  20087. e.setAttr("class", strings.Join(v, " "))
  20088. return e
  20089. }
  20090. func (e *htmlLi) ContentEditable(v bool) HTMLLi {
  20091. e.setAttr("contenteditable", v)
  20092. return e
  20093. }
  20094. func (e *htmlLi) DataSet(k string, v any) HTMLLi {
  20095. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  20096. return e
  20097. }
  20098. func (e *htmlLi) Dir(v string) HTMLLi {
  20099. e.setAttr("dir", v)
  20100. return e
  20101. }
  20102. func (e *htmlLi) Draggable(v bool) HTMLLi {
  20103. e.setAttr("draggable", v)
  20104. return e
  20105. }
  20106. func (e *htmlLi) Hidden(v bool) HTMLLi {
  20107. e.setAttr("hidden", v)
  20108. return e
  20109. }
  20110. func (e *htmlLi) ID(v string) HTMLLi {
  20111. e.setAttr("id", v)
  20112. return e
  20113. }
  20114. func (e *htmlLi) Lang(v string) HTMLLi {
  20115. e.setAttr("lang", v)
  20116. return e
  20117. }
  20118. func (e *htmlLi) Role(v string) HTMLLi {
  20119. e.setAttr("role", v)
  20120. return e
  20121. }
  20122. func (e *htmlLi) Spellcheck(v bool) HTMLLi {
  20123. s := "false"
  20124. if v {
  20125. s = "true"
  20126. }
  20127. e.setAttr("spellcheck", s)
  20128. return e
  20129. }
  20130. func (e *htmlLi) Style(k, v string) HTMLLi {
  20131. e.setAttr("style", k+":"+v)
  20132. return e
  20133. }
  20134. func (e *htmlLi) Styles(s map[string]string) HTMLLi {
  20135. for k, v := range s {
  20136. e.Style(k, v)
  20137. }
  20138. return e
  20139. }
  20140. func (e *htmlLi) TabIndex(v int) HTMLLi {
  20141. e.setAttr("tabindex", v)
  20142. return e
  20143. }
  20144. func (e *htmlLi) Title(v string) HTMLLi {
  20145. e.setAttr("title", v)
  20146. return e
  20147. }
  20148. func (e *htmlLi) Value(v any) HTMLLi {
  20149. e.setAttr("value", v)
  20150. return e
  20151. }
  20152. func (e *htmlLi) On(event string, h EventHandler, scope ...any) HTMLLi {
  20153. e.setEventHandler(event, h, scope...)
  20154. return e
  20155. }
  20156. func (e *htmlLi) OnBlur(h EventHandler, scope ...any) HTMLLi {
  20157. e.setEventHandler("blur", h, scope...)
  20158. return e
  20159. }
  20160. func (e *htmlLi) OnChange(h EventHandler, scope ...any) HTMLLi {
  20161. e.setEventHandler("change", h, scope...)
  20162. return e
  20163. }
  20164. func (e *htmlLi) OnClick(h EventHandler, scope ...any) HTMLLi {
  20165. e.setEventHandler("click", h, scope...)
  20166. return e
  20167. }
  20168. func (e *htmlLi) OnContextMenu(h EventHandler, scope ...any) HTMLLi {
  20169. e.setEventHandler("contextmenu", h, scope...)
  20170. return e
  20171. }
  20172. func (e *htmlLi) OnCopy(h EventHandler, scope ...any) HTMLLi {
  20173. e.setEventHandler("copy", h, scope...)
  20174. return e
  20175. }
  20176. func (e *htmlLi) OnCut(h EventHandler, scope ...any) HTMLLi {
  20177. e.setEventHandler("cut", h, scope...)
  20178. return e
  20179. }
  20180. func (e *htmlLi) OnDblClick(h EventHandler, scope ...any) HTMLLi {
  20181. e.setEventHandler("dblclick", h, scope...)
  20182. return e
  20183. }
  20184. func (e *htmlLi) OnDrag(h EventHandler, scope ...any) HTMLLi {
  20185. e.setEventHandler("drag", h, scope...)
  20186. return e
  20187. }
  20188. func (e *htmlLi) OnDragEnd(h EventHandler, scope ...any) HTMLLi {
  20189. e.setEventHandler("dragend", h, scope...)
  20190. return e
  20191. }
  20192. func (e *htmlLi) OnDragEnter(h EventHandler, scope ...any) HTMLLi {
  20193. e.setEventHandler("dragenter", h, scope...)
  20194. return e
  20195. }
  20196. func (e *htmlLi) OnDragLeave(h EventHandler, scope ...any) HTMLLi {
  20197. e.setEventHandler("dragleave", h, scope...)
  20198. return e
  20199. }
  20200. func (e *htmlLi) OnDragOver(h EventHandler, scope ...any) HTMLLi {
  20201. e.setEventHandler("dragover", h, scope...)
  20202. return e
  20203. }
  20204. func (e *htmlLi) OnDragStart(h EventHandler, scope ...any) HTMLLi {
  20205. e.setEventHandler("dragstart", h, scope...)
  20206. return e
  20207. }
  20208. func (e *htmlLi) OnDrop(h EventHandler, scope ...any) HTMLLi {
  20209. e.setEventHandler("drop", h, scope...)
  20210. return e
  20211. }
  20212. func (e *htmlLi) OnFocus(h EventHandler, scope ...any) HTMLLi {
  20213. e.setEventHandler("focus", h, scope...)
  20214. return e
  20215. }
  20216. func (e *htmlLi) OnInput(h EventHandler, scope ...any) HTMLLi {
  20217. e.setEventHandler("input", h, scope...)
  20218. return e
  20219. }
  20220. func (e *htmlLi) OnInvalid(h EventHandler, scope ...any) HTMLLi {
  20221. e.setEventHandler("invalid", h, scope...)
  20222. return e
  20223. }
  20224. func (e *htmlLi) OnKeyDown(h EventHandler, scope ...any) HTMLLi {
  20225. e.setEventHandler("keydown", h, scope...)
  20226. return e
  20227. }
  20228. func (e *htmlLi) OnKeyPress(h EventHandler, scope ...any) HTMLLi {
  20229. e.setEventHandler("keypress", h, scope...)
  20230. return e
  20231. }
  20232. func (e *htmlLi) OnKeyUp(h EventHandler, scope ...any) HTMLLi {
  20233. e.setEventHandler("keyup", h, scope...)
  20234. return e
  20235. }
  20236. func (e *htmlLi) OnMouseDown(h EventHandler, scope ...any) HTMLLi {
  20237. e.setEventHandler("mousedown", h, scope...)
  20238. return e
  20239. }
  20240. func (e *htmlLi) OnMouseMove(h EventHandler, scope ...any) HTMLLi {
  20241. e.setEventHandler("mousemove", h, scope...)
  20242. return e
  20243. }
  20244. func (e *htmlLi) OnMouseOut(h EventHandler, scope ...any) HTMLLi {
  20245. e.setEventHandler("mouseout", h, scope...)
  20246. return e
  20247. }
  20248. func (e *htmlLi) OnMouseOver(h EventHandler, scope ...any) HTMLLi {
  20249. e.setEventHandler("mouseover", h, scope...)
  20250. return e
  20251. }
  20252. func (e *htmlLi) OnMouseUp(h EventHandler, scope ...any) HTMLLi {
  20253. e.setEventHandler("mouseup", h, scope...)
  20254. return e
  20255. }
  20256. func (e *htmlLi) OnPaste(h EventHandler, scope ...any) HTMLLi {
  20257. e.setEventHandler("paste", h, scope...)
  20258. return e
  20259. }
  20260. func (e *htmlLi) OnReset(h EventHandler, scope ...any) HTMLLi {
  20261. e.setEventHandler("reset", h, scope...)
  20262. return e
  20263. }
  20264. func (e *htmlLi) OnScroll(h EventHandler, scope ...any) HTMLLi {
  20265. e.setEventHandler("scroll", h, scope...)
  20266. return e
  20267. }
  20268. func (e *htmlLi) OnSearch(h EventHandler, scope ...any) HTMLLi {
  20269. e.setEventHandler("search", h, scope...)
  20270. return e
  20271. }
  20272. func (e *htmlLi) OnSelect(h EventHandler, scope ...any) HTMLLi {
  20273. e.setEventHandler("select", h, scope...)
  20274. return e
  20275. }
  20276. func (e *htmlLi) OnSubmit(h EventHandler, scope ...any) HTMLLi {
  20277. e.setEventHandler("submit", h, scope...)
  20278. return e
  20279. }
  20280. func (e *htmlLi) OnWheel(h EventHandler, scope ...any) HTMLLi {
  20281. e.setEventHandler("wheel", h, scope...)
  20282. return e
  20283. }
  20284. // HTMLLink is the interface that describes a "link" HTML element.
  20285. type HTMLLink interface {
  20286. UI
  20287. // AccessKey specifies a shortcut key to activate/focus an element.
  20288. AccessKey(v string) HTMLLink
  20289. // Aria stores accessible rich internet applications (ARIA) data.
  20290. Aria(k string, v any) HTMLLink
  20291. // Attr sets the named attribute with the given value.
  20292. Attr(n string, v any) HTMLLink
  20293. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  20294. Class(v ...string) HTMLLink
  20295. // ContentEditable specifies whether the content of an element is editable or not.
  20296. ContentEditable(v bool) HTMLLink
  20297. // CrossOrigin sets the mode of the request to an HTTP CORS Request.
  20298. CrossOrigin(v string) HTMLLink
  20299. // DataSet stores custom data private to the page or application.
  20300. DataSet(k string, v any) HTMLLink
  20301. // Dir specifies the text direction for the content in an element.
  20302. Dir(v string) HTMLLink
  20303. // Draggable specifies whether an element is draggable or not.
  20304. Draggable(v bool) HTMLLink
  20305. // Hidden specifies that an element is not yet, or is no longer relevant.
  20306. Hidden(v bool) HTMLLink
  20307. // Href specifies the URL of the page the link goes to.
  20308. Href(v string) HTMLLink
  20309. // HrefLang specifies the language of the linked document.
  20310. HrefLang(v string) HTMLLink
  20311. // ID specifies a unique id for an element.
  20312. ID(v string) HTMLLink
  20313. // Lang specifies the language of the element's content.
  20314. Lang(v string) HTMLLink
  20315. // Media specifies what media/device the linked document is optimized for.
  20316. Media(v string) HTMLLink
  20317. // Rel specifies the relationship between the current document and the linked document.
  20318. Rel(v string) HTMLLink
  20319. // Role specifies to parsing software the exact function of an element (and its children).
  20320. Role(v string) HTMLLink
  20321. // Sizes specifies the size of the linked resource.
  20322. Sizes(v string) HTMLLink
  20323. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  20324. Spellcheck(v bool) HTMLLink
  20325. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  20326. Style(k, v string) HTMLLink
  20327. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  20328. Styles(s map[string]string) HTMLLink
  20329. // TabIndex specifies the tabbing order of an element.
  20330. TabIndex(v int) HTMLLink
  20331. // Title specifies extra information about an element.
  20332. Title(v string) HTMLLink
  20333. // Type specifies the type of element.
  20334. Type(v string) HTMLLink
  20335. // On registers the given event handler to the specified event.
  20336. On(event string, h EventHandler, scope ...any) HTMLLink
  20337. // OnBlur calls the given handler when the element loses focus.
  20338. OnBlur(h EventHandler, scope ...any) HTMLLink
  20339. // OnChange calls the given handler when the value of the element is changed.
  20340. OnChange(h EventHandler, scope ...any) HTMLLink
  20341. // OnClick calls the given handler when there is a mouse click on the element.
  20342. OnClick(h EventHandler, scope ...any) HTMLLink
  20343. // OnContextMenu calls the given handler when a context menu is triggered.
  20344. OnContextMenu(h EventHandler, scope ...any) HTMLLink
  20345. // OnCopy calls the given handler when the user copies the content of an element.
  20346. OnCopy(h EventHandler, scope ...any) HTMLLink
  20347. // OnCut calls the given handler when the user cuts the content of an element.
  20348. OnCut(h EventHandler, scope ...any) HTMLLink
  20349. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  20350. OnDblClick(h EventHandler, scope ...any) HTMLLink
  20351. // OnDrag calls the given handler when an element is dragged.
  20352. OnDrag(h EventHandler, scope ...any) HTMLLink
  20353. // OnDragEnd calls the given handler at the end of a drag operation.
  20354. OnDragEnd(h EventHandler, scope ...any) HTMLLink
  20355. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  20356. OnDragEnter(h EventHandler, scope ...any) HTMLLink
  20357. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  20358. OnDragLeave(h EventHandler, scope ...any) HTMLLink
  20359. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  20360. OnDragOver(h EventHandler, scope ...any) HTMLLink
  20361. // OnDragStart calls the given handler at the start of a drag operation.
  20362. OnDragStart(h EventHandler, scope ...any) HTMLLink
  20363. // OnDrop calls the given handler when dragged element is being dropped.
  20364. OnDrop(h EventHandler, scope ...any) HTMLLink
  20365. // OnFocus calls the given handler when the element gets focus.
  20366. OnFocus(h EventHandler, scope ...any) HTMLLink
  20367. // OnInput calls the given handler when an element gets user input.
  20368. OnInput(h EventHandler, scope ...any) HTMLLink
  20369. // OnInvalid calls the given handler when an element is invalid.
  20370. OnInvalid(h EventHandler, scope ...any) HTMLLink
  20371. // OnKeyDown calls the given handler when a user is pressing a key.
  20372. OnKeyDown(h EventHandler, scope ...any) HTMLLink
  20373. // OnKeyPress calls the given handler when a user presses a key.
  20374. OnKeyPress(h EventHandler, scope ...any) HTMLLink
  20375. // OnKeyUp calls the given handler when a user releases a key.
  20376. OnKeyUp(h EventHandler, scope ...any) HTMLLink
  20377. // OnLoad calls the given handler after the element is finished loading.
  20378. OnLoad(h EventHandler, scope ...any) HTMLLink
  20379. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  20380. OnMouseDown(h EventHandler, scope ...any) HTMLLink
  20381. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  20382. OnMouseMove(h EventHandler, scope ...any) HTMLLink
  20383. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  20384. OnMouseOut(h EventHandler, scope ...any) HTMLLink
  20385. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  20386. OnMouseOver(h EventHandler, scope ...any) HTMLLink
  20387. // OnMouseUp calls the given handler when a mouse button is released over an element.
  20388. OnMouseUp(h EventHandler, scope ...any) HTMLLink
  20389. // OnPaste calls the given handler when the user pastes some content in an element.
  20390. OnPaste(h EventHandler, scope ...any) HTMLLink
  20391. // OnReset calls the given handler when the Reset button in a form is clicked.
  20392. OnReset(h EventHandler, scope ...any) HTMLLink
  20393. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  20394. OnScroll(h EventHandler, scope ...any) HTMLLink
  20395. // OnSearch calls the given handler when the user writes something in a search field.
  20396. OnSearch(h EventHandler, scope ...any) HTMLLink
  20397. // OnSelect calls the given handler after some text has been selected in an element.
  20398. OnSelect(h EventHandler, scope ...any) HTMLLink
  20399. // OnSubmit calls the given handler when a form is submitted.
  20400. OnSubmit(h EventHandler, scope ...any) HTMLLink
  20401. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  20402. OnWheel(h EventHandler, scope ...any) HTMLLink
  20403. }
  20404. // Link returns an HTML element that defines the relationship between a document and an external resource (most used to link to style sheets).
  20405. func Link() HTMLLink {
  20406. e := &htmlLink{
  20407. htmlElement: htmlElement{
  20408. tag: "link",
  20409. isSelfClosing: true,
  20410. },
  20411. }
  20412. return e
  20413. }
  20414. type htmlLink struct {
  20415. htmlElement
  20416. }
  20417. func (e *htmlLink) AccessKey(v string) HTMLLink {
  20418. e.setAttr("accesskey", v)
  20419. return e
  20420. }
  20421. func (e *htmlLink) Aria(k string, v any) HTMLLink {
  20422. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  20423. return e
  20424. }
  20425. func (e *htmlLink) Attr(n string, v any) HTMLLink {
  20426. e.setAttr(n, v)
  20427. return e
  20428. }
  20429. func (e *htmlLink) Class(v ...string) HTMLLink {
  20430. e.setAttr("class", strings.Join(v, " "))
  20431. return e
  20432. }
  20433. func (e *htmlLink) ContentEditable(v bool) HTMLLink {
  20434. e.setAttr("contenteditable", v)
  20435. return e
  20436. }
  20437. func (e *htmlLink) CrossOrigin(v string) HTMLLink {
  20438. e.setAttr("crossorigin", v)
  20439. return e
  20440. }
  20441. func (e *htmlLink) DataSet(k string, v any) HTMLLink {
  20442. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  20443. return e
  20444. }
  20445. func (e *htmlLink) Dir(v string) HTMLLink {
  20446. e.setAttr("dir", v)
  20447. return e
  20448. }
  20449. func (e *htmlLink) Draggable(v bool) HTMLLink {
  20450. e.setAttr("draggable", v)
  20451. return e
  20452. }
  20453. func (e *htmlLink) Hidden(v bool) HTMLLink {
  20454. e.setAttr("hidden", v)
  20455. return e
  20456. }
  20457. func (e *htmlLink) Href(v string) HTMLLink {
  20458. e.setAttr("href", v)
  20459. return e
  20460. }
  20461. func (e *htmlLink) HrefLang(v string) HTMLLink {
  20462. e.setAttr("hreflang", v)
  20463. return e
  20464. }
  20465. func (e *htmlLink) ID(v string) HTMLLink {
  20466. e.setAttr("id", v)
  20467. return e
  20468. }
  20469. func (e *htmlLink) Lang(v string) HTMLLink {
  20470. e.setAttr("lang", v)
  20471. return e
  20472. }
  20473. func (e *htmlLink) Media(v string) HTMLLink {
  20474. e.setAttr("media", v)
  20475. return e
  20476. }
  20477. func (e *htmlLink) Rel(v string) HTMLLink {
  20478. e.setAttr("rel", v)
  20479. return e
  20480. }
  20481. func (e *htmlLink) Role(v string) HTMLLink {
  20482. e.setAttr("role", v)
  20483. return e
  20484. }
  20485. func (e *htmlLink) Sizes(v string) HTMLLink {
  20486. e.setAttr("sizes", v)
  20487. return e
  20488. }
  20489. func (e *htmlLink) Spellcheck(v bool) HTMLLink {
  20490. s := "false"
  20491. if v {
  20492. s = "true"
  20493. }
  20494. e.setAttr("spellcheck", s)
  20495. return e
  20496. }
  20497. func (e *htmlLink) Style(k, v string) HTMLLink {
  20498. e.setAttr("style", k+":"+v)
  20499. return e
  20500. }
  20501. func (e *htmlLink) Styles(s map[string]string) HTMLLink {
  20502. for k, v := range s {
  20503. e.Style(k, v)
  20504. }
  20505. return e
  20506. }
  20507. func (e *htmlLink) TabIndex(v int) HTMLLink {
  20508. e.setAttr("tabindex", v)
  20509. return e
  20510. }
  20511. func (e *htmlLink) Title(v string) HTMLLink {
  20512. e.setAttr("title", v)
  20513. return e
  20514. }
  20515. func (e *htmlLink) Type(v string) HTMLLink {
  20516. e.setAttr("type", v)
  20517. return e
  20518. }
  20519. func (e *htmlLink) On(event string, h EventHandler, scope ...any) HTMLLink {
  20520. e.setEventHandler(event, h, scope...)
  20521. return e
  20522. }
  20523. func (e *htmlLink) OnBlur(h EventHandler, scope ...any) HTMLLink {
  20524. e.setEventHandler("blur", h, scope...)
  20525. return e
  20526. }
  20527. func (e *htmlLink) OnChange(h EventHandler, scope ...any) HTMLLink {
  20528. e.setEventHandler("change", h, scope...)
  20529. return e
  20530. }
  20531. func (e *htmlLink) OnClick(h EventHandler, scope ...any) HTMLLink {
  20532. e.setEventHandler("click", h, scope...)
  20533. return e
  20534. }
  20535. func (e *htmlLink) OnContextMenu(h EventHandler, scope ...any) HTMLLink {
  20536. e.setEventHandler("contextmenu", h, scope...)
  20537. return e
  20538. }
  20539. func (e *htmlLink) OnCopy(h EventHandler, scope ...any) HTMLLink {
  20540. e.setEventHandler("copy", h, scope...)
  20541. return e
  20542. }
  20543. func (e *htmlLink) OnCut(h EventHandler, scope ...any) HTMLLink {
  20544. e.setEventHandler("cut", h, scope...)
  20545. return e
  20546. }
  20547. func (e *htmlLink) OnDblClick(h EventHandler, scope ...any) HTMLLink {
  20548. e.setEventHandler("dblclick", h, scope...)
  20549. return e
  20550. }
  20551. func (e *htmlLink) OnDrag(h EventHandler, scope ...any) HTMLLink {
  20552. e.setEventHandler("drag", h, scope...)
  20553. return e
  20554. }
  20555. func (e *htmlLink) OnDragEnd(h EventHandler, scope ...any) HTMLLink {
  20556. e.setEventHandler("dragend", h, scope...)
  20557. return e
  20558. }
  20559. func (e *htmlLink) OnDragEnter(h EventHandler, scope ...any) HTMLLink {
  20560. e.setEventHandler("dragenter", h, scope...)
  20561. return e
  20562. }
  20563. func (e *htmlLink) OnDragLeave(h EventHandler, scope ...any) HTMLLink {
  20564. e.setEventHandler("dragleave", h, scope...)
  20565. return e
  20566. }
  20567. func (e *htmlLink) OnDragOver(h EventHandler, scope ...any) HTMLLink {
  20568. e.setEventHandler("dragover", h, scope...)
  20569. return e
  20570. }
  20571. func (e *htmlLink) OnDragStart(h EventHandler, scope ...any) HTMLLink {
  20572. e.setEventHandler("dragstart", h, scope...)
  20573. return e
  20574. }
  20575. func (e *htmlLink) OnDrop(h EventHandler, scope ...any) HTMLLink {
  20576. e.setEventHandler("drop", h, scope...)
  20577. return e
  20578. }
  20579. func (e *htmlLink) OnFocus(h EventHandler, scope ...any) HTMLLink {
  20580. e.setEventHandler("focus", h, scope...)
  20581. return e
  20582. }
  20583. func (e *htmlLink) OnInput(h EventHandler, scope ...any) HTMLLink {
  20584. e.setEventHandler("input", h, scope...)
  20585. return e
  20586. }
  20587. func (e *htmlLink) OnInvalid(h EventHandler, scope ...any) HTMLLink {
  20588. e.setEventHandler("invalid", h, scope...)
  20589. return e
  20590. }
  20591. func (e *htmlLink) OnKeyDown(h EventHandler, scope ...any) HTMLLink {
  20592. e.setEventHandler("keydown", h, scope...)
  20593. return e
  20594. }
  20595. func (e *htmlLink) OnKeyPress(h EventHandler, scope ...any) HTMLLink {
  20596. e.setEventHandler("keypress", h, scope...)
  20597. return e
  20598. }
  20599. func (e *htmlLink) OnKeyUp(h EventHandler, scope ...any) HTMLLink {
  20600. e.setEventHandler("keyup", h, scope...)
  20601. return e
  20602. }
  20603. func (e *htmlLink) OnLoad(h EventHandler, scope ...any) HTMLLink {
  20604. e.setEventHandler("load", h, scope...)
  20605. return e
  20606. }
  20607. func (e *htmlLink) OnMouseDown(h EventHandler, scope ...any) HTMLLink {
  20608. e.setEventHandler("mousedown", h, scope...)
  20609. return e
  20610. }
  20611. func (e *htmlLink) OnMouseMove(h EventHandler, scope ...any) HTMLLink {
  20612. e.setEventHandler("mousemove", h, scope...)
  20613. return e
  20614. }
  20615. func (e *htmlLink) OnMouseOut(h EventHandler, scope ...any) HTMLLink {
  20616. e.setEventHandler("mouseout", h, scope...)
  20617. return e
  20618. }
  20619. func (e *htmlLink) OnMouseOver(h EventHandler, scope ...any) HTMLLink {
  20620. e.setEventHandler("mouseover", h, scope...)
  20621. return e
  20622. }
  20623. func (e *htmlLink) OnMouseUp(h EventHandler, scope ...any) HTMLLink {
  20624. e.setEventHandler("mouseup", h, scope...)
  20625. return e
  20626. }
  20627. func (e *htmlLink) OnPaste(h EventHandler, scope ...any) HTMLLink {
  20628. e.setEventHandler("paste", h, scope...)
  20629. return e
  20630. }
  20631. func (e *htmlLink) OnReset(h EventHandler, scope ...any) HTMLLink {
  20632. e.setEventHandler("reset", h, scope...)
  20633. return e
  20634. }
  20635. func (e *htmlLink) OnScroll(h EventHandler, scope ...any) HTMLLink {
  20636. e.setEventHandler("scroll", h, scope...)
  20637. return e
  20638. }
  20639. func (e *htmlLink) OnSearch(h EventHandler, scope ...any) HTMLLink {
  20640. e.setEventHandler("search", h, scope...)
  20641. return e
  20642. }
  20643. func (e *htmlLink) OnSelect(h EventHandler, scope ...any) HTMLLink {
  20644. e.setEventHandler("select", h, scope...)
  20645. return e
  20646. }
  20647. func (e *htmlLink) OnSubmit(h EventHandler, scope ...any) HTMLLink {
  20648. e.setEventHandler("submit", h, scope...)
  20649. return e
  20650. }
  20651. func (e *htmlLink) OnWheel(h EventHandler, scope ...any) HTMLLink {
  20652. e.setEventHandler("wheel", h, scope...)
  20653. return e
  20654. }
  20655. // HTMLMain is the interface that describes a "main" HTML element.
  20656. type HTMLMain interface {
  20657. UI
  20658. // Body set the content of the element.
  20659. Body(elems ...UI) HTMLMain
  20660. // Text sets the content of the element with a text node containing the stringified given value.
  20661. Text(v any) HTMLMain
  20662. // AccessKey specifies a shortcut key to activate/focus an element.
  20663. AccessKey(v string) HTMLMain
  20664. // Aria stores accessible rich internet applications (ARIA) data.
  20665. Aria(k string, v any) HTMLMain
  20666. // Attr sets the named attribute with the given value.
  20667. Attr(n string, v any) HTMLMain
  20668. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  20669. Class(v ...string) HTMLMain
  20670. // ContentEditable specifies whether the content of an element is editable or not.
  20671. ContentEditable(v bool) HTMLMain
  20672. // DataSet stores custom data private to the page or application.
  20673. DataSet(k string, v any) HTMLMain
  20674. // Dir specifies the text direction for the content in an element.
  20675. Dir(v string) HTMLMain
  20676. // Draggable specifies whether an element is draggable or not.
  20677. Draggable(v bool) HTMLMain
  20678. // Hidden specifies that an element is not yet, or is no longer relevant.
  20679. Hidden(v bool) HTMLMain
  20680. // ID specifies a unique id for an element.
  20681. ID(v string) HTMLMain
  20682. // Lang specifies the language of the element's content.
  20683. Lang(v string) HTMLMain
  20684. // Role specifies to parsing software the exact function of an element (and its children).
  20685. Role(v string) HTMLMain
  20686. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  20687. Spellcheck(v bool) HTMLMain
  20688. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  20689. Style(k, v string) HTMLMain
  20690. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  20691. Styles(s map[string]string) HTMLMain
  20692. // TabIndex specifies the tabbing order of an element.
  20693. TabIndex(v int) HTMLMain
  20694. // Title specifies extra information about an element.
  20695. Title(v string) HTMLMain
  20696. // On registers the given event handler to the specified event.
  20697. On(event string, h EventHandler, scope ...any) HTMLMain
  20698. // OnBlur calls the given handler when the element loses focus.
  20699. OnBlur(h EventHandler, scope ...any) HTMLMain
  20700. // OnChange calls the given handler when the value of the element is changed.
  20701. OnChange(h EventHandler, scope ...any) HTMLMain
  20702. // OnClick calls the given handler when there is a mouse click on the element.
  20703. OnClick(h EventHandler, scope ...any) HTMLMain
  20704. // OnContextMenu calls the given handler when a context menu is triggered.
  20705. OnContextMenu(h EventHandler, scope ...any) HTMLMain
  20706. // OnCopy calls the given handler when the user copies the content of an element.
  20707. OnCopy(h EventHandler, scope ...any) HTMLMain
  20708. // OnCut calls the given handler when the user cuts the content of an element.
  20709. OnCut(h EventHandler, scope ...any) HTMLMain
  20710. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  20711. OnDblClick(h EventHandler, scope ...any) HTMLMain
  20712. // OnDrag calls the given handler when an element is dragged.
  20713. OnDrag(h EventHandler, scope ...any) HTMLMain
  20714. // OnDragEnd calls the given handler at the end of a drag operation.
  20715. OnDragEnd(h EventHandler, scope ...any) HTMLMain
  20716. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  20717. OnDragEnter(h EventHandler, scope ...any) HTMLMain
  20718. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  20719. OnDragLeave(h EventHandler, scope ...any) HTMLMain
  20720. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  20721. OnDragOver(h EventHandler, scope ...any) HTMLMain
  20722. // OnDragStart calls the given handler at the start of a drag operation.
  20723. OnDragStart(h EventHandler, scope ...any) HTMLMain
  20724. // OnDrop calls the given handler when dragged element is being dropped.
  20725. OnDrop(h EventHandler, scope ...any) HTMLMain
  20726. // OnFocus calls the given handler when the element gets focus.
  20727. OnFocus(h EventHandler, scope ...any) HTMLMain
  20728. // OnInput calls the given handler when an element gets user input.
  20729. OnInput(h EventHandler, scope ...any) HTMLMain
  20730. // OnInvalid calls the given handler when an element is invalid.
  20731. OnInvalid(h EventHandler, scope ...any) HTMLMain
  20732. // OnKeyDown calls the given handler when a user is pressing a key.
  20733. OnKeyDown(h EventHandler, scope ...any) HTMLMain
  20734. // OnKeyPress calls the given handler when a user presses a key.
  20735. OnKeyPress(h EventHandler, scope ...any) HTMLMain
  20736. // OnKeyUp calls the given handler when a user releases a key.
  20737. OnKeyUp(h EventHandler, scope ...any) HTMLMain
  20738. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  20739. OnMouseDown(h EventHandler, scope ...any) HTMLMain
  20740. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  20741. OnMouseMove(h EventHandler, scope ...any) HTMLMain
  20742. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  20743. OnMouseOut(h EventHandler, scope ...any) HTMLMain
  20744. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  20745. OnMouseOver(h EventHandler, scope ...any) HTMLMain
  20746. // OnMouseUp calls the given handler when a mouse button is released over an element.
  20747. OnMouseUp(h EventHandler, scope ...any) HTMLMain
  20748. // OnPaste calls the given handler when the user pastes some content in an element.
  20749. OnPaste(h EventHandler, scope ...any) HTMLMain
  20750. // OnReset calls the given handler when the Reset button in a form is clicked.
  20751. OnReset(h EventHandler, scope ...any) HTMLMain
  20752. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  20753. OnScroll(h EventHandler, scope ...any) HTMLMain
  20754. // OnSearch calls the given handler when the user writes something in a search field.
  20755. OnSearch(h EventHandler, scope ...any) HTMLMain
  20756. // OnSelect calls the given handler after some text has been selected in an element.
  20757. OnSelect(h EventHandler, scope ...any) HTMLMain
  20758. // OnSubmit calls the given handler when a form is submitted.
  20759. OnSubmit(h EventHandler, scope ...any) HTMLMain
  20760. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  20761. OnWheel(h EventHandler, scope ...any) HTMLMain
  20762. }
  20763. // Main returns an HTML element that specifies the main content of a document.
  20764. func Main() HTMLMain {
  20765. e := &htmlMain{
  20766. htmlElement: htmlElement{
  20767. tag: "main",
  20768. isSelfClosing: false,
  20769. },
  20770. }
  20771. return e
  20772. }
  20773. type htmlMain struct {
  20774. htmlElement
  20775. }
  20776. func (e *htmlMain) Body(v ...UI) HTMLMain {
  20777. e.setChildren(v...)
  20778. return e
  20779. }
  20780. func (e *htmlMain) Text(v any) HTMLMain {
  20781. return e.Body(Text(v))
  20782. }
  20783. func (e *htmlMain) AccessKey(v string) HTMLMain {
  20784. e.setAttr("accesskey", v)
  20785. return e
  20786. }
  20787. func (e *htmlMain) Aria(k string, v any) HTMLMain {
  20788. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  20789. return e
  20790. }
  20791. func (e *htmlMain) Attr(n string, v any) HTMLMain {
  20792. e.setAttr(n, v)
  20793. return e
  20794. }
  20795. func (e *htmlMain) Class(v ...string) HTMLMain {
  20796. e.setAttr("class", strings.Join(v, " "))
  20797. return e
  20798. }
  20799. func (e *htmlMain) ContentEditable(v bool) HTMLMain {
  20800. e.setAttr("contenteditable", v)
  20801. return e
  20802. }
  20803. func (e *htmlMain) DataSet(k string, v any) HTMLMain {
  20804. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  20805. return e
  20806. }
  20807. func (e *htmlMain) Dir(v string) HTMLMain {
  20808. e.setAttr("dir", v)
  20809. return e
  20810. }
  20811. func (e *htmlMain) Draggable(v bool) HTMLMain {
  20812. e.setAttr("draggable", v)
  20813. return e
  20814. }
  20815. func (e *htmlMain) Hidden(v bool) HTMLMain {
  20816. e.setAttr("hidden", v)
  20817. return e
  20818. }
  20819. func (e *htmlMain) ID(v string) HTMLMain {
  20820. e.setAttr("id", v)
  20821. return e
  20822. }
  20823. func (e *htmlMain) Lang(v string) HTMLMain {
  20824. e.setAttr("lang", v)
  20825. return e
  20826. }
  20827. func (e *htmlMain) Role(v string) HTMLMain {
  20828. e.setAttr("role", v)
  20829. return e
  20830. }
  20831. func (e *htmlMain) Spellcheck(v bool) HTMLMain {
  20832. s := "false"
  20833. if v {
  20834. s = "true"
  20835. }
  20836. e.setAttr("spellcheck", s)
  20837. return e
  20838. }
  20839. func (e *htmlMain) Style(k, v string) HTMLMain {
  20840. e.setAttr("style", k+":"+v)
  20841. return e
  20842. }
  20843. func (e *htmlMain) Styles(s map[string]string) HTMLMain {
  20844. for k, v := range s {
  20845. e.Style(k, v)
  20846. }
  20847. return e
  20848. }
  20849. func (e *htmlMain) TabIndex(v int) HTMLMain {
  20850. e.setAttr("tabindex", v)
  20851. return e
  20852. }
  20853. func (e *htmlMain) Title(v string) HTMLMain {
  20854. e.setAttr("title", v)
  20855. return e
  20856. }
  20857. func (e *htmlMain) On(event string, h EventHandler, scope ...any) HTMLMain {
  20858. e.setEventHandler(event, h, scope...)
  20859. return e
  20860. }
  20861. func (e *htmlMain) OnBlur(h EventHandler, scope ...any) HTMLMain {
  20862. e.setEventHandler("blur", h, scope...)
  20863. return e
  20864. }
  20865. func (e *htmlMain) OnChange(h EventHandler, scope ...any) HTMLMain {
  20866. e.setEventHandler("change", h, scope...)
  20867. return e
  20868. }
  20869. func (e *htmlMain) OnClick(h EventHandler, scope ...any) HTMLMain {
  20870. e.setEventHandler("click", h, scope...)
  20871. return e
  20872. }
  20873. func (e *htmlMain) OnContextMenu(h EventHandler, scope ...any) HTMLMain {
  20874. e.setEventHandler("contextmenu", h, scope...)
  20875. return e
  20876. }
  20877. func (e *htmlMain) OnCopy(h EventHandler, scope ...any) HTMLMain {
  20878. e.setEventHandler("copy", h, scope...)
  20879. return e
  20880. }
  20881. func (e *htmlMain) OnCut(h EventHandler, scope ...any) HTMLMain {
  20882. e.setEventHandler("cut", h, scope...)
  20883. return e
  20884. }
  20885. func (e *htmlMain) OnDblClick(h EventHandler, scope ...any) HTMLMain {
  20886. e.setEventHandler("dblclick", h, scope...)
  20887. return e
  20888. }
  20889. func (e *htmlMain) OnDrag(h EventHandler, scope ...any) HTMLMain {
  20890. e.setEventHandler("drag", h, scope...)
  20891. return e
  20892. }
  20893. func (e *htmlMain) OnDragEnd(h EventHandler, scope ...any) HTMLMain {
  20894. e.setEventHandler("dragend", h, scope...)
  20895. return e
  20896. }
  20897. func (e *htmlMain) OnDragEnter(h EventHandler, scope ...any) HTMLMain {
  20898. e.setEventHandler("dragenter", h, scope...)
  20899. return e
  20900. }
  20901. func (e *htmlMain) OnDragLeave(h EventHandler, scope ...any) HTMLMain {
  20902. e.setEventHandler("dragleave", h, scope...)
  20903. return e
  20904. }
  20905. func (e *htmlMain) OnDragOver(h EventHandler, scope ...any) HTMLMain {
  20906. e.setEventHandler("dragover", h, scope...)
  20907. return e
  20908. }
  20909. func (e *htmlMain) OnDragStart(h EventHandler, scope ...any) HTMLMain {
  20910. e.setEventHandler("dragstart", h, scope...)
  20911. return e
  20912. }
  20913. func (e *htmlMain) OnDrop(h EventHandler, scope ...any) HTMLMain {
  20914. e.setEventHandler("drop", h, scope...)
  20915. return e
  20916. }
  20917. func (e *htmlMain) OnFocus(h EventHandler, scope ...any) HTMLMain {
  20918. e.setEventHandler("focus", h, scope...)
  20919. return e
  20920. }
  20921. func (e *htmlMain) OnInput(h EventHandler, scope ...any) HTMLMain {
  20922. e.setEventHandler("input", h, scope...)
  20923. return e
  20924. }
  20925. func (e *htmlMain) OnInvalid(h EventHandler, scope ...any) HTMLMain {
  20926. e.setEventHandler("invalid", h, scope...)
  20927. return e
  20928. }
  20929. func (e *htmlMain) OnKeyDown(h EventHandler, scope ...any) HTMLMain {
  20930. e.setEventHandler("keydown", h, scope...)
  20931. return e
  20932. }
  20933. func (e *htmlMain) OnKeyPress(h EventHandler, scope ...any) HTMLMain {
  20934. e.setEventHandler("keypress", h, scope...)
  20935. return e
  20936. }
  20937. func (e *htmlMain) OnKeyUp(h EventHandler, scope ...any) HTMLMain {
  20938. e.setEventHandler("keyup", h, scope...)
  20939. return e
  20940. }
  20941. func (e *htmlMain) OnMouseDown(h EventHandler, scope ...any) HTMLMain {
  20942. e.setEventHandler("mousedown", h, scope...)
  20943. return e
  20944. }
  20945. func (e *htmlMain) OnMouseMove(h EventHandler, scope ...any) HTMLMain {
  20946. e.setEventHandler("mousemove", h, scope...)
  20947. return e
  20948. }
  20949. func (e *htmlMain) OnMouseOut(h EventHandler, scope ...any) HTMLMain {
  20950. e.setEventHandler("mouseout", h, scope...)
  20951. return e
  20952. }
  20953. func (e *htmlMain) OnMouseOver(h EventHandler, scope ...any) HTMLMain {
  20954. e.setEventHandler("mouseover", h, scope...)
  20955. return e
  20956. }
  20957. func (e *htmlMain) OnMouseUp(h EventHandler, scope ...any) HTMLMain {
  20958. e.setEventHandler("mouseup", h, scope...)
  20959. return e
  20960. }
  20961. func (e *htmlMain) OnPaste(h EventHandler, scope ...any) HTMLMain {
  20962. e.setEventHandler("paste", h, scope...)
  20963. return e
  20964. }
  20965. func (e *htmlMain) OnReset(h EventHandler, scope ...any) HTMLMain {
  20966. e.setEventHandler("reset", h, scope...)
  20967. return e
  20968. }
  20969. func (e *htmlMain) OnScroll(h EventHandler, scope ...any) HTMLMain {
  20970. e.setEventHandler("scroll", h, scope...)
  20971. return e
  20972. }
  20973. func (e *htmlMain) OnSearch(h EventHandler, scope ...any) HTMLMain {
  20974. e.setEventHandler("search", h, scope...)
  20975. return e
  20976. }
  20977. func (e *htmlMain) OnSelect(h EventHandler, scope ...any) HTMLMain {
  20978. e.setEventHandler("select", h, scope...)
  20979. return e
  20980. }
  20981. func (e *htmlMain) OnSubmit(h EventHandler, scope ...any) HTMLMain {
  20982. e.setEventHandler("submit", h, scope...)
  20983. return e
  20984. }
  20985. func (e *htmlMain) OnWheel(h EventHandler, scope ...any) HTMLMain {
  20986. e.setEventHandler("wheel", h, scope...)
  20987. return e
  20988. }
  20989. // HTMLMap is the interface that describes a "map" HTML element.
  20990. type HTMLMap interface {
  20991. UI
  20992. // Body set the content of the element.
  20993. Body(elems ...UI) HTMLMap
  20994. // Text sets the content of the element with a text node containing the stringified given value.
  20995. Text(v any) HTMLMap
  20996. // AccessKey specifies a shortcut key to activate/focus an element.
  20997. AccessKey(v string) HTMLMap
  20998. // Aria stores accessible rich internet applications (ARIA) data.
  20999. Aria(k string, v any) HTMLMap
  21000. // Attr sets the named attribute with the given value.
  21001. Attr(n string, v any) HTMLMap
  21002. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  21003. Class(v ...string) HTMLMap
  21004. // ContentEditable specifies whether the content of an element is editable or not.
  21005. ContentEditable(v bool) HTMLMap
  21006. // DataSet stores custom data private to the page or application.
  21007. DataSet(k string, v any) HTMLMap
  21008. // Dir specifies the text direction for the content in an element.
  21009. Dir(v string) HTMLMap
  21010. // Draggable specifies whether an element is draggable or not.
  21011. Draggable(v bool) HTMLMap
  21012. // Hidden specifies that an element is not yet, or is no longer relevant.
  21013. Hidden(v bool) HTMLMap
  21014. // ID specifies a unique id for an element.
  21015. ID(v string) HTMLMap
  21016. // Lang specifies the language of the element's content.
  21017. Lang(v string) HTMLMap
  21018. // Name specifies the name of the element.
  21019. Name(v string) HTMLMap
  21020. // Role specifies to parsing software the exact function of an element (and its children).
  21021. Role(v string) HTMLMap
  21022. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  21023. Spellcheck(v bool) HTMLMap
  21024. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  21025. Style(k, v string) HTMLMap
  21026. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  21027. Styles(s map[string]string) HTMLMap
  21028. // TabIndex specifies the tabbing order of an element.
  21029. TabIndex(v int) HTMLMap
  21030. // Title specifies extra information about an element.
  21031. Title(v string) HTMLMap
  21032. // On registers the given event handler to the specified event.
  21033. On(event string, h EventHandler, scope ...any) HTMLMap
  21034. // OnBlur calls the given handler when the element loses focus.
  21035. OnBlur(h EventHandler, scope ...any) HTMLMap
  21036. // OnChange calls the given handler when the value of the element is changed.
  21037. OnChange(h EventHandler, scope ...any) HTMLMap
  21038. // OnClick calls the given handler when there is a mouse click on the element.
  21039. OnClick(h EventHandler, scope ...any) HTMLMap
  21040. // OnContextMenu calls the given handler when a context menu is triggered.
  21041. OnContextMenu(h EventHandler, scope ...any) HTMLMap
  21042. // OnCopy calls the given handler when the user copies the content of an element.
  21043. OnCopy(h EventHandler, scope ...any) HTMLMap
  21044. // OnCut calls the given handler when the user cuts the content of an element.
  21045. OnCut(h EventHandler, scope ...any) HTMLMap
  21046. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  21047. OnDblClick(h EventHandler, scope ...any) HTMLMap
  21048. // OnDrag calls the given handler when an element is dragged.
  21049. OnDrag(h EventHandler, scope ...any) HTMLMap
  21050. // OnDragEnd calls the given handler at the end of a drag operation.
  21051. OnDragEnd(h EventHandler, scope ...any) HTMLMap
  21052. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  21053. OnDragEnter(h EventHandler, scope ...any) HTMLMap
  21054. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  21055. OnDragLeave(h EventHandler, scope ...any) HTMLMap
  21056. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  21057. OnDragOver(h EventHandler, scope ...any) HTMLMap
  21058. // OnDragStart calls the given handler at the start of a drag operation.
  21059. OnDragStart(h EventHandler, scope ...any) HTMLMap
  21060. // OnDrop calls the given handler when dragged element is being dropped.
  21061. OnDrop(h EventHandler, scope ...any) HTMLMap
  21062. // OnFocus calls the given handler when the element gets focus.
  21063. OnFocus(h EventHandler, scope ...any) HTMLMap
  21064. // OnInput calls the given handler when an element gets user input.
  21065. OnInput(h EventHandler, scope ...any) HTMLMap
  21066. // OnInvalid calls the given handler when an element is invalid.
  21067. OnInvalid(h EventHandler, scope ...any) HTMLMap
  21068. // OnKeyDown calls the given handler when a user is pressing a key.
  21069. OnKeyDown(h EventHandler, scope ...any) HTMLMap
  21070. // OnKeyPress calls the given handler when a user presses a key.
  21071. OnKeyPress(h EventHandler, scope ...any) HTMLMap
  21072. // OnKeyUp calls the given handler when a user releases a key.
  21073. OnKeyUp(h EventHandler, scope ...any) HTMLMap
  21074. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  21075. OnMouseDown(h EventHandler, scope ...any) HTMLMap
  21076. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  21077. OnMouseMove(h EventHandler, scope ...any) HTMLMap
  21078. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  21079. OnMouseOut(h EventHandler, scope ...any) HTMLMap
  21080. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  21081. OnMouseOver(h EventHandler, scope ...any) HTMLMap
  21082. // OnMouseUp calls the given handler when a mouse button is released over an element.
  21083. OnMouseUp(h EventHandler, scope ...any) HTMLMap
  21084. // OnPaste calls the given handler when the user pastes some content in an element.
  21085. OnPaste(h EventHandler, scope ...any) HTMLMap
  21086. // OnReset calls the given handler when the Reset button in a form is clicked.
  21087. OnReset(h EventHandler, scope ...any) HTMLMap
  21088. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  21089. OnScroll(h EventHandler, scope ...any) HTMLMap
  21090. // OnSearch calls the given handler when the user writes something in a search field.
  21091. OnSearch(h EventHandler, scope ...any) HTMLMap
  21092. // OnSelect calls the given handler after some text has been selected in an element.
  21093. OnSelect(h EventHandler, scope ...any) HTMLMap
  21094. // OnSubmit calls the given handler when a form is submitted.
  21095. OnSubmit(h EventHandler, scope ...any) HTMLMap
  21096. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  21097. OnWheel(h EventHandler, scope ...any) HTMLMap
  21098. }
  21099. // Map returns an HTML element that defines a client-side image-map.
  21100. func Map() HTMLMap {
  21101. e := &htmlMap{
  21102. htmlElement: htmlElement{
  21103. tag: "map",
  21104. isSelfClosing: false,
  21105. },
  21106. }
  21107. return e
  21108. }
  21109. type htmlMap struct {
  21110. htmlElement
  21111. }
  21112. func (e *htmlMap) Body(v ...UI) HTMLMap {
  21113. e.setChildren(v...)
  21114. return e
  21115. }
  21116. func (e *htmlMap) Text(v any) HTMLMap {
  21117. return e.Body(Text(v))
  21118. }
  21119. func (e *htmlMap) AccessKey(v string) HTMLMap {
  21120. e.setAttr("accesskey", v)
  21121. return e
  21122. }
  21123. func (e *htmlMap) Aria(k string, v any) HTMLMap {
  21124. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  21125. return e
  21126. }
  21127. func (e *htmlMap) Attr(n string, v any) HTMLMap {
  21128. e.setAttr(n, v)
  21129. return e
  21130. }
  21131. func (e *htmlMap) Class(v ...string) HTMLMap {
  21132. e.setAttr("class", strings.Join(v, " "))
  21133. return e
  21134. }
  21135. func (e *htmlMap) ContentEditable(v bool) HTMLMap {
  21136. e.setAttr("contenteditable", v)
  21137. return e
  21138. }
  21139. func (e *htmlMap) DataSet(k string, v any) HTMLMap {
  21140. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  21141. return e
  21142. }
  21143. func (e *htmlMap) Dir(v string) HTMLMap {
  21144. e.setAttr("dir", v)
  21145. return e
  21146. }
  21147. func (e *htmlMap) Draggable(v bool) HTMLMap {
  21148. e.setAttr("draggable", v)
  21149. return e
  21150. }
  21151. func (e *htmlMap) Hidden(v bool) HTMLMap {
  21152. e.setAttr("hidden", v)
  21153. return e
  21154. }
  21155. func (e *htmlMap) ID(v string) HTMLMap {
  21156. e.setAttr("id", v)
  21157. return e
  21158. }
  21159. func (e *htmlMap) Lang(v string) HTMLMap {
  21160. e.setAttr("lang", v)
  21161. return e
  21162. }
  21163. func (e *htmlMap) Name(v string) HTMLMap {
  21164. e.setAttr("name", v)
  21165. return e
  21166. }
  21167. func (e *htmlMap) Role(v string) HTMLMap {
  21168. e.setAttr("role", v)
  21169. return e
  21170. }
  21171. func (e *htmlMap) Spellcheck(v bool) HTMLMap {
  21172. s := "false"
  21173. if v {
  21174. s = "true"
  21175. }
  21176. e.setAttr("spellcheck", s)
  21177. return e
  21178. }
  21179. func (e *htmlMap) Style(k, v string) HTMLMap {
  21180. e.setAttr("style", k+":"+v)
  21181. return e
  21182. }
  21183. func (e *htmlMap) Styles(s map[string]string) HTMLMap {
  21184. for k, v := range s {
  21185. e.Style(k, v)
  21186. }
  21187. return e
  21188. }
  21189. func (e *htmlMap) TabIndex(v int) HTMLMap {
  21190. e.setAttr("tabindex", v)
  21191. return e
  21192. }
  21193. func (e *htmlMap) Title(v string) HTMLMap {
  21194. e.setAttr("title", v)
  21195. return e
  21196. }
  21197. func (e *htmlMap) On(event string, h EventHandler, scope ...any) HTMLMap {
  21198. e.setEventHandler(event, h, scope...)
  21199. return e
  21200. }
  21201. func (e *htmlMap) OnBlur(h EventHandler, scope ...any) HTMLMap {
  21202. e.setEventHandler("blur", h, scope...)
  21203. return e
  21204. }
  21205. func (e *htmlMap) OnChange(h EventHandler, scope ...any) HTMLMap {
  21206. e.setEventHandler("change", h, scope...)
  21207. return e
  21208. }
  21209. func (e *htmlMap) OnClick(h EventHandler, scope ...any) HTMLMap {
  21210. e.setEventHandler("click", h, scope...)
  21211. return e
  21212. }
  21213. func (e *htmlMap) OnContextMenu(h EventHandler, scope ...any) HTMLMap {
  21214. e.setEventHandler("contextmenu", h, scope...)
  21215. return e
  21216. }
  21217. func (e *htmlMap) OnCopy(h EventHandler, scope ...any) HTMLMap {
  21218. e.setEventHandler("copy", h, scope...)
  21219. return e
  21220. }
  21221. func (e *htmlMap) OnCut(h EventHandler, scope ...any) HTMLMap {
  21222. e.setEventHandler("cut", h, scope...)
  21223. return e
  21224. }
  21225. func (e *htmlMap) OnDblClick(h EventHandler, scope ...any) HTMLMap {
  21226. e.setEventHandler("dblclick", h, scope...)
  21227. return e
  21228. }
  21229. func (e *htmlMap) OnDrag(h EventHandler, scope ...any) HTMLMap {
  21230. e.setEventHandler("drag", h, scope...)
  21231. return e
  21232. }
  21233. func (e *htmlMap) OnDragEnd(h EventHandler, scope ...any) HTMLMap {
  21234. e.setEventHandler("dragend", h, scope...)
  21235. return e
  21236. }
  21237. func (e *htmlMap) OnDragEnter(h EventHandler, scope ...any) HTMLMap {
  21238. e.setEventHandler("dragenter", h, scope...)
  21239. return e
  21240. }
  21241. func (e *htmlMap) OnDragLeave(h EventHandler, scope ...any) HTMLMap {
  21242. e.setEventHandler("dragleave", h, scope...)
  21243. return e
  21244. }
  21245. func (e *htmlMap) OnDragOver(h EventHandler, scope ...any) HTMLMap {
  21246. e.setEventHandler("dragover", h, scope...)
  21247. return e
  21248. }
  21249. func (e *htmlMap) OnDragStart(h EventHandler, scope ...any) HTMLMap {
  21250. e.setEventHandler("dragstart", h, scope...)
  21251. return e
  21252. }
  21253. func (e *htmlMap) OnDrop(h EventHandler, scope ...any) HTMLMap {
  21254. e.setEventHandler("drop", h, scope...)
  21255. return e
  21256. }
  21257. func (e *htmlMap) OnFocus(h EventHandler, scope ...any) HTMLMap {
  21258. e.setEventHandler("focus", h, scope...)
  21259. return e
  21260. }
  21261. func (e *htmlMap) OnInput(h EventHandler, scope ...any) HTMLMap {
  21262. e.setEventHandler("input", h, scope...)
  21263. return e
  21264. }
  21265. func (e *htmlMap) OnInvalid(h EventHandler, scope ...any) HTMLMap {
  21266. e.setEventHandler("invalid", h, scope...)
  21267. return e
  21268. }
  21269. func (e *htmlMap) OnKeyDown(h EventHandler, scope ...any) HTMLMap {
  21270. e.setEventHandler("keydown", h, scope...)
  21271. return e
  21272. }
  21273. func (e *htmlMap) OnKeyPress(h EventHandler, scope ...any) HTMLMap {
  21274. e.setEventHandler("keypress", h, scope...)
  21275. return e
  21276. }
  21277. func (e *htmlMap) OnKeyUp(h EventHandler, scope ...any) HTMLMap {
  21278. e.setEventHandler("keyup", h, scope...)
  21279. return e
  21280. }
  21281. func (e *htmlMap) OnMouseDown(h EventHandler, scope ...any) HTMLMap {
  21282. e.setEventHandler("mousedown", h, scope...)
  21283. return e
  21284. }
  21285. func (e *htmlMap) OnMouseMove(h EventHandler, scope ...any) HTMLMap {
  21286. e.setEventHandler("mousemove", h, scope...)
  21287. return e
  21288. }
  21289. func (e *htmlMap) OnMouseOut(h EventHandler, scope ...any) HTMLMap {
  21290. e.setEventHandler("mouseout", h, scope...)
  21291. return e
  21292. }
  21293. func (e *htmlMap) OnMouseOver(h EventHandler, scope ...any) HTMLMap {
  21294. e.setEventHandler("mouseover", h, scope...)
  21295. return e
  21296. }
  21297. func (e *htmlMap) OnMouseUp(h EventHandler, scope ...any) HTMLMap {
  21298. e.setEventHandler("mouseup", h, scope...)
  21299. return e
  21300. }
  21301. func (e *htmlMap) OnPaste(h EventHandler, scope ...any) HTMLMap {
  21302. e.setEventHandler("paste", h, scope...)
  21303. return e
  21304. }
  21305. func (e *htmlMap) OnReset(h EventHandler, scope ...any) HTMLMap {
  21306. e.setEventHandler("reset", h, scope...)
  21307. return e
  21308. }
  21309. func (e *htmlMap) OnScroll(h EventHandler, scope ...any) HTMLMap {
  21310. e.setEventHandler("scroll", h, scope...)
  21311. return e
  21312. }
  21313. func (e *htmlMap) OnSearch(h EventHandler, scope ...any) HTMLMap {
  21314. e.setEventHandler("search", h, scope...)
  21315. return e
  21316. }
  21317. func (e *htmlMap) OnSelect(h EventHandler, scope ...any) HTMLMap {
  21318. e.setEventHandler("select", h, scope...)
  21319. return e
  21320. }
  21321. func (e *htmlMap) OnSubmit(h EventHandler, scope ...any) HTMLMap {
  21322. e.setEventHandler("submit", h, scope...)
  21323. return e
  21324. }
  21325. func (e *htmlMap) OnWheel(h EventHandler, scope ...any) HTMLMap {
  21326. e.setEventHandler("wheel", h, scope...)
  21327. return e
  21328. }
  21329. // HTMLMark is the interface that describes a "mark" HTML element.
  21330. type HTMLMark interface {
  21331. UI
  21332. // Body set the content of the element.
  21333. Body(elems ...UI) HTMLMark
  21334. // Text sets the content of the element with a text node containing the stringified given value.
  21335. Text(v any) HTMLMark
  21336. // AccessKey specifies a shortcut key to activate/focus an element.
  21337. AccessKey(v string) HTMLMark
  21338. // Aria stores accessible rich internet applications (ARIA) data.
  21339. Aria(k string, v any) HTMLMark
  21340. // Attr sets the named attribute with the given value.
  21341. Attr(n string, v any) HTMLMark
  21342. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  21343. Class(v ...string) HTMLMark
  21344. // ContentEditable specifies whether the content of an element is editable or not.
  21345. ContentEditable(v bool) HTMLMark
  21346. // DataSet stores custom data private to the page or application.
  21347. DataSet(k string, v any) HTMLMark
  21348. // Dir specifies the text direction for the content in an element.
  21349. Dir(v string) HTMLMark
  21350. // Draggable specifies whether an element is draggable or not.
  21351. Draggable(v bool) HTMLMark
  21352. // Hidden specifies that an element is not yet, or is no longer relevant.
  21353. Hidden(v bool) HTMLMark
  21354. // ID specifies a unique id for an element.
  21355. ID(v string) HTMLMark
  21356. // Lang specifies the language of the element's content.
  21357. Lang(v string) HTMLMark
  21358. // Role specifies to parsing software the exact function of an element (and its children).
  21359. Role(v string) HTMLMark
  21360. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  21361. Spellcheck(v bool) HTMLMark
  21362. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  21363. Style(k, v string) HTMLMark
  21364. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  21365. Styles(s map[string]string) HTMLMark
  21366. // TabIndex specifies the tabbing order of an element.
  21367. TabIndex(v int) HTMLMark
  21368. // Title specifies extra information about an element.
  21369. Title(v string) HTMLMark
  21370. // On registers the given event handler to the specified event.
  21371. On(event string, h EventHandler, scope ...any) HTMLMark
  21372. // OnBlur calls the given handler when the element loses focus.
  21373. OnBlur(h EventHandler, scope ...any) HTMLMark
  21374. // OnChange calls the given handler when the value of the element is changed.
  21375. OnChange(h EventHandler, scope ...any) HTMLMark
  21376. // OnClick calls the given handler when there is a mouse click on the element.
  21377. OnClick(h EventHandler, scope ...any) HTMLMark
  21378. // OnContextMenu calls the given handler when a context menu is triggered.
  21379. OnContextMenu(h EventHandler, scope ...any) HTMLMark
  21380. // OnCopy calls the given handler when the user copies the content of an element.
  21381. OnCopy(h EventHandler, scope ...any) HTMLMark
  21382. // OnCut calls the given handler when the user cuts the content of an element.
  21383. OnCut(h EventHandler, scope ...any) HTMLMark
  21384. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  21385. OnDblClick(h EventHandler, scope ...any) HTMLMark
  21386. // OnDrag calls the given handler when an element is dragged.
  21387. OnDrag(h EventHandler, scope ...any) HTMLMark
  21388. // OnDragEnd calls the given handler at the end of a drag operation.
  21389. OnDragEnd(h EventHandler, scope ...any) HTMLMark
  21390. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  21391. OnDragEnter(h EventHandler, scope ...any) HTMLMark
  21392. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  21393. OnDragLeave(h EventHandler, scope ...any) HTMLMark
  21394. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  21395. OnDragOver(h EventHandler, scope ...any) HTMLMark
  21396. // OnDragStart calls the given handler at the start of a drag operation.
  21397. OnDragStart(h EventHandler, scope ...any) HTMLMark
  21398. // OnDrop calls the given handler when dragged element is being dropped.
  21399. OnDrop(h EventHandler, scope ...any) HTMLMark
  21400. // OnFocus calls the given handler when the element gets focus.
  21401. OnFocus(h EventHandler, scope ...any) HTMLMark
  21402. // OnInput calls the given handler when an element gets user input.
  21403. OnInput(h EventHandler, scope ...any) HTMLMark
  21404. // OnInvalid calls the given handler when an element is invalid.
  21405. OnInvalid(h EventHandler, scope ...any) HTMLMark
  21406. // OnKeyDown calls the given handler when a user is pressing a key.
  21407. OnKeyDown(h EventHandler, scope ...any) HTMLMark
  21408. // OnKeyPress calls the given handler when a user presses a key.
  21409. OnKeyPress(h EventHandler, scope ...any) HTMLMark
  21410. // OnKeyUp calls the given handler when a user releases a key.
  21411. OnKeyUp(h EventHandler, scope ...any) HTMLMark
  21412. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  21413. OnMouseDown(h EventHandler, scope ...any) HTMLMark
  21414. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  21415. OnMouseMove(h EventHandler, scope ...any) HTMLMark
  21416. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  21417. OnMouseOut(h EventHandler, scope ...any) HTMLMark
  21418. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  21419. OnMouseOver(h EventHandler, scope ...any) HTMLMark
  21420. // OnMouseUp calls the given handler when a mouse button is released over an element.
  21421. OnMouseUp(h EventHandler, scope ...any) HTMLMark
  21422. // OnPaste calls the given handler when the user pastes some content in an element.
  21423. OnPaste(h EventHandler, scope ...any) HTMLMark
  21424. // OnReset calls the given handler when the Reset button in a form is clicked.
  21425. OnReset(h EventHandler, scope ...any) HTMLMark
  21426. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  21427. OnScroll(h EventHandler, scope ...any) HTMLMark
  21428. // OnSearch calls the given handler when the user writes something in a search field.
  21429. OnSearch(h EventHandler, scope ...any) HTMLMark
  21430. // OnSelect calls the given handler after some text has been selected in an element.
  21431. OnSelect(h EventHandler, scope ...any) HTMLMark
  21432. // OnSubmit calls the given handler when a form is submitted.
  21433. OnSubmit(h EventHandler, scope ...any) HTMLMark
  21434. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  21435. OnWheel(h EventHandler, scope ...any) HTMLMark
  21436. }
  21437. // Mark returns an HTML element that defines marked/highlighted text.
  21438. func Mark() HTMLMark {
  21439. e := &htmlMark{
  21440. htmlElement: htmlElement{
  21441. tag: "mark",
  21442. isSelfClosing: false,
  21443. },
  21444. }
  21445. return e
  21446. }
  21447. type htmlMark struct {
  21448. htmlElement
  21449. }
  21450. func (e *htmlMark) Body(v ...UI) HTMLMark {
  21451. e.setChildren(v...)
  21452. return e
  21453. }
  21454. func (e *htmlMark) Text(v any) HTMLMark {
  21455. return e.Body(Text(v))
  21456. }
  21457. func (e *htmlMark) AccessKey(v string) HTMLMark {
  21458. e.setAttr("accesskey", v)
  21459. return e
  21460. }
  21461. func (e *htmlMark) Aria(k string, v any) HTMLMark {
  21462. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  21463. return e
  21464. }
  21465. func (e *htmlMark) Attr(n string, v any) HTMLMark {
  21466. e.setAttr(n, v)
  21467. return e
  21468. }
  21469. func (e *htmlMark) Class(v ...string) HTMLMark {
  21470. e.setAttr("class", strings.Join(v, " "))
  21471. return e
  21472. }
  21473. func (e *htmlMark) ContentEditable(v bool) HTMLMark {
  21474. e.setAttr("contenteditable", v)
  21475. return e
  21476. }
  21477. func (e *htmlMark) DataSet(k string, v any) HTMLMark {
  21478. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  21479. return e
  21480. }
  21481. func (e *htmlMark) Dir(v string) HTMLMark {
  21482. e.setAttr("dir", v)
  21483. return e
  21484. }
  21485. func (e *htmlMark) Draggable(v bool) HTMLMark {
  21486. e.setAttr("draggable", v)
  21487. return e
  21488. }
  21489. func (e *htmlMark) Hidden(v bool) HTMLMark {
  21490. e.setAttr("hidden", v)
  21491. return e
  21492. }
  21493. func (e *htmlMark) ID(v string) HTMLMark {
  21494. e.setAttr("id", v)
  21495. return e
  21496. }
  21497. func (e *htmlMark) Lang(v string) HTMLMark {
  21498. e.setAttr("lang", v)
  21499. return e
  21500. }
  21501. func (e *htmlMark) Role(v string) HTMLMark {
  21502. e.setAttr("role", v)
  21503. return e
  21504. }
  21505. func (e *htmlMark) Spellcheck(v bool) HTMLMark {
  21506. s := "false"
  21507. if v {
  21508. s = "true"
  21509. }
  21510. e.setAttr("spellcheck", s)
  21511. return e
  21512. }
  21513. func (e *htmlMark) Style(k, v string) HTMLMark {
  21514. e.setAttr("style", k+":"+v)
  21515. return e
  21516. }
  21517. func (e *htmlMark) Styles(s map[string]string) HTMLMark {
  21518. for k, v := range s {
  21519. e.Style(k, v)
  21520. }
  21521. return e
  21522. }
  21523. func (e *htmlMark) TabIndex(v int) HTMLMark {
  21524. e.setAttr("tabindex", v)
  21525. return e
  21526. }
  21527. func (e *htmlMark) Title(v string) HTMLMark {
  21528. e.setAttr("title", v)
  21529. return e
  21530. }
  21531. func (e *htmlMark) On(event string, h EventHandler, scope ...any) HTMLMark {
  21532. e.setEventHandler(event, h, scope...)
  21533. return e
  21534. }
  21535. func (e *htmlMark) OnBlur(h EventHandler, scope ...any) HTMLMark {
  21536. e.setEventHandler("blur", h, scope...)
  21537. return e
  21538. }
  21539. func (e *htmlMark) OnChange(h EventHandler, scope ...any) HTMLMark {
  21540. e.setEventHandler("change", h, scope...)
  21541. return e
  21542. }
  21543. func (e *htmlMark) OnClick(h EventHandler, scope ...any) HTMLMark {
  21544. e.setEventHandler("click", h, scope...)
  21545. return e
  21546. }
  21547. func (e *htmlMark) OnContextMenu(h EventHandler, scope ...any) HTMLMark {
  21548. e.setEventHandler("contextmenu", h, scope...)
  21549. return e
  21550. }
  21551. func (e *htmlMark) OnCopy(h EventHandler, scope ...any) HTMLMark {
  21552. e.setEventHandler("copy", h, scope...)
  21553. return e
  21554. }
  21555. func (e *htmlMark) OnCut(h EventHandler, scope ...any) HTMLMark {
  21556. e.setEventHandler("cut", h, scope...)
  21557. return e
  21558. }
  21559. func (e *htmlMark) OnDblClick(h EventHandler, scope ...any) HTMLMark {
  21560. e.setEventHandler("dblclick", h, scope...)
  21561. return e
  21562. }
  21563. func (e *htmlMark) OnDrag(h EventHandler, scope ...any) HTMLMark {
  21564. e.setEventHandler("drag", h, scope...)
  21565. return e
  21566. }
  21567. func (e *htmlMark) OnDragEnd(h EventHandler, scope ...any) HTMLMark {
  21568. e.setEventHandler("dragend", h, scope...)
  21569. return e
  21570. }
  21571. func (e *htmlMark) OnDragEnter(h EventHandler, scope ...any) HTMLMark {
  21572. e.setEventHandler("dragenter", h, scope...)
  21573. return e
  21574. }
  21575. func (e *htmlMark) OnDragLeave(h EventHandler, scope ...any) HTMLMark {
  21576. e.setEventHandler("dragleave", h, scope...)
  21577. return e
  21578. }
  21579. func (e *htmlMark) OnDragOver(h EventHandler, scope ...any) HTMLMark {
  21580. e.setEventHandler("dragover", h, scope...)
  21581. return e
  21582. }
  21583. func (e *htmlMark) OnDragStart(h EventHandler, scope ...any) HTMLMark {
  21584. e.setEventHandler("dragstart", h, scope...)
  21585. return e
  21586. }
  21587. func (e *htmlMark) OnDrop(h EventHandler, scope ...any) HTMLMark {
  21588. e.setEventHandler("drop", h, scope...)
  21589. return e
  21590. }
  21591. func (e *htmlMark) OnFocus(h EventHandler, scope ...any) HTMLMark {
  21592. e.setEventHandler("focus", h, scope...)
  21593. return e
  21594. }
  21595. func (e *htmlMark) OnInput(h EventHandler, scope ...any) HTMLMark {
  21596. e.setEventHandler("input", h, scope...)
  21597. return e
  21598. }
  21599. func (e *htmlMark) OnInvalid(h EventHandler, scope ...any) HTMLMark {
  21600. e.setEventHandler("invalid", h, scope...)
  21601. return e
  21602. }
  21603. func (e *htmlMark) OnKeyDown(h EventHandler, scope ...any) HTMLMark {
  21604. e.setEventHandler("keydown", h, scope...)
  21605. return e
  21606. }
  21607. func (e *htmlMark) OnKeyPress(h EventHandler, scope ...any) HTMLMark {
  21608. e.setEventHandler("keypress", h, scope...)
  21609. return e
  21610. }
  21611. func (e *htmlMark) OnKeyUp(h EventHandler, scope ...any) HTMLMark {
  21612. e.setEventHandler("keyup", h, scope...)
  21613. return e
  21614. }
  21615. func (e *htmlMark) OnMouseDown(h EventHandler, scope ...any) HTMLMark {
  21616. e.setEventHandler("mousedown", h, scope...)
  21617. return e
  21618. }
  21619. func (e *htmlMark) OnMouseMove(h EventHandler, scope ...any) HTMLMark {
  21620. e.setEventHandler("mousemove", h, scope...)
  21621. return e
  21622. }
  21623. func (e *htmlMark) OnMouseOut(h EventHandler, scope ...any) HTMLMark {
  21624. e.setEventHandler("mouseout", h, scope...)
  21625. return e
  21626. }
  21627. func (e *htmlMark) OnMouseOver(h EventHandler, scope ...any) HTMLMark {
  21628. e.setEventHandler("mouseover", h, scope...)
  21629. return e
  21630. }
  21631. func (e *htmlMark) OnMouseUp(h EventHandler, scope ...any) HTMLMark {
  21632. e.setEventHandler("mouseup", h, scope...)
  21633. return e
  21634. }
  21635. func (e *htmlMark) OnPaste(h EventHandler, scope ...any) HTMLMark {
  21636. e.setEventHandler("paste", h, scope...)
  21637. return e
  21638. }
  21639. func (e *htmlMark) OnReset(h EventHandler, scope ...any) HTMLMark {
  21640. e.setEventHandler("reset", h, scope...)
  21641. return e
  21642. }
  21643. func (e *htmlMark) OnScroll(h EventHandler, scope ...any) HTMLMark {
  21644. e.setEventHandler("scroll", h, scope...)
  21645. return e
  21646. }
  21647. func (e *htmlMark) OnSearch(h EventHandler, scope ...any) HTMLMark {
  21648. e.setEventHandler("search", h, scope...)
  21649. return e
  21650. }
  21651. func (e *htmlMark) OnSelect(h EventHandler, scope ...any) HTMLMark {
  21652. e.setEventHandler("select", h, scope...)
  21653. return e
  21654. }
  21655. func (e *htmlMark) OnSubmit(h EventHandler, scope ...any) HTMLMark {
  21656. e.setEventHandler("submit", h, scope...)
  21657. return e
  21658. }
  21659. func (e *htmlMark) OnWheel(h EventHandler, scope ...any) HTMLMark {
  21660. e.setEventHandler("wheel", h, scope...)
  21661. return e
  21662. }
  21663. // HTMLMeta is the interface that describes a "meta" HTML element.
  21664. type HTMLMeta interface {
  21665. UI
  21666. // AccessKey specifies a shortcut key to activate/focus an element.
  21667. AccessKey(v string) HTMLMeta
  21668. // Aria stores accessible rich internet applications (ARIA) data.
  21669. Aria(k string, v any) HTMLMeta
  21670. // Attr sets the named attribute with the given value.
  21671. Attr(n string, v any) HTMLMeta
  21672. // Charset specifies the character encoding.
  21673. Charset(v string) HTMLMeta
  21674. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  21675. Class(v ...string) HTMLMeta
  21676. // Content gives the value associated with the http-equiv or name attribute.
  21677. Content(v string) HTMLMeta
  21678. // ContentEditable specifies whether the content of an element is editable or not.
  21679. ContentEditable(v bool) HTMLMeta
  21680. // DataSet stores custom data private to the page or application.
  21681. DataSet(k string, v any) HTMLMeta
  21682. // Dir specifies the text direction for the content in an element.
  21683. Dir(v string) HTMLMeta
  21684. // Draggable specifies whether an element is draggable or not.
  21685. Draggable(v bool) HTMLMeta
  21686. // HTTPEquiv provides an HTTP header for the information/value of the content attribute.
  21687. HTTPEquiv(v string) HTMLMeta
  21688. // Hidden specifies that an element is not yet, or is no longer relevant.
  21689. Hidden(v bool) HTMLMeta
  21690. // ID specifies a unique id for an element.
  21691. ID(v string) HTMLMeta
  21692. // Lang specifies the language of the element's content.
  21693. Lang(v string) HTMLMeta
  21694. // Name specifies the name of the element.
  21695. Name(v string) HTMLMeta
  21696. // Property specifies the property name.
  21697. Property(v string) HTMLMeta
  21698. // Role specifies to parsing software the exact function of an element (and its children).
  21699. Role(v string) HTMLMeta
  21700. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  21701. Spellcheck(v bool) HTMLMeta
  21702. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  21703. Style(k, v string) HTMLMeta
  21704. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  21705. Styles(s map[string]string) HTMLMeta
  21706. // TabIndex specifies the tabbing order of an element.
  21707. TabIndex(v int) HTMLMeta
  21708. // Title specifies extra information about an element.
  21709. Title(v string) HTMLMeta
  21710. // On registers the given event handler to the specified event.
  21711. On(event string, h EventHandler, scope ...any) HTMLMeta
  21712. }
  21713. // Meta returns an HTML element that .
  21714. func Meta() HTMLMeta {
  21715. e := &htmlMeta{
  21716. htmlElement: htmlElement{
  21717. tag: "meta",
  21718. isSelfClosing: true,
  21719. },
  21720. }
  21721. return e
  21722. }
  21723. type htmlMeta struct {
  21724. htmlElement
  21725. }
  21726. func (e *htmlMeta) AccessKey(v string) HTMLMeta {
  21727. e.setAttr("accesskey", v)
  21728. return e
  21729. }
  21730. func (e *htmlMeta) Aria(k string, v any) HTMLMeta {
  21731. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  21732. return e
  21733. }
  21734. func (e *htmlMeta) Attr(n string, v any) HTMLMeta {
  21735. e.setAttr(n, v)
  21736. return e
  21737. }
  21738. func (e *htmlMeta) Charset(v string) HTMLMeta {
  21739. e.setAttr("charset", v)
  21740. return e
  21741. }
  21742. func (e *htmlMeta) Class(v ...string) HTMLMeta {
  21743. e.setAttr("class", strings.Join(v, " "))
  21744. return e
  21745. }
  21746. func (e *htmlMeta) Content(v string) HTMLMeta {
  21747. e.setAttr("content", v)
  21748. return e
  21749. }
  21750. func (e *htmlMeta) ContentEditable(v bool) HTMLMeta {
  21751. e.setAttr("contenteditable", v)
  21752. return e
  21753. }
  21754. func (e *htmlMeta) DataSet(k string, v any) HTMLMeta {
  21755. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  21756. return e
  21757. }
  21758. func (e *htmlMeta) Dir(v string) HTMLMeta {
  21759. e.setAttr("dir", v)
  21760. return e
  21761. }
  21762. func (e *htmlMeta) Draggable(v bool) HTMLMeta {
  21763. e.setAttr("draggable", v)
  21764. return e
  21765. }
  21766. func (e *htmlMeta) HTTPEquiv(v string) HTMLMeta {
  21767. e.setAttr("http-equiv", v)
  21768. return e
  21769. }
  21770. func (e *htmlMeta) Hidden(v bool) HTMLMeta {
  21771. e.setAttr("hidden", v)
  21772. return e
  21773. }
  21774. func (e *htmlMeta) ID(v string) HTMLMeta {
  21775. e.setAttr("id", v)
  21776. return e
  21777. }
  21778. func (e *htmlMeta) Lang(v string) HTMLMeta {
  21779. e.setAttr("lang", v)
  21780. return e
  21781. }
  21782. func (e *htmlMeta) Name(v string) HTMLMeta {
  21783. e.setAttr("name", v)
  21784. return e
  21785. }
  21786. func (e *htmlMeta) Property(v string) HTMLMeta {
  21787. e.setAttr("property", v)
  21788. return e
  21789. }
  21790. func (e *htmlMeta) Role(v string) HTMLMeta {
  21791. e.setAttr("role", v)
  21792. return e
  21793. }
  21794. func (e *htmlMeta) Spellcheck(v bool) HTMLMeta {
  21795. s := "false"
  21796. if v {
  21797. s = "true"
  21798. }
  21799. e.setAttr("spellcheck", s)
  21800. return e
  21801. }
  21802. func (e *htmlMeta) Style(k, v string) HTMLMeta {
  21803. e.setAttr("style", k+":"+v)
  21804. return e
  21805. }
  21806. func (e *htmlMeta) Styles(s map[string]string) HTMLMeta {
  21807. for k, v := range s {
  21808. e.Style(k, v)
  21809. }
  21810. return e
  21811. }
  21812. func (e *htmlMeta) TabIndex(v int) HTMLMeta {
  21813. e.setAttr("tabindex", v)
  21814. return e
  21815. }
  21816. func (e *htmlMeta) Title(v string) HTMLMeta {
  21817. e.setAttr("title", v)
  21818. return e
  21819. }
  21820. func (e *htmlMeta) On(event string, h EventHandler, scope ...any) HTMLMeta {
  21821. e.setEventHandler(event, h, scope...)
  21822. return e
  21823. }
  21824. // HTMLMeter is the interface that describes a "meter" HTML element.
  21825. type HTMLMeter interface {
  21826. UI
  21827. // Body set the content of the element.
  21828. Body(elems ...UI) HTMLMeter
  21829. // Text sets the content of the element with a text node containing the stringified given value.
  21830. Text(v any) HTMLMeter
  21831. // AccessKey specifies a shortcut key to activate/focus an element.
  21832. AccessKey(v string) HTMLMeter
  21833. // Aria stores accessible rich internet applications (ARIA) data.
  21834. Aria(k string, v any) HTMLMeter
  21835. // Attr sets the named attribute with the given value.
  21836. Attr(n string, v any) HTMLMeter
  21837. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  21838. Class(v ...string) HTMLMeter
  21839. // ContentEditable specifies whether the content of an element is editable or not.
  21840. ContentEditable(v bool) HTMLMeter
  21841. // DataSet stores custom data private to the page or application.
  21842. DataSet(k string, v any) HTMLMeter
  21843. // Dir specifies the text direction for the content in an element.
  21844. Dir(v string) HTMLMeter
  21845. // Draggable specifies whether an element is draggable or not.
  21846. Draggable(v bool) HTMLMeter
  21847. // Form specifies the name of the form the element belongs to.
  21848. Form(v string) HTMLMeter
  21849. // Hidden specifies that an element is not yet, or is no longer relevant.
  21850. Hidden(v bool) HTMLMeter
  21851. // High specifies the range that is considered to be a high value.
  21852. High(v float64) HTMLMeter
  21853. // ID specifies a unique id for an element.
  21854. ID(v string) HTMLMeter
  21855. // Lang specifies the language of the element's content.
  21856. Lang(v string) HTMLMeter
  21857. // Low specifies the range that is considered to be a low value.
  21858. Low(v float64) HTMLMeter
  21859. // Max Specifies the maximum value.
  21860. Max(v any) HTMLMeter
  21861. // Min specifies a minimum value.
  21862. Min(v any) HTMLMeter
  21863. // Optimum specifies what value is the optimal value for the gauge.
  21864. Optimum(v float64) HTMLMeter
  21865. // Role specifies to parsing software the exact function of an element (and its children).
  21866. Role(v string) HTMLMeter
  21867. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  21868. Spellcheck(v bool) HTMLMeter
  21869. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  21870. Style(k, v string) HTMLMeter
  21871. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  21872. Styles(s map[string]string) HTMLMeter
  21873. // TabIndex specifies the tabbing order of an element.
  21874. TabIndex(v int) HTMLMeter
  21875. // Title specifies extra information about an element.
  21876. Title(v string) HTMLMeter
  21877. // Value specifies the value of the element.
  21878. Value(v any) HTMLMeter
  21879. // On registers the given event handler to the specified event.
  21880. On(event string, h EventHandler, scope ...any) HTMLMeter
  21881. // OnBlur calls the given handler when the element loses focus.
  21882. OnBlur(h EventHandler, scope ...any) HTMLMeter
  21883. // OnChange calls the given handler when the value of the element is changed.
  21884. OnChange(h EventHandler, scope ...any) HTMLMeter
  21885. // OnClick calls the given handler when there is a mouse click on the element.
  21886. OnClick(h EventHandler, scope ...any) HTMLMeter
  21887. // OnContextMenu calls the given handler when a context menu is triggered.
  21888. OnContextMenu(h EventHandler, scope ...any) HTMLMeter
  21889. // OnCopy calls the given handler when the user copies the content of an element.
  21890. OnCopy(h EventHandler, scope ...any) HTMLMeter
  21891. // OnCut calls the given handler when the user cuts the content of an element.
  21892. OnCut(h EventHandler, scope ...any) HTMLMeter
  21893. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  21894. OnDblClick(h EventHandler, scope ...any) HTMLMeter
  21895. // OnDrag calls the given handler when an element is dragged.
  21896. OnDrag(h EventHandler, scope ...any) HTMLMeter
  21897. // OnDragEnd calls the given handler at the end of a drag operation.
  21898. OnDragEnd(h EventHandler, scope ...any) HTMLMeter
  21899. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  21900. OnDragEnter(h EventHandler, scope ...any) HTMLMeter
  21901. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  21902. OnDragLeave(h EventHandler, scope ...any) HTMLMeter
  21903. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  21904. OnDragOver(h EventHandler, scope ...any) HTMLMeter
  21905. // OnDragStart calls the given handler at the start of a drag operation.
  21906. OnDragStart(h EventHandler, scope ...any) HTMLMeter
  21907. // OnDrop calls the given handler when dragged element is being dropped.
  21908. OnDrop(h EventHandler, scope ...any) HTMLMeter
  21909. // OnFocus calls the given handler when the element gets focus.
  21910. OnFocus(h EventHandler, scope ...any) HTMLMeter
  21911. // OnInput calls the given handler when an element gets user input.
  21912. OnInput(h EventHandler, scope ...any) HTMLMeter
  21913. // OnInvalid calls the given handler when an element is invalid.
  21914. OnInvalid(h EventHandler, scope ...any) HTMLMeter
  21915. // OnKeyDown calls the given handler when a user is pressing a key.
  21916. OnKeyDown(h EventHandler, scope ...any) HTMLMeter
  21917. // OnKeyPress calls the given handler when a user presses a key.
  21918. OnKeyPress(h EventHandler, scope ...any) HTMLMeter
  21919. // OnKeyUp calls the given handler when a user releases a key.
  21920. OnKeyUp(h EventHandler, scope ...any) HTMLMeter
  21921. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  21922. OnMouseDown(h EventHandler, scope ...any) HTMLMeter
  21923. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  21924. OnMouseMove(h EventHandler, scope ...any) HTMLMeter
  21925. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  21926. OnMouseOut(h EventHandler, scope ...any) HTMLMeter
  21927. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  21928. OnMouseOver(h EventHandler, scope ...any) HTMLMeter
  21929. // OnMouseUp calls the given handler when a mouse button is released over an element.
  21930. OnMouseUp(h EventHandler, scope ...any) HTMLMeter
  21931. // OnPaste calls the given handler when the user pastes some content in an element.
  21932. OnPaste(h EventHandler, scope ...any) HTMLMeter
  21933. // OnReset calls the given handler when the Reset button in a form is clicked.
  21934. OnReset(h EventHandler, scope ...any) HTMLMeter
  21935. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  21936. OnScroll(h EventHandler, scope ...any) HTMLMeter
  21937. // OnSearch calls the given handler when the user writes something in a search field.
  21938. OnSearch(h EventHandler, scope ...any) HTMLMeter
  21939. // OnSelect calls the given handler after some text has been selected in an element.
  21940. OnSelect(h EventHandler, scope ...any) HTMLMeter
  21941. // OnSubmit calls the given handler when a form is submitted.
  21942. OnSubmit(h EventHandler, scope ...any) HTMLMeter
  21943. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  21944. OnWheel(h EventHandler, scope ...any) HTMLMeter
  21945. }
  21946. // Meter returns an HTML element that defines a scalar measurement within a known range (a gauge).
  21947. func Meter() HTMLMeter {
  21948. e := &htmlMeter{
  21949. htmlElement: htmlElement{
  21950. tag: "meter",
  21951. isSelfClosing: false,
  21952. },
  21953. }
  21954. return e
  21955. }
  21956. type htmlMeter struct {
  21957. htmlElement
  21958. }
  21959. func (e *htmlMeter) Body(v ...UI) HTMLMeter {
  21960. e.setChildren(v...)
  21961. return e
  21962. }
  21963. func (e *htmlMeter) Text(v any) HTMLMeter {
  21964. return e.Body(Text(v))
  21965. }
  21966. func (e *htmlMeter) AccessKey(v string) HTMLMeter {
  21967. e.setAttr("accesskey", v)
  21968. return e
  21969. }
  21970. func (e *htmlMeter) Aria(k string, v any) HTMLMeter {
  21971. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  21972. return e
  21973. }
  21974. func (e *htmlMeter) Attr(n string, v any) HTMLMeter {
  21975. e.setAttr(n, v)
  21976. return e
  21977. }
  21978. func (e *htmlMeter) Class(v ...string) HTMLMeter {
  21979. e.setAttr("class", strings.Join(v, " "))
  21980. return e
  21981. }
  21982. func (e *htmlMeter) ContentEditable(v bool) HTMLMeter {
  21983. e.setAttr("contenteditable", v)
  21984. return e
  21985. }
  21986. func (e *htmlMeter) DataSet(k string, v any) HTMLMeter {
  21987. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  21988. return e
  21989. }
  21990. func (e *htmlMeter) Dir(v string) HTMLMeter {
  21991. e.setAttr("dir", v)
  21992. return e
  21993. }
  21994. func (e *htmlMeter) Draggable(v bool) HTMLMeter {
  21995. e.setAttr("draggable", v)
  21996. return e
  21997. }
  21998. func (e *htmlMeter) Form(v string) HTMLMeter {
  21999. e.setAttr("form", v)
  22000. return e
  22001. }
  22002. func (e *htmlMeter) Hidden(v bool) HTMLMeter {
  22003. e.setAttr("hidden", v)
  22004. return e
  22005. }
  22006. func (e *htmlMeter) High(v float64) HTMLMeter {
  22007. e.setAttr("high", v)
  22008. return e
  22009. }
  22010. func (e *htmlMeter) ID(v string) HTMLMeter {
  22011. e.setAttr("id", v)
  22012. return e
  22013. }
  22014. func (e *htmlMeter) Lang(v string) HTMLMeter {
  22015. e.setAttr("lang", v)
  22016. return e
  22017. }
  22018. func (e *htmlMeter) Low(v float64) HTMLMeter {
  22019. e.setAttr("low", v)
  22020. return e
  22021. }
  22022. func (e *htmlMeter) Max(v any) HTMLMeter {
  22023. e.setAttr("max", v)
  22024. return e
  22025. }
  22026. func (e *htmlMeter) Min(v any) HTMLMeter {
  22027. e.setAttr("min", v)
  22028. return e
  22029. }
  22030. func (e *htmlMeter) Optimum(v float64) HTMLMeter {
  22031. e.setAttr("optimum", v)
  22032. return e
  22033. }
  22034. func (e *htmlMeter) Role(v string) HTMLMeter {
  22035. e.setAttr("role", v)
  22036. return e
  22037. }
  22038. func (e *htmlMeter) Spellcheck(v bool) HTMLMeter {
  22039. s := "false"
  22040. if v {
  22041. s = "true"
  22042. }
  22043. e.setAttr("spellcheck", s)
  22044. return e
  22045. }
  22046. func (e *htmlMeter) Style(k, v string) HTMLMeter {
  22047. e.setAttr("style", k+":"+v)
  22048. return e
  22049. }
  22050. func (e *htmlMeter) Styles(s map[string]string) HTMLMeter {
  22051. for k, v := range s {
  22052. e.Style(k, v)
  22053. }
  22054. return e
  22055. }
  22056. func (e *htmlMeter) TabIndex(v int) HTMLMeter {
  22057. e.setAttr("tabindex", v)
  22058. return e
  22059. }
  22060. func (e *htmlMeter) Title(v string) HTMLMeter {
  22061. e.setAttr("title", v)
  22062. return e
  22063. }
  22064. func (e *htmlMeter) Value(v any) HTMLMeter {
  22065. e.setAttr("value", v)
  22066. return e
  22067. }
  22068. func (e *htmlMeter) On(event string, h EventHandler, scope ...any) HTMLMeter {
  22069. e.setEventHandler(event, h, scope...)
  22070. return e
  22071. }
  22072. func (e *htmlMeter) OnBlur(h EventHandler, scope ...any) HTMLMeter {
  22073. e.setEventHandler("blur", h, scope...)
  22074. return e
  22075. }
  22076. func (e *htmlMeter) OnChange(h EventHandler, scope ...any) HTMLMeter {
  22077. e.setEventHandler("change", h, scope...)
  22078. return e
  22079. }
  22080. func (e *htmlMeter) OnClick(h EventHandler, scope ...any) HTMLMeter {
  22081. e.setEventHandler("click", h, scope...)
  22082. return e
  22083. }
  22084. func (e *htmlMeter) OnContextMenu(h EventHandler, scope ...any) HTMLMeter {
  22085. e.setEventHandler("contextmenu", h, scope...)
  22086. return e
  22087. }
  22088. func (e *htmlMeter) OnCopy(h EventHandler, scope ...any) HTMLMeter {
  22089. e.setEventHandler("copy", h, scope...)
  22090. return e
  22091. }
  22092. func (e *htmlMeter) OnCut(h EventHandler, scope ...any) HTMLMeter {
  22093. e.setEventHandler("cut", h, scope...)
  22094. return e
  22095. }
  22096. func (e *htmlMeter) OnDblClick(h EventHandler, scope ...any) HTMLMeter {
  22097. e.setEventHandler("dblclick", h, scope...)
  22098. return e
  22099. }
  22100. func (e *htmlMeter) OnDrag(h EventHandler, scope ...any) HTMLMeter {
  22101. e.setEventHandler("drag", h, scope...)
  22102. return e
  22103. }
  22104. func (e *htmlMeter) OnDragEnd(h EventHandler, scope ...any) HTMLMeter {
  22105. e.setEventHandler("dragend", h, scope...)
  22106. return e
  22107. }
  22108. func (e *htmlMeter) OnDragEnter(h EventHandler, scope ...any) HTMLMeter {
  22109. e.setEventHandler("dragenter", h, scope...)
  22110. return e
  22111. }
  22112. func (e *htmlMeter) OnDragLeave(h EventHandler, scope ...any) HTMLMeter {
  22113. e.setEventHandler("dragleave", h, scope...)
  22114. return e
  22115. }
  22116. func (e *htmlMeter) OnDragOver(h EventHandler, scope ...any) HTMLMeter {
  22117. e.setEventHandler("dragover", h, scope...)
  22118. return e
  22119. }
  22120. func (e *htmlMeter) OnDragStart(h EventHandler, scope ...any) HTMLMeter {
  22121. e.setEventHandler("dragstart", h, scope...)
  22122. return e
  22123. }
  22124. func (e *htmlMeter) OnDrop(h EventHandler, scope ...any) HTMLMeter {
  22125. e.setEventHandler("drop", h, scope...)
  22126. return e
  22127. }
  22128. func (e *htmlMeter) OnFocus(h EventHandler, scope ...any) HTMLMeter {
  22129. e.setEventHandler("focus", h, scope...)
  22130. return e
  22131. }
  22132. func (e *htmlMeter) OnInput(h EventHandler, scope ...any) HTMLMeter {
  22133. e.setEventHandler("input", h, scope...)
  22134. return e
  22135. }
  22136. func (e *htmlMeter) OnInvalid(h EventHandler, scope ...any) HTMLMeter {
  22137. e.setEventHandler("invalid", h, scope...)
  22138. return e
  22139. }
  22140. func (e *htmlMeter) OnKeyDown(h EventHandler, scope ...any) HTMLMeter {
  22141. e.setEventHandler("keydown", h, scope...)
  22142. return e
  22143. }
  22144. func (e *htmlMeter) OnKeyPress(h EventHandler, scope ...any) HTMLMeter {
  22145. e.setEventHandler("keypress", h, scope...)
  22146. return e
  22147. }
  22148. func (e *htmlMeter) OnKeyUp(h EventHandler, scope ...any) HTMLMeter {
  22149. e.setEventHandler("keyup", h, scope...)
  22150. return e
  22151. }
  22152. func (e *htmlMeter) OnMouseDown(h EventHandler, scope ...any) HTMLMeter {
  22153. e.setEventHandler("mousedown", h, scope...)
  22154. return e
  22155. }
  22156. func (e *htmlMeter) OnMouseMove(h EventHandler, scope ...any) HTMLMeter {
  22157. e.setEventHandler("mousemove", h, scope...)
  22158. return e
  22159. }
  22160. func (e *htmlMeter) OnMouseOut(h EventHandler, scope ...any) HTMLMeter {
  22161. e.setEventHandler("mouseout", h, scope...)
  22162. return e
  22163. }
  22164. func (e *htmlMeter) OnMouseOver(h EventHandler, scope ...any) HTMLMeter {
  22165. e.setEventHandler("mouseover", h, scope...)
  22166. return e
  22167. }
  22168. func (e *htmlMeter) OnMouseUp(h EventHandler, scope ...any) HTMLMeter {
  22169. e.setEventHandler("mouseup", h, scope...)
  22170. return e
  22171. }
  22172. func (e *htmlMeter) OnPaste(h EventHandler, scope ...any) HTMLMeter {
  22173. e.setEventHandler("paste", h, scope...)
  22174. return e
  22175. }
  22176. func (e *htmlMeter) OnReset(h EventHandler, scope ...any) HTMLMeter {
  22177. e.setEventHandler("reset", h, scope...)
  22178. return e
  22179. }
  22180. func (e *htmlMeter) OnScroll(h EventHandler, scope ...any) HTMLMeter {
  22181. e.setEventHandler("scroll", h, scope...)
  22182. return e
  22183. }
  22184. func (e *htmlMeter) OnSearch(h EventHandler, scope ...any) HTMLMeter {
  22185. e.setEventHandler("search", h, scope...)
  22186. return e
  22187. }
  22188. func (e *htmlMeter) OnSelect(h EventHandler, scope ...any) HTMLMeter {
  22189. e.setEventHandler("select", h, scope...)
  22190. return e
  22191. }
  22192. func (e *htmlMeter) OnSubmit(h EventHandler, scope ...any) HTMLMeter {
  22193. e.setEventHandler("submit", h, scope...)
  22194. return e
  22195. }
  22196. func (e *htmlMeter) OnWheel(h EventHandler, scope ...any) HTMLMeter {
  22197. e.setEventHandler("wheel", h, scope...)
  22198. return e
  22199. }
  22200. // HTMLNav is the interface that describes a "nav" HTML element.
  22201. type HTMLNav interface {
  22202. UI
  22203. // Body set the content of the element.
  22204. Body(elems ...UI) HTMLNav
  22205. // Text sets the content of the element with a text node containing the stringified given value.
  22206. Text(v any) HTMLNav
  22207. // AccessKey specifies a shortcut key to activate/focus an element.
  22208. AccessKey(v string) HTMLNav
  22209. // Aria stores accessible rich internet applications (ARIA) data.
  22210. Aria(k string, v any) HTMLNav
  22211. // Attr sets the named attribute with the given value.
  22212. Attr(n string, v any) HTMLNav
  22213. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  22214. Class(v ...string) HTMLNav
  22215. // ContentEditable specifies whether the content of an element is editable or not.
  22216. ContentEditable(v bool) HTMLNav
  22217. // DataSet stores custom data private to the page or application.
  22218. DataSet(k string, v any) HTMLNav
  22219. // Dir specifies the text direction for the content in an element.
  22220. Dir(v string) HTMLNav
  22221. // Draggable specifies whether an element is draggable or not.
  22222. Draggable(v bool) HTMLNav
  22223. // Hidden specifies that an element is not yet, or is no longer relevant.
  22224. Hidden(v bool) HTMLNav
  22225. // ID specifies a unique id for an element.
  22226. ID(v string) HTMLNav
  22227. // Lang specifies the language of the element's content.
  22228. Lang(v string) HTMLNav
  22229. // Role specifies to parsing software the exact function of an element (and its children).
  22230. Role(v string) HTMLNav
  22231. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  22232. Spellcheck(v bool) HTMLNav
  22233. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  22234. Style(k, v string) HTMLNav
  22235. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  22236. Styles(s map[string]string) HTMLNav
  22237. // TabIndex specifies the tabbing order of an element.
  22238. TabIndex(v int) HTMLNav
  22239. // Title specifies extra information about an element.
  22240. Title(v string) HTMLNav
  22241. // On registers the given event handler to the specified event.
  22242. On(event string, h EventHandler, scope ...any) HTMLNav
  22243. // OnBlur calls the given handler when the element loses focus.
  22244. OnBlur(h EventHandler, scope ...any) HTMLNav
  22245. // OnChange calls the given handler when the value of the element is changed.
  22246. OnChange(h EventHandler, scope ...any) HTMLNav
  22247. // OnClick calls the given handler when there is a mouse click on the element.
  22248. OnClick(h EventHandler, scope ...any) HTMLNav
  22249. // OnContextMenu calls the given handler when a context menu is triggered.
  22250. OnContextMenu(h EventHandler, scope ...any) HTMLNav
  22251. // OnCopy calls the given handler when the user copies the content of an element.
  22252. OnCopy(h EventHandler, scope ...any) HTMLNav
  22253. // OnCut calls the given handler when the user cuts the content of an element.
  22254. OnCut(h EventHandler, scope ...any) HTMLNav
  22255. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  22256. OnDblClick(h EventHandler, scope ...any) HTMLNav
  22257. // OnDrag calls the given handler when an element is dragged.
  22258. OnDrag(h EventHandler, scope ...any) HTMLNav
  22259. // OnDragEnd calls the given handler at the end of a drag operation.
  22260. OnDragEnd(h EventHandler, scope ...any) HTMLNav
  22261. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  22262. OnDragEnter(h EventHandler, scope ...any) HTMLNav
  22263. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  22264. OnDragLeave(h EventHandler, scope ...any) HTMLNav
  22265. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  22266. OnDragOver(h EventHandler, scope ...any) HTMLNav
  22267. // OnDragStart calls the given handler at the start of a drag operation.
  22268. OnDragStart(h EventHandler, scope ...any) HTMLNav
  22269. // OnDrop calls the given handler when dragged element is being dropped.
  22270. OnDrop(h EventHandler, scope ...any) HTMLNav
  22271. // OnFocus calls the given handler when the element gets focus.
  22272. OnFocus(h EventHandler, scope ...any) HTMLNav
  22273. // OnInput calls the given handler when an element gets user input.
  22274. OnInput(h EventHandler, scope ...any) HTMLNav
  22275. // OnInvalid calls the given handler when an element is invalid.
  22276. OnInvalid(h EventHandler, scope ...any) HTMLNav
  22277. // OnKeyDown calls the given handler when a user is pressing a key.
  22278. OnKeyDown(h EventHandler, scope ...any) HTMLNav
  22279. // OnKeyPress calls the given handler when a user presses a key.
  22280. OnKeyPress(h EventHandler, scope ...any) HTMLNav
  22281. // OnKeyUp calls the given handler when a user releases a key.
  22282. OnKeyUp(h EventHandler, scope ...any) HTMLNav
  22283. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  22284. OnMouseDown(h EventHandler, scope ...any) HTMLNav
  22285. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  22286. OnMouseMove(h EventHandler, scope ...any) HTMLNav
  22287. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  22288. OnMouseOut(h EventHandler, scope ...any) HTMLNav
  22289. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  22290. OnMouseOver(h EventHandler, scope ...any) HTMLNav
  22291. // OnMouseUp calls the given handler when a mouse button is released over an element.
  22292. OnMouseUp(h EventHandler, scope ...any) HTMLNav
  22293. // OnPaste calls the given handler when the user pastes some content in an element.
  22294. OnPaste(h EventHandler, scope ...any) HTMLNav
  22295. // OnReset calls the given handler when the Reset button in a form is clicked.
  22296. OnReset(h EventHandler, scope ...any) HTMLNav
  22297. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  22298. OnScroll(h EventHandler, scope ...any) HTMLNav
  22299. // OnSearch calls the given handler when the user writes something in a search field.
  22300. OnSearch(h EventHandler, scope ...any) HTMLNav
  22301. // OnSelect calls the given handler after some text has been selected in an element.
  22302. OnSelect(h EventHandler, scope ...any) HTMLNav
  22303. // OnSubmit calls the given handler when a form is submitted.
  22304. OnSubmit(h EventHandler, scope ...any) HTMLNav
  22305. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  22306. OnWheel(h EventHandler, scope ...any) HTMLNav
  22307. }
  22308. // Nav returns an HTML element that defines navigation links.
  22309. func Nav() HTMLNav {
  22310. e := &htmlNav{
  22311. htmlElement: htmlElement{
  22312. tag: "nav",
  22313. isSelfClosing: false,
  22314. },
  22315. }
  22316. return e
  22317. }
  22318. type htmlNav struct {
  22319. htmlElement
  22320. }
  22321. func (e *htmlNav) Body(v ...UI) HTMLNav {
  22322. e.setChildren(v...)
  22323. return e
  22324. }
  22325. func (e *htmlNav) Text(v any) HTMLNav {
  22326. return e.Body(Text(v))
  22327. }
  22328. func (e *htmlNav) AccessKey(v string) HTMLNav {
  22329. e.setAttr("accesskey", v)
  22330. return e
  22331. }
  22332. func (e *htmlNav) Aria(k string, v any) HTMLNav {
  22333. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  22334. return e
  22335. }
  22336. func (e *htmlNav) Attr(n string, v any) HTMLNav {
  22337. e.setAttr(n, v)
  22338. return e
  22339. }
  22340. func (e *htmlNav) Class(v ...string) HTMLNav {
  22341. e.setAttr("class", strings.Join(v, " "))
  22342. return e
  22343. }
  22344. func (e *htmlNav) ContentEditable(v bool) HTMLNav {
  22345. e.setAttr("contenteditable", v)
  22346. return e
  22347. }
  22348. func (e *htmlNav) DataSet(k string, v any) HTMLNav {
  22349. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  22350. return e
  22351. }
  22352. func (e *htmlNav) Dir(v string) HTMLNav {
  22353. e.setAttr("dir", v)
  22354. return e
  22355. }
  22356. func (e *htmlNav) Draggable(v bool) HTMLNav {
  22357. e.setAttr("draggable", v)
  22358. return e
  22359. }
  22360. func (e *htmlNav) Hidden(v bool) HTMLNav {
  22361. e.setAttr("hidden", v)
  22362. return e
  22363. }
  22364. func (e *htmlNav) ID(v string) HTMLNav {
  22365. e.setAttr("id", v)
  22366. return e
  22367. }
  22368. func (e *htmlNav) Lang(v string) HTMLNav {
  22369. e.setAttr("lang", v)
  22370. return e
  22371. }
  22372. func (e *htmlNav) Role(v string) HTMLNav {
  22373. e.setAttr("role", v)
  22374. return e
  22375. }
  22376. func (e *htmlNav) Spellcheck(v bool) HTMLNav {
  22377. s := "false"
  22378. if v {
  22379. s = "true"
  22380. }
  22381. e.setAttr("spellcheck", s)
  22382. return e
  22383. }
  22384. func (e *htmlNav) Style(k, v string) HTMLNav {
  22385. e.setAttr("style", k+":"+v)
  22386. return e
  22387. }
  22388. func (e *htmlNav) Styles(s map[string]string) HTMLNav {
  22389. for k, v := range s {
  22390. e.Style(k, v)
  22391. }
  22392. return e
  22393. }
  22394. func (e *htmlNav) TabIndex(v int) HTMLNav {
  22395. e.setAttr("tabindex", v)
  22396. return e
  22397. }
  22398. func (e *htmlNav) Title(v string) HTMLNav {
  22399. e.setAttr("title", v)
  22400. return e
  22401. }
  22402. func (e *htmlNav) On(event string, h EventHandler, scope ...any) HTMLNav {
  22403. e.setEventHandler(event, h, scope...)
  22404. return e
  22405. }
  22406. func (e *htmlNav) OnBlur(h EventHandler, scope ...any) HTMLNav {
  22407. e.setEventHandler("blur", h, scope...)
  22408. return e
  22409. }
  22410. func (e *htmlNav) OnChange(h EventHandler, scope ...any) HTMLNav {
  22411. e.setEventHandler("change", h, scope...)
  22412. return e
  22413. }
  22414. func (e *htmlNav) OnClick(h EventHandler, scope ...any) HTMLNav {
  22415. e.setEventHandler("click", h, scope...)
  22416. return e
  22417. }
  22418. func (e *htmlNav) OnContextMenu(h EventHandler, scope ...any) HTMLNav {
  22419. e.setEventHandler("contextmenu", h, scope...)
  22420. return e
  22421. }
  22422. func (e *htmlNav) OnCopy(h EventHandler, scope ...any) HTMLNav {
  22423. e.setEventHandler("copy", h, scope...)
  22424. return e
  22425. }
  22426. func (e *htmlNav) OnCut(h EventHandler, scope ...any) HTMLNav {
  22427. e.setEventHandler("cut", h, scope...)
  22428. return e
  22429. }
  22430. func (e *htmlNav) OnDblClick(h EventHandler, scope ...any) HTMLNav {
  22431. e.setEventHandler("dblclick", h, scope...)
  22432. return e
  22433. }
  22434. func (e *htmlNav) OnDrag(h EventHandler, scope ...any) HTMLNav {
  22435. e.setEventHandler("drag", h, scope...)
  22436. return e
  22437. }
  22438. func (e *htmlNav) OnDragEnd(h EventHandler, scope ...any) HTMLNav {
  22439. e.setEventHandler("dragend", h, scope...)
  22440. return e
  22441. }
  22442. func (e *htmlNav) OnDragEnter(h EventHandler, scope ...any) HTMLNav {
  22443. e.setEventHandler("dragenter", h, scope...)
  22444. return e
  22445. }
  22446. func (e *htmlNav) OnDragLeave(h EventHandler, scope ...any) HTMLNav {
  22447. e.setEventHandler("dragleave", h, scope...)
  22448. return e
  22449. }
  22450. func (e *htmlNav) OnDragOver(h EventHandler, scope ...any) HTMLNav {
  22451. e.setEventHandler("dragover", h, scope...)
  22452. return e
  22453. }
  22454. func (e *htmlNav) OnDragStart(h EventHandler, scope ...any) HTMLNav {
  22455. e.setEventHandler("dragstart", h, scope...)
  22456. return e
  22457. }
  22458. func (e *htmlNav) OnDrop(h EventHandler, scope ...any) HTMLNav {
  22459. e.setEventHandler("drop", h, scope...)
  22460. return e
  22461. }
  22462. func (e *htmlNav) OnFocus(h EventHandler, scope ...any) HTMLNav {
  22463. e.setEventHandler("focus", h, scope...)
  22464. return e
  22465. }
  22466. func (e *htmlNav) OnInput(h EventHandler, scope ...any) HTMLNav {
  22467. e.setEventHandler("input", h, scope...)
  22468. return e
  22469. }
  22470. func (e *htmlNav) OnInvalid(h EventHandler, scope ...any) HTMLNav {
  22471. e.setEventHandler("invalid", h, scope...)
  22472. return e
  22473. }
  22474. func (e *htmlNav) OnKeyDown(h EventHandler, scope ...any) HTMLNav {
  22475. e.setEventHandler("keydown", h, scope...)
  22476. return e
  22477. }
  22478. func (e *htmlNav) OnKeyPress(h EventHandler, scope ...any) HTMLNav {
  22479. e.setEventHandler("keypress", h, scope...)
  22480. return e
  22481. }
  22482. func (e *htmlNav) OnKeyUp(h EventHandler, scope ...any) HTMLNav {
  22483. e.setEventHandler("keyup", h, scope...)
  22484. return e
  22485. }
  22486. func (e *htmlNav) OnMouseDown(h EventHandler, scope ...any) HTMLNav {
  22487. e.setEventHandler("mousedown", h, scope...)
  22488. return e
  22489. }
  22490. func (e *htmlNav) OnMouseMove(h EventHandler, scope ...any) HTMLNav {
  22491. e.setEventHandler("mousemove", h, scope...)
  22492. return e
  22493. }
  22494. func (e *htmlNav) OnMouseOut(h EventHandler, scope ...any) HTMLNav {
  22495. e.setEventHandler("mouseout", h, scope...)
  22496. return e
  22497. }
  22498. func (e *htmlNav) OnMouseOver(h EventHandler, scope ...any) HTMLNav {
  22499. e.setEventHandler("mouseover", h, scope...)
  22500. return e
  22501. }
  22502. func (e *htmlNav) OnMouseUp(h EventHandler, scope ...any) HTMLNav {
  22503. e.setEventHandler("mouseup", h, scope...)
  22504. return e
  22505. }
  22506. func (e *htmlNav) OnPaste(h EventHandler, scope ...any) HTMLNav {
  22507. e.setEventHandler("paste", h, scope...)
  22508. return e
  22509. }
  22510. func (e *htmlNav) OnReset(h EventHandler, scope ...any) HTMLNav {
  22511. e.setEventHandler("reset", h, scope...)
  22512. return e
  22513. }
  22514. func (e *htmlNav) OnScroll(h EventHandler, scope ...any) HTMLNav {
  22515. e.setEventHandler("scroll", h, scope...)
  22516. return e
  22517. }
  22518. func (e *htmlNav) OnSearch(h EventHandler, scope ...any) HTMLNav {
  22519. e.setEventHandler("search", h, scope...)
  22520. return e
  22521. }
  22522. func (e *htmlNav) OnSelect(h EventHandler, scope ...any) HTMLNav {
  22523. e.setEventHandler("select", h, scope...)
  22524. return e
  22525. }
  22526. func (e *htmlNav) OnSubmit(h EventHandler, scope ...any) HTMLNav {
  22527. e.setEventHandler("submit", h, scope...)
  22528. return e
  22529. }
  22530. func (e *htmlNav) OnWheel(h EventHandler, scope ...any) HTMLNav {
  22531. e.setEventHandler("wheel", h, scope...)
  22532. return e
  22533. }
  22534. // HTMLNoScript is the interface that describes a "noscript" HTML element.
  22535. type HTMLNoScript interface {
  22536. UI
  22537. // Body set the content of the element.
  22538. Body(elems ...UI) HTMLNoScript
  22539. // Text sets the content of the element with a text node containing the stringified given value.
  22540. Text(v any) HTMLNoScript
  22541. // AccessKey specifies a shortcut key to activate/focus an element.
  22542. AccessKey(v string) HTMLNoScript
  22543. // Aria stores accessible rich internet applications (ARIA) data.
  22544. Aria(k string, v any) HTMLNoScript
  22545. // Attr sets the named attribute with the given value.
  22546. Attr(n string, v any) HTMLNoScript
  22547. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  22548. Class(v ...string) HTMLNoScript
  22549. // ContentEditable specifies whether the content of an element is editable or not.
  22550. ContentEditable(v bool) HTMLNoScript
  22551. // DataSet stores custom data private to the page or application.
  22552. DataSet(k string, v any) HTMLNoScript
  22553. // Dir specifies the text direction for the content in an element.
  22554. Dir(v string) HTMLNoScript
  22555. // Draggable specifies whether an element is draggable or not.
  22556. Draggable(v bool) HTMLNoScript
  22557. // Hidden specifies that an element is not yet, or is no longer relevant.
  22558. Hidden(v bool) HTMLNoScript
  22559. // ID specifies a unique id for an element.
  22560. ID(v string) HTMLNoScript
  22561. // Lang specifies the language of the element's content.
  22562. Lang(v string) HTMLNoScript
  22563. // Role specifies to parsing software the exact function of an element (and its children).
  22564. Role(v string) HTMLNoScript
  22565. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  22566. Spellcheck(v bool) HTMLNoScript
  22567. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  22568. Style(k, v string) HTMLNoScript
  22569. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  22570. Styles(s map[string]string) HTMLNoScript
  22571. // TabIndex specifies the tabbing order of an element.
  22572. TabIndex(v int) HTMLNoScript
  22573. // Title specifies extra information about an element.
  22574. Title(v string) HTMLNoScript
  22575. // On registers the given event handler to the specified event.
  22576. On(event string, h EventHandler, scope ...any) HTMLNoScript
  22577. }
  22578. // NoScript returns an HTML element that defines an alternate content for users that do not support client-side scripts.
  22579. func NoScript() HTMLNoScript {
  22580. e := &htmlNoScript{
  22581. htmlElement: htmlElement{
  22582. tag: "noscript",
  22583. isSelfClosing: false,
  22584. },
  22585. }
  22586. return e
  22587. }
  22588. type htmlNoScript struct {
  22589. htmlElement
  22590. }
  22591. func (e *htmlNoScript) Body(v ...UI) HTMLNoScript {
  22592. e.setChildren(v...)
  22593. return e
  22594. }
  22595. func (e *htmlNoScript) Text(v any) HTMLNoScript {
  22596. return e.Body(Text(v))
  22597. }
  22598. func (e *htmlNoScript) AccessKey(v string) HTMLNoScript {
  22599. e.setAttr("accesskey", v)
  22600. return e
  22601. }
  22602. func (e *htmlNoScript) Aria(k string, v any) HTMLNoScript {
  22603. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  22604. return e
  22605. }
  22606. func (e *htmlNoScript) Attr(n string, v any) HTMLNoScript {
  22607. e.setAttr(n, v)
  22608. return e
  22609. }
  22610. func (e *htmlNoScript) Class(v ...string) HTMLNoScript {
  22611. e.setAttr("class", strings.Join(v, " "))
  22612. return e
  22613. }
  22614. func (e *htmlNoScript) ContentEditable(v bool) HTMLNoScript {
  22615. e.setAttr("contenteditable", v)
  22616. return e
  22617. }
  22618. func (e *htmlNoScript) DataSet(k string, v any) HTMLNoScript {
  22619. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  22620. return e
  22621. }
  22622. func (e *htmlNoScript) Dir(v string) HTMLNoScript {
  22623. e.setAttr("dir", v)
  22624. return e
  22625. }
  22626. func (e *htmlNoScript) Draggable(v bool) HTMLNoScript {
  22627. e.setAttr("draggable", v)
  22628. return e
  22629. }
  22630. func (e *htmlNoScript) Hidden(v bool) HTMLNoScript {
  22631. e.setAttr("hidden", v)
  22632. return e
  22633. }
  22634. func (e *htmlNoScript) ID(v string) HTMLNoScript {
  22635. e.setAttr("id", v)
  22636. return e
  22637. }
  22638. func (e *htmlNoScript) Lang(v string) HTMLNoScript {
  22639. e.setAttr("lang", v)
  22640. return e
  22641. }
  22642. func (e *htmlNoScript) Role(v string) HTMLNoScript {
  22643. e.setAttr("role", v)
  22644. return e
  22645. }
  22646. func (e *htmlNoScript) Spellcheck(v bool) HTMLNoScript {
  22647. s := "false"
  22648. if v {
  22649. s = "true"
  22650. }
  22651. e.setAttr("spellcheck", s)
  22652. return e
  22653. }
  22654. func (e *htmlNoScript) Style(k, v string) HTMLNoScript {
  22655. e.setAttr("style", k+":"+v)
  22656. return e
  22657. }
  22658. func (e *htmlNoScript) Styles(s map[string]string) HTMLNoScript {
  22659. for k, v := range s {
  22660. e.Style(k, v)
  22661. }
  22662. return e
  22663. }
  22664. func (e *htmlNoScript) TabIndex(v int) HTMLNoScript {
  22665. e.setAttr("tabindex", v)
  22666. return e
  22667. }
  22668. func (e *htmlNoScript) Title(v string) HTMLNoScript {
  22669. e.setAttr("title", v)
  22670. return e
  22671. }
  22672. func (e *htmlNoScript) On(event string, h EventHandler, scope ...any) HTMLNoScript {
  22673. e.setEventHandler(event, h, scope...)
  22674. return e
  22675. }
  22676. // HTMLObject is the interface that describes a "object" HTML element.
  22677. type HTMLObject interface {
  22678. UI
  22679. // Body set the content of the element.
  22680. Body(elems ...UI) HTMLObject
  22681. // Text sets the content of the element with a text node containing the stringified given value.
  22682. Text(v any) HTMLObject
  22683. // AccessKey specifies a shortcut key to activate/focus an element.
  22684. AccessKey(v string) HTMLObject
  22685. // Aria stores accessible rich internet applications (ARIA) data.
  22686. Aria(k string, v any) HTMLObject
  22687. // Attr sets the named attribute with the given value.
  22688. Attr(n string, v any) HTMLObject
  22689. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  22690. Class(v ...string) HTMLObject
  22691. // ContentEditable specifies whether the content of an element is editable or not.
  22692. ContentEditable(v bool) HTMLObject
  22693. // Data specifies the URL of the resource to be used by the object.
  22694. Data(v string) HTMLObject
  22695. // DataSet stores custom data private to the page or application.
  22696. DataSet(k string, v any) HTMLObject
  22697. // Dir specifies the text direction for the content in an element.
  22698. Dir(v string) HTMLObject
  22699. // Draggable specifies whether an element is draggable or not.
  22700. Draggable(v bool) HTMLObject
  22701. // Form specifies the name of the form the element belongs to.
  22702. Form(v string) HTMLObject
  22703. // Height specifies the height of the element (in pixels).
  22704. Height(v int) HTMLObject
  22705. // Hidden specifies that an element is not yet, or is no longer relevant.
  22706. Hidden(v bool) HTMLObject
  22707. // ID specifies a unique id for an element.
  22708. ID(v string) HTMLObject
  22709. // Lang specifies the language of the element's content.
  22710. Lang(v string) HTMLObject
  22711. // Name specifies the name of the element.
  22712. Name(v string) HTMLObject
  22713. // Role specifies to parsing software the exact function of an element (and its children).
  22714. Role(v string) HTMLObject
  22715. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  22716. Spellcheck(v bool) HTMLObject
  22717. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  22718. Style(k, v string) HTMLObject
  22719. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  22720. Styles(s map[string]string) HTMLObject
  22721. // TabIndex specifies the tabbing order of an element.
  22722. TabIndex(v int) HTMLObject
  22723. // Title specifies extra information about an element.
  22724. Title(v string) HTMLObject
  22725. // Type specifies the type of element.
  22726. Type(v string) HTMLObject
  22727. // UseMap specifies an image as a client-side image-map.
  22728. UseMap(v string) HTMLObject
  22729. // Width specifies the width of the element.
  22730. Width(v int) HTMLObject
  22731. // On registers the given event handler to the specified event.
  22732. On(event string, h EventHandler, scope ...any) HTMLObject
  22733. // OnAbort calls the given handler on abort.
  22734. OnAbort(h EventHandler, scope ...any) HTMLObject
  22735. // OnBlur calls the given handler when the element loses focus.
  22736. OnBlur(h EventHandler, scope ...any) HTMLObject
  22737. // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
  22738. OnCanPlay(h EventHandler, scope ...any) HTMLObject
  22739. // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
  22740. OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject
  22741. // OnChange calls the given handler when the value of the element is changed.
  22742. OnChange(h EventHandler, scope ...any) HTMLObject
  22743. // OnClick calls the given handler when there is a mouse click on the element.
  22744. OnClick(h EventHandler, scope ...any) HTMLObject
  22745. // OnContextMenu calls the given handler when a context menu is triggered.
  22746. OnContextMenu(h EventHandler, scope ...any) HTMLObject
  22747. // OnCopy calls the given handler when the user copies the content of an element.
  22748. OnCopy(h EventHandler, scope ...any) HTMLObject
  22749. // OnCueChange calls the given handler when the cue changes in a track element.
  22750. OnCueChange(h EventHandler, scope ...any) HTMLObject
  22751. // OnCut calls the given handler when the user cuts the content of an element.
  22752. OnCut(h EventHandler, scope ...any) HTMLObject
  22753. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  22754. OnDblClick(h EventHandler, scope ...any) HTMLObject
  22755. // OnDrag calls the given handler when an element is dragged.
  22756. OnDrag(h EventHandler, scope ...any) HTMLObject
  22757. // OnDragEnd calls the given handler at the end of a drag operation.
  22758. OnDragEnd(h EventHandler, scope ...any) HTMLObject
  22759. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  22760. OnDragEnter(h EventHandler, scope ...any) HTMLObject
  22761. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  22762. OnDragLeave(h EventHandler, scope ...any) HTMLObject
  22763. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  22764. OnDragOver(h EventHandler, scope ...any) HTMLObject
  22765. // OnDragStart calls the given handler at the start of a drag operation.
  22766. OnDragStart(h EventHandler, scope ...any) HTMLObject
  22767. // OnDrop calls the given handler when dragged element is being dropped.
  22768. OnDrop(h EventHandler, scope ...any) HTMLObject
  22769. // OnDurationChange calls the given handler when the length of the media changes.
  22770. OnDurationChange(h EventHandler, scope ...any) HTMLObject
  22771. // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
  22772. OnEmptied(h EventHandler, scope ...any) HTMLObject
  22773. // OnEnded calls the given handler when the media has reach the end.
  22774. OnEnded(h EventHandler, scope ...any) HTMLObject
  22775. // OnError calls the given handler when an error occurs.
  22776. OnError(h EventHandler, scope ...any) HTMLObject
  22777. // OnFocus calls the given handler when the element gets focus.
  22778. OnFocus(h EventHandler, scope ...any) HTMLObject
  22779. // OnInput calls the given handler when an element gets user input.
  22780. OnInput(h EventHandler, scope ...any) HTMLObject
  22781. // OnInvalid calls the given handler when an element is invalid.
  22782. OnInvalid(h EventHandler, scope ...any) HTMLObject
  22783. // OnKeyDown calls the given handler when a user is pressing a key.
  22784. OnKeyDown(h EventHandler, scope ...any) HTMLObject
  22785. // OnKeyPress calls the given handler when a user presses a key.
  22786. OnKeyPress(h EventHandler, scope ...any) HTMLObject
  22787. // OnKeyUp calls the given handler when a user releases a key.
  22788. OnKeyUp(h EventHandler, scope ...any) HTMLObject
  22789. // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
  22790. OnLoadStart(h EventHandler, scope ...any) HTMLObject
  22791. // OnLoadedData calls the given handler when media data is loaded.
  22792. OnLoadedData(h EventHandler, scope ...any) HTMLObject
  22793. // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
  22794. OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject
  22795. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  22796. OnMouseDown(h EventHandler, scope ...any) HTMLObject
  22797. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  22798. OnMouseMove(h EventHandler, scope ...any) HTMLObject
  22799. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  22800. OnMouseOut(h EventHandler, scope ...any) HTMLObject
  22801. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  22802. OnMouseOver(h EventHandler, scope ...any) HTMLObject
  22803. // OnMouseUp calls the given handler when a mouse button is released over an element.
  22804. OnMouseUp(h EventHandler, scope ...any) HTMLObject
  22805. // OnPaste calls the given handler when the user pastes some content in an element.
  22806. OnPaste(h EventHandler, scope ...any) HTMLObject
  22807. // OnPause calls the given handler when the media is paused either by the user or programmatically.
  22808. OnPause(h EventHandler, scope ...any) HTMLObject
  22809. // OnPlay calls the given handler when the media is ready to start playing.
  22810. OnPlay(h EventHandler, scope ...any) HTMLObject
  22811. // OnPlaying calls the given handler when the media actually has started playing.
  22812. OnPlaying(h EventHandler, scope ...any) HTMLObject
  22813. // OnProgress calls the given handler when the browser is in the process of getting the media data.
  22814. OnProgress(h EventHandler, scope ...any) HTMLObject
  22815. // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
  22816. OnRateChange(h EventHandler, scope ...any) HTMLObject
  22817. // OnReset calls the given handler when the Reset button in a form is clicked.
  22818. OnReset(h EventHandler, scope ...any) HTMLObject
  22819. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  22820. OnScroll(h EventHandler, scope ...any) HTMLObject
  22821. // OnSearch calls the given handler when the user writes something in a search field.
  22822. OnSearch(h EventHandler, scope ...any) HTMLObject
  22823. // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
  22824. OnSeeked(h EventHandler, scope ...any) HTMLObject
  22825. // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
  22826. OnSeeking(h EventHandler, scope ...any) HTMLObject
  22827. // OnSelect calls the given handler after some text has been selected in an element.
  22828. OnSelect(h EventHandler, scope ...any) HTMLObject
  22829. // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
  22830. OnStalled(h EventHandler, scope ...any) HTMLObject
  22831. // OnSubmit calls the given handler when a form is submitted.
  22832. OnSubmit(h EventHandler, scope ...any) HTMLObject
  22833. // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
  22834. OnSuspend(h EventHandler, scope ...any) HTMLObject
  22835. // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
  22836. OnTimeUpdate(h EventHandler, scope ...any) HTMLObject
  22837. // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
  22838. OnVolumeChange(h EventHandler, scope ...any) HTMLObject
  22839. // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
  22840. OnWaiting(h EventHandler, scope ...any) HTMLObject
  22841. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  22842. OnWheel(h EventHandler, scope ...any) HTMLObject
  22843. }
  22844. // Object returns an HTML element that defines an embedded object.
  22845. func Object() HTMLObject {
  22846. e := &htmlObject{
  22847. htmlElement: htmlElement{
  22848. tag: "object",
  22849. isSelfClosing: false,
  22850. },
  22851. }
  22852. return e
  22853. }
  22854. type htmlObject struct {
  22855. htmlElement
  22856. }
  22857. func (e *htmlObject) Body(v ...UI) HTMLObject {
  22858. e.setChildren(v...)
  22859. return e
  22860. }
  22861. func (e *htmlObject) Text(v any) HTMLObject {
  22862. return e.Body(Text(v))
  22863. }
  22864. func (e *htmlObject) AccessKey(v string) HTMLObject {
  22865. e.setAttr("accesskey", v)
  22866. return e
  22867. }
  22868. func (e *htmlObject) Aria(k string, v any) HTMLObject {
  22869. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  22870. return e
  22871. }
  22872. func (e *htmlObject) Attr(n string, v any) HTMLObject {
  22873. e.setAttr(n, v)
  22874. return e
  22875. }
  22876. func (e *htmlObject) Class(v ...string) HTMLObject {
  22877. e.setAttr("class", strings.Join(v, " "))
  22878. return e
  22879. }
  22880. func (e *htmlObject) ContentEditable(v bool) HTMLObject {
  22881. e.setAttr("contenteditable", v)
  22882. return e
  22883. }
  22884. func (e *htmlObject) Data(v string) HTMLObject {
  22885. e.setAttr("data", v)
  22886. return e
  22887. }
  22888. func (e *htmlObject) DataSet(k string, v any) HTMLObject {
  22889. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  22890. return e
  22891. }
  22892. func (e *htmlObject) Dir(v string) HTMLObject {
  22893. e.setAttr("dir", v)
  22894. return e
  22895. }
  22896. func (e *htmlObject) Draggable(v bool) HTMLObject {
  22897. e.setAttr("draggable", v)
  22898. return e
  22899. }
  22900. func (e *htmlObject) Form(v string) HTMLObject {
  22901. e.setAttr("form", v)
  22902. return e
  22903. }
  22904. func (e *htmlObject) Height(v int) HTMLObject {
  22905. e.setAttr("height", v)
  22906. return e
  22907. }
  22908. func (e *htmlObject) Hidden(v bool) HTMLObject {
  22909. e.setAttr("hidden", v)
  22910. return e
  22911. }
  22912. func (e *htmlObject) ID(v string) HTMLObject {
  22913. e.setAttr("id", v)
  22914. return e
  22915. }
  22916. func (e *htmlObject) Lang(v string) HTMLObject {
  22917. e.setAttr("lang", v)
  22918. return e
  22919. }
  22920. func (e *htmlObject) Name(v string) HTMLObject {
  22921. e.setAttr("name", v)
  22922. return e
  22923. }
  22924. func (e *htmlObject) Role(v string) HTMLObject {
  22925. e.setAttr("role", v)
  22926. return e
  22927. }
  22928. func (e *htmlObject) Spellcheck(v bool) HTMLObject {
  22929. s := "false"
  22930. if v {
  22931. s = "true"
  22932. }
  22933. e.setAttr("spellcheck", s)
  22934. return e
  22935. }
  22936. func (e *htmlObject) Style(k, v string) HTMLObject {
  22937. e.setAttr("style", k+":"+v)
  22938. return e
  22939. }
  22940. func (e *htmlObject) Styles(s map[string]string) HTMLObject {
  22941. for k, v := range s {
  22942. e.Style(k, v)
  22943. }
  22944. return e
  22945. }
  22946. func (e *htmlObject) TabIndex(v int) HTMLObject {
  22947. e.setAttr("tabindex", v)
  22948. return e
  22949. }
  22950. func (e *htmlObject) Title(v string) HTMLObject {
  22951. e.setAttr("title", v)
  22952. return e
  22953. }
  22954. func (e *htmlObject) Type(v string) HTMLObject {
  22955. e.setAttr("type", v)
  22956. return e
  22957. }
  22958. func (e *htmlObject) UseMap(v string) HTMLObject {
  22959. e.setAttr("usemap", v)
  22960. return e
  22961. }
  22962. func (e *htmlObject) Width(v int) HTMLObject {
  22963. e.setAttr("width", v)
  22964. return e
  22965. }
  22966. func (e *htmlObject) On(event string, h EventHandler, scope ...any) HTMLObject {
  22967. e.setEventHandler(event, h, scope...)
  22968. return e
  22969. }
  22970. func (e *htmlObject) OnAbort(h EventHandler, scope ...any) HTMLObject {
  22971. e.setEventHandler("abort", h, scope...)
  22972. return e
  22973. }
  22974. func (e *htmlObject) OnBlur(h EventHandler, scope ...any) HTMLObject {
  22975. e.setEventHandler("blur", h, scope...)
  22976. return e
  22977. }
  22978. func (e *htmlObject) OnCanPlay(h EventHandler, scope ...any) HTMLObject {
  22979. e.setEventHandler("canplay", h, scope...)
  22980. return e
  22981. }
  22982. func (e *htmlObject) OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject {
  22983. e.setEventHandler("canplaythrough", h, scope...)
  22984. return e
  22985. }
  22986. func (e *htmlObject) OnChange(h EventHandler, scope ...any) HTMLObject {
  22987. e.setEventHandler("change", h, scope...)
  22988. return e
  22989. }
  22990. func (e *htmlObject) OnClick(h EventHandler, scope ...any) HTMLObject {
  22991. e.setEventHandler("click", h, scope...)
  22992. return e
  22993. }
  22994. func (e *htmlObject) OnContextMenu(h EventHandler, scope ...any) HTMLObject {
  22995. e.setEventHandler("contextmenu", h, scope...)
  22996. return e
  22997. }
  22998. func (e *htmlObject) OnCopy(h EventHandler, scope ...any) HTMLObject {
  22999. e.setEventHandler("copy", h, scope...)
  23000. return e
  23001. }
  23002. func (e *htmlObject) OnCueChange(h EventHandler, scope ...any) HTMLObject {
  23003. e.setEventHandler("cuechange", h, scope...)
  23004. return e
  23005. }
  23006. func (e *htmlObject) OnCut(h EventHandler, scope ...any) HTMLObject {
  23007. e.setEventHandler("cut", h, scope...)
  23008. return e
  23009. }
  23010. func (e *htmlObject) OnDblClick(h EventHandler, scope ...any) HTMLObject {
  23011. e.setEventHandler("dblclick", h, scope...)
  23012. return e
  23013. }
  23014. func (e *htmlObject) OnDrag(h EventHandler, scope ...any) HTMLObject {
  23015. e.setEventHandler("drag", h, scope...)
  23016. return e
  23017. }
  23018. func (e *htmlObject) OnDragEnd(h EventHandler, scope ...any) HTMLObject {
  23019. e.setEventHandler("dragend", h, scope...)
  23020. return e
  23021. }
  23022. func (e *htmlObject) OnDragEnter(h EventHandler, scope ...any) HTMLObject {
  23023. e.setEventHandler("dragenter", h, scope...)
  23024. return e
  23025. }
  23026. func (e *htmlObject) OnDragLeave(h EventHandler, scope ...any) HTMLObject {
  23027. e.setEventHandler("dragleave", h, scope...)
  23028. return e
  23029. }
  23030. func (e *htmlObject) OnDragOver(h EventHandler, scope ...any) HTMLObject {
  23031. e.setEventHandler("dragover", h, scope...)
  23032. return e
  23033. }
  23034. func (e *htmlObject) OnDragStart(h EventHandler, scope ...any) HTMLObject {
  23035. e.setEventHandler("dragstart", h, scope...)
  23036. return e
  23037. }
  23038. func (e *htmlObject) OnDrop(h EventHandler, scope ...any) HTMLObject {
  23039. e.setEventHandler("drop", h, scope...)
  23040. return e
  23041. }
  23042. func (e *htmlObject) OnDurationChange(h EventHandler, scope ...any) HTMLObject {
  23043. e.setEventHandler("durationchange", h, scope...)
  23044. return e
  23045. }
  23046. func (e *htmlObject) OnEmptied(h EventHandler, scope ...any) HTMLObject {
  23047. e.setEventHandler("emptied", h, scope...)
  23048. return e
  23049. }
  23050. func (e *htmlObject) OnEnded(h EventHandler, scope ...any) HTMLObject {
  23051. e.setEventHandler("ended", h, scope...)
  23052. return e
  23053. }
  23054. func (e *htmlObject) OnError(h EventHandler, scope ...any) HTMLObject {
  23055. e.setEventHandler("error", h, scope...)
  23056. return e
  23057. }
  23058. func (e *htmlObject) OnFocus(h EventHandler, scope ...any) HTMLObject {
  23059. e.setEventHandler("focus", h, scope...)
  23060. return e
  23061. }
  23062. func (e *htmlObject) OnInput(h EventHandler, scope ...any) HTMLObject {
  23063. e.setEventHandler("input", h, scope...)
  23064. return e
  23065. }
  23066. func (e *htmlObject) OnInvalid(h EventHandler, scope ...any) HTMLObject {
  23067. e.setEventHandler("invalid", h, scope...)
  23068. return e
  23069. }
  23070. func (e *htmlObject) OnKeyDown(h EventHandler, scope ...any) HTMLObject {
  23071. e.setEventHandler("keydown", h, scope...)
  23072. return e
  23073. }
  23074. func (e *htmlObject) OnKeyPress(h EventHandler, scope ...any) HTMLObject {
  23075. e.setEventHandler("keypress", h, scope...)
  23076. return e
  23077. }
  23078. func (e *htmlObject) OnKeyUp(h EventHandler, scope ...any) HTMLObject {
  23079. e.setEventHandler("keyup", h, scope...)
  23080. return e
  23081. }
  23082. func (e *htmlObject) OnLoadStart(h EventHandler, scope ...any) HTMLObject {
  23083. e.setEventHandler("loadstart", h, scope...)
  23084. return e
  23085. }
  23086. func (e *htmlObject) OnLoadedData(h EventHandler, scope ...any) HTMLObject {
  23087. e.setEventHandler("loadeddata", h, scope...)
  23088. return e
  23089. }
  23090. func (e *htmlObject) OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject {
  23091. e.setEventHandler("loadedmetadata", h, scope...)
  23092. return e
  23093. }
  23094. func (e *htmlObject) OnMouseDown(h EventHandler, scope ...any) HTMLObject {
  23095. e.setEventHandler("mousedown", h, scope...)
  23096. return e
  23097. }
  23098. func (e *htmlObject) OnMouseMove(h EventHandler, scope ...any) HTMLObject {
  23099. e.setEventHandler("mousemove", h, scope...)
  23100. return e
  23101. }
  23102. func (e *htmlObject) OnMouseOut(h EventHandler, scope ...any) HTMLObject {
  23103. e.setEventHandler("mouseout", h, scope...)
  23104. return e
  23105. }
  23106. func (e *htmlObject) OnMouseOver(h EventHandler, scope ...any) HTMLObject {
  23107. e.setEventHandler("mouseover", h, scope...)
  23108. return e
  23109. }
  23110. func (e *htmlObject) OnMouseUp(h EventHandler, scope ...any) HTMLObject {
  23111. e.setEventHandler("mouseup", h, scope...)
  23112. return e
  23113. }
  23114. func (e *htmlObject) OnPaste(h EventHandler, scope ...any) HTMLObject {
  23115. e.setEventHandler("paste", h, scope...)
  23116. return e
  23117. }
  23118. func (e *htmlObject) OnPause(h EventHandler, scope ...any) HTMLObject {
  23119. e.setEventHandler("pause", h, scope...)
  23120. return e
  23121. }
  23122. func (e *htmlObject) OnPlay(h EventHandler, scope ...any) HTMLObject {
  23123. e.setEventHandler("play", h, scope...)
  23124. return e
  23125. }
  23126. func (e *htmlObject) OnPlaying(h EventHandler, scope ...any) HTMLObject {
  23127. e.setEventHandler("playing", h, scope...)
  23128. return e
  23129. }
  23130. func (e *htmlObject) OnProgress(h EventHandler, scope ...any) HTMLObject {
  23131. e.setEventHandler("progress", h, scope...)
  23132. return e
  23133. }
  23134. func (e *htmlObject) OnRateChange(h EventHandler, scope ...any) HTMLObject {
  23135. e.setEventHandler("ratechange", h, scope...)
  23136. return e
  23137. }
  23138. func (e *htmlObject) OnReset(h EventHandler, scope ...any) HTMLObject {
  23139. e.setEventHandler("reset", h, scope...)
  23140. return e
  23141. }
  23142. func (e *htmlObject) OnScroll(h EventHandler, scope ...any) HTMLObject {
  23143. e.setEventHandler("scroll", h, scope...)
  23144. return e
  23145. }
  23146. func (e *htmlObject) OnSearch(h EventHandler, scope ...any) HTMLObject {
  23147. e.setEventHandler("search", h, scope...)
  23148. return e
  23149. }
  23150. func (e *htmlObject) OnSeeked(h EventHandler, scope ...any) HTMLObject {
  23151. e.setEventHandler("seeked", h, scope...)
  23152. return e
  23153. }
  23154. func (e *htmlObject) OnSeeking(h EventHandler, scope ...any) HTMLObject {
  23155. e.setEventHandler("seeking", h, scope...)
  23156. return e
  23157. }
  23158. func (e *htmlObject) OnSelect(h EventHandler, scope ...any) HTMLObject {
  23159. e.setEventHandler("select", h, scope...)
  23160. return e
  23161. }
  23162. func (e *htmlObject) OnStalled(h EventHandler, scope ...any) HTMLObject {
  23163. e.setEventHandler("stalled", h, scope...)
  23164. return e
  23165. }
  23166. func (e *htmlObject) OnSubmit(h EventHandler, scope ...any) HTMLObject {
  23167. e.setEventHandler("submit", h, scope...)
  23168. return e
  23169. }
  23170. func (e *htmlObject) OnSuspend(h EventHandler, scope ...any) HTMLObject {
  23171. e.setEventHandler("suspend", h, scope...)
  23172. return e
  23173. }
  23174. func (e *htmlObject) OnTimeUpdate(h EventHandler, scope ...any) HTMLObject {
  23175. e.setEventHandler("timeupdate", h, scope...)
  23176. return e
  23177. }
  23178. func (e *htmlObject) OnVolumeChange(h EventHandler, scope ...any) HTMLObject {
  23179. e.setEventHandler("volumechange", h, scope...)
  23180. return e
  23181. }
  23182. func (e *htmlObject) OnWaiting(h EventHandler, scope ...any) HTMLObject {
  23183. e.setEventHandler("waiting", h, scope...)
  23184. return e
  23185. }
  23186. func (e *htmlObject) OnWheel(h EventHandler, scope ...any) HTMLObject {
  23187. e.setEventHandler("wheel", h, scope...)
  23188. return e
  23189. }
  23190. // HTMLOl is the interface that describes a "ol" HTML element.
  23191. type HTMLOl interface {
  23192. UI
  23193. // Body set the content of the element.
  23194. Body(elems ...UI) HTMLOl
  23195. // Text sets the content of the element with a text node containing the stringified given value.
  23196. Text(v any) HTMLOl
  23197. // AccessKey specifies a shortcut key to activate/focus an element.
  23198. AccessKey(v string) HTMLOl
  23199. // Aria stores accessible rich internet applications (ARIA) data.
  23200. Aria(k string, v any) HTMLOl
  23201. // Attr sets the named attribute with the given value.
  23202. Attr(n string, v any) HTMLOl
  23203. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  23204. Class(v ...string) HTMLOl
  23205. // ContentEditable specifies whether the content of an element is editable or not.
  23206. ContentEditable(v bool) HTMLOl
  23207. // DataSet stores custom data private to the page or application.
  23208. DataSet(k string, v any) HTMLOl
  23209. // Dir specifies the text direction for the content in an element.
  23210. Dir(v string) HTMLOl
  23211. // Draggable specifies whether an element is draggable or not.
  23212. Draggable(v bool) HTMLOl
  23213. // Hidden specifies that an element is not yet, or is no longer relevant.
  23214. Hidden(v bool) HTMLOl
  23215. // ID specifies a unique id for an element.
  23216. ID(v string) HTMLOl
  23217. // Lang specifies the language of the element's content.
  23218. Lang(v string) HTMLOl
  23219. // Reversed specifies that the list order should be descending (9,8,7...).
  23220. Reversed(v bool) HTMLOl
  23221. // Role specifies to parsing software the exact function of an element (and its children).
  23222. Role(v string) HTMLOl
  23223. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  23224. Spellcheck(v bool) HTMLOl
  23225. // Start specifies the start value of the ordered list.
  23226. Start(v int) HTMLOl
  23227. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  23228. Style(k, v string) HTMLOl
  23229. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  23230. Styles(s map[string]string) HTMLOl
  23231. // TabIndex specifies the tabbing order of an element.
  23232. TabIndex(v int) HTMLOl
  23233. // Title specifies extra information about an element.
  23234. Title(v string) HTMLOl
  23235. // Type specifies the type of element.
  23236. Type(v string) HTMLOl
  23237. // On registers the given event handler to the specified event.
  23238. On(event string, h EventHandler, scope ...any) HTMLOl
  23239. // OnBlur calls the given handler when the element loses focus.
  23240. OnBlur(h EventHandler, scope ...any) HTMLOl
  23241. // OnChange calls the given handler when the value of the element is changed.
  23242. OnChange(h EventHandler, scope ...any) HTMLOl
  23243. // OnClick calls the given handler when there is a mouse click on the element.
  23244. OnClick(h EventHandler, scope ...any) HTMLOl
  23245. // OnContextMenu calls the given handler when a context menu is triggered.
  23246. OnContextMenu(h EventHandler, scope ...any) HTMLOl
  23247. // OnCopy calls the given handler when the user copies the content of an element.
  23248. OnCopy(h EventHandler, scope ...any) HTMLOl
  23249. // OnCut calls the given handler when the user cuts the content of an element.
  23250. OnCut(h EventHandler, scope ...any) HTMLOl
  23251. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  23252. OnDblClick(h EventHandler, scope ...any) HTMLOl
  23253. // OnDrag calls the given handler when an element is dragged.
  23254. OnDrag(h EventHandler, scope ...any) HTMLOl
  23255. // OnDragEnd calls the given handler at the end of a drag operation.
  23256. OnDragEnd(h EventHandler, scope ...any) HTMLOl
  23257. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  23258. OnDragEnter(h EventHandler, scope ...any) HTMLOl
  23259. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  23260. OnDragLeave(h EventHandler, scope ...any) HTMLOl
  23261. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  23262. OnDragOver(h EventHandler, scope ...any) HTMLOl
  23263. // OnDragStart calls the given handler at the start of a drag operation.
  23264. OnDragStart(h EventHandler, scope ...any) HTMLOl
  23265. // OnDrop calls the given handler when dragged element is being dropped.
  23266. OnDrop(h EventHandler, scope ...any) HTMLOl
  23267. // OnFocus calls the given handler when the element gets focus.
  23268. OnFocus(h EventHandler, scope ...any) HTMLOl
  23269. // OnInput calls the given handler when an element gets user input.
  23270. OnInput(h EventHandler, scope ...any) HTMLOl
  23271. // OnInvalid calls the given handler when an element is invalid.
  23272. OnInvalid(h EventHandler, scope ...any) HTMLOl
  23273. // OnKeyDown calls the given handler when a user is pressing a key.
  23274. OnKeyDown(h EventHandler, scope ...any) HTMLOl
  23275. // OnKeyPress calls the given handler when a user presses a key.
  23276. OnKeyPress(h EventHandler, scope ...any) HTMLOl
  23277. // OnKeyUp calls the given handler when a user releases a key.
  23278. OnKeyUp(h EventHandler, scope ...any) HTMLOl
  23279. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  23280. OnMouseDown(h EventHandler, scope ...any) HTMLOl
  23281. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  23282. OnMouseMove(h EventHandler, scope ...any) HTMLOl
  23283. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  23284. OnMouseOut(h EventHandler, scope ...any) HTMLOl
  23285. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  23286. OnMouseOver(h EventHandler, scope ...any) HTMLOl
  23287. // OnMouseUp calls the given handler when a mouse button is released over an element.
  23288. OnMouseUp(h EventHandler, scope ...any) HTMLOl
  23289. // OnPaste calls the given handler when the user pastes some content in an element.
  23290. OnPaste(h EventHandler, scope ...any) HTMLOl
  23291. // OnReset calls the given handler when the Reset button in a form is clicked.
  23292. OnReset(h EventHandler, scope ...any) HTMLOl
  23293. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  23294. OnScroll(h EventHandler, scope ...any) HTMLOl
  23295. // OnSearch calls the given handler when the user writes something in a search field.
  23296. OnSearch(h EventHandler, scope ...any) HTMLOl
  23297. // OnSelect calls the given handler after some text has been selected in an element.
  23298. OnSelect(h EventHandler, scope ...any) HTMLOl
  23299. // OnSubmit calls the given handler when a form is submitted.
  23300. OnSubmit(h EventHandler, scope ...any) HTMLOl
  23301. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  23302. OnWheel(h EventHandler, scope ...any) HTMLOl
  23303. }
  23304. // Ol returns an HTML element that defines an ordered list.
  23305. func Ol() HTMLOl {
  23306. e := &htmlOl{
  23307. htmlElement: htmlElement{
  23308. tag: "ol",
  23309. isSelfClosing: false,
  23310. },
  23311. }
  23312. return e
  23313. }
  23314. type htmlOl struct {
  23315. htmlElement
  23316. }
  23317. func (e *htmlOl) Body(v ...UI) HTMLOl {
  23318. e.setChildren(v...)
  23319. return e
  23320. }
  23321. func (e *htmlOl) Text(v any) HTMLOl {
  23322. return e.Body(Text(v))
  23323. }
  23324. func (e *htmlOl) AccessKey(v string) HTMLOl {
  23325. e.setAttr("accesskey", v)
  23326. return e
  23327. }
  23328. func (e *htmlOl) Aria(k string, v any) HTMLOl {
  23329. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  23330. return e
  23331. }
  23332. func (e *htmlOl) Attr(n string, v any) HTMLOl {
  23333. e.setAttr(n, v)
  23334. return e
  23335. }
  23336. func (e *htmlOl) Class(v ...string) HTMLOl {
  23337. e.setAttr("class", strings.Join(v, " "))
  23338. return e
  23339. }
  23340. func (e *htmlOl) ContentEditable(v bool) HTMLOl {
  23341. e.setAttr("contenteditable", v)
  23342. return e
  23343. }
  23344. func (e *htmlOl) DataSet(k string, v any) HTMLOl {
  23345. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  23346. return e
  23347. }
  23348. func (e *htmlOl) Dir(v string) HTMLOl {
  23349. e.setAttr("dir", v)
  23350. return e
  23351. }
  23352. func (e *htmlOl) Draggable(v bool) HTMLOl {
  23353. e.setAttr("draggable", v)
  23354. return e
  23355. }
  23356. func (e *htmlOl) Hidden(v bool) HTMLOl {
  23357. e.setAttr("hidden", v)
  23358. return e
  23359. }
  23360. func (e *htmlOl) ID(v string) HTMLOl {
  23361. e.setAttr("id", v)
  23362. return e
  23363. }
  23364. func (e *htmlOl) Lang(v string) HTMLOl {
  23365. e.setAttr("lang", v)
  23366. return e
  23367. }
  23368. func (e *htmlOl) Reversed(v bool) HTMLOl {
  23369. e.setAttr("reversed", v)
  23370. return e
  23371. }
  23372. func (e *htmlOl) Role(v string) HTMLOl {
  23373. e.setAttr("role", v)
  23374. return e
  23375. }
  23376. func (e *htmlOl) Spellcheck(v bool) HTMLOl {
  23377. s := "false"
  23378. if v {
  23379. s = "true"
  23380. }
  23381. e.setAttr("spellcheck", s)
  23382. return e
  23383. }
  23384. func (e *htmlOl) Start(v int) HTMLOl {
  23385. e.setAttr("start", v)
  23386. return e
  23387. }
  23388. func (e *htmlOl) Style(k, v string) HTMLOl {
  23389. e.setAttr("style", k+":"+v)
  23390. return e
  23391. }
  23392. func (e *htmlOl) Styles(s map[string]string) HTMLOl {
  23393. for k, v := range s {
  23394. e.Style(k, v)
  23395. }
  23396. return e
  23397. }
  23398. func (e *htmlOl) TabIndex(v int) HTMLOl {
  23399. e.setAttr("tabindex", v)
  23400. return e
  23401. }
  23402. func (e *htmlOl) Title(v string) HTMLOl {
  23403. e.setAttr("title", v)
  23404. return e
  23405. }
  23406. func (e *htmlOl) Type(v string) HTMLOl {
  23407. e.setAttr("type", v)
  23408. return e
  23409. }
  23410. func (e *htmlOl) On(event string, h EventHandler, scope ...any) HTMLOl {
  23411. e.setEventHandler(event, h, scope...)
  23412. return e
  23413. }
  23414. func (e *htmlOl) OnBlur(h EventHandler, scope ...any) HTMLOl {
  23415. e.setEventHandler("blur", h, scope...)
  23416. return e
  23417. }
  23418. func (e *htmlOl) OnChange(h EventHandler, scope ...any) HTMLOl {
  23419. e.setEventHandler("change", h, scope...)
  23420. return e
  23421. }
  23422. func (e *htmlOl) OnClick(h EventHandler, scope ...any) HTMLOl {
  23423. e.setEventHandler("click", h, scope...)
  23424. return e
  23425. }
  23426. func (e *htmlOl) OnContextMenu(h EventHandler, scope ...any) HTMLOl {
  23427. e.setEventHandler("contextmenu", h, scope...)
  23428. return e
  23429. }
  23430. func (e *htmlOl) OnCopy(h EventHandler, scope ...any) HTMLOl {
  23431. e.setEventHandler("copy", h, scope...)
  23432. return e
  23433. }
  23434. func (e *htmlOl) OnCut(h EventHandler, scope ...any) HTMLOl {
  23435. e.setEventHandler("cut", h, scope...)
  23436. return e
  23437. }
  23438. func (e *htmlOl) OnDblClick(h EventHandler, scope ...any) HTMLOl {
  23439. e.setEventHandler("dblclick", h, scope...)
  23440. return e
  23441. }
  23442. func (e *htmlOl) OnDrag(h EventHandler, scope ...any) HTMLOl {
  23443. e.setEventHandler("drag", h, scope...)
  23444. return e
  23445. }
  23446. func (e *htmlOl) OnDragEnd(h EventHandler, scope ...any) HTMLOl {
  23447. e.setEventHandler("dragend", h, scope...)
  23448. return e
  23449. }
  23450. func (e *htmlOl) OnDragEnter(h EventHandler, scope ...any) HTMLOl {
  23451. e.setEventHandler("dragenter", h, scope...)
  23452. return e
  23453. }
  23454. func (e *htmlOl) OnDragLeave(h EventHandler, scope ...any) HTMLOl {
  23455. e.setEventHandler("dragleave", h, scope...)
  23456. return e
  23457. }
  23458. func (e *htmlOl) OnDragOver(h EventHandler, scope ...any) HTMLOl {
  23459. e.setEventHandler("dragover", h, scope...)
  23460. return e
  23461. }
  23462. func (e *htmlOl) OnDragStart(h EventHandler, scope ...any) HTMLOl {
  23463. e.setEventHandler("dragstart", h, scope...)
  23464. return e
  23465. }
  23466. func (e *htmlOl) OnDrop(h EventHandler, scope ...any) HTMLOl {
  23467. e.setEventHandler("drop", h, scope...)
  23468. return e
  23469. }
  23470. func (e *htmlOl) OnFocus(h EventHandler, scope ...any) HTMLOl {
  23471. e.setEventHandler("focus", h, scope...)
  23472. return e
  23473. }
  23474. func (e *htmlOl) OnInput(h EventHandler, scope ...any) HTMLOl {
  23475. e.setEventHandler("input", h, scope...)
  23476. return e
  23477. }
  23478. func (e *htmlOl) OnInvalid(h EventHandler, scope ...any) HTMLOl {
  23479. e.setEventHandler("invalid", h, scope...)
  23480. return e
  23481. }
  23482. func (e *htmlOl) OnKeyDown(h EventHandler, scope ...any) HTMLOl {
  23483. e.setEventHandler("keydown", h, scope...)
  23484. return e
  23485. }
  23486. func (e *htmlOl) OnKeyPress(h EventHandler, scope ...any) HTMLOl {
  23487. e.setEventHandler("keypress", h, scope...)
  23488. return e
  23489. }
  23490. func (e *htmlOl) OnKeyUp(h EventHandler, scope ...any) HTMLOl {
  23491. e.setEventHandler("keyup", h, scope...)
  23492. return e
  23493. }
  23494. func (e *htmlOl) OnMouseDown(h EventHandler, scope ...any) HTMLOl {
  23495. e.setEventHandler("mousedown", h, scope...)
  23496. return e
  23497. }
  23498. func (e *htmlOl) OnMouseMove(h EventHandler, scope ...any) HTMLOl {
  23499. e.setEventHandler("mousemove", h, scope...)
  23500. return e
  23501. }
  23502. func (e *htmlOl) OnMouseOut(h EventHandler, scope ...any) HTMLOl {
  23503. e.setEventHandler("mouseout", h, scope...)
  23504. return e
  23505. }
  23506. func (e *htmlOl) OnMouseOver(h EventHandler, scope ...any) HTMLOl {
  23507. e.setEventHandler("mouseover", h, scope...)
  23508. return e
  23509. }
  23510. func (e *htmlOl) OnMouseUp(h EventHandler, scope ...any) HTMLOl {
  23511. e.setEventHandler("mouseup", h, scope...)
  23512. return e
  23513. }
  23514. func (e *htmlOl) OnPaste(h EventHandler, scope ...any) HTMLOl {
  23515. e.setEventHandler("paste", h, scope...)
  23516. return e
  23517. }
  23518. func (e *htmlOl) OnReset(h EventHandler, scope ...any) HTMLOl {
  23519. e.setEventHandler("reset", h, scope...)
  23520. return e
  23521. }
  23522. func (e *htmlOl) OnScroll(h EventHandler, scope ...any) HTMLOl {
  23523. e.setEventHandler("scroll", h, scope...)
  23524. return e
  23525. }
  23526. func (e *htmlOl) OnSearch(h EventHandler, scope ...any) HTMLOl {
  23527. e.setEventHandler("search", h, scope...)
  23528. return e
  23529. }
  23530. func (e *htmlOl) OnSelect(h EventHandler, scope ...any) HTMLOl {
  23531. e.setEventHandler("select", h, scope...)
  23532. return e
  23533. }
  23534. func (e *htmlOl) OnSubmit(h EventHandler, scope ...any) HTMLOl {
  23535. e.setEventHandler("submit", h, scope...)
  23536. return e
  23537. }
  23538. func (e *htmlOl) OnWheel(h EventHandler, scope ...any) HTMLOl {
  23539. e.setEventHandler("wheel", h, scope...)
  23540. return e
  23541. }
  23542. // HTMLOptGroup is the interface that describes a "optgroup" HTML element.
  23543. type HTMLOptGroup interface {
  23544. UI
  23545. // Body set the content of the element.
  23546. Body(elems ...UI) HTMLOptGroup
  23547. // Text sets the content of the element with a text node containing the stringified given value.
  23548. Text(v any) HTMLOptGroup
  23549. // AccessKey specifies a shortcut key to activate/focus an element.
  23550. AccessKey(v string) HTMLOptGroup
  23551. // Aria stores accessible rich internet applications (ARIA) data.
  23552. Aria(k string, v any) HTMLOptGroup
  23553. // Attr sets the named attribute with the given value.
  23554. Attr(n string, v any) HTMLOptGroup
  23555. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  23556. Class(v ...string) HTMLOptGroup
  23557. // ContentEditable specifies whether the content of an element is editable or not.
  23558. ContentEditable(v bool) HTMLOptGroup
  23559. // DataSet stores custom data private to the page or application.
  23560. DataSet(k string, v any) HTMLOptGroup
  23561. // Dir specifies the text direction for the content in an element.
  23562. Dir(v string) HTMLOptGroup
  23563. // Disabled specifies that the specified element/group of elements should be disabled.
  23564. Disabled(v bool) HTMLOptGroup
  23565. // Draggable specifies whether an element is draggable or not.
  23566. Draggable(v bool) HTMLOptGroup
  23567. // Hidden specifies that an element is not yet, or is no longer relevant.
  23568. Hidden(v bool) HTMLOptGroup
  23569. // ID specifies a unique id for an element.
  23570. ID(v string) HTMLOptGroup
  23571. // Label specifies a shorter label for the option.
  23572. Label(v string) HTMLOptGroup
  23573. // Lang specifies the language of the element's content.
  23574. Lang(v string) HTMLOptGroup
  23575. // Role specifies to parsing software the exact function of an element (and its children).
  23576. Role(v string) HTMLOptGroup
  23577. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  23578. Spellcheck(v bool) HTMLOptGroup
  23579. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  23580. Style(k, v string) HTMLOptGroup
  23581. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  23582. Styles(s map[string]string) HTMLOptGroup
  23583. // TabIndex specifies the tabbing order of an element.
  23584. TabIndex(v int) HTMLOptGroup
  23585. // Title specifies extra information about an element.
  23586. Title(v string) HTMLOptGroup
  23587. // On registers the given event handler to the specified event.
  23588. On(event string, h EventHandler, scope ...any) HTMLOptGroup
  23589. // OnBlur calls the given handler when the element loses focus.
  23590. OnBlur(h EventHandler, scope ...any) HTMLOptGroup
  23591. // OnChange calls the given handler when the value of the element is changed.
  23592. OnChange(h EventHandler, scope ...any) HTMLOptGroup
  23593. // OnClick calls the given handler when there is a mouse click on the element.
  23594. OnClick(h EventHandler, scope ...any) HTMLOptGroup
  23595. // OnContextMenu calls the given handler when a context menu is triggered.
  23596. OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup
  23597. // OnCopy calls the given handler when the user copies the content of an element.
  23598. OnCopy(h EventHandler, scope ...any) HTMLOptGroup
  23599. // OnCut calls the given handler when the user cuts the content of an element.
  23600. OnCut(h EventHandler, scope ...any) HTMLOptGroup
  23601. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  23602. OnDblClick(h EventHandler, scope ...any) HTMLOptGroup
  23603. // OnDrag calls the given handler when an element is dragged.
  23604. OnDrag(h EventHandler, scope ...any) HTMLOptGroup
  23605. // OnDragEnd calls the given handler at the end of a drag operation.
  23606. OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup
  23607. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  23608. OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup
  23609. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  23610. OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup
  23611. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  23612. OnDragOver(h EventHandler, scope ...any) HTMLOptGroup
  23613. // OnDragStart calls the given handler at the start of a drag operation.
  23614. OnDragStart(h EventHandler, scope ...any) HTMLOptGroup
  23615. // OnDrop calls the given handler when dragged element is being dropped.
  23616. OnDrop(h EventHandler, scope ...any) HTMLOptGroup
  23617. // OnFocus calls the given handler when the element gets focus.
  23618. OnFocus(h EventHandler, scope ...any) HTMLOptGroup
  23619. // OnInput calls the given handler when an element gets user input.
  23620. OnInput(h EventHandler, scope ...any) HTMLOptGroup
  23621. // OnInvalid calls the given handler when an element is invalid.
  23622. OnInvalid(h EventHandler, scope ...any) HTMLOptGroup
  23623. // OnKeyDown calls the given handler when a user is pressing a key.
  23624. OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup
  23625. // OnKeyPress calls the given handler when a user presses a key.
  23626. OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup
  23627. // OnKeyUp calls the given handler when a user releases a key.
  23628. OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup
  23629. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  23630. OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup
  23631. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  23632. OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup
  23633. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  23634. OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup
  23635. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  23636. OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup
  23637. // OnMouseUp calls the given handler when a mouse button is released over an element.
  23638. OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup
  23639. // OnPaste calls the given handler when the user pastes some content in an element.
  23640. OnPaste(h EventHandler, scope ...any) HTMLOptGroup
  23641. // OnReset calls the given handler when the Reset button in a form is clicked.
  23642. OnReset(h EventHandler, scope ...any) HTMLOptGroup
  23643. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  23644. OnScroll(h EventHandler, scope ...any) HTMLOptGroup
  23645. // OnSearch calls the given handler when the user writes something in a search field.
  23646. OnSearch(h EventHandler, scope ...any) HTMLOptGroup
  23647. // OnSelect calls the given handler after some text has been selected in an element.
  23648. OnSelect(h EventHandler, scope ...any) HTMLOptGroup
  23649. // OnSubmit calls the given handler when a form is submitted.
  23650. OnSubmit(h EventHandler, scope ...any) HTMLOptGroup
  23651. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  23652. OnWheel(h EventHandler, scope ...any) HTMLOptGroup
  23653. }
  23654. // OptGroup returns an HTML element that defines a group of related options in a drop-down list.
  23655. func OptGroup() HTMLOptGroup {
  23656. e := &htmlOptGroup{
  23657. htmlElement: htmlElement{
  23658. tag: "optgroup",
  23659. isSelfClosing: false,
  23660. },
  23661. }
  23662. return e
  23663. }
  23664. type htmlOptGroup struct {
  23665. htmlElement
  23666. }
  23667. func (e *htmlOptGroup) Body(v ...UI) HTMLOptGroup {
  23668. e.setChildren(v...)
  23669. return e
  23670. }
  23671. func (e *htmlOptGroup) Text(v any) HTMLOptGroup {
  23672. return e.Body(Text(v))
  23673. }
  23674. func (e *htmlOptGroup) AccessKey(v string) HTMLOptGroup {
  23675. e.setAttr("accesskey", v)
  23676. return e
  23677. }
  23678. func (e *htmlOptGroup) Aria(k string, v any) HTMLOptGroup {
  23679. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  23680. return e
  23681. }
  23682. func (e *htmlOptGroup) Attr(n string, v any) HTMLOptGroup {
  23683. e.setAttr(n, v)
  23684. return e
  23685. }
  23686. func (e *htmlOptGroup) Class(v ...string) HTMLOptGroup {
  23687. e.setAttr("class", strings.Join(v, " "))
  23688. return e
  23689. }
  23690. func (e *htmlOptGroup) ContentEditable(v bool) HTMLOptGroup {
  23691. e.setAttr("contenteditable", v)
  23692. return e
  23693. }
  23694. func (e *htmlOptGroup) DataSet(k string, v any) HTMLOptGroup {
  23695. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  23696. return e
  23697. }
  23698. func (e *htmlOptGroup) Dir(v string) HTMLOptGroup {
  23699. e.setAttr("dir", v)
  23700. return e
  23701. }
  23702. func (e *htmlOptGroup) Disabled(v bool) HTMLOptGroup {
  23703. e.setAttr("disabled", v)
  23704. return e
  23705. }
  23706. func (e *htmlOptGroup) Draggable(v bool) HTMLOptGroup {
  23707. e.setAttr("draggable", v)
  23708. return e
  23709. }
  23710. func (e *htmlOptGroup) Hidden(v bool) HTMLOptGroup {
  23711. e.setAttr("hidden", v)
  23712. return e
  23713. }
  23714. func (e *htmlOptGroup) ID(v string) HTMLOptGroup {
  23715. e.setAttr("id", v)
  23716. return e
  23717. }
  23718. func (e *htmlOptGroup) Label(v string) HTMLOptGroup {
  23719. e.setAttr("label", v)
  23720. return e
  23721. }
  23722. func (e *htmlOptGroup) Lang(v string) HTMLOptGroup {
  23723. e.setAttr("lang", v)
  23724. return e
  23725. }
  23726. func (e *htmlOptGroup) Role(v string) HTMLOptGroup {
  23727. e.setAttr("role", v)
  23728. return e
  23729. }
  23730. func (e *htmlOptGroup) Spellcheck(v bool) HTMLOptGroup {
  23731. s := "false"
  23732. if v {
  23733. s = "true"
  23734. }
  23735. e.setAttr("spellcheck", s)
  23736. return e
  23737. }
  23738. func (e *htmlOptGroup) Style(k, v string) HTMLOptGroup {
  23739. e.setAttr("style", k+":"+v)
  23740. return e
  23741. }
  23742. func (e *htmlOptGroup) Styles(s map[string]string) HTMLOptGroup {
  23743. for k, v := range s {
  23744. e.Style(k, v)
  23745. }
  23746. return e
  23747. }
  23748. func (e *htmlOptGroup) TabIndex(v int) HTMLOptGroup {
  23749. e.setAttr("tabindex", v)
  23750. return e
  23751. }
  23752. func (e *htmlOptGroup) Title(v string) HTMLOptGroup {
  23753. e.setAttr("title", v)
  23754. return e
  23755. }
  23756. func (e *htmlOptGroup) On(event string, h EventHandler, scope ...any) HTMLOptGroup {
  23757. e.setEventHandler(event, h, scope...)
  23758. return e
  23759. }
  23760. func (e *htmlOptGroup) OnBlur(h EventHandler, scope ...any) HTMLOptGroup {
  23761. e.setEventHandler("blur", h, scope...)
  23762. return e
  23763. }
  23764. func (e *htmlOptGroup) OnChange(h EventHandler, scope ...any) HTMLOptGroup {
  23765. e.setEventHandler("change", h, scope...)
  23766. return e
  23767. }
  23768. func (e *htmlOptGroup) OnClick(h EventHandler, scope ...any) HTMLOptGroup {
  23769. e.setEventHandler("click", h, scope...)
  23770. return e
  23771. }
  23772. func (e *htmlOptGroup) OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup {
  23773. e.setEventHandler("contextmenu", h, scope...)
  23774. return e
  23775. }
  23776. func (e *htmlOptGroup) OnCopy(h EventHandler, scope ...any) HTMLOptGroup {
  23777. e.setEventHandler("copy", h, scope...)
  23778. return e
  23779. }
  23780. func (e *htmlOptGroup) OnCut(h EventHandler, scope ...any) HTMLOptGroup {
  23781. e.setEventHandler("cut", h, scope...)
  23782. return e
  23783. }
  23784. func (e *htmlOptGroup) OnDblClick(h EventHandler, scope ...any) HTMLOptGroup {
  23785. e.setEventHandler("dblclick", h, scope...)
  23786. return e
  23787. }
  23788. func (e *htmlOptGroup) OnDrag(h EventHandler, scope ...any) HTMLOptGroup {
  23789. e.setEventHandler("drag", h, scope...)
  23790. return e
  23791. }
  23792. func (e *htmlOptGroup) OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup {
  23793. e.setEventHandler("dragend", h, scope...)
  23794. return e
  23795. }
  23796. func (e *htmlOptGroup) OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup {
  23797. e.setEventHandler("dragenter", h, scope...)
  23798. return e
  23799. }
  23800. func (e *htmlOptGroup) OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup {
  23801. e.setEventHandler("dragleave", h, scope...)
  23802. return e
  23803. }
  23804. func (e *htmlOptGroup) OnDragOver(h EventHandler, scope ...any) HTMLOptGroup {
  23805. e.setEventHandler("dragover", h, scope...)
  23806. return e
  23807. }
  23808. func (e *htmlOptGroup) OnDragStart(h EventHandler, scope ...any) HTMLOptGroup {
  23809. e.setEventHandler("dragstart", h, scope...)
  23810. return e
  23811. }
  23812. func (e *htmlOptGroup) OnDrop(h EventHandler, scope ...any) HTMLOptGroup {
  23813. e.setEventHandler("drop", h, scope...)
  23814. return e
  23815. }
  23816. func (e *htmlOptGroup) OnFocus(h EventHandler, scope ...any) HTMLOptGroup {
  23817. e.setEventHandler("focus", h, scope...)
  23818. return e
  23819. }
  23820. func (e *htmlOptGroup) OnInput(h EventHandler, scope ...any) HTMLOptGroup {
  23821. e.setEventHandler("input", h, scope...)
  23822. return e
  23823. }
  23824. func (e *htmlOptGroup) OnInvalid(h EventHandler, scope ...any) HTMLOptGroup {
  23825. e.setEventHandler("invalid", h, scope...)
  23826. return e
  23827. }
  23828. func (e *htmlOptGroup) OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup {
  23829. e.setEventHandler("keydown", h, scope...)
  23830. return e
  23831. }
  23832. func (e *htmlOptGroup) OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup {
  23833. e.setEventHandler("keypress", h, scope...)
  23834. return e
  23835. }
  23836. func (e *htmlOptGroup) OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup {
  23837. e.setEventHandler("keyup", h, scope...)
  23838. return e
  23839. }
  23840. func (e *htmlOptGroup) OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup {
  23841. e.setEventHandler("mousedown", h, scope...)
  23842. return e
  23843. }
  23844. func (e *htmlOptGroup) OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup {
  23845. e.setEventHandler("mousemove", h, scope...)
  23846. return e
  23847. }
  23848. func (e *htmlOptGroup) OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup {
  23849. e.setEventHandler("mouseout", h, scope...)
  23850. return e
  23851. }
  23852. func (e *htmlOptGroup) OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup {
  23853. e.setEventHandler("mouseover", h, scope...)
  23854. return e
  23855. }
  23856. func (e *htmlOptGroup) OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup {
  23857. e.setEventHandler("mouseup", h, scope...)
  23858. return e
  23859. }
  23860. func (e *htmlOptGroup) OnPaste(h EventHandler, scope ...any) HTMLOptGroup {
  23861. e.setEventHandler("paste", h, scope...)
  23862. return e
  23863. }
  23864. func (e *htmlOptGroup) OnReset(h EventHandler, scope ...any) HTMLOptGroup {
  23865. e.setEventHandler("reset", h, scope...)
  23866. return e
  23867. }
  23868. func (e *htmlOptGroup) OnScroll(h EventHandler, scope ...any) HTMLOptGroup {
  23869. e.setEventHandler("scroll", h, scope...)
  23870. return e
  23871. }
  23872. func (e *htmlOptGroup) OnSearch(h EventHandler, scope ...any) HTMLOptGroup {
  23873. e.setEventHandler("search", h, scope...)
  23874. return e
  23875. }
  23876. func (e *htmlOptGroup) OnSelect(h EventHandler, scope ...any) HTMLOptGroup {
  23877. e.setEventHandler("select", h, scope...)
  23878. return e
  23879. }
  23880. func (e *htmlOptGroup) OnSubmit(h EventHandler, scope ...any) HTMLOptGroup {
  23881. e.setEventHandler("submit", h, scope...)
  23882. return e
  23883. }
  23884. func (e *htmlOptGroup) OnWheel(h EventHandler, scope ...any) HTMLOptGroup {
  23885. e.setEventHandler("wheel", h, scope...)
  23886. return e
  23887. }
  23888. // HTMLOption is the interface that describes a "option" HTML element.
  23889. type HTMLOption interface {
  23890. UI
  23891. // Body set the content of the element.
  23892. Body(elems ...UI) HTMLOption
  23893. // Text sets the content of the element with a text node containing the stringified given value.
  23894. Text(v any) HTMLOption
  23895. // AccessKey specifies a shortcut key to activate/focus an element.
  23896. AccessKey(v string) HTMLOption
  23897. // Aria stores accessible rich internet applications (ARIA) data.
  23898. Aria(k string, v any) HTMLOption
  23899. // Attr sets the named attribute with the given value.
  23900. Attr(n string, v any) HTMLOption
  23901. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  23902. Class(v ...string) HTMLOption
  23903. // ContentEditable specifies whether the content of an element is editable or not.
  23904. ContentEditable(v bool) HTMLOption
  23905. // DataSet stores custom data private to the page or application.
  23906. DataSet(k string, v any) HTMLOption
  23907. // Dir specifies the text direction for the content in an element.
  23908. Dir(v string) HTMLOption
  23909. // Disabled specifies that the specified element/group of elements should be disabled.
  23910. Disabled(v bool) HTMLOption
  23911. // Draggable specifies whether an element is draggable or not.
  23912. Draggable(v bool) HTMLOption
  23913. // Hidden specifies that an element is not yet, or is no longer relevant.
  23914. Hidden(v bool) HTMLOption
  23915. // ID specifies a unique id for an element.
  23916. ID(v string) HTMLOption
  23917. // Label specifies a shorter label for the option.
  23918. Label(v string) HTMLOption
  23919. // Lang specifies the language of the element's content.
  23920. Lang(v string) HTMLOption
  23921. // Role specifies to parsing software the exact function of an element (and its children).
  23922. Role(v string) HTMLOption
  23923. // Selected specifies that an option should be pre-selected when the page loads.
  23924. Selected(v bool) HTMLOption
  23925. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  23926. Spellcheck(v bool) HTMLOption
  23927. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  23928. Style(k, v string) HTMLOption
  23929. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  23930. Styles(s map[string]string) HTMLOption
  23931. // TabIndex specifies the tabbing order of an element.
  23932. TabIndex(v int) HTMLOption
  23933. // Title specifies extra information about an element.
  23934. Title(v string) HTMLOption
  23935. // Value specifies the value of the element.
  23936. Value(v any) HTMLOption
  23937. // On registers the given event handler to the specified event.
  23938. On(event string, h EventHandler, scope ...any) HTMLOption
  23939. // OnBlur calls the given handler when the element loses focus.
  23940. OnBlur(h EventHandler, scope ...any) HTMLOption
  23941. // OnChange calls the given handler when the value of the element is changed.
  23942. OnChange(h EventHandler, scope ...any) HTMLOption
  23943. // OnClick calls the given handler when there is a mouse click on the element.
  23944. OnClick(h EventHandler, scope ...any) HTMLOption
  23945. // OnContextMenu calls the given handler when a context menu is triggered.
  23946. OnContextMenu(h EventHandler, scope ...any) HTMLOption
  23947. // OnCopy calls the given handler when the user copies the content of an element.
  23948. OnCopy(h EventHandler, scope ...any) HTMLOption
  23949. // OnCut calls the given handler when the user cuts the content of an element.
  23950. OnCut(h EventHandler, scope ...any) HTMLOption
  23951. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  23952. OnDblClick(h EventHandler, scope ...any) HTMLOption
  23953. // OnDrag calls the given handler when an element is dragged.
  23954. OnDrag(h EventHandler, scope ...any) HTMLOption
  23955. // OnDragEnd calls the given handler at the end of a drag operation.
  23956. OnDragEnd(h EventHandler, scope ...any) HTMLOption
  23957. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  23958. OnDragEnter(h EventHandler, scope ...any) HTMLOption
  23959. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  23960. OnDragLeave(h EventHandler, scope ...any) HTMLOption
  23961. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  23962. OnDragOver(h EventHandler, scope ...any) HTMLOption
  23963. // OnDragStart calls the given handler at the start of a drag operation.
  23964. OnDragStart(h EventHandler, scope ...any) HTMLOption
  23965. // OnDrop calls the given handler when dragged element is being dropped.
  23966. OnDrop(h EventHandler, scope ...any) HTMLOption
  23967. // OnFocus calls the given handler when the element gets focus.
  23968. OnFocus(h EventHandler, scope ...any) HTMLOption
  23969. // OnInput calls the given handler when an element gets user input.
  23970. OnInput(h EventHandler, scope ...any) HTMLOption
  23971. // OnInvalid calls the given handler when an element is invalid.
  23972. OnInvalid(h EventHandler, scope ...any) HTMLOption
  23973. // OnKeyDown calls the given handler when a user is pressing a key.
  23974. OnKeyDown(h EventHandler, scope ...any) HTMLOption
  23975. // OnKeyPress calls the given handler when a user presses a key.
  23976. OnKeyPress(h EventHandler, scope ...any) HTMLOption
  23977. // OnKeyUp calls the given handler when a user releases a key.
  23978. OnKeyUp(h EventHandler, scope ...any) HTMLOption
  23979. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  23980. OnMouseDown(h EventHandler, scope ...any) HTMLOption
  23981. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  23982. OnMouseMove(h EventHandler, scope ...any) HTMLOption
  23983. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  23984. OnMouseOut(h EventHandler, scope ...any) HTMLOption
  23985. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  23986. OnMouseOver(h EventHandler, scope ...any) HTMLOption
  23987. // OnMouseUp calls the given handler when a mouse button is released over an element.
  23988. OnMouseUp(h EventHandler, scope ...any) HTMLOption
  23989. // OnPaste calls the given handler when the user pastes some content in an element.
  23990. OnPaste(h EventHandler, scope ...any) HTMLOption
  23991. // OnReset calls the given handler when the Reset button in a form is clicked.
  23992. OnReset(h EventHandler, scope ...any) HTMLOption
  23993. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  23994. OnScroll(h EventHandler, scope ...any) HTMLOption
  23995. // OnSearch calls the given handler when the user writes something in a search field.
  23996. OnSearch(h EventHandler, scope ...any) HTMLOption
  23997. // OnSelect calls the given handler after some text has been selected in an element.
  23998. OnSelect(h EventHandler, scope ...any) HTMLOption
  23999. // OnSubmit calls the given handler when a form is submitted.
  24000. OnSubmit(h EventHandler, scope ...any) HTMLOption
  24001. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  24002. OnWheel(h EventHandler, scope ...any) HTMLOption
  24003. }
  24004. // Option returns an HTML element that defines an option in a drop-down list.
  24005. func Option() HTMLOption {
  24006. e := &htmlOption{
  24007. htmlElement: htmlElement{
  24008. tag: "option",
  24009. isSelfClosing: false,
  24010. },
  24011. }
  24012. return e
  24013. }
  24014. type htmlOption struct {
  24015. htmlElement
  24016. }
  24017. func (e *htmlOption) Body(v ...UI) HTMLOption {
  24018. e.setChildren(v...)
  24019. return e
  24020. }
  24021. func (e *htmlOption) Text(v any) HTMLOption {
  24022. return e.Body(Text(v))
  24023. }
  24024. func (e *htmlOption) AccessKey(v string) HTMLOption {
  24025. e.setAttr("accesskey", v)
  24026. return e
  24027. }
  24028. func (e *htmlOption) Aria(k string, v any) HTMLOption {
  24029. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  24030. return e
  24031. }
  24032. func (e *htmlOption) Attr(n string, v any) HTMLOption {
  24033. e.setAttr(n, v)
  24034. return e
  24035. }
  24036. func (e *htmlOption) Class(v ...string) HTMLOption {
  24037. e.setAttr("class", strings.Join(v, " "))
  24038. return e
  24039. }
  24040. func (e *htmlOption) ContentEditable(v bool) HTMLOption {
  24041. e.setAttr("contenteditable", v)
  24042. return e
  24043. }
  24044. func (e *htmlOption) DataSet(k string, v any) HTMLOption {
  24045. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  24046. return e
  24047. }
  24048. func (e *htmlOption) Dir(v string) HTMLOption {
  24049. e.setAttr("dir", v)
  24050. return e
  24051. }
  24052. func (e *htmlOption) Disabled(v bool) HTMLOption {
  24053. e.setAttr("disabled", v)
  24054. return e
  24055. }
  24056. func (e *htmlOption) Draggable(v bool) HTMLOption {
  24057. e.setAttr("draggable", v)
  24058. return e
  24059. }
  24060. func (e *htmlOption) Hidden(v bool) HTMLOption {
  24061. e.setAttr("hidden", v)
  24062. return e
  24063. }
  24064. func (e *htmlOption) ID(v string) HTMLOption {
  24065. e.setAttr("id", v)
  24066. return e
  24067. }
  24068. func (e *htmlOption) Label(v string) HTMLOption {
  24069. e.setAttr("label", v)
  24070. return e
  24071. }
  24072. func (e *htmlOption) Lang(v string) HTMLOption {
  24073. e.setAttr("lang", v)
  24074. return e
  24075. }
  24076. func (e *htmlOption) Role(v string) HTMLOption {
  24077. e.setAttr("role", v)
  24078. return e
  24079. }
  24080. func (e *htmlOption) Selected(v bool) HTMLOption {
  24081. e.setAttr("selected", v)
  24082. return e
  24083. }
  24084. func (e *htmlOption) Spellcheck(v bool) HTMLOption {
  24085. s := "false"
  24086. if v {
  24087. s = "true"
  24088. }
  24089. e.setAttr("spellcheck", s)
  24090. return e
  24091. }
  24092. func (e *htmlOption) Style(k, v string) HTMLOption {
  24093. e.setAttr("style", k+":"+v)
  24094. return e
  24095. }
  24096. func (e *htmlOption) Styles(s map[string]string) HTMLOption {
  24097. for k, v := range s {
  24098. e.Style(k, v)
  24099. }
  24100. return e
  24101. }
  24102. func (e *htmlOption) TabIndex(v int) HTMLOption {
  24103. e.setAttr("tabindex", v)
  24104. return e
  24105. }
  24106. func (e *htmlOption) Title(v string) HTMLOption {
  24107. e.setAttr("title", v)
  24108. return e
  24109. }
  24110. func (e *htmlOption) Value(v any) HTMLOption {
  24111. e.setAttr("value", v)
  24112. return e
  24113. }
  24114. func (e *htmlOption) On(event string, h EventHandler, scope ...any) HTMLOption {
  24115. e.setEventHandler(event, h, scope...)
  24116. return e
  24117. }
  24118. func (e *htmlOption) OnBlur(h EventHandler, scope ...any) HTMLOption {
  24119. e.setEventHandler("blur", h, scope...)
  24120. return e
  24121. }
  24122. func (e *htmlOption) OnChange(h EventHandler, scope ...any) HTMLOption {
  24123. e.setEventHandler("change", h, scope...)
  24124. return e
  24125. }
  24126. func (e *htmlOption) OnClick(h EventHandler, scope ...any) HTMLOption {
  24127. e.setEventHandler("click", h, scope...)
  24128. return e
  24129. }
  24130. func (e *htmlOption) OnContextMenu(h EventHandler, scope ...any) HTMLOption {
  24131. e.setEventHandler("contextmenu", h, scope...)
  24132. return e
  24133. }
  24134. func (e *htmlOption) OnCopy(h EventHandler, scope ...any) HTMLOption {
  24135. e.setEventHandler("copy", h, scope...)
  24136. return e
  24137. }
  24138. func (e *htmlOption) OnCut(h EventHandler, scope ...any) HTMLOption {
  24139. e.setEventHandler("cut", h, scope...)
  24140. return e
  24141. }
  24142. func (e *htmlOption) OnDblClick(h EventHandler, scope ...any) HTMLOption {
  24143. e.setEventHandler("dblclick", h, scope...)
  24144. return e
  24145. }
  24146. func (e *htmlOption) OnDrag(h EventHandler, scope ...any) HTMLOption {
  24147. e.setEventHandler("drag", h, scope...)
  24148. return e
  24149. }
  24150. func (e *htmlOption) OnDragEnd(h EventHandler, scope ...any) HTMLOption {
  24151. e.setEventHandler("dragend", h, scope...)
  24152. return e
  24153. }
  24154. func (e *htmlOption) OnDragEnter(h EventHandler, scope ...any) HTMLOption {
  24155. e.setEventHandler("dragenter", h, scope...)
  24156. return e
  24157. }
  24158. func (e *htmlOption) OnDragLeave(h EventHandler, scope ...any) HTMLOption {
  24159. e.setEventHandler("dragleave", h, scope...)
  24160. return e
  24161. }
  24162. func (e *htmlOption) OnDragOver(h EventHandler, scope ...any) HTMLOption {
  24163. e.setEventHandler("dragover", h, scope...)
  24164. return e
  24165. }
  24166. func (e *htmlOption) OnDragStart(h EventHandler, scope ...any) HTMLOption {
  24167. e.setEventHandler("dragstart", h, scope...)
  24168. return e
  24169. }
  24170. func (e *htmlOption) OnDrop(h EventHandler, scope ...any) HTMLOption {
  24171. e.setEventHandler("drop", h, scope...)
  24172. return e
  24173. }
  24174. func (e *htmlOption) OnFocus(h EventHandler, scope ...any) HTMLOption {
  24175. e.setEventHandler("focus", h, scope...)
  24176. return e
  24177. }
  24178. func (e *htmlOption) OnInput(h EventHandler, scope ...any) HTMLOption {
  24179. e.setEventHandler("input", h, scope...)
  24180. return e
  24181. }
  24182. func (e *htmlOption) OnInvalid(h EventHandler, scope ...any) HTMLOption {
  24183. e.setEventHandler("invalid", h, scope...)
  24184. return e
  24185. }
  24186. func (e *htmlOption) OnKeyDown(h EventHandler, scope ...any) HTMLOption {
  24187. e.setEventHandler("keydown", h, scope...)
  24188. return e
  24189. }
  24190. func (e *htmlOption) OnKeyPress(h EventHandler, scope ...any) HTMLOption {
  24191. e.setEventHandler("keypress", h, scope...)
  24192. return e
  24193. }
  24194. func (e *htmlOption) OnKeyUp(h EventHandler, scope ...any) HTMLOption {
  24195. e.setEventHandler("keyup", h, scope...)
  24196. return e
  24197. }
  24198. func (e *htmlOption) OnMouseDown(h EventHandler, scope ...any) HTMLOption {
  24199. e.setEventHandler("mousedown", h, scope...)
  24200. return e
  24201. }
  24202. func (e *htmlOption) OnMouseMove(h EventHandler, scope ...any) HTMLOption {
  24203. e.setEventHandler("mousemove", h, scope...)
  24204. return e
  24205. }
  24206. func (e *htmlOption) OnMouseOut(h EventHandler, scope ...any) HTMLOption {
  24207. e.setEventHandler("mouseout", h, scope...)
  24208. return e
  24209. }
  24210. func (e *htmlOption) OnMouseOver(h EventHandler, scope ...any) HTMLOption {
  24211. e.setEventHandler("mouseover", h, scope...)
  24212. return e
  24213. }
  24214. func (e *htmlOption) OnMouseUp(h EventHandler, scope ...any) HTMLOption {
  24215. e.setEventHandler("mouseup", h, scope...)
  24216. return e
  24217. }
  24218. func (e *htmlOption) OnPaste(h EventHandler, scope ...any) HTMLOption {
  24219. e.setEventHandler("paste", h, scope...)
  24220. return e
  24221. }
  24222. func (e *htmlOption) OnReset(h EventHandler, scope ...any) HTMLOption {
  24223. e.setEventHandler("reset", h, scope...)
  24224. return e
  24225. }
  24226. func (e *htmlOption) OnScroll(h EventHandler, scope ...any) HTMLOption {
  24227. e.setEventHandler("scroll", h, scope...)
  24228. return e
  24229. }
  24230. func (e *htmlOption) OnSearch(h EventHandler, scope ...any) HTMLOption {
  24231. e.setEventHandler("search", h, scope...)
  24232. return e
  24233. }
  24234. func (e *htmlOption) OnSelect(h EventHandler, scope ...any) HTMLOption {
  24235. e.setEventHandler("select", h, scope...)
  24236. return e
  24237. }
  24238. func (e *htmlOption) OnSubmit(h EventHandler, scope ...any) HTMLOption {
  24239. e.setEventHandler("submit", h, scope...)
  24240. return e
  24241. }
  24242. func (e *htmlOption) OnWheel(h EventHandler, scope ...any) HTMLOption {
  24243. e.setEventHandler("wheel", h, scope...)
  24244. return e
  24245. }
  24246. // HTMLOutput is the interface that describes a "output" HTML element.
  24247. type HTMLOutput interface {
  24248. UI
  24249. // Body set the content of the element.
  24250. Body(elems ...UI) HTMLOutput
  24251. // Text sets the content of the element with a text node containing the stringified given value.
  24252. Text(v any) HTMLOutput
  24253. // AccessKey specifies a shortcut key to activate/focus an element.
  24254. AccessKey(v string) HTMLOutput
  24255. // Aria stores accessible rich internet applications (ARIA) data.
  24256. Aria(k string, v any) HTMLOutput
  24257. // Attr sets the named attribute with the given value.
  24258. Attr(n string, v any) HTMLOutput
  24259. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  24260. Class(v ...string) HTMLOutput
  24261. // ContentEditable specifies whether the content of an element is editable or not.
  24262. ContentEditable(v bool) HTMLOutput
  24263. // DataSet stores custom data private to the page or application.
  24264. DataSet(k string, v any) HTMLOutput
  24265. // Dir specifies the text direction for the content in an element.
  24266. Dir(v string) HTMLOutput
  24267. // Draggable specifies whether an element is draggable or not.
  24268. Draggable(v bool) HTMLOutput
  24269. // For specifies which form element(s) a label/calculation is bound to.
  24270. For(v string) HTMLOutput
  24271. // Form specifies the name of the form the element belongs to.
  24272. Form(v string) HTMLOutput
  24273. // Hidden specifies that an element is not yet, or is no longer relevant.
  24274. Hidden(v bool) HTMLOutput
  24275. // ID specifies a unique id for an element.
  24276. ID(v string) HTMLOutput
  24277. // Lang specifies the language of the element's content.
  24278. Lang(v string) HTMLOutput
  24279. // Name specifies the name of the element.
  24280. Name(v string) HTMLOutput
  24281. // Role specifies to parsing software the exact function of an element (and its children).
  24282. Role(v string) HTMLOutput
  24283. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  24284. Spellcheck(v bool) HTMLOutput
  24285. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  24286. Style(k, v string) HTMLOutput
  24287. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  24288. Styles(s map[string]string) HTMLOutput
  24289. // TabIndex specifies the tabbing order of an element.
  24290. TabIndex(v int) HTMLOutput
  24291. // Title specifies extra information about an element.
  24292. Title(v string) HTMLOutput
  24293. // On registers the given event handler to the specified event.
  24294. On(event string, h EventHandler, scope ...any) HTMLOutput
  24295. // OnBlur calls the given handler when the element loses focus.
  24296. OnBlur(h EventHandler, scope ...any) HTMLOutput
  24297. // OnChange calls the given handler when the value of the element is changed.
  24298. OnChange(h EventHandler, scope ...any) HTMLOutput
  24299. // OnClick calls the given handler when there is a mouse click on the element.
  24300. OnClick(h EventHandler, scope ...any) HTMLOutput
  24301. // OnContextMenu calls the given handler when a context menu is triggered.
  24302. OnContextMenu(h EventHandler, scope ...any) HTMLOutput
  24303. // OnCopy calls the given handler when the user copies the content of an element.
  24304. OnCopy(h EventHandler, scope ...any) HTMLOutput
  24305. // OnCut calls the given handler when the user cuts the content of an element.
  24306. OnCut(h EventHandler, scope ...any) HTMLOutput
  24307. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  24308. OnDblClick(h EventHandler, scope ...any) HTMLOutput
  24309. // OnDrag calls the given handler when an element is dragged.
  24310. OnDrag(h EventHandler, scope ...any) HTMLOutput
  24311. // OnDragEnd calls the given handler at the end of a drag operation.
  24312. OnDragEnd(h EventHandler, scope ...any) HTMLOutput
  24313. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  24314. OnDragEnter(h EventHandler, scope ...any) HTMLOutput
  24315. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  24316. OnDragLeave(h EventHandler, scope ...any) HTMLOutput
  24317. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  24318. OnDragOver(h EventHandler, scope ...any) HTMLOutput
  24319. // OnDragStart calls the given handler at the start of a drag operation.
  24320. OnDragStart(h EventHandler, scope ...any) HTMLOutput
  24321. // OnDrop calls the given handler when dragged element is being dropped.
  24322. OnDrop(h EventHandler, scope ...any) HTMLOutput
  24323. // OnFocus calls the given handler when the element gets focus.
  24324. OnFocus(h EventHandler, scope ...any) HTMLOutput
  24325. // OnInput calls the given handler when an element gets user input.
  24326. OnInput(h EventHandler, scope ...any) HTMLOutput
  24327. // OnInvalid calls the given handler when an element is invalid.
  24328. OnInvalid(h EventHandler, scope ...any) HTMLOutput
  24329. // OnKeyDown calls the given handler when a user is pressing a key.
  24330. OnKeyDown(h EventHandler, scope ...any) HTMLOutput
  24331. // OnKeyPress calls the given handler when a user presses a key.
  24332. OnKeyPress(h EventHandler, scope ...any) HTMLOutput
  24333. // OnKeyUp calls the given handler when a user releases a key.
  24334. OnKeyUp(h EventHandler, scope ...any) HTMLOutput
  24335. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  24336. OnMouseDown(h EventHandler, scope ...any) HTMLOutput
  24337. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  24338. OnMouseMove(h EventHandler, scope ...any) HTMLOutput
  24339. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  24340. OnMouseOut(h EventHandler, scope ...any) HTMLOutput
  24341. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  24342. OnMouseOver(h EventHandler, scope ...any) HTMLOutput
  24343. // OnMouseUp calls the given handler when a mouse button is released over an element.
  24344. OnMouseUp(h EventHandler, scope ...any) HTMLOutput
  24345. // OnPaste calls the given handler when the user pastes some content in an element.
  24346. OnPaste(h EventHandler, scope ...any) HTMLOutput
  24347. // OnReset calls the given handler when the Reset button in a form is clicked.
  24348. OnReset(h EventHandler, scope ...any) HTMLOutput
  24349. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  24350. OnScroll(h EventHandler, scope ...any) HTMLOutput
  24351. // OnSearch calls the given handler when the user writes something in a search field.
  24352. OnSearch(h EventHandler, scope ...any) HTMLOutput
  24353. // OnSelect calls the given handler after some text has been selected in an element.
  24354. OnSelect(h EventHandler, scope ...any) HTMLOutput
  24355. // OnSubmit calls the given handler when a form is submitted.
  24356. OnSubmit(h EventHandler, scope ...any) HTMLOutput
  24357. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  24358. OnWheel(h EventHandler, scope ...any) HTMLOutput
  24359. }
  24360. // Output returns an HTML element that .
  24361. func Output() HTMLOutput {
  24362. e := &htmlOutput{
  24363. htmlElement: htmlElement{
  24364. tag: "output",
  24365. isSelfClosing: false,
  24366. },
  24367. }
  24368. return e
  24369. }
  24370. type htmlOutput struct {
  24371. htmlElement
  24372. }
  24373. func (e *htmlOutput) Body(v ...UI) HTMLOutput {
  24374. e.setChildren(v...)
  24375. return e
  24376. }
  24377. func (e *htmlOutput) Text(v any) HTMLOutput {
  24378. return e.Body(Text(v))
  24379. }
  24380. func (e *htmlOutput) AccessKey(v string) HTMLOutput {
  24381. e.setAttr("accesskey", v)
  24382. return e
  24383. }
  24384. func (e *htmlOutput) Aria(k string, v any) HTMLOutput {
  24385. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  24386. return e
  24387. }
  24388. func (e *htmlOutput) Attr(n string, v any) HTMLOutput {
  24389. e.setAttr(n, v)
  24390. return e
  24391. }
  24392. func (e *htmlOutput) Class(v ...string) HTMLOutput {
  24393. e.setAttr("class", strings.Join(v, " "))
  24394. return e
  24395. }
  24396. func (e *htmlOutput) ContentEditable(v bool) HTMLOutput {
  24397. e.setAttr("contenteditable", v)
  24398. return e
  24399. }
  24400. func (e *htmlOutput) DataSet(k string, v any) HTMLOutput {
  24401. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  24402. return e
  24403. }
  24404. func (e *htmlOutput) Dir(v string) HTMLOutput {
  24405. e.setAttr("dir", v)
  24406. return e
  24407. }
  24408. func (e *htmlOutput) Draggable(v bool) HTMLOutput {
  24409. e.setAttr("draggable", v)
  24410. return e
  24411. }
  24412. func (e *htmlOutput) For(v string) HTMLOutput {
  24413. e.setAttr("for", v)
  24414. return e
  24415. }
  24416. func (e *htmlOutput) Form(v string) HTMLOutput {
  24417. e.setAttr("form", v)
  24418. return e
  24419. }
  24420. func (e *htmlOutput) Hidden(v bool) HTMLOutput {
  24421. e.setAttr("hidden", v)
  24422. return e
  24423. }
  24424. func (e *htmlOutput) ID(v string) HTMLOutput {
  24425. e.setAttr("id", v)
  24426. return e
  24427. }
  24428. func (e *htmlOutput) Lang(v string) HTMLOutput {
  24429. e.setAttr("lang", v)
  24430. return e
  24431. }
  24432. func (e *htmlOutput) Name(v string) HTMLOutput {
  24433. e.setAttr("name", v)
  24434. return e
  24435. }
  24436. func (e *htmlOutput) Role(v string) HTMLOutput {
  24437. e.setAttr("role", v)
  24438. return e
  24439. }
  24440. func (e *htmlOutput) Spellcheck(v bool) HTMLOutput {
  24441. s := "false"
  24442. if v {
  24443. s = "true"
  24444. }
  24445. e.setAttr("spellcheck", s)
  24446. return e
  24447. }
  24448. func (e *htmlOutput) Style(k, v string) HTMLOutput {
  24449. e.setAttr("style", k+":"+v)
  24450. return e
  24451. }
  24452. func (e *htmlOutput) Styles(s map[string]string) HTMLOutput {
  24453. for k, v := range s {
  24454. e.Style(k, v)
  24455. }
  24456. return e
  24457. }
  24458. func (e *htmlOutput) TabIndex(v int) HTMLOutput {
  24459. e.setAttr("tabindex", v)
  24460. return e
  24461. }
  24462. func (e *htmlOutput) Title(v string) HTMLOutput {
  24463. e.setAttr("title", v)
  24464. return e
  24465. }
  24466. func (e *htmlOutput) On(event string, h EventHandler, scope ...any) HTMLOutput {
  24467. e.setEventHandler(event, h, scope...)
  24468. return e
  24469. }
  24470. func (e *htmlOutput) OnBlur(h EventHandler, scope ...any) HTMLOutput {
  24471. e.setEventHandler("blur", h, scope...)
  24472. return e
  24473. }
  24474. func (e *htmlOutput) OnChange(h EventHandler, scope ...any) HTMLOutput {
  24475. e.setEventHandler("change", h, scope...)
  24476. return e
  24477. }
  24478. func (e *htmlOutput) OnClick(h EventHandler, scope ...any) HTMLOutput {
  24479. e.setEventHandler("click", h, scope...)
  24480. return e
  24481. }
  24482. func (e *htmlOutput) OnContextMenu(h EventHandler, scope ...any) HTMLOutput {
  24483. e.setEventHandler("contextmenu", h, scope...)
  24484. return e
  24485. }
  24486. func (e *htmlOutput) OnCopy(h EventHandler, scope ...any) HTMLOutput {
  24487. e.setEventHandler("copy", h, scope...)
  24488. return e
  24489. }
  24490. func (e *htmlOutput) OnCut(h EventHandler, scope ...any) HTMLOutput {
  24491. e.setEventHandler("cut", h, scope...)
  24492. return e
  24493. }
  24494. func (e *htmlOutput) OnDblClick(h EventHandler, scope ...any) HTMLOutput {
  24495. e.setEventHandler("dblclick", h, scope...)
  24496. return e
  24497. }
  24498. func (e *htmlOutput) OnDrag(h EventHandler, scope ...any) HTMLOutput {
  24499. e.setEventHandler("drag", h, scope...)
  24500. return e
  24501. }
  24502. func (e *htmlOutput) OnDragEnd(h EventHandler, scope ...any) HTMLOutput {
  24503. e.setEventHandler("dragend", h, scope...)
  24504. return e
  24505. }
  24506. func (e *htmlOutput) OnDragEnter(h EventHandler, scope ...any) HTMLOutput {
  24507. e.setEventHandler("dragenter", h, scope...)
  24508. return e
  24509. }
  24510. func (e *htmlOutput) OnDragLeave(h EventHandler, scope ...any) HTMLOutput {
  24511. e.setEventHandler("dragleave", h, scope...)
  24512. return e
  24513. }
  24514. func (e *htmlOutput) OnDragOver(h EventHandler, scope ...any) HTMLOutput {
  24515. e.setEventHandler("dragover", h, scope...)
  24516. return e
  24517. }
  24518. func (e *htmlOutput) OnDragStart(h EventHandler, scope ...any) HTMLOutput {
  24519. e.setEventHandler("dragstart", h, scope...)
  24520. return e
  24521. }
  24522. func (e *htmlOutput) OnDrop(h EventHandler, scope ...any) HTMLOutput {
  24523. e.setEventHandler("drop", h, scope...)
  24524. return e
  24525. }
  24526. func (e *htmlOutput) OnFocus(h EventHandler, scope ...any) HTMLOutput {
  24527. e.setEventHandler("focus", h, scope...)
  24528. return e
  24529. }
  24530. func (e *htmlOutput) OnInput(h EventHandler, scope ...any) HTMLOutput {
  24531. e.setEventHandler("input", h, scope...)
  24532. return e
  24533. }
  24534. func (e *htmlOutput) OnInvalid(h EventHandler, scope ...any) HTMLOutput {
  24535. e.setEventHandler("invalid", h, scope...)
  24536. return e
  24537. }
  24538. func (e *htmlOutput) OnKeyDown(h EventHandler, scope ...any) HTMLOutput {
  24539. e.setEventHandler("keydown", h, scope...)
  24540. return e
  24541. }
  24542. func (e *htmlOutput) OnKeyPress(h EventHandler, scope ...any) HTMLOutput {
  24543. e.setEventHandler("keypress", h, scope...)
  24544. return e
  24545. }
  24546. func (e *htmlOutput) OnKeyUp(h EventHandler, scope ...any) HTMLOutput {
  24547. e.setEventHandler("keyup", h, scope...)
  24548. return e
  24549. }
  24550. func (e *htmlOutput) OnMouseDown(h EventHandler, scope ...any) HTMLOutput {
  24551. e.setEventHandler("mousedown", h, scope...)
  24552. return e
  24553. }
  24554. func (e *htmlOutput) OnMouseMove(h EventHandler, scope ...any) HTMLOutput {
  24555. e.setEventHandler("mousemove", h, scope...)
  24556. return e
  24557. }
  24558. func (e *htmlOutput) OnMouseOut(h EventHandler, scope ...any) HTMLOutput {
  24559. e.setEventHandler("mouseout", h, scope...)
  24560. return e
  24561. }
  24562. func (e *htmlOutput) OnMouseOver(h EventHandler, scope ...any) HTMLOutput {
  24563. e.setEventHandler("mouseover", h, scope...)
  24564. return e
  24565. }
  24566. func (e *htmlOutput) OnMouseUp(h EventHandler, scope ...any) HTMLOutput {
  24567. e.setEventHandler("mouseup", h, scope...)
  24568. return e
  24569. }
  24570. func (e *htmlOutput) OnPaste(h EventHandler, scope ...any) HTMLOutput {
  24571. e.setEventHandler("paste", h, scope...)
  24572. return e
  24573. }
  24574. func (e *htmlOutput) OnReset(h EventHandler, scope ...any) HTMLOutput {
  24575. e.setEventHandler("reset", h, scope...)
  24576. return e
  24577. }
  24578. func (e *htmlOutput) OnScroll(h EventHandler, scope ...any) HTMLOutput {
  24579. e.setEventHandler("scroll", h, scope...)
  24580. return e
  24581. }
  24582. func (e *htmlOutput) OnSearch(h EventHandler, scope ...any) HTMLOutput {
  24583. e.setEventHandler("search", h, scope...)
  24584. return e
  24585. }
  24586. func (e *htmlOutput) OnSelect(h EventHandler, scope ...any) HTMLOutput {
  24587. e.setEventHandler("select", h, scope...)
  24588. return e
  24589. }
  24590. func (e *htmlOutput) OnSubmit(h EventHandler, scope ...any) HTMLOutput {
  24591. e.setEventHandler("submit", h, scope...)
  24592. return e
  24593. }
  24594. func (e *htmlOutput) OnWheel(h EventHandler, scope ...any) HTMLOutput {
  24595. e.setEventHandler("wheel", h, scope...)
  24596. return e
  24597. }
  24598. // HTMLP is the interface that describes a "p" HTML element.
  24599. type HTMLP interface {
  24600. UI
  24601. // Body set the content of the element.
  24602. Body(elems ...UI) HTMLP
  24603. // Text sets the content of the element with a text node containing the stringified given value.
  24604. Text(v any) HTMLP
  24605. // AccessKey specifies a shortcut key to activate/focus an element.
  24606. AccessKey(v string) HTMLP
  24607. // Aria stores accessible rich internet applications (ARIA) data.
  24608. Aria(k string, v any) HTMLP
  24609. // Attr sets the named attribute with the given value.
  24610. Attr(n string, v any) HTMLP
  24611. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  24612. Class(v ...string) HTMLP
  24613. // ContentEditable specifies whether the content of an element is editable or not.
  24614. ContentEditable(v bool) HTMLP
  24615. // DataSet stores custom data private to the page or application.
  24616. DataSet(k string, v any) HTMLP
  24617. // Dir specifies the text direction for the content in an element.
  24618. Dir(v string) HTMLP
  24619. // Draggable specifies whether an element is draggable or not.
  24620. Draggable(v bool) HTMLP
  24621. // Hidden specifies that an element is not yet, or is no longer relevant.
  24622. Hidden(v bool) HTMLP
  24623. // ID specifies a unique id for an element.
  24624. ID(v string) HTMLP
  24625. // Lang specifies the language of the element's content.
  24626. Lang(v string) HTMLP
  24627. // Role specifies to parsing software the exact function of an element (and its children).
  24628. Role(v string) HTMLP
  24629. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  24630. Spellcheck(v bool) HTMLP
  24631. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  24632. Style(k, v string) HTMLP
  24633. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  24634. Styles(s map[string]string) HTMLP
  24635. // TabIndex specifies the tabbing order of an element.
  24636. TabIndex(v int) HTMLP
  24637. // Title specifies extra information about an element.
  24638. Title(v string) HTMLP
  24639. // On registers the given event handler to the specified event.
  24640. On(event string, h EventHandler, scope ...any) HTMLP
  24641. // OnBlur calls the given handler when the element loses focus.
  24642. OnBlur(h EventHandler, scope ...any) HTMLP
  24643. // OnChange calls the given handler when the value of the element is changed.
  24644. OnChange(h EventHandler, scope ...any) HTMLP
  24645. // OnClick calls the given handler when there is a mouse click on the element.
  24646. OnClick(h EventHandler, scope ...any) HTMLP
  24647. // OnContextMenu calls the given handler when a context menu is triggered.
  24648. OnContextMenu(h EventHandler, scope ...any) HTMLP
  24649. // OnCopy calls the given handler when the user copies the content of an element.
  24650. OnCopy(h EventHandler, scope ...any) HTMLP
  24651. // OnCut calls the given handler when the user cuts the content of an element.
  24652. OnCut(h EventHandler, scope ...any) HTMLP
  24653. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  24654. OnDblClick(h EventHandler, scope ...any) HTMLP
  24655. // OnDrag calls the given handler when an element is dragged.
  24656. OnDrag(h EventHandler, scope ...any) HTMLP
  24657. // OnDragEnd calls the given handler at the end of a drag operation.
  24658. OnDragEnd(h EventHandler, scope ...any) HTMLP
  24659. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  24660. OnDragEnter(h EventHandler, scope ...any) HTMLP
  24661. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  24662. OnDragLeave(h EventHandler, scope ...any) HTMLP
  24663. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  24664. OnDragOver(h EventHandler, scope ...any) HTMLP
  24665. // OnDragStart calls the given handler at the start of a drag operation.
  24666. OnDragStart(h EventHandler, scope ...any) HTMLP
  24667. // OnDrop calls the given handler when dragged element is being dropped.
  24668. OnDrop(h EventHandler, scope ...any) HTMLP
  24669. // OnFocus calls the given handler when the element gets focus.
  24670. OnFocus(h EventHandler, scope ...any) HTMLP
  24671. // OnInput calls the given handler when an element gets user input.
  24672. OnInput(h EventHandler, scope ...any) HTMLP
  24673. // OnInvalid calls the given handler when an element is invalid.
  24674. OnInvalid(h EventHandler, scope ...any) HTMLP
  24675. // OnKeyDown calls the given handler when a user is pressing a key.
  24676. OnKeyDown(h EventHandler, scope ...any) HTMLP
  24677. // OnKeyPress calls the given handler when a user presses a key.
  24678. OnKeyPress(h EventHandler, scope ...any) HTMLP
  24679. // OnKeyUp calls the given handler when a user releases a key.
  24680. OnKeyUp(h EventHandler, scope ...any) HTMLP
  24681. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  24682. OnMouseDown(h EventHandler, scope ...any) HTMLP
  24683. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  24684. OnMouseMove(h EventHandler, scope ...any) HTMLP
  24685. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  24686. OnMouseOut(h EventHandler, scope ...any) HTMLP
  24687. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  24688. OnMouseOver(h EventHandler, scope ...any) HTMLP
  24689. // OnMouseUp calls the given handler when a mouse button is released over an element.
  24690. OnMouseUp(h EventHandler, scope ...any) HTMLP
  24691. // OnPaste calls the given handler when the user pastes some content in an element.
  24692. OnPaste(h EventHandler, scope ...any) HTMLP
  24693. // OnReset calls the given handler when the Reset button in a form is clicked.
  24694. OnReset(h EventHandler, scope ...any) HTMLP
  24695. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  24696. OnScroll(h EventHandler, scope ...any) HTMLP
  24697. // OnSearch calls the given handler when the user writes something in a search field.
  24698. OnSearch(h EventHandler, scope ...any) HTMLP
  24699. // OnSelect calls the given handler after some text has been selected in an element.
  24700. OnSelect(h EventHandler, scope ...any) HTMLP
  24701. // OnSubmit calls the given handler when a form is submitted.
  24702. OnSubmit(h EventHandler, scope ...any) HTMLP
  24703. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  24704. OnWheel(h EventHandler, scope ...any) HTMLP
  24705. }
  24706. // P returns an HTML element that defines a paragraph.
  24707. func P() HTMLP {
  24708. e := &htmlP{
  24709. htmlElement: htmlElement{
  24710. tag: "p",
  24711. isSelfClosing: false,
  24712. },
  24713. }
  24714. return e
  24715. }
  24716. type htmlP struct {
  24717. htmlElement
  24718. }
  24719. func (e *htmlP) Body(v ...UI) HTMLP {
  24720. e.setChildren(v...)
  24721. return e
  24722. }
  24723. func (e *htmlP) Text(v any) HTMLP {
  24724. return e.Body(Text(v))
  24725. }
  24726. func (e *htmlP) AccessKey(v string) HTMLP {
  24727. e.setAttr("accesskey", v)
  24728. return e
  24729. }
  24730. func (e *htmlP) Aria(k string, v any) HTMLP {
  24731. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  24732. return e
  24733. }
  24734. func (e *htmlP) Attr(n string, v any) HTMLP {
  24735. e.setAttr(n, v)
  24736. return e
  24737. }
  24738. func (e *htmlP) Class(v ...string) HTMLP {
  24739. e.setAttr("class", strings.Join(v, " "))
  24740. return e
  24741. }
  24742. func (e *htmlP) ContentEditable(v bool) HTMLP {
  24743. e.setAttr("contenteditable", v)
  24744. return e
  24745. }
  24746. func (e *htmlP) DataSet(k string, v any) HTMLP {
  24747. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  24748. return e
  24749. }
  24750. func (e *htmlP) Dir(v string) HTMLP {
  24751. e.setAttr("dir", v)
  24752. return e
  24753. }
  24754. func (e *htmlP) Draggable(v bool) HTMLP {
  24755. e.setAttr("draggable", v)
  24756. return e
  24757. }
  24758. func (e *htmlP) Hidden(v bool) HTMLP {
  24759. e.setAttr("hidden", v)
  24760. return e
  24761. }
  24762. func (e *htmlP) ID(v string) HTMLP {
  24763. e.setAttr("id", v)
  24764. return e
  24765. }
  24766. func (e *htmlP) Lang(v string) HTMLP {
  24767. e.setAttr("lang", v)
  24768. return e
  24769. }
  24770. func (e *htmlP) Role(v string) HTMLP {
  24771. e.setAttr("role", v)
  24772. return e
  24773. }
  24774. func (e *htmlP) Spellcheck(v bool) HTMLP {
  24775. s := "false"
  24776. if v {
  24777. s = "true"
  24778. }
  24779. e.setAttr("spellcheck", s)
  24780. return e
  24781. }
  24782. func (e *htmlP) Style(k, v string) HTMLP {
  24783. e.setAttr("style", k+":"+v)
  24784. return e
  24785. }
  24786. func (e *htmlP) Styles(s map[string]string) HTMLP {
  24787. for k, v := range s {
  24788. e.Style(k, v)
  24789. }
  24790. return e
  24791. }
  24792. func (e *htmlP) TabIndex(v int) HTMLP {
  24793. e.setAttr("tabindex", v)
  24794. return e
  24795. }
  24796. func (e *htmlP) Title(v string) HTMLP {
  24797. e.setAttr("title", v)
  24798. return e
  24799. }
  24800. func (e *htmlP) On(event string, h EventHandler, scope ...any) HTMLP {
  24801. e.setEventHandler(event, h, scope...)
  24802. return e
  24803. }
  24804. func (e *htmlP) OnBlur(h EventHandler, scope ...any) HTMLP {
  24805. e.setEventHandler("blur", h, scope...)
  24806. return e
  24807. }
  24808. func (e *htmlP) OnChange(h EventHandler, scope ...any) HTMLP {
  24809. e.setEventHandler("change", h, scope...)
  24810. return e
  24811. }
  24812. func (e *htmlP) OnClick(h EventHandler, scope ...any) HTMLP {
  24813. e.setEventHandler("click", h, scope...)
  24814. return e
  24815. }
  24816. func (e *htmlP) OnContextMenu(h EventHandler, scope ...any) HTMLP {
  24817. e.setEventHandler("contextmenu", h, scope...)
  24818. return e
  24819. }
  24820. func (e *htmlP) OnCopy(h EventHandler, scope ...any) HTMLP {
  24821. e.setEventHandler("copy", h, scope...)
  24822. return e
  24823. }
  24824. func (e *htmlP) OnCut(h EventHandler, scope ...any) HTMLP {
  24825. e.setEventHandler("cut", h, scope...)
  24826. return e
  24827. }
  24828. func (e *htmlP) OnDblClick(h EventHandler, scope ...any) HTMLP {
  24829. e.setEventHandler("dblclick", h, scope...)
  24830. return e
  24831. }
  24832. func (e *htmlP) OnDrag(h EventHandler, scope ...any) HTMLP {
  24833. e.setEventHandler("drag", h, scope...)
  24834. return e
  24835. }
  24836. func (e *htmlP) OnDragEnd(h EventHandler, scope ...any) HTMLP {
  24837. e.setEventHandler("dragend", h, scope...)
  24838. return e
  24839. }
  24840. func (e *htmlP) OnDragEnter(h EventHandler, scope ...any) HTMLP {
  24841. e.setEventHandler("dragenter", h, scope...)
  24842. return e
  24843. }
  24844. func (e *htmlP) OnDragLeave(h EventHandler, scope ...any) HTMLP {
  24845. e.setEventHandler("dragleave", h, scope...)
  24846. return e
  24847. }
  24848. func (e *htmlP) OnDragOver(h EventHandler, scope ...any) HTMLP {
  24849. e.setEventHandler("dragover", h, scope...)
  24850. return e
  24851. }
  24852. func (e *htmlP) OnDragStart(h EventHandler, scope ...any) HTMLP {
  24853. e.setEventHandler("dragstart", h, scope...)
  24854. return e
  24855. }
  24856. func (e *htmlP) OnDrop(h EventHandler, scope ...any) HTMLP {
  24857. e.setEventHandler("drop", h, scope...)
  24858. return e
  24859. }
  24860. func (e *htmlP) OnFocus(h EventHandler, scope ...any) HTMLP {
  24861. e.setEventHandler("focus", h, scope...)
  24862. return e
  24863. }
  24864. func (e *htmlP) OnInput(h EventHandler, scope ...any) HTMLP {
  24865. e.setEventHandler("input", h, scope...)
  24866. return e
  24867. }
  24868. func (e *htmlP) OnInvalid(h EventHandler, scope ...any) HTMLP {
  24869. e.setEventHandler("invalid", h, scope...)
  24870. return e
  24871. }
  24872. func (e *htmlP) OnKeyDown(h EventHandler, scope ...any) HTMLP {
  24873. e.setEventHandler("keydown", h, scope...)
  24874. return e
  24875. }
  24876. func (e *htmlP) OnKeyPress(h EventHandler, scope ...any) HTMLP {
  24877. e.setEventHandler("keypress", h, scope...)
  24878. return e
  24879. }
  24880. func (e *htmlP) OnKeyUp(h EventHandler, scope ...any) HTMLP {
  24881. e.setEventHandler("keyup", h, scope...)
  24882. return e
  24883. }
  24884. func (e *htmlP) OnMouseDown(h EventHandler, scope ...any) HTMLP {
  24885. e.setEventHandler("mousedown", h, scope...)
  24886. return e
  24887. }
  24888. func (e *htmlP) OnMouseMove(h EventHandler, scope ...any) HTMLP {
  24889. e.setEventHandler("mousemove", h, scope...)
  24890. return e
  24891. }
  24892. func (e *htmlP) OnMouseOut(h EventHandler, scope ...any) HTMLP {
  24893. e.setEventHandler("mouseout", h, scope...)
  24894. return e
  24895. }
  24896. func (e *htmlP) OnMouseOver(h EventHandler, scope ...any) HTMLP {
  24897. e.setEventHandler("mouseover", h, scope...)
  24898. return e
  24899. }
  24900. func (e *htmlP) OnMouseUp(h EventHandler, scope ...any) HTMLP {
  24901. e.setEventHandler("mouseup", h, scope...)
  24902. return e
  24903. }
  24904. func (e *htmlP) OnPaste(h EventHandler, scope ...any) HTMLP {
  24905. e.setEventHandler("paste", h, scope...)
  24906. return e
  24907. }
  24908. func (e *htmlP) OnReset(h EventHandler, scope ...any) HTMLP {
  24909. e.setEventHandler("reset", h, scope...)
  24910. return e
  24911. }
  24912. func (e *htmlP) OnScroll(h EventHandler, scope ...any) HTMLP {
  24913. e.setEventHandler("scroll", h, scope...)
  24914. return e
  24915. }
  24916. func (e *htmlP) OnSearch(h EventHandler, scope ...any) HTMLP {
  24917. e.setEventHandler("search", h, scope...)
  24918. return e
  24919. }
  24920. func (e *htmlP) OnSelect(h EventHandler, scope ...any) HTMLP {
  24921. e.setEventHandler("select", h, scope...)
  24922. return e
  24923. }
  24924. func (e *htmlP) OnSubmit(h EventHandler, scope ...any) HTMLP {
  24925. e.setEventHandler("submit", h, scope...)
  24926. return e
  24927. }
  24928. func (e *htmlP) OnWheel(h EventHandler, scope ...any) HTMLP {
  24929. e.setEventHandler("wheel", h, scope...)
  24930. return e
  24931. }
  24932. // HTMLParam is the interface that describes a "param" HTML element.
  24933. type HTMLParam interface {
  24934. UI
  24935. // AccessKey specifies a shortcut key to activate/focus an element.
  24936. AccessKey(v string) HTMLParam
  24937. // Aria stores accessible rich internet applications (ARIA) data.
  24938. Aria(k string, v any) HTMLParam
  24939. // Attr sets the named attribute with the given value.
  24940. Attr(n string, v any) HTMLParam
  24941. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  24942. Class(v ...string) HTMLParam
  24943. // ContentEditable specifies whether the content of an element is editable or not.
  24944. ContentEditable(v bool) HTMLParam
  24945. // DataSet stores custom data private to the page or application.
  24946. DataSet(k string, v any) HTMLParam
  24947. // Dir specifies the text direction for the content in an element.
  24948. Dir(v string) HTMLParam
  24949. // Draggable specifies whether an element is draggable or not.
  24950. Draggable(v bool) HTMLParam
  24951. // Hidden specifies that an element is not yet, or is no longer relevant.
  24952. Hidden(v bool) HTMLParam
  24953. // ID specifies a unique id for an element.
  24954. ID(v string) HTMLParam
  24955. // Lang specifies the language of the element's content.
  24956. Lang(v string) HTMLParam
  24957. // Name specifies the name of the element.
  24958. Name(v string) HTMLParam
  24959. // Role specifies to parsing software the exact function of an element (and its children).
  24960. Role(v string) HTMLParam
  24961. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  24962. Spellcheck(v bool) HTMLParam
  24963. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  24964. Style(k, v string) HTMLParam
  24965. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  24966. Styles(s map[string]string) HTMLParam
  24967. // TabIndex specifies the tabbing order of an element.
  24968. TabIndex(v int) HTMLParam
  24969. // Title specifies extra information about an element.
  24970. Title(v string) HTMLParam
  24971. // Value specifies the value of the element.
  24972. Value(v any) HTMLParam
  24973. // On registers the given event handler to the specified event.
  24974. On(event string, h EventHandler, scope ...any) HTMLParam
  24975. // OnBlur calls the given handler when the element loses focus.
  24976. OnBlur(h EventHandler, scope ...any) HTMLParam
  24977. // OnChange calls the given handler when the value of the element is changed.
  24978. OnChange(h EventHandler, scope ...any) HTMLParam
  24979. // OnClick calls the given handler when there is a mouse click on the element.
  24980. OnClick(h EventHandler, scope ...any) HTMLParam
  24981. // OnContextMenu calls the given handler when a context menu is triggered.
  24982. OnContextMenu(h EventHandler, scope ...any) HTMLParam
  24983. // OnCopy calls the given handler when the user copies the content of an element.
  24984. OnCopy(h EventHandler, scope ...any) HTMLParam
  24985. // OnCut calls the given handler when the user cuts the content of an element.
  24986. OnCut(h EventHandler, scope ...any) HTMLParam
  24987. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  24988. OnDblClick(h EventHandler, scope ...any) HTMLParam
  24989. // OnDrag calls the given handler when an element is dragged.
  24990. OnDrag(h EventHandler, scope ...any) HTMLParam
  24991. // OnDragEnd calls the given handler at the end of a drag operation.
  24992. OnDragEnd(h EventHandler, scope ...any) HTMLParam
  24993. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  24994. OnDragEnter(h EventHandler, scope ...any) HTMLParam
  24995. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  24996. OnDragLeave(h EventHandler, scope ...any) HTMLParam
  24997. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  24998. OnDragOver(h EventHandler, scope ...any) HTMLParam
  24999. // OnDragStart calls the given handler at the start of a drag operation.
  25000. OnDragStart(h EventHandler, scope ...any) HTMLParam
  25001. // OnDrop calls the given handler when dragged element is being dropped.
  25002. OnDrop(h EventHandler, scope ...any) HTMLParam
  25003. // OnFocus calls the given handler when the element gets focus.
  25004. OnFocus(h EventHandler, scope ...any) HTMLParam
  25005. // OnInput calls the given handler when an element gets user input.
  25006. OnInput(h EventHandler, scope ...any) HTMLParam
  25007. // OnInvalid calls the given handler when an element is invalid.
  25008. OnInvalid(h EventHandler, scope ...any) HTMLParam
  25009. // OnKeyDown calls the given handler when a user is pressing a key.
  25010. OnKeyDown(h EventHandler, scope ...any) HTMLParam
  25011. // OnKeyPress calls the given handler when a user presses a key.
  25012. OnKeyPress(h EventHandler, scope ...any) HTMLParam
  25013. // OnKeyUp calls the given handler when a user releases a key.
  25014. OnKeyUp(h EventHandler, scope ...any) HTMLParam
  25015. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  25016. OnMouseDown(h EventHandler, scope ...any) HTMLParam
  25017. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  25018. OnMouseMove(h EventHandler, scope ...any) HTMLParam
  25019. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  25020. OnMouseOut(h EventHandler, scope ...any) HTMLParam
  25021. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  25022. OnMouseOver(h EventHandler, scope ...any) HTMLParam
  25023. // OnMouseUp calls the given handler when a mouse button is released over an element.
  25024. OnMouseUp(h EventHandler, scope ...any) HTMLParam
  25025. // OnPaste calls the given handler when the user pastes some content in an element.
  25026. OnPaste(h EventHandler, scope ...any) HTMLParam
  25027. // OnReset calls the given handler when the Reset button in a form is clicked.
  25028. OnReset(h EventHandler, scope ...any) HTMLParam
  25029. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  25030. OnScroll(h EventHandler, scope ...any) HTMLParam
  25031. // OnSearch calls the given handler when the user writes something in a search field.
  25032. OnSearch(h EventHandler, scope ...any) HTMLParam
  25033. // OnSelect calls the given handler after some text has been selected in an element.
  25034. OnSelect(h EventHandler, scope ...any) HTMLParam
  25035. // OnSubmit calls the given handler when a form is submitted.
  25036. OnSubmit(h EventHandler, scope ...any) HTMLParam
  25037. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  25038. OnWheel(h EventHandler, scope ...any) HTMLParam
  25039. }
  25040. // Param returns an HTML element that defines a parameter for an object.
  25041. func Param() HTMLParam {
  25042. e := &htmlParam{
  25043. htmlElement: htmlElement{
  25044. tag: "param",
  25045. isSelfClosing: true,
  25046. },
  25047. }
  25048. return e
  25049. }
  25050. type htmlParam struct {
  25051. htmlElement
  25052. }
  25053. func (e *htmlParam) AccessKey(v string) HTMLParam {
  25054. e.setAttr("accesskey", v)
  25055. return e
  25056. }
  25057. func (e *htmlParam) Aria(k string, v any) HTMLParam {
  25058. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  25059. return e
  25060. }
  25061. func (e *htmlParam) Attr(n string, v any) HTMLParam {
  25062. e.setAttr(n, v)
  25063. return e
  25064. }
  25065. func (e *htmlParam) Class(v ...string) HTMLParam {
  25066. e.setAttr("class", strings.Join(v, " "))
  25067. return e
  25068. }
  25069. func (e *htmlParam) ContentEditable(v bool) HTMLParam {
  25070. e.setAttr("contenteditable", v)
  25071. return e
  25072. }
  25073. func (e *htmlParam) DataSet(k string, v any) HTMLParam {
  25074. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  25075. return e
  25076. }
  25077. func (e *htmlParam) Dir(v string) HTMLParam {
  25078. e.setAttr("dir", v)
  25079. return e
  25080. }
  25081. func (e *htmlParam) Draggable(v bool) HTMLParam {
  25082. e.setAttr("draggable", v)
  25083. return e
  25084. }
  25085. func (e *htmlParam) Hidden(v bool) HTMLParam {
  25086. e.setAttr("hidden", v)
  25087. return e
  25088. }
  25089. func (e *htmlParam) ID(v string) HTMLParam {
  25090. e.setAttr("id", v)
  25091. return e
  25092. }
  25093. func (e *htmlParam) Lang(v string) HTMLParam {
  25094. e.setAttr("lang", v)
  25095. return e
  25096. }
  25097. func (e *htmlParam) Name(v string) HTMLParam {
  25098. e.setAttr("name", v)
  25099. return e
  25100. }
  25101. func (e *htmlParam) Role(v string) HTMLParam {
  25102. e.setAttr("role", v)
  25103. return e
  25104. }
  25105. func (e *htmlParam) Spellcheck(v bool) HTMLParam {
  25106. s := "false"
  25107. if v {
  25108. s = "true"
  25109. }
  25110. e.setAttr("spellcheck", s)
  25111. return e
  25112. }
  25113. func (e *htmlParam) Style(k, v string) HTMLParam {
  25114. e.setAttr("style", k+":"+v)
  25115. return e
  25116. }
  25117. func (e *htmlParam) Styles(s map[string]string) HTMLParam {
  25118. for k, v := range s {
  25119. e.Style(k, v)
  25120. }
  25121. return e
  25122. }
  25123. func (e *htmlParam) TabIndex(v int) HTMLParam {
  25124. e.setAttr("tabindex", v)
  25125. return e
  25126. }
  25127. func (e *htmlParam) Title(v string) HTMLParam {
  25128. e.setAttr("title", v)
  25129. return e
  25130. }
  25131. func (e *htmlParam) Value(v any) HTMLParam {
  25132. e.setAttr("value", v)
  25133. return e
  25134. }
  25135. func (e *htmlParam) On(event string, h EventHandler, scope ...any) HTMLParam {
  25136. e.setEventHandler(event, h, scope...)
  25137. return e
  25138. }
  25139. func (e *htmlParam) OnBlur(h EventHandler, scope ...any) HTMLParam {
  25140. e.setEventHandler("blur", h, scope...)
  25141. return e
  25142. }
  25143. func (e *htmlParam) OnChange(h EventHandler, scope ...any) HTMLParam {
  25144. e.setEventHandler("change", h, scope...)
  25145. return e
  25146. }
  25147. func (e *htmlParam) OnClick(h EventHandler, scope ...any) HTMLParam {
  25148. e.setEventHandler("click", h, scope...)
  25149. return e
  25150. }
  25151. func (e *htmlParam) OnContextMenu(h EventHandler, scope ...any) HTMLParam {
  25152. e.setEventHandler("contextmenu", h, scope...)
  25153. return e
  25154. }
  25155. func (e *htmlParam) OnCopy(h EventHandler, scope ...any) HTMLParam {
  25156. e.setEventHandler("copy", h, scope...)
  25157. return e
  25158. }
  25159. func (e *htmlParam) OnCut(h EventHandler, scope ...any) HTMLParam {
  25160. e.setEventHandler("cut", h, scope...)
  25161. return e
  25162. }
  25163. func (e *htmlParam) OnDblClick(h EventHandler, scope ...any) HTMLParam {
  25164. e.setEventHandler("dblclick", h, scope...)
  25165. return e
  25166. }
  25167. func (e *htmlParam) OnDrag(h EventHandler, scope ...any) HTMLParam {
  25168. e.setEventHandler("drag", h, scope...)
  25169. return e
  25170. }
  25171. func (e *htmlParam) OnDragEnd(h EventHandler, scope ...any) HTMLParam {
  25172. e.setEventHandler("dragend", h, scope...)
  25173. return e
  25174. }
  25175. func (e *htmlParam) OnDragEnter(h EventHandler, scope ...any) HTMLParam {
  25176. e.setEventHandler("dragenter", h, scope...)
  25177. return e
  25178. }
  25179. func (e *htmlParam) OnDragLeave(h EventHandler, scope ...any) HTMLParam {
  25180. e.setEventHandler("dragleave", h, scope...)
  25181. return e
  25182. }
  25183. func (e *htmlParam) OnDragOver(h EventHandler, scope ...any) HTMLParam {
  25184. e.setEventHandler("dragover", h, scope...)
  25185. return e
  25186. }
  25187. func (e *htmlParam) OnDragStart(h EventHandler, scope ...any) HTMLParam {
  25188. e.setEventHandler("dragstart", h, scope...)
  25189. return e
  25190. }
  25191. func (e *htmlParam) OnDrop(h EventHandler, scope ...any) HTMLParam {
  25192. e.setEventHandler("drop", h, scope...)
  25193. return e
  25194. }
  25195. func (e *htmlParam) OnFocus(h EventHandler, scope ...any) HTMLParam {
  25196. e.setEventHandler("focus", h, scope...)
  25197. return e
  25198. }
  25199. func (e *htmlParam) OnInput(h EventHandler, scope ...any) HTMLParam {
  25200. e.setEventHandler("input", h, scope...)
  25201. return e
  25202. }
  25203. func (e *htmlParam) OnInvalid(h EventHandler, scope ...any) HTMLParam {
  25204. e.setEventHandler("invalid", h, scope...)
  25205. return e
  25206. }
  25207. func (e *htmlParam) OnKeyDown(h EventHandler, scope ...any) HTMLParam {
  25208. e.setEventHandler("keydown", h, scope...)
  25209. return e
  25210. }
  25211. func (e *htmlParam) OnKeyPress(h EventHandler, scope ...any) HTMLParam {
  25212. e.setEventHandler("keypress", h, scope...)
  25213. return e
  25214. }
  25215. func (e *htmlParam) OnKeyUp(h EventHandler, scope ...any) HTMLParam {
  25216. e.setEventHandler("keyup", h, scope...)
  25217. return e
  25218. }
  25219. func (e *htmlParam) OnMouseDown(h EventHandler, scope ...any) HTMLParam {
  25220. e.setEventHandler("mousedown", h, scope...)
  25221. return e
  25222. }
  25223. func (e *htmlParam) OnMouseMove(h EventHandler, scope ...any) HTMLParam {
  25224. e.setEventHandler("mousemove", h, scope...)
  25225. return e
  25226. }
  25227. func (e *htmlParam) OnMouseOut(h EventHandler, scope ...any) HTMLParam {
  25228. e.setEventHandler("mouseout", h, scope...)
  25229. return e
  25230. }
  25231. func (e *htmlParam) OnMouseOver(h EventHandler, scope ...any) HTMLParam {
  25232. e.setEventHandler("mouseover", h, scope...)
  25233. return e
  25234. }
  25235. func (e *htmlParam) OnMouseUp(h EventHandler, scope ...any) HTMLParam {
  25236. e.setEventHandler("mouseup", h, scope...)
  25237. return e
  25238. }
  25239. func (e *htmlParam) OnPaste(h EventHandler, scope ...any) HTMLParam {
  25240. e.setEventHandler("paste", h, scope...)
  25241. return e
  25242. }
  25243. func (e *htmlParam) OnReset(h EventHandler, scope ...any) HTMLParam {
  25244. e.setEventHandler("reset", h, scope...)
  25245. return e
  25246. }
  25247. func (e *htmlParam) OnScroll(h EventHandler, scope ...any) HTMLParam {
  25248. e.setEventHandler("scroll", h, scope...)
  25249. return e
  25250. }
  25251. func (e *htmlParam) OnSearch(h EventHandler, scope ...any) HTMLParam {
  25252. e.setEventHandler("search", h, scope...)
  25253. return e
  25254. }
  25255. func (e *htmlParam) OnSelect(h EventHandler, scope ...any) HTMLParam {
  25256. e.setEventHandler("select", h, scope...)
  25257. return e
  25258. }
  25259. func (e *htmlParam) OnSubmit(h EventHandler, scope ...any) HTMLParam {
  25260. e.setEventHandler("submit", h, scope...)
  25261. return e
  25262. }
  25263. func (e *htmlParam) OnWheel(h EventHandler, scope ...any) HTMLParam {
  25264. e.setEventHandler("wheel", h, scope...)
  25265. return e
  25266. }
  25267. // HTMLPicture is the interface that describes a "picture" HTML element.
  25268. type HTMLPicture interface {
  25269. UI
  25270. // Body set the content of the element.
  25271. Body(elems ...UI) HTMLPicture
  25272. // Text sets the content of the element with a text node containing the stringified given value.
  25273. Text(v any) HTMLPicture
  25274. // AccessKey specifies a shortcut key to activate/focus an element.
  25275. AccessKey(v string) HTMLPicture
  25276. // Aria stores accessible rich internet applications (ARIA) data.
  25277. Aria(k string, v any) HTMLPicture
  25278. // Attr sets the named attribute with the given value.
  25279. Attr(n string, v any) HTMLPicture
  25280. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  25281. Class(v ...string) HTMLPicture
  25282. // ContentEditable specifies whether the content of an element is editable or not.
  25283. ContentEditable(v bool) HTMLPicture
  25284. // DataSet stores custom data private to the page or application.
  25285. DataSet(k string, v any) HTMLPicture
  25286. // Dir specifies the text direction for the content in an element.
  25287. Dir(v string) HTMLPicture
  25288. // Draggable specifies whether an element is draggable or not.
  25289. Draggable(v bool) HTMLPicture
  25290. // Hidden specifies that an element is not yet, or is no longer relevant.
  25291. Hidden(v bool) HTMLPicture
  25292. // ID specifies a unique id for an element.
  25293. ID(v string) HTMLPicture
  25294. // Lang specifies the language of the element's content.
  25295. Lang(v string) HTMLPicture
  25296. // Role specifies to parsing software the exact function of an element (and its children).
  25297. Role(v string) HTMLPicture
  25298. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  25299. Spellcheck(v bool) HTMLPicture
  25300. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  25301. Style(k, v string) HTMLPicture
  25302. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  25303. Styles(s map[string]string) HTMLPicture
  25304. // TabIndex specifies the tabbing order of an element.
  25305. TabIndex(v int) HTMLPicture
  25306. // Title specifies extra information about an element.
  25307. Title(v string) HTMLPicture
  25308. // On registers the given event handler to the specified event.
  25309. On(event string, h EventHandler, scope ...any) HTMLPicture
  25310. // OnBlur calls the given handler when the element loses focus.
  25311. OnBlur(h EventHandler, scope ...any) HTMLPicture
  25312. // OnChange calls the given handler when the value of the element is changed.
  25313. OnChange(h EventHandler, scope ...any) HTMLPicture
  25314. // OnClick calls the given handler when there is a mouse click on the element.
  25315. OnClick(h EventHandler, scope ...any) HTMLPicture
  25316. // OnContextMenu calls the given handler when a context menu is triggered.
  25317. OnContextMenu(h EventHandler, scope ...any) HTMLPicture
  25318. // OnCopy calls the given handler when the user copies the content of an element.
  25319. OnCopy(h EventHandler, scope ...any) HTMLPicture
  25320. // OnCut calls the given handler when the user cuts the content of an element.
  25321. OnCut(h EventHandler, scope ...any) HTMLPicture
  25322. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  25323. OnDblClick(h EventHandler, scope ...any) HTMLPicture
  25324. // OnDrag calls the given handler when an element is dragged.
  25325. OnDrag(h EventHandler, scope ...any) HTMLPicture
  25326. // OnDragEnd calls the given handler at the end of a drag operation.
  25327. OnDragEnd(h EventHandler, scope ...any) HTMLPicture
  25328. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  25329. OnDragEnter(h EventHandler, scope ...any) HTMLPicture
  25330. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  25331. OnDragLeave(h EventHandler, scope ...any) HTMLPicture
  25332. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  25333. OnDragOver(h EventHandler, scope ...any) HTMLPicture
  25334. // OnDragStart calls the given handler at the start of a drag operation.
  25335. OnDragStart(h EventHandler, scope ...any) HTMLPicture
  25336. // OnDrop calls the given handler when dragged element is being dropped.
  25337. OnDrop(h EventHandler, scope ...any) HTMLPicture
  25338. // OnFocus calls the given handler when the element gets focus.
  25339. OnFocus(h EventHandler, scope ...any) HTMLPicture
  25340. // OnInput calls the given handler when an element gets user input.
  25341. OnInput(h EventHandler, scope ...any) HTMLPicture
  25342. // OnInvalid calls the given handler when an element is invalid.
  25343. OnInvalid(h EventHandler, scope ...any) HTMLPicture
  25344. // OnKeyDown calls the given handler when a user is pressing a key.
  25345. OnKeyDown(h EventHandler, scope ...any) HTMLPicture
  25346. // OnKeyPress calls the given handler when a user presses a key.
  25347. OnKeyPress(h EventHandler, scope ...any) HTMLPicture
  25348. // OnKeyUp calls the given handler when a user releases a key.
  25349. OnKeyUp(h EventHandler, scope ...any) HTMLPicture
  25350. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  25351. OnMouseDown(h EventHandler, scope ...any) HTMLPicture
  25352. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  25353. OnMouseMove(h EventHandler, scope ...any) HTMLPicture
  25354. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  25355. OnMouseOut(h EventHandler, scope ...any) HTMLPicture
  25356. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  25357. OnMouseOver(h EventHandler, scope ...any) HTMLPicture
  25358. // OnMouseUp calls the given handler when a mouse button is released over an element.
  25359. OnMouseUp(h EventHandler, scope ...any) HTMLPicture
  25360. // OnPaste calls the given handler when the user pastes some content in an element.
  25361. OnPaste(h EventHandler, scope ...any) HTMLPicture
  25362. // OnReset calls the given handler when the Reset button in a form is clicked.
  25363. OnReset(h EventHandler, scope ...any) HTMLPicture
  25364. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  25365. OnScroll(h EventHandler, scope ...any) HTMLPicture
  25366. // OnSearch calls the given handler when the user writes something in a search field.
  25367. OnSearch(h EventHandler, scope ...any) HTMLPicture
  25368. // OnSelect calls the given handler after some text has been selected in an element.
  25369. OnSelect(h EventHandler, scope ...any) HTMLPicture
  25370. // OnSubmit calls the given handler when a form is submitted.
  25371. OnSubmit(h EventHandler, scope ...any) HTMLPicture
  25372. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  25373. OnWheel(h EventHandler, scope ...any) HTMLPicture
  25374. }
  25375. // Picture returns an HTML element that defines a container for multiple image resources.
  25376. func Picture() HTMLPicture {
  25377. e := &htmlPicture{
  25378. htmlElement: htmlElement{
  25379. tag: "picture",
  25380. isSelfClosing: false,
  25381. },
  25382. }
  25383. return e
  25384. }
  25385. type htmlPicture struct {
  25386. htmlElement
  25387. }
  25388. func (e *htmlPicture) Body(v ...UI) HTMLPicture {
  25389. e.setChildren(v...)
  25390. return e
  25391. }
  25392. func (e *htmlPicture) Text(v any) HTMLPicture {
  25393. return e.Body(Text(v))
  25394. }
  25395. func (e *htmlPicture) AccessKey(v string) HTMLPicture {
  25396. e.setAttr("accesskey", v)
  25397. return e
  25398. }
  25399. func (e *htmlPicture) Aria(k string, v any) HTMLPicture {
  25400. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  25401. return e
  25402. }
  25403. func (e *htmlPicture) Attr(n string, v any) HTMLPicture {
  25404. e.setAttr(n, v)
  25405. return e
  25406. }
  25407. func (e *htmlPicture) Class(v ...string) HTMLPicture {
  25408. e.setAttr("class", strings.Join(v, " "))
  25409. return e
  25410. }
  25411. func (e *htmlPicture) ContentEditable(v bool) HTMLPicture {
  25412. e.setAttr("contenteditable", v)
  25413. return e
  25414. }
  25415. func (e *htmlPicture) DataSet(k string, v any) HTMLPicture {
  25416. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  25417. return e
  25418. }
  25419. func (e *htmlPicture) Dir(v string) HTMLPicture {
  25420. e.setAttr("dir", v)
  25421. return e
  25422. }
  25423. func (e *htmlPicture) Draggable(v bool) HTMLPicture {
  25424. e.setAttr("draggable", v)
  25425. return e
  25426. }
  25427. func (e *htmlPicture) Hidden(v bool) HTMLPicture {
  25428. e.setAttr("hidden", v)
  25429. return e
  25430. }
  25431. func (e *htmlPicture) ID(v string) HTMLPicture {
  25432. e.setAttr("id", v)
  25433. return e
  25434. }
  25435. func (e *htmlPicture) Lang(v string) HTMLPicture {
  25436. e.setAttr("lang", v)
  25437. return e
  25438. }
  25439. func (e *htmlPicture) Role(v string) HTMLPicture {
  25440. e.setAttr("role", v)
  25441. return e
  25442. }
  25443. func (e *htmlPicture) Spellcheck(v bool) HTMLPicture {
  25444. s := "false"
  25445. if v {
  25446. s = "true"
  25447. }
  25448. e.setAttr("spellcheck", s)
  25449. return e
  25450. }
  25451. func (e *htmlPicture) Style(k, v string) HTMLPicture {
  25452. e.setAttr("style", k+":"+v)
  25453. return e
  25454. }
  25455. func (e *htmlPicture) Styles(s map[string]string) HTMLPicture {
  25456. for k, v := range s {
  25457. e.Style(k, v)
  25458. }
  25459. return e
  25460. }
  25461. func (e *htmlPicture) TabIndex(v int) HTMLPicture {
  25462. e.setAttr("tabindex", v)
  25463. return e
  25464. }
  25465. func (e *htmlPicture) Title(v string) HTMLPicture {
  25466. e.setAttr("title", v)
  25467. return e
  25468. }
  25469. func (e *htmlPicture) On(event string, h EventHandler, scope ...any) HTMLPicture {
  25470. e.setEventHandler(event, h, scope...)
  25471. return e
  25472. }
  25473. func (e *htmlPicture) OnBlur(h EventHandler, scope ...any) HTMLPicture {
  25474. e.setEventHandler("blur", h, scope...)
  25475. return e
  25476. }
  25477. func (e *htmlPicture) OnChange(h EventHandler, scope ...any) HTMLPicture {
  25478. e.setEventHandler("change", h, scope...)
  25479. return e
  25480. }
  25481. func (e *htmlPicture) OnClick(h EventHandler, scope ...any) HTMLPicture {
  25482. e.setEventHandler("click", h, scope...)
  25483. return e
  25484. }
  25485. func (e *htmlPicture) OnContextMenu(h EventHandler, scope ...any) HTMLPicture {
  25486. e.setEventHandler("contextmenu", h, scope...)
  25487. return e
  25488. }
  25489. func (e *htmlPicture) OnCopy(h EventHandler, scope ...any) HTMLPicture {
  25490. e.setEventHandler("copy", h, scope...)
  25491. return e
  25492. }
  25493. func (e *htmlPicture) OnCut(h EventHandler, scope ...any) HTMLPicture {
  25494. e.setEventHandler("cut", h, scope...)
  25495. return e
  25496. }
  25497. func (e *htmlPicture) OnDblClick(h EventHandler, scope ...any) HTMLPicture {
  25498. e.setEventHandler("dblclick", h, scope...)
  25499. return e
  25500. }
  25501. func (e *htmlPicture) OnDrag(h EventHandler, scope ...any) HTMLPicture {
  25502. e.setEventHandler("drag", h, scope...)
  25503. return e
  25504. }
  25505. func (e *htmlPicture) OnDragEnd(h EventHandler, scope ...any) HTMLPicture {
  25506. e.setEventHandler("dragend", h, scope...)
  25507. return e
  25508. }
  25509. func (e *htmlPicture) OnDragEnter(h EventHandler, scope ...any) HTMLPicture {
  25510. e.setEventHandler("dragenter", h, scope...)
  25511. return e
  25512. }
  25513. func (e *htmlPicture) OnDragLeave(h EventHandler, scope ...any) HTMLPicture {
  25514. e.setEventHandler("dragleave", h, scope...)
  25515. return e
  25516. }
  25517. func (e *htmlPicture) OnDragOver(h EventHandler, scope ...any) HTMLPicture {
  25518. e.setEventHandler("dragover", h, scope...)
  25519. return e
  25520. }
  25521. func (e *htmlPicture) OnDragStart(h EventHandler, scope ...any) HTMLPicture {
  25522. e.setEventHandler("dragstart", h, scope...)
  25523. return e
  25524. }
  25525. func (e *htmlPicture) OnDrop(h EventHandler, scope ...any) HTMLPicture {
  25526. e.setEventHandler("drop", h, scope...)
  25527. return e
  25528. }
  25529. func (e *htmlPicture) OnFocus(h EventHandler, scope ...any) HTMLPicture {
  25530. e.setEventHandler("focus", h, scope...)
  25531. return e
  25532. }
  25533. func (e *htmlPicture) OnInput(h EventHandler, scope ...any) HTMLPicture {
  25534. e.setEventHandler("input", h, scope...)
  25535. return e
  25536. }
  25537. func (e *htmlPicture) OnInvalid(h EventHandler, scope ...any) HTMLPicture {
  25538. e.setEventHandler("invalid", h, scope...)
  25539. return e
  25540. }
  25541. func (e *htmlPicture) OnKeyDown(h EventHandler, scope ...any) HTMLPicture {
  25542. e.setEventHandler("keydown", h, scope...)
  25543. return e
  25544. }
  25545. func (e *htmlPicture) OnKeyPress(h EventHandler, scope ...any) HTMLPicture {
  25546. e.setEventHandler("keypress", h, scope...)
  25547. return e
  25548. }
  25549. func (e *htmlPicture) OnKeyUp(h EventHandler, scope ...any) HTMLPicture {
  25550. e.setEventHandler("keyup", h, scope...)
  25551. return e
  25552. }
  25553. func (e *htmlPicture) OnMouseDown(h EventHandler, scope ...any) HTMLPicture {
  25554. e.setEventHandler("mousedown", h, scope...)
  25555. return e
  25556. }
  25557. func (e *htmlPicture) OnMouseMove(h EventHandler, scope ...any) HTMLPicture {
  25558. e.setEventHandler("mousemove", h, scope...)
  25559. return e
  25560. }
  25561. func (e *htmlPicture) OnMouseOut(h EventHandler, scope ...any) HTMLPicture {
  25562. e.setEventHandler("mouseout", h, scope...)
  25563. return e
  25564. }
  25565. func (e *htmlPicture) OnMouseOver(h EventHandler, scope ...any) HTMLPicture {
  25566. e.setEventHandler("mouseover", h, scope...)
  25567. return e
  25568. }
  25569. func (e *htmlPicture) OnMouseUp(h EventHandler, scope ...any) HTMLPicture {
  25570. e.setEventHandler("mouseup", h, scope...)
  25571. return e
  25572. }
  25573. func (e *htmlPicture) OnPaste(h EventHandler, scope ...any) HTMLPicture {
  25574. e.setEventHandler("paste", h, scope...)
  25575. return e
  25576. }
  25577. func (e *htmlPicture) OnReset(h EventHandler, scope ...any) HTMLPicture {
  25578. e.setEventHandler("reset", h, scope...)
  25579. return e
  25580. }
  25581. func (e *htmlPicture) OnScroll(h EventHandler, scope ...any) HTMLPicture {
  25582. e.setEventHandler("scroll", h, scope...)
  25583. return e
  25584. }
  25585. func (e *htmlPicture) OnSearch(h EventHandler, scope ...any) HTMLPicture {
  25586. e.setEventHandler("search", h, scope...)
  25587. return e
  25588. }
  25589. func (e *htmlPicture) OnSelect(h EventHandler, scope ...any) HTMLPicture {
  25590. e.setEventHandler("select", h, scope...)
  25591. return e
  25592. }
  25593. func (e *htmlPicture) OnSubmit(h EventHandler, scope ...any) HTMLPicture {
  25594. e.setEventHandler("submit", h, scope...)
  25595. return e
  25596. }
  25597. func (e *htmlPicture) OnWheel(h EventHandler, scope ...any) HTMLPicture {
  25598. e.setEventHandler("wheel", h, scope...)
  25599. return e
  25600. }
  25601. // HTMLPre is the interface that describes a "pre" HTML element.
  25602. type HTMLPre interface {
  25603. UI
  25604. // Body set the content of the element.
  25605. Body(elems ...UI) HTMLPre
  25606. // Text sets the content of the element with a text node containing the stringified given value.
  25607. Text(v any) HTMLPre
  25608. // AccessKey specifies a shortcut key to activate/focus an element.
  25609. AccessKey(v string) HTMLPre
  25610. // Aria stores accessible rich internet applications (ARIA) data.
  25611. Aria(k string, v any) HTMLPre
  25612. // Attr sets the named attribute with the given value.
  25613. Attr(n string, v any) HTMLPre
  25614. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  25615. Class(v ...string) HTMLPre
  25616. // ContentEditable specifies whether the content of an element is editable or not.
  25617. ContentEditable(v bool) HTMLPre
  25618. // DataSet stores custom data private to the page or application.
  25619. DataSet(k string, v any) HTMLPre
  25620. // Dir specifies the text direction for the content in an element.
  25621. Dir(v string) HTMLPre
  25622. // Draggable specifies whether an element is draggable or not.
  25623. Draggable(v bool) HTMLPre
  25624. // Hidden specifies that an element is not yet, or is no longer relevant.
  25625. Hidden(v bool) HTMLPre
  25626. // ID specifies a unique id for an element.
  25627. ID(v string) HTMLPre
  25628. // Lang specifies the language of the element's content.
  25629. Lang(v string) HTMLPre
  25630. // Role specifies to parsing software the exact function of an element (and its children).
  25631. Role(v string) HTMLPre
  25632. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  25633. Spellcheck(v bool) HTMLPre
  25634. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  25635. Style(k, v string) HTMLPre
  25636. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  25637. Styles(s map[string]string) HTMLPre
  25638. // TabIndex specifies the tabbing order of an element.
  25639. TabIndex(v int) HTMLPre
  25640. // Title specifies extra information about an element.
  25641. Title(v string) HTMLPre
  25642. // On registers the given event handler to the specified event.
  25643. On(event string, h EventHandler, scope ...any) HTMLPre
  25644. // OnBlur calls the given handler when the element loses focus.
  25645. OnBlur(h EventHandler, scope ...any) HTMLPre
  25646. // OnChange calls the given handler when the value of the element is changed.
  25647. OnChange(h EventHandler, scope ...any) HTMLPre
  25648. // OnClick calls the given handler when there is a mouse click on the element.
  25649. OnClick(h EventHandler, scope ...any) HTMLPre
  25650. // OnContextMenu calls the given handler when a context menu is triggered.
  25651. OnContextMenu(h EventHandler, scope ...any) HTMLPre
  25652. // OnCopy calls the given handler when the user copies the content of an element.
  25653. OnCopy(h EventHandler, scope ...any) HTMLPre
  25654. // OnCut calls the given handler when the user cuts the content of an element.
  25655. OnCut(h EventHandler, scope ...any) HTMLPre
  25656. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  25657. OnDblClick(h EventHandler, scope ...any) HTMLPre
  25658. // OnDrag calls the given handler when an element is dragged.
  25659. OnDrag(h EventHandler, scope ...any) HTMLPre
  25660. // OnDragEnd calls the given handler at the end of a drag operation.
  25661. OnDragEnd(h EventHandler, scope ...any) HTMLPre
  25662. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  25663. OnDragEnter(h EventHandler, scope ...any) HTMLPre
  25664. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  25665. OnDragLeave(h EventHandler, scope ...any) HTMLPre
  25666. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  25667. OnDragOver(h EventHandler, scope ...any) HTMLPre
  25668. // OnDragStart calls the given handler at the start of a drag operation.
  25669. OnDragStart(h EventHandler, scope ...any) HTMLPre
  25670. // OnDrop calls the given handler when dragged element is being dropped.
  25671. OnDrop(h EventHandler, scope ...any) HTMLPre
  25672. // OnFocus calls the given handler when the element gets focus.
  25673. OnFocus(h EventHandler, scope ...any) HTMLPre
  25674. // OnInput calls the given handler when an element gets user input.
  25675. OnInput(h EventHandler, scope ...any) HTMLPre
  25676. // OnInvalid calls the given handler when an element is invalid.
  25677. OnInvalid(h EventHandler, scope ...any) HTMLPre
  25678. // OnKeyDown calls the given handler when a user is pressing a key.
  25679. OnKeyDown(h EventHandler, scope ...any) HTMLPre
  25680. // OnKeyPress calls the given handler when a user presses a key.
  25681. OnKeyPress(h EventHandler, scope ...any) HTMLPre
  25682. // OnKeyUp calls the given handler when a user releases a key.
  25683. OnKeyUp(h EventHandler, scope ...any) HTMLPre
  25684. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  25685. OnMouseDown(h EventHandler, scope ...any) HTMLPre
  25686. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  25687. OnMouseMove(h EventHandler, scope ...any) HTMLPre
  25688. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  25689. OnMouseOut(h EventHandler, scope ...any) HTMLPre
  25690. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  25691. OnMouseOver(h EventHandler, scope ...any) HTMLPre
  25692. // OnMouseUp calls the given handler when a mouse button is released over an element.
  25693. OnMouseUp(h EventHandler, scope ...any) HTMLPre
  25694. // OnPaste calls the given handler when the user pastes some content in an element.
  25695. OnPaste(h EventHandler, scope ...any) HTMLPre
  25696. // OnReset calls the given handler when the Reset button in a form is clicked.
  25697. OnReset(h EventHandler, scope ...any) HTMLPre
  25698. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  25699. OnScroll(h EventHandler, scope ...any) HTMLPre
  25700. // OnSearch calls the given handler when the user writes something in a search field.
  25701. OnSearch(h EventHandler, scope ...any) HTMLPre
  25702. // OnSelect calls the given handler after some text has been selected in an element.
  25703. OnSelect(h EventHandler, scope ...any) HTMLPre
  25704. // OnSubmit calls the given handler when a form is submitted.
  25705. OnSubmit(h EventHandler, scope ...any) HTMLPre
  25706. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  25707. OnWheel(h EventHandler, scope ...any) HTMLPre
  25708. }
  25709. // Pre returns an HTML element that defines preformatted text.
  25710. func Pre() HTMLPre {
  25711. e := &htmlPre{
  25712. htmlElement: htmlElement{
  25713. tag: "pre",
  25714. isSelfClosing: false,
  25715. },
  25716. }
  25717. return e
  25718. }
  25719. type htmlPre struct {
  25720. htmlElement
  25721. }
  25722. func (e *htmlPre) Body(v ...UI) HTMLPre {
  25723. e.setChildren(v...)
  25724. return e
  25725. }
  25726. func (e *htmlPre) Text(v any) HTMLPre {
  25727. return e.Body(Text(v))
  25728. }
  25729. func (e *htmlPre) AccessKey(v string) HTMLPre {
  25730. e.setAttr("accesskey", v)
  25731. return e
  25732. }
  25733. func (e *htmlPre) Aria(k string, v any) HTMLPre {
  25734. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  25735. return e
  25736. }
  25737. func (e *htmlPre) Attr(n string, v any) HTMLPre {
  25738. e.setAttr(n, v)
  25739. return e
  25740. }
  25741. func (e *htmlPre) Class(v ...string) HTMLPre {
  25742. e.setAttr("class", strings.Join(v, " "))
  25743. return e
  25744. }
  25745. func (e *htmlPre) ContentEditable(v bool) HTMLPre {
  25746. e.setAttr("contenteditable", v)
  25747. return e
  25748. }
  25749. func (e *htmlPre) DataSet(k string, v any) HTMLPre {
  25750. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  25751. return e
  25752. }
  25753. func (e *htmlPre) Dir(v string) HTMLPre {
  25754. e.setAttr("dir", v)
  25755. return e
  25756. }
  25757. func (e *htmlPre) Draggable(v bool) HTMLPre {
  25758. e.setAttr("draggable", v)
  25759. return e
  25760. }
  25761. func (e *htmlPre) Hidden(v bool) HTMLPre {
  25762. e.setAttr("hidden", v)
  25763. return e
  25764. }
  25765. func (e *htmlPre) ID(v string) HTMLPre {
  25766. e.setAttr("id", v)
  25767. return e
  25768. }
  25769. func (e *htmlPre) Lang(v string) HTMLPre {
  25770. e.setAttr("lang", v)
  25771. return e
  25772. }
  25773. func (e *htmlPre) Role(v string) HTMLPre {
  25774. e.setAttr("role", v)
  25775. return e
  25776. }
  25777. func (e *htmlPre) Spellcheck(v bool) HTMLPre {
  25778. s := "false"
  25779. if v {
  25780. s = "true"
  25781. }
  25782. e.setAttr("spellcheck", s)
  25783. return e
  25784. }
  25785. func (e *htmlPre) Style(k, v string) HTMLPre {
  25786. e.setAttr("style", k+":"+v)
  25787. return e
  25788. }
  25789. func (e *htmlPre) Styles(s map[string]string) HTMLPre {
  25790. for k, v := range s {
  25791. e.Style(k, v)
  25792. }
  25793. return e
  25794. }
  25795. func (e *htmlPre) TabIndex(v int) HTMLPre {
  25796. e.setAttr("tabindex", v)
  25797. return e
  25798. }
  25799. func (e *htmlPre) Title(v string) HTMLPre {
  25800. e.setAttr("title", v)
  25801. return e
  25802. }
  25803. func (e *htmlPre) On(event string, h EventHandler, scope ...any) HTMLPre {
  25804. e.setEventHandler(event, h, scope...)
  25805. return e
  25806. }
  25807. func (e *htmlPre) OnBlur(h EventHandler, scope ...any) HTMLPre {
  25808. e.setEventHandler("blur", h, scope...)
  25809. return e
  25810. }
  25811. func (e *htmlPre) OnChange(h EventHandler, scope ...any) HTMLPre {
  25812. e.setEventHandler("change", h, scope...)
  25813. return e
  25814. }
  25815. func (e *htmlPre) OnClick(h EventHandler, scope ...any) HTMLPre {
  25816. e.setEventHandler("click", h, scope...)
  25817. return e
  25818. }
  25819. func (e *htmlPre) OnContextMenu(h EventHandler, scope ...any) HTMLPre {
  25820. e.setEventHandler("contextmenu", h, scope...)
  25821. return e
  25822. }
  25823. func (e *htmlPre) OnCopy(h EventHandler, scope ...any) HTMLPre {
  25824. e.setEventHandler("copy", h, scope...)
  25825. return e
  25826. }
  25827. func (e *htmlPre) OnCut(h EventHandler, scope ...any) HTMLPre {
  25828. e.setEventHandler("cut", h, scope...)
  25829. return e
  25830. }
  25831. func (e *htmlPre) OnDblClick(h EventHandler, scope ...any) HTMLPre {
  25832. e.setEventHandler("dblclick", h, scope...)
  25833. return e
  25834. }
  25835. func (e *htmlPre) OnDrag(h EventHandler, scope ...any) HTMLPre {
  25836. e.setEventHandler("drag", h, scope...)
  25837. return e
  25838. }
  25839. func (e *htmlPre) OnDragEnd(h EventHandler, scope ...any) HTMLPre {
  25840. e.setEventHandler("dragend", h, scope...)
  25841. return e
  25842. }
  25843. func (e *htmlPre) OnDragEnter(h EventHandler, scope ...any) HTMLPre {
  25844. e.setEventHandler("dragenter", h, scope...)
  25845. return e
  25846. }
  25847. func (e *htmlPre) OnDragLeave(h EventHandler, scope ...any) HTMLPre {
  25848. e.setEventHandler("dragleave", h, scope...)
  25849. return e
  25850. }
  25851. func (e *htmlPre) OnDragOver(h EventHandler, scope ...any) HTMLPre {
  25852. e.setEventHandler("dragover", h, scope...)
  25853. return e
  25854. }
  25855. func (e *htmlPre) OnDragStart(h EventHandler, scope ...any) HTMLPre {
  25856. e.setEventHandler("dragstart", h, scope...)
  25857. return e
  25858. }
  25859. func (e *htmlPre) OnDrop(h EventHandler, scope ...any) HTMLPre {
  25860. e.setEventHandler("drop", h, scope...)
  25861. return e
  25862. }
  25863. func (e *htmlPre) OnFocus(h EventHandler, scope ...any) HTMLPre {
  25864. e.setEventHandler("focus", h, scope...)
  25865. return e
  25866. }
  25867. func (e *htmlPre) OnInput(h EventHandler, scope ...any) HTMLPre {
  25868. e.setEventHandler("input", h, scope...)
  25869. return e
  25870. }
  25871. func (e *htmlPre) OnInvalid(h EventHandler, scope ...any) HTMLPre {
  25872. e.setEventHandler("invalid", h, scope...)
  25873. return e
  25874. }
  25875. func (e *htmlPre) OnKeyDown(h EventHandler, scope ...any) HTMLPre {
  25876. e.setEventHandler("keydown", h, scope...)
  25877. return e
  25878. }
  25879. func (e *htmlPre) OnKeyPress(h EventHandler, scope ...any) HTMLPre {
  25880. e.setEventHandler("keypress", h, scope...)
  25881. return e
  25882. }
  25883. func (e *htmlPre) OnKeyUp(h EventHandler, scope ...any) HTMLPre {
  25884. e.setEventHandler("keyup", h, scope...)
  25885. return e
  25886. }
  25887. func (e *htmlPre) OnMouseDown(h EventHandler, scope ...any) HTMLPre {
  25888. e.setEventHandler("mousedown", h, scope...)
  25889. return e
  25890. }
  25891. func (e *htmlPre) OnMouseMove(h EventHandler, scope ...any) HTMLPre {
  25892. e.setEventHandler("mousemove", h, scope...)
  25893. return e
  25894. }
  25895. func (e *htmlPre) OnMouseOut(h EventHandler, scope ...any) HTMLPre {
  25896. e.setEventHandler("mouseout", h, scope...)
  25897. return e
  25898. }
  25899. func (e *htmlPre) OnMouseOver(h EventHandler, scope ...any) HTMLPre {
  25900. e.setEventHandler("mouseover", h, scope...)
  25901. return e
  25902. }
  25903. func (e *htmlPre) OnMouseUp(h EventHandler, scope ...any) HTMLPre {
  25904. e.setEventHandler("mouseup", h, scope...)
  25905. return e
  25906. }
  25907. func (e *htmlPre) OnPaste(h EventHandler, scope ...any) HTMLPre {
  25908. e.setEventHandler("paste", h, scope...)
  25909. return e
  25910. }
  25911. func (e *htmlPre) OnReset(h EventHandler, scope ...any) HTMLPre {
  25912. e.setEventHandler("reset", h, scope...)
  25913. return e
  25914. }
  25915. func (e *htmlPre) OnScroll(h EventHandler, scope ...any) HTMLPre {
  25916. e.setEventHandler("scroll", h, scope...)
  25917. return e
  25918. }
  25919. func (e *htmlPre) OnSearch(h EventHandler, scope ...any) HTMLPre {
  25920. e.setEventHandler("search", h, scope...)
  25921. return e
  25922. }
  25923. func (e *htmlPre) OnSelect(h EventHandler, scope ...any) HTMLPre {
  25924. e.setEventHandler("select", h, scope...)
  25925. return e
  25926. }
  25927. func (e *htmlPre) OnSubmit(h EventHandler, scope ...any) HTMLPre {
  25928. e.setEventHandler("submit", h, scope...)
  25929. return e
  25930. }
  25931. func (e *htmlPre) OnWheel(h EventHandler, scope ...any) HTMLPre {
  25932. e.setEventHandler("wheel", h, scope...)
  25933. return e
  25934. }
  25935. // HTMLProgress is the interface that describes a "progress" HTML element.
  25936. type HTMLProgress interface {
  25937. UI
  25938. // Body set the content of the element.
  25939. Body(elems ...UI) HTMLProgress
  25940. // Text sets the content of the element with a text node containing the stringified given value.
  25941. Text(v any) HTMLProgress
  25942. // AccessKey specifies a shortcut key to activate/focus an element.
  25943. AccessKey(v string) HTMLProgress
  25944. // Aria stores accessible rich internet applications (ARIA) data.
  25945. Aria(k string, v any) HTMLProgress
  25946. // Attr sets the named attribute with the given value.
  25947. Attr(n string, v any) HTMLProgress
  25948. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  25949. Class(v ...string) HTMLProgress
  25950. // ContentEditable specifies whether the content of an element is editable or not.
  25951. ContentEditable(v bool) HTMLProgress
  25952. // DataSet stores custom data private to the page or application.
  25953. DataSet(k string, v any) HTMLProgress
  25954. // Dir specifies the text direction for the content in an element.
  25955. Dir(v string) HTMLProgress
  25956. // Draggable specifies whether an element is draggable or not.
  25957. Draggable(v bool) HTMLProgress
  25958. // Hidden specifies that an element is not yet, or is no longer relevant.
  25959. Hidden(v bool) HTMLProgress
  25960. // ID specifies a unique id for an element.
  25961. ID(v string) HTMLProgress
  25962. // Lang specifies the language of the element's content.
  25963. Lang(v string) HTMLProgress
  25964. // Max Specifies the maximum value.
  25965. Max(v any) HTMLProgress
  25966. // Role specifies to parsing software the exact function of an element (and its children).
  25967. Role(v string) HTMLProgress
  25968. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  25969. Spellcheck(v bool) HTMLProgress
  25970. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  25971. Style(k, v string) HTMLProgress
  25972. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  25973. Styles(s map[string]string) HTMLProgress
  25974. // TabIndex specifies the tabbing order of an element.
  25975. TabIndex(v int) HTMLProgress
  25976. // Title specifies extra information about an element.
  25977. Title(v string) HTMLProgress
  25978. // Value specifies the value of the element.
  25979. Value(v any) HTMLProgress
  25980. // On registers the given event handler to the specified event.
  25981. On(event string, h EventHandler, scope ...any) HTMLProgress
  25982. // OnBlur calls the given handler when the element loses focus.
  25983. OnBlur(h EventHandler, scope ...any) HTMLProgress
  25984. // OnChange calls the given handler when the value of the element is changed.
  25985. OnChange(h EventHandler, scope ...any) HTMLProgress
  25986. // OnClick calls the given handler when there is a mouse click on the element.
  25987. OnClick(h EventHandler, scope ...any) HTMLProgress
  25988. // OnContextMenu calls the given handler when a context menu is triggered.
  25989. OnContextMenu(h EventHandler, scope ...any) HTMLProgress
  25990. // OnCopy calls the given handler when the user copies the content of an element.
  25991. OnCopy(h EventHandler, scope ...any) HTMLProgress
  25992. // OnCut calls the given handler when the user cuts the content of an element.
  25993. OnCut(h EventHandler, scope ...any) HTMLProgress
  25994. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  25995. OnDblClick(h EventHandler, scope ...any) HTMLProgress
  25996. // OnDrag calls the given handler when an element is dragged.
  25997. OnDrag(h EventHandler, scope ...any) HTMLProgress
  25998. // OnDragEnd calls the given handler at the end of a drag operation.
  25999. OnDragEnd(h EventHandler, scope ...any) HTMLProgress
  26000. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  26001. OnDragEnter(h EventHandler, scope ...any) HTMLProgress
  26002. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  26003. OnDragLeave(h EventHandler, scope ...any) HTMLProgress
  26004. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  26005. OnDragOver(h EventHandler, scope ...any) HTMLProgress
  26006. // OnDragStart calls the given handler at the start of a drag operation.
  26007. OnDragStart(h EventHandler, scope ...any) HTMLProgress
  26008. // OnDrop calls the given handler when dragged element is being dropped.
  26009. OnDrop(h EventHandler, scope ...any) HTMLProgress
  26010. // OnFocus calls the given handler when the element gets focus.
  26011. OnFocus(h EventHandler, scope ...any) HTMLProgress
  26012. // OnInput calls the given handler when an element gets user input.
  26013. OnInput(h EventHandler, scope ...any) HTMLProgress
  26014. // OnInvalid calls the given handler when an element is invalid.
  26015. OnInvalid(h EventHandler, scope ...any) HTMLProgress
  26016. // OnKeyDown calls the given handler when a user is pressing a key.
  26017. OnKeyDown(h EventHandler, scope ...any) HTMLProgress
  26018. // OnKeyPress calls the given handler when a user presses a key.
  26019. OnKeyPress(h EventHandler, scope ...any) HTMLProgress
  26020. // OnKeyUp calls the given handler when a user releases a key.
  26021. OnKeyUp(h EventHandler, scope ...any) HTMLProgress
  26022. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  26023. OnMouseDown(h EventHandler, scope ...any) HTMLProgress
  26024. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  26025. OnMouseMove(h EventHandler, scope ...any) HTMLProgress
  26026. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  26027. OnMouseOut(h EventHandler, scope ...any) HTMLProgress
  26028. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  26029. OnMouseOver(h EventHandler, scope ...any) HTMLProgress
  26030. // OnMouseUp calls the given handler when a mouse button is released over an element.
  26031. OnMouseUp(h EventHandler, scope ...any) HTMLProgress
  26032. // OnPaste calls the given handler when the user pastes some content in an element.
  26033. OnPaste(h EventHandler, scope ...any) HTMLProgress
  26034. // OnReset calls the given handler when the Reset button in a form is clicked.
  26035. OnReset(h EventHandler, scope ...any) HTMLProgress
  26036. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  26037. OnScroll(h EventHandler, scope ...any) HTMLProgress
  26038. // OnSearch calls the given handler when the user writes something in a search field.
  26039. OnSearch(h EventHandler, scope ...any) HTMLProgress
  26040. // OnSelect calls the given handler after some text has been selected in an element.
  26041. OnSelect(h EventHandler, scope ...any) HTMLProgress
  26042. // OnSubmit calls the given handler when a form is submitted.
  26043. OnSubmit(h EventHandler, scope ...any) HTMLProgress
  26044. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  26045. OnWheel(h EventHandler, scope ...any) HTMLProgress
  26046. }
  26047. // Progress returns an HTML element that represents the progress of a task.
  26048. func Progress() HTMLProgress {
  26049. e := &htmlProgress{
  26050. htmlElement: htmlElement{
  26051. tag: "progress",
  26052. isSelfClosing: false,
  26053. },
  26054. }
  26055. return e
  26056. }
  26057. type htmlProgress struct {
  26058. htmlElement
  26059. }
  26060. func (e *htmlProgress) Body(v ...UI) HTMLProgress {
  26061. e.setChildren(v...)
  26062. return e
  26063. }
  26064. func (e *htmlProgress) Text(v any) HTMLProgress {
  26065. return e.Body(Text(v))
  26066. }
  26067. func (e *htmlProgress) AccessKey(v string) HTMLProgress {
  26068. e.setAttr("accesskey", v)
  26069. return e
  26070. }
  26071. func (e *htmlProgress) Aria(k string, v any) HTMLProgress {
  26072. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  26073. return e
  26074. }
  26075. func (e *htmlProgress) Attr(n string, v any) HTMLProgress {
  26076. e.setAttr(n, v)
  26077. return e
  26078. }
  26079. func (e *htmlProgress) Class(v ...string) HTMLProgress {
  26080. e.setAttr("class", strings.Join(v, " "))
  26081. return e
  26082. }
  26083. func (e *htmlProgress) ContentEditable(v bool) HTMLProgress {
  26084. e.setAttr("contenteditable", v)
  26085. return e
  26086. }
  26087. func (e *htmlProgress) DataSet(k string, v any) HTMLProgress {
  26088. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  26089. return e
  26090. }
  26091. func (e *htmlProgress) Dir(v string) HTMLProgress {
  26092. e.setAttr("dir", v)
  26093. return e
  26094. }
  26095. func (e *htmlProgress) Draggable(v bool) HTMLProgress {
  26096. e.setAttr("draggable", v)
  26097. return e
  26098. }
  26099. func (e *htmlProgress) Hidden(v bool) HTMLProgress {
  26100. e.setAttr("hidden", v)
  26101. return e
  26102. }
  26103. func (e *htmlProgress) ID(v string) HTMLProgress {
  26104. e.setAttr("id", v)
  26105. return e
  26106. }
  26107. func (e *htmlProgress) Lang(v string) HTMLProgress {
  26108. e.setAttr("lang", v)
  26109. return e
  26110. }
  26111. func (e *htmlProgress) Max(v any) HTMLProgress {
  26112. e.setAttr("max", v)
  26113. return e
  26114. }
  26115. func (e *htmlProgress) Role(v string) HTMLProgress {
  26116. e.setAttr("role", v)
  26117. return e
  26118. }
  26119. func (e *htmlProgress) Spellcheck(v bool) HTMLProgress {
  26120. s := "false"
  26121. if v {
  26122. s = "true"
  26123. }
  26124. e.setAttr("spellcheck", s)
  26125. return e
  26126. }
  26127. func (e *htmlProgress) Style(k, v string) HTMLProgress {
  26128. e.setAttr("style", k+":"+v)
  26129. return e
  26130. }
  26131. func (e *htmlProgress) Styles(s map[string]string) HTMLProgress {
  26132. for k, v := range s {
  26133. e.Style(k, v)
  26134. }
  26135. return e
  26136. }
  26137. func (e *htmlProgress) TabIndex(v int) HTMLProgress {
  26138. e.setAttr("tabindex", v)
  26139. return e
  26140. }
  26141. func (e *htmlProgress) Title(v string) HTMLProgress {
  26142. e.setAttr("title", v)
  26143. return e
  26144. }
  26145. func (e *htmlProgress) Value(v any) HTMLProgress {
  26146. e.setAttr("value", v)
  26147. return e
  26148. }
  26149. func (e *htmlProgress) On(event string, h EventHandler, scope ...any) HTMLProgress {
  26150. e.setEventHandler(event, h, scope...)
  26151. return e
  26152. }
  26153. func (e *htmlProgress) OnBlur(h EventHandler, scope ...any) HTMLProgress {
  26154. e.setEventHandler("blur", h, scope...)
  26155. return e
  26156. }
  26157. func (e *htmlProgress) OnChange(h EventHandler, scope ...any) HTMLProgress {
  26158. e.setEventHandler("change", h, scope...)
  26159. return e
  26160. }
  26161. func (e *htmlProgress) OnClick(h EventHandler, scope ...any) HTMLProgress {
  26162. e.setEventHandler("click", h, scope...)
  26163. return e
  26164. }
  26165. func (e *htmlProgress) OnContextMenu(h EventHandler, scope ...any) HTMLProgress {
  26166. e.setEventHandler("contextmenu", h, scope...)
  26167. return e
  26168. }
  26169. func (e *htmlProgress) OnCopy(h EventHandler, scope ...any) HTMLProgress {
  26170. e.setEventHandler("copy", h, scope...)
  26171. return e
  26172. }
  26173. func (e *htmlProgress) OnCut(h EventHandler, scope ...any) HTMLProgress {
  26174. e.setEventHandler("cut", h, scope...)
  26175. return e
  26176. }
  26177. func (e *htmlProgress) OnDblClick(h EventHandler, scope ...any) HTMLProgress {
  26178. e.setEventHandler("dblclick", h, scope...)
  26179. return e
  26180. }
  26181. func (e *htmlProgress) OnDrag(h EventHandler, scope ...any) HTMLProgress {
  26182. e.setEventHandler("drag", h, scope...)
  26183. return e
  26184. }
  26185. func (e *htmlProgress) OnDragEnd(h EventHandler, scope ...any) HTMLProgress {
  26186. e.setEventHandler("dragend", h, scope...)
  26187. return e
  26188. }
  26189. func (e *htmlProgress) OnDragEnter(h EventHandler, scope ...any) HTMLProgress {
  26190. e.setEventHandler("dragenter", h, scope...)
  26191. return e
  26192. }
  26193. func (e *htmlProgress) OnDragLeave(h EventHandler, scope ...any) HTMLProgress {
  26194. e.setEventHandler("dragleave", h, scope...)
  26195. return e
  26196. }
  26197. func (e *htmlProgress) OnDragOver(h EventHandler, scope ...any) HTMLProgress {
  26198. e.setEventHandler("dragover", h, scope...)
  26199. return e
  26200. }
  26201. func (e *htmlProgress) OnDragStart(h EventHandler, scope ...any) HTMLProgress {
  26202. e.setEventHandler("dragstart", h, scope...)
  26203. return e
  26204. }
  26205. func (e *htmlProgress) OnDrop(h EventHandler, scope ...any) HTMLProgress {
  26206. e.setEventHandler("drop", h, scope...)
  26207. return e
  26208. }
  26209. func (e *htmlProgress) OnFocus(h EventHandler, scope ...any) HTMLProgress {
  26210. e.setEventHandler("focus", h, scope...)
  26211. return e
  26212. }
  26213. func (e *htmlProgress) OnInput(h EventHandler, scope ...any) HTMLProgress {
  26214. e.setEventHandler("input", h, scope...)
  26215. return e
  26216. }
  26217. func (e *htmlProgress) OnInvalid(h EventHandler, scope ...any) HTMLProgress {
  26218. e.setEventHandler("invalid", h, scope...)
  26219. return e
  26220. }
  26221. func (e *htmlProgress) OnKeyDown(h EventHandler, scope ...any) HTMLProgress {
  26222. e.setEventHandler("keydown", h, scope...)
  26223. return e
  26224. }
  26225. func (e *htmlProgress) OnKeyPress(h EventHandler, scope ...any) HTMLProgress {
  26226. e.setEventHandler("keypress", h, scope...)
  26227. return e
  26228. }
  26229. func (e *htmlProgress) OnKeyUp(h EventHandler, scope ...any) HTMLProgress {
  26230. e.setEventHandler("keyup", h, scope...)
  26231. return e
  26232. }
  26233. func (e *htmlProgress) OnMouseDown(h EventHandler, scope ...any) HTMLProgress {
  26234. e.setEventHandler("mousedown", h, scope...)
  26235. return e
  26236. }
  26237. func (e *htmlProgress) OnMouseMove(h EventHandler, scope ...any) HTMLProgress {
  26238. e.setEventHandler("mousemove", h, scope...)
  26239. return e
  26240. }
  26241. func (e *htmlProgress) OnMouseOut(h EventHandler, scope ...any) HTMLProgress {
  26242. e.setEventHandler("mouseout", h, scope...)
  26243. return e
  26244. }
  26245. func (e *htmlProgress) OnMouseOver(h EventHandler, scope ...any) HTMLProgress {
  26246. e.setEventHandler("mouseover", h, scope...)
  26247. return e
  26248. }
  26249. func (e *htmlProgress) OnMouseUp(h EventHandler, scope ...any) HTMLProgress {
  26250. e.setEventHandler("mouseup", h, scope...)
  26251. return e
  26252. }
  26253. func (e *htmlProgress) OnPaste(h EventHandler, scope ...any) HTMLProgress {
  26254. e.setEventHandler("paste", h, scope...)
  26255. return e
  26256. }
  26257. func (e *htmlProgress) OnReset(h EventHandler, scope ...any) HTMLProgress {
  26258. e.setEventHandler("reset", h, scope...)
  26259. return e
  26260. }
  26261. func (e *htmlProgress) OnScroll(h EventHandler, scope ...any) HTMLProgress {
  26262. e.setEventHandler("scroll", h, scope...)
  26263. return e
  26264. }
  26265. func (e *htmlProgress) OnSearch(h EventHandler, scope ...any) HTMLProgress {
  26266. e.setEventHandler("search", h, scope...)
  26267. return e
  26268. }
  26269. func (e *htmlProgress) OnSelect(h EventHandler, scope ...any) HTMLProgress {
  26270. e.setEventHandler("select", h, scope...)
  26271. return e
  26272. }
  26273. func (e *htmlProgress) OnSubmit(h EventHandler, scope ...any) HTMLProgress {
  26274. e.setEventHandler("submit", h, scope...)
  26275. return e
  26276. }
  26277. func (e *htmlProgress) OnWheel(h EventHandler, scope ...any) HTMLProgress {
  26278. e.setEventHandler("wheel", h, scope...)
  26279. return e
  26280. }
  26281. // HTMLQ is the interface that describes a "q" HTML element.
  26282. type HTMLQ interface {
  26283. UI
  26284. // Body set the content of the element.
  26285. Body(elems ...UI) HTMLQ
  26286. // Text sets the content of the element with a text node containing the stringified given value.
  26287. Text(v any) HTMLQ
  26288. // AccessKey specifies a shortcut key to activate/focus an element.
  26289. AccessKey(v string) HTMLQ
  26290. // Aria stores accessible rich internet applications (ARIA) data.
  26291. Aria(k string, v any) HTMLQ
  26292. // Attr sets the named attribute with the given value.
  26293. Attr(n string, v any) HTMLQ
  26294. // Cite specifies a URL which explains the quote/deleted/inserted text.
  26295. Cite(v string) HTMLQ
  26296. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  26297. Class(v ...string) HTMLQ
  26298. // ContentEditable specifies whether the content of an element is editable or not.
  26299. ContentEditable(v bool) HTMLQ
  26300. // DataSet stores custom data private to the page or application.
  26301. DataSet(k string, v any) HTMLQ
  26302. // Dir specifies the text direction for the content in an element.
  26303. Dir(v string) HTMLQ
  26304. // Draggable specifies whether an element is draggable or not.
  26305. Draggable(v bool) HTMLQ
  26306. // Hidden specifies that an element is not yet, or is no longer relevant.
  26307. Hidden(v bool) HTMLQ
  26308. // ID specifies a unique id for an element.
  26309. ID(v string) HTMLQ
  26310. // Lang specifies the language of the element's content.
  26311. Lang(v string) HTMLQ
  26312. // Role specifies to parsing software the exact function of an element (and its children).
  26313. Role(v string) HTMLQ
  26314. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  26315. Spellcheck(v bool) HTMLQ
  26316. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  26317. Style(k, v string) HTMLQ
  26318. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  26319. Styles(s map[string]string) HTMLQ
  26320. // TabIndex specifies the tabbing order of an element.
  26321. TabIndex(v int) HTMLQ
  26322. // Title specifies extra information about an element.
  26323. Title(v string) HTMLQ
  26324. // On registers the given event handler to the specified event.
  26325. On(event string, h EventHandler, scope ...any) HTMLQ
  26326. // OnBlur calls the given handler when the element loses focus.
  26327. OnBlur(h EventHandler, scope ...any) HTMLQ
  26328. // OnChange calls the given handler when the value of the element is changed.
  26329. OnChange(h EventHandler, scope ...any) HTMLQ
  26330. // OnClick calls the given handler when there is a mouse click on the element.
  26331. OnClick(h EventHandler, scope ...any) HTMLQ
  26332. // OnContextMenu calls the given handler when a context menu is triggered.
  26333. OnContextMenu(h EventHandler, scope ...any) HTMLQ
  26334. // OnCopy calls the given handler when the user copies the content of an element.
  26335. OnCopy(h EventHandler, scope ...any) HTMLQ
  26336. // OnCut calls the given handler when the user cuts the content of an element.
  26337. OnCut(h EventHandler, scope ...any) HTMLQ
  26338. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  26339. OnDblClick(h EventHandler, scope ...any) HTMLQ
  26340. // OnDrag calls the given handler when an element is dragged.
  26341. OnDrag(h EventHandler, scope ...any) HTMLQ
  26342. // OnDragEnd calls the given handler at the end of a drag operation.
  26343. OnDragEnd(h EventHandler, scope ...any) HTMLQ
  26344. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  26345. OnDragEnter(h EventHandler, scope ...any) HTMLQ
  26346. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  26347. OnDragLeave(h EventHandler, scope ...any) HTMLQ
  26348. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  26349. OnDragOver(h EventHandler, scope ...any) HTMLQ
  26350. // OnDragStart calls the given handler at the start of a drag operation.
  26351. OnDragStart(h EventHandler, scope ...any) HTMLQ
  26352. // OnDrop calls the given handler when dragged element is being dropped.
  26353. OnDrop(h EventHandler, scope ...any) HTMLQ
  26354. // OnFocus calls the given handler when the element gets focus.
  26355. OnFocus(h EventHandler, scope ...any) HTMLQ
  26356. // OnInput calls the given handler when an element gets user input.
  26357. OnInput(h EventHandler, scope ...any) HTMLQ
  26358. // OnInvalid calls the given handler when an element is invalid.
  26359. OnInvalid(h EventHandler, scope ...any) HTMLQ
  26360. // OnKeyDown calls the given handler when a user is pressing a key.
  26361. OnKeyDown(h EventHandler, scope ...any) HTMLQ
  26362. // OnKeyPress calls the given handler when a user presses a key.
  26363. OnKeyPress(h EventHandler, scope ...any) HTMLQ
  26364. // OnKeyUp calls the given handler when a user releases a key.
  26365. OnKeyUp(h EventHandler, scope ...any) HTMLQ
  26366. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  26367. OnMouseDown(h EventHandler, scope ...any) HTMLQ
  26368. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  26369. OnMouseMove(h EventHandler, scope ...any) HTMLQ
  26370. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  26371. OnMouseOut(h EventHandler, scope ...any) HTMLQ
  26372. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  26373. OnMouseOver(h EventHandler, scope ...any) HTMLQ
  26374. // OnMouseUp calls the given handler when a mouse button is released over an element.
  26375. OnMouseUp(h EventHandler, scope ...any) HTMLQ
  26376. // OnPaste calls the given handler when the user pastes some content in an element.
  26377. OnPaste(h EventHandler, scope ...any) HTMLQ
  26378. // OnReset calls the given handler when the Reset button in a form is clicked.
  26379. OnReset(h EventHandler, scope ...any) HTMLQ
  26380. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  26381. OnScroll(h EventHandler, scope ...any) HTMLQ
  26382. // OnSearch calls the given handler when the user writes something in a search field.
  26383. OnSearch(h EventHandler, scope ...any) HTMLQ
  26384. // OnSelect calls the given handler after some text has been selected in an element.
  26385. OnSelect(h EventHandler, scope ...any) HTMLQ
  26386. // OnSubmit calls the given handler when a form is submitted.
  26387. OnSubmit(h EventHandler, scope ...any) HTMLQ
  26388. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  26389. OnWheel(h EventHandler, scope ...any) HTMLQ
  26390. }
  26391. // Q returns an HTML element that defines a short quotation.
  26392. func Q() HTMLQ {
  26393. e := &htmlQ{
  26394. htmlElement: htmlElement{
  26395. tag: "q",
  26396. isSelfClosing: false,
  26397. },
  26398. }
  26399. return e
  26400. }
  26401. type htmlQ struct {
  26402. htmlElement
  26403. }
  26404. func (e *htmlQ) Body(v ...UI) HTMLQ {
  26405. e.setChildren(v...)
  26406. return e
  26407. }
  26408. func (e *htmlQ) Text(v any) HTMLQ {
  26409. return e.Body(Text(v))
  26410. }
  26411. func (e *htmlQ) AccessKey(v string) HTMLQ {
  26412. e.setAttr("accesskey", v)
  26413. return e
  26414. }
  26415. func (e *htmlQ) Aria(k string, v any) HTMLQ {
  26416. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  26417. return e
  26418. }
  26419. func (e *htmlQ) Attr(n string, v any) HTMLQ {
  26420. e.setAttr(n, v)
  26421. return e
  26422. }
  26423. func (e *htmlQ) Cite(v string) HTMLQ {
  26424. e.setAttr("cite", v)
  26425. return e
  26426. }
  26427. func (e *htmlQ) Class(v ...string) HTMLQ {
  26428. e.setAttr("class", strings.Join(v, " "))
  26429. return e
  26430. }
  26431. func (e *htmlQ) ContentEditable(v bool) HTMLQ {
  26432. e.setAttr("contenteditable", v)
  26433. return e
  26434. }
  26435. func (e *htmlQ) DataSet(k string, v any) HTMLQ {
  26436. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  26437. return e
  26438. }
  26439. func (e *htmlQ) Dir(v string) HTMLQ {
  26440. e.setAttr("dir", v)
  26441. return e
  26442. }
  26443. func (e *htmlQ) Draggable(v bool) HTMLQ {
  26444. e.setAttr("draggable", v)
  26445. return e
  26446. }
  26447. func (e *htmlQ) Hidden(v bool) HTMLQ {
  26448. e.setAttr("hidden", v)
  26449. return e
  26450. }
  26451. func (e *htmlQ) ID(v string) HTMLQ {
  26452. e.setAttr("id", v)
  26453. return e
  26454. }
  26455. func (e *htmlQ) Lang(v string) HTMLQ {
  26456. e.setAttr("lang", v)
  26457. return e
  26458. }
  26459. func (e *htmlQ) Role(v string) HTMLQ {
  26460. e.setAttr("role", v)
  26461. return e
  26462. }
  26463. func (e *htmlQ) Spellcheck(v bool) HTMLQ {
  26464. s := "false"
  26465. if v {
  26466. s = "true"
  26467. }
  26468. e.setAttr("spellcheck", s)
  26469. return e
  26470. }
  26471. func (e *htmlQ) Style(k, v string) HTMLQ {
  26472. e.setAttr("style", k+":"+v)
  26473. return e
  26474. }
  26475. func (e *htmlQ) Styles(s map[string]string) HTMLQ {
  26476. for k, v := range s {
  26477. e.Style(k, v)
  26478. }
  26479. return e
  26480. }
  26481. func (e *htmlQ) TabIndex(v int) HTMLQ {
  26482. e.setAttr("tabindex", v)
  26483. return e
  26484. }
  26485. func (e *htmlQ) Title(v string) HTMLQ {
  26486. e.setAttr("title", v)
  26487. return e
  26488. }
  26489. func (e *htmlQ) On(event string, h EventHandler, scope ...any) HTMLQ {
  26490. e.setEventHandler(event, h, scope...)
  26491. return e
  26492. }
  26493. func (e *htmlQ) OnBlur(h EventHandler, scope ...any) HTMLQ {
  26494. e.setEventHandler("blur", h, scope...)
  26495. return e
  26496. }
  26497. func (e *htmlQ) OnChange(h EventHandler, scope ...any) HTMLQ {
  26498. e.setEventHandler("change", h, scope...)
  26499. return e
  26500. }
  26501. func (e *htmlQ) OnClick(h EventHandler, scope ...any) HTMLQ {
  26502. e.setEventHandler("click", h, scope...)
  26503. return e
  26504. }
  26505. func (e *htmlQ) OnContextMenu(h EventHandler, scope ...any) HTMLQ {
  26506. e.setEventHandler("contextmenu", h, scope...)
  26507. return e
  26508. }
  26509. func (e *htmlQ) OnCopy(h EventHandler, scope ...any) HTMLQ {
  26510. e.setEventHandler("copy", h, scope...)
  26511. return e
  26512. }
  26513. func (e *htmlQ) OnCut(h EventHandler, scope ...any) HTMLQ {
  26514. e.setEventHandler("cut", h, scope...)
  26515. return e
  26516. }
  26517. func (e *htmlQ) OnDblClick(h EventHandler, scope ...any) HTMLQ {
  26518. e.setEventHandler("dblclick", h, scope...)
  26519. return e
  26520. }
  26521. func (e *htmlQ) OnDrag(h EventHandler, scope ...any) HTMLQ {
  26522. e.setEventHandler("drag", h, scope...)
  26523. return e
  26524. }
  26525. func (e *htmlQ) OnDragEnd(h EventHandler, scope ...any) HTMLQ {
  26526. e.setEventHandler("dragend", h, scope...)
  26527. return e
  26528. }
  26529. func (e *htmlQ) OnDragEnter(h EventHandler, scope ...any) HTMLQ {
  26530. e.setEventHandler("dragenter", h, scope...)
  26531. return e
  26532. }
  26533. func (e *htmlQ) OnDragLeave(h EventHandler, scope ...any) HTMLQ {
  26534. e.setEventHandler("dragleave", h, scope...)
  26535. return e
  26536. }
  26537. func (e *htmlQ) OnDragOver(h EventHandler, scope ...any) HTMLQ {
  26538. e.setEventHandler("dragover", h, scope...)
  26539. return e
  26540. }
  26541. func (e *htmlQ) OnDragStart(h EventHandler, scope ...any) HTMLQ {
  26542. e.setEventHandler("dragstart", h, scope...)
  26543. return e
  26544. }
  26545. func (e *htmlQ) OnDrop(h EventHandler, scope ...any) HTMLQ {
  26546. e.setEventHandler("drop", h, scope...)
  26547. return e
  26548. }
  26549. func (e *htmlQ) OnFocus(h EventHandler, scope ...any) HTMLQ {
  26550. e.setEventHandler("focus", h, scope...)
  26551. return e
  26552. }
  26553. func (e *htmlQ) OnInput(h EventHandler, scope ...any) HTMLQ {
  26554. e.setEventHandler("input", h, scope...)
  26555. return e
  26556. }
  26557. func (e *htmlQ) OnInvalid(h EventHandler, scope ...any) HTMLQ {
  26558. e.setEventHandler("invalid", h, scope...)
  26559. return e
  26560. }
  26561. func (e *htmlQ) OnKeyDown(h EventHandler, scope ...any) HTMLQ {
  26562. e.setEventHandler("keydown", h, scope...)
  26563. return e
  26564. }
  26565. func (e *htmlQ) OnKeyPress(h EventHandler, scope ...any) HTMLQ {
  26566. e.setEventHandler("keypress", h, scope...)
  26567. return e
  26568. }
  26569. func (e *htmlQ) OnKeyUp(h EventHandler, scope ...any) HTMLQ {
  26570. e.setEventHandler("keyup", h, scope...)
  26571. return e
  26572. }
  26573. func (e *htmlQ) OnMouseDown(h EventHandler, scope ...any) HTMLQ {
  26574. e.setEventHandler("mousedown", h, scope...)
  26575. return e
  26576. }
  26577. func (e *htmlQ) OnMouseMove(h EventHandler, scope ...any) HTMLQ {
  26578. e.setEventHandler("mousemove", h, scope...)
  26579. return e
  26580. }
  26581. func (e *htmlQ) OnMouseOut(h EventHandler, scope ...any) HTMLQ {
  26582. e.setEventHandler("mouseout", h, scope...)
  26583. return e
  26584. }
  26585. func (e *htmlQ) OnMouseOver(h EventHandler, scope ...any) HTMLQ {
  26586. e.setEventHandler("mouseover", h, scope...)
  26587. return e
  26588. }
  26589. func (e *htmlQ) OnMouseUp(h EventHandler, scope ...any) HTMLQ {
  26590. e.setEventHandler("mouseup", h, scope...)
  26591. return e
  26592. }
  26593. func (e *htmlQ) OnPaste(h EventHandler, scope ...any) HTMLQ {
  26594. e.setEventHandler("paste", h, scope...)
  26595. return e
  26596. }
  26597. func (e *htmlQ) OnReset(h EventHandler, scope ...any) HTMLQ {
  26598. e.setEventHandler("reset", h, scope...)
  26599. return e
  26600. }
  26601. func (e *htmlQ) OnScroll(h EventHandler, scope ...any) HTMLQ {
  26602. e.setEventHandler("scroll", h, scope...)
  26603. return e
  26604. }
  26605. func (e *htmlQ) OnSearch(h EventHandler, scope ...any) HTMLQ {
  26606. e.setEventHandler("search", h, scope...)
  26607. return e
  26608. }
  26609. func (e *htmlQ) OnSelect(h EventHandler, scope ...any) HTMLQ {
  26610. e.setEventHandler("select", h, scope...)
  26611. return e
  26612. }
  26613. func (e *htmlQ) OnSubmit(h EventHandler, scope ...any) HTMLQ {
  26614. e.setEventHandler("submit", h, scope...)
  26615. return e
  26616. }
  26617. func (e *htmlQ) OnWheel(h EventHandler, scope ...any) HTMLQ {
  26618. e.setEventHandler("wheel", h, scope...)
  26619. return e
  26620. }
  26621. // HTMLRp is the interface that describes a "rp" HTML element.
  26622. type HTMLRp interface {
  26623. UI
  26624. // Body set the content of the element.
  26625. Body(elems ...UI) HTMLRp
  26626. // Text sets the content of the element with a text node containing the stringified given value.
  26627. Text(v any) HTMLRp
  26628. // AccessKey specifies a shortcut key to activate/focus an element.
  26629. AccessKey(v string) HTMLRp
  26630. // Aria stores accessible rich internet applications (ARIA) data.
  26631. Aria(k string, v any) HTMLRp
  26632. // Attr sets the named attribute with the given value.
  26633. Attr(n string, v any) HTMLRp
  26634. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  26635. Class(v ...string) HTMLRp
  26636. // ContentEditable specifies whether the content of an element is editable or not.
  26637. ContentEditable(v bool) HTMLRp
  26638. // DataSet stores custom data private to the page or application.
  26639. DataSet(k string, v any) HTMLRp
  26640. // Dir specifies the text direction for the content in an element.
  26641. Dir(v string) HTMLRp
  26642. // Draggable specifies whether an element is draggable or not.
  26643. Draggable(v bool) HTMLRp
  26644. // Hidden specifies that an element is not yet, or is no longer relevant.
  26645. Hidden(v bool) HTMLRp
  26646. // ID specifies a unique id for an element.
  26647. ID(v string) HTMLRp
  26648. // Lang specifies the language of the element's content.
  26649. Lang(v string) HTMLRp
  26650. // Role specifies to parsing software the exact function of an element (and its children).
  26651. Role(v string) HTMLRp
  26652. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  26653. Spellcheck(v bool) HTMLRp
  26654. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  26655. Style(k, v string) HTMLRp
  26656. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  26657. Styles(s map[string]string) HTMLRp
  26658. // TabIndex specifies the tabbing order of an element.
  26659. TabIndex(v int) HTMLRp
  26660. // Title specifies extra information about an element.
  26661. Title(v string) HTMLRp
  26662. // On registers the given event handler to the specified event.
  26663. On(event string, h EventHandler, scope ...any) HTMLRp
  26664. // OnBlur calls the given handler when the element loses focus.
  26665. OnBlur(h EventHandler, scope ...any) HTMLRp
  26666. // OnChange calls the given handler when the value of the element is changed.
  26667. OnChange(h EventHandler, scope ...any) HTMLRp
  26668. // OnClick calls the given handler when there is a mouse click on the element.
  26669. OnClick(h EventHandler, scope ...any) HTMLRp
  26670. // OnContextMenu calls the given handler when a context menu is triggered.
  26671. OnContextMenu(h EventHandler, scope ...any) HTMLRp
  26672. // OnCopy calls the given handler when the user copies the content of an element.
  26673. OnCopy(h EventHandler, scope ...any) HTMLRp
  26674. // OnCut calls the given handler when the user cuts the content of an element.
  26675. OnCut(h EventHandler, scope ...any) HTMLRp
  26676. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  26677. OnDblClick(h EventHandler, scope ...any) HTMLRp
  26678. // OnDrag calls the given handler when an element is dragged.
  26679. OnDrag(h EventHandler, scope ...any) HTMLRp
  26680. // OnDragEnd calls the given handler at the end of a drag operation.
  26681. OnDragEnd(h EventHandler, scope ...any) HTMLRp
  26682. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  26683. OnDragEnter(h EventHandler, scope ...any) HTMLRp
  26684. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  26685. OnDragLeave(h EventHandler, scope ...any) HTMLRp
  26686. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  26687. OnDragOver(h EventHandler, scope ...any) HTMLRp
  26688. // OnDragStart calls the given handler at the start of a drag operation.
  26689. OnDragStart(h EventHandler, scope ...any) HTMLRp
  26690. // OnDrop calls the given handler when dragged element is being dropped.
  26691. OnDrop(h EventHandler, scope ...any) HTMLRp
  26692. // OnFocus calls the given handler when the element gets focus.
  26693. OnFocus(h EventHandler, scope ...any) HTMLRp
  26694. // OnInput calls the given handler when an element gets user input.
  26695. OnInput(h EventHandler, scope ...any) HTMLRp
  26696. // OnInvalid calls the given handler when an element is invalid.
  26697. OnInvalid(h EventHandler, scope ...any) HTMLRp
  26698. // OnKeyDown calls the given handler when a user is pressing a key.
  26699. OnKeyDown(h EventHandler, scope ...any) HTMLRp
  26700. // OnKeyPress calls the given handler when a user presses a key.
  26701. OnKeyPress(h EventHandler, scope ...any) HTMLRp
  26702. // OnKeyUp calls the given handler when a user releases a key.
  26703. OnKeyUp(h EventHandler, scope ...any) HTMLRp
  26704. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  26705. OnMouseDown(h EventHandler, scope ...any) HTMLRp
  26706. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  26707. OnMouseMove(h EventHandler, scope ...any) HTMLRp
  26708. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  26709. OnMouseOut(h EventHandler, scope ...any) HTMLRp
  26710. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  26711. OnMouseOver(h EventHandler, scope ...any) HTMLRp
  26712. // OnMouseUp calls the given handler when a mouse button is released over an element.
  26713. OnMouseUp(h EventHandler, scope ...any) HTMLRp
  26714. // OnPaste calls the given handler when the user pastes some content in an element.
  26715. OnPaste(h EventHandler, scope ...any) HTMLRp
  26716. // OnReset calls the given handler when the Reset button in a form is clicked.
  26717. OnReset(h EventHandler, scope ...any) HTMLRp
  26718. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  26719. OnScroll(h EventHandler, scope ...any) HTMLRp
  26720. // OnSearch calls the given handler when the user writes something in a search field.
  26721. OnSearch(h EventHandler, scope ...any) HTMLRp
  26722. // OnSelect calls the given handler after some text has been selected in an element.
  26723. OnSelect(h EventHandler, scope ...any) HTMLRp
  26724. // OnSubmit calls the given handler when a form is submitted.
  26725. OnSubmit(h EventHandler, scope ...any) HTMLRp
  26726. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  26727. OnWheel(h EventHandler, scope ...any) HTMLRp
  26728. }
  26729. // Rp returns an HTML element that defines what to show in browsers that do not support ruby annotations.
  26730. func Rp() HTMLRp {
  26731. e := &htmlRp{
  26732. htmlElement: htmlElement{
  26733. tag: "rp",
  26734. isSelfClosing: false,
  26735. },
  26736. }
  26737. return e
  26738. }
  26739. type htmlRp struct {
  26740. htmlElement
  26741. }
  26742. func (e *htmlRp) Body(v ...UI) HTMLRp {
  26743. e.setChildren(v...)
  26744. return e
  26745. }
  26746. func (e *htmlRp) Text(v any) HTMLRp {
  26747. return e.Body(Text(v))
  26748. }
  26749. func (e *htmlRp) AccessKey(v string) HTMLRp {
  26750. e.setAttr("accesskey", v)
  26751. return e
  26752. }
  26753. func (e *htmlRp) Aria(k string, v any) HTMLRp {
  26754. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  26755. return e
  26756. }
  26757. func (e *htmlRp) Attr(n string, v any) HTMLRp {
  26758. e.setAttr(n, v)
  26759. return e
  26760. }
  26761. func (e *htmlRp) Class(v ...string) HTMLRp {
  26762. e.setAttr("class", strings.Join(v, " "))
  26763. return e
  26764. }
  26765. func (e *htmlRp) ContentEditable(v bool) HTMLRp {
  26766. e.setAttr("contenteditable", v)
  26767. return e
  26768. }
  26769. func (e *htmlRp) DataSet(k string, v any) HTMLRp {
  26770. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  26771. return e
  26772. }
  26773. func (e *htmlRp) Dir(v string) HTMLRp {
  26774. e.setAttr("dir", v)
  26775. return e
  26776. }
  26777. func (e *htmlRp) Draggable(v bool) HTMLRp {
  26778. e.setAttr("draggable", v)
  26779. return e
  26780. }
  26781. func (e *htmlRp) Hidden(v bool) HTMLRp {
  26782. e.setAttr("hidden", v)
  26783. return e
  26784. }
  26785. func (e *htmlRp) ID(v string) HTMLRp {
  26786. e.setAttr("id", v)
  26787. return e
  26788. }
  26789. func (e *htmlRp) Lang(v string) HTMLRp {
  26790. e.setAttr("lang", v)
  26791. return e
  26792. }
  26793. func (e *htmlRp) Role(v string) HTMLRp {
  26794. e.setAttr("role", v)
  26795. return e
  26796. }
  26797. func (e *htmlRp) Spellcheck(v bool) HTMLRp {
  26798. s := "false"
  26799. if v {
  26800. s = "true"
  26801. }
  26802. e.setAttr("spellcheck", s)
  26803. return e
  26804. }
  26805. func (e *htmlRp) Style(k, v string) HTMLRp {
  26806. e.setAttr("style", k+":"+v)
  26807. return e
  26808. }
  26809. func (e *htmlRp) Styles(s map[string]string) HTMLRp {
  26810. for k, v := range s {
  26811. e.Style(k, v)
  26812. }
  26813. return e
  26814. }
  26815. func (e *htmlRp) TabIndex(v int) HTMLRp {
  26816. e.setAttr("tabindex", v)
  26817. return e
  26818. }
  26819. func (e *htmlRp) Title(v string) HTMLRp {
  26820. e.setAttr("title", v)
  26821. return e
  26822. }
  26823. func (e *htmlRp) On(event string, h EventHandler, scope ...any) HTMLRp {
  26824. e.setEventHandler(event, h, scope...)
  26825. return e
  26826. }
  26827. func (e *htmlRp) OnBlur(h EventHandler, scope ...any) HTMLRp {
  26828. e.setEventHandler("blur", h, scope...)
  26829. return e
  26830. }
  26831. func (e *htmlRp) OnChange(h EventHandler, scope ...any) HTMLRp {
  26832. e.setEventHandler("change", h, scope...)
  26833. return e
  26834. }
  26835. func (e *htmlRp) OnClick(h EventHandler, scope ...any) HTMLRp {
  26836. e.setEventHandler("click", h, scope...)
  26837. return e
  26838. }
  26839. func (e *htmlRp) OnContextMenu(h EventHandler, scope ...any) HTMLRp {
  26840. e.setEventHandler("contextmenu", h, scope...)
  26841. return e
  26842. }
  26843. func (e *htmlRp) OnCopy(h EventHandler, scope ...any) HTMLRp {
  26844. e.setEventHandler("copy", h, scope...)
  26845. return e
  26846. }
  26847. func (e *htmlRp) OnCut(h EventHandler, scope ...any) HTMLRp {
  26848. e.setEventHandler("cut", h, scope...)
  26849. return e
  26850. }
  26851. func (e *htmlRp) OnDblClick(h EventHandler, scope ...any) HTMLRp {
  26852. e.setEventHandler("dblclick", h, scope...)
  26853. return e
  26854. }
  26855. func (e *htmlRp) OnDrag(h EventHandler, scope ...any) HTMLRp {
  26856. e.setEventHandler("drag", h, scope...)
  26857. return e
  26858. }
  26859. func (e *htmlRp) OnDragEnd(h EventHandler, scope ...any) HTMLRp {
  26860. e.setEventHandler("dragend", h, scope...)
  26861. return e
  26862. }
  26863. func (e *htmlRp) OnDragEnter(h EventHandler, scope ...any) HTMLRp {
  26864. e.setEventHandler("dragenter", h, scope...)
  26865. return e
  26866. }
  26867. func (e *htmlRp) OnDragLeave(h EventHandler, scope ...any) HTMLRp {
  26868. e.setEventHandler("dragleave", h, scope...)
  26869. return e
  26870. }
  26871. func (e *htmlRp) OnDragOver(h EventHandler, scope ...any) HTMLRp {
  26872. e.setEventHandler("dragover", h, scope...)
  26873. return e
  26874. }
  26875. func (e *htmlRp) OnDragStart(h EventHandler, scope ...any) HTMLRp {
  26876. e.setEventHandler("dragstart", h, scope...)
  26877. return e
  26878. }
  26879. func (e *htmlRp) OnDrop(h EventHandler, scope ...any) HTMLRp {
  26880. e.setEventHandler("drop", h, scope...)
  26881. return e
  26882. }
  26883. func (e *htmlRp) OnFocus(h EventHandler, scope ...any) HTMLRp {
  26884. e.setEventHandler("focus", h, scope...)
  26885. return e
  26886. }
  26887. func (e *htmlRp) OnInput(h EventHandler, scope ...any) HTMLRp {
  26888. e.setEventHandler("input", h, scope...)
  26889. return e
  26890. }
  26891. func (e *htmlRp) OnInvalid(h EventHandler, scope ...any) HTMLRp {
  26892. e.setEventHandler("invalid", h, scope...)
  26893. return e
  26894. }
  26895. func (e *htmlRp) OnKeyDown(h EventHandler, scope ...any) HTMLRp {
  26896. e.setEventHandler("keydown", h, scope...)
  26897. return e
  26898. }
  26899. func (e *htmlRp) OnKeyPress(h EventHandler, scope ...any) HTMLRp {
  26900. e.setEventHandler("keypress", h, scope...)
  26901. return e
  26902. }
  26903. func (e *htmlRp) OnKeyUp(h EventHandler, scope ...any) HTMLRp {
  26904. e.setEventHandler("keyup", h, scope...)
  26905. return e
  26906. }
  26907. func (e *htmlRp) OnMouseDown(h EventHandler, scope ...any) HTMLRp {
  26908. e.setEventHandler("mousedown", h, scope...)
  26909. return e
  26910. }
  26911. func (e *htmlRp) OnMouseMove(h EventHandler, scope ...any) HTMLRp {
  26912. e.setEventHandler("mousemove", h, scope...)
  26913. return e
  26914. }
  26915. func (e *htmlRp) OnMouseOut(h EventHandler, scope ...any) HTMLRp {
  26916. e.setEventHandler("mouseout", h, scope...)
  26917. return e
  26918. }
  26919. func (e *htmlRp) OnMouseOver(h EventHandler, scope ...any) HTMLRp {
  26920. e.setEventHandler("mouseover", h, scope...)
  26921. return e
  26922. }
  26923. func (e *htmlRp) OnMouseUp(h EventHandler, scope ...any) HTMLRp {
  26924. e.setEventHandler("mouseup", h, scope...)
  26925. return e
  26926. }
  26927. func (e *htmlRp) OnPaste(h EventHandler, scope ...any) HTMLRp {
  26928. e.setEventHandler("paste", h, scope...)
  26929. return e
  26930. }
  26931. func (e *htmlRp) OnReset(h EventHandler, scope ...any) HTMLRp {
  26932. e.setEventHandler("reset", h, scope...)
  26933. return e
  26934. }
  26935. func (e *htmlRp) OnScroll(h EventHandler, scope ...any) HTMLRp {
  26936. e.setEventHandler("scroll", h, scope...)
  26937. return e
  26938. }
  26939. func (e *htmlRp) OnSearch(h EventHandler, scope ...any) HTMLRp {
  26940. e.setEventHandler("search", h, scope...)
  26941. return e
  26942. }
  26943. func (e *htmlRp) OnSelect(h EventHandler, scope ...any) HTMLRp {
  26944. e.setEventHandler("select", h, scope...)
  26945. return e
  26946. }
  26947. func (e *htmlRp) OnSubmit(h EventHandler, scope ...any) HTMLRp {
  26948. e.setEventHandler("submit", h, scope...)
  26949. return e
  26950. }
  26951. func (e *htmlRp) OnWheel(h EventHandler, scope ...any) HTMLRp {
  26952. e.setEventHandler("wheel", h, scope...)
  26953. return e
  26954. }
  26955. // HTMLRt is the interface that describes a "rt" HTML element.
  26956. type HTMLRt interface {
  26957. UI
  26958. // Body set the content of the element.
  26959. Body(elems ...UI) HTMLRt
  26960. // Text sets the content of the element with a text node containing the stringified given value.
  26961. Text(v any) HTMLRt
  26962. // AccessKey specifies a shortcut key to activate/focus an element.
  26963. AccessKey(v string) HTMLRt
  26964. // Aria stores accessible rich internet applications (ARIA) data.
  26965. Aria(k string, v any) HTMLRt
  26966. // Attr sets the named attribute with the given value.
  26967. Attr(n string, v any) HTMLRt
  26968. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  26969. Class(v ...string) HTMLRt
  26970. // ContentEditable specifies whether the content of an element is editable or not.
  26971. ContentEditable(v bool) HTMLRt
  26972. // DataSet stores custom data private to the page or application.
  26973. DataSet(k string, v any) HTMLRt
  26974. // Dir specifies the text direction for the content in an element.
  26975. Dir(v string) HTMLRt
  26976. // Draggable specifies whether an element is draggable or not.
  26977. Draggable(v bool) HTMLRt
  26978. // Hidden specifies that an element is not yet, or is no longer relevant.
  26979. Hidden(v bool) HTMLRt
  26980. // ID specifies a unique id for an element.
  26981. ID(v string) HTMLRt
  26982. // Lang specifies the language of the element's content.
  26983. Lang(v string) HTMLRt
  26984. // Role specifies to parsing software the exact function of an element (and its children).
  26985. Role(v string) HTMLRt
  26986. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  26987. Spellcheck(v bool) HTMLRt
  26988. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  26989. Style(k, v string) HTMLRt
  26990. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  26991. Styles(s map[string]string) HTMLRt
  26992. // TabIndex specifies the tabbing order of an element.
  26993. TabIndex(v int) HTMLRt
  26994. // Title specifies extra information about an element.
  26995. Title(v string) HTMLRt
  26996. // On registers the given event handler to the specified event.
  26997. On(event string, h EventHandler, scope ...any) HTMLRt
  26998. // OnBlur calls the given handler when the element loses focus.
  26999. OnBlur(h EventHandler, scope ...any) HTMLRt
  27000. // OnChange calls the given handler when the value of the element is changed.
  27001. OnChange(h EventHandler, scope ...any) HTMLRt
  27002. // OnClick calls the given handler when there is a mouse click on the element.
  27003. OnClick(h EventHandler, scope ...any) HTMLRt
  27004. // OnContextMenu calls the given handler when a context menu is triggered.
  27005. OnContextMenu(h EventHandler, scope ...any) HTMLRt
  27006. // OnCopy calls the given handler when the user copies the content of an element.
  27007. OnCopy(h EventHandler, scope ...any) HTMLRt
  27008. // OnCut calls the given handler when the user cuts the content of an element.
  27009. OnCut(h EventHandler, scope ...any) HTMLRt
  27010. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  27011. OnDblClick(h EventHandler, scope ...any) HTMLRt
  27012. // OnDrag calls the given handler when an element is dragged.
  27013. OnDrag(h EventHandler, scope ...any) HTMLRt
  27014. // OnDragEnd calls the given handler at the end of a drag operation.
  27015. OnDragEnd(h EventHandler, scope ...any) HTMLRt
  27016. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  27017. OnDragEnter(h EventHandler, scope ...any) HTMLRt
  27018. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  27019. OnDragLeave(h EventHandler, scope ...any) HTMLRt
  27020. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  27021. OnDragOver(h EventHandler, scope ...any) HTMLRt
  27022. // OnDragStart calls the given handler at the start of a drag operation.
  27023. OnDragStart(h EventHandler, scope ...any) HTMLRt
  27024. // OnDrop calls the given handler when dragged element is being dropped.
  27025. OnDrop(h EventHandler, scope ...any) HTMLRt
  27026. // OnFocus calls the given handler when the element gets focus.
  27027. OnFocus(h EventHandler, scope ...any) HTMLRt
  27028. // OnInput calls the given handler when an element gets user input.
  27029. OnInput(h EventHandler, scope ...any) HTMLRt
  27030. // OnInvalid calls the given handler when an element is invalid.
  27031. OnInvalid(h EventHandler, scope ...any) HTMLRt
  27032. // OnKeyDown calls the given handler when a user is pressing a key.
  27033. OnKeyDown(h EventHandler, scope ...any) HTMLRt
  27034. // OnKeyPress calls the given handler when a user presses a key.
  27035. OnKeyPress(h EventHandler, scope ...any) HTMLRt
  27036. // OnKeyUp calls the given handler when a user releases a key.
  27037. OnKeyUp(h EventHandler, scope ...any) HTMLRt
  27038. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  27039. OnMouseDown(h EventHandler, scope ...any) HTMLRt
  27040. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  27041. OnMouseMove(h EventHandler, scope ...any) HTMLRt
  27042. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  27043. OnMouseOut(h EventHandler, scope ...any) HTMLRt
  27044. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  27045. OnMouseOver(h EventHandler, scope ...any) HTMLRt
  27046. // OnMouseUp calls the given handler when a mouse button is released over an element.
  27047. OnMouseUp(h EventHandler, scope ...any) HTMLRt
  27048. // OnPaste calls the given handler when the user pastes some content in an element.
  27049. OnPaste(h EventHandler, scope ...any) HTMLRt
  27050. // OnReset calls the given handler when the Reset button in a form is clicked.
  27051. OnReset(h EventHandler, scope ...any) HTMLRt
  27052. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  27053. OnScroll(h EventHandler, scope ...any) HTMLRt
  27054. // OnSearch calls the given handler when the user writes something in a search field.
  27055. OnSearch(h EventHandler, scope ...any) HTMLRt
  27056. // OnSelect calls the given handler after some text has been selected in an element.
  27057. OnSelect(h EventHandler, scope ...any) HTMLRt
  27058. // OnSubmit calls the given handler when a form is submitted.
  27059. OnSubmit(h EventHandler, scope ...any) HTMLRt
  27060. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  27061. OnWheel(h EventHandler, scope ...any) HTMLRt
  27062. }
  27063. // Rt returns an HTML element that defines an explanation/pronunciation of characters (for East Asian typography).
  27064. func Rt() HTMLRt {
  27065. e := &htmlRt{
  27066. htmlElement: htmlElement{
  27067. tag: "rt",
  27068. isSelfClosing: false,
  27069. },
  27070. }
  27071. return e
  27072. }
  27073. type htmlRt struct {
  27074. htmlElement
  27075. }
  27076. func (e *htmlRt) Body(v ...UI) HTMLRt {
  27077. e.setChildren(v...)
  27078. return e
  27079. }
  27080. func (e *htmlRt) Text(v any) HTMLRt {
  27081. return e.Body(Text(v))
  27082. }
  27083. func (e *htmlRt) AccessKey(v string) HTMLRt {
  27084. e.setAttr("accesskey", v)
  27085. return e
  27086. }
  27087. func (e *htmlRt) Aria(k string, v any) HTMLRt {
  27088. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  27089. return e
  27090. }
  27091. func (e *htmlRt) Attr(n string, v any) HTMLRt {
  27092. e.setAttr(n, v)
  27093. return e
  27094. }
  27095. func (e *htmlRt) Class(v ...string) HTMLRt {
  27096. e.setAttr("class", strings.Join(v, " "))
  27097. return e
  27098. }
  27099. func (e *htmlRt) ContentEditable(v bool) HTMLRt {
  27100. e.setAttr("contenteditable", v)
  27101. return e
  27102. }
  27103. func (e *htmlRt) DataSet(k string, v any) HTMLRt {
  27104. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  27105. return e
  27106. }
  27107. func (e *htmlRt) Dir(v string) HTMLRt {
  27108. e.setAttr("dir", v)
  27109. return e
  27110. }
  27111. func (e *htmlRt) Draggable(v bool) HTMLRt {
  27112. e.setAttr("draggable", v)
  27113. return e
  27114. }
  27115. func (e *htmlRt) Hidden(v bool) HTMLRt {
  27116. e.setAttr("hidden", v)
  27117. return e
  27118. }
  27119. func (e *htmlRt) ID(v string) HTMLRt {
  27120. e.setAttr("id", v)
  27121. return e
  27122. }
  27123. func (e *htmlRt) Lang(v string) HTMLRt {
  27124. e.setAttr("lang", v)
  27125. return e
  27126. }
  27127. func (e *htmlRt) Role(v string) HTMLRt {
  27128. e.setAttr("role", v)
  27129. return e
  27130. }
  27131. func (e *htmlRt) Spellcheck(v bool) HTMLRt {
  27132. s := "false"
  27133. if v {
  27134. s = "true"
  27135. }
  27136. e.setAttr("spellcheck", s)
  27137. return e
  27138. }
  27139. func (e *htmlRt) Style(k, v string) HTMLRt {
  27140. e.setAttr("style", k+":"+v)
  27141. return e
  27142. }
  27143. func (e *htmlRt) Styles(s map[string]string) HTMLRt {
  27144. for k, v := range s {
  27145. e.Style(k, v)
  27146. }
  27147. return e
  27148. }
  27149. func (e *htmlRt) TabIndex(v int) HTMLRt {
  27150. e.setAttr("tabindex", v)
  27151. return e
  27152. }
  27153. func (e *htmlRt) Title(v string) HTMLRt {
  27154. e.setAttr("title", v)
  27155. return e
  27156. }
  27157. func (e *htmlRt) On(event string, h EventHandler, scope ...any) HTMLRt {
  27158. e.setEventHandler(event, h, scope...)
  27159. return e
  27160. }
  27161. func (e *htmlRt) OnBlur(h EventHandler, scope ...any) HTMLRt {
  27162. e.setEventHandler("blur", h, scope...)
  27163. return e
  27164. }
  27165. func (e *htmlRt) OnChange(h EventHandler, scope ...any) HTMLRt {
  27166. e.setEventHandler("change", h, scope...)
  27167. return e
  27168. }
  27169. func (e *htmlRt) OnClick(h EventHandler, scope ...any) HTMLRt {
  27170. e.setEventHandler("click", h, scope...)
  27171. return e
  27172. }
  27173. func (e *htmlRt) OnContextMenu(h EventHandler, scope ...any) HTMLRt {
  27174. e.setEventHandler("contextmenu", h, scope...)
  27175. return e
  27176. }
  27177. func (e *htmlRt) OnCopy(h EventHandler, scope ...any) HTMLRt {
  27178. e.setEventHandler("copy", h, scope...)
  27179. return e
  27180. }
  27181. func (e *htmlRt) OnCut(h EventHandler, scope ...any) HTMLRt {
  27182. e.setEventHandler("cut", h, scope...)
  27183. return e
  27184. }
  27185. func (e *htmlRt) OnDblClick(h EventHandler, scope ...any) HTMLRt {
  27186. e.setEventHandler("dblclick", h, scope...)
  27187. return e
  27188. }
  27189. func (e *htmlRt) OnDrag(h EventHandler, scope ...any) HTMLRt {
  27190. e.setEventHandler("drag", h, scope...)
  27191. return e
  27192. }
  27193. func (e *htmlRt) OnDragEnd(h EventHandler, scope ...any) HTMLRt {
  27194. e.setEventHandler("dragend", h, scope...)
  27195. return e
  27196. }
  27197. func (e *htmlRt) OnDragEnter(h EventHandler, scope ...any) HTMLRt {
  27198. e.setEventHandler("dragenter", h, scope...)
  27199. return e
  27200. }
  27201. func (e *htmlRt) OnDragLeave(h EventHandler, scope ...any) HTMLRt {
  27202. e.setEventHandler("dragleave", h, scope...)
  27203. return e
  27204. }
  27205. func (e *htmlRt) OnDragOver(h EventHandler, scope ...any) HTMLRt {
  27206. e.setEventHandler("dragover", h, scope...)
  27207. return e
  27208. }
  27209. func (e *htmlRt) OnDragStart(h EventHandler, scope ...any) HTMLRt {
  27210. e.setEventHandler("dragstart", h, scope...)
  27211. return e
  27212. }
  27213. func (e *htmlRt) OnDrop(h EventHandler, scope ...any) HTMLRt {
  27214. e.setEventHandler("drop", h, scope...)
  27215. return e
  27216. }
  27217. func (e *htmlRt) OnFocus(h EventHandler, scope ...any) HTMLRt {
  27218. e.setEventHandler("focus", h, scope...)
  27219. return e
  27220. }
  27221. func (e *htmlRt) OnInput(h EventHandler, scope ...any) HTMLRt {
  27222. e.setEventHandler("input", h, scope...)
  27223. return e
  27224. }
  27225. func (e *htmlRt) OnInvalid(h EventHandler, scope ...any) HTMLRt {
  27226. e.setEventHandler("invalid", h, scope...)
  27227. return e
  27228. }
  27229. func (e *htmlRt) OnKeyDown(h EventHandler, scope ...any) HTMLRt {
  27230. e.setEventHandler("keydown", h, scope...)
  27231. return e
  27232. }
  27233. func (e *htmlRt) OnKeyPress(h EventHandler, scope ...any) HTMLRt {
  27234. e.setEventHandler("keypress", h, scope...)
  27235. return e
  27236. }
  27237. func (e *htmlRt) OnKeyUp(h EventHandler, scope ...any) HTMLRt {
  27238. e.setEventHandler("keyup", h, scope...)
  27239. return e
  27240. }
  27241. func (e *htmlRt) OnMouseDown(h EventHandler, scope ...any) HTMLRt {
  27242. e.setEventHandler("mousedown", h, scope...)
  27243. return e
  27244. }
  27245. func (e *htmlRt) OnMouseMove(h EventHandler, scope ...any) HTMLRt {
  27246. e.setEventHandler("mousemove", h, scope...)
  27247. return e
  27248. }
  27249. func (e *htmlRt) OnMouseOut(h EventHandler, scope ...any) HTMLRt {
  27250. e.setEventHandler("mouseout", h, scope...)
  27251. return e
  27252. }
  27253. func (e *htmlRt) OnMouseOver(h EventHandler, scope ...any) HTMLRt {
  27254. e.setEventHandler("mouseover", h, scope...)
  27255. return e
  27256. }
  27257. func (e *htmlRt) OnMouseUp(h EventHandler, scope ...any) HTMLRt {
  27258. e.setEventHandler("mouseup", h, scope...)
  27259. return e
  27260. }
  27261. func (e *htmlRt) OnPaste(h EventHandler, scope ...any) HTMLRt {
  27262. e.setEventHandler("paste", h, scope...)
  27263. return e
  27264. }
  27265. func (e *htmlRt) OnReset(h EventHandler, scope ...any) HTMLRt {
  27266. e.setEventHandler("reset", h, scope...)
  27267. return e
  27268. }
  27269. func (e *htmlRt) OnScroll(h EventHandler, scope ...any) HTMLRt {
  27270. e.setEventHandler("scroll", h, scope...)
  27271. return e
  27272. }
  27273. func (e *htmlRt) OnSearch(h EventHandler, scope ...any) HTMLRt {
  27274. e.setEventHandler("search", h, scope...)
  27275. return e
  27276. }
  27277. func (e *htmlRt) OnSelect(h EventHandler, scope ...any) HTMLRt {
  27278. e.setEventHandler("select", h, scope...)
  27279. return e
  27280. }
  27281. func (e *htmlRt) OnSubmit(h EventHandler, scope ...any) HTMLRt {
  27282. e.setEventHandler("submit", h, scope...)
  27283. return e
  27284. }
  27285. func (e *htmlRt) OnWheel(h EventHandler, scope ...any) HTMLRt {
  27286. e.setEventHandler("wheel", h, scope...)
  27287. return e
  27288. }
  27289. // HTMLRuby is the interface that describes a "ruby" HTML element.
  27290. type HTMLRuby interface {
  27291. UI
  27292. // Body set the content of the element.
  27293. Body(elems ...UI) HTMLRuby
  27294. // Text sets the content of the element with a text node containing the stringified given value.
  27295. Text(v any) HTMLRuby
  27296. // AccessKey specifies a shortcut key to activate/focus an element.
  27297. AccessKey(v string) HTMLRuby
  27298. // Aria stores accessible rich internet applications (ARIA) data.
  27299. Aria(k string, v any) HTMLRuby
  27300. // Attr sets the named attribute with the given value.
  27301. Attr(n string, v any) HTMLRuby
  27302. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  27303. Class(v ...string) HTMLRuby
  27304. // ContentEditable specifies whether the content of an element is editable or not.
  27305. ContentEditable(v bool) HTMLRuby
  27306. // DataSet stores custom data private to the page or application.
  27307. DataSet(k string, v any) HTMLRuby
  27308. // Dir specifies the text direction for the content in an element.
  27309. Dir(v string) HTMLRuby
  27310. // Draggable specifies whether an element is draggable or not.
  27311. Draggable(v bool) HTMLRuby
  27312. // Hidden specifies that an element is not yet, or is no longer relevant.
  27313. Hidden(v bool) HTMLRuby
  27314. // ID specifies a unique id for an element.
  27315. ID(v string) HTMLRuby
  27316. // Lang specifies the language of the element's content.
  27317. Lang(v string) HTMLRuby
  27318. // Role specifies to parsing software the exact function of an element (and its children).
  27319. Role(v string) HTMLRuby
  27320. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  27321. Spellcheck(v bool) HTMLRuby
  27322. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  27323. Style(k, v string) HTMLRuby
  27324. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  27325. Styles(s map[string]string) HTMLRuby
  27326. // TabIndex specifies the tabbing order of an element.
  27327. TabIndex(v int) HTMLRuby
  27328. // Title specifies extra information about an element.
  27329. Title(v string) HTMLRuby
  27330. // On registers the given event handler to the specified event.
  27331. On(event string, h EventHandler, scope ...any) HTMLRuby
  27332. // OnBlur calls the given handler when the element loses focus.
  27333. OnBlur(h EventHandler, scope ...any) HTMLRuby
  27334. // OnChange calls the given handler when the value of the element is changed.
  27335. OnChange(h EventHandler, scope ...any) HTMLRuby
  27336. // OnClick calls the given handler when there is a mouse click on the element.
  27337. OnClick(h EventHandler, scope ...any) HTMLRuby
  27338. // OnContextMenu calls the given handler when a context menu is triggered.
  27339. OnContextMenu(h EventHandler, scope ...any) HTMLRuby
  27340. // OnCopy calls the given handler when the user copies the content of an element.
  27341. OnCopy(h EventHandler, scope ...any) HTMLRuby
  27342. // OnCut calls the given handler when the user cuts the content of an element.
  27343. OnCut(h EventHandler, scope ...any) HTMLRuby
  27344. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  27345. OnDblClick(h EventHandler, scope ...any) HTMLRuby
  27346. // OnDrag calls the given handler when an element is dragged.
  27347. OnDrag(h EventHandler, scope ...any) HTMLRuby
  27348. // OnDragEnd calls the given handler at the end of a drag operation.
  27349. OnDragEnd(h EventHandler, scope ...any) HTMLRuby
  27350. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  27351. OnDragEnter(h EventHandler, scope ...any) HTMLRuby
  27352. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  27353. OnDragLeave(h EventHandler, scope ...any) HTMLRuby
  27354. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  27355. OnDragOver(h EventHandler, scope ...any) HTMLRuby
  27356. // OnDragStart calls the given handler at the start of a drag operation.
  27357. OnDragStart(h EventHandler, scope ...any) HTMLRuby
  27358. // OnDrop calls the given handler when dragged element is being dropped.
  27359. OnDrop(h EventHandler, scope ...any) HTMLRuby
  27360. // OnFocus calls the given handler when the element gets focus.
  27361. OnFocus(h EventHandler, scope ...any) HTMLRuby
  27362. // OnInput calls the given handler when an element gets user input.
  27363. OnInput(h EventHandler, scope ...any) HTMLRuby
  27364. // OnInvalid calls the given handler when an element is invalid.
  27365. OnInvalid(h EventHandler, scope ...any) HTMLRuby
  27366. // OnKeyDown calls the given handler when a user is pressing a key.
  27367. OnKeyDown(h EventHandler, scope ...any) HTMLRuby
  27368. // OnKeyPress calls the given handler when a user presses a key.
  27369. OnKeyPress(h EventHandler, scope ...any) HTMLRuby
  27370. // OnKeyUp calls the given handler when a user releases a key.
  27371. OnKeyUp(h EventHandler, scope ...any) HTMLRuby
  27372. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  27373. OnMouseDown(h EventHandler, scope ...any) HTMLRuby
  27374. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  27375. OnMouseMove(h EventHandler, scope ...any) HTMLRuby
  27376. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  27377. OnMouseOut(h EventHandler, scope ...any) HTMLRuby
  27378. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  27379. OnMouseOver(h EventHandler, scope ...any) HTMLRuby
  27380. // OnMouseUp calls the given handler when a mouse button is released over an element.
  27381. OnMouseUp(h EventHandler, scope ...any) HTMLRuby
  27382. // OnPaste calls the given handler when the user pastes some content in an element.
  27383. OnPaste(h EventHandler, scope ...any) HTMLRuby
  27384. // OnReset calls the given handler when the Reset button in a form is clicked.
  27385. OnReset(h EventHandler, scope ...any) HTMLRuby
  27386. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  27387. OnScroll(h EventHandler, scope ...any) HTMLRuby
  27388. // OnSearch calls the given handler when the user writes something in a search field.
  27389. OnSearch(h EventHandler, scope ...any) HTMLRuby
  27390. // OnSelect calls the given handler after some text has been selected in an element.
  27391. OnSelect(h EventHandler, scope ...any) HTMLRuby
  27392. // OnSubmit calls the given handler when a form is submitted.
  27393. OnSubmit(h EventHandler, scope ...any) HTMLRuby
  27394. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  27395. OnWheel(h EventHandler, scope ...any) HTMLRuby
  27396. }
  27397. // Ruby returns an HTML element that defines a ruby annotation (for East Asian typography).
  27398. func Ruby() HTMLRuby {
  27399. e := &htmlRuby{
  27400. htmlElement: htmlElement{
  27401. tag: "ruby",
  27402. isSelfClosing: false,
  27403. },
  27404. }
  27405. return e
  27406. }
  27407. type htmlRuby struct {
  27408. htmlElement
  27409. }
  27410. func (e *htmlRuby) Body(v ...UI) HTMLRuby {
  27411. e.setChildren(v...)
  27412. return e
  27413. }
  27414. func (e *htmlRuby) Text(v any) HTMLRuby {
  27415. return e.Body(Text(v))
  27416. }
  27417. func (e *htmlRuby) AccessKey(v string) HTMLRuby {
  27418. e.setAttr("accesskey", v)
  27419. return e
  27420. }
  27421. func (e *htmlRuby) Aria(k string, v any) HTMLRuby {
  27422. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  27423. return e
  27424. }
  27425. func (e *htmlRuby) Attr(n string, v any) HTMLRuby {
  27426. e.setAttr(n, v)
  27427. return e
  27428. }
  27429. func (e *htmlRuby) Class(v ...string) HTMLRuby {
  27430. e.setAttr("class", strings.Join(v, " "))
  27431. return e
  27432. }
  27433. func (e *htmlRuby) ContentEditable(v bool) HTMLRuby {
  27434. e.setAttr("contenteditable", v)
  27435. return e
  27436. }
  27437. func (e *htmlRuby) DataSet(k string, v any) HTMLRuby {
  27438. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  27439. return e
  27440. }
  27441. func (e *htmlRuby) Dir(v string) HTMLRuby {
  27442. e.setAttr("dir", v)
  27443. return e
  27444. }
  27445. func (e *htmlRuby) Draggable(v bool) HTMLRuby {
  27446. e.setAttr("draggable", v)
  27447. return e
  27448. }
  27449. func (e *htmlRuby) Hidden(v bool) HTMLRuby {
  27450. e.setAttr("hidden", v)
  27451. return e
  27452. }
  27453. func (e *htmlRuby) ID(v string) HTMLRuby {
  27454. e.setAttr("id", v)
  27455. return e
  27456. }
  27457. func (e *htmlRuby) Lang(v string) HTMLRuby {
  27458. e.setAttr("lang", v)
  27459. return e
  27460. }
  27461. func (e *htmlRuby) Role(v string) HTMLRuby {
  27462. e.setAttr("role", v)
  27463. return e
  27464. }
  27465. func (e *htmlRuby) Spellcheck(v bool) HTMLRuby {
  27466. s := "false"
  27467. if v {
  27468. s = "true"
  27469. }
  27470. e.setAttr("spellcheck", s)
  27471. return e
  27472. }
  27473. func (e *htmlRuby) Style(k, v string) HTMLRuby {
  27474. e.setAttr("style", k+":"+v)
  27475. return e
  27476. }
  27477. func (e *htmlRuby) Styles(s map[string]string) HTMLRuby {
  27478. for k, v := range s {
  27479. e.Style(k, v)
  27480. }
  27481. return e
  27482. }
  27483. func (e *htmlRuby) TabIndex(v int) HTMLRuby {
  27484. e.setAttr("tabindex", v)
  27485. return e
  27486. }
  27487. func (e *htmlRuby) Title(v string) HTMLRuby {
  27488. e.setAttr("title", v)
  27489. return e
  27490. }
  27491. func (e *htmlRuby) On(event string, h EventHandler, scope ...any) HTMLRuby {
  27492. e.setEventHandler(event, h, scope...)
  27493. return e
  27494. }
  27495. func (e *htmlRuby) OnBlur(h EventHandler, scope ...any) HTMLRuby {
  27496. e.setEventHandler("blur", h, scope...)
  27497. return e
  27498. }
  27499. func (e *htmlRuby) OnChange(h EventHandler, scope ...any) HTMLRuby {
  27500. e.setEventHandler("change", h, scope...)
  27501. return e
  27502. }
  27503. func (e *htmlRuby) OnClick(h EventHandler, scope ...any) HTMLRuby {
  27504. e.setEventHandler("click", h, scope...)
  27505. return e
  27506. }
  27507. func (e *htmlRuby) OnContextMenu(h EventHandler, scope ...any) HTMLRuby {
  27508. e.setEventHandler("contextmenu", h, scope...)
  27509. return e
  27510. }
  27511. func (e *htmlRuby) OnCopy(h EventHandler, scope ...any) HTMLRuby {
  27512. e.setEventHandler("copy", h, scope...)
  27513. return e
  27514. }
  27515. func (e *htmlRuby) OnCut(h EventHandler, scope ...any) HTMLRuby {
  27516. e.setEventHandler("cut", h, scope...)
  27517. return e
  27518. }
  27519. func (e *htmlRuby) OnDblClick(h EventHandler, scope ...any) HTMLRuby {
  27520. e.setEventHandler("dblclick", h, scope...)
  27521. return e
  27522. }
  27523. func (e *htmlRuby) OnDrag(h EventHandler, scope ...any) HTMLRuby {
  27524. e.setEventHandler("drag", h, scope...)
  27525. return e
  27526. }
  27527. func (e *htmlRuby) OnDragEnd(h EventHandler, scope ...any) HTMLRuby {
  27528. e.setEventHandler("dragend", h, scope...)
  27529. return e
  27530. }
  27531. func (e *htmlRuby) OnDragEnter(h EventHandler, scope ...any) HTMLRuby {
  27532. e.setEventHandler("dragenter", h, scope...)
  27533. return e
  27534. }
  27535. func (e *htmlRuby) OnDragLeave(h EventHandler, scope ...any) HTMLRuby {
  27536. e.setEventHandler("dragleave", h, scope...)
  27537. return e
  27538. }
  27539. func (e *htmlRuby) OnDragOver(h EventHandler, scope ...any) HTMLRuby {
  27540. e.setEventHandler("dragover", h, scope...)
  27541. return e
  27542. }
  27543. func (e *htmlRuby) OnDragStart(h EventHandler, scope ...any) HTMLRuby {
  27544. e.setEventHandler("dragstart", h, scope...)
  27545. return e
  27546. }
  27547. func (e *htmlRuby) OnDrop(h EventHandler, scope ...any) HTMLRuby {
  27548. e.setEventHandler("drop", h, scope...)
  27549. return e
  27550. }
  27551. func (e *htmlRuby) OnFocus(h EventHandler, scope ...any) HTMLRuby {
  27552. e.setEventHandler("focus", h, scope...)
  27553. return e
  27554. }
  27555. func (e *htmlRuby) OnInput(h EventHandler, scope ...any) HTMLRuby {
  27556. e.setEventHandler("input", h, scope...)
  27557. return e
  27558. }
  27559. func (e *htmlRuby) OnInvalid(h EventHandler, scope ...any) HTMLRuby {
  27560. e.setEventHandler("invalid", h, scope...)
  27561. return e
  27562. }
  27563. func (e *htmlRuby) OnKeyDown(h EventHandler, scope ...any) HTMLRuby {
  27564. e.setEventHandler("keydown", h, scope...)
  27565. return e
  27566. }
  27567. func (e *htmlRuby) OnKeyPress(h EventHandler, scope ...any) HTMLRuby {
  27568. e.setEventHandler("keypress", h, scope...)
  27569. return e
  27570. }
  27571. func (e *htmlRuby) OnKeyUp(h EventHandler, scope ...any) HTMLRuby {
  27572. e.setEventHandler("keyup", h, scope...)
  27573. return e
  27574. }
  27575. func (e *htmlRuby) OnMouseDown(h EventHandler, scope ...any) HTMLRuby {
  27576. e.setEventHandler("mousedown", h, scope...)
  27577. return e
  27578. }
  27579. func (e *htmlRuby) OnMouseMove(h EventHandler, scope ...any) HTMLRuby {
  27580. e.setEventHandler("mousemove", h, scope...)
  27581. return e
  27582. }
  27583. func (e *htmlRuby) OnMouseOut(h EventHandler, scope ...any) HTMLRuby {
  27584. e.setEventHandler("mouseout", h, scope...)
  27585. return e
  27586. }
  27587. func (e *htmlRuby) OnMouseOver(h EventHandler, scope ...any) HTMLRuby {
  27588. e.setEventHandler("mouseover", h, scope...)
  27589. return e
  27590. }
  27591. func (e *htmlRuby) OnMouseUp(h EventHandler, scope ...any) HTMLRuby {
  27592. e.setEventHandler("mouseup", h, scope...)
  27593. return e
  27594. }
  27595. func (e *htmlRuby) OnPaste(h EventHandler, scope ...any) HTMLRuby {
  27596. e.setEventHandler("paste", h, scope...)
  27597. return e
  27598. }
  27599. func (e *htmlRuby) OnReset(h EventHandler, scope ...any) HTMLRuby {
  27600. e.setEventHandler("reset", h, scope...)
  27601. return e
  27602. }
  27603. func (e *htmlRuby) OnScroll(h EventHandler, scope ...any) HTMLRuby {
  27604. e.setEventHandler("scroll", h, scope...)
  27605. return e
  27606. }
  27607. func (e *htmlRuby) OnSearch(h EventHandler, scope ...any) HTMLRuby {
  27608. e.setEventHandler("search", h, scope...)
  27609. return e
  27610. }
  27611. func (e *htmlRuby) OnSelect(h EventHandler, scope ...any) HTMLRuby {
  27612. e.setEventHandler("select", h, scope...)
  27613. return e
  27614. }
  27615. func (e *htmlRuby) OnSubmit(h EventHandler, scope ...any) HTMLRuby {
  27616. e.setEventHandler("submit", h, scope...)
  27617. return e
  27618. }
  27619. func (e *htmlRuby) OnWheel(h EventHandler, scope ...any) HTMLRuby {
  27620. e.setEventHandler("wheel", h, scope...)
  27621. return e
  27622. }
  27623. // HTMLS is the interface that describes a "s" HTML element.
  27624. type HTMLS interface {
  27625. UI
  27626. // Body set the content of the element.
  27627. Body(elems ...UI) HTMLS
  27628. // Text sets the content of the element with a text node containing the stringified given value.
  27629. Text(v any) HTMLS
  27630. // AccessKey specifies a shortcut key to activate/focus an element.
  27631. AccessKey(v string) HTMLS
  27632. // Aria stores accessible rich internet applications (ARIA) data.
  27633. Aria(k string, v any) HTMLS
  27634. // Attr sets the named attribute with the given value.
  27635. Attr(n string, v any) HTMLS
  27636. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  27637. Class(v ...string) HTMLS
  27638. // ContentEditable specifies whether the content of an element is editable or not.
  27639. ContentEditable(v bool) HTMLS
  27640. // DataSet stores custom data private to the page or application.
  27641. DataSet(k string, v any) HTMLS
  27642. // Dir specifies the text direction for the content in an element.
  27643. Dir(v string) HTMLS
  27644. // Draggable specifies whether an element is draggable or not.
  27645. Draggable(v bool) HTMLS
  27646. // Hidden specifies that an element is not yet, or is no longer relevant.
  27647. Hidden(v bool) HTMLS
  27648. // ID specifies a unique id for an element.
  27649. ID(v string) HTMLS
  27650. // Lang specifies the language of the element's content.
  27651. Lang(v string) HTMLS
  27652. // Role specifies to parsing software the exact function of an element (and its children).
  27653. Role(v string) HTMLS
  27654. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  27655. Spellcheck(v bool) HTMLS
  27656. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  27657. Style(k, v string) HTMLS
  27658. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  27659. Styles(s map[string]string) HTMLS
  27660. // TabIndex specifies the tabbing order of an element.
  27661. TabIndex(v int) HTMLS
  27662. // Title specifies extra information about an element.
  27663. Title(v string) HTMLS
  27664. // On registers the given event handler to the specified event.
  27665. On(event string, h EventHandler, scope ...any) HTMLS
  27666. // OnBlur calls the given handler when the element loses focus.
  27667. OnBlur(h EventHandler, scope ...any) HTMLS
  27668. // OnChange calls the given handler when the value of the element is changed.
  27669. OnChange(h EventHandler, scope ...any) HTMLS
  27670. // OnClick calls the given handler when there is a mouse click on the element.
  27671. OnClick(h EventHandler, scope ...any) HTMLS
  27672. // OnContextMenu calls the given handler when a context menu is triggered.
  27673. OnContextMenu(h EventHandler, scope ...any) HTMLS
  27674. // OnCopy calls the given handler when the user copies the content of an element.
  27675. OnCopy(h EventHandler, scope ...any) HTMLS
  27676. // OnCut calls the given handler when the user cuts the content of an element.
  27677. OnCut(h EventHandler, scope ...any) HTMLS
  27678. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  27679. OnDblClick(h EventHandler, scope ...any) HTMLS
  27680. // OnDrag calls the given handler when an element is dragged.
  27681. OnDrag(h EventHandler, scope ...any) HTMLS
  27682. // OnDragEnd calls the given handler at the end of a drag operation.
  27683. OnDragEnd(h EventHandler, scope ...any) HTMLS
  27684. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  27685. OnDragEnter(h EventHandler, scope ...any) HTMLS
  27686. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  27687. OnDragLeave(h EventHandler, scope ...any) HTMLS
  27688. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  27689. OnDragOver(h EventHandler, scope ...any) HTMLS
  27690. // OnDragStart calls the given handler at the start of a drag operation.
  27691. OnDragStart(h EventHandler, scope ...any) HTMLS
  27692. // OnDrop calls the given handler when dragged element is being dropped.
  27693. OnDrop(h EventHandler, scope ...any) HTMLS
  27694. // OnFocus calls the given handler when the element gets focus.
  27695. OnFocus(h EventHandler, scope ...any) HTMLS
  27696. // OnInput calls the given handler when an element gets user input.
  27697. OnInput(h EventHandler, scope ...any) HTMLS
  27698. // OnInvalid calls the given handler when an element is invalid.
  27699. OnInvalid(h EventHandler, scope ...any) HTMLS
  27700. // OnKeyDown calls the given handler when a user is pressing a key.
  27701. OnKeyDown(h EventHandler, scope ...any) HTMLS
  27702. // OnKeyPress calls the given handler when a user presses a key.
  27703. OnKeyPress(h EventHandler, scope ...any) HTMLS
  27704. // OnKeyUp calls the given handler when a user releases a key.
  27705. OnKeyUp(h EventHandler, scope ...any) HTMLS
  27706. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  27707. OnMouseDown(h EventHandler, scope ...any) HTMLS
  27708. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  27709. OnMouseMove(h EventHandler, scope ...any) HTMLS
  27710. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  27711. OnMouseOut(h EventHandler, scope ...any) HTMLS
  27712. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  27713. OnMouseOver(h EventHandler, scope ...any) HTMLS
  27714. // OnMouseUp calls the given handler when a mouse button is released over an element.
  27715. OnMouseUp(h EventHandler, scope ...any) HTMLS
  27716. // OnPaste calls the given handler when the user pastes some content in an element.
  27717. OnPaste(h EventHandler, scope ...any) HTMLS
  27718. // OnReset calls the given handler when the Reset button in a form is clicked.
  27719. OnReset(h EventHandler, scope ...any) HTMLS
  27720. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  27721. OnScroll(h EventHandler, scope ...any) HTMLS
  27722. // OnSearch calls the given handler when the user writes something in a search field.
  27723. OnSearch(h EventHandler, scope ...any) HTMLS
  27724. // OnSelect calls the given handler after some text has been selected in an element.
  27725. OnSelect(h EventHandler, scope ...any) HTMLS
  27726. // OnSubmit calls the given handler when a form is submitted.
  27727. OnSubmit(h EventHandler, scope ...any) HTMLS
  27728. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  27729. OnWheel(h EventHandler, scope ...any) HTMLS
  27730. }
  27731. // S returns an HTML element that Defines text that is no longer correct.
  27732. func S() HTMLS {
  27733. e := &htmlS{
  27734. htmlElement: htmlElement{
  27735. tag: "s",
  27736. isSelfClosing: false,
  27737. },
  27738. }
  27739. return e
  27740. }
  27741. type htmlS struct {
  27742. htmlElement
  27743. }
  27744. func (e *htmlS) Body(v ...UI) HTMLS {
  27745. e.setChildren(v...)
  27746. return e
  27747. }
  27748. func (e *htmlS) Text(v any) HTMLS {
  27749. return e.Body(Text(v))
  27750. }
  27751. func (e *htmlS) AccessKey(v string) HTMLS {
  27752. e.setAttr("accesskey", v)
  27753. return e
  27754. }
  27755. func (e *htmlS) Aria(k string, v any) HTMLS {
  27756. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  27757. return e
  27758. }
  27759. func (e *htmlS) Attr(n string, v any) HTMLS {
  27760. e.setAttr(n, v)
  27761. return e
  27762. }
  27763. func (e *htmlS) Class(v ...string) HTMLS {
  27764. e.setAttr("class", strings.Join(v, " "))
  27765. return e
  27766. }
  27767. func (e *htmlS) ContentEditable(v bool) HTMLS {
  27768. e.setAttr("contenteditable", v)
  27769. return e
  27770. }
  27771. func (e *htmlS) DataSet(k string, v any) HTMLS {
  27772. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  27773. return e
  27774. }
  27775. func (e *htmlS) Dir(v string) HTMLS {
  27776. e.setAttr("dir", v)
  27777. return e
  27778. }
  27779. func (e *htmlS) Draggable(v bool) HTMLS {
  27780. e.setAttr("draggable", v)
  27781. return e
  27782. }
  27783. func (e *htmlS) Hidden(v bool) HTMLS {
  27784. e.setAttr("hidden", v)
  27785. return e
  27786. }
  27787. func (e *htmlS) ID(v string) HTMLS {
  27788. e.setAttr("id", v)
  27789. return e
  27790. }
  27791. func (e *htmlS) Lang(v string) HTMLS {
  27792. e.setAttr("lang", v)
  27793. return e
  27794. }
  27795. func (e *htmlS) Role(v string) HTMLS {
  27796. e.setAttr("role", v)
  27797. return e
  27798. }
  27799. func (e *htmlS) Spellcheck(v bool) HTMLS {
  27800. s := "false"
  27801. if v {
  27802. s = "true"
  27803. }
  27804. e.setAttr("spellcheck", s)
  27805. return e
  27806. }
  27807. func (e *htmlS) Style(k, v string) HTMLS {
  27808. e.setAttr("style", k+":"+v)
  27809. return e
  27810. }
  27811. func (e *htmlS) Styles(s map[string]string) HTMLS {
  27812. for k, v := range s {
  27813. e.Style(k, v)
  27814. }
  27815. return e
  27816. }
  27817. func (e *htmlS) TabIndex(v int) HTMLS {
  27818. e.setAttr("tabindex", v)
  27819. return e
  27820. }
  27821. func (e *htmlS) Title(v string) HTMLS {
  27822. e.setAttr("title", v)
  27823. return e
  27824. }
  27825. func (e *htmlS) On(event string, h EventHandler, scope ...any) HTMLS {
  27826. e.setEventHandler(event, h, scope...)
  27827. return e
  27828. }
  27829. func (e *htmlS) OnBlur(h EventHandler, scope ...any) HTMLS {
  27830. e.setEventHandler("blur", h, scope...)
  27831. return e
  27832. }
  27833. func (e *htmlS) OnChange(h EventHandler, scope ...any) HTMLS {
  27834. e.setEventHandler("change", h, scope...)
  27835. return e
  27836. }
  27837. func (e *htmlS) OnClick(h EventHandler, scope ...any) HTMLS {
  27838. e.setEventHandler("click", h, scope...)
  27839. return e
  27840. }
  27841. func (e *htmlS) OnContextMenu(h EventHandler, scope ...any) HTMLS {
  27842. e.setEventHandler("contextmenu", h, scope...)
  27843. return e
  27844. }
  27845. func (e *htmlS) OnCopy(h EventHandler, scope ...any) HTMLS {
  27846. e.setEventHandler("copy", h, scope...)
  27847. return e
  27848. }
  27849. func (e *htmlS) OnCut(h EventHandler, scope ...any) HTMLS {
  27850. e.setEventHandler("cut", h, scope...)
  27851. return e
  27852. }
  27853. func (e *htmlS) OnDblClick(h EventHandler, scope ...any) HTMLS {
  27854. e.setEventHandler("dblclick", h, scope...)
  27855. return e
  27856. }
  27857. func (e *htmlS) OnDrag(h EventHandler, scope ...any) HTMLS {
  27858. e.setEventHandler("drag", h, scope...)
  27859. return e
  27860. }
  27861. func (e *htmlS) OnDragEnd(h EventHandler, scope ...any) HTMLS {
  27862. e.setEventHandler("dragend", h, scope...)
  27863. return e
  27864. }
  27865. func (e *htmlS) OnDragEnter(h EventHandler, scope ...any) HTMLS {
  27866. e.setEventHandler("dragenter", h, scope...)
  27867. return e
  27868. }
  27869. func (e *htmlS) OnDragLeave(h EventHandler, scope ...any) HTMLS {
  27870. e.setEventHandler("dragleave", h, scope...)
  27871. return e
  27872. }
  27873. func (e *htmlS) OnDragOver(h EventHandler, scope ...any) HTMLS {
  27874. e.setEventHandler("dragover", h, scope...)
  27875. return e
  27876. }
  27877. func (e *htmlS) OnDragStart(h EventHandler, scope ...any) HTMLS {
  27878. e.setEventHandler("dragstart", h, scope...)
  27879. return e
  27880. }
  27881. func (e *htmlS) OnDrop(h EventHandler, scope ...any) HTMLS {
  27882. e.setEventHandler("drop", h, scope...)
  27883. return e
  27884. }
  27885. func (e *htmlS) OnFocus(h EventHandler, scope ...any) HTMLS {
  27886. e.setEventHandler("focus", h, scope...)
  27887. return e
  27888. }
  27889. func (e *htmlS) OnInput(h EventHandler, scope ...any) HTMLS {
  27890. e.setEventHandler("input", h, scope...)
  27891. return e
  27892. }
  27893. func (e *htmlS) OnInvalid(h EventHandler, scope ...any) HTMLS {
  27894. e.setEventHandler("invalid", h, scope...)
  27895. return e
  27896. }
  27897. func (e *htmlS) OnKeyDown(h EventHandler, scope ...any) HTMLS {
  27898. e.setEventHandler("keydown", h, scope...)
  27899. return e
  27900. }
  27901. func (e *htmlS) OnKeyPress(h EventHandler, scope ...any) HTMLS {
  27902. e.setEventHandler("keypress", h, scope...)
  27903. return e
  27904. }
  27905. func (e *htmlS) OnKeyUp(h EventHandler, scope ...any) HTMLS {
  27906. e.setEventHandler("keyup", h, scope...)
  27907. return e
  27908. }
  27909. func (e *htmlS) OnMouseDown(h EventHandler, scope ...any) HTMLS {
  27910. e.setEventHandler("mousedown", h, scope...)
  27911. return e
  27912. }
  27913. func (e *htmlS) OnMouseMove(h EventHandler, scope ...any) HTMLS {
  27914. e.setEventHandler("mousemove", h, scope...)
  27915. return e
  27916. }
  27917. func (e *htmlS) OnMouseOut(h EventHandler, scope ...any) HTMLS {
  27918. e.setEventHandler("mouseout", h, scope...)
  27919. return e
  27920. }
  27921. func (e *htmlS) OnMouseOver(h EventHandler, scope ...any) HTMLS {
  27922. e.setEventHandler("mouseover", h, scope...)
  27923. return e
  27924. }
  27925. func (e *htmlS) OnMouseUp(h EventHandler, scope ...any) HTMLS {
  27926. e.setEventHandler("mouseup", h, scope...)
  27927. return e
  27928. }
  27929. func (e *htmlS) OnPaste(h EventHandler, scope ...any) HTMLS {
  27930. e.setEventHandler("paste", h, scope...)
  27931. return e
  27932. }
  27933. func (e *htmlS) OnReset(h EventHandler, scope ...any) HTMLS {
  27934. e.setEventHandler("reset", h, scope...)
  27935. return e
  27936. }
  27937. func (e *htmlS) OnScroll(h EventHandler, scope ...any) HTMLS {
  27938. e.setEventHandler("scroll", h, scope...)
  27939. return e
  27940. }
  27941. func (e *htmlS) OnSearch(h EventHandler, scope ...any) HTMLS {
  27942. e.setEventHandler("search", h, scope...)
  27943. return e
  27944. }
  27945. func (e *htmlS) OnSelect(h EventHandler, scope ...any) HTMLS {
  27946. e.setEventHandler("select", h, scope...)
  27947. return e
  27948. }
  27949. func (e *htmlS) OnSubmit(h EventHandler, scope ...any) HTMLS {
  27950. e.setEventHandler("submit", h, scope...)
  27951. return e
  27952. }
  27953. func (e *htmlS) OnWheel(h EventHandler, scope ...any) HTMLS {
  27954. e.setEventHandler("wheel", h, scope...)
  27955. return e
  27956. }
  27957. // HTMLSamp is the interface that describes a "samp" HTML element.
  27958. type HTMLSamp interface {
  27959. UI
  27960. // Body set the content of the element.
  27961. Body(elems ...UI) HTMLSamp
  27962. // Text sets the content of the element with a text node containing the stringified given value.
  27963. Text(v any) HTMLSamp
  27964. // AccessKey specifies a shortcut key to activate/focus an element.
  27965. AccessKey(v string) HTMLSamp
  27966. // Aria stores accessible rich internet applications (ARIA) data.
  27967. Aria(k string, v any) HTMLSamp
  27968. // Attr sets the named attribute with the given value.
  27969. Attr(n string, v any) HTMLSamp
  27970. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  27971. Class(v ...string) HTMLSamp
  27972. // ContentEditable specifies whether the content of an element is editable or not.
  27973. ContentEditable(v bool) HTMLSamp
  27974. // DataSet stores custom data private to the page or application.
  27975. DataSet(k string, v any) HTMLSamp
  27976. // Dir specifies the text direction for the content in an element.
  27977. Dir(v string) HTMLSamp
  27978. // Draggable specifies whether an element is draggable or not.
  27979. Draggable(v bool) HTMLSamp
  27980. // Hidden specifies that an element is not yet, or is no longer relevant.
  27981. Hidden(v bool) HTMLSamp
  27982. // ID specifies a unique id for an element.
  27983. ID(v string) HTMLSamp
  27984. // Lang specifies the language of the element's content.
  27985. Lang(v string) HTMLSamp
  27986. // Role specifies to parsing software the exact function of an element (and its children).
  27987. Role(v string) HTMLSamp
  27988. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  27989. Spellcheck(v bool) HTMLSamp
  27990. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  27991. Style(k, v string) HTMLSamp
  27992. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  27993. Styles(s map[string]string) HTMLSamp
  27994. // TabIndex specifies the tabbing order of an element.
  27995. TabIndex(v int) HTMLSamp
  27996. // Title specifies extra information about an element.
  27997. Title(v string) HTMLSamp
  27998. // On registers the given event handler to the specified event.
  27999. On(event string, h EventHandler, scope ...any) HTMLSamp
  28000. // OnBlur calls the given handler when the element loses focus.
  28001. OnBlur(h EventHandler, scope ...any) HTMLSamp
  28002. // OnChange calls the given handler when the value of the element is changed.
  28003. OnChange(h EventHandler, scope ...any) HTMLSamp
  28004. // OnClick calls the given handler when there is a mouse click on the element.
  28005. OnClick(h EventHandler, scope ...any) HTMLSamp
  28006. // OnContextMenu calls the given handler when a context menu is triggered.
  28007. OnContextMenu(h EventHandler, scope ...any) HTMLSamp
  28008. // OnCopy calls the given handler when the user copies the content of an element.
  28009. OnCopy(h EventHandler, scope ...any) HTMLSamp
  28010. // OnCut calls the given handler when the user cuts the content of an element.
  28011. OnCut(h EventHandler, scope ...any) HTMLSamp
  28012. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  28013. OnDblClick(h EventHandler, scope ...any) HTMLSamp
  28014. // OnDrag calls the given handler when an element is dragged.
  28015. OnDrag(h EventHandler, scope ...any) HTMLSamp
  28016. // OnDragEnd calls the given handler at the end of a drag operation.
  28017. OnDragEnd(h EventHandler, scope ...any) HTMLSamp
  28018. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  28019. OnDragEnter(h EventHandler, scope ...any) HTMLSamp
  28020. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  28021. OnDragLeave(h EventHandler, scope ...any) HTMLSamp
  28022. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  28023. OnDragOver(h EventHandler, scope ...any) HTMLSamp
  28024. // OnDragStart calls the given handler at the start of a drag operation.
  28025. OnDragStart(h EventHandler, scope ...any) HTMLSamp
  28026. // OnDrop calls the given handler when dragged element is being dropped.
  28027. OnDrop(h EventHandler, scope ...any) HTMLSamp
  28028. // OnFocus calls the given handler when the element gets focus.
  28029. OnFocus(h EventHandler, scope ...any) HTMLSamp
  28030. // OnInput calls the given handler when an element gets user input.
  28031. OnInput(h EventHandler, scope ...any) HTMLSamp
  28032. // OnInvalid calls the given handler when an element is invalid.
  28033. OnInvalid(h EventHandler, scope ...any) HTMLSamp
  28034. // OnKeyDown calls the given handler when a user is pressing a key.
  28035. OnKeyDown(h EventHandler, scope ...any) HTMLSamp
  28036. // OnKeyPress calls the given handler when a user presses a key.
  28037. OnKeyPress(h EventHandler, scope ...any) HTMLSamp
  28038. // OnKeyUp calls the given handler when a user releases a key.
  28039. OnKeyUp(h EventHandler, scope ...any) HTMLSamp
  28040. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  28041. OnMouseDown(h EventHandler, scope ...any) HTMLSamp
  28042. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  28043. OnMouseMove(h EventHandler, scope ...any) HTMLSamp
  28044. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  28045. OnMouseOut(h EventHandler, scope ...any) HTMLSamp
  28046. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  28047. OnMouseOver(h EventHandler, scope ...any) HTMLSamp
  28048. // OnMouseUp calls the given handler when a mouse button is released over an element.
  28049. OnMouseUp(h EventHandler, scope ...any) HTMLSamp
  28050. // OnPaste calls the given handler when the user pastes some content in an element.
  28051. OnPaste(h EventHandler, scope ...any) HTMLSamp
  28052. // OnReset calls the given handler when the Reset button in a form is clicked.
  28053. OnReset(h EventHandler, scope ...any) HTMLSamp
  28054. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  28055. OnScroll(h EventHandler, scope ...any) HTMLSamp
  28056. // OnSearch calls the given handler when the user writes something in a search field.
  28057. OnSearch(h EventHandler, scope ...any) HTMLSamp
  28058. // OnSelect calls the given handler after some text has been selected in an element.
  28059. OnSelect(h EventHandler, scope ...any) HTMLSamp
  28060. // OnSubmit calls the given handler when a form is submitted.
  28061. OnSubmit(h EventHandler, scope ...any) HTMLSamp
  28062. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  28063. OnWheel(h EventHandler, scope ...any) HTMLSamp
  28064. }
  28065. // Samp returns an HTML element that defines sample output from a computer program.
  28066. func Samp() HTMLSamp {
  28067. e := &htmlSamp{
  28068. htmlElement: htmlElement{
  28069. tag: "samp",
  28070. isSelfClosing: false,
  28071. },
  28072. }
  28073. return e
  28074. }
  28075. type htmlSamp struct {
  28076. htmlElement
  28077. }
  28078. func (e *htmlSamp) Body(v ...UI) HTMLSamp {
  28079. e.setChildren(v...)
  28080. return e
  28081. }
  28082. func (e *htmlSamp) Text(v any) HTMLSamp {
  28083. return e.Body(Text(v))
  28084. }
  28085. func (e *htmlSamp) AccessKey(v string) HTMLSamp {
  28086. e.setAttr("accesskey", v)
  28087. return e
  28088. }
  28089. func (e *htmlSamp) Aria(k string, v any) HTMLSamp {
  28090. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  28091. return e
  28092. }
  28093. func (e *htmlSamp) Attr(n string, v any) HTMLSamp {
  28094. e.setAttr(n, v)
  28095. return e
  28096. }
  28097. func (e *htmlSamp) Class(v ...string) HTMLSamp {
  28098. e.setAttr("class", strings.Join(v, " "))
  28099. return e
  28100. }
  28101. func (e *htmlSamp) ContentEditable(v bool) HTMLSamp {
  28102. e.setAttr("contenteditable", v)
  28103. return e
  28104. }
  28105. func (e *htmlSamp) DataSet(k string, v any) HTMLSamp {
  28106. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  28107. return e
  28108. }
  28109. func (e *htmlSamp) Dir(v string) HTMLSamp {
  28110. e.setAttr("dir", v)
  28111. return e
  28112. }
  28113. func (e *htmlSamp) Draggable(v bool) HTMLSamp {
  28114. e.setAttr("draggable", v)
  28115. return e
  28116. }
  28117. func (e *htmlSamp) Hidden(v bool) HTMLSamp {
  28118. e.setAttr("hidden", v)
  28119. return e
  28120. }
  28121. func (e *htmlSamp) ID(v string) HTMLSamp {
  28122. e.setAttr("id", v)
  28123. return e
  28124. }
  28125. func (e *htmlSamp) Lang(v string) HTMLSamp {
  28126. e.setAttr("lang", v)
  28127. return e
  28128. }
  28129. func (e *htmlSamp) Role(v string) HTMLSamp {
  28130. e.setAttr("role", v)
  28131. return e
  28132. }
  28133. func (e *htmlSamp) Spellcheck(v bool) HTMLSamp {
  28134. s := "false"
  28135. if v {
  28136. s = "true"
  28137. }
  28138. e.setAttr("spellcheck", s)
  28139. return e
  28140. }
  28141. func (e *htmlSamp) Style(k, v string) HTMLSamp {
  28142. e.setAttr("style", k+":"+v)
  28143. return e
  28144. }
  28145. func (e *htmlSamp) Styles(s map[string]string) HTMLSamp {
  28146. for k, v := range s {
  28147. e.Style(k, v)
  28148. }
  28149. return e
  28150. }
  28151. func (e *htmlSamp) TabIndex(v int) HTMLSamp {
  28152. e.setAttr("tabindex", v)
  28153. return e
  28154. }
  28155. func (e *htmlSamp) Title(v string) HTMLSamp {
  28156. e.setAttr("title", v)
  28157. return e
  28158. }
  28159. func (e *htmlSamp) On(event string, h EventHandler, scope ...any) HTMLSamp {
  28160. e.setEventHandler(event, h, scope...)
  28161. return e
  28162. }
  28163. func (e *htmlSamp) OnBlur(h EventHandler, scope ...any) HTMLSamp {
  28164. e.setEventHandler("blur", h, scope...)
  28165. return e
  28166. }
  28167. func (e *htmlSamp) OnChange(h EventHandler, scope ...any) HTMLSamp {
  28168. e.setEventHandler("change", h, scope...)
  28169. return e
  28170. }
  28171. func (e *htmlSamp) OnClick(h EventHandler, scope ...any) HTMLSamp {
  28172. e.setEventHandler("click", h, scope...)
  28173. return e
  28174. }
  28175. func (e *htmlSamp) OnContextMenu(h EventHandler, scope ...any) HTMLSamp {
  28176. e.setEventHandler("contextmenu", h, scope...)
  28177. return e
  28178. }
  28179. func (e *htmlSamp) OnCopy(h EventHandler, scope ...any) HTMLSamp {
  28180. e.setEventHandler("copy", h, scope...)
  28181. return e
  28182. }
  28183. func (e *htmlSamp) OnCut(h EventHandler, scope ...any) HTMLSamp {
  28184. e.setEventHandler("cut", h, scope...)
  28185. return e
  28186. }
  28187. func (e *htmlSamp) OnDblClick(h EventHandler, scope ...any) HTMLSamp {
  28188. e.setEventHandler("dblclick", h, scope...)
  28189. return e
  28190. }
  28191. func (e *htmlSamp) OnDrag(h EventHandler, scope ...any) HTMLSamp {
  28192. e.setEventHandler("drag", h, scope...)
  28193. return e
  28194. }
  28195. func (e *htmlSamp) OnDragEnd(h EventHandler, scope ...any) HTMLSamp {
  28196. e.setEventHandler("dragend", h, scope...)
  28197. return e
  28198. }
  28199. func (e *htmlSamp) OnDragEnter(h EventHandler, scope ...any) HTMLSamp {
  28200. e.setEventHandler("dragenter", h, scope...)
  28201. return e
  28202. }
  28203. func (e *htmlSamp) OnDragLeave(h EventHandler, scope ...any) HTMLSamp {
  28204. e.setEventHandler("dragleave", h, scope...)
  28205. return e
  28206. }
  28207. func (e *htmlSamp) OnDragOver(h EventHandler, scope ...any) HTMLSamp {
  28208. e.setEventHandler("dragover", h, scope...)
  28209. return e
  28210. }
  28211. func (e *htmlSamp) OnDragStart(h EventHandler, scope ...any) HTMLSamp {
  28212. e.setEventHandler("dragstart", h, scope...)
  28213. return e
  28214. }
  28215. func (e *htmlSamp) OnDrop(h EventHandler, scope ...any) HTMLSamp {
  28216. e.setEventHandler("drop", h, scope...)
  28217. return e
  28218. }
  28219. func (e *htmlSamp) OnFocus(h EventHandler, scope ...any) HTMLSamp {
  28220. e.setEventHandler("focus", h, scope...)
  28221. return e
  28222. }
  28223. func (e *htmlSamp) OnInput(h EventHandler, scope ...any) HTMLSamp {
  28224. e.setEventHandler("input", h, scope...)
  28225. return e
  28226. }
  28227. func (e *htmlSamp) OnInvalid(h EventHandler, scope ...any) HTMLSamp {
  28228. e.setEventHandler("invalid", h, scope...)
  28229. return e
  28230. }
  28231. func (e *htmlSamp) OnKeyDown(h EventHandler, scope ...any) HTMLSamp {
  28232. e.setEventHandler("keydown", h, scope...)
  28233. return e
  28234. }
  28235. func (e *htmlSamp) OnKeyPress(h EventHandler, scope ...any) HTMLSamp {
  28236. e.setEventHandler("keypress", h, scope...)
  28237. return e
  28238. }
  28239. func (e *htmlSamp) OnKeyUp(h EventHandler, scope ...any) HTMLSamp {
  28240. e.setEventHandler("keyup", h, scope...)
  28241. return e
  28242. }
  28243. func (e *htmlSamp) OnMouseDown(h EventHandler, scope ...any) HTMLSamp {
  28244. e.setEventHandler("mousedown", h, scope...)
  28245. return e
  28246. }
  28247. func (e *htmlSamp) OnMouseMove(h EventHandler, scope ...any) HTMLSamp {
  28248. e.setEventHandler("mousemove", h, scope...)
  28249. return e
  28250. }
  28251. func (e *htmlSamp) OnMouseOut(h EventHandler, scope ...any) HTMLSamp {
  28252. e.setEventHandler("mouseout", h, scope...)
  28253. return e
  28254. }
  28255. func (e *htmlSamp) OnMouseOver(h EventHandler, scope ...any) HTMLSamp {
  28256. e.setEventHandler("mouseover", h, scope...)
  28257. return e
  28258. }
  28259. func (e *htmlSamp) OnMouseUp(h EventHandler, scope ...any) HTMLSamp {
  28260. e.setEventHandler("mouseup", h, scope...)
  28261. return e
  28262. }
  28263. func (e *htmlSamp) OnPaste(h EventHandler, scope ...any) HTMLSamp {
  28264. e.setEventHandler("paste", h, scope...)
  28265. return e
  28266. }
  28267. func (e *htmlSamp) OnReset(h EventHandler, scope ...any) HTMLSamp {
  28268. e.setEventHandler("reset", h, scope...)
  28269. return e
  28270. }
  28271. func (e *htmlSamp) OnScroll(h EventHandler, scope ...any) HTMLSamp {
  28272. e.setEventHandler("scroll", h, scope...)
  28273. return e
  28274. }
  28275. func (e *htmlSamp) OnSearch(h EventHandler, scope ...any) HTMLSamp {
  28276. e.setEventHandler("search", h, scope...)
  28277. return e
  28278. }
  28279. func (e *htmlSamp) OnSelect(h EventHandler, scope ...any) HTMLSamp {
  28280. e.setEventHandler("select", h, scope...)
  28281. return e
  28282. }
  28283. func (e *htmlSamp) OnSubmit(h EventHandler, scope ...any) HTMLSamp {
  28284. e.setEventHandler("submit", h, scope...)
  28285. return e
  28286. }
  28287. func (e *htmlSamp) OnWheel(h EventHandler, scope ...any) HTMLSamp {
  28288. e.setEventHandler("wheel", h, scope...)
  28289. return e
  28290. }
  28291. // HTMLScript is the interface that describes a "script" HTML element.
  28292. type HTMLScript interface {
  28293. UI
  28294. // Body set the content of the element.
  28295. Body(elems ...UI) HTMLScript
  28296. // Text sets the content of the element with a text node containing the stringified given value.
  28297. Text(v any) HTMLScript
  28298. // AccessKey specifies a shortcut key to activate/focus an element.
  28299. AccessKey(v string) HTMLScript
  28300. // Aria stores accessible rich internet applications (ARIA) data.
  28301. Aria(k string, v any) HTMLScript
  28302. // Async specifies that the script is executed asynchronously (only for external scripts).
  28303. Async(v bool) HTMLScript
  28304. // Attr sets the named attribute with the given value.
  28305. Attr(n string, v any) HTMLScript
  28306. // Charset specifies the character encoding.
  28307. Charset(v string) HTMLScript
  28308. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  28309. Class(v ...string) HTMLScript
  28310. // ContentEditable specifies whether the content of an element is editable or not.
  28311. ContentEditable(v bool) HTMLScript
  28312. // CrossOrigin sets the mode of the request to an HTTP CORS Request.
  28313. CrossOrigin(v string) HTMLScript
  28314. // DataSet stores custom data private to the page or application.
  28315. DataSet(k string, v any) HTMLScript
  28316. // Defer specifies that the script is executed when the page has finished parsing (only for external scripts).
  28317. Defer(v bool) HTMLScript
  28318. // Dir specifies the text direction for the content in an element.
  28319. Dir(v string) HTMLScript
  28320. // Draggable specifies whether an element is draggable or not.
  28321. Draggable(v bool) HTMLScript
  28322. // Hidden specifies that an element is not yet, or is no longer relevant.
  28323. Hidden(v bool) HTMLScript
  28324. // ID specifies a unique id for an element.
  28325. ID(v string) HTMLScript
  28326. // Lang specifies the language of the element's content.
  28327. Lang(v string) HTMLScript
  28328. // Role specifies to parsing software the exact function of an element (and its children).
  28329. Role(v string) HTMLScript
  28330. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  28331. Spellcheck(v bool) HTMLScript
  28332. // Src specifies the URL of the media file.
  28333. Src(v string) HTMLScript
  28334. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  28335. Style(k, v string) HTMLScript
  28336. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  28337. Styles(s map[string]string) HTMLScript
  28338. // TabIndex specifies the tabbing order of an element.
  28339. TabIndex(v int) HTMLScript
  28340. // Title specifies extra information about an element.
  28341. Title(v string) HTMLScript
  28342. // Type specifies the type of element.
  28343. Type(v string) HTMLScript
  28344. // On registers the given event handler to the specified event.
  28345. On(event string, h EventHandler, scope ...any) HTMLScript
  28346. // OnLoad calls the given handler after the element is finished loading.
  28347. OnLoad(h EventHandler, scope ...any) HTMLScript
  28348. }
  28349. // Script returns an HTML element that defines a client-side script.
  28350. func Script() HTMLScript {
  28351. e := &htmlScript{
  28352. htmlElement: htmlElement{
  28353. tag: "script",
  28354. isSelfClosing: false,
  28355. },
  28356. }
  28357. return e
  28358. }
  28359. type htmlScript struct {
  28360. htmlElement
  28361. }
  28362. func (e *htmlScript) Body(v ...UI) HTMLScript {
  28363. e.setChildren(v...)
  28364. return e
  28365. }
  28366. func (e *htmlScript) Text(v any) HTMLScript {
  28367. return e.Body(Text(v))
  28368. }
  28369. func (e *htmlScript) AccessKey(v string) HTMLScript {
  28370. e.setAttr("accesskey", v)
  28371. return e
  28372. }
  28373. func (e *htmlScript) Aria(k string, v any) HTMLScript {
  28374. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  28375. return e
  28376. }
  28377. func (e *htmlScript) Async(v bool) HTMLScript {
  28378. e.setAttr("async", v)
  28379. return e
  28380. }
  28381. func (e *htmlScript) Attr(n string, v any) HTMLScript {
  28382. e.setAttr(n, v)
  28383. return e
  28384. }
  28385. func (e *htmlScript) Charset(v string) HTMLScript {
  28386. e.setAttr("charset", v)
  28387. return e
  28388. }
  28389. func (e *htmlScript) Class(v ...string) HTMLScript {
  28390. e.setAttr("class", strings.Join(v, " "))
  28391. return e
  28392. }
  28393. func (e *htmlScript) ContentEditable(v bool) HTMLScript {
  28394. e.setAttr("contenteditable", v)
  28395. return e
  28396. }
  28397. func (e *htmlScript) CrossOrigin(v string) HTMLScript {
  28398. e.setAttr("crossorigin", v)
  28399. return e
  28400. }
  28401. func (e *htmlScript) DataSet(k string, v any) HTMLScript {
  28402. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  28403. return e
  28404. }
  28405. func (e *htmlScript) Defer(v bool) HTMLScript {
  28406. e.setAttr("defer", v)
  28407. return e
  28408. }
  28409. func (e *htmlScript) Dir(v string) HTMLScript {
  28410. e.setAttr("dir", v)
  28411. return e
  28412. }
  28413. func (e *htmlScript) Draggable(v bool) HTMLScript {
  28414. e.setAttr("draggable", v)
  28415. return e
  28416. }
  28417. func (e *htmlScript) Hidden(v bool) HTMLScript {
  28418. e.setAttr("hidden", v)
  28419. return e
  28420. }
  28421. func (e *htmlScript) ID(v string) HTMLScript {
  28422. e.setAttr("id", v)
  28423. return e
  28424. }
  28425. func (e *htmlScript) Lang(v string) HTMLScript {
  28426. e.setAttr("lang", v)
  28427. return e
  28428. }
  28429. func (e *htmlScript) Role(v string) HTMLScript {
  28430. e.setAttr("role", v)
  28431. return e
  28432. }
  28433. func (e *htmlScript) Spellcheck(v bool) HTMLScript {
  28434. s := "false"
  28435. if v {
  28436. s = "true"
  28437. }
  28438. e.setAttr("spellcheck", s)
  28439. return e
  28440. }
  28441. func (e *htmlScript) Src(v string) HTMLScript {
  28442. e.setAttr("src", v)
  28443. return e
  28444. }
  28445. func (e *htmlScript) Style(k, v string) HTMLScript {
  28446. e.setAttr("style", k+":"+v)
  28447. return e
  28448. }
  28449. func (e *htmlScript) Styles(s map[string]string) HTMLScript {
  28450. for k, v := range s {
  28451. e.Style(k, v)
  28452. }
  28453. return e
  28454. }
  28455. func (e *htmlScript) TabIndex(v int) HTMLScript {
  28456. e.setAttr("tabindex", v)
  28457. return e
  28458. }
  28459. func (e *htmlScript) Title(v string) HTMLScript {
  28460. e.setAttr("title", v)
  28461. return e
  28462. }
  28463. func (e *htmlScript) Type(v string) HTMLScript {
  28464. e.setAttr("type", v)
  28465. return e
  28466. }
  28467. func (e *htmlScript) On(event string, h EventHandler, scope ...any) HTMLScript {
  28468. e.setEventHandler(event, h, scope...)
  28469. return e
  28470. }
  28471. func (e *htmlScript) OnLoad(h EventHandler, scope ...any) HTMLScript {
  28472. e.setEventHandler("load", h, scope...)
  28473. return e
  28474. }
  28475. // HTMLSection is the interface that describes a "section" HTML element.
  28476. type HTMLSection interface {
  28477. UI
  28478. // Body set the content of the element.
  28479. Body(elems ...UI) HTMLSection
  28480. // Text sets the content of the element with a text node containing the stringified given value.
  28481. Text(v any) HTMLSection
  28482. // AccessKey specifies a shortcut key to activate/focus an element.
  28483. AccessKey(v string) HTMLSection
  28484. // Aria stores accessible rich internet applications (ARIA) data.
  28485. Aria(k string, v any) HTMLSection
  28486. // Attr sets the named attribute with the given value.
  28487. Attr(n string, v any) HTMLSection
  28488. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  28489. Class(v ...string) HTMLSection
  28490. // ContentEditable specifies whether the content of an element is editable or not.
  28491. ContentEditable(v bool) HTMLSection
  28492. // DataSet stores custom data private to the page or application.
  28493. DataSet(k string, v any) HTMLSection
  28494. // Dir specifies the text direction for the content in an element.
  28495. Dir(v string) HTMLSection
  28496. // Draggable specifies whether an element is draggable or not.
  28497. Draggable(v bool) HTMLSection
  28498. // Hidden specifies that an element is not yet, or is no longer relevant.
  28499. Hidden(v bool) HTMLSection
  28500. // ID specifies a unique id for an element.
  28501. ID(v string) HTMLSection
  28502. // Lang specifies the language of the element's content.
  28503. Lang(v string) HTMLSection
  28504. // Role specifies to parsing software the exact function of an element (and its children).
  28505. Role(v string) HTMLSection
  28506. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  28507. Spellcheck(v bool) HTMLSection
  28508. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  28509. Style(k, v string) HTMLSection
  28510. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  28511. Styles(s map[string]string) HTMLSection
  28512. // TabIndex specifies the tabbing order of an element.
  28513. TabIndex(v int) HTMLSection
  28514. // Title specifies extra information about an element.
  28515. Title(v string) HTMLSection
  28516. // On registers the given event handler to the specified event.
  28517. On(event string, h EventHandler, scope ...any) HTMLSection
  28518. // OnBlur calls the given handler when the element loses focus.
  28519. OnBlur(h EventHandler, scope ...any) HTMLSection
  28520. // OnChange calls the given handler when the value of the element is changed.
  28521. OnChange(h EventHandler, scope ...any) HTMLSection
  28522. // OnClick calls the given handler when there is a mouse click on the element.
  28523. OnClick(h EventHandler, scope ...any) HTMLSection
  28524. // OnContextMenu calls the given handler when a context menu is triggered.
  28525. OnContextMenu(h EventHandler, scope ...any) HTMLSection
  28526. // OnCopy calls the given handler when the user copies the content of an element.
  28527. OnCopy(h EventHandler, scope ...any) HTMLSection
  28528. // OnCut calls the given handler when the user cuts the content of an element.
  28529. OnCut(h EventHandler, scope ...any) HTMLSection
  28530. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  28531. OnDblClick(h EventHandler, scope ...any) HTMLSection
  28532. // OnDrag calls the given handler when an element is dragged.
  28533. OnDrag(h EventHandler, scope ...any) HTMLSection
  28534. // OnDragEnd calls the given handler at the end of a drag operation.
  28535. OnDragEnd(h EventHandler, scope ...any) HTMLSection
  28536. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  28537. OnDragEnter(h EventHandler, scope ...any) HTMLSection
  28538. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  28539. OnDragLeave(h EventHandler, scope ...any) HTMLSection
  28540. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  28541. OnDragOver(h EventHandler, scope ...any) HTMLSection
  28542. // OnDragStart calls the given handler at the start of a drag operation.
  28543. OnDragStart(h EventHandler, scope ...any) HTMLSection
  28544. // OnDrop calls the given handler when dragged element is being dropped.
  28545. OnDrop(h EventHandler, scope ...any) HTMLSection
  28546. // OnFocus calls the given handler when the element gets focus.
  28547. OnFocus(h EventHandler, scope ...any) HTMLSection
  28548. // OnInput calls the given handler when an element gets user input.
  28549. OnInput(h EventHandler, scope ...any) HTMLSection
  28550. // OnInvalid calls the given handler when an element is invalid.
  28551. OnInvalid(h EventHandler, scope ...any) HTMLSection
  28552. // OnKeyDown calls the given handler when a user is pressing a key.
  28553. OnKeyDown(h EventHandler, scope ...any) HTMLSection
  28554. // OnKeyPress calls the given handler when a user presses a key.
  28555. OnKeyPress(h EventHandler, scope ...any) HTMLSection
  28556. // OnKeyUp calls the given handler when a user releases a key.
  28557. OnKeyUp(h EventHandler, scope ...any) HTMLSection
  28558. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  28559. OnMouseDown(h EventHandler, scope ...any) HTMLSection
  28560. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  28561. OnMouseMove(h EventHandler, scope ...any) HTMLSection
  28562. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  28563. OnMouseOut(h EventHandler, scope ...any) HTMLSection
  28564. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  28565. OnMouseOver(h EventHandler, scope ...any) HTMLSection
  28566. // OnMouseUp calls the given handler when a mouse button is released over an element.
  28567. OnMouseUp(h EventHandler, scope ...any) HTMLSection
  28568. // OnPaste calls the given handler when the user pastes some content in an element.
  28569. OnPaste(h EventHandler, scope ...any) HTMLSection
  28570. // OnReset calls the given handler when the Reset button in a form is clicked.
  28571. OnReset(h EventHandler, scope ...any) HTMLSection
  28572. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  28573. OnScroll(h EventHandler, scope ...any) HTMLSection
  28574. // OnSearch calls the given handler when the user writes something in a search field.
  28575. OnSearch(h EventHandler, scope ...any) HTMLSection
  28576. // OnSelect calls the given handler after some text has been selected in an element.
  28577. OnSelect(h EventHandler, scope ...any) HTMLSection
  28578. // OnSubmit calls the given handler when a form is submitted.
  28579. OnSubmit(h EventHandler, scope ...any) HTMLSection
  28580. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  28581. OnWheel(h EventHandler, scope ...any) HTMLSection
  28582. }
  28583. // Section returns an HTML element that defines a section in a document.
  28584. func Section() HTMLSection {
  28585. e := &htmlSection{
  28586. htmlElement: htmlElement{
  28587. tag: "section",
  28588. isSelfClosing: false,
  28589. },
  28590. }
  28591. return e
  28592. }
  28593. type htmlSection struct {
  28594. htmlElement
  28595. }
  28596. func (e *htmlSection) Body(v ...UI) HTMLSection {
  28597. e.setChildren(v...)
  28598. return e
  28599. }
  28600. func (e *htmlSection) Text(v any) HTMLSection {
  28601. return e.Body(Text(v))
  28602. }
  28603. func (e *htmlSection) AccessKey(v string) HTMLSection {
  28604. e.setAttr("accesskey", v)
  28605. return e
  28606. }
  28607. func (e *htmlSection) Aria(k string, v any) HTMLSection {
  28608. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  28609. return e
  28610. }
  28611. func (e *htmlSection) Attr(n string, v any) HTMLSection {
  28612. e.setAttr(n, v)
  28613. return e
  28614. }
  28615. func (e *htmlSection) Class(v ...string) HTMLSection {
  28616. e.setAttr("class", strings.Join(v, " "))
  28617. return e
  28618. }
  28619. func (e *htmlSection) ContentEditable(v bool) HTMLSection {
  28620. e.setAttr("contenteditable", v)
  28621. return e
  28622. }
  28623. func (e *htmlSection) DataSet(k string, v any) HTMLSection {
  28624. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  28625. return e
  28626. }
  28627. func (e *htmlSection) Dir(v string) HTMLSection {
  28628. e.setAttr("dir", v)
  28629. return e
  28630. }
  28631. func (e *htmlSection) Draggable(v bool) HTMLSection {
  28632. e.setAttr("draggable", v)
  28633. return e
  28634. }
  28635. func (e *htmlSection) Hidden(v bool) HTMLSection {
  28636. e.setAttr("hidden", v)
  28637. return e
  28638. }
  28639. func (e *htmlSection) ID(v string) HTMLSection {
  28640. e.setAttr("id", v)
  28641. return e
  28642. }
  28643. func (e *htmlSection) Lang(v string) HTMLSection {
  28644. e.setAttr("lang", v)
  28645. return e
  28646. }
  28647. func (e *htmlSection) Role(v string) HTMLSection {
  28648. e.setAttr("role", v)
  28649. return e
  28650. }
  28651. func (e *htmlSection) Spellcheck(v bool) HTMLSection {
  28652. s := "false"
  28653. if v {
  28654. s = "true"
  28655. }
  28656. e.setAttr("spellcheck", s)
  28657. return e
  28658. }
  28659. func (e *htmlSection) Style(k, v string) HTMLSection {
  28660. e.setAttr("style", k+":"+v)
  28661. return e
  28662. }
  28663. func (e *htmlSection) Styles(s map[string]string) HTMLSection {
  28664. for k, v := range s {
  28665. e.Style(k, v)
  28666. }
  28667. return e
  28668. }
  28669. func (e *htmlSection) TabIndex(v int) HTMLSection {
  28670. e.setAttr("tabindex", v)
  28671. return e
  28672. }
  28673. func (e *htmlSection) Title(v string) HTMLSection {
  28674. e.setAttr("title", v)
  28675. return e
  28676. }
  28677. func (e *htmlSection) On(event string, h EventHandler, scope ...any) HTMLSection {
  28678. e.setEventHandler(event, h, scope...)
  28679. return e
  28680. }
  28681. func (e *htmlSection) OnBlur(h EventHandler, scope ...any) HTMLSection {
  28682. e.setEventHandler("blur", h, scope...)
  28683. return e
  28684. }
  28685. func (e *htmlSection) OnChange(h EventHandler, scope ...any) HTMLSection {
  28686. e.setEventHandler("change", h, scope...)
  28687. return e
  28688. }
  28689. func (e *htmlSection) OnClick(h EventHandler, scope ...any) HTMLSection {
  28690. e.setEventHandler("click", h, scope...)
  28691. return e
  28692. }
  28693. func (e *htmlSection) OnContextMenu(h EventHandler, scope ...any) HTMLSection {
  28694. e.setEventHandler("contextmenu", h, scope...)
  28695. return e
  28696. }
  28697. func (e *htmlSection) OnCopy(h EventHandler, scope ...any) HTMLSection {
  28698. e.setEventHandler("copy", h, scope...)
  28699. return e
  28700. }
  28701. func (e *htmlSection) OnCut(h EventHandler, scope ...any) HTMLSection {
  28702. e.setEventHandler("cut", h, scope...)
  28703. return e
  28704. }
  28705. func (e *htmlSection) OnDblClick(h EventHandler, scope ...any) HTMLSection {
  28706. e.setEventHandler("dblclick", h, scope...)
  28707. return e
  28708. }
  28709. func (e *htmlSection) OnDrag(h EventHandler, scope ...any) HTMLSection {
  28710. e.setEventHandler("drag", h, scope...)
  28711. return e
  28712. }
  28713. func (e *htmlSection) OnDragEnd(h EventHandler, scope ...any) HTMLSection {
  28714. e.setEventHandler("dragend", h, scope...)
  28715. return e
  28716. }
  28717. func (e *htmlSection) OnDragEnter(h EventHandler, scope ...any) HTMLSection {
  28718. e.setEventHandler("dragenter", h, scope...)
  28719. return e
  28720. }
  28721. func (e *htmlSection) OnDragLeave(h EventHandler, scope ...any) HTMLSection {
  28722. e.setEventHandler("dragleave", h, scope...)
  28723. return e
  28724. }
  28725. func (e *htmlSection) OnDragOver(h EventHandler, scope ...any) HTMLSection {
  28726. e.setEventHandler("dragover", h, scope...)
  28727. return e
  28728. }
  28729. func (e *htmlSection) OnDragStart(h EventHandler, scope ...any) HTMLSection {
  28730. e.setEventHandler("dragstart", h, scope...)
  28731. return e
  28732. }
  28733. func (e *htmlSection) OnDrop(h EventHandler, scope ...any) HTMLSection {
  28734. e.setEventHandler("drop", h, scope...)
  28735. return e
  28736. }
  28737. func (e *htmlSection) OnFocus(h EventHandler, scope ...any) HTMLSection {
  28738. e.setEventHandler("focus", h, scope...)
  28739. return e
  28740. }
  28741. func (e *htmlSection) OnInput(h EventHandler, scope ...any) HTMLSection {
  28742. e.setEventHandler("input", h, scope...)
  28743. return e
  28744. }
  28745. func (e *htmlSection) OnInvalid(h EventHandler, scope ...any) HTMLSection {
  28746. e.setEventHandler("invalid", h, scope...)
  28747. return e
  28748. }
  28749. func (e *htmlSection) OnKeyDown(h EventHandler, scope ...any) HTMLSection {
  28750. e.setEventHandler("keydown", h, scope...)
  28751. return e
  28752. }
  28753. func (e *htmlSection) OnKeyPress(h EventHandler, scope ...any) HTMLSection {
  28754. e.setEventHandler("keypress", h, scope...)
  28755. return e
  28756. }
  28757. func (e *htmlSection) OnKeyUp(h EventHandler, scope ...any) HTMLSection {
  28758. e.setEventHandler("keyup", h, scope...)
  28759. return e
  28760. }
  28761. func (e *htmlSection) OnMouseDown(h EventHandler, scope ...any) HTMLSection {
  28762. e.setEventHandler("mousedown", h, scope...)
  28763. return e
  28764. }
  28765. func (e *htmlSection) OnMouseMove(h EventHandler, scope ...any) HTMLSection {
  28766. e.setEventHandler("mousemove", h, scope...)
  28767. return e
  28768. }
  28769. func (e *htmlSection) OnMouseOut(h EventHandler, scope ...any) HTMLSection {
  28770. e.setEventHandler("mouseout", h, scope...)
  28771. return e
  28772. }
  28773. func (e *htmlSection) OnMouseOver(h EventHandler, scope ...any) HTMLSection {
  28774. e.setEventHandler("mouseover", h, scope...)
  28775. return e
  28776. }
  28777. func (e *htmlSection) OnMouseUp(h EventHandler, scope ...any) HTMLSection {
  28778. e.setEventHandler("mouseup", h, scope...)
  28779. return e
  28780. }
  28781. func (e *htmlSection) OnPaste(h EventHandler, scope ...any) HTMLSection {
  28782. e.setEventHandler("paste", h, scope...)
  28783. return e
  28784. }
  28785. func (e *htmlSection) OnReset(h EventHandler, scope ...any) HTMLSection {
  28786. e.setEventHandler("reset", h, scope...)
  28787. return e
  28788. }
  28789. func (e *htmlSection) OnScroll(h EventHandler, scope ...any) HTMLSection {
  28790. e.setEventHandler("scroll", h, scope...)
  28791. return e
  28792. }
  28793. func (e *htmlSection) OnSearch(h EventHandler, scope ...any) HTMLSection {
  28794. e.setEventHandler("search", h, scope...)
  28795. return e
  28796. }
  28797. func (e *htmlSection) OnSelect(h EventHandler, scope ...any) HTMLSection {
  28798. e.setEventHandler("select", h, scope...)
  28799. return e
  28800. }
  28801. func (e *htmlSection) OnSubmit(h EventHandler, scope ...any) HTMLSection {
  28802. e.setEventHandler("submit", h, scope...)
  28803. return e
  28804. }
  28805. func (e *htmlSection) OnWheel(h EventHandler, scope ...any) HTMLSection {
  28806. e.setEventHandler("wheel", h, scope...)
  28807. return e
  28808. }
  28809. // HTMLSelect is the interface that describes a "select" HTML element.
  28810. type HTMLSelect interface {
  28811. UI
  28812. // Body set the content of the element.
  28813. Body(elems ...UI) HTMLSelect
  28814. // Text sets the content of the element with a text node containing the stringified given value.
  28815. Text(v any) HTMLSelect
  28816. // AccessKey specifies a shortcut key to activate/focus an element.
  28817. AccessKey(v string) HTMLSelect
  28818. // Aria stores accessible rich internet applications (ARIA) data.
  28819. Aria(k string, v any) HTMLSelect
  28820. // Attr sets the named attribute with the given value.
  28821. Attr(n string, v any) HTMLSelect
  28822. // AutoFocus specifies that the element should automatically get focus when the page loads.
  28823. AutoFocus(v bool) HTMLSelect
  28824. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  28825. Class(v ...string) HTMLSelect
  28826. // ContentEditable specifies whether the content of an element is editable or not.
  28827. ContentEditable(v bool) HTMLSelect
  28828. // DataSet stores custom data private to the page or application.
  28829. DataSet(k string, v any) HTMLSelect
  28830. // Dir specifies the text direction for the content in an element.
  28831. Dir(v string) HTMLSelect
  28832. // Disabled specifies that the specified element/group of elements should be disabled.
  28833. Disabled(v bool) HTMLSelect
  28834. // Draggable specifies whether an element is draggable or not.
  28835. Draggable(v bool) HTMLSelect
  28836. // Form specifies the name of the form the element belongs to.
  28837. Form(v string) HTMLSelect
  28838. // Hidden specifies that an element is not yet, or is no longer relevant.
  28839. Hidden(v bool) HTMLSelect
  28840. // ID specifies a unique id for an element.
  28841. ID(v string) HTMLSelect
  28842. // Lang specifies the language of the element's content.
  28843. Lang(v string) HTMLSelect
  28844. // Multiple specifies that a user can enter more than one value.
  28845. Multiple(v bool) HTMLSelect
  28846. // Name specifies the name of the element.
  28847. Name(v string) HTMLSelect
  28848. // Required specifies that the element must be filled out before submitting the form.
  28849. Required(v bool) HTMLSelect
  28850. // Role specifies to parsing software the exact function of an element (and its children).
  28851. Role(v string) HTMLSelect
  28852. // Size specifies the width.
  28853. Size(v int) HTMLSelect
  28854. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  28855. Spellcheck(v bool) HTMLSelect
  28856. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  28857. Style(k, v string) HTMLSelect
  28858. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  28859. Styles(s map[string]string) HTMLSelect
  28860. // TabIndex specifies the tabbing order of an element.
  28861. TabIndex(v int) HTMLSelect
  28862. // Title specifies extra information about an element.
  28863. Title(v string) HTMLSelect
  28864. // On registers the given event handler to the specified event.
  28865. On(event string, h EventHandler, scope ...any) HTMLSelect
  28866. // OnBlur calls the given handler when the element loses focus.
  28867. OnBlur(h EventHandler, scope ...any) HTMLSelect
  28868. // OnChange calls the given handler when the value of the element is changed.
  28869. OnChange(h EventHandler, scope ...any) HTMLSelect
  28870. // OnClick calls the given handler when there is a mouse click on the element.
  28871. OnClick(h EventHandler, scope ...any) HTMLSelect
  28872. // OnContextMenu calls the given handler when a context menu is triggered.
  28873. OnContextMenu(h EventHandler, scope ...any) HTMLSelect
  28874. // OnCopy calls the given handler when the user copies the content of an element.
  28875. OnCopy(h EventHandler, scope ...any) HTMLSelect
  28876. // OnCut calls the given handler when the user cuts the content of an element.
  28877. OnCut(h EventHandler, scope ...any) HTMLSelect
  28878. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  28879. OnDblClick(h EventHandler, scope ...any) HTMLSelect
  28880. // OnDrag calls the given handler when an element is dragged.
  28881. OnDrag(h EventHandler, scope ...any) HTMLSelect
  28882. // OnDragEnd calls the given handler at the end of a drag operation.
  28883. OnDragEnd(h EventHandler, scope ...any) HTMLSelect
  28884. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  28885. OnDragEnter(h EventHandler, scope ...any) HTMLSelect
  28886. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  28887. OnDragLeave(h EventHandler, scope ...any) HTMLSelect
  28888. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  28889. OnDragOver(h EventHandler, scope ...any) HTMLSelect
  28890. // OnDragStart calls the given handler at the start of a drag operation.
  28891. OnDragStart(h EventHandler, scope ...any) HTMLSelect
  28892. // OnDrop calls the given handler when dragged element is being dropped.
  28893. OnDrop(h EventHandler, scope ...any) HTMLSelect
  28894. // OnFocus calls the given handler when the element gets focus.
  28895. OnFocus(h EventHandler, scope ...any) HTMLSelect
  28896. // OnInput calls the given handler when an element gets user input.
  28897. OnInput(h EventHandler, scope ...any) HTMLSelect
  28898. // OnInvalid calls the given handler when an element is invalid.
  28899. OnInvalid(h EventHandler, scope ...any) HTMLSelect
  28900. // OnKeyDown calls the given handler when a user is pressing a key.
  28901. OnKeyDown(h EventHandler, scope ...any) HTMLSelect
  28902. // OnKeyPress calls the given handler when a user presses a key.
  28903. OnKeyPress(h EventHandler, scope ...any) HTMLSelect
  28904. // OnKeyUp calls the given handler when a user releases a key.
  28905. OnKeyUp(h EventHandler, scope ...any) HTMLSelect
  28906. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  28907. OnMouseDown(h EventHandler, scope ...any) HTMLSelect
  28908. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  28909. OnMouseMove(h EventHandler, scope ...any) HTMLSelect
  28910. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  28911. OnMouseOut(h EventHandler, scope ...any) HTMLSelect
  28912. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  28913. OnMouseOver(h EventHandler, scope ...any) HTMLSelect
  28914. // OnMouseUp calls the given handler when a mouse button is released over an element.
  28915. OnMouseUp(h EventHandler, scope ...any) HTMLSelect
  28916. // OnPaste calls the given handler when the user pastes some content in an element.
  28917. OnPaste(h EventHandler, scope ...any) HTMLSelect
  28918. // OnReset calls the given handler when the Reset button in a form is clicked.
  28919. OnReset(h EventHandler, scope ...any) HTMLSelect
  28920. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  28921. OnScroll(h EventHandler, scope ...any) HTMLSelect
  28922. // OnSearch calls the given handler when the user writes something in a search field.
  28923. OnSearch(h EventHandler, scope ...any) HTMLSelect
  28924. // OnSelect calls the given handler after some text has been selected in an element.
  28925. OnSelect(h EventHandler, scope ...any) HTMLSelect
  28926. // OnSubmit calls the given handler when a form is submitted.
  28927. OnSubmit(h EventHandler, scope ...any) HTMLSelect
  28928. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  28929. OnWheel(h EventHandler, scope ...any) HTMLSelect
  28930. }
  28931. // Select returns an HTML element that defines a drop-down list.
  28932. func Select() HTMLSelect {
  28933. e := &htmlSelect{
  28934. htmlElement: htmlElement{
  28935. tag: "select",
  28936. isSelfClosing: false,
  28937. },
  28938. }
  28939. return e
  28940. }
  28941. type htmlSelect struct {
  28942. htmlElement
  28943. }
  28944. func (e *htmlSelect) Body(v ...UI) HTMLSelect {
  28945. e.setChildren(v...)
  28946. return e
  28947. }
  28948. func (e *htmlSelect) Text(v any) HTMLSelect {
  28949. return e.Body(Text(v))
  28950. }
  28951. func (e *htmlSelect) AccessKey(v string) HTMLSelect {
  28952. e.setAttr("accesskey", v)
  28953. return e
  28954. }
  28955. func (e *htmlSelect) Aria(k string, v any) HTMLSelect {
  28956. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  28957. return e
  28958. }
  28959. func (e *htmlSelect) Attr(n string, v any) HTMLSelect {
  28960. e.setAttr(n, v)
  28961. return e
  28962. }
  28963. func (e *htmlSelect) AutoFocus(v bool) HTMLSelect {
  28964. e.setAttr("autofocus", v)
  28965. return e
  28966. }
  28967. func (e *htmlSelect) Class(v ...string) HTMLSelect {
  28968. e.setAttr("class", strings.Join(v, " "))
  28969. return e
  28970. }
  28971. func (e *htmlSelect) ContentEditable(v bool) HTMLSelect {
  28972. e.setAttr("contenteditable", v)
  28973. return e
  28974. }
  28975. func (e *htmlSelect) DataSet(k string, v any) HTMLSelect {
  28976. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  28977. return e
  28978. }
  28979. func (e *htmlSelect) Dir(v string) HTMLSelect {
  28980. e.setAttr("dir", v)
  28981. return e
  28982. }
  28983. func (e *htmlSelect) Disabled(v bool) HTMLSelect {
  28984. e.setAttr("disabled", v)
  28985. return e
  28986. }
  28987. func (e *htmlSelect) Draggable(v bool) HTMLSelect {
  28988. e.setAttr("draggable", v)
  28989. return e
  28990. }
  28991. func (e *htmlSelect) Form(v string) HTMLSelect {
  28992. e.setAttr("form", v)
  28993. return e
  28994. }
  28995. func (e *htmlSelect) Hidden(v bool) HTMLSelect {
  28996. e.setAttr("hidden", v)
  28997. return e
  28998. }
  28999. func (e *htmlSelect) ID(v string) HTMLSelect {
  29000. e.setAttr("id", v)
  29001. return e
  29002. }
  29003. func (e *htmlSelect) Lang(v string) HTMLSelect {
  29004. e.setAttr("lang", v)
  29005. return e
  29006. }
  29007. func (e *htmlSelect) Multiple(v bool) HTMLSelect {
  29008. e.setAttr("multiple", v)
  29009. return e
  29010. }
  29011. func (e *htmlSelect) Name(v string) HTMLSelect {
  29012. e.setAttr("name", v)
  29013. return e
  29014. }
  29015. func (e *htmlSelect) Required(v bool) HTMLSelect {
  29016. e.setAttr("required", v)
  29017. return e
  29018. }
  29019. func (e *htmlSelect) Role(v string) HTMLSelect {
  29020. e.setAttr("role", v)
  29021. return e
  29022. }
  29023. func (e *htmlSelect) Size(v int) HTMLSelect {
  29024. e.setAttr("size", v)
  29025. return e
  29026. }
  29027. func (e *htmlSelect) Spellcheck(v bool) HTMLSelect {
  29028. s := "false"
  29029. if v {
  29030. s = "true"
  29031. }
  29032. e.setAttr("spellcheck", s)
  29033. return e
  29034. }
  29035. func (e *htmlSelect) Style(k, v string) HTMLSelect {
  29036. e.setAttr("style", k+":"+v)
  29037. return e
  29038. }
  29039. func (e *htmlSelect) Styles(s map[string]string) HTMLSelect {
  29040. for k, v := range s {
  29041. e.Style(k, v)
  29042. }
  29043. return e
  29044. }
  29045. func (e *htmlSelect) TabIndex(v int) HTMLSelect {
  29046. e.setAttr("tabindex", v)
  29047. return e
  29048. }
  29049. func (e *htmlSelect) Title(v string) HTMLSelect {
  29050. e.setAttr("title", v)
  29051. return e
  29052. }
  29053. func (e *htmlSelect) On(event string, h EventHandler, scope ...any) HTMLSelect {
  29054. e.setEventHandler(event, h, scope...)
  29055. return e
  29056. }
  29057. func (e *htmlSelect) OnBlur(h EventHandler, scope ...any) HTMLSelect {
  29058. e.setEventHandler("blur", h, scope...)
  29059. return e
  29060. }
  29061. func (e *htmlSelect) OnChange(h EventHandler, scope ...any) HTMLSelect {
  29062. e.setEventHandler("change", h, scope...)
  29063. return e
  29064. }
  29065. func (e *htmlSelect) OnClick(h EventHandler, scope ...any) HTMLSelect {
  29066. e.setEventHandler("click", h, scope...)
  29067. return e
  29068. }
  29069. func (e *htmlSelect) OnContextMenu(h EventHandler, scope ...any) HTMLSelect {
  29070. e.setEventHandler("contextmenu", h, scope...)
  29071. return e
  29072. }
  29073. func (e *htmlSelect) OnCopy(h EventHandler, scope ...any) HTMLSelect {
  29074. e.setEventHandler("copy", h, scope...)
  29075. return e
  29076. }
  29077. func (e *htmlSelect) OnCut(h EventHandler, scope ...any) HTMLSelect {
  29078. e.setEventHandler("cut", h, scope...)
  29079. return e
  29080. }
  29081. func (e *htmlSelect) OnDblClick(h EventHandler, scope ...any) HTMLSelect {
  29082. e.setEventHandler("dblclick", h, scope...)
  29083. return e
  29084. }
  29085. func (e *htmlSelect) OnDrag(h EventHandler, scope ...any) HTMLSelect {
  29086. e.setEventHandler("drag", h, scope...)
  29087. return e
  29088. }
  29089. func (e *htmlSelect) OnDragEnd(h EventHandler, scope ...any) HTMLSelect {
  29090. e.setEventHandler("dragend", h, scope...)
  29091. return e
  29092. }
  29093. func (e *htmlSelect) OnDragEnter(h EventHandler, scope ...any) HTMLSelect {
  29094. e.setEventHandler("dragenter", h, scope...)
  29095. return e
  29096. }
  29097. func (e *htmlSelect) OnDragLeave(h EventHandler, scope ...any) HTMLSelect {
  29098. e.setEventHandler("dragleave", h, scope...)
  29099. return e
  29100. }
  29101. func (e *htmlSelect) OnDragOver(h EventHandler, scope ...any) HTMLSelect {
  29102. e.setEventHandler("dragover", h, scope...)
  29103. return e
  29104. }
  29105. func (e *htmlSelect) OnDragStart(h EventHandler, scope ...any) HTMLSelect {
  29106. e.setEventHandler("dragstart", h, scope...)
  29107. return e
  29108. }
  29109. func (e *htmlSelect) OnDrop(h EventHandler, scope ...any) HTMLSelect {
  29110. e.setEventHandler("drop", h, scope...)
  29111. return e
  29112. }
  29113. func (e *htmlSelect) OnFocus(h EventHandler, scope ...any) HTMLSelect {
  29114. e.setEventHandler("focus", h, scope...)
  29115. return e
  29116. }
  29117. func (e *htmlSelect) OnInput(h EventHandler, scope ...any) HTMLSelect {
  29118. e.setEventHandler("input", h, scope...)
  29119. return e
  29120. }
  29121. func (e *htmlSelect) OnInvalid(h EventHandler, scope ...any) HTMLSelect {
  29122. e.setEventHandler("invalid", h, scope...)
  29123. return e
  29124. }
  29125. func (e *htmlSelect) OnKeyDown(h EventHandler, scope ...any) HTMLSelect {
  29126. e.setEventHandler("keydown", h, scope...)
  29127. return e
  29128. }
  29129. func (e *htmlSelect) OnKeyPress(h EventHandler, scope ...any) HTMLSelect {
  29130. e.setEventHandler("keypress", h, scope...)
  29131. return e
  29132. }
  29133. func (e *htmlSelect) OnKeyUp(h EventHandler, scope ...any) HTMLSelect {
  29134. e.setEventHandler("keyup", h, scope...)
  29135. return e
  29136. }
  29137. func (e *htmlSelect) OnMouseDown(h EventHandler, scope ...any) HTMLSelect {
  29138. e.setEventHandler("mousedown", h, scope...)
  29139. return e
  29140. }
  29141. func (e *htmlSelect) OnMouseMove(h EventHandler, scope ...any) HTMLSelect {
  29142. e.setEventHandler("mousemove", h, scope...)
  29143. return e
  29144. }
  29145. func (e *htmlSelect) OnMouseOut(h EventHandler, scope ...any) HTMLSelect {
  29146. e.setEventHandler("mouseout", h, scope...)
  29147. return e
  29148. }
  29149. func (e *htmlSelect) OnMouseOver(h EventHandler, scope ...any) HTMLSelect {
  29150. e.setEventHandler("mouseover", h, scope...)
  29151. return e
  29152. }
  29153. func (e *htmlSelect) OnMouseUp(h EventHandler, scope ...any) HTMLSelect {
  29154. e.setEventHandler("mouseup", h, scope...)
  29155. return e
  29156. }
  29157. func (e *htmlSelect) OnPaste(h EventHandler, scope ...any) HTMLSelect {
  29158. e.setEventHandler("paste", h, scope...)
  29159. return e
  29160. }
  29161. func (e *htmlSelect) OnReset(h EventHandler, scope ...any) HTMLSelect {
  29162. e.setEventHandler("reset", h, scope...)
  29163. return e
  29164. }
  29165. func (e *htmlSelect) OnScroll(h EventHandler, scope ...any) HTMLSelect {
  29166. e.setEventHandler("scroll", h, scope...)
  29167. return e
  29168. }
  29169. func (e *htmlSelect) OnSearch(h EventHandler, scope ...any) HTMLSelect {
  29170. e.setEventHandler("search", h, scope...)
  29171. return e
  29172. }
  29173. func (e *htmlSelect) OnSelect(h EventHandler, scope ...any) HTMLSelect {
  29174. e.setEventHandler("select", h, scope...)
  29175. return e
  29176. }
  29177. func (e *htmlSelect) OnSubmit(h EventHandler, scope ...any) HTMLSelect {
  29178. e.setEventHandler("submit", h, scope...)
  29179. return e
  29180. }
  29181. func (e *htmlSelect) OnWheel(h EventHandler, scope ...any) HTMLSelect {
  29182. e.setEventHandler("wheel", h, scope...)
  29183. return e
  29184. }
  29185. // HTMLSmall is the interface that describes a "small" HTML element.
  29186. type HTMLSmall interface {
  29187. UI
  29188. // Body set the content of the element.
  29189. Body(elems ...UI) HTMLSmall
  29190. // Text sets the content of the element with a text node containing the stringified given value.
  29191. Text(v any) HTMLSmall
  29192. // AccessKey specifies a shortcut key to activate/focus an element.
  29193. AccessKey(v string) HTMLSmall
  29194. // Aria stores accessible rich internet applications (ARIA) data.
  29195. Aria(k string, v any) HTMLSmall
  29196. // Attr sets the named attribute with the given value.
  29197. Attr(n string, v any) HTMLSmall
  29198. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  29199. Class(v ...string) HTMLSmall
  29200. // ContentEditable specifies whether the content of an element is editable or not.
  29201. ContentEditable(v bool) HTMLSmall
  29202. // DataSet stores custom data private to the page or application.
  29203. DataSet(k string, v any) HTMLSmall
  29204. // Dir specifies the text direction for the content in an element.
  29205. Dir(v string) HTMLSmall
  29206. // Draggable specifies whether an element is draggable or not.
  29207. Draggable(v bool) HTMLSmall
  29208. // Hidden specifies that an element is not yet, or is no longer relevant.
  29209. Hidden(v bool) HTMLSmall
  29210. // ID specifies a unique id for an element.
  29211. ID(v string) HTMLSmall
  29212. // Lang specifies the language of the element's content.
  29213. Lang(v string) HTMLSmall
  29214. // Role specifies to parsing software the exact function of an element (and its children).
  29215. Role(v string) HTMLSmall
  29216. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  29217. Spellcheck(v bool) HTMLSmall
  29218. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  29219. Style(k, v string) HTMLSmall
  29220. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  29221. Styles(s map[string]string) HTMLSmall
  29222. // TabIndex specifies the tabbing order of an element.
  29223. TabIndex(v int) HTMLSmall
  29224. // Title specifies extra information about an element.
  29225. Title(v string) HTMLSmall
  29226. // On registers the given event handler to the specified event.
  29227. On(event string, h EventHandler, scope ...any) HTMLSmall
  29228. // OnBlur calls the given handler when the element loses focus.
  29229. OnBlur(h EventHandler, scope ...any) HTMLSmall
  29230. // OnChange calls the given handler when the value of the element is changed.
  29231. OnChange(h EventHandler, scope ...any) HTMLSmall
  29232. // OnClick calls the given handler when there is a mouse click on the element.
  29233. OnClick(h EventHandler, scope ...any) HTMLSmall
  29234. // OnContextMenu calls the given handler when a context menu is triggered.
  29235. OnContextMenu(h EventHandler, scope ...any) HTMLSmall
  29236. // OnCopy calls the given handler when the user copies the content of an element.
  29237. OnCopy(h EventHandler, scope ...any) HTMLSmall
  29238. // OnCut calls the given handler when the user cuts the content of an element.
  29239. OnCut(h EventHandler, scope ...any) HTMLSmall
  29240. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  29241. OnDblClick(h EventHandler, scope ...any) HTMLSmall
  29242. // OnDrag calls the given handler when an element is dragged.
  29243. OnDrag(h EventHandler, scope ...any) HTMLSmall
  29244. // OnDragEnd calls the given handler at the end of a drag operation.
  29245. OnDragEnd(h EventHandler, scope ...any) HTMLSmall
  29246. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  29247. OnDragEnter(h EventHandler, scope ...any) HTMLSmall
  29248. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  29249. OnDragLeave(h EventHandler, scope ...any) HTMLSmall
  29250. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  29251. OnDragOver(h EventHandler, scope ...any) HTMLSmall
  29252. // OnDragStart calls the given handler at the start of a drag operation.
  29253. OnDragStart(h EventHandler, scope ...any) HTMLSmall
  29254. // OnDrop calls the given handler when dragged element is being dropped.
  29255. OnDrop(h EventHandler, scope ...any) HTMLSmall
  29256. // OnFocus calls the given handler when the element gets focus.
  29257. OnFocus(h EventHandler, scope ...any) HTMLSmall
  29258. // OnInput calls the given handler when an element gets user input.
  29259. OnInput(h EventHandler, scope ...any) HTMLSmall
  29260. // OnInvalid calls the given handler when an element is invalid.
  29261. OnInvalid(h EventHandler, scope ...any) HTMLSmall
  29262. // OnKeyDown calls the given handler when a user is pressing a key.
  29263. OnKeyDown(h EventHandler, scope ...any) HTMLSmall
  29264. // OnKeyPress calls the given handler when a user presses a key.
  29265. OnKeyPress(h EventHandler, scope ...any) HTMLSmall
  29266. // OnKeyUp calls the given handler when a user releases a key.
  29267. OnKeyUp(h EventHandler, scope ...any) HTMLSmall
  29268. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  29269. OnMouseDown(h EventHandler, scope ...any) HTMLSmall
  29270. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  29271. OnMouseMove(h EventHandler, scope ...any) HTMLSmall
  29272. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  29273. OnMouseOut(h EventHandler, scope ...any) HTMLSmall
  29274. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  29275. OnMouseOver(h EventHandler, scope ...any) HTMLSmall
  29276. // OnMouseUp calls the given handler when a mouse button is released over an element.
  29277. OnMouseUp(h EventHandler, scope ...any) HTMLSmall
  29278. // OnPaste calls the given handler when the user pastes some content in an element.
  29279. OnPaste(h EventHandler, scope ...any) HTMLSmall
  29280. // OnReset calls the given handler when the Reset button in a form is clicked.
  29281. OnReset(h EventHandler, scope ...any) HTMLSmall
  29282. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  29283. OnScroll(h EventHandler, scope ...any) HTMLSmall
  29284. // OnSearch calls the given handler when the user writes something in a search field.
  29285. OnSearch(h EventHandler, scope ...any) HTMLSmall
  29286. // OnSelect calls the given handler after some text has been selected in an element.
  29287. OnSelect(h EventHandler, scope ...any) HTMLSmall
  29288. // OnSubmit calls the given handler when a form is submitted.
  29289. OnSubmit(h EventHandler, scope ...any) HTMLSmall
  29290. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  29291. OnWheel(h EventHandler, scope ...any) HTMLSmall
  29292. }
  29293. // Small returns an HTML element that defines smaller text.
  29294. func Small() HTMLSmall {
  29295. e := &htmlSmall{
  29296. htmlElement: htmlElement{
  29297. tag: "small",
  29298. isSelfClosing: false,
  29299. },
  29300. }
  29301. return e
  29302. }
  29303. type htmlSmall struct {
  29304. htmlElement
  29305. }
  29306. func (e *htmlSmall) Body(v ...UI) HTMLSmall {
  29307. e.setChildren(v...)
  29308. return e
  29309. }
  29310. func (e *htmlSmall) Text(v any) HTMLSmall {
  29311. return e.Body(Text(v))
  29312. }
  29313. func (e *htmlSmall) AccessKey(v string) HTMLSmall {
  29314. e.setAttr("accesskey", v)
  29315. return e
  29316. }
  29317. func (e *htmlSmall) Aria(k string, v any) HTMLSmall {
  29318. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  29319. return e
  29320. }
  29321. func (e *htmlSmall) Attr(n string, v any) HTMLSmall {
  29322. e.setAttr(n, v)
  29323. return e
  29324. }
  29325. func (e *htmlSmall) Class(v ...string) HTMLSmall {
  29326. e.setAttr("class", strings.Join(v, " "))
  29327. return e
  29328. }
  29329. func (e *htmlSmall) ContentEditable(v bool) HTMLSmall {
  29330. e.setAttr("contenteditable", v)
  29331. return e
  29332. }
  29333. func (e *htmlSmall) DataSet(k string, v any) HTMLSmall {
  29334. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  29335. return e
  29336. }
  29337. func (e *htmlSmall) Dir(v string) HTMLSmall {
  29338. e.setAttr("dir", v)
  29339. return e
  29340. }
  29341. func (e *htmlSmall) Draggable(v bool) HTMLSmall {
  29342. e.setAttr("draggable", v)
  29343. return e
  29344. }
  29345. func (e *htmlSmall) Hidden(v bool) HTMLSmall {
  29346. e.setAttr("hidden", v)
  29347. return e
  29348. }
  29349. func (e *htmlSmall) ID(v string) HTMLSmall {
  29350. e.setAttr("id", v)
  29351. return e
  29352. }
  29353. func (e *htmlSmall) Lang(v string) HTMLSmall {
  29354. e.setAttr("lang", v)
  29355. return e
  29356. }
  29357. func (e *htmlSmall) Role(v string) HTMLSmall {
  29358. e.setAttr("role", v)
  29359. return e
  29360. }
  29361. func (e *htmlSmall) Spellcheck(v bool) HTMLSmall {
  29362. s := "false"
  29363. if v {
  29364. s = "true"
  29365. }
  29366. e.setAttr("spellcheck", s)
  29367. return e
  29368. }
  29369. func (e *htmlSmall) Style(k, v string) HTMLSmall {
  29370. e.setAttr("style", k+":"+v)
  29371. return e
  29372. }
  29373. func (e *htmlSmall) Styles(s map[string]string) HTMLSmall {
  29374. for k, v := range s {
  29375. e.Style(k, v)
  29376. }
  29377. return e
  29378. }
  29379. func (e *htmlSmall) TabIndex(v int) HTMLSmall {
  29380. e.setAttr("tabindex", v)
  29381. return e
  29382. }
  29383. func (e *htmlSmall) Title(v string) HTMLSmall {
  29384. e.setAttr("title", v)
  29385. return e
  29386. }
  29387. func (e *htmlSmall) On(event string, h EventHandler, scope ...any) HTMLSmall {
  29388. e.setEventHandler(event, h, scope...)
  29389. return e
  29390. }
  29391. func (e *htmlSmall) OnBlur(h EventHandler, scope ...any) HTMLSmall {
  29392. e.setEventHandler("blur", h, scope...)
  29393. return e
  29394. }
  29395. func (e *htmlSmall) OnChange(h EventHandler, scope ...any) HTMLSmall {
  29396. e.setEventHandler("change", h, scope...)
  29397. return e
  29398. }
  29399. func (e *htmlSmall) OnClick(h EventHandler, scope ...any) HTMLSmall {
  29400. e.setEventHandler("click", h, scope...)
  29401. return e
  29402. }
  29403. func (e *htmlSmall) OnContextMenu(h EventHandler, scope ...any) HTMLSmall {
  29404. e.setEventHandler("contextmenu", h, scope...)
  29405. return e
  29406. }
  29407. func (e *htmlSmall) OnCopy(h EventHandler, scope ...any) HTMLSmall {
  29408. e.setEventHandler("copy", h, scope...)
  29409. return e
  29410. }
  29411. func (e *htmlSmall) OnCut(h EventHandler, scope ...any) HTMLSmall {
  29412. e.setEventHandler("cut", h, scope...)
  29413. return e
  29414. }
  29415. func (e *htmlSmall) OnDblClick(h EventHandler, scope ...any) HTMLSmall {
  29416. e.setEventHandler("dblclick", h, scope...)
  29417. return e
  29418. }
  29419. func (e *htmlSmall) OnDrag(h EventHandler, scope ...any) HTMLSmall {
  29420. e.setEventHandler("drag", h, scope...)
  29421. return e
  29422. }
  29423. func (e *htmlSmall) OnDragEnd(h EventHandler, scope ...any) HTMLSmall {
  29424. e.setEventHandler("dragend", h, scope...)
  29425. return e
  29426. }
  29427. func (e *htmlSmall) OnDragEnter(h EventHandler, scope ...any) HTMLSmall {
  29428. e.setEventHandler("dragenter", h, scope...)
  29429. return e
  29430. }
  29431. func (e *htmlSmall) OnDragLeave(h EventHandler, scope ...any) HTMLSmall {
  29432. e.setEventHandler("dragleave", h, scope...)
  29433. return e
  29434. }
  29435. func (e *htmlSmall) OnDragOver(h EventHandler, scope ...any) HTMLSmall {
  29436. e.setEventHandler("dragover", h, scope...)
  29437. return e
  29438. }
  29439. func (e *htmlSmall) OnDragStart(h EventHandler, scope ...any) HTMLSmall {
  29440. e.setEventHandler("dragstart", h, scope...)
  29441. return e
  29442. }
  29443. func (e *htmlSmall) OnDrop(h EventHandler, scope ...any) HTMLSmall {
  29444. e.setEventHandler("drop", h, scope...)
  29445. return e
  29446. }
  29447. func (e *htmlSmall) OnFocus(h EventHandler, scope ...any) HTMLSmall {
  29448. e.setEventHandler("focus", h, scope...)
  29449. return e
  29450. }
  29451. func (e *htmlSmall) OnInput(h EventHandler, scope ...any) HTMLSmall {
  29452. e.setEventHandler("input", h, scope...)
  29453. return e
  29454. }
  29455. func (e *htmlSmall) OnInvalid(h EventHandler, scope ...any) HTMLSmall {
  29456. e.setEventHandler("invalid", h, scope...)
  29457. return e
  29458. }
  29459. func (e *htmlSmall) OnKeyDown(h EventHandler, scope ...any) HTMLSmall {
  29460. e.setEventHandler("keydown", h, scope...)
  29461. return e
  29462. }
  29463. func (e *htmlSmall) OnKeyPress(h EventHandler, scope ...any) HTMLSmall {
  29464. e.setEventHandler("keypress", h, scope...)
  29465. return e
  29466. }
  29467. func (e *htmlSmall) OnKeyUp(h EventHandler, scope ...any) HTMLSmall {
  29468. e.setEventHandler("keyup", h, scope...)
  29469. return e
  29470. }
  29471. func (e *htmlSmall) OnMouseDown(h EventHandler, scope ...any) HTMLSmall {
  29472. e.setEventHandler("mousedown", h, scope...)
  29473. return e
  29474. }
  29475. func (e *htmlSmall) OnMouseMove(h EventHandler, scope ...any) HTMLSmall {
  29476. e.setEventHandler("mousemove", h, scope...)
  29477. return e
  29478. }
  29479. func (e *htmlSmall) OnMouseOut(h EventHandler, scope ...any) HTMLSmall {
  29480. e.setEventHandler("mouseout", h, scope...)
  29481. return e
  29482. }
  29483. func (e *htmlSmall) OnMouseOver(h EventHandler, scope ...any) HTMLSmall {
  29484. e.setEventHandler("mouseover", h, scope...)
  29485. return e
  29486. }
  29487. func (e *htmlSmall) OnMouseUp(h EventHandler, scope ...any) HTMLSmall {
  29488. e.setEventHandler("mouseup", h, scope...)
  29489. return e
  29490. }
  29491. func (e *htmlSmall) OnPaste(h EventHandler, scope ...any) HTMLSmall {
  29492. e.setEventHandler("paste", h, scope...)
  29493. return e
  29494. }
  29495. func (e *htmlSmall) OnReset(h EventHandler, scope ...any) HTMLSmall {
  29496. e.setEventHandler("reset", h, scope...)
  29497. return e
  29498. }
  29499. func (e *htmlSmall) OnScroll(h EventHandler, scope ...any) HTMLSmall {
  29500. e.setEventHandler("scroll", h, scope...)
  29501. return e
  29502. }
  29503. func (e *htmlSmall) OnSearch(h EventHandler, scope ...any) HTMLSmall {
  29504. e.setEventHandler("search", h, scope...)
  29505. return e
  29506. }
  29507. func (e *htmlSmall) OnSelect(h EventHandler, scope ...any) HTMLSmall {
  29508. e.setEventHandler("select", h, scope...)
  29509. return e
  29510. }
  29511. func (e *htmlSmall) OnSubmit(h EventHandler, scope ...any) HTMLSmall {
  29512. e.setEventHandler("submit", h, scope...)
  29513. return e
  29514. }
  29515. func (e *htmlSmall) OnWheel(h EventHandler, scope ...any) HTMLSmall {
  29516. e.setEventHandler("wheel", h, scope...)
  29517. return e
  29518. }
  29519. // HTMLSource is the interface that describes a "source" HTML element.
  29520. type HTMLSource interface {
  29521. UI
  29522. // AccessKey specifies a shortcut key to activate/focus an element.
  29523. AccessKey(v string) HTMLSource
  29524. // Aria stores accessible rich internet applications (ARIA) data.
  29525. Aria(k string, v any) HTMLSource
  29526. // Attr sets the named attribute with the given value.
  29527. Attr(n string, v any) HTMLSource
  29528. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  29529. Class(v ...string) HTMLSource
  29530. // ContentEditable specifies whether the content of an element is editable or not.
  29531. ContentEditable(v bool) HTMLSource
  29532. // DataSet stores custom data private to the page or application.
  29533. DataSet(k string, v any) HTMLSource
  29534. // Dir specifies the text direction for the content in an element.
  29535. Dir(v string) HTMLSource
  29536. // Draggable specifies whether an element is draggable or not.
  29537. Draggable(v bool) HTMLSource
  29538. // Hidden specifies that an element is not yet, or is no longer relevant.
  29539. Hidden(v bool) HTMLSource
  29540. // ID specifies a unique id for an element.
  29541. ID(v string) HTMLSource
  29542. // Lang specifies the language of the element's content.
  29543. Lang(v string) HTMLSource
  29544. // Media specifies what media/device the linked document is optimized for.
  29545. Media(v string) HTMLSource
  29546. // Role specifies to parsing software the exact function of an element (and its children).
  29547. Role(v string) HTMLSource
  29548. // Sizes specifies the size of the linked resource.
  29549. Sizes(v string) HTMLSource
  29550. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  29551. Spellcheck(v bool) HTMLSource
  29552. // Src specifies the URL of the media file.
  29553. Src(v string) HTMLSource
  29554. // SrcSet specifies the URL of the image to use in different situations.
  29555. SrcSet(v string) HTMLSource
  29556. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  29557. Style(k, v string) HTMLSource
  29558. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  29559. Styles(s map[string]string) HTMLSource
  29560. // TabIndex specifies the tabbing order of an element.
  29561. TabIndex(v int) HTMLSource
  29562. // Title specifies extra information about an element.
  29563. Title(v string) HTMLSource
  29564. // Type specifies the type of element.
  29565. Type(v string) HTMLSource
  29566. // On registers the given event handler to the specified event.
  29567. On(event string, h EventHandler, scope ...any) HTMLSource
  29568. // OnBlur calls the given handler when the element loses focus.
  29569. OnBlur(h EventHandler, scope ...any) HTMLSource
  29570. // OnChange calls the given handler when the value of the element is changed.
  29571. OnChange(h EventHandler, scope ...any) HTMLSource
  29572. // OnClick calls the given handler when there is a mouse click on the element.
  29573. OnClick(h EventHandler, scope ...any) HTMLSource
  29574. // OnContextMenu calls the given handler when a context menu is triggered.
  29575. OnContextMenu(h EventHandler, scope ...any) HTMLSource
  29576. // OnCopy calls the given handler when the user copies the content of an element.
  29577. OnCopy(h EventHandler, scope ...any) HTMLSource
  29578. // OnCut calls the given handler when the user cuts the content of an element.
  29579. OnCut(h EventHandler, scope ...any) HTMLSource
  29580. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  29581. OnDblClick(h EventHandler, scope ...any) HTMLSource
  29582. // OnDrag calls the given handler when an element is dragged.
  29583. OnDrag(h EventHandler, scope ...any) HTMLSource
  29584. // OnDragEnd calls the given handler at the end of a drag operation.
  29585. OnDragEnd(h EventHandler, scope ...any) HTMLSource
  29586. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  29587. OnDragEnter(h EventHandler, scope ...any) HTMLSource
  29588. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  29589. OnDragLeave(h EventHandler, scope ...any) HTMLSource
  29590. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  29591. OnDragOver(h EventHandler, scope ...any) HTMLSource
  29592. // OnDragStart calls the given handler at the start of a drag operation.
  29593. OnDragStart(h EventHandler, scope ...any) HTMLSource
  29594. // OnDrop calls the given handler when dragged element is being dropped.
  29595. OnDrop(h EventHandler, scope ...any) HTMLSource
  29596. // OnFocus calls the given handler when the element gets focus.
  29597. OnFocus(h EventHandler, scope ...any) HTMLSource
  29598. // OnInput calls the given handler when an element gets user input.
  29599. OnInput(h EventHandler, scope ...any) HTMLSource
  29600. // OnInvalid calls the given handler when an element is invalid.
  29601. OnInvalid(h EventHandler, scope ...any) HTMLSource
  29602. // OnKeyDown calls the given handler when a user is pressing a key.
  29603. OnKeyDown(h EventHandler, scope ...any) HTMLSource
  29604. // OnKeyPress calls the given handler when a user presses a key.
  29605. OnKeyPress(h EventHandler, scope ...any) HTMLSource
  29606. // OnKeyUp calls the given handler when a user releases a key.
  29607. OnKeyUp(h EventHandler, scope ...any) HTMLSource
  29608. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  29609. OnMouseDown(h EventHandler, scope ...any) HTMLSource
  29610. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  29611. OnMouseMove(h EventHandler, scope ...any) HTMLSource
  29612. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  29613. OnMouseOut(h EventHandler, scope ...any) HTMLSource
  29614. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  29615. OnMouseOver(h EventHandler, scope ...any) HTMLSource
  29616. // OnMouseUp calls the given handler when a mouse button is released over an element.
  29617. OnMouseUp(h EventHandler, scope ...any) HTMLSource
  29618. // OnPaste calls the given handler when the user pastes some content in an element.
  29619. OnPaste(h EventHandler, scope ...any) HTMLSource
  29620. // OnReset calls the given handler when the Reset button in a form is clicked.
  29621. OnReset(h EventHandler, scope ...any) HTMLSource
  29622. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  29623. OnScroll(h EventHandler, scope ...any) HTMLSource
  29624. // OnSearch calls the given handler when the user writes something in a search field.
  29625. OnSearch(h EventHandler, scope ...any) HTMLSource
  29626. // OnSelect calls the given handler after some text has been selected in an element.
  29627. OnSelect(h EventHandler, scope ...any) HTMLSource
  29628. // OnSubmit calls the given handler when a form is submitted.
  29629. OnSubmit(h EventHandler, scope ...any) HTMLSource
  29630. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  29631. OnWheel(h EventHandler, scope ...any) HTMLSource
  29632. }
  29633. // Source returns an HTML element that .
  29634. func Source() HTMLSource {
  29635. e := &htmlSource{
  29636. htmlElement: htmlElement{
  29637. tag: "source",
  29638. isSelfClosing: true,
  29639. },
  29640. }
  29641. return e
  29642. }
  29643. type htmlSource struct {
  29644. htmlElement
  29645. }
  29646. func (e *htmlSource) AccessKey(v string) HTMLSource {
  29647. e.setAttr("accesskey", v)
  29648. return e
  29649. }
  29650. func (e *htmlSource) Aria(k string, v any) HTMLSource {
  29651. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  29652. return e
  29653. }
  29654. func (e *htmlSource) Attr(n string, v any) HTMLSource {
  29655. e.setAttr(n, v)
  29656. return e
  29657. }
  29658. func (e *htmlSource) Class(v ...string) HTMLSource {
  29659. e.setAttr("class", strings.Join(v, " "))
  29660. return e
  29661. }
  29662. func (e *htmlSource) ContentEditable(v bool) HTMLSource {
  29663. e.setAttr("contenteditable", v)
  29664. return e
  29665. }
  29666. func (e *htmlSource) DataSet(k string, v any) HTMLSource {
  29667. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  29668. return e
  29669. }
  29670. func (e *htmlSource) Dir(v string) HTMLSource {
  29671. e.setAttr("dir", v)
  29672. return e
  29673. }
  29674. func (e *htmlSource) Draggable(v bool) HTMLSource {
  29675. e.setAttr("draggable", v)
  29676. return e
  29677. }
  29678. func (e *htmlSource) Hidden(v bool) HTMLSource {
  29679. e.setAttr("hidden", v)
  29680. return e
  29681. }
  29682. func (e *htmlSource) ID(v string) HTMLSource {
  29683. e.setAttr("id", v)
  29684. return e
  29685. }
  29686. func (e *htmlSource) Lang(v string) HTMLSource {
  29687. e.setAttr("lang", v)
  29688. return e
  29689. }
  29690. func (e *htmlSource) Media(v string) HTMLSource {
  29691. e.setAttr("media", v)
  29692. return e
  29693. }
  29694. func (e *htmlSource) Role(v string) HTMLSource {
  29695. e.setAttr("role", v)
  29696. return e
  29697. }
  29698. func (e *htmlSource) Sizes(v string) HTMLSource {
  29699. e.setAttr("sizes", v)
  29700. return e
  29701. }
  29702. func (e *htmlSource) Spellcheck(v bool) HTMLSource {
  29703. s := "false"
  29704. if v {
  29705. s = "true"
  29706. }
  29707. e.setAttr("spellcheck", s)
  29708. return e
  29709. }
  29710. func (e *htmlSource) Src(v string) HTMLSource {
  29711. e.setAttr("src", v)
  29712. return e
  29713. }
  29714. func (e *htmlSource) SrcSet(v string) HTMLSource {
  29715. e.setAttr("srcset", v)
  29716. return e
  29717. }
  29718. func (e *htmlSource) Style(k, v string) HTMLSource {
  29719. e.setAttr("style", k+":"+v)
  29720. return e
  29721. }
  29722. func (e *htmlSource) Styles(s map[string]string) HTMLSource {
  29723. for k, v := range s {
  29724. e.Style(k, v)
  29725. }
  29726. return e
  29727. }
  29728. func (e *htmlSource) TabIndex(v int) HTMLSource {
  29729. e.setAttr("tabindex", v)
  29730. return e
  29731. }
  29732. func (e *htmlSource) Title(v string) HTMLSource {
  29733. e.setAttr("title", v)
  29734. return e
  29735. }
  29736. func (e *htmlSource) Type(v string) HTMLSource {
  29737. e.setAttr("type", v)
  29738. return e
  29739. }
  29740. func (e *htmlSource) On(event string, h EventHandler, scope ...any) HTMLSource {
  29741. e.setEventHandler(event, h, scope...)
  29742. return e
  29743. }
  29744. func (e *htmlSource) OnBlur(h EventHandler, scope ...any) HTMLSource {
  29745. e.setEventHandler("blur", h, scope...)
  29746. return e
  29747. }
  29748. func (e *htmlSource) OnChange(h EventHandler, scope ...any) HTMLSource {
  29749. e.setEventHandler("change", h, scope...)
  29750. return e
  29751. }
  29752. func (e *htmlSource) OnClick(h EventHandler, scope ...any) HTMLSource {
  29753. e.setEventHandler("click", h, scope...)
  29754. return e
  29755. }
  29756. func (e *htmlSource) OnContextMenu(h EventHandler, scope ...any) HTMLSource {
  29757. e.setEventHandler("contextmenu", h, scope...)
  29758. return e
  29759. }
  29760. func (e *htmlSource) OnCopy(h EventHandler, scope ...any) HTMLSource {
  29761. e.setEventHandler("copy", h, scope...)
  29762. return e
  29763. }
  29764. func (e *htmlSource) OnCut(h EventHandler, scope ...any) HTMLSource {
  29765. e.setEventHandler("cut", h, scope...)
  29766. return e
  29767. }
  29768. func (e *htmlSource) OnDblClick(h EventHandler, scope ...any) HTMLSource {
  29769. e.setEventHandler("dblclick", h, scope...)
  29770. return e
  29771. }
  29772. func (e *htmlSource) OnDrag(h EventHandler, scope ...any) HTMLSource {
  29773. e.setEventHandler("drag", h, scope...)
  29774. return e
  29775. }
  29776. func (e *htmlSource) OnDragEnd(h EventHandler, scope ...any) HTMLSource {
  29777. e.setEventHandler("dragend", h, scope...)
  29778. return e
  29779. }
  29780. func (e *htmlSource) OnDragEnter(h EventHandler, scope ...any) HTMLSource {
  29781. e.setEventHandler("dragenter", h, scope...)
  29782. return e
  29783. }
  29784. func (e *htmlSource) OnDragLeave(h EventHandler, scope ...any) HTMLSource {
  29785. e.setEventHandler("dragleave", h, scope...)
  29786. return e
  29787. }
  29788. func (e *htmlSource) OnDragOver(h EventHandler, scope ...any) HTMLSource {
  29789. e.setEventHandler("dragover", h, scope...)
  29790. return e
  29791. }
  29792. func (e *htmlSource) OnDragStart(h EventHandler, scope ...any) HTMLSource {
  29793. e.setEventHandler("dragstart", h, scope...)
  29794. return e
  29795. }
  29796. func (e *htmlSource) OnDrop(h EventHandler, scope ...any) HTMLSource {
  29797. e.setEventHandler("drop", h, scope...)
  29798. return e
  29799. }
  29800. func (e *htmlSource) OnFocus(h EventHandler, scope ...any) HTMLSource {
  29801. e.setEventHandler("focus", h, scope...)
  29802. return e
  29803. }
  29804. func (e *htmlSource) OnInput(h EventHandler, scope ...any) HTMLSource {
  29805. e.setEventHandler("input", h, scope...)
  29806. return e
  29807. }
  29808. func (e *htmlSource) OnInvalid(h EventHandler, scope ...any) HTMLSource {
  29809. e.setEventHandler("invalid", h, scope...)
  29810. return e
  29811. }
  29812. func (e *htmlSource) OnKeyDown(h EventHandler, scope ...any) HTMLSource {
  29813. e.setEventHandler("keydown", h, scope...)
  29814. return e
  29815. }
  29816. func (e *htmlSource) OnKeyPress(h EventHandler, scope ...any) HTMLSource {
  29817. e.setEventHandler("keypress", h, scope...)
  29818. return e
  29819. }
  29820. func (e *htmlSource) OnKeyUp(h EventHandler, scope ...any) HTMLSource {
  29821. e.setEventHandler("keyup", h, scope...)
  29822. return e
  29823. }
  29824. func (e *htmlSource) OnMouseDown(h EventHandler, scope ...any) HTMLSource {
  29825. e.setEventHandler("mousedown", h, scope...)
  29826. return e
  29827. }
  29828. func (e *htmlSource) OnMouseMove(h EventHandler, scope ...any) HTMLSource {
  29829. e.setEventHandler("mousemove", h, scope...)
  29830. return e
  29831. }
  29832. func (e *htmlSource) OnMouseOut(h EventHandler, scope ...any) HTMLSource {
  29833. e.setEventHandler("mouseout", h, scope...)
  29834. return e
  29835. }
  29836. func (e *htmlSource) OnMouseOver(h EventHandler, scope ...any) HTMLSource {
  29837. e.setEventHandler("mouseover", h, scope...)
  29838. return e
  29839. }
  29840. func (e *htmlSource) OnMouseUp(h EventHandler, scope ...any) HTMLSource {
  29841. e.setEventHandler("mouseup", h, scope...)
  29842. return e
  29843. }
  29844. func (e *htmlSource) OnPaste(h EventHandler, scope ...any) HTMLSource {
  29845. e.setEventHandler("paste", h, scope...)
  29846. return e
  29847. }
  29848. func (e *htmlSource) OnReset(h EventHandler, scope ...any) HTMLSource {
  29849. e.setEventHandler("reset", h, scope...)
  29850. return e
  29851. }
  29852. func (e *htmlSource) OnScroll(h EventHandler, scope ...any) HTMLSource {
  29853. e.setEventHandler("scroll", h, scope...)
  29854. return e
  29855. }
  29856. func (e *htmlSource) OnSearch(h EventHandler, scope ...any) HTMLSource {
  29857. e.setEventHandler("search", h, scope...)
  29858. return e
  29859. }
  29860. func (e *htmlSource) OnSelect(h EventHandler, scope ...any) HTMLSource {
  29861. e.setEventHandler("select", h, scope...)
  29862. return e
  29863. }
  29864. func (e *htmlSource) OnSubmit(h EventHandler, scope ...any) HTMLSource {
  29865. e.setEventHandler("submit", h, scope...)
  29866. return e
  29867. }
  29868. func (e *htmlSource) OnWheel(h EventHandler, scope ...any) HTMLSource {
  29869. e.setEventHandler("wheel", h, scope...)
  29870. return e
  29871. }
  29872. // HTMLSpan is the interface that describes a "span" HTML element.
  29873. type HTMLSpan interface {
  29874. UI
  29875. // Body set the content of the element.
  29876. Body(elems ...UI) HTMLSpan
  29877. // Text sets the content of the element with a text node containing the stringified given value.
  29878. Text(v any) HTMLSpan
  29879. // AccessKey specifies a shortcut key to activate/focus an element.
  29880. AccessKey(v string) HTMLSpan
  29881. // Aria stores accessible rich internet applications (ARIA) data.
  29882. Aria(k string, v any) HTMLSpan
  29883. // Attr sets the named attribute with the given value.
  29884. Attr(n string, v any) HTMLSpan
  29885. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  29886. Class(v ...string) HTMLSpan
  29887. // ContentEditable specifies whether the content of an element is editable or not.
  29888. ContentEditable(v bool) HTMLSpan
  29889. // DataSet stores custom data private to the page or application.
  29890. DataSet(k string, v any) HTMLSpan
  29891. // Dir specifies the text direction for the content in an element.
  29892. Dir(v string) HTMLSpan
  29893. // Draggable specifies whether an element is draggable or not.
  29894. Draggable(v bool) HTMLSpan
  29895. // Hidden specifies that an element is not yet, or is no longer relevant.
  29896. Hidden(v bool) HTMLSpan
  29897. // ID specifies a unique id for an element.
  29898. ID(v string) HTMLSpan
  29899. // Lang specifies the language of the element's content.
  29900. Lang(v string) HTMLSpan
  29901. // Role specifies to parsing software the exact function of an element (and its children).
  29902. Role(v string) HTMLSpan
  29903. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  29904. Spellcheck(v bool) HTMLSpan
  29905. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  29906. Style(k, v string) HTMLSpan
  29907. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  29908. Styles(s map[string]string) HTMLSpan
  29909. // TabIndex specifies the tabbing order of an element.
  29910. TabIndex(v int) HTMLSpan
  29911. // Title specifies extra information about an element.
  29912. Title(v string) HTMLSpan
  29913. // On registers the given event handler to the specified event.
  29914. On(event string, h EventHandler, scope ...any) HTMLSpan
  29915. // OnBlur calls the given handler when the element loses focus.
  29916. OnBlur(h EventHandler, scope ...any) HTMLSpan
  29917. // OnChange calls the given handler when the value of the element is changed.
  29918. OnChange(h EventHandler, scope ...any) HTMLSpan
  29919. // OnClick calls the given handler when there is a mouse click on the element.
  29920. OnClick(h EventHandler, scope ...any) HTMLSpan
  29921. // OnContextMenu calls the given handler when a context menu is triggered.
  29922. OnContextMenu(h EventHandler, scope ...any) HTMLSpan
  29923. // OnCopy calls the given handler when the user copies the content of an element.
  29924. OnCopy(h EventHandler, scope ...any) HTMLSpan
  29925. // OnCut calls the given handler when the user cuts the content of an element.
  29926. OnCut(h EventHandler, scope ...any) HTMLSpan
  29927. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  29928. OnDblClick(h EventHandler, scope ...any) HTMLSpan
  29929. // OnDrag calls the given handler when an element is dragged.
  29930. OnDrag(h EventHandler, scope ...any) HTMLSpan
  29931. // OnDragEnd calls the given handler at the end of a drag operation.
  29932. OnDragEnd(h EventHandler, scope ...any) HTMLSpan
  29933. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  29934. OnDragEnter(h EventHandler, scope ...any) HTMLSpan
  29935. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  29936. OnDragLeave(h EventHandler, scope ...any) HTMLSpan
  29937. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  29938. OnDragOver(h EventHandler, scope ...any) HTMLSpan
  29939. // OnDragStart calls the given handler at the start of a drag operation.
  29940. OnDragStart(h EventHandler, scope ...any) HTMLSpan
  29941. // OnDrop calls the given handler when dragged element is being dropped.
  29942. OnDrop(h EventHandler, scope ...any) HTMLSpan
  29943. // OnFocus calls the given handler when the element gets focus.
  29944. OnFocus(h EventHandler, scope ...any) HTMLSpan
  29945. // OnInput calls the given handler when an element gets user input.
  29946. OnInput(h EventHandler, scope ...any) HTMLSpan
  29947. // OnInvalid calls the given handler when an element is invalid.
  29948. OnInvalid(h EventHandler, scope ...any) HTMLSpan
  29949. // OnKeyDown calls the given handler when a user is pressing a key.
  29950. OnKeyDown(h EventHandler, scope ...any) HTMLSpan
  29951. // OnKeyPress calls the given handler when a user presses a key.
  29952. OnKeyPress(h EventHandler, scope ...any) HTMLSpan
  29953. // OnKeyUp calls the given handler when a user releases a key.
  29954. OnKeyUp(h EventHandler, scope ...any) HTMLSpan
  29955. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  29956. OnMouseDown(h EventHandler, scope ...any) HTMLSpan
  29957. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  29958. OnMouseMove(h EventHandler, scope ...any) HTMLSpan
  29959. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  29960. OnMouseOut(h EventHandler, scope ...any) HTMLSpan
  29961. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  29962. OnMouseOver(h EventHandler, scope ...any) HTMLSpan
  29963. // OnMouseUp calls the given handler when a mouse button is released over an element.
  29964. OnMouseUp(h EventHandler, scope ...any) HTMLSpan
  29965. // OnPaste calls the given handler when the user pastes some content in an element.
  29966. OnPaste(h EventHandler, scope ...any) HTMLSpan
  29967. // OnReset calls the given handler when the Reset button in a form is clicked.
  29968. OnReset(h EventHandler, scope ...any) HTMLSpan
  29969. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  29970. OnScroll(h EventHandler, scope ...any) HTMLSpan
  29971. // OnSearch calls the given handler when the user writes something in a search field.
  29972. OnSearch(h EventHandler, scope ...any) HTMLSpan
  29973. // OnSelect calls the given handler after some text has been selected in an element.
  29974. OnSelect(h EventHandler, scope ...any) HTMLSpan
  29975. // OnSubmit calls the given handler when a form is submitted.
  29976. OnSubmit(h EventHandler, scope ...any) HTMLSpan
  29977. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  29978. OnWheel(h EventHandler, scope ...any) HTMLSpan
  29979. }
  29980. // Span returns an HTML element that defines a section in a document.
  29981. func Span() HTMLSpan {
  29982. e := &htmlSpan{
  29983. htmlElement: htmlElement{
  29984. tag: "span",
  29985. isSelfClosing: false,
  29986. },
  29987. }
  29988. return e
  29989. }
  29990. type htmlSpan struct {
  29991. htmlElement
  29992. }
  29993. func (e *htmlSpan) Body(v ...UI) HTMLSpan {
  29994. e.setChildren(v...)
  29995. return e
  29996. }
  29997. func (e *htmlSpan) Text(v any) HTMLSpan {
  29998. return e.Body(Text(v))
  29999. }
  30000. func (e *htmlSpan) AccessKey(v string) HTMLSpan {
  30001. e.setAttr("accesskey", v)
  30002. return e
  30003. }
  30004. func (e *htmlSpan) Aria(k string, v any) HTMLSpan {
  30005. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  30006. return e
  30007. }
  30008. func (e *htmlSpan) Attr(n string, v any) HTMLSpan {
  30009. e.setAttr(n, v)
  30010. return e
  30011. }
  30012. func (e *htmlSpan) Class(v ...string) HTMLSpan {
  30013. e.setAttr("class", strings.Join(v, " "))
  30014. return e
  30015. }
  30016. func (e *htmlSpan) ContentEditable(v bool) HTMLSpan {
  30017. e.setAttr("contenteditable", v)
  30018. return e
  30019. }
  30020. func (e *htmlSpan) DataSet(k string, v any) HTMLSpan {
  30021. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  30022. return e
  30023. }
  30024. func (e *htmlSpan) Dir(v string) HTMLSpan {
  30025. e.setAttr("dir", v)
  30026. return e
  30027. }
  30028. func (e *htmlSpan) Draggable(v bool) HTMLSpan {
  30029. e.setAttr("draggable", v)
  30030. return e
  30031. }
  30032. func (e *htmlSpan) Hidden(v bool) HTMLSpan {
  30033. e.setAttr("hidden", v)
  30034. return e
  30035. }
  30036. func (e *htmlSpan) ID(v string) HTMLSpan {
  30037. e.setAttr("id", v)
  30038. return e
  30039. }
  30040. func (e *htmlSpan) Lang(v string) HTMLSpan {
  30041. e.setAttr("lang", v)
  30042. return e
  30043. }
  30044. func (e *htmlSpan) Role(v string) HTMLSpan {
  30045. e.setAttr("role", v)
  30046. return e
  30047. }
  30048. func (e *htmlSpan) Spellcheck(v bool) HTMLSpan {
  30049. s := "false"
  30050. if v {
  30051. s = "true"
  30052. }
  30053. e.setAttr("spellcheck", s)
  30054. return e
  30055. }
  30056. func (e *htmlSpan) Style(k, v string) HTMLSpan {
  30057. e.setAttr("style", k+":"+v)
  30058. return e
  30059. }
  30060. func (e *htmlSpan) Styles(s map[string]string) HTMLSpan {
  30061. for k, v := range s {
  30062. e.Style(k, v)
  30063. }
  30064. return e
  30065. }
  30066. func (e *htmlSpan) TabIndex(v int) HTMLSpan {
  30067. e.setAttr("tabindex", v)
  30068. return e
  30069. }
  30070. func (e *htmlSpan) Title(v string) HTMLSpan {
  30071. e.setAttr("title", v)
  30072. return e
  30073. }
  30074. func (e *htmlSpan) On(event string, h EventHandler, scope ...any) HTMLSpan {
  30075. e.setEventHandler(event, h, scope...)
  30076. return e
  30077. }
  30078. func (e *htmlSpan) OnBlur(h EventHandler, scope ...any) HTMLSpan {
  30079. e.setEventHandler("blur", h, scope...)
  30080. return e
  30081. }
  30082. func (e *htmlSpan) OnChange(h EventHandler, scope ...any) HTMLSpan {
  30083. e.setEventHandler("change", h, scope...)
  30084. return e
  30085. }
  30086. func (e *htmlSpan) OnClick(h EventHandler, scope ...any) HTMLSpan {
  30087. e.setEventHandler("click", h, scope...)
  30088. return e
  30089. }
  30090. func (e *htmlSpan) OnContextMenu(h EventHandler, scope ...any) HTMLSpan {
  30091. e.setEventHandler("contextmenu", h, scope...)
  30092. return e
  30093. }
  30094. func (e *htmlSpan) OnCopy(h EventHandler, scope ...any) HTMLSpan {
  30095. e.setEventHandler("copy", h, scope...)
  30096. return e
  30097. }
  30098. func (e *htmlSpan) OnCut(h EventHandler, scope ...any) HTMLSpan {
  30099. e.setEventHandler("cut", h, scope...)
  30100. return e
  30101. }
  30102. func (e *htmlSpan) OnDblClick(h EventHandler, scope ...any) HTMLSpan {
  30103. e.setEventHandler("dblclick", h, scope...)
  30104. return e
  30105. }
  30106. func (e *htmlSpan) OnDrag(h EventHandler, scope ...any) HTMLSpan {
  30107. e.setEventHandler("drag", h, scope...)
  30108. return e
  30109. }
  30110. func (e *htmlSpan) OnDragEnd(h EventHandler, scope ...any) HTMLSpan {
  30111. e.setEventHandler("dragend", h, scope...)
  30112. return e
  30113. }
  30114. func (e *htmlSpan) OnDragEnter(h EventHandler, scope ...any) HTMLSpan {
  30115. e.setEventHandler("dragenter", h, scope...)
  30116. return e
  30117. }
  30118. func (e *htmlSpan) OnDragLeave(h EventHandler, scope ...any) HTMLSpan {
  30119. e.setEventHandler("dragleave", h, scope...)
  30120. return e
  30121. }
  30122. func (e *htmlSpan) OnDragOver(h EventHandler, scope ...any) HTMLSpan {
  30123. e.setEventHandler("dragover", h, scope...)
  30124. return e
  30125. }
  30126. func (e *htmlSpan) OnDragStart(h EventHandler, scope ...any) HTMLSpan {
  30127. e.setEventHandler("dragstart", h, scope...)
  30128. return e
  30129. }
  30130. func (e *htmlSpan) OnDrop(h EventHandler, scope ...any) HTMLSpan {
  30131. e.setEventHandler("drop", h, scope...)
  30132. return e
  30133. }
  30134. func (e *htmlSpan) OnFocus(h EventHandler, scope ...any) HTMLSpan {
  30135. e.setEventHandler("focus", h, scope...)
  30136. return e
  30137. }
  30138. func (e *htmlSpan) OnInput(h EventHandler, scope ...any) HTMLSpan {
  30139. e.setEventHandler("input", h, scope...)
  30140. return e
  30141. }
  30142. func (e *htmlSpan) OnInvalid(h EventHandler, scope ...any) HTMLSpan {
  30143. e.setEventHandler("invalid", h, scope...)
  30144. return e
  30145. }
  30146. func (e *htmlSpan) OnKeyDown(h EventHandler, scope ...any) HTMLSpan {
  30147. e.setEventHandler("keydown", h, scope...)
  30148. return e
  30149. }
  30150. func (e *htmlSpan) OnKeyPress(h EventHandler, scope ...any) HTMLSpan {
  30151. e.setEventHandler("keypress", h, scope...)
  30152. return e
  30153. }
  30154. func (e *htmlSpan) OnKeyUp(h EventHandler, scope ...any) HTMLSpan {
  30155. e.setEventHandler("keyup", h, scope...)
  30156. return e
  30157. }
  30158. func (e *htmlSpan) OnMouseDown(h EventHandler, scope ...any) HTMLSpan {
  30159. e.setEventHandler("mousedown", h, scope...)
  30160. return e
  30161. }
  30162. func (e *htmlSpan) OnMouseMove(h EventHandler, scope ...any) HTMLSpan {
  30163. e.setEventHandler("mousemove", h, scope...)
  30164. return e
  30165. }
  30166. func (e *htmlSpan) OnMouseOut(h EventHandler, scope ...any) HTMLSpan {
  30167. e.setEventHandler("mouseout", h, scope...)
  30168. return e
  30169. }
  30170. func (e *htmlSpan) OnMouseOver(h EventHandler, scope ...any) HTMLSpan {
  30171. e.setEventHandler("mouseover", h, scope...)
  30172. return e
  30173. }
  30174. func (e *htmlSpan) OnMouseUp(h EventHandler, scope ...any) HTMLSpan {
  30175. e.setEventHandler("mouseup", h, scope...)
  30176. return e
  30177. }
  30178. func (e *htmlSpan) OnPaste(h EventHandler, scope ...any) HTMLSpan {
  30179. e.setEventHandler("paste", h, scope...)
  30180. return e
  30181. }
  30182. func (e *htmlSpan) OnReset(h EventHandler, scope ...any) HTMLSpan {
  30183. e.setEventHandler("reset", h, scope...)
  30184. return e
  30185. }
  30186. func (e *htmlSpan) OnScroll(h EventHandler, scope ...any) HTMLSpan {
  30187. e.setEventHandler("scroll", h, scope...)
  30188. return e
  30189. }
  30190. func (e *htmlSpan) OnSearch(h EventHandler, scope ...any) HTMLSpan {
  30191. e.setEventHandler("search", h, scope...)
  30192. return e
  30193. }
  30194. func (e *htmlSpan) OnSelect(h EventHandler, scope ...any) HTMLSpan {
  30195. e.setEventHandler("select", h, scope...)
  30196. return e
  30197. }
  30198. func (e *htmlSpan) OnSubmit(h EventHandler, scope ...any) HTMLSpan {
  30199. e.setEventHandler("submit", h, scope...)
  30200. return e
  30201. }
  30202. func (e *htmlSpan) OnWheel(h EventHandler, scope ...any) HTMLSpan {
  30203. e.setEventHandler("wheel", h, scope...)
  30204. return e
  30205. }
  30206. // HTMLStrong is the interface that describes a "strong" HTML element.
  30207. type HTMLStrong interface {
  30208. UI
  30209. // Body set the content of the element.
  30210. Body(elems ...UI) HTMLStrong
  30211. // Text sets the content of the element with a text node containing the stringified given value.
  30212. Text(v any) HTMLStrong
  30213. // AccessKey specifies a shortcut key to activate/focus an element.
  30214. AccessKey(v string) HTMLStrong
  30215. // Aria stores accessible rich internet applications (ARIA) data.
  30216. Aria(k string, v any) HTMLStrong
  30217. // Attr sets the named attribute with the given value.
  30218. Attr(n string, v any) HTMLStrong
  30219. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  30220. Class(v ...string) HTMLStrong
  30221. // ContentEditable specifies whether the content of an element is editable or not.
  30222. ContentEditable(v bool) HTMLStrong
  30223. // DataSet stores custom data private to the page or application.
  30224. DataSet(k string, v any) HTMLStrong
  30225. // Dir specifies the text direction for the content in an element.
  30226. Dir(v string) HTMLStrong
  30227. // Draggable specifies whether an element is draggable or not.
  30228. Draggable(v bool) HTMLStrong
  30229. // Hidden specifies that an element is not yet, or is no longer relevant.
  30230. Hidden(v bool) HTMLStrong
  30231. // ID specifies a unique id for an element.
  30232. ID(v string) HTMLStrong
  30233. // Lang specifies the language of the element's content.
  30234. Lang(v string) HTMLStrong
  30235. // Role specifies to parsing software the exact function of an element (and its children).
  30236. Role(v string) HTMLStrong
  30237. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  30238. Spellcheck(v bool) HTMLStrong
  30239. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  30240. Style(k, v string) HTMLStrong
  30241. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  30242. Styles(s map[string]string) HTMLStrong
  30243. // TabIndex specifies the tabbing order of an element.
  30244. TabIndex(v int) HTMLStrong
  30245. // Title specifies extra information about an element.
  30246. Title(v string) HTMLStrong
  30247. // On registers the given event handler to the specified event.
  30248. On(event string, h EventHandler, scope ...any) HTMLStrong
  30249. // OnBlur calls the given handler when the element loses focus.
  30250. OnBlur(h EventHandler, scope ...any) HTMLStrong
  30251. // OnChange calls the given handler when the value of the element is changed.
  30252. OnChange(h EventHandler, scope ...any) HTMLStrong
  30253. // OnClick calls the given handler when there is a mouse click on the element.
  30254. OnClick(h EventHandler, scope ...any) HTMLStrong
  30255. // OnContextMenu calls the given handler when a context menu is triggered.
  30256. OnContextMenu(h EventHandler, scope ...any) HTMLStrong
  30257. // OnCopy calls the given handler when the user copies the content of an element.
  30258. OnCopy(h EventHandler, scope ...any) HTMLStrong
  30259. // OnCut calls the given handler when the user cuts the content of an element.
  30260. OnCut(h EventHandler, scope ...any) HTMLStrong
  30261. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  30262. OnDblClick(h EventHandler, scope ...any) HTMLStrong
  30263. // OnDrag calls the given handler when an element is dragged.
  30264. OnDrag(h EventHandler, scope ...any) HTMLStrong
  30265. // OnDragEnd calls the given handler at the end of a drag operation.
  30266. OnDragEnd(h EventHandler, scope ...any) HTMLStrong
  30267. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  30268. OnDragEnter(h EventHandler, scope ...any) HTMLStrong
  30269. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  30270. OnDragLeave(h EventHandler, scope ...any) HTMLStrong
  30271. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  30272. OnDragOver(h EventHandler, scope ...any) HTMLStrong
  30273. // OnDragStart calls the given handler at the start of a drag operation.
  30274. OnDragStart(h EventHandler, scope ...any) HTMLStrong
  30275. // OnDrop calls the given handler when dragged element is being dropped.
  30276. OnDrop(h EventHandler, scope ...any) HTMLStrong
  30277. // OnFocus calls the given handler when the element gets focus.
  30278. OnFocus(h EventHandler, scope ...any) HTMLStrong
  30279. // OnInput calls the given handler when an element gets user input.
  30280. OnInput(h EventHandler, scope ...any) HTMLStrong
  30281. // OnInvalid calls the given handler when an element is invalid.
  30282. OnInvalid(h EventHandler, scope ...any) HTMLStrong
  30283. // OnKeyDown calls the given handler when a user is pressing a key.
  30284. OnKeyDown(h EventHandler, scope ...any) HTMLStrong
  30285. // OnKeyPress calls the given handler when a user presses a key.
  30286. OnKeyPress(h EventHandler, scope ...any) HTMLStrong
  30287. // OnKeyUp calls the given handler when a user releases a key.
  30288. OnKeyUp(h EventHandler, scope ...any) HTMLStrong
  30289. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  30290. OnMouseDown(h EventHandler, scope ...any) HTMLStrong
  30291. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  30292. OnMouseMove(h EventHandler, scope ...any) HTMLStrong
  30293. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  30294. OnMouseOut(h EventHandler, scope ...any) HTMLStrong
  30295. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  30296. OnMouseOver(h EventHandler, scope ...any) HTMLStrong
  30297. // OnMouseUp calls the given handler when a mouse button is released over an element.
  30298. OnMouseUp(h EventHandler, scope ...any) HTMLStrong
  30299. // OnPaste calls the given handler when the user pastes some content in an element.
  30300. OnPaste(h EventHandler, scope ...any) HTMLStrong
  30301. // OnReset calls the given handler when the Reset button in a form is clicked.
  30302. OnReset(h EventHandler, scope ...any) HTMLStrong
  30303. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  30304. OnScroll(h EventHandler, scope ...any) HTMLStrong
  30305. // OnSearch calls the given handler when the user writes something in a search field.
  30306. OnSearch(h EventHandler, scope ...any) HTMLStrong
  30307. // OnSelect calls the given handler after some text has been selected in an element.
  30308. OnSelect(h EventHandler, scope ...any) HTMLStrong
  30309. // OnSubmit calls the given handler when a form is submitted.
  30310. OnSubmit(h EventHandler, scope ...any) HTMLStrong
  30311. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  30312. OnWheel(h EventHandler, scope ...any) HTMLStrong
  30313. }
  30314. // Strong returns an HTML element that defines important text.
  30315. func Strong() HTMLStrong {
  30316. e := &htmlStrong{
  30317. htmlElement: htmlElement{
  30318. tag: "strong",
  30319. isSelfClosing: false,
  30320. },
  30321. }
  30322. return e
  30323. }
  30324. type htmlStrong struct {
  30325. htmlElement
  30326. }
  30327. func (e *htmlStrong) Body(v ...UI) HTMLStrong {
  30328. e.setChildren(v...)
  30329. return e
  30330. }
  30331. func (e *htmlStrong) Text(v any) HTMLStrong {
  30332. return e.Body(Text(v))
  30333. }
  30334. func (e *htmlStrong) AccessKey(v string) HTMLStrong {
  30335. e.setAttr("accesskey", v)
  30336. return e
  30337. }
  30338. func (e *htmlStrong) Aria(k string, v any) HTMLStrong {
  30339. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  30340. return e
  30341. }
  30342. func (e *htmlStrong) Attr(n string, v any) HTMLStrong {
  30343. e.setAttr(n, v)
  30344. return e
  30345. }
  30346. func (e *htmlStrong) Class(v ...string) HTMLStrong {
  30347. e.setAttr("class", strings.Join(v, " "))
  30348. return e
  30349. }
  30350. func (e *htmlStrong) ContentEditable(v bool) HTMLStrong {
  30351. e.setAttr("contenteditable", v)
  30352. return e
  30353. }
  30354. func (e *htmlStrong) DataSet(k string, v any) HTMLStrong {
  30355. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  30356. return e
  30357. }
  30358. func (e *htmlStrong) Dir(v string) HTMLStrong {
  30359. e.setAttr("dir", v)
  30360. return e
  30361. }
  30362. func (e *htmlStrong) Draggable(v bool) HTMLStrong {
  30363. e.setAttr("draggable", v)
  30364. return e
  30365. }
  30366. func (e *htmlStrong) Hidden(v bool) HTMLStrong {
  30367. e.setAttr("hidden", v)
  30368. return e
  30369. }
  30370. func (e *htmlStrong) ID(v string) HTMLStrong {
  30371. e.setAttr("id", v)
  30372. return e
  30373. }
  30374. func (e *htmlStrong) Lang(v string) HTMLStrong {
  30375. e.setAttr("lang", v)
  30376. return e
  30377. }
  30378. func (e *htmlStrong) Role(v string) HTMLStrong {
  30379. e.setAttr("role", v)
  30380. return e
  30381. }
  30382. func (e *htmlStrong) Spellcheck(v bool) HTMLStrong {
  30383. s := "false"
  30384. if v {
  30385. s = "true"
  30386. }
  30387. e.setAttr("spellcheck", s)
  30388. return e
  30389. }
  30390. func (e *htmlStrong) Style(k, v string) HTMLStrong {
  30391. e.setAttr("style", k+":"+v)
  30392. return e
  30393. }
  30394. func (e *htmlStrong) Styles(s map[string]string) HTMLStrong {
  30395. for k, v := range s {
  30396. e.Style(k, v)
  30397. }
  30398. return e
  30399. }
  30400. func (e *htmlStrong) TabIndex(v int) HTMLStrong {
  30401. e.setAttr("tabindex", v)
  30402. return e
  30403. }
  30404. func (e *htmlStrong) Title(v string) HTMLStrong {
  30405. e.setAttr("title", v)
  30406. return e
  30407. }
  30408. func (e *htmlStrong) On(event string, h EventHandler, scope ...any) HTMLStrong {
  30409. e.setEventHandler(event, h, scope...)
  30410. return e
  30411. }
  30412. func (e *htmlStrong) OnBlur(h EventHandler, scope ...any) HTMLStrong {
  30413. e.setEventHandler("blur", h, scope...)
  30414. return e
  30415. }
  30416. func (e *htmlStrong) OnChange(h EventHandler, scope ...any) HTMLStrong {
  30417. e.setEventHandler("change", h, scope...)
  30418. return e
  30419. }
  30420. func (e *htmlStrong) OnClick(h EventHandler, scope ...any) HTMLStrong {
  30421. e.setEventHandler("click", h, scope...)
  30422. return e
  30423. }
  30424. func (e *htmlStrong) OnContextMenu(h EventHandler, scope ...any) HTMLStrong {
  30425. e.setEventHandler("contextmenu", h, scope...)
  30426. return e
  30427. }
  30428. func (e *htmlStrong) OnCopy(h EventHandler, scope ...any) HTMLStrong {
  30429. e.setEventHandler("copy", h, scope...)
  30430. return e
  30431. }
  30432. func (e *htmlStrong) OnCut(h EventHandler, scope ...any) HTMLStrong {
  30433. e.setEventHandler("cut", h, scope...)
  30434. return e
  30435. }
  30436. func (e *htmlStrong) OnDblClick(h EventHandler, scope ...any) HTMLStrong {
  30437. e.setEventHandler("dblclick", h, scope...)
  30438. return e
  30439. }
  30440. func (e *htmlStrong) OnDrag(h EventHandler, scope ...any) HTMLStrong {
  30441. e.setEventHandler("drag", h, scope...)
  30442. return e
  30443. }
  30444. func (e *htmlStrong) OnDragEnd(h EventHandler, scope ...any) HTMLStrong {
  30445. e.setEventHandler("dragend", h, scope...)
  30446. return e
  30447. }
  30448. func (e *htmlStrong) OnDragEnter(h EventHandler, scope ...any) HTMLStrong {
  30449. e.setEventHandler("dragenter", h, scope...)
  30450. return e
  30451. }
  30452. func (e *htmlStrong) OnDragLeave(h EventHandler, scope ...any) HTMLStrong {
  30453. e.setEventHandler("dragleave", h, scope...)
  30454. return e
  30455. }
  30456. func (e *htmlStrong) OnDragOver(h EventHandler, scope ...any) HTMLStrong {
  30457. e.setEventHandler("dragover", h, scope...)
  30458. return e
  30459. }
  30460. func (e *htmlStrong) OnDragStart(h EventHandler, scope ...any) HTMLStrong {
  30461. e.setEventHandler("dragstart", h, scope...)
  30462. return e
  30463. }
  30464. func (e *htmlStrong) OnDrop(h EventHandler, scope ...any) HTMLStrong {
  30465. e.setEventHandler("drop", h, scope...)
  30466. return e
  30467. }
  30468. func (e *htmlStrong) OnFocus(h EventHandler, scope ...any) HTMLStrong {
  30469. e.setEventHandler("focus", h, scope...)
  30470. return e
  30471. }
  30472. func (e *htmlStrong) OnInput(h EventHandler, scope ...any) HTMLStrong {
  30473. e.setEventHandler("input", h, scope...)
  30474. return e
  30475. }
  30476. func (e *htmlStrong) OnInvalid(h EventHandler, scope ...any) HTMLStrong {
  30477. e.setEventHandler("invalid", h, scope...)
  30478. return e
  30479. }
  30480. func (e *htmlStrong) OnKeyDown(h EventHandler, scope ...any) HTMLStrong {
  30481. e.setEventHandler("keydown", h, scope...)
  30482. return e
  30483. }
  30484. func (e *htmlStrong) OnKeyPress(h EventHandler, scope ...any) HTMLStrong {
  30485. e.setEventHandler("keypress", h, scope...)
  30486. return e
  30487. }
  30488. func (e *htmlStrong) OnKeyUp(h EventHandler, scope ...any) HTMLStrong {
  30489. e.setEventHandler("keyup", h, scope...)
  30490. return e
  30491. }
  30492. func (e *htmlStrong) OnMouseDown(h EventHandler, scope ...any) HTMLStrong {
  30493. e.setEventHandler("mousedown", h, scope...)
  30494. return e
  30495. }
  30496. func (e *htmlStrong) OnMouseMove(h EventHandler, scope ...any) HTMLStrong {
  30497. e.setEventHandler("mousemove", h, scope...)
  30498. return e
  30499. }
  30500. func (e *htmlStrong) OnMouseOut(h EventHandler, scope ...any) HTMLStrong {
  30501. e.setEventHandler("mouseout", h, scope...)
  30502. return e
  30503. }
  30504. func (e *htmlStrong) OnMouseOver(h EventHandler, scope ...any) HTMLStrong {
  30505. e.setEventHandler("mouseover", h, scope...)
  30506. return e
  30507. }
  30508. func (e *htmlStrong) OnMouseUp(h EventHandler, scope ...any) HTMLStrong {
  30509. e.setEventHandler("mouseup", h, scope...)
  30510. return e
  30511. }
  30512. func (e *htmlStrong) OnPaste(h EventHandler, scope ...any) HTMLStrong {
  30513. e.setEventHandler("paste", h, scope...)
  30514. return e
  30515. }
  30516. func (e *htmlStrong) OnReset(h EventHandler, scope ...any) HTMLStrong {
  30517. e.setEventHandler("reset", h, scope...)
  30518. return e
  30519. }
  30520. func (e *htmlStrong) OnScroll(h EventHandler, scope ...any) HTMLStrong {
  30521. e.setEventHandler("scroll", h, scope...)
  30522. return e
  30523. }
  30524. func (e *htmlStrong) OnSearch(h EventHandler, scope ...any) HTMLStrong {
  30525. e.setEventHandler("search", h, scope...)
  30526. return e
  30527. }
  30528. func (e *htmlStrong) OnSelect(h EventHandler, scope ...any) HTMLStrong {
  30529. e.setEventHandler("select", h, scope...)
  30530. return e
  30531. }
  30532. func (e *htmlStrong) OnSubmit(h EventHandler, scope ...any) HTMLStrong {
  30533. e.setEventHandler("submit", h, scope...)
  30534. return e
  30535. }
  30536. func (e *htmlStrong) OnWheel(h EventHandler, scope ...any) HTMLStrong {
  30537. e.setEventHandler("wheel", h, scope...)
  30538. return e
  30539. }
  30540. // HTMLStyle is the interface that describes a "style" HTML element.
  30541. type HTMLStyle interface {
  30542. UI
  30543. // Body set the content of the element.
  30544. Body(elems ...UI) HTMLStyle
  30545. // Text sets the content of the element with a text node containing the stringified given value.
  30546. Text(v any) HTMLStyle
  30547. // AccessKey specifies a shortcut key to activate/focus an element.
  30548. AccessKey(v string) HTMLStyle
  30549. // Aria stores accessible rich internet applications (ARIA) data.
  30550. Aria(k string, v any) HTMLStyle
  30551. // Attr sets the named attribute with the given value.
  30552. Attr(n string, v any) HTMLStyle
  30553. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  30554. Class(v ...string) HTMLStyle
  30555. // ContentEditable specifies whether the content of an element is editable or not.
  30556. ContentEditable(v bool) HTMLStyle
  30557. // DataSet stores custom data private to the page or application.
  30558. DataSet(k string, v any) HTMLStyle
  30559. // Dir specifies the text direction for the content in an element.
  30560. Dir(v string) HTMLStyle
  30561. // Draggable specifies whether an element is draggable or not.
  30562. Draggable(v bool) HTMLStyle
  30563. // Hidden specifies that an element is not yet, or is no longer relevant.
  30564. Hidden(v bool) HTMLStyle
  30565. // ID specifies a unique id for an element.
  30566. ID(v string) HTMLStyle
  30567. // Lang specifies the language of the element's content.
  30568. Lang(v string) HTMLStyle
  30569. // Media specifies what media/device the linked document is optimized for.
  30570. Media(v string) HTMLStyle
  30571. // Role specifies to parsing software the exact function of an element (and its children).
  30572. Role(v string) HTMLStyle
  30573. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  30574. Spellcheck(v bool) HTMLStyle
  30575. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  30576. Style(k, v string) HTMLStyle
  30577. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  30578. Styles(s map[string]string) HTMLStyle
  30579. // TabIndex specifies the tabbing order of an element.
  30580. TabIndex(v int) HTMLStyle
  30581. // Title specifies extra information about an element.
  30582. Title(v string) HTMLStyle
  30583. // Type specifies the type of element.
  30584. Type(v string) HTMLStyle
  30585. // On registers the given event handler to the specified event.
  30586. On(event string, h EventHandler, scope ...any) HTMLStyle
  30587. // OnBlur calls the given handler when the element loses focus.
  30588. OnBlur(h EventHandler, scope ...any) HTMLStyle
  30589. // OnChange calls the given handler when the value of the element is changed.
  30590. OnChange(h EventHandler, scope ...any) HTMLStyle
  30591. // OnClick calls the given handler when there is a mouse click on the element.
  30592. OnClick(h EventHandler, scope ...any) HTMLStyle
  30593. // OnContextMenu calls the given handler when a context menu is triggered.
  30594. OnContextMenu(h EventHandler, scope ...any) HTMLStyle
  30595. // OnCopy calls the given handler when the user copies the content of an element.
  30596. OnCopy(h EventHandler, scope ...any) HTMLStyle
  30597. // OnCut calls the given handler when the user cuts the content of an element.
  30598. OnCut(h EventHandler, scope ...any) HTMLStyle
  30599. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  30600. OnDblClick(h EventHandler, scope ...any) HTMLStyle
  30601. // OnDrag calls the given handler when an element is dragged.
  30602. OnDrag(h EventHandler, scope ...any) HTMLStyle
  30603. // OnDragEnd calls the given handler at the end of a drag operation.
  30604. OnDragEnd(h EventHandler, scope ...any) HTMLStyle
  30605. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  30606. OnDragEnter(h EventHandler, scope ...any) HTMLStyle
  30607. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  30608. OnDragLeave(h EventHandler, scope ...any) HTMLStyle
  30609. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  30610. OnDragOver(h EventHandler, scope ...any) HTMLStyle
  30611. // OnDragStart calls the given handler at the start of a drag operation.
  30612. OnDragStart(h EventHandler, scope ...any) HTMLStyle
  30613. // OnDrop calls the given handler when dragged element is being dropped.
  30614. OnDrop(h EventHandler, scope ...any) HTMLStyle
  30615. // OnFocus calls the given handler when the element gets focus.
  30616. OnFocus(h EventHandler, scope ...any) HTMLStyle
  30617. // OnInput calls the given handler when an element gets user input.
  30618. OnInput(h EventHandler, scope ...any) HTMLStyle
  30619. // OnInvalid calls the given handler when an element is invalid.
  30620. OnInvalid(h EventHandler, scope ...any) HTMLStyle
  30621. // OnKeyDown calls the given handler when a user is pressing a key.
  30622. OnKeyDown(h EventHandler, scope ...any) HTMLStyle
  30623. // OnKeyPress calls the given handler when a user presses a key.
  30624. OnKeyPress(h EventHandler, scope ...any) HTMLStyle
  30625. // OnKeyUp calls the given handler when a user releases a key.
  30626. OnKeyUp(h EventHandler, scope ...any) HTMLStyle
  30627. // OnLoad calls the given handler after the element is finished loading.
  30628. OnLoad(h EventHandler, scope ...any) HTMLStyle
  30629. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  30630. OnMouseDown(h EventHandler, scope ...any) HTMLStyle
  30631. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  30632. OnMouseMove(h EventHandler, scope ...any) HTMLStyle
  30633. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  30634. OnMouseOut(h EventHandler, scope ...any) HTMLStyle
  30635. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  30636. OnMouseOver(h EventHandler, scope ...any) HTMLStyle
  30637. // OnMouseUp calls the given handler when a mouse button is released over an element.
  30638. OnMouseUp(h EventHandler, scope ...any) HTMLStyle
  30639. // OnPaste calls the given handler when the user pastes some content in an element.
  30640. OnPaste(h EventHandler, scope ...any) HTMLStyle
  30641. // OnReset calls the given handler when the Reset button in a form is clicked.
  30642. OnReset(h EventHandler, scope ...any) HTMLStyle
  30643. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  30644. OnScroll(h EventHandler, scope ...any) HTMLStyle
  30645. // OnSearch calls the given handler when the user writes something in a search field.
  30646. OnSearch(h EventHandler, scope ...any) HTMLStyle
  30647. // OnSelect calls the given handler after some text has been selected in an element.
  30648. OnSelect(h EventHandler, scope ...any) HTMLStyle
  30649. // OnSubmit calls the given handler when a form is submitted.
  30650. OnSubmit(h EventHandler, scope ...any) HTMLStyle
  30651. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  30652. OnWheel(h EventHandler, scope ...any) HTMLStyle
  30653. }
  30654. // Style returns an HTML element that defines style information for a document.
  30655. func Style() HTMLStyle {
  30656. e := &htmlStyle{
  30657. htmlElement: htmlElement{
  30658. tag: "style",
  30659. isSelfClosing: false,
  30660. },
  30661. }
  30662. return e
  30663. }
  30664. type htmlStyle struct {
  30665. htmlElement
  30666. }
  30667. func (e *htmlStyle) Body(v ...UI) HTMLStyle {
  30668. e.setChildren(v...)
  30669. return e
  30670. }
  30671. func (e *htmlStyle) Text(v any) HTMLStyle {
  30672. return e.Body(Text(v))
  30673. }
  30674. func (e *htmlStyle) AccessKey(v string) HTMLStyle {
  30675. e.setAttr("accesskey", v)
  30676. return e
  30677. }
  30678. func (e *htmlStyle) Aria(k string, v any) HTMLStyle {
  30679. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  30680. return e
  30681. }
  30682. func (e *htmlStyle) Attr(n string, v any) HTMLStyle {
  30683. e.setAttr(n, v)
  30684. return e
  30685. }
  30686. func (e *htmlStyle) Class(v ...string) HTMLStyle {
  30687. e.setAttr("class", strings.Join(v, " "))
  30688. return e
  30689. }
  30690. func (e *htmlStyle) ContentEditable(v bool) HTMLStyle {
  30691. e.setAttr("contenteditable", v)
  30692. return e
  30693. }
  30694. func (e *htmlStyle) DataSet(k string, v any) HTMLStyle {
  30695. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  30696. return e
  30697. }
  30698. func (e *htmlStyle) Dir(v string) HTMLStyle {
  30699. e.setAttr("dir", v)
  30700. return e
  30701. }
  30702. func (e *htmlStyle) Draggable(v bool) HTMLStyle {
  30703. e.setAttr("draggable", v)
  30704. return e
  30705. }
  30706. func (e *htmlStyle) Hidden(v bool) HTMLStyle {
  30707. e.setAttr("hidden", v)
  30708. return e
  30709. }
  30710. func (e *htmlStyle) ID(v string) HTMLStyle {
  30711. e.setAttr("id", v)
  30712. return e
  30713. }
  30714. func (e *htmlStyle) Lang(v string) HTMLStyle {
  30715. e.setAttr("lang", v)
  30716. return e
  30717. }
  30718. func (e *htmlStyle) Media(v string) HTMLStyle {
  30719. e.setAttr("media", v)
  30720. return e
  30721. }
  30722. func (e *htmlStyle) Role(v string) HTMLStyle {
  30723. e.setAttr("role", v)
  30724. return e
  30725. }
  30726. func (e *htmlStyle) Spellcheck(v bool) HTMLStyle {
  30727. s := "false"
  30728. if v {
  30729. s = "true"
  30730. }
  30731. e.setAttr("spellcheck", s)
  30732. return e
  30733. }
  30734. func (e *htmlStyle) Style(k, v string) HTMLStyle {
  30735. e.setAttr("style", k+":"+v)
  30736. return e
  30737. }
  30738. func (e *htmlStyle) Styles(s map[string]string) HTMLStyle {
  30739. for k, v := range s {
  30740. e.Style(k, v)
  30741. }
  30742. return e
  30743. }
  30744. func (e *htmlStyle) TabIndex(v int) HTMLStyle {
  30745. e.setAttr("tabindex", v)
  30746. return e
  30747. }
  30748. func (e *htmlStyle) Title(v string) HTMLStyle {
  30749. e.setAttr("title", v)
  30750. return e
  30751. }
  30752. func (e *htmlStyle) Type(v string) HTMLStyle {
  30753. e.setAttr("type", v)
  30754. return e
  30755. }
  30756. func (e *htmlStyle) On(event string, h EventHandler, scope ...any) HTMLStyle {
  30757. e.setEventHandler(event, h, scope...)
  30758. return e
  30759. }
  30760. func (e *htmlStyle) OnBlur(h EventHandler, scope ...any) HTMLStyle {
  30761. e.setEventHandler("blur", h, scope...)
  30762. return e
  30763. }
  30764. func (e *htmlStyle) OnChange(h EventHandler, scope ...any) HTMLStyle {
  30765. e.setEventHandler("change", h, scope...)
  30766. return e
  30767. }
  30768. func (e *htmlStyle) OnClick(h EventHandler, scope ...any) HTMLStyle {
  30769. e.setEventHandler("click", h, scope...)
  30770. return e
  30771. }
  30772. func (e *htmlStyle) OnContextMenu(h EventHandler, scope ...any) HTMLStyle {
  30773. e.setEventHandler("contextmenu", h, scope...)
  30774. return e
  30775. }
  30776. func (e *htmlStyle) OnCopy(h EventHandler, scope ...any) HTMLStyle {
  30777. e.setEventHandler("copy", h, scope...)
  30778. return e
  30779. }
  30780. func (e *htmlStyle) OnCut(h EventHandler, scope ...any) HTMLStyle {
  30781. e.setEventHandler("cut", h, scope...)
  30782. return e
  30783. }
  30784. func (e *htmlStyle) OnDblClick(h EventHandler, scope ...any) HTMLStyle {
  30785. e.setEventHandler("dblclick", h, scope...)
  30786. return e
  30787. }
  30788. func (e *htmlStyle) OnDrag(h EventHandler, scope ...any) HTMLStyle {
  30789. e.setEventHandler("drag", h, scope...)
  30790. return e
  30791. }
  30792. func (e *htmlStyle) OnDragEnd(h EventHandler, scope ...any) HTMLStyle {
  30793. e.setEventHandler("dragend", h, scope...)
  30794. return e
  30795. }
  30796. func (e *htmlStyle) OnDragEnter(h EventHandler, scope ...any) HTMLStyle {
  30797. e.setEventHandler("dragenter", h, scope...)
  30798. return e
  30799. }
  30800. func (e *htmlStyle) OnDragLeave(h EventHandler, scope ...any) HTMLStyle {
  30801. e.setEventHandler("dragleave", h, scope...)
  30802. return e
  30803. }
  30804. func (e *htmlStyle) OnDragOver(h EventHandler, scope ...any) HTMLStyle {
  30805. e.setEventHandler("dragover", h, scope...)
  30806. return e
  30807. }
  30808. func (e *htmlStyle) OnDragStart(h EventHandler, scope ...any) HTMLStyle {
  30809. e.setEventHandler("dragstart", h, scope...)
  30810. return e
  30811. }
  30812. func (e *htmlStyle) OnDrop(h EventHandler, scope ...any) HTMLStyle {
  30813. e.setEventHandler("drop", h, scope...)
  30814. return e
  30815. }
  30816. func (e *htmlStyle) OnFocus(h EventHandler, scope ...any) HTMLStyle {
  30817. e.setEventHandler("focus", h, scope...)
  30818. return e
  30819. }
  30820. func (e *htmlStyle) OnInput(h EventHandler, scope ...any) HTMLStyle {
  30821. e.setEventHandler("input", h, scope...)
  30822. return e
  30823. }
  30824. func (e *htmlStyle) OnInvalid(h EventHandler, scope ...any) HTMLStyle {
  30825. e.setEventHandler("invalid", h, scope...)
  30826. return e
  30827. }
  30828. func (e *htmlStyle) OnKeyDown(h EventHandler, scope ...any) HTMLStyle {
  30829. e.setEventHandler("keydown", h, scope...)
  30830. return e
  30831. }
  30832. func (e *htmlStyle) OnKeyPress(h EventHandler, scope ...any) HTMLStyle {
  30833. e.setEventHandler("keypress", h, scope...)
  30834. return e
  30835. }
  30836. func (e *htmlStyle) OnKeyUp(h EventHandler, scope ...any) HTMLStyle {
  30837. e.setEventHandler("keyup", h, scope...)
  30838. return e
  30839. }
  30840. func (e *htmlStyle) OnLoad(h EventHandler, scope ...any) HTMLStyle {
  30841. e.setEventHandler("load", h, scope...)
  30842. return e
  30843. }
  30844. func (e *htmlStyle) OnMouseDown(h EventHandler, scope ...any) HTMLStyle {
  30845. e.setEventHandler("mousedown", h, scope...)
  30846. return e
  30847. }
  30848. func (e *htmlStyle) OnMouseMove(h EventHandler, scope ...any) HTMLStyle {
  30849. e.setEventHandler("mousemove", h, scope...)
  30850. return e
  30851. }
  30852. func (e *htmlStyle) OnMouseOut(h EventHandler, scope ...any) HTMLStyle {
  30853. e.setEventHandler("mouseout", h, scope...)
  30854. return e
  30855. }
  30856. func (e *htmlStyle) OnMouseOver(h EventHandler, scope ...any) HTMLStyle {
  30857. e.setEventHandler("mouseover", h, scope...)
  30858. return e
  30859. }
  30860. func (e *htmlStyle) OnMouseUp(h EventHandler, scope ...any) HTMLStyle {
  30861. e.setEventHandler("mouseup", h, scope...)
  30862. return e
  30863. }
  30864. func (e *htmlStyle) OnPaste(h EventHandler, scope ...any) HTMLStyle {
  30865. e.setEventHandler("paste", h, scope...)
  30866. return e
  30867. }
  30868. func (e *htmlStyle) OnReset(h EventHandler, scope ...any) HTMLStyle {
  30869. e.setEventHandler("reset", h, scope...)
  30870. return e
  30871. }
  30872. func (e *htmlStyle) OnScroll(h EventHandler, scope ...any) HTMLStyle {
  30873. e.setEventHandler("scroll", h, scope...)
  30874. return e
  30875. }
  30876. func (e *htmlStyle) OnSearch(h EventHandler, scope ...any) HTMLStyle {
  30877. e.setEventHandler("search", h, scope...)
  30878. return e
  30879. }
  30880. func (e *htmlStyle) OnSelect(h EventHandler, scope ...any) HTMLStyle {
  30881. e.setEventHandler("select", h, scope...)
  30882. return e
  30883. }
  30884. func (e *htmlStyle) OnSubmit(h EventHandler, scope ...any) HTMLStyle {
  30885. e.setEventHandler("submit", h, scope...)
  30886. return e
  30887. }
  30888. func (e *htmlStyle) OnWheel(h EventHandler, scope ...any) HTMLStyle {
  30889. e.setEventHandler("wheel", h, scope...)
  30890. return e
  30891. }
  30892. // HTMLSub is the interface that describes a "sub" HTML element.
  30893. type HTMLSub interface {
  30894. UI
  30895. // Body set the content of the element.
  30896. Body(elems ...UI) HTMLSub
  30897. // Text sets the content of the element with a text node containing the stringified given value.
  30898. Text(v any) HTMLSub
  30899. // AccessKey specifies a shortcut key to activate/focus an element.
  30900. AccessKey(v string) HTMLSub
  30901. // Aria stores accessible rich internet applications (ARIA) data.
  30902. Aria(k string, v any) HTMLSub
  30903. // Attr sets the named attribute with the given value.
  30904. Attr(n string, v any) HTMLSub
  30905. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  30906. Class(v ...string) HTMLSub
  30907. // ContentEditable specifies whether the content of an element is editable or not.
  30908. ContentEditable(v bool) HTMLSub
  30909. // DataSet stores custom data private to the page or application.
  30910. DataSet(k string, v any) HTMLSub
  30911. // Dir specifies the text direction for the content in an element.
  30912. Dir(v string) HTMLSub
  30913. // Draggable specifies whether an element is draggable or not.
  30914. Draggable(v bool) HTMLSub
  30915. // Hidden specifies that an element is not yet, or is no longer relevant.
  30916. Hidden(v bool) HTMLSub
  30917. // ID specifies a unique id for an element.
  30918. ID(v string) HTMLSub
  30919. // Lang specifies the language of the element's content.
  30920. Lang(v string) HTMLSub
  30921. // Role specifies to parsing software the exact function of an element (and its children).
  30922. Role(v string) HTMLSub
  30923. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  30924. Spellcheck(v bool) HTMLSub
  30925. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  30926. Style(k, v string) HTMLSub
  30927. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  30928. Styles(s map[string]string) HTMLSub
  30929. // TabIndex specifies the tabbing order of an element.
  30930. TabIndex(v int) HTMLSub
  30931. // Title specifies extra information about an element.
  30932. Title(v string) HTMLSub
  30933. // On registers the given event handler to the specified event.
  30934. On(event string, h EventHandler, scope ...any) HTMLSub
  30935. // OnBlur calls the given handler when the element loses focus.
  30936. OnBlur(h EventHandler, scope ...any) HTMLSub
  30937. // OnChange calls the given handler when the value of the element is changed.
  30938. OnChange(h EventHandler, scope ...any) HTMLSub
  30939. // OnClick calls the given handler when there is a mouse click on the element.
  30940. OnClick(h EventHandler, scope ...any) HTMLSub
  30941. // OnContextMenu calls the given handler when a context menu is triggered.
  30942. OnContextMenu(h EventHandler, scope ...any) HTMLSub
  30943. // OnCopy calls the given handler when the user copies the content of an element.
  30944. OnCopy(h EventHandler, scope ...any) HTMLSub
  30945. // OnCut calls the given handler when the user cuts the content of an element.
  30946. OnCut(h EventHandler, scope ...any) HTMLSub
  30947. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  30948. OnDblClick(h EventHandler, scope ...any) HTMLSub
  30949. // OnDrag calls the given handler when an element is dragged.
  30950. OnDrag(h EventHandler, scope ...any) HTMLSub
  30951. // OnDragEnd calls the given handler at the end of a drag operation.
  30952. OnDragEnd(h EventHandler, scope ...any) HTMLSub
  30953. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  30954. OnDragEnter(h EventHandler, scope ...any) HTMLSub
  30955. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  30956. OnDragLeave(h EventHandler, scope ...any) HTMLSub
  30957. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  30958. OnDragOver(h EventHandler, scope ...any) HTMLSub
  30959. // OnDragStart calls the given handler at the start of a drag operation.
  30960. OnDragStart(h EventHandler, scope ...any) HTMLSub
  30961. // OnDrop calls the given handler when dragged element is being dropped.
  30962. OnDrop(h EventHandler, scope ...any) HTMLSub
  30963. // OnFocus calls the given handler when the element gets focus.
  30964. OnFocus(h EventHandler, scope ...any) HTMLSub
  30965. // OnInput calls the given handler when an element gets user input.
  30966. OnInput(h EventHandler, scope ...any) HTMLSub
  30967. // OnInvalid calls the given handler when an element is invalid.
  30968. OnInvalid(h EventHandler, scope ...any) HTMLSub
  30969. // OnKeyDown calls the given handler when a user is pressing a key.
  30970. OnKeyDown(h EventHandler, scope ...any) HTMLSub
  30971. // OnKeyPress calls the given handler when a user presses a key.
  30972. OnKeyPress(h EventHandler, scope ...any) HTMLSub
  30973. // OnKeyUp calls the given handler when a user releases a key.
  30974. OnKeyUp(h EventHandler, scope ...any) HTMLSub
  30975. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  30976. OnMouseDown(h EventHandler, scope ...any) HTMLSub
  30977. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  30978. OnMouseMove(h EventHandler, scope ...any) HTMLSub
  30979. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  30980. OnMouseOut(h EventHandler, scope ...any) HTMLSub
  30981. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  30982. OnMouseOver(h EventHandler, scope ...any) HTMLSub
  30983. // OnMouseUp calls the given handler when a mouse button is released over an element.
  30984. OnMouseUp(h EventHandler, scope ...any) HTMLSub
  30985. // OnPaste calls the given handler when the user pastes some content in an element.
  30986. OnPaste(h EventHandler, scope ...any) HTMLSub
  30987. // OnReset calls the given handler when the Reset button in a form is clicked.
  30988. OnReset(h EventHandler, scope ...any) HTMLSub
  30989. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  30990. OnScroll(h EventHandler, scope ...any) HTMLSub
  30991. // OnSearch calls the given handler when the user writes something in a search field.
  30992. OnSearch(h EventHandler, scope ...any) HTMLSub
  30993. // OnSelect calls the given handler after some text has been selected in an element.
  30994. OnSelect(h EventHandler, scope ...any) HTMLSub
  30995. // OnSubmit calls the given handler when a form is submitted.
  30996. OnSubmit(h EventHandler, scope ...any) HTMLSub
  30997. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  30998. OnWheel(h EventHandler, scope ...any) HTMLSub
  30999. }
  31000. // Sub returns an HTML element that defines subscripted text.
  31001. func Sub() HTMLSub {
  31002. e := &htmlSub{
  31003. htmlElement: htmlElement{
  31004. tag: "sub",
  31005. isSelfClosing: false,
  31006. },
  31007. }
  31008. return e
  31009. }
  31010. type htmlSub struct {
  31011. htmlElement
  31012. }
  31013. func (e *htmlSub) Body(v ...UI) HTMLSub {
  31014. e.setChildren(v...)
  31015. return e
  31016. }
  31017. func (e *htmlSub) Text(v any) HTMLSub {
  31018. return e.Body(Text(v))
  31019. }
  31020. func (e *htmlSub) AccessKey(v string) HTMLSub {
  31021. e.setAttr("accesskey", v)
  31022. return e
  31023. }
  31024. func (e *htmlSub) Aria(k string, v any) HTMLSub {
  31025. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  31026. return e
  31027. }
  31028. func (e *htmlSub) Attr(n string, v any) HTMLSub {
  31029. e.setAttr(n, v)
  31030. return e
  31031. }
  31032. func (e *htmlSub) Class(v ...string) HTMLSub {
  31033. e.setAttr("class", strings.Join(v, " "))
  31034. return e
  31035. }
  31036. func (e *htmlSub) ContentEditable(v bool) HTMLSub {
  31037. e.setAttr("contenteditable", v)
  31038. return e
  31039. }
  31040. func (e *htmlSub) DataSet(k string, v any) HTMLSub {
  31041. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  31042. return e
  31043. }
  31044. func (e *htmlSub) Dir(v string) HTMLSub {
  31045. e.setAttr("dir", v)
  31046. return e
  31047. }
  31048. func (e *htmlSub) Draggable(v bool) HTMLSub {
  31049. e.setAttr("draggable", v)
  31050. return e
  31051. }
  31052. func (e *htmlSub) Hidden(v bool) HTMLSub {
  31053. e.setAttr("hidden", v)
  31054. return e
  31055. }
  31056. func (e *htmlSub) ID(v string) HTMLSub {
  31057. e.setAttr("id", v)
  31058. return e
  31059. }
  31060. func (e *htmlSub) Lang(v string) HTMLSub {
  31061. e.setAttr("lang", v)
  31062. return e
  31063. }
  31064. func (e *htmlSub) Role(v string) HTMLSub {
  31065. e.setAttr("role", v)
  31066. return e
  31067. }
  31068. func (e *htmlSub) Spellcheck(v bool) HTMLSub {
  31069. s := "false"
  31070. if v {
  31071. s = "true"
  31072. }
  31073. e.setAttr("spellcheck", s)
  31074. return e
  31075. }
  31076. func (e *htmlSub) Style(k, v string) HTMLSub {
  31077. e.setAttr("style", k+":"+v)
  31078. return e
  31079. }
  31080. func (e *htmlSub) Styles(s map[string]string) HTMLSub {
  31081. for k, v := range s {
  31082. e.Style(k, v)
  31083. }
  31084. return e
  31085. }
  31086. func (e *htmlSub) TabIndex(v int) HTMLSub {
  31087. e.setAttr("tabindex", v)
  31088. return e
  31089. }
  31090. func (e *htmlSub) Title(v string) HTMLSub {
  31091. e.setAttr("title", v)
  31092. return e
  31093. }
  31094. func (e *htmlSub) On(event string, h EventHandler, scope ...any) HTMLSub {
  31095. e.setEventHandler(event, h, scope...)
  31096. return e
  31097. }
  31098. func (e *htmlSub) OnBlur(h EventHandler, scope ...any) HTMLSub {
  31099. e.setEventHandler("blur", h, scope...)
  31100. return e
  31101. }
  31102. func (e *htmlSub) OnChange(h EventHandler, scope ...any) HTMLSub {
  31103. e.setEventHandler("change", h, scope...)
  31104. return e
  31105. }
  31106. func (e *htmlSub) OnClick(h EventHandler, scope ...any) HTMLSub {
  31107. e.setEventHandler("click", h, scope...)
  31108. return e
  31109. }
  31110. func (e *htmlSub) OnContextMenu(h EventHandler, scope ...any) HTMLSub {
  31111. e.setEventHandler("contextmenu", h, scope...)
  31112. return e
  31113. }
  31114. func (e *htmlSub) OnCopy(h EventHandler, scope ...any) HTMLSub {
  31115. e.setEventHandler("copy", h, scope...)
  31116. return e
  31117. }
  31118. func (e *htmlSub) OnCut(h EventHandler, scope ...any) HTMLSub {
  31119. e.setEventHandler("cut", h, scope...)
  31120. return e
  31121. }
  31122. func (e *htmlSub) OnDblClick(h EventHandler, scope ...any) HTMLSub {
  31123. e.setEventHandler("dblclick", h, scope...)
  31124. return e
  31125. }
  31126. func (e *htmlSub) OnDrag(h EventHandler, scope ...any) HTMLSub {
  31127. e.setEventHandler("drag", h, scope...)
  31128. return e
  31129. }
  31130. func (e *htmlSub) OnDragEnd(h EventHandler, scope ...any) HTMLSub {
  31131. e.setEventHandler("dragend", h, scope...)
  31132. return e
  31133. }
  31134. func (e *htmlSub) OnDragEnter(h EventHandler, scope ...any) HTMLSub {
  31135. e.setEventHandler("dragenter", h, scope...)
  31136. return e
  31137. }
  31138. func (e *htmlSub) OnDragLeave(h EventHandler, scope ...any) HTMLSub {
  31139. e.setEventHandler("dragleave", h, scope...)
  31140. return e
  31141. }
  31142. func (e *htmlSub) OnDragOver(h EventHandler, scope ...any) HTMLSub {
  31143. e.setEventHandler("dragover", h, scope...)
  31144. return e
  31145. }
  31146. func (e *htmlSub) OnDragStart(h EventHandler, scope ...any) HTMLSub {
  31147. e.setEventHandler("dragstart", h, scope...)
  31148. return e
  31149. }
  31150. func (e *htmlSub) OnDrop(h EventHandler, scope ...any) HTMLSub {
  31151. e.setEventHandler("drop", h, scope...)
  31152. return e
  31153. }
  31154. func (e *htmlSub) OnFocus(h EventHandler, scope ...any) HTMLSub {
  31155. e.setEventHandler("focus", h, scope...)
  31156. return e
  31157. }
  31158. func (e *htmlSub) OnInput(h EventHandler, scope ...any) HTMLSub {
  31159. e.setEventHandler("input", h, scope...)
  31160. return e
  31161. }
  31162. func (e *htmlSub) OnInvalid(h EventHandler, scope ...any) HTMLSub {
  31163. e.setEventHandler("invalid", h, scope...)
  31164. return e
  31165. }
  31166. func (e *htmlSub) OnKeyDown(h EventHandler, scope ...any) HTMLSub {
  31167. e.setEventHandler("keydown", h, scope...)
  31168. return e
  31169. }
  31170. func (e *htmlSub) OnKeyPress(h EventHandler, scope ...any) HTMLSub {
  31171. e.setEventHandler("keypress", h, scope...)
  31172. return e
  31173. }
  31174. func (e *htmlSub) OnKeyUp(h EventHandler, scope ...any) HTMLSub {
  31175. e.setEventHandler("keyup", h, scope...)
  31176. return e
  31177. }
  31178. func (e *htmlSub) OnMouseDown(h EventHandler, scope ...any) HTMLSub {
  31179. e.setEventHandler("mousedown", h, scope...)
  31180. return e
  31181. }
  31182. func (e *htmlSub) OnMouseMove(h EventHandler, scope ...any) HTMLSub {
  31183. e.setEventHandler("mousemove", h, scope...)
  31184. return e
  31185. }
  31186. func (e *htmlSub) OnMouseOut(h EventHandler, scope ...any) HTMLSub {
  31187. e.setEventHandler("mouseout", h, scope...)
  31188. return e
  31189. }
  31190. func (e *htmlSub) OnMouseOver(h EventHandler, scope ...any) HTMLSub {
  31191. e.setEventHandler("mouseover", h, scope...)
  31192. return e
  31193. }
  31194. func (e *htmlSub) OnMouseUp(h EventHandler, scope ...any) HTMLSub {
  31195. e.setEventHandler("mouseup", h, scope...)
  31196. return e
  31197. }
  31198. func (e *htmlSub) OnPaste(h EventHandler, scope ...any) HTMLSub {
  31199. e.setEventHandler("paste", h, scope...)
  31200. return e
  31201. }
  31202. func (e *htmlSub) OnReset(h EventHandler, scope ...any) HTMLSub {
  31203. e.setEventHandler("reset", h, scope...)
  31204. return e
  31205. }
  31206. func (e *htmlSub) OnScroll(h EventHandler, scope ...any) HTMLSub {
  31207. e.setEventHandler("scroll", h, scope...)
  31208. return e
  31209. }
  31210. func (e *htmlSub) OnSearch(h EventHandler, scope ...any) HTMLSub {
  31211. e.setEventHandler("search", h, scope...)
  31212. return e
  31213. }
  31214. func (e *htmlSub) OnSelect(h EventHandler, scope ...any) HTMLSub {
  31215. e.setEventHandler("select", h, scope...)
  31216. return e
  31217. }
  31218. func (e *htmlSub) OnSubmit(h EventHandler, scope ...any) HTMLSub {
  31219. e.setEventHandler("submit", h, scope...)
  31220. return e
  31221. }
  31222. func (e *htmlSub) OnWheel(h EventHandler, scope ...any) HTMLSub {
  31223. e.setEventHandler("wheel", h, scope...)
  31224. return e
  31225. }
  31226. // HTMLSummary is the interface that describes a "summary" HTML element.
  31227. type HTMLSummary interface {
  31228. UI
  31229. // Body set the content of the element.
  31230. Body(elems ...UI) HTMLSummary
  31231. // Text sets the content of the element with a text node containing the stringified given value.
  31232. Text(v any) HTMLSummary
  31233. // AccessKey specifies a shortcut key to activate/focus an element.
  31234. AccessKey(v string) HTMLSummary
  31235. // Aria stores accessible rich internet applications (ARIA) data.
  31236. Aria(k string, v any) HTMLSummary
  31237. // Attr sets the named attribute with the given value.
  31238. Attr(n string, v any) HTMLSummary
  31239. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  31240. Class(v ...string) HTMLSummary
  31241. // ContentEditable specifies whether the content of an element is editable or not.
  31242. ContentEditable(v bool) HTMLSummary
  31243. // DataSet stores custom data private to the page or application.
  31244. DataSet(k string, v any) HTMLSummary
  31245. // Dir specifies the text direction for the content in an element.
  31246. Dir(v string) HTMLSummary
  31247. // Draggable specifies whether an element is draggable or not.
  31248. Draggable(v bool) HTMLSummary
  31249. // Hidden specifies that an element is not yet, or is no longer relevant.
  31250. Hidden(v bool) HTMLSummary
  31251. // ID specifies a unique id for an element.
  31252. ID(v string) HTMLSummary
  31253. // Lang specifies the language of the element's content.
  31254. Lang(v string) HTMLSummary
  31255. // Role specifies to parsing software the exact function of an element (and its children).
  31256. Role(v string) HTMLSummary
  31257. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  31258. Spellcheck(v bool) HTMLSummary
  31259. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  31260. Style(k, v string) HTMLSummary
  31261. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  31262. Styles(s map[string]string) HTMLSummary
  31263. // TabIndex specifies the tabbing order of an element.
  31264. TabIndex(v int) HTMLSummary
  31265. // Title specifies extra information about an element.
  31266. Title(v string) HTMLSummary
  31267. // On registers the given event handler to the specified event.
  31268. On(event string, h EventHandler, scope ...any) HTMLSummary
  31269. // OnBlur calls the given handler when the element loses focus.
  31270. OnBlur(h EventHandler, scope ...any) HTMLSummary
  31271. // OnChange calls the given handler when the value of the element is changed.
  31272. OnChange(h EventHandler, scope ...any) HTMLSummary
  31273. // OnClick calls the given handler when there is a mouse click on the element.
  31274. OnClick(h EventHandler, scope ...any) HTMLSummary
  31275. // OnContextMenu calls the given handler when a context menu is triggered.
  31276. OnContextMenu(h EventHandler, scope ...any) HTMLSummary
  31277. // OnCopy calls the given handler when the user copies the content of an element.
  31278. OnCopy(h EventHandler, scope ...any) HTMLSummary
  31279. // OnCut calls the given handler when the user cuts the content of an element.
  31280. OnCut(h EventHandler, scope ...any) HTMLSummary
  31281. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  31282. OnDblClick(h EventHandler, scope ...any) HTMLSummary
  31283. // OnDrag calls the given handler when an element is dragged.
  31284. OnDrag(h EventHandler, scope ...any) HTMLSummary
  31285. // OnDragEnd calls the given handler at the end of a drag operation.
  31286. OnDragEnd(h EventHandler, scope ...any) HTMLSummary
  31287. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  31288. OnDragEnter(h EventHandler, scope ...any) HTMLSummary
  31289. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  31290. OnDragLeave(h EventHandler, scope ...any) HTMLSummary
  31291. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  31292. OnDragOver(h EventHandler, scope ...any) HTMLSummary
  31293. // OnDragStart calls the given handler at the start of a drag operation.
  31294. OnDragStart(h EventHandler, scope ...any) HTMLSummary
  31295. // OnDrop calls the given handler when dragged element is being dropped.
  31296. OnDrop(h EventHandler, scope ...any) HTMLSummary
  31297. // OnFocus calls the given handler when the element gets focus.
  31298. OnFocus(h EventHandler, scope ...any) HTMLSummary
  31299. // OnInput calls the given handler when an element gets user input.
  31300. OnInput(h EventHandler, scope ...any) HTMLSummary
  31301. // OnInvalid calls the given handler when an element is invalid.
  31302. OnInvalid(h EventHandler, scope ...any) HTMLSummary
  31303. // OnKeyDown calls the given handler when a user is pressing a key.
  31304. OnKeyDown(h EventHandler, scope ...any) HTMLSummary
  31305. // OnKeyPress calls the given handler when a user presses a key.
  31306. OnKeyPress(h EventHandler, scope ...any) HTMLSummary
  31307. // OnKeyUp calls the given handler when a user releases a key.
  31308. OnKeyUp(h EventHandler, scope ...any) HTMLSummary
  31309. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  31310. OnMouseDown(h EventHandler, scope ...any) HTMLSummary
  31311. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  31312. OnMouseMove(h EventHandler, scope ...any) HTMLSummary
  31313. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  31314. OnMouseOut(h EventHandler, scope ...any) HTMLSummary
  31315. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  31316. OnMouseOver(h EventHandler, scope ...any) HTMLSummary
  31317. // OnMouseUp calls the given handler when a mouse button is released over an element.
  31318. OnMouseUp(h EventHandler, scope ...any) HTMLSummary
  31319. // OnPaste calls the given handler when the user pastes some content in an element.
  31320. OnPaste(h EventHandler, scope ...any) HTMLSummary
  31321. // OnReset calls the given handler when the Reset button in a form is clicked.
  31322. OnReset(h EventHandler, scope ...any) HTMLSummary
  31323. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  31324. OnScroll(h EventHandler, scope ...any) HTMLSummary
  31325. // OnSearch calls the given handler when the user writes something in a search field.
  31326. OnSearch(h EventHandler, scope ...any) HTMLSummary
  31327. // OnSelect calls the given handler after some text has been selected in an element.
  31328. OnSelect(h EventHandler, scope ...any) HTMLSummary
  31329. // OnSubmit calls the given handler when a form is submitted.
  31330. OnSubmit(h EventHandler, scope ...any) HTMLSummary
  31331. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  31332. OnWheel(h EventHandler, scope ...any) HTMLSummary
  31333. }
  31334. // Summary returns an HTML element that defines a visible heading for a details element.
  31335. func Summary() HTMLSummary {
  31336. e := &htmlSummary{
  31337. htmlElement: htmlElement{
  31338. tag: "summary",
  31339. isSelfClosing: false,
  31340. },
  31341. }
  31342. return e
  31343. }
  31344. type htmlSummary struct {
  31345. htmlElement
  31346. }
  31347. func (e *htmlSummary) Body(v ...UI) HTMLSummary {
  31348. e.setChildren(v...)
  31349. return e
  31350. }
  31351. func (e *htmlSummary) Text(v any) HTMLSummary {
  31352. return e.Body(Text(v))
  31353. }
  31354. func (e *htmlSummary) AccessKey(v string) HTMLSummary {
  31355. e.setAttr("accesskey", v)
  31356. return e
  31357. }
  31358. func (e *htmlSummary) Aria(k string, v any) HTMLSummary {
  31359. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  31360. return e
  31361. }
  31362. func (e *htmlSummary) Attr(n string, v any) HTMLSummary {
  31363. e.setAttr(n, v)
  31364. return e
  31365. }
  31366. func (e *htmlSummary) Class(v ...string) HTMLSummary {
  31367. e.setAttr("class", strings.Join(v, " "))
  31368. return e
  31369. }
  31370. func (e *htmlSummary) ContentEditable(v bool) HTMLSummary {
  31371. e.setAttr("contenteditable", v)
  31372. return e
  31373. }
  31374. func (e *htmlSummary) DataSet(k string, v any) HTMLSummary {
  31375. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  31376. return e
  31377. }
  31378. func (e *htmlSummary) Dir(v string) HTMLSummary {
  31379. e.setAttr("dir", v)
  31380. return e
  31381. }
  31382. func (e *htmlSummary) Draggable(v bool) HTMLSummary {
  31383. e.setAttr("draggable", v)
  31384. return e
  31385. }
  31386. func (e *htmlSummary) Hidden(v bool) HTMLSummary {
  31387. e.setAttr("hidden", v)
  31388. return e
  31389. }
  31390. func (e *htmlSummary) ID(v string) HTMLSummary {
  31391. e.setAttr("id", v)
  31392. return e
  31393. }
  31394. func (e *htmlSummary) Lang(v string) HTMLSummary {
  31395. e.setAttr("lang", v)
  31396. return e
  31397. }
  31398. func (e *htmlSummary) Role(v string) HTMLSummary {
  31399. e.setAttr("role", v)
  31400. return e
  31401. }
  31402. func (e *htmlSummary) Spellcheck(v bool) HTMLSummary {
  31403. s := "false"
  31404. if v {
  31405. s = "true"
  31406. }
  31407. e.setAttr("spellcheck", s)
  31408. return e
  31409. }
  31410. func (e *htmlSummary) Style(k, v string) HTMLSummary {
  31411. e.setAttr("style", k+":"+v)
  31412. return e
  31413. }
  31414. func (e *htmlSummary) Styles(s map[string]string) HTMLSummary {
  31415. for k, v := range s {
  31416. e.Style(k, v)
  31417. }
  31418. return e
  31419. }
  31420. func (e *htmlSummary) TabIndex(v int) HTMLSummary {
  31421. e.setAttr("tabindex", v)
  31422. return e
  31423. }
  31424. func (e *htmlSummary) Title(v string) HTMLSummary {
  31425. e.setAttr("title", v)
  31426. return e
  31427. }
  31428. func (e *htmlSummary) On(event string, h EventHandler, scope ...any) HTMLSummary {
  31429. e.setEventHandler(event, h, scope...)
  31430. return e
  31431. }
  31432. func (e *htmlSummary) OnBlur(h EventHandler, scope ...any) HTMLSummary {
  31433. e.setEventHandler("blur", h, scope...)
  31434. return e
  31435. }
  31436. func (e *htmlSummary) OnChange(h EventHandler, scope ...any) HTMLSummary {
  31437. e.setEventHandler("change", h, scope...)
  31438. return e
  31439. }
  31440. func (e *htmlSummary) OnClick(h EventHandler, scope ...any) HTMLSummary {
  31441. e.setEventHandler("click", h, scope...)
  31442. return e
  31443. }
  31444. func (e *htmlSummary) OnContextMenu(h EventHandler, scope ...any) HTMLSummary {
  31445. e.setEventHandler("contextmenu", h, scope...)
  31446. return e
  31447. }
  31448. func (e *htmlSummary) OnCopy(h EventHandler, scope ...any) HTMLSummary {
  31449. e.setEventHandler("copy", h, scope...)
  31450. return e
  31451. }
  31452. func (e *htmlSummary) OnCut(h EventHandler, scope ...any) HTMLSummary {
  31453. e.setEventHandler("cut", h, scope...)
  31454. return e
  31455. }
  31456. func (e *htmlSummary) OnDblClick(h EventHandler, scope ...any) HTMLSummary {
  31457. e.setEventHandler("dblclick", h, scope...)
  31458. return e
  31459. }
  31460. func (e *htmlSummary) OnDrag(h EventHandler, scope ...any) HTMLSummary {
  31461. e.setEventHandler("drag", h, scope...)
  31462. return e
  31463. }
  31464. func (e *htmlSummary) OnDragEnd(h EventHandler, scope ...any) HTMLSummary {
  31465. e.setEventHandler("dragend", h, scope...)
  31466. return e
  31467. }
  31468. func (e *htmlSummary) OnDragEnter(h EventHandler, scope ...any) HTMLSummary {
  31469. e.setEventHandler("dragenter", h, scope...)
  31470. return e
  31471. }
  31472. func (e *htmlSummary) OnDragLeave(h EventHandler, scope ...any) HTMLSummary {
  31473. e.setEventHandler("dragleave", h, scope...)
  31474. return e
  31475. }
  31476. func (e *htmlSummary) OnDragOver(h EventHandler, scope ...any) HTMLSummary {
  31477. e.setEventHandler("dragover", h, scope...)
  31478. return e
  31479. }
  31480. func (e *htmlSummary) OnDragStart(h EventHandler, scope ...any) HTMLSummary {
  31481. e.setEventHandler("dragstart", h, scope...)
  31482. return e
  31483. }
  31484. func (e *htmlSummary) OnDrop(h EventHandler, scope ...any) HTMLSummary {
  31485. e.setEventHandler("drop", h, scope...)
  31486. return e
  31487. }
  31488. func (e *htmlSummary) OnFocus(h EventHandler, scope ...any) HTMLSummary {
  31489. e.setEventHandler("focus", h, scope...)
  31490. return e
  31491. }
  31492. func (e *htmlSummary) OnInput(h EventHandler, scope ...any) HTMLSummary {
  31493. e.setEventHandler("input", h, scope...)
  31494. return e
  31495. }
  31496. func (e *htmlSummary) OnInvalid(h EventHandler, scope ...any) HTMLSummary {
  31497. e.setEventHandler("invalid", h, scope...)
  31498. return e
  31499. }
  31500. func (e *htmlSummary) OnKeyDown(h EventHandler, scope ...any) HTMLSummary {
  31501. e.setEventHandler("keydown", h, scope...)
  31502. return e
  31503. }
  31504. func (e *htmlSummary) OnKeyPress(h EventHandler, scope ...any) HTMLSummary {
  31505. e.setEventHandler("keypress", h, scope...)
  31506. return e
  31507. }
  31508. func (e *htmlSummary) OnKeyUp(h EventHandler, scope ...any) HTMLSummary {
  31509. e.setEventHandler("keyup", h, scope...)
  31510. return e
  31511. }
  31512. func (e *htmlSummary) OnMouseDown(h EventHandler, scope ...any) HTMLSummary {
  31513. e.setEventHandler("mousedown", h, scope...)
  31514. return e
  31515. }
  31516. func (e *htmlSummary) OnMouseMove(h EventHandler, scope ...any) HTMLSummary {
  31517. e.setEventHandler("mousemove", h, scope...)
  31518. return e
  31519. }
  31520. func (e *htmlSummary) OnMouseOut(h EventHandler, scope ...any) HTMLSummary {
  31521. e.setEventHandler("mouseout", h, scope...)
  31522. return e
  31523. }
  31524. func (e *htmlSummary) OnMouseOver(h EventHandler, scope ...any) HTMLSummary {
  31525. e.setEventHandler("mouseover", h, scope...)
  31526. return e
  31527. }
  31528. func (e *htmlSummary) OnMouseUp(h EventHandler, scope ...any) HTMLSummary {
  31529. e.setEventHandler("mouseup", h, scope...)
  31530. return e
  31531. }
  31532. func (e *htmlSummary) OnPaste(h EventHandler, scope ...any) HTMLSummary {
  31533. e.setEventHandler("paste", h, scope...)
  31534. return e
  31535. }
  31536. func (e *htmlSummary) OnReset(h EventHandler, scope ...any) HTMLSummary {
  31537. e.setEventHandler("reset", h, scope...)
  31538. return e
  31539. }
  31540. func (e *htmlSummary) OnScroll(h EventHandler, scope ...any) HTMLSummary {
  31541. e.setEventHandler("scroll", h, scope...)
  31542. return e
  31543. }
  31544. func (e *htmlSummary) OnSearch(h EventHandler, scope ...any) HTMLSummary {
  31545. e.setEventHandler("search", h, scope...)
  31546. return e
  31547. }
  31548. func (e *htmlSummary) OnSelect(h EventHandler, scope ...any) HTMLSummary {
  31549. e.setEventHandler("select", h, scope...)
  31550. return e
  31551. }
  31552. func (e *htmlSummary) OnSubmit(h EventHandler, scope ...any) HTMLSummary {
  31553. e.setEventHandler("submit", h, scope...)
  31554. return e
  31555. }
  31556. func (e *htmlSummary) OnWheel(h EventHandler, scope ...any) HTMLSummary {
  31557. e.setEventHandler("wheel", h, scope...)
  31558. return e
  31559. }
  31560. // HTMLSup is the interface that describes a "sup" HTML element.
  31561. type HTMLSup interface {
  31562. UI
  31563. // Body set the content of the element.
  31564. Body(elems ...UI) HTMLSup
  31565. // Text sets the content of the element with a text node containing the stringified given value.
  31566. Text(v any) HTMLSup
  31567. // AccessKey specifies a shortcut key to activate/focus an element.
  31568. AccessKey(v string) HTMLSup
  31569. // Aria stores accessible rich internet applications (ARIA) data.
  31570. Aria(k string, v any) HTMLSup
  31571. // Attr sets the named attribute with the given value.
  31572. Attr(n string, v any) HTMLSup
  31573. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  31574. Class(v ...string) HTMLSup
  31575. // ContentEditable specifies whether the content of an element is editable or not.
  31576. ContentEditable(v bool) HTMLSup
  31577. // DataSet stores custom data private to the page or application.
  31578. DataSet(k string, v any) HTMLSup
  31579. // Dir specifies the text direction for the content in an element.
  31580. Dir(v string) HTMLSup
  31581. // Draggable specifies whether an element is draggable or not.
  31582. Draggable(v bool) HTMLSup
  31583. // Hidden specifies that an element is not yet, or is no longer relevant.
  31584. Hidden(v bool) HTMLSup
  31585. // ID specifies a unique id for an element.
  31586. ID(v string) HTMLSup
  31587. // Lang specifies the language of the element's content.
  31588. Lang(v string) HTMLSup
  31589. // Role specifies to parsing software the exact function of an element (and its children).
  31590. Role(v string) HTMLSup
  31591. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  31592. Spellcheck(v bool) HTMLSup
  31593. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  31594. Style(k, v string) HTMLSup
  31595. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  31596. Styles(s map[string]string) HTMLSup
  31597. // TabIndex specifies the tabbing order of an element.
  31598. TabIndex(v int) HTMLSup
  31599. // Title specifies extra information about an element.
  31600. Title(v string) HTMLSup
  31601. // On registers the given event handler to the specified event.
  31602. On(event string, h EventHandler, scope ...any) HTMLSup
  31603. // OnBlur calls the given handler when the element loses focus.
  31604. OnBlur(h EventHandler, scope ...any) HTMLSup
  31605. // OnChange calls the given handler when the value of the element is changed.
  31606. OnChange(h EventHandler, scope ...any) HTMLSup
  31607. // OnClick calls the given handler when there is a mouse click on the element.
  31608. OnClick(h EventHandler, scope ...any) HTMLSup
  31609. // OnContextMenu calls the given handler when a context menu is triggered.
  31610. OnContextMenu(h EventHandler, scope ...any) HTMLSup
  31611. // OnCopy calls the given handler when the user copies the content of an element.
  31612. OnCopy(h EventHandler, scope ...any) HTMLSup
  31613. // OnCut calls the given handler when the user cuts the content of an element.
  31614. OnCut(h EventHandler, scope ...any) HTMLSup
  31615. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  31616. OnDblClick(h EventHandler, scope ...any) HTMLSup
  31617. // OnDrag calls the given handler when an element is dragged.
  31618. OnDrag(h EventHandler, scope ...any) HTMLSup
  31619. // OnDragEnd calls the given handler at the end of a drag operation.
  31620. OnDragEnd(h EventHandler, scope ...any) HTMLSup
  31621. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  31622. OnDragEnter(h EventHandler, scope ...any) HTMLSup
  31623. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  31624. OnDragLeave(h EventHandler, scope ...any) HTMLSup
  31625. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  31626. OnDragOver(h EventHandler, scope ...any) HTMLSup
  31627. // OnDragStart calls the given handler at the start of a drag operation.
  31628. OnDragStart(h EventHandler, scope ...any) HTMLSup
  31629. // OnDrop calls the given handler when dragged element is being dropped.
  31630. OnDrop(h EventHandler, scope ...any) HTMLSup
  31631. // OnFocus calls the given handler when the element gets focus.
  31632. OnFocus(h EventHandler, scope ...any) HTMLSup
  31633. // OnInput calls the given handler when an element gets user input.
  31634. OnInput(h EventHandler, scope ...any) HTMLSup
  31635. // OnInvalid calls the given handler when an element is invalid.
  31636. OnInvalid(h EventHandler, scope ...any) HTMLSup
  31637. // OnKeyDown calls the given handler when a user is pressing a key.
  31638. OnKeyDown(h EventHandler, scope ...any) HTMLSup
  31639. // OnKeyPress calls the given handler when a user presses a key.
  31640. OnKeyPress(h EventHandler, scope ...any) HTMLSup
  31641. // OnKeyUp calls the given handler when a user releases a key.
  31642. OnKeyUp(h EventHandler, scope ...any) HTMLSup
  31643. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  31644. OnMouseDown(h EventHandler, scope ...any) HTMLSup
  31645. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  31646. OnMouseMove(h EventHandler, scope ...any) HTMLSup
  31647. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  31648. OnMouseOut(h EventHandler, scope ...any) HTMLSup
  31649. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  31650. OnMouseOver(h EventHandler, scope ...any) HTMLSup
  31651. // OnMouseUp calls the given handler when a mouse button is released over an element.
  31652. OnMouseUp(h EventHandler, scope ...any) HTMLSup
  31653. // OnPaste calls the given handler when the user pastes some content in an element.
  31654. OnPaste(h EventHandler, scope ...any) HTMLSup
  31655. // OnReset calls the given handler when the Reset button in a form is clicked.
  31656. OnReset(h EventHandler, scope ...any) HTMLSup
  31657. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  31658. OnScroll(h EventHandler, scope ...any) HTMLSup
  31659. // OnSearch calls the given handler when the user writes something in a search field.
  31660. OnSearch(h EventHandler, scope ...any) HTMLSup
  31661. // OnSelect calls the given handler after some text has been selected in an element.
  31662. OnSelect(h EventHandler, scope ...any) HTMLSup
  31663. // OnSubmit calls the given handler when a form is submitted.
  31664. OnSubmit(h EventHandler, scope ...any) HTMLSup
  31665. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  31666. OnWheel(h EventHandler, scope ...any) HTMLSup
  31667. }
  31668. // Sup returns an HTML element that defines superscripted text.
  31669. func Sup() HTMLSup {
  31670. e := &htmlSup{
  31671. htmlElement: htmlElement{
  31672. tag: "sup",
  31673. isSelfClosing: false,
  31674. },
  31675. }
  31676. return e
  31677. }
  31678. type htmlSup struct {
  31679. htmlElement
  31680. }
  31681. func (e *htmlSup) Body(v ...UI) HTMLSup {
  31682. e.setChildren(v...)
  31683. return e
  31684. }
  31685. func (e *htmlSup) Text(v any) HTMLSup {
  31686. return e.Body(Text(v))
  31687. }
  31688. func (e *htmlSup) AccessKey(v string) HTMLSup {
  31689. e.setAttr("accesskey", v)
  31690. return e
  31691. }
  31692. func (e *htmlSup) Aria(k string, v any) HTMLSup {
  31693. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  31694. return e
  31695. }
  31696. func (e *htmlSup) Attr(n string, v any) HTMLSup {
  31697. e.setAttr(n, v)
  31698. return e
  31699. }
  31700. func (e *htmlSup) Class(v ...string) HTMLSup {
  31701. e.setAttr("class", strings.Join(v, " "))
  31702. return e
  31703. }
  31704. func (e *htmlSup) ContentEditable(v bool) HTMLSup {
  31705. e.setAttr("contenteditable", v)
  31706. return e
  31707. }
  31708. func (e *htmlSup) DataSet(k string, v any) HTMLSup {
  31709. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  31710. return e
  31711. }
  31712. func (e *htmlSup) Dir(v string) HTMLSup {
  31713. e.setAttr("dir", v)
  31714. return e
  31715. }
  31716. func (e *htmlSup) Draggable(v bool) HTMLSup {
  31717. e.setAttr("draggable", v)
  31718. return e
  31719. }
  31720. func (e *htmlSup) Hidden(v bool) HTMLSup {
  31721. e.setAttr("hidden", v)
  31722. return e
  31723. }
  31724. func (e *htmlSup) ID(v string) HTMLSup {
  31725. e.setAttr("id", v)
  31726. return e
  31727. }
  31728. func (e *htmlSup) Lang(v string) HTMLSup {
  31729. e.setAttr("lang", v)
  31730. return e
  31731. }
  31732. func (e *htmlSup) Role(v string) HTMLSup {
  31733. e.setAttr("role", v)
  31734. return e
  31735. }
  31736. func (e *htmlSup) Spellcheck(v bool) HTMLSup {
  31737. s := "false"
  31738. if v {
  31739. s = "true"
  31740. }
  31741. e.setAttr("spellcheck", s)
  31742. return e
  31743. }
  31744. func (e *htmlSup) Style(k, v string) HTMLSup {
  31745. e.setAttr("style", k+":"+v)
  31746. return e
  31747. }
  31748. func (e *htmlSup) Styles(s map[string]string) HTMLSup {
  31749. for k, v := range s {
  31750. e.Style(k, v)
  31751. }
  31752. return e
  31753. }
  31754. func (e *htmlSup) TabIndex(v int) HTMLSup {
  31755. e.setAttr("tabindex", v)
  31756. return e
  31757. }
  31758. func (e *htmlSup) Title(v string) HTMLSup {
  31759. e.setAttr("title", v)
  31760. return e
  31761. }
  31762. func (e *htmlSup) On(event string, h EventHandler, scope ...any) HTMLSup {
  31763. e.setEventHandler(event, h, scope...)
  31764. return e
  31765. }
  31766. func (e *htmlSup) OnBlur(h EventHandler, scope ...any) HTMLSup {
  31767. e.setEventHandler("blur", h, scope...)
  31768. return e
  31769. }
  31770. func (e *htmlSup) OnChange(h EventHandler, scope ...any) HTMLSup {
  31771. e.setEventHandler("change", h, scope...)
  31772. return e
  31773. }
  31774. func (e *htmlSup) OnClick(h EventHandler, scope ...any) HTMLSup {
  31775. e.setEventHandler("click", h, scope...)
  31776. return e
  31777. }
  31778. func (e *htmlSup) OnContextMenu(h EventHandler, scope ...any) HTMLSup {
  31779. e.setEventHandler("contextmenu", h, scope...)
  31780. return e
  31781. }
  31782. func (e *htmlSup) OnCopy(h EventHandler, scope ...any) HTMLSup {
  31783. e.setEventHandler("copy", h, scope...)
  31784. return e
  31785. }
  31786. func (e *htmlSup) OnCut(h EventHandler, scope ...any) HTMLSup {
  31787. e.setEventHandler("cut", h, scope...)
  31788. return e
  31789. }
  31790. func (e *htmlSup) OnDblClick(h EventHandler, scope ...any) HTMLSup {
  31791. e.setEventHandler("dblclick", h, scope...)
  31792. return e
  31793. }
  31794. func (e *htmlSup) OnDrag(h EventHandler, scope ...any) HTMLSup {
  31795. e.setEventHandler("drag", h, scope...)
  31796. return e
  31797. }
  31798. func (e *htmlSup) OnDragEnd(h EventHandler, scope ...any) HTMLSup {
  31799. e.setEventHandler("dragend", h, scope...)
  31800. return e
  31801. }
  31802. func (e *htmlSup) OnDragEnter(h EventHandler, scope ...any) HTMLSup {
  31803. e.setEventHandler("dragenter", h, scope...)
  31804. return e
  31805. }
  31806. func (e *htmlSup) OnDragLeave(h EventHandler, scope ...any) HTMLSup {
  31807. e.setEventHandler("dragleave", h, scope...)
  31808. return e
  31809. }
  31810. func (e *htmlSup) OnDragOver(h EventHandler, scope ...any) HTMLSup {
  31811. e.setEventHandler("dragover", h, scope...)
  31812. return e
  31813. }
  31814. func (e *htmlSup) OnDragStart(h EventHandler, scope ...any) HTMLSup {
  31815. e.setEventHandler("dragstart", h, scope...)
  31816. return e
  31817. }
  31818. func (e *htmlSup) OnDrop(h EventHandler, scope ...any) HTMLSup {
  31819. e.setEventHandler("drop", h, scope...)
  31820. return e
  31821. }
  31822. func (e *htmlSup) OnFocus(h EventHandler, scope ...any) HTMLSup {
  31823. e.setEventHandler("focus", h, scope...)
  31824. return e
  31825. }
  31826. func (e *htmlSup) OnInput(h EventHandler, scope ...any) HTMLSup {
  31827. e.setEventHandler("input", h, scope...)
  31828. return e
  31829. }
  31830. func (e *htmlSup) OnInvalid(h EventHandler, scope ...any) HTMLSup {
  31831. e.setEventHandler("invalid", h, scope...)
  31832. return e
  31833. }
  31834. func (e *htmlSup) OnKeyDown(h EventHandler, scope ...any) HTMLSup {
  31835. e.setEventHandler("keydown", h, scope...)
  31836. return e
  31837. }
  31838. func (e *htmlSup) OnKeyPress(h EventHandler, scope ...any) HTMLSup {
  31839. e.setEventHandler("keypress", h, scope...)
  31840. return e
  31841. }
  31842. func (e *htmlSup) OnKeyUp(h EventHandler, scope ...any) HTMLSup {
  31843. e.setEventHandler("keyup", h, scope...)
  31844. return e
  31845. }
  31846. func (e *htmlSup) OnMouseDown(h EventHandler, scope ...any) HTMLSup {
  31847. e.setEventHandler("mousedown", h, scope...)
  31848. return e
  31849. }
  31850. func (e *htmlSup) OnMouseMove(h EventHandler, scope ...any) HTMLSup {
  31851. e.setEventHandler("mousemove", h, scope...)
  31852. return e
  31853. }
  31854. func (e *htmlSup) OnMouseOut(h EventHandler, scope ...any) HTMLSup {
  31855. e.setEventHandler("mouseout", h, scope...)
  31856. return e
  31857. }
  31858. func (e *htmlSup) OnMouseOver(h EventHandler, scope ...any) HTMLSup {
  31859. e.setEventHandler("mouseover", h, scope...)
  31860. return e
  31861. }
  31862. func (e *htmlSup) OnMouseUp(h EventHandler, scope ...any) HTMLSup {
  31863. e.setEventHandler("mouseup", h, scope...)
  31864. return e
  31865. }
  31866. func (e *htmlSup) OnPaste(h EventHandler, scope ...any) HTMLSup {
  31867. e.setEventHandler("paste", h, scope...)
  31868. return e
  31869. }
  31870. func (e *htmlSup) OnReset(h EventHandler, scope ...any) HTMLSup {
  31871. e.setEventHandler("reset", h, scope...)
  31872. return e
  31873. }
  31874. func (e *htmlSup) OnScroll(h EventHandler, scope ...any) HTMLSup {
  31875. e.setEventHandler("scroll", h, scope...)
  31876. return e
  31877. }
  31878. func (e *htmlSup) OnSearch(h EventHandler, scope ...any) HTMLSup {
  31879. e.setEventHandler("search", h, scope...)
  31880. return e
  31881. }
  31882. func (e *htmlSup) OnSelect(h EventHandler, scope ...any) HTMLSup {
  31883. e.setEventHandler("select", h, scope...)
  31884. return e
  31885. }
  31886. func (e *htmlSup) OnSubmit(h EventHandler, scope ...any) HTMLSup {
  31887. e.setEventHandler("submit", h, scope...)
  31888. return e
  31889. }
  31890. func (e *htmlSup) OnWheel(h EventHandler, scope ...any) HTMLSup {
  31891. e.setEventHandler("wheel", h, scope...)
  31892. return e
  31893. }
  31894. // HTMLTable is the interface that describes a "table" HTML element.
  31895. type HTMLTable interface {
  31896. UI
  31897. // Body set the content of the element.
  31898. Body(elems ...UI) HTMLTable
  31899. // Text sets the content of the element with a text node containing the stringified given value.
  31900. Text(v any) HTMLTable
  31901. // AccessKey specifies a shortcut key to activate/focus an element.
  31902. AccessKey(v string) HTMLTable
  31903. // Aria stores accessible rich internet applications (ARIA) data.
  31904. Aria(k string, v any) HTMLTable
  31905. // Attr sets the named attribute with the given value.
  31906. Attr(n string, v any) HTMLTable
  31907. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  31908. Class(v ...string) HTMLTable
  31909. // ContentEditable specifies whether the content of an element is editable or not.
  31910. ContentEditable(v bool) HTMLTable
  31911. // DataSet stores custom data private to the page or application.
  31912. DataSet(k string, v any) HTMLTable
  31913. // Dir specifies the text direction for the content in an element.
  31914. Dir(v string) HTMLTable
  31915. // Draggable specifies whether an element is draggable or not.
  31916. Draggable(v bool) HTMLTable
  31917. // Hidden specifies that an element is not yet, or is no longer relevant.
  31918. Hidden(v bool) HTMLTable
  31919. // ID specifies a unique id for an element.
  31920. ID(v string) HTMLTable
  31921. // Lang specifies the language of the element's content.
  31922. Lang(v string) HTMLTable
  31923. // Role specifies to parsing software the exact function of an element (and its children).
  31924. Role(v string) HTMLTable
  31925. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  31926. Spellcheck(v bool) HTMLTable
  31927. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  31928. Style(k, v string) HTMLTable
  31929. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  31930. Styles(s map[string]string) HTMLTable
  31931. // TabIndex specifies the tabbing order of an element.
  31932. TabIndex(v int) HTMLTable
  31933. // Title specifies extra information about an element.
  31934. Title(v string) HTMLTable
  31935. // On registers the given event handler to the specified event.
  31936. On(event string, h EventHandler, scope ...any) HTMLTable
  31937. // OnBlur calls the given handler when the element loses focus.
  31938. OnBlur(h EventHandler, scope ...any) HTMLTable
  31939. // OnChange calls the given handler when the value of the element is changed.
  31940. OnChange(h EventHandler, scope ...any) HTMLTable
  31941. // OnClick calls the given handler when there is a mouse click on the element.
  31942. OnClick(h EventHandler, scope ...any) HTMLTable
  31943. // OnContextMenu calls the given handler when a context menu is triggered.
  31944. OnContextMenu(h EventHandler, scope ...any) HTMLTable
  31945. // OnCopy calls the given handler when the user copies the content of an element.
  31946. OnCopy(h EventHandler, scope ...any) HTMLTable
  31947. // OnCut calls the given handler when the user cuts the content of an element.
  31948. OnCut(h EventHandler, scope ...any) HTMLTable
  31949. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  31950. OnDblClick(h EventHandler, scope ...any) HTMLTable
  31951. // OnDrag calls the given handler when an element is dragged.
  31952. OnDrag(h EventHandler, scope ...any) HTMLTable
  31953. // OnDragEnd calls the given handler at the end of a drag operation.
  31954. OnDragEnd(h EventHandler, scope ...any) HTMLTable
  31955. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  31956. OnDragEnter(h EventHandler, scope ...any) HTMLTable
  31957. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  31958. OnDragLeave(h EventHandler, scope ...any) HTMLTable
  31959. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  31960. OnDragOver(h EventHandler, scope ...any) HTMLTable
  31961. // OnDragStart calls the given handler at the start of a drag operation.
  31962. OnDragStart(h EventHandler, scope ...any) HTMLTable
  31963. // OnDrop calls the given handler when dragged element is being dropped.
  31964. OnDrop(h EventHandler, scope ...any) HTMLTable
  31965. // OnFocus calls the given handler when the element gets focus.
  31966. OnFocus(h EventHandler, scope ...any) HTMLTable
  31967. // OnInput calls the given handler when an element gets user input.
  31968. OnInput(h EventHandler, scope ...any) HTMLTable
  31969. // OnInvalid calls the given handler when an element is invalid.
  31970. OnInvalid(h EventHandler, scope ...any) HTMLTable
  31971. // OnKeyDown calls the given handler when a user is pressing a key.
  31972. OnKeyDown(h EventHandler, scope ...any) HTMLTable
  31973. // OnKeyPress calls the given handler when a user presses a key.
  31974. OnKeyPress(h EventHandler, scope ...any) HTMLTable
  31975. // OnKeyUp calls the given handler when a user releases a key.
  31976. OnKeyUp(h EventHandler, scope ...any) HTMLTable
  31977. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  31978. OnMouseDown(h EventHandler, scope ...any) HTMLTable
  31979. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  31980. OnMouseMove(h EventHandler, scope ...any) HTMLTable
  31981. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  31982. OnMouseOut(h EventHandler, scope ...any) HTMLTable
  31983. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  31984. OnMouseOver(h EventHandler, scope ...any) HTMLTable
  31985. // OnMouseUp calls the given handler when a mouse button is released over an element.
  31986. OnMouseUp(h EventHandler, scope ...any) HTMLTable
  31987. // OnPaste calls the given handler when the user pastes some content in an element.
  31988. OnPaste(h EventHandler, scope ...any) HTMLTable
  31989. // OnReset calls the given handler when the Reset button in a form is clicked.
  31990. OnReset(h EventHandler, scope ...any) HTMLTable
  31991. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  31992. OnScroll(h EventHandler, scope ...any) HTMLTable
  31993. // OnSearch calls the given handler when the user writes something in a search field.
  31994. OnSearch(h EventHandler, scope ...any) HTMLTable
  31995. // OnSelect calls the given handler after some text has been selected in an element.
  31996. OnSelect(h EventHandler, scope ...any) HTMLTable
  31997. // OnSubmit calls the given handler when a form is submitted.
  31998. OnSubmit(h EventHandler, scope ...any) HTMLTable
  31999. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  32000. OnWheel(h EventHandler, scope ...any) HTMLTable
  32001. }
  32002. // Table returns an HTML element that defines a table.
  32003. func Table() HTMLTable {
  32004. e := &htmlTable{
  32005. htmlElement: htmlElement{
  32006. tag: "table",
  32007. isSelfClosing: false,
  32008. },
  32009. }
  32010. return e
  32011. }
  32012. type htmlTable struct {
  32013. htmlElement
  32014. }
  32015. func (e *htmlTable) Body(v ...UI) HTMLTable {
  32016. e.setChildren(v...)
  32017. return e
  32018. }
  32019. func (e *htmlTable) Text(v any) HTMLTable {
  32020. return e.Body(Text(v))
  32021. }
  32022. func (e *htmlTable) AccessKey(v string) HTMLTable {
  32023. e.setAttr("accesskey", v)
  32024. return e
  32025. }
  32026. func (e *htmlTable) Aria(k string, v any) HTMLTable {
  32027. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  32028. return e
  32029. }
  32030. func (e *htmlTable) Attr(n string, v any) HTMLTable {
  32031. e.setAttr(n, v)
  32032. return e
  32033. }
  32034. func (e *htmlTable) Class(v ...string) HTMLTable {
  32035. e.setAttr("class", strings.Join(v, " "))
  32036. return e
  32037. }
  32038. func (e *htmlTable) ContentEditable(v bool) HTMLTable {
  32039. e.setAttr("contenteditable", v)
  32040. return e
  32041. }
  32042. func (e *htmlTable) DataSet(k string, v any) HTMLTable {
  32043. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  32044. return e
  32045. }
  32046. func (e *htmlTable) Dir(v string) HTMLTable {
  32047. e.setAttr("dir", v)
  32048. return e
  32049. }
  32050. func (e *htmlTable) Draggable(v bool) HTMLTable {
  32051. e.setAttr("draggable", v)
  32052. return e
  32053. }
  32054. func (e *htmlTable) Hidden(v bool) HTMLTable {
  32055. e.setAttr("hidden", v)
  32056. return e
  32057. }
  32058. func (e *htmlTable) ID(v string) HTMLTable {
  32059. e.setAttr("id", v)
  32060. return e
  32061. }
  32062. func (e *htmlTable) Lang(v string) HTMLTable {
  32063. e.setAttr("lang", v)
  32064. return e
  32065. }
  32066. func (e *htmlTable) Role(v string) HTMLTable {
  32067. e.setAttr("role", v)
  32068. return e
  32069. }
  32070. func (e *htmlTable) Spellcheck(v bool) HTMLTable {
  32071. s := "false"
  32072. if v {
  32073. s = "true"
  32074. }
  32075. e.setAttr("spellcheck", s)
  32076. return e
  32077. }
  32078. func (e *htmlTable) Style(k, v string) HTMLTable {
  32079. e.setAttr("style", k+":"+v)
  32080. return e
  32081. }
  32082. func (e *htmlTable) Styles(s map[string]string) HTMLTable {
  32083. for k, v := range s {
  32084. e.Style(k, v)
  32085. }
  32086. return e
  32087. }
  32088. func (e *htmlTable) TabIndex(v int) HTMLTable {
  32089. e.setAttr("tabindex", v)
  32090. return e
  32091. }
  32092. func (e *htmlTable) Title(v string) HTMLTable {
  32093. e.setAttr("title", v)
  32094. return e
  32095. }
  32096. func (e *htmlTable) On(event string, h EventHandler, scope ...any) HTMLTable {
  32097. e.setEventHandler(event, h, scope...)
  32098. return e
  32099. }
  32100. func (e *htmlTable) OnBlur(h EventHandler, scope ...any) HTMLTable {
  32101. e.setEventHandler("blur", h, scope...)
  32102. return e
  32103. }
  32104. func (e *htmlTable) OnChange(h EventHandler, scope ...any) HTMLTable {
  32105. e.setEventHandler("change", h, scope...)
  32106. return e
  32107. }
  32108. func (e *htmlTable) OnClick(h EventHandler, scope ...any) HTMLTable {
  32109. e.setEventHandler("click", h, scope...)
  32110. return e
  32111. }
  32112. func (e *htmlTable) OnContextMenu(h EventHandler, scope ...any) HTMLTable {
  32113. e.setEventHandler("contextmenu", h, scope...)
  32114. return e
  32115. }
  32116. func (e *htmlTable) OnCopy(h EventHandler, scope ...any) HTMLTable {
  32117. e.setEventHandler("copy", h, scope...)
  32118. return e
  32119. }
  32120. func (e *htmlTable) OnCut(h EventHandler, scope ...any) HTMLTable {
  32121. e.setEventHandler("cut", h, scope...)
  32122. return e
  32123. }
  32124. func (e *htmlTable) OnDblClick(h EventHandler, scope ...any) HTMLTable {
  32125. e.setEventHandler("dblclick", h, scope...)
  32126. return e
  32127. }
  32128. func (e *htmlTable) OnDrag(h EventHandler, scope ...any) HTMLTable {
  32129. e.setEventHandler("drag", h, scope...)
  32130. return e
  32131. }
  32132. func (e *htmlTable) OnDragEnd(h EventHandler, scope ...any) HTMLTable {
  32133. e.setEventHandler("dragend", h, scope...)
  32134. return e
  32135. }
  32136. func (e *htmlTable) OnDragEnter(h EventHandler, scope ...any) HTMLTable {
  32137. e.setEventHandler("dragenter", h, scope...)
  32138. return e
  32139. }
  32140. func (e *htmlTable) OnDragLeave(h EventHandler, scope ...any) HTMLTable {
  32141. e.setEventHandler("dragleave", h, scope...)
  32142. return e
  32143. }
  32144. func (e *htmlTable) OnDragOver(h EventHandler, scope ...any) HTMLTable {
  32145. e.setEventHandler("dragover", h, scope...)
  32146. return e
  32147. }
  32148. func (e *htmlTable) OnDragStart(h EventHandler, scope ...any) HTMLTable {
  32149. e.setEventHandler("dragstart", h, scope...)
  32150. return e
  32151. }
  32152. func (e *htmlTable) OnDrop(h EventHandler, scope ...any) HTMLTable {
  32153. e.setEventHandler("drop", h, scope...)
  32154. return e
  32155. }
  32156. func (e *htmlTable) OnFocus(h EventHandler, scope ...any) HTMLTable {
  32157. e.setEventHandler("focus", h, scope...)
  32158. return e
  32159. }
  32160. func (e *htmlTable) OnInput(h EventHandler, scope ...any) HTMLTable {
  32161. e.setEventHandler("input", h, scope...)
  32162. return e
  32163. }
  32164. func (e *htmlTable) OnInvalid(h EventHandler, scope ...any) HTMLTable {
  32165. e.setEventHandler("invalid", h, scope...)
  32166. return e
  32167. }
  32168. func (e *htmlTable) OnKeyDown(h EventHandler, scope ...any) HTMLTable {
  32169. e.setEventHandler("keydown", h, scope...)
  32170. return e
  32171. }
  32172. func (e *htmlTable) OnKeyPress(h EventHandler, scope ...any) HTMLTable {
  32173. e.setEventHandler("keypress", h, scope...)
  32174. return e
  32175. }
  32176. func (e *htmlTable) OnKeyUp(h EventHandler, scope ...any) HTMLTable {
  32177. e.setEventHandler("keyup", h, scope...)
  32178. return e
  32179. }
  32180. func (e *htmlTable) OnMouseDown(h EventHandler, scope ...any) HTMLTable {
  32181. e.setEventHandler("mousedown", h, scope...)
  32182. return e
  32183. }
  32184. func (e *htmlTable) OnMouseMove(h EventHandler, scope ...any) HTMLTable {
  32185. e.setEventHandler("mousemove", h, scope...)
  32186. return e
  32187. }
  32188. func (e *htmlTable) OnMouseOut(h EventHandler, scope ...any) HTMLTable {
  32189. e.setEventHandler("mouseout", h, scope...)
  32190. return e
  32191. }
  32192. func (e *htmlTable) OnMouseOver(h EventHandler, scope ...any) HTMLTable {
  32193. e.setEventHandler("mouseover", h, scope...)
  32194. return e
  32195. }
  32196. func (e *htmlTable) OnMouseUp(h EventHandler, scope ...any) HTMLTable {
  32197. e.setEventHandler("mouseup", h, scope...)
  32198. return e
  32199. }
  32200. func (e *htmlTable) OnPaste(h EventHandler, scope ...any) HTMLTable {
  32201. e.setEventHandler("paste", h, scope...)
  32202. return e
  32203. }
  32204. func (e *htmlTable) OnReset(h EventHandler, scope ...any) HTMLTable {
  32205. e.setEventHandler("reset", h, scope...)
  32206. return e
  32207. }
  32208. func (e *htmlTable) OnScroll(h EventHandler, scope ...any) HTMLTable {
  32209. e.setEventHandler("scroll", h, scope...)
  32210. return e
  32211. }
  32212. func (e *htmlTable) OnSearch(h EventHandler, scope ...any) HTMLTable {
  32213. e.setEventHandler("search", h, scope...)
  32214. return e
  32215. }
  32216. func (e *htmlTable) OnSelect(h EventHandler, scope ...any) HTMLTable {
  32217. e.setEventHandler("select", h, scope...)
  32218. return e
  32219. }
  32220. func (e *htmlTable) OnSubmit(h EventHandler, scope ...any) HTMLTable {
  32221. e.setEventHandler("submit", h, scope...)
  32222. return e
  32223. }
  32224. func (e *htmlTable) OnWheel(h EventHandler, scope ...any) HTMLTable {
  32225. e.setEventHandler("wheel", h, scope...)
  32226. return e
  32227. }
  32228. // HTMLTBody is the interface that describes a "tbody" HTML element.
  32229. type HTMLTBody interface {
  32230. UI
  32231. // Body set the content of the element.
  32232. Body(elems ...UI) HTMLTBody
  32233. // Text sets the content of the element with a text node containing the stringified given value.
  32234. Text(v any) HTMLTBody
  32235. // AccessKey specifies a shortcut key to activate/focus an element.
  32236. AccessKey(v string) HTMLTBody
  32237. // Aria stores accessible rich internet applications (ARIA) data.
  32238. Aria(k string, v any) HTMLTBody
  32239. // Attr sets the named attribute with the given value.
  32240. Attr(n string, v any) HTMLTBody
  32241. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  32242. Class(v ...string) HTMLTBody
  32243. // ContentEditable specifies whether the content of an element is editable or not.
  32244. ContentEditable(v bool) HTMLTBody
  32245. // DataSet stores custom data private to the page or application.
  32246. DataSet(k string, v any) HTMLTBody
  32247. // Dir specifies the text direction for the content in an element.
  32248. Dir(v string) HTMLTBody
  32249. // Draggable specifies whether an element is draggable or not.
  32250. Draggable(v bool) HTMLTBody
  32251. // Hidden specifies that an element is not yet, or is no longer relevant.
  32252. Hidden(v bool) HTMLTBody
  32253. // ID specifies a unique id for an element.
  32254. ID(v string) HTMLTBody
  32255. // Lang specifies the language of the element's content.
  32256. Lang(v string) HTMLTBody
  32257. // Role specifies to parsing software the exact function of an element (and its children).
  32258. Role(v string) HTMLTBody
  32259. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  32260. Spellcheck(v bool) HTMLTBody
  32261. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  32262. Style(k, v string) HTMLTBody
  32263. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  32264. Styles(s map[string]string) HTMLTBody
  32265. // TabIndex specifies the tabbing order of an element.
  32266. TabIndex(v int) HTMLTBody
  32267. // Title specifies extra information about an element.
  32268. Title(v string) HTMLTBody
  32269. // On registers the given event handler to the specified event.
  32270. On(event string, h EventHandler, scope ...any) HTMLTBody
  32271. // OnBlur calls the given handler when the element loses focus.
  32272. OnBlur(h EventHandler, scope ...any) HTMLTBody
  32273. // OnChange calls the given handler when the value of the element is changed.
  32274. OnChange(h EventHandler, scope ...any) HTMLTBody
  32275. // OnClick calls the given handler when there is a mouse click on the element.
  32276. OnClick(h EventHandler, scope ...any) HTMLTBody
  32277. // OnContextMenu calls the given handler when a context menu is triggered.
  32278. OnContextMenu(h EventHandler, scope ...any) HTMLTBody
  32279. // OnCopy calls the given handler when the user copies the content of an element.
  32280. OnCopy(h EventHandler, scope ...any) HTMLTBody
  32281. // OnCut calls the given handler when the user cuts the content of an element.
  32282. OnCut(h EventHandler, scope ...any) HTMLTBody
  32283. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  32284. OnDblClick(h EventHandler, scope ...any) HTMLTBody
  32285. // OnDrag calls the given handler when an element is dragged.
  32286. OnDrag(h EventHandler, scope ...any) HTMLTBody
  32287. // OnDragEnd calls the given handler at the end of a drag operation.
  32288. OnDragEnd(h EventHandler, scope ...any) HTMLTBody
  32289. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  32290. OnDragEnter(h EventHandler, scope ...any) HTMLTBody
  32291. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  32292. OnDragLeave(h EventHandler, scope ...any) HTMLTBody
  32293. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  32294. OnDragOver(h EventHandler, scope ...any) HTMLTBody
  32295. // OnDragStart calls the given handler at the start of a drag operation.
  32296. OnDragStart(h EventHandler, scope ...any) HTMLTBody
  32297. // OnDrop calls the given handler when dragged element is being dropped.
  32298. OnDrop(h EventHandler, scope ...any) HTMLTBody
  32299. // OnFocus calls the given handler when the element gets focus.
  32300. OnFocus(h EventHandler, scope ...any) HTMLTBody
  32301. // OnInput calls the given handler when an element gets user input.
  32302. OnInput(h EventHandler, scope ...any) HTMLTBody
  32303. // OnInvalid calls the given handler when an element is invalid.
  32304. OnInvalid(h EventHandler, scope ...any) HTMLTBody
  32305. // OnKeyDown calls the given handler when a user is pressing a key.
  32306. OnKeyDown(h EventHandler, scope ...any) HTMLTBody
  32307. // OnKeyPress calls the given handler when a user presses a key.
  32308. OnKeyPress(h EventHandler, scope ...any) HTMLTBody
  32309. // OnKeyUp calls the given handler when a user releases a key.
  32310. OnKeyUp(h EventHandler, scope ...any) HTMLTBody
  32311. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  32312. OnMouseDown(h EventHandler, scope ...any) HTMLTBody
  32313. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  32314. OnMouseMove(h EventHandler, scope ...any) HTMLTBody
  32315. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  32316. OnMouseOut(h EventHandler, scope ...any) HTMLTBody
  32317. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  32318. OnMouseOver(h EventHandler, scope ...any) HTMLTBody
  32319. // OnMouseUp calls the given handler when a mouse button is released over an element.
  32320. OnMouseUp(h EventHandler, scope ...any) HTMLTBody
  32321. // OnPaste calls the given handler when the user pastes some content in an element.
  32322. OnPaste(h EventHandler, scope ...any) HTMLTBody
  32323. // OnReset calls the given handler when the Reset button in a form is clicked.
  32324. OnReset(h EventHandler, scope ...any) HTMLTBody
  32325. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  32326. OnScroll(h EventHandler, scope ...any) HTMLTBody
  32327. // OnSearch calls the given handler when the user writes something in a search field.
  32328. OnSearch(h EventHandler, scope ...any) HTMLTBody
  32329. // OnSelect calls the given handler after some text has been selected in an element.
  32330. OnSelect(h EventHandler, scope ...any) HTMLTBody
  32331. // OnSubmit calls the given handler when a form is submitted.
  32332. OnSubmit(h EventHandler, scope ...any) HTMLTBody
  32333. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  32334. OnWheel(h EventHandler, scope ...any) HTMLTBody
  32335. }
  32336. // TBody returns an HTML element that groups the body content in a table.
  32337. func TBody() HTMLTBody {
  32338. e := &htmlTBody{
  32339. htmlElement: htmlElement{
  32340. tag: "tbody",
  32341. isSelfClosing: false,
  32342. },
  32343. }
  32344. return e
  32345. }
  32346. type htmlTBody struct {
  32347. htmlElement
  32348. }
  32349. func (e *htmlTBody) Body(v ...UI) HTMLTBody {
  32350. e.setChildren(v...)
  32351. return e
  32352. }
  32353. func (e *htmlTBody) Text(v any) HTMLTBody {
  32354. return e.Body(Text(v))
  32355. }
  32356. func (e *htmlTBody) AccessKey(v string) HTMLTBody {
  32357. e.setAttr("accesskey", v)
  32358. return e
  32359. }
  32360. func (e *htmlTBody) Aria(k string, v any) HTMLTBody {
  32361. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  32362. return e
  32363. }
  32364. func (e *htmlTBody) Attr(n string, v any) HTMLTBody {
  32365. e.setAttr(n, v)
  32366. return e
  32367. }
  32368. func (e *htmlTBody) Class(v ...string) HTMLTBody {
  32369. e.setAttr("class", strings.Join(v, " "))
  32370. return e
  32371. }
  32372. func (e *htmlTBody) ContentEditable(v bool) HTMLTBody {
  32373. e.setAttr("contenteditable", v)
  32374. return e
  32375. }
  32376. func (e *htmlTBody) DataSet(k string, v any) HTMLTBody {
  32377. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  32378. return e
  32379. }
  32380. func (e *htmlTBody) Dir(v string) HTMLTBody {
  32381. e.setAttr("dir", v)
  32382. return e
  32383. }
  32384. func (e *htmlTBody) Draggable(v bool) HTMLTBody {
  32385. e.setAttr("draggable", v)
  32386. return e
  32387. }
  32388. func (e *htmlTBody) Hidden(v bool) HTMLTBody {
  32389. e.setAttr("hidden", v)
  32390. return e
  32391. }
  32392. func (e *htmlTBody) ID(v string) HTMLTBody {
  32393. e.setAttr("id", v)
  32394. return e
  32395. }
  32396. func (e *htmlTBody) Lang(v string) HTMLTBody {
  32397. e.setAttr("lang", v)
  32398. return e
  32399. }
  32400. func (e *htmlTBody) Role(v string) HTMLTBody {
  32401. e.setAttr("role", v)
  32402. return e
  32403. }
  32404. func (e *htmlTBody) Spellcheck(v bool) HTMLTBody {
  32405. s := "false"
  32406. if v {
  32407. s = "true"
  32408. }
  32409. e.setAttr("spellcheck", s)
  32410. return e
  32411. }
  32412. func (e *htmlTBody) Style(k, v string) HTMLTBody {
  32413. e.setAttr("style", k+":"+v)
  32414. return e
  32415. }
  32416. func (e *htmlTBody) Styles(s map[string]string) HTMLTBody {
  32417. for k, v := range s {
  32418. e.Style(k, v)
  32419. }
  32420. return e
  32421. }
  32422. func (e *htmlTBody) TabIndex(v int) HTMLTBody {
  32423. e.setAttr("tabindex", v)
  32424. return e
  32425. }
  32426. func (e *htmlTBody) Title(v string) HTMLTBody {
  32427. e.setAttr("title", v)
  32428. return e
  32429. }
  32430. func (e *htmlTBody) On(event string, h EventHandler, scope ...any) HTMLTBody {
  32431. e.setEventHandler(event, h, scope...)
  32432. return e
  32433. }
  32434. func (e *htmlTBody) OnBlur(h EventHandler, scope ...any) HTMLTBody {
  32435. e.setEventHandler("blur", h, scope...)
  32436. return e
  32437. }
  32438. func (e *htmlTBody) OnChange(h EventHandler, scope ...any) HTMLTBody {
  32439. e.setEventHandler("change", h, scope...)
  32440. return e
  32441. }
  32442. func (e *htmlTBody) OnClick(h EventHandler, scope ...any) HTMLTBody {
  32443. e.setEventHandler("click", h, scope...)
  32444. return e
  32445. }
  32446. func (e *htmlTBody) OnContextMenu(h EventHandler, scope ...any) HTMLTBody {
  32447. e.setEventHandler("contextmenu", h, scope...)
  32448. return e
  32449. }
  32450. func (e *htmlTBody) OnCopy(h EventHandler, scope ...any) HTMLTBody {
  32451. e.setEventHandler("copy", h, scope...)
  32452. return e
  32453. }
  32454. func (e *htmlTBody) OnCut(h EventHandler, scope ...any) HTMLTBody {
  32455. e.setEventHandler("cut", h, scope...)
  32456. return e
  32457. }
  32458. func (e *htmlTBody) OnDblClick(h EventHandler, scope ...any) HTMLTBody {
  32459. e.setEventHandler("dblclick", h, scope...)
  32460. return e
  32461. }
  32462. func (e *htmlTBody) OnDrag(h EventHandler, scope ...any) HTMLTBody {
  32463. e.setEventHandler("drag", h, scope...)
  32464. return e
  32465. }
  32466. func (e *htmlTBody) OnDragEnd(h EventHandler, scope ...any) HTMLTBody {
  32467. e.setEventHandler("dragend", h, scope...)
  32468. return e
  32469. }
  32470. func (e *htmlTBody) OnDragEnter(h EventHandler, scope ...any) HTMLTBody {
  32471. e.setEventHandler("dragenter", h, scope...)
  32472. return e
  32473. }
  32474. func (e *htmlTBody) OnDragLeave(h EventHandler, scope ...any) HTMLTBody {
  32475. e.setEventHandler("dragleave", h, scope...)
  32476. return e
  32477. }
  32478. func (e *htmlTBody) OnDragOver(h EventHandler, scope ...any) HTMLTBody {
  32479. e.setEventHandler("dragover", h, scope...)
  32480. return e
  32481. }
  32482. func (e *htmlTBody) OnDragStart(h EventHandler, scope ...any) HTMLTBody {
  32483. e.setEventHandler("dragstart", h, scope...)
  32484. return e
  32485. }
  32486. func (e *htmlTBody) OnDrop(h EventHandler, scope ...any) HTMLTBody {
  32487. e.setEventHandler("drop", h, scope...)
  32488. return e
  32489. }
  32490. func (e *htmlTBody) OnFocus(h EventHandler, scope ...any) HTMLTBody {
  32491. e.setEventHandler("focus", h, scope...)
  32492. return e
  32493. }
  32494. func (e *htmlTBody) OnInput(h EventHandler, scope ...any) HTMLTBody {
  32495. e.setEventHandler("input", h, scope...)
  32496. return e
  32497. }
  32498. func (e *htmlTBody) OnInvalid(h EventHandler, scope ...any) HTMLTBody {
  32499. e.setEventHandler("invalid", h, scope...)
  32500. return e
  32501. }
  32502. func (e *htmlTBody) OnKeyDown(h EventHandler, scope ...any) HTMLTBody {
  32503. e.setEventHandler("keydown", h, scope...)
  32504. return e
  32505. }
  32506. func (e *htmlTBody) OnKeyPress(h EventHandler, scope ...any) HTMLTBody {
  32507. e.setEventHandler("keypress", h, scope...)
  32508. return e
  32509. }
  32510. func (e *htmlTBody) OnKeyUp(h EventHandler, scope ...any) HTMLTBody {
  32511. e.setEventHandler("keyup", h, scope...)
  32512. return e
  32513. }
  32514. func (e *htmlTBody) OnMouseDown(h EventHandler, scope ...any) HTMLTBody {
  32515. e.setEventHandler("mousedown", h, scope...)
  32516. return e
  32517. }
  32518. func (e *htmlTBody) OnMouseMove(h EventHandler, scope ...any) HTMLTBody {
  32519. e.setEventHandler("mousemove", h, scope...)
  32520. return e
  32521. }
  32522. func (e *htmlTBody) OnMouseOut(h EventHandler, scope ...any) HTMLTBody {
  32523. e.setEventHandler("mouseout", h, scope...)
  32524. return e
  32525. }
  32526. func (e *htmlTBody) OnMouseOver(h EventHandler, scope ...any) HTMLTBody {
  32527. e.setEventHandler("mouseover", h, scope...)
  32528. return e
  32529. }
  32530. func (e *htmlTBody) OnMouseUp(h EventHandler, scope ...any) HTMLTBody {
  32531. e.setEventHandler("mouseup", h, scope...)
  32532. return e
  32533. }
  32534. func (e *htmlTBody) OnPaste(h EventHandler, scope ...any) HTMLTBody {
  32535. e.setEventHandler("paste", h, scope...)
  32536. return e
  32537. }
  32538. func (e *htmlTBody) OnReset(h EventHandler, scope ...any) HTMLTBody {
  32539. e.setEventHandler("reset", h, scope...)
  32540. return e
  32541. }
  32542. func (e *htmlTBody) OnScroll(h EventHandler, scope ...any) HTMLTBody {
  32543. e.setEventHandler("scroll", h, scope...)
  32544. return e
  32545. }
  32546. func (e *htmlTBody) OnSearch(h EventHandler, scope ...any) HTMLTBody {
  32547. e.setEventHandler("search", h, scope...)
  32548. return e
  32549. }
  32550. func (e *htmlTBody) OnSelect(h EventHandler, scope ...any) HTMLTBody {
  32551. e.setEventHandler("select", h, scope...)
  32552. return e
  32553. }
  32554. func (e *htmlTBody) OnSubmit(h EventHandler, scope ...any) HTMLTBody {
  32555. e.setEventHandler("submit", h, scope...)
  32556. return e
  32557. }
  32558. func (e *htmlTBody) OnWheel(h EventHandler, scope ...any) HTMLTBody {
  32559. e.setEventHandler("wheel", h, scope...)
  32560. return e
  32561. }
  32562. // HTMLTd is the interface that describes a "td" HTML element.
  32563. type HTMLTd interface {
  32564. UI
  32565. // Body set the content of the element.
  32566. Body(elems ...UI) HTMLTd
  32567. // Text sets the content of the element with a text node containing the stringified given value.
  32568. Text(v any) HTMLTd
  32569. // AccessKey specifies a shortcut key to activate/focus an element.
  32570. AccessKey(v string) HTMLTd
  32571. // Aria stores accessible rich internet applications (ARIA) data.
  32572. Aria(k string, v any) HTMLTd
  32573. // Attr sets the named attribute with the given value.
  32574. Attr(n string, v any) HTMLTd
  32575. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  32576. Class(v ...string) HTMLTd
  32577. // ColSpan specifies the number of columns a table cell should span.
  32578. ColSpan(v int) HTMLTd
  32579. // ContentEditable specifies whether the content of an element is editable or not.
  32580. ContentEditable(v bool) HTMLTd
  32581. // DataSet stores custom data private to the page or application.
  32582. DataSet(k string, v any) HTMLTd
  32583. // Dir specifies the text direction for the content in an element.
  32584. Dir(v string) HTMLTd
  32585. // Draggable specifies whether an element is draggable or not.
  32586. Draggable(v bool) HTMLTd
  32587. // Headers specifies one or more headers cells a cell is related to.
  32588. Headers(v string) HTMLTd
  32589. // Hidden specifies that an element is not yet, or is no longer relevant.
  32590. Hidden(v bool) HTMLTd
  32591. // ID specifies a unique id for an element.
  32592. ID(v string) HTMLTd
  32593. // Lang specifies the language of the element's content.
  32594. Lang(v string) HTMLTd
  32595. // Role specifies to parsing software the exact function of an element (and its children).
  32596. Role(v string) HTMLTd
  32597. // Rowspan specifies the number of rows a table cell should span.
  32598. Rowspan(v int) HTMLTd
  32599. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  32600. Spellcheck(v bool) HTMLTd
  32601. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  32602. Style(k, v string) HTMLTd
  32603. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  32604. Styles(s map[string]string) HTMLTd
  32605. // TabIndex specifies the tabbing order of an element.
  32606. TabIndex(v int) HTMLTd
  32607. // Title specifies extra information about an element.
  32608. Title(v string) HTMLTd
  32609. // On registers the given event handler to the specified event.
  32610. On(event string, h EventHandler, scope ...any) HTMLTd
  32611. // OnBlur calls the given handler when the element loses focus.
  32612. OnBlur(h EventHandler, scope ...any) HTMLTd
  32613. // OnChange calls the given handler when the value of the element is changed.
  32614. OnChange(h EventHandler, scope ...any) HTMLTd
  32615. // OnClick calls the given handler when there is a mouse click on the element.
  32616. OnClick(h EventHandler, scope ...any) HTMLTd
  32617. // OnContextMenu calls the given handler when a context menu is triggered.
  32618. OnContextMenu(h EventHandler, scope ...any) HTMLTd
  32619. // OnCopy calls the given handler when the user copies the content of an element.
  32620. OnCopy(h EventHandler, scope ...any) HTMLTd
  32621. // OnCut calls the given handler when the user cuts the content of an element.
  32622. OnCut(h EventHandler, scope ...any) HTMLTd
  32623. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  32624. OnDblClick(h EventHandler, scope ...any) HTMLTd
  32625. // OnDrag calls the given handler when an element is dragged.
  32626. OnDrag(h EventHandler, scope ...any) HTMLTd
  32627. // OnDragEnd calls the given handler at the end of a drag operation.
  32628. OnDragEnd(h EventHandler, scope ...any) HTMLTd
  32629. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  32630. OnDragEnter(h EventHandler, scope ...any) HTMLTd
  32631. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  32632. OnDragLeave(h EventHandler, scope ...any) HTMLTd
  32633. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  32634. OnDragOver(h EventHandler, scope ...any) HTMLTd
  32635. // OnDragStart calls the given handler at the start of a drag operation.
  32636. OnDragStart(h EventHandler, scope ...any) HTMLTd
  32637. // OnDrop calls the given handler when dragged element is being dropped.
  32638. OnDrop(h EventHandler, scope ...any) HTMLTd
  32639. // OnFocus calls the given handler when the element gets focus.
  32640. OnFocus(h EventHandler, scope ...any) HTMLTd
  32641. // OnInput calls the given handler when an element gets user input.
  32642. OnInput(h EventHandler, scope ...any) HTMLTd
  32643. // OnInvalid calls the given handler when an element is invalid.
  32644. OnInvalid(h EventHandler, scope ...any) HTMLTd
  32645. // OnKeyDown calls the given handler when a user is pressing a key.
  32646. OnKeyDown(h EventHandler, scope ...any) HTMLTd
  32647. // OnKeyPress calls the given handler when a user presses a key.
  32648. OnKeyPress(h EventHandler, scope ...any) HTMLTd
  32649. // OnKeyUp calls the given handler when a user releases a key.
  32650. OnKeyUp(h EventHandler, scope ...any) HTMLTd
  32651. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  32652. OnMouseDown(h EventHandler, scope ...any) HTMLTd
  32653. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  32654. OnMouseMove(h EventHandler, scope ...any) HTMLTd
  32655. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  32656. OnMouseOut(h EventHandler, scope ...any) HTMLTd
  32657. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  32658. OnMouseOver(h EventHandler, scope ...any) HTMLTd
  32659. // OnMouseUp calls the given handler when a mouse button is released over an element.
  32660. OnMouseUp(h EventHandler, scope ...any) HTMLTd
  32661. // OnPaste calls the given handler when the user pastes some content in an element.
  32662. OnPaste(h EventHandler, scope ...any) HTMLTd
  32663. // OnReset calls the given handler when the Reset button in a form is clicked.
  32664. OnReset(h EventHandler, scope ...any) HTMLTd
  32665. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  32666. OnScroll(h EventHandler, scope ...any) HTMLTd
  32667. // OnSearch calls the given handler when the user writes something in a search field.
  32668. OnSearch(h EventHandler, scope ...any) HTMLTd
  32669. // OnSelect calls the given handler after some text has been selected in an element.
  32670. OnSelect(h EventHandler, scope ...any) HTMLTd
  32671. // OnSubmit calls the given handler when a form is submitted.
  32672. OnSubmit(h EventHandler, scope ...any) HTMLTd
  32673. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  32674. OnWheel(h EventHandler, scope ...any) HTMLTd
  32675. }
  32676. // Td returns an HTML element that defines a cell in a table.
  32677. func Td() HTMLTd {
  32678. e := &htmlTd{
  32679. htmlElement: htmlElement{
  32680. tag: "td",
  32681. isSelfClosing: false,
  32682. },
  32683. }
  32684. return e
  32685. }
  32686. type htmlTd struct {
  32687. htmlElement
  32688. }
  32689. func (e *htmlTd) Body(v ...UI) HTMLTd {
  32690. e.setChildren(v...)
  32691. return e
  32692. }
  32693. func (e *htmlTd) Text(v any) HTMLTd {
  32694. return e.Body(Text(v))
  32695. }
  32696. func (e *htmlTd) AccessKey(v string) HTMLTd {
  32697. e.setAttr("accesskey", v)
  32698. return e
  32699. }
  32700. func (e *htmlTd) Aria(k string, v any) HTMLTd {
  32701. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  32702. return e
  32703. }
  32704. func (e *htmlTd) Attr(n string, v any) HTMLTd {
  32705. e.setAttr(n, v)
  32706. return e
  32707. }
  32708. func (e *htmlTd) Class(v ...string) HTMLTd {
  32709. e.setAttr("class", strings.Join(v, " "))
  32710. return e
  32711. }
  32712. func (e *htmlTd) ColSpan(v int) HTMLTd {
  32713. e.setAttr("colspan", v)
  32714. return e
  32715. }
  32716. func (e *htmlTd) ContentEditable(v bool) HTMLTd {
  32717. e.setAttr("contenteditable", v)
  32718. return e
  32719. }
  32720. func (e *htmlTd) DataSet(k string, v any) HTMLTd {
  32721. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  32722. return e
  32723. }
  32724. func (e *htmlTd) Dir(v string) HTMLTd {
  32725. e.setAttr("dir", v)
  32726. return e
  32727. }
  32728. func (e *htmlTd) Draggable(v bool) HTMLTd {
  32729. e.setAttr("draggable", v)
  32730. return e
  32731. }
  32732. func (e *htmlTd) Headers(v string) HTMLTd {
  32733. e.setAttr("headers", v)
  32734. return e
  32735. }
  32736. func (e *htmlTd) Hidden(v bool) HTMLTd {
  32737. e.setAttr("hidden", v)
  32738. return e
  32739. }
  32740. func (e *htmlTd) ID(v string) HTMLTd {
  32741. e.setAttr("id", v)
  32742. return e
  32743. }
  32744. func (e *htmlTd) Lang(v string) HTMLTd {
  32745. e.setAttr("lang", v)
  32746. return e
  32747. }
  32748. func (e *htmlTd) Role(v string) HTMLTd {
  32749. e.setAttr("role", v)
  32750. return e
  32751. }
  32752. func (e *htmlTd) Rowspan(v int) HTMLTd {
  32753. e.setAttr("rowspan", v)
  32754. return e
  32755. }
  32756. func (e *htmlTd) Spellcheck(v bool) HTMLTd {
  32757. s := "false"
  32758. if v {
  32759. s = "true"
  32760. }
  32761. e.setAttr("spellcheck", s)
  32762. return e
  32763. }
  32764. func (e *htmlTd) Style(k, v string) HTMLTd {
  32765. e.setAttr("style", k+":"+v)
  32766. return e
  32767. }
  32768. func (e *htmlTd) Styles(s map[string]string) HTMLTd {
  32769. for k, v := range s {
  32770. e.Style(k, v)
  32771. }
  32772. return e
  32773. }
  32774. func (e *htmlTd) TabIndex(v int) HTMLTd {
  32775. e.setAttr("tabindex", v)
  32776. return e
  32777. }
  32778. func (e *htmlTd) Title(v string) HTMLTd {
  32779. e.setAttr("title", v)
  32780. return e
  32781. }
  32782. func (e *htmlTd) On(event string, h EventHandler, scope ...any) HTMLTd {
  32783. e.setEventHandler(event, h, scope...)
  32784. return e
  32785. }
  32786. func (e *htmlTd) OnBlur(h EventHandler, scope ...any) HTMLTd {
  32787. e.setEventHandler("blur", h, scope...)
  32788. return e
  32789. }
  32790. func (e *htmlTd) OnChange(h EventHandler, scope ...any) HTMLTd {
  32791. e.setEventHandler("change", h, scope...)
  32792. return e
  32793. }
  32794. func (e *htmlTd) OnClick(h EventHandler, scope ...any) HTMLTd {
  32795. e.setEventHandler("click", h, scope...)
  32796. return e
  32797. }
  32798. func (e *htmlTd) OnContextMenu(h EventHandler, scope ...any) HTMLTd {
  32799. e.setEventHandler("contextmenu", h, scope...)
  32800. return e
  32801. }
  32802. func (e *htmlTd) OnCopy(h EventHandler, scope ...any) HTMLTd {
  32803. e.setEventHandler("copy", h, scope...)
  32804. return e
  32805. }
  32806. func (e *htmlTd) OnCut(h EventHandler, scope ...any) HTMLTd {
  32807. e.setEventHandler("cut", h, scope...)
  32808. return e
  32809. }
  32810. func (e *htmlTd) OnDblClick(h EventHandler, scope ...any) HTMLTd {
  32811. e.setEventHandler("dblclick", h, scope...)
  32812. return e
  32813. }
  32814. func (e *htmlTd) OnDrag(h EventHandler, scope ...any) HTMLTd {
  32815. e.setEventHandler("drag", h, scope...)
  32816. return e
  32817. }
  32818. func (e *htmlTd) OnDragEnd(h EventHandler, scope ...any) HTMLTd {
  32819. e.setEventHandler("dragend", h, scope...)
  32820. return e
  32821. }
  32822. func (e *htmlTd) OnDragEnter(h EventHandler, scope ...any) HTMLTd {
  32823. e.setEventHandler("dragenter", h, scope...)
  32824. return e
  32825. }
  32826. func (e *htmlTd) OnDragLeave(h EventHandler, scope ...any) HTMLTd {
  32827. e.setEventHandler("dragleave", h, scope...)
  32828. return e
  32829. }
  32830. func (e *htmlTd) OnDragOver(h EventHandler, scope ...any) HTMLTd {
  32831. e.setEventHandler("dragover", h, scope...)
  32832. return e
  32833. }
  32834. func (e *htmlTd) OnDragStart(h EventHandler, scope ...any) HTMLTd {
  32835. e.setEventHandler("dragstart", h, scope...)
  32836. return e
  32837. }
  32838. func (e *htmlTd) OnDrop(h EventHandler, scope ...any) HTMLTd {
  32839. e.setEventHandler("drop", h, scope...)
  32840. return e
  32841. }
  32842. func (e *htmlTd) OnFocus(h EventHandler, scope ...any) HTMLTd {
  32843. e.setEventHandler("focus", h, scope...)
  32844. return e
  32845. }
  32846. func (e *htmlTd) OnInput(h EventHandler, scope ...any) HTMLTd {
  32847. e.setEventHandler("input", h, scope...)
  32848. return e
  32849. }
  32850. func (e *htmlTd) OnInvalid(h EventHandler, scope ...any) HTMLTd {
  32851. e.setEventHandler("invalid", h, scope...)
  32852. return e
  32853. }
  32854. func (e *htmlTd) OnKeyDown(h EventHandler, scope ...any) HTMLTd {
  32855. e.setEventHandler("keydown", h, scope...)
  32856. return e
  32857. }
  32858. func (e *htmlTd) OnKeyPress(h EventHandler, scope ...any) HTMLTd {
  32859. e.setEventHandler("keypress", h, scope...)
  32860. return e
  32861. }
  32862. func (e *htmlTd) OnKeyUp(h EventHandler, scope ...any) HTMLTd {
  32863. e.setEventHandler("keyup", h, scope...)
  32864. return e
  32865. }
  32866. func (e *htmlTd) OnMouseDown(h EventHandler, scope ...any) HTMLTd {
  32867. e.setEventHandler("mousedown", h, scope...)
  32868. return e
  32869. }
  32870. func (e *htmlTd) OnMouseMove(h EventHandler, scope ...any) HTMLTd {
  32871. e.setEventHandler("mousemove", h, scope...)
  32872. return e
  32873. }
  32874. func (e *htmlTd) OnMouseOut(h EventHandler, scope ...any) HTMLTd {
  32875. e.setEventHandler("mouseout", h, scope...)
  32876. return e
  32877. }
  32878. func (e *htmlTd) OnMouseOver(h EventHandler, scope ...any) HTMLTd {
  32879. e.setEventHandler("mouseover", h, scope...)
  32880. return e
  32881. }
  32882. func (e *htmlTd) OnMouseUp(h EventHandler, scope ...any) HTMLTd {
  32883. e.setEventHandler("mouseup", h, scope...)
  32884. return e
  32885. }
  32886. func (e *htmlTd) OnPaste(h EventHandler, scope ...any) HTMLTd {
  32887. e.setEventHandler("paste", h, scope...)
  32888. return e
  32889. }
  32890. func (e *htmlTd) OnReset(h EventHandler, scope ...any) HTMLTd {
  32891. e.setEventHandler("reset", h, scope...)
  32892. return e
  32893. }
  32894. func (e *htmlTd) OnScroll(h EventHandler, scope ...any) HTMLTd {
  32895. e.setEventHandler("scroll", h, scope...)
  32896. return e
  32897. }
  32898. func (e *htmlTd) OnSearch(h EventHandler, scope ...any) HTMLTd {
  32899. e.setEventHandler("search", h, scope...)
  32900. return e
  32901. }
  32902. func (e *htmlTd) OnSelect(h EventHandler, scope ...any) HTMLTd {
  32903. e.setEventHandler("select", h, scope...)
  32904. return e
  32905. }
  32906. func (e *htmlTd) OnSubmit(h EventHandler, scope ...any) HTMLTd {
  32907. e.setEventHandler("submit", h, scope...)
  32908. return e
  32909. }
  32910. func (e *htmlTd) OnWheel(h EventHandler, scope ...any) HTMLTd {
  32911. e.setEventHandler("wheel", h, scope...)
  32912. return e
  32913. }
  32914. // HTMLTemplate is the interface that describes a "template" HTML element.
  32915. type HTMLTemplate interface {
  32916. UI
  32917. // Body set the content of the element.
  32918. Body(elems ...UI) HTMLTemplate
  32919. // Text sets the content of the element with a text node containing the stringified given value.
  32920. Text(v any) HTMLTemplate
  32921. // AccessKey specifies a shortcut key to activate/focus an element.
  32922. AccessKey(v string) HTMLTemplate
  32923. // Aria stores accessible rich internet applications (ARIA) data.
  32924. Aria(k string, v any) HTMLTemplate
  32925. // Attr sets the named attribute with the given value.
  32926. Attr(n string, v any) HTMLTemplate
  32927. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  32928. Class(v ...string) HTMLTemplate
  32929. // ContentEditable specifies whether the content of an element is editable or not.
  32930. ContentEditable(v bool) HTMLTemplate
  32931. // DataSet stores custom data private to the page or application.
  32932. DataSet(k string, v any) HTMLTemplate
  32933. // Dir specifies the text direction for the content in an element.
  32934. Dir(v string) HTMLTemplate
  32935. // Draggable specifies whether an element is draggable or not.
  32936. Draggable(v bool) HTMLTemplate
  32937. // Hidden specifies that an element is not yet, or is no longer relevant.
  32938. Hidden(v bool) HTMLTemplate
  32939. // ID specifies a unique id for an element.
  32940. ID(v string) HTMLTemplate
  32941. // Lang specifies the language of the element's content.
  32942. Lang(v string) HTMLTemplate
  32943. // Role specifies to parsing software the exact function of an element (and its children).
  32944. Role(v string) HTMLTemplate
  32945. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  32946. Spellcheck(v bool) HTMLTemplate
  32947. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  32948. Style(k, v string) HTMLTemplate
  32949. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  32950. Styles(s map[string]string) HTMLTemplate
  32951. // TabIndex specifies the tabbing order of an element.
  32952. TabIndex(v int) HTMLTemplate
  32953. // Title specifies extra information about an element.
  32954. Title(v string) HTMLTemplate
  32955. // On registers the given event handler to the specified event.
  32956. On(event string, h EventHandler, scope ...any) HTMLTemplate
  32957. }
  32958. // Template returns an HTML element that defines a template.
  32959. func Template() HTMLTemplate {
  32960. e := &htmlTemplate{
  32961. htmlElement: htmlElement{
  32962. tag: "template",
  32963. isSelfClosing: false,
  32964. },
  32965. }
  32966. return e
  32967. }
  32968. type htmlTemplate struct {
  32969. htmlElement
  32970. }
  32971. func (e *htmlTemplate) Body(v ...UI) HTMLTemplate {
  32972. e.setChildren(v...)
  32973. return e
  32974. }
  32975. func (e *htmlTemplate) Text(v any) HTMLTemplate {
  32976. return e.Body(Text(v))
  32977. }
  32978. func (e *htmlTemplate) AccessKey(v string) HTMLTemplate {
  32979. e.setAttr("accesskey", v)
  32980. return e
  32981. }
  32982. func (e *htmlTemplate) Aria(k string, v any) HTMLTemplate {
  32983. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  32984. return e
  32985. }
  32986. func (e *htmlTemplate) Attr(n string, v any) HTMLTemplate {
  32987. e.setAttr(n, v)
  32988. return e
  32989. }
  32990. func (e *htmlTemplate) Class(v ...string) HTMLTemplate {
  32991. e.setAttr("class", strings.Join(v, " "))
  32992. return e
  32993. }
  32994. func (e *htmlTemplate) ContentEditable(v bool) HTMLTemplate {
  32995. e.setAttr("contenteditable", v)
  32996. return e
  32997. }
  32998. func (e *htmlTemplate) DataSet(k string, v any) HTMLTemplate {
  32999. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  33000. return e
  33001. }
  33002. func (e *htmlTemplate) Dir(v string) HTMLTemplate {
  33003. e.setAttr("dir", v)
  33004. return e
  33005. }
  33006. func (e *htmlTemplate) Draggable(v bool) HTMLTemplate {
  33007. e.setAttr("draggable", v)
  33008. return e
  33009. }
  33010. func (e *htmlTemplate) Hidden(v bool) HTMLTemplate {
  33011. e.setAttr("hidden", v)
  33012. return e
  33013. }
  33014. func (e *htmlTemplate) ID(v string) HTMLTemplate {
  33015. e.setAttr("id", v)
  33016. return e
  33017. }
  33018. func (e *htmlTemplate) Lang(v string) HTMLTemplate {
  33019. e.setAttr("lang", v)
  33020. return e
  33021. }
  33022. func (e *htmlTemplate) Role(v string) HTMLTemplate {
  33023. e.setAttr("role", v)
  33024. return e
  33025. }
  33026. func (e *htmlTemplate) Spellcheck(v bool) HTMLTemplate {
  33027. s := "false"
  33028. if v {
  33029. s = "true"
  33030. }
  33031. e.setAttr("spellcheck", s)
  33032. return e
  33033. }
  33034. func (e *htmlTemplate) Style(k, v string) HTMLTemplate {
  33035. e.setAttr("style", k+":"+v)
  33036. return e
  33037. }
  33038. func (e *htmlTemplate) Styles(s map[string]string) HTMLTemplate {
  33039. for k, v := range s {
  33040. e.Style(k, v)
  33041. }
  33042. return e
  33043. }
  33044. func (e *htmlTemplate) TabIndex(v int) HTMLTemplate {
  33045. e.setAttr("tabindex", v)
  33046. return e
  33047. }
  33048. func (e *htmlTemplate) Title(v string) HTMLTemplate {
  33049. e.setAttr("title", v)
  33050. return e
  33051. }
  33052. func (e *htmlTemplate) On(event string, h EventHandler, scope ...any) HTMLTemplate {
  33053. e.setEventHandler(event, h, scope...)
  33054. return e
  33055. }
  33056. // HTMLTextarea is the interface that describes a "textarea" HTML element.
  33057. type HTMLTextarea interface {
  33058. UI
  33059. // Body set the content of the element.
  33060. Body(elems ...UI) HTMLTextarea
  33061. // Text sets the content of the element with a text node containing the stringified given value.
  33062. Text(v any) HTMLTextarea
  33063. // AccessKey specifies a shortcut key to activate/focus an element.
  33064. AccessKey(v string) HTMLTextarea
  33065. // Aria stores accessible rich internet applications (ARIA) data.
  33066. Aria(k string, v any) HTMLTextarea
  33067. // Attr sets the named attribute with the given value.
  33068. Attr(n string, v any) HTMLTextarea
  33069. // AutoFocus specifies that the element should automatically get focus when the page loads.
  33070. AutoFocus(v bool) HTMLTextarea
  33071. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  33072. Class(v ...string) HTMLTextarea
  33073. // Cols specifies the visible width of a text area.
  33074. Cols(v int) HTMLTextarea
  33075. // ContentEditable specifies whether the content of an element is editable or not.
  33076. ContentEditable(v bool) HTMLTextarea
  33077. // DataSet stores custom data private to the page or application.
  33078. DataSet(k string, v any) HTMLTextarea
  33079. // Dir specifies the text direction for the content in an element.
  33080. Dir(v string) HTMLTextarea
  33081. // DirName specifies that the text direction will be submitted.
  33082. DirName(v string) HTMLTextarea
  33083. // Disabled specifies that the specified element/group of elements should be disabled.
  33084. Disabled(v bool) HTMLTextarea
  33085. // Draggable specifies whether an element is draggable or not.
  33086. Draggable(v bool) HTMLTextarea
  33087. // Form specifies the name of the form the element belongs to.
  33088. Form(v string) HTMLTextarea
  33089. // Hidden specifies that an element is not yet, or is no longer relevant.
  33090. Hidden(v bool) HTMLTextarea
  33091. // ID specifies a unique id for an element.
  33092. ID(v string) HTMLTextarea
  33093. // Lang specifies the language of the element's content.
  33094. Lang(v string) HTMLTextarea
  33095. // MaxLength specifies the maximum number of characters allowed in an element.
  33096. MaxLength(v int) HTMLTextarea
  33097. // Name specifies the name of the element.
  33098. Name(v string) HTMLTextarea
  33099. // Placeholder specifies a short hint that describes the expected value of the element.
  33100. Placeholder(v string) HTMLTextarea
  33101. // ReadOnly specifies that the element is read-only.
  33102. ReadOnly(v bool) HTMLTextarea
  33103. // Required specifies that the element must be filled out before submitting the form.
  33104. Required(v bool) HTMLTextarea
  33105. // Role specifies to parsing software the exact function of an element (and its children).
  33106. Role(v string) HTMLTextarea
  33107. // Rows specifies the visible number of lines in a text area.
  33108. Rows(v int) HTMLTextarea
  33109. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  33110. Spellcheck(v bool) HTMLTextarea
  33111. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  33112. Style(k, v string) HTMLTextarea
  33113. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  33114. Styles(s map[string]string) HTMLTextarea
  33115. // TabIndex specifies the tabbing order of an element.
  33116. TabIndex(v int) HTMLTextarea
  33117. // Title specifies extra information about an element.
  33118. Title(v string) HTMLTextarea
  33119. // Wrap specifies how the text in a text area is to be wrapped when submitted in a form.
  33120. Wrap(v string) HTMLTextarea
  33121. // On registers the given event handler to the specified event.
  33122. On(event string, h EventHandler, scope ...any) HTMLTextarea
  33123. // OnBlur calls the given handler when the element loses focus.
  33124. OnBlur(h EventHandler, scope ...any) HTMLTextarea
  33125. // OnChange calls the given handler when the value of the element is changed.
  33126. OnChange(h EventHandler, scope ...any) HTMLTextarea
  33127. // OnClick calls the given handler when there is a mouse click on the element.
  33128. OnClick(h EventHandler, scope ...any) HTMLTextarea
  33129. // OnContextMenu calls the given handler when a context menu is triggered.
  33130. OnContextMenu(h EventHandler, scope ...any) HTMLTextarea
  33131. // OnCopy calls the given handler when the user copies the content of an element.
  33132. OnCopy(h EventHandler, scope ...any) HTMLTextarea
  33133. // OnCut calls the given handler when the user cuts the content of an element.
  33134. OnCut(h EventHandler, scope ...any) HTMLTextarea
  33135. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  33136. OnDblClick(h EventHandler, scope ...any) HTMLTextarea
  33137. // OnDrag calls the given handler when an element is dragged.
  33138. OnDrag(h EventHandler, scope ...any) HTMLTextarea
  33139. // OnDragEnd calls the given handler at the end of a drag operation.
  33140. OnDragEnd(h EventHandler, scope ...any) HTMLTextarea
  33141. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  33142. OnDragEnter(h EventHandler, scope ...any) HTMLTextarea
  33143. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  33144. OnDragLeave(h EventHandler, scope ...any) HTMLTextarea
  33145. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  33146. OnDragOver(h EventHandler, scope ...any) HTMLTextarea
  33147. // OnDragStart calls the given handler at the start of a drag operation.
  33148. OnDragStart(h EventHandler, scope ...any) HTMLTextarea
  33149. // OnDrop calls the given handler when dragged element is being dropped.
  33150. OnDrop(h EventHandler, scope ...any) HTMLTextarea
  33151. // OnFocus calls the given handler when the element gets focus.
  33152. OnFocus(h EventHandler, scope ...any) HTMLTextarea
  33153. // OnInput calls the given handler when an element gets user input.
  33154. OnInput(h EventHandler, scope ...any) HTMLTextarea
  33155. // OnInvalid calls the given handler when an element is invalid.
  33156. OnInvalid(h EventHandler, scope ...any) HTMLTextarea
  33157. // OnKeyDown calls the given handler when a user is pressing a key.
  33158. OnKeyDown(h EventHandler, scope ...any) HTMLTextarea
  33159. // OnKeyPress calls the given handler when a user presses a key.
  33160. OnKeyPress(h EventHandler, scope ...any) HTMLTextarea
  33161. // OnKeyUp calls the given handler when a user releases a key.
  33162. OnKeyUp(h EventHandler, scope ...any) HTMLTextarea
  33163. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  33164. OnMouseDown(h EventHandler, scope ...any) HTMLTextarea
  33165. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  33166. OnMouseMove(h EventHandler, scope ...any) HTMLTextarea
  33167. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  33168. OnMouseOut(h EventHandler, scope ...any) HTMLTextarea
  33169. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  33170. OnMouseOver(h EventHandler, scope ...any) HTMLTextarea
  33171. // OnMouseUp calls the given handler when a mouse button is released over an element.
  33172. OnMouseUp(h EventHandler, scope ...any) HTMLTextarea
  33173. // OnPaste calls the given handler when the user pastes some content in an element.
  33174. OnPaste(h EventHandler, scope ...any) HTMLTextarea
  33175. // OnReset calls the given handler when the Reset button in a form is clicked.
  33176. OnReset(h EventHandler, scope ...any) HTMLTextarea
  33177. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  33178. OnScroll(h EventHandler, scope ...any) HTMLTextarea
  33179. // OnSearch calls the given handler when the user writes something in a search field.
  33180. OnSearch(h EventHandler, scope ...any) HTMLTextarea
  33181. // OnSelect calls the given handler after some text has been selected in an element.
  33182. OnSelect(h EventHandler, scope ...any) HTMLTextarea
  33183. // OnSubmit calls the given handler when a form is submitted.
  33184. OnSubmit(h EventHandler, scope ...any) HTMLTextarea
  33185. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  33186. OnWheel(h EventHandler, scope ...any) HTMLTextarea
  33187. }
  33188. // Textarea returns an HTML element that defines a multiline input control (text area).
  33189. func Textarea() HTMLTextarea {
  33190. e := &htmlTextarea{
  33191. htmlElement: htmlElement{
  33192. tag: "textarea",
  33193. isSelfClosing: false,
  33194. },
  33195. }
  33196. return e
  33197. }
  33198. type htmlTextarea struct {
  33199. htmlElement
  33200. }
  33201. func (e *htmlTextarea) Body(v ...UI) HTMLTextarea {
  33202. e.setChildren(v...)
  33203. return e
  33204. }
  33205. func (e *htmlTextarea) Text(v any) HTMLTextarea {
  33206. e.setAttr("value", v)
  33207. return e
  33208. }
  33209. func (e *htmlTextarea) AccessKey(v string) HTMLTextarea {
  33210. e.setAttr("accesskey", v)
  33211. return e
  33212. }
  33213. func (e *htmlTextarea) Aria(k string, v any) HTMLTextarea {
  33214. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  33215. return e
  33216. }
  33217. func (e *htmlTextarea) Attr(n string, v any) HTMLTextarea {
  33218. e.setAttr(n, v)
  33219. return e
  33220. }
  33221. func (e *htmlTextarea) AutoFocus(v bool) HTMLTextarea {
  33222. e.setAttr("autofocus", v)
  33223. return e
  33224. }
  33225. func (e *htmlTextarea) Class(v ...string) HTMLTextarea {
  33226. e.setAttr("class", strings.Join(v, " "))
  33227. return e
  33228. }
  33229. func (e *htmlTextarea) Cols(v int) HTMLTextarea {
  33230. e.setAttr("cols", v)
  33231. return e
  33232. }
  33233. func (e *htmlTextarea) ContentEditable(v bool) HTMLTextarea {
  33234. e.setAttr("contenteditable", v)
  33235. return e
  33236. }
  33237. func (e *htmlTextarea) DataSet(k string, v any) HTMLTextarea {
  33238. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  33239. return e
  33240. }
  33241. func (e *htmlTextarea) Dir(v string) HTMLTextarea {
  33242. e.setAttr("dir", v)
  33243. return e
  33244. }
  33245. func (e *htmlTextarea) DirName(v string) HTMLTextarea {
  33246. e.setAttr("dirname", v)
  33247. return e
  33248. }
  33249. func (e *htmlTextarea) Disabled(v bool) HTMLTextarea {
  33250. e.setAttr("disabled", v)
  33251. return e
  33252. }
  33253. func (e *htmlTextarea) Draggable(v bool) HTMLTextarea {
  33254. e.setAttr("draggable", v)
  33255. return e
  33256. }
  33257. func (e *htmlTextarea) Form(v string) HTMLTextarea {
  33258. e.setAttr("form", v)
  33259. return e
  33260. }
  33261. func (e *htmlTextarea) Hidden(v bool) HTMLTextarea {
  33262. e.setAttr("hidden", v)
  33263. return e
  33264. }
  33265. func (e *htmlTextarea) ID(v string) HTMLTextarea {
  33266. e.setAttr("id", v)
  33267. return e
  33268. }
  33269. func (e *htmlTextarea) Lang(v string) HTMLTextarea {
  33270. e.setAttr("lang", v)
  33271. return e
  33272. }
  33273. func (e *htmlTextarea) MaxLength(v int) HTMLTextarea {
  33274. e.setAttr("maxlength", v)
  33275. return e
  33276. }
  33277. func (e *htmlTextarea) Name(v string) HTMLTextarea {
  33278. e.setAttr("name", v)
  33279. return e
  33280. }
  33281. func (e *htmlTextarea) Placeholder(v string) HTMLTextarea {
  33282. e.setAttr("placeholder", v)
  33283. return e
  33284. }
  33285. func (e *htmlTextarea) ReadOnly(v bool) HTMLTextarea {
  33286. e.setAttr("readonly", v)
  33287. return e
  33288. }
  33289. func (e *htmlTextarea) Required(v bool) HTMLTextarea {
  33290. e.setAttr("required", v)
  33291. return e
  33292. }
  33293. func (e *htmlTextarea) Role(v string) HTMLTextarea {
  33294. e.setAttr("role", v)
  33295. return e
  33296. }
  33297. func (e *htmlTextarea) Rows(v int) HTMLTextarea {
  33298. e.setAttr("rows", v)
  33299. return e
  33300. }
  33301. func (e *htmlTextarea) Spellcheck(v bool) HTMLTextarea {
  33302. s := "false"
  33303. if v {
  33304. s = "true"
  33305. }
  33306. e.setAttr("spellcheck", s)
  33307. return e
  33308. }
  33309. func (e *htmlTextarea) Style(k, v string) HTMLTextarea {
  33310. e.setAttr("style", k+":"+v)
  33311. return e
  33312. }
  33313. func (e *htmlTextarea) Styles(s map[string]string) HTMLTextarea {
  33314. for k, v := range s {
  33315. e.Style(k, v)
  33316. }
  33317. return e
  33318. }
  33319. func (e *htmlTextarea) TabIndex(v int) HTMLTextarea {
  33320. e.setAttr("tabindex", v)
  33321. return e
  33322. }
  33323. func (e *htmlTextarea) Title(v string) HTMLTextarea {
  33324. e.setAttr("title", v)
  33325. return e
  33326. }
  33327. func (e *htmlTextarea) Wrap(v string) HTMLTextarea {
  33328. e.setAttr("wrap", v)
  33329. return e
  33330. }
  33331. func (e *htmlTextarea) On(event string, h EventHandler, scope ...any) HTMLTextarea {
  33332. e.setEventHandler(event, h, scope...)
  33333. return e
  33334. }
  33335. func (e *htmlTextarea) OnBlur(h EventHandler, scope ...any) HTMLTextarea {
  33336. e.setEventHandler("blur", h, scope...)
  33337. return e
  33338. }
  33339. func (e *htmlTextarea) OnChange(h EventHandler, scope ...any) HTMLTextarea {
  33340. e.setEventHandler("change", h, scope...)
  33341. return e
  33342. }
  33343. func (e *htmlTextarea) OnClick(h EventHandler, scope ...any) HTMLTextarea {
  33344. e.setEventHandler("click", h, scope...)
  33345. return e
  33346. }
  33347. func (e *htmlTextarea) OnContextMenu(h EventHandler, scope ...any) HTMLTextarea {
  33348. e.setEventHandler("contextmenu", h, scope...)
  33349. return e
  33350. }
  33351. func (e *htmlTextarea) OnCopy(h EventHandler, scope ...any) HTMLTextarea {
  33352. e.setEventHandler("copy", h, scope...)
  33353. return e
  33354. }
  33355. func (e *htmlTextarea) OnCut(h EventHandler, scope ...any) HTMLTextarea {
  33356. e.setEventHandler("cut", h, scope...)
  33357. return e
  33358. }
  33359. func (e *htmlTextarea) OnDblClick(h EventHandler, scope ...any) HTMLTextarea {
  33360. e.setEventHandler("dblclick", h, scope...)
  33361. return e
  33362. }
  33363. func (e *htmlTextarea) OnDrag(h EventHandler, scope ...any) HTMLTextarea {
  33364. e.setEventHandler("drag", h, scope...)
  33365. return e
  33366. }
  33367. func (e *htmlTextarea) OnDragEnd(h EventHandler, scope ...any) HTMLTextarea {
  33368. e.setEventHandler("dragend", h, scope...)
  33369. return e
  33370. }
  33371. func (e *htmlTextarea) OnDragEnter(h EventHandler, scope ...any) HTMLTextarea {
  33372. e.setEventHandler("dragenter", h, scope...)
  33373. return e
  33374. }
  33375. func (e *htmlTextarea) OnDragLeave(h EventHandler, scope ...any) HTMLTextarea {
  33376. e.setEventHandler("dragleave", h, scope...)
  33377. return e
  33378. }
  33379. func (e *htmlTextarea) OnDragOver(h EventHandler, scope ...any) HTMLTextarea {
  33380. e.setEventHandler("dragover", h, scope...)
  33381. return e
  33382. }
  33383. func (e *htmlTextarea) OnDragStart(h EventHandler, scope ...any) HTMLTextarea {
  33384. e.setEventHandler("dragstart", h, scope...)
  33385. return e
  33386. }
  33387. func (e *htmlTextarea) OnDrop(h EventHandler, scope ...any) HTMLTextarea {
  33388. e.setEventHandler("drop", h, scope...)
  33389. return e
  33390. }
  33391. func (e *htmlTextarea) OnFocus(h EventHandler, scope ...any) HTMLTextarea {
  33392. e.setEventHandler("focus", h, scope...)
  33393. return e
  33394. }
  33395. func (e *htmlTextarea) OnInput(h EventHandler, scope ...any) HTMLTextarea {
  33396. e.setEventHandler("input", h, scope...)
  33397. return e
  33398. }
  33399. func (e *htmlTextarea) OnInvalid(h EventHandler, scope ...any) HTMLTextarea {
  33400. e.setEventHandler("invalid", h, scope...)
  33401. return e
  33402. }
  33403. func (e *htmlTextarea) OnKeyDown(h EventHandler, scope ...any) HTMLTextarea {
  33404. e.setEventHandler("keydown", h, scope...)
  33405. return e
  33406. }
  33407. func (e *htmlTextarea) OnKeyPress(h EventHandler, scope ...any) HTMLTextarea {
  33408. e.setEventHandler("keypress", h, scope...)
  33409. return e
  33410. }
  33411. func (e *htmlTextarea) OnKeyUp(h EventHandler, scope ...any) HTMLTextarea {
  33412. e.setEventHandler("keyup", h, scope...)
  33413. return e
  33414. }
  33415. func (e *htmlTextarea) OnMouseDown(h EventHandler, scope ...any) HTMLTextarea {
  33416. e.setEventHandler("mousedown", h, scope...)
  33417. return e
  33418. }
  33419. func (e *htmlTextarea) OnMouseMove(h EventHandler, scope ...any) HTMLTextarea {
  33420. e.setEventHandler("mousemove", h, scope...)
  33421. return e
  33422. }
  33423. func (e *htmlTextarea) OnMouseOut(h EventHandler, scope ...any) HTMLTextarea {
  33424. e.setEventHandler("mouseout", h, scope...)
  33425. return e
  33426. }
  33427. func (e *htmlTextarea) OnMouseOver(h EventHandler, scope ...any) HTMLTextarea {
  33428. e.setEventHandler("mouseover", h, scope...)
  33429. return e
  33430. }
  33431. func (e *htmlTextarea) OnMouseUp(h EventHandler, scope ...any) HTMLTextarea {
  33432. e.setEventHandler("mouseup", h, scope...)
  33433. return e
  33434. }
  33435. func (e *htmlTextarea) OnPaste(h EventHandler, scope ...any) HTMLTextarea {
  33436. e.setEventHandler("paste", h, scope...)
  33437. return e
  33438. }
  33439. func (e *htmlTextarea) OnReset(h EventHandler, scope ...any) HTMLTextarea {
  33440. e.setEventHandler("reset", h, scope...)
  33441. return e
  33442. }
  33443. func (e *htmlTextarea) OnScroll(h EventHandler, scope ...any) HTMLTextarea {
  33444. e.setEventHandler("scroll", h, scope...)
  33445. return e
  33446. }
  33447. func (e *htmlTextarea) OnSearch(h EventHandler, scope ...any) HTMLTextarea {
  33448. e.setEventHandler("search", h, scope...)
  33449. return e
  33450. }
  33451. func (e *htmlTextarea) OnSelect(h EventHandler, scope ...any) HTMLTextarea {
  33452. e.setEventHandler("select", h, scope...)
  33453. return e
  33454. }
  33455. func (e *htmlTextarea) OnSubmit(h EventHandler, scope ...any) HTMLTextarea {
  33456. e.setEventHandler("submit", h, scope...)
  33457. return e
  33458. }
  33459. func (e *htmlTextarea) OnWheel(h EventHandler, scope ...any) HTMLTextarea {
  33460. e.setEventHandler("wheel", h, scope...)
  33461. return e
  33462. }
  33463. // HTMLTFoot is the interface that describes a "tfoot" HTML element.
  33464. type HTMLTFoot interface {
  33465. UI
  33466. // Body set the content of the element.
  33467. Body(elems ...UI) HTMLTFoot
  33468. // Text sets the content of the element with a text node containing the stringified given value.
  33469. Text(v any) HTMLTFoot
  33470. // AccessKey specifies a shortcut key to activate/focus an element.
  33471. AccessKey(v string) HTMLTFoot
  33472. // Aria stores accessible rich internet applications (ARIA) data.
  33473. Aria(k string, v any) HTMLTFoot
  33474. // Attr sets the named attribute with the given value.
  33475. Attr(n string, v any) HTMLTFoot
  33476. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  33477. Class(v ...string) HTMLTFoot
  33478. // ContentEditable specifies whether the content of an element is editable or not.
  33479. ContentEditable(v bool) HTMLTFoot
  33480. // DataSet stores custom data private to the page or application.
  33481. DataSet(k string, v any) HTMLTFoot
  33482. // Dir specifies the text direction for the content in an element.
  33483. Dir(v string) HTMLTFoot
  33484. // Draggable specifies whether an element is draggable or not.
  33485. Draggable(v bool) HTMLTFoot
  33486. // Hidden specifies that an element is not yet, or is no longer relevant.
  33487. Hidden(v bool) HTMLTFoot
  33488. // ID specifies a unique id for an element.
  33489. ID(v string) HTMLTFoot
  33490. // Lang specifies the language of the element's content.
  33491. Lang(v string) HTMLTFoot
  33492. // Role specifies to parsing software the exact function of an element (and its children).
  33493. Role(v string) HTMLTFoot
  33494. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  33495. Spellcheck(v bool) HTMLTFoot
  33496. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  33497. Style(k, v string) HTMLTFoot
  33498. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  33499. Styles(s map[string]string) HTMLTFoot
  33500. // TabIndex specifies the tabbing order of an element.
  33501. TabIndex(v int) HTMLTFoot
  33502. // Title specifies extra information about an element.
  33503. Title(v string) HTMLTFoot
  33504. // On registers the given event handler to the specified event.
  33505. On(event string, h EventHandler, scope ...any) HTMLTFoot
  33506. // OnBlur calls the given handler when the element loses focus.
  33507. OnBlur(h EventHandler, scope ...any) HTMLTFoot
  33508. // OnChange calls the given handler when the value of the element is changed.
  33509. OnChange(h EventHandler, scope ...any) HTMLTFoot
  33510. // OnClick calls the given handler when there is a mouse click on the element.
  33511. OnClick(h EventHandler, scope ...any) HTMLTFoot
  33512. // OnContextMenu calls the given handler when a context menu is triggered.
  33513. OnContextMenu(h EventHandler, scope ...any) HTMLTFoot
  33514. // OnCopy calls the given handler when the user copies the content of an element.
  33515. OnCopy(h EventHandler, scope ...any) HTMLTFoot
  33516. // OnCut calls the given handler when the user cuts the content of an element.
  33517. OnCut(h EventHandler, scope ...any) HTMLTFoot
  33518. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  33519. OnDblClick(h EventHandler, scope ...any) HTMLTFoot
  33520. // OnDrag calls the given handler when an element is dragged.
  33521. OnDrag(h EventHandler, scope ...any) HTMLTFoot
  33522. // OnDragEnd calls the given handler at the end of a drag operation.
  33523. OnDragEnd(h EventHandler, scope ...any) HTMLTFoot
  33524. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  33525. OnDragEnter(h EventHandler, scope ...any) HTMLTFoot
  33526. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  33527. OnDragLeave(h EventHandler, scope ...any) HTMLTFoot
  33528. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  33529. OnDragOver(h EventHandler, scope ...any) HTMLTFoot
  33530. // OnDragStart calls the given handler at the start of a drag operation.
  33531. OnDragStart(h EventHandler, scope ...any) HTMLTFoot
  33532. // OnDrop calls the given handler when dragged element is being dropped.
  33533. OnDrop(h EventHandler, scope ...any) HTMLTFoot
  33534. // OnFocus calls the given handler when the element gets focus.
  33535. OnFocus(h EventHandler, scope ...any) HTMLTFoot
  33536. // OnInput calls the given handler when an element gets user input.
  33537. OnInput(h EventHandler, scope ...any) HTMLTFoot
  33538. // OnInvalid calls the given handler when an element is invalid.
  33539. OnInvalid(h EventHandler, scope ...any) HTMLTFoot
  33540. // OnKeyDown calls the given handler when a user is pressing a key.
  33541. OnKeyDown(h EventHandler, scope ...any) HTMLTFoot
  33542. // OnKeyPress calls the given handler when a user presses a key.
  33543. OnKeyPress(h EventHandler, scope ...any) HTMLTFoot
  33544. // OnKeyUp calls the given handler when a user releases a key.
  33545. OnKeyUp(h EventHandler, scope ...any) HTMLTFoot
  33546. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  33547. OnMouseDown(h EventHandler, scope ...any) HTMLTFoot
  33548. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  33549. OnMouseMove(h EventHandler, scope ...any) HTMLTFoot
  33550. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  33551. OnMouseOut(h EventHandler, scope ...any) HTMLTFoot
  33552. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  33553. OnMouseOver(h EventHandler, scope ...any) HTMLTFoot
  33554. // OnMouseUp calls the given handler when a mouse button is released over an element.
  33555. OnMouseUp(h EventHandler, scope ...any) HTMLTFoot
  33556. // OnPaste calls the given handler when the user pastes some content in an element.
  33557. OnPaste(h EventHandler, scope ...any) HTMLTFoot
  33558. // OnReset calls the given handler when the Reset button in a form is clicked.
  33559. OnReset(h EventHandler, scope ...any) HTMLTFoot
  33560. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  33561. OnScroll(h EventHandler, scope ...any) HTMLTFoot
  33562. // OnSearch calls the given handler when the user writes something in a search field.
  33563. OnSearch(h EventHandler, scope ...any) HTMLTFoot
  33564. // OnSelect calls the given handler after some text has been selected in an element.
  33565. OnSelect(h EventHandler, scope ...any) HTMLTFoot
  33566. // OnSubmit calls the given handler when a form is submitted.
  33567. OnSubmit(h EventHandler, scope ...any) HTMLTFoot
  33568. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  33569. OnWheel(h EventHandler, scope ...any) HTMLTFoot
  33570. }
  33571. // TFoot returns an HTML element that groups the footer content in a table.
  33572. func TFoot() HTMLTFoot {
  33573. e := &htmlTFoot{
  33574. htmlElement: htmlElement{
  33575. tag: "tfoot",
  33576. isSelfClosing: false,
  33577. },
  33578. }
  33579. return e
  33580. }
  33581. type htmlTFoot struct {
  33582. htmlElement
  33583. }
  33584. func (e *htmlTFoot) Body(v ...UI) HTMLTFoot {
  33585. e.setChildren(v...)
  33586. return e
  33587. }
  33588. func (e *htmlTFoot) Text(v any) HTMLTFoot {
  33589. return e.Body(Text(v))
  33590. }
  33591. func (e *htmlTFoot) AccessKey(v string) HTMLTFoot {
  33592. e.setAttr("accesskey", v)
  33593. return e
  33594. }
  33595. func (e *htmlTFoot) Aria(k string, v any) HTMLTFoot {
  33596. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  33597. return e
  33598. }
  33599. func (e *htmlTFoot) Attr(n string, v any) HTMLTFoot {
  33600. e.setAttr(n, v)
  33601. return e
  33602. }
  33603. func (e *htmlTFoot) Class(v ...string) HTMLTFoot {
  33604. e.setAttr("class", strings.Join(v, " "))
  33605. return e
  33606. }
  33607. func (e *htmlTFoot) ContentEditable(v bool) HTMLTFoot {
  33608. e.setAttr("contenteditable", v)
  33609. return e
  33610. }
  33611. func (e *htmlTFoot) DataSet(k string, v any) HTMLTFoot {
  33612. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  33613. return e
  33614. }
  33615. func (e *htmlTFoot) Dir(v string) HTMLTFoot {
  33616. e.setAttr("dir", v)
  33617. return e
  33618. }
  33619. func (e *htmlTFoot) Draggable(v bool) HTMLTFoot {
  33620. e.setAttr("draggable", v)
  33621. return e
  33622. }
  33623. func (e *htmlTFoot) Hidden(v bool) HTMLTFoot {
  33624. e.setAttr("hidden", v)
  33625. return e
  33626. }
  33627. func (e *htmlTFoot) ID(v string) HTMLTFoot {
  33628. e.setAttr("id", v)
  33629. return e
  33630. }
  33631. func (e *htmlTFoot) Lang(v string) HTMLTFoot {
  33632. e.setAttr("lang", v)
  33633. return e
  33634. }
  33635. func (e *htmlTFoot) Role(v string) HTMLTFoot {
  33636. e.setAttr("role", v)
  33637. return e
  33638. }
  33639. func (e *htmlTFoot) Spellcheck(v bool) HTMLTFoot {
  33640. s := "false"
  33641. if v {
  33642. s = "true"
  33643. }
  33644. e.setAttr("spellcheck", s)
  33645. return e
  33646. }
  33647. func (e *htmlTFoot) Style(k, v string) HTMLTFoot {
  33648. e.setAttr("style", k+":"+v)
  33649. return e
  33650. }
  33651. func (e *htmlTFoot) Styles(s map[string]string) HTMLTFoot {
  33652. for k, v := range s {
  33653. e.Style(k, v)
  33654. }
  33655. return e
  33656. }
  33657. func (e *htmlTFoot) TabIndex(v int) HTMLTFoot {
  33658. e.setAttr("tabindex", v)
  33659. return e
  33660. }
  33661. func (e *htmlTFoot) Title(v string) HTMLTFoot {
  33662. e.setAttr("title", v)
  33663. return e
  33664. }
  33665. func (e *htmlTFoot) On(event string, h EventHandler, scope ...any) HTMLTFoot {
  33666. e.setEventHandler(event, h, scope...)
  33667. return e
  33668. }
  33669. func (e *htmlTFoot) OnBlur(h EventHandler, scope ...any) HTMLTFoot {
  33670. e.setEventHandler("blur", h, scope...)
  33671. return e
  33672. }
  33673. func (e *htmlTFoot) OnChange(h EventHandler, scope ...any) HTMLTFoot {
  33674. e.setEventHandler("change", h, scope...)
  33675. return e
  33676. }
  33677. func (e *htmlTFoot) OnClick(h EventHandler, scope ...any) HTMLTFoot {
  33678. e.setEventHandler("click", h, scope...)
  33679. return e
  33680. }
  33681. func (e *htmlTFoot) OnContextMenu(h EventHandler, scope ...any) HTMLTFoot {
  33682. e.setEventHandler("contextmenu", h, scope...)
  33683. return e
  33684. }
  33685. func (e *htmlTFoot) OnCopy(h EventHandler, scope ...any) HTMLTFoot {
  33686. e.setEventHandler("copy", h, scope...)
  33687. return e
  33688. }
  33689. func (e *htmlTFoot) OnCut(h EventHandler, scope ...any) HTMLTFoot {
  33690. e.setEventHandler("cut", h, scope...)
  33691. return e
  33692. }
  33693. func (e *htmlTFoot) OnDblClick(h EventHandler, scope ...any) HTMLTFoot {
  33694. e.setEventHandler("dblclick", h, scope...)
  33695. return e
  33696. }
  33697. func (e *htmlTFoot) OnDrag(h EventHandler, scope ...any) HTMLTFoot {
  33698. e.setEventHandler("drag", h, scope...)
  33699. return e
  33700. }
  33701. func (e *htmlTFoot) OnDragEnd(h EventHandler, scope ...any) HTMLTFoot {
  33702. e.setEventHandler("dragend", h, scope...)
  33703. return e
  33704. }
  33705. func (e *htmlTFoot) OnDragEnter(h EventHandler, scope ...any) HTMLTFoot {
  33706. e.setEventHandler("dragenter", h, scope...)
  33707. return e
  33708. }
  33709. func (e *htmlTFoot) OnDragLeave(h EventHandler, scope ...any) HTMLTFoot {
  33710. e.setEventHandler("dragleave", h, scope...)
  33711. return e
  33712. }
  33713. func (e *htmlTFoot) OnDragOver(h EventHandler, scope ...any) HTMLTFoot {
  33714. e.setEventHandler("dragover", h, scope...)
  33715. return e
  33716. }
  33717. func (e *htmlTFoot) OnDragStart(h EventHandler, scope ...any) HTMLTFoot {
  33718. e.setEventHandler("dragstart", h, scope...)
  33719. return e
  33720. }
  33721. func (e *htmlTFoot) OnDrop(h EventHandler, scope ...any) HTMLTFoot {
  33722. e.setEventHandler("drop", h, scope...)
  33723. return e
  33724. }
  33725. func (e *htmlTFoot) OnFocus(h EventHandler, scope ...any) HTMLTFoot {
  33726. e.setEventHandler("focus", h, scope...)
  33727. return e
  33728. }
  33729. func (e *htmlTFoot) OnInput(h EventHandler, scope ...any) HTMLTFoot {
  33730. e.setEventHandler("input", h, scope...)
  33731. return e
  33732. }
  33733. func (e *htmlTFoot) OnInvalid(h EventHandler, scope ...any) HTMLTFoot {
  33734. e.setEventHandler("invalid", h, scope...)
  33735. return e
  33736. }
  33737. func (e *htmlTFoot) OnKeyDown(h EventHandler, scope ...any) HTMLTFoot {
  33738. e.setEventHandler("keydown", h, scope...)
  33739. return e
  33740. }
  33741. func (e *htmlTFoot) OnKeyPress(h EventHandler, scope ...any) HTMLTFoot {
  33742. e.setEventHandler("keypress", h, scope...)
  33743. return e
  33744. }
  33745. func (e *htmlTFoot) OnKeyUp(h EventHandler, scope ...any) HTMLTFoot {
  33746. e.setEventHandler("keyup", h, scope...)
  33747. return e
  33748. }
  33749. func (e *htmlTFoot) OnMouseDown(h EventHandler, scope ...any) HTMLTFoot {
  33750. e.setEventHandler("mousedown", h, scope...)
  33751. return e
  33752. }
  33753. func (e *htmlTFoot) OnMouseMove(h EventHandler, scope ...any) HTMLTFoot {
  33754. e.setEventHandler("mousemove", h, scope...)
  33755. return e
  33756. }
  33757. func (e *htmlTFoot) OnMouseOut(h EventHandler, scope ...any) HTMLTFoot {
  33758. e.setEventHandler("mouseout", h, scope...)
  33759. return e
  33760. }
  33761. func (e *htmlTFoot) OnMouseOver(h EventHandler, scope ...any) HTMLTFoot {
  33762. e.setEventHandler("mouseover", h, scope...)
  33763. return e
  33764. }
  33765. func (e *htmlTFoot) OnMouseUp(h EventHandler, scope ...any) HTMLTFoot {
  33766. e.setEventHandler("mouseup", h, scope...)
  33767. return e
  33768. }
  33769. func (e *htmlTFoot) OnPaste(h EventHandler, scope ...any) HTMLTFoot {
  33770. e.setEventHandler("paste", h, scope...)
  33771. return e
  33772. }
  33773. func (e *htmlTFoot) OnReset(h EventHandler, scope ...any) HTMLTFoot {
  33774. e.setEventHandler("reset", h, scope...)
  33775. return e
  33776. }
  33777. func (e *htmlTFoot) OnScroll(h EventHandler, scope ...any) HTMLTFoot {
  33778. e.setEventHandler("scroll", h, scope...)
  33779. return e
  33780. }
  33781. func (e *htmlTFoot) OnSearch(h EventHandler, scope ...any) HTMLTFoot {
  33782. e.setEventHandler("search", h, scope...)
  33783. return e
  33784. }
  33785. func (e *htmlTFoot) OnSelect(h EventHandler, scope ...any) HTMLTFoot {
  33786. e.setEventHandler("select", h, scope...)
  33787. return e
  33788. }
  33789. func (e *htmlTFoot) OnSubmit(h EventHandler, scope ...any) HTMLTFoot {
  33790. e.setEventHandler("submit", h, scope...)
  33791. return e
  33792. }
  33793. func (e *htmlTFoot) OnWheel(h EventHandler, scope ...any) HTMLTFoot {
  33794. e.setEventHandler("wheel", h, scope...)
  33795. return e
  33796. }
  33797. // HTMLTh is the interface that describes a "th" HTML element.
  33798. type HTMLTh interface {
  33799. UI
  33800. // Body set the content of the element.
  33801. Body(elems ...UI) HTMLTh
  33802. // Text sets the content of the element with a text node containing the stringified given value.
  33803. Text(v any) HTMLTh
  33804. // Abbr specifies an abbreviated version of the content in a header cell.
  33805. Abbr(v string) HTMLTh
  33806. // AccessKey specifies a shortcut key to activate/focus an element.
  33807. AccessKey(v string) HTMLTh
  33808. // Aria stores accessible rich internet applications (ARIA) data.
  33809. Aria(k string, v any) HTMLTh
  33810. // Attr sets the named attribute with the given value.
  33811. Attr(n string, v any) HTMLTh
  33812. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  33813. Class(v ...string) HTMLTh
  33814. // ColSpan specifies the number of columns a table cell should span.
  33815. ColSpan(v int) HTMLTh
  33816. // ContentEditable specifies whether the content of an element is editable or not.
  33817. ContentEditable(v bool) HTMLTh
  33818. // DataSet stores custom data private to the page or application.
  33819. DataSet(k string, v any) HTMLTh
  33820. // Dir specifies the text direction for the content in an element.
  33821. Dir(v string) HTMLTh
  33822. // Draggable specifies whether an element is draggable or not.
  33823. Draggable(v bool) HTMLTh
  33824. // Headers specifies one or more headers cells a cell is related to.
  33825. Headers(v string) HTMLTh
  33826. // Hidden specifies that an element is not yet, or is no longer relevant.
  33827. Hidden(v bool) HTMLTh
  33828. // ID specifies a unique id for an element.
  33829. ID(v string) HTMLTh
  33830. // Lang specifies the language of the element's content.
  33831. Lang(v string) HTMLTh
  33832. // Role specifies to parsing software the exact function of an element (and its children).
  33833. Role(v string) HTMLTh
  33834. // Rowspan specifies the number of rows a table cell should span.
  33835. Rowspan(v int) HTMLTh
  33836. // Scope specifies whether a header cell is a header for a column, row, or group of columns or rows.
  33837. Scope(v string) HTMLTh
  33838. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  33839. Spellcheck(v bool) HTMLTh
  33840. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  33841. Style(k, v string) HTMLTh
  33842. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  33843. Styles(s map[string]string) HTMLTh
  33844. // TabIndex specifies the tabbing order of an element.
  33845. TabIndex(v int) HTMLTh
  33846. // Title specifies extra information about an element.
  33847. Title(v string) HTMLTh
  33848. // On registers the given event handler to the specified event.
  33849. On(event string, h EventHandler, scope ...any) HTMLTh
  33850. // OnBlur calls the given handler when the element loses focus.
  33851. OnBlur(h EventHandler, scope ...any) HTMLTh
  33852. // OnChange calls the given handler when the value of the element is changed.
  33853. OnChange(h EventHandler, scope ...any) HTMLTh
  33854. // OnClick calls the given handler when there is a mouse click on the element.
  33855. OnClick(h EventHandler, scope ...any) HTMLTh
  33856. // OnContextMenu calls the given handler when a context menu is triggered.
  33857. OnContextMenu(h EventHandler, scope ...any) HTMLTh
  33858. // OnCopy calls the given handler when the user copies the content of an element.
  33859. OnCopy(h EventHandler, scope ...any) HTMLTh
  33860. // OnCut calls the given handler when the user cuts the content of an element.
  33861. OnCut(h EventHandler, scope ...any) HTMLTh
  33862. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  33863. OnDblClick(h EventHandler, scope ...any) HTMLTh
  33864. // OnDrag calls the given handler when an element is dragged.
  33865. OnDrag(h EventHandler, scope ...any) HTMLTh
  33866. // OnDragEnd calls the given handler at the end of a drag operation.
  33867. OnDragEnd(h EventHandler, scope ...any) HTMLTh
  33868. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  33869. OnDragEnter(h EventHandler, scope ...any) HTMLTh
  33870. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  33871. OnDragLeave(h EventHandler, scope ...any) HTMLTh
  33872. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  33873. OnDragOver(h EventHandler, scope ...any) HTMLTh
  33874. // OnDragStart calls the given handler at the start of a drag operation.
  33875. OnDragStart(h EventHandler, scope ...any) HTMLTh
  33876. // OnDrop calls the given handler when dragged element is being dropped.
  33877. OnDrop(h EventHandler, scope ...any) HTMLTh
  33878. // OnFocus calls the given handler when the element gets focus.
  33879. OnFocus(h EventHandler, scope ...any) HTMLTh
  33880. // OnInput calls the given handler when an element gets user input.
  33881. OnInput(h EventHandler, scope ...any) HTMLTh
  33882. // OnInvalid calls the given handler when an element is invalid.
  33883. OnInvalid(h EventHandler, scope ...any) HTMLTh
  33884. // OnKeyDown calls the given handler when a user is pressing a key.
  33885. OnKeyDown(h EventHandler, scope ...any) HTMLTh
  33886. // OnKeyPress calls the given handler when a user presses a key.
  33887. OnKeyPress(h EventHandler, scope ...any) HTMLTh
  33888. // OnKeyUp calls the given handler when a user releases a key.
  33889. OnKeyUp(h EventHandler, scope ...any) HTMLTh
  33890. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  33891. OnMouseDown(h EventHandler, scope ...any) HTMLTh
  33892. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  33893. OnMouseMove(h EventHandler, scope ...any) HTMLTh
  33894. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  33895. OnMouseOut(h EventHandler, scope ...any) HTMLTh
  33896. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  33897. OnMouseOver(h EventHandler, scope ...any) HTMLTh
  33898. // OnMouseUp calls the given handler when a mouse button is released over an element.
  33899. OnMouseUp(h EventHandler, scope ...any) HTMLTh
  33900. // OnPaste calls the given handler when the user pastes some content in an element.
  33901. OnPaste(h EventHandler, scope ...any) HTMLTh
  33902. // OnReset calls the given handler when the Reset button in a form is clicked.
  33903. OnReset(h EventHandler, scope ...any) HTMLTh
  33904. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  33905. OnScroll(h EventHandler, scope ...any) HTMLTh
  33906. // OnSearch calls the given handler when the user writes something in a search field.
  33907. OnSearch(h EventHandler, scope ...any) HTMLTh
  33908. // OnSelect calls the given handler after some text has been selected in an element.
  33909. OnSelect(h EventHandler, scope ...any) HTMLTh
  33910. // OnSubmit calls the given handler when a form is submitted.
  33911. OnSubmit(h EventHandler, scope ...any) HTMLTh
  33912. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  33913. OnWheel(h EventHandler, scope ...any) HTMLTh
  33914. }
  33915. // Th returns an HTML element that defines a header cell in a table.
  33916. func Th() HTMLTh {
  33917. e := &htmlTh{
  33918. htmlElement: htmlElement{
  33919. tag: "th",
  33920. isSelfClosing: false,
  33921. },
  33922. }
  33923. return e
  33924. }
  33925. type htmlTh struct {
  33926. htmlElement
  33927. }
  33928. func (e *htmlTh) Body(v ...UI) HTMLTh {
  33929. e.setChildren(v...)
  33930. return e
  33931. }
  33932. func (e *htmlTh) Text(v any) HTMLTh {
  33933. return e.Body(Text(v))
  33934. }
  33935. func (e *htmlTh) Abbr(v string) HTMLTh {
  33936. e.setAttr("abbr", v)
  33937. return e
  33938. }
  33939. func (e *htmlTh) AccessKey(v string) HTMLTh {
  33940. e.setAttr("accesskey", v)
  33941. return e
  33942. }
  33943. func (e *htmlTh) Aria(k string, v any) HTMLTh {
  33944. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  33945. return e
  33946. }
  33947. func (e *htmlTh) Attr(n string, v any) HTMLTh {
  33948. e.setAttr(n, v)
  33949. return e
  33950. }
  33951. func (e *htmlTh) Class(v ...string) HTMLTh {
  33952. e.setAttr("class", strings.Join(v, " "))
  33953. return e
  33954. }
  33955. func (e *htmlTh) ColSpan(v int) HTMLTh {
  33956. e.setAttr("colspan", v)
  33957. return e
  33958. }
  33959. func (e *htmlTh) ContentEditable(v bool) HTMLTh {
  33960. e.setAttr("contenteditable", v)
  33961. return e
  33962. }
  33963. func (e *htmlTh) DataSet(k string, v any) HTMLTh {
  33964. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  33965. return e
  33966. }
  33967. func (e *htmlTh) Dir(v string) HTMLTh {
  33968. e.setAttr("dir", v)
  33969. return e
  33970. }
  33971. func (e *htmlTh) Draggable(v bool) HTMLTh {
  33972. e.setAttr("draggable", v)
  33973. return e
  33974. }
  33975. func (e *htmlTh) Headers(v string) HTMLTh {
  33976. e.setAttr("headers", v)
  33977. return e
  33978. }
  33979. func (e *htmlTh) Hidden(v bool) HTMLTh {
  33980. e.setAttr("hidden", v)
  33981. return e
  33982. }
  33983. func (e *htmlTh) ID(v string) HTMLTh {
  33984. e.setAttr("id", v)
  33985. return e
  33986. }
  33987. func (e *htmlTh) Lang(v string) HTMLTh {
  33988. e.setAttr("lang", v)
  33989. return e
  33990. }
  33991. func (e *htmlTh) Role(v string) HTMLTh {
  33992. e.setAttr("role", v)
  33993. return e
  33994. }
  33995. func (e *htmlTh) Rowspan(v int) HTMLTh {
  33996. e.setAttr("rowspan", v)
  33997. return e
  33998. }
  33999. func (e *htmlTh) Scope(v string) HTMLTh {
  34000. e.setAttr("scope", v)
  34001. return e
  34002. }
  34003. func (e *htmlTh) Spellcheck(v bool) HTMLTh {
  34004. s := "false"
  34005. if v {
  34006. s = "true"
  34007. }
  34008. e.setAttr("spellcheck", s)
  34009. return e
  34010. }
  34011. func (e *htmlTh) Style(k, v string) HTMLTh {
  34012. e.setAttr("style", k+":"+v)
  34013. return e
  34014. }
  34015. func (e *htmlTh) Styles(s map[string]string) HTMLTh {
  34016. for k, v := range s {
  34017. e.Style(k, v)
  34018. }
  34019. return e
  34020. }
  34021. func (e *htmlTh) TabIndex(v int) HTMLTh {
  34022. e.setAttr("tabindex", v)
  34023. return e
  34024. }
  34025. func (e *htmlTh) Title(v string) HTMLTh {
  34026. e.setAttr("title", v)
  34027. return e
  34028. }
  34029. func (e *htmlTh) On(event string, h EventHandler, scope ...any) HTMLTh {
  34030. e.setEventHandler(event, h, scope...)
  34031. return e
  34032. }
  34033. func (e *htmlTh) OnBlur(h EventHandler, scope ...any) HTMLTh {
  34034. e.setEventHandler("blur", h, scope...)
  34035. return e
  34036. }
  34037. func (e *htmlTh) OnChange(h EventHandler, scope ...any) HTMLTh {
  34038. e.setEventHandler("change", h, scope...)
  34039. return e
  34040. }
  34041. func (e *htmlTh) OnClick(h EventHandler, scope ...any) HTMLTh {
  34042. e.setEventHandler("click", h, scope...)
  34043. return e
  34044. }
  34045. func (e *htmlTh) OnContextMenu(h EventHandler, scope ...any) HTMLTh {
  34046. e.setEventHandler("contextmenu", h, scope...)
  34047. return e
  34048. }
  34049. func (e *htmlTh) OnCopy(h EventHandler, scope ...any) HTMLTh {
  34050. e.setEventHandler("copy", h, scope...)
  34051. return e
  34052. }
  34053. func (e *htmlTh) OnCut(h EventHandler, scope ...any) HTMLTh {
  34054. e.setEventHandler("cut", h, scope...)
  34055. return e
  34056. }
  34057. func (e *htmlTh) OnDblClick(h EventHandler, scope ...any) HTMLTh {
  34058. e.setEventHandler("dblclick", h, scope...)
  34059. return e
  34060. }
  34061. func (e *htmlTh) OnDrag(h EventHandler, scope ...any) HTMLTh {
  34062. e.setEventHandler("drag", h, scope...)
  34063. return e
  34064. }
  34065. func (e *htmlTh) OnDragEnd(h EventHandler, scope ...any) HTMLTh {
  34066. e.setEventHandler("dragend", h, scope...)
  34067. return e
  34068. }
  34069. func (e *htmlTh) OnDragEnter(h EventHandler, scope ...any) HTMLTh {
  34070. e.setEventHandler("dragenter", h, scope...)
  34071. return e
  34072. }
  34073. func (e *htmlTh) OnDragLeave(h EventHandler, scope ...any) HTMLTh {
  34074. e.setEventHandler("dragleave", h, scope...)
  34075. return e
  34076. }
  34077. func (e *htmlTh) OnDragOver(h EventHandler, scope ...any) HTMLTh {
  34078. e.setEventHandler("dragover", h, scope...)
  34079. return e
  34080. }
  34081. func (e *htmlTh) OnDragStart(h EventHandler, scope ...any) HTMLTh {
  34082. e.setEventHandler("dragstart", h, scope...)
  34083. return e
  34084. }
  34085. func (e *htmlTh) OnDrop(h EventHandler, scope ...any) HTMLTh {
  34086. e.setEventHandler("drop", h, scope...)
  34087. return e
  34088. }
  34089. func (e *htmlTh) OnFocus(h EventHandler, scope ...any) HTMLTh {
  34090. e.setEventHandler("focus", h, scope...)
  34091. return e
  34092. }
  34093. func (e *htmlTh) OnInput(h EventHandler, scope ...any) HTMLTh {
  34094. e.setEventHandler("input", h, scope...)
  34095. return e
  34096. }
  34097. func (e *htmlTh) OnInvalid(h EventHandler, scope ...any) HTMLTh {
  34098. e.setEventHandler("invalid", h, scope...)
  34099. return e
  34100. }
  34101. func (e *htmlTh) OnKeyDown(h EventHandler, scope ...any) HTMLTh {
  34102. e.setEventHandler("keydown", h, scope...)
  34103. return e
  34104. }
  34105. func (e *htmlTh) OnKeyPress(h EventHandler, scope ...any) HTMLTh {
  34106. e.setEventHandler("keypress", h, scope...)
  34107. return e
  34108. }
  34109. func (e *htmlTh) OnKeyUp(h EventHandler, scope ...any) HTMLTh {
  34110. e.setEventHandler("keyup", h, scope...)
  34111. return e
  34112. }
  34113. func (e *htmlTh) OnMouseDown(h EventHandler, scope ...any) HTMLTh {
  34114. e.setEventHandler("mousedown", h, scope...)
  34115. return e
  34116. }
  34117. func (e *htmlTh) OnMouseMove(h EventHandler, scope ...any) HTMLTh {
  34118. e.setEventHandler("mousemove", h, scope...)
  34119. return e
  34120. }
  34121. func (e *htmlTh) OnMouseOut(h EventHandler, scope ...any) HTMLTh {
  34122. e.setEventHandler("mouseout", h, scope...)
  34123. return e
  34124. }
  34125. func (e *htmlTh) OnMouseOver(h EventHandler, scope ...any) HTMLTh {
  34126. e.setEventHandler("mouseover", h, scope...)
  34127. return e
  34128. }
  34129. func (e *htmlTh) OnMouseUp(h EventHandler, scope ...any) HTMLTh {
  34130. e.setEventHandler("mouseup", h, scope...)
  34131. return e
  34132. }
  34133. func (e *htmlTh) OnPaste(h EventHandler, scope ...any) HTMLTh {
  34134. e.setEventHandler("paste", h, scope...)
  34135. return e
  34136. }
  34137. func (e *htmlTh) OnReset(h EventHandler, scope ...any) HTMLTh {
  34138. e.setEventHandler("reset", h, scope...)
  34139. return e
  34140. }
  34141. func (e *htmlTh) OnScroll(h EventHandler, scope ...any) HTMLTh {
  34142. e.setEventHandler("scroll", h, scope...)
  34143. return e
  34144. }
  34145. func (e *htmlTh) OnSearch(h EventHandler, scope ...any) HTMLTh {
  34146. e.setEventHandler("search", h, scope...)
  34147. return e
  34148. }
  34149. func (e *htmlTh) OnSelect(h EventHandler, scope ...any) HTMLTh {
  34150. e.setEventHandler("select", h, scope...)
  34151. return e
  34152. }
  34153. func (e *htmlTh) OnSubmit(h EventHandler, scope ...any) HTMLTh {
  34154. e.setEventHandler("submit", h, scope...)
  34155. return e
  34156. }
  34157. func (e *htmlTh) OnWheel(h EventHandler, scope ...any) HTMLTh {
  34158. e.setEventHandler("wheel", h, scope...)
  34159. return e
  34160. }
  34161. // HTMLTHead is the interface that describes a "thead" HTML element.
  34162. type HTMLTHead interface {
  34163. UI
  34164. // Body set the content of the element.
  34165. Body(elems ...UI) HTMLTHead
  34166. // Text sets the content of the element with a text node containing the stringified given value.
  34167. Text(v any) HTMLTHead
  34168. // AccessKey specifies a shortcut key to activate/focus an element.
  34169. AccessKey(v string) HTMLTHead
  34170. // Aria stores accessible rich internet applications (ARIA) data.
  34171. Aria(k string, v any) HTMLTHead
  34172. // Attr sets the named attribute with the given value.
  34173. Attr(n string, v any) HTMLTHead
  34174. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  34175. Class(v ...string) HTMLTHead
  34176. // ContentEditable specifies whether the content of an element is editable or not.
  34177. ContentEditable(v bool) HTMLTHead
  34178. // DataSet stores custom data private to the page or application.
  34179. DataSet(k string, v any) HTMLTHead
  34180. // Dir specifies the text direction for the content in an element.
  34181. Dir(v string) HTMLTHead
  34182. // Draggable specifies whether an element is draggable or not.
  34183. Draggable(v bool) HTMLTHead
  34184. // Hidden specifies that an element is not yet, or is no longer relevant.
  34185. Hidden(v bool) HTMLTHead
  34186. // ID specifies a unique id for an element.
  34187. ID(v string) HTMLTHead
  34188. // Lang specifies the language of the element's content.
  34189. Lang(v string) HTMLTHead
  34190. // Role specifies to parsing software the exact function of an element (and its children).
  34191. Role(v string) HTMLTHead
  34192. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  34193. Spellcheck(v bool) HTMLTHead
  34194. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  34195. Style(k, v string) HTMLTHead
  34196. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  34197. Styles(s map[string]string) HTMLTHead
  34198. // TabIndex specifies the tabbing order of an element.
  34199. TabIndex(v int) HTMLTHead
  34200. // Title specifies extra information about an element.
  34201. Title(v string) HTMLTHead
  34202. // On registers the given event handler to the specified event.
  34203. On(event string, h EventHandler, scope ...any) HTMLTHead
  34204. // OnBlur calls the given handler when the element loses focus.
  34205. OnBlur(h EventHandler, scope ...any) HTMLTHead
  34206. // OnChange calls the given handler when the value of the element is changed.
  34207. OnChange(h EventHandler, scope ...any) HTMLTHead
  34208. // OnClick calls the given handler when there is a mouse click on the element.
  34209. OnClick(h EventHandler, scope ...any) HTMLTHead
  34210. // OnContextMenu calls the given handler when a context menu is triggered.
  34211. OnContextMenu(h EventHandler, scope ...any) HTMLTHead
  34212. // OnCopy calls the given handler when the user copies the content of an element.
  34213. OnCopy(h EventHandler, scope ...any) HTMLTHead
  34214. // OnCut calls the given handler when the user cuts the content of an element.
  34215. OnCut(h EventHandler, scope ...any) HTMLTHead
  34216. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  34217. OnDblClick(h EventHandler, scope ...any) HTMLTHead
  34218. // OnDrag calls the given handler when an element is dragged.
  34219. OnDrag(h EventHandler, scope ...any) HTMLTHead
  34220. // OnDragEnd calls the given handler at the end of a drag operation.
  34221. OnDragEnd(h EventHandler, scope ...any) HTMLTHead
  34222. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  34223. OnDragEnter(h EventHandler, scope ...any) HTMLTHead
  34224. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  34225. OnDragLeave(h EventHandler, scope ...any) HTMLTHead
  34226. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  34227. OnDragOver(h EventHandler, scope ...any) HTMLTHead
  34228. // OnDragStart calls the given handler at the start of a drag operation.
  34229. OnDragStart(h EventHandler, scope ...any) HTMLTHead
  34230. // OnDrop calls the given handler when dragged element is being dropped.
  34231. OnDrop(h EventHandler, scope ...any) HTMLTHead
  34232. // OnFocus calls the given handler when the element gets focus.
  34233. OnFocus(h EventHandler, scope ...any) HTMLTHead
  34234. // OnInput calls the given handler when an element gets user input.
  34235. OnInput(h EventHandler, scope ...any) HTMLTHead
  34236. // OnInvalid calls the given handler when an element is invalid.
  34237. OnInvalid(h EventHandler, scope ...any) HTMLTHead
  34238. // OnKeyDown calls the given handler when a user is pressing a key.
  34239. OnKeyDown(h EventHandler, scope ...any) HTMLTHead
  34240. // OnKeyPress calls the given handler when a user presses a key.
  34241. OnKeyPress(h EventHandler, scope ...any) HTMLTHead
  34242. // OnKeyUp calls the given handler when a user releases a key.
  34243. OnKeyUp(h EventHandler, scope ...any) HTMLTHead
  34244. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  34245. OnMouseDown(h EventHandler, scope ...any) HTMLTHead
  34246. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  34247. OnMouseMove(h EventHandler, scope ...any) HTMLTHead
  34248. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  34249. OnMouseOut(h EventHandler, scope ...any) HTMLTHead
  34250. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  34251. OnMouseOver(h EventHandler, scope ...any) HTMLTHead
  34252. // OnMouseUp calls the given handler when a mouse button is released over an element.
  34253. OnMouseUp(h EventHandler, scope ...any) HTMLTHead
  34254. // OnPaste calls the given handler when the user pastes some content in an element.
  34255. OnPaste(h EventHandler, scope ...any) HTMLTHead
  34256. // OnReset calls the given handler when the Reset button in a form is clicked.
  34257. OnReset(h EventHandler, scope ...any) HTMLTHead
  34258. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  34259. OnScroll(h EventHandler, scope ...any) HTMLTHead
  34260. // OnSearch calls the given handler when the user writes something in a search field.
  34261. OnSearch(h EventHandler, scope ...any) HTMLTHead
  34262. // OnSelect calls the given handler after some text has been selected in an element.
  34263. OnSelect(h EventHandler, scope ...any) HTMLTHead
  34264. // OnSubmit calls the given handler when a form is submitted.
  34265. OnSubmit(h EventHandler, scope ...any) HTMLTHead
  34266. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  34267. OnWheel(h EventHandler, scope ...any) HTMLTHead
  34268. }
  34269. // THead returns an HTML element that groups the header content in a table
  34270. func THead() HTMLTHead {
  34271. e := &htmlTHead{
  34272. htmlElement: htmlElement{
  34273. tag: "thead",
  34274. isSelfClosing: false,
  34275. },
  34276. }
  34277. return e
  34278. }
  34279. type htmlTHead struct {
  34280. htmlElement
  34281. }
  34282. func (e *htmlTHead) Body(v ...UI) HTMLTHead {
  34283. e.setChildren(v...)
  34284. return e
  34285. }
  34286. func (e *htmlTHead) Text(v any) HTMLTHead {
  34287. return e.Body(Text(v))
  34288. }
  34289. func (e *htmlTHead) AccessKey(v string) HTMLTHead {
  34290. e.setAttr("accesskey", v)
  34291. return e
  34292. }
  34293. func (e *htmlTHead) Aria(k string, v any) HTMLTHead {
  34294. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  34295. return e
  34296. }
  34297. func (e *htmlTHead) Attr(n string, v any) HTMLTHead {
  34298. e.setAttr(n, v)
  34299. return e
  34300. }
  34301. func (e *htmlTHead) Class(v ...string) HTMLTHead {
  34302. e.setAttr("class", strings.Join(v, " "))
  34303. return e
  34304. }
  34305. func (e *htmlTHead) ContentEditable(v bool) HTMLTHead {
  34306. e.setAttr("contenteditable", v)
  34307. return e
  34308. }
  34309. func (e *htmlTHead) DataSet(k string, v any) HTMLTHead {
  34310. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  34311. return e
  34312. }
  34313. func (e *htmlTHead) Dir(v string) HTMLTHead {
  34314. e.setAttr("dir", v)
  34315. return e
  34316. }
  34317. func (e *htmlTHead) Draggable(v bool) HTMLTHead {
  34318. e.setAttr("draggable", v)
  34319. return e
  34320. }
  34321. func (e *htmlTHead) Hidden(v bool) HTMLTHead {
  34322. e.setAttr("hidden", v)
  34323. return e
  34324. }
  34325. func (e *htmlTHead) ID(v string) HTMLTHead {
  34326. e.setAttr("id", v)
  34327. return e
  34328. }
  34329. func (e *htmlTHead) Lang(v string) HTMLTHead {
  34330. e.setAttr("lang", v)
  34331. return e
  34332. }
  34333. func (e *htmlTHead) Role(v string) HTMLTHead {
  34334. e.setAttr("role", v)
  34335. return e
  34336. }
  34337. func (e *htmlTHead) Spellcheck(v bool) HTMLTHead {
  34338. s := "false"
  34339. if v {
  34340. s = "true"
  34341. }
  34342. e.setAttr("spellcheck", s)
  34343. return e
  34344. }
  34345. func (e *htmlTHead) Style(k, v string) HTMLTHead {
  34346. e.setAttr("style", k+":"+v)
  34347. return e
  34348. }
  34349. func (e *htmlTHead) Styles(s map[string]string) HTMLTHead {
  34350. for k, v := range s {
  34351. e.Style(k, v)
  34352. }
  34353. return e
  34354. }
  34355. func (e *htmlTHead) TabIndex(v int) HTMLTHead {
  34356. e.setAttr("tabindex", v)
  34357. return e
  34358. }
  34359. func (e *htmlTHead) Title(v string) HTMLTHead {
  34360. e.setAttr("title", v)
  34361. return e
  34362. }
  34363. func (e *htmlTHead) On(event string, h EventHandler, scope ...any) HTMLTHead {
  34364. e.setEventHandler(event, h, scope...)
  34365. return e
  34366. }
  34367. func (e *htmlTHead) OnBlur(h EventHandler, scope ...any) HTMLTHead {
  34368. e.setEventHandler("blur", h, scope...)
  34369. return e
  34370. }
  34371. func (e *htmlTHead) OnChange(h EventHandler, scope ...any) HTMLTHead {
  34372. e.setEventHandler("change", h, scope...)
  34373. return e
  34374. }
  34375. func (e *htmlTHead) OnClick(h EventHandler, scope ...any) HTMLTHead {
  34376. e.setEventHandler("click", h, scope...)
  34377. return e
  34378. }
  34379. func (e *htmlTHead) OnContextMenu(h EventHandler, scope ...any) HTMLTHead {
  34380. e.setEventHandler("contextmenu", h, scope...)
  34381. return e
  34382. }
  34383. func (e *htmlTHead) OnCopy(h EventHandler, scope ...any) HTMLTHead {
  34384. e.setEventHandler("copy", h, scope...)
  34385. return e
  34386. }
  34387. func (e *htmlTHead) OnCut(h EventHandler, scope ...any) HTMLTHead {
  34388. e.setEventHandler("cut", h, scope...)
  34389. return e
  34390. }
  34391. func (e *htmlTHead) OnDblClick(h EventHandler, scope ...any) HTMLTHead {
  34392. e.setEventHandler("dblclick", h, scope...)
  34393. return e
  34394. }
  34395. func (e *htmlTHead) OnDrag(h EventHandler, scope ...any) HTMLTHead {
  34396. e.setEventHandler("drag", h, scope...)
  34397. return e
  34398. }
  34399. func (e *htmlTHead) OnDragEnd(h EventHandler, scope ...any) HTMLTHead {
  34400. e.setEventHandler("dragend", h, scope...)
  34401. return e
  34402. }
  34403. func (e *htmlTHead) OnDragEnter(h EventHandler, scope ...any) HTMLTHead {
  34404. e.setEventHandler("dragenter", h, scope...)
  34405. return e
  34406. }
  34407. func (e *htmlTHead) OnDragLeave(h EventHandler, scope ...any) HTMLTHead {
  34408. e.setEventHandler("dragleave", h, scope...)
  34409. return e
  34410. }
  34411. func (e *htmlTHead) OnDragOver(h EventHandler, scope ...any) HTMLTHead {
  34412. e.setEventHandler("dragover", h, scope...)
  34413. return e
  34414. }
  34415. func (e *htmlTHead) OnDragStart(h EventHandler, scope ...any) HTMLTHead {
  34416. e.setEventHandler("dragstart", h, scope...)
  34417. return e
  34418. }
  34419. func (e *htmlTHead) OnDrop(h EventHandler, scope ...any) HTMLTHead {
  34420. e.setEventHandler("drop", h, scope...)
  34421. return e
  34422. }
  34423. func (e *htmlTHead) OnFocus(h EventHandler, scope ...any) HTMLTHead {
  34424. e.setEventHandler("focus", h, scope...)
  34425. return e
  34426. }
  34427. func (e *htmlTHead) OnInput(h EventHandler, scope ...any) HTMLTHead {
  34428. e.setEventHandler("input", h, scope...)
  34429. return e
  34430. }
  34431. func (e *htmlTHead) OnInvalid(h EventHandler, scope ...any) HTMLTHead {
  34432. e.setEventHandler("invalid", h, scope...)
  34433. return e
  34434. }
  34435. func (e *htmlTHead) OnKeyDown(h EventHandler, scope ...any) HTMLTHead {
  34436. e.setEventHandler("keydown", h, scope...)
  34437. return e
  34438. }
  34439. func (e *htmlTHead) OnKeyPress(h EventHandler, scope ...any) HTMLTHead {
  34440. e.setEventHandler("keypress", h, scope...)
  34441. return e
  34442. }
  34443. func (e *htmlTHead) OnKeyUp(h EventHandler, scope ...any) HTMLTHead {
  34444. e.setEventHandler("keyup", h, scope...)
  34445. return e
  34446. }
  34447. func (e *htmlTHead) OnMouseDown(h EventHandler, scope ...any) HTMLTHead {
  34448. e.setEventHandler("mousedown", h, scope...)
  34449. return e
  34450. }
  34451. func (e *htmlTHead) OnMouseMove(h EventHandler, scope ...any) HTMLTHead {
  34452. e.setEventHandler("mousemove", h, scope...)
  34453. return e
  34454. }
  34455. func (e *htmlTHead) OnMouseOut(h EventHandler, scope ...any) HTMLTHead {
  34456. e.setEventHandler("mouseout", h, scope...)
  34457. return e
  34458. }
  34459. func (e *htmlTHead) OnMouseOver(h EventHandler, scope ...any) HTMLTHead {
  34460. e.setEventHandler("mouseover", h, scope...)
  34461. return e
  34462. }
  34463. func (e *htmlTHead) OnMouseUp(h EventHandler, scope ...any) HTMLTHead {
  34464. e.setEventHandler("mouseup", h, scope...)
  34465. return e
  34466. }
  34467. func (e *htmlTHead) OnPaste(h EventHandler, scope ...any) HTMLTHead {
  34468. e.setEventHandler("paste", h, scope...)
  34469. return e
  34470. }
  34471. func (e *htmlTHead) OnReset(h EventHandler, scope ...any) HTMLTHead {
  34472. e.setEventHandler("reset", h, scope...)
  34473. return e
  34474. }
  34475. func (e *htmlTHead) OnScroll(h EventHandler, scope ...any) HTMLTHead {
  34476. e.setEventHandler("scroll", h, scope...)
  34477. return e
  34478. }
  34479. func (e *htmlTHead) OnSearch(h EventHandler, scope ...any) HTMLTHead {
  34480. e.setEventHandler("search", h, scope...)
  34481. return e
  34482. }
  34483. func (e *htmlTHead) OnSelect(h EventHandler, scope ...any) HTMLTHead {
  34484. e.setEventHandler("select", h, scope...)
  34485. return e
  34486. }
  34487. func (e *htmlTHead) OnSubmit(h EventHandler, scope ...any) HTMLTHead {
  34488. e.setEventHandler("submit", h, scope...)
  34489. return e
  34490. }
  34491. func (e *htmlTHead) OnWheel(h EventHandler, scope ...any) HTMLTHead {
  34492. e.setEventHandler("wheel", h, scope...)
  34493. return e
  34494. }
  34495. // HTMLTime is the interface that describes a "time" HTML element.
  34496. type HTMLTime interface {
  34497. UI
  34498. // Body set the content of the element.
  34499. Body(elems ...UI) HTMLTime
  34500. // Text sets the content of the element with a text node containing the stringified given value.
  34501. Text(v any) HTMLTime
  34502. // AccessKey specifies a shortcut key to activate/focus an element.
  34503. AccessKey(v string) HTMLTime
  34504. // Aria stores accessible rich internet applications (ARIA) data.
  34505. Aria(k string, v any) HTMLTime
  34506. // Attr sets the named attribute with the given value.
  34507. Attr(n string, v any) HTMLTime
  34508. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  34509. Class(v ...string) HTMLTime
  34510. // ContentEditable specifies whether the content of an element is editable or not.
  34511. ContentEditable(v bool) HTMLTime
  34512. // DataSet stores custom data private to the page or application.
  34513. DataSet(k string, v any) HTMLTime
  34514. // DateTime specifies the date and time.
  34515. DateTime(v string) HTMLTime
  34516. // Dir specifies the text direction for the content in an element.
  34517. Dir(v string) HTMLTime
  34518. // Draggable specifies whether an element is draggable or not.
  34519. Draggable(v bool) HTMLTime
  34520. // Hidden specifies that an element is not yet, or is no longer relevant.
  34521. Hidden(v bool) HTMLTime
  34522. // ID specifies a unique id for an element.
  34523. ID(v string) HTMLTime
  34524. // Lang specifies the language of the element's content.
  34525. Lang(v string) HTMLTime
  34526. // Role specifies to parsing software the exact function of an element (and its children).
  34527. Role(v string) HTMLTime
  34528. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  34529. Spellcheck(v bool) HTMLTime
  34530. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  34531. Style(k, v string) HTMLTime
  34532. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  34533. Styles(s map[string]string) HTMLTime
  34534. // TabIndex specifies the tabbing order of an element.
  34535. TabIndex(v int) HTMLTime
  34536. // Title specifies extra information about an element.
  34537. Title(v string) HTMLTime
  34538. // On registers the given event handler to the specified event.
  34539. On(event string, h EventHandler, scope ...any) HTMLTime
  34540. // OnBlur calls the given handler when the element loses focus.
  34541. OnBlur(h EventHandler, scope ...any) HTMLTime
  34542. // OnChange calls the given handler when the value of the element is changed.
  34543. OnChange(h EventHandler, scope ...any) HTMLTime
  34544. // OnClick calls the given handler when there is a mouse click on the element.
  34545. OnClick(h EventHandler, scope ...any) HTMLTime
  34546. // OnContextMenu calls the given handler when a context menu is triggered.
  34547. OnContextMenu(h EventHandler, scope ...any) HTMLTime
  34548. // OnCopy calls the given handler when the user copies the content of an element.
  34549. OnCopy(h EventHandler, scope ...any) HTMLTime
  34550. // OnCut calls the given handler when the user cuts the content of an element.
  34551. OnCut(h EventHandler, scope ...any) HTMLTime
  34552. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  34553. OnDblClick(h EventHandler, scope ...any) HTMLTime
  34554. // OnDrag calls the given handler when an element is dragged.
  34555. OnDrag(h EventHandler, scope ...any) HTMLTime
  34556. // OnDragEnd calls the given handler at the end of a drag operation.
  34557. OnDragEnd(h EventHandler, scope ...any) HTMLTime
  34558. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  34559. OnDragEnter(h EventHandler, scope ...any) HTMLTime
  34560. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  34561. OnDragLeave(h EventHandler, scope ...any) HTMLTime
  34562. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  34563. OnDragOver(h EventHandler, scope ...any) HTMLTime
  34564. // OnDragStart calls the given handler at the start of a drag operation.
  34565. OnDragStart(h EventHandler, scope ...any) HTMLTime
  34566. // OnDrop calls the given handler when dragged element is being dropped.
  34567. OnDrop(h EventHandler, scope ...any) HTMLTime
  34568. // OnFocus calls the given handler when the element gets focus.
  34569. OnFocus(h EventHandler, scope ...any) HTMLTime
  34570. // OnInput calls the given handler when an element gets user input.
  34571. OnInput(h EventHandler, scope ...any) HTMLTime
  34572. // OnInvalid calls the given handler when an element is invalid.
  34573. OnInvalid(h EventHandler, scope ...any) HTMLTime
  34574. // OnKeyDown calls the given handler when a user is pressing a key.
  34575. OnKeyDown(h EventHandler, scope ...any) HTMLTime
  34576. // OnKeyPress calls the given handler when a user presses a key.
  34577. OnKeyPress(h EventHandler, scope ...any) HTMLTime
  34578. // OnKeyUp calls the given handler when a user releases a key.
  34579. OnKeyUp(h EventHandler, scope ...any) HTMLTime
  34580. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  34581. OnMouseDown(h EventHandler, scope ...any) HTMLTime
  34582. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  34583. OnMouseMove(h EventHandler, scope ...any) HTMLTime
  34584. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  34585. OnMouseOut(h EventHandler, scope ...any) HTMLTime
  34586. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  34587. OnMouseOver(h EventHandler, scope ...any) HTMLTime
  34588. // OnMouseUp calls the given handler when a mouse button is released over an element.
  34589. OnMouseUp(h EventHandler, scope ...any) HTMLTime
  34590. // OnPaste calls the given handler when the user pastes some content in an element.
  34591. OnPaste(h EventHandler, scope ...any) HTMLTime
  34592. // OnReset calls the given handler when the Reset button in a form is clicked.
  34593. OnReset(h EventHandler, scope ...any) HTMLTime
  34594. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  34595. OnScroll(h EventHandler, scope ...any) HTMLTime
  34596. // OnSearch calls the given handler when the user writes something in a search field.
  34597. OnSearch(h EventHandler, scope ...any) HTMLTime
  34598. // OnSelect calls the given handler after some text has been selected in an element.
  34599. OnSelect(h EventHandler, scope ...any) HTMLTime
  34600. // OnSubmit calls the given handler when a form is submitted.
  34601. OnSubmit(h EventHandler, scope ...any) HTMLTime
  34602. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  34603. OnWheel(h EventHandler, scope ...any) HTMLTime
  34604. }
  34605. // Time returns an HTML element that defines a date/time.
  34606. func Time() HTMLTime {
  34607. e := &htmlTime{
  34608. htmlElement: htmlElement{
  34609. tag: "time",
  34610. isSelfClosing: false,
  34611. },
  34612. }
  34613. return e
  34614. }
  34615. type htmlTime struct {
  34616. htmlElement
  34617. }
  34618. func (e *htmlTime) Body(v ...UI) HTMLTime {
  34619. e.setChildren(v...)
  34620. return e
  34621. }
  34622. func (e *htmlTime) Text(v any) HTMLTime {
  34623. return e.Body(Text(v))
  34624. }
  34625. func (e *htmlTime) AccessKey(v string) HTMLTime {
  34626. e.setAttr("accesskey", v)
  34627. return e
  34628. }
  34629. func (e *htmlTime) Aria(k string, v any) HTMLTime {
  34630. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  34631. return e
  34632. }
  34633. func (e *htmlTime) Attr(n string, v any) HTMLTime {
  34634. e.setAttr(n, v)
  34635. return e
  34636. }
  34637. func (e *htmlTime) Class(v ...string) HTMLTime {
  34638. e.setAttr("class", strings.Join(v, " "))
  34639. return e
  34640. }
  34641. func (e *htmlTime) ContentEditable(v bool) HTMLTime {
  34642. e.setAttr("contenteditable", v)
  34643. return e
  34644. }
  34645. func (e *htmlTime) DataSet(k string, v any) HTMLTime {
  34646. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  34647. return e
  34648. }
  34649. func (e *htmlTime) DateTime(v string) HTMLTime {
  34650. e.setAttr("datetime", v)
  34651. return e
  34652. }
  34653. func (e *htmlTime) Dir(v string) HTMLTime {
  34654. e.setAttr("dir", v)
  34655. return e
  34656. }
  34657. func (e *htmlTime) Draggable(v bool) HTMLTime {
  34658. e.setAttr("draggable", v)
  34659. return e
  34660. }
  34661. func (e *htmlTime) Hidden(v bool) HTMLTime {
  34662. e.setAttr("hidden", v)
  34663. return e
  34664. }
  34665. func (e *htmlTime) ID(v string) HTMLTime {
  34666. e.setAttr("id", v)
  34667. return e
  34668. }
  34669. func (e *htmlTime) Lang(v string) HTMLTime {
  34670. e.setAttr("lang", v)
  34671. return e
  34672. }
  34673. func (e *htmlTime) Role(v string) HTMLTime {
  34674. e.setAttr("role", v)
  34675. return e
  34676. }
  34677. func (e *htmlTime) Spellcheck(v bool) HTMLTime {
  34678. s := "false"
  34679. if v {
  34680. s = "true"
  34681. }
  34682. e.setAttr("spellcheck", s)
  34683. return e
  34684. }
  34685. func (e *htmlTime) Style(k, v string) HTMLTime {
  34686. e.setAttr("style", k+":"+v)
  34687. return e
  34688. }
  34689. func (e *htmlTime) Styles(s map[string]string) HTMLTime {
  34690. for k, v := range s {
  34691. e.Style(k, v)
  34692. }
  34693. return e
  34694. }
  34695. func (e *htmlTime) TabIndex(v int) HTMLTime {
  34696. e.setAttr("tabindex", v)
  34697. return e
  34698. }
  34699. func (e *htmlTime) Title(v string) HTMLTime {
  34700. e.setAttr("title", v)
  34701. return e
  34702. }
  34703. func (e *htmlTime) On(event string, h EventHandler, scope ...any) HTMLTime {
  34704. e.setEventHandler(event, h, scope...)
  34705. return e
  34706. }
  34707. func (e *htmlTime) OnBlur(h EventHandler, scope ...any) HTMLTime {
  34708. e.setEventHandler("blur", h, scope...)
  34709. return e
  34710. }
  34711. func (e *htmlTime) OnChange(h EventHandler, scope ...any) HTMLTime {
  34712. e.setEventHandler("change", h, scope...)
  34713. return e
  34714. }
  34715. func (e *htmlTime) OnClick(h EventHandler, scope ...any) HTMLTime {
  34716. e.setEventHandler("click", h, scope...)
  34717. return e
  34718. }
  34719. func (e *htmlTime) OnContextMenu(h EventHandler, scope ...any) HTMLTime {
  34720. e.setEventHandler("contextmenu", h, scope...)
  34721. return e
  34722. }
  34723. func (e *htmlTime) OnCopy(h EventHandler, scope ...any) HTMLTime {
  34724. e.setEventHandler("copy", h, scope...)
  34725. return e
  34726. }
  34727. func (e *htmlTime) OnCut(h EventHandler, scope ...any) HTMLTime {
  34728. e.setEventHandler("cut", h, scope...)
  34729. return e
  34730. }
  34731. func (e *htmlTime) OnDblClick(h EventHandler, scope ...any) HTMLTime {
  34732. e.setEventHandler("dblclick", h, scope...)
  34733. return e
  34734. }
  34735. func (e *htmlTime) OnDrag(h EventHandler, scope ...any) HTMLTime {
  34736. e.setEventHandler("drag", h, scope...)
  34737. return e
  34738. }
  34739. func (e *htmlTime) OnDragEnd(h EventHandler, scope ...any) HTMLTime {
  34740. e.setEventHandler("dragend", h, scope...)
  34741. return e
  34742. }
  34743. func (e *htmlTime) OnDragEnter(h EventHandler, scope ...any) HTMLTime {
  34744. e.setEventHandler("dragenter", h, scope...)
  34745. return e
  34746. }
  34747. func (e *htmlTime) OnDragLeave(h EventHandler, scope ...any) HTMLTime {
  34748. e.setEventHandler("dragleave", h, scope...)
  34749. return e
  34750. }
  34751. func (e *htmlTime) OnDragOver(h EventHandler, scope ...any) HTMLTime {
  34752. e.setEventHandler("dragover", h, scope...)
  34753. return e
  34754. }
  34755. func (e *htmlTime) OnDragStart(h EventHandler, scope ...any) HTMLTime {
  34756. e.setEventHandler("dragstart", h, scope...)
  34757. return e
  34758. }
  34759. func (e *htmlTime) OnDrop(h EventHandler, scope ...any) HTMLTime {
  34760. e.setEventHandler("drop", h, scope...)
  34761. return e
  34762. }
  34763. func (e *htmlTime) OnFocus(h EventHandler, scope ...any) HTMLTime {
  34764. e.setEventHandler("focus", h, scope...)
  34765. return e
  34766. }
  34767. func (e *htmlTime) OnInput(h EventHandler, scope ...any) HTMLTime {
  34768. e.setEventHandler("input", h, scope...)
  34769. return e
  34770. }
  34771. func (e *htmlTime) OnInvalid(h EventHandler, scope ...any) HTMLTime {
  34772. e.setEventHandler("invalid", h, scope...)
  34773. return e
  34774. }
  34775. func (e *htmlTime) OnKeyDown(h EventHandler, scope ...any) HTMLTime {
  34776. e.setEventHandler("keydown", h, scope...)
  34777. return e
  34778. }
  34779. func (e *htmlTime) OnKeyPress(h EventHandler, scope ...any) HTMLTime {
  34780. e.setEventHandler("keypress", h, scope...)
  34781. return e
  34782. }
  34783. func (e *htmlTime) OnKeyUp(h EventHandler, scope ...any) HTMLTime {
  34784. e.setEventHandler("keyup", h, scope...)
  34785. return e
  34786. }
  34787. func (e *htmlTime) OnMouseDown(h EventHandler, scope ...any) HTMLTime {
  34788. e.setEventHandler("mousedown", h, scope...)
  34789. return e
  34790. }
  34791. func (e *htmlTime) OnMouseMove(h EventHandler, scope ...any) HTMLTime {
  34792. e.setEventHandler("mousemove", h, scope...)
  34793. return e
  34794. }
  34795. func (e *htmlTime) OnMouseOut(h EventHandler, scope ...any) HTMLTime {
  34796. e.setEventHandler("mouseout", h, scope...)
  34797. return e
  34798. }
  34799. func (e *htmlTime) OnMouseOver(h EventHandler, scope ...any) HTMLTime {
  34800. e.setEventHandler("mouseover", h, scope...)
  34801. return e
  34802. }
  34803. func (e *htmlTime) OnMouseUp(h EventHandler, scope ...any) HTMLTime {
  34804. e.setEventHandler("mouseup", h, scope...)
  34805. return e
  34806. }
  34807. func (e *htmlTime) OnPaste(h EventHandler, scope ...any) HTMLTime {
  34808. e.setEventHandler("paste", h, scope...)
  34809. return e
  34810. }
  34811. func (e *htmlTime) OnReset(h EventHandler, scope ...any) HTMLTime {
  34812. e.setEventHandler("reset", h, scope...)
  34813. return e
  34814. }
  34815. func (e *htmlTime) OnScroll(h EventHandler, scope ...any) HTMLTime {
  34816. e.setEventHandler("scroll", h, scope...)
  34817. return e
  34818. }
  34819. func (e *htmlTime) OnSearch(h EventHandler, scope ...any) HTMLTime {
  34820. e.setEventHandler("search", h, scope...)
  34821. return e
  34822. }
  34823. func (e *htmlTime) OnSelect(h EventHandler, scope ...any) HTMLTime {
  34824. e.setEventHandler("select", h, scope...)
  34825. return e
  34826. }
  34827. func (e *htmlTime) OnSubmit(h EventHandler, scope ...any) HTMLTime {
  34828. e.setEventHandler("submit", h, scope...)
  34829. return e
  34830. }
  34831. func (e *htmlTime) OnWheel(h EventHandler, scope ...any) HTMLTime {
  34832. e.setEventHandler("wheel", h, scope...)
  34833. return e
  34834. }
  34835. // HTMLTitle is the interface that describes a "title" HTML element.
  34836. type HTMLTitle interface {
  34837. UI
  34838. // Body set the content of the element.
  34839. Body(elems ...UI) HTMLTitle
  34840. // Text sets the content of the element with a text node containing the stringified given value.
  34841. Text(v any) HTMLTitle
  34842. // AccessKey specifies a shortcut key to activate/focus an element.
  34843. AccessKey(v string) HTMLTitle
  34844. // Aria stores accessible rich internet applications (ARIA) data.
  34845. Aria(k string, v any) HTMLTitle
  34846. // Attr sets the named attribute with the given value.
  34847. Attr(n string, v any) HTMLTitle
  34848. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  34849. Class(v ...string) HTMLTitle
  34850. // ContentEditable specifies whether the content of an element is editable or not.
  34851. ContentEditable(v bool) HTMLTitle
  34852. // DataSet stores custom data private to the page or application.
  34853. DataSet(k string, v any) HTMLTitle
  34854. // Dir specifies the text direction for the content in an element.
  34855. Dir(v string) HTMLTitle
  34856. // Draggable specifies whether an element is draggable or not.
  34857. Draggable(v bool) HTMLTitle
  34858. // Hidden specifies that an element is not yet, or is no longer relevant.
  34859. Hidden(v bool) HTMLTitle
  34860. // ID specifies a unique id for an element.
  34861. ID(v string) HTMLTitle
  34862. // Lang specifies the language of the element's content.
  34863. Lang(v string) HTMLTitle
  34864. // Role specifies to parsing software the exact function of an element (and its children).
  34865. Role(v string) HTMLTitle
  34866. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  34867. Spellcheck(v bool) HTMLTitle
  34868. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  34869. Style(k, v string) HTMLTitle
  34870. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  34871. Styles(s map[string]string) HTMLTitle
  34872. // TabIndex specifies the tabbing order of an element.
  34873. TabIndex(v int) HTMLTitle
  34874. // Title specifies extra information about an element.
  34875. Title(v string) HTMLTitle
  34876. // On registers the given event handler to the specified event.
  34877. On(event string, h EventHandler, scope ...any) HTMLTitle
  34878. }
  34879. // Title returns an HTML element that defines a title for the document.
  34880. func Title() HTMLTitle {
  34881. e := &htmlTitle{
  34882. htmlElement: htmlElement{
  34883. tag: "title",
  34884. isSelfClosing: false,
  34885. },
  34886. }
  34887. return e
  34888. }
  34889. type htmlTitle struct {
  34890. htmlElement
  34891. }
  34892. func (e *htmlTitle) Body(v ...UI) HTMLTitle {
  34893. e.setChildren(v...)
  34894. return e
  34895. }
  34896. func (e *htmlTitle) Text(v any) HTMLTitle {
  34897. return e.Body(Text(v))
  34898. }
  34899. func (e *htmlTitle) AccessKey(v string) HTMLTitle {
  34900. e.setAttr("accesskey", v)
  34901. return e
  34902. }
  34903. func (e *htmlTitle) Aria(k string, v any) HTMLTitle {
  34904. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  34905. return e
  34906. }
  34907. func (e *htmlTitle) Attr(n string, v any) HTMLTitle {
  34908. e.setAttr(n, v)
  34909. return e
  34910. }
  34911. func (e *htmlTitle) Class(v ...string) HTMLTitle {
  34912. e.setAttr("class", strings.Join(v, " "))
  34913. return e
  34914. }
  34915. func (e *htmlTitle) ContentEditable(v bool) HTMLTitle {
  34916. e.setAttr("contenteditable", v)
  34917. return e
  34918. }
  34919. func (e *htmlTitle) DataSet(k string, v any) HTMLTitle {
  34920. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  34921. return e
  34922. }
  34923. func (e *htmlTitle) Dir(v string) HTMLTitle {
  34924. e.setAttr("dir", v)
  34925. return e
  34926. }
  34927. func (e *htmlTitle) Draggable(v bool) HTMLTitle {
  34928. e.setAttr("draggable", v)
  34929. return e
  34930. }
  34931. func (e *htmlTitle) Hidden(v bool) HTMLTitle {
  34932. e.setAttr("hidden", v)
  34933. return e
  34934. }
  34935. func (e *htmlTitle) ID(v string) HTMLTitle {
  34936. e.setAttr("id", v)
  34937. return e
  34938. }
  34939. func (e *htmlTitle) Lang(v string) HTMLTitle {
  34940. e.setAttr("lang", v)
  34941. return e
  34942. }
  34943. func (e *htmlTitle) Role(v string) HTMLTitle {
  34944. e.setAttr("role", v)
  34945. return e
  34946. }
  34947. func (e *htmlTitle) Spellcheck(v bool) HTMLTitle {
  34948. s := "false"
  34949. if v {
  34950. s = "true"
  34951. }
  34952. e.setAttr("spellcheck", s)
  34953. return e
  34954. }
  34955. func (e *htmlTitle) Style(k, v string) HTMLTitle {
  34956. e.setAttr("style", k+":"+v)
  34957. return e
  34958. }
  34959. func (e *htmlTitle) Styles(s map[string]string) HTMLTitle {
  34960. for k, v := range s {
  34961. e.Style(k, v)
  34962. }
  34963. return e
  34964. }
  34965. func (e *htmlTitle) TabIndex(v int) HTMLTitle {
  34966. e.setAttr("tabindex", v)
  34967. return e
  34968. }
  34969. func (e *htmlTitle) Title(v string) HTMLTitle {
  34970. e.setAttr("title", v)
  34971. return e
  34972. }
  34973. func (e *htmlTitle) On(event string, h EventHandler, scope ...any) HTMLTitle {
  34974. e.setEventHandler(event, h, scope...)
  34975. return e
  34976. }
  34977. // HTMLTr is the interface that describes a "tr" HTML element.
  34978. type HTMLTr interface {
  34979. UI
  34980. // Body set the content of the element.
  34981. Body(elems ...UI) HTMLTr
  34982. // Text sets the content of the element with a text node containing the stringified given value.
  34983. Text(v any) HTMLTr
  34984. // AccessKey specifies a shortcut key to activate/focus an element.
  34985. AccessKey(v string) HTMLTr
  34986. // Aria stores accessible rich internet applications (ARIA) data.
  34987. Aria(k string, v any) HTMLTr
  34988. // Attr sets the named attribute with the given value.
  34989. Attr(n string, v any) HTMLTr
  34990. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  34991. Class(v ...string) HTMLTr
  34992. // ContentEditable specifies whether the content of an element is editable or not.
  34993. ContentEditable(v bool) HTMLTr
  34994. // DataSet stores custom data private to the page or application.
  34995. DataSet(k string, v any) HTMLTr
  34996. // Dir specifies the text direction for the content in an element.
  34997. Dir(v string) HTMLTr
  34998. // Draggable specifies whether an element is draggable or not.
  34999. Draggable(v bool) HTMLTr
  35000. // Hidden specifies that an element is not yet, or is no longer relevant.
  35001. Hidden(v bool) HTMLTr
  35002. // ID specifies a unique id for an element.
  35003. ID(v string) HTMLTr
  35004. // Lang specifies the language of the element's content.
  35005. Lang(v string) HTMLTr
  35006. // Role specifies to parsing software the exact function of an element (and its children).
  35007. Role(v string) HTMLTr
  35008. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  35009. Spellcheck(v bool) HTMLTr
  35010. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  35011. Style(k, v string) HTMLTr
  35012. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  35013. Styles(s map[string]string) HTMLTr
  35014. // TabIndex specifies the tabbing order of an element.
  35015. TabIndex(v int) HTMLTr
  35016. // Title specifies extra information about an element.
  35017. Title(v string) HTMLTr
  35018. // On registers the given event handler to the specified event.
  35019. On(event string, h EventHandler, scope ...any) HTMLTr
  35020. // OnBlur calls the given handler when the element loses focus.
  35021. OnBlur(h EventHandler, scope ...any) HTMLTr
  35022. // OnChange calls the given handler when the value of the element is changed.
  35023. OnChange(h EventHandler, scope ...any) HTMLTr
  35024. // OnClick calls the given handler when there is a mouse click on the element.
  35025. OnClick(h EventHandler, scope ...any) HTMLTr
  35026. // OnContextMenu calls the given handler when a context menu is triggered.
  35027. OnContextMenu(h EventHandler, scope ...any) HTMLTr
  35028. // OnCopy calls the given handler when the user copies the content of an element.
  35029. OnCopy(h EventHandler, scope ...any) HTMLTr
  35030. // OnCut calls the given handler when the user cuts the content of an element.
  35031. OnCut(h EventHandler, scope ...any) HTMLTr
  35032. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  35033. OnDblClick(h EventHandler, scope ...any) HTMLTr
  35034. // OnDrag calls the given handler when an element is dragged.
  35035. OnDrag(h EventHandler, scope ...any) HTMLTr
  35036. // OnDragEnd calls the given handler at the end of a drag operation.
  35037. OnDragEnd(h EventHandler, scope ...any) HTMLTr
  35038. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  35039. OnDragEnter(h EventHandler, scope ...any) HTMLTr
  35040. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  35041. OnDragLeave(h EventHandler, scope ...any) HTMLTr
  35042. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  35043. OnDragOver(h EventHandler, scope ...any) HTMLTr
  35044. // OnDragStart calls the given handler at the start of a drag operation.
  35045. OnDragStart(h EventHandler, scope ...any) HTMLTr
  35046. // OnDrop calls the given handler when dragged element is being dropped.
  35047. OnDrop(h EventHandler, scope ...any) HTMLTr
  35048. // OnFocus calls the given handler when the element gets focus.
  35049. OnFocus(h EventHandler, scope ...any) HTMLTr
  35050. // OnInput calls the given handler when an element gets user input.
  35051. OnInput(h EventHandler, scope ...any) HTMLTr
  35052. // OnInvalid calls the given handler when an element is invalid.
  35053. OnInvalid(h EventHandler, scope ...any) HTMLTr
  35054. // OnKeyDown calls the given handler when a user is pressing a key.
  35055. OnKeyDown(h EventHandler, scope ...any) HTMLTr
  35056. // OnKeyPress calls the given handler when a user presses a key.
  35057. OnKeyPress(h EventHandler, scope ...any) HTMLTr
  35058. // OnKeyUp calls the given handler when a user releases a key.
  35059. OnKeyUp(h EventHandler, scope ...any) HTMLTr
  35060. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  35061. OnMouseDown(h EventHandler, scope ...any) HTMLTr
  35062. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  35063. OnMouseMove(h EventHandler, scope ...any) HTMLTr
  35064. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  35065. OnMouseOut(h EventHandler, scope ...any) HTMLTr
  35066. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  35067. OnMouseOver(h EventHandler, scope ...any) HTMLTr
  35068. // OnMouseUp calls the given handler when a mouse button is released over an element.
  35069. OnMouseUp(h EventHandler, scope ...any) HTMLTr
  35070. // OnPaste calls the given handler when the user pastes some content in an element.
  35071. OnPaste(h EventHandler, scope ...any) HTMLTr
  35072. // OnReset calls the given handler when the Reset button in a form is clicked.
  35073. OnReset(h EventHandler, scope ...any) HTMLTr
  35074. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  35075. OnScroll(h EventHandler, scope ...any) HTMLTr
  35076. // OnSearch calls the given handler when the user writes something in a search field.
  35077. OnSearch(h EventHandler, scope ...any) HTMLTr
  35078. // OnSelect calls the given handler after some text has been selected in an element.
  35079. OnSelect(h EventHandler, scope ...any) HTMLTr
  35080. // OnSubmit calls the given handler when a form is submitted.
  35081. OnSubmit(h EventHandler, scope ...any) HTMLTr
  35082. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  35083. OnWheel(h EventHandler, scope ...any) HTMLTr
  35084. }
  35085. // Tr returns an HTML element that defines a row in a table.
  35086. func Tr() HTMLTr {
  35087. e := &htmlTr{
  35088. htmlElement: htmlElement{
  35089. tag: "tr",
  35090. isSelfClosing: false,
  35091. },
  35092. }
  35093. return e
  35094. }
  35095. type htmlTr struct {
  35096. htmlElement
  35097. }
  35098. func (e *htmlTr) Body(v ...UI) HTMLTr {
  35099. e.setChildren(v...)
  35100. return e
  35101. }
  35102. func (e *htmlTr) Text(v any) HTMLTr {
  35103. return e.Body(Text(v))
  35104. }
  35105. func (e *htmlTr) AccessKey(v string) HTMLTr {
  35106. e.setAttr("accesskey", v)
  35107. return e
  35108. }
  35109. func (e *htmlTr) Aria(k string, v any) HTMLTr {
  35110. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  35111. return e
  35112. }
  35113. func (e *htmlTr) Attr(n string, v any) HTMLTr {
  35114. e.setAttr(n, v)
  35115. return e
  35116. }
  35117. func (e *htmlTr) Class(v ...string) HTMLTr {
  35118. e.setAttr("class", strings.Join(v, " "))
  35119. return e
  35120. }
  35121. func (e *htmlTr) ContentEditable(v bool) HTMLTr {
  35122. e.setAttr("contenteditable", v)
  35123. return e
  35124. }
  35125. func (e *htmlTr) DataSet(k string, v any) HTMLTr {
  35126. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  35127. return e
  35128. }
  35129. func (e *htmlTr) Dir(v string) HTMLTr {
  35130. e.setAttr("dir", v)
  35131. return e
  35132. }
  35133. func (e *htmlTr) Draggable(v bool) HTMLTr {
  35134. e.setAttr("draggable", v)
  35135. return e
  35136. }
  35137. func (e *htmlTr) Hidden(v bool) HTMLTr {
  35138. e.setAttr("hidden", v)
  35139. return e
  35140. }
  35141. func (e *htmlTr) ID(v string) HTMLTr {
  35142. e.setAttr("id", v)
  35143. return e
  35144. }
  35145. func (e *htmlTr) Lang(v string) HTMLTr {
  35146. e.setAttr("lang", v)
  35147. return e
  35148. }
  35149. func (e *htmlTr) Role(v string) HTMLTr {
  35150. e.setAttr("role", v)
  35151. return e
  35152. }
  35153. func (e *htmlTr) Spellcheck(v bool) HTMLTr {
  35154. s := "false"
  35155. if v {
  35156. s = "true"
  35157. }
  35158. e.setAttr("spellcheck", s)
  35159. return e
  35160. }
  35161. func (e *htmlTr) Style(k, v string) HTMLTr {
  35162. e.setAttr("style", k+":"+v)
  35163. return e
  35164. }
  35165. func (e *htmlTr) Styles(s map[string]string) HTMLTr {
  35166. for k, v := range s {
  35167. e.Style(k, v)
  35168. }
  35169. return e
  35170. }
  35171. func (e *htmlTr) TabIndex(v int) HTMLTr {
  35172. e.setAttr("tabindex", v)
  35173. return e
  35174. }
  35175. func (e *htmlTr) Title(v string) HTMLTr {
  35176. e.setAttr("title", v)
  35177. return e
  35178. }
  35179. func (e *htmlTr) On(event string, h EventHandler, scope ...any) HTMLTr {
  35180. e.setEventHandler(event, h, scope...)
  35181. return e
  35182. }
  35183. func (e *htmlTr) OnBlur(h EventHandler, scope ...any) HTMLTr {
  35184. e.setEventHandler("blur", h, scope...)
  35185. return e
  35186. }
  35187. func (e *htmlTr) OnChange(h EventHandler, scope ...any) HTMLTr {
  35188. e.setEventHandler("change", h, scope...)
  35189. return e
  35190. }
  35191. func (e *htmlTr) OnClick(h EventHandler, scope ...any) HTMLTr {
  35192. e.setEventHandler("click", h, scope...)
  35193. return e
  35194. }
  35195. func (e *htmlTr) OnContextMenu(h EventHandler, scope ...any) HTMLTr {
  35196. e.setEventHandler("contextmenu", h, scope...)
  35197. return e
  35198. }
  35199. func (e *htmlTr) OnCopy(h EventHandler, scope ...any) HTMLTr {
  35200. e.setEventHandler("copy", h, scope...)
  35201. return e
  35202. }
  35203. func (e *htmlTr) OnCut(h EventHandler, scope ...any) HTMLTr {
  35204. e.setEventHandler("cut", h, scope...)
  35205. return e
  35206. }
  35207. func (e *htmlTr) OnDblClick(h EventHandler, scope ...any) HTMLTr {
  35208. e.setEventHandler("dblclick", h, scope...)
  35209. return e
  35210. }
  35211. func (e *htmlTr) OnDrag(h EventHandler, scope ...any) HTMLTr {
  35212. e.setEventHandler("drag", h, scope...)
  35213. return e
  35214. }
  35215. func (e *htmlTr) OnDragEnd(h EventHandler, scope ...any) HTMLTr {
  35216. e.setEventHandler("dragend", h, scope...)
  35217. return e
  35218. }
  35219. func (e *htmlTr) OnDragEnter(h EventHandler, scope ...any) HTMLTr {
  35220. e.setEventHandler("dragenter", h, scope...)
  35221. return e
  35222. }
  35223. func (e *htmlTr) OnDragLeave(h EventHandler, scope ...any) HTMLTr {
  35224. e.setEventHandler("dragleave", h, scope...)
  35225. return e
  35226. }
  35227. func (e *htmlTr) OnDragOver(h EventHandler, scope ...any) HTMLTr {
  35228. e.setEventHandler("dragover", h, scope...)
  35229. return e
  35230. }
  35231. func (e *htmlTr) OnDragStart(h EventHandler, scope ...any) HTMLTr {
  35232. e.setEventHandler("dragstart", h, scope...)
  35233. return e
  35234. }
  35235. func (e *htmlTr) OnDrop(h EventHandler, scope ...any) HTMLTr {
  35236. e.setEventHandler("drop", h, scope...)
  35237. return e
  35238. }
  35239. func (e *htmlTr) OnFocus(h EventHandler, scope ...any) HTMLTr {
  35240. e.setEventHandler("focus", h, scope...)
  35241. return e
  35242. }
  35243. func (e *htmlTr) OnInput(h EventHandler, scope ...any) HTMLTr {
  35244. e.setEventHandler("input", h, scope...)
  35245. return e
  35246. }
  35247. func (e *htmlTr) OnInvalid(h EventHandler, scope ...any) HTMLTr {
  35248. e.setEventHandler("invalid", h, scope...)
  35249. return e
  35250. }
  35251. func (e *htmlTr) OnKeyDown(h EventHandler, scope ...any) HTMLTr {
  35252. e.setEventHandler("keydown", h, scope...)
  35253. return e
  35254. }
  35255. func (e *htmlTr) OnKeyPress(h EventHandler, scope ...any) HTMLTr {
  35256. e.setEventHandler("keypress", h, scope...)
  35257. return e
  35258. }
  35259. func (e *htmlTr) OnKeyUp(h EventHandler, scope ...any) HTMLTr {
  35260. e.setEventHandler("keyup", h, scope...)
  35261. return e
  35262. }
  35263. func (e *htmlTr) OnMouseDown(h EventHandler, scope ...any) HTMLTr {
  35264. e.setEventHandler("mousedown", h, scope...)
  35265. return e
  35266. }
  35267. func (e *htmlTr) OnMouseMove(h EventHandler, scope ...any) HTMLTr {
  35268. e.setEventHandler("mousemove", h, scope...)
  35269. return e
  35270. }
  35271. func (e *htmlTr) OnMouseOut(h EventHandler, scope ...any) HTMLTr {
  35272. e.setEventHandler("mouseout", h, scope...)
  35273. return e
  35274. }
  35275. func (e *htmlTr) OnMouseOver(h EventHandler, scope ...any) HTMLTr {
  35276. e.setEventHandler("mouseover", h, scope...)
  35277. return e
  35278. }
  35279. func (e *htmlTr) OnMouseUp(h EventHandler, scope ...any) HTMLTr {
  35280. e.setEventHandler("mouseup", h, scope...)
  35281. return e
  35282. }
  35283. func (e *htmlTr) OnPaste(h EventHandler, scope ...any) HTMLTr {
  35284. e.setEventHandler("paste", h, scope...)
  35285. return e
  35286. }
  35287. func (e *htmlTr) OnReset(h EventHandler, scope ...any) HTMLTr {
  35288. e.setEventHandler("reset", h, scope...)
  35289. return e
  35290. }
  35291. func (e *htmlTr) OnScroll(h EventHandler, scope ...any) HTMLTr {
  35292. e.setEventHandler("scroll", h, scope...)
  35293. return e
  35294. }
  35295. func (e *htmlTr) OnSearch(h EventHandler, scope ...any) HTMLTr {
  35296. e.setEventHandler("search", h, scope...)
  35297. return e
  35298. }
  35299. func (e *htmlTr) OnSelect(h EventHandler, scope ...any) HTMLTr {
  35300. e.setEventHandler("select", h, scope...)
  35301. return e
  35302. }
  35303. func (e *htmlTr) OnSubmit(h EventHandler, scope ...any) HTMLTr {
  35304. e.setEventHandler("submit", h, scope...)
  35305. return e
  35306. }
  35307. func (e *htmlTr) OnWheel(h EventHandler, scope ...any) HTMLTr {
  35308. e.setEventHandler("wheel", h, scope...)
  35309. return e
  35310. }
  35311. // HTMLU is the interface that describes a "u" HTML element.
  35312. type HTMLU interface {
  35313. UI
  35314. // Body set the content of the element.
  35315. Body(elems ...UI) HTMLU
  35316. // Text sets the content of the element with a text node containing the stringified given value.
  35317. Text(v any) HTMLU
  35318. // AccessKey specifies a shortcut key to activate/focus an element.
  35319. AccessKey(v string) HTMLU
  35320. // Aria stores accessible rich internet applications (ARIA) data.
  35321. Aria(k string, v any) HTMLU
  35322. // Attr sets the named attribute with the given value.
  35323. Attr(n string, v any) HTMLU
  35324. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  35325. Class(v ...string) HTMLU
  35326. // ContentEditable specifies whether the content of an element is editable or not.
  35327. ContentEditable(v bool) HTMLU
  35328. // DataSet stores custom data private to the page or application.
  35329. DataSet(k string, v any) HTMLU
  35330. // Dir specifies the text direction for the content in an element.
  35331. Dir(v string) HTMLU
  35332. // Draggable specifies whether an element is draggable or not.
  35333. Draggable(v bool) HTMLU
  35334. // Hidden specifies that an element is not yet, or is no longer relevant.
  35335. Hidden(v bool) HTMLU
  35336. // ID specifies a unique id for an element.
  35337. ID(v string) HTMLU
  35338. // Lang specifies the language of the element's content.
  35339. Lang(v string) HTMLU
  35340. // Role specifies to parsing software the exact function of an element (and its children).
  35341. Role(v string) HTMLU
  35342. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  35343. Spellcheck(v bool) HTMLU
  35344. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  35345. Style(k, v string) HTMLU
  35346. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  35347. Styles(s map[string]string) HTMLU
  35348. // TabIndex specifies the tabbing order of an element.
  35349. TabIndex(v int) HTMLU
  35350. // Title specifies extra information about an element.
  35351. Title(v string) HTMLU
  35352. // On registers the given event handler to the specified event.
  35353. On(event string, h EventHandler, scope ...any) HTMLU
  35354. // OnBlur calls the given handler when the element loses focus.
  35355. OnBlur(h EventHandler, scope ...any) HTMLU
  35356. // OnChange calls the given handler when the value of the element is changed.
  35357. OnChange(h EventHandler, scope ...any) HTMLU
  35358. // OnClick calls the given handler when there is a mouse click on the element.
  35359. OnClick(h EventHandler, scope ...any) HTMLU
  35360. // OnContextMenu calls the given handler when a context menu is triggered.
  35361. OnContextMenu(h EventHandler, scope ...any) HTMLU
  35362. // OnCopy calls the given handler when the user copies the content of an element.
  35363. OnCopy(h EventHandler, scope ...any) HTMLU
  35364. // OnCut calls the given handler when the user cuts the content of an element.
  35365. OnCut(h EventHandler, scope ...any) HTMLU
  35366. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  35367. OnDblClick(h EventHandler, scope ...any) HTMLU
  35368. // OnDrag calls the given handler when an element is dragged.
  35369. OnDrag(h EventHandler, scope ...any) HTMLU
  35370. // OnDragEnd calls the given handler at the end of a drag operation.
  35371. OnDragEnd(h EventHandler, scope ...any) HTMLU
  35372. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  35373. OnDragEnter(h EventHandler, scope ...any) HTMLU
  35374. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  35375. OnDragLeave(h EventHandler, scope ...any) HTMLU
  35376. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  35377. OnDragOver(h EventHandler, scope ...any) HTMLU
  35378. // OnDragStart calls the given handler at the start of a drag operation.
  35379. OnDragStart(h EventHandler, scope ...any) HTMLU
  35380. // OnDrop calls the given handler when dragged element is being dropped.
  35381. OnDrop(h EventHandler, scope ...any) HTMLU
  35382. // OnFocus calls the given handler when the element gets focus.
  35383. OnFocus(h EventHandler, scope ...any) HTMLU
  35384. // OnInput calls the given handler when an element gets user input.
  35385. OnInput(h EventHandler, scope ...any) HTMLU
  35386. // OnInvalid calls the given handler when an element is invalid.
  35387. OnInvalid(h EventHandler, scope ...any) HTMLU
  35388. // OnKeyDown calls the given handler when a user is pressing a key.
  35389. OnKeyDown(h EventHandler, scope ...any) HTMLU
  35390. // OnKeyPress calls the given handler when a user presses a key.
  35391. OnKeyPress(h EventHandler, scope ...any) HTMLU
  35392. // OnKeyUp calls the given handler when a user releases a key.
  35393. OnKeyUp(h EventHandler, scope ...any) HTMLU
  35394. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  35395. OnMouseDown(h EventHandler, scope ...any) HTMLU
  35396. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  35397. OnMouseMove(h EventHandler, scope ...any) HTMLU
  35398. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  35399. OnMouseOut(h EventHandler, scope ...any) HTMLU
  35400. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  35401. OnMouseOver(h EventHandler, scope ...any) HTMLU
  35402. // OnMouseUp calls the given handler when a mouse button is released over an element.
  35403. OnMouseUp(h EventHandler, scope ...any) HTMLU
  35404. // OnPaste calls the given handler when the user pastes some content in an element.
  35405. OnPaste(h EventHandler, scope ...any) HTMLU
  35406. // OnReset calls the given handler when the Reset button in a form is clicked.
  35407. OnReset(h EventHandler, scope ...any) HTMLU
  35408. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  35409. OnScroll(h EventHandler, scope ...any) HTMLU
  35410. // OnSearch calls the given handler when the user writes something in a search field.
  35411. OnSearch(h EventHandler, scope ...any) HTMLU
  35412. // OnSelect calls the given handler after some text has been selected in an element.
  35413. OnSelect(h EventHandler, scope ...any) HTMLU
  35414. // OnSubmit calls the given handler when a form is submitted.
  35415. OnSubmit(h EventHandler, scope ...any) HTMLU
  35416. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  35417. OnWheel(h EventHandler, scope ...any) HTMLU
  35418. }
  35419. // U returns an HTML element that defines text that should be stylistically different from normal text.
  35420. func U() HTMLU {
  35421. e := &htmlU{
  35422. htmlElement: htmlElement{
  35423. tag: "u",
  35424. isSelfClosing: false,
  35425. },
  35426. }
  35427. return e
  35428. }
  35429. type htmlU struct {
  35430. htmlElement
  35431. }
  35432. func (e *htmlU) Body(v ...UI) HTMLU {
  35433. e.setChildren(v...)
  35434. return e
  35435. }
  35436. func (e *htmlU) Text(v any) HTMLU {
  35437. return e.Body(Text(v))
  35438. }
  35439. func (e *htmlU) AccessKey(v string) HTMLU {
  35440. e.setAttr("accesskey", v)
  35441. return e
  35442. }
  35443. func (e *htmlU) Aria(k string, v any) HTMLU {
  35444. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  35445. return e
  35446. }
  35447. func (e *htmlU) Attr(n string, v any) HTMLU {
  35448. e.setAttr(n, v)
  35449. return e
  35450. }
  35451. func (e *htmlU) Class(v ...string) HTMLU {
  35452. e.setAttr("class", strings.Join(v, " "))
  35453. return e
  35454. }
  35455. func (e *htmlU) ContentEditable(v bool) HTMLU {
  35456. e.setAttr("contenteditable", v)
  35457. return e
  35458. }
  35459. func (e *htmlU) DataSet(k string, v any) HTMLU {
  35460. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  35461. return e
  35462. }
  35463. func (e *htmlU) Dir(v string) HTMLU {
  35464. e.setAttr("dir", v)
  35465. return e
  35466. }
  35467. func (e *htmlU) Draggable(v bool) HTMLU {
  35468. e.setAttr("draggable", v)
  35469. return e
  35470. }
  35471. func (e *htmlU) Hidden(v bool) HTMLU {
  35472. e.setAttr("hidden", v)
  35473. return e
  35474. }
  35475. func (e *htmlU) ID(v string) HTMLU {
  35476. e.setAttr("id", v)
  35477. return e
  35478. }
  35479. func (e *htmlU) Lang(v string) HTMLU {
  35480. e.setAttr("lang", v)
  35481. return e
  35482. }
  35483. func (e *htmlU) Role(v string) HTMLU {
  35484. e.setAttr("role", v)
  35485. return e
  35486. }
  35487. func (e *htmlU) Spellcheck(v bool) HTMLU {
  35488. s := "false"
  35489. if v {
  35490. s = "true"
  35491. }
  35492. e.setAttr("spellcheck", s)
  35493. return e
  35494. }
  35495. func (e *htmlU) Style(k, v string) HTMLU {
  35496. e.setAttr("style", k+":"+v)
  35497. return e
  35498. }
  35499. func (e *htmlU) Styles(s map[string]string) HTMLU {
  35500. for k, v := range s {
  35501. e.Style(k, v)
  35502. }
  35503. return e
  35504. }
  35505. func (e *htmlU) TabIndex(v int) HTMLU {
  35506. e.setAttr("tabindex", v)
  35507. return e
  35508. }
  35509. func (e *htmlU) Title(v string) HTMLU {
  35510. e.setAttr("title", v)
  35511. return e
  35512. }
  35513. func (e *htmlU) On(event string, h EventHandler, scope ...any) HTMLU {
  35514. e.setEventHandler(event, h, scope...)
  35515. return e
  35516. }
  35517. func (e *htmlU) OnBlur(h EventHandler, scope ...any) HTMLU {
  35518. e.setEventHandler("blur", h, scope...)
  35519. return e
  35520. }
  35521. func (e *htmlU) OnChange(h EventHandler, scope ...any) HTMLU {
  35522. e.setEventHandler("change", h, scope...)
  35523. return e
  35524. }
  35525. func (e *htmlU) OnClick(h EventHandler, scope ...any) HTMLU {
  35526. e.setEventHandler("click", h, scope...)
  35527. return e
  35528. }
  35529. func (e *htmlU) OnContextMenu(h EventHandler, scope ...any) HTMLU {
  35530. e.setEventHandler("contextmenu", h, scope...)
  35531. return e
  35532. }
  35533. func (e *htmlU) OnCopy(h EventHandler, scope ...any) HTMLU {
  35534. e.setEventHandler("copy", h, scope...)
  35535. return e
  35536. }
  35537. func (e *htmlU) OnCut(h EventHandler, scope ...any) HTMLU {
  35538. e.setEventHandler("cut", h, scope...)
  35539. return e
  35540. }
  35541. func (e *htmlU) OnDblClick(h EventHandler, scope ...any) HTMLU {
  35542. e.setEventHandler("dblclick", h, scope...)
  35543. return e
  35544. }
  35545. func (e *htmlU) OnDrag(h EventHandler, scope ...any) HTMLU {
  35546. e.setEventHandler("drag", h, scope...)
  35547. return e
  35548. }
  35549. func (e *htmlU) OnDragEnd(h EventHandler, scope ...any) HTMLU {
  35550. e.setEventHandler("dragend", h, scope...)
  35551. return e
  35552. }
  35553. func (e *htmlU) OnDragEnter(h EventHandler, scope ...any) HTMLU {
  35554. e.setEventHandler("dragenter", h, scope...)
  35555. return e
  35556. }
  35557. func (e *htmlU) OnDragLeave(h EventHandler, scope ...any) HTMLU {
  35558. e.setEventHandler("dragleave", h, scope...)
  35559. return e
  35560. }
  35561. func (e *htmlU) OnDragOver(h EventHandler, scope ...any) HTMLU {
  35562. e.setEventHandler("dragover", h, scope...)
  35563. return e
  35564. }
  35565. func (e *htmlU) OnDragStart(h EventHandler, scope ...any) HTMLU {
  35566. e.setEventHandler("dragstart", h, scope...)
  35567. return e
  35568. }
  35569. func (e *htmlU) OnDrop(h EventHandler, scope ...any) HTMLU {
  35570. e.setEventHandler("drop", h, scope...)
  35571. return e
  35572. }
  35573. func (e *htmlU) OnFocus(h EventHandler, scope ...any) HTMLU {
  35574. e.setEventHandler("focus", h, scope...)
  35575. return e
  35576. }
  35577. func (e *htmlU) OnInput(h EventHandler, scope ...any) HTMLU {
  35578. e.setEventHandler("input", h, scope...)
  35579. return e
  35580. }
  35581. func (e *htmlU) OnInvalid(h EventHandler, scope ...any) HTMLU {
  35582. e.setEventHandler("invalid", h, scope...)
  35583. return e
  35584. }
  35585. func (e *htmlU) OnKeyDown(h EventHandler, scope ...any) HTMLU {
  35586. e.setEventHandler("keydown", h, scope...)
  35587. return e
  35588. }
  35589. func (e *htmlU) OnKeyPress(h EventHandler, scope ...any) HTMLU {
  35590. e.setEventHandler("keypress", h, scope...)
  35591. return e
  35592. }
  35593. func (e *htmlU) OnKeyUp(h EventHandler, scope ...any) HTMLU {
  35594. e.setEventHandler("keyup", h, scope...)
  35595. return e
  35596. }
  35597. func (e *htmlU) OnMouseDown(h EventHandler, scope ...any) HTMLU {
  35598. e.setEventHandler("mousedown", h, scope...)
  35599. return e
  35600. }
  35601. func (e *htmlU) OnMouseMove(h EventHandler, scope ...any) HTMLU {
  35602. e.setEventHandler("mousemove", h, scope...)
  35603. return e
  35604. }
  35605. func (e *htmlU) OnMouseOut(h EventHandler, scope ...any) HTMLU {
  35606. e.setEventHandler("mouseout", h, scope...)
  35607. return e
  35608. }
  35609. func (e *htmlU) OnMouseOver(h EventHandler, scope ...any) HTMLU {
  35610. e.setEventHandler("mouseover", h, scope...)
  35611. return e
  35612. }
  35613. func (e *htmlU) OnMouseUp(h EventHandler, scope ...any) HTMLU {
  35614. e.setEventHandler("mouseup", h, scope...)
  35615. return e
  35616. }
  35617. func (e *htmlU) OnPaste(h EventHandler, scope ...any) HTMLU {
  35618. e.setEventHandler("paste", h, scope...)
  35619. return e
  35620. }
  35621. func (e *htmlU) OnReset(h EventHandler, scope ...any) HTMLU {
  35622. e.setEventHandler("reset", h, scope...)
  35623. return e
  35624. }
  35625. func (e *htmlU) OnScroll(h EventHandler, scope ...any) HTMLU {
  35626. e.setEventHandler("scroll", h, scope...)
  35627. return e
  35628. }
  35629. func (e *htmlU) OnSearch(h EventHandler, scope ...any) HTMLU {
  35630. e.setEventHandler("search", h, scope...)
  35631. return e
  35632. }
  35633. func (e *htmlU) OnSelect(h EventHandler, scope ...any) HTMLU {
  35634. e.setEventHandler("select", h, scope...)
  35635. return e
  35636. }
  35637. func (e *htmlU) OnSubmit(h EventHandler, scope ...any) HTMLU {
  35638. e.setEventHandler("submit", h, scope...)
  35639. return e
  35640. }
  35641. func (e *htmlU) OnWheel(h EventHandler, scope ...any) HTMLU {
  35642. e.setEventHandler("wheel", h, scope...)
  35643. return e
  35644. }
  35645. // HTMLUl is the interface that describes a "ul" HTML element.
  35646. type HTMLUl interface {
  35647. UI
  35648. // Body set the content of the element.
  35649. Body(elems ...UI) HTMLUl
  35650. // Text sets the content of the element with a text node containing the stringified given value.
  35651. Text(v any) HTMLUl
  35652. // AccessKey specifies a shortcut key to activate/focus an element.
  35653. AccessKey(v string) HTMLUl
  35654. // Aria stores accessible rich internet applications (ARIA) data.
  35655. Aria(k string, v any) HTMLUl
  35656. // Attr sets the named attribute with the given value.
  35657. Attr(n string, v any) HTMLUl
  35658. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  35659. Class(v ...string) HTMLUl
  35660. // ContentEditable specifies whether the content of an element is editable or not.
  35661. ContentEditable(v bool) HTMLUl
  35662. // DataSet stores custom data private to the page or application.
  35663. DataSet(k string, v any) HTMLUl
  35664. // Dir specifies the text direction for the content in an element.
  35665. Dir(v string) HTMLUl
  35666. // Draggable specifies whether an element is draggable or not.
  35667. Draggable(v bool) HTMLUl
  35668. // Hidden specifies that an element is not yet, or is no longer relevant.
  35669. Hidden(v bool) HTMLUl
  35670. // ID specifies a unique id for an element.
  35671. ID(v string) HTMLUl
  35672. // Lang specifies the language of the element's content.
  35673. Lang(v string) HTMLUl
  35674. // Role specifies to parsing software the exact function of an element (and its children).
  35675. Role(v string) HTMLUl
  35676. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  35677. Spellcheck(v bool) HTMLUl
  35678. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  35679. Style(k, v string) HTMLUl
  35680. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  35681. Styles(s map[string]string) HTMLUl
  35682. // TabIndex specifies the tabbing order of an element.
  35683. TabIndex(v int) HTMLUl
  35684. // Title specifies extra information about an element.
  35685. Title(v string) HTMLUl
  35686. // On registers the given event handler to the specified event.
  35687. On(event string, h EventHandler, scope ...any) HTMLUl
  35688. // OnBlur calls the given handler when the element loses focus.
  35689. OnBlur(h EventHandler, scope ...any) HTMLUl
  35690. // OnChange calls the given handler when the value of the element is changed.
  35691. OnChange(h EventHandler, scope ...any) HTMLUl
  35692. // OnClick calls the given handler when there is a mouse click on the element.
  35693. OnClick(h EventHandler, scope ...any) HTMLUl
  35694. // OnContextMenu calls the given handler when a context menu is triggered.
  35695. OnContextMenu(h EventHandler, scope ...any) HTMLUl
  35696. // OnCopy calls the given handler when the user copies the content of an element.
  35697. OnCopy(h EventHandler, scope ...any) HTMLUl
  35698. // OnCut calls the given handler when the user cuts the content of an element.
  35699. OnCut(h EventHandler, scope ...any) HTMLUl
  35700. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  35701. OnDblClick(h EventHandler, scope ...any) HTMLUl
  35702. // OnDrag calls the given handler when an element is dragged.
  35703. OnDrag(h EventHandler, scope ...any) HTMLUl
  35704. // OnDragEnd calls the given handler at the end of a drag operation.
  35705. OnDragEnd(h EventHandler, scope ...any) HTMLUl
  35706. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  35707. OnDragEnter(h EventHandler, scope ...any) HTMLUl
  35708. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  35709. OnDragLeave(h EventHandler, scope ...any) HTMLUl
  35710. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  35711. OnDragOver(h EventHandler, scope ...any) HTMLUl
  35712. // OnDragStart calls the given handler at the start of a drag operation.
  35713. OnDragStart(h EventHandler, scope ...any) HTMLUl
  35714. // OnDrop calls the given handler when dragged element is being dropped.
  35715. OnDrop(h EventHandler, scope ...any) HTMLUl
  35716. // OnFocus calls the given handler when the element gets focus.
  35717. OnFocus(h EventHandler, scope ...any) HTMLUl
  35718. // OnInput calls the given handler when an element gets user input.
  35719. OnInput(h EventHandler, scope ...any) HTMLUl
  35720. // OnInvalid calls the given handler when an element is invalid.
  35721. OnInvalid(h EventHandler, scope ...any) HTMLUl
  35722. // OnKeyDown calls the given handler when a user is pressing a key.
  35723. OnKeyDown(h EventHandler, scope ...any) HTMLUl
  35724. // OnKeyPress calls the given handler when a user presses a key.
  35725. OnKeyPress(h EventHandler, scope ...any) HTMLUl
  35726. // OnKeyUp calls the given handler when a user releases a key.
  35727. OnKeyUp(h EventHandler, scope ...any) HTMLUl
  35728. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  35729. OnMouseDown(h EventHandler, scope ...any) HTMLUl
  35730. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  35731. OnMouseMove(h EventHandler, scope ...any) HTMLUl
  35732. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  35733. OnMouseOut(h EventHandler, scope ...any) HTMLUl
  35734. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  35735. OnMouseOver(h EventHandler, scope ...any) HTMLUl
  35736. // OnMouseUp calls the given handler when a mouse button is released over an element.
  35737. OnMouseUp(h EventHandler, scope ...any) HTMLUl
  35738. // OnPaste calls the given handler when the user pastes some content in an element.
  35739. OnPaste(h EventHandler, scope ...any) HTMLUl
  35740. // OnReset calls the given handler when the Reset button in a form is clicked.
  35741. OnReset(h EventHandler, scope ...any) HTMLUl
  35742. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  35743. OnScroll(h EventHandler, scope ...any) HTMLUl
  35744. // OnSearch calls the given handler when the user writes something in a search field.
  35745. OnSearch(h EventHandler, scope ...any) HTMLUl
  35746. // OnSelect calls the given handler after some text has been selected in an element.
  35747. OnSelect(h EventHandler, scope ...any) HTMLUl
  35748. // OnSubmit calls the given handler when a form is submitted.
  35749. OnSubmit(h EventHandler, scope ...any) HTMLUl
  35750. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  35751. OnWheel(h EventHandler, scope ...any) HTMLUl
  35752. }
  35753. // Ul returns an HTML element that defines an unordered list.
  35754. func Ul() HTMLUl {
  35755. e := &htmlUl{
  35756. htmlElement: htmlElement{
  35757. tag: "ul",
  35758. isSelfClosing: false,
  35759. },
  35760. }
  35761. return e
  35762. }
  35763. type htmlUl struct {
  35764. htmlElement
  35765. }
  35766. func (e *htmlUl) Body(v ...UI) HTMLUl {
  35767. e.setChildren(v...)
  35768. return e
  35769. }
  35770. func (e *htmlUl) Text(v any) HTMLUl {
  35771. return e.Body(Text(v))
  35772. }
  35773. func (e *htmlUl) AccessKey(v string) HTMLUl {
  35774. e.setAttr("accesskey", v)
  35775. return e
  35776. }
  35777. func (e *htmlUl) Aria(k string, v any) HTMLUl {
  35778. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  35779. return e
  35780. }
  35781. func (e *htmlUl) Attr(n string, v any) HTMLUl {
  35782. e.setAttr(n, v)
  35783. return e
  35784. }
  35785. func (e *htmlUl) Class(v ...string) HTMLUl {
  35786. e.setAttr("class", strings.Join(v, " "))
  35787. return e
  35788. }
  35789. func (e *htmlUl) ContentEditable(v bool) HTMLUl {
  35790. e.setAttr("contenteditable", v)
  35791. return e
  35792. }
  35793. func (e *htmlUl) DataSet(k string, v any) HTMLUl {
  35794. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  35795. return e
  35796. }
  35797. func (e *htmlUl) Dir(v string) HTMLUl {
  35798. e.setAttr("dir", v)
  35799. return e
  35800. }
  35801. func (e *htmlUl) Draggable(v bool) HTMLUl {
  35802. e.setAttr("draggable", v)
  35803. return e
  35804. }
  35805. func (e *htmlUl) Hidden(v bool) HTMLUl {
  35806. e.setAttr("hidden", v)
  35807. return e
  35808. }
  35809. func (e *htmlUl) ID(v string) HTMLUl {
  35810. e.setAttr("id", v)
  35811. return e
  35812. }
  35813. func (e *htmlUl) Lang(v string) HTMLUl {
  35814. e.setAttr("lang", v)
  35815. return e
  35816. }
  35817. func (e *htmlUl) Role(v string) HTMLUl {
  35818. e.setAttr("role", v)
  35819. return e
  35820. }
  35821. func (e *htmlUl) Spellcheck(v bool) HTMLUl {
  35822. s := "false"
  35823. if v {
  35824. s = "true"
  35825. }
  35826. e.setAttr("spellcheck", s)
  35827. return e
  35828. }
  35829. func (e *htmlUl) Style(k, v string) HTMLUl {
  35830. e.setAttr("style", k+":"+v)
  35831. return e
  35832. }
  35833. func (e *htmlUl) Styles(s map[string]string) HTMLUl {
  35834. for k, v := range s {
  35835. e.Style(k, v)
  35836. }
  35837. return e
  35838. }
  35839. func (e *htmlUl) TabIndex(v int) HTMLUl {
  35840. e.setAttr("tabindex", v)
  35841. return e
  35842. }
  35843. func (e *htmlUl) Title(v string) HTMLUl {
  35844. e.setAttr("title", v)
  35845. return e
  35846. }
  35847. func (e *htmlUl) On(event string, h EventHandler, scope ...any) HTMLUl {
  35848. e.setEventHandler(event, h, scope...)
  35849. return e
  35850. }
  35851. func (e *htmlUl) OnBlur(h EventHandler, scope ...any) HTMLUl {
  35852. e.setEventHandler("blur", h, scope...)
  35853. return e
  35854. }
  35855. func (e *htmlUl) OnChange(h EventHandler, scope ...any) HTMLUl {
  35856. e.setEventHandler("change", h, scope...)
  35857. return e
  35858. }
  35859. func (e *htmlUl) OnClick(h EventHandler, scope ...any) HTMLUl {
  35860. e.setEventHandler("click", h, scope...)
  35861. return e
  35862. }
  35863. func (e *htmlUl) OnContextMenu(h EventHandler, scope ...any) HTMLUl {
  35864. e.setEventHandler("contextmenu", h, scope...)
  35865. return e
  35866. }
  35867. func (e *htmlUl) OnCopy(h EventHandler, scope ...any) HTMLUl {
  35868. e.setEventHandler("copy", h, scope...)
  35869. return e
  35870. }
  35871. func (e *htmlUl) OnCut(h EventHandler, scope ...any) HTMLUl {
  35872. e.setEventHandler("cut", h, scope...)
  35873. return e
  35874. }
  35875. func (e *htmlUl) OnDblClick(h EventHandler, scope ...any) HTMLUl {
  35876. e.setEventHandler("dblclick", h, scope...)
  35877. return e
  35878. }
  35879. func (e *htmlUl) OnDrag(h EventHandler, scope ...any) HTMLUl {
  35880. e.setEventHandler("drag", h, scope...)
  35881. return e
  35882. }
  35883. func (e *htmlUl) OnDragEnd(h EventHandler, scope ...any) HTMLUl {
  35884. e.setEventHandler("dragend", h, scope...)
  35885. return e
  35886. }
  35887. func (e *htmlUl) OnDragEnter(h EventHandler, scope ...any) HTMLUl {
  35888. e.setEventHandler("dragenter", h, scope...)
  35889. return e
  35890. }
  35891. func (e *htmlUl) OnDragLeave(h EventHandler, scope ...any) HTMLUl {
  35892. e.setEventHandler("dragleave", h, scope...)
  35893. return e
  35894. }
  35895. func (e *htmlUl) OnDragOver(h EventHandler, scope ...any) HTMLUl {
  35896. e.setEventHandler("dragover", h, scope...)
  35897. return e
  35898. }
  35899. func (e *htmlUl) OnDragStart(h EventHandler, scope ...any) HTMLUl {
  35900. e.setEventHandler("dragstart", h, scope...)
  35901. return e
  35902. }
  35903. func (e *htmlUl) OnDrop(h EventHandler, scope ...any) HTMLUl {
  35904. e.setEventHandler("drop", h, scope...)
  35905. return e
  35906. }
  35907. func (e *htmlUl) OnFocus(h EventHandler, scope ...any) HTMLUl {
  35908. e.setEventHandler("focus", h, scope...)
  35909. return e
  35910. }
  35911. func (e *htmlUl) OnInput(h EventHandler, scope ...any) HTMLUl {
  35912. e.setEventHandler("input", h, scope...)
  35913. return e
  35914. }
  35915. func (e *htmlUl) OnInvalid(h EventHandler, scope ...any) HTMLUl {
  35916. e.setEventHandler("invalid", h, scope...)
  35917. return e
  35918. }
  35919. func (e *htmlUl) OnKeyDown(h EventHandler, scope ...any) HTMLUl {
  35920. e.setEventHandler("keydown", h, scope...)
  35921. return e
  35922. }
  35923. func (e *htmlUl) OnKeyPress(h EventHandler, scope ...any) HTMLUl {
  35924. e.setEventHandler("keypress", h, scope...)
  35925. return e
  35926. }
  35927. func (e *htmlUl) OnKeyUp(h EventHandler, scope ...any) HTMLUl {
  35928. e.setEventHandler("keyup", h, scope...)
  35929. return e
  35930. }
  35931. func (e *htmlUl) OnMouseDown(h EventHandler, scope ...any) HTMLUl {
  35932. e.setEventHandler("mousedown", h, scope...)
  35933. return e
  35934. }
  35935. func (e *htmlUl) OnMouseMove(h EventHandler, scope ...any) HTMLUl {
  35936. e.setEventHandler("mousemove", h, scope...)
  35937. return e
  35938. }
  35939. func (e *htmlUl) OnMouseOut(h EventHandler, scope ...any) HTMLUl {
  35940. e.setEventHandler("mouseout", h, scope...)
  35941. return e
  35942. }
  35943. func (e *htmlUl) OnMouseOver(h EventHandler, scope ...any) HTMLUl {
  35944. e.setEventHandler("mouseover", h, scope...)
  35945. return e
  35946. }
  35947. func (e *htmlUl) OnMouseUp(h EventHandler, scope ...any) HTMLUl {
  35948. e.setEventHandler("mouseup", h, scope...)
  35949. return e
  35950. }
  35951. func (e *htmlUl) OnPaste(h EventHandler, scope ...any) HTMLUl {
  35952. e.setEventHandler("paste", h, scope...)
  35953. return e
  35954. }
  35955. func (e *htmlUl) OnReset(h EventHandler, scope ...any) HTMLUl {
  35956. e.setEventHandler("reset", h, scope...)
  35957. return e
  35958. }
  35959. func (e *htmlUl) OnScroll(h EventHandler, scope ...any) HTMLUl {
  35960. e.setEventHandler("scroll", h, scope...)
  35961. return e
  35962. }
  35963. func (e *htmlUl) OnSearch(h EventHandler, scope ...any) HTMLUl {
  35964. e.setEventHandler("search", h, scope...)
  35965. return e
  35966. }
  35967. func (e *htmlUl) OnSelect(h EventHandler, scope ...any) HTMLUl {
  35968. e.setEventHandler("select", h, scope...)
  35969. return e
  35970. }
  35971. func (e *htmlUl) OnSubmit(h EventHandler, scope ...any) HTMLUl {
  35972. e.setEventHandler("submit", h, scope...)
  35973. return e
  35974. }
  35975. func (e *htmlUl) OnWheel(h EventHandler, scope ...any) HTMLUl {
  35976. e.setEventHandler("wheel", h, scope...)
  35977. return e
  35978. }
  35979. // HTMLVar is the interface that describes a "var" HTML element.
  35980. type HTMLVar interface {
  35981. UI
  35982. // Body set the content of the element.
  35983. Body(elems ...UI) HTMLVar
  35984. // Text sets the content of the element with a text node containing the stringified given value.
  35985. Text(v any) HTMLVar
  35986. // AccessKey specifies a shortcut key to activate/focus an element.
  35987. AccessKey(v string) HTMLVar
  35988. // Aria stores accessible rich internet applications (ARIA) data.
  35989. Aria(k string, v any) HTMLVar
  35990. // Attr sets the named attribute with the given value.
  35991. Attr(n string, v any) HTMLVar
  35992. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  35993. Class(v ...string) HTMLVar
  35994. // ContentEditable specifies whether the content of an element is editable or not.
  35995. ContentEditable(v bool) HTMLVar
  35996. // DataSet stores custom data private to the page or application.
  35997. DataSet(k string, v any) HTMLVar
  35998. // Dir specifies the text direction for the content in an element.
  35999. Dir(v string) HTMLVar
  36000. // Draggable specifies whether an element is draggable or not.
  36001. Draggable(v bool) HTMLVar
  36002. // Hidden specifies that an element is not yet, or is no longer relevant.
  36003. Hidden(v bool) HTMLVar
  36004. // ID specifies a unique id for an element.
  36005. ID(v string) HTMLVar
  36006. // Lang specifies the language of the element's content.
  36007. Lang(v string) HTMLVar
  36008. // Role specifies to parsing software the exact function of an element (and its children).
  36009. Role(v string) HTMLVar
  36010. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  36011. Spellcheck(v bool) HTMLVar
  36012. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  36013. Style(k, v string) HTMLVar
  36014. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  36015. Styles(s map[string]string) HTMLVar
  36016. // TabIndex specifies the tabbing order of an element.
  36017. TabIndex(v int) HTMLVar
  36018. // Title specifies extra information about an element.
  36019. Title(v string) HTMLVar
  36020. // On registers the given event handler to the specified event.
  36021. On(event string, h EventHandler, scope ...any) HTMLVar
  36022. // OnBlur calls the given handler when the element loses focus.
  36023. OnBlur(h EventHandler, scope ...any) HTMLVar
  36024. // OnChange calls the given handler when the value of the element is changed.
  36025. OnChange(h EventHandler, scope ...any) HTMLVar
  36026. // OnClick calls the given handler when there is a mouse click on the element.
  36027. OnClick(h EventHandler, scope ...any) HTMLVar
  36028. // OnContextMenu calls the given handler when a context menu is triggered.
  36029. OnContextMenu(h EventHandler, scope ...any) HTMLVar
  36030. // OnCopy calls the given handler when the user copies the content of an element.
  36031. OnCopy(h EventHandler, scope ...any) HTMLVar
  36032. // OnCut calls the given handler when the user cuts the content of an element.
  36033. OnCut(h EventHandler, scope ...any) HTMLVar
  36034. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  36035. OnDblClick(h EventHandler, scope ...any) HTMLVar
  36036. // OnDrag calls the given handler when an element is dragged.
  36037. OnDrag(h EventHandler, scope ...any) HTMLVar
  36038. // OnDragEnd calls the given handler at the end of a drag operation.
  36039. OnDragEnd(h EventHandler, scope ...any) HTMLVar
  36040. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  36041. OnDragEnter(h EventHandler, scope ...any) HTMLVar
  36042. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  36043. OnDragLeave(h EventHandler, scope ...any) HTMLVar
  36044. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  36045. OnDragOver(h EventHandler, scope ...any) HTMLVar
  36046. // OnDragStart calls the given handler at the start of a drag operation.
  36047. OnDragStart(h EventHandler, scope ...any) HTMLVar
  36048. // OnDrop calls the given handler when dragged element is being dropped.
  36049. OnDrop(h EventHandler, scope ...any) HTMLVar
  36050. // OnFocus calls the given handler when the element gets focus.
  36051. OnFocus(h EventHandler, scope ...any) HTMLVar
  36052. // OnInput calls the given handler when an element gets user input.
  36053. OnInput(h EventHandler, scope ...any) HTMLVar
  36054. // OnInvalid calls the given handler when an element is invalid.
  36055. OnInvalid(h EventHandler, scope ...any) HTMLVar
  36056. // OnKeyDown calls the given handler when a user is pressing a key.
  36057. OnKeyDown(h EventHandler, scope ...any) HTMLVar
  36058. // OnKeyPress calls the given handler when a user presses a key.
  36059. OnKeyPress(h EventHandler, scope ...any) HTMLVar
  36060. // OnKeyUp calls the given handler when a user releases a key.
  36061. OnKeyUp(h EventHandler, scope ...any) HTMLVar
  36062. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  36063. OnMouseDown(h EventHandler, scope ...any) HTMLVar
  36064. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  36065. OnMouseMove(h EventHandler, scope ...any) HTMLVar
  36066. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  36067. OnMouseOut(h EventHandler, scope ...any) HTMLVar
  36068. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  36069. OnMouseOver(h EventHandler, scope ...any) HTMLVar
  36070. // OnMouseUp calls the given handler when a mouse button is released over an element.
  36071. OnMouseUp(h EventHandler, scope ...any) HTMLVar
  36072. // OnPaste calls the given handler when the user pastes some content in an element.
  36073. OnPaste(h EventHandler, scope ...any) HTMLVar
  36074. // OnReset calls the given handler when the Reset button in a form is clicked.
  36075. OnReset(h EventHandler, scope ...any) HTMLVar
  36076. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  36077. OnScroll(h EventHandler, scope ...any) HTMLVar
  36078. // OnSearch calls the given handler when the user writes something in a search field.
  36079. OnSearch(h EventHandler, scope ...any) HTMLVar
  36080. // OnSelect calls the given handler after some text has been selected in an element.
  36081. OnSelect(h EventHandler, scope ...any) HTMLVar
  36082. // OnSubmit calls the given handler when a form is submitted.
  36083. OnSubmit(h EventHandler, scope ...any) HTMLVar
  36084. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  36085. OnWheel(h EventHandler, scope ...any) HTMLVar
  36086. }
  36087. // Var returns an HTML element that defines a variable.
  36088. func Var() HTMLVar {
  36089. e := &htmlVar{
  36090. htmlElement: htmlElement{
  36091. tag: "var",
  36092. isSelfClosing: false,
  36093. },
  36094. }
  36095. return e
  36096. }
  36097. type htmlVar struct {
  36098. htmlElement
  36099. }
  36100. func (e *htmlVar) Body(v ...UI) HTMLVar {
  36101. e.setChildren(v...)
  36102. return e
  36103. }
  36104. func (e *htmlVar) Text(v any) HTMLVar {
  36105. return e.Body(Text(v))
  36106. }
  36107. func (e *htmlVar) AccessKey(v string) HTMLVar {
  36108. e.setAttr("accesskey", v)
  36109. return e
  36110. }
  36111. func (e *htmlVar) Aria(k string, v any) HTMLVar {
  36112. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  36113. return e
  36114. }
  36115. func (e *htmlVar) Attr(n string, v any) HTMLVar {
  36116. e.setAttr(n, v)
  36117. return e
  36118. }
  36119. func (e *htmlVar) Class(v ...string) HTMLVar {
  36120. e.setAttr("class", strings.Join(v, " "))
  36121. return e
  36122. }
  36123. func (e *htmlVar) ContentEditable(v bool) HTMLVar {
  36124. e.setAttr("contenteditable", v)
  36125. return e
  36126. }
  36127. func (e *htmlVar) DataSet(k string, v any) HTMLVar {
  36128. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  36129. return e
  36130. }
  36131. func (e *htmlVar) Dir(v string) HTMLVar {
  36132. e.setAttr("dir", v)
  36133. return e
  36134. }
  36135. func (e *htmlVar) Draggable(v bool) HTMLVar {
  36136. e.setAttr("draggable", v)
  36137. return e
  36138. }
  36139. func (e *htmlVar) Hidden(v bool) HTMLVar {
  36140. e.setAttr("hidden", v)
  36141. return e
  36142. }
  36143. func (e *htmlVar) ID(v string) HTMLVar {
  36144. e.setAttr("id", v)
  36145. return e
  36146. }
  36147. func (e *htmlVar) Lang(v string) HTMLVar {
  36148. e.setAttr("lang", v)
  36149. return e
  36150. }
  36151. func (e *htmlVar) Role(v string) HTMLVar {
  36152. e.setAttr("role", v)
  36153. return e
  36154. }
  36155. func (e *htmlVar) Spellcheck(v bool) HTMLVar {
  36156. s := "false"
  36157. if v {
  36158. s = "true"
  36159. }
  36160. e.setAttr("spellcheck", s)
  36161. return e
  36162. }
  36163. func (e *htmlVar) Style(k, v string) HTMLVar {
  36164. e.setAttr("style", k+":"+v)
  36165. return e
  36166. }
  36167. func (e *htmlVar) Styles(s map[string]string) HTMLVar {
  36168. for k, v := range s {
  36169. e.Style(k, v)
  36170. }
  36171. return e
  36172. }
  36173. func (e *htmlVar) TabIndex(v int) HTMLVar {
  36174. e.setAttr("tabindex", v)
  36175. return e
  36176. }
  36177. func (e *htmlVar) Title(v string) HTMLVar {
  36178. e.setAttr("title", v)
  36179. return e
  36180. }
  36181. func (e *htmlVar) On(event string, h EventHandler, scope ...any) HTMLVar {
  36182. e.setEventHandler(event, h, scope...)
  36183. return e
  36184. }
  36185. func (e *htmlVar) OnBlur(h EventHandler, scope ...any) HTMLVar {
  36186. e.setEventHandler("blur", h, scope...)
  36187. return e
  36188. }
  36189. func (e *htmlVar) OnChange(h EventHandler, scope ...any) HTMLVar {
  36190. e.setEventHandler("change", h, scope...)
  36191. return e
  36192. }
  36193. func (e *htmlVar) OnClick(h EventHandler, scope ...any) HTMLVar {
  36194. e.setEventHandler("click", h, scope...)
  36195. return e
  36196. }
  36197. func (e *htmlVar) OnContextMenu(h EventHandler, scope ...any) HTMLVar {
  36198. e.setEventHandler("contextmenu", h, scope...)
  36199. return e
  36200. }
  36201. func (e *htmlVar) OnCopy(h EventHandler, scope ...any) HTMLVar {
  36202. e.setEventHandler("copy", h, scope...)
  36203. return e
  36204. }
  36205. func (e *htmlVar) OnCut(h EventHandler, scope ...any) HTMLVar {
  36206. e.setEventHandler("cut", h, scope...)
  36207. return e
  36208. }
  36209. func (e *htmlVar) OnDblClick(h EventHandler, scope ...any) HTMLVar {
  36210. e.setEventHandler("dblclick", h, scope...)
  36211. return e
  36212. }
  36213. func (e *htmlVar) OnDrag(h EventHandler, scope ...any) HTMLVar {
  36214. e.setEventHandler("drag", h, scope...)
  36215. return e
  36216. }
  36217. func (e *htmlVar) OnDragEnd(h EventHandler, scope ...any) HTMLVar {
  36218. e.setEventHandler("dragend", h, scope...)
  36219. return e
  36220. }
  36221. func (e *htmlVar) OnDragEnter(h EventHandler, scope ...any) HTMLVar {
  36222. e.setEventHandler("dragenter", h, scope...)
  36223. return e
  36224. }
  36225. func (e *htmlVar) OnDragLeave(h EventHandler, scope ...any) HTMLVar {
  36226. e.setEventHandler("dragleave", h, scope...)
  36227. return e
  36228. }
  36229. func (e *htmlVar) OnDragOver(h EventHandler, scope ...any) HTMLVar {
  36230. e.setEventHandler("dragover", h, scope...)
  36231. return e
  36232. }
  36233. func (e *htmlVar) OnDragStart(h EventHandler, scope ...any) HTMLVar {
  36234. e.setEventHandler("dragstart", h, scope...)
  36235. return e
  36236. }
  36237. func (e *htmlVar) OnDrop(h EventHandler, scope ...any) HTMLVar {
  36238. e.setEventHandler("drop", h, scope...)
  36239. return e
  36240. }
  36241. func (e *htmlVar) OnFocus(h EventHandler, scope ...any) HTMLVar {
  36242. e.setEventHandler("focus", h, scope...)
  36243. return e
  36244. }
  36245. func (e *htmlVar) OnInput(h EventHandler, scope ...any) HTMLVar {
  36246. e.setEventHandler("input", h, scope...)
  36247. return e
  36248. }
  36249. func (e *htmlVar) OnInvalid(h EventHandler, scope ...any) HTMLVar {
  36250. e.setEventHandler("invalid", h, scope...)
  36251. return e
  36252. }
  36253. func (e *htmlVar) OnKeyDown(h EventHandler, scope ...any) HTMLVar {
  36254. e.setEventHandler("keydown", h, scope...)
  36255. return e
  36256. }
  36257. func (e *htmlVar) OnKeyPress(h EventHandler, scope ...any) HTMLVar {
  36258. e.setEventHandler("keypress", h, scope...)
  36259. return e
  36260. }
  36261. func (e *htmlVar) OnKeyUp(h EventHandler, scope ...any) HTMLVar {
  36262. e.setEventHandler("keyup", h, scope...)
  36263. return e
  36264. }
  36265. func (e *htmlVar) OnMouseDown(h EventHandler, scope ...any) HTMLVar {
  36266. e.setEventHandler("mousedown", h, scope...)
  36267. return e
  36268. }
  36269. func (e *htmlVar) OnMouseMove(h EventHandler, scope ...any) HTMLVar {
  36270. e.setEventHandler("mousemove", h, scope...)
  36271. return e
  36272. }
  36273. func (e *htmlVar) OnMouseOut(h EventHandler, scope ...any) HTMLVar {
  36274. e.setEventHandler("mouseout", h, scope...)
  36275. return e
  36276. }
  36277. func (e *htmlVar) OnMouseOver(h EventHandler, scope ...any) HTMLVar {
  36278. e.setEventHandler("mouseover", h, scope...)
  36279. return e
  36280. }
  36281. func (e *htmlVar) OnMouseUp(h EventHandler, scope ...any) HTMLVar {
  36282. e.setEventHandler("mouseup", h, scope...)
  36283. return e
  36284. }
  36285. func (e *htmlVar) OnPaste(h EventHandler, scope ...any) HTMLVar {
  36286. e.setEventHandler("paste", h, scope...)
  36287. return e
  36288. }
  36289. func (e *htmlVar) OnReset(h EventHandler, scope ...any) HTMLVar {
  36290. e.setEventHandler("reset", h, scope...)
  36291. return e
  36292. }
  36293. func (e *htmlVar) OnScroll(h EventHandler, scope ...any) HTMLVar {
  36294. e.setEventHandler("scroll", h, scope...)
  36295. return e
  36296. }
  36297. func (e *htmlVar) OnSearch(h EventHandler, scope ...any) HTMLVar {
  36298. e.setEventHandler("search", h, scope...)
  36299. return e
  36300. }
  36301. func (e *htmlVar) OnSelect(h EventHandler, scope ...any) HTMLVar {
  36302. e.setEventHandler("select", h, scope...)
  36303. return e
  36304. }
  36305. func (e *htmlVar) OnSubmit(h EventHandler, scope ...any) HTMLVar {
  36306. e.setEventHandler("submit", h, scope...)
  36307. return e
  36308. }
  36309. func (e *htmlVar) OnWheel(h EventHandler, scope ...any) HTMLVar {
  36310. e.setEventHandler("wheel", h, scope...)
  36311. return e
  36312. }
  36313. // HTMLVideo is the interface that describes a "video" HTML element.
  36314. type HTMLVideo interface {
  36315. UI
  36316. // Body set the content of the element.
  36317. Body(elems ...UI) HTMLVideo
  36318. // Text sets the content of the element with a text node containing the stringified given value.
  36319. Text(v any) HTMLVideo
  36320. // AccessKey specifies a shortcut key to activate/focus an element.
  36321. AccessKey(v string) HTMLVideo
  36322. // Aria stores accessible rich internet applications (ARIA) data.
  36323. Aria(k string, v any) HTMLVideo
  36324. // Attr sets the named attribute with the given value.
  36325. Attr(n string, v any) HTMLVideo
  36326. // AutoPlay specifies that the audio/video will start playing as soon as it is ready.
  36327. AutoPlay(v bool) HTMLVideo
  36328. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  36329. Class(v ...string) HTMLVideo
  36330. // ContentEditable specifies whether the content of an element is editable or not.
  36331. ContentEditable(v bool) HTMLVideo
  36332. // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc).
  36333. Controls(v bool) HTMLVideo
  36334. // CrossOrigin sets the mode of the request to an HTTP CORS Request.
  36335. CrossOrigin(v string) HTMLVideo
  36336. // DataSet stores custom data private to the page or application.
  36337. DataSet(k string, v any) HTMLVideo
  36338. // Dir specifies the text direction for the content in an element.
  36339. Dir(v string) HTMLVideo
  36340. // Draggable specifies whether an element is draggable or not.
  36341. Draggable(v bool) HTMLVideo
  36342. // Height specifies the height of the element (in pixels).
  36343. Height(v int) HTMLVideo
  36344. // Hidden specifies that an element is not yet, or is no longer relevant.
  36345. Hidden(v bool) HTMLVideo
  36346. // ID specifies a unique id for an element.
  36347. ID(v string) HTMLVideo
  36348. // Lang specifies the language of the element's content.
  36349. Lang(v string) HTMLVideo
  36350. // Loop specifies that the audio/video will start over again, every time it is finished.
  36351. Loop(v bool) HTMLVideo
  36352. // Muted specifies that the audio output of the video should be muted.
  36353. Muted(v bool) HTMLVideo
  36354. // Poster specifies an image to be shown while the video is downloading, or until the user hits the play button.
  36355. Poster(v string) HTMLVideo
  36356. // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads.
  36357. Preload(v string) HTMLVideo
  36358. // Role specifies to parsing software the exact function of an element (and its children).
  36359. Role(v string) HTMLVideo
  36360. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  36361. Spellcheck(v bool) HTMLVideo
  36362. // Src specifies the URL of the media file.
  36363. Src(v string) HTMLVideo
  36364. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  36365. Style(k, v string) HTMLVideo
  36366. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  36367. Styles(s map[string]string) HTMLVideo
  36368. // TabIndex specifies the tabbing order of an element.
  36369. TabIndex(v int) HTMLVideo
  36370. // Title specifies extra information about an element.
  36371. Title(v string) HTMLVideo
  36372. // Width specifies the width of the element.
  36373. Width(v int) HTMLVideo
  36374. // On registers the given event handler to the specified event.
  36375. On(event string, h EventHandler, scope ...any) HTMLVideo
  36376. // OnAbort calls the given handler on abort.
  36377. OnAbort(h EventHandler, scope ...any) HTMLVideo
  36378. // OnBlur calls the given handler when the element loses focus.
  36379. OnBlur(h EventHandler, scope ...any) HTMLVideo
  36380. // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin).
  36381. OnCanPlay(h EventHandler, scope ...any) HTMLVideo
  36382. // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering.
  36383. OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo
  36384. // OnChange calls the given handler when the value of the element is changed.
  36385. OnChange(h EventHandler, scope ...any) HTMLVideo
  36386. // OnClick calls the given handler when there is a mouse click on the element.
  36387. OnClick(h EventHandler, scope ...any) HTMLVideo
  36388. // OnContextMenu calls the given handler when a context menu is triggered.
  36389. OnContextMenu(h EventHandler, scope ...any) HTMLVideo
  36390. // OnCopy calls the given handler when the user copies the content of an element.
  36391. OnCopy(h EventHandler, scope ...any) HTMLVideo
  36392. // OnCueChange calls the given handler when the cue changes in a track element.
  36393. OnCueChange(h EventHandler, scope ...any) HTMLVideo
  36394. // OnCut calls the given handler when the user cuts the content of an element.
  36395. OnCut(h EventHandler, scope ...any) HTMLVideo
  36396. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  36397. OnDblClick(h EventHandler, scope ...any) HTMLVideo
  36398. // OnDrag calls the given handler when an element is dragged.
  36399. OnDrag(h EventHandler, scope ...any) HTMLVideo
  36400. // OnDragEnd calls the given handler at the end of a drag operation.
  36401. OnDragEnd(h EventHandler, scope ...any) HTMLVideo
  36402. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  36403. OnDragEnter(h EventHandler, scope ...any) HTMLVideo
  36404. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  36405. OnDragLeave(h EventHandler, scope ...any) HTMLVideo
  36406. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  36407. OnDragOver(h EventHandler, scope ...any) HTMLVideo
  36408. // OnDragStart calls the given handler at the start of a drag operation.
  36409. OnDragStart(h EventHandler, scope ...any) HTMLVideo
  36410. // OnDrop calls the given handler when dragged element is being dropped.
  36411. OnDrop(h EventHandler, scope ...any) HTMLVideo
  36412. // OnDurationChange calls the given handler when the length of the media changes.
  36413. OnDurationChange(h EventHandler, scope ...any) HTMLVideo
  36414. // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects).
  36415. OnEmptied(h EventHandler, scope ...any) HTMLVideo
  36416. // OnEnded calls the given handler when the media has reach the end.
  36417. OnEnded(h EventHandler, scope ...any) HTMLVideo
  36418. // OnError calls the given handler when an error occurs.
  36419. OnError(h EventHandler, scope ...any) HTMLVideo
  36420. // OnFocus calls the given handler when the element gets focus.
  36421. OnFocus(h EventHandler, scope ...any) HTMLVideo
  36422. // OnInput calls the given handler when an element gets user input.
  36423. OnInput(h EventHandler, scope ...any) HTMLVideo
  36424. // OnInvalid calls the given handler when an element is invalid.
  36425. OnInvalid(h EventHandler, scope ...any) HTMLVideo
  36426. // OnKeyDown calls the given handler when a user is pressing a key.
  36427. OnKeyDown(h EventHandler, scope ...any) HTMLVideo
  36428. // OnKeyPress calls the given handler when a user presses a key.
  36429. OnKeyPress(h EventHandler, scope ...any) HTMLVideo
  36430. // OnKeyUp calls the given handler when a user releases a key.
  36431. OnKeyUp(h EventHandler, scope ...any) HTMLVideo
  36432. // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded.
  36433. OnLoadStart(h EventHandler, scope ...any) HTMLVideo
  36434. // OnLoadedData calls the given handler when media data is loaded.
  36435. OnLoadedData(h EventHandler, scope ...any) HTMLVideo
  36436. // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded.
  36437. OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo
  36438. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  36439. OnMouseDown(h EventHandler, scope ...any) HTMLVideo
  36440. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  36441. OnMouseMove(h EventHandler, scope ...any) HTMLVideo
  36442. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  36443. OnMouseOut(h EventHandler, scope ...any) HTMLVideo
  36444. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  36445. OnMouseOver(h EventHandler, scope ...any) HTMLVideo
  36446. // OnMouseUp calls the given handler when a mouse button is released over an element.
  36447. OnMouseUp(h EventHandler, scope ...any) HTMLVideo
  36448. // OnPaste calls the given handler when the user pastes some content in an element.
  36449. OnPaste(h EventHandler, scope ...any) HTMLVideo
  36450. // OnPause calls the given handler when the media is paused either by the user or programmatically.
  36451. OnPause(h EventHandler, scope ...any) HTMLVideo
  36452. // OnPlay calls the given handler when the media is ready to start playing.
  36453. OnPlay(h EventHandler, scope ...any) HTMLVideo
  36454. // OnPlaying calls the given handler when the media actually has started playing.
  36455. OnPlaying(h EventHandler, scope ...any) HTMLVideo
  36456. // OnProgress calls the given handler when the browser is in the process of getting the media data.
  36457. OnProgress(h EventHandler, scope ...any) HTMLVideo
  36458. // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode).
  36459. OnRateChange(h EventHandler, scope ...any) HTMLVideo
  36460. // OnReset calls the given handler when the Reset button in a form is clicked.
  36461. OnReset(h EventHandler, scope ...any) HTMLVideo
  36462. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  36463. OnScroll(h EventHandler, scope ...any) HTMLVideo
  36464. // OnSearch calls the given handler when the user writes something in a search field.
  36465. OnSearch(h EventHandler, scope ...any) HTMLVideo
  36466. // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended.
  36467. OnSeeked(h EventHandler, scope ...any) HTMLVideo
  36468. // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active.
  36469. OnSeeking(h EventHandler, scope ...any) HTMLVideo
  36470. // OnSelect calls the given handler after some text has been selected in an element.
  36471. OnSelect(h EventHandler, scope ...any) HTMLVideo
  36472. // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason.
  36473. OnStalled(h EventHandler, scope ...any) HTMLVideo
  36474. // OnSubmit calls the given handler when a form is submitted.
  36475. OnSubmit(h EventHandler, scope ...any) HTMLVideo
  36476. // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason.
  36477. OnSuspend(h EventHandler, scope ...any) HTMLVideo
  36478. // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media).
  36479. OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo
  36480. // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute").
  36481. OnVolumeChange(h EventHandler, scope ...any) HTMLVideo
  36482. // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data).
  36483. OnWaiting(h EventHandler, scope ...any) HTMLVideo
  36484. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  36485. OnWheel(h EventHandler, scope ...any) HTMLVideo
  36486. }
  36487. // Video returns an HTML element that defines a video or movie.
  36488. func Video() HTMLVideo {
  36489. e := &htmlVideo{
  36490. htmlElement: htmlElement{
  36491. tag: "video",
  36492. isSelfClosing: false,
  36493. },
  36494. }
  36495. return e
  36496. }
  36497. type htmlVideo struct {
  36498. htmlElement
  36499. }
  36500. func (e *htmlVideo) Body(v ...UI) HTMLVideo {
  36501. e.setChildren(v...)
  36502. return e
  36503. }
  36504. func (e *htmlVideo) Text(v any) HTMLVideo {
  36505. return e.Body(Text(v))
  36506. }
  36507. func (e *htmlVideo) AccessKey(v string) HTMLVideo {
  36508. e.setAttr("accesskey", v)
  36509. return e
  36510. }
  36511. func (e *htmlVideo) Aria(k string, v any) HTMLVideo {
  36512. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  36513. return e
  36514. }
  36515. func (e *htmlVideo) Attr(n string, v any) HTMLVideo {
  36516. e.setAttr(n, v)
  36517. return e
  36518. }
  36519. func (e *htmlVideo) AutoPlay(v bool) HTMLVideo {
  36520. e.setAttr("autoplay", v)
  36521. return e
  36522. }
  36523. func (e *htmlVideo) Class(v ...string) HTMLVideo {
  36524. e.setAttr("class", strings.Join(v, " "))
  36525. return e
  36526. }
  36527. func (e *htmlVideo) ContentEditable(v bool) HTMLVideo {
  36528. e.setAttr("contenteditable", v)
  36529. return e
  36530. }
  36531. func (e *htmlVideo) Controls(v bool) HTMLVideo {
  36532. e.setAttr("controls", v)
  36533. return e
  36534. }
  36535. func (e *htmlVideo) CrossOrigin(v string) HTMLVideo {
  36536. e.setAttr("crossorigin", v)
  36537. return e
  36538. }
  36539. func (e *htmlVideo) DataSet(k string, v any) HTMLVideo {
  36540. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  36541. return e
  36542. }
  36543. func (e *htmlVideo) Dir(v string) HTMLVideo {
  36544. e.setAttr("dir", v)
  36545. return e
  36546. }
  36547. func (e *htmlVideo) Draggable(v bool) HTMLVideo {
  36548. e.setAttr("draggable", v)
  36549. return e
  36550. }
  36551. func (e *htmlVideo) Height(v int) HTMLVideo {
  36552. e.setAttr("height", v)
  36553. return e
  36554. }
  36555. func (e *htmlVideo) Hidden(v bool) HTMLVideo {
  36556. e.setAttr("hidden", v)
  36557. return e
  36558. }
  36559. func (e *htmlVideo) ID(v string) HTMLVideo {
  36560. e.setAttr("id", v)
  36561. return e
  36562. }
  36563. func (e *htmlVideo) Lang(v string) HTMLVideo {
  36564. e.setAttr("lang", v)
  36565. return e
  36566. }
  36567. func (e *htmlVideo) Loop(v bool) HTMLVideo {
  36568. e.setAttr("loop", v)
  36569. return e
  36570. }
  36571. func (e *htmlVideo) Muted(v bool) HTMLVideo {
  36572. e.setAttr("muted", v)
  36573. return e
  36574. }
  36575. func (e *htmlVideo) Poster(v string) HTMLVideo {
  36576. e.setAttr("poster", v)
  36577. return e
  36578. }
  36579. func (e *htmlVideo) Preload(v string) HTMLVideo {
  36580. e.setAttr("preload", v)
  36581. return e
  36582. }
  36583. func (e *htmlVideo) Role(v string) HTMLVideo {
  36584. e.setAttr("role", v)
  36585. return e
  36586. }
  36587. func (e *htmlVideo) Spellcheck(v bool) HTMLVideo {
  36588. s := "false"
  36589. if v {
  36590. s = "true"
  36591. }
  36592. e.setAttr("spellcheck", s)
  36593. return e
  36594. }
  36595. func (e *htmlVideo) Src(v string) HTMLVideo {
  36596. e.setAttr("src", v)
  36597. return e
  36598. }
  36599. func (e *htmlVideo) Style(k, v string) HTMLVideo {
  36600. e.setAttr("style", k+":"+v)
  36601. return e
  36602. }
  36603. func (e *htmlVideo) Styles(s map[string]string) HTMLVideo {
  36604. for k, v := range s {
  36605. e.Style(k, v)
  36606. }
  36607. return e
  36608. }
  36609. func (e *htmlVideo) TabIndex(v int) HTMLVideo {
  36610. e.setAttr("tabindex", v)
  36611. return e
  36612. }
  36613. func (e *htmlVideo) Title(v string) HTMLVideo {
  36614. e.setAttr("title", v)
  36615. return e
  36616. }
  36617. func (e *htmlVideo) Width(v int) HTMLVideo {
  36618. e.setAttr("width", v)
  36619. return e
  36620. }
  36621. func (e *htmlVideo) On(event string, h EventHandler, scope ...any) HTMLVideo {
  36622. e.setEventHandler(event, h, scope...)
  36623. return e
  36624. }
  36625. func (e *htmlVideo) OnAbort(h EventHandler, scope ...any) HTMLVideo {
  36626. e.setEventHandler("abort", h, scope...)
  36627. return e
  36628. }
  36629. func (e *htmlVideo) OnBlur(h EventHandler, scope ...any) HTMLVideo {
  36630. e.setEventHandler("blur", h, scope...)
  36631. return e
  36632. }
  36633. func (e *htmlVideo) OnCanPlay(h EventHandler, scope ...any) HTMLVideo {
  36634. e.setEventHandler("canplay", h, scope...)
  36635. return e
  36636. }
  36637. func (e *htmlVideo) OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo {
  36638. e.setEventHandler("canplaythrough", h, scope...)
  36639. return e
  36640. }
  36641. func (e *htmlVideo) OnChange(h EventHandler, scope ...any) HTMLVideo {
  36642. e.setEventHandler("change", h, scope...)
  36643. return e
  36644. }
  36645. func (e *htmlVideo) OnClick(h EventHandler, scope ...any) HTMLVideo {
  36646. e.setEventHandler("click", h, scope...)
  36647. return e
  36648. }
  36649. func (e *htmlVideo) OnContextMenu(h EventHandler, scope ...any) HTMLVideo {
  36650. e.setEventHandler("contextmenu", h, scope...)
  36651. return e
  36652. }
  36653. func (e *htmlVideo) OnCopy(h EventHandler, scope ...any) HTMLVideo {
  36654. e.setEventHandler("copy", h, scope...)
  36655. return e
  36656. }
  36657. func (e *htmlVideo) OnCueChange(h EventHandler, scope ...any) HTMLVideo {
  36658. e.setEventHandler("cuechange", h, scope...)
  36659. return e
  36660. }
  36661. func (e *htmlVideo) OnCut(h EventHandler, scope ...any) HTMLVideo {
  36662. e.setEventHandler("cut", h, scope...)
  36663. return e
  36664. }
  36665. func (e *htmlVideo) OnDblClick(h EventHandler, scope ...any) HTMLVideo {
  36666. e.setEventHandler("dblclick", h, scope...)
  36667. return e
  36668. }
  36669. func (e *htmlVideo) OnDrag(h EventHandler, scope ...any) HTMLVideo {
  36670. e.setEventHandler("drag", h, scope...)
  36671. return e
  36672. }
  36673. func (e *htmlVideo) OnDragEnd(h EventHandler, scope ...any) HTMLVideo {
  36674. e.setEventHandler("dragend", h, scope...)
  36675. return e
  36676. }
  36677. func (e *htmlVideo) OnDragEnter(h EventHandler, scope ...any) HTMLVideo {
  36678. e.setEventHandler("dragenter", h, scope...)
  36679. return e
  36680. }
  36681. func (e *htmlVideo) OnDragLeave(h EventHandler, scope ...any) HTMLVideo {
  36682. e.setEventHandler("dragleave", h, scope...)
  36683. return e
  36684. }
  36685. func (e *htmlVideo) OnDragOver(h EventHandler, scope ...any) HTMLVideo {
  36686. e.setEventHandler("dragover", h, scope...)
  36687. return e
  36688. }
  36689. func (e *htmlVideo) OnDragStart(h EventHandler, scope ...any) HTMLVideo {
  36690. e.setEventHandler("dragstart", h, scope...)
  36691. return e
  36692. }
  36693. func (e *htmlVideo) OnDrop(h EventHandler, scope ...any) HTMLVideo {
  36694. e.setEventHandler("drop", h, scope...)
  36695. return e
  36696. }
  36697. func (e *htmlVideo) OnDurationChange(h EventHandler, scope ...any) HTMLVideo {
  36698. e.setEventHandler("durationchange", h, scope...)
  36699. return e
  36700. }
  36701. func (e *htmlVideo) OnEmptied(h EventHandler, scope ...any) HTMLVideo {
  36702. e.setEventHandler("emptied", h, scope...)
  36703. return e
  36704. }
  36705. func (e *htmlVideo) OnEnded(h EventHandler, scope ...any) HTMLVideo {
  36706. e.setEventHandler("ended", h, scope...)
  36707. return e
  36708. }
  36709. func (e *htmlVideo) OnError(h EventHandler, scope ...any) HTMLVideo {
  36710. e.setEventHandler("error", h, scope...)
  36711. return e
  36712. }
  36713. func (e *htmlVideo) OnFocus(h EventHandler, scope ...any) HTMLVideo {
  36714. e.setEventHandler("focus", h, scope...)
  36715. return e
  36716. }
  36717. func (e *htmlVideo) OnInput(h EventHandler, scope ...any) HTMLVideo {
  36718. e.setEventHandler("input", h, scope...)
  36719. return e
  36720. }
  36721. func (e *htmlVideo) OnInvalid(h EventHandler, scope ...any) HTMLVideo {
  36722. e.setEventHandler("invalid", h, scope...)
  36723. return e
  36724. }
  36725. func (e *htmlVideo) OnKeyDown(h EventHandler, scope ...any) HTMLVideo {
  36726. e.setEventHandler("keydown", h, scope...)
  36727. return e
  36728. }
  36729. func (e *htmlVideo) OnKeyPress(h EventHandler, scope ...any) HTMLVideo {
  36730. e.setEventHandler("keypress", h, scope...)
  36731. return e
  36732. }
  36733. func (e *htmlVideo) OnKeyUp(h EventHandler, scope ...any) HTMLVideo {
  36734. e.setEventHandler("keyup", h, scope...)
  36735. return e
  36736. }
  36737. func (e *htmlVideo) OnLoadStart(h EventHandler, scope ...any) HTMLVideo {
  36738. e.setEventHandler("loadstart", h, scope...)
  36739. return e
  36740. }
  36741. func (e *htmlVideo) OnLoadedData(h EventHandler, scope ...any) HTMLVideo {
  36742. e.setEventHandler("loadeddata", h, scope...)
  36743. return e
  36744. }
  36745. func (e *htmlVideo) OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo {
  36746. e.setEventHandler("loadedmetadata", h, scope...)
  36747. return e
  36748. }
  36749. func (e *htmlVideo) OnMouseDown(h EventHandler, scope ...any) HTMLVideo {
  36750. e.setEventHandler("mousedown", h, scope...)
  36751. return e
  36752. }
  36753. func (e *htmlVideo) OnMouseMove(h EventHandler, scope ...any) HTMLVideo {
  36754. e.setEventHandler("mousemove", h, scope...)
  36755. return e
  36756. }
  36757. func (e *htmlVideo) OnMouseOut(h EventHandler, scope ...any) HTMLVideo {
  36758. e.setEventHandler("mouseout", h, scope...)
  36759. return e
  36760. }
  36761. func (e *htmlVideo) OnMouseOver(h EventHandler, scope ...any) HTMLVideo {
  36762. e.setEventHandler("mouseover", h, scope...)
  36763. return e
  36764. }
  36765. func (e *htmlVideo) OnMouseUp(h EventHandler, scope ...any) HTMLVideo {
  36766. e.setEventHandler("mouseup", h, scope...)
  36767. return e
  36768. }
  36769. func (e *htmlVideo) OnPaste(h EventHandler, scope ...any) HTMLVideo {
  36770. e.setEventHandler("paste", h, scope...)
  36771. return e
  36772. }
  36773. func (e *htmlVideo) OnPause(h EventHandler, scope ...any) HTMLVideo {
  36774. e.setEventHandler("pause", h, scope...)
  36775. return e
  36776. }
  36777. func (e *htmlVideo) OnPlay(h EventHandler, scope ...any) HTMLVideo {
  36778. e.setEventHandler("play", h, scope...)
  36779. return e
  36780. }
  36781. func (e *htmlVideo) OnPlaying(h EventHandler, scope ...any) HTMLVideo {
  36782. e.setEventHandler("playing", h, scope...)
  36783. return e
  36784. }
  36785. func (e *htmlVideo) OnProgress(h EventHandler, scope ...any) HTMLVideo {
  36786. e.setEventHandler("progress", h, scope...)
  36787. return e
  36788. }
  36789. func (e *htmlVideo) OnRateChange(h EventHandler, scope ...any) HTMLVideo {
  36790. e.setEventHandler("ratechange", h, scope...)
  36791. return e
  36792. }
  36793. func (e *htmlVideo) OnReset(h EventHandler, scope ...any) HTMLVideo {
  36794. e.setEventHandler("reset", h, scope...)
  36795. return e
  36796. }
  36797. func (e *htmlVideo) OnScroll(h EventHandler, scope ...any) HTMLVideo {
  36798. e.setEventHandler("scroll", h, scope...)
  36799. return e
  36800. }
  36801. func (e *htmlVideo) OnSearch(h EventHandler, scope ...any) HTMLVideo {
  36802. e.setEventHandler("search", h, scope...)
  36803. return e
  36804. }
  36805. func (e *htmlVideo) OnSeeked(h EventHandler, scope ...any) HTMLVideo {
  36806. e.setEventHandler("seeked", h, scope...)
  36807. return e
  36808. }
  36809. func (e *htmlVideo) OnSeeking(h EventHandler, scope ...any) HTMLVideo {
  36810. e.setEventHandler("seeking", h, scope...)
  36811. return e
  36812. }
  36813. func (e *htmlVideo) OnSelect(h EventHandler, scope ...any) HTMLVideo {
  36814. e.setEventHandler("select", h, scope...)
  36815. return e
  36816. }
  36817. func (e *htmlVideo) OnStalled(h EventHandler, scope ...any) HTMLVideo {
  36818. e.setEventHandler("stalled", h, scope...)
  36819. return e
  36820. }
  36821. func (e *htmlVideo) OnSubmit(h EventHandler, scope ...any) HTMLVideo {
  36822. e.setEventHandler("submit", h, scope...)
  36823. return e
  36824. }
  36825. func (e *htmlVideo) OnSuspend(h EventHandler, scope ...any) HTMLVideo {
  36826. e.setEventHandler("suspend", h, scope...)
  36827. return e
  36828. }
  36829. func (e *htmlVideo) OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo {
  36830. e.setEventHandler("timeupdate", h, scope...)
  36831. return e
  36832. }
  36833. func (e *htmlVideo) OnVolumeChange(h EventHandler, scope ...any) HTMLVideo {
  36834. e.setEventHandler("volumechange", h, scope...)
  36835. return e
  36836. }
  36837. func (e *htmlVideo) OnWaiting(h EventHandler, scope ...any) HTMLVideo {
  36838. e.setEventHandler("waiting", h, scope...)
  36839. return e
  36840. }
  36841. func (e *htmlVideo) OnWheel(h EventHandler, scope ...any) HTMLVideo {
  36842. e.setEventHandler("wheel", h, scope...)
  36843. return e
  36844. }
  36845. // HTMLWbr is the interface that describes a "wbr" HTML element.
  36846. type HTMLWbr interface {
  36847. UI
  36848. // Body set the content of the element.
  36849. Body(elems ...UI) HTMLWbr
  36850. // Text sets the content of the element with a text node containing the stringified given value.
  36851. Text(v any) HTMLWbr
  36852. // AccessKey specifies a shortcut key to activate/focus an element.
  36853. AccessKey(v string) HTMLWbr
  36854. // Aria stores accessible rich internet applications (ARIA) data.
  36855. Aria(k string, v any) HTMLWbr
  36856. // Attr sets the named attribute with the given value.
  36857. Attr(n string, v any) HTMLWbr
  36858. // Class specifies one or more classnames for an element (refers to a class in a style sheet).
  36859. Class(v ...string) HTMLWbr
  36860. // ContentEditable specifies whether the content of an element is editable or not.
  36861. ContentEditable(v bool) HTMLWbr
  36862. // DataSet stores custom data private to the page or application.
  36863. DataSet(k string, v any) HTMLWbr
  36864. // Dir specifies the text direction for the content in an element.
  36865. Dir(v string) HTMLWbr
  36866. // Draggable specifies whether an element is draggable or not.
  36867. Draggable(v bool) HTMLWbr
  36868. // Hidden specifies that an element is not yet, or is no longer relevant.
  36869. Hidden(v bool) HTMLWbr
  36870. // ID specifies a unique id for an element.
  36871. ID(v string) HTMLWbr
  36872. // Lang specifies the language of the element's content.
  36873. Lang(v string) HTMLWbr
  36874. // Role specifies to parsing software the exact function of an element (and its children).
  36875. Role(v string) HTMLWbr
  36876. // Spellcheck specifies whether the element is to have its spelling and grammar checked or not.
  36877. Spellcheck(v bool) HTMLWbr
  36878. // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles.
  36879. Style(k, v string) HTMLWbr
  36880. // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles.
  36881. Styles(s map[string]string) HTMLWbr
  36882. // TabIndex specifies the tabbing order of an element.
  36883. TabIndex(v int) HTMLWbr
  36884. // Title specifies extra information about an element.
  36885. Title(v string) HTMLWbr
  36886. // On registers the given event handler to the specified event.
  36887. On(event string, h EventHandler, scope ...any) HTMLWbr
  36888. // OnBlur calls the given handler when the element loses focus.
  36889. OnBlur(h EventHandler, scope ...any) HTMLWbr
  36890. // OnChange calls the given handler when the value of the element is changed.
  36891. OnChange(h EventHandler, scope ...any) HTMLWbr
  36892. // OnClick calls the given handler when there is a mouse click on the element.
  36893. OnClick(h EventHandler, scope ...any) HTMLWbr
  36894. // OnContextMenu calls the given handler when a context menu is triggered.
  36895. OnContextMenu(h EventHandler, scope ...any) HTMLWbr
  36896. // OnCopy calls the given handler when the user copies the content of an element.
  36897. OnCopy(h EventHandler, scope ...any) HTMLWbr
  36898. // OnCut calls the given handler when the user cuts the content of an element.
  36899. OnCut(h EventHandler, scope ...any) HTMLWbr
  36900. // OnDblClick calls the given handler when there is a mouse double-click on the element.
  36901. OnDblClick(h EventHandler, scope ...any) HTMLWbr
  36902. // OnDrag calls the given handler when an element is dragged.
  36903. OnDrag(h EventHandler, scope ...any) HTMLWbr
  36904. // OnDragEnd calls the given handler at the end of a drag operation.
  36905. OnDragEnd(h EventHandler, scope ...any) HTMLWbr
  36906. // OnDragEnter calls the given handler when an element has been dragged to a valid drop target.
  36907. OnDragEnter(h EventHandler, scope ...any) HTMLWbr
  36908. // OnDragLeave calls the given handler when an element leaves a valid drop target.
  36909. OnDragLeave(h EventHandler, scope ...any) HTMLWbr
  36910. // OnDragOver calls the given handler when an element is being dragged over a valid drop target.
  36911. OnDragOver(h EventHandler, scope ...any) HTMLWbr
  36912. // OnDragStart calls the given handler at the start of a drag operation.
  36913. OnDragStart(h EventHandler, scope ...any) HTMLWbr
  36914. // OnDrop calls the given handler when dragged element is being dropped.
  36915. OnDrop(h EventHandler, scope ...any) HTMLWbr
  36916. // OnFocus calls the given handler when the element gets focus.
  36917. OnFocus(h EventHandler, scope ...any) HTMLWbr
  36918. // OnInput calls the given handler when an element gets user input.
  36919. OnInput(h EventHandler, scope ...any) HTMLWbr
  36920. // OnInvalid calls the given handler when an element is invalid.
  36921. OnInvalid(h EventHandler, scope ...any) HTMLWbr
  36922. // OnKeyDown calls the given handler when a user is pressing a key.
  36923. OnKeyDown(h EventHandler, scope ...any) HTMLWbr
  36924. // OnKeyPress calls the given handler when a user presses a key.
  36925. OnKeyPress(h EventHandler, scope ...any) HTMLWbr
  36926. // OnKeyUp calls the given handler when a user releases a key.
  36927. OnKeyUp(h EventHandler, scope ...any) HTMLWbr
  36928. // OnMouseDown calls the given handler when a mouse button is pressed down on an element.
  36929. OnMouseDown(h EventHandler, scope ...any) HTMLWbr
  36930. // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element.
  36931. OnMouseMove(h EventHandler, scope ...any) HTMLWbr
  36932. // OnMouseOut calls the given handler when the mouse pointer moves out of an element.
  36933. OnMouseOut(h EventHandler, scope ...any) HTMLWbr
  36934. // OnMouseOver calls the given handler when the mouse pointer moves over an element.
  36935. OnMouseOver(h EventHandler, scope ...any) HTMLWbr
  36936. // OnMouseUp calls the given handler when a mouse button is released over an element.
  36937. OnMouseUp(h EventHandler, scope ...any) HTMLWbr
  36938. // OnPaste calls the given handler when the user pastes some content in an element.
  36939. OnPaste(h EventHandler, scope ...any) HTMLWbr
  36940. // OnReset calls the given handler when the Reset button in a form is clicked.
  36941. OnReset(h EventHandler, scope ...any) HTMLWbr
  36942. // OnScroll calls the given handler when an element's scrollbar is being scrolled.
  36943. OnScroll(h EventHandler, scope ...any) HTMLWbr
  36944. // OnSearch calls the given handler when the user writes something in a search field.
  36945. OnSearch(h EventHandler, scope ...any) HTMLWbr
  36946. // OnSelect calls the given handler after some text has been selected in an element.
  36947. OnSelect(h EventHandler, scope ...any) HTMLWbr
  36948. // OnSubmit calls the given handler when a form is submitted.
  36949. OnSubmit(h EventHandler, scope ...any) HTMLWbr
  36950. // OnWheel calls the given handler when the mouse wheel rolls up or down over an element.
  36951. OnWheel(h EventHandler, scope ...any) HTMLWbr
  36952. }
  36953. // Wbr returns an HTML element that defines a possible line-break.
  36954. func Wbr() HTMLWbr {
  36955. e := &htmlWbr{
  36956. htmlElement: htmlElement{
  36957. tag: "wbr",
  36958. isSelfClosing: false,
  36959. },
  36960. }
  36961. return e
  36962. }
  36963. type htmlWbr struct {
  36964. htmlElement
  36965. }
  36966. func (e *htmlWbr) Body(v ...UI) HTMLWbr {
  36967. e.setChildren(v...)
  36968. return e
  36969. }
  36970. func (e *htmlWbr) Text(v any) HTMLWbr {
  36971. return e.Body(Text(v))
  36972. }
  36973. func (e *htmlWbr) AccessKey(v string) HTMLWbr {
  36974. e.setAttr("accesskey", v)
  36975. return e
  36976. }
  36977. func (e *htmlWbr) Aria(k string, v any) HTMLWbr {
  36978. e.setAttr("aria-"+k, fmt.Sprintf("%v", v))
  36979. return e
  36980. }
  36981. func (e *htmlWbr) Attr(n string, v any) HTMLWbr {
  36982. e.setAttr(n, v)
  36983. return e
  36984. }
  36985. func (e *htmlWbr) Class(v ...string) HTMLWbr {
  36986. e.setAttr("class", strings.Join(v, " "))
  36987. return e
  36988. }
  36989. func (e *htmlWbr) ContentEditable(v bool) HTMLWbr {
  36990. e.setAttr("contenteditable", v)
  36991. return e
  36992. }
  36993. func (e *htmlWbr) DataSet(k string, v any) HTMLWbr {
  36994. e.setAttr("data-"+k, fmt.Sprintf("%v", v))
  36995. return e
  36996. }
  36997. func (e *htmlWbr) Dir(v string) HTMLWbr {
  36998. e.setAttr("dir", v)
  36999. return e
  37000. }
  37001. func (e *htmlWbr) Draggable(v bool) HTMLWbr {
  37002. e.setAttr("draggable", v)
  37003. return e
  37004. }
  37005. func (e *htmlWbr) Hidden(v bool) HTMLWbr {
  37006. e.setAttr("hidden", v)
  37007. return e
  37008. }
  37009. func (e *htmlWbr) ID(v string) HTMLWbr {
  37010. e.setAttr("id", v)
  37011. return e
  37012. }
  37013. func (e *htmlWbr) Lang(v string) HTMLWbr {
  37014. e.setAttr("lang", v)
  37015. return e
  37016. }
  37017. func (e *htmlWbr) Role(v string) HTMLWbr {
  37018. e.setAttr("role", v)
  37019. return e
  37020. }
  37021. func (e *htmlWbr) Spellcheck(v bool) HTMLWbr {
  37022. s := "false"
  37023. if v {
  37024. s = "true"
  37025. }
  37026. e.setAttr("spellcheck", s)
  37027. return e
  37028. }
  37029. func (e *htmlWbr) Style(k, v string) HTMLWbr {
  37030. e.setAttr("style", k+":"+v)
  37031. return e
  37032. }
  37033. func (e *htmlWbr) Styles(s map[string]string) HTMLWbr {
  37034. for k, v := range s {
  37035. e.Style(k, v)
  37036. }
  37037. return e
  37038. }
  37039. func (e *htmlWbr) TabIndex(v int) HTMLWbr {
  37040. e.setAttr("tabindex", v)
  37041. return e
  37042. }
  37043. func (e *htmlWbr) Title(v string) HTMLWbr {
  37044. e.setAttr("title", v)
  37045. return e
  37046. }
  37047. func (e *htmlWbr) On(event string, h EventHandler, scope ...any) HTMLWbr {
  37048. e.setEventHandler(event, h, scope...)
  37049. return e
  37050. }
  37051. func (e *htmlWbr) OnBlur(h EventHandler, scope ...any) HTMLWbr {
  37052. e.setEventHandler("blur", h, scope...)
  37053. return e
  37054. }
  37055. func (e *htmlWbr) OnChange(h EventHandler, scope ...any) HTMLWbr {
  37056. e.setEventHandler("change", h, scope...)
  37057. return e
  37058. }
  37059. func (e *htmlWbr) OnClick(h EventHandler, scope ...any) HTMLWbr {
  37060. e.setEventHandler("click", h, scope...)
  37061. return e
  37062. }
  37063. func (e *htmlWbr) OnContextMenu(h EventHandler, scope ...any) HTMLWbr {
  37064. e.setEventHandler("contextmenu", h, scope...)
  37065. return e
  37066. }
  37067. func (e *htmlWbr) OnCopy(h EventHandler, scope ...any) HTMLWbr {
  37068. e.setEventHandler("copy", h, scope...)
  37069. return e
  37070. }
  37071. func (e *htmlWbr) OnCut(h EventHandler, scope ...any) HTMLWbr {
  37072. e.setEventHandler("cut", h, scope...)
  37073. return e
  37074. }
  37075. func (e *htmlWbr) OnDblClick(h EventHandler, scope ...any) HTMLWbr {
  37076. e.setEventHandler("dblclick", h, scope...)
  37077. return e
  37078. }
  37079. func (e *htmlWbr) OnDrag(h EventHandler, scope ...any) HTMLWbr {
  37080. e.setEventHandler("drag", h, scope...)
  37081. return e
  37082. }
  37083. func (e *htmlWbr) OnDragEnd(h EventHandler, scope ...any) HTMLWbr {
  37084. e.setEventHandler("dragend", h, scope...)
  37085. return e
  37086. }
  37087. func (e *htmlWbr) OnDragEnter(h EventHandler, scope ...any) HTMLWbr {
  37088. e.setEventHandler("dragenter", h, scope...)
  37089. return e
  37090. }
  37091. func (e *htmlWbr) OnDragLeave(h EventHandler, scope ...any) HTMLWbr {
  37092. e.setEventHandler("dragleave", h, scope...)
  37093. return e
  37094. }
  37095. func (e *htmlWbr) OnDragOver(h EventHandler, scope ...any) HTMLWbr {
  37096. e.setEventHandler("dragover", h, scope...)
  37097. return e
  37098. }
  37099. func (e *htmlWbr) OnDragStart(h EventHandler, scope ...any) HTMLWbr {
  37100. e.setEventHandler("dragstart", h, scope...)
  37101. return e
  37102. }
  37103. func (e *htmlWbr) OnDrop(h EventHandler, scope ...any) HTMLWbr {
  37104. e.setEventHandler("drop", h, scope...)
  37105. return e
  37106. }
  37107. func (e *htmlWbr) OnFocus(h EventHandler, scope ...any) HTMLWbr {
  37108. e.setEventHandler("focus", h, scope...)
  37109. return e
  37110. }
  37111. func (e *htmlWbr) OnInput(h EventHandler, scope ...any) HTMLWbr {
  37112. e.setEventHandler("input", h, scope...)
  37113. return e
  37114. }
  37115. func (e *htmlWbr) OnInvalid(h EventHandler, scope ...any) HTMLWbr {
  37116. e.setEventHandler("invalid", h, scope...)
  37117. return e
  37118. }
  37119. func (e *htmlWbr) OnKeyDown(h EventHandler, scope ...any) HTMLWbr {
  37120. e.setEventHandler("keydown", h, scope...)
  37121. return e
  37122. }
  37123. func (e *htmlWbr) OnKeyPress(h EventHandler, scope ...any) HTMLWbr {
  37124. e.setEventHandler("keypress", h, scope...)
  37125. return e
  37126. }
  37127. func (e *htmlWbr) OnKeyUp(h EventHandler, scope ...any) HTMLWbr {
  37128. e.setEventHandler("keyup", h, scope...)
  37129. return e
  37130. }
  37131. func (e *htmlWbr) OnMouseDown(h EventHandler, scope ...any) HTMLWbr {
  37132. e.setEventHandler("mousedown", h, scope...)
  37133. return e
  37134. }
  37135. func (e *htmlWbr) OnMouseMove(h EventHandler, scope ...any) HTMLWbr {
  37136. e.setEventHandler("mousemove", h, scope...)
  37137. return e
  37138. }
  37139. func (e *htmlWbr) OnMouseOut(h EventHandler, scope ...any) HTMLWbr {
  37140. e.setEventHandler("mouseout", h, scope...)
  37141. return e
  37142. }
  37143. func (e *htmlWbr) OnMouseOver(h EventHandler, scope ...any) HTMLWbr {
  37144. e.setEventHandler("mouseover", h, scope...)
  37145. return e
  37146. }
  37147. func (e *htmlWbr) OnMouseUp(h EventHandler, scope ...any) HTMLWbr {
  37148. e.setEventHandler("mouseup", h, scope...)
  37149. return e
  37150. }
  37151. func (e *htmlWbr) OnPaste(h EventHandler, scope ...any) HTMLWbr {
  37152. e.setEventHandler("paste", h, scope...)
  37153. return e
  37154. }
  37155. func (e *htmlWbr) OnReset(h EventHandler, scope ...any) HTMLWbr {
  37156. e.setEventHandler("reset", h, scope...)
  37157. return e
  37158. }
  37159. func (e *htmlWbr) OnScroll(h EventHandler, scope ...any) HTMLWbr {
  37160. e.setEventHandler("scroll", h, scope...)
  37161. return e
  37162. }
  37163. func (e *htmlWbr) OnSearch(h EventHandler, scope ...any) HTMLWbr {
  37164. e.setEventHandler("search", h, scope...)
  37165. return e
  37166. }
  37167. func (e *htmlWbr) OnSelect(h EventHandler, scope ...any) HTMLWbr {
  37168. e.setEventHandler("select", h, scope...)
  37169. return e
  37170. }
  37171. func (e *htmlWbr) OnSubmit(h EventHandler, scope ...any) HTMLWbr {
  37172. e.setEventHandler("submit", h, scope...)
  37173. return e
  37174. }
  37175. func (e *htmlWbr) OnWheel(h EventHandler, scope ...any) HTMLWbr {
  37176. e.setEventHandler("wheel", h, scope...)
  37177. return e
  37178. }