llms-full.txt 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055
  1. Repository: any-tdf/stdf
  2. Files analyzed: 825
  3. Estimated tokens: 755.0k
  4. Directory structure:
  5. └── any-tdf-stdf/
  6. ├── README.md
  7. ├── CODE_OF_CONDUCT.md
  8. ├── LICENSE
  9. ├── README_CN.md
  10. ├── SECURITY.md
  11. ├── docs/
  12. │ ├── mds/
  13. │ │ ├── components/
  14. │ │ │ ├── actionSheet/
  15. │ │ │ │ ├── api.md
  16. │ │ │ │ ├── api_en.md
  17. │ │ │ │ ├── FAQ.md
  18. │ │ │ │ ├── FAQ_en.md
  19. │ │ │ │ ├── guide.md
  20. │ │ │ │ ├── guide_en.md
  21. │ │ │ │ ├── version.md
  22. │ │ │ │ └── version_en.md
  23. │ │ │ ├── asyncPicker/
  24. │ │ │ │ ├── api.md
  25. │ │ │ │ ├── api_en.md
  26. │ │ │ │ ├── FAQ.md
  27. │ │ │ │ ├── FAQ_en.md
  28. │ │ │ │ ├── guide.md
  29. │ │ │ │ ├── guide_en.md
  30. │ │ │ │ ├── version.md
  31. │ │ │ │ └── version_en.md
  32. │ │ │ ├── avatar/
  33. │ │ │ │ ├── api.md
  34. │ │ │ │ ├── api_en.md
  35. │ │ │ │ ├── FAQ.md
  36. │ │ │ │ ├── FAQ_en.md
  37. │ │ │ │ ├── guide.md
  38. │ │ │ │ ├── guide_en.md
  39. │ │ │ │ ├── version.md
  40. │ │ │ │ └── version_en.md
  41. │ │ │ ├── badge/
  42. │ │ │ │ ├── api.md
  43. │ │ │ │ ├── api_en.md
  44. │ │ │ │ ├── FAQ.md
  45. │ │ │ │ ├── FAQ_en.md
  46. │ │ │ │ ├── guide.md
  47. │ │ │ │ ├── guide_en.md
  48. │ │ │ │ ├── version.md
  49. │ │ │ │ └── version_en.md
  50. │ │ │ ├── bottomSheet/
  51. │ │ │ │ ├── api.md
  52. │ │ │ │ ├── api_en.md
  53. │ │ │ │ ├── FAQ.md
  54. │ │ │ │ ├── FAQ_en.md
  55. │ │ │ │ ├── guide.md
  56. │ │ │ │ ├── guide_en.md
  57. │ │ │ │ ├── version.md
  58. │ │ │ │ └── version_en.md
  59. │ │ │ ├── button/
  60. │ │ │ │ ├── api.md
  61. │ │ │ │ ├── api_en.md
  62. │ │ │ │ ├── FAQ.md
  63. │ │ │ │ ├── FAQ_en.md
  64. │ │ │ │ ├── guide.md
  65. │ │ │ │ ├── guide_en.md
  66. │ │ │ │ ├── version.md
  67. │ │ │ │ └── version_en.md
  68. │ │ │ ├── calendar/
  69. │ │ │ │ ├── api.md
  70. │ │ │ │ ├── api_en.md
  71. │ │ │ │ ├── FAQ.md
  72. │ │ │ │ ├── FAQ_en.md
  73. │ │ │ │ ├── guide.md
  74. │ │ │ │ ├── guide_en.md
  75. │ │ │ │ ├── version.md
  76. │ │ │ │ └── version_en.md
  77. │ │ │ ├── cell/
  78. │ │ │ │ ├── api.md
  79. │ │ │ │ ├── api_en.md
  80. │ │ │ │ ├── FAQ.md
  81. │ │ │ │ ├── FAQ_en.md
  82. │ │ │ │ ├── guide.md
  83. │ │ │ │ ├── guide_en.md
  84. │ │ │ │ ├── version.md
  85. │ │ │ │ └── version_en.md
  86. │ │ │ ├── checkbox/
  87. │ │ │ │ ├── api.md
  88. │ │ │ │ ├── api_en.md
  89. │ │ │ │ ├── FAQ.md
  90. │ │ │ │ ├── FAQ_en.md
  91. │ │ │ │ ├── guide.md
  92. │ │ │ │ ├── guide_en.md
  93. │ │ │ │ ├── version.md
  94. │ │ │ │ └── version_en.md
  95. │ │ │ ├── dialog/
  96. │ │ │ │ ├── api.md
  97. │ │ │ │ ├── api_en.md
  98. │ │ │ │ ├── FAQ.md
  99. │ │ │ │ ├── FAQ_en.md
  100. │ │ │ │ ├── guide.md
  101. │ │ │ │ ├── guide_en.md
  102. │ │ │ │ ├── version.md
  103. │ │ │ │ └── version_en.md
  104. │ │ │ ├── divider/
  105. │ │ │ │ ├── api.md
  106. │ │ │ │ ├── api_en.md
  107. │ │ │ │ ├── FAQ.md
  108. │ │ │ │ ├── FAQ_en.md
  109. │ │ │ │ ├── guide.md
  110. │ │ │ │ ├── guide_en.md
  111. │ │ │ │ ├── version.md
  112. │ │ │ │ └── version_en.md
  113. │ │ │ ├── grids/
  114. │ │ │ │ ├── api.md
  115. │ │ │ │ ├── api_en.md
  116. │ │ │ │ ├── FAQ.md
  117. │ │ │ │ ├── FAQ_en.md
  118. │ │ │ │ ├── guide.md
  119. │ │ │ │ ├── guide_en.md
  120. │ │ │ │ ├── version.md
  121. │ │ │ │ └── version_en.md
  122. │ │ │ ├── icon/
  123. │ │ │ │ ├── api.md
  124. │ │ │ │ ├── api_en.md
  125. │ │ │ │ ├── FAQ.md
  126. │ │ │ │ ├── FAQ_en.md
  127. │ │ │ │ ├── guide.md
  128. │ │ │ │ ├── guide_en.md
  129. │ │ │ │ ├── version.md
  130. │ │ │ │ └── version_en.md
  131. │ │ │ ├── indexBar/
  132. │ │ │ │ ├── api.md
  133. │ │ │ │ ├── api_en.md
  134. │ │ │ │ ├── FAQ.md
  135. │ │ │ │ ├── FAQ_en.md
  136. │ │ │ │ ├── guide.md
  137. │ │ │ │ ├── guide_en.md
  138. │ │ │ │ ├── version.md
  139. │ │ │ │ └── version_en.md
  140. │ │ │ ├── input/
  141. │ │ │ │ ├── api.md
  142. │ │ │ │ ├── api_en.md
  143. │ │ │ │ ├── FAQ.md
  144. │ │ │ │ ├── FAQ_en.md
  145. │ │ │ │ ├── guide.md
  146. │ │ │ │ ├── guide_en.md
  147. │ │ │ │ ├── version.md
  148. │ │ │ │ └── version_en.md
  149. │ │ │ ├── loading/
  150. │ │ │ │ ├── api.md
  151. │ │ │ │ ├── api_en.md
  152. │ │ │ │ ├── FAQ.md
  153. │ │ │ │ ├── FAQ_en.md
  154. │ │ │ │ ├── guide.md
  155. │ │ │ │ ├── guide_en.md
  156. │ │ │ │ ├── version.md
  157. │ │ │ │ └── version_en.md
  158. │ │ │ ├── mask/
  159. │ │ │ │ ├── api.md
  160. │ │ │ │ ├── api_en.md
  161. │ │ │ │ ├── FAQ.md
  162. │ │ │ │ ├── FAQ_en.md
  163. │ │ │ │ ├── guide.md
  164. │ │ │ │ ├── guide_en.md
  165. │ │ │ │ ├── version.md
  166. │ │ │ │ └── version_en.md
  167. │ │ │ ├── modal/
  168. │ │ │ │ ├── api.md
  169. │ │ │ │ ├── api_en.md
  170. │ │ │ │ ├── FAQ.md
  171. │ │ │ │ ├── FAQ_en.md
  172. │ │ │ │ ├── guide.md
  173. │ │ │ │ ├── guide_en.md
  174. │ │ │ │ ├── version.md
  175. │ │ │ │ └── version_en.md
  176. │ │ │ ├── navBar/
  177. │ │ │ │ ├── api.md
  178. │ │ │ │ ├── api_en.md
  179. │ │ │ │ ├── FAQ.md
  180. │ │ │ │ ├── FAQ_en.md
  181. │ │ │ │ ├── guide.md
  182. │ │ │ │ ├── guide_en.md
  183. │ │ │ │ ├── version.md
  184. │ │ │ │ └── version_en.md
  185. │ │ │ ├── noticeBar/
  186. │ │ │ │ ├── api.md
  187. │ │ │ │ ├── api_en.md
  188. │ │ │ │ ├── FAQ.md
  189. │ │ │ │ ├── FAQ_en.md
  190. │ │ │ │ ├── guide.md
  191. │ │ │ │ ├── guide_en.md
  192. │ │ │ │ ├── version.md
  193. │ │ │ │ └── version_en.md
  194. │ │ │ ├── numKeyboard/
  195. │ │ │ │ ├── api.md
  196. │ │ │ │ ├── api_en.md
  197. │ │ │ │ ├── FAQ.md
  198. │ │ │ │ ├── FAQ_en.md
  199. │ │ │ │ ├── guide.md
  200. │ │ │ │ ├── guide_en.md
  201. │ │ │ │ ├── version.md
  202. │ │ │ │ └── version_en.md
  203. │ │ │ ├── pagination/
  204. │ │ │ │ ├── api.md
  205. │ │ │ │ ├── api_en.md
  206. │ │ │ │ ├── FAQ.md
  207. │ │ │ │ ├── FAQ_en.md
  208. │ │ │ │ ├── guide.md
  209. │ │ │ │ ├── guide_en.md
  210. │ │ │ │ ├── version.md
  211. │ │ │ │ └── version_en.md
  212. │ │ │ ├── picker/
  213. │ │ │ │ ├── api.md
  214. │ │ │ │ ├── api_en.md
  215. │ │ │ │ ├── FAQ.md
  216. │ │ │ │ ├── FAQ_en.md
  217. │ │ │ │ ├── guide.md
  218. │ │ │ │ ├── guide_en.md
  219. │ │ │ │ ├── version.md
  220. │ │ │ │ └── version_en.md
  221. │ │ │ ├── placeholder/
  222. │ │ │ │ ├── api.md
  223. │ │ │ │ ├── api_en.md
  224. │ │ │ │ ├── FAQ.md
  225. │ │ │ │ ├── FAQ_en.md
  226. │ │ │ │ ├── guide.md
  227. │ │ │ │ ├── guide_en.md
  228. │ │ │ │ ├── version.md
  229. │ │ │ │ └── version_en.md
  230. │ │ │ ├── popup/
  231. │ │ │ │ ├── api.md
  232. │ │ │ │ ├── api_en.md
  233. │ │ │ │ ├── FAQ.md
  234. │ │ │ │ ├── FAQ_en.md
  235. │ │ │ │ ├── guide.md
  236. │ │ │ │ ├── guide_en.md
  237. │ │ │ │ ├── version.md
  238. │ │ │ │ └── version_en.md
  239. │ │ │ ├── progress/
  240. │ │ │ │ ├── api.md
  241. │ │ │ │ ├── api_en.md
  242. │ │ │ │ ├── FAQ.md
  243. │ │ │ │ ├── FAQ_en.md
  244. │ │ │ │ ├── guide.md
  245. │ │ │ │ ├── guide_en.md
  246. │ │ │ │ ├── version.md
  247. │ │ │ │ └── version_en.md
  248. │ │ │ ├── progressLoop/
  249. │ │ │ │ ├── api.md
  250. │ │ │ │ ├── api_en.md
  251. │ │ │ │ ├── FAQ.md
  252. │ │ │ │ ├── FAQ_en.md
  253. │ │ │ │ ├── guide.md
  254. │ │ │ │ ├── guide_en.md
  255. │ │ │ │ ├── version.md
  256. │ │ │ │ └── version_en.md
  257. │ │ │ ├── radio/
  258. │ │ │ │ ├── api.md
  259. │ │ │ │ ├── api_en.md
  260. │ │ │ │ ├── FAQ.md
  261. │ │ │ │ ├── FAQ_en.md
  262. │ │ │ │ ├── guide.md
  263. │ │ │ │ ├── guide_en.md
  264. │ │ │ │ ├── version.md
  265. │ │ │ │ └── version_en.md
  266. │ │ │ ├── rate/
  267. │ │ │ │ ├── api.md
  268. │ │ │ │ ├── api_en.md
  269. │ │ │ │ ├── FAQ.md
  270. │ │ │ │ ├── FAQ_en.md
  271. │ │ │ │ ├── guide.md
  272. │ │ │ │ ├── guide_en.md
  273. │ │ │ │ ├── version.md
  274. │ │ │ │ └── version_en.md
  275. │ │ │ ├── skeleton/
  276. │ │ │ │ ├── api.md
  277. │ │ │ │ ├── api_en.md
  278. │ │ │ │ ├── FAQ.md
  279. │ │ │ │ ├── FAQ_en.md
  280. │ │ │ │ ├── guide.md
  281. │ │ │ │ ├── guide_en.md
  282. │ │ │ │ ├── version.md
  283. │ │ │ │ └── version_en.md
  284. │ │ │ ├── slider/
  285. │ │ │ │ ├── api.md
  286. │ │ │ │ ├── api_en.md
  287. │ │ │ │ ├── FAQ.md
  288. │ │ │ │ ├── FAQ_en.md
  289. │ │ │ │ ├── guide.md
  290. │ │ │ │ ├── guide_en.md
  291. │ │ │ │ ├── version.md
  292. │ │ │ │ └── version_en.md
  293. │ │ │ ├── stepper/
  294. │ │ │ │ ├── api.md
  295. │ │ │ │ ├── api_en.md
  296. │ │ │ │ ├── FAQ.md
  297. │ │ │ │ ├── FAQ_en.md
  298. │ │ │ │ ├── guide.md
  299. │ │ │ │ ├── guide_en.md
  300. │ │ │ │ ├── version.md
  301. │ │ │ │ └── version_en.md
  302. │ │ │ ├── steps/
  303. │ │ │ │ ├── api.md
  304. │ │ │ │ ├── api_en.md
  305. │ │ │ │ ├── FAQ.md
  306. │ │ │ │ ├── FAQ_en.md
  307. │ │ │ │ ├── guide.md
  308. │ │ │ │ ├── guide_en.md
  309. │ │ │ │ ├── version.md
  310. │ │ │ │ └── version_en.md
  311. │ │ │ ├── swiper/
  312. │ │ │ │ ├── api.md
  313. │ │ │ │ ├── api_en.md
  314. │ │ │ │ ├── FAQ.md
  315. │ │ │ │ ├── FAQ_en.md
  316. │ │ │ │ ├── guide.md
  317. │ │ │ │ ├── guide_en.md
  318. │ │ │ │ ├── version.md
  319. │ │ │ │ └── version_en.md
  320. │ │ │ ├── switch/
  321. │ │ │ │ ├── api.md
  322. │ │ │ │ ├── api_en.md
  323. │ │ │ │ ├── FAQ.md
  324. │ │ │ │ ├── FAQ_en.md
  325. │ │ │ │ ├── guide.md
  326. │ │ │ │ ├── guide_en.md
  327. │ │ │ │ ├── version.md
  328. │ │ │ │ └── version_en.md
  329. │ │ │ ├── tabBar/
  330. │ │ │ │ ├── api.md
  331. │ │ │ │ ├── api_en.md
  332. │ │ │ │ ├── FAQ.md
  333. │ │ │ │ ├── FAQ_en.md
  334. │ │ │ │ ├── guide.md
  335. │ │ │ │ ├── guide_en.md
  336. │ │ │ │ ├── version.md
  337. │ │ │ │ └── version_en.md
  338. │ │ │ ├── tabs/
  339. │ │ │ │ ├── api.md
  340. │ │ │ │ ├── api_en.md
  341. │ │ │ │ ├── FAQ.md
  342. │ │ │ │ ├── FAQ_en.md
  343. │ │ │ │ ├── guide.md
  344. │ │ │ │ ├── guide_en.md
  345. │ │ │ │ ├── version.md
  346. │ │ │ │ └── version_en.md
  347. │ │ │ ├── timePicker/
  348. │ │ │ │ ├── api.md
  349. │ │ │ │ ├── api_en.md
  350. │ │ │ │ ├── FAQ.md
  351. │ │ │ │ ├── FAQ_en.md
  352. │ │ │ │ ├── guide.md
  353. │ │ │ │ ├── guide_en.md
  354. │ │ │ │ ├── version.md
  355. │ │ │ │ └── version_en.md
  356. │ │ │ └── toast/
  357. │ │ │ ├── api.md
  358. │ │ │ ├── api_en.md
  359. │ │ │ ├── FAQ.md
  360. │ │ │ ├── FAQ_en.md
  361. │ │ │ ├── guide.md
  362. │ │ │ ├── guide_en.md
  363. │ │ │ ├── version.md
  364. │ │ │ └── version_en.md
  365. │ │ └── guide/
  366. │ │ ├── about.md
  367. │ │ ├── about_en.md
  368. │ │ ├── changelog.md
  369. │ │ ├── changelog_en.md
  370. │ │ ├── compatibility.md
  371. │ │ ├── compatibility_en.md
  372. │ │ ├── contribution.md
  373. │ │ ├── contribution_en.md
  374. │ │ ├── faq.md
  375. │ │ ├── faq_en.md
  376. │ │ ├── future.md
  377. │ │ ├── future_en.md
  378. │ │ ├── icon.md
  379. │ │ ├── icon_en.md
  380. │ │ ├── internation.md
  381. │ │ ├── internation_en.md
  382. │ │ ├── milestone.md
  383. │ │ ├── milestone_en.md
  384. │ │ ├── quickStart.md
  385. │ │ ├── quickStart_en.md
  386. │ │ ├── theme.md
  387. │ │ ├── theme_en.md
  388. │ │ ├── vscode.md
  389. │ │ └── vscode_en.md
  390. │ └── site/
  391. │ ├── eslint.config.js
  392. │ ├── package.json
  393. │ ├── svelte.config.js
  394. │ ├── tsconfig.json
  395. │ ├── vite.config.ts
  396. │ ├── .prettierignore
  397. │ ├── .prettierrc
  398. │ ├── scripts/
  399. │ │ └── env.js
  400. │ ├── src/
  401. │ │ ├── app.css
  402. │ │ ├── app.d.ts
  403. │ │ ├── app.html
  404. │ │ ├── global.d.ts
  405. │ │ ├── store.ts
  406. │ │ ├── data/
  407. │ │ │ ├── color.ts
  408. │ │ │ ├── menuList.ts
  409. │ │ │ └── themes/
  410. │ │ │ ├── aqua.ts
  411. │ │ │ ├── azuper.ts
  412. │ │ │ ├── azurePink.ts
  413. │ │ │ ├── camelliaRed.ts
  414. │ │ │ ├── chameleon.ts
  415. │ │ │ ├── citrus.ts
  416. │ │ │ ├── greenJade.ts
  417. │ │ │ ├── index.ts
  418. │ │ │ ├── kleinH.ts
  419. │ │ │ ├── lavender.ts
  420. │ │ │ ├── nintendo.ts
  421. │ │ │ ├── skybloom.ts
  422. │ │ │ ├── smartLive.ts
  423. │ │ │ └── tealMedley.ts
  424. │ │ ├── lib/
  425. │ │ │ ├── index.ts
  426. │ │ │ ├── clis/
  427. │ │ │ │ └── Clis.svelte
  428. │ │ │ ├── cmdk/
  429. │ │ │ │ └── CmdK.svelte
  430. │ │ │ ├── colorCard/
  431. │ │ │ │ └── ColorCard.svelte
  432. │ │ │ ├── fund/
  433. │ │ │ │ └── Fund.svelte
  434. │ │ │ ├── header/
  435. │ │ │ │ └── Header.svelte
  436. │ │ │ ├── menu/
  437. │ │ │ │ └── Menu.svelte
  438. │ │ │ ├── modeSwitch/
  439. │ │ │ │ ├── darkMode.ts
  440. │ │ │ │ └── ModeSwitch.svelte
  441. │ │ │ ├── symbol/
  442. │ │ │ ├── tab/
  443. │ │ │ │ └── Tab.svelte
  444. │ │ │ └── themeSwitch/
  445. │ │ │ └── ThemeSwitch.svelte
  446. │ │ ├── routes/
  447. │ │ │ ├── +error.svelte
  448. │ │ │ ├── +layout.svelte
  449. │ │ │ ├── +layout.ts
  450. │ │ │ ├── +page.svelte
  451. │ │ │ ├── components/
  452. │ │ │ │ ├── +page.svelte
  453. │ │ │ │ ├── Api.svelte
  454. │ │ │ │ ├── Component.svelte
  455. │ │ │ │ ├── FAQ.svelte
  456. │ │ │ │ ├── Guide.svelte
  457. │ │ │ │ └── Version.svelte
  458. │ │ │ └── guide/
  459. │ │ │ ├── +layout.svelte
  460. │ │ │ ├── +page.svelte
  461. │ │ │ ├── Create.svelte
  462. │ │ │ ├── about/
  463. │ │ │ │ └── +page.svelte
  464. │ │ │ ├── changelog/
  465. │ │ │ │ └── +page.svelte
  466. │ │ │ ├── color/
  467. │ │ │ │ ├── +page.svelte
  468. │ │ │ │ └── Color.svelte
  469. │ │ │ ├── compatibility/
  470. │ │ │ │ └── +page.svelte
  471. │ │ │ ├── contribution/
  472. │ │ │ │ └── +page.svelte
  473. │ │ │ ├── create/
  474. │ │ │ │ └── +page.svelte
  475. │ │ │ ├── faq/
  476. │ │ │ │ └── +page.svelte
  477. │ │ │ ├── future/
  478. │ │ │ │ └── +page.svelte
  479. │ │ │ ├── generator/
  480. │ │ │ │ ├── +page.svelte
  481. │ │ │ │ ├── Calendar.svelte
  482. │ │ │ │ └── GeneratorPreview.svelte
  483. │ │ │ ├── icon/
  484. │ │ │ │ └── +page.svelte
  485. │ │ │ ├── icon-plugin/
  486. │ │ │ │ └── +page.svelte
  487. │ │ │ ├── internation/
  488. │ │ │ │ └── +page.svelte
  489. │ │ │ ├── logo/
  490. │ │ │ │ └── +page.svelte
  491. │ │ │ ├── md/
  492. │ │ │ │ └── +page.svelte
  493. │ │ │ ├── milestone/
  494. │ │ │ │ └── +page.svelte
  495. │ │ │ ├── shortkey/
  496. │ │ │ │ └── +page.svelte
  497. │ │ │ ├── theme/
  498. │ │ │ │ └── +page.svelte
  499. │ │ │ └── vscode/
  500. │ │ │ └── +page.svelte
  501. │ │ └── utils/
  502. │ │ ├── code-group-svg-data.js
  503. │ │ └── index.ts
  504. │ └── static/
  505. │ ├── assets/
  506. │ │ ├── favicon_logo/
  507. │ │ │ └── site.webmanifest
  508. │ │ ├── favicon_logo_dark/
  509. │ │ │ └── site.webmanifest
  510. │ │ ├── fonts/
  511. │ │ │ └── JetBrainsMono-Regular.woff2
  512. │ │ ├── fund/
  513. │ │ ├── images/
  514. │ │ │ ├── guide/
  515. │ │ │ └── home/
  516. │ │ ├── qr/
  517. │ │ ├── svg/
  518. │ │ └── vscode/
  519. │ └── logo/
  520. ├── packages/
  521. │ ├── create-stdf/
  522. │ │ ├── README.md
  523. │ │ ├── index.js
  524. │ │ ├── package.json
  525. │ │ ├── README_CN.md
  526. │ │ ├── rollup.config.js
  527. │ │ ├── scripts/
  528. │ │ │ └── update.js
  529. │ │ ├── src/
  530. │ │ │ ├── index.js
  531. │ │ │ └── lang.js
  532. │ │ └── templates/
  533. │ │ ├── skt/
  534. │ │ │ ├── README.md
  535. │ │ │ ├── eslint.config.js
  536. │ │ │ ├── jsconfig.json
  537. │ │ │ ├── package.json
  538. │ │ │ ├── svelte.config.js
  539. │ │ │ ├── vite.config.js
  540. │ │ │ ├── .npmrc
  541. │ │ │ ├── .prettierignore
  542. │ │ │ ├── .prettierrc
  543. │ │ │ ├── src/
  544. │ │ │ │ ├── app.css
  545. │ │ │ │ ├── app.d.ts
  546. │ │ │ │ ├── app.html
  547. │ │ │ │ ├── data/
  548. │ │ │ │ │ └── nintendo.ts
  549. │ │ │ │ ├── lib/
  550. │ │ │ │ │ ├── svgs/
  551. │ │ │ │ │ │ ├── Heroicons/
  552. │ │ │ │ │ │ ├── IconPark/
  553. │ │ │ │ │ │ └── Remix/
  554. │ │ │ │ │ └── symbol/
  555. │ │ │ │ └── routes/
  556. │ │ │ │ ├── +layout.js
  557. │ │ │ │ ├── +layout.svelte
  558. │ │ │ │ ├── +page.svelte
  559. │ │ │ │ ├── Counter.svelte
  560. │ │ │ │ └── about/
  561. │ │ │ │ └── +page.svelte
  562. │ │ │ └── static/
  563. │ │ └── sktt/
  564. │ │ ├── README.md
  565. │ │ ├── eslint.config.js
  566. │ │ ├── package.json
  567. │ │ ├── svelte.config.js
  568. │ │ ├── tsconfig.json
  569. │ │ ├── vite.config.ts
  570. │ │ ├── .npmrc
  571. │ │ ├── .prettierignore
  572. │ │ ├── .prettierrc
  573. │ │ ├── src/
  574. │ │ │ ├── app.css
  575. │ │ │ ├── app.d.ts
  576. │ │ │ ├── app.html
  577. │ │ │ ├── data/
  578. │ │ │ │ └── nintendo.ts
  579. │ │ │ ├── lib/
  580. │ │ │ │ ├── svgs/
  581. │ │ │ │ │ ├── Heroicons/
  582. │ │ │ │ │ ├── IconPark/
  583. │ │ │ │ │ └── Remix/
  584. │ │ │ │ └── symbol/
  585. │ │ │ └── routes/
  586. │ │ │ ├── +layout.js
  587. │ │ │ ├── +layout.svelte
  588. │ │ │ ├── +page.svelte
  589. │ │ │ ├── Counter.svelte
  590. │ │ │ └── about/
  591. │ │ │ └── +page.svelte
  592. │ │ └── static/
  593. │ ├── rollup-plugin-md-ts/
  594. │ │ ├── README.md
  595. │ │ ├── eslint.config.js
  596. │ │ ├── package.json
  597. │ │ ├── README_CN.md
  598. │ │ ├── rollup.config.ts
  599. │ │ ├── tsconfig.json
  600. │ │ ├── .prettierrc
  601. │ │ └── src/
  602. │ │ └── index.ts
  603. │ ├── rollup-plugin-stdf-icon/
  604. │ │ ├── README.md
  605. │ │ ├── package.json
  606. │ │ ├── README_CN.md
  607. │ │ ├── rollup.config.js
  608. │ │ ├── tsconfig.json
  609. │ │ ├── src/
  610. │ │ │ └── index.ts
  611. │ │ └── test/
  612. │ │ ├── index.js
  613. │ │ └── icons/
  614. │ ├── stdf/
  615. │ │ ├── eslint.config.js
  616. │ │ ├── package.json
  617. │ │ ├── svelte.config.js
  618. │ │ ├── tsconfig.json
  619. │ │ ├── vite.config.ts
  620. │ │ ├── .prettierignore
  621. │ │ ├── .prettierrc
  622. │ │ ├── src/
  623. │ │ │ ├── app.css
  624. │ │ │ ├── app.d.ts
  625. │ │ │ ├── app.html
  626. │ │ │ ├── assets/
  627. │ │ │ │ └── svgs/
  628. │ │ │ ├── data/
  629. │ │ │ │ ├── aphorisms.ts
  630. │ │ │ │ ├── menuList.ts
  631. │ │ │ │ └── themes/
  632. │ │ │ │ ├── aqua.ts
  633. │ │ │ │ ├── azuper.ts
  634. │ │ │ │ ├── azurePink.ts
  635. │ │ │ │ ├── camelliaRed.ts
  636. │ │ │ │ ├── chameleon.ts
  637. │ │ │ │ ├── citrus.ts
  638. │ │ │ │ ├── greenJade.ts
  639. │ │ │ │ ├── index.ts
  640. │ │ │ │ ├── kleinH.ts
  641. │ │ │ │ ├── lavender.ts
  642. │ │ │ │ ├── nintendo.ts
  643. │ │ │ │ ├── skybloom.ts
  644. │ │ │ │ ├── smartLive.ts
  645. │ │ │ │ └── tealMedley.ts
  646. │ │ │ ├── lib/
  647. │ │ │ │ ├── index.ts
  648. │ │ │ │ ├── assets/
  649. │ │ │ │ │ └── svg_base/
  650. │ │ │ │ ├── components/
  651. │ │ │ │ │ ├── actionSheet/
  652. │ │ │ │ │ │ └── ActionSheet.svelte
  653. │ │ │ │ │ ├── asyncPicker/
  654. │ │ │ │ │ │ └── AsyncPicker.svelte
  655. │ │ │ │ │ ├── avatar/
  656. │ │ │ │ │ │ ├── Avatar.svelte
  657. │ │ │ │ │ │ └── Avatars.svelte
  658. │ │ │ │ │ ├── badge/
  659. │ │ │ │ │ │ └── Badge.svelte
  660. │ │ │ │ │ ├── bottomSheet/
  661. │ │ │ │ │ │ └── BottomSheet.svelte
  662. │ │ │ │ │ ├── button/
  663. │ │ │ │ │ │ └── Button.svelte
  664. │ │ │ │ │ ├── calendar/
  665. │ │ │ │ │ │ └── Calendar.svelte
  666. │ │ │ │ │ ├── cell/
  667. │ │ │ │ │ │ ├── Cell.svelte
  668. │ │ │ │ │ │ └── CellGroup.svelte
  669. │ │ │ │ │ ├── checkbox/
  670. │ │ │ │ │ │ ├── Checkbox.svelte
  671. │ │ │ │ │ │ └── CheckboxItem.svelte
  672. │ │ │ │ │ ├── dialog/
  673. │ │ │ │ │ │ └── Dialog.svelte
  674. │ │ │ │ │ ├── divider/
  675. │ │ │ │ │ │ └── Divider.svelte
  676. │ │ │ │ │ ├── grids/
  677. │ │ │ │ │ │ ├── Grid.svelte
  678. │ │ │ │ │ │ └── Grids.svelte
  679. │ │ │ │ │ ├── icon/
  680. │ │ │ │ │ │ └── Icon.svelte
  681. │ │ │ │ │ ├── indexBar/
  682. │ │ │ │ │ │ └── IndexBar.svelte
  683. │ │ │ │ │ ├── input/
  684. │ │ │ │ │ │ └── Input.svelte
  685. │ │ │ │ │ ├── loading/
  686. │ │ │ │ │ │ ├── Loading.svelte
  687. │ │ │ │ │ │ └── loadings/
  688. │ │ │ │ │ │ ├── fourColor/
  689. │ │ │ │ │ │ │ ├── 4_0.svelte
  690. │ │ │ │ │ │ │ ├── 4_1.svelte
  691. │ │ │ │ │ │ │ ├── 4_2.svelte
  692. │ │ │ │ │ │ │ ├── 4_3.svelte
  693. │ │ │ │ │ │ │ └── index.ts
  694. │ │ │ │ │ │ ├── oneColor/
  695. │ │ │ │ │ │ │ ├── 1_0.svelte
  696. │ │ │ │ │ │ │ ├── 1_1.svelte
  697. │ │ │ │ │ │ │ ├── 1_10.svelte
  698. │ │ │ │ │ │ │ ├── 1_11.svelte
  699. │ │ │ │ │ │ │ ├── 1_12.svelte
  700. │ │ │ │ │ │ │ ├── 1_13.svelte
  701. │ │ │ │ │ │ │ ├── 1_14.svelte
  702. │ │ │ │ │ │ │ ├── 1_15.svelte
  703. │ │ │ │ │ │ │ ├── 1_16.svelte
  704. │ │ │ │ │ │ │ ├── 1_17.svelte
  705. │ │ │ │ │ │ │ ├── 1_18.svelte
  706. │ │ │ │ │ │ │ ├── 1_19.svelte
  707. │ │ │ │ │ │ │ ├── 1_2.svelte
  708. │ │ │ │ │ │ │ ├── 1_20.svelte
  709. │ │ │ │ │ │ │ ├── 1_21.svelte
  710. │ │ │ │ │ │ │ ├── 1_22.svelte
  711. │ │ │ │ │ │ │ ├── 1_23.svelte
  712. │ │ │ │ │ │ │ ├── 1_24.svelte
  713. │ │ │ │ │ │ │ ├── 1_25.svelte
  714. │ │ │ │ │ │ │ ├── 1_26.svelte
  715. │ │ │ │ │ │ │ ├── 1_27.svelte
  716. │ │ │ │ │ │ │ ├── 1_28.svelte
  717. │ │ │ │ │ │ │ ├── 1_29.svelte
  718. │ │ │ │ │ │ │ ├── 1_3.svelte
  719. │ │ │ │ │ │ │ ├── 1_30.svelte
  720. │ │ │ │ │ │ │ ├── 1_31.svelte
  721. │ │ │ │ │ │ │ ├── 1_32.svelte
  722. │ │ │ │ │ │ │ ├── 1_33.svelte
  723. │ │ │ │ │ │ │ ├── 1_34.svelte
  724. │ │ │ │ │ │ │ ├── 1_35.svelte
  725. │ │ │ │ │ │ │ ├── 1_36.svelte
  726. │ │ │ │ │ │ │ ├── 1_37.svelte
  727. │ │ │ │ │ │ │ ├── 1_38.svelte
  728. │ │ │ │ │ │ │ ├── 1_39.svelte
  729. │ │ │ │ │ │ │ ├── 1_4.svelte
  730. │ │ │ │ │ │ │ ├── 1_40.svelte
  731. │ │ │ │ │ │ │ ├── 1_41.svelte
  732. │ │ │ │ │ │ │ ├── 1_42.svelte
  733. │ │ │ │ │ │ │ ├── 1_43.svelte
  734. │ │ │ │ │ │ │ ├── 1_44.svelte
  735. │ │ │ │ │ │ │ ├── 1_45.svelte
  736. │ │ │ │ │ │ │ ├── 1_46.svelte
  737. │ │ │ │ │ │ │ ├── 1_47.svelte
  738. │ │ │ │ │ │ │ ├── 1_48.svelte
  739. │ │ │ │ │ │ │ ├── 1_49.svelte
  740. │ │ │ │ │ │ │ ├── 1_5.svelte
  741. │ │ │ │ │ │ │ ├── 1_50.svelte
  742. │ │ │ │ │ │ │ ├── 1_51.svelte
  743. │ │ │ │ │ │ │ ├── 1_52.svelte
  744. │ │ │ │ │ │ │ ├── 1_53.svelte
  745. │ │ │ │ │ │ │ ├── 1_6.svelte
  746. │ │ │ │ │ │ │ ├── 1_7.svelte
  747. │ │ │ │ │ │ │ ├── 1_8.svelte
  748. │ │ │ │ │ │ │ ├── 1_9.svelte
  749. │ │ │ │ │ │ │ └── index.ts
  750. │ │ │ │ │ │ └── twoColor/
  751. │ │ │ │ │ │ ├── 2_0.svelte
  752. │ │ │ │ │ │ ├── 2_1.svelte
  753. │ │ │ │ │ │ ├── 2_2.svelte
  754. │ │ │ │ │ │ ├── 2_3.svelte
  755. │ │ │ │ │ │ ├── 2_4.svelte
  756. │ │ │ │ │ │ ├── 2_5.svelte
  757. │ │ │ │ │ │ └── index.ts
  758. │ │ │ │ │ ├── mask/
  759. │ │ │ │ │ │ └── Mask.svelte
  760. │ │ │ │ │ ├── modal/
  761. │ │ │ │ │ │ └── Modal.svelte
  762. │ │ │ │ │ ├── navBar/
  763. │ │ │ │ │ │ └── NavBar.svelte
  764. │ │ │ │ │ ├── noticeBar/
  765. │ │ │ │ │ │ └── NoticeBar.svelte
  766. │ │ │ │ │ ├── numKeyboard/
  767. │ │ │ │ │ │ └── NumKeyboard.svelte
  768. │ │ │ │ │ ├── pagination/
  769. │ │ │ │ │ │ ├── Page.svelte
  770. │ │ │ │ │ │ ├── Pagination.svelte
  771. │ │ │ │ │ │ ├── SecondPageNext.svelte
  772. │ │ │ │ │ │ └── SecondPagePre.svelte
  773. │ │ │ │ │ ├── picker/
  774. │ │ │ │ │ │ └── Picker.svelte
  775. │ │ │ │ │ ├── placeholder/
  776. │ │ │ │ │ │ └── Placeholder.svelte
  777. │ │ │ │ │ ├── popup/
  778. │ │ │ │ │ │ ├── Popup.svelte
  779. │ │ │ │ │ │ └── Transition.svelte
  780. │ │ │ │ │ ├── progress/
  781. │ │ │ │ │ │ └── Progress.svelte
  782. │ │ │ │ │ ├── progressLoop/
  783. │ │ │ │ │ │ └── ProgressLoop.svelte
  784. │ │ │ │ │ ├── radio/
  785. │ │ │ │ │ │ ├── Radio.svelte
  786. │ │ │ │ │ │ └── RadioItem.svelte
  787. │ │ │ │ │ ├── rate/
  788. │ │ │ │ │ │ └── Rate.svelte
  789. │ │ │ │ │ ├── scrollRadio/
  790. │ │ │ │ │ │ └── ScrollRadio.svelte
  791. │ │ │ │ │ ├── skeleton/
  792. │ │ │ │ │ │ └── Skeleton.svelte
  793. │ │ │ │ │ ├── slider/
  794. │ │ │ │ │ │ └── Slider.svelte
  795. │ │ │ │ │ ├── stepper/
  796. │ │ │ │ │ │ └── Stepper.svelte
  797. │ │ │ │ │ ├── steps/
  798. │ │ │ │ │ │ └── Steps.svelte
  799. │ │ │ │ │ ├── swiper/
  800. │ │ │ │ │ │ └── Swiper.svelte
  801. │ │ │ │ │ ├── switch/
  802. │ │ │ │ │ │ └── Switch.svelte
  803. │ │ │ │ │ ├── tabBar/
  804. │ │ │ │ │ │ └── TabBar.svelte
  805. │ │ │ │ │ ├── tabs/
  806. │ │ │ │ │ │ ├── Tab.svelte
  807. │ │ │ │ │ │ ├── TabContent.svelte
  808. │ │ │ │ │ │ └── Tabs.svelte
  809. │ │ │ │ │ ├── timePicker/
  810. │ │ │ │ │ │ └── TimePicker.svelte
  811. │ │ │ │ │ ├── toast/
  812. │ │ │ │ │ │ ├── Toast.svelte
  813. │ │ │ │ │ │ └── Transition.svelte
  814. │ │ │ │ │ └── utils/
  815. │ │ │ │ │ └── index.ts
  816. │ │ │ │ ├── lang/
  817. │ │ │ │ │ ├── ar_EG.ts
  818. │ │ │ │ │ ├── az_AZ.ts
  819. │ │ │ │ │ ├── bg_BG.ts
  820. │ │ │ │ │ ├── bn_BD.ts
  821. │ │ │ │ │ ├── ca_ES.ts
  822. │ │ │ │ │ ├── cs_CZ.ts
  823. │ │ │ │ │ ├── da_DK.ts
  824. │ │ │ │ │ ├── de_DE.ts
  825. │ │ │ │ │ ├── el_GR.ts
  826. │ │ │ │ │ ├── en_GB.ts
  827. │ │ │ │ │ ├── en_US.ts
  828. │ │ │ │ │ ├── es_ES.ts
  829. │ │ │ │ │ ├── et_EE.ts
  830. │ │ │ │ │ ├── eu_ES.ts
  831. │ │ │ │ │ ├── fa_IR.ts
  832. │ │ │ │ │ ├── fi_FI.ts
  833. │ │ │ │ │ ├── fr_BE.ts
  834. │ │ │ │ │ ├── fr_CA.ts
  835. │ │ │ │ │ ├── fr_FR.ts
  836. │ │ │ │ │ ├── ga_IE.ts
  837. │ │ │ │ │ ├── gl_ES.ts
  838. │ │ │ │ │ ├── he_IL.ts
  839. │ │ │ │ │ ├── hi_IN.ts
  840. │ │ │ │ │ ├── hr_HR.ts
  841. │ │ │ │ │ ├── hu_HU.ts
  842. │ │ │ │ │ ├── hy_AM.ts
  843. │ │ │ │ │ ├── id_ID.ts
  844. │ │ │ │ │ ├── index.ts
  845. │ │ │ │ │ ├── is_IS.ts
  846. │ │ │ │ │ ├── it_IT.ts
  847. │ │ │ │ │ ├── ja_JP.ts
  848. │ │ │ │ │ ├── ka_GE.ts
  849. │ │ │ │ │ ├── kk_KZ.ts
  850. │ │ │ │ │ ├── km_KH.ts
  851. │ │ │ │ │ ├── kmr_IQ.ts
  852. │ │ │ │ │ ├── kn_IN.ts
  853. │ │ │ │ │ ├── ko_KR.ts
  854. │ │ │ │ │ ├── lt_LT.ts
  855. │ │ │ │ │ ├── lv_LV.ts
  856. │ │ │ │ │ ├── mk_MK.ts
  857. │ │ │ │ │ ├── ml_IN.ts
  858. │ │ │ │ │ ├── mn_MN.ts
  859. │ │ │ │ │ ├── ms_MY.ts
  860. │ │ │ │ │ ├── nb_NO.ts
  861. │ │ │ │ │ ├── ne_NP.ts
  862. │ │ │ │ │ ├── nl_BE.ts
  863. │ │ │ │ │ ├── nl_NL.ts
  864. │ │ │ │ │ ├── pl_PL.ts
  865. │ │ │ │ │ ├── pt_BR.ts
  866. │ │ │ │ │ ├── pt_PT.ts
  867. │ │ │ │ │ ├── ro_RO.ts
  868. │ │ │ │ │ ├── ru_RU.ts
  869. │ │ │ │ │ ├── si_LK.ts
  870. │ │ │ │ │ ├── sk_SK.ts
  871. │ │ │ │ │ ├── sl_SI.ts
  872. │ │ │ │ │ ├── sr_RS.ts
  873. │ │ │ │ │ ├── sv_SE.ts
  874. │ │ │ │ │ ├── ta_IN.ts
  875. │ │ │ │ │ ├── th_TH.ts
  876. │ │ │ │ │ ├── tk_TK.ts
  877. │ │ │ │ │ ├── tr_TR.ts
  878. │ │ │ │ │ ├── uk_UA.ts
  879. │ │ │ │ │ ├── ur_PK.ts
  880. │ │ │ │ │ ├── vi_VN.ts
  881. │ │ │ │ │ ├── zh_CN.ts
  882. │ │ │ │ │ ├── zh_HK.ts
  883. │ │ │ │ │ └── zh_TW.ts
  884. │ │ │ │ ├── theme/
  885. │ │ │ │ │ ├── darkMode.ts
  886. │ │ │ │ │ ├── index.ts
  887. │ │ │ │ │ ├── stdf.ts
  888. │ │ │ │ │ ├── switchTheme.ts
  889. │ │ │ │ │ └── types.ts
  890. │ │ │ │ └── types/
  891. │ │ │ │ └── index.ts
  892. │ │ │ └── routes/
  893. │ │ │ ├── +layout.svelte
  894. │ │ │ ├── +layout.ts
  895. │ │ │ ├── +page.svelte
  896. │ │ │ ├── actionSheet/
  897. │ │ │ │ ├── en_US/
  898. │ │ │ │ │ └── +page.svelte
  899. │ │ │ │ └── zh_CN/
  900. │ │ │ │ └── +page.svelte
  901. │ │ │ ├── asyncPicker/
  902. │ │ │ │ ├── en_US/
  903. │ │ │ │ │ ├── +page.svelte
  904. │ │ │ │ │ └── data_en.js
  905. │ │ │ │ └── zh_CN/
  906. │ │ │ │ ├── +page.svelte
  907. │ │ │ │ └── data.js
  908. │ │ │ ├── avatar/
  909. │ │ │ │ ├── en_US/
  910. │ │ │ │ │ └── +page.svelte
  911. │ │ │ │ └── zh_CN/
  912. │ │ │ │ └── +page.svelte
  913. │ │ │ ├── badge/
  914. │ │ │ │ ├── en_US/
  915. │ │ │ │ │ └── +page.svelte
  916. │ │ │ │ └── zh_CN/
  917. │ │ │ │ └── +page.svelte
  918. │ │ │ ├── bottomSheet/
  919. │ │ │ │ ├── en_US/
  920. │ │ │ │ │ └── +page.svelte
  921. │ │ │ │ └── zh_CN/
  922. │ │ │ │ └── +page.svelte
  923. │ │ │ ├── button/
  924. │ │ │ │ ├── en_US/
  925. │ │ │ │ │ └── +page.svelte
  926. │ │ │ │ └── zh_CN/
  927. │ │ │ │ └── +page.svelte
  928. │ │ │ ├── calendar/
  929. │ │ │ │ ├── en_US/
  930. │ │ │ │ │ └── +page.svelte
  931. │ │ │ │ └── zh_CN/
  932. │ │ │ │ └── +page.svelte
  933. │ │ │ ├── cell/
  934. │ │ │ │ ├── en_US/
  935. │ │ │ │ │ └── +page.svelte
  936. │ │ │ │ └── zh_CN/
  937. │ │ │ │ └── +page.svelte
  938. │ │ │ ├── checkbox/
  939. │ │ │ │ ├── en_US/
  940. │ │ │ │ │ └── +page.svelte
  941. │ │ │ │ └── zh_CN/
  942. │ │ │ │ └── +page.svelte
  943. │ │ │ ├── components/
  944. │ │ │ │ ├── Aphorism.svelte
  945. │ │ │ │ └── ThemeSwitch.svelte
  946. │ │ │ ├── dialog/
  947. │ │ │ │ ├── en_US/
  948. │ │ │ │ │ └── +page.svelte
  949. │ │ │ │ └── zh_CN/
  950. │ │ │ │ └── +page.svelte
  951. │ │ │ ├── divider/
  952. │ │ │ │ ├── en_US/
  953. │ │ │ │ │ └── +page.svelte
  954. │ │ │ │ └── zh_CN/
  955. │ │ │ │ └── +page.svelte
  956. │ │ │ ├── grids/
  957. │ │ │ │ ├── en_US/
  958. │ │ │ │ │ └── +page.svelte
  959. │ │ │ │ └── zh_CN/
  960. │ │ │ │ └── +page.svelte
  961. │ │ │ ├── icon/
  962. │ │ │ │ ├── en_US/
  963. │ │ │ │ │ └── +page.svelte
  964. │ │ │ │ └── zh_CN/
  965. │ │ │ │ └── +page.svelte
  966. │ │ │ ├── indexBar/
  967. │ │ │ │ ├── en_US/
  968. │ │ │ │ │ └── +page.svelte
  969. │ │ │ │ └── zh_CN/
  970. │ │ │ │ └── +page.svelte
  971. │ │ │ ├── input/
  972. │ │ │ │ ├── en_US/
  973. │ │ │ │ │ └── +page.svelte
  974. │ │ │ │ └── zh_CN/
  975. │ │ │ │ └── +page.svelte
  976. │ │ │ ├── loading/
  977. │ │ │ │ ├── en_US/
  978. │ │ │ │ │ └── +page.svelte
  979. │ │ │ │ └── zh_CN/
  980. │ │ │ │ └── +page.svelte
  981. │ │ │ ├── mask/
  982. │ │ │ │ ├── en_US/
  983. │ │ │ │ │ └── +page.svelte
  984. │ │ │ │ └── zh_CN/
  985. │ │ │ │ └── +page.svelte
  986. │ │ │ ├── modal/
  987. │ │ │ │ ├── en_US/
  988. │ │ │ │ │ └── +page.svelte
  989. │ │ │ │ └── zh_CN/
  990. │ │ │ │ └── +page.svelte
  991. │ │ │ ├── navBar/
  992. │ │ │ │ ├── en_US/
  993. │ │ │ │ │ └── +page.svelte
  994. │ │ │ │ └── zh_CN/
  995. │ │ │ │ └── +page.svelte
  996. │ │ │ ├── noticeBar/
  997. │ │ │ │ ├── en_US/
  998. │ │ │ │ │ └── +page.svelte
  999. │ │ │ │ └── zh_CN/
  1000. │ │ │ │ └── +page.svelte
  1001. │ │ │ ├── numKeyboard/
  1002. │ │ │ │ ├── en_US/
  1003. │ │ │ │ │ └── +page.svelte
  1004. │ │ │ │ └── zh_CN/
  1005. │ │ │ │ └── +page.svelte
  1006. │ │ │ ├── pagination/
  1007. │ │ │ │ ├── en_US/
  1008. │ │ │ │ │ └── +page.svelte
  1009. │ │ │ │ └── zh_CN/
  1010. │ │ │ │ └── +page.svelte
  1011. │ │ │ ├── picker/
  1012. │ │ │ │ ├── en_US/
  1013. │ │ │ │ │ ├── +page.svelte
  1014. │ │ │ │ │ └── data_en.js
  1015. │ │ │ │ └── zh_CN/
  1016. │ │ │ │ ├── +page.svelte
  1017. │ │ │ │ └── data.js
  1018. │ │ │ ├── placeholder/
  1019. │ │ │ │ ├── en_US/
  1020. │ │ │ │ │ └── +page.svelte
  1021. │ │ │ │ └── zh_CN/
  1022. │ │ │ │ └── +page.svelte
  1023. │ │ │ ├── popup/
  1024. │ │ │ │ ├── en_US/
  1025. │ │ │ │ │ └── +page.svelte
  1026. │ │ │ │ └── zh_CN/
  1027. │ │ │ │ └── +page.svelte
  1028. │ │ │ ├── progress/
  1029. │ │ │ │ ├── en_US/
  1030. │ │ │ │ │ └── +page.svelte
  1031. │ │ │ │ └── zh_CN/
  1032. │ │ │ │ └── +page.svelte
  1033. │ │ │ ├── progressLoop/
  1034. │ │ │ │ ├── en_US/
  1035. │ │ │ │ │ └── +page.svelte
  1036. │ │ │ │ └── zh_CN/
  1037. │ │ │ │ └── +page.svelte
  1038. │ │ │ ├── radio/
  1039. │ │ │ │ ├── en_US/
  1040. │ │ │ │ │ └── +page.svelte
  1041. │ │ │ │ └── zh_CN/
  1042. │ │ │ │ └── +page.svelte
  1043. │ │ │ ├── rate/
  1044. │ │ │ │ ├── en_US/
  1045. │ │ │ │ │ └── +page.svelte
  1046. │ │ │ │ └── zh_CN/
  1047. │ │ │ │ └── +page.svelte
  1048. │ │ │ ├── skeleton/
  1049. │ │ │ │ ├── en_US/
  1050. │ │ │ │ │ └── +page.svelte
  1051. │ │ │ │ └── zh_CN/
  1052. │ │ │ │ └── +page.svelte
  1053. │ │ │ ├── slider/
  1054. │ │ │ │ ├── en_US/
  1055. │ │ │ │ │ └── +page.svelte
  1056. │ │ │ │ └── zh_CN/
  1057. │ │ │ │ └── +page.svelte
  1058. │ │ │ ├── stepper/
  1059. │ │ │ │ ├── en_US/
  1060. │ │ │ │ │ └── +page.svelte
  1061. │ │ │ │ └── zh_CN/
  1062. │ │ │ │ └── +page.svelte
  1063. │ │ │ ├── steps/
  1064. │ │ │ │ ├── en_US/
  1065. │ │ │ │ │ ├── +page.svelte
  1066. │ │ │ │ │ ├── injCom1_en.svelte
  1067. │ │ │ │ │ └── injCom2_en.svelte
  1068. │ │ │ │ └── zh_CN/
  1069. │ │ │ │ ├── +page.svelte
  1070. │ │ │ │ ├── injCom1.svelte
  1071. │ │ │ │ └── injCom2.svelte
  1072. │ │ │ ├── swiper/
  1073. │ │ │ │ ├── en_US/
  1074. │ │ │ │ │ ├── +page.svelte
  1075. │ │ │ │ │ └── Item_en.svelte
  1076. │ │ │ │ └── zh_CN/
  1077. │ │ │ │ ├── +page.svelte
  1078. │ │ │ │ └── Item.svelte
  1079. │ │ │ ├── switch/
  1080. │ │ │ │ ├── en_US/
  1081. │ │ │ │ │ └── +page.svelte
  1082. │ │ │ │ └── zh_CN/
  1083. │ │ │ │ └── +page.svelte
  1084. │ │ │ ├── tabBar/
  1085. │ │ │ │ ├── en_US/
  1086. │ │ │ │ │ └── +page.svelte
  1087. │ │ │ │ └── zh_CN/
  1088. │ │ │ │ └── +page.svelte
  1089. │ │ │ ├── tabs/
  1090. │ │ │ │ ├── en_US/
  1091. │ │ │ │ │ └── +page.svelte
  1092. │ │ │ │ └── zh_CN/
  1093. │ │ │ │ └── +page.svelte
  1094. │ │ │ ├── timePicker/
  1095. │ │ │ │ ├── en_US/
  1096. │ │ │ │ │ └── +page.svelte
  1097. │ │ │ │ └── zh_CN/
  1098. │ │ │ │ └── +page.svelte
  1099. │ │ │ └── toast/
  1100. │ │ │ ├── en_US/
  1101. │ │ │ │ └── +page.svelte
  1102. │ │ │ └── zh_CN/
  1103. │ │ │ └── +page.svelte
  1104. │ │ ├── static/
  1105. │ │ │ ├── 404.html
  1106. │ │ │ ├── .nojekyll
  1107. │ │ │ ├── assets/
  1108. │ │ │ │ ├── images/
  1109. │ │ │ │ └── logos/
  1110. │ │ │ └── fonts/
  1111. │ │ │ └── Trueno.otf
  1112. │ │ └── .github/
  1113. │ │ └── workflows/
  1114. │ │ └── releases-demo.yml
  1115. │ └── vscode-extension/
  1116. │ ├── README.md
  1117. │ ├── CHANGELOG.md
  1118. │ ├── CHANGELOG_CN.md
  1119. │ ├── package.json
  1120. │ ├── README_CN.md
  1121. │ ├── scripts/
  1122. │ │ └── files.js
  1123. │ └── src/
  1124. │ ├── extension.js
  1125. │ └── assets/
  1126. └── .github/
  1127. ├── CONTRIBUTING.md
  1128. ├── FUNDING.yml
  1129. ├── PULL_REQUEST_TEMPLATE.md
  1130. ├── ISSUE_TEMPLATE/
  1131. │ ├── bug_report.yml
  1132. │ ├── bug_report_CN.yml
  1133. │ ├── feature_request.yml
  1134. │ └── feature_request_CN.yml
  1135. └── workflows/
  1136. ├── publish-create.yml
  1137. ├── publish-icon-0.x.yml
  1138. ├── publish-icon.yml
  1139. ├── publish-md-0.x.yml
  1140. ├── publish-md.yml
  1141. ├── publish-stdf-0.x.yml
  1142. ├── publish-stdf.yml
  1143. ├── publish-vscode-0.x.yml
  1144. ├── publish-vscode.yml
  1145. ├── releases-0.x.yml
  1146. ├── releases-site.yml
  1147. ├── releases-stdf.yml
  1148. ├── sync-demo-0.x.yml
  1149. ├── sync-demo.yml
  1150. └── sync-gitee.yml
  1151. ================================================
  1152. FILE: README.md
  1153. ================================================
  1154. <div align="center">
  1155. [![Public STDF Status](https://github.com/any-tdf/stdf/actions/workflows/publish-stdf.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-stdf.yml)
  1156. [![Releases STDF Status](https://github.com/any-tdf/stdf/actions/workflows/releases-stdf.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/releases-stdf.yml)
  1157. [![Sync Demo Status](https://github.com/any-tdf/stdf/actions/workflows/sync-demo.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/sync-demo.yml)
  1158. [![Releases Demo](https://github.com/any-tdf/demo-stdf/actions/workflows/releases-demo.yml/badge.svg)](https://github.com/any-tdf/demo-stdf/actions/workflows/releases-demo.yml)
  1159. [![Public Create Status](https://github.com/any-tdf/stdf/actions/workflows/publish-create.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-create.yml)
  1160. [![Public Icon Status](https://github.com/any-tdf/stdf/actions/workflows/publish-icon.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-icon.yml)
  1161. [![Public MD Status](https://github.com/any-tdf/stdf/actions/workflows/publish-md.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-md.yml)
  1162. [![Public VS Code Extension Status](https://github.com/any-tdf/stdf/actions/workflows/publish-vscode.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-vscode.yml)
  1163. [![Sync Gitee Status](https://github.com/any-tdf/stdf/actions/workflows/sync-gitee.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/sync-gitee.yml)
  1164. [![Releases Site](https://github.com/any-tdf/stdf/actions/workflows/releases-site.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/releases-site.yml)
  1165. <picture>
  1166. <source media="(prefers-color-scheme: dark)" srcset="https://stdf.design/assets/favicon_logo_dark/android-chrome-512x512.png">
  1167. <img src="https://stdf.design/assets/favicon_logo/android-chrome-512x512.png" alt="logo" width="120" height="auto" />
  1168. </picture>
  1169. <h1>STDF</h1>
  1170. ![](https://img.shields.io/badge/-Svelte%205-%23ff3e00?logo=svelte&logoColor=ffffff)
  1171. ![](https://img.shields.io/badge/-Tailwind%204-%2300a6f4?logo=tailwindcss&logoColor=ffffff)
  1172. ![](https://img.shields.io/badge/-TypeScript-%233178c6?logo=typescript&logoColor=ffffff)
  1173. [![npm](https://img.shields.io/npm/v/stdf?logo=npm&label=stdf&style=for-the-badge&color=aeb5f4&logoColor=DCE4FD&labelColor=010319)](https://www.npmjs.com/package/stdf)
  1174. [![npm](https://img.shields.io/npm/v/create-stdf?logo=npm&label=create&style=for-the-badge&color=ebb2ba&logoColor=FBDDDD&labelColor=190104)](https://www.npmjs.com/package/create-stdf)
  1175. [![npm](https://img.shields.io/npm/v/rollup-plugin-stdf-icon?logo=npm&label=icon&style=for-the-badge&color=8cf2be&logoColor=D5FCE3&labelColor=01190C)](https://www.npmjs.com/package/rollup-plugin-stdf-icon)
  1176. [![npm](https://img.shields.io/npm/v/rollup-plugin-md-ts?logo=npm&label=md&style=for-the-badge&color=fda0f0&logoColor=fda0f0&labelColor=12020f)](https://www.npmjs.com/package/rollup-plugin-md-ts)
  1177. [![Visual Studio Marketplace Version (including pre-releases)](https://img.shields.io/visual-studio-marketplace/v/STDF.stdf-vscode-extension?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGgKICAgICAgICBmaWxsPSIjRjBGQ0Q2IgogICAgICAgIGQ9Ik0zMC44NjUgMy40NDhMMjQuMjgyLjI4MWExLjk5IDEuOTkgMCAwIDAtMi4yNzYuMzg1TDkuMzk3IDEyLjE3MUwzLjkwMiA4LjAwNGExLjMzIDEuMzMgMCAwIDAtMS43MDMuMDczTC40MzkgOS42ODFhMS4zMyAxLjMzIDAgMCAwLS4wMDUgMS45NjlMNS4yIDE1Ljk5OUwuNDM0IDIwLjM0OGExLjMzIDEuMzMgMCAwIDAgLjAwNSAxLjk2OWwxLjc2IDEuNjA0YTEuMzMgMS4zMyAwIDAgMCAxLjcwMy4wNzNsNS40OTUtNC4xNzJsMTIuNjE1IDExLjUxYTEuOTgyIDEuOTgyIDAgMCAwIDIuMjcxLjM4NWw2LjU4OS0zLjE3MmExLjk5MyAxLjk5MyAwIDAgMCAxLjEzLTEuODAyVjUuMjQ4YzAtLjc2Ni0uNDQzLTEuNDY5LTEuMTM1LTEuODAyem0tNi44NiAxOS44MThMMTQuNDMyIDE2bDkuNTczLTcuMjY2eiIKICAgIC8+Cjwvc3ZnPgo=&label=extension&style=for-the-badge&color=c7f292&logoColor=F0FCD6&labelColor=0E1901)](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension)
  1178. [![GitHub stars](https://img.shields.io/github/stars/any-tdf/stdf?logo=github&label=star&style=for-the-badge&color=A1DAD7&logoColor=D9F8F2&labelColor=011918)](https://github.com/any-tdf/stdf)
  1179. [![GitHub license](https://img.shields.io/github/license/any-tdf/stdf?logo=github&style=for-the-badge&color=B9C46A&logoColor=F3F3CB&labelColor=161901)](https://github.com/any-tdf/stdf)
  1180. <h3>
  1181. <a href="https://github.com/any-tdf/stdf/blob/main/README_CN.md" target="_blank">简体中文</a>
  1182. <span> • </span>
  1183. <a href="https://stdf.design?lang=en_US" target="_blank">Website</a>
  1184. </h3>
  1185. </div>
  1186. # Introduction
  1187. Mobile web component library based on [Svelte](https://svelte.dev) and [Tailwind](https://www.tailwindcss.com) .
  1188. > **S**imple • **T**iny • **D**esign • **F**ast
  1189. # Features
  1190. - 🔥 Full support for Svelte v5, Tailwind CSS v4, and TypeScript.
  1191. - 🚀 No runtime, no virtual DOM — runs faster online.
  1192. - 🧰 Rich API — easily configure component styles to meet your needs.
  1193. - 🍭 Supports dark mode and multiple theme configuration.
  1194. - 📖 Provides extensive Chinese and English documentation and component examples.
  1195. - 🌍 Supports internationalization, with 60+ built-in language packages.
  1196. - 🫰 User-friendly interaction, animation parameters can be configured, and custom themes are supported.
  1197. - 🤝 Supports Tailwind libraries such as UnoCSS.
  1198. - 🫡 No third-party dependencies — no need to worry about library versions or security issues.
  1199. - 📦 Supports on-demand import to reduce bundle size.
  1200. - 🪜 Comes with a scaffolding tool for quick project creation.
  1201. - 🔗 Comes with an SVG merging plugin for quickly merging SVG files.
  1202. - 🍺 IDE plugin for quickly viewing component APIs.
  1203. # Getting Started
  1204. <!-- :::code-groups -->
  1205. <!-- pnpm -->
  1206. ```sh
  1207. pnpm create stdf
  1208. ```
  1209. <!-- :: -->
  1210. <!-- npm -->
  1211. ```sh
  1212. npm create stdf
  1213. # or
  1214. npm init stdf
  1215. # or
  1216. npx create-stdf
  1217. ```
  1218. <!-- :: -->
  1219. <!-- bun -->
  1220. ```sh
  1221. bun create stdf
  1222. ```
  1223. <!-- :: -->
  1224. <!-- yarn -->
  1225. ```sh
  1226. yarn create stdf
  1227. ```
  1228. <!-- ::: -->
  1229. # Preview Demo
  1230. Please scan the QR code to access the mobile demo:
  1231. <picture>
  1232. <source media="(prefers-color-scheme: dark)" srcset="https://stdf.design/assets/qr/demo_en_dark.png">
  1233. <img src="https://stdf.design/assets/qr/demo_en.png" width="220" height="220" >
  1234. </picture>
  1235. # Quick Try
  1236. You can quickly try STDF on StackBlitz's [STDF Demo](https://stackblitz.com/github/any-tdf/demo-stdf?startScript=dev_en).
  1237. # Feedback and Communication
  1238. We recommend using [GitHub Issues](https://github.com/any-tdf/stdf/issues) for direct and effective feedback and communication. Contributions of code are also highly appreciated. You can also choose from the following options:
  1239. - [QQ Group](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=U8ZlXJ3KVpTI9oZzs1jBnyWc3gVA0h6Y&authKey=ScWu0nU9g8BqNsC7o2eYkESwgVDVz9vzGNZEb17MrEAay9%2F7bTkXDiLJRIzo2vrg&noverify=0&group_code=581073686)
  1240. - [QQ Discord](https://pd.qq.com/s/fdd8incyr)
  1241. - [Discord](https://discord.gg/DMkHu8GGre)
  1242. - [Discussions](https://github.com/any-tdf/stdf/discussions)
  1243. # Contributors
  1244. <a href="https://github.com/any-tdf/stdf/graphs/contributors">
  1245. <img src="https://contrib.nn.ci/api?repo=any-tdf/stdf" />
  1246. </a>
  1247. # Sponsors
  1248. <a href="https://github.com/sbscan" target="_blank">
  1249. <img src="https://avatars.githubusercontent.com/sbscan" width="60" height="auto" style="border-radius:100%" >
  1250. </a>
  1251. <a href="https://github.com/MuGuiLin" target="_blank">
  1252. <img src="https://avatars.githubusercontent.com/MuGuiLin" width="60" height="auto" style='border-radius:100%' >
  1253. </a>
  1254. <a href="https://github.com/yuedanlabs" target="_blank">
  1255. <img src="https://avatars.githubusercontent.com/yuedanlabs" width="60" height="auto" style='border-radius:100%' >
  1256. </a>
  1257. # License
  1258. This project is licensed under the [MIT License](https://github.com/any-tdf/stdf/blob/main/LICENSE). Feel free to enjoy and contribute to this open-source project.
  1259. # Star History
  1260. <a href="https://github.com/any-tdf/stdf">
  1261. <picture>
  1262. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=any-tdf/stdf&type=Timeline&theme=dark" />
  1263. <img alt="Star History Chart" width="100%" src="https://api.star-history.com/svg?repos=any-tdf/stdf&type=Timeline" />
  1264. </picture>
  1265. </a>
  1266. ================================================
  1267. FILE: CODE_OF_CONDUCT.md
  1268. ================================================
  1269. # STDF Code of Conduct
  1270. Like the technical community as a whole, the STDF team and community is made up of a mixture of professionals and volunteers from all over the world, working on every aspect of the mission - including mentorship, teaching, and connecting people.
  1271. Diversity is one of our huge strengths, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This code applies equally to founders, mentors and those seeking help and guidance.
  1272. This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit in which it’s intended - a guide to make it easier to enrich all of us and the technical communities in which we participate.
  1273. This code of conduct applies to all spaces managed by the STDF project or any-tdf. This includes IRC, the mailing lists, the issue tracker, DSF events, and any other forums created by the project team which the community uses for communication. In addition, violations of this code outside these spaces may affect a person's ability to participate within them.
  1274. If you believe someone is violating the code of conduct, we ask that you report it by emailing [any_tdf@163.com](mailto:any_tdf@163.com). For more details please see our
  1275. - **Be friendly and patient.**
  1276. - **Be welcoming.** We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
  1277. - **Be considerate.** Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language.
  1278. - **Be respectful.** Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the STDF community should be respectful when dealing with other members as well as with people outside the STDF community.
  1279. - **Be careful in the words that you choose.** We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren't acceptable. This includes, but is not limited to:
  1280. - Violent threats or language directed against another person.
  1281. - Discriminatory jokes and language.
  1282. - Posting sexually explicit or violent material.
  1283. - Posting (or threatening to post) other people's personally identifying information ("doxing").
  1284. - Personal insults, especially those using racist or sexist terms.
  1285. - Unwelcome sexual attention.
  1286. - Advocating for, or encouraging, any of the above behavior.
  1287. - Repeated harassment of others. In general, if someone asks you to stop, then stop.
  1288. - **When we disagree, try to understand why.** Disagreements, both social and technical, happen all the time and STDF is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we’re different. The strength of STDF comes from its varied community, people from a wide range of backgrounds. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes.
  1289. Original text courtesy of the [Speak Up! project](http://web.archive.org/web/20141109123859/http://speakup.io/coc.html).
  1290. ## Questions?
  1291. If you have questions, please see . If that doesn't answer your questions, feel free to [contact us](mailto:any_tdf@163.com).
  1292. ================================================
  1293. FILE: LICENSE
  1294. ================================================
  1295. MIT License
  1296. Copyright (c) 2023 dufu1991
  1297. Permission is hereby granted, free of charge, to any person obtaining a copy
  1298. of this software and associated documentation files (the "Software"), to deal
  1299. in the Software without restriction, including without limitation the rights
  1300. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1301. copies of the Software, and to permit persons to whom the Software is
  1302. furnished to do so, subject to the following conditions:
  1303. The above copyright notice and this permission notice shall be included in all
  1304. copies or substantial portions of the Software.
  1305. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1306. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1307. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1308. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1309. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1310. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  1311. SOFTWARE.
  1312. ================================================
  1313. FILE: README_CN.md
  1314. ================================================
  1315. <div align="center">
  1316. [![Public STDF Status](https://github.com/any-tdf/stdf/actions/workflows/publish-stdf.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-stdf.yml)
  1317. [![Releases STDF Status](https://github.com/any-tdf/stdf/actions/workflows/releases-stdf.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/releases-stdf.yml)
  1318. [![Sync Demo Status](https://github.com/any-tdf/stdf/actions/workflows/sync-demo.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/sync-demo.yml)
  1319. [![Releases Demo](https://github.com/any-tdf/demo-stdf/actions/workflows/releases-demo.yml/badge.svg)](https://github.com/any-tdf/demo-stdf/actions/workflows/releases-demo.yml)
  1320. [![Public Create Status](https://github.com/any-tdf/stdf/actions/workflows/publish-create.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-create.yml)
  1321. [![Public Icon Status](https://github.com/any-tdf/stdf/actions/workflows/publish-icon.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-icon.yml)
  1322. [![Public MD Status](https://github.com/any-tdf/stdf/actions/workflows/publish-md.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-md.yml)
  1323. [![Public VS Code Extension Status](https://github.com/any-tdf/stdf/actions/workflows/publish-vscode.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/publish-vscode.yml)
  1324. [![Sync Gitee Status](https://github.com/any-tdf/stdf/actions/workflows/sync-gitee.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/sync-gitee.yml)
  1325. [![Releases Site](https://github.com/any-tdf/stdf/actions/workflows/releases-site.yml/badge.svg)](https://github.com/any-tdf/stdf/actions/workflows/releases-site.yml)
  1326. <picture>
  1327. <source media="(prefers-color-scheme: dark)" srcset="https://stdf.design/assets/favicon_logo_dark/android-chrome-512x512.png">
  1328. <img src="https://stdf.design/assets/favicon_logo/android-chrome-512x512.png" alt="logo" width="120" height="auto" />
  1329. </picture>
  1330. <h1>STDF</h1>
  1331. ![](https://img.shields.io/badge/-Svelte%205-%23ff3e00?logo=svelte&logoColor=ffffff)
  1332. ![](https://img.shields.io/badge/-Tailwind%204-%2300a6f4?logo=tailwindcss&logoColor=ffffff)
  1333. ![](https://img.shields.io/badge/-TypeScript-%233178c6?logo=typescript&logoColor=ffffff)
  1334. [![npm](https://img.shields.io/npm/v/stdf?logo=npm&label=stdf&style=for-the-badge&color=aeb5f4&logoColor=DCE4FD&labelColor=010319)](https://www.npmjs.com/package/stdf)
  1335. [![npm](https://img.shields.io/npm/v/create-stdf?logo=npm&label=create&style=for-the-badge&color=ebb2ba&logoColor=FBDDDD&labelColor=190104)](https://www.npmjs.com/package/create-stdf)
  1336. [![npm](https://img.shields.io/npm/v/rollup-plugin-stdf-icon?logo=npm&label=icon&style=for-the-badge&color=8cf2be&logoColor=D5FCE3&labelColor=01190C)](https://www.npmjs.com/package/rollup-plugin-stdf-icon)
  1337. [![npm](https://img.shields.io/npm/v/rollup-plugin-md-ts?logo=npm&label=md&style=for-the-badge&color=fda0f0&logoColor=fda0f0&labelColor=12020f)](https://www.npmjs.com/package/rollup-plugin-md-ts)
  1338. [![Visual Studio Marketplace Version (including pre-releases)](https://img.shields.io/visual-studio-marketplace/v/STDF.stdf-vscode-extension?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgogICAgPHBhdGgKICAgICAgICBmaWxsPSIjRjBGQ0Q2IgogICAgICAgIGQ9Ik0zMC44NjUgMy40NDhMMjQuMjgyLjI4MWExLjk5IDEuOTkgMCAwIDAtMi4yNzYuMzg1TDkuMzk3IDEyLjE3MUwzLjkwMiA4LjAwNGExLjMzIDEuMzMgMCAwIDAtMS43MDMuMDczTC40MzkgOS42ODFhMS4zMyAxLjMzIDAgMCAwLS4wMDUgMS45NjlMNS4yIDE1Ljk5OUwuNDM0IDIwLjM0OGExLjMzIDEuMzMgMCAwIDAgLjAwNSAxLjk2OWwxLjc2IDEuNjA0YTEuMzMgMS4zMyAwIDAgMCAxLjcwMy4wNzNsNS40OTUtNC4xNzJsMTIuNjE1IDExLjUxYTEuOTgyIDEuOTgyIDAgMCAwIDIuMjcxLjM4NWw2LjU4OS0zLjE3MmExLjk5MyAxLjk5MyAwIDAgMCAxLjEzLTEuODAyVjUuMjQ4YzAtLjc2Ni0uNDQzLTEuNDY5LTEuMTM1LTEuODAyem0tNi44NiAxOS44MThMMTQuNDMyIDE2bDkuNTczLTcuMjY2eiIKICAgIC8+Cjwvc3ZnPgo=&label=extension&style=for-the-badge&color=c7f292&logoColor=F0FCD6&labelColor=0E1901)](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension)
  1339. [![GitHub stars](https://img.shields.io/github/stars/any-tdf/stdf?logo=github&label=star&style=for-the-badge&color=A1DAD7&logoColor=D9F8F2&labelColor=011918)](https://github.com/any-tdf/stdf)
  1340. [![GitHub license](https://img.shields.io/github/license/any-tdf/stdf?logo=github&style=for-the-badge&color=B9C46A&logoColor=F3F3CB&labelColor=161901)](https://github.com/any-tdf/stdf)
  1341. <h3>
  1342. <a href="https://github.com/any-tdf/stdf/blob/main/README.md" target="_blank">English</a>
  1343. <span> • </span>
  1344. <a href="https://stdf.design?lang=zh_CN" target="_blank">网站</a>
  1345. </h3>
  1346. </div>
  1347. # 介绍
  1348. 基于 [Svelte](https://svelte.dev) 与 [Tailwind](https://www.tailwindcss.com) 的移动 web 组件库。
  1349. > **S**imple • **T**iny • **D**esign • **F**ast
  1350. > 简 单 • 轻 量 • 设 计 • 快 速
  1351. # 特性
  1352. - 🔥 完整支持 Svelte v5、Tailwind CSS v4 与 TypeScript。
  1353. - 🚀 无运行时,无虚拟 DOM,线上运行更快。
  1354. - 🧰 API 丰富,轻松配置出符合需求的组件样式。
  1355. - 🍭 支持暗模式与多主题配置。
  1356. - 📖 提供丰富的中英文文档和组件示例。
  1357. - 🌍 支持国际化,已内置 60+ 种语言包。
  1358. - 🫰 交互友好,动画参数可配,可自定义主题。
  1359. - 🤝 支持 Tailwind 类库,如 UnoCSS。
  1360. - 🫡 无三方依赖,无需担心三方库版本与安全问题。
  1361. - 📦 支持按需引入,减少打包体积。
  1362. - 🪜 配套脚手架,快速创建工程。
  1363. - 🔗 配套 SVG 合并插件,快速合并 SVG。
  1364. - 🍺 配套 IDE 插件,快速查看组件 API。
  1365. # 快速上手
  1366. <!-- :::code-groups -->
  1367. <!-- pnpm -->
  1368. ```sh
  1369. pnpm create stdf
  1370. ```
  1371. <!-- :: -->
  1372. <!-- npm -->
  1373. ```sh
  1374. npm create stdf
  1375. # 或
  1376. npm init stdf
  1377. # 或
  1378. npx create-stdf
  1379. ```
  1380. <!-- :: -->
  1381. <!-- bun -->
  1382. ```sh
  1383. bun create stdf
  1384. ```
  1385. <!-- :: -->
  1386. <!-- yarn -->
  1387. ```sh
  1388. yarn create stdf
  1389. ```
  1390. <!-- ::: -->
  1391. # 预览 Demo
  1392. 扫描二维码访问移动端 Demo:
  1393. <picture>
  1394. <source media="(prefers-color-scheme: dark)" srcset="https://stdf.design/assets/qr/demo_zh_dark.png">
  1395. <img src="https://stdf.design/assets/qr/demo_zh.png" width="220" height="220" >
  1396. </picture>
  1397. # 快速尝试
  1398. 可以到 StackBlitz 的 [STDF Demo](https://stackblitz.com/github/any-tdf/demo-stdf) 快速尝试 STDF。
  1399. # 反馈与交流
  1400. 推荐使用 [GitHub Issues](https://github.com/any-tdf/stdf/issues) 进行直接有效地反馈与交流,贡献代码就更好了。也可以选择以下几种方式:
  1401. - [QQ 群](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=U8ZlXJ3KVpTI9oZzs1jBnyWc3gVA0h6Y&authKey=ScWu0nU9g8BqNsC7o2eYkESwgVDVz9vzGNZEb17MrEAay9%2F7bTkXDiLJRIzo2vrg&noverify=0&group_code=581073686)
  1402. - [QQ 频道](https://pd.qq.com/s/fdd8incyr)
  1403. - [Discord](https://discord.gg/DMkHu8GGre)
  1404. - [Discussions](https://github.com/any-tdf/stdf/discussions)
  1405. # 贡献者
  1406. <a href="https://github.com/any-tdf/stdf/graphs/contributors">
  1407. <img src="https://contrib.nn.ci/api?repo=any-tdf/stdf" />
  1408. </a>
  1409. # 赞助者
  1410. <a href="https://github.com/sbscan" target="_blank">
  1411. <img src="https://avatars.githubusercontent.com/sbscan" width="60" height="auto" style="border-radius:100%" >
  1412. </a>
  1413. <a href="https://github.com/MuGuiLin" target="_blank">
  1414. <img src="https://avatars.githubusercontent.com/MuGuiLin" width="60" height="auto" style='border-radius:100%' >
  1415. </a>
  1416. <a href="https://github.com/yuedanlabs" target="_blank">
  1417. <img src="https://avatars.githubusercontent.com/yuedanlabs" width="60" height="auto" style='border-radius:100%' >
  1418. </a>
  1419. # 开源协议
  1420. 本项目基于 [MIT](https://github.com/any-tdf/stdf/blob/main/LICENSE) 协议,请自由地享受和参与开源。
  1421. # Star 历史
  1422. <a href="https://github.com/any-tdf/stdf">
  1423. <picture>
  1424. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=any-tdf/stdf&type=Timeline&theme=dark" />
  1425. <img alt="Star History Chart" width="100%" src="https://api.star-history.com/svg?repos=any-tdf/stdf&type=Timeline" />
  1426. </picture>
  1427. </a>
  1428. ================================================
  1429. FILE: SECURITY.md
  1430. ================================================
  1431. # Security Policy
  1432. ## Reporting a Vulnerability
  1433. - [QQ Group](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=U8ZlXJ3KVpTI9oZzs1jBnyWc3gVA0h6Y&authKey=ScWu0nU9g8BqNsC7o2eYkESwgVDVz9vzGNZEb17MrEAay9%2F7bTkXDiLJRIzo2vrg&noverify=0&group_code=581073686)
  1434. - [QQ Discord](https://pd.qq.com/s/fdd8incyr)
  1435. - [Discord](https://discord.gg/DMkHu8GGre)
  1436. - [Discussions](https://github.com/any-tdf/stdf/discussions)
  1437. ================================================
  1438. FILE: docs/mds/components/actionSheet/api.md
  1439. ================================================
  1440. ## ActionSheet Props
  1441. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1442. | -------------- | ----------------------------------------------------------- | --------------------------------- | ---- | ----------------------------------- |
  1443. | visible | `boolean` | `false` | N | 是否显示。 |
  1444. | title | `string` | `''` | N | 标题。 |
  1445. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | 标题对齐方式。 |
  1446. | actions | `Action[]` | `[]` | N | 菜单选项,Action Props 组成的数组。 |
  1447. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  1448. | showCancel | `boolean` | `false` | N | 是否显示取消选项。 |
  1449. | cancelText | `string` | 当前语言的 actionSheet.cancelText | N | 取消选项文本。 |
  1450. | actionClosable | `boolean` | `true` | N | 点击选项是否关闭。 |
  1451. | align | `'left'\|'center'\|'right'` | `'center'` | N | 对齐方式。 |
  1452. ## ActionSheet Events
  1453. | 名称 | 类型 | 参数 | 描述 |
  1454. | ------------- | ----------------------------------------- | --------------------------------------------- | -------------------------------------------- |
  1455. | onclose | `() => void` | - | 关闭时触发。 |
  1456. | oncancel | `() => void` | - | 点击取消时触发。 |
  1457. | onclickAction | `(index: number, action: Action) => void` | index - 点击索引值<br />action - 点击选项数据 | 点击选项时触发,即使点击选项不关闭也会触发。 |
  1458. ## Action Props
  1459. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1460. | --------- | ----------------------------------------- | ---------- | ---- | -------------- |
  1461. | content | `string` | `''` | Y | 选项内容。 |
  1462. | style | `'normal'\|'theme'\|'danger'\|'disabled'` | `'normal'` | N | 选项样式。 |
  1463. | desc | `string` | `''` | N | 选项描述。 |
  1464. | showImg | `boolean` | `false` | N | 是否显示图片。 |
  1465. | imgRadius | `'none'\|'sm'\|'full'\|'lg'` | `'full'` | N | 图片圆角。 |
  1466. | imgSrc | `string` | `''` | N | 图片地址。 |
  1467. ================================================
  1468. FILE: docs/mds/components/actionSheet/api_en.md
  1469. ================================================
  1470. ## ActionSheet Props
  1471. | Name | Type | Default | Required | Description |
  1472. | -------------- | ----------------------------------------------------------- | --------------------------------------- | -------- | -------------------------------------------- |
  1473. | visible | `boolean` | `false` | N | Whether to show the action sheet. |
  1474. | title | `string` | `''` | N | Title text. |
  1475. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | Title alignment. |
  1476. | actions | `Action[]` | `[]` | N | Menu options array composed of Action Props. |
  1477. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup layer parameters. |
  1478. | showCancel | `boolean` | `false` | N | Whether to show cancel button. |
  1479. | cancelText | `string` | Current language actionSheet.cancelText | N | Cancel button text. |
  1480. | actionClosable | `boolean` | `true` | N | Whether to close when clicking an option. |
  1481. | align | `'left'\|'center'\|'right'` | `'center'` | N | Content alignment. |
  1482. ## ActionSheet Events
  1483. | Name | Type | Parameters | Description |
  1484. | ------------- | ----------------------------------------- | ----------------------------------------------- | --------------------------------------------------------------------- |
  1485. | onclose | `() => void` | - | Triggered when closing. |
  1486. | oncancel | `() => void` | - | Triggered when clicking cancel button. |
  1487. | onclickAction | `(index: number, action: Action) => void` | index - Click index; action - Click option data | Triggered when clicking an option, even if the option does not close. |
  1488. ## Action Props
  1489. | Name | Type | Default | Required | Description |
  1490. | --------- | ----------------------------------------- | ---------- | -------- | ---------------------- |
  1491. | content | `string` | `''` | Y | Option content. |
  1492. | style | `'normal'\|'theme'\|'danger'\|'disabled'` | `'normal'` | N | Option style. |
  1493. | desc | `string` | `''` | N | Option description. |
  1494. | showImg | `boolean` | `false` | N | Whether to show image. |
  1495. | imgRadius | `'none'\|'sm'\|'full'\|'lg'` | `'full'` | N | Image border radius. |
  1496. | imgSrc | `string` | `''` | N | Image source URL. |
  1497. ================================================
  1498. FILE: docs/mds/components/actionSheet/FAQ.md
  1499. ================================================
  1500. ================================================
  1501. FILE: docs/mds/components/actionSheet/FAQ_en.md
  1502. ================================================
  1503. ================================================
  1504. FILE: docs/mds/components/actionSheet/guide.md
  1505. ================================================
  1506. ## 使用
  1507. ActionSheet 动作面板一般从页面底部弹出,提供与当前场景相关的操作动作。此操作一般不会携带数据,不用担心误触,默认不显示取消操作项,允许点击遮罩关闭。
  1508. ## 说明
  1509. ActionSheet 动作面板是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 radius 改变圆角风格。
  1510. ## actions
  1511. ActionSheet 的 actions 属性是一个数组,数组中的每一项都是一个对象,对象属性参考 Action Props。
  1512. ## Radio、ActionSheet、IndexBar、Picker、AsyncPicker 区别
  1513. Radio、Checkbox、ActionSheet、IndexBar、Picker、AsyncPicker 组件本质都是给出一系列数据,让用户进行数据选择或执行一些操作,但在使用上有一些区别:
  1514. - Radio 一般用于单选数据,数据量固定且较少,需要在 UI 界面上直接展示选项,方便用户在界面交互时对备选数据有个概览,比如性别选择。
  1515. - Checkbox 使用场景类似 Radio,但是可以多选。
  1516. - ActionSheet 一般用于选择之后立即执行一些操作,选项固定且较少,但不需要在 UI 界面上直接展示选项,比如做一些删除、修改等操作。
  1517. - IndexBar 一般用于选择单条数据,数据量非常大的动态数据,且已经对数据进行了分类索引,一般会用整个页面来展示。
  1518. - Picker 一般用于选择单条或多条数据,数据量较大或无法确定长度的动态数据,或用于一些联动数据的选择。**无论是否联动,数据在传入时已经是确定的。**
  1519. - AsyncPicker 一般用于选择多条数据,下级数据是根据上级数据动态获取的,比如服务端接口单次只返回一级数据,需要根据用户选择的一级数据再次请求接口获取下级数据。
  1520. ================================================
  1521. FILE: docs/mds/components/actionSheet/guide_en.md
  1522. ================================================
  1523. ## Usage
  1524. ActionSheet is a panel that pops up from the bottom of the page and provides operation actions related to the current scene. This operation generally does not carry data, so there is no need to worry about accidental touch. The cancel operation item is not displayed by default and clicking the mask can close it.
  1525. ## Description
  1526. ActionSheet is encapsulated based on Popup. By predefining some Props of Popup, different effects can be achieved by passing Popup's properties. For example, in the example, the radius style is changed by setting the radius of popup.
  1527. ## Actions
  1528. The actions property of ActionSheet is an array, and each item in the array is an object. The properties of the object refer to Action Props.
  1529. ## Differences between Radio, ActionSheet, IndexBar, Picker, and AsyncPicker
  1530. Radio, Checkbox, ActionSheet, IndexBar, Picker, and AsyncPicker components essentially provide a series of data for users to select or perform operations, but there are some differences in their usage:
  1531. - Radio is generally used for single selection data with fixed and small amount of options that need to be displayed directly on the UI interface, making it convenient for users to have an overview of alternative data during interface interaction, such as gender selection.
  1532. - Checkbox has similar usage scenarios to Radio, but allows multiple selections.
  1533. - ActionSheet is generally used for immediate operations after selection, with fixed and few options that don't need to be displayed directly on the UI interface, such as delete or modify operations.
  1534. - IndexBar is generally used to select a single piece of data from a very large dynamic dataset that has been categorized with indexes, usually displayed on an entire page.
  1535. - Picker is generally used to select single or multiple pieces of data from large or uncertain length dynamic datasets, or for linked data selection. **Whether linked or not, the data is determined when passed in.**
  1536. - AsyncPicker is generally used to select multiple pieces of data where lower-level data is dynamically obtained based on upper-level data, such as when a server interface only returns one level of data at a time and needs to request the interface again based on the user's first-level selection to get the next level of data.
  1537. ================================================
  1538. FILE: docs/mds/components/actionSheet/version.md
  1539. ================================================
  1540. ================================================
  1541. FILE: docs/mds/components/actionSheet/version_en.md
  1542. ================================================
  1543. ================================================
  1544. FILE: docs/mds/components/asyncPicker/api.md
  1545. ================================================
  1546. ## AsyncPicker Props
  1547. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1548. | ------------ | --------------------------------------------------------------- | --------------------------------- | ---- | ---------------------------- |
  1549. | visible | `boolean` | `false` | N | 是否显示。 |
  1550. | data | `array` | `[]` | Y | 列数据,具体使用请参考示例。 |
  1551. | lastLevel | `boolean` | `false` | N | 是否是最后一级。 |
  1552. | firstLevel | `boolean` | `false` | N | 是否是第一级。 |
  1553. | showRow | `3\|5\|7` | `5` | N | 列显示行数。 |
  1554. | labelKey | `string` | `'label'` | N | 自定义 label 的 key。 |
  1555. | align | `'left'\|'center'\|'right'` | `'center'` | N | 对齐方式。 |
  1556. | cancelText | `string` | 当前语言的 picker.defaultCancel | N | 取消选项文本。 |
  1557. | confirmText | `string` | 当前语言的 picker.defaultConfirm | N | 确定选项文本。 |
  1558. | title | `string` | 当前语言的 picker.defaultTitle | N | 中间标题文本。 |
  1559. | nextText | `string` | 当前语言的 picker.defaultNext | N | 下一级文本。 |
  1560. | prevText | `string` | 当前语言的 picker.defaultPrev | N | 上一级文本。 |
  1561. | showSelected | `boolean` | `false` | N | 是否显示已选项。 |
  1562. | selectedText | `string` | 当前语言的 picker.defaultSelected | N | 已选文本。 |
  1563. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  1564. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | 加载数据时 Loading 参数。 |
  1565. ## AsyncPicker Events
  1566. | 名称 | 类型 | 参数 | 描述 |
  1567. | --------- | ------------------------------------------ | ----------------------------------------------------------------------- | ---------------------- |
  1568. | onclose | `() => void` | - | 关闭时触发。 |
  1569. | oncancel | `() => void` | - | 点击左侧取消时触发。 |
  1570. | onprev | `() => void` | - | 点击左侧上一级时触发。 |
  1571. | onnext | `(index: number) => void` | index - 当前选定项在所在列的索引 | 点击右侧下一级时触发。 |
  1572. | onconfirm | `(items: any[], indexs: number[]) => void` | items - 选定多列数据组成的数组<br />indexs - 选定多列数据索引组成的数组 | 点击右侧确定时触发。 |
  1573. ================================================
  1574. FILE: docs/mds/components/asyncPicker/api_en.md
  1575. ================================================
  1576. ## AsyncPicker Props
  1577. | Name | Type | Default | Required | Description |
  1578. | ------------ | --------------------------------------------------------------- | --------------------------------------- | -------- | --------------------------------------------------------- |
  1579. | visible | `boolean` | `false` | N | Whether to show the picker. |
  1580. | data | `array` | `[]` | Y | Column data. Please refer to examples for specific usage. |
  1581. | lastLevel | `boolean` | `false` | N | Whether it is the last level. |
  1582. | firstLevel | `boolean` | `false` | N | Whether it is the first level. |
  1583. | showRow | `3\|5\|7` | `5` | N | Number of rows to display in the column. |
  1584. | labelKey | `string` | `'label'` | N | Custom key for label. |
  1585. | align | `'left' \| 'center' \| 'right'` | `'center'` | N | Text alignment. |
  1586. | cancelText | `string` | Current language picker.defaultCancel | N | Cancel button text. |
  1587. | confirmText | `string` | Current language picker.defaultConfirm | N | Confirm button text. |
  1588. | title | `string` | Current language picker.defaultTitle | N | Title text. |
  1589. | nextText | `string` | Current language picker.defaultNext | N | Next level text. |
  1590. | prevText | `string` | Current language picker.defaultPrev | N | Previous level text. |
  1591. | showSelected | `boolean` | `false` | N | Whether to show selected items. |
  1592. | selectedText | `string` | Current language picker.defaultSelected | N | Selected text. |
  1593. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  1594. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | Loading parameters when loading data. |
  1595. ## AsyncPicker Events
  1596. | Name | Type | Parameters | Description |
  1597. | --------- | ------------------------------------------ | ----------------------------------------------------------------------------- | --------------------------------------- |
  1598. | onclose | `() => void` | - | Triggered when closing. |
  1599. | oncancel | `() => void` | - | Triggered when clicking cancel. |
  1600. | onprev | `() => void` | - | Triggered when clicking previous level. |
  1601. | onnext | `(index: number) => void` | index - Index of selected item in current column | Triggered when clicking next level. |
  1602. | onconfirm | `(items: any[], indexs: number[]) => void` | items - Array of selected column data<br />indexs - Array of selected indexes | Triggered when clicking confirm. |
  1603. ================================================
  1604. FILE: docs/mds/components/asyncPicker/FAQ.md
  1605. ================================================
  1606. ================================================
  1607. FILE: docs/mds/components/asyncPicker/FAQ_en.md
  1608. ================================================
  1609. ================================================
  1610. FILE: docs/mds/components/asyncPicker/guide.md
  1611. ================================================
  1612. ## 使用场景
  1613. AsyncPicker 组件使用场景类似于 Picker 多级联动,是为了解决下级数据根据上级数据从服务端查询的情况。例如:选择省级数据后,动态查询对应的市级数据,再选择市级数据后,动态查询对应的区级数据,以此类推。
  1614. ## 使用方式
  1615. AsyncPicker 的使用对比 Picker 多级联动稍微有些复杂,因为数据不是一次性传入,而是通过接口动态获取,所以需要开发者自己处理数据。
  1616. 通过监听 onnext 和 onprev 方法,更新当前列的新数据 data 并动态绑定至组件内部,同时需要动态绑定当前列是否是第一级 lastLevel,是否是最后一级 firstLevel。
  1617. 当数据是最后一级时,右侧按钮会触发 onconfirm 方法,返回选定的数据;当数据不是最后一级时,右侧按钮会触发 onnext 方法,返回当前选定项的索引值。
  1618. ## 返回数据
  1619. AsyncPicker 组件最终返回的数据有两项,一项是选定的多列数据组成的数组 items,另一项是选定的多列数据的索引组成的数组 indexs,请按照需求选择使用。
  1620. 其中 items 每一项的数据结构与传入的数据结构一致,也方便开发者直接使用。
  1621. ## 使用优化
  1622. 实际开发中,多数情况下 AsyncPicker 的数据都是动态获取的,通常是通过接口获取,一般我们需要对传入的数据进行循环处理,以便于 AsyncPicker 组件能够正常使用。但这是一个比较繁琐且没必要的过程,因此 STDF 对 AsyncPicker 组件的入参做了一些优化,使得开发者可以直接传入接口返回的数据,而不需要做循环处理。
  1623. - 可以通过动态绑定每次数据的 labelKey,自定义传入的每列数据 label 属性名,如果不传入则默认使用 'label',请参考示例。
  1624. ## 说明
  1625. AsyncPicker 是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 radius 改变圆角风格。
  1626. AsyncPicker 内加载数据时显示的 loading 是在 Loading 组件基础上封装的,可以通过传入 Loading 的属性来实现不同的效果。比如示例中通过设置 loading 的一些参数换了一个 loading 效果。
  1627. ## Radio、ActionSheet、IndexBar、Picker、AsyncPicker 区别
  1628. Radio、Checkbox、ActionSheet、IndexBar、Picker、AsyncPicker 组件本质都是给出一系列数据,让用户进行数据选择或执行一些操作,但在使用上有一些区别:
  1629. - Radio 一般用于单选数据,数据量固定且较少,需要在 UI 界面上直接展示选项,方便用户在界面交互时对备选数据有个概览,比如性别选择。
  1630. - Checkbox 使用场景类似 Radio,但是可以多选。
  1631. - ActionSheet 一般用于选择之后立即执行一些操作,选项固定且较少,但不需要在 UI 界面上直接展示选项,比如做一些删除、修改等操作。
  1632. - IndexBar 一般用于选择单条数据,数据量非常大的动态数据,且已经对数据进行了分类索引,一般会用整个页面来展示。
  1633. - Picker 一般用于选择单条或多条数据,数据量较大或无法确定长度的动态数据,或用于一些联动数据的选择。**无论是否联动,数据在传入时已经是确定的。**
  1634. - AsyncPicker 一般用于选择多条数据,下级数据是根据上级数据动态获取的,比如服务端接口单次只返回一级数据,需要根据用户选择的一级数据再次请求接口获取下级数据。
  1635. ================================================
  1636. FILE: docs/mds/components/asyncPicker/guide_en.md
  1637. ================================================
  1638. ## Usage Scenarios
  1639. The AsyncPicker component is similar to Picker's multi-level linkage, but it's designed to handle scenarios where child-level data needs to be queried from the server based on parent-level selections. For example: after selecting province-level data, dynamically query corresponding city-level data, and after selecting city-level data, dynamically query corresponding district-level data, and so on.
  1640. ## How to Use
  1641. Using AsyncPicker is slightly more complex compared to Picker's multi-level linkage because the data isn't passed in all at once but is obtained dynamically through APIs. Therefore, developers need to handle the data themselves.
  1642. By monitoring the onnext and onprev methods, update the current column's new data and dynamically bind it to the component internally. Additionally, you need to dynamically bind whether the current column is the first level (lastLevel) or the last level (firstLevel).
  1643. When the data is at the last level, the right button will trigger the onconfirm method, returning the selected data; when the data is not at the last level, the right button will trigger the onnext method, returning the index of the current selection.
  1644. ## Return Data
  1645. The AsyncPicker component ultimately returns two items: an array of items containing the selected multi-column data, and an array of indexs containing the indices of the selected multi-column data. Please choose according to your needs.
  1646. The structure of each item in items matches the structure of the input data, making it convenient for developers to use directly.
  1647. ## Usage Optimization
  1648. In actual development, AsyncPicker data is usually obtained dynamically, typically through APIs. Generally, we need to process the input data through loops to make it work with the AsyncPicker component. However, this is a cumbersome and unnecessary process. Therefore, STDF has optimized the AsyncPicker component's input parameters, allowing developers to directly pass in API response data without loop processing.
  1649. - You can dynamically bind labelKey for each data set to customize the label property name for each column's data. If not provided, it defaults to 'label'. Please refer to the examples.
  1650. ## Notes
  1651. AsyncPicker is built on top of Popup by pre-defining some Popup Props. Therefore, different effects can be achieved by passing in Popup properties. For example, in the demo, the border radius style is changed by setting the popup's radius.
  1652. The loading display in AsyncPicker during data loading is built on top of the Loading component. Different effects can be achieved by passing in Loading properties. For example, in the demo, a different loading effect is achieved by setting some loading parameters.
  1653. ## Differences between Radio, ActionSheet, IndexBar, Picker, and AsyncPicker
  1654. Radio, Checkbox, ActionSheet, IndexBar, Picker, and AsyncPicker components essentially all provide a series of data for users to select or perform operations, but there are some differences in their usage:
  1655. - Radio is generally used for single-selection data with fixed and fewer options, requiring direct display of options in the UI interface for users to have an overview during interaction, such as gender selection.
  1656. - Checkbox is similar to Radio in usage scenarios but allows multiple selections.
  1657. - ActionSheet is generally used when immediate actions need to be executed after selection, with fixed and fewer options, but doesn't need to display options directly in the UI interface, such as delete or modify operations.
  1658. - IndexBar is generally used for selecting single data items from very large dynamic datasets that have been categorized with indexes, typically using an entire page for display.
  1659. - Picker is generally used for selecting single or multiple data items from large or variable-length dynamic datasets, or for selecting linked data. **Whether linked or not, the data is determined when passed in.**
  1660. - AsyncPicker is generally used for selecting multiple data items where child-level data is dynamically obtained based on parent-level selections, such as when server APIs return only one level of data at a time and require additional requests based on user selections to obtain child-level data.
  1661. ================================================
  1662. FILE: docs/mds/components/asyncPicker/version.md
  1663. ================================================
  1664. ================================================
  1665. FILE: docs/mds/components/asyncPicker/version_en.md
  1666. ================================================
  1667. ================================================
  1668. FILE: docs/mds/components/avatar/api.md
  1669. ================================================
  1670. ## Avatar Props
  1671. | 属性 | 类型 | 默认值 | 必传 | 说明 |
  1672. | -------- | --------------------------------------------------------- | -------- | ---- | -------------------- |
  1673. | image | `string` | `''` | N | 图片路径。 |
  1674. | alt | `string` | `''` | N | 替换文本,建议单字。 |
  1675. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | 替换图标。 |
  1676. | altSize | `'xs'\|'sm'\|'md'\|'lg'\|'xl'` | `'md'` | N | 替换文本大小。 |
  1677. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  1678. | size | `'xs'\|'sm'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'` | `'md'` | N | 头像框大小。 |
  1679. | imgSize | `'s'\|'m'\|'l'` | `'l'` | N | 头像图片大小。 |
  1680. | line | `'none'\|'solid'\|'dashed'\|'dotted'` | `'none'` | N | 边框风格。 |
  1681. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  1682. ## Avatar Events
  1683. | 名称 | 类型 | 参数 | 描述 |
  1684. | ------- | ------------ | ---- | ---------- |
  1685. | onclick | `() => void` | - | 点击触发。 |
  1686. ## Avatars Props
  1687. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1688. | --------- | ------------------------------------------------------------------------------------------- | --------- | ---- | -------------------------------- |
  1689. | data | `Avatar[]` | `[]` | N | 由 Avatar Props 组成的头像数据。 |
  1690. | radius | `'none'\|'base'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'full'` | N | 圆角风格。 |
  1691. | size | `'xs'\|'sm'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'` | `'md'` | N | 头像框大小。 |
  1692. | compact | `number` | `5` | N | 紧凑程度,越大越紧凑。 |
  1693. | lineWidth | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'3'` | N | 边框粗细。 |
  1694. | reverse | `boolean` | `false` | N | 是否反向。 |
  1695. | max | `number` | `10` | N | 最大最大显示数量。 |
  1696. | top | `'totle'\|'add'\|null`\|[`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | `'totle'` | N | 顶层内容。 |
  1697. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  1698. ## Avatars Events
  1699. | 名称 | 类型 | 参数 | 描述 |
  1700. | ------- | ------------ | ---- | ---------------- |
  1701. | onclick | `() => void` | - | 点击头像组触发。 |
  1702. ================================================
  1703. FILE: docs/mds/components/avatar/api_en.md
  1704. ================================================
  1705. ## Avatar Props
  1706. | Property | Type | Default | Required | Description |
  1707. | -------- | --------------------------------------------------------- | -------- | -------- | ---------------------------------- |
  1708. | image | `string` | `''` | N | Image path. |
  1709. | alt | `string` | `''` | N | Alt text, single char recommended. |
  1710. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | Alternative icon. |
  1711. | altSize | `'xs'\|'sm'\|'md'\|'lg'\|'xl'` | `'md'` | N | Alt text size. |
  1712. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | Border radius style. |
  1713. | size | `'xs'\|'sm'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'` | `'md'` | N | Avatar frame size. |
  1714. | imgSize | `'s'\|'m'\|'l'` | `'l'` | N | Avatar image size. |
  1715. | line | `'none'\|'solid'\|'dashed'\|'dotted'` | `'none'` | N | Border style. |
  1716. | injClass | `string` | `''` | N | Injected CSS class name. |
  1717. ## Avatar Events
  1718. | Name | Type | Params | Description |
  1719. | ------- | ------------ | ------ | ------------------- |
  1720. | onclick | `() => void` | - | Triggered on click. |
  1721. ## Avatars Props
  1722. | Name | Type | Default | Required | Description |
  1723. | --------- | ------------------------------------------------------------------------------------------- | --------- | -------- | --------------------------------------------- |
  1724. | data | `Avatar[]` | `[]` | N | Array of Avatar Props data. |
  1725. | radius | `'none'\|'base'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'full'` | N | Border radius style. |
  1726. | size | `'xs'\|'sm'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'` | `'md'` | N | Avatar frame size. |
  1727. | compact | `number` | `5` | N | Compactness level, higher means more compact. |
  1728. | lineWidth | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'3'` | N | Border width. |
  1729. | reverse | `boolean` | `false` | N | Whether to reverse the order. |
  1730. | max | `number` | `10` | N | Maximum number of avatars to display. |
  1731. | top | `'totle'\|'add'\|null`\|[`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | `'totle'` | N | Top layer content. |
  1732. | injClass | `string` | `''` | N | Injected CSS class name. |
  1733. ## Avatars Events
  1734. | Name | Type | Params | Description |
  1735. | ------- | ------------ | ------ | ------------------------------------ |
  1736. | onclick | `() => void` | - | Triggered when avatar group clicked. |
  1737. ================================================
  1738. FILE: docs/mds/components/avatar/FAQ.md
  1739. ================================================
  1740. ================================================
  1741. FILE: docs/mds/components/avatar/FAQ_en.md
  1742. ================================================
  1743. ================================================
  1744. FILE: docs/mds/components/avatar/guide.md
  1745. ================================================
  1746. > Avatar 使用了图标 ri-user-3-line 和 ri-user-add-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  1747. ## 内容说明
  1748. image 可以传入图片的相对路径或绝对路径,组件内部将其转换为 img 标签的 src 属性;alt 传入文字将直接显示;icon 传入 Icon Props 将使用 Icon 组件渲染头像框内容,请参考 Icon API;若 image、alt、icon 都不传,Avatar 组件会默认使用 Icon 组件显示一个用户图标。
  1749. 内容的可配置性结合其他对于样式调整的参数,Avatar 组件不仅仅适用于头像这一种业务场景了,请灵活使用。
  1750. ## 内容优先级
  1751. image > alt > icon。
  1752. ## imgSize
  1753. 此参数决定头像框内部的图片占整个头像框的比例,三个档位 s、m、l 分别对应 1/3、2/3、铺满。多数业务场景都是铺满使用的,但是有些界面设计要求使用 png 格式图片,此时可能需要使用此参数调整使页面有呼吸感。
  1754. ## injClass
  1755. 通过 injClass 参数可以向组件内部 button 元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义背景色和边框颜色。
  1756. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  1757. ## 头像组
  1758. v0.4.0 开始支持头像组,头像组的使用场景是在头像框内部显示多个头像,例如群聊头像、评论头像等。传入由 Avatar Props 组成的数组即可,头像组有自己的 Props 用于控制不同样式。
  1759. 默认顶层显示头像总数,可通过 top 参数控制顶层显示内容,可选值有 totle(显示头像总数)、add(新增头像 Icon)、null(不显示)、Snippet(自定义顶层内容)。
  1760. 头像组 Props 自己也有一个 injClass,可为头像组注入 Class 名称,一般用于当默认边框颜色与背景色不统一时传入传入 ring 的颜色使其统一。
  1761. ================================================
  1762. FILE: docs/mds/components/avatar/guide_en.md
  1763. ================================================
  1764. > Avatar uses icons ri-user-3-line and ri-user-add-line. Please ensure these icons are included in your project's symbol.svg file. For detailed information, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  1765. ## Content Description
  1766. image accepts relative or absolute image paths, which will be converted to the src attribute of an img tag internally; alt displays the input text directly; icon accepts Icon Props to render avatar content using the Icon component, please refer to Icon API; if image, alt, and icon are not provided, the Avatar component will display a default user icon using the Icon component.
  1767. With the configurability of content combined with other style adjustment parameters, the Avatar component is not limited to just avatar scenarios - please use it flexibly.
  1768. ## Content Priority
  1769. image > alt > icon.
  1770. ## imgSize
  1771. This parameter determines the ratio of the internal image to the entire avatar frame. The three levels s, m, l correspond to 1/3, 2/3, and full coverage respectively. Most business scenarios use full coverage, but some interface designs require PNG format images, in which case this parameter may need to be adjusted to give the page a sense of breathing space.
  1772. ## injClass
  1773. The injClass parameter allows injecting CSS class names (not limited to Tailwind CSS) into the component's internal button element, enabling more customization possibilities for component styles. The example demonstrates custom background color and border color through injClass.
  1774. If the injected class doesn't take effect, please add "!" before the class name. Refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  1775. ## Avatar Group
  1776. Starting from v0.4.0, avatar groups are supported. Avatar groups are used to display multiple avatars within an avatar frame, such as group chat avatars or comment avatars. Simply pass in an array composed of Avatar Props, and the avatar group has its own Props to control different styles.
  1777. By default, the top layer displays the total number of avatars. The top parameter can control the top layer content, with options including totle (display total avatar count), add (add avatar Icon), null (no display), and Snippet (custom top layer content).
  1778. Avatar group Props also has its own injClass, which can inject Class names for the avatar group, typically used to unify the ring color when the default border color doesn't match the background color.
  1779. ================================================
  1780. FILE: docs/mds/components/avatar/version.md
  1781. ================================================
  1782. ## 0.5.1
  1783. - [!tag|B|3|]修复未传入 altSizeObj 时的默认值问题。
  1784. ## 0.4.0
  1785. - [!tag|A|0|]新增头像组用法。
  1786. ================================================
  1787. FILE: docs/mds/components/avatar/version_en.md
  1788. ================================================
  1789. ## 0.5.1
  1790. - [!tag|B|3|] Fix the problem of default values when altSizeObj is not passed in.
  1791. ## 0.4.0
  1792. - [!tag|A|0|] Add avatar component.
  1793. ================================================
  1794. FILE: docs/mds/components/badge/api.md
  1795. ================================================
  1796. ## Badge Props
  1797. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1798. | -------- | ------------------------------ | -------- | ---- | -------------------------------------------- |
  1799. | text | `string` | `''` | N | 徽标文案。 |
  1800. | radius | `'full'\|'sm'\|'none'\|'leaf'` | `'full'` | N | 圆角风格。 |
  1801. | isLeft | `boolean` | `false` | N | 是否位于左侧(仅 isInner 为 false 时生效)。 |
  1802. | isShow | `boolean` | `true` | N | 是否显示。 |
  1803. | offsetY | `number` | `0` | N | 上下偏移量(仅 isInner 为 false 时生效)。 |
  1804. | offsetX | `number` | `0` | N | 左右偏移量(仅 isInner 为 false 时生效)。 |
  1805. | isInner | `boolean` | `false` | N | 是否位于内部。 |
  1806. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  1807. ## Badge Snippets
  1808. | 名称 | 类型 | 参数 | 说明 |
  1809. | -------- | ------------------------------------------------------------------- | ---- | ------------------------------------------------ |
  1810. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | `isInner` 为 false 时作为 Badge 相对位置的内容。 |
  1811. ================================================
  1812. FILE: docs/mds/components/badge/api_en.md
  1813. ================================================
  1814. ## Badge Props
  1815. | Name | Type | Default | Required | Description |
  1816. | -------- | ------------------------------ | -------- | -------- | ------------------------------------------------------------------- |
  1817. | text | `string` | `''` | N | Badge text content. |
  1818. | radius | `'full'\|'sm'\|'none'\|'leaf'` | `'full'` | N | Border radius style. |
  1819. | isLeft | `boolean` | `false` | N | Whether to position on the left (only works when isInner is false). |
  1820. | isShow | `boolean` | `true` | N | Whether to show the badge. |
  1821. | offsetY | `number` | `0` | N | Vertical offset (only works when isInner is false). |
  1822. | offsetX | `number` | `0` | N | Horizontal offset (only works when isInner is false). |
  1823. | isInner | `boolean` | `false` | N | Whether to position inside. |
  1824. | injClass | `string` | `''` | N | Injected CSS class name. |
  1825. ## Badge Snippets
  1826. | Name | Type | Params | Description |
  1827. | -------- | ------------------------------------------------------------------- | ------ | ------------------------------------------------------- |
  1828. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Content for relative positioning when isInner is false. |
  1829. ================================================
  1830. FILE: docs/mds/components/badge/FAQ.md
  1831. ================================================
  1832. ================================================
  1833. FILE: docs/mds/components/badge/FAQ_en.md
  1834. ================================================
  1835. ================================================
  1836. FILE: docs/mds/components/badge/guide.md
  1837. ================================================
  1838. ## 搭配使用
  1839. Badge 组件一般位于内容的右上角,所以常规使用时请将主体内容作为默认 Snippet 传入。同时 Badge 是相对于主体内容定位的,所以不会影响主体内容的布局。
  1840. 但是一些特殊组件如 Cell,Badge 有可能位于组件内部指定位置,这时候可以使用 `isInner` 属性将 Badge 作为内部元素,放置位置由组件内部决定,请参考示例。
  1841. ## offsetY 与 offsetX
  1842. Badge 组件默认位置是相对于主体内容右上角,左右和上下偏移量分别是 Badge 自身宽高的一半,但是由于内部内容的不确定性和复杂性,offsetY 与 offsetX 可以用来在原本基础上再调整 Badge 的位置,使其满足更多的需求。
  1843. ## 叶形圆角
  1844. 当 radius 为 `'leaf'` 时,Badge 圆角风格为叶形,同时叶形方向会与当前位置关联。
  1845. ## CSS 注入
  1846. 通过 injClass 参数可以向 Badge 组件内部注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义背景色与边框。
  1847. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  1848. ================================================
  1849. FILE: docs/mds/components/badge/guide_en.md
  1850. ================================================
  1851. ## Usage
  1852. The `Badge` component is usually placed in the upper right corner of the content, so when used conventionally, please pass the main content as the default Snippet. Since the `Badge` is positioned relative to the main content, it will not affect the layout of the main content.
  1853. However, for some special components, such as `Cell`, the `Badge` may be placed in a specific position within the component. In this case, you can use the `isInner` attribute to position the `Badge` as an inner element, with the placement determined by the component itself. See the example for reference.
  1854. ## `offsetY` and `offsetX`
  1855. By default, the `Badge` component is positioned relative to the upper right corner of the main content, and the left and top offsets are half the width and height of the `Badge`, respectively. However, due to the uncertainty and complexity of the internal content, `offsetY` and `offsetX` can be used to adjust the position of the `Badge` based on the original position, in order to meet more requirements.
  1856. ## Leaf-shaped Corner Radius
  1857. When `radius` is set to `'leaf'`, the corner style of the `Badge` is leaf-shaped, and the direction of the leaves is associated with the current position.
  1858. ## Injecting CSS
  1859. The `injClass` parameter can be used to inject custom CSS class names (not limited to Tailwind CSS) into the `Badge` component, which allows for further customization of the component's appearance. For example, the example uses `injClass` to customize the background color and border of the `Badge`.
  1860. If the injected class name does not take effect, add a `!` before the class name, as demonstrated in the [Tailwind Important Modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  1861. ================================================
  1862. FILE: docs/mds/components/badge/version.md
  1863. ================================================
  1864. ================================================
  1865. FILE: docs/mds/components/badge/version_en.md
  1866. ================================================
  1867. ================================================
  1868. FILE: docs/mds/components/bottomSheet/api.md
  1869. ================================================
  1870. ## BottomSheet Props
  1871. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1872. | --------------- | --------------------------------------------------------- | ---------------------------- | ---- | ---------------------------------- |
  1873. | visible | `boolean` | `false` | N | 是否显示。 |
  1874. | title | `string` | 当前语言的 bottomSheet.title | N | 标题。 |
  1875. | titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | 标题对齐方式。 |
  1876. | showBackIcon | `boolean` | `false` | N | 是否显示返回图标。 |
  1877. | closeContent | `'downIcon'\|'closeIcon'\|''\|string` | `'downIcon'` | N | 关闭区域内容。 |
  1878. | showDivider | `boolean` | `true` | N | 是否显示分割线。 |
  1879. | duration | `number` | `450` | N | 过渡动画出现时间,单位:ms。 |
  1880. | outDuration | `number` | `240` | N | 过渡动画退出时间,单位:ms。 |
  1881. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | 遮罩层参数。 |
  1882. | maskClosable | `boolean` | `false` | N | 点击遮罩层是否关闭。 |
  1883. | zIndex | `number` | `600` | N | z-index。 |
  1884. | stayHeightList | `number[]` | `[10, 50, 90]` | N | 固定高度列表。 |
  1885. | stayHeightIndex | `number` | `1` | N | 初始固定高度索引。 |
  1886. | closeHeight | `number` | `0` | N | 滑动结束时位置低于此高度自动关闭。 |
  1887. | radius | `'none'\|'middle'\|'full'` | `'full'` | N | 圆角风格。 |
  1888. ## BottomSheet Events
  1889. | 名称 | 类型 | 参数 | 描述 |
  1890. | -------------- | -------------------------- | ------------------- | --------------------------------------------------------- |
  1891. | onclose | `() => void` | - | 浮窗关闭时触发。 |
  1892. | onclickMask | `() => void` | - | 点击浮窗遮罩时触发,即使 maskClosable 为 false 也会触发。 |
  1893. | onback | `() => void` | - | 点击左侧返回图标时触发。 |
  1894. | onheightChange | `(height: number) => void` | height - 当前高度。 | 滑动结束时触发。 |
  1895. ## BottomSheet Snippets
  1896. | 名称 | 类型 | 参数 | 说明 |
  1897. | -------- | ------------------------------------------------------------------- | ---- | ------ |
  1898. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 内容。 |
  1899. ================================================
  1900. FILE: docs/mds/components/bottomSheet/api_en.md
  1901. ================================================
  1902. ## BottomSheet Props
  1903. | Name | Type | Default | Required | Description |
  1904. | --------------- | --------------------------------------------------------- | ------------------------------ | -------- | ---------------------------------------------------------------------- |
  1905. | visible | `boolean` | `false` | N | Whether to display. |
  1906. | title | `string` | Current lang bottomSheet.title | N | Title. |
  1907. | titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | Title alignment. |
  1908. | showBackIcon | `boolean` | `false` | N | Whether to show back icon. |
  1909. | closeContent | `'downIcon'\|'closeIcon'\|''\|string` | `'downIcon'` | N | Close area content. |
  1910. | showDivider | `boolean` | `true` | N | Whether to show divider. |
  1911. | duration | `number` | `450` | N | Transition animation appear time, unit: ms. |
  1912. | outDuration | `number` | `240` | N | Transition animation exit time, unit: ms. |
  1913. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | Mask parameters. |
  1914. | maskClosable | `boolean` | `false` | N | Whether to close when clicking mask. |
  1915. | zIndex | `number` | `600` | N | z-index. |
  1916. | stayHeightList | `number[]` | `[10, 50, 90]` | N | Fixed height list. |
  1917. | stayHeightIndex | `number` | `1` | N | Initial fixed height index. |
  1918. | closeHeight | `number` | `0` | N | Auto close when position is lower than this height after sliding ends. |
  1919. | radius | `'none'\|'middle'\|'full'` | `'full'` | N | Border radius style. |
  1920. ## BottomSheet Events
  1921. | Name | Type | Parameters | Description |
  1922. | -------------- | -------------------------- | ----------------------- | ------------------------------------------------------------ |
  1923. | onclose | `() => void` | - | Triggered when popup closes. |
  1924. | onclickMask | `() => void` | - | Triggered when clicking mask, even if maskClosable is false. |
  1925. | onback | `() => void` | - | Triggered when clicking left back icon. |
  1926. | onheightChange | `(height: number) => void` | height - Current height | Triggered when sliding ends. |
  1927. ## BottomSheet Snippets
  1928. | Name | Type | Parameters | Description |
  1929. | -------- | ------------------------------------------------------------------- | ---------- | -------------------- |
  1930. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | BottomSheet content. |
  1931. ================================================
  1932. FILE: docs/mds/components/bottomSheet/FAQ.md
  1933. ================================================
  1934. ================================================
  1935. FILE: docs/mds/components/bottomSheet/FAQ_en.md
  1936. ================================================
  1937. ================================================
  1938. FILE: docs/mds/components/bottomSheet/guide.md
  1939. ================================================
  1940. ## BottomSheet 与 Popup
  1941. 在 STDF 的设计思路内,BottomSheet 与 Popup 都属于界面内的浮动交互,一般用于页面内的二级操作场景,在组件使用上有一些相似之处。**但弹出层 Popup 是「层」的概念,而底部浮窗 BottomSheet 是「窗」的概念**。
  1942. Popup 作为弹出层,内部一般不宜做比较复杂步骤的交互,默认点击遮罩层就可以关闭,但可以自定义弹出的位置、大小、过渡动画、方向、样式等多项参数。**重样式轻逻辑。**
  1943. BottomSheet 作为底部浮窗,就只能从底部弹出。「浮」体现在可以通过滑动其内部的头部区域来控制其固定高度;而「窗」区别于「层」的是,BottomSheet 有自己的头部区域,可以自定义头部内容,并派发出关闭、返回、滑动等类似窗口交互的事件,可以用于一些相对复杂的交互场景,默认点击遮罩不可关闭。**重逻辑轻样式。**
  1944. ## 固定高度
  1945. BottomSheet 的高度由 stayHeightList 决定,stayHeightList 是由多个 0-100 正整数组成的数组,将 BottomSheet 在页面上的显示高度按照页面高度百分比划分成几个档位,当滑动停止时,BottomSheet 会自动停留在最接近的一个档位高度。stayHeightIndex 表示初始固定高度索引,结合 stayHeightList 决定 BottomSheet 的初始高度。
  1946. ## 滑动关闭
  1947. 当滑动结束时 BottomSheet 位置相对于页面高度的百分比数值低于 closeHeight 时 BottomSheet 将自动关闭。closeHeight 默认为 0,即不允许滑动关闭。
  1948. ## 事件
  1949. BottomSheet 支持通过 onclose/onback/onheightChange 来监听关闭、返回、固定高度变化事件,而 onclickMask 事件则是点击遮罩层时触发,即使 maskClosable 为 false 也会触发。
  1950. ================================================
  1951. FILE: docs/mds/components/bottomSheet/guide_en.md
  1952. ================================================
  1953. ## BottomSheet and Popup
  1954. In STDF's design philosophy, both BottomSheet and Popup are floating interactions within the interface, generally used for secondary operation scenarios on the page, and share some similarities in component usage. **However, Popup is a concept of "layer", while BottomSheet is a concept of "window"**.
  1955. As a popup layer, Popup generally should not involve complex interaction steps. By default, clicking the mask layer can close it, but you can customize parameters such as popup position, size, transition animation, direction, and style. **Emphasizes style over logic.**
  1956. As a bottom window, BottomSheet can only pop up from the bottom. The "floating" aspect is reflected in the ability to control its fixed height by sliding its internal header area. The difference between a "window" and a "layer" is that BottomSheet has its own header area, which can be customized with content and dispatches events like close, back, and slide similar to window interactions. It can be used for relatively complex interaction scenarios, and by default, clicking the mask cannot close it. **Emphasizes logic over style.**
  1957. ## Fixed Height
  1958. The height of BottomSheet is determined by stayHeightList, which is an array of integers between 0-100. It divides the display height of BottomSheet on the page into several levels based on page height percentage. When sliding stops, BottomSheet will automatically stay at the closest level height. stayHeightIndex indicates the initial fixed height index, which, combined with stayHeightList, determines the initial height of BottomSheet.
  1959. ## Slide to Close
  1960. When sliding ends, if BottomSheet's position relative to the page height percentage is lower than closeHeight, BottomSheet will automatically close. closeHeight defaults to 0, meaning sliding to close is not allowed.
  1961. ## Events
  1962. BottomSheet supports monitoring close, back, and fixed height change events through onclose/onback/onheightChange, while the onclickMask event is triggered when clicking the mask layer, even if maskClosable is false.
  1963. ================================================
  1964. FILE: docs/mds/components/bottomSheet/version.md
  1965. ================================================
  1966. ## 0.5.1
  1967. - [!tag|O|0|]优化滑动动画效果。关联 [PR](https://github.com/any-tdf/stdf/pull/31)。[!contribute|mrlovables|]
  1968. ================================================
  1969. FILE: docs/mds/components/bottomSheet/version_en.md
  1970. ================================================
  1971. ## 0.5.1
  1972. - [!tag|O|0|] Optimize the sliding animation effect. Related [PR](https://github.com/any-tdf/stdf/pull/31). [!contribute|mrlovables|]
  1973. ================================================
  1974. FILE: docs/mds/components/button/api.md
  1975. ================================================
  1976. ## Button Props
  1977. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  1978. | --------------- | ----------------------------------------------------------------------------- | --------- | ---- | ------------------------------ |
  1979. | fill | `'base'\|'line'\|'lineLight'\|'lineTheme'\|'text'\|'textTheme'\|'colorLight'` | `'base'` | N | 填充模式。 |
  1980. | state | `'theme'\|'success'\|'warning'\|'error'\|'info'` | `'theme'` | N | 状态色,theme 表示跟随主题色。 |
  1981. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  1982. | size | `'full'\|'big'\|'md'\|'sm'\|'auto'` | `'big'` | N | 尺寸。 |
  1983. | line | `'solid'\|'dashed'\|'dotted'` | `'solid'` | N | 边框风格。 |
  1984. | heightOut | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | 按钮外部高度。 |
  1985. | heightIn | `'0'\|'1'\|'2'\|'3'\|'4'` | `'3'` | N | 按钮高度。 |
  1986. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  1987. | love | `boolean` | `false` | N | 是否开启关爱版。 |
  1988. | group | `boolean` | `false` | N | 是否使用按钮组。 |
  1989. | disabled | `boolean` | `false` | N | 是否禁用。 |
  1990. | customSize | `boolean` | `false` | N | 是否自定义大小。 |
  1991. | customWidth | `number` | `0` | N | 自定义宽度。 |
  1992. | customHeight | `number` | `0` | N | 自定义高度。 |
  1993. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | 图标参数。 |
  1994. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1)\|`null` | `null` | N | 加载参数。 |
  1995. | disabledLoading | `boolean` | `false` | N | 加载时是否禁用。 |
  1996. | type | `'button'\|'reset'\|'submit'` | `button` | N | button 的类型。 |
  1997. ## Button Events
  1998. | 名称 | 类型 | 参数 | 描述 |
  1999. | ------- | ------------ | ---- | ---------- |
  2000. | onclick | `() => void` | - | 点击触发。 |
  2001. ## Button Snippets
  2002. | 名称 | 类型 | 参数 | 说明 |
  2003. | -------- | ------------------------------------------------------------------- | ---- | ---------- |
  2004. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 按钮内容。 |
  2005. ================================================
  2006. FILE: docs/mds/components/button/api_en.md
  2007. ================================================
  2008. ## Button Props
  2009. | Name | Type | Default | Required | Description |
  2010. | --------------- | ----------------------------------------------------------------------------- | --------- | -------- | ------------------------------------------------ |
  2011. | fill | `'base'\|'line'\|'lineLight'\|'lineTheme'\|'text'\|'textTheme'\|'colorLight'` | `'base'` | N | Fill mode. |
  2012. | state | `'theme'\|'success'\|'warning'\|'error'\|'info'` | `'theme'` | N | Status color, theme means following theme color. |
  2013. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'full'` | `'sm'` | N | Border radius style. |
  2014. | size | `'full'\|'big'\|'md'\|'sm'\|'auto'` | `'big'` | N | Size. |
  2015. | line | `'solid'\|'dashed'\|'dotted'` | `'solid'` | N | Border style. |
  2016. | heightOut | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | Button outer height. |
  2017. | heightIn | `'0'\|'1'\|'2'\|'3'\|'4'` | `'3'` | N | Button height. |
  2018. | injClass | `string` | `''` | N | Inject CSS class name. |
  2019. | love | `boolean` | `false` | N | Whether to enable care version. |
  2020. | group | `boolean` | `false` | N | Whether to use button group. |
  2021. | disabled | `boolean` | `false` | N | Whether to disable. |
  2022. | customSize | `boolean` | `false` | N | Whether to use custom size. |
  2023. | customWidth | `number` | `0` | N | Custom width. |
  2024. | customHeight | `number` | `0` | N | Custom height. |
  2025. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | Icon props. |
  2026. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1)\|`null` | `null` | N | Loading props. |
  2027. | disabledLoading | `boolean` | `false` | N | Whether to disable when loading. |
  2028. | type | `'button'\|'reset'\|'submit'` | `button` | N | The default behavior of the button |
  2029. ## Button Events
  2030. | Name | Type | Parameters | Description |
  2031. | ------- | ------------ | ---------- | ------------------- |
  2032. | onclick | `() => void` | - | Triggered on click. |
  2033. ## Button Snippets
  2034. | Name | Type | Parameters | Description |
  2035. | -------- | ------------------------------------------------------------------- | ---------- | --------------- |
  2036. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Button content. |
  2037. ================================================
  2038. FILE: docs/mds/components/button/FAQ.md
  2039. ================================================
  2040. ================================================
  2041. FILE: docs/mds/components/button/FAQ_en.md
  2042. ================================================
  2043. ================================================
  2044. FILE: docs/mds/components/button/guide.md
  2045. ================================================
  2046. ## 默认样式
  2047. 通过查看大量主流的移动端 UI 设计(包含原生与 web),发现在实际应用中,大块主题色按钮的使用频率比较高,因为它的突出性与品牌属性,非常适合用来引导用户操作。故而 STDF 没有跟随主流组件库的灰色边框按钮作为默认样式,而采用大块主题色填充按钮,应该可以减少使用时的书写代码量。其余样式基本上按照 Tailwind 的样式规则,只是对一些选项做了分类与限定,传入可选外的值将被按照默认值处理。
  2048. ## 填充模式
  2049. 填充模式中,line 为线性按钮(幽灵按钮);lineLight 线性浅色按钮;text 为纯文本按钮;而 lineTheme 与 textTheme 表示对应边框和文字颜色会跟随主题色,包括亮暗模式;colorLight 为带透明度浅色背景按钮,也自动适配亮暗模式。
  2050. ## 状态色
  2051. 状态色对应着 STDF 颜色系统的成功、警告、错误、信息四种功能色,请确保在 Tailwind 的配置文件 tailwind.config.js 中已经配置了对应色值,当然也可以根据你的项目自行灵活配置。
  2052. ## 尺寸
  2053. 按钮尺寸为 full 和 big 表示块级元素,md、sm、xs 表示行内元素,auto 时按钮宽度由内部元素的宽度决定。
  2054. ## 边框风格
  2055. 边框风格(line)必须在填充模式(fill)为 line 或 lineTheme 情况下才会生效。
  2056. ## CSS 注入
  2057. 通过 injClass 参数可以向组件内部 button 元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义颜色。
  2058. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  2059. ## 按钮组
  2060. 要使用按钮组可以直接通过在内部 Snippet 放入多个元素,结合 heightOut 与 heightIn 就可以实现。需要注意的是此时点击事件就需要绑定在内部独立元素之上,另外需要通过将 Props 的 group 设置为 true,将不显示整个按钮区域的点击效果。可参考示例。
  2061. ## 带图标或加载
  2062. 通过 icon 参数可以向 Button 组件内容区域前注入图标,参数为 Icon 组件的 Props;通过 loading 参数可以向 Button 组件内容区域前注入加载,参数为 Loading 组件的 Props,当传入 loading 时按钮默认禁用,可通过 disabledLoading 参数控制。请参考示例。
  2063. ================================================
  2064. FILE: docs/mds/components/button/guide_en.md
  2065. ================================================
  2066. ## Default style
  2067. In the practical application of mobile web, the use of large theme color buttons is relatively high, because of its prominence and brand attributes, it is very suitable for guiding users to operate. Therefore, STDF does not follow the gray border button of the mainstream component library as the default style, but uses a large theme color to fill the button, which should reduce the amount of writing code when using it. The rest of the styles are basically in accordance with Tailwind's style rules, but some options are classified and limited, and the incoming optional values ​​will be processed according to the default values.
  2068. ## Fill pattern
  2069. In fill mode, line is a linear button (ghost button), lineLight is a linear light button, text is a plain text button, and lineTheme and textTheme indicate that the corresponding border and text color will follow the theme color, including light and dark colors.
  2070. ## Status color
  2071. The status color corresponds to the four functional colors of success, warning, error, and information of the STDF color system. Please make sure that the corresponding color values ​​have been configured in the Tailwind configuration file tailwind.config.js. Of course, you can also configure it flexibly according to your project.
  2072. ## Size
  2073. The button size is full and big for block-level elements, md, sm, and xs for inline elements. When auto, the button width is determined by the width of the inner element.
  2074. ## Border style
  2075. The border style (line) will only take effect if the fill mode (fill) is line or lineTheme.
  2076. ## CSS injection
  2077. Through the injClass parameter, you can inject CSS names (not limited to Tailwind CSS) to the button element inside the component, which will allow more customization possibilities for component styles. In the example, injClass implements custom colors.
  2078. If the injected class does not take effect, please add "!" before the injected class name, please refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  2079. ## Button group
  2080. To use the button group, you can directly put multiple elements in the inner Snippet, which can be achieved by combining heightOut and heightIn. It should be noted that the click event needs to be bound to the internal independent element at this time. In addition, by setting the group of Props to true, the click effect of the entire button area will not be displayed. Examples are available.
  2081. ## With icon or loading
  2082. Through the icon parameter, you can inject an icon into the content area of the Button component, the parameter is the Props of the Icon component; through the loading parameter, you can inject a loading into the content area of the Button component, the parameter is the Props of the Loading component. When loading is passed in, the button is disabled by default, which can be controlled by the disabledLoading parameter. Please refer to the example.
  2083. ================================================
  2084. FILE: docs/mds/components/button/version.md
  2085. ================================================
  2086. <!-- "[!tag|A|0|]"表示一个 tag,其中 A 表示新增,B 表示 BUG,O 表示优化,第二个数字表示 BUG 等级,0 暂无意义。 -->
  2087. <!-- "[!issue|dufu1991|]"表示一个 issue 提出者,其中 dufu1991 是提出者的 id。 -->
  2088. <!-- "[!contribute|dufu1991|]"表示一个贡献者,其中 eric1932 是贡献者的 id。 -->
  2089. <!-- 记得带上版本号和更新日期,以下是一个示例:
  2090. ## 0.0.1
  2091. - [!tag|B|1|] 严重 BUG。[!contribute|dufu1991|][!issue|dufu1991|]
  2092. - [!tag|B|2|] 一般 BUG。
  2093. - [!tag|B|3|] 轻微 BUG。
  2094. - [!tag|O|0|] 优化。
  2095. - [!tag|A|0|] 新增。
  2096. -->
  2097. ## 1.0.4
  2098. - [!tag|A|0|] 新增 `type` 属性 [PR#43](https://github.com/any-tdf/stdf/pull/43),相关 [MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Reference/Elements/button#type)。[!contribute|arithefirst|]
  2099. ## 0.5.2
  2100. - [!tag|O|0|]调整 icon 与 loading 参数,使其可同时存在。
  2101. ## 0.5.1
  2102. - [!tag|A|0|]支持通过传入 iconLoading 参数实现在按钮内容前显示图标或者加载。
  2103. ================================================
  2104. FILE: docs/mds/components/button/version_en.md
  2105. ================================================
  2106. ## 1.0.4
  2107. - [!tag|A|0|] Added `type` property [PR#43](https://github.com/any-tdf/stdf/pull/43), related [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#type). [!contribute|arithefirst|]
  2108. ## 0.5.2
  2109. - [!tag|O|0|]Adjust the icon and loading parameters to allow them to coexist.
  2110. ## 0.5.1
  2111. - [!tag|A|0|]Support displaying icons or loading before the button content by passing in the iconLoading parameter.
  2112. ================================================
  2113. FILE: docs/mds/components/calendar/api.md
  2114. ================================================
  2115. ## Calendar Props
  2116. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2117. | --------------- | ------------------------------------------------------------- | ------------------------------------ | ---- | -------------------------------------------- |
  2118. | visible | `boolean` | `false` | N | 是否显示。 |
  2119. | startMonth | `string` | 当前月份前第 6 个月 | N | 开始月份,格式为 YYYYMM。 |
  2120. | endMonth | `string` | 当前月份后第 6 个月 | N | 结束月份,格式为 YYYYMM。 |
  2121. | initMonth | `string` | 当前月份 | N | 初始化时显示月份,格式为 YYYYMM。 |
  2122. | mode | `'single'\|'multiple'\|'range'` | `'single'` | N | 选择模式。 |
  2123. | startSunday | `boolean` | `false` | N | 是否从周日开始。 |
  2124. | weekendRed | `boolean` | `false` | N | 是否周末红色。 |
  2125. | monthCard | `boolean` | `true` | N | 月数据是否使用卡片样式。 |
  2126. | monthMark | `boolean` | `false` | N | 是否显示月份水印。 |
  2127. | monthMarkSize | `'3xl'\|'4xl'\|'5xl'\|'6xl'\|'7xl'\|'8xl'\|'9xl'` | `'7xl'` | N | 月份水印文字大小。 |
  2128. | height | `number` | `50` | N | 显示高度占页面高度百分比。 |
  2129. | infoDates | `InfoDate[]` | `[]` | N | 需要显示信息的日期。 |
  2130. | disabledDates | `string[]` | `[]` | N | 不可选的日期。 |
  2131. | radius | `'none'\|'sm'\|'xl'\|'2xl'` | `'xl'` | N | 选定日期的圆角风格。 |
  2132. | showSelectedDay | `boolean` | `true` | N | 多选和范围选择时确定按钮是否显示已选天数。 |
  2133. | confirmText | `string` | 当前语言的 calendarLang.confirmText | N | 确定按钮文案。 |
  2134. | selectedText | `string` | 当前语言的 calendarLang.selectedText | N | showSelectedDay 为 true 时确定按钮部分文案。 |
  2135. | dayText | `string` | 当前语言的 calendarLang.dayText | N | showSelectedDay 为 true 时确定按钮部分文案。 |
  2136. | quickSelects | `('week'\|'month'\|'quarter'\|number)[]` | `[]` | N | 快捷选择配置参数。 |
  2137. | includeToday | `boolean` | `false` | N | 快速选择天数时是否包含今天。 |
  2138. | highlightToday | `boolean` | `true` | N | 是否高亮今天。 |
  2139. | useAnimation | `boolean` | `true` | N | 自动滚动到指定月份时是否使用动画。 |
  2140. | outFormat | `string` | `'YMD'` | N | 返回日期数据格式。 |
  2141. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  2142. | button | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | 确定按钮参数。 |
  2143. | clear | `boolean` | `true` | N | 关闭时是否清空已选日期。 |
  2144. ## Calendar Events
  2145. | 名称 | 类型 | 参数 | 描述 |
  2146. | --------- | --------------------------- | ---------------------------------------------- | -------------------- |
  2147. | onclose | `() => void` | - | 关闭时触发。 |
  2148. | onconfirm | `(dates: string[]) => void` | dates - 所有选定日期格式化后字符串组成的数组。 | 点击确定按钮时触发。 |
  2149. ## InfoDate Props
  2150. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2151. | ---- | -------- | ------ | ---- | ---------------------------------- |
  2152. | date | `string` | - | Y | 由年月日 YYYYMMDD 格式组成的数组。 |
  2153. | info | `string` | - | Y | 信息内容,长度尽量短。 |
  2154. ================================================
  2155. FILE: docs/mds/components/calendar/api_en.md
  2156. ================================================
  2157. ## Calendar Props
  2158. | Name | Type | Default | Required | Description |
  2159. | --------------- | ------------------------------------------------------------- | ------------------------------------------ | -------- | ------------------------------------------------------------------------------ |
  2160. | visible | `boolean` | `false` | N | Whether to show the calendar. |
  2161. | startMonth | `string` | 6 months before current month | N | Start month in YYYYMM format. |
  2162. | endMonth | `string` | 6 months after current month | N | End month in YYYYMM format. |
  2163. | initMonth | `string` | Current month | N | Initial display month in YYYYMM format. |
  2164. | mode | `'single'\|'multiple'\|'range'` | `'single'` | N | Selection mode. |
  2165. | startSunday | `boolean` | `false` | N | Whether week starts from Sunday. |
  2166. | weekendRed | `boolean` | `false` | N | Whether weekend dates are in red. |
  2167. | monthCard | `boolean` | `true` | N | Whether to use card style for month data. |
  2168. | monthMark | `boolean` | `false` | N | Whether to show month watermark. |
  2169. | monthMarkSize | `'3xl'\|'4xl'\|'5xl'\|'6xl'\|'7xl'\|'8xl'\|'9xl'` | `'7xl'` | N | Month watermark text size. |
  2170. | height | `number` | `50` | N | Display height as percentage of page height. |
  2171. | infoDates | `InfoDate[]` | `[]` | N | Dates that need to display information. |
  2172. | disabledDates | `string[]` | `[]` | N | Disabled dates. |
  2173. | radius | `'none'\|'sm'\|'xl'\|'2xl'` | `'xl'` | N | Border radius style for selected dates. |
  2174. | showSelectedDay | `boolean` | `true` | N | Whether to show selected days count in confirm button for multiple/range mode. |
  2175. | confirmText | `string` | Current language calendarLang.confirmText | N | Confirm button text. |
  2176. | selectedText | `string` | Current language calendarLang.selectedText | N | Part of confirm button text when showSelectedDay is true. |
  2177. | dayText | `string` | Current language calendarLang.dayText | N | Part of confirm button text when showSelectedDay is true. |
  2178. | quickSelects | `('week'\|'month'\|'quarter'\|number)[]` | `[]` | N | Quick selection configuration parameters. |
  2179. | includeToday | `boolean` | `false` | N | Whether to include today when using quick select days. |
  2180. | highlightToday | `boolean` | `true` | N | Whether to highlight today. |
  2181. | useAnimation | `boolean` | `true` | N | Whether to use animation when auto-scrolling to specified month. |
  2182. | outFormat | `string` | `'YMD'` | N | Output date format. |
  2183. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  2184. | button | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | Confirm button parameters. |
  2185. | clear | `boolean` | `true` | N | Whether to clear selected dates when closing. |
  2186. ## Calendar Events
  2187. | Name | Type | Parameters | Description |
  2188. | --------- | --------------------------- | ------------------------------------------------- | --------------------------- |
  2189. | onclose | `() => void` | - | Triggered when closing. |
  2190. | onconfirm | `(dates: string[]) => void` | dates - Array of formatted selected date strings. | Triggered on confirm click. |
  2191. ## InfoDate Props
  2192. | Name | Type | Default | Required | Description |
  2193. | ---- | -------- | ------- | -------- | ------------------------------------- |
  2194. | date | `string` | - | Y | Date in YYYYMMDD format. |
  2195. | info | `string` | - | Y | Information content, keep it concise. |
  2196. ================================================
  2197. FILE: docs/mds/components/calendar/FAQ.md
  2198. ================================================
  2199. ================================================
  2200. FILE: docs/mds/components/calendar/FAQ_en.md
  2201. ================================================
  2202. ================================================
  2203. FILE: docs/mds/components/calendar/guide.md
  2204. ================================================
  2205. ## 使用场景
  2206. Calendar 组件用于选择单个日期、多个日期或日期范围。
  2207. ## 注意事项
  2208. 传入的 startMonth、endMonth、initMonth 必须是 YYYYMM 格式的字符串,且 initMonth 必须在 startMonth 和 endMonth 之间。另外其他传入用到年月或年月日的属性时,请保证传入的数据格式都是 YYYYMM 或 YYYYMMDD,月和日如果不足两位数时,需要在前面补 0。
  2209. ## 周开始
  2210. 部分国家或地区在日常生活中习惯将周日作为一周的第一天,但是按照国际标准 [ISO 8601](https://wikipedia.org/wiki/ISO_8601) 规定,一周的第一天是周一。同时从「周末」这个词的含义来看,周六周日应该是一周的末尾,而不是开头。
  2211. 所以 Calendar 组件默认周一作为一周的第一天,也建议大家尽量以此为标准。如果需要将周日作为一周的第一天,可以通过 startSunday 属性来设置。
  2212. ## infoDates
  2213. Calendar 组件可以通过传入 infoDates 属性来显示某天的一些提示信息,建议传入的 info 信息长度尽量简短,否则可能造成日历显示不美观。
  2214. ## disabledDates
  2215. Calendar 组件可以通过传入 disabledDates 属性来禁用某些日期,此时如果是范围选择模式,选择的日期中会自动过滤掉禁用的日期。
  2216. ## 快捷选择
  2217. 当处于范围选择模式时,Calendar 组件可以通过传入 quickSelects 这个数组属性来决定启用哪些快捷选择方式。
  2218. - 当传入的 quickSelects 包含 week 字符时,可以点击当前周快速选定一周的日期范围;当传入的 quickSelects 包含 month 字符时,可以点击当前月快速选定一个月的日期范围;当传入的 quickSelects 包含 quarter 字符时,可以点击当前季度快速选定一个季度的日期范围。
  2219. - 当传入的 quickSelects 包含正整数时,组件内部会显示对应的未来几天的快捷选择按钮,比如传入 [3, 7] 时,会显示未来 3 天、7 天的快捷选择按钮,点击后会自动选定对应的日期范围。
  2220. - 当传入的 quickSelects 包含负整数时,组件内部会显示对应的过去几天的快捷选择按钮,比如传入 [-3, -7] 时,会显示最近 3 天、7 天的快捷选择按钮,点击后会自动选定对应的日期范围。
  2221. - 当使用快捷选择指定天数时,默认是不包含当天的,可以通过修改 includeToday 的值来决定是否包含今天,请参考示例。
  2222. ## 返回日期格式
  2223. 当点击 Calendar 组件底部的确定按钮时,会触发 confirm 事件,此时会将当前选中的所有日期数据字符组成数组返回。每个日期的数据格式由 outFormat 决定,返回后的格式中的年与 outFormat 中的 Y 对应,月与 outFormat 中的 M 对应,日与 outFormat 中的 D 对应。请参考示例。
  2224. ## 月份水印
  2225. Calendar 组件可以通过传入 monthMark 属性来决定是否在日历的每个月内显示月份文字的水印,考虑不同语言的月份文字长度不同,可以通过 monthMarkSize 属性来设置水印的字体大小。
  2226. ## 说明
  2227. Calendar 是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 radius 改变圆角风格。
  2228. Calendar 内底部的确定按钮使用了 Button 组件,可以通过传入 button 参数来自定义按钮的样式,请参考示例。
  2229. ================================================
  2230. FILE: docs/mds/components/calendar/guide_en.md
  2231. ================================================
  2232. ## Usage
  2233. The Calendar component is used to select a single date, multiple dates, or a range of dates.
  2234. ## Notes
  2235. The startMonth, endMonth, and initMonth passed in must be strings in the format YYYYMM, and initMonth must be between startMonth and endMonth. Additionally, when other attributes that use year-month or year-month-day are used, please ensure that the data format passed in is either YYYYMM or YYYYMMDD. If the month or day is less than two digits long, add a 0 before it.
  2236. ## Week Start Day
  2237. Some countries or regions habitually consider Sunday as the first day of the week in daily life. However, according to international standard [ISO 8601](https://wikipedia.org/wiki/ISO_8601), Monday is considered as the first day of the week. Also from the meaning of "weekend," Saturday and Sunday should be at the end of a week rather than at its beginning.
  2238. Therefore by default Calendar considers Monday as the first day of a week; we also recommend using this as your standard whenever possible. If you need to set Sunday as your first day instead for some reason you can do so with startSunday attribute.
  2239. ## infoDates
  2240. Calendar can display some prompt information about certain days by passing an infoDates attribute. It's recommended to keep these messages short; otherwise they may cause calendar display issues.
  2241. ## disabledDates
  2242. Calendar can disable certain dates by passing disabledDates attribute; if range selection mode is enabled then any selected date(s) will automatically filter out any disabled ones.
  2243. ## Quick Selections
  2244. When in range selection mode Calendar can enable quick selections via passing an array property called quickSelects:
  2245. - When quickSelects contains 'week', clicking on current week will quickly select all dates within that same week.
  2246. - When quickSelects contains 'month', clicking on current month will quickly select all dates within that same month.
  2247. - When quickSelects contains 'quarter', clicking on current quarter will quickly select all dates within that same quarter.
  2248. - When positive integers are included inside quickSelects array component internally displays corresponding future days' shortcut buttons (e.g., [3,7] shows shortcuts for next three days & seven days).
  2249. - Similarly when negative integers are included inside quickSelects array component internally displays corresponding past few days' shortcut buttons (e.g., [-3,-7] shows shortcuts for last three & seven days).
  2250. - By default when specifying number of days through Quick Select feature today's date isn't included but includeToday value can be modified accordingly - see example below.
  2251. ## Return Date Format
  2252. When user clicks confirm button located at bottom part of Calendar component it triggers confirm event which returns an array containing character data representing currently selected date(s). The format for each individual date depends upon outFormat parameter: Year corresponds with Y from outFormat while Month corresponds with M from outFormat and Day corresponds with D from outFormat - see example below.
  2253. ## Month Watermark
  2254. By setting monthMark property Calendar component decides whether watermark text displaying name(s)of months appears inside every calendar month view; since different languages have varying lengths for their respective names one may adjust font size via monthMarkSize property.
  2255. ]=[]
  2256. ### Note
  2257. Calendar was built atop Popup module utilizing predefined Props thus allowing various effects achieved through properties passed into Popup object itself e.g., radius style change demonstrated via sample code snippet provided hereunder.
  2258. Calendar's Confirm Button uses Button Component enabling customization options available through button parameter - refer to examples provided below.
  2259. ================================================
  2260. FILE: docs/mds/components/calendar/version.md
  2261. ================================================
  2262. ## 1.0.3
  2263. - [!tag|A|0|]新增 `clear` 属性,关闭时可保留已选日期。
  2264. ## 0.0.8
  2265. - [!tag|B|2|]修复显示快捷选项时已选项的高亮样式。
  2266. ================================================
  2267. FILE: docs/mds/components/calendar/version_en.md
  2268. ================================================
  2269. ## 1.0.3
  2270. - [!tag|A|0|]Add `clear` property, keep the selected date when closed.
  2271. ## 0.0.8
  2272. - [!tag|B|2|]Fix the highlighted style that was selected when shortcut options were displayed.
  2273. ================================================
  2274. FILE: docs/mds/components/cell/api.md
  2275. ================================================
  2276. ## Cell Props
  2277. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2278. | ------------ | ----------------------------------------------------------------- | --------- | ---- | ---------------------- |
  2279. | title | `string` | `''` | N | 标题。 |
  2280. | detail | `string` | `''` | N | 右侧详情。 |
  2281. | left | `null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `null` | N | 最左侧内容。 |
  2282. | right | `null\|'arrow'\|CellRight` | `'arrow'` | N | 最右侧内容。 |
  2283. | subTitle | `string` | `''` | N | 左侧次级标题。 |
  2284. | info | `string` | `''` | N | 右侧次级信息。 |
  2285. | line | `boolean` | `false` | N | 是否显示底部分割线。 |
  2286. | my | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'4'` | N | 上下间距。 |
  2287. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'2'` | N | 左右间距。 |
  2288. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'lg'` | N | 圆角风格。 |
  2289. | switchActive | `boolean` | `false` | N | 开关状态。 |
  2290. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'xs'` | N | 阴影风格。 |
  2291. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  2292. | love | `boolean` | `false` | N | 是否开启关爱版。 |
  2293. | clickAll | `boolean` | `true` | N | 是否点击整行触发事件。 |
  2294. ## Cell Events
  2295. | 名称 | 类型 | 参数 | 描述 |
  2296. | ------- | ------------ | ---- | -------- |
  2297. | onclick | `() => void` | - | 点击触发 |
  2298. ## Cell Snippets
  2299. | 名称 | 类型 | 参数 | 说明 |
  2300. | ----------- | ------------------------------------------------------------------- | ---- | ------------- |
  2301. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 最左侧内容。 |
  2302. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 最右侧内容。 |
  2303. | detailChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Detail 内容。 |
  2304. ## CellGroup Props
  2305. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2306. | ------ | ----------------------------------------------- | ------ | ---- | ---------- |
  2307. | my | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'4'` | N | 上下间距。 |
  2308. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'2'` | N | 左右间距。 |
  2309. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'lg'` | N | 圆角风格。 |
  2310. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'xs'` | N | 阴影风格。 |
  2311. ## CellGroup Snippets
  2312. | 名称 | 类型 | 参数 | 说明 |
  2313. | -------- | ------------------------------------------------------------------- | ---- | ---------------------------------- |
  2314. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Cell Group 内容,一般是多个 Cell。 |
  2315. ## CellRight
  2316. ```javascript
  2317. type CellRight = {
  2318. type: 'switch' | 'icon',
  2319. switch?: Switch,
  2320. icon?: Icon,
  2321. };
  2322. ```
  2323. ================================================
  2324. FILE: docs/mds/components/cell/api_en.md
  2325. ================================================
  2326. ## Cell Props
  2327. | Name | Type | Default | Required | Description |
  2328. | ------------ | ----------------------------------------------------------------- | --------- | -------- | ---------------------------- |
  2329. | title | `string` | `''` | N | Title. |
  2330. | detail | `string` | `''` | N | Right detail. |
  2331. | left | `null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `null` | N | Leftmost content. |
  2332. | right | `null\|'arrow'\|CellRight` | `'arrow'` | N | Rightmost content. |
  2333. | subTitle | `string` | `''` | N | Left subtitle. |
  2334. | info | `string` | `''` | N | Right secondary info. |
  2335. | line | `boolean` | `false` | N | Show bottom divider. |
  2336. | my | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'4'` | N | Vertical margin. |
  2337. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'2'` | N | Horizontal margin. |
  2338. | radius | `'none'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'lg'` | N | Border radius style. |
  2339. | switchActive | `boolean` | `false` | N | Switch state. |
  2340. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'xs'` | N | Shadow style. |
  2341. | injClass | `string` | `''` | N | Inject CSS class name. |
  2342. | love | `boolean` | `false` | N | Enable care version. |
  2343. | clickAll | `boolean` | `true` | N | Click entire row to trigger. |
  2344. ## Cell Events
  2345. | Name | Type | Params | Description |
  2346. | ------- | ------------ | ------ | -------------- |
  2347. | onclick | `() => void` | - | Click callback |
  2348. ## Cell Snippets
  2349. | Name | Type | Params | Description |
  2350. | ----------- | ------------------------------------------------------------------- | ------ | ------------------ |
  2351. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Leftmost content. |
  2352. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Rightmost content. |
  2353. | detailChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Detail content. |
  2354. ## CellGroup Props
  2355. | Name | Type | Default | Required | Description |
  2356. | ------ | ------------------------------------------------- | ------- | -------- | ------------------ |
  2357. | my | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'4'` | N | Vertical margin. |
  2358. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'` | `'2'` | N | Horizontal margin. |
  2359. | radius | `'none'\|'base'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'lg'` | N | Border radius. |
  2360. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'xs'` | N | Shadow style. |
  2361. ## CellGroup Snippets
  2362. | Name | Type | Params | Description |
  2363. | -------- | ------------------------------------------------------------------- | ------ | ------------------------------------------------ |
  2364. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Cell Group content, usually multiple Cell items. |
  2365. ## CellRight
  2366. ```javascript
  2367. type CellRight = {
  2368. type: 'switch' | 'icon';
  2369. switch?: Switch;
  2370. icon?: Icon;
  2371. };
  2372. ```
  2373. ================================================
  2374. FILE: docs/mds/components/cell/FAQ.md
  2375. ================================================
  2376. ================================================
  2377. FILE: docs/mds/components/cell/FAQ_en.md
  2378. ================================================
  2379. ================================================
  2380. FILE: docs/mds/components/cell/guide.md
  2381. ================================================
  2382. > Cell 使用了图标 ri-arrow-right-s-line,请确保项目的 symbol.svg 文件中包含此图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  2383. ## 说明
  2384. 组件库开发中满足自定义与上手简单始终是不可兼得的。
  2385. Cell 作为移动端使用频率较高的组件,承载的使用场景也比较多,因此可以很明显地看出来 Props 比较多,支持的自定义选项也比较多。
  2386. ## Snippet
  2387. Cell 组件支持 leftChild、rightChild 和 detailChild 三种 Snippet,当传入 leftChild 时 Cell 最左侧内容会被 leftChild 渲染,可参考示例自定义左侧图片;当传入 rightChild 时 Cell 最右侧内容会被 rightChild 渲染,可参考示例自定义右侧图片;当传入 detailChild 时 Cell 右侧详情内容会被 detailChild 渲染,可参考示例自定义右侧详情内容。
  2388. ## left & right
  2389. left 参数支持使用 Icon Props,此时将使用 STDF 的 Icon 组件渲染。
  2390. 考虑到 Cell 右侧区域使用箭头的场景非常多,组件默认 right 参数为 `'arrow'`,显示箭头。
  2391. right 也支持传入 Icon Props,考虑右侧使用开关的场景较多,为了区分是 Switch Props 还是其他 Icon Props,right 增加了一个 type 属性(可选 `'icon'` 和 `'switch'`)用于区分 Icon 和 Switch 组件。
  2392. 优化:当右侧为 switch 时,点击整个 Cell 区域都会切换 Switch 的开关状态。
  2393. 具体 Icon Props 与 Switch Props 请查看对应组件 API。
  2394. ## clickAll
  2395. 移动端考虑交互的友好性,Cell 默认点击整行都会触发事件,但是考虑场景的多样性,你可以通过将 clickAll 参数设置为 false 来禁用这个功能。只是在特定区域触发事件,比如示例中配合 Switch 组件使用,仅在点击 Switch 时触发事件。
  2396. ## switchActive
  2397. switchActive 值仅在 right 的 type 为 switch 时生效,表示开关状态值。注意,此时 Cell 内部 Switch 的 active 由 switchActive 决定,**请不要在 switch 内部再传入 active**。
  2398. ## 底部分割线
  2399. 主要用于组合时,当 Cell 与 Cell 之间有间隔时,可以使用 line 参数控制是否显示底部分割线。
  2400. ## 组合使用
  2401. Cell 组件支持组合使用,可以向 CellGroup 传入 Cell 来实现。为了不影响布局,注意配置单条 Cell 的 my、mx、radius、shadow、line 参数,请参考示例。
  2402. ## 自定义
  2403. 使用上下左右间距和顶部底部圆角参数,可以配置出多种 Cell 风格,如果还不能满足,可以使用注入 CSS(injClass)来实现更多自定义的样式,请参考示例。
  2404. ================================================
  2405. FILE: docs/mds/components/cell/guide_en.md
  2406. ================================================
  2407. > Cell uses the icon ri-arrow-right-s-line, please make sure this icon is included in your project's symbol.svg file. For detailed information, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  2408. ## Description
  2409. In component library development, satisfying both customization and ease of use is always a trade-off.
  2410. As a frequently used component in mobile applications, Cell supports many use cases, which is why it has quite a few Props and customization options.
  2411. ## Snippet
  2412. Cell component supports three Snippet: leftChild, rightChild and detailChild. When leftChild is provided, the leftmost content of Cell will be rendered by the leftChild, refer to examples for customizing left images; when rightChild is provided, the rightmost content will be rendered by rightChild, refer to examples for customizing right images; when detailChild is provided, the right detail content will be rendered by detailChild, refer to examples for customizing right detail content.
  2413. ## left & right
  2414. The left parameter supports Icon Props, which will be rendered using STDF's Icon component.
  2415. Considering that arrows are commonly used in the right area of Cell, the default right parameter is set to `'arrow'`, displaying an arrow.
  2416. right also supports Icon Props. Given that switches are frequently used on the right side, to distinguish between Switch Props and other Icon Props, right includes a type attribute (options are `'icon'` and `'switch'`) to differentiate between Icon and Switch components.
  2417. Optimization: When right is set to switch, clicking anywhere in the Cell area will toggle the Switch state.
  2418. For specific Icon Props and Switch Props, please refer to the corresponding component APIs.
  2419. ## clickAll
  2420. Considering mobile interaction friendliness, Cell triggers events by default when clicking anywhere in the row. However, for diverse scenarios, you can disable this feature by setting clickAll parameter to false. This restricts event triggering to specific areas, like in examples where it's used with Switch component to only trigger events when clicking the Switch.
  2421. ## switchActive
  2422. switchActive value only takes effect when right's type is switch, indicating the switch state. Note that in this case, the Cell's internal Switch active state is determined by switchActive, **please do not pass active inside switch again**.
  2423. ## Bottom Divider
  2424. Mainly used in combinations, when there are gaps between Cells, you can use the line parameter to control whether to display the bottom divider.
  2425. ## Combination Usage
  2426. Cell component supports combination usage by passing Cells to CellGroup. To avoid affecting the layout, pay attention to configuring individual Cell's my, mx, radius, shadow, line parameters, please refer to examples.
  2427. ## Customization
  2428. Using vertical and horizontal margin parameters and top/bottom border radius parameters, you can configure various Cell styles. If these still don't meet your needs, you can use injected CSS (injClass) to achieve more custom styles, please refer to examples.
  2429. ================================================
  2430. FILE: docs/mds/components/cell/version.md
  2431. ================================================
  2432. ## 1.0.3
  2433. - [!tag|B|3|]修复右侧箭头未垂直居中问题。
  2434. - [!tag|O|0|]减少左右两侧间距。
  2435. ## 0.2.11
  2436. - [!tag|B|2|]修复左右区域上下居中对齐问题。
  2437. ## 0.2.10
  2438. - [!tag|A|0|]增加 `clickAll` 参数,用于控制是否点击整行都触发事件。关联 [Issues](https://github.com/any-tdf/stdf/issues/7)。[!issue|yuedanlabs|]
  2439. ## 0.0.10
  2440. - [!tag|O|0|]增加 title 与右侧 detail 间距。[!contribute|893358308|]
  2441. ================================================
  2442. FILE: docs/mds/components/cell/version_en.md
  2443. ================================================
  2444. ## 1.0.3
  2445. - [!tag|B|3|]Fix the problem that the right arrow is not vertically centered.
  2446. - [!tag|O|0|]Reduce the distance between the left and right sides.
  2447. ## 0.2.11
  2448. - [!tag|B|2|]Fix the problem of up and down alignment in the left and right areas.
  2449. ## 0.2.10
  2450. - [!tag|A|0|]Add the `clickAll` parameter to control whether clicking on the entire row triggers an event. Related [Issues](https://github.com/any-tdf/stdf/issues/7). [!issue|yuedanlabs|]
  2451. ## 0.0.10
  2452. - [!tag|O|0|]Increase the distance between title and right detail. [!contribute|893358308|]
  2453. ================================================
  2454. FILE: docs/mds/components/checkbox/api.md
  2455. ================================================
  2456. ## Checkbox Props
  2457. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2458. | ------------ | ---------------------------------------------------------------------------- | ----------- | ---- | ---------------------------- |
  2459. | data | `CheckboxItem[]` | `[]` | Y | 选项数据。 |
  2460. | layout | `'h'\|'v'\|'inline'` | `'v'` | N | 排列方式。 |
  2461. | checkeds | `string[]` | `[]` | N | 选中的选项标识符组成的数组。 |
  2462. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | 选项文本区域位置。 |
  2463. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 未选中选项图标区域内容。 |
  2464. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 选中选项图标区域内容。 |
  2465. ## Checkbox Events
  2466. | 名称 | 类型 | 参数 | 描述 |
  2467. | -------- | ------------------------------ | ----------------------------------- | ---------------- |
  2468. | onchange | `(checkeds: string[]) => void` | checkeds - 选定项标识符组成的数组。 | 点击选项时触发。 |
  2469. ## Checkbox Snippets
  2470. | 名称 | 类型 | 参数 | 说明 |
  2471. | ------------- | --------------------------------------------------------------------------------------------- | ----------------- | ------------------------ |
  2472. | checkboxChild | [`Snippet<[{ item: CheckboxItem }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | item - 选项数据。 | 当选项区域自定义时使用。 |
  2473. ## CheckboxItem Props
  2474. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2475. | ------------ | ---------------------------------------------------------------------------- | ----------- | ---- | ------------------------ |
  2476. | name | `string` | `''` | Y | 标识符。 |
  2477. | label | `string` | `''` | N | 选项文本,主要用于显示。 |
  2478. | layout | `'h'\|'v'\|'inline'` | `'v'` | N | 排列方式。 |
  2479. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | 选项文本区域位置。 |
  2480. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 未选中选项图标区域内容。 |
  2481. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 选中选项图标区域内容。 |
  2482. | checked | `boolean` | `false` | N | 是否选中。 |
  2483. ## CheckboxItem Events
  2484. | 名称 | 类型 | 参数 | 描述 |
  2485. | ------- | ------------------------ | --------------- | ---------------- |
  2486. | onclick | `(name: string) => void` | name - 标识符。 | 点击选项时触发。 |
  2487. ## CheckboxItem Snippets
  2488. | 名称 | 类型 | 参数 | 说明 |
  2489. | -------- | ------------------------------------------------------------------- | ---- | ------------------ |
  2490. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 选项文本区域内容。 |
  2491. ================================================
  2492. FILE: docs/mds/components/checkbox/api_en.md
  2493. ================================================
  2494. ## Checkbox Props
  2495. | Name | Type | Default | Required | Description |
  2496. | ------------ | ---------------------------------------------------------------------------- | ----------- | -------- | -------------------------------------- |
  2497. | data | `CheckboxItem[]` | `[]` | Y | Option data. |
  2498. | layout | `'h'\|'v'\|'inline'` | `'v'` | N | Layout mode. |
  2499. | checkeds | `string[]` | `[]` | N | Array of selected option identifiers. |
  2500. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | Position of option text area. |
  2501. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of unchecked option icon area. |
  2502. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of checked option icon area. |
  2503. ## Checkbox Events
  2504. | Name | Type | Parameters | Description |
  2505. | -------- | ------------------------------ | ----------------------------------------- | ------------------------------ |
  2506. | onchange | `(checkeds: string[]) => void` | checkeds - Array of selected identifiers. | Triggered when option clicked. |
  2507. ## Checkbox Snippets
  2508. | Name | Type | Parameters | Description |
  2509. | ------------- | --------------------------------------------------------------------------------------------- | ------------------- | ---------------------------------- |
  2510. | checkboxChild | [`Snippet<[{ item: CheckboxItem }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | item - Option data. | Used when customizing option area. |
  2511. ## CheckboxItem Props
  2512. | Name | Type | Default | Required | Description |
  2513. | ------------ | ---------------------------------------------------------------------------- | ----------- | -------- | -------------------------------------- |
  2514. | name | `string` | `''` | Y | Identifier. |
  2515. | label | `string` | `''` | N | Option text, mainly for display. |
  2516. | layout | `'h'\|'v'\|'inline'` | `'v'` | N | Layout mode. |
  2517. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | Position of option text area. |
  2518. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of unchecked option icon area. |
  2519. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of checked option icon area. |
  2520. | checked | `boolean` | `false` | N | Whether checked. |
  2521. ## CheckboxItem Events
  2522. | Name | Type | Parameters | Description |
  2523. | ------- | ------------------------ | ------------------ | ------------------------------ |
  2524. | onclick | `(name: string) => void` | name - Identifier. | Triggered when option clicked. |
  2525. ## CheckboxItem Snippets
  2526. | Name | Type | Parameters | Description |
  2527. | -------- | ------------------------------------------------------------------- | ---------- | ---------------------------- |
  2528. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Content of option text area. |
  2529. ================================================
  2530. FILE: docs/mds/components/checkbox/FAQ.md
  2531. ================================================
  2532. ================================================
  2533. FILE: docs/mds/components/checkbox/FAQ_en.md
  2534. ================================================
  2535. ================================================
  2536. FILE: docs/mds/components/checkbox/guide.md
  2537. ================================================
  2538. > Checkbox 使用了图标 ri-checkbox-fill 和 ri-checkbox-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  2539. ## 说明
  2540. 由于移动端横向显示内容有限,Checkbox 默认为纵向布局,横向布局建议只用作简单使用。当选项较多、内容较长或显示内容较多时建议使用纵向布局,当 Checkbox 内的选项被点击时,通过 onchange 事件,可以获取到当前所有选定项标识符 name 组成的数组。
  2541. ## icon && iconChecked
  2542. Checkbox Props 的 icon 默认值 `'default'` 会按照 Remix Icon 的 checkbox-line 以 Icon 组件形式渲染;传入字符 `null`,表示未选中选项图标区域不显示内容;也可以传入 Icon Props,未选中选项图标区域将会以传入的参数以 Icon 组件形式渲染。
  2543. iconChecked 与 icon 逻辑一样,对应的是选中选项的图标区域内容。
  2544. ## Checkbox Snippet
  2545. 当传入 checkboxChild 这个 Snippet 时,选项区域将会以传入的 Snippet 内容渲染,可自由设计选中与未选中的效果,获取数据逻辑等。
  2546. > 虽然有 Tailwind 写样式比较方便,但过多的自定义将会失去使用组件库的意义。
  2547. ## 点击区域优化
  2548. 为了优化体验,CheckboxItem 整个区域都可以点击,将会激活与之对应的选项,不仅仅只可以点击文字或图标区域。
  2549. ================================================
  2550. FILE: docs/mds/components/checkbox/guide_en.md
  2551. ================================================
  2552. > Checkbox uses icons ri-checkbox-fill and ri-checkbox-line. Please ensure these icons are included in your project's symbol.svg file. For more details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  2553. ## Description
  2554. Due to limited horizontal display space on mobile devices, Checkbox defaults to vertical layout, with horizontal layout recommended only for simple use cases. When there are multiple options, long content, or rich display content, vertical layout is recommended. When an option within the Checkbox is clicked, through the onchange event, you can get an array of name identifiers for all currently selected items.
  2555. ## icon && iconChecked
  2556. The default value `'default'` for Checkbox Props' icon will render as an Icon component following Remix Icon's checkbox-line style; passing `null` means no content will be displayed in the unchecked option's icon area; you can also pass Icon Props, and the unchecked option's icon area will be rendered as an Icon component with the passed parameters.
  2557. iconChecked follows the same logic as icon, corresponding to the icon area content for checked options.
  2558. ## Checkbox Snippet
  2559. When passing the checkboxChild Snippet, the option area will be rendered with the passed Snippet content, allowing free design of checked and unchecked effects, data logic handling, etc.
  2560. > Although Tailwind makes styling convenient, too much customization will defeat the purpose of using a component library.
  2561. ## Click Area Optimization
  2562. To optimize the user experience, the entire CheckboxItem area is clickable and will activate its corresponding option, not just the text or icon areas.
  2563. ================================================
  2564. FILE: docs/mds/components/checkbox/version.md
  2565. ================================================
  2566. ================================================
  2567. FILE: docs/mds/components/checkbox/version_en.md
  2568. ================================================
  2569. ================================================
  2570. FILE: docs/mds/components/dialog/api.md
  2571. ================================================
  2572. ## Dialog Props
  2573. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2574. | --------------- | ------------------------------------------------------------- | ------------------------------- | ---- | ---------------------- |
  2575. | visible | `boolean` | `false` | N | 是否显示。 |
  2576. | title | `string` | 当前语言的 dialog.title | N | 标题。 |
  2577. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | 标题对齐方式。 |
  2578. | content | `string` | 当前语言的 dialog.content | N | 内容。 |
  2579. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  2580. | showIcon | `boolean` | `false` | N | 是否显示图标。 |
  2581. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | 图标参数。 |
  2582. | btnStyle | `'button'\|'text'\|'textLine'` | `'button'` | N | 按钮样式。 |
  2583. | primaryText | `string` | 当前语言的 dialog.primaryText | N | 主按钮文字。 |
  2584. | primaryButton | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | 主按钮参数。 |
  2585. | secondaryText | `string` | 当前语言的 dialog.secondaryText | N | 次按钮文字。 |
  2586. | secondaryButton | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | 次按钮参数。 |
  2587. | btnRatio | `[number,number]` | `[1, 1]` | N | 主次按钮大小比例。 |
  2588. | btnReverse | `boolean` | `false` | N | 主次按钮位置是否反转。 |
  2589. | secondaryClose | `boolean` | `true` | N | 次按钮是否关闭弹窗。 |
  2590. | btnGap | `'0'\|'1'\|'2'\|'4'\|'8'\|'12'\|'16'` | `'2'` | N | 按钮间距。 |
  2591. ## Dialog Events
  2592. | 名称 | 类型 | 参数 | 描述 |
  2593. | ----------- | ------------ | ---- | ------------------ |
  2594. | onclose | `() => void` | - | 对话框关闭时触发。 |
  2595. | onprimary | `() => void` | - | 点击主按钮时触发。 |
  2596. | onsecondary | `() => void` | - | 点击次按钮时触发。 |
  2597. ## Dialog Snippets
  2598. | 名称 | 类型 | 参数 | 描述 |
  2599. | ------------ | ------------------------------------------------------------------- | ---- | ----------------------------- |
  2600. | contentChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染 content 内容。 |
  2601. | primaryChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染 primaryText 内容。 |
  2602. ================================================
  2603. FILE: docs/mds/components/dialog/api_en.md
  2604. ================================================
  2605. ## Dialog Props
  2606. | Name | Type | Default | Required | Description |
  2607. | --------------- | ------------------------------------------------------------- | ------------------------------------- | -------- | -------------------------------------------- |
  2608. | visible | `boolean` | `false` | N | Whether to show the dialog. |
  2609. | title | `string` | Current language dialog.title | N | Title. |
  2610. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | Title alignment. |
  2611. | content | `string` | Current language dialog.content | N | Content. |
  2612. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  2613. | showIcon | `boolean` | `false` | N | Whether to show icon. |
  2614. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | Icon parameters. |
  2615. | btnStyle | `'button'\|'text'\|'textLine'` | `'button'` | N | Button style. |
  2616. | primaryText | `string` | Current language dialog.primaryText | N | Primary button text. |
  2617. | primaryButton | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | Primary button parameters. |
  2618. | secondaryText | `string` | Current language dialog.secondaryText | N | Secondary button text. |
  2619. | secondaryButton | [`Button`](https://stdf.design/components?nav=button&tab=1) | `{}` | N | Secondary button parameters. |
  2620. | btnRatio | `[number,number]` | `[1, 1]` | N | Size ratio of primary and secondary buttons. |
  2621. | btnReverse | `boolean` | `false` | N | Whether to reverse button positions. |
  2622. | secondaryClose | `boolean` | `true` | N | Whether secondary button closes dialog. |
  2623. | btnGap | `'0'\|'1'\|'2'\|'4'\|'8'\|'12'\|'16'` | `'2'` | N | Gap between buttons. |
  2624. ## Dialog Events
  2625. | Name | Type | Parameters | Description |
  2626. | ----------- | ------------ | ---------- | ------------------------------------------- |
  2627. | onclose | `() => void` | - | Triggered when dialog closes. |
  2628. | onprimary | `() => void` | - | Triggered when primary button is clicked. |
  2629. | onsecondary | `() => void` | - | Triggered when secondary button is clicked. |
  2630. ## Dialog Snippets
  2631. | Name | Type | Parameters | Description |
  2632. | ------------ | ------------------------------------------------------------------- | ---------- | -------------------------------------------- |
  2633. | contentChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Render the content when it is passed in. |
  2634. | primaryChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Render the primaryText when it is passed in. |
  2635. ================================================
  2636. FILE: docs/mds/components/dialog/FAQ.md
  2637. ================================================
  2638. ================================================
  2639. FILE: docs/mds/components/dialog/FAQ_en.md
  2640. ================================================
  2641. ================================================
  2642. FILE: docs/mds/components/dialog/guide.md
  2643. ================================================
  2644. ## 使用
  2645. Dialog 对话框一般用于展示一些需要用户明确知悉的内容或步骤,同时可以完成一些简单的交互操作,为避免误触,点击遮罩默认不会关闭。比一般只用于展示的 Modal 组件更加强大一些。
  2646. ## 说明
  2647. Dialog 弹框组件是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 easeType 换了一种缓动效果。
  2648. 而 Dialog 内部又使用了 Icon 和 Button 组件,可以通过传入 Icon 和 Button 的 Props 来实现不同的效果。比如示例中通过设置 Button 的 radius 自定义按钮的圆角风格。
  2649. ## contentChild
  2650. Dialog 的内容可以通过 contentChild 这个 Snippet 渲染,当需要显示复杂内容时,可以通过此方式来实现。
  2651. ## btnRatio
  2652. Dialog 的按钮有主次之分,通过 btnRatio 可以设置主次按钮的大小比例,如 btnRatio 为 `[2,1]` 时,主按钮宽度为次按钮的两倍。
  2653. ## 关闭
  2654. Dialog 默认不会自动关闭,默认点击内部次要按钮可以关闭,或者通过改变外部的 visible 来关闭。当然这些参数都可以通过传入的 Props 来控制。
  2655. ================================================
  2656. FILE: docs/mds/components/dialog/guide_en.md
  2657. ================================================
  2658. ## Usage
  2659. Dialog is generally used to display content or steps that users need to be clearly aware of, while also enabling simple interactions. To prevent accidental touches, clicking the mask will not close the dialog by default. It is more powerful than the Modal component which is mainly used for display.
  2660. ## Description
  2661. The Dialog component is built on top of Popup by pre-defining some Popup Props. Therefore, different effects can be achieved by passing in Popup properties. For example, in the demo, a different easing effect is achieved by setting the easeType of popup.
  2662. Dialog internally uses Icon and Button components, and different effects can be achieved by passing in Icon and Button Props. For example, in the demo, the button's rounded corner style is customized by setting the Button's radius.
  2663. ## contentChild
  2664. The content of Dialog can be rendered through the contentChild Snippet. When complex content needs to be displayed, it can be achieved through this method.
  2665. ## btnRatio
  2666. Dialog's buttons have primary and secondary distinctions. The size ratio of primary and secondary buttons can be set through btnRatio. For example, when btnRatio is `[2,1]`, the width of the primary button is twice that of the secondary button.
  2667. ## Close
  2668. Dialog will not automatically close by default. By default, clicking the internal secondary button can close it, or it can be closed by changing the external visible prop. Of course, these parameters can be controlled through the passed Props.
  2669. ================================================
  2670. FILE: docs/mds/components/dialog/version.md
  2671. ================================================
  2672. ================================================
  2673. FILE: docs/mds/components/dialog/version_en.md
  2674. ================================================
  2675. ================================================
  2676. FILE: docs/mds/components/divider/api.md
  2677. ================================================
  2678. ## Divider Props
  2679. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2680. | -------- | ----------------------------- | ---------- | ---- | --------------------------- |
  2681. | layout | `'h'\|'v'` | `'h'` | N | 分隔线类型,水平 h/垂直 v。 |
  2682. | px | `'0'\|'4'\|'8'\|'16'\|'36'` | `'0'` | N | 左右留白(仅水平有效)。 |
  2683. | py | `'0'\|'4'\|'8'` | `'4'` | N | 高度(仅水平有效)。 |
  2684. | text | `string` | `''` | N | 文本内容(仅水平有效)。 |
  2685. | align | `'left'\|'center'\|'right'` | `'center'` | N | 文本位置(仅水平有效)。 |
  2686. | line | `'solid'\|'dashed'\|'dotted'` | `'solid'` | N | 线条风格。 |
  2687. | weight | `'1'\|'2'\|'4'` | `'1'` | N | 线条粗细。 |
  2688. | mx | `'1'\|'2'\|'4'` | `'1'` | N | 左右间距(仅垂直有效)。 |
  2689. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  2690. ================================================
  2691. FILE: docs/mds/components/divider/api_en.md
  2692. ================================================
  2693. ## Divider Props
  2694. | Name | Type | Default | Required | Description |
  2695. | -------- | ----------------------------- | ---------- | -------- | ----------------------------------------- |
  2696. | layout | `'h'\|'v'` | `'h'` | N | Divider type, horizontal h/vertical v. |
  2697. | px | `'0'\|'4'\|'8'\|'16'\|'36'` | `'0'` | N | Left and right padding (horizontal only). |
  2698. | py | `'0'\|'4'\|'8'` | `'4'` | N | Height (horizontal only). |
  2699. | text | `string` | `''` | N | Text content (horizontal only). |
  2700. | align | `'left'\|'center'\|'right'` | `'center'` | N | Text position (horizontal only). |
  2701. | line | `'solid'\|'dashed'\|'dotted'` | `'solid'` | N | Line style. |
  2702. | weight | `'1'\|'2'\|'4'` | `'1'` | N | Line thickness. |
  2703. | mx | `'1'\|'2'\|'4'` | `'1'` | N | Left and right margin (vertical only). |
  2704. | injClass | `string` | `''` | N | Inject CSS class name. |
  2705. ================================================
  2706. FILE: docs/mds/components/divider/FAQ.md
  2707. ================================================
  2708. ================================================
  2709. FILE: docs/mds/components/divider/FAQ_en.md
  2710. ================================================
  2711. ================================================
  2712. FILE: docs/mds/components/divider/guide.md
  2713. ================================================
  2714. ## CSS 注入
  2715. 由于 Divider 是利用元素的 border 实现,所以无论是水平还是垂直时,injClass 注入的的 class 只会对相应属性生效,border 属性对线条生效,text 属性对水平分割线内文本生效。
  2716. ## 可选值
  2717. 传入可选值以外的参数将按照默认参数处理。
  2718. ## Props 类型
  2719. 部分 Props 比如 px、py、weight、mx,明明是数字为何要用字符类型?主要是由于可选参数传入组件内部是作为 object 的 key 使用的,就必须为字符,况且组件传值的时候写 '' 应该比写 {} 更方便吧!坚持传入数字的话也可以,只是开启类型检查时会报错。
  2720. ================================================
  2721. FILE: docs/mds/components/divider/guide_en.md
  2722. ================================================
  2723. ## Injecting CSS
  2724. As Divider uses element borders to create the line effect, the injClass passed in will only affect the corresponding properties, such as the border property affecting the line and the text property affecting the text in the horizontal divider.
  2725. ## Available Options
  2726. Passing in values other than the available options will be treated as the default parameters.
  2727. ## Prop Types
  2728. For some Props such as px, py, weight, mx, they are clearly numbers, why use string types? It is mainly because the optional parameters passed in to the component are used as object keys inside, so they must be strings. Besides, it should be more convenient to write '' instead of {} when passing values to the component! Of course, you can also insist on passing in numbers, but it will report an error when type checking is enabled.
  2729. ================================================
  2730. FILE: docs/mds/components/divider/version.md
  2731. ================================================
  2732. ================================================
  2733. FILE: docs/mds/components/divider/version_en.md
  2734. ================================================
  2735. ================================================
  2736. FILE: docs/mds/components/grids/api.md
  2737. ================================================
  2738. ## Grids Props
  2739. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2740. | ---- | --------------------------------------------------------------- | ------ | ---- | ------------ |
  2741. | cols | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'10'\|'11'\|'12'` | `'6'` | N | 列数。 |
  2742. | gap | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | 单元格间距。 |
  2743. | mx | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | 左右外边距。 |
  2744. | my | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | 上下外边距。 |
  2745. ## Grids Snippets
  2746. | 名称 | 类型 | 参数 | 说明 |
  2747. | -------- | ------------------------------------------------------------------- | ---- | ------------ |
  2748. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Grids 内容。 |
  2749. ## Grid Props
  2750. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2751. | ---- | --------------------------------------------------------------- | ------ | ---- | ---------------- |
  2752. | col | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'10'\|'11'\|'12'` | `'1'` | N | 单元格所占列数。 |
  2753. | row | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'` | `'1'` | N | 单元格所占行数。 |
  2754. ## Grid Snippets
  2755. | 名称 | 类型 | 参数 | 说明 |
  2756. | -------- | ------------------------------------------------------------------- | ---- | ----------- |
  2757. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Grid 内容。 |
  2758. ================================================
  2759. FILE: docs/mds/components/grids/api_en.md
  2760. ================================================
  2761. ## Grids Props
  2762. | Name | Type | Default | Required | Description |
  2763. | ---- | --------------------------------------------------------------- | ------- | -------- | ----------------- |
  2764. | cols | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'10'\|'11'\|'12'` | `'6'` | N | Number of columns |
  2765. | gap | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | Cell spacing |
  2766. | mx | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | Horizontal margin |
  2767. | my | `'0'\|'1'\|'2'\|'4'\|'8'` | `'2'` | N | Vertical margin |
  2768. ## Grids Snippets
  2769. | Name | Type | Parameters | Description |
  2770. | -------- | ------------------------------------------------------------------- | ---------- | ------------- |
  2771. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Grids content |
  2772. ## Grid Props
  2773. | Name | Type | Default | Required | Description |
  2774. | ---- | --------------------------------------------------------------- | ------- | -------- | -------------------------------------- |
  2775. | col | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'7'\|'8'\|'9'\|'10'\|'11'\|'12'` | `'1'` | N | Number of columns occupied by the cell |
  2776. | row | `'1'\|'2'\|'3'\|'4'\|'5'\|'6'` | `'1'` | N | Number of rows occupied by the cell |
  2777. ## Grid Snippets
  2778. | Name | Type | Parameters | Description |
  2779. | -------- | ------------------------------------------------------------------- | ---------- | ------------ |
  2780. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Grid content |
  2781. ================================================
  2782. FILE: docs/mds/components/grids/FAQ.md
  2783. ================================================
  2784. ================================================
  2785. FILE: docs/mds/components/grids/FAQ_en.md
  2786. ================================================
  2787. ================================================
  2788. FILE: docs/mds/components/grids/guide.md
  2789. ================================================
  2790. ## 说明
  2791. Grids 组件本质使用 CSS 的 grid 布局,只是将 grid 在参数上做了一下简化,使用起来更方便。
  2792. 移动端没有了 IE 浏览器,grid 的兼容性已经非常乐观了,可放心食用。
  2793. ## 使用
  2794. Grids 的 cols 决定了内部等分的列数,而高度由每个单元格内部元素的高度决定。
  2795. ## 行与列
  2796. Grid 的 row 和 col 属性决定了单元格所占行数和列数,默认为 1。
  2797. 排列行列小技巧:**优先从左上角开始摆放,右侧放不下将挤到下一行。**
  2798. ================================================
  2799. FILE: docs/mds/components/grids/guide_en.md
  2800. ================================================
  2801. ## Description
  2802. The Grids component essentially uses CSS grid layouts, but simplifies the grid with parameters for more convenient use.
  2803. With the disappearance of Internet Explorer on mobile devices, the compatibility of grid layout is now very optimistic and can be used with confidence.
  2804. ## Usage
  2805. The `cols` property of Grids determines the number of columns in the internal division, while the height is determined by the height of the internal elements of each cell.
  2806. ## Rows and Columns
  2807. The `row` and `col` properties of Grid determine the number of rows and columns occupied by the cell, respectively, and the default is 1.
  2808. A small tip for arranging rows and columns: **start from the top left corner and place items in a row, if there is no room on the right side, they will be squeezed into the next row.**
  2809. ================================================
  2810. FILE: docs/mds/components/grids/version.md
  2811. ================================================
  2812. ## 1.0.8
  2813. - [!tag|B|2|] 修复 Grid Props 的 `col` 为 `'10'|'11'|'12'` 时的类名错误 [PR#45](https://github.com/any-tdf/stdf/pull/45)。[!contribute|nakulrathore|]
  2814. ================================================
  2815. FILE: docs/mds/components/grids/version_en.md
  2816. ================================================
  2817. ## 1.0.8
  2818. - [!tag|B|2|] Fixed the class name error when `col` is `'10'|'11'|'12'` in Grid Props [PR#45](https://github.com/any-tdf/stdf/pull/45). [!contribute|nakulrathore|]
  2819. ================================================
  2820. FILE: docs/mds/components/icon/api.md
  2821. ================================================
  2822. ## Icon Props
  2823. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2824. | -------- | --------- | -------------------- | ---- | -------------------------------- |
  2825. | name | `string` | `''` | N | 图标名称。 |
  2826. | size | `number` | `24` | N | 图标大小。 |
  2827. | theme | `boolean` | `false` | N | 是否跟随主题色(包含亮暗模式)。 |
  2828. | alpha | `number` | `1` | N | 图标透明度。 |
  2829. | top | `number` | `0` | N | 上下偏移量。 |
  2830. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  2831. | path | `string` | `'fonts/symbol.svg'` | N | 项目存放 symbol.svg 的路径。 |
  2832. ## Icon Snippets
  2833. | 名称 | 类型 | 参数 | 说明 |
  2834. | -------- | ------------------------------------------------------------------- | ---- | ----------------------------------------- |
  2835. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 自定义内容,一般是 Icon 组件或 SVG 元素。 |
  2836. ================================================
  2837. FILE: docs/mds/components/icon/api_en.md
  2838. ================================================
  2839. ## Icon Props
  2840. | Name | Type | Default | Required | Description |
  2841. | -------- | --------- | -------------------- | -------- | ------------------------------------------------ |
  2842. | name | `string` | `''` | N | Icon name. |
  2843. | size | `number` | `24` | N | Icon size. |
  2844. | theme | `boolean` | `false` | N | Whether to follow theme color (light/dark mode). |
  2845. | alpha | `number` | `1` | N | Icon opacity. |
  2846. | top | `number` | `0` | N | Vertical offset. |
  2847. | injClass | `string` | `''` | N | Injected CSS class name. |
  2848. | path | `string` | `'fonts/symbol.svg'` | N | Project path for symbol.svg file. |
  2849. ## Icon Snippets
  2850. | Name | Type | Parameters | Description |
  2851. | -------- | ------------------------------------------------------------------- | ---------- | ------------------------------------------------------ |
  2852. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Custom content, usually Icon component or SVG element. |
  2853. ================================================
  2854. FILE: docs/mds/components/icon/FAQ.md
  2855. ================================================
  2856. ================================================
  2857. FILE: docs/mds/components/icon/FAQ_en.md
  2858. ================================================
  2859. ================================================
  2860. FILE: docs/mds/components/icon/guide.md
  2861. ================================================
  2862. ## 背景
  2863. STDF 使用 SVG Sprites 技术使用图标,这样可以减少 HTTP 请求,提高页面性能。
  2864. STDF 的 SVG Sprites 是使用 [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol),大致原理类似于 CSS 中的 Sprite 技术,将项目中的 SVG 拼接在一个文件内,通过 SVG 中的 use 元素找到对应的图标来显示。
  2865. 你可以把它类比看成是一种字体,只不过这种字体是由 SVG 组成的,而且可以通过 CSS 控制颜色、大小等属性。所以如果用到比较大或者有多种颜色等比较复杂的图标,建议单独引入 SVG 文件使用,不要放在 symbol 中。
  2866. 兼容性方面也完全没问题。参考 [MDN symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol#browser_compatibility)。
  2867. ## rollup-plugin-stdf-icon
  2868. STDF 已经开发了一个 Rollup/Vite 插件,用于将项目中的 SVG 文件合并成 SVG Sprites,具体使用请参考 [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon),由于 svg 格式的多样性,可能存在 rollup-plugin-stdf-icon 处理不准确的情况,请到 [GitHub](https://github.com/any-tdf/stdf/issues) 提 issue,注明 svg 文件的具体情况。
  2869. 或使用其他 SVG Sprites 合成工具或手动合成,也可以请设计师提供设计物料时一并提供对应的 SVG Sprites。或类似 Remix Icon 这样的图标库,可以直接将选定的多个图标下载为 SVG Sprites。
  2870. ## 内置说明
  2871. STDF 部分组件内使用的图标源自 [Remix Icon 图标库](https://remixicon.com)([GitHub](https://github.com/Remix-Design/remixicon)),在此表示感谢 🙏🏻🙏🏻。
  2872. **如果使用这些组件,请确保项目的 symbol.svg 中包含了对应图标。**
  2873. 具体请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  2874. 可到 `node_modules/stdf/assets/svg_base/` 查看这些图标的 SVG 源文件。
  2875. ## 图标名称
  2876. 当传入 Snippet 时表示图标内部使用传入的元素渲染,其他字符如 'ri-home-line' 使用 symbol.svg 中对应的 SVG 图标渲染。
  2877. ## 图标颜色
  2878. 如果 theme 不传或传入 false,图标颜色将继承自父级文字颜色,传入 true 图标颜色会根据主题色变化(包含亮暗模式);如果要实现自定义颜色,而颜色又同时包含亮暗模式,建议使用 CSS 注入或 Snippet 渲染,在 injClass 或 Snippet 中分别配置亮暗模式,请查看示例。
  2879. ## 颜色优先级
  2880. 颜色优先级 Snippet > injClass > theme > 默认。
  2881. ## 偏移量
  2882. 欧洲和西亚文字排版中是有一条基准线的,东亚文字没有基线,参考 [MDN](https://developer.mozilla.org/zh-CN/docs/Glossary/baseline)。但由于不同系统不同字体中的差异,可能导致图标与文字一起排列时上下无法对齐,可以通过偏移量来微调。或者某些图标由于视觉重心的差异,需要排版时给出偏移量来保持视觉平衡。
  2883. ## CSS 注入
  2884. 通过 injClass 参数可以向组件内部最外层元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性。因为 CSS 注入于最后,此时最外层元素若已有同属性 CSS 将会以 injClass 为准,这也是通过 injClass 实现自定义图标颜色的原因。
  2885. ## Snippet
  2886. 可放入任何元素(甚至 Icon 组件自身),当然主要用于自定义图标或自定义图标颜色,如将自定义 SVG 放入 Icon 组件,请注意 SVG 的 viewBox、height、width 关系与 display 属性。此时图标内容取决于传入的元素,Props 中的 name、size、theme 等参数都将失效。通过 Snippet 将使组件内容有更多自定义可能性。
  2887. ## 全局注入图标 svg 路径
  2888. STDF Icon 组件使用 Svg 文件路径配置,适用于一次性配置全局 SVG symbol 路径,或应用部署在服务器非根路径下。一般在应用的入口如 `App.svelte` 或 `+layout.svelte` 中配置 Context,例如:
  2889. ```svelte
  2890. <!-- App.svelte/+layout.svelte -->
  2891. <script>
  2892. import { setContext } from 'svelte'; // 引入 setContext
  2893. setContext('STDF-global-icon-svg-path', 'webapps/svelte_demo/fonts/symbol.svg'); // 设置 svg 文件路径
  2894. </script>
  2895. ```
  2896. ================================================
  2897. FILE: docs/mds/components/icon/guide_en.md
  2898. ================================================
  2899. ## Background
  2900. STDF uses SVG Sprites technology for icons, which reduces HTTP requests and improves page performance.
  2901. STDF's SVG Sprites uses [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol), with a principle similar to CSS Sprite technology - combining project SVG files into one file and displaying icons through the SVG use element.
  2902. You can think of it as a font, except it's composed of SVGs and can be styled with CSS properties like color and size. For large or complex icons with multiple colors, it's recommended to import SVG files separately rather than including them in the symbol.
  2903. Browser compatibility is not an issue. See [MDN symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol#browser_compatibility).
  2904. ## rollup-plugin-stdf-icon
  2905. STDF has developed a Rollup/Vite plugin to merge SVG files into SVG Sprites. For usage details, see [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon). Due to SVG format variations, if you encounter any issues with rollup-plugin-stdf-icon processing, please submit an issue on [GitHub](https://github.com/any-tdf/stdf/issues) with specific SVG file details.
  2906. You can also use other SVG Sprites generation tools, manual compilation, or request SVG Sprites from designers along with design assets. Icon libraries like Remix Icon allow direct download of selected icons as SVG Sprites.
  2907. ## Built-in Icons
  2908. Some STDF components use icons from [Remix Icon](https://remixicon.com) ([GitHub](https://github.com/Remix-Design/remixicon)). We express our gratitude 🙏🏻🙏🏻.
  2909. **When using these components, ensure your project's symbol.svg includes the corresponding icons.**
  2910. For details, refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  2911. You can find SVG source files in `node_modules/stdf/assets/svg_base/`.
  2912. ## Icon Names
  2913. When a Snippet is passed, the icon renders using the passed element. Other strings like 'ri-home-line' render the corresponding SVG icon from symbol.svg.
  2914. ## Icon Colors
  2915. Without theme prop or when set to false, icons inherit parent text color. When true, icons follow theme colors (including light/dark modes). For custom colors with light/dark mode support, use CSS injection or Snippet rendering with injClass or Snippet configured for both modes. See examples.
  2916. ## Color Priority
  2917. Color priority: Snippet > injClass > theme > default.
  2918. ## Vertical Offset
  2919. European and West Asian typography has a baseline, while East Asian text doesn't. See [MDN](https://developer.mozilla.org/zh-CN/docs/Glossary/baseline). Due to differences in system fonts, icons may misalign with text. Use the offset to fine-tune alignment or balance visual weight of icons.
  2920. ## CSS Injection
  2921. The injClass parameter injects CSS classes (not limited to Tailwind CSS) into the component's outer element, enabling more style customization. Since CSS injection occurs last, any existing CSS properties on the outer element will be overridden by injClass, which enables custom icon colors.
  2922. ## Snippet
  2923. Can contain any element (even Icon component itself), primarily used for custom icons or colors. When placing custom SVGs in Icon component, note the relationships between SVG viewBox, height, width, and display property. Icon content depends on the passed element, and Props like name, size, theme become ineffective. Snippets enable more customization possibilities for component content.
  2924. ## Global Injection Icon SVG Path
  2925. STDF Icon component uses SVG file path configuration, which is suitable for a one-time configuration of the global SVG symbol path or the application being deployed on a non-root server path. Usually, the Context is configured in the entry of the application, such as `App.svelte` or `+layout.svelte`, for example:
  2926. ```svelte
  2927. <!-- App.svelte/+layout.svelte -->
  2928. <script>
  2929. import { setContext } from 'svelte'; // Import setContext
  2930. setContext('STDF-global-icon-svg-path', 'webapps/svelte_demo/fonts/symbol.svg'); // Set the SVG file path
  2931. </script>
  2932. ```
  2933. ================================================
  2934. FILE: docs/mds/components/icon/version.md
  2935. ================================================
  2936. ## 0.5.3
  2937. - [!tag|O|0|] 支持一次性配置全局 SVG symbol 路径。关联 [PR](https://github.com/any-tdf/stdf/pull/28)。[!contribute|zh1047842950|]
  2938. ## 0.2.11
  2939. - [!tag|B|1|] Icon 组件区域不再是 `inline-block`。
  2940. ## 0.2.5
  2941. - [!tag|O|0|] path 默认值由 `/assets/fonts/symbol.svg` 修改为 `fonts/symbol.svg`。
  2942. ================================================
  2943. FILE: docs/mds/components/icon/version_en.md
  2944. ================================================
  2945. ## 0.5.3
  2946. - [!tag|O|0|] Support one-time configuration of the global SVG symbol path. Related to [PR](https://github.com/any-tdf/stdf/pull/28). [!contribute|zh1047842950|]
  2947. ## 0.2.11
  2948. - [!tag|B|1|] The Icon component area is no longer `inline-block`.
  2949. ## 0.2.5
  2950. - [!tag|O|0|] The default value of `path` has been changed from `/assets/fonts/symbol.svg` to `fonts/symbol.svg`.
  2951. ================================================
  2952. FILE: docs/mds/components/indexBar/api.md
  2953. ================================================
  2954. ## IndexBar Props
  2955. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2956. | ------------- | -------------------------- | ---------- | ---- | -------------------------------- |
  2957. | data | `IndexBarItem[]` | `[]` | Y | 索引数据组成的数组。 |
  2958. | current | `number` | `0` | N | 当前激活的索引值。 |
  2959. | top | `number` | `0` | N | 索引内容区域距离文档顶部的距离。 |
  2960. | height | `number` | `100` | Y | 索引内容区域高度。 |
  2961. | radius | `'none'\|'middle'\|'full'` | `'middle'` | N | 圆角风格。 |
  2962. | scrollAlign | `boolean` | `true` | N | 是否开启滚动自动对齐。 |
  2963. | titleInjClass | `string` | `''` | N | 索引组标题注入 CSS。 |
  2964. | textInjClass | `string` | `''` | N | 索引项文本注入 CSS。 |
  2965. ## IndexBar Events
  2966. | 名称 | 类型 | 参数 | 描述 |
  2967. | ------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------ |
  2968. | onclickChild | `(index: number, group: IndexBarItem, childIndex: number, child: string) => void` | index - 点击项的父级组索引值<br />group - 点击项的父级组内容<br />childIndex - 点击项索引值<br />child - 点击项内容 | 点击索引项时触发。 |
  2969. ## IndexBarItem Props
  2970. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  2971. | ------ | ---------- | ------ | ---- | ---------------- |
  2972. | index | `string` | `''` | Y | 索引值。 |
  2973. | title | `string` | `''` | Y | 标题。 |
  2974. | child | `string[]` | `[]` | Y | 子项组成的数组。 |
  2975. | height | `number` | `0` | N | 子项高度。 |
  2976. ================================================
  2977. FILE: docs/mds/components/indexBar/api_en.md
  2978. ================================================
  2979. ## IndexBar Props
  2980. | Name | Type | Default | Required | Description |
  2981. | ------------- | ------------------------ | -------- | -------- | ------------------------------------------------- |
  2982. | data | `IndexBarItem[]` | `[]` | Y | Array of index data. |
  2983. | current | `number` | `0` | N | Currently active index value. |
  2984. | top | `number` | `0` | N | Distance from index content area to document top. |
  2985. | height | `number` | `100` | Y | Height of index content area. |
  2986. | radius | `'none'\|'base'\|'full'` | `'base'` | N | Border radius style. |
  2987. | scrollAlign | `boolean` | `true` | N | Whether to enable scroll auto-alignment. |
  2988. | titleInjClass | `string` | `''` | N | Inject CSS for index group title. |
  2989. | textInjClass | `string` | `''` | N | Inject CSS for index item text. |
  2990. ## IndexBar Events
  2991. | Name | Type | Parameters | Description |
  2992. | ------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
  2993. | onclickChild | `(index: number, group: IndexBarItem, childIndex: number, child: string) => void` | index - Parent group index of clicked item<br />group - Parent group content of clicked item<br />childIndex - Index of clicked item<br />child - Content of clicked item | Triggered when clicking an index item. |
  2994. ## IndexBarItem Props
  2995. | Name | Type | Default | Required | Description |
  2996. | ------ | ---------- | ------- | -------- | ---------------------- |
  2997. | index | `string` | `''` | Y | Index value. |
  2998. | title | `string` | `''` | Y | Title. |
  2999. | child | `string[]` | `[]` | Y | Array of child items. |
  3000. | height | `number` | `0` | N | Height of child items. |
  3001. ================================================
  3002. FILE: docs/mds/components/indexBar/FAQ.md
  3003. ================================================
  3004. ================================================
  3005. FILE: docs/mds/components/indexBar/FAQ_en.md
  3006. ================================================
  3007. ================================================
  3008. FILE: docs/mds/components/indexBar/guide.md
  3009. ================================================
  3010. ## 说明
  3011. 一般用于页面中信息快速检索,可以根据目录中的索引值快速找到所需的内容。
  3012. ## data
  3013. 此 Props 是索引项组组成的数组,基本结构为`{ index: 'x', title: 'xx', child: ['xx', 'xx'] }`,其中 index 用于显示右侧 Bar 内的文字(建议单个字符),title 为内容区域每一组索引的标题,child 为一组索引内的单项内容,具体使用请参考示例。
  3014. ## height && top
  3015. 由于索引的内容区域在 Y 轴滚动,需要内容区域的高度,同时需要结合内容区域距离文档顶部的距离,用于监听与设置内容区域的滚动位置等操作。
  3016. 建议 data 长度较大时 height 请传入较大值,总不能整个索引内容显示区域还没右侧的滑动 Bar 区域高吧。当然也不能传入过大,导致滚动区域显示不全或出现多个滚动条问题。
  3017. ## CSS 注入
  3018. IndexBar 支持在两个地方注入 Class,注入 titleInjClass 会在索引组标题生效,注入 textInjClass 会在索引项的文本处生效。可以参考示例中改变索引内容区域样式。
  3019. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 Tailwind Important modifier。
  3020. ## scrollAlign
  3021. 当索引内容区域滚动结束时,通过 CSS 的 scroll-snap-align 模块,每组索引内容顶部都会自动吸附到内容区域顶部,当然如果觉得影响滚动体验或不需要的话也可以关闭。
  3022. 关于 scroll-snap-align 可参考 [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-align)。
  3023. ================================================
  3024. FILE: docs/mds/components/indexBar/guide_en.md
  3025. ================================================
  3026. ## Description
  3027. Generally used for quickly searching information on a page, where you can quickly find the desired content based on the index value in the directory.
  3028. ## data
  3029. This Props is an array composed of indexing items, the basic structure is `{ index: 'x', title: 'xx', child: ['xx', 'xx'] }`, where index is used to display the text in the right-side bar (it is recommended to use a single character), title is the title of each index group in the content area, and child is the content of a single indexing group. For specific usage, please refer to the example.
  3030. ## height && top
  3031. Since the content area of the index scrolls on the Y-axis, the height of the content area is required, and the distance between the content area and the top of the document needs to be combined to listen for and set the scroll position in the content area and other operations.
  3032. When the length of data is large, it is recommended to pass in a larger value for height. After all, the display area of the entire index content cannot be lower than the height of the right-side scroll bar area. Of course, it cannot be too large either, which may cause the scroll area to be incomplete or multiple scrollbars to appear.
  3033. ## CSS injection
  3034. IndexBar supports injecting classes in two places, where injecting titleInjClass will have an effect on the title of the indexing group, and injecting textInjClass will have an effect on the text of the indexing item. You can refer to the example to change the style of the index content area.
  3035. If the injected class is not effective, please prefix the injected class name with "!". You can refer to the Tailwind Important modifier.
  3036. ## scrollAlign
  3037. When the index content area scrolls to an end, based on the CSS scroll-snap-align module, the top of each group of index content will automatically snap to the top of the content area. Of course, this feature can also be turned off if it affects the scrolling experience or is not needed.
  3038. Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-align) for more information on scroll-snap-align.
  3039. ================================================
  3040. FILE: docs/mds/components/indexBar/version.md
  3041. ================================================
  3042. ## 0.5.1
  3043. - [!tag|O|0|]优化滑动动画效果。
  3044. ================================================
  3045. FILE: docs/mds/components/indexBar/version_en.md
  3046. ================================================
  3047. ## 0.5.1
  3048. - [!tag|O|0|] Optimize the sliding animation effect.
  3049. ================================================
  3050. FILE: docs/mds/components/input/api.md
  3051. ================================================
  3052. ## Input Props
  3053. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3054. | ----------------- | --------------------------------------------------------------------------------------------------------- | --------- | ---- | ------------------------------- |
  3055. | title | `string` | `''` | N | 标题内容。 |
  3056. | titlePosition | `'in'\|'out'\|null` | `'out'` | N | 标题位置。 |
  3057. | inputPosition | `'left'\|'right'` | `'left'` | N | 输入框文字位置。 |
  3058. | placeholder | `string` | `''` | N | 输入框提示文本。 |
  3059. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  3060. | inputStyle | `'block'\|'line'` | `'block'` | N | 输入框风格。 |
  3061. | lineTransition | `'left'\|'center'` | `'left'` | N | 线性过渡位置。 |
  3062. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | 过渡时间。 |
  3063. | autocomplete | `boolean` | `true` | N | 是否开启自动填充功能。 |
  3064. | py | `'0'\|'0.5'\|'1'\|'2'\|'3'\|'4'\|'6'` | `'2'` | N | 垂直间距。 |
  3065. | disabled | `boolean` | `false` | N | 是否禁用。 |
  3066. | state | `'theme'\|'success'\|'warning'\|'error'\|'info'` | `'theme'` | N | 状态。 |
  3067. | type | `'text'\|'decimal'\|'email'\|'none'\|'numeric'\|'search'\|'tel'\|'url'\|'password'\|'number'\|'textarea'` | `'text'` | N | 输入框类型。 |
  3068. | inputmode | `'text'\|'decimal'\|'email'\|'none'\|'numeric'\|'search'\|'tel'\|'url'\|''` | `''` | N | 指定输入的数据类型。 |
  3069. | maxlength | `number` | `24` | N | 最多可输入文本长度。 |
  3070. | textareaMaxlength | `number` | `200` | N | textarea 时最多可输入文本长度。 |
  3071. | rows | `number` | `2` | N | textarea 时行数。 |
  3072. | autosize | `boolean` | `false` | N | textarea 时是否自动调整高度。 |
  3073. | negative | `boolean` | `false` | N | 是否允许输入负数。 |
  3074. | label1 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | 标签 1 内容。 |
  3075. | label2 | `string\|null` | `null` | N | 标签 2 内容。 |
  3076. | label3 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | 标签 3 内容。 |
  3077. | label4 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | 标签 4 内容。 |
  3078. | label5 | `string\|null` | `null` | N | 标签 5 内容。 |
  3079. | label6 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | 标签 6 内容。 |
  3080. | tip | `string\|null` | `null` | N | 提示信息内容。 |
  3081. | data1 | `string\|null` | `null` | N | 数据项 1 内容。 |
  3082. | data2 | `string\|null` | `null` | N | 数据项 2 内容。 |
  3083. | data3 | `string\|null` | `null` | N | 数据项 3 内容。 |
  3084. | value | `string` | `''` | N | 输入框值。 |
  3085. | clear | `boolean` | `false` | N | 是否可清空。 |
  3086. ## Input Events
  3087. | 名称 | 类型 | 参数 | 说明 |
  3088. | ------------- | ------------------------- | -------------------- | ------------------------ |
  3089. | onfocus | `(value: string) => void` | value - 当前 value | 获得焦点时触发。 |
  3090. | onblur | `(value: string) => void` | value - 当前 value | 失去焦点时触发。 |
  3091. | onchange | `(value: string) => void` | value - 当前 value | 输入框值发生变化时触发。 |
  3092. | onclear | `() => void` | - | 清空按钮点击时触发。 |
  3093. | onclickLabel1 | `() => void` | - | 点击标签 1 时触发。 |
  3094. | onclickLabel2 | `() => void` | - | 点击标签 2 时触发。 |
  3095. | onclickLabel3 | `() => void` | - | 点击标签 3 时触发。 |
  3096. | onclickLabel4 | `() => void` | - | 点击标签 4 时触发。 |
  3097. | onclickLabel5 | `() => void` | - | 点击标签 5 时触发。 |
  3098. | onclickLabel6 | `() => void` | - | 点击标签 6 时触发。 |
  3099. | onkeydown | `(key: string) => void` | key - 按下的按键 key | 按下键盘时触发。 |
  3100. ## Input Snippets
  3101. | 名称 | 类型 | 参数 | 说明 |
  3102. | ----------- | ------------------------------------------------------------------- | ---- | ----------------------- |
  3103. | titleChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标题 Snippet 内容。 |
  3104. | data1Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 数据项 1 Snippet 内容。 |
  3105. | data2Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 数据项 2 Snippet 内容。 |
  3106. | data3Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 数据项 3 Snippet 内容。 |
  3107. | label1Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 1 Snippet 内容。 |
  3108. | label2Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 2 Snippet 内容。 |
  3109. | label3Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 3 Snippet 内容。 |
  3110. | label4Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 4 Snippet 内容。 |
  3111. | label5Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 5 Snippet 内容。 |
  3112. | label6Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 标签 6 Snippet 内容。 |
  3113. | tipChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 提示信息 Snippet 内容。 |
  3114. ================================================
  3115. FILE: docs/mds/components/input/api_en.md
  3116. ================================================
  3117. ## Input Props
  3118. | Name | Type | Default | Required | Description |
  3119. | ----------------- | --------------------------------------------------------------------------------------------------------- | --------- | -------- | --------------------------------- |
  3120. | title | `string` | `''` | N | Title content. |
  3121. | titlePosition | `'in'\|'out'\|null` | `'out'` | N | Title position. |
  3122. | inputPosition | `'left'\|'right'` | `'left'` | N | Input text position. |
  3123. | placeholder | `string` | `''` | N | Input placeholder text. |
  3124. | radius | `'none'\|'base'\|'xl'\|'full'` | `'base'` | N | Border radius style. |
  3125. | inputStyle | `'block'\|'line'` | `'block'` | N | Input box style. |
  3126. | lineTransition | `'left'\|'center'` | `'left'` | N | Linear transition position. |
  3127. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | Transition duration. |
  3128. | autocomplete | `boolean` | `true` | N | Whether to enable autocomplete. |
  3129. | py | `'0'\|'0.5'\|'1'\|'2'\|'3'\|'4'\|'6'` | `'2'` | N | Vertical padding. |
  3130. | disabled | `boolean` | `false` | N | Whether disabled. |
  3131. | state | `'theme'\|'success'\|'warning'\|'error'\|'info'` | `'theme'` | N | State. |
  3132. | type | `'text'\|'decimal'\|'email'\|'none'\|'numeric'\|'search'\|'tel'\|'url'\|'password'\|'number'\|'textarea'` | `'text'` | N | Input type. |
  3133. | inputmode | `'text'\|'decimal'\|'email'\|'none'\|'numeric'\|'search'\|'tel'\|'url'\|''` | `''` | N | Specify input data type. |
  3134. | maxlength | `number` | `24` | N | Maximum input text length. |
  3135. | textareaMaxlength | `number` | `200` | N | Maximum text length for textarea. |
  3136. | rows | `number` | `2` | N | Number of rows for textarea. |
  3137. | autosize | `boolean` | `false` | N | Auto adjust height for textarea. |
  3138. | negative | `boolean` | `false` | N | Whether to allow negative numbers. |
  3139. | label1 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | Label 1 content. |
  3140. | label2 | `string\|null` | `null` | N | Label 2 content. |
  3141. | label3 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | Label 3 content. |
  3142. | label4 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | Label 4 content. |
  3143. | label5 | `string\|null` | `null` | N | Label 5 content. |
  3144. | label6 | [`Icon`](https://stdf.design/components?nav=icon&tab=1)\|`null` | `null` | N | Label 6 content. |
  3145. | tip | `string\|null` | `null` | N | Tip message content. |
  3146. | data1 | `string\|null` | `null` | N | Data item 1 content. |
  3147. | data2 | `string\|null` | `null` | N | Data item 2 content. |
  3148. | data3 | `string\|null` | `null` | N | Data item 3 content. |
  3149. | value | `string` | `''` | N | Input value. |
  3150. | clear | `boolean` | `false` | N | Whether clearable. |
  3151. ## Input Events
  3152. | Name | Type | Parameters | Description |
  3153. | ------------- | ------------------------- | --------------------- | --------------------------------------- |
  3154. | onfocus | `(value: string) => void` | value - current value | Triggered when input gets focus. |
  3155. | onblur | `(value: string) => void` | value - current value | Triggered when input loses focus. |
  3156. | onchange | `(value: string) => void` | value - current value | Triggered when input value changes. |
  3157. | onclear | `() => void` | - | Triggered when clear button is clicked. |
  3158. | onclickLabel1 | `() => void` | - | Triggered when Label 1 is clicked. |
  3159. | onclickLabel2 | `() => void` | - | Triggered when Label 2 is clicked. |
  3160. | onclickLabel3 | `() => void` | - | Triggered when Label 3 is clicked. |
  3161. | onclickLabel4 | `() => void` | - | Triggered when Label 4 is clicked. |
  3162. | onclickLabel5 | `() => void` | - | Triggered when Label 5 is clicked. |
  3163. | onclickLabel6 | `() => void` | - | Triggered when Label 6 is clicked. |
  3164. | onkeydown | `(key: string) => void` | key - pressed key | Triggered when keyboard key is pressed. |
  3165. ## Input Snippets
  3166. | Name | Type | Parameters | Description |
  3167. | ----------- | ------------------------------------------------------------------- | ---------- | ---------------------------- |
  3168. | titleChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Title Snippet content. |
  3169. | data1Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Data item 1 Snippet content. |
  3170. | data2Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Data item 2 Snippet content. |
  3171. | data3Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Data item 3 Snippet content. |
  3172. | label1Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 1 Snippet content. |
  3173. | label2Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 2 Snippet content. |
  3174. | label3Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 3 Snippet content. |
  3175. | label4Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 4 Snippet content. |
  3176. | label5Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 5 Snippet content. |
  3177. | label6Child | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Label 6 Snippet content. |
  3178. | tipChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Tip message Snippet content. |
  3179. ================================================
  3180. FILE: docs/mds/components/input/FAQ.md
  3181. ================================================
  3182. ================================================
  3183. FILE: docs/mds/components/input/FAQ_en.md
  3184. ================================================
  3185. ================================================
  3186. FILE: docs/mds/components/input/guide.md
  3187. ================================================
  3188. > Input 使用了图标 ri-close-circle-fill,请确保项目的 symbol.svg 文件中包含此图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  3189. ## title 与 placeholder
  3190. 如果传入了 title 而未传入 placeholder,Input 组件内部使用”请输入+title“作为默认 placeholder,**title 和 placeholder 请至少传入一项**。
  3191. ## type 与 inputmode
  3192. 关于 inputmode 请参考 [MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/inputmode) 。
  3193. 针对移动端交互特性,Input 组件主要用于输入文本,原生 input 标签的 type 值 file、radio、date 等有其他组件支持或交互方式,同时 type 与 inputmode 有高度重合性,type 的可选值在 inputmode 的基础上增加了 password 与 number。**使用时一般只需要传入 type 即可,当然你也可以单独设置 inputmode。**
  3194. 因为在组件内部对输入内容做了一些处理,渲染为页面的最终 input 时 type 除了 password 外输入框内都会被转成 text,获取返回值时请自行转换类型。
  3195. ## 监听按键事件
  3196. Input 组件内部监听了键盘按键事件,当按下任意按键时会触发 onkeydown 事件,返回的 `value` 表示按下的按键 key(备注:keyCode 已弃用,参考 [MDN](https://developer.mozilla.org/zh-CN/docs/Web/API/KeyboardEvent/keyCode) ),可根据此值做一些特殊处理。参考示例。
  3197. ## 可配置项
  3198. Input 组件的所有可配置项位置如下图所示。
  3199. <img src="input.png" alt="input config" title="输入框配置项">
  3200. 一般 label1、label3、label4、label6 用 Icon Props,label2 与 label5 用文字。
  3201. 当然,如果这些配置项不能满足需求,它们也都支持使用 Snippet 渲染,请参考示例。
  3202. ## textarea
  3203. textareaMaxlength、rows、autosize 三个参数只在 type 为 'textarea' 时生效,而且当 autosize 为 true 时 rows 将失效。
  3204. ## CJK 输入
  3205. 输入中日韩文等各种包含【选字】环节的文字过程中,组件内部在对输入长度、内容等信息处理时,是在**内容上屏后**才做校验。
  3206. ================================================
  3207. FILE: docs/mds/components/input/guide_en.md
  3208. ================================================
  3209. > Input uses the icon ri-close-circle-fill. Please ensure this icon is included in your project's symbol.svg file. For detailed information, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  3210. ## title and placeholder
  3211. If title is provided but placeholder is not, the Input component internally uses "Please enter + title" as the default placeholder. **At least one of title or placeholder must be provided**.
  3212. ## type and inputmode
  3213. For inputmode, please refer to [MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/inputmode).
  3214. Considering mobile interaction characteristics, the Input component is mainly used for text input. Native input tag type values like file, radio, date, etc. have other component support or interaction methods. Additionally, type and inputmode have high overlap, with type adding password and number options on top of inputmode's base values. **Generally, you only need to pass type, though you can set inputmode separately if needed.**
  3215. Because the component internally processes input content, when rendering the final input to the page, all type values except password will be converted to text. Please convert the return value type as needed.
  3216. ## Listening to Key Events
  3217. The Input component internally listens to keyboard events. When any key is pressed, it triggers the onkeydown event, returning a `value` representing the pressed key (Note: keyCode is deprecated, refer to [MDN](https://developer.mozilla.org/zh-CN/docs/Web/API/KeyboardEvent/keyCode)). You can handle this value for special processing. See examples.
  3218. ## Configuration Options
  3219. All configurable items of the Input component are shown in the image below.
  3220. <img src="input_en.png" alt="input config" title="Input Configuration Items">
  3221. Typically, label1, label3, label4, and label6 use Icon Props, while label2 and label5 use text.
  3222. Of course, if these configuration options don't meet your needs, they all support Snippet rendering. Please refer to the examples.
  3223. ## textarea
  3224. The parameters textareaMaxlength, rows, and autosize only take effect when type is 'textarea', and when autosize is true, rows will be ineffective.
  3225. ## CJK Input
  3226. When inputting Chinese, Japanese, Korean, or other text that involves a character selection process, the component internally validates input length, content, and other information **only after the content is committed to the screen**.
  3227. ================================================
  3228. FILE: docs/mds/components/input/version.md
  3229. ================================================
  3230. ## 1.0.6
  3231. - [!tag|B|3|]修复切换亮暗模式时,输入框 placeholder 字体颜色不跟随变化的问题。
  3232. ## 1.0.5
  3233. - [!tag|B|3|]输入数字时不允许小数点开头。
  3234. ## 1.0.4
  3235. - [!tag|B|3|]触发 `onclear` 同时也触发 `onchange`。
  3236. - [!tag|A|0|]通过 `negative` 属性允许输入负数 [Issue#37](https://github.com/any-tdf/stdf/issues/37) [PR#38](https://github.com/any-tdf/stdf/pull/38)。[!issue|sbscan|] [!contribute|rizmyabdulla|]
  3237. - [!tag|O|0|]输入数字时不允许小数点开头且只允许一个小数点。
  3238. ## 0.3.2
  3239. - [!tag|B|2|]修复 textarea 回车无法换行的问题。
  3240. ## 0.3.1
  3241. - [!tag|A|0|]新增监听键盘事件 keydown。
  3242. ## 0.0.11
  3243. - [!tag|O|0|]垂直间距 py 默认值改为 2,并新增 3 与 6 两个可选值。
  3244. - [!tag|O|0|]标题与输入框增加一点间距。
  3245. ================================================
  3246. FILE: docs/mds/components/input/version_en.md
  3247. ================================================
  3248. ## 1.0.6
  3249. - [!tag|B|3|] Fix the problem that the input box placeholder font color does not follow the change when the light and dark mode is switched.
  3250. ## 1.0.5
  3251. - [!tag|B|3|] Do not allow decimal points to start when entering numbers.
  3252. ## 1.0.4
  3253. - [!tag|B|3|] Trigger `onclear` also triggers `onchange`.
  3254. - [!tag|A|0|] Allow negative numbers through the `negative` property [Issue#37](https://github.com/any-tdf/stdf/issues/37) [PR#38](https://github.com/any-tdf/stdf/pull/38). [!issue|sbscan|] [!contribute|rizmyabdulla|]
  3255. - [!tag|O|0|] Do not allow decimal points to start and only allow one decimal point when entering numbers.
  3256. ## 0.3.2
  3257. - [!tag|B|2|] Fixed the problem that textarea cannot wrap when pressing enter.
  3258. ## 0.3.1
  3259. - [!tag|A|0|] Added keydown event listener.
  3260. ## 0.0.11
  3261. - [!tag|O|0|] The default vertical spacing of py has been changed to 2, and two optional values of 3 and 6 have been added.
  3262. - [!tag|O|0|] A little extra spacing has been added between the title and input box.
  3263. ================================================
  3264. FILE: docs/mds/components/loading/api.md
  3265. ================================================
  3266. ## Loading Props
  3267. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3268. | ------------- | ---------------------------------------------------------------------------------------------- | ------- | ---- | ---------------------------------- |
  3269. | type | `string` | `'1_0'` | N | 类型编号。 |
  3270. | height | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'\|'28'\|'36'\|'48'\|'56'\|'64'\|'72'\|'80'\|'96'\|'full'` | `'8'` | N | 容器高度。 |
  3271. | width | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'\|'28'\|'36'\|'48'\|'56'\|'64'\|'72'\|'80'\|'96'\|'full'` | `'8'` | N | 容器宽度。 |
  3272. | theme | `boolean` | `false` | N | 是否使用主题色,仅单色生效。 |
  3273. | inverse | `boolean` | `false` | N | 是否使用反差色,仅单色与双色生效。 |
  3274. | customColor | `string[]` | `[]` | N | 自定义颜色数组。 |
  3275. | lazyAnimation | `boolean` | `true` | N | 是否开启懒动画。 |
  3276. | speed | `number` | `1` | N | 动画速度,基数为 1。 |
  3277. ================================================
  3278. FILE: docs/mds/components/loading/api_en.md
  3279. ================================================
  3280. ## Loading Props
  3281. | Name | Type | Default | Required | Description |
  3282. | ------------- | ---------------------------------------------------------------------------------------------- | ------- | -------- | --------------------------------------------------------------- |
  3283. | type | `string` | `'1_0'` | N | Type number. |
  3284. | height | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'\|'28'\|'36'\|'48'\|'56'\|'64'\|'72'\|'80'\|'96'\|'full'` | `'8'` | N | Container height. |
  3285. | width | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'\|'28'\|'36'\|'48'\|'56'\|'64'\|'72'\|'80'\|'96'\|'full'` | `'8'` | N | Container width. |
  3286. | theme | `boolean` | `false` | N | Whether to use theme color, only works for monochrome. |
  3287. | inverse | `boolean` | `false` | N | Whether to use contrast color, only works for mono/dual colors. |
  3288. | customColor | `string[]` | `[]` | N | Custom color array. |
  3289. | lazyAnimation | `boolean` | `true` | N | Whether to enable lazy animation. |
  3290. | speed | `number` | `1` | N | Animation speed, base value is 1. |
  3291. ================================================
  3292. FILE: docs/mds/components/loading/FAQ.md
  3293. ================================================
  3294. ================================================
  3295. FILE: docs/mds/components/loading/FAQ_en.md
  3296. ================================================
  3297. ================================================
  3298. FILE: docs/mds/components/loading/guide.md
  3299. ================================================
  3300. ## 类型
  3301. Loading 目前支持四种类型,分别是单色、双色、四色和其他,通过 type 的第一个值来区分,如 `1_0`、`2_0`、`4_0`、`o_0`,第二个值表示此类型的编号。
  3302. 更多的 Loading 将会在后续版本中逐步增加,也欢迎参与开发。
  3303. ## 尺寸
  3304. Loading 的容器大小由 height 与 width 决定,除了少数几个需要固定尺寸,大多数 Loading 都会自动铺满给定的容器,请根据自己的需求调整大小。
  3305. ## 主题色
  3306. 当使用单色模式时,可以通过 theme 来控制是否使用主题色,颜色会自动适配亮暗模式,请参考示例。
  3307. ## 反差色
  3308. 通常情况下,页面颜色是浅色系颜色,Loading 会使用深色系颜色。但在一些场景,比如 Toast 组件内背景色与页面颜色深浅恰好相反,比如默认按钮背景色偏深色等情况,在这些组件内部使用 Loading 时,可以通过 inverse 来控制颜色,使其恰好与页面的亮暗模式相反,请参考示例。
  3309. ## 自定义颜色
  3310. 当需要传入自定义颜色时,可以通过 customColor 来传入颜色数组,数组长度与 type 的第一个值相同,如 `1_0` 需要传入一个颜色,`2_0` 需要传入两个颜色,`4_0` 需要传入四个颜色,请参考示例。
  3311. 注:当使用自定义颜色时,theme 和 inverse 会失效。
  3312. ## 四色默认颜色
  3313. 当使用四色模式时,Loading 内部默认的四个颜色分别是红色(#DA1414)、绿色(#11BB8D)、紫色(#7356BF)、黄色(#FFC043),对应 STDF 颜色系统的 error、success、purple、yellow,如果需要自定义颜色请传入长度为 4 的 customColor,请参考示例。
  3314. ## 动画速度
  3315. Loading 的动画速度可以通过 speed 来控制,基数为 1 表示正常速度,speed 的值越大,动画速度越快。请使用大于 0 的数值,但不建议使用过大的数值,否则可能会导致动画过快,徒增功耗还影响用户体验。
  3316. 部分 Loading 因为动画的特殊性,当 speed 的值会影响元素之间连贯性时,会忽略 speed 的值,使用默认值。
  3317. ## 懒动画
  3318. Loading 自带了一系列过渡动画,极端情况下,当页面同时有大量过渡效果时,考虑到设备性能与动画帧率等问题,Loading 通过 lazyAnimation 默认开启了懒动画,即 Loading 组件**不在页面可视范围内时会暂停动画**,当然你也可以单独设置。
  3319. ## 感谢
  3320. 部分动效灵感来自 [德育处主任](https://gitee.com/k21vin/front-end-data-visualization/tree/master/src/views/Native/PureCSS/pages/Loading/components) 与 [LDRS](https://uiball.com/ldrs), 感谢他们的分享。
  3321. ================================================
  3322. FILE: docs/mds/components/loading/guide_en.md
  3323. ================================================
  3324. ## Type
  3325. There are currently four types of Loading, which are monochrome, bicolor, quadricolor, and other. They can be distinguished by the first value of the `type`, such as `1_0`, `2_0`, `4_0`, `o_0`. The second value represents the identification number of this type.
  3326. More Loading types will be gradually added in future versions, and your feedback is welcome.
  3327. ## Size
  3328. The size of the Loading container is determined by `height` and `width`. Most Loading components will automatically fill the given container, except for a few that require a fixed size. Please adjust the size according to your needs.
  3329. ## Theme Color
  3330. When using the monochrome mode, the `theme` can be used to control whether to use the theme color. The color will automatically adapt to light and dark mode. Please refer to the example.
  3331. ## Contrast Color
  3332. Usually, the color scheme of the website is light, and Loading will use dark colors. However, in some scenarios, such as toast components where the background color is opposite in light and dark mode, or default button background colors that are darker, you can use `inverse` to control the color scheme to make it opposite to the light and dark mode of the website. Please refer to the example.
  3333. ## Custom Color
  3334. When you need to pass in custom colors, you can use `customColor` to pass in an array of colors. The length of the array is the same as the first value of the Loading `type`. For example, `1_0` requires passing in one color, `2_0` requires passing in two colors, and `4_0` requires passing in four colors. Please refer to the example.
  3335. Note: When using custom colors, `theme` and `inverse` will not take effect.
  3336. ## Default Colors for Quadricolor
  3337. When using the quadricolor mode, the default colors used inside Loading are red (#DA1414), green (#11BB8D), purple (#7356BF), and yellow (#FFC043), which correspond to the STDF color system's error, success, purple, and yellow respectively. If you need to customize the colors, please pass in a `customColor` array of length 4. Please refer to the example.
  3338. ## Animation Speed
  3339. The animation speed of Loading can be controlled by `speed`, with a base of 1 indicating normal speed. The larger the value of `speed`, the faster the animation speed. Please use a value greater than 0, but it is not recommended to use a too large a value, otherwise it may cause the animation to be too fast, which will increase power consumption and affect the user experience.
  3340. For some Loading animations that have special continuity between elements, the value of `speed` may be ignored and use the default value.
  3341. ## Lazy Animation
  3342. Loading comes with a series of transition animations. In extreme cases, when there are a large number of transition effects on the page, considering device performance and animation frame rate issues, Loading uses `lazyAnimation` to enable lazy animation by default, which means that the Loading component **will pause the animation when it is not in the visible range on the page**. Of course, you can also set it individually.
  3343. ## Acknowledgments
  3344. Some of the animation inspirations are from [德育处主任](https://gitee.com/k21vin/front-end-data-visualization/tree/master/src/views/Native/PureCSS/pages/Loading/components) and [LDRS](https://uiball.com/ldrs). Special thanks go to them.
  3345. ================================================
  3346. FILE: docs/mds/components/loading/version.md
  3347. ================================================
  3348. ## 0.4.7
  3349. - [!tag|O|0|]去除 Loading 容器默认大小。
  3350. ## 0.4.6
  3351. - [!tag|A|0|]新增 32 种 Loading 类型(1_22 - 1_53)。
  3352. ## 0.0.6
  3353. - [!tag|A|0|]新增 8 种 Loading 类型(1_18、1_19、1_20、1_21、2_2、2_3、2_4、2_5)。
  3354. ================================================
  3355. FILE: docs/mds/components/loading/version_en.md
  3356. ================================================
  3357. ## 0.4.7
  3358. - [!tag|O|0|]Remove default size of Loading container.
  3359. ## 0.4.6
  3360. - [!tag|A|0|]Add 32 Loading type(1_22 - 1_53).
  3361. ## 0.0.6
  3362. - [!tag|A|0|]Add 8 Loading type(1_18, 1_19, 1_20, 1_21, 2_2, 2_3, 2_4, 2_5).
  3363. ================================================
  3364. FILE: docs/mds/components/mask/api.md
  3365. ================================================
  3366. ## Mask Props
  3367. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3368. | ------------ | -------------------------------------------------------------------- | -------- | ---- | ---------------------------- |
  3369. | visible | `boolean` | `false` | N | 是否显示。 |
  3370. | opacity | `'0.1'\|'0.2'\|'0.3'\|'0.4'\|'0.5'\|'0.6'\|'0.7'\|'0.8'\|'0.9'\|'1'` | `'0.5'` | N | 遮罩透明度。 |
  3371. | duration | `number` | `150` | N | 出现动画过渡时长,单位:ms。 |
  3372. | outDuration | `number` | `0` | N | 消失动画过渡时长,单位:ms。 |
  3373. | inverse | `boolean` | `false` | N | 遮罩背景是否反色。 |
  3374. | clickable | `boolean` | `false` | N | 遮罩是否可点击穿透。 |
  3375. | backdropBlur | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'` | `'none'` | N | 背景模糊度。 |
  3376. | zIndex | `number` | `500` | N | z-index。 |
  3377. ## Mask Events
  3378. | 名称 | 类型 | 参数 | 描述 |
  3379. | ----------- | ------------ | ---- | --------------------------------------------------- |
  3380. | onclickMask | `() => void` | - | 点击遮罩时触发,注意 clickable 为 true 时不会触发。 |
  3381. ## Mask Snippets
  3382. | 名称 | 类型 | 参数 | 说明 |
  3383. | -------- | ------------------------------------------------------------------- | ---- | ---------- |
  3384. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 遮罩内容。 |
  3385. ================================================
  3386. FILE: docs/mds/components/mask/api_en.md
  3387. ================================================
  3388. ## Mask Props
  3389. | Name | Type | Default | Required | Description |
  3390. | ------------ | -------------------------------------------------------------------- | -------- | -------- | -------------------------------------------- |
  3391. | visible | `boolean` | `false` | N | Whether to show the mask. |
  3392. | opacity | `'0.1'\|'0.2'\|'0.3'\|'0.4'\|'0.5'\|'0.6'\|'0.7'\|'0.8'\|'0.9'\|'1'` | `'0.5'` | N | Opacity of the mask. |
  3393. | duration | `number` | `150` | N | Duration of the show animation in ms. |
  3394. | outDuration | `number` | `0` | N | Duration of the hide animation in ms. |
  3395. | inverse | `boolean` | `false` | N | Whether to invert the mask background color. |
  3396. | clickable | `boolean` | `false` | N | Whether the mask is click-through. |
  3397. | backdropBlur | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'` | `'none'` | N | Backdrop blur level. |
  3398. | zIndex | `number` | `500` | N | z-index value. |
  3399. ## Mask Events
  3400. | Name | Type | Parameters | Description |
  3401. | ----------- | ------------ | ---------- | ----------------------------------------------------------------------- |
  3402. | onclickMask | `() => void` | - | Triggered when clicking the mask. Not triggered when clickable is true. |
  3403. ## Mask Snippets
  3404. | Name | Type | Parameters | Description |
  3405. | -------- | ------------------------------------------------------------------- | ---------- | ------------- |
  3406. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Mask content. |
  3407. ================================================
  3408. FILE: docs/mds/components/mask/FAQ.md
  3409. ================================================
  3410. ================================================
  3411. FILE: docs/mds/components/mask/FAQ_en.md
  3412. ================================================
  3413. ================================================
  3414. FILE: docs/mds/components/mask/guide.md
  3415. ================================================
  3416. ## 使用
  3417. Mask 组件一般是用来结合 BottomSheet、Toast、Popup 等组件使用,用于遮挡下层内容,突出弹出层内容,或防止用户操作。
  3418. ## 动画
  3419. 遮罩动画效果为 fade,可参考 [svelte/transition/fade](https://svelte.dev/docs/svelte/svelte-transition#fade) 。
  3420. 遮罩一般是放置于其他交互式组件下层,考虑到出现与消失不会太突兀,遮罩出现时有一个较短的动画(默认 150ms),一般与内容时长一样;而内容信息展示完后一般需要迅速关闭,所以退出动画默认为 0ms,当然也可以通过 `outDuration` 属性设置退出的动画时间。
  3421. ## 点击穿透
  3422. Mask 可以通过 `clickable` 属性设置是否可点击穿透,当设置为 `true` 时,点击遮罩不会触发 `onclickMask` 事件。
  3423. ## inverse
  3424. 通常情况下,页面颜色是浅色系颜色,Mask 会使用黑色背景色,当页面使用暗模式时 Mask 会使用白色背景色。但在一些特殊场景可能会使用恰好相反的背景色,可以通过 inverse 来控制颜色,使其恰好与页面的亮暗模式相反,请参考示例。
  3425. Mask 可以通过 `inverse` 属性设置是否反色,当设置为 `true` 时,遮罩背景色为白色。
  3426. ## zIndex
  3427. 遮罩层是相对于浏览器窗口通过 fixed 定位的,默认的 `z-index` 为 500,可以通过 `zIndex` 属性设置。
  3428. 使用到 Mask 的组件包括 BottomSheet、Toast、Popup 等,这些组件也有默认的 z-index,见下表。如果同时显示这些组件时请注意层级关系。
  3429. 使用到 Mask 组件的默认 `z-index` 如下:
  3430. | 组件 | zIndex |
  3431. | ----------- | ------ |
  3432. | BottomSheet | 600 |
  3433. | Popup | 600 |
  3434. | Toast | 1000 |
  3435. ================================================
  3436. FILE: docs/mds/components/mask/guide_en.md
  3437. ================================================
  3438. ## Usage
  3439. The Mask component is usually used in combination with other components such as Toast, BottomSheet or Popup to block out the underlying content, highlight the pop-up content or prevent user interaction.
  3440. ## Animation
  3441. The animation effect of the mask is fade, which can be referred to [svelte/transition/fade](https://svelte.dev/docs/svelte/svelte-transition#fade).
  3442. Normally, the mask is placed below other interactive components, so considering the smoothness of appearance and disappearance, there is a short animation (default 150ms) when the mask appears, generally the same length as the content. After the content is displayed, it is generally necessary to close quickly, so the exit animation is 0ms by default, but of course, the exit animation time can also be set through the `outDuration` attribute.
  3443. ## Click-through
  3444. The Mask can be set whether it can be clicked through by the `clickable` attribute. When it is set to `true`, clicking the mask will not trigger the `onclickMask` event.
  3445. ## Inverse
  3446. Usually, the page color is in light color scheme, and the Mask uses a black background color. When the page uses a dark mode, the Mask will use a white background color. However, in some special scenarios, the background color is precisely opposite to the page (light/dark). The color can be controlled via `inverse` attribute to make it exactly opposite to the page's light/dark colors. Please refer to the example for details.
  3447. The Mask can be set whether to invert the color by using the `inverse` attribute. When it is set to `true`, the mask background color is white.
  3448. ## zIndex
  3449. The mask layer is positioned fixed relative to the browser window, and the default `z-index` is 500, which can be set via the `zIndex` attribute.
  3450. The components that use the Mask include Toast, Popup, BottomSheet, etc., and these components also have default z-index as shown in the table below. If these components are displayed at the same time, please pay attention to the layer relationship.
  3451. The default `z-index` of components that use the Mask are as follows:
  3452. | Component | zIndex |
  3453. | ----------- | ------ |
  3454. | BottomSheet | 600 |
  3455. | Popup | 600 |
  3456. | Toast | 1000 |
  3457. ================================================
  3458. FILE: docs/mds/components/mask/version.md
  3459. ================================================
  3460. ================================================
  3461. FILE: docs/mds/components/mask/version_en.md
  3462. ================================================
  3463. ================================================
  3464. FILE: docs/mds/components/modal/api.md
  3465. ================================================
  3466. ## Modal Props
  3467. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3468. | ---------- | ------------------------------------------------------------- | ------------------------ | ---- | -------------- |
  3469. | visible | `boolean` | `false` | N | 是否显示。 |
  3470. | title | `string` | 当前语言的 modal.title | N | 标题。 |
  3471. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | 标题对齐方式。 |
  3472. | content | `string` | 当前语言的 modal.content | N | 内容。 |
  3473. | showIcon | `boolean` | `false` | N | 是否显示图标。 |
  3474. | icon | [`Icon`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | 图标参数。 |
  3475. | showBtn | `boolean` | `true` | N | 是否显示按钮。 |
  3476. | btnText | `string` | 当前语言的 modal.btnText | N | 按钮文字。 |
  3477. | button | [`Button`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | 按钮参数。 |
  3478. | popup | [`Popup`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | 弹出层参数。 |
  3479. ## Modal Events
  3480. | 名称 | 类型 | 参数 | 描述 |
  3481. | ------- | ------------ | ---- | ---------------- |
  3482. | onclose | `() => void` | - | 弹框关闭时触发。 |
  3483. ## Modal Snippets
  3484. | 名称 | 类型 | 参数 | 描述 |
  3485. | ------------ | ------------------------------------------------------------------- | ---- | ------------------------- |
  3486. | contentChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染 content 内容。 |
  3487. ================================================
  3488. FILE: docs/mds/components/modal/api_en.md
  3489. ================================================
  3490. ## Modal Props
  3491. | Name | Type | Default | Required | Description |
  3492. | ---------- | ------------------------------------------------------------- | ------------------------------ | -------- | -------------------------- |
  3493. | visible | `boolean` | `false` | N | Whether to show the modal. |
  3494. | title | `string` | Current language modal.title | N | Title text. |
  3495. | titleAlign | `'left'\|'center'\|'right'` | `'center'` | N | Title alignment. |
  3496. | content | `string` | Current language modal.content | N | Content text. |
  3497. | showIcon | `boolean` | `false` | N | Whether to show icon. |
  3498. | icon | [`Icon`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | Icon props. |
  3499. | showBtn | `boolean` | `true` | N | Whether to show button. |
  3500. | btnText | `string` | Current language modal.btnText | N | Button text. |
  3501. | button | [`Button`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | Button props. |
  3502. | popup | [`Popup`](https://stdf.design/components?nav=dialog&tab=1) | `{}` | N | Popup props. |
  3503. ## Modal Events
  3504. | Name | Type | Parameters | Description |
  3505. | ------- | ------------ | ---------- | ---------------------------- |
  3506. | onclose | `() => void` | - | Triggered when modal closes. |
  3507. ## Modal Snippets
  3508. | Name | Type | Parameters | Description |
  3509. | ------------ | ------------------------------------------------------------------- | ---------- | ---------------------------------------- |
  3510. | contentChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Render the content when it is passed in. |
  3511. ================================================
  3512. FILE: docs/mds/components/modal/FAQ.md
  3513. ================================================
  3514. ================================================
  3515. FILE: docs/mds/components/modal/FAQ_en.md
  3516. ================================================
  3517. ================================================
  3518. FILE: docs/mds/components/modal/guide.md
  3519. ================================================
  3520. ## 使用
  3521. Modal 弹框组件一般用于展示一些需要用户明确知悉的内容或步骤,为避免误触,点击遮罩默认不会关闭。相比 Toast 用户感知度会更强,相比可以完成特定交互操作的 Dialog 又更简单一些。
  3522. ## 说明
  3523. Modal 弹框组件是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 easeType 换了一种缓动效果。
  3524. 而 Modal 内部又使用了 Icon 和 Button 组件,可以通过传入 Icon 和 Button 的 Props 来实现不同的效果。比如示例中通过设置 Button 的 radius 自定义按钮的圆角风格。
  3525. ## contentChild
  3526. Modal 的内容可以通过 contentChild 传入,当需要显示复杂内容时,可以通过 contentChild 渲染,此时 content 会失效。
  3527. ## 关闭
  3528. Modal 默认不会自动关闭,需要通过点击内部按钮来关闭,当不显示按钮时默认点击遮罩也会关闭,或者通过改变外部的 visible 来关闭。当然这些参数都可以通过传入的 Props 来控制。
  3529. ================================================
  3530. FILE: docs/mds/components/modal/guide_en.md
  3531. ================================================
  3532. ## Usage
  3533. The Modal dialog component is generally used to display important information or steps that users need to be aware of. To avoid accidental clicks, clicking on the mask does not close the dialog by default. Compared to Toast, users will have a stronger sense of awareness, and compared to Dialog, it is simpler to implement specific interactive operations.
  3534. ## Description
  3535. The Modal dialog component is based on Popup and is implemented by defining some of Popup's Props in advance. Therefore, different effects can be achieved by passing in Popup's attributes. For example, in the example, a different easing effect is achieved by setting the easeType of popup.
  3536. Modal also uses the Icon and Button components internally, and different effects can be achieved by passing in the Props of Icon and Button. For example, in the example, the radius of the Button is customized to achieve a custom button style.
  3537. ## ContentChild
  3538. The content of the Modal can be passed in through the contentChild property. When complex content needs to be displayed, it can be rendered through contentChild, at this time content will be invalid.
  3539. ## Close
  3540. The Modal by default will not automatically close and needs to be closed by clicking the internal button. When the button is not displayed, clicking the mask will close the Modal by default, or you can close it by changing the visible property externally. Of course, these parameters can be controlled through the Props passed in.
  3541. ================================================
  3542. FILE: docs/mds/components/modal/version.md
  3543. ================================================
  3544. ================================================
  3545. FILE: docs/mds/components/modal/version_en.md
  3546. ================================================
  3547. ================================================
  3548. FILE: docs/mds/components/navBar/api.md
  3549. ================================================
  3550. ## NavBar Props
  3551. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3552. | ---------- | ------------------------------------------------------------------------- | ----------------------- | ---- | ---------------------------------------------------------- |
  3553. | title | `string` | 当前语言的 navBar.title | N | 标题。 |
  3554. | titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | 标题对齐方式。 |
  3555. | left | `'back'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'back'` | N | 左侧内容,`'back'` 返回图标,`null` 无内容,否则渲染图标。 |
  3556. | rights | [`Icon[]`](https://stdf.design/components?nav=icon&tab=1) | `[]` | N | 右侧内容,Icon Props 组成的数组,建议不超过三个。 |
  3557. | line | `boolean` | `true` | N | 是否显示底部分割线。 |
  3558. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  3559. | love | `boolean` | `false` | N | 是否开启关爱版。 |
  3560. ## NavBar Events
  3561. | 名称 | 类型 | 参数 | 说明 |
  3562. | ------------ | ------------------------- | ---------------------- | ------------------ |
  3563. | onclickLeft | `() => void` | - | 点击左侧图标触发。 |
  3564. | onclickRight | `(index: number) => void` | index - 点击图标索引值 | 点击右侧图标触发。 |
  3565. ## NavBar Snippets
  3566. | 名称 | 类型 | 参数 | 说明 |
  3567. | ---------- | ------------------------------------------------------------------- | ---- | -------------------- |
  3568. | titleChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染标题区域。 |
  3569. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染左侧区域。 |
  3570. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染右侧区域。 |
  3571. ================================================
  3572. FILE: docs/mds/components/navBar/api_en.md
  3573. ================================================
  3574. ## NavBar Props
  3575. | Name | Type | Default | Required | Description |
  3576. | ---------- | ------------------------------------------------------------------------- | ----------------------------- | -------- | ----------------------------------------------------------------------------------- |
  3577. | title | `string` | Current language navBar.title | N | Title text. |
  3578. | titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | Title alignment. |
  3579. | left | `'back'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'back'` | N | Left content, `'back'` for back icon, `null` for no content, otherwise render icon. |
  3580. | rights | [`Icon[]`](https://stdf.design/components?nav=icon&tab=1) | `[]` | N | Right content array of Icon Props, recommend no more than 3 icons. |
  3581. | line | `boolean` | `true` | N | Whether to show bottom divider line. |
  3582. | injClass | `string` | `''` | N | Inject CSS class name. |
  3583. | love | `boolean` | `false` | N | Whether to enable care version. |
  3584. ## NavBar Events
  3585. | Name | Type | Parameters | Description |
  3586. | ------------ | ------------------------- | -------------------------- | ----------------------------------- |
  3587. | onclickLeft | `() => void` | - | Triggered when clicking left icon. |
  3588. | onclickRight | `(index: number) => void` | index - Clicked icon index | Triggered when clicking right icon. |
  3589. ## NavBar Snippets
  3590. | Name | Type | Parameters | Description |
  3591. | ---------- | ------------------------------------------------------------------- | ---------- | ------------------------------- |
  3592. | titleChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders title area when passed. |
  3593. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders left area when passed. |
  3594. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders right area when passed. |
  3595. ================================================
  3596. FILE: docs/mds/components/navBar/FAQ.md
  3597. ================================================
  3598. ================================================
  3599. FILE: docs/mds/components/navBar/FAQ_en.md
  3600. ================================================
  3601. ================================================
  3602. FILE: docs/mds/components/navBar/guide.md
  3603. ================================================
  3604. > NavBar 使用了图标 ri-arrow-left-s-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  3605. ## 说明
  3606. 移动端的 NavBar 一般用于页面顶部显示当前页面与路由跳转操作。STDF 的 NavBar 由左中右三个部分组成,且每个部分都支持 Snippet 渲染,而最外层元素的 Class 支持 injClass(class 注入)。
  3607. ## 拓展
  3608. 现有参数已经能满足绝大部分业务场景,比如根据页面上下滚动实时改变 NavBar 背景透明度与文字颜色这种常用场景,就可以通过 injClass 实现。如果还不满足你的需求,结合 Snippet 与 injClass,理论上 NavBar 可以定制为你想要的任何样式,甚至不仅仅把它作为顶部的导航栏来使用。
  3609. 需要提醒的是,此处的拓展只是提供一种方法与思路,过多的自定义可能已经比自己写一个组件显得更加复杂,反而失去了使用组件库的意义。
  3610. ================================================
  3611. FILE: docs/mds/components/navBar/guide_en.md
  3612. ================================================
  3613. > NavBar uses the icon ri-arrow-left-s-line, please ensure that the symbol.svg file in your project includes this icon. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  3614. ## Explanation
  3615. On mobile devices, the NavBar is generally used to display the current page and to perform routing operations at the top of the page. STDF's NavBar consists of three parts: left, center, and right, and each part supports Snippet rendering. The class of the outermost element also supports injClass (class injection).
  3616. ## Extension
  3617. The existing parameters are sufficient to meet most business scenarios. For example, the common scene of changing the transparency of the NavBar background and text color based on the scrolling of the page can be achieved through injClass. If you are still not satisfied with your needs, combining Snippet and injClass, theoretically the NavBar can be customized to any style you want, not only for use as a top navigation bar.
  3618. It should be noted that this extension only provides a method and idea. Too much customization may already be more complex than writing a component yourself, and may lose the meaning of using a component library.
  3619. ================================================
  3620. FILE: docs/mds/components/navBar/version.md
  3621. ================================================
  3622. ## 1.0.3
  3623. - [!tag|A|0|]新增 titleAlign 属性。
  3624. ================================================
  3625. FILE: docs/mds/components/navBar/version_en.md
  3626. ================================================
  3627. ## 1.0.3
  3628. - [!tag|A|0|]Add titleAlign property.
  3629. ================================================
  3630. FILE: docs/mds/components/noticeBar/api.md
  3631. ================================================
  3632. ## NoticeBar Props
  3633. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3634. | --------- | ----------------------------------------------------------------- | --------- | ---- | ----------------------------- |
  3635. | textList | `string[]` | `[]` | Y | 通告内容组成的数组。 |
  3636. | leftIcon | `null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=0) | `{}` | N | 左侧内容。 |
  3637. | rightIcon | `'close'`\|`'arrow'`\|`null` | `'close'` | N | 右侧内容。 |
  3638. | fontSize | `'xs'\|'sm'\|'base'\|'lg'` | `'sm'` | N | 通告字体大小。 |
  3639. | space | `number` | `100` | N | 通告间距,单位是 px。 |
  3640. | speed | `number` | `30` | N | 横向滚动速度,单位是 px/s。 |
  3641. | vertical | `boolean` | `false` | N | 是否垂直滚动。 |
  3642. | duration | `100`\|`300`\|`500`\|`700`\|`1000` | `500` | N | 垂直滚动过渡时间,单位是 ms。 |
  3643. | interval | `number` | `4` | N | 垂直滚动间隔时间,单位是 s。 |
  3644. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  3645. ## NoticeBar Events
  3646. | 名称 | 类型 | 参数 | 描述 |
  3647. | ------------ | ------------ | ---- | ------------------ |
  3648. | onclickRight | `() => void` | - | 点击右侧区域触发。 |
  3649. ## NoticeBar Snippets
  3650. | 名称 | 类型 | 参数 | 说明 |
  3651. | ---------- | ------------------------------------------------------------------- | ---- | ------------------------ |
  3652. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染左侧内容区域。 |
  3653. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染右侧内容区域。 |
  3654. ================================================
  3655. FILE: docs/mds/components/noticeBar/api_en.md
  3656. ================================================
  3657. ## NoticeBar Props
  3658. | Name | Type | Default | Required | Description |
  3659. | --------- | ----------------------------------------------------------------- | --------- | -------- | --------------------------------------------- |
  3660. | textList | `string[]` | `[]` | Y | Array of announcement contents. |
  3661. | leftIcon | `null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=0) | `{}` | N | Left content. |
  3662. | rightIcon | `'close'`\|`'arrow'`\|`null` | `'close'` | N | Right content. |
  3663. | fontSize | `'xs'\|'sm'\|'base'\|'lg'` | `'sm'` | N | Font size of the announcement. |
  3664. | space | `number` | `100` | N | Space between announcements in px. |
  3665. | speed | `number` | `30` | N | Horizontal scrolling speed in px/s. |
  3666. | vertical | `boolean` | `false` | N | Whether to scroll vertically. |
  3667. | duration | `100`\|`300`\|`500`\|`700`\|`1000` | `500` | N | Vertical scrolling transition duration in ms. |
  3668. | interval | `number` | `4` | N | Vertical scrolling interval time in seconds. |
  3669. | injClass | `string` | `''` | N | Injected CSS class name. |
  3670. ## NoticeBar Events
  3671. | Name | Type | Params | Description |
  3672. | ------------ | ------------ | ------ | ------------------------------------- |
  3673. | onclickRight | `() => void` | - | Triggered when right area is clicked. |
  3674. ## NoticeBar Snippets
  3675. | Name | Type | Params | Description |
  3676. | ---------- | ------------------------------------------------------------------- | ------ | ------------------------------------- |
  3677. | leftChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders left content area if passed. |
  3678. | rightChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders right content area if passed. |
  3679. ================================================
  3680. FILE: docs/mds/components/noticeBar/FAQ.md
  3681. ================================================
  3682. ================================================
  3683. FILE: docs/mds/components/noticeBar/FAQ_en.md
  3684. ================================================
  3685. ================================================
  3686. FILE: docs/mds/components/noticeBar/guide.md
  3687. ================================================
  3688. > NoticeBar 使用了图标 ri-volume-down-line 和 ri-close-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  3689. ## 说明
  3690. 当横向放置时,不论内容有几条,只要所有内容加上内容之间的间隔长度之和超过容器宽度,NoticeBar 将会自动横向滚动,否则不滚动。
  3691. 垂直放置时,内容超过一条时将会自动垂直滚动,单条内容过长将会溢出显示。
  3692. ## leftIcon 与 rightIcon
  3693. 左侧区域 leftIcon 除了默认的小喇叭图标,可以传入 Icon Props 实现其他图标显示,还可以自定义任何内容,通过 leftChild 这个 Snippet 实现,而右侧区域 rightIcon 只允许关闭、箭头、不显示三种情况,也可以通过 rightChild 这个 Snippet 实现自定义内容,请参考示例。
  3694. ## onclickRight 事件
  3695. 当点击右侧区域时,如果 rightIcon 为 close 会关闭当前通告栏;而 rightIcon 无论是 close 还是 arrow 都会派发 onclickRight 事件,可以通过监听该事件来实现自定义的业务逻辑。
  3696. ## CSS 注入
  3697. 通过 injClass 参数可以向组件内部最外层元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义背景色与文字颜色。
  3698. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  3699. ================================================
  3700. FILE: docs/mds/components/noticeBar/guide_en.md
  3701. ================================================
  3702. > NoticeBar uses icons ri-volume-down-line and ri-close-line. Please ensure these icons are included in your project's symbol.svg file. For more details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  3703. ## Description
  3704. When placed horizontally, regardless of the number of content items, NoticeBar will automatically scroll horizontally if the total length of all content plus the spacing between them exceeds the container width. Otherwise, it will not scroll.
  3705. When placed vertically, it will automatically scroll vertically if there is more than one content item. Single content items that are too long will overflow.
  3706. ## leftIcon and rightIcon
  3707. The left area (leftIcon), besides the default speaker icon, can display other icons by passing Icon Props. It can also be customized with any content through the leftChild Snippet. The right area (rightIcon) only allows three states: close, arrow, or hidden. It can also be customized through the rightChild Snippet. Please refer to the examples.
  3708. ## onclickRight Event
  3709. When clicking the right area, if rightIcon is set to close, it will close the current notice bar. Whether rightIcon is set to close or arrow, it will dispatch the onclickRight event, which can be listened to implement custom business logic.
  3710. ## CSS Injection
  3711. Through the injClass parameter, you can inject CSS class names (not limited to Tailwind CSS) into the component's outermost element. This provides more possibilities for custom styling. In the example, injClass is used to implement custom background and text colors.
  3712. If the injected class doesn't take effect, please add "!" before the class name. You can refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  3713. ================================================
  3714. FILE: docs/mds/components/noticeBar/version.md
  3715. ================================================
  3716. ================================================
  3717. FILE: docs/mds/components/noticeBar/version_en.md
  3718. ================================================
  3719. ================================================
  3720. FILE: docs/mds/components/numKeyboard/api.md
  3721. ================================================
  3722. ## NumKeyboard Props
  3723. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3724. | ------------ | ----------------------------------------------------------- | ---------------------- | ---- | -------------------- |
  3725. | value | `string` | `''` | N | 输入内容。 |
  3726. | type | `'button'`\|`'block'` | `'button'` | N | 键盘样式类型。 |
  3727. | visible | `boolean` | `false` | N | 是否显示键盘。 |
  3728. | height | `'8'\|'10'\|'12'\|'14'\|'16'\|'20'` | `'12'` | N | 按键高度。 |
  3729. | space | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | 按键间距。 |
  3730. | p | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | 键盘内边距。 |
  3731. | reverse | `boolean` | `false` | N | 数字是否上下反向。 |
  3732. | done | `boolean` | `true` | N | 是否显示完成按钮。 |
  3733. | dot | `boolean` | `true` | N | 是否显示小数点。 |
  3734. | close | `boolean` | `false` | N | 是否显示关闭按钮。 |
  3735. | doneText | `string` | 当前语言的 common.done | N | 完成按钮文案。 |
  3736. | doneDisabled | `boolean` | `false` | N | 完成按钮是否禁用。 |
  3737. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | 按键圆角。 |
  3738. | clear | `boolean` | `false` | N | 打开时是否清空内容。 |
  3739. | panelClass | `string` | `''` | N | 键盘面板注入 Class。 |
  3740. | keyClass | `string` | `''` | N | 按键注入 Class。 |
  3741. | doneClass | `string` | `''` | N | 完成按键注入 Class。 |
  3742. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  3743. ## NumKeyboard Events
  3744. | 名称 | 类型 | 参数 | 描述 |
  3745. | ------- | -------------------------- | ------------------------ | ---------------------- |
  3746. | onclick | `(key: string) => void` | key - 本次点击的键盘 key | 每次点击任意按键触发。 |
  3747. | onopen | `(height: number) => void` | height - 键盘高度 | 键盘打开时触发。 |
  3748. | onclose | `() => void` | - | 键盘关闭时触发。 |
  3749. ================================================
  3750. FILE: docs/mds/components/numKeyboard/api_en.md
  3751. ================================================
  3752. ## NumKeyboard Props
  3753. | Name | Type | Default | Required | Description |
  3754. | ------------ | ----------------------------------------------------------- | ------------------------------ | -------- | ----------------------------------- |
  3755. | value | `string` | `''` | N | Input content. |
  3756. | type | `'button'`\|`'block'` | `'button'` | N | Keyboard style type. |
  3757. | visible | `boolean` | `false` | N | Whether to show keyboard. |
  3758. | height | `'8'\|'10'\|'12'\|'14'\|'16'\|'20'` | `'12'` | N | Key height. |
  3759. | space | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | Key spacing. |
  3760. | p | `'0'\|'1'\|'2'\|'3'\|'4'` | `'2'` | N | Keyboard padding. |
  3761. | reverse | `boolean` | `false` | N | Whether to reverse number order. |
  3762. | done | `boolean` | `true` | N | Whether to show done button. |
  3763. | dot | `boolean` | `true` | N | Whether to show decimal point. |
  3764. | close | `boolean` | `false` | N | Whether to show close button. |
  3765. | doneText | `string` | Current language's common.done | N | Done button text. |
  3766. | doneDisabled | `boolean` | `false` | N | Whether to disable done button. |
  3767. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | Key border radius. |
  3768. | clear | `boolean` | `false` | N | Whether to clear content when open. |
  3769. | panelClass | `string` | `''` | N | Inject class for keyboard panel. |
  3770. | keyClass | `string` | `''` | N | Inject class for keys. |
  3771. | doneClass | `string` | `''` | N | Inject class for done button. |
  3772. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  3773. ## NumKeyboard Events
  3774. | Name | Type | Parameters | Description |
  3775. | ------- | -------------------------- | -------------------------- | ---------------------------------- |
  3776. | onclick | `(key: string) => void` | key - Clicked keyboard key | Triggered when any key is clicked. |
  3777. | onopen | `(height: number) => void` | height - Keyboard height | Triggered when keyboard opens. |
  3778. | onclose | `() => void` | - | Triggered when keyboard closes. |
  3779. ================================================
  3780. FILE: docs/mds/components/numKeyboard/FAQ.md
  3781. ================================================
  3782. ================================================
  3783. FILE: docs/mds/components/numKeyboard/FAQ_en.md
  3784. ================================================
  3785. ================================================
  3786. FILE: docs/mds/components/numKeyboard/guide.md
  3787. ================================================
  3788. > NumKeyboard 使用了图标 ri-delete-back-2-line 和 ri-skip-down-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  3789. ## 说明
  3790. NumKeyboard 组件是一个虚拟的数字键盘,一般用于输入整数或小数。内部使用了网格布局,布局方式只有 3\*4 或 4\*4 两种,当不显示完成按键时,就只有 3 列,否则就是 4 列。
  3791. ## 按键
  3792. NumKeyboard 组件的按键有 5 种类型,分别是 0-9 数字、删除、小数点、完成、关闭,其中 0-9 数字、删除是必须的,完成、删除、关闭是非必须的。
  3793. 非必须按键的优先级为:完成 > 小数点 > 关闭,所以当同时需要显示小数点和关闭时,由于关闭的优先级低于小数点,所以关闭按钮将不会显示,如果需要强制显示关闭按钮,只能关闭小数点的显示。请参考示例。
  3794. ## reverse
  3795. 通常情况,我们在移动设备上习惯的数字键盘布局是从上到下的顺序,但是在传统物理键盘上数字键盘是按照从下到上的顺序排列的,考虑部分特殊行业人群的使用习惯,NumKeyboard 组件提供了 reverse 参数,当 reverse 为 true 时,数字键盘将会按照从下到上的顺序排列。
  3796. ## doneDisabled
  3797. 当 doneDisabled 为 true 时,完成按钮将会被禁用,此时完成按钮的文案将会变成灰色,且不可点击。可用于根据输入内容动态控制业务流程。
  3798. ## 按键文字大小
  3799. 按键文字大小会动态地跟随按键的高度变化。
  3800. ## 键盘高度
  3801. 移动端使用到键盘的地方需要注意键盘的高度,因为键盘可能会遮盖掉页面上需要显示输入内容的区域,所以 NumKeyboard 组件在打开的时候会自动计算键盘的高度,通过 onopen 事件派发出去,开发者可以根据这个值来处理键盘遮挡的问题。
  3802. ## CSS 注入
  3803. 通过 injClass 参数可以向 NumKeyboard 的三个地方注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义背景色与文字颜色。
  3804. panelClass 注入后作用到键盘面板,keyClass 注入后作用到所有按键,doneClass 注入后作用到完成按键。
  3805. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  3806. ## popup
  3807. NumKeyboard 是在 Popup 的基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 改变了过渡动画和背景透明度。
  3808. ================================================
  3809. FILE: docs/mds/components/numKeyboard/guide_en.md
  3810. ================================================
  3811. > NumKeyboard uses the icons ri-delete-back-2-line and ri-skip-down-line, please ensure that the symbol.svg file in your project includes these icons. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  3812. ## Description
  3813. The NumKeyboard component is a virtual numeric keyboard used for inputting integers or decimals. It uses a grid layout, with two layout options: 3\*4 or 4\*4. If the completion key is not displayed, there will only be 3 columns; otherwise, there will be 4 columns.
  3814. ## Keys
  3815. The NumKeyboard component has 5 types of keys: digits 0-9, delete, decimal point, completion, and close. Digits 0-9 and delete are required, while completion, delete, and close are optional.
  3816. The priority of optional keys is as follows: completion > decimal point > close. Therefore, if both the decimal point and close keys need to be displayed, the close button will not be shown, as the close key has a lower priority than the decimal point. If the close button needs to be forcibly shown, the display of the decimal point will need to be disabled. Please refer to the example.
  3817. ## Reverse
  3818. Normally, on mobile devices, we are accustomed to the layout of the numeric keyboard being arranged from top to bottom. However, on traditional physical keyboards, the numeric keypad is arranged from bottom to top. To accommodate the usage habits of certain industries, the NumKeyboard component provides a reverse parameter. When reverse is set to true, the numeric keyboard will be arranged from bottom to top.
  3819. ## doneDisabled
  3820. When doneDisabled is set to true, the completion button will be disabled. In this case, the completion button will appear grayed out and cannot be clicked. This can be used to dynamically control the business flow based on the input content.
  3821. ## Key Text Size
  3822. The key text size will dynamically adjust according to the height of the key.
  3823. ## Keyboard Height
  3824. When using the keyboard on a mobile device, it is important to consider the height of the keyboard. The keyboard may cover the area where input content needs to be displayed on the page. Therefore, the NumKeyboard component automatically calculates the height of the keyboard when it is opened and dispatches it through the onopen event. Developers can use this value to handle the issue of keyboard covering content.
  3825. ## CSS Injection
  3826. The injClass parameter can be used to inject CSS class names (not limited to Tailwind CSS) into three parts of the NumKeyboard. This allows for more customization possibilities for the component's style. In the example, custom background color and text color are achieved through injClass.
  3827. After the panelClass is injected, it will affect the keyboard panel. After the keyClass is injected, it will affect all keys. After the doneClass is injected, it will affect the completion key.
  3828. If the injected class does not take effect, please prepend "!" to the class name being injected. You can refer to the [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier) for more information.
  3829. ## Popup
  3830. The NumKeyboard is built on top of the Popup component. Different effects can be achieved by passing in Popup properties. For example, in the example, the transition animation and background transparency are changed by setting popup.
  3831. ================================================
  3832. FILE: docs/mds/components/numKeyboard/version.md
  3833. ================================================
  3834. ## 1.0.3
  3835. - [!tag|A|0|]新增 `value` 与 `clear` 属性,关联 Issue [#36](https://github.com/any-tdf/stdf/issues/36)。[!issue|sbscan|]
  3836. - [!tag|O|0|]输入值不再通过 `onclick` 事件获取,而是通过 `value` 绑定。
  3837. ================================================
  3838. FILE: docs/mds/components/numKeyboard/version_en.md
  3839. ================================================
  3840. ## 1.0.3
  3841. - [!tag|A|0|]Add `value` and `clear` properties, related to Issue [#36](https://github.com/any-tdf/stdf/issues/36). [!issue|sbscan|]
  3842. - [!tag|O|0|]Input value is no longer obtained through the `onclick` event, but through the `value` binding.
  3843. ================================================
  3844. FILE: docs/mds/components/pagination/api.md
  3845. ================================================
  3846. ## Pagination Props
  3847. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3848. | ---------------- | ---------------------------------------- | ---------------------------------------- | ---- | -------------------- |
  3849. | total | `number` | `0` | Y | 总条数。 |
  3850. | pageSize | `number` | `10` | N | 每页条数。 |
  3851. | current | `number` | `1` | N | 当前页。 |
  3852. | maxShowPage | `5\|7\|9\|11` | `7` | N | 最大显示页码数。 |
  3853. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'full'` | `'md'` | N | 圆角风格。 |
  3854. | type | `'border'\|'block'\|'bold'` | `'bold'` | N | 高亮页码类型。 |
  3855. | pageCol | `number` | `3` | N | 省略页码列数。 |
  3856. | showNextOmitPage | `boolean` | `false` | N | 是否显示后省略页码。 |
  3857. | showPreOmitPage | `boolean` | `false` | N | 是否显示前省略页码。 |
  3858. | injClass | `string` | `''` | N | 注入 CSS 名称。。 |
  3859. | noDataText | `string` | 当前语言的 common.noData | N | 无数据显示文本。 |
  3860. | onePageText | `string` | 当前语言的 pagination.defaultOnlyOnePage | N | 仅一页显示文本。 |
  3861. | continuous | `boolean` | `false` | N | 是否是连续模式。 |
  3862. ## Pagination Events
  3863. | 名称 | 类型 | 参数 | 描述 |
  3864. | -------- | --------------------------- | ------------------ | ------------------ |
  3865. | onchange | `(current: number) => void` | current - 当前页码 | 页码变化时触发。 |
  3866. | onnext | `(current: number) => void` | current - 当前页码 | 点击下一页时触发。 |
  3867. | onpre | `(current: number) => void` | current - 当前页码 | 点击上一页时触发。 |
  3868. ================================================
  3869. FILE: docs/mds/components/pagination/api_en.md
  3870. ================================================
  3871. ## Pagination Props
  3872. | Name | Type | Default | Required | Description |
  3873. | ---------------- | ---------------------------------------- | ------------------------------------------------ | -------- | -------------------------------------------- |
  3874. | total | `number` | `0` | Y | Total number of items. |
  3875. | pageSize | `number` | `10` | N | Number of items per page. |
  3876. | current | `number` | `1` | N | Current page number. |
  3877. | maxShowPage | `5\|7\|9\|11` | `7` | N | Maximum number of page numbers to display. |
  3878. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'full'` | `'md'` | N | Border radius style. |
  3879. | type | `'border'\|'block'\|'bold'` | `'bold'` | N | Highlighted page number style. |
  3880. | pageCol | `number` | `3` | N | Number of columns for omitted page numbers. |
  3881. | showNextOmitPage | `boolean` | `false` | N | Whether to show omitted page numbers after. |
  3882. | showPreOmitPage | `boolean` | `false` | N | Whether to show omitted page numbers before. |
  3883. | injClass | `string` | `''` | N | Inject CSS class name. |
  3884. | noDataText | `string` | Current language's common.noData | N | Text to display when no data. |
  3885. | onePageText | `string` | Current language's pagination.defaultOnlyOnePage | N | Text to display when only one page. |
  3886. | continuous | `boolean` | `false` | N | Whether to use continuous mode. |
  3887. ## Pagination Events
  3888. | Name | Type | Parameters | Description |
  3889. | -------- | --------------------------- | ----------------------------- | -------------------------------------- |
  3890. | onchange | `(current: number) => void` | current - Current page number | Triggered when page number changes. |
  3891. | onnext | `(current: number) => void` | current - Current page number | Triggered when clicking next page. |
  3892. | onpre | `(current: number) => void` | current - Current page number | Triggered when clicking previous page. |
  3893. ================================================
  3894. FILE: docs/mds/components/pagination/FAQ.md
  3895. ================================================
  3896. ================================================
  3897. FILE: docs/mds/components/pagination/FAQ_en.md
  3898. ================================================
  3899. ================================================
  3900. FILE: docs/mds/components/pagination/guide.md
  3901. ================================================
  3902. > Pagination 使用了图标 ri-more-line 和 ri-more-fill,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  3903. ## 设计思路
  3904. 私以为,分页不应该是上滑加载下一页,这种交互会让用户无心理预期而产生不适,所以 STDF 的分页组件交互默认满足以下几个条件:
  3905. - 页码变化事件必须是用户主动触发。
  3906. - 无论何时都须同时显示上一页、下一页、首页、尾页、当前页,用户对全部数据有预期且可直接点击跳转到这些关键页码。
  3907. - 移动端横向显示区域有限,即便如此,也可以通过点击省略页码跳转到任意页码。
  3908. 当然,你也可以配置为**连续模式**,即只允许点击上一页、下一页,比如一些后端接口必须根据上一页数据查询下一页数据的情况。但这样无疑会降低用户体验。
  3909. > To be in charge, the user must be informed. When, for example, the user initiates an operation, immediate feedback confirms that the operation is being carried out, and (eventually) then it’s finished… This communication should be brief, direct, and expressed in the user’s vocabulary rather than the programmer’s. (Apple Human Interface Guidelines)
  3910. ## 事件监听
  3911. Pagination 组件对外暴露了三个事件:onchange、onnext、onpre,分别对应页码变化、下一页、上一页。onnext 和 onpre 事件都会触发 onchange 事件,请按需监听。
  3912. ## total
  3913. Pagination 组件内将不显示 total 数据,请根据具体业务决定是否在页面内显示。
  3914. ## current
  3915. current 为当前页码,内部默认从 1 开始计数,外部也可传入一个初始页码。
  3916. ## maxShowPage
  3917. maxShowPage 表示最大显示页码数,即算上首页、尾页、显示页、省略号等在内一起算的数量,可选值为 5、7、9、11。此数值越大同时显示的页码越多,但也会导致单项宽度变小,影响用户操作,请根据具体业务决定。
  3918. ## 省略页码
  3919. 当总页码数大于 maxShowPage 时,就会有省略页码,省略页码分为前省略页码和后省略页码。当总页码数不是很多时,同时只会省略前后页码中的一个,当总页码数很多时,同时会省略前后页码。
  3920. 所有省略的页码都可以通过点击省略号展开,展开区域支持上下滚动,且支持通过 pageCol 属性控制每行显示的页码数量。**并支持点击任意页码跳转到该页码。**
  3921. 如果担心用户首次使用时无法知晓此交互,可以根据具体业务,比如用户首次使用时且总页码数大于 maxShowPage 时,通过传入 showNextOmitPage 默认将后省略页码展开,加以引导。
  3922. ## type
  3923. type 表示高亮页码类型,可选值为 border、block、bold。border 表示高亮页码为边框,block 表示高亮页码为块,bold 表示高亮页码加粗且弱化其他页码。
  3924. ## CSS 注入
  3925. 通过 injClass 参数可以向组件内部外层注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 实现了自定义圆角风格、两边间距、阴影等。
  3926. 若注入的 CSS 没生效,请在注入的 CSS 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  3927. ================================================
  3928. FILE: docs/mds/components/pagination/guide_en.md
  3929. ================================================
  3930. > Pagination uses the icons ri-more-line and ri-more-fill, please ensure that the symbol.svg file in your project includes these icons. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  3931. ## Design Concept
  3932. In my opinion, pagination should not be based on scrolling up to load the next page. This interaction can cause user uncomfortable as there is no psychological expectation. Therefore, the STDF pagination component meet the following conditions by default:
  3933. - The page change event must be triggered by the user.
  3934. - The previous page, next page, first page, last page, and current page must always be displayed, and the user can directly click to jump to these key page numbers.
  3935. - On mobile devices, the horizontal display area is limited. Nevertheless, users can still click on the ellipsis to jump to any page number.
  3936. Of course, you can also configure it to **continuous mode**, that is, you are only allowed to click on the previous page and the next page. For example, some backend APIs must query the next page of data based on the previous page. But this will undoubtedly reduce the user experience.
  3937. > To be in charge, the user must be informed. When, for example, the user initiates an operation, immediate feedback confirms that the operation is being carried out, and (eventually) then it’s finished… This communication should be brief, direct, and expressed in the user’s vocabulary rather than the programmer’s. (Apple Human Interface Guidelines)
  3938. ## Event Listening
  3939. The Pagination component exposes three events to the outside: onchange, onnext, and onpre, corresponding to page number changes, next page, and previous page, respectively. The onnext and onpre events will also trigger the onchange event, so listen as needed.
  3940. ## total
  3941. The total data will not be displayed inside the Pagination component, so decide whether to display it on the page based on specific business requirements.
  3942. ## current
  3943. Current represents the current page number, which is counted from 1 internally by default. An initial page number can also be passed in from the outside.
  3944. ## maxShowPage
  3945. MaxShowPage represents the maximum number of displayed page numbers, including the first page, last page, displayed page, ellipsis, and so on. The optional values are 5, 7, 9, and 11. The larger the value, the more page numbers will be displayed at the same time, but the width of each item will be smaller, affecting user operations. Decide based on specific business requirements.
  3946. ## Ellipsis Page Number
  3947. When the total number of pages is greater than maxShowPage, there will be ellipsis page numbers, which are divided into front ellipsis page numbers and back ellipsis page numbers. When the total number of pages is not very large, only one of the front and back ellipsis page numbers will be omitted at the same time. When the total number of pages is very large, both the front and back ellipsis page numbers will be omitted at the same time.
  3948. All omitted page numbers can be expanded by clicking on the ellipsis, and the expandable area supports scrolling up and down. The number of page numbers displayed per row can be controlled by the pageCol property. **And clicking on any page number in the expanded area will jump to that page number.**
  3949. If you are concerned that users may not understand this interaction when they use it for the first time, and the total number of pages is greater than maxShowPage, you can pass in showNextOmitPage by default to expand the back ellipsis page numbers and guide them.
  3950. ## Type
  3951. Type represents the type of highlighted page numbers, with optional values of border, block, and bold. Border represents that the highlighted page number is the border, block represents that the highlighted page number is the block, and bold represents that the highlighted page number is bold and the other page numbers are weakened.
  3952. ## CSS Injection
  3953. The injClass parameter can be used to inject a CSS class name (not limited to Tailwind CSS) into the outer layer of the component, which will provide more possibilities for customizing the component style. In the example, custom rounded corners, spacing on both sides, shadows, and other styles are achieved through injClass.
  3954. If the injected CSS does not take effect, add "!" in front of the injected CSS class name, as shown in the [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  3955. ================================================
  3956. FILE: docs/mds/components/pagination/version.md
  3957. ================================================
  3958. ## 0.4.7
  3959. - [!tag|B|1|]修复总页码数没有实时响应的问题。
  3960. ## 0.4.5
  3961. - [!tag|B|1|]修复页码显示错乱问题,关联 [#22](https://github.com/any-tdf/stdf/pull/22) 。[!contribute|lemonTree345|]
  3962. ## 0.1.3
  3963. - [!tag|A|0|]支持是否使用连续模式,即只允许点击上一页、下一页。
  3964. ## 0.1.2
  3965. - [!tag|O|0|]细节优化。当 type 为 bold 且展开此省略页码时,省略号 Icon 也会加粗,使其与高亮页码文字样式逻辑匹配。
  3966. ================================================
  3967. FILE: docs/mds/components/pagination/version_en.md
  3968. ================================================
  3969. ## 0.4.7
  3970. - [!tag|B|1|]Fixed total page number not updating in real time.
  3971. ## 0.4.5
  3972. - [!tag|B|1|]Fixed the problem of incorrect page number display. Related to [#22](https://github.com/any-tdf/stdf/pull/22). [!contribute|lemonTree345|]
  3973. ## 0.1.3
  3974. - [!tag|A|0|]Supports whether to use continuous mode, that is, only allows clicking the previous page and the next page.
  3975. ## 0.1.2
  3976. - [!tag|O|0|]Fine-tune details. When type is set to bold and the ellipsis page numbers are expanded, the ellipsis icon will also be bold, matching the style logic of the highlighted page number text.
  3977. ================================================
  3978. FILE: docs/mds/components/picker/api.md
  3979. ================================================
  3980. ## Picker Props
  3981. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  3982. | ------------------ | ----------------------------------------------------------- | -------------------------------- | ---- | ------------------------------------------ |
  3983. | visible | `boolean` | `false` | N | 是否显示。 |
  3984. | datas | `PickerDatas[]\|PickerDataChild[]` | `[]` | Y | 所有列数据,参考 Picker datas Props。 |
  3985. | autoScrollToLast | `boolean` | `true` | N | 是否自动滚动到上次的选中项。 |
  3986. | cancelText | `string` | 当前语言的 picker.defaultCancel | N | 取消选项文本。 |
  3987. | confirmText | `string` | 当前语言的 picker.defaultConfirm | N | 确定选项文本。 |
  3988. | title | `string` | 当前语言的 picker.defaultTitle | N | 中间标题文本。 |
  3989. | isLinkage | `boolean` | `false` | N | 是否多级联动。 |
  3990. | linkageInitIndexs | `number[]` | `[]` | N | 多级联动时,设置初始选中项。 |
  3991. | linkageShowRows | `number[]` | `[]` | N | 多级联动时,设置每列显示行数。 |
  3992. | linkageFlexs | `number[]` | `[]` | N | 多级联动时,设置每列的宽度。 |
  3993. | linkageAligns | `('left'\|'center'\|'right')[]` | `[]` | N | 多级联动时,设置每列的对齐方式。 |
  3994. | linkageLabelKeys | `string[]` | `[]` | N | 多级联动时,自定义每列 label 的 Key。 |
  3995. | linkageChildrenKey | `string` | `'children'` | N | 多级联动时,自定义上下级 children 的 key。 |
  3996. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  3997. ## Picker Events
  3998. | 名称 | 类型 | 参数 | 描述 |
  3999. | --------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------- |
  4000. | onclose | `() => void` | | 关闭时触发。 |
  4001. | oncancel | `() => void` | | 点击左侧取消时触发。 |
  4002. | onconfirm | `(items: { [key: string]: string }[], indexs: number[]) => void` | items - 选定多列数据组成的数组;<br />indexs - 选定多列数据索引组成的数组。 | 点击右侧确定时触发。 |
  4003. ## PickerDatas Props
  4004. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4005. | ------------ | ----------------------------- | ---------- | ---- | --------------------- |
  4006. | data | `{ [key: string]: string }[]` | `[]` | Y | 列数据。 |
  4007. | showRow | `3`\|`5`\|`7` | `5` | N | 列显示行数。 |
  4008. | initIndex | `number` | `0` | N | 列初始选中项。 |
  4009. | useAnimation | `boolean` | `true` | N | 滚动是否使用动画。 |
  4010. | labelKey | `string` | `'label'` | N | 自定义 label 的 key。 |
  4011. | flex | `number` | `1` | N | 多列时此列宽度。 |
  4012. | align | `'left'\|'center'\|'right'` | `'center'` | N | 多列时此列对齐方式。 |
  4013. ## PickerDataChild Props
  4014. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4015. | ------------- | -------------------------------------- | --------- | ---- | --------------------- |
  4016. | children | `PickerDatas[]` | `[]` | Y | 子数据。 |
  4017. | [key: string] | `string\|PickerDataChild[]\|undefined` | `'label'` | N | 自定义 label 的 key。 |
  4018. | |
  4019. ================================================
  4020. FILE: docs/mds/components/picker/api_en.md
  4021. ================================================
  4022. ## Picker Props
  4023. | Name | Type | Default | Required | Description |
  4024. | ------------------ | ----------------------------------------------------------- | -------------------------------------- | -------- | ---------------------------------------------------------- |
  4025. | visible | `boolean` | `false` | N | Whether to show the picker. |
  4026. | datas | `PickerDatas[]\|PickerDataChild[]` | `[]` | Y | All column data, refer to Picker datas Props. |
  4027. | autoScrollToLast | `boolean` | `true` | N | Whether to automatically scroll to the last selected item. |
  4028. | cancelText | `string` | Current language picker.defaultCancel | N | Cancel button text. |
  4029. | confirmText | `string` | Current language picker.defaultConfirm | N | Confirm button text. |
  4030. | title | `string` | Current language picker.defaultTitle | N | Title text. |
  4031. | isLinkage | `boolean` | `false` | N | Whether to enable multi-level linkage. |
  4032. | linkageInitIndexs | `number[]` | `[]` | N | Initial selected indexes for multi-level linkage. |
  4033. | linkageShowRows | `number[]` | `[]` | N | Number of rows to display for each column in linkage mode. |
  4034. | linkageFlexs | `number[]` | `[]` | N | Width of each column in linkage mode. |
  4035. | linkageAligns | `('left'\|'center'\|'right')[]` | `[]` | N | Alignment of each column in linkage mode. |
  4036. | linkageLabelKeys | `string[]` | `[]` | N | Custom label keys for each column in linkage mode. |
  4037. | linkageChildrenKey | `string` | `'children'` | N | Custom children key for parent-child data in linkage mode. |
  4038. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  4039. ## Picker Events
  4040. | Name | Type | Parameters | Description |
  4041. | --------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------- |
  4042. | onclose | `() => void` | | Triggered when closing. |
  4043. | oncancel | `() => void` | | Triggered when clicking cancel. |
  4044. | onconfirm | `(items: { [key: string]: string }[], indexs: number[]) => void` | items - Array of selected column data;<br />indexs - Array of selected indexes. | Triggered when clicking confirm. |
  4045. ## PickerDatas Props
  4046. | Name | Type | Default | Required | Description |
  4047. | ------------ | ----------------------------- | ---------- | -------- | ---------------------------------------- |
  4048. | data | `{ [key: string]: string }[]` | `[]` | Y | Column data. |
  4049. | showRow | `3`\|`5`\|`7` | `5` | N | Number of rows to display. |
  4050. | initIndex | `number` | `0` | N | Initial selected index. |
  4051. | useAnimation | `boolean` | `true` | N | Whether to use animation when scrolling. |
  4052. | labelKey | `string` | `'label'` | N | Custom label key. |
  4053. | flex | `number` | `1` | N | Column width in multi-column mode. |
  4054. | align | `'left'\|'center'\|'right'` | `'center'` | N | Column alignment in multi-column mode. |
  4055. ## PickerDataChild Props
  4056. | Name | Type | Default | Required | Description |
  4057. | ------------- | -------------------------------------- | --------- | -------- | ----------------- |
  4058. | children | `PickerDatas[]` | `[]` | Y | Child data. |
  4059. | [key: string] | `string\|PickerDataChild[]\|undefined` | `'label'` | N | Custom label key. |
  4060. | |
  4061. ================================================
  4062. FILE: docs/mds/components/picker/FAQ.md
  4063. ================================================
  4064. ================================================
  4065. FILE: docs/mds/components/picker/FAQ_en.md
  4066. ================================================
  4067. ================================================
  4068. FILE: docs/mds/components/picker/guide.md
  4069. ================================================
  4070. ## 使用场景
  4071. Picker 组件用于选择单条或多条数据,数据量较大或无法确定长度的动态数据。Picker 组件的数据源可以是静态数据,也可以是动态数据。
  4072. ## 传入数据
  4073. 非多级联动时,传入的数据 datas 是一个数组,数组中的每一项都是一个对象,对象中的属性参考 PickerDatas Props。其中 data 才是每一列的数据,每一列的数据都是一个数组。
  4074. 多级联动时,传入的数据与非联动的结构将完全不一样,传入的是一个多层级的数组,由 Picker 内部自动处理。请参考示例。
  4075. 注意:多级联动使用时,请在传入数据之前先明确数据层级,且**保证每一条数据层级相同**,缺失的请用空数据或其他补齐。
  4076. ## 返回数据
  4077. Picker 组件返回的数据有两项,一项是选定的多列数据组成的数组 items,另一项是选定的多列数据的索引组成的数组 indexs,请按照需求选择使用。
  4078. 其中 items 每一项的数据结构与传入的数据结构一致,也方便开发者直接使用。
  4079. ## 使用优化
  4080. 实际开发中,多数情况下 Picker 的数据都是动态获取的,通常是通过接口获取,一般我们需要对传入的数据进行循环处理,以便于 Picker 组件能够正常使用。但这是一个比较繁琐且没必要的过程,因此 STDF 对 Picker 组件的入参作了一些优化,使得开发者可以直接传入接口返回的数据,而不需要做循环处理。
  4081. 非多级联动时:
  4082. - 可以通过 PickerDatas Props 中的 labelKey 自定义传入的每列数据 label 属性名,如果不传入则默认使用 'label',请参考示例。
  4083. 多级联动时:
  4084. - 可以通过 linkageLabelKeys 自定义对应的每级数据的 label 属性名,如果不传入则默认使用 'label',请参考示例。
  4085. - 可以通过 linkageChildrenKey 自定义上下级数据的 children 属性名,如果不传入则默认使用 'children',请参考示例。
  4086. ## 特别说明
  4087. 多级联动使用时,请在**传入数据之前先明确数据层级**,传入 linkageInitIndexs、linkageShowRows、linkageFlexs、linkageAligns、linkageLabelKeys 的长度必须与数据层级一致。
  4088. ## 说明
  4089. Picker 选择器是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 radius 改变圆角风格。
  4090. ## Radio、ActionSheet、IndexBar、Picker、AsyncPicker 区别
  4091. Radio、Checkbox、ActionSheet、IndexBar、Picker、AsyncPicker 组件本质都是给出一系列数据,让用户进行数据选择或执行一些操作,但在使用上有一些区别:
  4092. - Radio 一般用于单选数据,数据量固定且较少,需要在 UI 界面上直接展示选项,方便用户在界面交互时对备选数据有个概览,比如性别选择。
  4093. - Checkbox 使用场景类似 Radio,但是可以多选。
  4094. - ActionSheet 一般用于选择之后立即执行一些操作,选项固定且较少,但不需要在 UI 界面上直接展示选项,比如做一些删除、修改等操作。
  4095. - IndexBar 一般用于选择单条数据,数据量非常大的动态数据,且已经对数据进行了分类索引,一般会用整个页面来展示。
  4096. - Picker 一般用于选择单条或多条数据,数据量较大或无法确定长度的动态数据,或用于一些联动数据的选择。**无论是否联动,数据在传入时已经是确定的。**
  4097. - AsyncPicker 一般用于选择多条数据,下级数据是根据上级数据动态获取的,比如服务端接口单次只返回一级数据,需要根据用户选择的一级数据再次请求接口获取下级数据。
  4098. ================================================
  4099. FILE: docs/mds/components/picker/guide_en.md
  4100. ================================================
  4101. ## Usage Scenario
  4102. The Picker component is used to select one or more pieces of data from a large amount of dynamic data that may have an unspecified length. The data source for the Picker component can be static data or dynamic data.
  4103. ## Incoming Data
  4104. When there is no multi-level linkage, the incoming data `datas` is an array. Each item in the array is an object, and the properties of the object reference the `PickerDatas Props`. The `data` is the data for each column, and the data for each column is an array.
  4105. When there is multi-level linkage, the incoming data structure will be completely different from non-linked structures. You need to pass in a multi-level array that the Picker component processes automatically. Refer to the example for details.
  4106. Note: When using multi-level linkage, make sure to specify the data hierarchy before passing in the data and ensure that the hierarchy of each data is the same. If any data is missing, please fill it in with empty data or other data to ensure uniformity.
  4107. ## Return Data
  4108. The Picker component returns two sets of data. One is an array of selected data from multiple columns, and the other is an array of indexes of the selected data from multiple columns. Please select the data sets to use according to your needs.
  4109. Each item in `items` has the same data structure as in the input data, which is also convenient for developers to use directly.
  4110. ## Usage Optimization
  4111. In actual development, the data used for the Picker is usually obtained dynamically, often through an interface. Usually, we need to loop through the incoming data to enable the Picker component to function properly. However, this is a cumbersome and unnecessary process. Therefore, some optimization has been made to the input parameters of the Picker component to enable developers to directly pass in the data returned by the interface without undergoing a looping process.
  4112. When there is no multi-level linkage:
  4113. - You can customize the `label` property name for the column data passed in through the `PickerDatas Props` with `labelKey`. If not passed in, it defaults to `'label'`. See the example for details.
  4114. When there is multi-level linkage:
  4115. - You can customize each level's `label` property name with `linkageLabelKeys`. If not passed in, it defaults to `'label'`. See the example for details.
  4116. - You can customize the `children` property name for the upper and lower level data with `linkageChildrenKey`. If not passed in, it defaults to `'children'`. See the example for details.
  4117. ## Special Instructions
  4118. When using multi-level linkage, make sure to specify the data hierarchy before passing in the data. The lengths of `linkageInitIndexs`, `linkageShowRows`, `linkageFlexs`, `linkageAligns`, and `linkageLabelKeys` must be the same as the data hierarchy.
  4119. ## Description
  4120. The Picker selector is based on Popup and encapsulated by predefining some Popup Props, so different effects can be achieved by passing in Popup attributes. For example, changing the rounded corner style by setting the `radius` of `popup`.
  4121. ## Differences Between Radio, ActionSheet, IndexBar, Picker, and AsyncPicker
  4122. Radio, Checkbox, ActionSheet, IndexBar, Picker, and AsyncPicker components are essentially used to provide a series of data for users to choose from or to perform certain operations. However, there are some differences in usage:
  4123. - Radio is generally used for single-choice data. The amount of data is fixed and relatively small, and options need to be displayed directly in the UI interface to facilitate the user to have an overview of the options during UI interaction, for example, gender selection.
  4124. - Checkbox has a similar usage scenario to radio, but allows multiple selections.
  4125. - ActionSheet is generally used for immediate execution of certain operations after selection. The options are fixed and relatively small, but do not need to be displayed directly in the UI interface, for example, performing some delete or modification operations.
  4126. - IndexBar is generally used to select a single piece of data from a large amount of dynamic data that has already been categorized and indexed, and a whole page is usually used for display.
  4127. - Picker is generally used to select one or more pieces of data from dynamic data with a larger quantity or an undefined length, or for the selection of some linked data. The data is determined when it is passed in, regardless of whether there is linkage or not.
  4128. - AsyncPicker is generally used to select multiple pieces of data. The next-level data is obtained dynamically based on the upper-level data. For example, the server interface only returns one level of data at a time, and it is necessary to request the interface again to obtain the next-level data based on the upper-level data selected by the user.
  4129. ================================================
  4130. FILE: docs/mds/components/picker/version.md
  4131. ================================================
  4132. ================================================
  4133. FILE: docs/mds/components/picker/version_en.md
  4134. ================================================
  4135. ================================================
  4136. FILE: docs/mds/components/placeholder/api.md
  4137. ================================================
  4138. ## Placeholder Props
  4139. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4140. | -------- | ---------------------------------------------------------------- | -------- | ---- | --------------- |
  4141. | py | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'4'` | N | 上下内边距。 |
  4142. | height | `'full'\|'1'\|'2'\|'4'\|'8'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'` | `'full'` | N | 高度。 |
  4143. | radius | `'none'\|'sm'\|'md'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'md'` | N | 圆角风格。 |
  4144. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'none'` | N | 阴影风格。 |
  4145. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  4146. ## Placeholder Snippets
  4147. | 名称 | 类型 | 参数 | 说明 |
  4148. | -------- | ------------------------------------------------------------------- | ---- | ------------------ |
  4149. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Placeholder 内容。 |
  4150. ================================================
  4151. FILE: docs/mds/components/placeholder/api_en.md
  4152. ================================================
  4153. ## Placeholder Props
  4154. | Name | Type | Default | Required | Description |
  4155. | -------- | ---------------------------------------------------------------- | -------- | -------- | ------------------------ |
  4156. | py | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'4'` | N | Vertical padding. |
  4157. | height | `'full'\|'1'\|'2'\|'4'\|'8'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'` | `'full'` | N | Height. |
  4158. | radius | `'none'\|'sm'\|'md'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'md'` | N | Border radius style. |
  4159. | shadow | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'` | `'none'` | N | Shadow style. |
  4160. | injClass | `string` | `''` | N | Injected CSS class name. |
  4161. ## Placeholder Snippets
  4162. | Name | Type | Parameters | Description |
  4163. | -------- | ------------------------------------------------------------------- | ---------- | -------------------- |
  4164. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Placeholder content. |
  4165. ================================================
  4166. FILE: docs/mds/components/placeholder/FAQ.md
  4167. ================================================
  4168. ================================================
  4169. FILE: docs/mds/components/placeholder/FAQ_en.md
  4170. ================================================
  4171. ================================================
  4172. FILE: docs/mds/components/placeholder/guide.md
  4173. ================================================
  4174. ## 说明
  4175. Placeholder 组件用于占位,用于表示此位置的一些内容。
  4176. ================================================
  4177. FILE: docs/mds/components/placeholder/guide_en.md
  4178. ================================================
  4179. ## Description
  4180. The Placeholder component is used to occupy a space and can be used to represent some content in this space.
  4181. ================================================
  4182. FILE: docs/mds/components/placeholder/version.md
  4183. ================================================
  4184. ================================================
  4185. FILE: docs/mds/components/placeholder/version_en.md
  4186. ================================================
  4187. ================================================
  4188. FILE: docs/mds/components/popup/api.md
  4189. ================================================
  4190. ## Popup Props
  4191. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4192. | ------------------ | ---------------------------------------------------------------------------------- | ------------ | ---- | -------------------------------------------------------------------------------------------- |
  4193. | visible | `boolean` | `false` | N | 是否显示。 |
  4194. | size | `number` | `40` | N | 弹出层大小,值为 0 时由内部元素决定。 |
  4195. | position | `'center'\|'top'\|'bottom'\|'left'\|'right'` | `'bottom'` | N | 显示位置。 |
  4196. | duration | `number` | `450` | N | 出现动画过渡时间,单位:ms。 |
  4197. | outDuration | `number` | `240` | N | 退出动画过渡时间,单位:ms。 |
  4198. | easeType | [`SvelteEasing`](https://svelte.dev/docs#run-time-svelte-easing) | `'cubicOut'` | N | 出现动画,共 31 个值,参考 [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing)。 |
  4199. | easeOutType | [`SvelteEasing`](https://svelte.dev/docs#run-time-svelte-easing) | `'cubicOut'` | N | 退出动画,共 31 个值,参考 [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing)。 |
  4200. | px | `'0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'8'\|'10'\|'12'\|'16'\|'20'` | `'0'` | N | 左右间距。 |
  4201. | py | `'0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'8'\|'10'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'` | `'0'` | N | 上下间距。 |
  4202. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | 遮罩层参数。 |
  4203. | maskClosable | `boolean` | `true` | N | 点击遮罩层是否关闭。 |
  4204. | radiusPosition | `'all'\|'top'\|'bottom'\|'left'\|'right'` | `'top'` | N | 圆角位置。 |
  4205. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'none'` | N | 圆角大小。 |
  4206. | transitionDistance | `number` | `0` | N | 动画距离,当弹出层大小由内部元素决定时生效。 |
  4207. | transparent | `boolean` | `false` | N | 背景是否透明。 |
  4208. | allowBodyScroll | `boolean` | `true` | N | 弹出层显示时是否允许 body 滚动。 |
  4209. | zIndex | `number` | `600` | N | z-index。 |
  4210. | dynamicFixed | `boolean` | `true` | N | 是否动态固定。 |
  4211. | hideScrollbar | `boolean` | `false` | N | 是否隐藏滚动区域滚动条。 |
  4212. ## Popup Events
  4213. | 名称 | 类型 | 参数 | 描述 |
  4214. | ----------- | ------------ | ---- | ----------------------------------------------------------- |
  4215. | onclickMask | `() => void` | - | 点击弹出层遮罩时触发,即使 maskClosable 为 false 也会触发。 |
  4216. | onclose | `() => void` | - | 弹出层关闭时触发。 |
  4217. ## Popup Snippets
  4218. | 名称 | 类型 | 参数 | 说明 |
  4219. | -------- | ------------------------------------------------------------------- | ---- | ------------ |
  4220. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Popup 内容。 |
  4221. ## SvelteEasing
  4222. ```javascript
  4223. type SvelteEasing =
  4224. | 'backIn'
  4225. | 'backInOut'
  4226. | 'backOut'
  4227. | 'bounceIn'
  4228. | 'bounceInOut'
  4229. | 'bounceOut'
  4230. | 'circIn'
  4231. | 'circInOut'
  4232. | 'circOut'
  4233. | 'cubicIn'
  4234. | 'cubicInOut'
  4235. | 'cubicOut'
  4236. | 'elasticIn'
  4237. | 'elasticInOut'
  4238. | 'elasticOut'
  4239. | 'expoIn'
  4240. | 'expoInOut'
  4241. | 'expoOut'
  4242. | 'linear'
  4243. | 'quadIn'
  4244. | 'quadInOut'
  4245. | 'quadOut'
  4246. | 'quartIn'
  4247. | 'quartInOut'
  4248. | 'quartOut'
  4249. | 'quintIn'
  4250. | 'quintInOut'
  4251. | 'quintOut'
  4252. | 'sineIn'
  4253. | 'sineInOut'
  4254. | 'sineOut';
  4255. ```
  4256. ================================================
  4257. FILE: docs/mds/components/popup/api_en.md
  4258. ================================================
  4259. ## Popup Props
  4260. | Name | Type | Default | Required | Description |
  4261. | ------------------ | ---------------------------------------------------------------------------------- | ------------ | -------- | --------------------------------------------------------------------------------------------------------------- |
  4262. | visible | `boolean` | `false` | N | Whether to show the popup. |
  4263. | size | `number` | `40` | N | Popup size. When value is 0, size is determined by inner elements. |
  4264. | position | `'center'\|'top'\|'bottom'\|'left'\|'right'` | `'bottom'` | N | Display position. |
  4265. | duration | `number` | `450` | N | Enter animation transition duration in ms. |
  4266. | outDuration | `number` | `240` | N | Exit animation transition duration in ms. |
  4267. | easeType | [`SvelteEasing`](https://svelte.dev/docs#run-time-svelte-easing) | `'cubicOut'` | N | Enter animation type, 31 values available, see [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing). |
  4268. | easeOutType | [`SvelteEasing`](https://svelte.dev/docs#run-time-svelte-easing) | `'cubicOut'` | N | Exit animation type, 31 values available, see [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing). |
  4269. | px | `'0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'8'\|'10'\|'12'\|'16'\|'20'` | `'0'` | N | Horizontal padding. |
  4270. | py | `'0'\|'1'\|'2'\|'3'\|'4'\|'5'\|'6'\|'8'\|'10'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'` | `'0'` | N | Vertical padding. |
  4271. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | Mask layer parameters. |
  4272. | maskClosable | `boolean` | `true` | N | Whether clicking mask layer closes popup. |
  4273. | radiusPosition | `'all'\|'top'\|'bottom'\|'left'\|'right'` | `'top'` | N | Border radius position. |
  4274. | radius | `'none'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'none'` | N | Border radius size. |
  4275. | transitionDistance | `number` | `0` | N | Animation distance when popup size is determined by inner elements. |
  4276. | transparent | `boolean` | `false` | N | Whether background is transparent. |
  4277. | allowBodyScroll | `boolean` | `true` | N | Whether to allow body scrolling when popup is shown. |
  4278. | zIndex | `number` | `600` | N | z-index value. |
  4279. | dynamicFixed | `boolean` | `true` | N | Whether to use dynamic fixed positioning. |
  4280. | hideScrollbar | `boolean` | `false` | N | Whether to hide scrollbar in scroll area. |
  4281. ## Popup Events
  4282. | Name | Type | Params | Description |
  4283. | ----------- | ------------ | ------ | ------------------------------------------------------------------ |
  4284. | onclickMask | `() => void` | - | Triggered when clicking mask layer, even if maskClosable is false. |
  4285. | onclose | `() => void` | - | Triggered when popup closes. |
  4286. ## Popup Snippets
  4287. | Name | Type | Parameters | Description |
  4288. | -------- | ------------------------------------------------------------------- | ---------- | -------------- |
  4289. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Popup content. |
  4290. ## SvelteEasing
  4291. ```javascript
  4292. type SvelteEasing =
  4293. | 'backIn'
  4294. | 'backInOut'
  4295. | 'backOut'
  4296. | 'bounceIn'
  4297. | 'bounceInOut'
  4298. | 'bounceOut'
  4299. | 'circIn'
  4300. | 'circInOut'
  4301. | 'circOut'
  4302. | 'cubicIn'
  4303. | 'cubicInOut'
  4304. | 'cubicOut'
  4305. | 'elasticIn'
  4306. | 'elasticInOut'
  4307. | 'elasticOut'
  4308. | 'expoIn'
  4309. | 'expoInOut'
  4310. | 'expoOut'
  4311. | 'linear'
  4312. | 'quadIn'
  4313. | 'quadInOut'
  4314. | 'quadOut'
  4315. | 'quartIn'
  4316. | 'quartInOut'
  4317. | 'quartOut'
  4318. | 'quintIn'
  4319. | 'quintInOut'
  4320. | 'quintOut'
  4321. | 'sineIn'
  4322. | 'sineInOut'
  4323. | 'sineOut';
  4324. ```
  4325. ================================================
  4326. FILE: docs/mds/components/popup/FAQ.md
  4327. ================================================
  4328. ================================================
  4329. FILE: docs/mds/components/popup/FAQ_en.md
  4330. ================================================
  4331. ================================================
  4332. FILE: docs/mds/components/popup/guide.md
  4333. ================================================
  4334. ## Popup 与 BottomSheet
  4335. 在 STDF 的设计思路内,BottomSheet 与 Popup 都属于界面内的浮动交互,一般用于在页面内进行一些二级操作场景,在组件使用上有一些相似之处。**但弹出层 Popup 是「层」的概念,而底部浮窗 BottomSheet 是「窗」的概念**。
  4336. Popup 作为弹出层,内部一般不宜做比较复杂步骤的交互,默认点击遮罩层就可以关闭,但可以自定义弹出的位置、大小、过渡动画、方向、样式等多项参数。**重样式轻逻辑。**
  4337. BottomSheet 作为底部浮窗,就只能从底部弹出。「浮」体现在可以通过滑动其内部的头部区域来控制其固定高度;而「窗」区别于「层」的是,BottomSheet 有自己的头部区域,可以自定义头部内容,并派发出关闭、返回、滑动等类似窗口交互的事件,可以用于一些相对复杂的交互场景,默认点击遮罩不可关闭。**重逻辑轻样式。**
  4338. ## size
  4339. 弹出层的大小由 size 决定,表示占据整个页面大小的百分比,当位置为 top、bottom、center 时表示弹出层的高占据视窗高度的比例,当位置为 left 和 right 时表示弹出层的宽占据视窗宽度的比例。值为 0 时弹出层不再固定宽高,而是由内部元素的宽或高决定。
  4340. ## 动画
  4341. 弹出层出现与退出的过渡动画类型由 easeType 决定,默认值为 cubicOut,可选值有 31 个(一个线性动画 linear 与下面 30 种非线性动画),具体值可参考 [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing),具体非线性动效可参考 [ease visualiser](https://svelte.dev/examples/easing)。而动画出现与退出的时间由 duration 与 outDuration 决定。
  4342. | ease | in | out | inOut |
  4343. | ------- | --------- | ---------- | ------------ |
  4344. | back | backIn | backOut | backInOut |
  4345. | bounce | bounceIn | bounceOut | bounceInOut |
  4346. | circ | circIn | circOut | circInOut |
  4347. | cubic | cubicIn | cubicOut | cubicInOut |
  4348. | elastic | elasticIn | elasticOut | elasticInOut |
  4349. | expo | expoIn | expoOut | expoInOut |
  4350. | quad | quadIn | quadOut | quadInOut |
  4351. | quart | quartIn | quartOut | quartInOut |
  4352. | quint | quintIn | quintOut | quintInOut |
  4353. | sine | sineIn | sineOut | sineInOut |
  4354. ## 间距
  4355. 当弹出层位置是 top、bottom、center 时,弹出层的宽度会占据整个视窗宽度,此时若需要弹出层的左右两侧有间距,则可通过 px 这个 Props 来设置。当弹出层位置是 left、right 时,弹出层的高度会占据整个视窗高度,此时若需要弹出层的上下两侧有间距,则可以通过 py 来设置。请参考示例。
  4356. ## transitionDistance
  4357. 一般来说,如果不确定弹出层内容的宽高(比如动态展示协议)或预计内容会很多,请尽量使用固定大小限制弹出层大小,使内部元素滚动展示。此时,弹出层出现时,会从页面可视区域外向可视区域内移入,移动距离就是弹出层的大小。
  4358. 当弹出层内容的宽高确定时,可以设置弹出层的 size 为 0,弹出层大小由内部元素决定,但组件无法提前获悉弹出层的宽高,因此无法执行弹出层的动画效果,此时就需要外部传入 transitionDistance 即弹出层的宽或高(位置为 top 和 bottom 时需要传入高,位置为 left 和 right 时需要传入宽)来固定动画执行的距离,单位为 px。此值无需严格准确,只要保证动画执行的距离合适即可。
  4359. 由于位置为 center 时动画效果为缩放,无论弹出层的宽高为多少都无需传入 transitionDistance。
  4360. ## 背景色
  4361. 弹出层的背景色会自动适配亮暗模式,当 transparent 为 true 时,弹出层的背景色为透明,可以满足其他不需要背景色的需求。
  4362. ## 事件
  4363. 弹出层默认点击遮罩会关闭,若不需要此功能,可以设置 maskClosable 为 false。另外支持通过 onclose 来监听弹出层退出事件,而 onclickMask 事件则是点击遮罩层时触发,即使 maskClosable 为 false 也会触发。
  4364. ## 优化
  4365. 由于移动端的 Safari、Chrome 或其他一些浏览器滚动页面时会动态显示工具栏或地址栏(多此一举),导致页面的高度也会动态变化,Popup 针对这一情况也做了优化。当 dynamicFixed 为 true 时滚动页面时会动态地更新页面高度,相对应地弹出层相对于页面的位置也会动态更新。
  4366. 当然,这个滚动监听会有微弱的性能损失,如果你的项目中不需要此功能(比如在可控的 webview 内使用),可以设置 dynamicFixed 为 false 来关闭。
  4367. ================================================
  4368. FILE: docs/mds/components/popup/guide_en.md
  4369. ================================================
  4370. ## Popup vs. BottomSheet
  4371. In the STDF design philosophy, both BottomSheet and Popup are floating interactions within the interface, generally used for secondary operations within a page. There are some similarities in the use of the components. However, the Popup is a "layer" concept, while the BottomSheet is a "window" concept.
  4372. As a pop-up layer, the Popup is generally not suitable for complex step-by-step interactions. Clicking the mask layer should close the Popup by default, but you can customize the position, size, transition animation, direction, style, and other parameters of the Popup. **The emphasis is on style rather than logic.**
  4373. As a bottom floating window, the BottomSheet can only be popped up from the bottom. The "floating" means that its fixed height can be controlled by sliding its inner header area. Unlike the Popup's "layer" concept, the BottomSheet has its own header area, which allows custom header content and dispatches close, return, slide, and other window-like interactive events. It can be used for relatively complex interaction scenarios, and by default, clicking the mask cannot close the BottomSheet. **The emphasis is on logic rather than style.**
  4374. ## size
  4375. The size of the popup is determined by the size property, which represents the percentage of the entire page size. When the position is top, bottom or center, it represents the proportion of the popup's height to the viewport height. When the position is left or right, it represents the proportion of the popup's width to the viewport width. When the value is 0, the size of the popup is no longer fixed, but determined by the width or height of the internal elements.
  4376. ## Animation
  4377. The transition animation type when the Popup appears and exits is determined by the easeType property, with a default value of cubicOut. There are 31 optional values (including a linear animation and 30 non-linear animations), specifically documented at [svelte/easing](https://svelte.dev/docs#run-time-svelte-easing), and the specific non-linear effects can be seen at the [ease visualizer](https://svelte.dev/examples/easing). The duration of the animation appearing and exiting is determined by the duration and outDuration properties.
  4378. | ease | in | out | inOut |
  4379. | ------- | --------- | ---------- | ------------ |
  4380. | back | backIn | backOut | backInOut |
  4381. | bounce | bounceIn | bounceOut | bounceInOut |
  4382. | circ | circIn | circOut | circInOut |
  4383. | cubic | cubicIn | cubicOut | cubicInOut |
  4384. | elastic | elasticIn | elasticOut | elasticInOut |
  4385. | expo | expoIn | expoOut | expoInOut |
  4386. | quad | quadIn | quadOut | quadInOut |
  4387. | quart | quartIn | quartOut | quartInOut |
  4388. | quint | quintIn | quintOut | quintInOut |
  4389. | sine | sineIn | sineOut | sineInOut |
  4390. ## Spacing
  4391. When the position of the popup layer is top, bottom, or center, and the width of the popup layer takes up the entire viewport, you can use the `px` prop to set the left and right spacing. When the position of the popup layer is left or right, and the height of the popup layer takes up the entire viewport, you can use the `py` prop to set the top and bottom spacing. Please refer to the example.
  4392. ## Transition Distance
  4393. When the size of the popup layer content is not certain, or a large amount of content is expected (such as displaying agreements dynamically), it is recommended to use a fixed size to limit the size of the popup layer, allowing the internal elements to scroll. In this case, when the popup layer appears, it will move from outside the visible area of the page into the visible area, and the distance moved will be the size of the popup layer.
  4394. When the width and height of the popup layer content are determined, you can set the `size` of the popup layer to 0, and the size will be determined by the internal elements. However, the component cannot obtain the width and height of the popup layer in advance, which causes the animation effect to not be executed. In this case, transitionDistance needs to be provided externally to specify the width or height of the popup layer (height needs to be provided for the top and bottom positions, while width needs to be provided for the left and right positions) to fix the animation distance, in pixels. It doesn't need to be exact, as long as the animation distance is appropriate.
  4395. Note that when the position of the popup layer is center, the animation effect is scaling, so `transitionDistance` does not need to be provided regardless of the size of the popup layer.
  4396. ## Background Color
  4397. The background color of the popup layer will automatically adapt to the light and dark background. When `transparent` is set to true, the background color of the popup layer will be transparent, which can satisfy needs where no background color is required.
  4398. ## Events
  4399. By default, clicking on the mask of the popup layer will close it. If this function is not required, you can set `maskClosable` to false. Additionally, `onclose` is supported to listen for the exit event of the popup layer, while `onclickMask` is triggered when the mask layer is clicked. Even if `maskClosable` is set to false, this event will still be triggered.
  4400. ## Optimization
  4401. Popup has also been optimized to dynamically update the page height and the position of the popup layer relative to the page with `dynamicFixed` set to true when scrolling the page in mobile versions of Safari, Chrome, or other browsers. However, this scroll listener will have a slight performance loss. If this feature is not needed in your project (such as when using a controllable webview), you can set `dynamicFixed` to false to disable it.
  4402. ================================================
  4403. FILE: docs/mds/components/popup/version.md
  4404. ================================================
  4405. ================================================
  4406. FILE: docs/mds/components/popup/version_en.md
  4407. ================================================
  4408. ================================================
  4409. FILE: docs/mds/components/progress/api.md
  4410. ================================================
  4411. ## Progress Props
  4412. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4413. | --------------- | ------------------------------------ | --------- | ---- | ------------------------------------------------- |
  4414. | percent | `number` | `66` | N | 百分比。 |
  4415. | percentPosition | `'inner'\|'right'\|'block'\|null` | `'right'` | N | 百分比位置。 |
  4416. | height | `'1'\|'2'\|'3'\|'4'` | `'2'` | N | 高度。 |
  4417. | radius | `'full'\|'middle'\|'none'` | `'full'` | N | 圆角风格。 |
  4418. | inactive | `boolean` | `false` | N | 是否置灰。 |
  4419. | overflowPercent | `number` | `10` | N | percentPosition 为 `'inner'` 时,文字溢出的阀值。 |
  4420. | duration | `'150'\|'300'\|'500'\|'700'\|'1000'` | `'300'` | N | 动画过度时间(ms)。 |
  4421. | injClass | `string` | `''` | N | 激活进度条注入 Class 名称。 |
  4422. | trackInjClass | `string` | `''` | N | 轨道条注入 Class 名称。 |
  4423. ## Progress Snippets
  4424. | 名称 | 类型 | 参数 | 说明 |
  4425. | -------- | ------------------------------------------------------------------- | ---- | -------------------- |
  4426. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染文字内容。 |
  4427. ================================================
  4428. FILE: docs/mds/components/progress/api_en.md
  4429. ================================================
  4430. ## Progress Props
  4431. | Name | Type | Default | Required | Description |
  4432. | --------------- | ------------------------------------ | --------- | -------- | ----------------------------------------------------------------- |
  4433. | percent | `number` | `66` | N | Percentage value. |
  4434. | percentPosition | `'inner'\|'right'\|'block'\|null` | `'right'` | N | Position of percentage text. |
  4435. | height | `'1'\|'2'\|'3'\|'4'` | `'2'` | N | Height of progress bar. |
  4436. | radius | `'full'\|'middle'\|'none'` | `'full'` | N | Border radius style. |
  4437. | inactive | `boolean` | `false` | N | Whether to show in inactive state. |
  4438. | overflowPercent | `number` | `10` | N | Text overflow threshold when percentPosition is set to `'inner'`. |
  4439. | duration | `'150'\|'300'\|'500'\|'700'\|'1000'` | `'300'` | N | Animation transition duration (ms). |
  4440. | injClass | `string` | `''` | N | Injected class name for active progress bar. |
  4441. | trackInjClass | `string` | `''` | N | Injected class name for track bar. |
  4442. ## Progress Snippets
  4443. | Name | Type | Params | Description |
  4444. | -------- | ------------------------------------------------------------------- | ------ | ------------------------------------------- |
  4445. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders custom text content when passed in. |
  4446. ================================================
  4447. FILE: docs/mds/components/progress/FAQ.md
  4448. ================================================
  4449. ================================================
  4450. FILE: docs/mds/components/progress/FAQ_en.md
  4451. ================================================
  4452. ================================================
  4453. FILE: docs/mds/components/progress/guide.md
  4454. ================================================
  4455. ## Snippet
  4456. 当传入 children 时,百分比内容不再使用默认百分比文字,而是使用传入的 children 渲染。
  4457. ## overflowPercent
  4458. 当 percentPosition 为 `'inner'` 且百分比数值较低时,百分比文字会溢出,overflowPercent 为溢出的阀值,当百分比小于该值时,百分比文字会放置于进度条右侧。
  4459. ## CSS 注入
  4460. 通过 injClass 和 trackInjClass 参数可以向组件内部的激活进度条和轨道条元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 和 trackInjClass 实现了自定义进度条颜色。
  4461. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  4462. ================================================
  4463. FILE: docs/mds/components/progress/guide_en.md
  4464. ================================================
  4465. ## Snippet
  4466. When children is passed in, the percentage content will no longer use the default percentage text, but will render using the passed in children.
  4467. ## overflowPercent
  4468. When percentPosition is set to `'inner'` and the percentage value is low, the percentage text may overflow. overflowPercent is the overflow threshold - when the percentage is less than this value, the percentage text will be placed on the right side of the progress bar.
  4469. ## CSS Injection
  4470. The injClass and trackInjClass parameters can be used to inject CSS class names (not limited to Tailwind CSS) into the active progress bar and track bar elements inside the component. This provides more customization possibilities for component styling. The example demonstrates customizing progress bar colors through injClass and trackInjClass.
  4471. If the injected class is not taking effect, try adding "!" before the class name. See [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier) for reference.
  4472. ================================================
  4473. FILE: docs/mds/components/progress/version.md
  4474. ================================================
  4475. ================================================
  4476. FILE: docs/mds/components/progress/version_en.md
  4477. ================================================
  4478. ================================================
  4479. FILE: docs/mds/components/progressLoop/api.md
  4480. ================================================
  4481. ## ProgressLoop Props
  4482. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4483. | ------------- | ------------------------------------ | ------- | ---- | ---------------------------------- |
  4484. | percent | `number` | `66` | N | 百分比。 |
  4485. | strokeWidth | `number` | `2` | N | 圆环宽度。 |
  4486. | butt | `boolean` | `false` | N | 端点是否直角。 |
  4487. | reverse | `boolean` | `false` | N | 是否反向(逆时针)。 |
  4488. | duration | `'150'\|'300'\|'500'\|'700'\|'1000'` | `'300'` | N | 动画过渡时间。 |
  4489. | gradient | `[string,string]\|null` | `[]` | N | 渐变色,开始色与结束色组成的数组。 |
  4490. | injClass | `String` | `''` | N | 激活进度环注入 Class 名称。 |
  4491. | trackInjClass | `String` | `''` | N | 轨道环注入 Class 名称。 |
  4492. ## ProgressLoop Snippets
  4493. | 名称 | 类型 | 参数 | 说明 |
  4494. | -------- | ------------------------------------------------------------------- | ---- | -------------------- |
  4495. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染文字内容。 |
  4496. ================================================
  4497. FILE: docs/mds/components/progressLoop/api_en.md
  4498. ================================================
  4499. ## ProgressLoop Props
  4500. | Name | Type | Default | Required | Description |
  4501. | ------------- | ------------------------------------ | ------- | -------- | ------------------------------------------------ |
  4502. | percent | `number` | `66` | N | Percentage value. |
  4503. | strokeWidth | `number` | `2` | N | Width of the circular ring. |
  4504. | butt | `boolean` | `false` | N | Whether the endpoints are square. |
  4505. | reverse | `boolean` | `false` | N | Whether to reverse direction (counterclockwise). |
  4506. | duration | `'150'\|'300'\|'500'\|'700'\|'1000'` | `'300'` | N | Animation transition duration. |
  4507. | gradient | `[string,string]\|null` | `[]` | N | Gradient colors, array of start and end colors. |
  4508. | injClass | `String` | `''` | N | Injected class name for active progress ring. |
  4509. | trackInjClass | `String` | `''` | N | Injected class name for track ring. |
  4510. ## ProgressLoop Snippets
  4511. | Name | Type | Params | Description |
  4512. | -------- | ------------------------------------------------------------------- | ------ | --------------------------------- |
  4513. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders text content when passed. |
  4514. ================================================
  4515. FILE: docs/mds/components/progressLoop/FAQ.md
  4516. ================================================
  4517. ================================================
  4518. FILE: docs/mds/components/progressLoop/FAQ_en.md
  4519. ================================================
  4520. ================================================
  4521. FILE: docs/mds/components/progressLoop/guide.md
  4522. ================================================
  4523. ## 进度环大小与宽度
  4524. 进度环 ProgressLoop 的大小由外层容器的宽度决定,组件内部使用了 24*24 画布大小的 svg 渲染,铺满父容器。而宽度 strokeWidth 理论上支持 0-12 的任意数值,但宽度太大时圆环将会很不美观。
  4525. ## Snippet
  4526. 当传入 children 时,百分比内容不再使用默认百分比文字,而是使用传入的 children 渲染。
  4527. ## CSS 注入
  4528. 通过 injClass 和 trackInjClass 参数可以向组件内部的激活进度环和轨道环元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过 injClass 和 trackInjClass 实现了自定义进度环颜色。
  4529. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  4530. ================================================
  4531. FILE: docs/mds/components/progressLoop/guide_en.md
  4532. ================================================
  4533. ## Progress loop size and width
  4534. The size of the progress loop, ProgressLoop, is determined by the width of the outer container. The component uses an SVG rendering with a canvas size of 24\*24, which fills the parent container. The width, strokeWidth, theoretically supports any value between 0 to 12, but when the width is too large, the circular ring may not be aesthetically pleasing.
  4535. ## Snippet
  4536. When children is passed in, the percentage content no longer uses the default percentage text, but uses the passed children to render.
  4537. ## CSS injection
  4538. The injClass and trackInjClass parameters can be used to inject CSS names (not limited to Tailwind CSS) into the activating progress ring and track ring elements inside the component. This will provide more possibilities for customizing the component style. In the example, custom progress loop colors are achieved using injClass and trackInjClass.
  4539. If the injected class is not effective, add "!" before the class name. For the reference, please see the [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  4540. ================================================
  4541. FILE: docs/mds/components/progressLoop/version.md
  4542. ================================================
  4543. ================================================
  4544. FILE: docs/mds/components/progressLoop/version_en.md
  4545. ================================================
  4546. ================================================
  4547. FILE: docs/mds/components/radio/api.md
  4548. ================================================
  4549. ## Radio Props
  4550. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4551. | ------------ | ---------------------------------------------------------------------------- | ----------- | ---- | ------------------------ |
  4552. | data | `RadioItem[]` | `[]` | Y | 选项数据。 |
  4553. | layout | `'v'\|'h'\|'inline'` | `'v'` | N | 排列方式。 |
  4554. | value | `string` | `''` | N | 选中的 value。 |
  4555. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | 选项内容区域位置。 |
  4556. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 未选中选项图标区域内容。 |
  4557. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 选中选项图标区域内容。 |
  4558. ## Radio Events
  4559. | 名称 | 类型 | 参数 | 描述 |
  4560. | -------- | ------------------------- | --------------------------- | ------------------------------------------------ |
  4561. | onchange | `(value: string) => void` | value - 选中的 Radio 标识符 | 点击 RadioItem(即 Radio 的 value 变化)时触发。 |
  4562. ## Radio Snippets
  4563. | 名称 | 类型 | 参数 | 说明 |
  4564. | ---------- | ------------------------------------------------------------------------------------------ | --------------- | ------------------------ |
  4565. | radioChild | [`Snippet<[{ item: RadioItem }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | item - 选项数据 | 当选项区域自定义时使用。 |
  4566. ## RadioItem Props
  4567. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4568. | ------------ | ---------------------------------------------------------------------------- | ----------- | ---- | ----------------------------------- |
  4569. | name | `string` | `''` | Y | 标识符,对应 Radio Props 的 value。 |
  4570. | label | `string` | `''` | N | 选项内容。 |
  4571. | layout | `'v'\|'h'\|'inline'` | `'v'` | N | 排列方式。 |
  4572. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | 选项内容区域位置。 |
  4573. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 未选中选项图标区域内容。 |
  4574. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | 选中选项图标区域内容。 |
  4575. | checked | `boolean` | `false` | N | 是否选中。 |
  4576. ## RadioItem Events
  4577. | 名称 | 类型 | 参数 | 说明 |
  4578. | ------- | ------------------------ | ------------------- | ------------ |
  4579. | onclick | `(name: string) => void` | name - 点击项标识符 | 点击时触发。 |
  4580. ## RadioItem Snippets
  4581. | 名称 | 类型 | 参数 | 说明 |
  4582. | -------- | ------------------------------------------------------------------- | ---- | -------------- |
  4583. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 选项区域内容。 |
  4584. ================================================
  4585. FILE: docs/mds/components/radio/api_en.md
  4586. ================================================
  4587. ## Radio Props
  4588. | Name | Type | Default | Required | Description |
  4589. | ------------ | ---------------------------------------------------------------------------- | ----------- | -------- | -------------------------------------- |
  4590. | data | `RadioItem[]` | `[]` | Y | Option data. |
  4591. | layout | `'v'\|'h'\|'inline'` | `'v'` | N | Layout mode. |
  4592. | value | `string` | `''` | N | Selected value. |
  4593. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | Position of option content area. |
  4594. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of unchecked option icon area. |
  4595. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of checked option icon area. |
  4596. ## Radio Events
  4597. | Name | Type | Parameters | Description |
  4598. | -------- | ------------------------- | --------------------------------- | ---------------------------------------------------------- |
  4599. | onchange | `(value: string) => void` | value - Selected Radio identifier | Triggered when RadioItem is clicked (Radio value changes). |
  4600. ## Radio Snippets
  4601. | Name | Type | Parameters | Description |
  4602. | ---------- | ------------------------------------------------------------------------------------------ | ------------------ | -------------------------------------- |
  4603. | radioChild | [`Snippet<[{ item: RadioItem }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | item - Option data | Used when customizing the option area. |
  4604. ## RadioItem Props
  4605. | Name | Type | Default | Required | Description |
  4606. | ------------ | ---------------------------------------------------------------------------- | ----------- | -------- | --------------------------------------------- |
  4607. | name | `string` | `''` | Y | Identifier, corresponds to Radio Props value. |
  4608. | label | `string` | `''` | N | Option content. |
  4609. | layout | `'v'\|'h'\|'inline'` | `'v'` | N | Layout mode. |
  4610. | textPosition | `'l'\|'r'\|'t'\|'b'` | `'r'` | N | Position of option content area. |
  4611. | icon | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of unchecked option icon area. |
  4612. | iconChecked | `'default'\|null`\|[`Icon`](https://stdf.design/components?nav=icon&tab=1) | `'default'` | N | Content of checked option icon area. |
  4613. | checked | `boolean` | `false` | N | Whether checked. |
  4614. ## RadioItem Events
  4615. | Name | Type | Parameters | Description |
  4616. | ------- | ------------------------ | ------------------------------ | ----------------------- |
  4617. | onclick | `(name: string) => void` | name - Clicked item identifier | Triggered when clicked. |
  4618. ## RadioItem Snippets
  4619. | Name | Type | Parameters | Description |
  4620. | -------- | ------------------------------------------------------------------- | ---------- | -------------------- |
  4621. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Option area content. |
  4622. ================================================
  4623. FILE: docs/mds/components/radio/FAQ.md
  4624. ================================================
  4625. ================================================
  4626. FILE: docs/mds/components/radio/FAQ_en.md
  4627. ================================================
  4628. ================================================
  4629. FILE: docs/mds/components/radio/guide.md
  4630. ================================================
  4631. > Radio 使用了图标 ri-radio-button-line 和 ri-checkbox-blank-circle-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  4632. ## 说明
  4633. 由于移动端横向显示内容有限,Radio 默认为纵向布局,横向布局建议只用作简单使用。当选项较多、内容较长或显示内容较多时建议使用纵向布局,
  4634. Radio 通过 value 传入一个值作为内部 Radio 的初始标识符;而当 RadioItem 被点击时,Radio 通过 onchange 事件,可以获取到当前 value,即当前选定 RadioItem 的 name。
  4635. ## icon && iconChecked
  4636. Radio Props 的 icon 默认值 `'default'` 会按照 Remix Icon 的 ri-checkbox-blank-circle-line 以 Icon 组件形式渲染;传入 `null` 表示未选中选项图标区域不显示内容;也可以传入 Icon Props,未选中选项图标区域将会以传入的参数以 Icon 组件形式渲染。
  4637. iconChecked 与 icon 逻辑一样,对应的是选中选项的图标区域内容。
  4638. ## Radio Snippets
  4639. 当传入 radioChild 时,Radio 的每条 RadioItem 的内容区域将会使用 radioChild 的内容区域,可结合 Radio 的 onchange 事件获取到的 value,自由设计选中与未选中的效果。
  4640. 注:虽然有 Tailwind 写样式比较方便,但过多的自定义将会失去使用组件库的意义。
  4641. ## 点击区域优化
  4642. 为了优化体验,RadioItem 整个区域都可以点击,将会激活与之对应的 value,不仅仅只可以点击文字或图标区域。
  4643. ## ActionSheet、Picker、Radio
  4644. ActionSheet、Picker、Radio 三者都是给出数据,让用户进行数据选择或执行一些操作,但何时使用哪个组件呢?
  4645. - Radio 一般用于单选数据,数据量固定且较少,需要在 UI 界面上直接展示选项,方便用户在界面交互时对多条数据有个概览,比如性别选择。
  4646. - ActionSheet 一般用于选择之后立即执行一些操作,选项固定且较少,但不需要在 UI 界面上直接展示选项,比如做一些删除、修改等操作。
  4647. - Picker 一般用于选择单条或多条数据,数据量较大或无法确定长度的动态数据,或用于一些联动数据的选择,比如省市区选择。
  4648. ================================================
  4649. FILE: docs/mds/components/radio/guide_en.md
  4650. ================================================
  4651. > Radio uses icons ri-radio-button-line and ri-checkbox-blank-circle-line. Please ensure these icons are included in your project's symbol.svg file. For detailed information, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  4652. ## Description
  4653. Due to limited horizontal display space on mobile devices, Radio defaults to vertical layout. Horizontal layout is recommended only for simple use cases. When there are multiple options, longer content, or more display content, vertical layout is recommended.
  4654. Radio accepts a value prop as the initial identifier for internal Radio items. When a RadioItem is clicked, Radio can get the current value through the onchange event, which is the name of the currently selected RadioItem.
  4655. ## icon && iconChecked
  4656. The default value `'default'` for Radio Props' icon will render as an Icon component using Remix Icon's ri-checkbox-blank-circle-line. Passing `null` means no content will be displayed in the unchecked option's icon area. You can also pass Icon Props, and the unchecked option's icon area will render as an Icon component with the passed parameters.
  4657. iconChecked follows the same logic as icon, corresponding to the icon area content of the selected option.
  4658. ## Radio Snippets
  4659. When radioChild is passed, the content area of each RadioItem in Radio will use the content area of radioChild. You can freely design the selected and unselected effects by combining with the value obtained from Radio's onchange event.
  4660. Note: Although Tailwind makes styling convenient, too much customization will defeat the purpose of using a component library.
  4661. ## Click Area Optimization
  4662. To optimize the user experience, the entire area of RadioItem is clickable and will activate its corresponding value, not just the text or icon areas.
  4663. ## ActionSheet, Picker, Radio
  4664. ActionSheet, Picker, and Radio all provide data for users to select or perform operations, but when should each component be used?
  4665. - Radio is generally used for single-selection data with a fixed and small number of options that need to be directly displayed on the UI interface, allowing users to have an overview of multiple data points during interface interaction, such as gender selection.
  4666. - ActionSheet is generally used when actions need to be executed immediately after selection, with fixed and fewer options that don't need to be directly displayed on the UI interface, such as delete or modify operations.
  4667. - Picker is generally used for selecting single or multiple data points with a large amount of data or dynamic data of uncertain length, or for selecting linked data, such as province-city-district selection.
  4668. ================================================
  4669. FILE: docs/mds/components/radio/version.md
  4670. ================================================
  4671. ================================================
  4672. FILE: docs/mds/components/radio/version_en.md
  4673. ================================================
  4674. ================================================
  4675. FILE: docs/mds/components/rate/api.md
  4676. ================================================
  4677. ## Rate Props
  4678. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4679. | --------- | ---------------------------------------------------------------------------- | ----------- | ---- | --------------------- |
  4680. | value | `number` | `4` | N | 选定值。 |
  4681. | total | `number` | `5` | N | 总分。 |
  4682. | width | `number` | `24` | N | 单个内容宽度(px) 。 |
  4683. | height | `number` | `24` | N | 单个内容高度(px)。 |
  4684. | opacity | `'0.05'\|'0.1'\|'0.2'\|'0.3'\|'0.4'\|'0.5'\|'0.6'\|'0.7'\|'0.8'\|'0.9'\|'1'` | `0.2` | N | 未选中内容透明度。 |
  4685. | space | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'3'` | N | 内容间距。 |
  4686. | half | `boolean` | `false` | N | 是否允许半选。 |
  4687. | zero | `boolean` | `false` | N | 是否允许 0 分。 |
  4688. | vertical | `boolean` | `false` | N | 是否垂直半选。 |
  4689. | disabled | `boolean` | `false` | N | 是否禁用。 |
  4690. | readonly | `boolean` | `false` | N | 是否只读。 |
  4691. | custom | `boolean` | `false` | N | 是否自定义内容。 |
  4692. | animation | `'current'\|'active'\|null` | `'current'` | N | 点击动画类型。 |
  4693. ## Rate Events
  4694. | 名称 | 类型 | 参数 | 描述 |
  4695. | ------- | ------------------------- | ------------------ | ---------- |
  4696. | onclick | `(value: number) => void` | value - 当前 value | 点击触发。 |
  4697. ## Rate Snippets
  4698. | 名称 | 类型 | 参数 | 说明 |
  4699. | -------- | ------------------------------------------------------------------- | ---- | ------------------------ |
  4700. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 将作为 Rate 的单个内容。 |
  4701. ================================================
  4702. FILE: docs/mds/components/rate/api_en.md
  4703. ================================================
  4704. ## Rate Props
  4705. | Name | Type | Default | Required | Description |
  4706. | --------- | ---------------------------------------------------------------------------- | ----------- | -------- | ------------------------------------------ |
  4707. | value | `number` | `4` | N | Selected value. |
  4708. | total | `number` | `5` | N | Total score. |
  4709. | width | `number` | `24` | N | Width of single content (px). |
  4710. | height | `number` | `24` | N | Height of single content (px). |
  4711. | opacity | `'0.05'\|'0.1'\|'0.2'\|'0.3'\|'0.4'\|'0.5'\|'0.6'\|'0.7'\|'0.8'\|'0.9'\|'1'` | `0.2` | N | Opacity of unselected content. |
  4712. | space | `'0'\|'1'\|'2'\|'3'\|'4'\|'8'` | `'3'` | N | Content spacing. |
  4713. | half | `boolean` | `false` | N | Whether to allow half selection. |
  4714. | zero | `boolean` | `false` | N | Whether to allow 0 score. |
  4715. | vertical | `boolean` | `false` | N | Whether to enable vertical half selection. |
  4716. | disabled | `boolean` | `false` | N | Whether to disable. |
  4717. | readonly | `boolean` | `false` | N | Whether it's read-only. |
  4718. | custom | `boolean` | `false` | N | Whether to use custom content. |
  4719. | animation | `'current'\|'active'\|null` | `'current'` | N | Click animation type. |
  4720. ## Rate Events
  4721. | Name | Type | Parameters | Description |
  4722. | ------- | ------------------------- | --------------------- | ------------------- |
  4723. | onclick | `(value: number) => void` | value - Current value | Triggered on click. |
  4724. ## Rate Snippets
  4725. | Name | Type | Parameters | Description |
  4726. | -------- | ------------------------------------------------------------------- | ---------- | ---------------------------------------- |
  4727. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Will be used as single content for Rate. |
  4728. ================================================
  4729. FILE: docs/mds/components/rate/FAQ.md
  4730. ================================================
  4731. ================================================
  4732. FILE: docs/mds/components/rate/FAQ_en.md
  4733. ================================================
  4734. ================================================
  4735. FILE: docs/mds/components/rate/guide.md
  4736. ================================================
  4737. > Rate 使用了图标 ri-star-fill,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  4738. ## value 与 total 注意事项
  4739. 1. 传入的 value 不允许大于 total;
  4740. 2. total 必须能被 1 整除;
  4741. 3. 非半选时,value 必须能被 1 整除;
  4742. 4. 半选时,value 必须能被 0.5 整除。
  4743. ## 点击优化
  4744. 考虑移动端交互方式,允许半选时点击会在半选和全选之间切换,允许零分时点击第一项会在 0、0.5、1 之间切换。
  4745. 注意:考虑点击区域,**width 与 height 的值请不要小于 20**。
  4746. ## 点击动画
  4747. 通过 animation 来控制点击动画,`'current'` 表示仅点击项有动画,`'active'` 表示点击项及之前的项都有动画,`null` 表示无动画。
  4748. ## 特别注意
  4749. 当需要自定义内容时,可以通过传入 Snippet 实现,此时请务必**传入自定义内容的宽高**。
  4750. ================================================
  4751. FILE: docs/mds/components/rate/guide_en.md
  4752. ================================================
  4753. > Rate uses the icon ri-star-fill, please ensure that the symbol.svg file in your project includes this icon. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  4754. ## Notes on value and total
  4755. 1. The passed-in value cannot be greater than the total;
  4756. 2. The value of total must be divisible by 1;
  4757. 3. When not allowing half selection, the value must be divisible by 1;
  4758. 4. When allowing half selection, the value must be divisible by 0.5.
  4759. ## Click optimization
  4760. Considering the interaction mode on mobile devices, when allowing half selection, clicking will switch between half selection and full selection, and when allowing zero scores, clicking the first item will switch between 0, 0.5, and 1.
  4761. Note: When considering the click area, please make sure that **the values of width and height are not less than 20**.
  4762. ## Click Animation
  4763. Control click animation through animation, `'current'` means only the clicked item has animation, `'active'` means the clicked item and all previous items have animation, and `null` means no animation.
  4764. ## Special attention
  4765. When custom content is needed, it can be achieved by passing in Snippet. At this time, **be sure to pass in the width and height of the custom content**.
  4766. ================================================
  4767. FILE: docs/mds/components/rate/version.md
  4768. ================================================
  4769. ================================================
  4770. FILE: docs/mds/components/rate/version_en.md
  4771. ================================================
  4772. ================================================
  4773. FILE: docs/mds/components/skeleton/api.md
  4774. ================================================
  4775. ## Skeleton Props
  4776. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4777. | --------- | ---------------------------------------------------------------------- | ------- | ---- | --------------------------------------------------------------------- |
  4778. | type | `'div'\|'p'\|'img'\|'video'\|'code'\|'qrcode'\|'barcode'` | `'div'` | N | Skeleton 类型。 |
  4779. | width | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'\|'full'` | `'6'` | N | 宽度。 |
  4780. | height | `'1'\|'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'` | `'6'` | N | 高度。 |
  4781. | radius | `'none'\|'sm'\|'md'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  4782. | padding | `'0.5'\|'1'\|'2'\|'4'\|'8'` | `'1'` | N | 内边距。 |
  4783. | lines | `number` | `3` | N | 行数,仅在 type 为 p 时生效。 |
  4784. | iconRatio | `number` | `0.6` | N | 内部图标比例,仅在 type 为 img、video、code、qrcode、barcode 时生效。 |
  4785. ================================================
  4786. FILE: docs/mds/components/skeleton/api_en.md
  4787. ================================================
  4788. ## Skeleton Props
  4789. | Name | Type | Default | Required | Description |
  4790. | --------- | ---------------------------------------------------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------- |
  4791. | type | `'div'\|'p'\|'img'\|'video'\|'code'\|'qrcode'\|'barcode'` | `'div'` | N | Type of skeleton. |
  4792. | width | `'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'\|'full'` | `'6'` | N | Width. |
  4793. | height | `'1'\|'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'\|'32'\|'48'\|'64'\|'96'` | `'6'` | N | Height. |
  4794. | radius | `'none'\|'sm'\|'md'\|'xl'\|'2xl'\|'3xl'\|'full'` | `'sm'` | N | Border radius style. |
  4795. | padding | `'0.5'\|'1'\|'2'\|'4'\|'8'` | `'1'` | N | Padding. |
  4796. | lines | `number` | `3` | N | Number of lines, only takes effect when type is p. |
  4797. | iconRatio | `number` | `0.6` | N | Internal icon ratio, only takes effect when type is img, video, code, qrcode, or barcode. |
  4798. ================================================
  4799. FILE: docs/mds/components/skeleton/FAQ.md
  4800. ================================================
  4801. ================================================
  4802. FILE: docs/mds/components/skeleton/FAQ_en.md
  4803. ================================================
  4804. ================================================
  4805. FILE: docs/mds/components/skeleton/guide.md
  4806. ================================================
  4807. > Skeleton 使用了图标 ri-image-fill、ri-movie-2-fill、ri-code-box-fill、ri-qr-code-fill、ri-barcode-fill,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  4808. ## 说明
  4809. 1. Skeleton 组件并不是必需组件,但它能优化页面加载过程中的视觉效果,进而有效地提升用户体验。
  4810. 2. 对比 Loading 组件,Skeleton 组件更加不容易引起用户的注意,因为它的样式接近实际页面,而且它的过渡效果更加轻柔自然,能给用户一个页面的预期效果。
  4811. 3. 为了满足如此多复杂的页面布局,使 Skeleton 更加接近实际页面轮廓,组件内部只是实现了基本的过渡效果与自身样式配置,页面整块 Skeleton 区域需开发者按照实际业务场景去布局,使用 Tailwind CSS 的 Flexbox 或 Grid 是很快的,况且这一过程相当于搭建实际页面之前的一次彩排,可以复用。
  4812. ## type
  4813. Skeleton 组件目前提供了七种类型的骨架屏,分别是:`'div'|'p'|'img'|'video'|'code'|'qrcode'|'barcode'`,其中 code 是代码块,qrcode 是二维码,barcode 是条形码。
  4814. ## 特殊
  4815. 当 type 为 `'p'` 时可以通过 lines 属性来控制段落行数,此时最后一行的长度会在一个合适的范围内随机变化。
  4816. ================================================
  4817. FILE: docs/mds/components/skeleton/guide_en.md
  4818. ================================================
  4819. > Skeleton uses the icon ri-image-fill, ri-movie-2-fill, ri-code-box-fill,ri-qr-code-fill, ri-barcode-fill, please ensure that the symbol.svg file in your project includes these icons. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  4820. ## Explanation
  4821. 1. The Skeleton component is not a mandatory component, but it can optimize the visual effect during the page loading process, thereby effectively improving the user experience.
  4822. 2. Compared with the Loading component, the Skeleton component is less likely to attract users' attention, because its style is close to the actual page, and its transition effect is more gentle and natural, which can give users an expected effect of the page.
  4823. 3. In order to meet such complex page layouts and make the Skeleton more close to the actual page outline, the component internally only implements basic transition effects and self-style configuration. The entire Skeleton area of ​​the page needs to be layout according to the actual business scenario by developers. Using Tailwind CSS's Flexbox or Grid is fast, and this process is like a rehearsal before building the actual page, which can be reused.
  4824. ## Type
  4825. The Skeleton component currently provides seven types of skeletons, which are: `'div'|'p'|'img'|'video'|'code'|'qrcode'|'barcode'`, where code is a code block, qrcode is a QR code, and barcode is a barcode.
  4826. ## Special
  4827. When the type is `'p'`, you can control the number of lines in the paragraph through the lines attribute, and the length of the last line will randomly change within a reasonable range.
  4828. ================================================
  4829. FILE: docs/mds/components/skeleton/version.md
  4830. ================================================
  4831. ## 0.2.11
  4832. - [!tag|B|2|]修复当使用 'img'/'video'/'code'/'qrcode'/'barcode' 等内容时,图标上下居中的问题。
  4833. ================================================
  4834. FILE: docs/mds/components/skeleton/version_en.md
  4835. ================================================
  4836. ## 0.2.11
  4837. - [!tag|B|2|] Fix the problem of vertical centering of icons when using 'img'/'video'/'code'/'qrcode'/'barcode' and other content.
  4838. ================================================
  4839. FILE: docs/mds/components/slider/api.md
  4840. ================================================
  4841. ## Slider Props
  4842. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4843. | ---------- | --------------------------- | --------- | ---- | ---------------- |
  4844. | value | `number` | `40` | N | 当前值。 |
  4845. | step | `number` | `1` | N | 步长。 |
  4846. | minRange | `number` | `0` | N | 可选最小值。 |
  4847. | maxRange | `number` | `100` | N | 可选最大值。 |
  4848. | isRange | `boolean` | `false` | N | 是否为区间选择。 |
  4849. | startValue | `number` | `20` | N | 区间选择开始值。 |
  4850. | endValue | `number` | `60` | N | 区间选择结束值。 |
  4851. | showTip | `'always'\|'never'\|'touch'` | `'touch'` | N | 提示显示方式。 |
  4852. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'full'` | N | 圆角风格。 |
  4853. | lineBlock | `boolean` | `false` | N | 滑块是否为线框。 |
  4854. | disabled | `boolean` | `false` | N | 是否禁用。 |
  4855. | readonly | `boolean` | `false` | N | 是否只读。 |
  4856. ## Slider Events
  4857. | 名称 | 类型 | 参数 | 描述 |
  4858. | -------- | ------------------------------------- | ----------------------------------------- | ---------------- |
  4859. | onchange | `(values: [number, number?]) => void` | values - 当前取值数组(区间选择时两项)。 | 取值变化时触发。 |
  4860. ## Slider Snippets
  4861. | 名称 | 类型 | 参数 | 说明 |
  4862. | -------- | ------------------------------------------------------------------- | ---- | ------------------------ |
  4863. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入将渲染进度区域内容。 |
  4864. ================================================
  4865. FILE: docs/mds/components/slider/api_en.md
  4866. ================================================
  4867. ## Slider Props
  4868. | Name | Type | Default | Required | Description |
  4869. | ---------- | --------------------------- | --------- | -------- | ----------------------------------- |
  4870. | value | `number` | `40` | N | Current value. |
  4871. | step | `number` | `1` | N | Step size. |
  4872. | minRange | `number` | `0` | N | Minimum selectable value. |
  4873. | maxRange | `number` | `100` | N | Maximum selectable value. |
  4874. | isRange | `boolean` | `false` | N | Whether it's a range selection. |
  4875. | startValue | `number` | `20` | N | Start value for range selection. |
  4876. | endValue | `number` | `60` | N | End value for range selection. |
  4877. | showTip | `'always'\|'never'\|'touch'` | `'touch'` | N | Tip display mode. |
  4878. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'full'` | N | Border radius style. |
  4879. | lineBlock | `boolean` | `false` | N | Whether the slider is a line block. |
  4880. | disabled | `boolean` | `false` | N | Whether it's disabled. |
  4881. | readonly | `boolean` | `false` | N | Whether it's read-only. |
  4882. ## Slider Events
  4883. | Name | Type | Parameters | Description |
  4884. | -------- | ------------------------------------- | --------------------------------------------------- | ----------------------------- |
  4885. | onchange | `(values: [number, number?]) => void` | values - Current value array (two items for range). | Triggered when value changes. |
  4886. ## Slider Snippets
  4887. | Name | Type | Parameters | Description |
  4888. | -------- | ------------------------------------------------------------------- | ---------- | -------------------------------------------- |
  4889. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Content to be rendered in the progress area. |
  4890. ================================================
  4891. FILE: docs/mds/components/slider/FAQ.md
  4892. ================================================
  4893. ================================================
  4894. FILE: docs/mds/components/slider/FAQ_en.md
  4895. ================================================
  4896. ================================================
  4897. FILE: docs/mds/components/slider/guide.md
  4898. ================================================
  4899. ## value、startValue、endValue、minRange、maxRange
  4900. 传入 value、startValue、endValue 时,请确保在 minRange 与 maxRange 之间。
  4901. ## step
  4902. 传入 step 时,请尽量保证 (maxRange - minRange) / step 为整数,且考虑每一步的精度问题,太小可能导致无法快速滑动到需要的值,从而影响用户体验。
  4903. ## 布局
  4904. Slider 未设置外部间距,请在页面布局时自行设置。
  4905. ## Snippet
  4906. 当传入 Snippet 时,Slider 的进度区域会使用 Snippet 渲染,参考示例。
  4907. ================================================
  4908. FILE: docs/mds/components/slider/guide_en.md
  4909. ================================================
  4910. ## value, startValue, endValue, minRange, maxRange
  4911. When passing in value, startValue, and endValue, please make sure it is between minRange and maxRange.
  4912. ## step
  4913. When passing in step, please try to ensure that (maxRange - minRange) / step is an integer, and consider the accuracy of each step. The step size is too small may cause the slider unable to slide to the required value quickly, thus affecting the user experience.
  4914. ## Layout
  4915. The Slider component does not set external margins, please set it yourself when laying out the page.
  4916. ## Snippet
  4917. When passing in Snippet, the area representing the progress of the Slider will render using Snippet, refer to the example.
  4918. ================================================
  4919. FILE: docs/mds/components/slider/version.md
  4920. ================================================
  4921. ## 0.4.7
  4922. - [!tag|O|0|]优化滑动动画效果。关联 [PR](https://github.com/any-tdf/stdf/pull/26)。[!contribute|mrlovables|]
  4923. ================================================
  4924. FILE: docs/mds/components/slider/version_en.md
  4925. ================================================
  4926. ## 0.4.7
  4927. - [!tag|O|0|] Optimize the sliding animation effect. Associated [PR](https://github.com/any-tdf/stdf/pull/26). [!contribute|mrlovables|]
  4928. ================================================
  4929. FILE: docs/mds/components/stepper/api.md
  4930. ================================================
  4931. ## Stepper Props
  4932. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  4933. | --------------- | --------------------------------------------------------------- | ------- | ---- | ---------------------------------- |
  4934. | value | `number` | `10` | N | 当前值。 |
  4935. | min | `number` | `0` | N | 最小值。 |
  4936. | max | `number` | `100` | N | 最大值。 |
  4937. | step | `number` | `1` | N | 步长。 |
  4938. | vertical | `boolean` | `false` | N | 是否纵向。 |
  4939. | numberHighlight | `boolean` | `false` | N | 是否强调数字区域。 |
  4940. | theme | `boolean` | `true` | N | 强调区域是否是主题色。 |
  4941. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  4942. | decimal | `number` | `0` | N | 对内部显示数字保留小数位数。 |
  4943. | async | `boolean` | `false` | N | 是否异步状态。 |
  4944. | asyncLoading | `boolean` | `false` | N | 异步状态时,是否显示内部 Loading。 |
  4945. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | 异步状态时,Loading 参数。 |
  4946. | padding | `boolean` | `true` | N | 外部有无 padding。 |
  4947. | injClassOut | `string` | `''` | N | 外部注入的类。 |
  4948. | injClassBtn | `string` | `''` | N | 按钮区域注入的类。 |
  4949. | injClassNum | `string` | `''` | N | 数字区域注入的类。 |
  4950. ## Stepper Events
  4951. | 名称 | 类型 | 参数 | 描述 |
  4952. | ---------- | ------------------- | -------------- | ---------------- |
  4953. | onchange | `{ value: number }` | value - 当前值 | 当前值。 |
  4954. | ondecrease | `() => void` | - | 点击减少时触发。 |
  4955. | onincrease | `() => void` | - | 点击增加时触发。 |
  4956. ================================================
  4957. FILE: docs/mds/components/stepper/api_en.md
  4958. ================================================
  4959. ## Stepper Props
  4960. | Name | Type | Default | Required | Description |
  4961. | --------------- | --------------------------------------------------------------- | ------- | -------- | -------------------------------------------------- |
  4962. | value | `number` | `10` | N | Current value. |
  4963. | min | `number` | `0` | N | Minimum value. |
  4964. | max | `number` | `100` | N | Maximum value. |
  4965. | step | `number` | `1` | N | Step increment. |
  4966. | vertical | `boolean` | `false` | N | Whether to display vertically. |
  4967. | numberHighlight | `boolean` | `false` | N | Whether to highlight the number area. |
  4968. | theme | `boolean` | `true` | N | Whether the highlighted area uses the theme color. |
  4969. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | Border radius style. |
  4970. | decimal | `number` | `0` | N | Number of decimal places for displayed value. |
  4971. | async | `boolean` | `false` | N | Whether in async state. |
  4972. | asyncLoading | `boolean` | `false` | N | Whether to show internal Loading in async state. |
  4973. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | Loading parameters in async state. |
  4974. | padding | `boolean` | `true` | N | Whether to have external padding. |
  4975. | injClassOut | `string` | `''` | N | Injected class for the outer container. |
  4976. | injClassBtn | `string` | `''` | N | Injected class for the button area. |
  4977. | injClassNum | `string` | `''` | N | Injected class for the number area. |
  4978. ## Stepper Events
  4979. | Name | Type | Parameters | Description |
  4980. | ---------- | ------------------- | --------------------- | ------------------------------------------ |
  4981. | onchange | `{ value: number }` | value - current value | Triggered when the value changes. |
  4982. | ondecrease | `() => void` | - | Triggered when decrease button is clicked. |
  4983. | onincrease | `() => void` | - | Triggered when increase button is clicked. |
  4984. ================================================
  4985. FILE: docs/mds/components/stepper/FAQ.md
  4986. ================================================
  4987. ================================================
  4988. FILE: docs/mds/components/stepper/FAQ_en.md
  4989. ================================================
  4990. ================================================
  4991. FILE: docs/mds/components/stepper/guide.md
  4992. ================================================
  4993. > Stepper 使用了图标 ri-subtract-line、ri-add-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  4994. ## 使用场景
  4995. Stepper 组件一般用于需要对数据进行逐步增减操作的场景,比如商品数量选择、积分加减、进度条等,如果数据量调整较大,建议使用 NumKeyboard 或 Input 组件。
  4996. ## 异步状态
  4997. Stepper 组件支持异步状态,一般用于与服务端交互过程中更加合理地显示 Stepper 的值。通过设置 async 属性开启,此时可通过 asyncLoading 属性设置内部是否显示 Loading 状态,当然也可以自由设置 Loading 的显示位置和方式,请参考示例。
  4998. 异步状态时为防止用户误触,增减按钮将会自动禁用,直到异步状态结束。
  4999. ## CSS 注入
  5000. 通过 injClass 参数可以分别向组件的外部、增减按钮、数字区域注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性,示例中通过注入实现了自定义不同位置的样式。
  5001. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  5002. ================================================
  5003. FILE: docs/mds/components/stepper/guide_en.md
  5004. ================================================
  5005. > Stepper uses the icon ri-subtract-line, ri-add-line, please ensure that the symbol.svg file in your project includes these icons. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  5006. ## Usage scenarios
  5007. The Stepper component is generally used in scenarios where data needs to be incrementally increased or decreased, such as selecting the quantity of goods, adding or subtracting points, progress bars, etc. If there are significant adjustments to the data volume, it is recommended to use the NumKeyboard or Input components.
  5008. ## Async State
  5009. The Stepper component supports asynchronous state, generally used to display the Stepper's value more reasonably during interactions with the server. It can be enabled by setting the async property. At this time, you can use the asyncLoading property to set whether to display the Loading state internally. Of course, you can also freely set the display position and method of Loading. Please refer to the example.
  5010. To prevent accidental user touches during the asynchronous state, the increase and decrease buttons will be automatically disabled until the asynchronous state ends.
  5011. ## CSS Injection
  5012. The injClass parameter allows you to inject CSS class names (not limited to Tailwind CSS) into different parts of the component: the outer container, the increase/decrease buttons, and the number area. This provides more possibilities for customizing the component's style. In the example, custom styles for different positions are implemented through injection.
  5013. If the injected class doesn't take effect, try adding "!" before the class name. You can refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier) for more information.
  5014. ================================================
  5015. FILE: docs/mds/components/stepper/version.md
  5016. ================================================
  5017. ================================================
  5018. FILE: docs/mds/components/stepper/version_en.md
  5019. ================================================
  5020. ================================================
  5021. FILE: docs/mds/components/steps/api.md
  5022. ================================================
  5023. ## Steps Props
  5024. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5025. | --------- | ---------------------------- | ------- | ---- | ------------------------------------------- |
  5026. | steps | `StepsItem[]` | `[]` | Y | step Props 或 finishStep Props 组成的数组。 |
  5027. | current | `number` | `1` | N | 当前进行的步骤序号。 |
  5028. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  5029. | barBorder | `boolean` | `true` | N | 图标是否带边框。 |
  5030. | vertical | `boolean` | `false` | N | 是否纵向布局。 |
  5031. ## StepsItem Props
  5032. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5033. | ---------- | ----------------- | ------ | ---- | ---------------------------------------------------- |
  5034. | step | `StepsStep` | `{}` | Y | 步骤参数。 |
  5035. | finishStep | `StepsFinishStep` | `{}` | N | 已完成步骤参数。 |
  5036. | height | `number` | `0` | N | 步骤高度,用于纵向布局,一般不设置,由组件自动计算。 |
  5037. ## step Props && StepsFinishStep Props
  5038. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5039. | ------------ | ------------------------------------------------------------- | ------ | ---- | ---------------------------- |
  5040. | title | `string` | `''` | Y | 步骤标题。 |
  5041. | bar | `StepsStepBarIcon \| StepsStepBarImage \| StepsStepBarString` | `{}` | N | 步骤区域内容。 |
  5042. | desc | `string` | `''` | N | 步骤描述内容。 |
  5043. | injComponent | `Component` | - | N | 向步骤区域注入 Svelte 组件。 |
  5044. ## StepsStepBarIcon Props
  5045. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5046. | ------- | --------------------------------------------------------- | ------ | ---- | -------------------------- |
  5047. | type | `'icon'` | `{}` | Y | 步骤区域内容为图标时使用。 |
  5048. | content | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `-` | Y | 图标参数。 |
  5049. ## StepsStepBarImage Props
  5050. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5051. | ------- | --------- | ------ | ---- | -------------------------- |
  5052. | type | `'image'` | `{}` | Y | 步骤区域内容为图片时使用。 |
  5053. | content | `string` | `-` | Y | 图片路径。 |
  5054. ## StepsStepBarString Props
  5055. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5056. | ------- | ---------- | ------ | ---- | ---------------------------- |
  5057. | type | `'string'` | `{}` | Y | 步骤区域内容为字符串时使用。 |
  5058. | content | `string` | `-` | Y | 字符串内容。 |
  5059. ================================================
  5060. FILE: docs/mds/components/steps/api_en.md
  5061. ================================================
  5062. ## Steps Props
  5063. | Name | Type | Default | Required | Description |
  5064. | --------- | ---------------------------- | ------- | -------- | ------------------------------------------------- |
  5065. | steps | `StepsItem[]` | `[]` | Y | Array composed of step Props or finishStep Props. |
  5066. | current | `number` | `1` | N | Current step number. |
  5067. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | Border radius style. |
  5068. | barBorder | `boolean` | `true` | N | Whether the icon has a border. |
  5069. | vertical | `boolean` | `false` | N | Whether to use vertical layout. |
  5070. ## StepsItem Props
  5071. | Name | Type | Default | Required | Description |
  5072. | ---------- | ----------------- | ------- | -------- | -------------------------------------------------------------------------- |
  5073. | step | `StepsStep` | `{}` | Y | Step parameters. |
  5074. | finishStep | `StepsFinishStep` | `{}` | N | Completed step parameters. |
  5075. | height | `number` | `0` | N | Step height for vertical layout, usually auto-calculated by the component. |
  5076. ## step Props && StepsFinishStep Props
  5077. | Name | Type | Default | Required | Description |
  5078. | ------------ | ------------------------------------------------------------- | ------- | -------- | --------------------------------------- |
  5079. | title | `string` | `''` | Y | Step title. |
  5080. | bar | `StepsStepBarIcon \| StepsStepBarImage \| StepsStepBarString` | `{}` | N | Step area content. |
  5081. | desc | `string` | `''` | N | Step description content. |
  5082. | injComponent | `Component` | - | N | Inject Svelte component into step area. |
  5083. ## StepsStepBarIcon Props
  5084. | Name | Type | Default | Required | Description |
  5085. | ------- | --------------------------------------------------------- | ------- | -------- | --------------------------------------- |
  5086. | type | `'icon'` | `{}` | Y | Used when step area content is an icon. |
  5087. | content | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `-` | Y | Icon parameters. |
  5088. ## StepsStepBarImage Props
  5089. | Name | Type | Default | Required | Description |
  5090. | ------- | --------- | ------- | -------- | ---------------------------------------- |
  5091. | type | `'image'` | `{}` | Y | Used when step area content is an image. |
  5092. | content | `string` | `-` | Y | Image path. |
  5093. ## StepsStepBarString Props
  5094. | Name | Type | Default | Required | Description |
  5095. | ------- | ---------- | ------- | -------- | ---------------------------------------- |
  5096. | type | `'string'` | `{}` | Y | Used when step area content is a string. |
  5097. | content | `string` | `-` | Y | String content. |
  5098. ================================================
  5099. FILE: docs/mds/components/steps/FAQ.md
  5100. ================================================
  5101. ================================================
  5102. FILE: docs/mds/components/steps/FAQ_en.md
  5103. ================================================
  5104. ================================================
  5105. FILE: docs/mds/components/steps/guide.md
  5106. ================================================
  5107. ## 说明
  5108. Steps 默认为横向布局,由于移动端横向显示内容有限,横向布局建议只用作简单使用。当步骤较多、标题较长或显示内容较多时建议使用纵向布局。
  5109. > 横向布局只显示标题与步骤栏区域,即使传入了 desc 等其他参数也不会显示。
  5110. ## current
  5111. 从 1 开始的实际步骤序号,组件内部对应 steps 的索引值 +1。
  5112. ## finishStep
  5113. 每一步的 Props 支持传入 finishStep,格式与 step 相同,用于一些场景下更准确细致地表达已经完成的步骤,请参考示例。
  5114. ## 步骤栏区域
  5115. 步骤栏区域 bar 可以传入三种情况,type 为 `'string'` 将直接显示字符,建议单个字符;type 为 `'image'` 将显示图片,可以传入图片的相对路径或绝对路径,组件内部将其转换为 img 标签的 src 属性;type 为 `'icon'` 将显示图标,根据传入的 [Icon Props](https://stdf.design/components?nav=icon&tab=1) 进行渲染。
  5116. ## injComponent
  5117. step 和 finishStep 支持通过 injComponent 注入 Svelte 组件,Steps 内部将其渲染至步骤区域底部,请参考示例。
  5118. 将 Svelte 组件作为传入参数并进行渲染的实现,使用到了 Svelte 的 `{@const ...}` 语法,请参考 [{@const ...}](https://svelte.dev/docs/svelte/@const)。
  5119. ## 补充
  5120. Tip:表示时间线的业务场景也是可以使用 Steps 组件。
  5121. ================================================
  5122. FILE: docs/mds/components/steps/guide_en.md
  5123. ================================================
  5124. ## Description
  5125. Steps defaults to horizontal layout. Due to limited horizontal display content on mobile devices, horizontal layout is recommended only for simple use. When there are multiple steps, long titles, or more content to display, vertical layout is recommended.
  5126. > Horizontal layout only displays the title and step bar area, even if other parameters like desc are passed in, they will not be displayed.
  5127. ## current
  5128. The actual step number starting from 1, which corresponds to the steps array index + 1 internally in the component.
  5129. ## finishStep
  5130. Each step's Props supports passing in finishStep, which has the same format as step, used to more accurately and precisely express completed steps in some scenarios. Please refer to the examples.
  5131. ## Step Bar Area
  5132. The step bar area can accept three types of content: when type is `'string'`, it will directly display characters (single character recommended); when type is `'image'`, it will display an image, accepting relative or absolute image paths which will be converted to img tag src attribute internally; when type is `'icon'`, it will display an icon rendered according to the passed [Icon Props](https://stdf.design/components?nav=icon&tab=1).
  5133. ## injComponent
  5134. step and finishStep support injecting Svelte components via injComponent, which Steps will render at the bottom of the step area. Please refer to the examples.
  5135. The implementation of passing and rendering Svelte components as parameters uses Svelte's `{@const ...}` syntax, please refer to [{@const ...}](https://svelte.dev/docs/svelte/@const).
  5136. ## Additional Note
  5137. Tip: The Steps component can also be used for timeline business scenarios.
  5138. ================================================
  5139. FILE: docs/mds/components/steps/version.md
  5140. ================================================
  5141. ================================================
  5142. FILE: docs/mds/components/steps/version_en.md
  5143. ================================================
  5144. ================================================
  5145. FILE: docs/mds/components/swiper/api.md
  5146. ================================================
  5147. ## Swiper Props
  5148. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5149. | ------------------- | ------------------------------------------------ | ------------- | ---- | ---------------------------- |
  5150. | data | `(SwiperImg\|SwiperComponent)[]` | `[]` | Y | 数据。 |
  5151. | interval | `number` | `4` | N | 间隔时间(秒)。 |
  5152. | duration | `number` | `1000` | N | 过渡时间(毫秒)。 |
  5153. | autoplay | `boolean` | `true` | N | 是否自动播放。 |
  5154. | lazyplay | `boolean` | `true` | N | 是否懒轮播。 |
  5155. | initActive | `number` | `0` | N | 初始激活索引。 |
  5156. | indicatePosition | `'inner'\|'out'\|null` | `'inner'` | N | 指示器位置。 |
  5157. | indicateAlign | `'center'\|'right'\|'left'` | `'center'` | N | 指示器对齐方式。 |
  5158. | indicateStyle | `'point'\|'line'\|'pointLine'\|'longLine'` | `'pointLine'` | N | 指示器样式。 |
  5159. | indicateRadius | `boolean` | `true` | N | 指示器是否圆角。 |
  5160. | indicateInjClass | `string` | `''` | N | 指示器注入 Class。 |
  5161. | indicateColor | `string` | `''` | N | 指示器颜色。 |
  5162. | indicateActiveColor | `string` | `''` | N | 指示器激活颜色。 |
  5163. | aspectRatio | `[number,number]` | `[16, 9]` | N | 容器宽高比。 |
  5164. | containerWidth | `number` | `0` | N | 容器宽度。 |
  5165. | px | `'0'\|'1'\|'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'` | `'0'` | N | 容器横向内边距。 |
  5166. | py | `'0'\|'1'\|'2'\|'4'\|'6'\|'8'\|'12'` | `'0'` | N | 容器纵向内边距。 |
  5167. | translateX | `number` | `0` | N | 未激活容器 X 方向偏移值。 |
  5168. | translateZ | `number` | `0` | N | 未激活容器 Z 方向偏移值。 |
  5169. | rotateX | `number` | `0` | N | 未激活容器 X 轴旋转值。 |
  5170. | rotateY | `number` | `0` | N | 未激活容器 Y 轴旋转值。 |
  5171. | rotateZ | `number` | `0` | N | 未激活容器 Z 轴旋转值。 |
  5172. | activeInjClass | `string` | `''` | N | 激活容器注入 Class。 |
  5173. | notActiveInjClass | `string` | `''` | N | 未激活容器注入 Class。 |
  5174. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'full'` | `'none'` | N | 容器内部区域圆角。 |
  5175. | triggerLong | `number` | `30` | N | 始终触发的滑动距离百分比。 |
  5176. | notTriggerLong | `number` | `10` | N | 始终不触发的滑动距离百分比。 |
  5177. | triggerSpeed | `number` | `0.5` | N | 触发的滑动速度系数。 |
  5178. | innerInjClass | `string` | `''` | N | 容器内部元素注入 Class。 |
  5179. ## Swiper Events
  5180. | 名称 | 类型 | 参数 | 描述 |
  5181. | -------- | --------------------------- | -------------------- | ------------------------ |
  5182. | onclick | `(current: number) => void` | current - 点击索引值 | 点击容器内图片时触发。 |
  5183. | onchange | `(current: number) => void` | current - 当前索引值 | 当前激活容器变化时触发。 |
  5184. ## SwiperImg
  5185. ```javascript
  5186. type SwiperImg = { type: 'img', url: string };
  5187. ```
  5188. ## SwiperComponent
  5189. ```javascript
  5190. type SwiperComponent = { type: 'component', component: Component };
  5191. ```
  5192. ================================================
  5193. FILE: docs/mds/components/swiper/api_en.md
  5194. ================================================
  5195. ## Swiper Props
  5196. | Name | Type | Default | Required | Description |
  5197. | ------------------- | ------------------------------------------------ | ------------- | -------- | ----------------------------------------------- |
  5198. | data | `(SwiperImg\|SwiperComponent)[]` | `[]` | Y | Data. |
  5199. | interval | `number` | `4` | N | Interval time (seconds). |
  5200. | duration | `number` | `1000` | N | Transition duration (milliseconds). |
  5201. | autoplay | `boolean` | `true` | N | Whether to autoplay. |
  5202. | lazyplay | `boolean` | `true` | N | Whether to lazy load. |
  5203. | initActive | `number` | `0` | N | Initial active index. |
  5204. | indicatePosition | `'inner'\|'out'\|null` | `'inner'` | N | Indicator position. |
  5205. | indicateAlign | `'center'\|'right'\|'left'` | `'center'` | N | Indicator alignment. |
  5206. | indicateStyle | `'point'\|'line'\|'pointLine'\|'longLine'` | `'pointLine'` | N | Indicator style. |
  5207. | indicateRadius | `boolean` | `true` | N | Whether indicator has rounded corners. |
  5208. | indicateInjClass | `string` | `''` | N | Indicator injected class. |
  5209. | indicateColor | `string` | `''` | N | Indicator color. |
  5210. | indicateActiveColor | `string` | `''` | N | Active indicator color. |
  5211. | aspectRatio | `[number,number]` | `[16, 9]` | N | Container aspect ratio. |
  5212. | containerWidth | `number` | `0` | N | Container width. |
  5213. | px | `'0'\|'1'\|'2'\|'4'\|'6'\|'8'\|'12'\|'16'\|'24'` | `'0'` | N | Container horizontal padding. |
  5214. | py | `'0'\|'1'\|'2'\|'4'\|'6'\|'8'\|'12'` | `'0'` | N | Container vertical padding. |
  5215. | translateX | `number` | `0` | N | Inactive container X-axis translation. |
  5216. | translateZ | `number` | `0` | N | Inactive container Z-axis translation. |
  5217. | rotateX | `number` | `0` | N | Inactive container X-axis rotation. |
  5218. | rotateY | `number` | `0` | N | Inactive container Y-axis rotation. |
  5219. | rotateZ | `number` | `0` | N | Inactive container Z-axis rotation. |
  5220. | activeInjClass | `string` | `''` | N | Active container injected class. |
  5221. | notActiveInjClass | `string` | `''` | N | Inactive container injected class. |
  5222. | radius | `'none'\|'sm'\|'xl'\|'2xl'\|'full'` | `'none'` | N | Container inner area border radius. |
  5223. | triggerLong | `number` | `30` | N | Slide distance percentage that always triggers. |
  5224. | notTriggerLong | `number` | `10` | N | Slide distance percentage that never triggers. |
  5225. | triggerSpeed | `number` | `0.5` | N | Slide speed coefficient that triggers. |
  5226. | innerInjClass | `string` | `''` | N | Container inner element injected class. |
  5227. ## Swiper Events
  5228. | Name | Type | Parameters | Description |
  5229. | -------- | --------------------------- | ----------------------- | ---------------------------------------- |
  5230. | onclick | `(current: number) => void` | current - clicked index | Triggered when clicking container image. |
  5231. | onchange | `(current: number) => void` | current - current index | Triggered when active container changes. |
  5232. ## SwiperImg
  5233. ```javascript
  5234. type SwiperImg = { type: 'img', url: string };
  5235. ```
  5236. ## SwiperComponent
  5237. ```javascript
  5238. type SwiperComponent = { type: 'component', component: Component };
  5239. ```
  5240. ================================================
  5241. FILE: docs/mds/components/swiper/FAQ.md
  5242. ================================================
  5243. ## 问:为何 Swiper 左右滑动过快时会感到卡顿?
  5244. 答:最开始是考虑直接通过使容器左右滚动和滚动对齐来实现切换效果(自带滚动惯性),遗憾的是目前 web 还不支持对平滑滚动的过渡时间做控制,这就失去了过渡效果的可配置。所以目前采用的方案是监听手指滑动的距离来实现滑动切换,同时通过 triggerLong、notTriggerLong 和 triggerSpeed 可对触发条件做自定义配置。当手指滑动结束离开屏幕时即表示一次滑动结束,Swiper 会结合滑动距离与滑动速度判断本次滑动是否触发切换。
  5245. ================================================
  5246. FILE: docs/mds/components/swiper/FAQ_en.md
  5247. ================================================
  5248. ## Q: Why does Swiper lag when sliding too quickly left and right?
  5249. A: Initially, we considered using container scrolling and alignment to achieve the switching effect (with built-in scroll inertia). Unfortunately, web browsers currently do not support controlling the transition time for smooth scrolling, which makes the configuration of transition effects impossible. Therefore, the current solution is to listen to the distance of finger sliding to achieve slide switching, and custom configure the triggering conditions using triggerLong, notTriggerLong, and triggerSpeed. When the finger finishes sliding and leaves the screen, it indicates the end of a slide. Swiper will determine whether to trigger the slide switch based on the sliding distance and sliding speed.
  5250. ================================================
  5251. FILE: docs/mds/components/swiper/guide.md
  5252. ================================================
  5253. ## data
  5254. 传入的数据 data 内部的 type 支持 `'img'` 和 `'component'`,其中 `img` 类型需要传入图片 url,`component` 类型时传入单文件组件,Swiper
  5255. 内部将会根据 type 渲染对应内容。
  5256. ## interval && duration
  5257. 为了书写方便,注意间隔时间 interval 以秒为单位,过渡时间 duration 以毫秒为单位,同时需要注意传入的过渡时间必须小于间隔时间。
  5258. ## indicateStyle
  5259. 此参数配置指示器的样式,当 `indicateStyle` 为 `longLine` 时,激活的指示器会在 Swiper 停留时间内表示间隔进度,请参考示例。
  5260. ## indicateInjClass
  5261. 此参数可以对指示器 indicate 区域注入 CSS 名称(不仅限于 Tailwind CSS),比如示例中去除默认自带透明度的渐变色背景。
  5262. 若注入的 class 没生效,请在注入的 class 名称前添加“!”
  5263. ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  5264. ## aspectRatio && containerWidth && px&& py
  5265. containerWidth 若不传或为 0,Swiper 内部默认使用页面宽度作为此组件区域宽度。而此区域高度将通过 containerWidth 与
  5266. aspectRatio 计算出来。
  5267. 注意,aspectRatio 仅仅决定容器的宽高比,所以只有当 px 和 py 一致时,每个容器内部显示区域宽高比才会与 aspectRatio 一致。
  5268. ## 未激活容器偏移与旋转
  5269. 通过对 X、Z 两个方向上的偏移值和 X、Y、Z 三个旋转轴旋转角度的设置,可以让未激活的容器在对应轴进行偏移与旋转,从而实现一些特殊的切换过渡效果,请参考示例。
  5270. 注意,偏移值以像素(px)为单位,而旋转角度以度(deg)为单位。
  5271. ## activeInjClass && notActiveInjClass
  5272. 通过对激活和未激活的容器注入 Class,可以让不同状态的容器有不同的样式,
  5273. ## radius && innerInjClass
  5274. 这是对容器内部区域的圆角设置与注入 Class,请参考示例。
  5275. ## onclick 事件
  5276. 点击事件仅仅在传入图片时生效,传入组件时事件由传入的组件内部决定。
  5277. ## 滑动事件
  5278. 当手指或其他触摸设备在 Swiper 容器内滑动结束时,Swiper 会结合滑动距离与滑动速度判断本次滑动是否触发切换,若触发则会根据滑动方向切换到上一个或下一个容器。
  5279. - 当滑动距离小于某个阈值时,始终不触发切换。
  5280. - 当滑动距离大于某个阈值时,始终触发切换。
  5281. - 当滑动距离介于两个阈值之间时,会根据滑动速度判断是否触发切换,速度大于某个速度系数时会触发切换。
  5282. 上述三种情况的阈值和速度系数可以通过 triggerLong、notTriggerLong 和 triggerSpeed 参数进行自定义。其中 triggerLong 和 notTriggerLong 为百分比,表示滑动距离占容器宽度的百分比;triggerSpeed 为 0-1 之间的小数,表示滑动速度系数。
  5283. ## lazyplay
  5284. Swiper 自动轮播时有一系列过渡动画,当页面同时有大量过渡效果时,考虑到设备性能与动画帧率等问题,Swiper 默认会开启懒轮播,即
  5285. Swiper 组件**不在页面可视范围内时会暂停自动轮播**,当然你也可以单独设置。
  5286. 下面两张图展示了极端情况下,同一个页面存在 30+ Swiper 同时轮播时,桌面端浏览器处理大量过渡动画时的性能监视图对比。
  5287. - 未开启懒轮播,同时会有 30+ 组过渡动画在进行时的性能监视图。
  5288. <img src="lazyplay_no.png" style="width: 100%;" alt="lazyplay_no" title="未开启懒轮播性能监视图">
  5289. - 已开启懒轮播,同时只有 3-4 组过渡动画在进行时的性能监视图。
  5290. <img src="lazyplay_yes.png" style="width: 100%;" alt="lazyplay_yes" title="已开启懒轮播性能监视图">
  5291. ================================================
  5292. FILE: docs/mds/components/swiper/guide_en.md
  5293. ================================================
  5294. ## data
  5295. The type field in the input data supports 'img' and 'component'. For 'img' type, you need to provide an image URL. For 'component' type, you need to provide a single-file component. The Swiper will render corresponding content based on the type.
  5296. ## interval && duration
  5297. For convenience, note that the interval time is in seconds while the transition duration is in milliseconds. Also note that the transition duration must be less than the interval time.
  5298. ## indicateStyle
  5299. This parameter configures the indicator style. When `indicateStyle` is set to `longLine`, the active indicator will show the interval progress during the Swiper's dwell time. Please refer to the examples.
  5300. ## indicateInjClass
  5301. This parameter allows you to inject CSS class names (not limited to Tailwind CSS) into the indicator area. For example, you can remove the default gradient background with transparency as shown in the examples.
  5302. If the injected class doesn't take effect, add "!" before the class name. Please refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  5303. ## aspectRatio && containerWidth && px && py
  5304. If containerWidth is not provided or set to 0, the Swiper will use the page width as the component area width by default. The height of this area will be calculated using containerWidth and aspectRatio.
  5305. Note that aspectRatio only determines the container's aspect ratio. The aspect ratio of the inner display area will match aspectRatio only when px and py are equal.
  5306. ## Inactive Container Offset and Rotation
  5307. By setting offset values in X and Z directions and rotation angles around X, Y, and Z axes, inactive containers can be offset and rotated along corresponding axes to achieve special transition effects. Please refer to the examples.
  5308. Note that offset values are in pixels (px) while rotation angles are in degrees (deg).
  5309. ## activeInjClass && notActiveInjClass
  5310. By injecting classes into active and inactive containers, you can apply different styles to containers in different states.
  5311. ## radius && innerInjClass
  5312. These parameters control the border radius and class injection for the inner container area. Please refer to the examples.
  5313. ## onclick Event
  5314. Click events only work when images are provided. For components, events are determined by the provided component itself.
  5315. ## Swipe Events
  5316. When a finger or other touch device finishes sliding within the Swiper container, the Swiper will determine whether to trigger a switch based on the sliding distance and velocity. If triggered, it will switch to the previous or next container according to the sliding direction.
  5317. - When the sliding distance is less than a certain threshold, switching will never be triggered.
  5318. - When the sliding distance is greater than a certain threshold, switching will always be triggered.
  5319. - When the sliding distance is between these two thresholds, switching will be determined by the sliding velocity - if the velocity exceeds a certain coefficient, switching will be triggered.
  5320. The thresholds and velocity coefficient for these three scenarios can be customized through triggerLong, notTriggerLong, and triggerSpeed parameters. Both triggerLong and notTriggerLong are percentages representing the sliding distance as a percentage of container width; triggerSpeed is a decimal between 0-1 representing the velocity coefficient.
  5321. ## lazyplay
  5322. When Swiper auto-plays, there are a series of transition animations. Considering device performance and animation frame rate issues when there are many simultaneous transitions on a page, Swiper enables lazy playback by default - meaning the Swiper component **will pause auto-play when not in the viewport**. Of course, you can configure this individually.
  5323. The following two images show performance monitoring comparisons in an extreme case where 30+ Swipers are playing simultaneously on the same page in a desktop browser.
  5324. - Performance monitor when lazy playback is disabled, showing 30+ sets of transitions occurring simultaneously.
  5325. <img src="lazyplay_no.png" style="width: 100%;" alt="lazyplay_no" title="Performance monitor with lazy playback disabled">
  5326. - Performance monitor when lazy playback is enabled, showing only 3-4 sets of transitions occurring simultaneously.
  5327. <img src="lazyplay_yes.png" style="width: 100%;" alt="lazyplay_yes" title="Performance monitor with lazy playback enabled">
  5328. ================================================
  5329. FILE: docs/mds/components/swiper/version.md
  5330. ================================================
  5331. ## 0.2.0
  5332. - [!tag|A|0|] 支持通过 triggerLong、notTriggerLong 和 triggerSpeed 三个 API 自定义滑动触发条件。
  5333. ================================================
  5334. FILE: docs/mds/components/swiper/version_en.md
  5335. ================================================
  5336. ## 0.2.0
  5337. - [!tag|A|0|] Supports customizing slide triggering conditions through the triggerLong, notTriggerLong, and triggerSpeed APIs.
  5338. ================================================
  5339. FILE: docs/mds/components/switch/api.md
  5340. ================================================
  5341. ## Switch Props
  5342. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5343. | -------- | --------------------------------------------------------------- | ---------- | ---- | ----------------------------------------------- |
  5344. | active | `boolean` | `false` | N | 开关状态。 |
  5345. | radius | `'none'\|'middle'\|'full'` | `'middle'` | N | 圆角风格。 |
  5346. | inside | `'state'\|'loading'\|[string,string]\|null` | `null` | N | 开关内部内容。 |
  5347. | injClass | `string` | `''` | N | 注入 CSS 名称。 |
  5348. | disabled | `boolean` | `false` | N | 是否禁用。 |
  5349. | async | `boolean` | `false` | N | 是否异步。 |
  5350. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | 加载组件参数,仅 inside 为 `'loading'` 时生效。 |
  5351. ## Switch Events
  5352. | 名称 | 类型 | 参数 | 描述 |
  5353. | -------- | --------------------------- | ----------------------- | -------------------- |
  5354. | onclick | `() => void` | - | 点击触发。 |
  5355. | onchange | `(active: boolean) => void` | active - 当前开关状态。 | 开关状态变化时触发。 |
  5356. ## Switch Snippets
  5357. | 名称 | 类型 | 参数 | 说明 |
  5358. | ---------- | ------------------------------------------------------------------- | ---- | -------------------------- |
  5359. | trueChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 状态为开启时开关内部内容。 |
  5360. | falseChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 状态为关闭时开关内部内容。 |
  5361. ================================================
  5362. FILE: docs/mds/components/switch/api_en.md
  5363. ================================================
  5364. ## Switch Props
  5365. | Name | Type | Default | Required | Description |
  5366. | -------- | --------------------------------------------------------------- | ---------- | -------- | ------------------------------------------------------------------------ |
  5367. | active | `boolean` | `false` | N | Switch state. |
  5368. | radius | `'none'\|'middle'\|'full'` | `'middle'` | N | Border radius style. |
  5369. | inside | `'state'\|'loading'\|[string,string]\|null` | `null` | N | Switch inner content. |
  5370. | injClass | `string` | `''` | N | Injected CSS class name. |
  5371. | disabled | `boolean` | `false` | N | Whether the switch is disabled. |
  5372. | async | `boolean` | `false` | N | Whether the switch is asynchronous. |
  5373. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | Loading component parameters, only effective when inside is `'loading'`. |
  5374. ## Switch Events
  5375. | Name | Type | Parameters | Description |
  5376. | -------- | --------------------------- | ------------------------------ | ---------------------------------------- |
  5377. | onclick | `() => void` | - | Triggered when clicked. |
  5378. | onchange | `(active: boolean) => void` | active - Current switch state. | Triggered when the switch state changes. |
  5379. ## Switch Snippets
  5380. | Name | Type | Parameters | Description |
  5381. | ---------- | ------------------------------------------------------------------- | ---------- | ------------------------------------------- |
  5382. | trueChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Switch inner content when the state is on. |
  5383. | falseChild | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Switch inner content when the state is off. |
  5384. ================================================
  5385. FILE: docs/mds/components/switch/FAQ.md
  5386. ================================================
  5387. ================================================
  5388. FILE: docs/mds/components/switch/FAQ_en.md
  5389. ================================================
  5390. ================================================
  5391. FILE: docs/mds/components/switch/guide.md
  5392. ================================================
  5393. ## 使用场景
  5394. 移动端的 Switch 组件一般来说都是搭配在 Cell 组件内使用,Cell 组件的 right 参数支持传入 Switch Props,请参考 Cell API。
  5395. 当然,单独使用也是可以的。
  5396. ## injClass
  5397. 通过 injClass 参数可以向组件内部最外层元素注入 CSS 名称(不仅限于 Tailwind CSS),这将使组件样式有更多自定义可能性。因为 CSS 注入于最后,此时最外层元素若已有同属性 CSS 将会以 injClass 为准,这也是通过 injClass 实现自定义开关颜色的原因。
  5398. ## inside & Snippet
  5399. inside 参数决定了开关内部显示内容,默认值是空字符,不显示任何内容。若传入字符 `'state’` 则会以竖线和圆形表示开关状态;若传入两项字符组成的数组,第一项和第二项将分别显示关闭与开启状态时的内部文字,建议传入单个文字;若传入字符 `'loading'` 则会以 Loading 图标渲染,且支持传入 Loading Props;若传入 falseChild 和 trueChild 则会以传入内容分别渲染开启与关闭时开关内部内容,请参考示例。
  5400. ## 特别注意
  5401. 在 Cell 组件内使用时,Switch 的 active 由 Cell Props 的 switchActive 决定,**请不要在 switch 内部再传入 active**。
  5402. ================================================
  5403. FILE: docs/mds/components/switch/guide_en.md
  5404. ================================================
  5405. ## Usage Scenarios
  5406. The Switch component for mobile devices is generally used in conjunction with the Cell component. The right parameter of the Cell component supports passing Switch Props. Please refer to the Cell API for more details.
  5407. Of course, it can also be used independently.
  5408. ## injClass
  5409. The injClass parameter allows you to inject CSS class names (not limited to Tailwind CSS) into the outermost element of the component, providing more customization possibilities for the component's style. Since CSS injection occurs at the end, if the outermost element already has CSS properties with the same attributes, the injClass will take precedence. This is also the reason why injClass can be used to customize the switch color.
  5410. ## inside & Snippet
  5411. The inside parameter determines the content displayed inside the switch. The default value is an empty string, which displays nothing. If the string 'state' is passed, it will represent the switch state with a vertical line and a circle. If an array of two strings is passed, the first and second items will display the internal text for the off and on states respectively; it's recommended to pass a single character. If the string 'loading' is passed, it will render with a Loading icon and supports passing Loading Props. If falseChild and trueChild are passed, they will render the internal content of the switch when it's off and on respectively. Please refer to the examples.
  5412. ## Special Note
  5413. When used within the Cell component, the active state of the Switch is determined by the switchActive prop of the Cell. **Please do not pass active again inside the switch.**
  5414. ================================================
  5415. FILE: docs/mds/components/switch/version.md
  5416. ================================================
  5417. ================================================
  5418. FILE: docs/mds/components/switch/version_en.md
  5419. ================================================
  5420. ================================================
  5421. FILE: docs/mds/components/tabBar/api.md
  5422. ================================================
  5423. ## TabBar Props
  5424. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5425. | ----------------- | --------------- | ------- | ---- | --------------------------- |
  5426. | labels | `TabBarLabel[]` | `[]` | Y | 选项卡内容组。 |
  5427. | active | `number` | `0` | N | 激活的选项卡索引值。 |
  5428. | line | `boolean` | `false` | N | 底部是否显示线条。 |
  5429. | lineW | `number` | `4` | N | 线条占当前 Tab 宽度的比例。 |
  5430. | love | `boolean` | `false` | N | 是否开启关爱版。 |
  5431. | injClass | `string` | `''` | N | TabBar 外层注入 CSS。 |
  5432. | tabInjClass | `string` | `''` | N | 单项 Tab 注入 CSS。 |
  5433. | activeTabInjClass | `string` | `''` | N | 激活的 Tab 注入 CSS。 |
  5434. | activeInjClass | `string` | `''` | N | 底部线条注入 CSS。 |
  5435. ## TabBarLabel Props
  5436. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5437. | ---------- | --------------------------------------------------------- | ------ | ---- | ------------------ |
  5438. | text | `string` | `''` | N | 选项卡文字。 |
  5439. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | - | N | 选项卡图标。 |
  5440. | activeIcon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | - | N | 激活的选项卡图标。 |
  5441. ## TabBar Events
  5442. | 名称 | 类型 | 参数 | 描述 |
  5443. | -------- | -------------------------- | ------------------------------- | -------------------- |
  5444. | onchange | `(active: number) => void` | `active` - 激活的 TabBar 索引值 | 点击 TabBar 时触发。 |
  5445. ================================================
  5446. FILE: docs/mds/components/tabBar/api_en.md
  5447. ================================================
  5448. ## TabBar Props
  5449. | Name | Type | Default | Required | Description |
  5450. | ----------------- | --------------- | ------- | -------- | -------------------------------------- |
  5451. | labels | `TabBarLabel[]` | `[]` | Y | Tab content group. |
  5452. | active | `number` | `0` | N | Index value of active tab. |
  5453. | line | `boolean` | `false` | N | Whether to show bottom line. |
  5454. | lineW | `number` | `4` | N | Line width ratio of current tab width. |
  5455. | love | `boolean` | `false` | N | Whether to enable care version. |
  5456. | injClass | `string` | `''` | N | Inject CSS class for TabBar wrapper. |
  5457. | tabInjClass | `string` | `''` | N | Inject CSS class for single tab. |
  5458. | activeTabInjClass | `string` | `''` | N | Inject CSS class for active tab. |
  5459. | activeInjClass | `string` | `''` | N | Inject CSS class for bottom line. |
  5460. ## TabBarLabel Props
  5461. | Name | Type | Default | Required | Description |
  5462. | ---------- | --------------------------------------------------------- | ------- | -------- | ---------------- |
  5463. | text | `string` | `''` | N | Tab text. |
  5464. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | - | N | Tab icon. |
  5465. | activeIcon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | - | N | Active tab icon. |
  5466. ## TabBar Events
  5467. | Name | Type | Parameters | Description |
  5468. | -------- | -------------------------- | ------------------------------ | --------------------------------- |
  5469. | onchange | `(active: number) => void` | `active` - Active TabBar index | Triggered when TabBar is clicked. |
  5470. ================================================
  5471. FILE: docs/mds/components/tabBar/FAQ.md
  5472. ================================================
  5473. ================================================
  5474. FILE: docs/mds/components/tabBar/FAQ_en.md
  5475. ================================================
  5476. ================================================
  5477. FILE: docs/mds/components/tabBar/guide.md
  5478. ================================================
  5479. ## 说明
  5480. TabBar 通过绑定的 onchange 事件,传递出当前激活选项卡的索引值。
  5481. ## labels
  5482. 此参数决定了 TabBar 内部的选项卡内容,支持图标与文字自由搭配。数据类型为对象数组,内部对象由 text 和 icon、activeIcon 搭配组成。icon 和 activeIcon 使用 Icon 组件渲染,其中 activeIcon 表示 TabBar 激活时的 Icon。具体参数请参考 [Icon Props](https://stdf.design/components?nav=icon&tab=1)。
  5483. ## 底部线条
  5484. line 为 true 时激活的 TabBar 底部会显示线条,lineW 和 activeInjClass 只会在 line 为 true 时生效。线条宽度可由 lineW 控制,lineW 的值为线条宽度占当前 Tab 宽度的比例,默认值为 4,**lineW 的值越大线条越窄**。
  5485. ## CSS 注入
  5486. TabBar 结构相对复杂,为了支持更灵活的自定义样式,内部支持四个地方注入 CSS,injClass 作用于 TabBar 最外层元素;tabInjClass 作用于内部的单项 tab;activeTabInjClass 作用于当前激活的 tab;activeInjClass 作用于 TabBar 底部的线条。
  5487. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  5488. ## 简单
  5489. 相对于其他组件,TabBar 组件在应用中被使用的频率较低,一般一个应用就一个,而且一般都有针对自己品牌的专属 UI/UX 设计,复用性很低,因此 TabBar 组件在 API 设计上相对简单一些。
  5490. ================================================
  5491. FILE: docs/mds/components/tabBar/guide_en.md
  5492. ================================================
  5493. ## Description
  5494. TabBar passes the index value of the currently active tab through the bound onchange event.
  5495. ## labels
  5496. This parameter determines the content of tabs inside the TabBar, supporting free combination of icons and text. The data type is an array of objects, where each object consists of text, icon and activeIcon. The icon and activeIcon are rendered using the Icon component, where activeIcon represents the Icon when TabBar is active. For specific parameters, please refer to [Icon Props](https://stdf.design/components?nav=icon&tab=1).
  5497. ## Bottom Line
  5498. When line is true, a line will be displayed at the bottom of the active TabBar. lineW and activeInjClass only take effect when line is true. The line width can be controlled by lineW, whose value represents the ratio of line width to current Tab width. The default value is 4, **the larger the lineW value, the narrower the line**.
  5499. ## CSS Injection
  5500. TabBar has a relatively complex structure. To support more flexible custom styles, it supports CSS injection in four places: injClass applies to the outermost element of TabBar; tabInjClass applies to individual tabs inside; activeTabInjClass applies to the currently active tab; activeInjClass applies to the bottom line of TabBar.
  5501. If the injected class doesn't take effect, please add "!" before the injected class name. You can refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  5502. ## Simplicity
  5503. Compared to other components, the TabBar component is used less frequently in applications, usually just one per application, and generally has brand-specific UI/UX design with low reusability. Therefore, the TabBar component's API design is relatively simple.
  5504. ================================================
  5505. FILE: docs/mds/components/tabBar/version.md
  5506. ================================================
  5507. ================================================
  5508. FILE: docs/mds/components/tabBar/version_en.md
  5509. ================================================
  5510. ================================================
  5511. FILE: docs/mds/components/tabs/api.md
  5512. ================================================
  5513. ## Tabs Props
  5514. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5515. | ---------- | ---------------------------------- | -------- | ---- | -------------------- |
  5516. | tab | `Tab` | `{}` | Y | 内部 Tab 组件。 |
  5517. | active | `number` | `0` | N | 激活的选项卡索引值。 |
  5518. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | 过渡动画快慢。 |
  5519. | position | `'t'\|'b'\|'l'\|'r'` | `'t'` | N | 选项卡位置。 |
  5520. | transition | `boolean` | `true` | N | 是否使用过渡动画。 |
  5521. ## Tabs Events
  5522. | 名称 | 类型 | 参数 | 描述 |
  5523. | -------- | -------------------------- | --------------------------- | ---------------------------- |
  5524. | onchange | `(active: number) => void` | active - 激活的选项卡索引值 | 激活的选项卡发生变化时触发。 |
  5525. ## Tabs Snippets
  5526. | 名称 | 类型 | 参数 | 说明 |
  5527. | -------- | ----------------------------------------------------------------------------------------- | --------------------------- | --------------- |
  5528. | children | [`Snippet<[{ active: number }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | active - 激活的选项卡索引值 | Tabs 主体内容。 |
  5529. ## Tab Props
  5530. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5531. | ----------------- | ----------------------------------------------------- | -------- | ---- | ---------------------------------- |
  5532. | labels | `TabLabel[]` | `[]` | Y | 选项卡内容组。 |
  5533. | active | `number` | `0` | N | 激活的选项卡索引值。 |
  5534. | lineType | `boolean` | `false` | N | 是否使用线性风格。 |
  5535. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  5536. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'` | `'2'` | N | 左右间距。 |
  5537. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | 过渡动画快慢。 |
  5538. | layout | `'h'\|'v'` | `'h'` | N | 水平或垂直布局。 |
  5539. | love | `boolean` | `false` | N | 是否开启关爱版。 |
  5540. | injClass | `string` | `''` | N | Tab 外层注入 CSS。 |
  5541. | tabInjClass | `string` | `''` | N | 单项 Tab 注入 CSS。 |
  5542. | activeTabInjClass | `string` | `''` | N | 激活的 Tab 注入 CSS。 |
  5543. | activeInjClass | `string` | `''` | N | 指示器注入 CSS。 |
  5544. | overflow | `boolean` | `false` | N | 是否开启溢出模式。 |
  5545. | showNum | `number` | `3` | N | 开启溢出模式时,完整显示 Tab 数。 |
  5546. | autoScroll | `boolean` | `false` | N | 开启溢出模式时,是否开启自动滚动。 |
  5547. ## Tab Events
  5548. | 名称 | 类型 | 参数 | 描述 |
  5549. | ---------- | -------------------------- | ----------------------------- | ------------------ |
  5550. | onclickTab | `(active: number) => void` | active - 激活的选项卡索引值。 | 点击选项卡时触发。 |
  5551. ## TabLabel Props
  5552. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5553. | ---- | --------------------------------------------------------- | ------ | ---- | ---------- |
  5554. | text | `string` | `''` | N | 标签文本。 |
  5555. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | 标签图标。 |
  5556. ## TabContent Props
  5557. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5558. | ---- | --------- | ------ | ---- | ---------- |
  5559. | show | `boolean` | `true` | N | 是否显示。 |
  5560. ## TabContent Snippets
  5561. | 名称 | 类型 | 参数 | 说明 |
  5562. | -------- | ------------------------------------------------------------------- | ---- | ----------------- |
  5563. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | TabContent 内容。 |
  5564. ================================================
  5565. FILE: docs/mds/components/tabs/api_en.md
  5566. ================================================
  5567. ## Tabs Props
  5568. | Name | Type | Default | Required | Description |
  5569. | ---------- | ---------------------------------- | -------- | -------- | ---------------------------------- |
  5570. | tab | `Tab` | `{}` | Y | Internal Tab component. |
  5571. | active | `number` | `0` | N | Active tab index. |
  5572. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | Transition animation duration. |
  5573. | position | `'t'\|'b'\|'l'\|'r'` | `'t'` | N | Tab position. |
  5574. | transition | `boolean` | `true` | N | Whether to use transition effects. |
  5575. ## Tabs Events
  5576. | Name | Type | Parameters | Description |
  5577. | -------- | -------------------------- | ------------------------- | ---------------------------------- |
  5578. | onchange | `(active: number) => void` | active - Active tab index | Triggered when active tab changes. |
  5579. ## Tabs Snippets
  5580. | Name | Type | Parameters | Description |
  5581. | -------- | ----------------------------------------------------------------------------------------- | ------------------------- | ------------------ |
  5582. | children | [`Snippet<[{ active: number }]>`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | active - Active tab index | Tabs main content. |
  5583. ## Tab Props
  5584. | Name | Type | Default | Required | Description |
  5585. | ----------------- | ----------------------------------------------------- | -------- | -------- | ------------------------------------------------ |
  5586. | labels | `TabLabel[]` | `[]` | Y | Tab content group. |
  5587. | active | `number` | `0` | N | Active tab index. |
  5588. | lineType | `boolean` | `false` | N | Whether to use line style. |
  5589. | radius | `'none'\|'sm'\|'xl'\|'full'` | `'sm'` | N | Border radius style. |
  5590. | mx | `'0'\|'1'\|'2'\|'3'\|'4'\|'6'\|'8'\|'12'\|'16'\|'20'` | `'2'` | N | Horizontal margin. |
  5591. | duration | `'fast'\|'base'\|'slow'\|'slower'` | `'base'` | N | Transition animation duration. |
  5592. | layout | `'h'\|'v'` | `'h'` | N | Horizontal or vertical layout. |
  5593. | love | `boolean` | `false` | N | Whether to enable care version. |
  5594. | injClass | `string` | `''` | N | Inject CSS to Tab wrapper. |
  5595. | tabInjClass | `string` | `''` | N | Inject CSS to single Tab. |
  5596. | activeTabInjClass | `string` | `''` | N | Inject CSS to active Tab. |
  5597. | activeInjClass | `string` | `''` | N | Inject CSS to indicator. |
  5598. | overflow | `boolean` | `false` | N | Whether to enable overflow mode. |
  5599. | showNum | `number` | `3` | N | Number of fully displayed tabs in overflow mode. |
  5600. | autoScroll | `boolean` | `false` | N | Auto scroll in overflow mode. |
  5601. ## Tab Events
  5602. | Name | Type | Parameters | Description |
  5603. | ---------- | -------------------------- | -------------------------- | ------------------------------ |
  5604. | onclickTab | `(active: number) => void` | active - Active tab index. | Triggered when tab is clicked. |
  5605. ## TabLabel Props
  5606. | Name | Type | Default | Required | Description |
  5607. | ---- | --------------------------------------------------------- | ------- | -------- | ----------- |
  5608. | text | `string` | `''` | N | Label text. |
  5609. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | Label icon. |
  5610. ## TabContent Props
  5611. | Name | Type | Default | Required | Description |
  5612. | ---- | --------- | ------- | -------- | ------------------------ |
  5613. | show | `boolean` | `true` | N | Whether to show content. |
  5614. ## TabContent Snippets
  5615. | Name | Type | Parameters | Description |
  5616. | -------- | ------------------------------------------------------------------- | ---------- | ------------------- |
  5617. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | TabContent content. |
  5618. ================================================
  5619. FILE: docs/mds/components/tabs/FAQ.md
  5620. ================================================
  5621. ================================================
  5622. FILE: docs/mds/components/tabs/FAQ_en.md
  5623. ================================================
  5624. ================================================
  5625. FILE: docs/mds/components/tabs/guide.md
  5626. ================================================
  5627. ## Tabs
  5628. Tabs 组件内部使用了 Tab 组件,而 Tabs Props 中的 tab 全部透传给 Tab,用于配置 Tab 不同的样式。
  5629. ### Snippet
  5630. Tabs Props 的 transition 默认为 true,此时 Tabs 主体内容切换带有过渡效果。而当 transition 为 false,或者 position 为 'l' 或 'r' 时,Tabs 主体内容将不会有过渡效果,可以通过 Svelte 提供的 [{#snippet ...}](https://svelte.dev/docs/svelte/snippet) 传入,注意此时 children 需要将当前激活的 Tab 索引值 `{ active }` 传入,暴露给 Snippet 内部,再结合 TabContent 的 show 控制主体内容的显示与隐藏。通过暴露出的 active,你还可以自由使用其他方式控制主体区域内容的过渡效果。示例中展示了一种方式,请结合具体业务尝试其他切换效果。
  5631. ### 选项卡位置
  5632. Tabs 通过 position(t:上、b:下、l:左、r:右)决定选项卡位置,而此参数又决定了其中 Tab 的布局方式 layout(h:水平、v:垂直)。
  5633. ---
  5634. ## Tab
  5635. Tab 组件可以单独使用,通过绑定的 onclickTab 事件,传递出当前激活选项卡的索引值。
  5636. ### labels
  5637. 此参数决定了 Tab 内部的选项卡内容,支持图标与文字自由搭配。数据类型为对象数组,内部对象由 text 和 icon 组成,而 icon 使用 Icon 组件渲染,具体参数请参考 [Icon Props](https://stdf.design/components?nav=icon&tab=1)。
  5638. ### 线性风格
  5639. 当 Tab props 的 lineType 为 true 时,Tab 会使用线性风格,但若布局方式为 v(垂直)则线性风格不会生效。
  5640. ### 溢出模式
  5641. 由于移动设备横向空间有限,当横向布局且 Tab 数量较多或者动态无法确定时,可以开启溢出模式,此时 Tabs 会自动隐藏溢出的 Tab,通过滑动来查看隐藏的 Tab。开启溢出模式后,可以通过 `showNum` 控制显示的 Tab 数量,通过 `autoScroll` 控制是否开启自动滚动。
  5642. 溢出模式时,可见区域内实际显示的 Tab 是 `showNum+0.5`,如此设计会在初始时将最后一个 Tab 隐藏一半,以便在不刻意提示的情况下,用户可以自然地意识到隐藏了 Tab,从而产生滑动的操作。
  5643. > Tip:如果 Tab 内容宽度过大时请适当减小 `showNum`,以免 Tab 内容溢出被隐藏。
  5644. ### CSS 注入
  5645. Tab 结构相对复杂,为了支持更灵活的自定义样式,内部支持四个地方注入 CSS,injClass 作用于 Tab 最外层元素;tabInjClass 作用于内部的单项 tab;activeTabInjClass 作用于当前激活的 tab;activeInjClass 作用于 Tab 的指示器。
  5646. 若注入的 class 没生效,请在注入的 class 名称前添加“!” ,可参考 [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier)。
  5647. ================================================
  5648. FILE: docs/mds/components/tabs/guide_en.md
  5649. ================================================
  5650. ## Tabs
  5651. The Tabs component internally uses the Tab component, and the tab in Tabs Props is fully passed through to Tab to configure different styles of Tab.
  5652. ### Snippet
  5653. The transition in Tabs Props defaults to true, at which point the Tabs main content switches with transition effects. When transition is false, or position is 'l' or 'r', the Tabs main content will not have transition effects. It can be passed in through Svelte's [{#snippet ...}](https://svelte.dev/docs/svelte/snippet). Note that children needs to pass in the currently active Tab index value `{ active }` to expose it to the Snippet interior, and then combine with TabContent's show to control the display and hiding of the main content. Through the exposed active, you can also freely use other ways to control the transition effects of the main area content. The example shows one way, please try other switching effects in combination with specific business needs.
  5654. ### Tab Position
  5655. Tabs determines the tab position through position (t: top, b: bottom, l: left, r: right), and this parameter also determines the layout mode of Tab within it (h: horizontal, v: vertical).
  5656. ---
  5657. ## Tab
  5658. The Tab component can be used independently, passing out the index value of the currently active tab through the bound onclickTab event.
  5659. ### labels
  5660. This parameter determines the tab content inside Tab, supporting free combination of icons and text. The data type is an array of objects, with internal objects consisting of text and icon, while icon is rendered using the Icon component. For specific parameters, please refer to [Icon Props](https://stdf.design/components?nav=icon&tab=1).
  5661. ### Line Style
  5662. When lineType in Tab props is true, Tab will use line style, but if the layout mode is v (vertical), the line style will not take effect.
  5663. ### Overflow Mode
  5664. Due to limited horizontal space on mobile devices, when using horizontal layout and the number of Tabs is large or dynamically uncertain, overflow mode can be enabled. At this time, Tabs will automatically hide overflowing Tabs, which can be viewed by sliding. After enabling overflow mode, you can control the number of displayed Tabs through `showNum`, and control whether to enable auto-scrolling through `autoScroll`.
  5665. In overflow mode, the actual number of Tabs displayed in the visible area is `showNum+0.5`. This design will initially hide half of the last Tab, so that users can naturally realize that Tabs are hidden without deliberate prompting, thus producing sliding operations.
  5666. > Tip: If the Tab content width is too large, please appropriately reduce `showNum` to prevent Tab content from being hidden due to overflow.
  5667. ### CSS Injection
  5668. The Tab structure is relatively complex. To support more flexible custom styles, four places are supported for CSS injection internally: injClass acts on the outermost element of Tab; tabInjClass acts on the internal single tab; activeTabInjClass acts on the currently active tab; activeInjClass acts on the Tab indicator.
  5669. If the injected class doesn't take effect, please add "!" before the injected class name. You can refer to [Tailwind Important modifier](https://tailwindcss.com/docs/configuration#important-modifier).
  5670. ================================================
  5671. FILE: docs/mds/components/tabs/version.md
  5672. ================================================
  5673. ## 0.4.4
  5674. - [!tag|A|0|]支持溢出模式。
  5675. ## 0.4.3
  5676. - [!tag|O|0|]Tabs Props 的 `placement` 改为 `position`。
  5677. - [!tag|O|0|]Tab 的 `mx` 默认值由 '4' 改为 '2'。
  5678. - [!tag|B|3|]修复 [Issues](https://github.com/any-tdf/stdf/issues/17)。[!issue|Zz-ZzzZ|]
  5679. ================================================
  5680. FILE: docs/mds/components/tabs/version_en.md
  5681. ================================================
  5682. ## 0.4.4
  5683. - [!tag|A|0|]Overflow mode is supported.
  5684. ## 0.4.3
  5685. - [!tag|O|0|]Tabs Props `placement` changed to `position`.
  5686. - [!tag|O|0|]Tab `mx` default value changed from '4' to '2'.
  5687. - [!tag|B|3|]Fix [Issues](https://github.com/any-tdf/stdf/issues/17). [!issue|Zz-ZzzZ|]
  5688. ================================================
  5689. FILE: docs/mds/components/timePicker/api.md
  5690. ================================================
  5691. ## TimePicker Props
  5692. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5693. | ----------- | ----------------------------------------------------------- | ------------------------------------ | ---- | ------------------ |
  5694. | visible | `boolean` | `false` | N | 是否显示。 |
  5695. | type | `TimePickerType` | `'YYYYMMDDhhmmss'` | N | 时间类型。 |
  5696. | yearProps | `TimePickerItem` | `{}` | N | 年份列参数。 |
  5697. | monthProps | `TimePickerItem` | `{}` | N | 月份列参数。 |
  5698. | dayProps | `TimePickerItem` | `{}` | N | 日期列参数。 |
  5699. | hourProps | `TimePickerItem` | `{}` | N | 小时列参数。 |
  5700. | minuteProps | `TimePickerItem` | `{}` | N | 分钟列参数。 |
  5701. | secondProps | `TimePickerItem` | `{}` | N | 秒钟列参数。 |
  5702. | initYear | `string` | `''` | N | 初始选定的年份。 |
  5703. | initMonth | `string` | `''` | N | 初始选定的月份。 |
  5704. | initDay | `string` | `''` | N | 初始选定的日期。 |
  5705. | initHour | `string` | `''` | N | 初始选定的小时。 |
  5706. | initMinute | `string` | `''` | N | 初始选定的分钟。 |
  5707. | initSecond | `string` | `''` | N | 初始选定的秒钟。 |
  5708. | minuteStep | `number` | `1` | N | 分钟步长。 |
  5709. | secondStep | `number` | `1` | N | 秒钟步长。 |
  5710. | yearRange | `[number,number]\|[]` | `[]` | N | 年份范围。 |
  5711. | monthRange | `[number,number]` | `[1, 12]` | N | 月份范围。 |
  5712. | hourRange | `[number,number]` | `[0, 23]` | N | 小时范围。 |
  5713. | minuteRange | `[number,number]` | `[0, 59]` | N | 分钟范围。 |
  5714. | secondRange | `[number,number]` | `[0, 59]` | N | 秒钟范围。 |
  5715. | showTips | `boolean` | `true` | N | 是否显示提示信息。 |
  5716. | cancelText | `string` | 当前语言的 timePicker.defaultCancel | N | 取消选项文本。 |
  5717. | confirmText | `string` | 当前语言的 timePicker.defaultConfirm | N | 确定选项文本。 |
  5718. | title | `string` | 当前语言的 timePicker.defaultTitle | N | 中间标题文本。 |
  5719. | yearText | `string` | 当前语言的 timePicker.defaultYear | N | 年份列提示文本。 |
  5720. | monthText | `string` | 当前语言的 timePicker.defaultMonth | N | 月份列提示文本。 |
  5721. | dayText | `string` | 当前语言的 timePicker.defaultDay | N | 日期列提示文本。 |
  5722. | hourText | `string` | 当前语言的 timePicker.defaultHour | N | 小时列提示文本。 |
  5723. | minuteText | `string` | 当前语言的 timePicker.defaultMinute | N | 分钟列提示文本。 |
  5724. | secondText | `string` | 当前语言的 timePicker.defaultSecond | N | 秒钟列提示文本。 |
  5725. | outFormat | `string` | `''` | N | 返回数据格式。 |
  5726. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | 弹出层参数。 |
  5727. ## TimePicker Events
  5728. | 名称 | 类型 | 参数 | 描述 |
  5729. | --------- | --------------------------------------------------- | ------------------------------------------------------ | -------------------- |
  5730. | onclose | `() => void` | - | 关闭时触发。 |
  5731. | oncancel | `() => void` | - | 点击左侧取消时触发。 |
  5732. | onconfirm | `(timeStr: string, timeObj: TimePickerObj) => void` | timeStr - 格式化后的时间字符串<br />timeObj - 时间对象 | 点击右侧确定时触发。 |
  5733. ## TimePickerItem Props
  5734. | 名称 | 类型 | 默认值 | 必传 | 说明 |
  5735. | ------- | --------------------------- | ---------- | ---- | -------------------------------------------- |
  5736. | flex | `number` | `1` | N | 年、月、日、时、分、秒数据列所占的宽度比例。 |
  5737. | showRow | `3\|5\|7` | `5` | N | 年、月、日、时、分、秒数据列可见行数。 |
  5738. | align | `'left'\|'center'\|'right'` | `'center'` | N | 年、月、日、时、分、秒数据列对齐方式。 |
  5739. ## TimePickerType
  5740. ```javascript
  5741. type TimePickerType =
  5742. | 'YYYY'
  5743. | 'MM'
  5744. | 'hh'
  5745. | 'mm'
  5746. | 'ss'
  5747. | 'YYYYMM'
  5748. | 'hhmm'
  5749. | 'mmss'
  5750. | 'YYYYMMDD'
  5751. | 'hhmmss'
  5752. | 'YYYYMMDDhh'
  5753. | 'YYYYMMDDhhmm'
  5754. | 'YYYYMMDDhhmmss';
  5755. ```
  5756. ## TimePickerObj
  5757. ```javascript
  5758. type TimePickerObj = { YYYY: string; MM: string; DD: string; hh: string; mm: string; ss: string };
  5759. ```
  5760. ================================================
  5761. FILE: docs/mds/components/timePicker/api_en.md
  5762. ================================================
  5763. ## TimePicker Props
  5764. | Name | Type | Default | Required | Description |
  5765. | ----------- | ----------------------------------------------------------- | ------------------------------------------ | -------- | --------------------------- |
  5766. | visible | `boolean` | `false` | N | Whether to show the picker. |
  5767. | type | `TimePickerType` | `'YYYYMMDDhhmmss'` | N | Time type. |
  5768. | yearProps | `TimePickerItem` | `{}` | N | Year column parameters. |
  5769. | monthProps | `TimePickerItem` | `{}` | N | Month column parameters. |
  5770. | dayProps | `TimePickerItem` | `{}` | N | Day column parameters. |
  5771. | hourProps | `TimePickerItem` | `{}` | N | Hour column parameters. |
  5772. | minuteProps | `TimePickerItem` | `{}` | N | Minute column parameters. |
  5773. | secondProps | `TimePickerItem` | `{}` | N | Second column parameters. |
  5774. | initYear | `string` | `''` | N | Initial selected year. |
  5775. | initMonth | `string` | `''` | N | Initial selected month. |
  5776. | initDay | `string` | `''` | N | Initial selected day. |
  5777. | initHour | `string` | `''` | N | Initial selected hour. |
  5778. | initMinute | `string` | `''` | N | Initial selected minute. |
  5779. | initSecond | `string` | `''` | N | Initial selected second. |
  5780. | minuteStep | `number` | `1` | N | Minute step. |
  5781. | secondStep | `number` | `1` | N | Second step. |
  5782. | yearRange | `[number,number]\|[]` | `[]` | N | Year range. |
  5783. | monthRange | `[number,number]` | `[1, 12]` | N | Month range. |
  5784. | hourRange | `[number,number]` | `[0, 23]` | N | Hour range. |
  5785. | minuteRange | `[number,number]` | `[0, 59]` | N | Minute range. |
  5786. | secondRange | `[number,number]` | `[0, 59]` | N | Second range. |
  5787. | showTips | `boolean` | `true` | N | Whether to show tips. |
  5788. | cancelText | `string` | Current language timePicker.defaultCancel | N | Cancel button text. |
  5789. | confirmText | `string` | Current language timePicker.defaultConfirm | N | Confirm button text. |
  5790. | title | `string` | Current language timePicker.defaultTitle | N | Title text. |
  5791. | yearText | `string` | Current language timePicker.defaultYear | N | Year column tip text. |
  5792. | monthText | `string` | Current language timePicker.defaultMonth | N | Month column tip text. |
  5793. | dayText | `string` | Current language timePicker.defaultDay | N | Day column tip text. |
  5794. | hourText | `string` | Current language timePicker.defaultHour | N | Hour column tip text. |
  5795. | minuteText | `string` | Current language timePicker.defaultMinute | N | Minute column tip text. |
  5796. | secondText | `string` | Current language timePicker.defaultSecond | N | Second column tip text. |
  5797. | outFormat | `string` | `''` | N | Output data format. |
  5798. | popup | [`Popup`](https://stdf.design/components?nav=popup&tab=1) | `{}` | N | Popup parameters. |
  5799. ## TimePicker Events
  5800. | Name | Type | Parameters | Description |
  5801. | --------- | --------------------------------------------------- | ---------------------------------------------------------- | --------------------------------------- |
  5802. | onclose | `() => void` | - | Triggered when closing. |
  5803. | oncancel | `() => void` | - | Triggered when clicking cancel button. |
  5804. | onconfirm | `(timeStr: string, timeObj: TimePickerObj) => void` | timeStr - Formatted time string<br />timeObj - Time object | Triggered when clicking confirm button. |
  5805. ## TimePickerItem Props
  5806. | Name | Type | Default | Required | Description |
  5807. | ------- | --------------------------- | ---------- | -------- | --------------------------------------------------------------- |
  5808. | flex | `number` | `1` | N | Width ratio of year, month, day, hour, minute, second columns. |
  5809. | showRow | `3\|5\|7` | `5` | N | Visible rows of year, month, day, hour, minute, second columns. |
  5810. | align | `'left'\|'center'\|'right'` | `'center'` | N | Alignment of year, month, day, hour, minute, second columns. |
  5811. ## TimePickerType
  5812. ```javascript
  5813. type TimePickerType =
  5814. | 'YYYY'
  5815. | 'MM'
  5816. | 'hh'
  5817. | 'mm'
  5818. | 'ss'
  5819. | 'YYYYMM'
  5820. | 'hhmm'
  5821. | 'mmss'
  5822. | 'YYYYMMDD'
  5823. | 'hhmmss'
  5824. | 'YYYYMMDDhh'
  5825. | 'YYYYMMDDhhmm'
  5826. | 'YYYYMMDDhhmmss';
  5827. ```
  5828. ## TimePickerObj
  5829. ```javascript
  5830. type TimePickerObj = { YYYY: string; MM: string; DD: string; hh: string; mm: string; ss: string };
  5831. ```
  5832. ================================================
  5833. FILE: docs/mds/components/timePicker/FAQ.md
  5834. ================================================
  5835. ================================================
  5836. FILE: docs/mds/components/timePicker/FAQ_en.md
  5837. ================================================
  5838. ================================================
  5839. FILE: docs/mds/components/timePicker/guide.md
  5840. ================================================
  5841. ## 使用场景
  5842. TimePicker 组件用于选择时间,支持单列选择和多列选择。默认参数选择前后十年的时间,默认初始时选中当前时间。
  5843. ## 时间类型
  5844. TimePicker 组件通过传入的 type 参数来决定选择的时间类型,由 YYYY MM DD hh mm ss 组合而来,目前共支持以下 13 种,不在此列出的类型将使用默认的 'YYYYMMDDhhmmss' 类型。
  5845. - YYYY:年
  5846. - MM:月
  5847. - DD:日
  5848. - hh:时
  5849. - mm:分
  5850. - ss:秒
  5851. - YYYYMM:年月
  5852. - hhmm:时分
  5853. - mmss:分秒
  5854. - YYYYMMDD:年月日
  5855. - hhmmss:时分秒
  5856. - YYYYMMDDhh:年月日时
  5857. - YYYYMMDDhhmm:年月日时分
  5858. - YYYYMMDDhhmmss:年月日时分秒
  5859. ## 单列样式
  5860. 无论是年、月、日、时、分、秒的列数据,都可以通过传入对应的 Props 来自定义三种样式,分别是:flex、showRow、align。具体使用请参考示例。
  5861. ## 限定选择区间
  5862. 因为每月的天数会根据当前年与月动态更新,所以除了天数列数据,其余列数据都可以通过传入对应的 Range 来限定选择区间,由对应数据组成的数组。但请保证传入的区间数组为两项,**每一项为 Number 类型**,且第一项小于第二项,否则将使用默认的区间。具体使用请参考示例。
  5863. ## 初始选定值
  5864. 每列数据初始化时默认会选择当前时间,同时也支持传入对应的初始值来自定义初始选定值。但需要注意的是传入的初始值类型为字符类型,且**保证月、日、时、分、秒的初始值不足两位时补齐至两位**。具体使用请参考示例。
  5865. ## 分秒步长
  5866. 考虑实际用途,支持对分和秒数据进行步长设置,步长默认为 1,即每次选择都会增加 1 分或 1 秒。具体使用请参考示例。
  5867. ## outFormat
  5868. 默认情况下,TimePicker 组件的 outFormat 由传入的 type 按照【年月日之间用 - 连接,时分秒之间用 : 连接,两者之间用空格连接】的规则生成,比如转入 `'YYYYMMDD'` 对应 `YYYY-MM-DD`,`'YYYYMMDDhh'` 对应 `YYYY-MM-DD hh`,`'hhmmss'` 对应 `hh:mm:ss` 等。当然也可以自定义输出格式。具体使用请参考示例。
  5869. 需要注意的是,onconfirm 返回的第二个参数是选择的时间对象,方便开发者自行处理。
  5870. ## 说明
  5871. TimePicker 是在 Popup 基础上封装的,通过预先定义一些 Popup 的 Props 实现,因此可以通过传入 Popup 的属性来实现不同的效果。比如示例中通过设置 popup 的 radius 改变圆角风格。
  5872. ================================================
  5873. FILE: docs/mds/components/timePicker/guide_en.md
  5874. ================================================
  5875. ## Usage Scenarios
  5876. The TimePicker component is used for time selection, supporting both single-column and multi-column selection. By default, it allows selection of time within 10 years before and after the current year, and initially selects the current time.
  5877. ## Time Types
  5878. The TimePicker component determines the time type through the type parameter, which is composed of YYYY MM DD hh mm ss. Currently, it supports the following 13 types. Any type not listed here will use the default 'YYYYMMDDhhmmss' type.
  5879. - YYYY: Year
  5880. - MM: Month
  5881. - DD: Day
  5882. - hh: Hour
  5883. - mm: Minute
  5884. - ss: Second
  5885. - YYYYMM: Year and Month
  5886. - hhmm: Hour and Minute
  5887. - mmss: Minute and Second
  5888. - YYYYMMDD: Year, Month and Day
  5889. - hhmmss: Hour, Minute and Second
  5890. - YYYYMMDDhh: Year, Month, Day and Hour
  5891. - YYYYMMDDhhmm: Year, Month, Day, Hour and Minute
  5892. - YYYYMMDDhhmmss: Year, Month, Day, Hour, Minute and Second
  5893. ## Single Column Style
  5894. For all column data (year, month, day, hour, minute, second), you can customize three styles by passing corresponding Props: flex, showRow, and align. Please refer to the examples for specific usage.
  5895. ## Selection Range Limitation
  5896. Since the number of days in each month updates dynamically based on the current year and month, all column data except days can have their selection range limited by passing in the corresponding Range, which is an array of corresponding data. However, please ensure that the range array has two items, **each item being of Number type**, and the first item is less than the second item, otherwise the default range will be used. Please refer to the examples for specific usage.
  5897. ## Initial Selected Value
  5898. By default, each column data initially selects the current time, but you can also pass in corresponding initial values to customize the initially selected value. Note that the initial value type should be string type, and **ensure that month, day, hour, minute, and second initial values are padded to two digits if less than two digits**. Please refer to the examples for specific usage.
  5899. ## Minute and Second Step
  5900. Considering practical use, the component supports step settings for minute and second data. The default step is 1, meaning each selection increases by 1 minute or 1 second. Please refer to the examples for specific usage.
  5901. ## outFormat
  5902. By default, the TimePicker component's outFormat is generated from the input type following the rule [years, months, and days are connected by -, hours, minutes, and seconds are connected by :, and the two parts are connected by space]. For example, `'YYYYMMDD'` corresponds to `YYYY-MM-DD`, `'YYYYMMDDhh'` corresponds to `YYYY-MM-DD hh`, `'hhmmss'` corresponds to `hh:mm:ss`, etc. Of course, you can also customize the output format. Please refer to the examples for specific usage.
  5903. Note that the second parameter returned by onconfirm is the selected time object, making it convenient for developers to handle themselves.
  5904. ## Note
  5905. TimePicker is encapsulated based on Popup by pre-defining some Popup Props, so different effects can be achieved by passing in Popup properties. For example, in the example, the radius style is changed by setting the popup's radius.
  5906. ================================================
  5907. FILE: docs/mds/components/timePicker/version.md
  5908. ================================================
  5909. ================================================
  5910. FILE: docs/mds/components/timePicker/version_en.md
  5911. ================================================
  5912. ================================================
  5913. FILE: docs/mds/components/toast/api.md
  5914. ================================================
  5915. ## Toast Props
  5916. | 名称 | 类型 | 默认值 | 必传 | 说明 | |
  5917. | ---------------- | ---------------------------------------------------------------- | ---------- | ---- | --------------------------------------------------------------------- | :-- |
  5918. | message | `string` | `''` | N | 提示内容。 |
  5919. | visible | `boolean` | `false` | N | 是否显示。 |
  5920. | duration | `number` | `2000` | N | 显示时长,为 0 时提示不会自动关闭,单位:ms。 |
  5921. | position | `'center'\|'top'\|'bottom'` | `'center'` | N | 显示位置。 |
  5922. | py | `'0'\|'10'\|'20'\|'40'\|'60'\|'80'` | `'20'` | N | 顶部和底部显示时距离顶部或底部的距离,position 为 'center' 时不生效。 |
  5923. | radius | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'sm'` | N | 圆角风格。 |
  5924. | transitionType | `'scale'\|'fly'\|'fade'\|'slide'\|'blur'\|null` | `'scale'` | N | 动画类型。 |
  5925. | transitionParams | [`Transition`](https://svelte.dev/docs/svelte/svelte-transition) | `{}` | N | 动画参数,其中 duration 默认 300。 |
  5926. | outDuration | `number` | `0` | N | 退出动画时间,单位:ms。 |
  5927. | type | `'success'\|'error'\|'warning'\|'info'\|'loading'\|'icon'\|null` | `null` | N | 提示图标类型。 |
  5928. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | 遮罩层参数。 |
  5929. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | 加载组件参数,仅 type 为 `'loading'` 时生效。 |
  5930. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | 图标组件参数,仅 type 为非 `'loading'` 且非 `null` 时生效。 |
  5931. | zIndex | `number` | `1000` | N | z-index。 |
  5932. | clickable | `boolean` | `false` | N | 是否允许点击穿透。 |
  5933. | dynamicFixed | `boolean` | `true` | N | 是否动态固定。 |
  5934. ## Toast Events
  5935. | 名称 | 类型 | 参数 | 描述 |
  5936. | ------- | ------------ | ---- | ---------------- |
  5937. | onclose | `() => void` | - | 提示关闭时触发。 |
  5938. ## Toast Snippets
  5939. | 名称 | 类型 | 参数 | 说明 |
  5940. | -------- | ------------------------------------------------------------------- | ---- | -------------------- |
  5941. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | 传入时渲染提示内容。 |
  5942. ================================================
  5943. FILE: docs/mds/components/toast/api_en.md
  5944. ================================================
  5945. ## Toast Props
  5946. | Name | Type | Default | Required | Description | |
  5947. | ---------------- | ---------------------------------------------------------------- | ---------- | -------- | ---------------------------------------------------------------------------------- | :-- |
  5948. | message | `string` | `''` | N | Toast content. |
  5949. | visible | `boolean` | `false` | N | Whether to show the toast. |
  5950. | duration | `number` | `2000` | N | Display duration in ms. Toast won't auto-close if set to 0. |
  5951. | position | `'center'\|'top'\|'bottom'` | `'center'` | N | Display position. |
  5952. | py | `'0'\|'10'\|'20'\|'40'\|'60'\|'80'` | `'20'` | N | Distance from top/bottom when position is 'top'/'bottom'. Ignored for 'center'. |
  5953. | radius | `'none'\|'xs'\|'sm'\|'md'\|'lg'\|'xl'\|'2xl'\|'full'` | `'sm'` | N | Border radius style. |
  5954. | transitionType | `'scale'\|'fly'\|'fade'\|'slide'\|'blur'\|null` | `'scale'` | N | Animation type. |
  5955. | transitionParams | [`Transition`](https://svelte.dev/docs/svelte/svelte-transition) | `{}` | N | Animation parameters, default duration is 300. |
  5956. | outDuration | `number` | `0` | N | Exit animation duration in ms. |
  5957. | type | `'success'\|'error'\|'warning'\|'info'\|'loading'\|'icon'\|null` | `null` | N | Toast icon type. |
  5958. | mask | [`Mask`](https://stdf.design/components?nav=mask&tab=1) | `{}` | N | Mask layer parameters. |
  5959. | loading | [`Loading`](https://stdf.design/components?nav=loading&tab=1) | `{}` | N | Loading component parameters, only works when type is `'loading'`. |
  5960. | icon | [`Icon`](https://stdf.design/components?nav=icon&tab=1) | `{}` | N | Icon component parameters, only works when type is not `'loading'` and not `null`. |
  5961. | zIndex | `number` | `1000` | N | z-index value. |
  5962. | clickable | `boolean` | `false` | N | Whether to allow click through. |
  5963. | dynamicFixed | `boolean` | `true` | N | Whether to use dynamic fixed positioning. |
  5964. ## Toast Events
  5965. | Name | Type | Parameters | Description |
  5966. | ------- | ------------ | ---------- | ----------------------------------- |
  5967. | onclose | `() => void` | - | Triggered when the toast is closed. |
  5968. ## Toast Snippets
  5969. | Name | Type | Parameters | Description |
  5970. | -------- | ------------------------------------------------------------------- | ---------- | ---------------------------------- |
  5971. | children | [`Snippet`](https://svelte.dev/docs/svelte/snippet#Typing-snippets) | - | Renders toast content when passed. |
  5972. ================================================
  5973. FILE: docs/mds/components/toast/FAQ.md
  5974. ================================================
  5975. ================================================
  5976. FILE: docs/mds/components/toast/FAQ_en.md
  5977. ================================================
  5978. ================================================
  5979. FILE: docs/mds/components/toast/guide.md
  5980. ================================================
  5981. > Toast 使用了图标 ri-checkbox-circle-line、ri-close-circle-line、ri-error-warning-line、ri-information-line,请确保项目的 symbol.svg 文件中包含这些图标。详细信息请参考 [STDF-指南 - 图标](https://stdf.design/guide/icon)。
  5982. ## 显示位置
  5983. 提示默认显示在屏幕中央,也可以通过 `position` 属性设置显示位置,当 position 为 `top` 或 `bottom` 时,可以通过 `py` 属性设置距离顶部或底部的距离。
  5984. ## 动画
  5985. 提示默认使用 `scale` 动画,也可以通过 `transitionType` 属性设置其他动画类型,通过 `transitionParams` 属性设置动画参数,其中 `duration` 表示进入的动画时间。
  5986. transitionParams 具体支持的参数请参考 [svelte/transition](https://svelte.dev/docs#run-time-svelte-transition)。
  5987. 考虑到用户体验,提示信息出现时有一个较短的动画(默认 300ms),能引起用户的注意力;而提示信息展示完后一般需要迅速关闭,所以退出动画默认为 0ms,当然也可以通过 `outDuration` 属性设置退出的动画时间。
  5988. 退出动画只允许设置动画时长,其他参数会沿用进入动画的参数,保证动画效果「从哪里来回哪里去」。
  5989. ## 显示时长
  5990. 显示时长默认为 2000ms,可以通过 `duration` 属性设置显示时长。当 `duration` 为 0 时,提示不会自动关闭。
  5991. 注意:由于出现有动画时长(默认 300ms 或自定义其他值),所以 `duration` 不能低于出现的动画时长,否则提示信息还没完全出现就被关闭了 😭。
  5992. ## type
  5993. Toast 内部通过 `type` 属性为 `'success'|'error'|'warning'|'info'` 四种情况设置了对应的图标,图标颜色跟随[颜色系统](https://stdf.design/guide/color)中的功能色,也可以传入 `'loading'` 和 `'icon'` 配合 loading 与 icon 自定义对应的显示内容,传 `null` 不显示。请参考示例。
  5994. ## Snippet
  5995. 默认情况下,Toast 内部可以通过 `children` 属性传入任意内容作为提示信息。
  5996. ## 优化
  5997. 由于移动端的 Safari、Chrome 或其他一些浏览器滚动页面时会动态显示工具栏或地址栏(多此一举),导致页面的高度也会动态变化,Toast 针对这一情况也做了优化。当 dynamicFixed 为 true 时滚动页面时会动态地更新页面高度,相对应地 Toast 内部元素相对于页面的位置也会动态更新。
  5998. 当然,这个滚动监听会有微弱的性能损失,如果你的项目中不需要此功能(比如在可控的 webview 内使用),可以设置 dynamicFixed 为 false 来关闭。
  5999. ================================================
  6000. FILE: docs/mds/components/toast/guide_en.md
  6001. ================================================
  6002. > Toast uses icons ri-checkbox-circle-line, ri-close-circle-line, ri-error-warning-line, ri-information-line. Please ensure these icons are included in your project's symbol.svg file. For details, please refer to [STDF-Guide-Icon](https://stdf.design/guide/icon).
  6003. ## Display Position
  6004. By default, the toast appears in the center of the screen. You can also set its position using the `position` prop. When position is set to `top` or `bottom`, you can use the `py` prop to set the distance from the top or bottom.
  6005. ## Animation
  6006. Toast uses `scale` animation by default. You can set other animation types through the `transitionType` prop and configure animation parameters via `transitionParams`, where `duration` represents the entry animation time.
  6007. For detailed supported parameters of transitionParams, please refer to [svelte/transition](https://svelte.dev/docs#run-time-svelte-transition).
  6008. For better user experience, the toast appears with a short animation (default 300ms) to catch user attention. Since toast messages generally need to close quickly after display, the exit animation is 0ms by default. However, you can set the exit animation duration using the `outDuration` prop.
  6009. The exit animation only allows setting the duration, while other parameters inherit from the entry animation to ensure the animation effect "returns where it came from".
  6010. ## Display Duration
  6011. The default display duration is 2000ms, which can be customized using the `duration` prop. When `duration` is 0, the toast won't close automatically.
  6012. Note: Since there is an entry animation duration (default 300ms or custom value), `duration` cannot be less than the entry animation duration, otherwise the toast would close before fully appearing 😭.
  6013. ## type
  6014. Toast internally sets corresponding icons for four types: `'success'|'error'|'warning'|'info'` through the `type` prop, and the icon color follows the functional color in the [Color System](https://stdf.design/guide/color). You can also pass `'loading'` and `'icon'` to customize display content with loading and icon components, or pass `null` to display no icon. Please refer to examples.
  6015. ## Snippet
  6016. By default, Toast can accept any content as the prompt message through the `children` prop.
  6017. ## Optimization
  6018. Since mobile Safari, Chrome, and some other browsers dynamically show/hide toolbars or address bars when scrolling (unnecessarily), causing page height to change dynamically, Toast has been optimized for this situation. When dynamicFixed is true, the page height updates dynamically while scrolling, and correspondingly, Toast's internal elements' positions relative to the page update dynamically.
  6019. Of course, this scroll monitoring causes slight performance overhead. If your project doesn't need this feature (e.g., when used in a controlled webview), you can disable it by setting dynamicFixed to false.
  6020. ================================================
  6021. FILE: docs/mds/components/toast/version.md
  6022. ================================================
  6023. ================================================
  6024. FILE: docs/mds/components/toast/version_en.md
  6025. ================================================
  6026. ================================================
  6027. FILE: docs/mds/guide/about.md
  6028. ================================================
  6029. ## STDF 名称
  6030. 常规解释:S 代表 Simple(简单),T 代表 Tiny(轻量),D 代表 Design(设计),F 代表 Fast(快速),STDF 代表一个使用简单、体积轻量、设计友好、开发快速的组件库。
  6031. 非常规解释:S 和 T 分别代表 Svelte 和 Tailwind,因为 STDF 是基于 Svelte 和 Tailwind 的。DF 可以看成诗人杜甫,不像李白那么浪漫飘逸,他注重的是实用性与易用性,这也是 STDF 的设计理念。希望每一位使用 STDF 的开发者都能写出诗一般的代码。
  6032. ## 为什么要做这个库
  6033. 首先最重要的是补充 Svelte 生态。
  6034. 关于 UI 组件库,PC 端有很多优秀的产品,但是移动端并没有能与 PC 端比肩的产品,这是由于移动端的特殊性导致的。移动端产品大多数是 To C 业务,这就要求对组件库的灵活性有更高的要求。在设计组件 API 的时候,需要有更多的参数支持可供配置,但又不能设计得太过复杂。而在 UI 设计方面,不能有太多的个性化设计,这样才能达到组件的复用性。
  6035. 市面上也有很多移动端的组件库,但是使用下来还是有很多痛点,比如一些组件库的设计风格太过个性化,导致组件的复用性不高;一些组件库的可配置 API 太少,无法通过简单的 API 配置出符合业务需求的组件;一些组件库的文档太过高深或简陋,使初上手的人很难理解组件的使用方法;一些组件库的文档和 Demo 中英混杂,难以查阅;一些组件库的 Demo 太少或太简陋,高频使用时无法直接复制使用,降低开发效率等。
  6036. 在体验过 Svelte 和 Tailwind 之后,发现使用它们开发真的是非常舒服,所以就想着能不能把它们结合起来,做一个移动端的 UI 组件库。这样的话,就能够在移动端也享受到 Svelte 和 Tailwind 带来的开发体验了。
  6037. ## 适用场景
  6038. 在移动端有一种业务场景,应用不算复杂,使用 Vue 或者 React 开发其实会显得「大材小用」了,可能整个应用打包之后的 JS 体积也就几十 KB,但是使用 Vue 或者 React 开发,这两个库的基础大小就超过了几十 KB,这样就得不偿失了,而且移动端 To C 应用体积过大是非常不可取的。但是使用纯原生 JS 开发,又会显得开发效率低下,这个时候 Svelte 就是一个很好的选择,它的简洁语法,使原生 JS 代码有了响应式能力。
  6039. ================================================
  6040. FILE: docs/mds/guide/about_en.md
  6041. ================================================
  6042. ## STDF Name
  6043. Generally speaking, S stands for Simple, T stands for Tiny, D stands for Design, and F stands for Fast. So, STDF is a simple, lightweight, design-friendly, and fast UI component library.
  6044. Unconventional explanation: S and T stand for Svelte and Tailwind respectively, because STDF is based on Svelte and Tailwind. DF can be seen as the poet Du Fu, who is not as romantic and elegant as Li Bai. He pays attention to practicality and ease of use, which is also the design concept of STDF. I hope that every developer who uses STDF can write code like a poem.
  6045. ## Why Create This Library
  6046. First and foremost, it's to complement the Svelte ecosystem.
  6047. Regarding UI component libraries, there are many excellent products for PC, but there aren't many on the mobile side that can match the PC level. This is due to the unique characteristics of the mobile side. Most mobile products are To C businesses, which require higher flexibility in component libraries. When designing component APIs, more parameter support for configuration is required, but it cannot be designed to be too complex. In terms of UI design, there should not be too many personalized designs so that component reuse can be achieved.
  6048. There are also many mobile component libraries on the market, but there are still many pain points in use. For example, some component library design styles are too personalized, resulting in low component reuse. Some component libraries have too few configurable APIs and cannot configure components that meet business requirements through a simple API. Some component library documentation is either too advanced or too rudimentary, making it difficult for beginners to understand how to use the components. Some component library documentation and demo are mixed with Chinese and English, making it difficult to browse. Some component library demos are too few or too simple, making it difficult to directly copy and use when used frequently, which reduces development efficiency, and so on.
  6049. After experiencing Svelte and Tailwind, I found that developing with them is really comfortable, so I thought about combining them to create a mobile UI component library. In this way, we can enjoy the development experience brought by Svelte and Tailwind on the mobile side too.
  6050. ## Applicable Scenarios
  6051. There is a mobile business scenario where the application is not too complex, and developing with Vue or React may appear to be "overkill." The entire application package JS size may only be a few tens of KB, but using Vue or React would result in the base sizes of these two libraries exceeding tens of KB, which would be too costly. Additionally, it is not desirable to have a large volume of To C applications on mobile platforms. However, developing with pure native JS would appear to be inefficient. In such cases, Svelte is a good choice. Its concise syntax gives native JS code responsive capabilities.
  6052. ================================================
  6053. FILE: docs/mds/guide/changelog.md
  6054. ================================================
  6055. ## 1.0.8 <font size=1>2025-05-04</font>
  6056. - 修复 Grids 组件,详见 [Grids](https://stdf.design/components?nav=grids&tab=4)。
  6057. ## 1.0.7 <font size=1>2025-04-30</font>
  6058. - 修复部分类型错误。
  6059. - 修复 `id_ID` 语言文件错误。
  6060. ## 1.0.6 <font size=1>2025-04-27</font>
  6061. - 修复 Input 组件,详见 [Input](https://stdf.design/components?nav=input&tab=4)。
  6062. ## 1.0.5 <font size=1>2025-04-27</font>
  6063. - 修复 Input 组件,详见 [Input](https://stdf.design/components?nav=input&tab=4)。
  6064. ## 1.0.4 <font size=1>2025-04-26</font>
  6065. - 增强 Input 组件,详见 [Input](https://stdf.design/components?nav=input&tab=4)。
  6066. - 增强 Button 组件,详见 [Button](https://stdf.design/components?nav=button&tab=4)。
  6067. - 补充遗漏的语言文件。
  6068. - 修复类型导出错误。
  6069. ## 1.0.3 <font size=1>2025-04-07</font>
  6070. - 完整支持 Svelte v5、Tailwind CSS v4 与 TypeScript,包括库、示例、create-stdf、站点。
  6071. - 按照 Svelte 官方 CLI [sv create](https://svelte.dev/docs/cli/sv-create) 重构库文件。
  6072. - 增强 NavBar 组件,详见 [NavBar](https://stdf.design/components?nav=navBar&tab=4)。
  6073. - 修复 Cell 组件,详见 [Cell](https://stdf.design/components?nav=cell&tab=4)。
  6074. - 增强 NumKeyboard 组件,详见 [NumKeyboard](https://stdf.design/components?nav=numKeyboard&tab=4)。
  6075. - 重写 Checkbox、Radio 等组件,修改部分组件 API,升级时请注意检查。
  6076. - 文档组件 API 增加类型。
  6077. - 跟随 Tailwind CSS v4,文档站点、主题生成器、组件库等颜色系统统一使用 oklch,参考 [Tailwind CSS](https://tailwindcss.com/docs/colors)。
  6078. ## 1.0.0 <font size=1>2025-04-07</font>
  6079. - 升级至 1.x 版本,重构项目结构。
  6080. ================================================
  6081. FILE: docs/mds/guide/changelog_en.md
  6082. ================================================
  6083. ## 1.0.8 <font size=1>2025-05-04</font>
  6084. - Fixed Grids component, please see [Grids](https://stdf.design/components?nav=grids&tab=4).
  6085. ## 1.0.7 <font size=1>2025-04-30</font>
  6086. - Fixed some type errors.
  6087. - Fixed `id_ID` language file error.
  6088. ## 1.0.6 <font size=1>2025-04-27</font>
  6089. - Fixed Input component, please see [Input](https://stdf.design/components?nav=input&tab=4).
  6090. ## 1.0.5 <font size=1>2025-04-27</font>
  6091. - Fixed Input component, please see [Input](https://stdf.design/components?nav=input&tab=4).
  6092. ## 1.0.4 <font size=1>2025-04-26</font>
  6093. - Enhanced Input component, please see [Input](https://stdf.design/components?nav=input&tab=4).
  6094. - Enhanced Button component, please see [Button](https://stdf.design/components?nav=button&tab=4).
  6095. - Added missing language files.
  6096. - Fixed type export error.
  6097. ## 1.0.3 <font size=1>2025-04-07</font>
  6098. - Full support for Svelte v5, Tailwind CSS v4, and TypeScript, including libraries, demos, create-stdf, and site.
  6099. - Rebuilt the library according to Svelte official CLI [sv create](https://svelte.dev/docs/cli/sv-create).
  6100. - Enhanced NavBar component, please see [NavBar](https://stdf.design/components?nav=navBar&tab=4).
  6101. - Fixed Cell component, please see [Cell](https://stdf.design/components?nav=cell&tab=4).
  6102. - Enhanced NumKeyboard component, please see [NumKeyboard](https://stdf.design/components?nav=numKeyboard&tab=4).
  6103. - Rewrote Checkbox, Radio, etc. components, modified some component APIs, please check when upgrading.
  6104. - Document component API added type.
  6105. - Follow Tailwind CSS v4, the color system of document site, theme generator, component library, etc. uses oklch, reference [Tailwind CSS](https://tailwindcss.com/docs/colors).
  6106. ## 1.0.0 <font size=1>2025-04-07</font>
  6107. - Upgrade to 1.x version, refactor project structure.
  6108. ================================================
  6109. FILE: docs/mds/guide/compatibility.md
  6110. ================================================
  6111. > STDF v1.x 基于 Svelte v5 与 Tailwind CSS v4。
  6112. ## Svelte
  6113. 市面上能看到的浏览器版本基本都已经支持了 Svelte v5,旧版的 IE 浏览器需要 Polyfills,不过移动端没有 IE,况且微软也已经放弃了 IE,所以这里不做讨论。
  6114. ## Tailwind CSS
  6115. 参考 [Browser Support](https://tailwindcss.com/docs/browser-support),STDF 组件库内已有样式都支持现代浏览器。有问题请参考 [Can I Use](https://caniuse.com)。
  6116. ## 特殊情况
  6117. - Loading 与 Swiper 组件内为优化性能实现懒轮播和懒动画,使用了 [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API),如果需要此功能,请确保浏览器支持 IntersectionObserver。此处查看 [Can I Use](https://caniuse.com/intersectionobserver)。
  6118. ================================================
  6119. FILE: docs/mds/guide/compatibility_en.md
  6120. ================================================
  6121. > STDF v1.x based on Svelte v5 and Tailwind CSS v4.
  6122. ## Svelte
  6123. Most modern browsers on the market already support Svelte v5. Old versions of Internet Explorer may require polyfills, but since mobile devices generally do not use IE and Microsoft has also abandoned IE, we won't discuss it here.
  6124. ## Tailwind CSS
  6125. According to [Browser Support](https://tailwindcss.com/docs/browser-support), the styles within the STDF component library already support modern browsers. If you encounter any issues, please refer to [Can I Use](https://caniuse.com).
  6126. ## Special Considerations
  6127. - The loading and swiper components implement lazy animation and lazy carousel for performance optimization using [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). If you need this feature, please make sure your browser supports IntersectionObserver. You can check compatibility at [Can I Use](https://caniuse.com/intersectionobserver).
  6128. ================================================
  6129. FILE: docs/mds/guide/contribution.md
  6130. ================================================
  6131. ## 介绍
  6132. 感谢你使用 STDF。
  6133. 以下是关于向 STDF 提交反馈或代码的指南。在向 STDF 提交 issue 或者 PR 之前,请先花几分钟时间阅读以下内容。
  6134. ## Issue 规范
  6135. - 遇到问题时,请先确认这个问题是否已经在 issue 中有记录或者已被修复。
  6136. - 提 issue 时,请用简短的语言描述遇到的问题,并添加出现问题时的环境和复现步骤。
  6137. ## 本地开发
  6138. 在进行本地开发前,请先确保你的开发环境中安装了 [Git](https://git-scm.com) 与 [Node.js](https://nodejs.org/zh-cn) 或 [Bun](https://bun.sh) 。
  6139. 调试 STDF 必须要有个工程环境,为此提供了一个简单的 Demo 工程。STDF 本身不受 Node 版本限制,Demo 使用 Vite 开发,所以请确保你的 Node.js 版本 >= 14.18+,参考 [Vite 官网](https://cn.vitejs.dev/guide/#scaffolding-your-first-vite-project)。
  6140. 当你修改完成代码之后,提交 PR 之前请确保对代码进行了格式化并通过代码格式检查,可安装相关编辑器插件或通过命令行进行格式化。
  6141. 推荐安装:
  6142. - [pnpm](https://pnpm.io/zh):包管理工具,使用 Bun 无需安装。
  6143. - [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) 或者 [Svelte](https://plugins.jetbrains.com/plugin/12375-svelte):Svelte 开发插件。
  6144. - [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/tailwind-css.html):Tailwind CSS 开发插件。
  6145. - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/eslint.html):代码格式检查插件。
  6146. - [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 或者 [WebStorm 集成](https://www.jetbrains.com/help/webstorm/prettier.html):代码格式化插件。
  6147. 按照下面的步骤操作,即可在本地快速启动 STDF Demo。
  6148. > 由于 Demo 依赖的 rollup-plugin-stdf-icon 包是本地构建的,所以请先构建一下这个包。
  6149. <!-- :::code-groups -->
  6150. <!-- pnpm -->
  6151. ```sh
  6152. ## 1. 克隆 STDF 仓库并进入
  6153. git clone git@github.com:any-tdf/stdf.git
  6154. cd stdf
  6155. ## 2. 构建 rollup-plugin-stdf-icon 包
  6156. cd packages/rollup-plugin-stdf-icon
  6157. ## 安装依赖
  6158. pnpm i
  6159. ## 构建包
  6160. pnpm build
  6161. ## 3. 调试 STDF
  6162. cd packages/stdf
  6163. ## 安装依赖
  6164. pnpm i
  6165. ## 启动 Demo
  6166. pnpm dev
  6167. ```
  6168. <!-- :: -->
  6169. <!-- npm -->
  6170. ```sh
  6171. ## 1. 克隆 STDF 仓库并进入
  6172. git clone git@github.com:any-tdf/stdf.git
  6173. cd stdf
  6174. ## 2. 构建 rollup-plugin-stdf-icon 包
  6175. cd packages/rollup-plugin-stdf-icon
  6176. ## 安装依赖
  6177. npm i
  6178. ## 构建包
  6179. npm run build
  6180. ## 3. 调试 STDF
  6181. cd packages/stdf
  6182. ## 安装依赖
  6183. npm i
  6184. ## 启动 Demo
  6185. npm run dev
  6186. ```
  6187. <!-- :: -->
  6188. <!-- bun -->
  6189. ```sh
  6190. ## 1. 克隆 STDF 仓库并进入
  6191. git clone git@github.com:any-tdf/stdf.git
  6192. cd stdf
  6193. ## 2. 构建 rollup-plugin-stdf-icon 包
  6194. cd packages/rollup-plugin-stdf-icon
  6195. ## 安装依赖
  6196. bun i
  6197. ## 构建包
  6198. bun run build
  6199. ## 3. 调试 STDF
  6200. cd packages/stdf
  6201. ## 安装依赖
  6202. bun i
  6203. ## 启动 Demo
  6204. bun dev
  6205. ```
  6206. <!-- :: -->
  6207. <!-- yarn -->
  6208. ```sh
  6209. ## 1. 克隆 STDF 仓库并进入
  6210. git clone git@github.com:any-tdf/stdf.git
  6211. cd stdf
  6212. ## 2. 构建 rollup-plugin-stdf-icon 包
  6213. cd packages/rollup-plugin-stdf-icon
  6214. ## 安装依赖
  6215. yarn
  6216. ## 构建包
  6217. yarn build
  6218. ## 3. 调试 STDF
  6219. cd packages/stdf
  6220. ## 安装依赖
  6221. yarn
  6222. ## 启动 Demo
  6223. yarn dev
  6224. ```
  6225. <!-- ::: -->
  6226. 启动成功之后,可在浏览器中打开 `http://localhost:8888` 查看效果,请将浏览器的开发者工具切换为移动端模式。
  6227. 可对 `packages/stdf/src/lib/components` 目录下组件源码进行修改并实时查看修改效果。注意,VS Code 与 WebStorm 都支持在调用组件时直接跳转到组件源码。
  6228. 如果不想本地开发,可以选择使用 StackBlitz 在线简单调试。直接打开 [STDF Demo](https://stackblitz.com/github/any-tdf/demo-stdf) 即可开始在线调试。
  6229. ## 提交 PR
  6230. 如果你是第一次在 GitHub 上提 Pull Request,可以阅读下面这两篇文章来学习:
  6231. - [第一次参与开源](https://github.com/firstcontributions/first-contributions/blob/main/translations/README.zh-cn.md)
  6232. - [如何优雅地在 GitHub 上贡献代码](https://segmentfault.com/a/1190000000736629)
  6233. ### 流程
  6234. - 请先 fork 一份 [STDF](https://github.com/any-tdf/stdf) 代码到自己的仓库,如果已经 fork 过,请同步主仓库的最新代码。
  6235. - 克隆你的仓库至本地。
  6236. - 修改组件源码并验证通过。
  6237. - 「可选」补充此次修改的中英文档中,文档位于 `docs/mds/components` 目录下。根据具体修改内容可能需要修改 api、FAQ、guide、version 等文档。对 version 的修改请增加 tag,具体参考 [STDF Version tag](https://github.com/any-tdf/stdf/blob/main/docs/mds/components/button/version.md?plain=1)。
  6238. - 到仓库 `packages/stdf` 目录,执行 `pnpm i` 或 `npm i` 或 `bun i` 安装依赖。
  6239. - 提交修改内容至你的仓库,然后提 Pull Request 到主仓库。
  6240. - Pull Request 会在 Review 通过后被合并到主仓库,后续发布新版。
  6241. ### 注意事项
  6242. 在提交 Pull Request 时,请注意:
  6243. - 保持你的 PR 足够小,一般一个 PR 只解决单个组件文件,解决单个问题或添加单个功能,以便于 Review。
  6244. - 当新增组件或者修改原有组件时,记得在 Demo 中验证通过,保证代码的稳定。
  6245. - 在 PR 中请添加合适的描述,如果有关联 Issue,请注明一下。
  6246. ================================================
  6247. FILE: docs/mds/guide/contribution_en.md
  6248. ================================================
  6249. ## Introduction
  6250. Thank you for using STDF.
  6251. Below are guidelines for submitting feedback or code to STDF. Please take a few minutes to read through this content before submitting an issue or PR to STDF.
  6252. ## Issue Guidelines
  6253. - When encountering a problem, please first confirm whether this issue has already been recorded or fixed in existing issues.
  6254. - When submitting an issue, please use concise language to describe the problem encountered, and include the environment and steps to reproduce the issue.
  6255. ## Local Development
  6256. Before starting local development, please ensure your development environment has [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en) or [Bun](https://bun.sh) installed.
  6257. Debugging STDF requires a project environment, for which we provide a simple Demo project. STDF itself is not restricted by Node version, but since the Demo uses Vite for development, please ensure your Node.js version is >= 14.18+, refer to [Vite official website](https://vitejs.dev/guide/#scaffolding-your-first-vite-project).
  6258. After modifying the code and before submitting a PR, please ensure the code is formatted and passes code format checks. You can install relevant editor plugins or format through the command line.
  6259. Recommended installations:
  6260. - [pnpm](https://pnpm.io): Package management tool, not needed when using Bun.
  6261. - [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) or [Svelte](https://plugins.jetbrains.com/plugin/12375-svelte): Svelte development plugin.
  6262. - [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) or [WebStorm Integration](https://www.jetbrains.com/help/webstorm/tailwind-css.html): Tailwind CSS development plugin.
  6263. - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) or [WebStorm Integration](https://www.jetbrains.com/help/webstorm/eslint.html): Code format checking plugin.
  6264. - [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) or [WebStorm Integration](https://www.jetbrains.com/help/webstorm/prettier.html): Code formatting plugin.
  6265. Follow the steps below to quickly start STDF Demo locally.
  6266. > Because the rollup-plugin-stdf-icon package that the Demo depends on is built locally, please build this package first.
  6267. <!-- :::code-groups -->
  6268. <!-- pnpm -->
  6269. ```sh
  6270. ## 1. Clone the STDF repository
  6271. git clone git@github.com:any-tdf/stdf.git
  6272. cd stdf
  6273. ## 2. Build the rollup-plugin-stdf-icon package
  6274. cd packages/rollup-plugin-stdf-icon
  6275. ## Install dependencies
  6276. pnpm i
  6277. ## Build package
  6278. pnpm build
  6279. ## 3. Debug STDF
  6280. cd packages/stdf
  6281. ## Install dependencies
  6282. pnpm i
  6283. ## Start Demo
  6284. pnpm dev
  6285. ```
  6286. <!-- :: -->
  6287. <!-- npm -->
  6288. ```sh
  6289. ## 1. Clone the STDF repository
  6290. git clone git@github.com:any-tdf/stdf.git
  6291. cd stdf
  6292. ## 2. Build the rollup-plugin-stdf-icon package
  6293. cd packages/rollup-plugin-stdf-icon
  6294. ## Install dependencies
  6295. npm i
  6296. ## Build package
  6297. npm run build
  6298. ## 3. Debug STDF
  6299. cd packages/stdf
  6300. ## Install dependencies
  6301. npm i
  6302. ## Start Demo
  6303. npm run dev
  6304. ```
  6305. <!-- :: -->
  6306. <!-- bun -->
  6307. ```sh
  6308. ## 1. Clone the STDF repository
  6309. git clone git@github.com:any-tdf/stdf.git
  6310. cd stdf
  6311. ## 2. Build the rollup-plugin-stdf-icon package
  6312. cd packages/rollup-plugin-stdf-icon
  6313. ## Install dependencies
  6314. bun i
  6315. ## Build package
  6316. bun run build
  6317. ## 3. Debug STDF
  6318. cd packages/stdf
  6319. ## Install dependencies
  6320. bun i
  6321. ## Start Demo
  6322. bun dev
  6323. ```
  6324. <!-- :: -->
  6325. <!-- yarn -->
  6326. ```sh
  6327. ## 1. Clone the STDF repository
  6328. git clone git@github.com:any-tdf/stdf.git
  6329. cd stdf
  6330. ## 2. Build the rollup-plugin-stdf-icon package
  6331. cd packages/rollup-plugin-stdf-icon
  6332. ## Install dependencies
  6333. yarn
  6334. ## Build package
  6335. yarn build
  6336. ## 3. Debug STDF
  6337. cd packages/stdf
  6338. ## Install dependencies
  6339. yarn
  6340. ## Start Demo
  6341. yarn dev
  6342. ```
  6343. <!-- ::: -->
  6344. After starting successfully, you can view the effect in the browser by opening `http://localhost:8888`, please switch the developer tools of the browser to the mobile mode.
  6345. You can modify the component source code in the `packages/stdf/src/lib/components` directory and view the modification effect in real time. Note that VS Code and WebStorm both support jumping to the component source code when calling the component.
  6346. If you don't want to develop locally, you can choose to use StackBlitz for online simple debugging. Simply open [STDF Demo](https://stackblitz.com/github/any-tdf/demo-stdf) to start online debugging.
  6347. ## Submit PR
  6348. If you are submitting your first Pull Request on GitHub, you can read the following two articles to learn:
  6349. - [First Contribution to Open Source](https://github.com/firstcontributions/first-contributions/blob/main/translations/README.zh-cn.md)
  6350. - [如何优雅地在 GitHub 上贡献代码](https://segmentfault.com/a/1190000000736629)
  6351. ### Process
  6352. - Please first fork a [STDF](https://github.com/any-tdf/stdf) repository to your own repository, if you have already forked it, please sync the latest code from the main repository.
  6353. - Clone your repository to your local machine.
  6354. - Modify the component source code and verify it.
  6355. - (Optional) Supplement the Chinese and English documentation of this modification, the documentation is located in the `docs/mds/components` directory. Depending on the specific modification content, you may need to modify the api, FAQ, guide, version, etc. documents. For the modification of the version, please add the tag, refer to [STDF Version tag](https://github.com/any-tdf/stdf/blob/main/docs/mds/components/button/version.md?plain=1).
  6356. - Go to the `packages/stdf` directory, execute `pnpm i` or `npm i` or `bun i` to install dependencies.
  6357. - Submit the modified content to your repository, then submit a Pull Request to the main repository.
  6358. - Pull Request will be merged into the main repository after being reviewed, and a new version will be released.
  6359. ### Notes
  6360. When submitting a Pull Request, please note the following:
  6361. - Keep your PR small, generally one PR solves a single component file, solves a single problem, or adds a single function, so that it is easier to review.
  6362. - When adding a new component or modifying an existing component, remember to verify it in the Demo to ensure the stability of the code.
  6363. - Please add a suitable description in the PR, if there is an associated Issue, please note it.
  6364. ================================================
  6365. FILE: docs/mds/guide/faq.md
  6366. ================================================
  6367. ## 问:为什么没有栅格组件?
  6368. 答:直接使用 CSS 的 Flexbox 特性,已经可以很方便快速地实现栅格布局,不再需要为了实现栅格布局而引入额外的组件,而且使用 Tailwind CSS 书写会非常简洁。
  6369. ## 问:部分组件的 Props 需要传入 String 类型,但传入 Number 类型也完全正常使用?
  6370. 答:由于组件内部这些 Props 作为 Object 的 key,严格来说应该传入 String 类型,若传入数字也会被转为 String,所以传入 Number 或者 String 类型都是可以的,开启类型检查的时候会有类型报错。虽然可以正常使用,但还是建议传入规定的类型。
  6371. ================================================
  6372. FILE: docs/mds/guide/faq_en.md
  6373. ================================================
  6374. ## Q: Why isn't there a rasterization component?
  6375. A: Using CSS Flexbox directly can easily and quickly achieve rasterization layout. There is no need to introduce additional components to achieve rasterization layout. Moreover, using Tailwind CSS to write will be very concise.
  6376. ## Q: Some components require props to be of type string, but passing number types is completely normal?
  6377. A: Because these Props inside the component are used as keys of an Object, strictly speaking, they should be passed in as String type. If a number is passed in, it will also be converted to String. Therefore, passing in Number or String types are both acceptable. When type checking is enabled, there will be a type error. Although it can still function normally, it is recommended to pass in the specified types.
  6378. ================================================
  6379. FILE: docs/mds/guide/future.md
  6380. ================================================
  6381. ## 新增 💪
  6382. - [x] 按照 Tailwind CSS 变量规则,实现自定义主题色。
  6383. - [ ] 新增 SecurityCode-安全码组件,一般用于输入短信或邮件收到的数字校验码。
  6384. - [x] 开发一款 Vite/Rollup 插件,支持将指定目录下的所有 svg 合并为 SVG symbol。
  6385. - [x] 开发一款 VS Code 插件,支持光标悬浮显示 STDF 组件 API 等功能。
  6386. - [x] 开发一款模板脚手架,支持按照配置初始使用 STDF 的工程,初步考虑支持 Vite、SvelteKit。
  6387. - [x] 新增 NumKeyboard-数字键盘组件,一般用于输入数字。
  6388. - [x] 新增 Pagination-分页组件。
  6389. - [x] 新增 Stepper-步进器组件。
  6390. - [x] 完整支持 Svelte 5。
  6391. - [x] 完整支持 TypeScript。
  6392. - [x] 适配 Tailwind CSS v4。
  6393. - [ ] 主题配置支持圆角、间距、字体等。
  6394. ---
  6395. ## 优化 👏
  6396. - [ ] Skeleton 骨架屏组件增加更多的动画效果。
  6397. ---
  6398. ## 持续 💧
  6399. - 丰富 Loading 加载组件类型。
  6400. - 完成 Figma 设计稿,并按照 Figma 的 Variable 规则实现与组件 API 的连通。
  6401. - 根据基础组件,组合一系列业务场景组件。
  6402. ================================================
  6403. FILE: docs/mds/guide/future_en.md
  6404. ================================================
  6405. ## New Features 💪
  6406. - [x] Implement custom theme colors according to Tailwind CSS variable rules.
  6407. - [ ] Add SecurityCode component, which is generally used for entering numeric verification codes received via SMS or email.
  6408. - [x] Develop a Vite/Rollup plugin that supports merging all SVGs in a specified directory into an SVG symbol.
  6409. - [x] Develop a VS Code plugin that supports displaying STDF component API and other functions when hovering over the cursor.
  6410. - [x] Develop a template scaffold that supports initializing STDF projects according to configuration. Initial support for Vite and SvelteKit.
  6411. - [x] Add NumKeyboard component, which is generally used for entering numbers.
  6412. - [x] Added Pagination component.
  6413. - [x] Added Stepper component.
  6414. - [x] Complete support for Svelte 5.
  6415. - [x] Complete support for TypeScript.
  6416. - [x] Adapt to Tailwind CSS v4.
  6417. - [ ] Theme configuration supports rounded corners, spacing, fonts, etc.
  6418. ---
  6419. ## Improvements 👏
  6420. - [ ] Increased the number of animation effects in the Skeleton screen component.
  6421. ---
  6422. ## Ongoing Development 💧
  6423. - Expand the types of Loading components available.
  6424. - Complete the Figma design draft and implement connectivity with component API according to Figma's Variable rules.
  6425. - Based on the basic components, combine a series of business scenario components.
  6426. ================================================
  6427. FILE: docs/mds/guide/icon.md
  6428. ================================================
  6429. ## 背景
  6430. STDF 使用 SVG Sprites 技术使用图标,这样可以减少 HTTP 请求,提高页面性能。
  6431. STDF 的 SVG Sprites 是使用 [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol),大致原理类似于 CSS 中的 Sprite 技术,将项目中的 SVG 拼接在一个文件内,通过 SVG 中的 use 元素找到对应的图标来显示。
  6432. 你可以把它类比看成是一种字体,只不过这种字体是由 SVG 组成的,而且可以通过 CSS 控制颜色、大小等属性。所以如果用到比较大或者有多种颜色等比较复杂的图标,建议单独引入 SVG 文件使用,不要放在 symbol 中。
  6433. 兼容性方面也完全没问题。参考 [MDN symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol#browser_compatibility)。
  6434. ## rollup-plugin-stdf-icon
  6435. STDF 已经开发了一个 Rollup/Vite 插件,用于将项目中的 SVG 文件合并成 SVG Sprites,具体使用请参考 [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon),由于 svg 格式的多样性,可能存在 rollup-plugin-stdf-icon 处理不准确的情况,请到 [GitHub](https://github.com/any-tdf/stdf/issues) 提 issue,注明 svg 文件的具体情况。
  6436. 或使用其他 SVG Sprites 合成工具或手动合成,也可以请设计师提供设计物料时一并提供对应的 SVG Sprites。或类似 Remix Icon 这样的图标库,可以直接将选定的多个图标下载为 SVG Sprites。
  6437. ## 内置说明
  6438. STDF 部分组件内使用的图标源自 [Remix Icon 图标库](https://remixicon.com)([GitHub](https://github.com/Remix-Design/remixicon)),在此表示感谢 🙏🏻🙏🏻。
  6439. **如果使用这些组件,请确保项目的 symbol.svg 中包含了对应图标。**
  6440. 具体使用如下:
  6441. | 图标名称 | 所属组件 |
  6442. | ----------------------------- | ---------------- |
  6443. | ri-user-3-line | Avatar |
  6444. | ri-user-add-line | Avatars |
  6445. | ri-arrow-right-s-line | Cell / NoticeBar |
  6446. | ri-checkbox-fill | Checkbox |
  6447. | ri-checkbox-line | Checkbox |
  6448. | ri-close-circle-fill | Input |
  6449. | ri-arrow-left-s-line | NavBar |
  6450. | ri-volume-down-line | NoticeBar |
  6451. | ri-close-line | NoticeBar |
  6452. | ri-delete-back-2-line | NumKeyboard |
  6453. | ri-skip-down-line | NumKeyboard |
  6454. | ri-more-line | Pagination |
  6455. | ri-more-fill | Pagination |
  6456. | ri-radio-button-line | Radio |
  6457. | ri-checkbox-blank-circle-line | Radio |
  6458. | ri-star-fill | Rate |
  6459. | ri-image-2-fill | Skeleton |
  6460. | ri-movie-2-fill | Skeleton |
  6461. | ri-code-box-fill | Skeleton |
  6462. | ri-qr-code-fill | Skeleton |
  6463. | ri-barcode-fill | Skeleton |
  6464. | ri-add-line | Stepper |
  6465. | ri-subtract-line | Stepper |
  6466. | ri-checkbox-circle-line | Toast |
  6467. | ri-close-circle-line | Toast |
  6468. | ri-error-warning-line | Toast |
  6469. | ri-information-line | Toast |
  6470. 可到 `node_modules/stdf/dist/assets/svg_base/` 查看这些图标的 SVG 源文件。
  6471. ================================================
  6472. FILE: docs/mds/guide/icon_en.md
  6473. ================================================
  6474. ## Background
  6475. STDF uses SVG Sprites technology for icons, which helps reduce HTTP requests and improve page performance.
  6476. STDF's SVG Sprites use [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol), which is similar to CSS Sprite technique. It combines SVG files in the project into a single file and uses the `<use>` element in SVG to display the corresponding icons.
  6477. You can think of it as a type of font, except that it is composed of SVG and can be styled using CSS properties such as color and size. Therefore, for larger or more complex icons with multiple colors, it is recommended to use individual SVG files instead of placing them in the symbol.
  6478. Compatibility is not an issue. Refer to [MDN symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol#browser_compatibility) for more information.
  6479. ## rollup-plugin-stdf-icon
  6480. STDF has developed a Rollup/Vite plugin called rollup-plugin-stdf-icon, which combines SVG files in the project into SVG Sprites. Please refer to [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon) for specific usage. Due to the diversity of SVG formats, there may be cases where rollup-plugin-stdf-icon does not handle them accurately. In such cases, please raise an issue on [GitHub](https://github.com/any-tdf/stdf/issues) and provide details about the SVG file.
  6481. Alternatively, you can use other SVG Sprites synthesis tools or manually combine them. You can also ask the designer to provide the corresponding SVG Sprites along with the design materials.Or, for icon libraries like Remix Icon, you can directly download a selection of multiple icons as SVG Sprites.
  6482. ## Built-in Icons
  6483. Some of the icons used in STDF components are sourced from [Remix Icon Library](https://remixicon.com) ([GitHub](https://github.com/Remix-Design/remixicon)). Many thanks to them! 🙏🏻🙏🏻
  6484. **If you are using these components, please make sure that the `symbol.svg` file in your project includes the corresponding icons.**
  6485. Here are the icons and their corresponding components:
  6486. | Icon Name | Component |
  6487. | ----------------------------- | ---------------- |
  6488. | ri-user-3-line | Avatar |
  6489. | ri-user-add-line | Avatars |
  6490. | ri-arrow-right-s-line | Cell / NoticeBar |
  6491. | ri-checkbox-fill | Checkbox |
  6492. | ri-checkbox-line | Checkbox |
  6493. | ri-close-circle-fill | Input |
  6494. | ri-arrow-left-s-line | NavBar |
  6495. | ri-volume-down-line | NoticeBar |
  6496. | ri-close-line | NoticeBar |
  6497. | ri-delete-back-2-line | NumKeyboard |
  6498. | ri-skip-down-line | NumKeyboard |
  6499. | ri-more-line | Pagination |
  6500. | ri-more-fill | Pagination |
  6501. | ri-radio-button-line | Radio |
  6502. | ri-checkbox-blank-circle-line | Radio |
  6503. | ri-star-fill | Rate |
  6504. | ri-image-2-fill | Skeleton |
  6505. | ri-movie-2-fill | Skeleton |
  6506. | ri-code-box-fill | Skeleton |
  6507. | ri-qr-code-fill | Skeleton |
  6508. | ri-barcode-fill | Skeleton |
  6509. | ri-add-line | Stepper |
  6510. | ri-subtract-line | Stepper |
  6511. | ri-checkbox-circle-line | Toast |
  6512. | ri-close-circle-line | Toast |
  6513. | ri-error-warning-line | Toast |
  6514. | ri-information-line | Toast |
  6515. You can find the SVG source files for these icons in `node_modules/stdf/dist/assets/svg_base/`.
  6516. ================================================
  6517. FILE: docs/mds/guide/internation.md
  6518. ================================================
  6519. ## 配置语言包
  6520. STDF 组件使用 Svelte 的 [Context](https://svelte.dev/docs/svelte/context) 实现国际化文案配置,默认配置是中文简体。一般在应用的入口如 `App.svelte` 或 `+layout.svelte` 中配置 Context,例如:
  6521. ```svelte
  6522. <!-- App.svelte/+layout.svelte -->
  6523. <script>
  6524. import { setContext } from 'svelte'; // 引入 setContext
  6525. import { en_US } from 'stdf/lang'; // 导入语言文件
  6526. setContext('STDF_lang', en_US); // 设置语言
  6527. </script>
  6528. ```
  6529. 此组件的所有子孙组件(包含了 STDF 组件)都可以通过 `getContext('STDF_lang')` 获取到当前语言配置。更加灵活的是,甚至可以在应用内的某部分配置另一种语言。
  6530. 注意 **Context 的切换不是响应式的**,一般应用中语言的切换也不需要实时响应。
  6531. 目前支持以下语言:
  6532. | 语言 | lang |
  6533. | -------------------- | ------ |
  6534. | 阿拉伯语 | ar_EG |
  6535. | 阿塞拜疆语 | az_AZ |
  6536. | 保加利亚语 | bg_BG |
  6537. | 孟加拉语(孟加拉国) | bn_BD |
  6538. | 加泰罗尼亚语 | ca_ES |
  6539. | 捷克语 | cs_CZ |
  6540. | 丹麦语 | da_DK |
  6541. | 德语 | de_DE |
  6542. | 希腊语 | el_GR |
  6543. | 英语 | en_GB |
  6544. | 英语(美式) | en_US |
  6545. | 西班牙语 | es_ES |
  6546. | 巴斯克语 | eu_ES |
  6547. | 爱沙尼亚语 | et_EE |
  6548. | 波斯语 | fa_IR |
  6549. | 芬兰语 | fi_FI |
  6550. | 法语(比利时) | fr_BE |
  6551. | 法语(加拿大) | fr_CA |
  6552. | 法语(法国) | fr_FR |
  6553. | 爱尔兰语 | ga_IE |
  6554. | 加利西亚语(西班牙) | gl_ES |
  6555. | 希伯来语 | he_IL |
  6556. | 印地语 | hi_IN |
  6557. | 克罗地亚语 | hr_HR |
  6558. | 匈牙利语 | hu_HU |
  6559. | 亚美尼亚 | hy_AM |
  6560. | 印度尼西亚语 | id_ID |
  6561. | 意大利语 | it_IT |
  6562. | 冰岛语 | is_IS |
  6563. | 日语 | ja_JP |
  6564. | 格鲁吉亚语 | ka_GE |
  6565. | 高棉语 | km_KH |
  6566. | 北库尔德语 | kmr_IQ |
  6567. | 卡纳达语 | kn_IN |
  6568. | 哈萨克语 | kk_KZ |
  6569. | 韩语/朝鲜语 | ko_KR |
  6570. | 立陶宛语 | lt_LT |
  6571. | 拉脱维亚语 | lv_LV |
  6572. | 马其顿语 | mk_MK |
  6573. | 马拉雅拉姆语 | ml_IN |
  6574. | 蒙古语 | mn_MN |
  6575. | 马来语 (马来西亚) | ms_MY |
  6576. | 挪威语 | nb_NO |
  6577. | 尼泊尔语 | ne_NP |
  6578. | 荷兰语(比利时) | nl_BE |
  6579. | 荷兰语 | nl_NL |
  6580. | 波兰语 | pl_PL |
  6581. | 葡萄牙语 (巴西) | pt_BR |
  6582. | 葡萄牙语 | pt_PT |
  6583. | 罗马尼亚语 | ro_RO |
  6584. | 俄罗斯语 | ru_RU |
  6585. | 僧伽罗语 | si_LK |
  6586. | 斯洛伐克语 | sk_SK |
  6587. | 塞尔维亚语 | sr_RS |
  6588. | 斯洛文尼亚语 | sl_SI |
  6589. | 瑞典语 | sv_SE |
  6590. | 泰米尔语 | ta_IN |
  6591. | 泰语 | th_TH |
  6592. | 土耳其语 | tr_TR |
  6593. | 土库曼 | tk_TK |
  6594. | 乌尔都语 (巴基斯坦) | ur_PK |
  6595. | 乌克兰语 | uk_UA |
  6596. | 越南语 | vi_VN |
  6597. | 简体中文 | zh_CN |
  6598. | 繁体中文(中国香港) | zh_HK |
  6599. | 繁体中文(中国台湾) | zh_TW |
  6600. > 多语言文件由机器翻译,如果有不准确的地方,请提交 PR 进行修正。
  6601. ## 增加语言包
  6602. 如果找不到你需要的语言包,欢迎你在 [中文语言包](https://github.com/any-tdf/stdf/blob/main/packages/stdf/src/lib/lang/zh_CN.ts) 或 [英文语言包](https://github.com/any-tdf/stdf/blob/main/packages/stdf/src/lib/lang/en_US.ts) 的基础上创建一个新的语言包,并发一个 Pull Request。[语言对照表](http://www.lingoes.net/en/translator/langcode.htm)
  6603. 基本步骤如下:
  6604. - 请先 fork 一份 [STDF](https://github.com/any-tdf/stdf) 代码到自己的仓库,如果已经 fork 过,请同步主仓库的最新代码。
  6605. - 克隆你的仓库至本地。
  6606. - 在 `packages/stdf/src/lib/lang` 文件夹中增加语言包。
  6607. - (可选)更新文档,在 docs/mds/guide 文件夹更新 [internation.md](https://github.com/any-tdf/stdf/edit/main/docs/mds/guide/internation.md) 和 [internation_en.md](https://github.com/any-tdf/stdf/edit/main/docs/mds/guide/internation_en.md) 文件,请在语言列表中按照 lang 的字母顺序更新。
  6608. - 提交修改内容至你的仓库,然后提 Pull Request 到主仓库。
  6609. - Pull Request 会在 Review 通过后被合并到主仓库,并发布新版本至 npm。
  6610. ================================================
  6611. FILE: docs/mds/guide/internation_en.md
  6612. ================================================
  6613. ## Configuring Language Pack
  6614. The STDF component uses Svelte's [Context](https://svelte.dev/docs/svelte/context) to implement internationalization configuration of text, with the default configuration being in Simplified Chinese. Usually, the Context is configured in the entry file `App.svelte` or `+layout.svelte`. For example:
  6615. ```svelte
  6616. <!-- App.svelte/+layout.svelte -->
  6617. <script>
  6618. import { setContext } from 'svelte'; // import setContext
  6619. import { en_US } from 'stdf/lang'; // import language file
  6620. setContext('STDF_lang', en_US); // set language
  6621. </script>
  6622. ```
  6623. All child components of this component (including STDF components) can obtain the current language configuration using `getContext('STDF_lang')`. More flexible is that another language can be configured in some parts of the application.
  6624. Note that **Context switching is not reactive**, and language switching in most applications does not require real-time response.
  6625. Currently supported languages:
  6626. | Language | lang |
  6627. | ------------------------------------- | ------ |
  6628. | Arabic | ar_EG |
  6629. | Azerbaijani | az_AZ |
  6630. | Bulgarian | bg_BG |
  6631. | Bengali (Bangladesh) | bn_BD |
  6632. | Catalan | ca_ES |
  6633. | Czech | cs_CZ |
  6634. | Danish | da_DK |
  6635. | German | de_DE |
  6636. | Greek | el_GR |
  6637. | English | en_GB |
  6638. | English (US) | en_US |
  6639. | Spanish | es_ES |
  6640. | Basque | eu_ES |
  6641. | Estonian | et_EE |
  6642. | Persian | fa_IR |
  6643. | Finnish | fi_FI |
  6644. | French (Belgium) | fr_BE |
  6645. | French (Canada) | fr_CA |
  6646. | French (France) | fr_FR |
  6647. | Irish | ga_IE |
  6648. | Galician (Spain) | gl_ES |
  6649. | Hebrew | he_IL |
  6650. | Hindi | hi_IN |
  6651. | Croatian | hr_HR |
  6652. | Hungarian | hu_HU |
  6653. | Armenian | hy_AM |
  6654. | Indonesian | id_ID |
  6655. | Italian | it_IT |
  6656. | Icelandic | is_IS |
  6657. | Japanese | ja_JP |
  6658. | Georgian | ka_GE |
  6659. | Khmer | km_KH |
  6660. | Kurdish (Northern) | kmr_IQ |
  6661. | Kannada | kn_IN |
  6662. | Kazakh | kk_KZ |
  6663. | Korean | ko_KR |
  6664. | Lithuanian | lt_LT |
  6665. | Latvian | lv_LV |
  6666. | Macedonian | mk_MK |
  6667. | Malayalam | ml_IN |
  6668. | Mongolian | mn_MN |
  6669. | Malay (Malaysia) | ms_MY |
  6670. | Norwegian | nb_NO |
  6671. | Nepali | ne_NP |
  6672. | Dutch (Belgium) | nl_BE |
  6673. | Dutch | nl_NL |
  6674. | Polish | pl_PL |
  6675. | Portuguese (Brazil) | pt_BR |
  6676. | Portuguese | pt_PT |
  6677. | Romanian | ro_RO |
  6678. | Russian | ru_RU |
  6679. | Sinhalese | si_LK |
  6680. | Slovak | sk_SK |
  6681. | Serbian | sr_RS |
  6682. | Slovenian | sl_SI |
  6683. | Swedish | sv_SE |
  6684. | Tamil | ta_IN |
  6685. | Thai | th_TH |
  6686. | Turkish | tr_TR |
  6687. | Turkmen | tk_TK |
  6688. | Urdu (Pakistan) | ur_PK |
  6689. | Ukrainian | uk_UA |
  6690. | Vietnamese | vi_VN |
  6691. | Simplified Chinese | zh_CN |
  6692. | Traditional Chinese (China Hong Kong) | zh_HK |
  6693. | Traditional Chinese (China Taiwan) | zh_TW |
  6694. > The multilingual files are translated by machine. If there are any inaccuracies, please submit a PR for correction.
  6695. ## Adding a Language Pack
  6696. If you cannot find the language pack you need, you are welcome to create a new language pack based on the [Chinese language pack](https://github.com/any-tdf/stdf/blob/main/packages/stdf/src/lib/lang/zh_CN.ts) or [English language pack](https://github.com/any-tdf/stdf/blob/main/packages/stdf/src/lib/lang/en_US.ts) and submit it as a Pull Request. [Language code table](http://www.lingoes.net/en/translator/langcode.htm)
  6697. The basic steps are as follows:
  6698. - Please fork the [STDF](https://github.com/any-tdf/stdf) code to your own repository. If you have already forked it, please sync the latest code from the main repository.
  6699. - Clone your repository to your local machine.
  6700. - Add language packs in the `packages/stdf/src/lib/lang` folder.
  6701. - (Optional) Update the documentation. Update the [internation.md](https://github.com/any-tdf/stdf/edit/main/docs/mds/guide/internation.md) and [internation_en.md](https://github.com/any-tdf/stdf/edit/main/docs/mds/guide/internation_en.md) files in the docs/mds/guide folder. Please update them in alphabetical order according to the lang list.
  6702. - Commit the modifications to your repository and then submit a Pull Request to the main repository.
  6703. - Once the Pull Request is approved during the review process, it will be merged into the main repository and a new version will be released on npm.
  6704. ================================================
  6705. FILE: docs/mds/guide/milestone.md
  6706. ================================================
  6707. ## 2025-04-07
  6708. v1 版本发布,完整支持 Svelte v5、Tailwind CSS v4 与 TypeScript。
  6709. ## 2023-11-03
  6710. 支持多主题配置 @0.4.0。
  6711. ## 2023-08-24
  6712. 完成 STDF 配套的模板脚手架 [create-stdf](https://www.npmjs.com/package/create-stdf),Vite/Rollup 插件 [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon),VS Code 插件 [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension)。
  6713. ## 2023-07-23
  6714. 适配 Svelte 4 也兼容 Svelte 3(v0.2.0)。
  6715. ## 2023-06-16
  6716. 入选阮一峰老师的[科技爱好者周刊 259 期](https://www.ruanyifeng.com/blog/2023/06/weekly-issue-259.html)。
  6717. ## 2023-05-03
  6718. 将组件源码与文档分开,避免 node_modules 体积过大。
  6719. ## 2023-04-27
  6720. 第一次 commit。
  6721. 组件库开发到我认为能用的程度,正式开源。期间工作量包括组件库 UI 设计(后续补充 Figma 源文件),组件库逻辑开发,源码中英双语注释,搭建中英文 Demo 工程,调试各种 API,撰写组件库中英文档,搭建文档站点,设计 LOGO,首页 3D 建模,部署文档站点,购买域名、CDN...
  6722. ## 2022-07-06
  6723. 新建文件夹。
  6724. 早在 2021 年开发 [simple-cloud-music](https://github.com/dufu1991/simple-cloud-music) 的时候就发现写 Svelte 的体验非常好,但是市面上好像没有一款针对移动端的 UI 组件库,就开始萌生开发一个移动端的 Svelte UI 组件库的想法。再后来遇到了 Tailwind CSS,体验过后被它优秀的开发体验深深吸引,于是决定使用 Svelte 结合 Tailwind 开发一个移动端的 UI 组件库。
  6725. ================================================
  6726. FILE: docs/mds/guide/milestone_en.md
  6727. ================================================
  6728. ## 2025-04-07
  6729. v1 version released, full support for Svelte v5, Tailwind CSS v4, and TypeScript.
  6730. ## 2023-11-03
  6731. Support multi-theme configuration @0.4.0.
  6732. ## 2023-08-24
  6733. Completed the template scaffolding tool [create-stdf](https://www.npmjs.com/package/create-stdf), Vite/Rollup plugin [rollup-plugin-stdf-icon](https://www.npmjs.com/package/rollup-plugin-stdf-icon), and VS Code plugin [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension) for STDF.
  6734. ## 2023-07-23
  6735. Adapted for Svelte 4 while remaining compatible with Svelte 3 (v0.2.0).
  6736. ## 2023-06-16
  6737. Featured in Ruan Yifeng's [weekly-issue No. 259](https://www.ruanyifeng.com/blog/2023/06/weekly-issue-259.html).
  6738. ## 2023-05-03
  6739. Separate component source code and documentation to avoid large node_modules size.
  6740. ## 2023-04-27
  6741. First commit.
  6742. The component library has been developed to a usable level and is now officially open source. During this period, the workload included UI design of the component library (Figma source files will be added later), logic development of the component library, bilingual comments in the source code, building demo projects in both Chinese and English, debugging various APIs, writing documentation for the component library in both Chinese and English, setting up a documentation website, designing a logo, creating a 3D model for the homepage, deploying the documentation website, purchasing domain names and CDN...
  6743. ## 2022-07-06
  6744. New folder created.
  6745. As early as 2021 when developing [simple-cloud-music](https://github.com/dufu1991/simple-cloud-music), I found that writing Svelte was very enjoyable but there seemed to be no mobile-oriented UI component libraries on the market. So I came up with an idea to develop a mobile-oriented Svelte UI component library. Later on I discovered Tailwind CSS which impressed me deeply with its excellent development experience. Therefore I decided to use Svelte combined with Tailwind to develop a mobile-oriented UI component library.
  6746. ================================================
  6747. FILE: docs/mds/guide/quickStart.md
  6748. ================================================
  6749. > Tip:所有代码或命令可以双击选定词,三击选定行。
  6750. ## 1. [create-stdf](https://www.npmjs.com/package/create-stdf)(推荐)
  6751. <!-- :::code-groups -->
  6752. <!-- pnpm -->
  6753. ```sh
  6754. pnpm create stdf
  6755. ```
  6756. <!-- :: -->
  6757. <!-- npm -->
  6758. ```sh
  6759. npm create stdf
  6760. # 或
  6761. npm init stdf
  6762. # 或
  6763. npx create-stdf
  6764. ```
  6765. <!-- :: -->
  6766. <!-- bun -->
  6767. ```sh
  6768. bun create stdf
  6769. ```
  6770. <!-- :: -->
  6771. <!-- yarn -->
  6772. ```sh
  6773. yarn create stdf
  6774. ```
  6775. <!-- ::: -->
  6776. ## 2. 自行搭建
  6777. 2.1 使用 [Svelte CLI](https://svelte.dev/docs/cli/sv-create) 创建工程
  6778. <!-- :::code-groups -->
  6779. <!-- pnpm -->
  6780. ```sh
  6781. pnpm dlx sv create
  6782. ```
  6783. <!-- :: -->
  6784. <!-- npm -->
  6785. ```sh
  6786. npx sv create
  6787. ```
  6788. <!-- :: -->
  6789. <!-- bun -->
  6790. ```sh
  6791. bunx sv create
  6792. ```
  6793. <!-- :: -->
  6794. <!-- yarn -->
  6795. ```sh
  6796. yarn dlx sv create
  6797. ```
  6798. <!-- ::: -->
  6799. 2.2 安装 Tailwind CSS 与 Vite 插件。
  6800. 参考 [Tailwind CSS 文档](https://tailwindcss.com/docs/guides/vite#svelte) 配置 Tailwind CSS。
  6801. <!-- :::code-groups -->
  6802. <!-- pnpm -->
  6803. ```sh
  6804. pnpm i tailwindcss @tailwindcss/vite -D
  6805. ```
  6806. <!-- :: -->
  6807. <!-- npm -->
  6808. ```sh
  6809. npm i tailwindcss @tailwindcss/vite -D
  6810. ```
  6811. <!-- :: -->
  6812. <!-- bun -->
  6813. ```sh
  6814. bun add tailwindcss @tailwindcss/vite -D
  6815. ```
  6816. <!-- :: -->
  6817. <!-- yarn -->
  6818. ```sh
  6819. yarn add tailwindcss @tailwindcss/vite -D
  6820. ```
  6821. <!-- ::: -->
  6822. 2.3 在项目的入口 CSS 文件中引入 Tailwind CSS,设置暗黑模式,添加初始颜色变量,**使用 `@source` 指令指定 Tailwind 自动检测 STDF 组件**。
  6823. 以下为 STDF 默认主题色,请根据自己的需要进行修改。可参考 [STDF 指南 - 色彩](/guide/color)。
  6824. ```css
  6825. /* app.css */
  6826. @import 'tailwindcss';
  6827. @custom-variant dark (&:where(.dark, .dark *));
  6828. @theme {
  6829. /* 主题色 */
  6830. --color-primary-50: oklch(0.979 0.01 267.36);
  6831. --color-primary-100: oklch(0.95 0.024 270.343);
  6832. --color-primary-200: oklch(0.847 0.074 271.188);
  6833. --color-primary-300: oklch(0.741 0.13 272.232);
  6834. --color-primary-400: oklch(0.634 0.193 271.595);
  6835. --color-primary-500: oklch(0.536 0.252 268.66);
  6836. --color-primary: oklch(0.467 0.296 264.886);
  6837. --color-primary-700: oklch(0.397 0.26 264.877);
  6838. --color-primary-800: oklch(0.331 0.221 264.833);
  6839. --color-primary-900: oklch(0.26 0.178 264.428);
  6840. --color-primary-950: oklch(0.192 0.13 266.64);
  6841. --color-dark-50: oklch(0.995 0.012 101.474);
  6842. --color-dark-100: oklch(0.986 0.025 97.107);
  6843. --color-dark-200: oklch(0.965 0.059 95.884);
  6844. --color-dark-300: oklch(0.938 0.089 92.952);
  6845. --color-dark-400: oklch(0.91 0.114 89.711);
  6846. --color-dark-500: oklch(0.88 0.136 86.375);
  6847. --color-dark: oklch(0.845 0.153 80.597);
  6848. --color-dark-700: oklch(0.71 0.137 75.734);
  6849. --color-dark-800: oklch(0.58 0.118 70.166);
  6850. --color-dark-900: oklch(0.449 0.097 65.209);
  6851. --color-dark-950: oklch(0.321 0.074 62.379);
  6852. --color-primaryBlack: oklch(0.116 0.054 267.087);
  6853. --color-primaryWhite: oklch(0.961 0.001 286.375);
  6854. --color-darkBlack: oklch(0.183 0.035 86.634);
  6855. --color-darkWhite: oklch(0.962 0.001 17.178);
  6856. /* 功能色 */
  6857. --color-success: oklch(0.704 0.142 167.084);
  6858. --color-warning: oklch(0.558 0.154 47.186);
  6859. --color-error: oklch(0.564 0.223 28.46);
  6860. --color-info: oklch(0.482 0.14 261.518);
  6861. /* 扩展色 */
  6862. --color-extend0: oklch(0.703 0.149 235.059);
  6863. --color-Twitter: oklch(0.703 0.149 235.059);
  6864. --color-extend1: oklch(0.702 0.194 38.137);
  6865. --color-Svelte: oklch(0.702 0.194 38.137);
  6866. --color-extend2: oklch(0.482 0.107 161.212);
  6867. --color-Starbucks: oklch(0.482 0.107 161.212);
  6868. /* 中性色 */
  6869. --color-black: oklch(0 0 0);
  6870. --color-white: oklch(1 0 0);
  6871. --color-gray-50: oklch(0.961 0 0);
  6872. --color-gray-100: oklch(0.925 0 0);
  6873. --color-gray-200: oklch(0.845 0 0);
  6874. --color-gray-300: oklch(0.767 0 0);
  6875. --color-gray-400: oklch(0.683 0 0);
  6876. --color-gray-500: oklch(0.6 0 0);
  6877. --color-gray-600: oklch(0.51 0 0);
  6878. --color-gray-700: oklch(0.42 0 0);
  6879. --color-gray-800: oklch(0.321 0 0);
  6880. --color-gray-900: oklch(0.218 0 0);
  6881. --color-gray-950: oklch(0.159 0 0);
  6882. --color-transparent: transparent;
  6883. }
  6884. @source "../node_modules/stdf/**/*.svelte";
  6885. ```
  6886. 2.4 在 Svelte 文件中引入并使用。
  6887. ```svelte
  6888. <script lang="ts">
  6889. import { Button } from 'stdf';
  6890. </script>
  6891. <Button>点击我</Button>
  6892. ```
  6893. 2.5 启动项目。
  6894. <!-- :::code-groups -->
  6895. <!-- pnpm -->
  6896. ```sh
  6897. pnpm dev
  6898. ```
  6899. <!-- :: -->
  6900. <!-- npm -->
  6901. ```sh
  6902. npm run dev
  6903. ```
  6904. <!-- :: -->
  6905. <!-- bun -->
  6906. ```sh
  6907. bun dev
  6908. ```
  6909. <!-- :: -->
  6910. <!-- yarn -->
  6911. ```sh
  6912. yarn dev
  6913. ```
  6914. <!-- ::: -->
  6915. ================================================
  6916. FILE: docs/mds/guide/quickStart_en.md
  6917. ================================================
  6918. > Tip: All code or commands can be double-clicked to select the word, three clicks to select the line.
  6919. ## 1. [create-stdf](https://www.npmjs.com/package/create-stdf) (Recommended)
  6920. <!-- :::code-groups -->
  6921. <!-- pnpm -->
  6922. ```sh
  6923. pnpm create stdf
  6924. ```
  6925. <!-- :: -->
  6926. <!-- npm -->
  6927. ```sh
  6928. npm create stdf
  6929. # or
  6930. npm init stdf
  6931. # or
  6932. npx create-stdf
  6933. ```
  6934. <!-- :: -->
  6935. <!-- bun -->
  6936. ```sh
  6937. bun create stdf
  6938. ```
  6939. <!-- :: -->
  6940. <!-- yarn -->
  6941. ```sh
  6942. yarn create stdf
  6943. ```
  6944. <!-- ::: -->
  6945. ## 2. Self-built
  6946. 2.1 Use the [Svelte CLI](https://svelte.dev/docs/cli/sv-create) to create the project.
  6947. <!-- :::code-groups -->
  6948. <!-- pnpm -->
  6949. ```sh
  6950. pnpm dlx sv create
  6951. ```
  6952. <!-- :: -->
  6953. <!-- npm -->
  6954. ```sh
  6955. npx sv create
  6956. ```
  6957. <!-- :: -->
  6958. <!-- bun -->
  6959. ```sh
  6960. bunx sv create
  6961. ```
  6962. <!-- :: -->
  6963. <!-- yarn -->
  6964. ```sh
  6965. yarn dlx sv create
  6966. ```
  6967. <!-- ::: -->
  6968. 2.2 Install Tailwind CSS and Vite plugins.
  6969. Refer to the [Tailwind CSS documentation](https://tailwindcss.com/docs/guides/vite#svelte) to configure Tailwind CSS.
  6970. <!-- :::code-groups -->
  6971. <!-- pnpm -->
  6972. ```sh
  6973. pnpm i tailwindcss @tailwindcss/vite -D
  6974. ```
  6975. <!-- :: -->
  6976. <!-- npm -->
  6977. ```sh
  6978. npm i tailwindcss @tailwindcss/vite -D
  6979. ```
  6980. <!-- :: -->
  6981. <!-- bun -->
  6982. ```sh
  6983. bun i tailwindcss @tailwindcss/vite -D
  6984. ```
  6985. <!-- :: -->
  6986. <!-- yarn -->
  6987. ```sh
  6988. yarn add tailwindcss @tailwindcss/vite -D
  6989. ```
  6990. <!-- ::: -->
  6991. 2.3 In the project's entry CSS file, import Tailwind CSS, set the dark mode, add the initial color variables, and **use the `@source` directive to specify that Tailwind CSS automatically detects STDF components**.
  6992. The following are the default theme colors of STDF, please modify them according to your needs. For more information, refer to [STDF Guide - Color](/guide/color).
  6993. ```css
  6994. /* app.css */
  6995. @import 'tailwindcss';
  6996. @custom-variant dark (&:where(.dark, .dark *));
  6997. @theme {
  6998. /* Theme Colors */
  6999. --color-primary-50: oklch(0.979 0.01 267.36);
  7000. --color-primary-100: oklch(0.95 0.024 270.343);
  7001. --color-primary-200: oklch(0.847 0.074 271.188);
  7002. --color-primary-300: oklch(0.741 0.13 272.232);
  7003. --color-primary-400: oklch(0.634 0.193 271.595);
  7004. --color-primary-500: oklch(0.536 0.252 268.66);
  7005. --color-primary: oklch(0.467 0.296 264.886);
  7006. --color-primary-700: oklch(0.397 0.26 264.877);
  7007. --color-primary-800: oklch(0.331 0.221 264.833);
  7008. --color-primary-900: oklch(0.26 0.178 264.428);
  7009. --color-primary-950: oklch(0.192 0.13 266.64);
  7010. --color-dark-50: oklch(0.995 0.012 101.474);
  7011. --color-dark-100: oklch(0.986 0.025 97.107);
  7012. --color-dark-200: oklch(0.965 0.059 95.884);
  7013. --color-dark-300: oklch(0.938 0.089 92.952);
  7014. --color-dark-400: oklch(0.91 0.114 89.711);
  7015. --color-dark-500: oklch(0.88 0.136 86.375);
  7016. --color-dark: oklch(0.845 0.153 80.597);
  7017. --color-dark-700: oklch(0.71 0.137 75.734);
  7018. --color-dark-800: oklch(0.58 0.118 70.166);
  7019. --color-dark-900: oklch(0.449 0.097 65.209);
  7020. --color-dark-950: oklch(0.321 0.074 62.379);
  7021. --color-primaryBlack: oklch(0.116 0.054 267.087);
  7022. --color-primaryWhite: oklch(0.961 0.001 286.375);
  7023. --color-darkBlack: oklch(0.183 0.035 86.634);
  7024. --color-darkWhite: oklch(0.962 0.001 17.178);
  7025. /* Functional Colors */
  7026. --color-success: oklch(0.704 0.142 167.084);
  7027. --color-warning: oklch(0.558 0.154 47.186);
  7028. --color-error: oklch(0.564 0.223 28.46);
  7029. --color-info: oklch(0.482 0.14 261.518);
  7030. /* Extended Colors */
  7031. --color-extend0: oklch(0.703 0.149 235.059);
  7032. --color-Twitter: oklch(0.703 0.149 235.059);
  7033. --color-extend1: oklch(0.702 0.194 38.137);
  7034. --color-Svelte: oklch(0.702 0.194 38.137);
  7035. --color-extend2: oklch(0.482 0.107 161.212);
  7036. --color-Starbucks: oklch(0.482 0.107 161.212);
  7037. /* Neutral Colors */
  7038. --color-black: oklch(0 0 0);
  7039. --color-white: oklch(1 0 0);
  7040. --color-gray-50: oklch(0.961 0 0);
  7041. --color-gray-100: oklch(0.925 0 0);
  7042. --color-gray-200: oklch(0.845 0 0);
  7043. --color-gray-300: oklch(0.767 0 0);
  7044. --color-gray-400: oklch(0.683 0 0);
  7045. --color-gray-500: oklch(0.6 0 0);
  7046. --color-gray-600: oklch(0.51 0 0);
  7047. --color-gray-700: oklch(0.42 0 0);
  7048. --color-gray-800: oklch(0.321 0 0);
  7049. --color-gray-900: oklch(0.218 0 0);
  7050. --color-gray-950: oklch(0.159 0 0);
  7051. --color-transparent: transparent;
  7052. }
  7053. @source "../node_modules/stdf/**/*.svelte";
  7054. ```
  7055. 2.4 Import and use components in Svelte files.
  7056. ```svelte
  7057. <script lang="ts">
  7058. import { Button } from 'stdf';
  7059. </script>
  7060. <Button>Click me</Button>
  7061. ```
  7062. 2.5 Start the project.
  7063. <!-- :::code-groups -->
  7064. <!-- pnpm -->
  7065. ```sh
  7066. pnpm dev
  7067. ```
  7068. <!-- :: -->
  7069. <!-- npm -->
  7070. ```sh
  7071. npm run dev
  7072. ```
  7073. <!-- :: -->
  7074. <!-- bun -->
  7075. ```sh
  7076. bun dev
  7077. ```
  7078. <!-- :: -->
  7079. <!-- yarn -->
  7080. ```sh
  7081. yarn dev
  7082. ```
  7083. <!-- ::: -->
  7084. ================================================
  7085. FILE: docs/mds/guide/theme.md
  7086. ================================================
  7087. ## 亮暗模式
  7088. ### 配置
  7089. 使用 Tailwind CSS 的暗模式配置,请在项目入口 CSS 文件中做如下 `@custom-variant` 配置,参考 [Dark Mode](https://tailwindcss.com/docs/dark-mode)。
  7090. ```css
  7091. @custom-variant dark (&:where(.dark, .dark *))
  7092. ```
  7093. ### 切换
  7094. STDF 将切换亮暗模式的方法置于 STDF 的 NPM 包中,本质上是直接给 `html` 标签添加或删除 `dark` 类名。
  7095. ```javascript
  7096. // 引入 darkMode,传入 false 切换为亮模式,不传参或传入 true 切换为暗模式。
  7097. import { darkMode } from 'stdf/theme';
  7098. // 切换为亮模式
  7099. darkMode(false);
  7100. // 切换为暗模式
  7101. darkMode();
  7102. ```
  7103. ## 多主题模式
  7104. ### 介绍
  7105. STDF 支持多主题切换,主题暂支持切换[颜色系统](/guide/color),后续考虑字体、间距、文字大小等配置也可跟随主题切换。本质原理是将一些属性设置为 CSS 变量,通过修改这些变量实现主题切换。
  7106. ### 配置
  7107. 请参考主题生成器生成的主题配置格式配置好主题,主题配置须包含 name 与 color 两个属性,name 为主题名称,color 为此主题搭配的颜色。
  7108. > 可到<a href="/guide/generator" target="_blank">主题生成器</a>快速配置颜色系统并生成配置文件。
  7109. 默认主题配置如下:
  7110. ```javascript
  7111. {
  7112. name: 'STDF',
  7113. color: {
  7114. primary: {
  7115. 50: 'oklch(0.979 0.01 267.36)', // #F5F8FF hsl(222, 100%, 98%)
  7116. 100: 'oklch(0.95 0.024 270.343)', // #E8EEFF hsl(224, 100%, 96%)
  7117. 200: 'oklch(0.847 0.074 271.188)', // #BBCBFE hsl(226, 97%, 87%)
  7118. 300: 'oklch(0.741 0.13 272.232)', // #8FA5FD hsl(228, 97%, 78%)
  7119. 400: 'oklch(0.634 0.193 271.595)', // #637CFD hsl(230, 98%, 69%)
  7120. 500: 'oklch(0.536 0.252 268.66)', // #3751FC hsl(232, 97%, 60%)
  7121. default: 'oklch(0.467 0.296 264.886)', // #0B24FB hsl(234, 97%, 51%)
  7122. 700: 'oklch(0.397 0.26 264.877)', // #0714CF hsl(236, 94%, 42%)
  7123. 800: 'oklch(0.331 0.221 264.833)', // #0409A4 hsl(238, 95%, 33%)
  7124. 900: 'oklch(0.26 0.178 264.428)', // #010178 hsl(240, 98%, 24%)
  7125. 950: 'oklch(0.192 0.13 266.64)' // #03004D hsl(242, 100%, 15%)
  7126. },
  7127. dark: {
  7128. 50: 'oklch(0.995 0.012 101.474)', // #FFFEF5 hsl(54, 100%, 98%)
  7129. 100: 'oklch(0.986 0.025 97.107)', // #FFFBE8 hsl(50, 100%, 96%)
  7130. 200: 'oklch(0.965 0.059 95.884)', // #FFF4C7 hsl(48, 100%, 89%)
  7131. 300: 'oklch(0.938 0.089 92.952)', // #FFEAA6 hsl(46, 100%, 83%)
  7132. 400: 'oklch(0.91 0.114 89.711)', // #FFDE85 hsl(44, 100%, 76%)
  7133. 500: 'oklch(0.88 0.136 86.375)', // #FFD164 hsl(42, 100%, 70%)
  7134. default: 'oklch(0.845 0.153 80.597)', // #FFC043 hsl(40, 100%, 63%)
  7135. 700: 'oklch(0.71 0.137 75.734)', // #D29429 hsl(38, 67%, 49%)
  7136. 800: 'oklch(0.58 0.118 70.166)', // #A66C16 hsl(36, 77%, 37%)
  7137. 900: 'oklch(0.449 0.097 65.209)', // #794808 hsl(34, 88%, 25%)
  7138. 950: 'oklch(0.321 0.074 62.379)' // #4D2900 hsl(32, 100%, 15%)
  7139. },
  7140. primaryBlack: 'oklch(0.116 0.054 267.087)', // #010319 hsl(234, 95%, 5%)
  7141. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(234, 5%, 95%)
  7142. darkBlack: 'oklch(0.183 0.035 86.634)', // #191101 hsl(40, 95%, 5%)
  7143. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(40, 5%, 95%)
  7144. functional: {
  7145. success: 'oklch(0.704 0.142 167.084)', // #11bb8d hsl(164, 83%, 40%)
  7146. warning: 'oklch(0.558 0.154 47.186)', // #b95000 hsl(26, 100%, 36%)
  7147. error: 'oklch(0.564 0.223 28.46)', // #da1414 hsl(0, 83%, 47%)
  7148. info: 'oklch(0.482 0.14 261.518)' // #2e5aac hsl(219, 58%, 43%)
  7149. },
  7150. extend: [
  7151. {
  7152. color: 'oklch(0.703 0.149 235.059)', // #00acee hsl(197, 100%, 47%)
  7153. alias: 'Twitter'
  7154. },
  7155. {
  7156. color: 'oklch(0.702 0.194 38.137)', // #ff6937 hsl(15, 100%, 61%)
  7157. alias: 'Svelte'
  7158. },
  7159. {
  7160. color: 'oklch(0.482 0.107 161.212)', // #00704a hsl(160, 100%, 22%)
  7161. alias: 'Starbucks'
  7162. }
  7163. ]
  7164. }
  7165. }
  7166. ```
  7167. Tailwind v4 推荐使用 oklch 颜色模式,参考 [Using CSS variables](https://tailwindcss.com/docs/customizing-colors#using-css-variables)。
  7168. 按照颜色系统的配色,加上基础的黑、白、灰、透明,默认配色在入口 CSS 文件中至少包含以下内容:
  7169. ```css
  7170. @theme {
  7171. /* 主题色 */
  7172. --color-primary-50: oklch(0.979 0.01 267.36);
  7173. --color-primary-100: oklch(0.95 0.024 270.343);
  7174. --color-primary-200: oklch(0.847 0.074 271.188);
  7175. --color-primary-300: oklch(0.741 0.13 272.232);
  7176. --color-primary-400: oklch(0.634 0.193 271.595);
  7177. --color-primary-500: oklch(0.536 0.252 268.66);
  7178. --color-primary: oklch(0.467 0.296 264.886);
  7179. --color-primary-700: oklch(0.397 0.26 264.877);
  7180. --color-primary-800: oklch(0.331 0.221 264.833);
  7181. --color-primary-900: oklch(0.26 0.178 264.428);
  7182. --color-primary-950: oklch(0.192 0.13 266.64);
  7183. --color-dark-50: oklch(0.995 0.012 101.474);
  7184. --color-dark-100: oklch(0.986 0.025 97.107);
  7185. --color-dark-200: oklch(0.965 0.059 95.884);
  7186. --color-dark-300: oklch(0.938 0.089 92.952);
  7187. --color-dark-400: oklch(0.91 0.114 89.711);
  7188. --color-dark-500: oklch(0.88 0.136 86.375);
  7189. --color-dark: oklch(0.845 0.153 80.597);
  7190. --color-dark-700: oklch(0.71 0.137 75.734);
  7191. --color-dark-800: oklch(0.58 0.118 70.166);
  7192. --color-dark-900: oklch(0.449 0.097 65.209);
  7193. --color-dark-950: oklch(0.321 0.074 62.379);
  7194. --color-primaryBlack: oklch(0.116 0.054 267.087);
  7195. --color-primaryWhite: oklch(0.961 0.001 286.375);
  7196. --color-darkBlack: oklch(0.183 0.035 86.634);
  7197. --color-darkWhite: oklch(0.962 0.001 17.178);
  7198. /* 功能色 */
  7199. --color-success: oklch(0.704 0.142 167.084);
  7200. --color-warning: oklch(0.558 0.154 47.186);
  7201. --color-error: oklch(0.564 0.223 28.46);
  7202. --color-info: oklch(0.482 0.14 261.518);
  7203. /* 扩展色 */
  7204. --color-extend0: oklch(0.703 0.149 235.059);
  7205. --color-Twitter: oklch(0.703 0.149 235.059);
  7206. --color-extend1: oklch(0.702 0.194 38.137);
  7207. --color-Svelte: oklch(0.702 0.194 38.137);
  7208. --color-extend2: oklch(0.482 0.107 161.212);
  7209. --color-Starbucks: oklch(0.482 0.107 161.212);
  7210. /* 中性色 */
  7211. --color-black: oklch(0 0 0);
  7212. --color-white: oklch(1 0 0);
  7213. --color-gray-50: oklch(0.961 0 0);
  7214. --color-gray-100: oklch(0.925 0 0);
  7215. --color-gray-200: oklch(0.845 0 0);
  7216. --color-gray-300: oklch(0.767 0 0);
  7217. --color-gray-400: oklch(0.683 0 0);
  7218. --color-gray-500: oklch(0.6 0 0);
  7219. --color-gray-600: oklch(0.51 0 0);
  7220. --color-gray-700: oklch(0.42 0 0);
  7221. --color-gray-800: oklch(0.321 0 0);
  7222. --color-gray-900: oklch(0.218 0 0);
  7223. --color-gray-950: oklch(0.159 0 0);
  7224. --color-transparent: transparent;
  7225. /* ... */
  7226. }
  7227. ```
  7228. ### 切换
  7229. 引入 NPM 包中的 switchTheme 方法切换主题,传入主题文件对象即可。
  7230. ```javascript
  7231. // 引入 STDF 主题配置文件和切换主题方法(stdf 的 NPM 包中包含一个 stdf 主题配置文件)
  7232. import { stdfTheme, switchTheme } from 'stdf/theme';
  7233. // 引入自定义主题配置文件,假定 customTheme 为自定义主题配置文件
  7234. import customTheme from './customTheme';
  7235. // 切换主题为 STDF 主题
  7236. switchTheme(stdfTheme);
  7237. // 切换主题为自定义主题
  7238. switchTheme(customTheme);
  7239. ```
  7240. 详细使用方式可参考 [STDF Demo](https://github.com/any-tdf/demo-stdf)。
  7241. ## 总结
  7242. ### 亮暗模式
  7243. 直接使用 STDF 的 NPM 包中的 darkMode 方法即可。
  7244. ### 多主题模式
  7245. 1. 在入口 CSS 文件内配置默认主题 CSS 变量,如 `src/app.css`。
  7246. 2. 到主题生成器中配置颜色系统并生成主题配置文件。
  7247. 3. 在需要切换主题的地方引入主题配置文件和切换主题方法,调用切换主题方法。
  7248. > 当然,如果你不需要切换主题,只需要配置初始 CSS 变量即可。
  7249. ================================================
  7250. FILE: docs/mds/guide/theme_en.md
  7251. ================================================
  7252. ## Light and dark modes
  7253. ### Configuration
  7254. Use the Tailwind CSS dark mode configuration, please make the following `@custom-variant` configuration in the project entry CSS file, reference [Dark Mode](https://tailwindcss.com/docs/dark-mode).
  7255. ```css
  7256. @custom-variant dark (&:where(.dark, .dark *))
  7257. ```
  7258. ### Switching
  7259. STDF supports switching between multiple themes. The method of switching themes is placed in the NPM package of STDF, essentially adding or removing the `dark` class name to the `html` tag.
  7260. ```javascript
  7261. // Import darkMode, pass false to switch to light mode, or not pass parameters or pass true to switch to dark mode.
  7262. import { darkMode } from 'stdf/theme';
  7263. // Switch to light mode
  7264. darkMode(false);
  7265. // Switch to dark mode
  7266. darkMode();
  7267. ```
  7268. ## Multiple theme mode
  7269. ### Introduction
  7270. STDF supports switching between multiple themes, currently supports switching [color system](/guide/color), and will consider switching font, spacing, text size, etc. in the future. The essential principle is to set some attributes as CSS variables, and switch the theme by modifying these variables.
  7271. ### Configuration
  7272. Please refer to the theme configuration format generated by the theme generator for the theme configuration, the theme configuration must contain the name and color attributes, name is the theme name, and color is the color system configuration.
  7273. > Please refer to [Theme Generator](/guide/generator) for the theme configuration format.
  7274. Default theme configuration:
  7275. ```javascript
  7276. {
  7277. name: 'STDF',
  7278. color: {
  7279. primary: {
  7280. 50: 'oklch(0.979 0.01 267.36)', // #F5F8FF hsl(222, 100%, 98%)
  7281. 100: 'oklch(0.95 0.024 270.343)', // #E8EEFF hsl(224, 100%, 96%)
  7282. 200: 'oklch(0.847 0.074 271.188)', // #BBCBFE hsl(226, 97%, 87%)
  7283. 300: 'oklch(0.741 0.13 272.232)', // #8FA5FD hsl(228, 97%, 78%)
  7284. 400: 'oklch(0.634 0.193 271.595)', // #637CFD hsl(230, 98%, 69%)
  7285. 500: 'oklch(0.536 0.252 268.66)', // #3751FC hsl(232, 97%, 60%)
  7286. default: 'oklch(0.467 0.296 264.886)', // #0B24FB hsl(234, 97%, 51%)
  7287. 700: 'oklch(0.397 0.26 264.877)', // #0714CF hsl(236, 94%, 42%)
  7288. 800: 'oklch(0.331 0.221 264.833)', // #0409A4 hsl(238, 95%, 33%)
  7289. 900: 'oklch(0.26 0.178 264.428)', // #010178 hsl(240, 98%, 24%)
  7290. 950: 'oklch(0.192 0.13 266.64)' // #03004D hsl(242, 100%, 15%)
  7291. },
  7292. dark: {
  7293. 50: 'oklch(0.995 0.012 101.474)', // #FFFEF5 hsl(54, 100%, 98%)
  7294. 100: 'oklch(0.986 0.025 97.107)', // #FFFBE8 hsl(50, 100%, 96%)
  7295. 200: 'oklch(0.965 0.059 95.884)', // #FFF4C7 hsl(48, 100%, 89%)
  7296. 300: 'oklch(0.938 0.089 92.952)', // #FFEAA6 hsl(46, 100%, 83%)
  7297. 400: 'oklch(0.91 0.114 89.711)', // #FFDE85 hsl(44, 100%, 76%)
  7298. 500: 'oklch(0.88 0.136 86.375)', // #FFD164 hsl(42, 100%, 70%)
  7299. default: 'oklch(0.845 0.153 80.597)', // #FFC043 hsl(40, 100%, 63%)
  7300. 700: 'oklch(0.71 0.137 75.734)', // #D29429 hsl(38, 67%, 49%)
  7301. 800: 'oklch(0.58 0.118 70.166)', // #A3731F hsl(36, 80%, 45%)
  7302. 900: 'oklch(0.45 0.094 64.59)', // #744F14 hsl(34, 80%, 39%)
  7303. 950: 'oklch(0.32 0.069 59.014)' // #46300A hsl(32, 80%, 32%)
  7304. },
  7305. primaryBlack: 'oklch(0.116 0.054 267.087)', // #010319 hsl(234, 95%, 5%)
  7306. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(234, 5%, 95%)
  7307. darkBlack: 'oklch(0.183 0.035 86.634)', // #191101 hsl(40, 95%, 5%)
  7308. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(40, 5%, 95%)
  7309. functional: {
  7310. success: 'oklch(0.704 0.142 167.084)', // #11bb8d hsl(164, 83%, 40%)
  7311. warning: 'oklch(0.558 0.154 47.186)', // #b95000 hsl(26, 100%, 36%)
  7312. error: 'oklch(0.564 0.223 28.46)', // #da1414 hsl(0, 83%, 47%)
  7313. info: 'oklch(0.482 0.14 261.518)' // #2e5aac hsl(219, 58%, 43%)
  7314. },
  7315. extend: [
  7316. {
  7317. color: 'oklch(0.703 0.149 235.059)', // #00acee hsl(197, 100%, 47%)
  7318. alias: 'Twitter'
  7319. },
  7320. {
  7321. color: 'oklch(0.702 0.194 38.137)', // #ff6937 hsl(15, 100%, 61%)
  7322. alias: 'Svelte'
  7323. },
  7324. {
  7325. color: 'oklch(0.482 0.107 161.212)', // #00704a hsl(160, 100%, 22%)
  7326. alias: 'Starbucks'
  7327. }
  7328. ]
  7329. }
  7330. }
  7331. ```
  7332. Tailwind v4 recommends using the oklch color mode, reference [Using CSS variables](https://tailwindcss.com/docs/customizing-colors#using-css-variables).
  7333. According to the color system configuration, plus the basic black, white, gray, and transparent, the default color system configuration in the entry CSS file must contain the following content:
  7334. ```css
  7335. @theme {
  7336. /* Theme color */
  7337. --color-primary-50: oklch(0.979 0.01 267.36);
  7338. --color-primary-100: oklch(0.95 0.024 270.343);
  7339. --color-primary-200: oklch(0.847 0.074 271.188);
  7340. --color-primary-300: oklch(0.741 0.13 272.232);
  7341. --color-primary-400: oklch(0.634 0.193 271.595);
  7342. --color-primary-500: oklch(0.536 0.252 268.66);
  7343. --color-primary: oklch(0.467 0.296 264.886);
  7344. --color-primary-700: oklch(0.397 0.26 264.877);
  7345. --color-primary-800: oklch(0.331 0.221 264.833);
  7346. --color-primary-900: oklch(0.26 0.178 264.428);
  7347. --color-primary-950: oklch(0.192 0.13 266.64);
  7348. --color-dark-50: oklch(0.995 0.012 101.474);
  7349. --color-dark-100: oklch(0.986 0.025 97.107);
  7350. --color-dark-200: oklch(0.965 0.059 95.884);
  7351. --color-dark-300: oklch(0.938 0.089 92.952);
  7352. --color-dark-400: oklch(0.91 0.114 89.711);
  7353. --color-dark-500: oklch(0.88 0.136 86.375);
  7354. --color-dark: oklch(0.845 0.153 80.597);
  7355. --color-dark-700: oklch(0.71 0.137 75.734);
  7356. --color-dark-800: oklch(0.58 0.118 70.166);
  7357. --color-dark-900: oklch(0.449 0.097 65.209);
  7358. --color-dark-950: oklch(0.321 0.074 62.379);
  7359. --color-primaryBlack: oklch(0.116 0.054 267.087);
  7360. --color-primaryWhite: oklch(0.961 0.001 286.375);
  7361. --color-darkBlack: oklch(0.183 0.035 86.634);
  7362. --color-darkWhite: oklch(0.962 0.001 17.178);
  7363. /* Functional color */
  7364. --color-success: oklch(0.704 0.142 167.084);
  7365. --color-warning: oklch(0.558 0.154 47.186);
  7366. --color-error: oklch(0.564 0.223 28.46);
  7367. --color-info: oklch(0.482 0.14 261.518);
  7368. /* Extended color */
  7369. --color-extend0: oklch(0.703 0.149 235.059);
  7370. --color-Twitter: oklch(0.703 0.149 235.059);
  7371. --color-extend1: oklch(0.702 0.194 38.137);
  7372. --color-Svelte: oklch(0.702 0.194 38.137);
  7373. --color-extend2: oklch(0.482 0.107 161.212);
  7374. --color-Starbucks: oklch(0.482 0.107 161.212);
  7375. /* Neutral color */
  7376. --color-black: oklch(0 0 0);
  7377. --color-white: oklch(1 0 0);
  7378. --color-gray-50: oklch(0.961 0 0);
  7379. --color-gray-100: oklch(0.925 0 0);
  7380. --color-gray-200: oklch(0.845 0 0);
  7381. --color-gray-300: oklch(0.767 0 0);
  7382. --color-gray-400: oklch(0.683 0 0);
  7383. --color-gray-500: oklch(0.6 0 0);
  7384. --color-gray-600: oklch(0.51 0 0);
  7385. --color-gray-700: oklch(0.42 0 0);
  7386. --color-gray-800: oklch(0.321 0 0);
  7387. --color-gray-900: oklch(0.218 0 0);
  7388. --color-gray-950: oklch(0.159 0 0);
  7389. --color-transparent: transparent;
  7390. /* ... */
  7391. }
  7392. ```
  7393. ### Switching
  7394. Import the theme configuration file and the switch theme method in the NPM package of STDF, and call the switch theme method.
  7395. ```javascript
  7396. // Import the theme configuration file and the switch theme method (the NPM package of STDF contains a STDF theme configuration file)
  7397. import { stdfTheme, switchTheme } from 'stdf/theme';
  7398. // Import the custom theme configuration file, assume customTheme is the custom theme configuration file
  7399. import customTheme from './customTheme';
  7400. // Switch to STDF theme
  7401. switchTheme(stdfTheme);
  7402. // Switch to custom theme
  7403. switchTheme(customTheme);
  7404. ```
  7405. Detailed usage can refer to [STDF Demo](https://github.com/any-tdf/demo-stdf).
  7406. ## Summary
  7407. ### Light and dark modes
  7408. Directly use the darkMode method in the NPM package of STDF.
  7409. ### Multiple theme mode
  7410. 1. Configure the default theme CSS variables in the entry CSS file, such as `src/app.css`.
  7411. 2. Configure the color system in the theme generator and generate the theme configuration file.
  7412. 3. Import the theme configuration file and the switch theme method in the NPM package of STDF, and call the switch theme method.
  7413. > Of course, if you don't need to switch themes, you only need to configure the initial CSS variables.
  7414. ================================================
  7415. FILE: docs/mds/guide/vscode.md
  7416. ================================================
  7417. ## VS Code 插件
  7418. ### 介绍
  7419. STDF 提供了一个 VS Code 插件 [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension),用于在使用 [STDF](https://stdf.design) 开发时提供一些便利。
  7420. ### 安装
  7421. 在 VS Code 插件中搜索 `STDF for VS Code` 点击安装,或到 VS Code 插件市场安装 [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension)。
  7422. ### 功能
  7423. 光标悬浮于 STDF 组件名称上时悬浮显示。
  7424. - 此组件 API。
  7425. - 直接打开 STDF 官网此组件的示例/API/指南。
  7426. - 直接打开 STDF 此组件源码(GitHub/Gitee)。
  7427. ![TIP](https://stdf.design/assets/vscode/tip.png)
  7428. 或者
  7429. ![TIP](https://stdf.design/assets/vscode/tip2.png)
  7430. ### 配置
  7431. 默认显示的 API 为简体中文,可到 VS Code 的设置页开启英文 API。
  7432. ![SETTING](https://stdf.design/assets/vscode/setting.png)
  7433. ================================================
  7434. FILE: docs/mds/guide/vscode_en.md
  7435. ================================================
  7436. ## VS Code Plugin
  7437. ### Introduction
  7438. STDF provides a VS Code plugin called [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension), which provides convenience when developing with [STDF](https://stdf.design).
  7439. ### Installation
  7440. Search for `STDF for VS Code` in the VS Code plugin marketplace and click install, or install [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension) from the VS Code plugin marketplace.
  7441. ### Features
  7442. When hovering over the name of an STDF component, the following information will be displayed:
  7443. - The API of this component.
  7444. - The example/API/guide of this component on the STDF official website.
  7445. - The source code of this component on GitHub/Gitee.
  7446. ![TIP](https://stdf.design/assets/vscode/tip.png)
  7447. or
  7448. ![TIP](https://stdf.design/assets/vscode/tip2.png)
  7449. ### Configuration
  7450. The default API display is in Simplified Chinese. You can enable English API in the VS Code settings.
  7451. ![SETTING](https://stdf.design/assets/vscode/setting.png)
  7452. ================================================
  7453. FILE: docs/site/eslint.config.js
  7454. ================================================
  7455. import prettier from 'eslint-config-prettier';
  7456. import js from '@eslint/js';
  7457. import { includeIgnoreFile } from '@eslint/compat';
  7458. import svelte from 'eslint-plugin-svelte';
  7459. import globals from 'globals';
  7460. import { fileURLToPath } from 'node:url';
  7461. import ts from 'typescript-eslint';
  7462. const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
  7463. export default ts.config(
  7464. includeIgnoreFile(gitignorePath),
  7465. js.configs.recommended,
  7466. ...ts.configs.recommended,
  7467. ...svelte.configs['flat/recommended'],
  7468. prettier,
  7469. ...svelte.configs['flat/prettier'],
  7470. {
  7471. languageOptions: {
  7472. globals: {
  7473. ...globals.browser,
  7474. ...globals.node
  7475. }
  7476. }
  7477. },
  7478. {
  7479. files: ['**/*.svelte'],
  7480. languageOptions: {
  7481. parserOptions: {
  7482. parser: ts.parser
  7483. }
  7484. }
  7485. }
  7486. );
  7487. ================================================
  7488. FILE: docs/site/package.json
  7489. ================================================
  7490. {
  7491. "name": "site",
  7492. "version": "0.0.1",
  7493. "type": "module",
  7494. "scripts": {
  7495. "env": "bun run scripts/env.js",
  7496. "dev": "bun run env && vite dev",
  7497. "preview": "vite preview",
  7498. "build": "bun run env && vite build",
  7499. "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
  7500. "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
  7501. "format": "prettier --write .",
  7502. "lint": "prettier --check . && eslint ."
  7503. },
  7504. "devDependencies": {
  7505. "@eslint/compat": "^1.2.4",
  7506. "@sveltejs/adapter-static": "^3.0.6",
  7507. "@sveltejs/kit": "^2.9.0",
  7508. "@sveltejs/vite-plugin-svelte": "^5.0.1",
  7509. "@tailwindcss/typography": "^0.5.15",
  7510. "@tailwindcss/vite": "^4.0.12",
  7511. "@types/color": "^4.2.0",
  7512. "@types/culori": "^2.1.1",
  7513. "beautify-qrcode": "^1.0.3",
  7514. "clipboard": "^2.0.11",
  7515. "color": "^4.2.3",
  7516. "culori": "^4.0.1",
  7517. "eslint": "^9.16.0",
  7518. "eslint-config-prettier": "^9.1.0",
  7519. "eslint-plugin-svelte": "^2.46.1",
  7520. "globals": "^15.13.0",
  7521. "highlight.js": "^11.10.0",
  7522. "highlightjs-svelte": "^1.0.6",
  7523. "prettier": "^3.4.2",
  7524. "prettier-plugin-svelte": "^3.3.2",
  7525. "prettier-plugin-tailwindcss": "^0.6.9",
  7526. "rollup-plugin-md-ts": "file:../../packages/rollup-plugin-md-ts",
  7527. "rollup-plugin-stdf-icon": "file:../../packages/rollup-plugin-stdf-icon",
  7528. "stdf": "file:../../packages/stdf",
  7529. "svelte": "^5.7.1",
  7530. "svelte-check": "^4.1.1",
  7531. "svelte-confetti": "^2.3.1",
  7532. "tailwindcss": "^4.0.12",
  7533. "typescript": "^5.7.2",
  7534. "typescript-eslint": "^8.17.0",
  7535. "vite": "^6.0.3"
  7536. }
  7537. }
  7538. ================================================
  7539. FILE: docs/site/svelte.config.js
  7540. ================================================
  7541. import adapter from '@sveltejs/adapter-static';
  7542. import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
  7543. /** @type {import('@sveltejs/kit').Config} */
  7544. const config = {
  7545. // Consult https://svelte.dev/docs/kit/integrations
  7546. // for more information about preprocessors
  7547. preprocess: vitePreprocess(),
  7548. kit: {
  7549. // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
  7550. // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
  7551. // See https://svelte.dev/docs/kit/adapters for more information about adapters.
  7552. adapter: adapter({ fallback: '404.html' })
  7553. }
  7554. };
  7555. export default config;
  7556. ================================================
  7557. FILE: docs/site/tsconfig.json
  7558. ================================================
  7559. {
  7560. "extends": "./.svelte-kit/tsconfig.json",
  7561. "compilerOptions": {
  7562. "allowJs": true,
  7563. "checkJs": true,
  7564. "esModuleInterop": true,
  7565. "forceConsistentCasingInFileNames": true,
  7566. "resolveJsonModule": true,
  7567. "skipLibCheck": true,
  7568. "sourceMap": true,
  7569. "strict": true,
  7570. "moduleResolution": "bundler"
  7571. }
  7572. // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  7573. // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  7574. //
  7575. // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
  7576. // from the referenced tsconfig.json - TypeScript does not merge them in
  7577. }
  7578. ================================================
  7579. FILE: docs/site/vite.config.ts
  7580. ================================================
  7581. import { sveltekit } from '@sveltejs/kit/vite';
  7582. import { defineConfig } from 'vite';
  7583. import tailwindcss from '@tailwindcss/vite';
  7584. import md from 'rollup-plugin-md-ts';
  7585. import svgSprite from 'rollup-plugin-stdf-icon';
  7586. export default defineConfig({
  7587. plugins: [
  7588. sveltekit(),
  7589. tailwindcss(),
  7590. md({ marked: {}, include: ['../mds/**/*.md', '../../packages/**/*.md'] }),
  7591. svgSprite([{ inFile: 'src/lib/symbol', outFile: 'static/fonts', fileName: 'symbol' }])
  7592. ],
  7593. server: { hmr: true, host: '0.0.0.0', port: 5555 },
  7594. build: { assetsDir: 'build' }
  7595. });
  7596. ================================================
  7597. FILE: docs/site/.prettierignore
  7598. ================================================
  7599. # Package Managers
  7600. package-lock.json
  7601. pnpm-lock.yaml
  7602. yarn.lock
  7603. ================================================
  7604. FILE: docs/site/.prettierrc
  7605. ================================================
  7606. {
  7607. "useTabs": true,
  7608. "singleQuote": true,
  7609. "trailingComma": "none",
  7610. "printWidth": 140,
  7611. "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
  7612. "overrides": [
  7613. {
  7614. "files": "*.svelte",
  7615. "options": {
  7616. "parser": "svelte"
  7617. }
  7618. }
  7619. ]
  7620. }
  7621. ================================================
  7622. FILE: docs/site/scripts/env.js
  7623. ================================================
  7624. import fs from 'node:fs';
  7625. //得到标准时区的时间的函数
  7626. const getLocalTime = (i) => {
  7627. //参数 i 为时区值数字,比如北京为东八区则输进 8,纽约为西 5 区输入 -5
  7628. if (typeof i !== 'number') return;
  7629. const d = new Date();
  7630. //得到 1970 年一月一日到现在的秒数
  7631. const len = d.getTime();
  7632. //本地时间与 GMT 时间的时间偏移差
  7633. const offset = d.getTimezoneOffset() * 60000;
  7634. //得到现在的格林尼治时间
  7635. const utcTime = len + offset;
  7636. return new Date(utcTime + 3600000 * i);
  7637. };
  7638. // 获取当前时间,返回中文和英文时间格式,24 小时制
  7639. let now_en = getLocalTime(-4).toLocaleString('en-US', { hour12: false });
  7640. let now_zh = getLocalTime(+8).toLocaleString('zh-CN', { hour12: false });
  7641. // 去掉秒,即去除最后的 ':xx'
  7642. now_en = `${now_en.slice(0, -3)} GMT-4`;
  7643. now_zh = `${now_zh.slice(0, -3)} GMT+8`;
  7644. console.log('now_en', now_en);
  7645. console.log('now_zh', now_zh);
  7646. // 如果已存在 .env 文件,则删除
  7647. if (fs.existsSync('.env')) {
  7648. fs.unlinkSync('.env');
  7649. }
  7650. // 将当前时间写入 .env 文件
  7651. fs.writeFileSync('.env', `VITE_BUILD_TIME_EN=${now_en}\nVITE_BUILD_TIME_ZH=${now_zh}`);
  7652. ================================================
  7653. FILE: docs/site/src/app.css
  7654. ================================================
  7655. @import "tailwindcss";
  7656. @custom-variant dark (&:where(.dark, .dark *));
  7657. @plugin "@tailwindcss/typography";
  7658. @theme {
  7659. --color-primary-50: oklch(0.979 0.01 267.36);
  7660. --color-primary-100: oklch(0.95 0.024 270.343);
  7661. --color-primary-200: oklch(0.847 0.074 271.188);
  7662. --color-primary-300: oklch(0.741 0.13 272.232);
  7663. --color-primary-400: oklch(0.634 0.193 271.595);
  7664. --color-primary-500: oklch(0.536 0.252 268.66);
  7665. --color-primary: oklch(0.467 0.296 264.886);
  7666. --color-primary-700: oklch(0.397 0.26 264.877);
  7667. --color-primary-800: oklch(0.331 0.221 264.833);
  7668. --color-primary-900: oklch(0.26 0.178 264.428);
  7669. --color-primary-950: oklch(0.192 0.13 266.64);
  7670. --color-dark-50: oklch(0.995 0.012 101.474);
  7671. --color-dark-100: oklch(0.986 0.025 97.107);
  7672. --color-dark-200: oklch(0.965 0.059 95.884);
  7673. --color-dark-300: oklch(0.938 0.089 92.952);
  7674. --color-dark-400: oklch(0.91 0.114 89.711);
  7675. --color-dark-500: oklch(0.88 0.136 86.375);
  7676. --color-dark: oklch(0.845 0.153 80.597);
  7677. --color-dark-700: oklch(0.71 0.137 75.734);
  7678. --color-dark-800: oklch(0.58 0.118 70.166);
  7679. --color-dark-900: oklch(0.449 0.097 65.209);
  7680. --color-dark-950: oklch(0.321 0.074 62.379);
  7681. --color-primaryBlack: oklch(0.116 0.054 267.087);
  7682. --color-primaryWhite: oklch(0.961 0.001 286.375);
  7683. --color-darkBlack: oklch(0.183 0.035 86.634);
  7684. --color-darkWhite: oklch(0.962 0.001 17.178);
  7685. --color-success: oklch(0.704 0.142 167.084);
  7686. --color-warning: oklch(0.558 0.154 47.186);
  7687. --color-error: oklch(0.564 0.223 28.46);
  7688. --color-info: oklch(0.482 0.14 261.518);
  7689. --color-extend0: oklch(0.703 0.149 235.059);
  7690. --color-Twitter: oklch(0.703 0.149 235.059);
  7691. --color-extend1: oklch(0.702 0.194 38.137);
  7692. --color-Svelte: oklch(0.702 0.194 38.137);
  7693. --color-extend2: oklch(0.482 0.107 161.212);
  7694. --color-Starbucks: oklch(0.482 0.107 161.212);
  7695. --color-black: oklch(0 0 0);
  7696. --color-white: oklch(1 0 0);
  7697. --color-gray-50: oklch(0.961 0 0);
  7698. --color-gray-100: oklch(0.925 0 0);
  7699. --color-gray-200: oklch(0.845 0 0);
  7700. --color-gray-300: oklch(0.767 0 0);
  7701. --color-gray-400: oklch(0.683 0 0);
  7702. --color-gray-500: oklch(0.6 0 0);
  7703. --color-gray-600: oklch(0.51 0 0);
  7704. --color-gray-700: oklch(0.42 0 0);
  7705. --color-gray-800: oklch(0.321 0 0);
  7706. --color-gray-900: oklch(0.218 0 0);
  7707. --color-gray-950: oklch(0.159 0 0);
  7708. --color-transparent: transparent;
  7709. --color-bug1: oklch(0.579 0.214 27.172);
  7710. --color-bug2: oklch(0.749 0.162 66.986);
  7711. --color-bug3: oklch(0.912 0.192 103.116);
  7712. --color-bug4: oklch(0.779 0.141 229.596);
  7713. --color-tailwind: oklch(0.746 0.16 232.661);
  7714. --color-svelte: oklch(0.702 0.194 38.137);
  7715. /* 抖动动效 */
  7716. --animate-shake: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  7717. @keyframes shake {
  7718. 10%,
  7719. 90% {
  7720. transform: translate3d(-1px, 0, 0);
  7721. }
  7722. 20%,
  7723. 80% {
  7724. transform: translate3d(2px, 0, 0);
  7725. }
  7726. 30%,
  7727. 50%,
  7728. 70% {
  7729. transform: translate3d(-4px, 0, 0);
  7730. }
  7731. 40%,
  7732. 60% {
  7733. transform: translate3d(4px, 0, 0);
  7734. }
  7735. }
  7736. /* 闪电动效 */
  7737. --animate-lightning: lightning 3s linear infinite;
  7738. @keyframes lightning {
  7739. 0% {
  7740. opacity: 0;
  7741. }
  7742. 10% {
  7743. opacity: 1;
  7744. }
  7745. 20% {
  7746. opacity: 0;
  7747. }
  7748. 30% {
  7749. opacity: 1;
  7750. }
  7751. 100% {
  7752. opacity: 0;
  7753. }
  7754. }
  7755. /* 路径动效 */
  7756. --animate-path: path 3s linear infinite;
  7757. @keyframes path {
  7758. 0% {
  7759. stroke-dashoffset: 400;
  7760. fill: transparent;
  7761. }
  7762. 31% {
  7763. stroke-dashoffset: 0;
  7764. fill: transparent;
  7765. }
  7766. 32% {
  7767. stroke-dashoffset: 0;
  7768. fill: currentColor;
  7769. opacity: 1;
  7770. }
  7771. 33% {
  7772. opacity: 0;
  7773. }
  7774. 35% {
  7775. opacity: 1;
  7776. }
  7777. 37% {
  7778. opacity: 0;
  7779. }
  7780. 39% {
  7781. opacity: 1;
  7782. }
  7783. 41% {
  7784. opacity: 0;
  7785. }
  7786. 43% {
  7787. opacity: 1;
  7788. }
  7789. 44% {
  7790. stroke-dashoffset: 0;
  7791. fill: currentColor;
  7792. }
  7793. 99% {
  7794. stroke-dashoffset: 0;
  7795. fill: currentColor;
  7796. }
  7797. 100% {
  7798. stroke-dashoffset: 400;
  7799. fill: transparent;
  7800. }
  7801. }
  7802. /* 动态背景动效 */
  7803. --animate-dynamicsBg: dynamicsBg 8s linear infinite;
  7804. @keyframes dynamicsBg {
  7805. 0% {
  7806. transform: rotate(360deg);
  7807. height: 14rem;
  7808. width: 14rem;
  7809. }
  7810. 50% {
  7811. height: 7rem;
  7812. width: 7rem;
  7813. }
  7814. 100% {
  7815. transform: rotate(0deg);
  7816. height: 14rem;
  7817. width: 14rem;
  7818. }
  7819. }
  7820. /* 云朵移动动效 */
  7821. --animate-cloudMove: cloudMove 40s linear infinite;
  7822. @keyframes cloudMove {
  7823. 0% {
  7824. transform: translateX(20%) translateY(-20%);
  7825. }
  7826. 50% {
  7827. transform: translateX(-100%) translateY(-20%);
  7828. }
  7829. 100% {
  7830. transform: translateX(20%) translateY(-20%);
  7831. }
  7832. }
  7833. /* 星星闪烁动效 */
  7834. --animate-starTwinkle: starTwinkle 8s linear infinite;
  7835. --animate-starTwinkle2: starTwinkle 3s linear infinite;
  7836. --animate-starTwinkle3: starTwinkle 6s linear infinite;
  7837. --animate-starTwinkle4: starTwinkle 4s linear infinite;
  7838. @keyframes starTwinkle {
  7839. 0% {
  7840. opacity: 1;
  7841. }
  7842. 40% {
  7843. opacity: 1;
  7844. }
  7845. 50% {
  7846. opacity: 0;
  7847. }
  7848. 60% {
  7849. opacity: 1;
  7850. }
  7851. 100% {
  7852. opacity: 1;
  7853. }
  7854. }
  7855. /* 元素上下慢慢循环移动动效 */
  7856. --animate-elementUpDownMove1: elementUpDownMove 12s linear infinite;
  7857. --animate-elementUpDownMove2: elementUpDownMove 10s linear infinite -12s;
  7858. --animate-elementUpDownMove3: elementUpDownMove 12s linear infinite -14s;
  7859. --animate-elementUpDownMove4: elementUpDownMove 8s linear infinite -10s;
  7860. --animate-elementUpDownMove5: elementUpDownMove 10s linear infinite -8s;
  7861. --animate-elementUpDownMove6: elementUpDownMove 12s linear infinite -6s;
  7862. @keyframes elementUpDownMove {
  7863. 0% {
  7864. transform: translateY(-20px);
  7865. }
  7866. 50% {
  7867. transform: translateY(20px);
  7868. }
  7869. 100% {
  7870. transform: translateY(-20px);
  7871. }
  7872. }
  7873. }
  7874. @source "../../../packages/stdf/dist/**/*.svelte";
  7875. pre {
  7876. background-color: transparent;
  7877. padding: 0;
  7878. }
  7879. *::-webkit-scrollbar {
  7880. width: 4px;
  7881. }
  7882. *::-webkit-scrollbar-thumb {
  7883. border-radius: 2px;
  7884. background-color: rgba(133, 133, 133, 0.5);
  7885. }
  7886. *::-webkit-scrollbar-track {
  7887. background-color: rgba(133, 133, 133, 0.2);
  7888. }
  7889. html {
  7890. overflow-x: hidden;
  7891. overflow-y: overlay;
  7892. /*scrollbar-gutter: stable;*/
  7893. /* scrollbar-gutter: stable both-edges; */
  7894. -webkit-tap-highlight-color: transparent;
  7895. }
  7896. * {
  7897. scrollbar-width: thin;
  7898. }
  7899. .prose :where(code):not(:where([class~='not-prose'] *))::before {
  7900. content: '' !important;
  7901. }
  7902. .prose :where(code):not(:where([class~='not-prose'] *))::after {
  7903. content: '' !important;
  7904. }
  7905. .prose :where(code):not(:where([class~='not-prose'] *)) {
  7906. padding-left: 4px;
  7907. padding-right: 4px;
  7908. border-radius: 2px;
  7909. background: #e4e4e4 !important;
  7910. }
  7911. .dark .dark\:prose-invert :where(code):not(:where([class~='not-prose'] *)) {
  7912. background: #202020 !important;
  7913. }
  7914. /*!
  7915. Theme: GitHub Light
  7916. */
  7917. .prose pre code.hljs {
  7918. background: #e4e4e4 !important;
  7919. }
  7920. .prose pre code.hljs {
  7921. display: block;
  7922. overflow-x: auto;
  7923. padding: 1em;
  7924. }
  7925. .prose code.hljs {
  7926. padding: 3px 5px;
  7927. }
  7928. .prose .hljs {
  7929. /* background: #ebebeb !important; */
  7930. color: #434f54;
  7931. }
  7932. .prose .hljs-subst {
  7933. color: #434f54;
  7934. }
  7935. .prose .hljs-attribute,
  7936. .prose .hljs-doctag,
  7937. .prose .hljs-keyword,
  7938. .prose .hljs-name,
  7939. .prose .hljs-selector-tag {
  7940. /* color: #00979d; */
  7941. /* color: #0B24FB; */
  7942. /* color: #ff3e00; */
  7943. color: #af10a7;
  7944. }
  7945. .prose .hljs-addition,
  7946. .prose .hljs-built_in,
  7947. .prose .hljs-bullet,
  7948. .prose .hljs-code,
  7949. .prose .hljs-literal {
  7950. color: #d35400;
  7951. }
  7952. .prose .hljs-link,
  7953. .prose .hljs-regexp,
  7954. .prose .hljs-selector-attr,
  7955. .prose .hljs-selector-pseudo,
  7956. .prose .hljs-symbol,
  7957. .prose .hljs-template-variable,
  7958. .prose .hljs-variable {
  7959. /* color: #00979d; */
  7960. color: #0b24fb;
  7961. /* font-weight: bold; */
  7962. /* color: #8a3ce2; */
  7963. }
  7964. .prose .hljs-deletion,
  7965. .prose .hljs-quote,
  7966. .prose .hljs-selector-class,
  7967. .prose .hljs-selector-id,
  7968. .prose .hljs-string,
  7969. .prose .hljs-template-tag,
  7970. .prose .hljs-type {
  7971. /* color: #005c5f; */
  7972. color: rgb(56, 189, 248);
  7973. }
  7974. .prose .hljs-comment {
  7975. color: rgba(149, 165, 166, 0.8);
  7976. }
  7977. .prose .hljs-meta .hljs-keyword {
  7978. color: #728e00;
  7979. }
  7980. .prose .hljs-meta {
  7981. color: #434f54;
  7982. }
  7983. .prose .hljs-emphasis {
  7984. font-style: italic;
  7985. }
  7986. .prose .hljs-strong {
  7987. font-weight: 700;
  7988. }
  7989. .prose .hljs-function {
  7990. color: #728e00;
  7991. }
  7992. .prose .hljs-section,
  7993. .prose .hljs-title {
  7994. /* color: #800; */
  7995. color: #0b24fb;
  7996. font-weight: 700;
  7997. }
  7998. .prose .hljs-number {
  7999. color: #8a7b52;
  8000. }
  8001. .dark .dark\:prose-invert pre code.hljs {
  8002. background: #202020 !important;
  8003. }
  8004. .dark .dark\:prose-invert pre code.hljs {
  8005. display: block;
  8006. overflow-x: auto;
  8007. padding: 1em;
  8008. }
  8009. .dark .dark\:prose-invert code.hljs {
  8010. padding: 3px 5px;
  8011. }
  8012. /*!
  8013. Theme: GitHub Dark
  8014. */
  8015. .dark .dark\:prose-invert .hljs {
  8016. color: #c9d1d9;
  8017. /* background: #0d1117; */
  8018. }
  8019. .dark .dark\:prose-invert .hljs-doctag,
  8020. .dark .dark\:prose-invert .hljs-keyword,
  8021. .dark .dark\:prose-invert .hljs-meta .hljs-keyword,
  8022. .dark .dark\:prose-invert .hljs-template-tag,
  8023. .dark .dark\:prose-invert .hljs-template-variable,
  8024. .dark .dark\:prose-invert .hljs-type,
  8025. .dark .dark\:prose-invert .hljs-variable.language_ {
  8026. /* color: #ff7b72; */
  8027. color: #ffc043;
  8028. }
  8029. .dark .dark\:prose-invert .hljs-title,
  8030. .dark .dark\:prose-invert .hljs-title.class_,
  8031. .dark .dark\:prose-invert .hljs-title.class_.inherited__,
  8032. .dark .dark\:prose-invert .hljs-title.function_ {
  8033. color: #d2a8ff;
  8034. }
  8035. .dark .dark\:prose-invert .hljs-attr,
  8036. .dark .dark\:prose-invert .hljs-attribute,
  8037. .dark .dark\:prose-invert .hljs-literal,
  8038. .dark .dark\:prose-invert .hljs-meta,
  8039. .dark .dark\:prose-invert .hljs-number,
  8040. .dark .dark\:prose-invert .hljs-operator,
  8041. .dark .dark\:prose-invert .hljs-selector-attr,
  8042. .dark .dark\:prose-invert .hljs-selector-class,
  8043. .dark .dark\:prose-invert .hljs-selector-id,
  8044. .dark .dark\:prose-invert .hljs-variable {
  8045. color: #79c0ff;
  8046. }
  8047. .dark .dark\:prose-invert .hljs-meta .hljs-string,
  8048. .dark .dark\:prose-invert .hljs-regexp,
  8049. .dark .dark\:prose-invert .hljs-string {
  8050. color: #a5d6ff;
  8051. }
  8052. .dark .dark\:prose-invert .hljs-built_in,
  8053. .dark .dark\:prose-invert .hljs-symbol {
  8054. color: #ffa657;
  8055. }
  8056. .dark .dark\:prose-invert .hljs-code,
  8057. .dark .dark\:prose-invert .hljs-comment,
  8058. .dark .dark\:prose-invert .hljs-formula {
  8059. color: #8b949e;
  8060. }
  8061. .dark .dark\:prose-invert .hljs-name,
  8062. .dark .dark\:prose-invert .hljs-quote,
  8063. .dark .dark\:prose-invert .hljs-selector-pseudo,
  8064. .dark .dark\:prose-invert .hljs-selector-tag {
  8065. color: #7ee787;
  8066. }
  8067. .dark .dark\:prose-invert .hljs-subst {
  8068. color: #c9d1d9;
  8069. }
  8070. .dark .dark\:prose-invert .hljs-section {
  8071. color: #1f6feb;
  8072. font-weight: 700;
  8073. }
  8074. .dark .dark\:prose-invert .hljs-bullet {
  8075. color: #f2cc60;
  8076. }
  8077. .dark .dark\:prose-invert .hljs-emphasis {
  8078. color: #c9d1d9;
  8079. font-style: italic;
  8080. }
  8081. .dark .dark\:prose-invert .hljs-strong {
  8082. color: #c9d1d9;
  8083. font-weight: 700;
  8084. }
  8085. .dark .dark\:prose-invert .hljs-addition {
  8086. color: #aff5b4;
  8087. background-color: #033a16;
  8088. }
  8089. .dark .dark\:prose-invert .hljs-deletion {
  8090. color: #ffdcd7;
  8091. background-color: #67060c;
  8092. }
  8093. @font-face {
  8094. font-family: 'JetBrainsMono';
  8095. src: url('/assets/fonts/JetBrainsMono-Regular.woff2');
  8096. }
  8097. code {
  8098. font-family: 'JetBrainsMono' !important;
  8099. }
  8100. /* 模拟设计软件的透明层 */
  8101. .transparent-background {
  8102. background-image: linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%),
  8103. linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%);
  8104. background-position:
  8105. 0 0,
  8106. 10px 10px;
  8107. background-size: 20px 20px;
  8108. }
  8109. @keyframes clip {
  8110. from {
  8111. clip-path: circle(0% at var(--x) var(--y));
  8112. }
  8113. to {
  8114. clip-path: circle(100% at var(--x) var(--y));
  8115. }
  8116. }
  8117. ::view-transition-old(root) {
  8118. animation: none;
  8119. }
  8120. ::view-transition-new(root) {
  8121. mix-blend-mode: normal;
  8122. animation: clip 0.6s ease-in;
  8123. }
  8124. ================================================
  8125. FILE: docs/site/src/app.d.ts
  8126. ================================================
  8127. // See https://svelte.dev/docs/kit/types#app.d.ts
  8128. // for information about these interfaces
  8129. declare global {
  8130. namespace App {
  8131. // interface Error {}
  8132. // interface Locals {}
  8133. // interface PageData {}
  8134. // interface PageState {}
  8135. // interface Platform {}
  8136. }
  8137. }
  8138. export {};
  8139. ================================================
  8140. FILE: docs/site/src/app.html
  8141. ================================================
  8142. <!doctype html>
  8143. <html lang="zh-CN">
  8144. <head>
  8145. <meta charset="utf-8" />
  8146. <meta name="viewport" content="width=device-width,initial-scale=1" />
  8147. <meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
  8148. <meta name="theme-color" content="#23262B" media="(prefers-color-scheme: dark)" />
  8149. <meta itemprop="name" content="STDF" />
  8150. <meta name="description" itemprop="description" content="Mobile web component library based on Svelte and Tailwind" />
  8151. <meta itemprop="image" content="./assets/images/logo.png" />
  8152. <title>STDF - 移动 web 组件库</title>
  8153. <link href="/favicon.ico" rel="icon" media="(prefers-color-scheme: light)" />
  8154. <link href="/favicon_black.ico" rel="icon" media="(prefers-color-scheme: dark)" />
  8155. %sveltekit.head%
  8156. </head>
  8157. <body
  8158. data-sveltekit-preload-data="hover"
  8159. class="selection:bg-primary dark:selection:bg-dark selection:text-white dark:selection:text-black"
  8160. >
  8161. <div style="display: contents">%sveltekit.body%</div>
  8162. </body>
  8163. </html>
  8164. ================================================
  8165. FILE: docs/site/src/global.d.ts
  8166. ================================================
  8167. /// <reference types="vite-plugin-md-to-html/types" />
  8168. ================================================
  8169. FILE: docs/site/src/store.ts
  8170. ================================================
  8171. import { writable } from 'svelte/store';
  8172. // 是否显示导航
  8173. export const isShowNavStore = writable(false);
  8174. // 文档 theme 模式,dark、light、auto。
  8175. export const themeStore = writable(localStorage.getItem('theme') || 'auto');
  8176. // 系统 theme 模式,dark、light
  8177. export const sysThemeStore = writable(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
  8178. // 当前 theme 模式,dark、light
  8179. const currentTheme =
  8180. (localStorage.getItem('theme') || 'auto') === 'auto'
  8181. ? window.matchMedia('(prefers-color-scheme: dark)').matches
  8182. ? 'dark'
  8183. : 'light'
  8184. : localStorage.getItem('theme') || 'auto';
  8185. export const currentThemeStore = writable(currentTheme);
  8186. // 是否开启 cmdK
  8187. export const isCmdKStore = writable(false);
  8188. // 是否显示赞赏
  8189. export const isShowFundStore = writable(false);
  8190. // 当前主题色
  8191. export const currentColorStore = writable(localStorage.getItem('theme_color') || 'STDF');
  8192. // 显示主题色选择器
  8193. export const showThemeSwitchStore = writable(false);
  8194. // 宽屏显示还是窄屏显示
  8195. export const isWideScreenStore = writable(localStorage.getItem('isFull') && localStorage.getItem('isFull') === 'full');
  8196. ================================================
  8197. FILE: docs/site/src/data/color.ts
  8198. ================================================
  8199. import { colorConvertFunc } from '../utils';
  8200. const colors = [
  8201. ['000000', 'Black'],
  8202. ['000080', 'Navy Blue'],
  8203. ['0000C8', 'Dark Blue'],
  8204. ['0000FF', 'Blue'],
  8205. ['000741', 'Stratos'],
  8206. ['001B1C', 'Swamp'],
  8207. ['002387', 'Resolution Blue'],
  8208. ['002900', 'Deep Fir'],
  8209. ['002E20', 'Burnham'],
  8210. ['002FA7', 'Klein Blue'],
  8211. ['003153', 'Prussian Blue'],
  8212. ['003366', 'Midnight Blue'],
  8213. ['003399', 'Smalt'],
  8214. ['003532', 'Deep Teal'],
  8215. ['003E40', 'Cyprus'],
  8216. ['004620', 'Kaitoke Green'],
  8217. ['0047AB', 'Cobalt'],
  8218. ['004816', 'Crusoe'],
  8219. ['004950', 'Sherpa Blue'],
  8220. ['0056A7', 'Endeavour'],
  8221. ['00581A', 'Camarone'],
  8222. ['0066CC', 'Science Blue'],
  8223. ['0066FF', 'Blue Ribbon'],
  8224. ['00755E', 'Tropical Rain Forest'],
  8225. ['0076A3', 'Allports'],
  8226. ['007BA7', 'Deep Cerulean'],
  8227. ['007EC7', 'Lochmara'],
  8228. ['007FFF', 'Azure Radiance'],
  8229. ['008080', 'Teal'],
  8230. ['0095B6', 'Bondi Blue'],
  8231. ['009DC4', 'Pacific Blue'],
  8232. ['00A693', 'Persian Green'],
  8233. ['00A86B', 'Jade'],
  8234. ['00CC99', 'Caribbean Green'],
  8235. ['00CCCC', "Robin's Egg Blue"],
  8236. ['00FF00', 'Green'],
  8237. ['00FF7F', 'Spring Green'],
  8238. ['00FFFF', 'Cyan / Aqua'],
  8239. ['010D1A', 'Blue Charcoal'],
  8240. ['011635', 'Midnight'],
  8241. ['011D13', 'Holly'],
  8242. ['012731', 'Daintree'],
  8243. ['01361C', 'Cardin Green'],
  8244. ['01371A', 'County Green'],
  8245. ['013E62', 'Astronaut Blue'],
  8246. ['013F6A', 'Regal Blue'],
  8247. ['014B43', 'Aqua Deep'],
  8248. ['015E85', 'Orient'],
  8249. ['016162', 'Blue Stone'],
  8250. ['016D39', 'Fun Green'],
  8251. ['01796F', 'Pine Green'],
  8252. ['017987', 'Blue Lagoon'],
  8253. ['01826B', 'Deep Sea'],
  8254. ['01A368', 'Green Haze'],
  8255. ['022D15', 'English Holly'],
  8256. ['02402C', 'Sherwood Green'],
  8257. ['02478E', 'Congress Blue'],
  8258. ['024E46', 'Evening Sea'],
  8259. ['026395', 'Bahama Blue'],
  8260. ['02866F', 'Observatory'],
  8261. ['02A4D3', 'Cerulean'],
  8262. ['03163C', 'Tangaroa'],
  8263. ['032B52', 'Green Vogue'],
  8264. ['036A6E', 'Mosque'],
  8265. ['041004', 'Midnight Moss'],
  8266. ['041322', 'Black Pearl'],
  8267. ['042E4C', 'Blue Whale'],
  8268. ['044022', 'Zuccini'],
  8269. ['044259', 'Teal Blue'],
  8270. ['051040', 'Deep Cove'],
  8271. ['051657', 'Gulf Blue'],
  8272. ['055989', 'Venice Blue'],
  8273. ['056F57', 'Watercourse'],
  8274. ['062A78', 'Catalina Blue'],
  8275. ['063537', 'Tiber'],
  8276. ['069B81', 'Gossamer'],
  8277. ['06A189', 'Niagara'],
  8278. ['073A50', 'Tarawera'],
  8279. ['080110', 'Jaguar'],
  8280. ['081910', 'Black Bean'],
  8281. ['082567', 'Deep Sapphire'],
  8282. ['088370', 'Elf Green'],
  8283. ['08E8DE', 'Bright Turquoise'],
  8284. ['092256', 'Downriver'],
  8285. ['09230F', 'Palm Green'],
  8286. ['09255D', 'Madison'],
  8287. ['093624', 'Bottle Green'],
  8288. ['095859', 'Deep Sea Green'],
  8289. ['097F4B', 'Salem'],
  8290. ['0A001C', 'Black Russian'],
  8291. ['0A480D', 'Dark Fern'],
  8292. ['0A6906', 'Japanese Laurel'],
  8293. ['0A6F75', 'Atoll'],
  8294. ['0B0B0B', 'Cod Gray'],
  8295. ['0B0F08', 'Marshland'],
  8296. ['0B1107', 'Gordons Green'],
  8297. ['0B1304', 'Black Forest'],
  8298. ['0B6207', 'San Felix'],
  8299. ['0BDA51', 'Malachite'],
  8300. ['0C0B1D', 'Ebony'],
  8301. ['0C0D0F', 'Woodsmoke'],
  8302. ['0C1911', 'Racing Green'],
  8303. ['0C7A79', 'Surfie Green'],
  8304. ['0C8990', 'Blue Chill'],
  8305. ['0D0332', 'Black Rock'],
  8306. ['0D1117', 'Bunker'],
  8307. ['0D1C19', 'Aztec'],
  8308. ['0D2E1C', 'Bush'],
  8309. ['0E0E18', 'Cinder'],
  8310. ['0E2A30', 'Firefly'],
  8311. ['0F2D9E', 'Torea Bay'],
  8312. ['10121D', 'Vulcan'],
  8313. ['101405', 'Green Waterloo'],
  8314. ['105852', 'Eden'],
  8315. ['110C6C', 'Arapawa'],
  8316. ['120A8F', 'Ultramarine'],
  8317. ['123447', 'Elephant'],
  8318. ['126B40', 'Jewel'],
  8319. ['130000', 'Diesel'],
  8320. ['130A06', 'Asphalt'],
  8321. ['13264D', 'Blue Zodiac'],
  8322. ['134F19', 'Parsley'],
  8323. ['140600', 'Nero'],
  8324. ['1450AA', 'Tory Blue'],
  8325. ['151F4C', 'Bunting'],
  8326. ['1560BD', 'Denim'],
  8327. ['15736B', 'Genoa'],
  8328. ['161928', 'Mirage'],
  8329. ['161D10', 'Hunter Green'],
  8330. ['162A40', 'Big Stone'],
  8331. ['163222', 'Celtic'],
  8332. ['16322C', 'Timber Green'],
  8333. ['163531', 'Gable Green'],
  8334. ['171F04', 'Pine Tree'],
  8335. ['175579', 'Chathams Blue'],
  8336. ['182D09', 'Deep Forest Green'],
  8337. ['18587A', 'Blumine'],
  8338. ['19330E', 'Palm Leaf'],
  8339. ['193751', 'Nile Blue'],
  8340. ['1959A8', 'Fun Blue'],
  8341. ['1A1A68', 'Lucky Point'],
  8342. ['1AB385', 'Mountain Meadow'],
  8343. ['1B0245', 'Tolopea'],
  8344. ['1B1035', 'Haiti'],
  8345. ['1B127B', 'Deep Koamaru'],
  8346. ['1B1404', 'Acadia'],
  8347. ['1B2F11', 'Seaweed'],
  8348. ['1B3162', 'Biscay'],
  8349. ['1B659D', 'Matisse'],
  8350. ['1C1208', 'Crowshead'],
  8351. ['1C1E13', 'Rangoon Green'],
  8352. ['1C39BB', 'Persian Blue'],
  8353. ['1C402E', 'Everglade'],
  8354. ['1C7C7D', 'Elm'],
  8355. ['1D6142', 'Green Pea'],
  8356. ['1E0F04', 'Creole'],
  8357. ['1E1609', 'Karaka'],
  8358. ['1E1708', 'El Paso'],
  8359. ['1E385B', 'Cello'],
  8360. ['1E433C', 'Te Papa Green'],
  8361. ['1E90FF', 'Dodger Blue'],
  8362. ['1E9AB0', 'Eastern Blue'],
  8363. ['1F120F', 'Night Rider'],
  8364. ['1FC2C2', 'Java'],
  8365. ['20208D', 'Jacksons Purple'],
  8366. ['202E54', 'Cloud Burst'],
  8367. ['204852', 'Blue Dianne'],
  8368. ['211A0E', 'Eternity'],
  8369. ['220878', 'Deep Blue'],
  8370. ['228B22', 'Forest Green'],
  8371. ['233418', 'Mallard'],
  8372. ['240A40', 'Violet'],
  8373. ['240C02', 'Kilamanjaro'],
  8374. ['242A1D', 'Log Cabin'],
  8375. ['242E16', 'Black Olive'],
  8376. ['24500F', 'Green House'],
  8377. ['251607', 'Graphite'],
  8378. ['251706', 'Cannon Black'],
  8379. ['251F4F', 'Port Gore'],
  8380. ['25272C', 'Shark'],
  8381. ['25311C', 'Green Kelp'],
  8382. ['2596D1', 'Curious Blue'],
  8383. ['260368', 'Paua'],
  8384. ['26056A', 'Paris M'],
  8385. ['261105', 'Wood Bark'],
  8386. ['261414', 'Gondola'],
  8387. ['262335', 'Steel Gray'],
  8388. ['26283B', 'Ebony Clay'],
  8389. ['273A81', 'Bay of Many'],
  8390. ['27504B', 'Plantation'],
  8391. ['278A5B', 'Eucalyptus'],
  8392. ['281E15', 'Oil'],
  8393. ['283A77', 'Astronaut'],
  8394. ['286ACD', 'Mariner'],
  8395. ['290C5E', 'Violent Violet'],
  8396. ['292130', 'Bastille'],
  8397. ['292319', 'Zeus'],
  8398. ['292937', 'Charade'],
  8399. ['297B9A', 'Jelly Bean'],
  8400. ['29AB87', 'Jungle Green'],
  8401. ['2A0359', 'Cherry Pie'],
  8402. ['2A140E', 'Coffee Bean'],
  8403. ['2A2630', 'Baltic Sea'],
  8404. ['2A380B', 'Turtle Green'],
  8405. ['2A52BE', 'Cerulean Blue'],
  8406. ['2B0202', 'Sepia Black'],
  8407. ['2B194F', 'Valhalla'],
  8408. ['2B3228', 'Heavy Metal'],
  8409. ['2C0E8C', 'Blue Gem'],
  8410. ['2C1632', 'Revolver'],
  8411. ['2C2133', 'Bleached Cedar'],
  8412. ['2C8C84', 'Lochinvar'],
  8413. ['2D2510', 'Mikado'],
  8414. ['2D383A', 'Outer Space'],
  8415. ['2D569B', 'St Tropaz'],
  8416. ['2E0329', 'Jacaranda'],
  8417. ['2E1905', 'Jacko Bean'],
  8418. ['2E3222', 'Rangitoto'],
  8419. ['2E3F62', 'Rhino'],
  8420. ['2E8B57', 'Sea Green'],
  8421. ['2EBFD4', 'Scooter'],
  8422. ['2F270E', 'Onion'],
  8423. ['2F3CB3', 'Governor Bay'],
  8424. ['2F519E', 'Sapphire'],
  8425. ['2F5A57', 'Spectra'],
  8426. ['2F6168', 'Casal'],
  8427. ['300529', 'Melanzane'],
  8428. ['301F1E', 'Cocoa Brown'],
  8429. ['302A0F', 'Woodrush'],
  8430. ['304B6A', 'San Juan'],
  8431. ['30D5C8', 'Turquoise'],
  8432. ['311C17', 'Eclipse'],
  8433. ['314459', 'Pickled Bluewood'],
  8434. ['315BA1', 'Azure'],
  8435. ['31728D', 'Calypso'],
  8436. ['317D82', 'Paradiso'],
  8437. ['32127A', 'Persian Indigo'],
  8438. ['32293A', 'Blackcurrant'],
  8439. ['323232', 'Mine Shaft'],
  8440. ['325D52', 'Stromboli'],
  8441. ['327C14', 'Bilbao'],
  8442. ['327DA0', 'Astral'],
  8443. ['33036B', 'Christalle'],
  8444. ['33292F', 'Thunder'],
  8445. ['33CC99', 'Shamrock'],
  8446. ['341515', 'Tamarind'],
  8447. ['350036', 'Mardi Gras'],
  8448. ['350E42', 'Valentino'],
  8449. ['350E57', 'Jagger'],
  8450. ['353542', 'Tuna'],
  8451. ['354E8C', 'Chambray'],
  8452. ['363050', 'Martinique'],
  8453. ['363534', 'Tuatara'],
  8454. ['363C0D', 'Waiouru'],
  8455. ['36747D', 'Ming'],
  8456. ['368716', 'La Palma'],
  8457. ['370202', 'Chocolate'],
  8458. ['371D09', 'Clinker'],
  8459. ['37290E', 'Brown Tumbleweed'],
  8460. ['373021', 'Birch'],
  8461. ['377475', 'Oracle'],
  8462. ['380474', 'Blue Diamond'],
  8463. ['381A51', 'Grape'],
  8464. ['383533', 'Dune'],
  8465. ['384555', 'Oxford Blue'],
  8466. ['384910', 'Clover'],
  8467. ['394851', 'Limed Spruce'],
  8468. ['396413', 'Dell'],
  8469. ['3A0020', 'Toledo'],
  8470. ['3A2010', 'Sambuca'],
  8471. ['3A2A6A', 'Jacarta'],
  8472. ['3A686C', 'William'],
  8473. ['3A6A47', 'Killarney'],
  8474. ['3AB09E', 'Keppel'],
  8475. ['3B000B', 'Temptress'],
  8476. ['3B0910', 'Aubergine'],
  8477. ['3B1F1F', 'Jon'],
  8478. ['3B2820', 'Treehouse'],
  8479. ['3B7A57', 'Amazon'],
  8480. ['3B91B4', 'Boston Blue'],
  8481. ['3C0878', 'Windsor'],
  8482. ['3C1206', 'Rebel'],
  8483. ['3C1F76', 'Meteorite'],
  8484. ['3C2005', 'Dark Ebony'],
  8485. ['3C3910', 'Camouflage'],
  8486. ['3C4151', 'Bright Gray'],
  8487. ['3C4443', 'Cape Cod'],
  8488. ['3C493A', 'Lunar Green'],
  8489. ['3D0C02', 'Bean '],
  8490. ['3D2B1F', 'Bistre'],
  8491. ['3D7D52', 'Goblin'],
  8492. ['3E0480', 'Kingfisher Daisy'],
  8493. ['3E1C14', 'Cedar'],
  8494. ['3E2B23', 'English Walnut'],
  8495. ['3E2C1C', 'Black Marlin'],
  8496. ['3E3A44', 'Ship Gray'],
  8497. ['3EABBF', 'Pelorous'],
  8498. ['3F2109', 'Bronze'],
  8499. ['3F2500', 'Cola'],
  8500. ['3F3002', 'Madras'],
  8501. ['3F307F', 'Minsk'],
  8502. ['3F4C3A', 'Cabbage Pont'],
  8503. ['3F583B', 'Tom Thumb'],
  8504. ['3F5D53', 'Mineral Green'],
  8505. ['3FC1AA', 'Puerto Rico'],
  8506. ['3FFF00', 'Harlequin'],
  8507. ['401801', 'Brown Pod'],
  8508. ['40291D', 'Cork'],
  8509. ['403B38', 'Masala'],
  8510. ['403D19', 'Thatch Green'],
  8511. ['405169', 'Fiord'],
  8512. ['40826D', 'Viridian'],
  8513. ['40A860', 'Chateau Green'],
  8514. ['410056', 'Ripe Plum'],
  8515. ['411F10', 'Paco'],
  8516. ['412010', 'Deep Oak'],
  8517. ['413C37', 'Merlin'],
  8518. ['414257', 'Gun Powder'],
  8519. ['414C7D', 'East Bay'],
  8520. ['4169E1', 'Royal Blue'],
  8521. ['41AA78', 'Ocean Green'],
  8522. ['420303', 'Burnt Maroon'],
  8523. ['423921', 'Lisbon Brown'],
  8524. ['427977', 'Faded Jade'],
  8525. ['431560', 'Scarlet Gum'],
  8526. ['433120', 'Iroko'],
  8527. ['433E37', 'Armadillo'],
  8528. ['434C59', 'River Bed'],
  8529. ['436A0D', 'Green Leaf'],
  8530. ['44012D', 'Barossa'],
  8531. ['441D00', 'Morocco Brown'],
  8532. ['444954', 'Mako'],
  8533. ['454936', 'Kelp'],
  8534. ['456CAC', 'San Marino'],
  8535. ['45B1E8', 'Picton Blue'],
  8536. ['460B41', 'Loulou'],
  8537. ['462425', 'Crater Brown'],
  8538. ['465945', 'Gray Asparagus'],
  8539. ['4682B4', 'Steel Blue'],
  8540. ['480404', 'Rustic Red'],
  8541. ['480607', 'Bulgarian Rose'],
  8542. ['480656', 'Clairvoyant'],
  8543. ['481C1C', 'Cocoa Bean'],
  8544. ['483131', 'Woody Brown'],
  8545. ['483C32', 'Taupe'],
  8546. ['49170C', 'Van Cleef'],
  8547. ['492615', 'Brown Derby'],
  8548. ['49371B', 'Metallic Bronze'],
  8549. ['495400', 'Verdun Green'],
  8550. ['496679', 'Blue Bayoux'],
  8551. ['497183', 'Bismark'],
  8552. ['4A2A04', 'Bracken'],
  8553. ['4A3004', 'Deep Bronze'],
  8554. ['4A3C30', 'Mondo'],
  8555. ['4A4244', 'Tundora'],
  8556. ['4A444B', 'Gravel'],
  8557. ['4A4E5A', 'Trout'],
  8558. ['4B0082', 'Pigment Indigo'],
  8559. ['4B5D52', 'Nandor'],
  8560. ['4C3024', 'Saddle'],
  8561. ['4C4F56', 'Abbey'],
  8562. ['4D0135', 'Blackberry'],
  8563. ['4D0A18', 'Cab Sav'],
  8564. ['4D1E01', 'Indian Tan'],
  8565. ['4D282D', 'Cowboy'],
  8566. ['4D282E', 'Livid Brown'],
  8567. ['4D3833', 'Rock'],
  8568. ['4D3D14', 'Punga'],
  8569. ['4D400F', 'Bronzetone'],
  8570. ['4D5328', 'Woodland'],
  8571. ['4E0606', 'Mahogany'],
  8572. ['4E2A5A', 'Bossanova'],
  8573. ['4E3B41', 'Matterhorn'],
  8574. ['4E420C', 'Bronze Olive'],
  8575. ['4E4562', 'Mulled Wine'],
  8576. ['4E6649', 'Axolotl'],
  8577. ['4E7F9E', 'Wedgewood'],
  8578. ['4EABD1', 'Shakespeare'],
  8579. ['4F1C70', 'Honey Flower'],
  8580. ['4F2398', 'Daisy Bush'],
  8581. ['4F69C6', 'Indigo'],
  8582. ['4F7942', 'Fern Green'],
  8583. ['4F9D5D', 'Fruit Salad'],
  8584. ['4FA83D', 'Apple'],
  8585. ['504351', 'Mortar'],
  8586. ['507096', 'Kashmir Blue'],
  8587. ['507672', 'Cutty Sark'],
  8588. ['50C878', 'Emerald'],
  8589. ['514649', 'Emperor'],
  8590. ['516E3D', 'Chalet Green'],
  8591. ['517C66', 'Como'],
  8592. ['51808F', 'Smalt Blue'],
  8593. ['52001F', 'Castro'],
  8594. ['520C17', 'Maroon Oak'],
  8595. ['523C94', 'Gigas'],
  8596. ['533455', 'Voodoo'],
  8597. ['534491', 'Victoria'],
  8598. ['53824B', 'Hippie Green'],
  8599. ['541012', 'Heath'],
  8600. ['544333', 'Judge Gray'],
  8601. ['54534D', 'Fuscous Gray'],
  8602. ['549019', 'Vida Loca'],
  8603. ['55280C', 'Cioccolato'],
  8604. ['555B10', 'Saratoga'],
  8605. ['556D56', 'Finlandia'],
  8606. ['5590D9', 'Havelock Blue'],
  8607. ['56B4BE', 'Fountain Blue'],
  8608. ['578363', 'Spring Leaves'],
  8609. ['583401', 'Saddle Brown'],
  8610. ['585562', 'Scarpa Flow'],
  8611. ['587156', 'Cactus'],
  8612. ['589AAF', 'Hippie Blue'],
  8613. ['591D35', 'Wine Berry'],
  8614. ['592804', 'Brown Bramble'],
  8615. ['593737', 'Congo Brown'],
  8616. ['594433', 'Millbrook'],
  8617. ['5A6E9C', 'Waikawa Gray'],
  8618. ['5A87A0', 'Horizon'],
  8619. ['5B3013', 'Jambalaya'],
  8620. ['5C0120', 'Bordeaux'],
  8621. ['5C0536', 'Mulberry Wood'],
  8622. ['5C2E01', 'Carnaby Tan'],
  8623. ['5C5D75', 'Comet'],
  8624. ['5D1E0F', 'Redwood'],
  8625. ['5D4C51', 'Don Juan'],
  8626. ['5D5C58', 'Chicago'],
  8627. ['5D5E37', 'Verdigris'],
  8628. ['5D7747', 'Dingley'],
  8629. ['5DA19F', 'Breaker Bay'],
  8630. ['5E483E', 'Kabul'],
  8631. ['5E5D3B', 'Hemlock'],
  8632. ['5F3D26', 'Irish Coffee'],
  8633. ['5F5F6E', 'Mid Gray'],
  8634. ['5F6672', 'Shuttle Gray'],
  8635. ['5FA777', 'Aqua Forest'],
  8636. ['5FB3AC', 'Tradewind'],
  8637. ['604913', 'Horses Neck'],
  8638. ['605B73', 'Smoky'],
  8639. ['606E68', 'Corduroy'],
  8640. ['6093D1', 'Danube'],
  8641. ['612718', 'Espresso'],
  8642. ['614051', 'Eggplant'],
  8643. ['615D30', 'Costa Del Sol'],
  8644. ['61845F', 'Glade Green'],
  8645. ['622F30', 'Buccaneer'],
  8646. ['623F2D', 'Quincy'],
  8647. ['624E9A', 'Butterfly Bush'],
  8648. ['625119', 'West Coast'],
  8649. ['626649', 'Finch'],
  8650. ['639A8F', 'Patina'],
  8651. ['63B76C', 'Fern'],
  8652. ['6456B7', 'Blue Violet'],
  8653. ['646077', 'Dolphin'],
  8654. ['646463', 'Storm Dust'],
  8655. ['646A54', 'Siam'],
  8656. ['646E75', 'Nevada'],
  8657. ['6495ED', 'Cornflower Blue'],
  8658. ['64CCDB', 'Viking'],
  8659. ['65000B', 'Rosewood'],
  8660. ['651A14', 'Cherrywood'],
  8661. ['652DC1', 'Purple Heart'],
  8662. ['657220', 'Fern Frond'],
  8663. ['65745D', 'Willow Grove'],
  8664. ['65869F', 'Hoki'],
  8665. ['660045', 'Pompadour'],
  8666. ['660099', 'Purple'],
  8667. ['66023C', 'Tyrian Purple'],
  8668. ['661010', 'Dark Tan'],
  8669. ['66B58F', 'Silver Tree'],
  8670. ['66FF00', 'Bright Green'],
  8671. ['66FF66', "Screamin' Green"],
  8672. ['67032D', 'Black Rose'],
  8673. ['675FA6', 'Scampi'],
  8674. ['676662', 'Ironside Gray'],
  8675. ['678975', 'Viridian Green'],
  8676. ['67A712', 'Christi'],
  8677. ['683600', 'Nutmeg Wood Finish'],
  8678. ['685558', 'Zambezi'],
  8679. ['685E6E', 'Salt Box'],
  8680. ['692545', 'Tawny Port'],
  8681. ['692D54', 'Finn'],
  8682. ['695F62', 'Scorpion'],
  8683. ['697E9A', 'Lynch'],
  8684. ['6A442E', 'Spice'],
  8685. ['6A5D1B', 'Himalaya'],
  8686. ['6A6051', 'Soya Bean'],
  8687. ['6B2A14', 'Hairy Heath'],
  8688. ['6B3FA0', 'Royal Purple'],
  8689. ['6B4E31', 'Shingle Fawn'],
  8690. ['6B5755', 'Dorado'],
  8691. ['6B8BA2', 'Bermuda Gray'],
  8692. ['6B8E23', 'Olive Drab'],
  8693. ['6C3082', 'Eminence'],
  8694. ['6CDAE7', 'Turquoise Blue'],
  8695. ['6D0101', 'Lonestar'],
  8696. ['6D5E54', 'Pine Cone'],
  8697. ['6D6C6C', 'Dove Gray'],
  8698. ['6D9292', 'Juniper'],
  8699. ['6D92A1', 'Gothic'],
  8700. ['6E0902', 'Red Oxide'],
  8701. ['6E1D14', 'Moccaccino'],
  8702. ['6E4826', 'Pickled Bean'],
  8703. ['6E4B26', 'Dallas'],
  8704. ['6E6D57', 'Kokoda'],
  8705. ['6E7783', 'Pale Sky'],
  8706. ['6F440C', 'Cafe Royale'],
  8707. ['6F6A61', 'Flint'],
  8708. ['6F8E63', 'Highland'],
  8709. ['6F9D02', 'Limeade'],
  8710. ['6FD0C5', 'Downy'],
  8711. ['701C1C', 'Persian Plum'],
  8712. ['704214', 'Sepia'],
  8713. ['704A07', 'Antique Bronze'],
  8714. ['704F50', 'Ferra'],
  8715. ['706555', 'Coffee'],
  8716. ['708090', 'Slate Gray'],
  8717. ['711A00', 'Cedar Wood Finish'],
  8718. ['71291D', 'Metallic Copper'],
  8719. ['714693', 'Affair'],
  8720. ['714AB2', 'Studio'],
  8721. ['715D47', 'Tobacco Brown'],
  8722. ['716338', 'Yellow Metal'],
  8723. ['716B56', 'Peat'],
  8724. ['716E10', 'Olivetone'],
  8725. ['717486', 'Storm Gray'],
  8726. ['718080', 'Sirocco'],
  8727. ['71D9E2', 'Aquamarine Blue'],
  8728. ['72010F', 'Venetian Red'],
  8729. ['724A2F', 'Old Copper'],
  8730. ['726D4E', 'Go Ben'],
  8731. ['727B89', 'Raven'],
  8732. ['731E8F', 'Seance'],
  8733. ['734A12', 'Raw Umber'],
  8734. ['736C9F', 'Kimberly'],
  8735. ['736D58', 'Crocodile'],
  8736. ['737829', 'Crete'],
  8737. ['738678', 'Xanadu'],
  8738. ['74640D', 'Spicy Mustard'],
  8739. ['747D63', 'Limed Ash'],
  8740. ['747D83', 'Rolling Stone'],
  8741. ['748881', 'Blue Smoke'],
  8742. ['749378', 'Laurel'],
  8743. ['74C365', 'Mantis'],
  8744. ['755A57', 'Russett'],
  8745. ['7563A8', 'Deluge'],
  8746. ['76395D', 'Cosmic'],
  8747. ['7666C6', 'Blue Marguerite'],
  8748. ['76BD17', 'Lima'],
  8749. ['76D7EA', 'Sky Blue'],
  8750. ['770F05', 'Dark Burgundy'],
  8751. ['771F1F', 'Crown of Thorns'],
  8752. ['773F1A', 'Walnut'],
  8753. ['776F61', 'Pablo'],
  8754. ['778120', 'Pacifika'],
  8755. ['779E86', 'Oxley'],
  8756. ['77DD77', 'Pastel Green'],
  8757. ['780109', 'Japanese Maple'],
  8758. ['782D19', 'Mocha'],
  8759. ['782F16', 'Peanut'],
  8760. ['78866B', 'Camouflage Green'],
  8761. ['788A25', 'Wasabi'],
  8762. ['788BBA', 'Ship Cove'],
  8763. ['78A39C', 'Sea Nymph'],
  8764. ['795D4C', 'Roman Coffee'],
  8765. ['796878', 'Old Lavender'],
  8766. ['796989', 'Rum'],
  8767. ['796A78', 'Fedora'],
  8768. ['796D62', 'Sandstone'],
  8769. ['79DEEC', 'Spray'],
  8770. ['7A013A', 'Siren'],
  8771. ['7A58C1', 'Fuchsia Blue'],
  8772. ['7A7A7A', 'Boulder'],
  8773. ['7A89B8', 'Wild Blue Yonder'],
  8774. ['7AC488', 'De York'],
  8775. ['7B3801', 'Red Beech'],
  8776. ['7B3F00', 'Cinnamon'],
  8777. ['7B6608', 'Yukon Gold'],
  8778. ['7B7874', 'Tapa'],
  8779. ['7B7C94', 'Waterloo '],
  8780. ['7B8265', 'Flax Smoke'],
  8781. ['7B9F80', 'Amulet'],
  8782. ['7BA05B', 'Asparagus'],
  8783. ['7C1C05', 'Kenyan Copper'],
  8784. ['7C7631', 'Pesto'],
  8785. ['7C778A', 'Topaz'],
  8786. ['7C7B7A', 'Concord'],
  8787. ['7C7B82', 'Jumbo'],
  8788. ['7C881A', 'Trendy Green'],
  8789. ['7CA1A6', 'Gumbo'],
  8790. ['7CB0A1', 'Acapulco'],
  8791. ['7CB7BB', 'Neptune'],
  8792. ['7D2C14', 'Pueblo'],
  8793. ['7DA98D', 'Bay Leaf'],
  8794. ['7DC8F7', 'Malibu'],
  8795. ['7DD8C6', 'Bermuda'],
  8796. ['7E3A15', 'Copper Canyon'],
  8797. ['7F1734', 'Claret'],
  8798. ['7F3A02', 'Peru Tan'],
  8799. ['7F626D', 'Falcon'],
  8800. ['7F7589', 'Mobster'],
  8801. ['7F76D3', 'Moody Blue'],
  8802. ['7FFF00', 'Chartreuse'],
  8803. ['7FFFD4', 'Aquamarine'],
  8804. ['800000', 'Maroon'],
  8805. ['800B47', 'Rose Bud Cherry'],
  8806. ['801818', 'Falu Red'],
  8807. ['80341F', 'Red Robin'],
  8808. ['803790', 'Vivid Violet'],
  8809. ['80461B', 'Russet'],
  8810. ['807E79', 'Friar Gray'],
  8811. ['808000', 'Olive'],
  8812. ['808080', 'Gray'],
  8813. ['80B3AE', 'Gulf Stream'],
  8814. ['80B3C4', 'Glacier'],
  8815. ['80CCEA', 'Seagull'],
  8816. ['81422C', 'Nutmeg'],
  8817. ['816E71', 'Spicy Pink'],
  8818. ['817377', 'Empress'],
  8819. ['819885', 'Spanish Green'],
  8820. ['826F65', 'Sand Dune'],
  8821. ['828685', 'Gunsmoke'],
  8822. ['828F72', 'Battleship Gray'],
  8823. ['831923', 'Merlot'],
  8824. ['837050', 'Shadow'],
  8825. ['83AA5D', 'Chelsea Cucumber'],
  8826. ['83D0C6', 'Monte Carlo'],
  8827. ['843179', 'Plum'],
  8828. ['84A0A0', 'Granny Smith'],
  8829. ['8581D9', 'Chetwode Blue'],
  8830. ['858470', 'Bandicoot'],
  8831. ['859FAF', 'Bali Hai'],
  8832. ['85C4CC', 'Half Baked'],
  8833. ['860111', 'Red Devil'],
  8834. ['863C3C', 'Lotus'],
  8835. ['86483C', 'Ironstone'],
  8836. ['864D1E', 'Bull Shot'],
  8837. ['86560A', 'Rusty Nail'],
  8838. ['868974', 'Bitter'],
  8839. ['86949F', 'Regent Gray'],
  8840. ['871550', 'Disco'],
  8841. ['87756E', 'Americano'],
  8842. ['877C7B', 'Hurricane'],
  8843. ['878D91', 'Oslo Gray'],
  8844. ['87AB39', 'Sushi'],
  8845. ['885342', 'Spicy Mix'],
  8846. ['886221', 'Kumera'],
  8847. ['888387', 'Suva Gray'],
  8848. ['888D65', 'Avocado'],
  8849. ['893456', 'Camelot'],
  8850. ['893843', 'Solid Pink'],
  8851. ['894367', 'Cannon Pink'],
  8852. ['897D6D', 'Makara'],
  8853. ['8A3324', 'Burnt Umber'],
  8854. ['8A73D6', 'True V'],
  8855. ['8A8360', 'Clay Creek'],
  8856. ['8A8389', 'Monsoon'],
  8857. ['8A8F8A', 'Stack'],
  8858. ['8AB9F1', 'Jordy Blue'],
  8859. ['8B00FF', 'Electric Violet'],
  8860. ['8B0723', 'Monarch'],
  8861. ['8B6B0B', 'Corn Harvest'],
  8862. ['8B8470', 'Olive Haze'],
  8863. ['8B847E', 'Schooner'],
  8864. ['8B8680', 'Natural Gray'],
  8865. ['8B9C90', 'Mantle'],
  8866. ['8B9FEE', 'Portage'],
  8867. ['8BA690', 'Envy'],
  8868. ['8BA9A5', 'Cascade'],
  8869. ['8BE6D8', 'Riptide'],
  8870. ['8C055E', 'Cardinal Pink'],
  8871. ['8C472F', 'Mule Fawn'],
  8872. ['8C5738', 'Potters Clay'],
  8873. ['8C6495', 'Trendy Pink'],
  8874. ['8D0226', 'Paprika'],
  8875. ['8D3D38', 'Sanguine Brown'],
  8876. ['8D3F3F', 'Tosca'],
  8877. ['8D7662', 'Cement'],
  8878. ['8D8974', 'Granite Green'],
  8879. ['8D90A1', 'Manatee'],
  8880. ['8DA8CC', 'Polo Blue'],
  8881. ['8E0000', 'Red Berry'],
  8882. ['8E4D1E', 'Rope'],
  8883. ['8E6F70', 'Opium'],
  8884. ['8E775E', 'Domino'],
  8885. ['8E8190', 'Mamba'],
  8886. ['8EABC1', 'Nepal'],
  8887. ['8F021C', 'Pohutukawa'],
  8888. ['8F3E33', 'El Salva'],
  8889. ['8F4B0E', 'Korma'],
  8890. ['8F8176', 'Squirrel'],
  8891. ['8FD6B4', 'Vista Blue'],
  8892. ['900020', 'Burgundy'],
  8893. ['901E1E', 'Old Brick'],
  8894. ['907874', 'Hemp'],
  8895. ['907B71', 'Almond Frost'],
  8896. ['908D39', 'Sycamore'],
  8897. ['92000A', 'Sangria'],
  8898. ['924321', 'Cumin'],
  8899. ['926F5B', 'Beaver'],
  8900. ['928573', 'Stonewall'],
  8901. ['928590', 'Venus'],
  8902. ['9370DB', 'Medium Purple'],
  8903. ['93CCEA', 'Cornflower'],
  8904. ['93DFB8', 'Algae Green'],
  8905. ['944747', 'Copper Rust'],
  8906. ['948771', 'Arrowtown'],
  8907. ['950015', 'Scarlett'],
  8908. ['956387', 'Strikemaster'],
  8909. ['959396', 'Mountain Mist'],
  8910. ['960018', 'Carmine'],
  8911. ['964B00', 'Brown'],
  8912. ['967059', 'Leather'],
  8913. ['9678B6', "Purple Mountain's Majesty"],
  8914. ['967BB6', 'Lavender Purple'],
  8915. ['96A8A1', 'Pewter'],
  8916. ['96BBAB', 'Summer Green'],
  8917. ['97605D', 'Au Chico'],
  8918. ['9771B5', 'Wisteria'],
  8919. ['97CD2D', 'Atlantis'],
  8920. ['983D61', 'Vin Rouge'],
  8921. ['9874D3', 'Lilac Bush'],
  8922. ['98777B', 'Bazaar'],
  8923. ['98811B', 'Hacienda'],
  8924. ['988D77', 'Pale Oyster'],
  8925. ['98FF98', 'Mint Green'],
  8926. ['990066', 'Fresh Eggplant'],
  8927. ['991199', 'Violet Eggplant'],
  8928. ['991613', 'Tamarillo'],
  8929. ['991B07', 'Totem Pole'],
  8930. ['996666', 'Copper Rose'],
  8931. ['9966CC', 'Amethyst'],
  8932. ['997A8D', 'Mountbatten Pink'],
  8933. ['9999CC', 'Blue Bell'],
  8934. ['9A3820', 'Prairie Sand'],
  8935. ['9A6E61', 'Toast'],
  8936. ['9A9577', 'Gurkha'],
  8937. ['9AB973', 'Olivine'],
  8938. ['9AC2B8', 'Shadow Green'],
  8939. ['9B4703', 'Oregon'],
  8940. ['9B9E8F', 'Lemon Grass'],
  8941. ['9C3336', 'Stiletto'],
  8942. ['9D5616', 'Hawaiian Tan'],
  8943. ['9DACB7', 'Gull Gray'],
  8944. ['9DC209', 'Pistachio'],
  8945. ['9DE093', 'Granny Smith Apple'],
  8946. ['9DE5FF', 'Anakiwa'],
  8947. ['9E5302', 'Chelsea Gem'],
  8948. ['9E5B40', 'Sepia Skin'],
  8949. ['9EA587', 'Sage'],
  8950. ['9EA91F', 'Citron'],
  8951. ['9EB1CD', 'Rock Blue'],
  8952. ['9EDEE0', 'Morning Glory'],
  8953. ['9F381D', 'Cognac'],
  8954. ['9F821C', 'Reef Gold'],
  8955. ['9F9F9C', 'Star Dust'],
  8956. ['9FA0B1', 'Santas Gray'],
  8957. ['9FD7D3', 'Sinbad'],
  8958. ['9FDD8C', 'Feijoa'],
  8959. ['A02712', 'Tabasco'],
  8960. ['A1750D', 'Buttered Rum'],
  8961. ['A1ADB5', 'Hit Gray'],
  8962. ['A1C50A', 'Citrus'],
  8963. ['A1DAD7', 'Aqua Island'],
  8964. ['A1E9DE', 'Water Leaf'],
  8965. ['A2006D', 'Flirt'],
  8966. ['A23B6C', 'Rouge'],
  8967. ['A26645', 'Cape Palliser'],
  8968. ['A2AAB3', 'Gray Chateau'],
  8969. ['A2AEAB', 'Edward'],
  8970. ['A3807B', 'Pharlap'],
  8971. ['A397B4', 'Amethyst Smoke'],
  8972. ['A3E3ED', 'Blizzard Blue'],
  8973. ['A4A49D', 'Delta'],
  8974. ['A4A6D3', 'Wistful'],
  8975. ['A4AF6E', 'Green Smoke'],
  8976. ['A50B5E', 'Jazzberry Jam'],
  8977. ['A59B91', 'Zorba'],
  8978. ['A5CB0C', 'Bahia'],
  8979. ['A62F20', 'Roof Terracotta'],
  8980. ['A65529', 'Paarl'],
  8981. ['A68B5B', 'Barley Corn'],
  8982. ['A69279', 'Donkey Brown'],
  8983. ['A6A29A', 'Dawn'],
  8984. ['A72525', 'Mexican Red'],
  8985. ['A7882C', 'Luxor Gold'],
  8986. ['A85307', 'Rich Gold'],
  8987. ['A86515', 'Reno Sand'],
  8988. ['A86B6B', 'Coral Tree'],
  8989. ['A8989B', 'Dusty Gray'],
  8990. ['A899E6', 'Dull Lavender'],
  8991. ['A8A589', 'Tallow'],
  8992. ['A8AE9C', 'Bud'],
  8993. ['A8AF8E', 'Locust'],
  8994. ['A8BD9F', 'Norway'],
  8995. ['A8E3BD', 'Chinook'],
  8996. ['A9A491', 'Gray Olive'],
  8997. ['A9ACB6', 'Aluminium'],
  8998. ['A9B2C3', 'Cadet Blue'],
  8999. ['A9B497', 'Schist'],
  9000. ['A9BDBF', 'Tower Gray'],
  9001. ['A9BEF2', 'Perano'],
  9002. ['A9C6C2', 'Opal'],
  9003. ['AA375A', 'Night Shadz'],
  9004. ['AA4203', 'Fire'],
  9005. ['AA8B5B', 'Muesli'],
  9006. ['AA8D6F', 'Sandal'],
  9007. ['AAA5A9', 'Shady Lady'],
  9008. ['AAA9CD', 'Logan'],
  9009. ['AAABB7', 'Spun Pearl'],
  9010. ['AAD6E6', 'Regent St Blue'],
  9011. ['AAF0D1', 'Magic Mint'],
  9012. ['AB0563', 'Lipstick'],
  9013. ['AB3472', 'Royal Heath'],
  9014. ['AB917A', 'Sandrift'],
  9015. ['ABA0D9', 'Cold Purple'],
  9016. ['ABA196', 'Bronco'],
  9017. ['AC8A56', 'Limed Oak'],
  9018. ['AC91CE', 'East Side'],
  9019. ['AC9E22', 'Lemon Ginger'],
  9020. ['ACA494', 'Napa'],
  9021. ['ACA586', 'Hillary'],
  9022. ['ACA59F', 'Cloudy'],
  9023. ['ACACAC', 'Silver Chalice'],
  9024. ['ACB78E', 'Swamp Green'],
  9025. ['ACCBB1', 'Spring Rain'],
  9026. ['ACDD4D', 'Conifer'],
  9027. ['ACE1AF', 'Celadon'],
  9028. ['AD781B', 'Mandalay'],
  9029. ['ADBED1', 'Casper'],
  9030. ['ADDFAD', 'Moss Green'],
  9031. ['ADE6C4', 'Padua'],
  9032. ['ADFF2F', 'Green Yellow'],
  9033. ['AE4560', 'Hippie Pink'],
  9034. ['AE6020', 'Desert'],
  9035. ['AE809E', 'Bouquet'],
  9036. ['AF4035', 'Medium Carmine'],
  9037. ['AF4D43', 'Apple Blossom'],
  9038. ['AF593E', 'Brown Rust'],
  9039. ['AF8751', 'Driftwood'],
  9040. ['AF8F2C', 'Alpine'],
  9041. ['AF9F1C', 'Lucky'],
  9042. ['AFA09E', 'Martini'],
  9043. ['AFB1B8', 'Bombay'],
  9044. ['AFBDD9', 'Pigeon Post'],
  9045. ['B04C6A', 'Cadillac'],
  9046. ['B05D54', 'Matrix'],
  9047. ['B05E81', 'Tapestry'],
  9048. ['B06608', 'Mai Tai'],
  9049. ['B09A95', 'Del Rio'],
  9050. ['B0E0E6', 'Powder Blue'],
  9051. ['B0E313', 'Inch Worm'],
  9052. ['B10000', 'Bright Red'],
  9053. ['B14A0B', 'Vesuvius'],
  9054. ['B1610B', 'Pumpkin Skin'],
  9055. ['B16D52', 'Santa Fe'],
  9056. ['B19461', 'Teak'],
  9057. ['B1E2C1', 'Fringy Flower'],
  9058. ['B1F4E7', 'Ice Cold'],
  9059. ['B20931', 'Shiraz'],
  9060. ['B2A1EA', 'Biloba Flower'],
  9061. ['B32D29', 'Tall Poppy'],
  9062. ['B35213', 'Fiery Orange'],
  9063. ['B38007', 'Hot Toddy'],
  9064. ['B3AF95', 'Taupe Gray'],
  9065. ['B3C110', 'La Rioja'],
  9066. ['B43332', 'Well Read'],
  9067. ['B44668', 'Blush'],
  9068. ['B4CFD3', 'Jungle Mist'],
  9069. ['B57281', 'Turkish Rose'],
  9070. ['B57EDC', 'Lavender'],
  9071. ['B5A27F', 'Mongoose'],
  9072. ['B5B35C', 'Olive Green'],
  9073. ['B5D2CE', 'Jet Stream'],
  9074. ['B5ECDF', 'Cruise'],
  9075. ['B6316C', 'Hibiscus'],
  9076. ['B69D98', 'Thatch'],
  9077. ['B6B095', 'Heathered Gray'],
  9078. ['B6BAA4', 'Eagle'],
  9079. ['B6D1EA', 'Spindle'],
  9080. ['B6D3BF', 'Gum Leaf'],
  9081. ['B7410E', 'Rust'],
  9082. ['B78E5C', 'Muddy Waters'],
  9083. ['B7A214', 'Sahara'],
  9084. ['B7A458', 'Husk'],
  9085. ['B7B1B1', 'Nobel'],
  9086. ['B7C3D0', 'Heather'],
  9087. ['B7F0BE', 'Madang'],
  9088. ['B81104', 'Milano Red'],
  9089. ['B87333', 'Copper'],
  9090. ['B8B56A', 'Gimblet'],
  9091. ['B8C1B1', 'Green Spring'],
  9092. ['B8C25D', 'Celery'],
  9093. ['B8E0F9', 'Sail'],
  9094. ['B94E48', 'Chestnut'],
  9095. ['B95140', 'Crail'],
  9096. ['B98D28', 'Marigold'],
  9097. ['B9C46A', 'Wild Willow'],
  9098. ['B9C8AC', 'Rainee'],
  9099. ['BA0101', 'Guardsman Red'],
  9100. ['BA450C', 'Rock Spray'],
  9101. ['BA6F1E', 'Bourbon'],
  9102. ['BA7F03', 'Pirate Gold'],
  9103. ['BAB1A2', 'Nomad'],
  9104. ['BAC7C9', 'Submarine'],
  9105. ['BAEEF9', 'Charlotte'],
  9106. ['BB3385', 'Medium Red Violet'],
  9107. ['BB8983', 'Brandy Rose'],
  9108. ['BBD009', 'Rio Grande'],
  9109. ['BBD7C1', 'Surf'],
  9110. ['BCC9C2', 'Powder Ash'],
  9111. ['BD5E2E', 'Tuscany'],
  9112. ['BD978E', 'Quicksand'],
  9113. ['BDB1A8', 'Silk'],
  9114. ['BDB2A1', 'Malta'],
  9115. ['BDB3C7', 'Chatelle'],
  9116. ['BDBBD7', 'Lavender Gray'],
  9117. ['BDBDC6', 'French Gray'],
  9118. ['BDC8B3', 'Clay Ash'],
  9119. ['BDC9CE', 'Loblolly'],
  9120. ['BDEDFD', 'French Pass'],
  9121. ['BEA6C3', 'London Hue'],
  9122. ['BEB5B7', 'Pink Swan'],
  9123. ['BEDE0D', 'Fuego'],
  9124. ['BF5500', 'Rose of Sharon'],
  9125. ['BFB8B0', 'Tide'],
  9126. ['BFBED8', 'Blue Haze'],
  9127. ['BFC1C2', 'Silver Sand'],
  9128. ['BFC921', 'Key Lime Pie'],
  9129. ['BFDBE2', 'Ziggurat'],
  9130. ['BFFF00', 'Lime'],
  9131. ['C02B18', 'Thunderbird'],
  9132. ['C04737', 'Mojo'],
  9133. ['C08081', 'Old Rose'],
  9134. ['C0C0C0', 'Silver'],
  9135. ['C0D3B9', 'Pale Leaf'],
  9136. ['C0D8B6', 'Pixie Green'],
  9137. ['C1440E', 'Tia Maria'],
  9138. ['C154C1', 'Fuchsia Pink'],
  9139. ['C1A004', 'Buddha Gold'],
  9140. ['C1B7A4', 'Bison Hide'],
  9141. ['C1BAB0', 'Tea'],
  9142. ['C1BECD', 'Gray Suit'],
  9143. ['C1D7B0', 'Sprout'],
  9144. ['C1F07C', 'Sulu'],
  9145. ['C26B03', 'Indochine'],
  9146. ['C2955D', 'Twine'],
  9147. ['C2BDB6', 'Cotton Seed'],
  9148. ['C2CAC4', 'Pumice'],
  9149. ['C2E8E5', 'Jagged Ice'],
  9150. ['C32148', 'Maroon Flush'],
  9151. ['C3B091', 'Indian Khaki'],
  9152. ['C3BFC1', 'Pale Slate'],
  9153. ['C3C3BD', 'Gray Nickel'],
  9154. ['C3CDE6', 'Periwinkle Gray'],
  9155. ['C3D1D1', 'Tiara'],
  9156. ['C3DDF9', 'Tropical Blue'],
  9157. ['C41E3A', 'Cardinal'],
  9158. ['C45655', 'Fuzzy Wuzzy Brown'],
  9159. ['C45719', 'Orange Roughy'],
  9160. ['C4C4BC', 'Mist Gray'],
  9161. ['C4D0B0', 'Coriander'],
  9162. ['C4F4EB', 'Mint Tulip'],
  9163. ['C54B8C', 'Mulberry'],
  9164. ['C59922', 'Nugget'],
  9165. ['C5994B', 'Tussock'],
  9166. ['C5DBCA', 'Sea Mist'],
  9167. ['C5E17A', 'Yellow Green'],
  9168. ['C62D42', 'Brick Red'],
  9169. ['C6726B', 'Contessa'],
  9170. ['C69191', 'Oriental Pink'],
  9171. ['C6A84B', 'Roti'],
  9172. ['C6C3B5', 'Ash'],
  9173. ['C6C8BD', 'Kangaroo'],
  9174. ['C6E610', 'Las Palmas'],
  9175. ['C7031E', 'Monza'],
  9176. ['C71585', 'Red Violet'],
  9177. ['C7BCA2', 'Coral Reef'],
  9178. ['C7C1FF', 'Melrose'],
  9179. ['C7C4BF', 'Cloud'],
  9180. ['C7C9D5', 'Ghost'],
  9181. ['C7CD90', 'Pine Glade'],
  9182. ['C7DDE5', 'Botticelli'],
  9183. ['C88A65', 'Antique Brass'],
  9184. ['C8A2C8', 'Lilac'],
  9185. ['C8A528', 'Hokey Pokey'],
  9186. ['C8AABF', 'Lily'],
  9187. ['C8B568', 'Laser'],
  9188. ['C8E3D7', 'Edgewater'],
  9189. ['C96323', 'Piper'],
  9190. ['C99415', 'Pizza'],
  9191. ['C9A0DC', 'Light Wisteria'],
  9192. ['C9B29B', 'Rodeo Dust'],
  9193. ['C9B35B', 'Sundance'],
  9194. ['C9B93B', 'Earls Green'],
  9195. ['C9C0BB', 'Silver Rust'],
  9196. ['C9D9D2', 'Conch'],
  9197. ['C9FFA2', 'Reef'],
  9198. ['C9FFE5', 'Aero Blue'],
  9199. ['CA3435', 'Flush Mahogany'],
  9200. ['CABB48', 'Turmeric'],
  9201. ['CADCD4', 'Paris White'],
  9202. ['CAE00D', 'Bitter Lemon'],
  9203. ['CAE6DA', 'Skeptic'],
  9204. ['CB8FA9', 'Viola'],
  9205. ['CBCAB6', 'Foggy Gray'],
  9206. ['CBD3B0', 'Green Mist'],
  9207. ['CBDBD6', 'Nebula'],
  9208. ['CC3333', 'Persian Red'],
  9209. ['CC5500', 'Burnt Orange'],
  9210. ['CC7722', 'Ochre'],
  9211. ['CC8899', 'Puce'],
  9212. ['CCCAA8', 'Thistle Green'],
  9213. ['CCCCFF', 'Periwinkle'],
  9214. ['CCFF00', 'Electric Lime'],
  9215. ['CD5700', 'Tenn'],
  9216. ['CD5C5C', 'Chestnut Rose'],
  9217. ['CD8429', 'Brandy Punch'],
  9218. ['CDF4FF', 'Onahau'],
  9219. ['CEB98F', 'Sorrell Brown'],
  9220. ['CEBABA', 'Cold Turkey'],
  9221. ['CEC291', 'Yuma'],
  9222. ['CEC7A7', 'Chino'],
  9223. ['CFA39D', 'Eunry'],
  9224. ['CFB53B', 'Old Gold'],
  9225. ['CFDCCF', 'Tasman'],
  9226. ['CFE5D2', 'Surf Crest'],
  9227. ['CFF9F3', 'Humming Bird'],
  9228. ['CFFAF4', 'Scandal'],
  9229. ['D05F04', 'Red Stage'],
  9230. ['D06DA1', 'Hopbush'],
  9231. ['D07D12', 'Meteor'],
  9232. ['D0BEF8', 'Perfume'],
  9233. ['D0C0E5', 'Prelude'],
  9234. ['D0F0C0', 'Tea Green'],
  9235. ['D18F1B', 'Geebung'],
  9236. ['D1BEA8', 'Vanilla'],
  9237. ['D1C6B4', 'Soft Amber'],
  9238. ['D1D2CA', 'Celeste'],
  9239. ['D1D2DD', 'Mischka'],
  9240. ['D1E231', 'Pear'],
  9241. ['D2691E', 'Hot Cinnamon'],
  9242. ['D27D46', 'Raw Sienna'],
  9243. ['D29EAA', 'Careys Pink'],
  9244. ['D2B48C', 'Tan'],
  9245. ['D2DA97', 'Deco'],
  9246. ['D2F6DE', 'Blue Romance'],
  9247. ['D2F8B0', 'Gossip'],
  9248. ['D3CBBA', 'Sisal'],
  9249. ['D3CDC5', 'Swirl'],
  9250. ['D47494', 'Charm'],
  9251. ['D4B6AF', 'Clam Shell'],
  9252. ['D4BF8D', 'Straw'],
  9253. ['D4C4A8', 'Akaroa'],
  9254. ['D4CD16', 'Bird Flower'],
  9255. ['D4D7D9', 'Iron'],
  9256. ['D4DFE2', 'Geyser'],
  9257. ['D4E2FC', 'Hawkes Blue'],
  9258. ['D54600', 'Grenadier'],
  9259. ['D591A4', 'Can Can'],
  9260. ['D59A6F', 'Whiskey'],
  9261. ['D5D195', 'Winter Hazel'],
  9262. ['D5F6E3', 'Granny Apple'],
  9263. ['D69188', 'My Pink'],
  9264. ['D6C562', 'Tacha'],
  9265. ['D6CEF6', 'Moon Raker'],
  9266. ['D6D6D1', 'Quill Gray'],
  9267. ['D6FFDB', 'Snowy Mint'],
  9268. ['D7837F', 'New York Pink'],
  9269. ['D7C498', 'Pavlova'],
  9270. ['D7D0FF', 'Fog'],
  9271. ['D84437', 'Valencia'],
  9272. ['D87C63', 'Japonica'],
  9273. ['D8BFD8', 'Thistle'],
  9274. ['D8C2D5', 'Maverick'],
  9275. ['D8FCFA', 'Foam'],
  9276. ['D94972', 'Cabaret'],
  9277. ['D99376', 'Burning Sand'],
  9278. ['D9B99B', 'Cameo'],
  9279. ['D9D6CF', 'Timberwolf'],
  9280. ['D9DCC1', 'Tana'],
  9281. ['D9E4F5', 'Link Water'],
  9282. ['D9F7FF', 'Mabel'],
  9283. ['DA3287', 'Cerise'],
  9284. ['DA5B38', 'Flame Pea'],
  9285. ['DA6304', 'Bamboo'],
  9286. ['DA6A41', 'Red Damask'],
  9287. ['DA70D6', 'Orchid'],
  9288. ['DA8A67', 'Copperfield'],
  9289. ['DAA520', 'Golden Grass'],
  9290. ['DAECD6', 'Zanah'],
  9291. ['DAF4F0', 'Iceberg'],
  9292. ['DAFAFF', 'Oyster Bay'],
  9293. ['DB5079', 'Cranberry'],
  9294. ['DB9690', 'Petite Orchid'],
  9295. ['DB995E', 'Di Serria'],
  9296. ['DBDBDB', 'Alto'],
  9297. ['DBFFF8', 'Frosted Mint'],
  9298. ['DC143C', 'Crimson'],
  9299. ['DC4333', 'Punch'],
  9300. ['DCB20C', 'Galliano'],
  9301. ['DCB4BC', 'Blossom'],
  9302. ['DCD747', 'Wattle'],
  9303. ['DCD9D2', 'Westar'],
  9304. ['DCDDCC', 'Moon Mist'],
  9305. ['DCEDB4', 'Caper'],
  9306. ['DCF0EA', 'Swans Down'],
  9307. ['DDD6D5', 'Swiss Coffee'],
  9308. ['DDF9F1', 'White Ice'],
  9309. ['DE3163', 'Cerise Red'],
  9310. ['DE6360', 'Roman'],
  9311. ['DEA681', 'Tumbleweed'],
  9312. ['DEBA13', 'Gold Tips'],
  9313. ['DEC196', 'Brandy'],
  9314. ['DECBC6', 'Wafer'],
  9315. ['DED4A4', 'Sapling'],
  9316. ['DED717', 'Barberry'],
  9317. ['DEE5C0', 'Beryl Green'],
  9318. ['DEF5FF', 'Pattens Blue'],
  9319. ['DF73FF', 'Heliotrope'],
  9320. ['DFBE6F', 'Apache'],
  9321. ['DFCD6F', 'Chenin'],
  9322. ['DFCFDB', 'Lola'],
  9323. ['DFECDA', 'Willow Brook'],
  9324. ['DFFF00', 'Chartreuse Yellow'],
  9325. ['E0B0FF', 'Mauve'],
  9326. ['E0B646', 'Anzac'],
  9327. ['E0B974', 'Harvest Gold'],
  9328. ['E0C095', 'Calico'],
  9329. ['E0FFFF', 'Baby Blue'],
  9330. ['E16865', 'Sunglo'],
  9331. ['E1BC64', 'Equator'],
  9332. ['E1C0C8', 'Pink Flare'],
  9333. ['E1E6D6', 'Periglacial Blue'],
  9334. ['E1EAD4', 'Kidnapper'],
  9335. ['E1F6E8', 'Tara'],
  9336. ['E25465', 'Mandy'],
  9337. ['E2725B', 'Terracotta'],
  9338. ['E28913', 'Golden Bell'],
  9339. ['E292C0', 'Shocking'],
  9340. ['E29418', 'Dixie'],
  9341. ['E29CD2', 'Light Orchid'],
  9342. ['E2D8ED', 'Snuff'],
  9343. ['E2EBED', 'Mystic'],
  9344. ['E2F3EC', 'Apple Green'],
  9345. ['E30B5C', 'Razzmatazz'],
  9346. ['E32636', 'Alizarin Crimson'],
  9347. ['E34234', 'Cinnabar'],
  9348. ['E3BEBE', 'Cavern Pink'],
  9349. ['E3F5E1', 'Peppermint'],
  9350. ['E3F988', 'Mindaro'],
  9351. ['E47698', 'Deep Blush'],
  9352. ['E49B0F', 'Gamboge'],
  9353. ['E4C2D5', 'Melanie'],
  9354. ['E4CFDE', 'Twilight'],
  9355. ['E4D1C0', 'Bone'],
  9356. ['E4D422', 'Sunflower'],
  9357. ['E4D5B7', 'Grain Brown'],
  9358. ['E4D69B', 'Zombie'],
  9359. ['E4F6E7', 'Frostee'],
  9360. ['E4FFD1', 'Snow Flurry'],
  9361. ['E52B50', 'Amaranth'],
  9362. ['E5841B', 'Zest'],
  9363. ['E5CCC9', 'Dust Storm'],
  9364. ['E5D7BD', 'Stark White'],
  9365. ['E5D8AF', 'Hampton'],
  9366. ['E5E0E1', 'Bon Jour'],
  9367. ['E5E5E5', 'Mercury'],
  9368. ['E5F9F6', 'Polar'],
  9369. ['E64E03', 'Trinidad'],
  9370. ['E6BE8A', 'Gold Sand'],
  9371. ['E6BEA5', 'Cashmere'],
  9372. ['E6D7B9', 'Double Spanish White'],
  9373. ['E6E4D4', 'Satin Linen'],
  9374. ['E6F2EA', 'Harp'],
  9375. ['E6F8F3', 'Off Green'],
  9376. ['E6FFE9', 'Hint of Green'],
  9377. ['E6FFFF', 'Tranquil'],
  9378. ['E77200', 'Mango Tango'],
  9379. ['E7730A', 'Christine'],
  9380. ['E79F8C', 'Tonys Pink'],
  9381. ['E79FC4', 'Kobi'],
  9382. ['E7BCB4', 'Rose Fog'],
  9383. ['E7BF05', 'Corn'],
  9384. ['E7CD8C', 'Putty'],
  9385. ['E7ECE6', 'Gray Nurse'],
  9386. ['E7F8FF', 'Lily White'],
  9387. ['E7FEFF', 'Bubbles'],
  9388. ['E89928', 'Fire Bush'],
  9389. ['E8B9B3', 'Shilo'],
  9390. ['E8E0D5', 'Pearl Bush'],
  9391. ['E8EBE0', 'Green White'],
  9392. ['E8F1D4', 'Chrome White'],
  9393. ['E8F2EB', 'Gin'],
  9394. ['E8F5F2', 'Aqua Squeeze'],
  9395. ['E96E00', 'Clementine'],
  9396. ['E97451', 'Burnt Sienna'],
  9397. ['E97C07', 'Tahiti Gold'],
  9398. ['E9CECD', 'Oyster Pink'],
  9399. ['E9D75A', 'Confetti'],
  9400. ['E9E3E3', 'Ebb'],
  9401. ['E9F8ED', 'Ottoman'],
  9402. ['E9FFFD', 'Clear Day'],
  9403. ['EA88A8', 'Carissma'],
  9404. ['EAAE69', 'Porsche'],
  9405. ['EAB33B', 'Tulip Tree'],
  9406. ['EAC674', 'Rob Roy'],
  9407. ['EADAB8', 'Raffia'],
  9408. ['EAE8D4', 'White Rock'],
  9409. ['EAF6EE', 'Panache'],
  9410. ['EAF6FF', 'Solitude'],
  9411. ['EAF9F5', 'Aqua Spring'],
  9412. ['EAFFFE', 'Dew'],
  9413. ['EB9373', 'Apricot'],
  9414. ['EBC2AF', 'Zinnwaldite'],
  9415. ['ECA927', 'Fuel Yellow'],
  9416. ['ECC54E', 'Ronchi'],
  9417. ['ECC7EE', 'French Lilac'],
  9418. ['ECCDB9', 'Just Right'],
  9419. ['ECE090', 'Wild Rice'],
  9420. ['ECEBBD', 'Fall Green'],
  9421. ['ECEBCE', 'Aths Special'],
  9422. ['ECF245', 'Starship'],
  9423. ['ED0A3F', 'Red Ribbon'],
  9424. ['ED7A1C', 'Tango'],
  9425. ['ED9121', 'Carrot Orange'],
  9426. ['ED989E', 'Sea Pink'],
  9427. ['EDB381', 'Tacao'],
  9428. ['EDC9AF', 'Desert Sand'],
  9429. ['EDCDAB', 'Pancho'],
  9430. ['EDDCB1', 'Chamois'],
  9431. ['EDEA99', 'Primrose'],
  9432. ['EDF5DD', 'Frost'],
  9433. ['EDF5F5', 'Aqua Haze'],
  9434. ['EDF6FF', 'Zumthor'],
  9435. ['EDF9F1', 'Narvik'],
  9436. ['EDFC84', 'Honeysuckle'],
  9437. ['EE82EE', 'Lavender Magenta'],
  9438. ['EEC1BE', 'Beauty Bush'],
  9439. ['EED794', 'Chalky'],
  9440. ['EED9C4', 'Almond'],
  9441. ['EEDC82', 'Flax'],
  9442. ['EEDEDA', 'Bizarre'],
  9443. ['EEE3AD', 'Double Colonial White'],
  9444. ['EEEEE8', 'Cararra'],
  9445. ['EEEF78', 'Manz'],
  9446. ['EEF0C8', 'Tahuna Sands'],
  9447. ['EEF0F3', 'Athens Gray'],
  9448. ['EEF3C3', 'Tusk'],
  9449. ['EEF4DE', 'Loafer'],
  9450. ['EEF6F7', 'Catskill White'],
  9451. ['EEFDFF', 'Twilight Blue'],
  9452. ['EEFF9A', 'Jonquil'],
  9453. ['EEFFE2', 'Rice Flower'],
  9454. ['EF863F', 'Jaffa'],
  9455. ['EFEFEF', 'Gallery'],
  9456. ['EFF2F3', 'Porcelain'],
  9457. ['F091A9', 'Mauvelous'],
  9458. ['F0D52D', 'Golden Dream'],
  9459. ['F0DB7D', 'Golden Sand'],
  9460. ['F0DC82', 'Buff'],
  9461. ['F0E2EC', 'Prim'],
  9462. ['F0E68C', 'Khaki'],
  9463. ['F0EEFD', 'Selago'],
  9464. ['F0EEFF', 'Titan White'],
  9465. ['F0F8FF', 'Alice Blue'],
  9466. ['F0FCEA', 'Feta'],
  9467. ['F18200', 'Gold Drop'],
  9468. ['F19BAB', 'Wewak'],
  9469. ['F1E788', 'Sahara Sand'],
  9470. ['F1E9D2', 'Parchment'],
  9471. ['F1E9FF', 'Blue Chalk'],
  9472. ['F1EEC1', 'Mint Julep'],
  9473. ['F1F1F1', 'Seashell'],
  9474. ['F1F7F2', 'Saltpan'],
  9475. ['F1FFAD', 'Tidal'],
  9476. ['F1FFC8', 'Chiffon'],
  9477. ['F2552A', 'Flamingo'],
  9478. ['F28500', 'Tangerine'],
  9479. ['F2C3B2', 'Mandys Pink'],
  9480. ['F2F2F2', 'Concrete'],
  9481. ['F2FAFA', 'Black Squeeze'],
  9482. ['F34723', 'Pomegranate'],
  9483. ['F3AD16', 'Buttercup'],
  9484. ['F3D69D', 'New Orleans'],
  9485. ['F3D9DF', 'Vanilla Ice'],
  9486. ['F3E7BB', 'Sidecar'],
  9487. ['F3E9E5', 'Dawn Pink'],
  9488. ['F3EDCF', 'Wheatfield'],
  9489. ['F3FB62', 'Canary'],
  9490. ['F3FBD4', 'Orinoco'],
  9491. ['F3FFD8', 'Carla'],
  9492. ['F400A1', 'Hollywood Cerise'],
  9493. ['F4A460', 'Sandy brown'],
  9494. ['F4C430', 'Saffron'],
  9495. ['F4D81C', 'Ripe Lemon'],
  9496. ['F4EBD3', 'Janna'],
  9497. ['F4F2EE', 'Pampas'],
  9498. ['F4F4F4', 'Wild Sand'],
  9499. ['F4F8FF', 'Zircon'],
  9500. ['F57584', 'Froly'],
  9501. ['F5C85C', 'Cream Can'],
  9502. ['F5C999', 'Manhattan'],
  9503. ['F5D5A0', 'Maize'],
  9504. ['F5DEB3', 'Wheat'],
  9505. ['F5E7A2', 'Sandwisp'],
  9506. ['F5E7E2', 'Pot Pourri'],
  9507. ['F5E9D3', 'Albescent White'],
  9508. ['F5EDEF', 'Soft Peach'],
  9509. ['F5F3E5', 'Ecru White'],
  9510. ['F5F5DC', 'Beige'],
  9511. ['F5FB3D', 'Golden Fizz'],
  9512. ['F5FFBE', 'Australian Mint'],
  9513. ['F64A8A', 'French Rose'],
  9514. ['F653A6', 'Brilliant Rose'],
  9515. ['F6A4C9', 'Illusion'],
  9516. ['F6F0E6', 'Merino'],
  9517. ['F6F7F7', 'Black Haze'],
  9518. ['F6FFDC', 'Spring Sun'],
  9519. ['F7468A', 'Violet Red'],
  9520. ['F77703', 'Chilean Fire'],
  9521. ['F77FBE', 'Persian Pink'],
  9522. ['F7B668', 'Rajah'],
  9523. ['F7C8DA', 'Azalea'],
  9524. ['F7DBE6', 'We Peep'],
  9525. ['F7F2E1', 'Quarter Spanish White'],
  9526. ['F7F5FA', 'Whisper'],
  9527. ['F7FAF7', 'Snow Drift'],
  9528. ['F8B853', 'Casablanca'],
  9529. ['F8C3DF', 'Chantilly'],
  9530. ['F8D9E9', 'Cherub'],
  9531. ['F8DB9D', 'Marzipan'],
  9532. ['F8DD5C', 'Energy Yellow'],
  9533. ['F8E4BF', 'Givry'],
  9534. ['F8F0E8', 'White Linen'],
  9535. ['F8F4FF', 'Magnolia'],
  9536. ['F8F6F1', 'Spring Wood'],
  9537. ['F8F7DC', 'Coconut Cream'],
  9538. ['F8F7FC', 'White Lilac'],
  9539. ['F8F8F7', 'Desert Storm'],
  9540. ['F8F99C', 'Texas'],
  9541. ['F8FACD', 'Corn Field'],
  9542. ['F8FDD3', 'Mimosa'],
  9543. ['F95A61', 'Carnation'],
  9544. ['F9BF58', 'Saffron Mango'],
  9545. ['F9E0ED', 'Carousel Pink'],
  9546. ['F9E4BC', 'Dairy Cream'],
  9547. ['F9E663', 'Portica'],
  9548. ['F9EAF3', 'Amour'],
  9549. ['F9F8E4', 'Rum Swizzle'],
  9550. ['F9FF8B', 'Dolly'],
  9551. ['F9FFF6', 'Sugar Cane'],
  9552. ['FA7814', 'Ecstasy'],
  9553. ['FA9D5A', 'Tan Hide'],
  9554. ['FAD3A2', 'Corvette'],
  9555. ['FADFAD', 'Peach Yellow'],
  9556. ['FAE600', 'Turbo'],
  9557. ['FAEAB9', 'Astra'],
  9558. ['FAECCC', 'Champagne'],
  9559. ['FAF0E6', 'Linen'],
  9560. ['FAF3F0', 'Fantasy'],
  9561. ['FAF7D6', 'Citrine White'],
  9562. ['FAFAFA', 'Alabaster'],
  9563. ['FAFDE4', 'Hint of Yellow'],
  9564. ['FAFFA4', 'Milan'],
  9565. ['FB607F', 'Brink Pink'],
  9566. ['FB8989', 'Geraldine'],
  9567. ['FBA0E3', 'Lavender Rose'],
  9568. ['FBA129', 'Sea Buckthorn'],
  9569. ['FBAC13', 'Sun'],
  9570. ['FBAED2', 'Lavender Pink'],
  9571. ['FBB2A3', 'Rose Bud'],
  9572. ['FBBEDA', 'Cupid'],
  9573. ['FBCCE7', 'Classic Rose'],
  9574. ['FBCEB1', 'Apricot Peach'],
  9575. ['FBE7B2', 'Banana Mania'],
  9576. ['FBE870', 'Marigold Yellow'],
  9577. ['FBE96C', 'Festival'],
  9578. ['FBEA8C', 'Sweet Corn'],
  9579. ['FBEC5D', 'Candy Corn'],
  9580. ['FBF9F9', 'Hint of Red'],
  9581. ['FBFFBA', 'Shalimar'],
  9582. ['FC0FC0', 'Shocking Pink'],
  9583. ['FC80A5', 'Tickle Me Pink'],
  9584. ['FC9C1D', 'Tree Poppy'],
  9585. ['FCC01E', 'Lightning Yellow'],
  9586. ['FCD667', 'Goldenrod'],
  9587. ['FCD917', 'Candlelight'],
  9588. ['FCDA98', 'Cherokee'],
  9589. ['FCF4D0', 'Double Pearl Lusta'],
  9590. ['FCF4DC', 'Pearl Lusta'],
  9591. ['FCF8F7', 'Vista White'],
  9592. ['FCFBF3', 'Bianca'],
  9593. ['FCFEDA', 'Moon Glow'],
  9594. ['FCFFE7', 'China Ivory'],
  9595. ['FCFFF9', 'Ceramic'],
  9596. ['FD0E35', 'Torch Red'],
  9597. ['FD5B78', 'Wild Watermelon'],
  9598. ['FD7B33', 'Crusta'],
  9599. ['FD7C07', 'Sorbus'],
  9600. ['FD9FA2', 'Sweet Pink'],
  9601. ['FDD5B1', 'Light Apricot'],
  9602. ['FDD7E4', 'Pig Pink'],
  9603. ['FDE1DC', 'Cinderella'],
  9604. ['FDE295', 'Golden Glow'],
  9605. ['FDE910', 'Lemon'],
  9606. ['FDF5E6', 'Old Lace'],
  9607. ['FDF6D3', 'Half Colonial White'],
  9608. ['FDF7AD', 'Drover'],
  9609. ['FDFEB8', 'Pale Prim'],
  9610. ['FDFFD5', 'Cumulus'],
  9611. ['FE28A2', 'Persian Rose'],
  9612. ['FE4C40', 'Sunset Orange'],
  9613. ['FE6F5E', 'Bittersweet'],
  9614. ['FE9D04', 'California'],
  9615. ['FEA904', 'Yellow Sea'],
  9616. ['FEBAAD', 'Melon'],
  9617. ['FED33C', 'Bright Sun'],
  9618. ['FED85D', 'Dandelion'],
  9619. ['FEDB8D', 'Salomie'],
  9620. ['FEE5AC', 'Cape Honey'],
  9621. ['FEEBF3', 'Remy'],
  9622. ['FEEFCE', 'Oasis'],
  9623. ['FEF0EC', 'Bridesmaid'],
  9624. ['FEF2C7', 'Beeswax'],
  9625. ['FEF3D8', 'Bleach White'],
  9626. ['FEF4CC', 'Pipi'],
  9627. ['FEF4DB', 'Half Spanish White'],
  9628. ['FEF4F8', 'Wisp Pink'],
  9629. ['FEF5F1', 'Provincial Pink'],
  9630. ['FEF7DE', 'Half Dutch White'],
  9631. ['FEF8E2', 'Solitaire'],
  9632. ['FEF8FF', 'White Pointer'],
  9633. ['FEF9E3', 'Off Yellow'],
  9634. ['FEFCED', 'Orange White'],
  9635. ['FF0000', 'Red'],
  9636. ['FF007F', 'Rose'],
  9637. ['FF00CC', 'Purple Pizzazz'],
  9638. ['FF00FF', 'Magenta / Fuchsia'],
  9639. ['FF2400', 'Scarlet'],
  9640. ['FF3399', 'Wild Strawberry'],
  9641. ['FF33CC', 'Razzle Dazzle Rose'],
  9642. ['FF355E', 'Radical Red'],
  9643. ['FF3F34', 'Red Orange'],
  9644. ['FF4040', 'Coral Red'],
  9645. ['FF4D00', 'Vermilion'],
  9646. ['FF4F00', 'International Orange'],
  9647. ['FF6037', 'Outrageous Orange'],
  9648. ['FF6600', 'Blaze Orange'],
  9649. ['FF66FF', 'Pink Flamingo'],
  9650. ['FF681F', 'Orange'],
  9651. ['FF69B4', 'Hot Pink'],
  9652. ['FF6B53', 'Persimmon'],
  9653. ['FF6FFF', 'Blush Pink'],
  9654. ['FF7034', 'Burning Orange'],
  9655. ['FF7518', 'Pumpkin'],
  9656. ['FF7D07', 'Flamenco'],
  9657. ['FF7F00', 'Flush Orange'],
  9658. ['FF7F50', 'Coral'],
  9659. ['FF8C69', 'Salmon'],
  9660. ['FF9000', 'Pizazz'],
  9661. ['FF910F', 'West Side'],
  9662. ['FF91A4', 'Pink Salmon'],
  9663. ['FF9933', 'Neon Carrot'],
  9664. ['FF9966', 'Atomic Tangerine'],
  9665. ['FF9980', 'Vivid Tangerine'],
  9666. ['FF9E2C', 'Sunshade'],
  9667. ['FFA000', 'Orange Peel'],
  9668. ['FFA194', 'Mona Lisa'],
  9669. ['FFA500', 'Web Orange'],
  9670. ['FFA6C9', 'Carnation Pink'],
  9671. ['FFAB81', 'Hit Pink'],
  9672. ['FFAE42', 'Yellow Orange'],
  9673. ['FFB0AC', 'Cornflower Lilac'],
  9674. ['FFB1B3', 'Sundown'],
  9675. ['FFB31F', 'My Sin'],
  9676. ['FFB555', 'Texas Rose'],
  9677. ['FFB7D5', 'Cotton Candy'],
  9678. ['FFB97B', 'Macaroni and Cheese'],
  9679. ['FFBA00', 'Selective Yellow'],
  9680. ['FFBD5F', 'Koromiko'],
  9681. ['FFBF00', 'Amber'],
  9682. ['FFC0A8', 'Wax Flower'],
  9683. ['FFC0CB', 'Pink'],
  9684. ['FFC3C0', 'Your Pink'],
  9685. ['FFC901', 'Supernova'],
  9686. ['FFCBA4', 'Flesh'],
  9687. ['FFCC33', 'Sunglow'],
  9688. ['FFCC5C', 'Golden Tainoi'],
  9689. ['FFCC99', 'Peach Orange'],
  9690. ['FFCD8C', 'Chardonnay'],
  9691. ['FFD1DC', 'Pastel Pink'],
  9692. ['FFD2B7', 'Romantic'],
  9693. ['FFD38C', 'Grandis'],
  9694. ['FFD700', 'Gold'],
  9695. ['FFD800', 'School bus Yellow'],
  9696. ['FFD8D9', 'Cosmos'],
  9697. ['FFDB58', 'Mustard'],
  9698. ['FFDCD6', 'Peach Schnapps'],
  9699. ['FFDDAF', 'Caramel'],
  9700. ['FFDDCD', 'Tuft Bush'],
  9701. ['FFDDCF', 'Watusi'],
  9702. ['FFDDF4', 'Pink Lace'],
  9703. ['FFDEAD', 'Navajo White'],
  9704. ['FFDEB3', 'Frangipani'],
  9705. ['FFE1DF', 'Pippin'],
  9706. ['FFE1F2', 'Pale Rose'],
  9707. ['FFE2C5', 'Negroni'],
  9708. ['FFE5A0', 'Cream Brulee'],
  9709. ['FFE5B4', 'Peach'],
  9710. ['FFE6C7', 'Tequila'],
  9711. ['FFE772', 'Kournikova'],
  9712. ['FFEAC8', 'Sandy Beach'],
  9713. ['FFEAD4', 'Karry'],
  9714. ['FFEC13', 'Broom'],
  9715. ['FFEDBC', 'Colonial White'],
  9716. ['FFEED8', 'Derby'],
  9717. ['FFEFA1', 'Vis Vis'],
  9718. ['FFEFC1', 'Egg White'],
  9719. ['FFEFD5', 'Papaya Whip'],
  9720. ['FFEFEC', 'Fair Pink'],
  9721. ['FFF0DB', 'Peach Cream'],
  9722. ['FFF0F5', 'Lavender blush'],
  9723. ['FFF14F', 'Gorse'],
  9724. ['FFF1B5', 'Buttermilk'],
  9725. ['FFF1D8', 'Pink Lady'],
  9726. ['FFF1EE', 'Forget Me Not'],
  9727. ['FFF1F9', 'Tutu'],
  9728. ['FFF39D', 'Picasso'],
  9729. ['FFF3F1', 'Chardon'],
  9730. ['FFF46E', 'Paris Daisy'],
  9731. ['FFF4CE', 'Barley White'],
  9732. ['FFF4DD', 'Egg Sour'],
  9733. ['FFF4E0', 'Sazerac'],
  9734. ['FFF4E8', 'Serenade'],
  9735. ['FFF4F3', 'Chablis'],
  9736. ['FFF5EE', 'Seashell Peach'],
  9737. ['FFF5F3', 'Sauvignon'],
  9738. ['FFF6D4', 'Milk Punch'],
  9739. ['FFF6DF', 'Varden'],
  9740. ['FFF6F5', 'Rose White'],
  9741. ['FFF8D1', 'Baja White'],
  9742. ['FFF9E2', 'Gin Fizz'],
  9743. ['FFF9E6', 'Early Dawn'],
  9744. ['FFFACD', 'Lemon Chiffon'],
  9745. ['FFFAF4', 'Bridal Heath'],
  9746. ['FFFBDC', 'Scotch Mist'],
  9747. ['FFFBF9', 'Soapstone'],
  9748. ['FFFC99', 'Witch Haze'],
  9749. ['FFFCEA', 'Buttery White'],
  9750. ['FFFCEE', 'Island Spice'],
  9751. ['FFFDD0', 'Cream'],
  9752. ['FFFDE6', 'Chilean Heath'],
  9753. ['FFFDE8', 'Travertine'],
  9754. ['FFFDF3', 'Orchid White'],
  9755. ['FFFDF4', 'Quarter Pearl Lusta'],
  9756. ['FFFEE1', 'Half and Half'],
  9757. ['FFFEEC', 'Apricot White'],
  9758. ['FFFEF0', 'Rice Cake'],
  9759. ['FFFEF6', 'Black White'],
  9760. ['FFFEFD', 'Romance'],
  9761. ['FFFF00', 'Yellow'],
  9762. ['FFFF66', 'Laser Lemon'],
  9763. ['FFFF99', 'Pale Canary'],
  9764. ['FFFFB4', 'Portafino'],
  9765. ['FFFFF0', 'Ivory'],
  9766. ['FFFFFF', 'White'],
  9767. ['5c2223', '暗玉紫'],
  9768. ['eea2a4', '牡丹粉红'],
  9769. ['5a191b', '栗紫'],
  9770. ['f07c82', '香叶红'],
  9771. ['5a1216', '葡萄酱紫'],
  9772. ['ed5a65', '艳红'],
  9773. ['c04851', '玉红'],
  9774. ['ee3f4d', '茶花红'],
  9775. ['c02c38', '高粱红'],
  9776. ['a7535a', '满江红'],
  9777. ['e3b4b8', '鼠鼻红'],
  9778. ['f0a1a8', '合欢红'],
  9779. ['f1939c', '春梅红'],
  9780. ['a61b29', '苋菜红'],
  9781. ['894e54', '烟红'],
  9782. ['c45a65', '莓红'],
  9783. ['d11a2d', '鹅冠红'],
  9784. ['c21f30', '枫叶红'],
  9785. ['de1c31', '唐菖蒲红'],
  9786. ['7c1823', '枣红'],
  9787. ['541e24', '猪肝紫'],
  9788. ['4c1f24', '葡萄紫'],
  9789. ['82202b', '暗紫苑红'],
  9790. ['82111f', '殷红'],
  9791. ['ef475d', '草茉莉红'],
  9792. ['4d1018', '酱紫'],
  9793. ['ed556a', '山茶红'],
  9794. ['7a7374', '锌灰'],
  9795. ['f03752', '海棠红'],
  9796. ['e6d2d5', '蓟粉红'],
  9797. ['f0c9cf', '石蕊红'],
  9798. ['ee2746', '淡曙红'],
  9799. ['2b1216', '李紫'],
  9800. ['ee4863', '石竹红'],
  9801. ['e77c8e', '淡茜红'],
  9802. ['500a16', '金鱼紫'],
  9803. ['c27c88', '山黎豆红'],
  9804. ['73575c', '鼠背灰'],
  9805. ['ee4866', '淡蕊香红'],
  9806. ['621624', '甘蔗紫'],
  9807. ['ce5777', '月季红'],
  9808. ['cc163a', '尖晶玉红'],
  9809. ['f1c4cd', '水红'],
  9810. ['eeb8c3', '姜红'],
  9811. ['856d72', '芦灰'],
  9812. ['2d0c13', '茄皮紫'],
  9813. ['36282b', '苍蝇灰'],
  9814. ['bf3553', '锦葵红'],
  9815. ['ec9bad', '粉团花红'],
  9816. ['63071c', '石竹紫'],
  9817. ['30161c', '卵石紫'],
  9818. ['eea6b7', '晶红'],
  9819. ['e9ccd3', '芝兰紫'],
  9820. ['eba0b3', '芍药耕红'],
  9821. ['4f383e', '暮云灰'],
  9822. ['ed9db2', '豇豆红'],
  9823. ['ec8aa4', '报春红'],
  9824. ['ec7696', '淡绛红'],
  9825. ['ea7293', '凤仙花红'],
  9826. ['ef82a0', '霞光红'],
  9827. ['ec2c64', '喜蛋红'],
  9828. ['eb507e', '夹竹桃红'],
  9829. ['eb3c70', '松叶牡丹红'],
  9830. ['ea517f', '莲瓣红'],
  9831. ['de7897', '白芨红'],
  9832. ['b598a1', '隐红灰'],
  9833. ['ed2f6a', '榲桲红'],
  9834. ['c5708b', '酢酱草红'],
  9835. ['33141e', '火鹅紫'],
  9836. ['621d34', '鹞冠紫'],
  9837. ['ef3473', '品红'],
  9838. ['382129', '磨石紫'],
  9839. ['310f1b', '墨紫'],
  9840. ['381924', '檀紫'],
  9841. ['e16c96', '初荷红'],
  9842. ['951c48', '菜头紫'],
  9843. ['62102e', '葡萄酒红'],
  9844. ['e0c8d1', '淡青紫'],
  9845. ['d13c74', '菠根红'],
  9846. ['4b1e2f', '海象紫'],
  9847. ['ec4e8a', '兔眼红'],
  9848. ['de3f7c', '嫩菱红'],
  9849. ['a8456b', '洋葱紫'],
  9850. ['ce5e8a', '吊钟花红'],
  9851. ['461629', '绀紫'],
  9852. ['ee2c79', '紫荆红'],
  9853. ['ef498b', '扁豆花红'],
  9854. ['ede3e7', '马鞭草紫'],
  9855. ['ec2d7a', '藏花红'],
  9856. ['482936', '斑鸠灰'],
  9857. ['440e25', '古铜紫'],
  9858. ['d2568c', '丹紫红'],
  9859. ['e9d7df', '丁香淡紫'],
  9860. ['d2357d', '玫瑰红'],
  9861. ['36292f', '古鼎灰'],
  9862. ['d276a3', '菱锰红'],
  9863. ['c06f98', '樱草紫'],
  9864. ['cc5595', '龙须红'],
  9865. ['c35691', '电气石红'],
  9866. ['ba2f7b', '玫瑰紫'],
  9867. ['9b1e64', '苋菜紫'],
  9868. ['5d3f51', '紫灰'],
  9869. ['4e2a40', '龙睛鱼紫'],
  9870. ['bc84a8', '青蛤壳紫'],
  9871. ['c08eaf', '萝兰紫'],
  9872. ['411c35', '荸荠紫'],
  9873. ['ad6598', '豆蔻紫'],
  9874. ['a35c8f', '扁豆紫'],
  9875. ['681752', '牵牛紫'],
  9876. ['894276', '芓紫'],
  9877. ['7e2065', '葛巾紫'],
  9878. ['8b2671', '青莲'],
  9879. ['983680', '芥花紫'],
  9880. ['c8adc4', '凤信紫'],
  9881. ['1c0d1a', '深牵牛紫'],
  9882. ['7e1671', '魏紫'],
  9883. ['1e131d', '乌梅紫'],
  9884. ['813c85', '桔梗紫'],
  9885. ['d1c2d3', '淡牵牛紫'],
  9886. ['3e3841', '剑锋紫'],
  9887. ['815c94', '蕈紫'],
  9888. ['806d9e', '槿紫'],
  9889. ['e2e1e4', '芡食白'],
  9890. ['322f3b', '龙葵紫'],
  9891. ['8076a3', '藤萝紫'],
  9892. ['35333c', '沙鱼灰'],
  9893. ['22202e', '暗龙胆紫'],
  9894. ['131124', '暗蓝紫'],
  9895. ['302f4b', '野葡萄紫'],
  9896. ['525288', '野菊紫'],
  9897. ['2f2f35', '水牛灰'],
  9898. ['ccccd6', '远山紫'],
  9899. ['74759b', '螺甸紫'],
  9900. ['1f2040', '晶石紫'],
  9901. ['2e317c', '满天星紫'],
  9902. ['a7a8bd', '淡蓝紫'],
  9903. ['61649f', '山梗紫'],
  9904. ['2d2e36', '牛角灰'],
  9905. ['5e616d', '鱼尾灰'],
  9906. ['47484c', '瓦罐灰'],
  9907. ['0f1423', '钢蓝'],
  9908. ['131824', '燕颔蓝'],
  9909. ['475164', '鲸鱼灰'],
  9910. ['2b333e', '青灰'],
  9911. ['1c2938', '鸽蓝'],
  9912. ['101f30', '暗蓝'],
  9913. ['142334', '钢青'],
  9914. ['15559a', '海涛蓝'],
  9915. ['0f59a4', '飞燕草蓝'],
  9916. ['1661ab', '靛青'],
  9917. ['3170a7', '安安蓝'],
  9918. ['346c9c', '海军蓝'],
  9919. ['2775b6', '景泰蓝'],
  9920. ['2b73af', '品蓝'],
  9921. ['2474b5', '尼罗蓝'],
  9922. ['4e7ca1', '蝶翅蓝'],
  9923. ['2376b7', '花青'],
  9924. ['144a74', '鷃蓝'],
  9925. ['93b5cf', '星蓝'],
  9926. ['2177b8', '虹蓝'],
  9927. ['126bae', '柏林蓝'],
  9928. ['1772b4', '群青'],
  9929. ['baccd9', '云水蓝'],
  9930. ['619ac3', '羽扇豆蓝'],
  9931. ['495c69', '战舰灰'],
  9932. ['8fb2c9', '晴山蓝'],
  9933. ['5698c3', '睛蓝'],
  9934. ['11659a', '搪磁蓝'],
  9935. ['2983bb', '潮蓝'],
  9936. ['1677b3', '天蓝'],
  9937. ['c4cbcf', '大理石灰'],
  9938. ['1177b0', '牵牛花蓝'],
  9939. ['2486b9', '宝石蓝'],
  9940. ['5e7987', '淡蓝灰'],
  9941. ['74787a', '嫩灰'],
  9942. ['cdd1d3', '银鱼白'],
  9943. ['1781b5', '釉蓝'],
  9944. ['66a9c9', '涧石蓝'],
  9945. ['d0dfe6', '远天蓝'],
  9946. ['2f90b9', '云山蓝'],
  9947. ['8abcd1', '秋波蓝'],
  9948. ['c3d7df', '井天蓝'],
  9949. ['158bb8', '鸢尾蓝'],
  9950. ['d8e3e7', '云峰白'],
  9951. ['b2bbbe', '星灰'],
  9952. ['1a94bc', '钴蓝'],
  9953. ['5cb3cc', '碧青'],
  9954. ['134857', '苍蓝'],
  9955. ['132c33', '深灰蓝'],
  9956. ['21373d', '灰蓝'],
  9957. ['b0d5df', '湖水蓝'],
  9958. ['22a2c3', '海青'],
  9959. ['474b4c', '黄昏灰'],
  9960. ['63bbd0', '霁青'],
  9961. ['126e82', '玉鈫蓝'],
  9962. ['0f95b0', '胆矾蓝'],
  9963. ['1491a8', '樫鸟蓝'],
  9964. ['c7d2d4', '鸥蓝'],
  9965. ['1e9eb3', '翠蓝'],
  9966. ['3b818c', '蜻蜓蓝'],
  9967. ['0eb0c9', '孔雀蓝'],
  9968. ['29b7cb', '蔚蓝'],
  9969. ['51c4d3', '瀑布蓝'],
  9970. ['7cabb1', '闪蓝'],
  9971. ['10aec2', '甸子蓝'],
  9972. ['648e93', '晚波蓝'],
  9973. ['93d5dc', '清水蓝'],
  9974. ['617172', '夏云灰'],
  9975. ['c6e6e8', '海天蓝'],
  9976. ['869d9d', '虾壳青'],
  9977. ['57c3c2', '石绿'],
  9978. ['c4d7d6', '穹灰'],
  9979. ['12aa9c', '美蝶绿'],
  9980. ['737c7b', '垩灰'],
  9981. ['12a182', '蓝绿'],
  9982. ['1ba784', '竹绿'],
  9983. ['428675', '亚丁绿'],
  9984. ['c0c4c3', '月影白'],
  9985. ['248067', '海王绿'],
  9986. ['1a3b32', '深海绿'],
  9987. ['314a43', '绿灰'],
  9988. ['2c9678', '青矾绿'],
  9989. ['223e36', '苍绿'],
  9990. ['497568', '飞泉绿'],
  9991. ['141e1b', '莽丛绿'],
  9992. ['69a794', '梧枝绿'],
  9993. ['2bae85', '铜绿'],
  9994. ['9abeaf', '草原远绿'],
  9995. ['45b787', '蛙绿'],
  9996. ['92b3a5', '浪花绿'],
  9997. ['1f2623', '苷蓝绿'],
  9998. ['83cbac', '粉绿'],
  9999. ['70887d', '淡绿灰'],
  10000. ['55bb8a', '麦苗绿'],
  10001. ['20a162', '翠绿'],
  10002. ['40a070', '葱绿'],
  10003. ['1a6840', '荷叶绿'],
  10004. ['61ac85', '淡绿'],
  10005. ['68b88e', '田园绿'],
  10006. ['a4cab6', '玉簪绿'],
  10007. ['3c9566', '蟾绿'],
  10008. ['5dbe8a', '蔻梢绿'],
  10009. ['207f4c', '薄荷绿'],
  10010. ['eef7f2', '月白'],
  10011. ['579572', '蛋白石绿'],
  10012. ['b9dec9', '竹篁绿'],
  10013. ['229453', '孔雀绿'],
  10014. ['20894d', '宫殿绿'],
  10015. ['15231b', '云杉绿'],
  10016. ['66c18c', '毛绿'],
  10017. ['a4aca7', '冰山蓝'],
  10018. ['8a988e', '明灰'],
  10019. ['9eccab', '明绿'],
  10020. ['83a78d', '松霜绿'],
  10021. ['485b4d', '白屈菜绿'],
  10022. ['5d655f', '狼烟灰'],
  10023. ['6e8b74', '瓦松绿'],
  10024. ['2b312c', '槲寄生绿'],
  10025. ['c6dfc8', '淡翠绿'],
  10026. ['41b349', '玉髓绿'],
  10027. ['43b244', '鲜绿'],
  10028. ['253d24', '油绿'],
  10029. ['41ae3c', '宝石绿'],
  10030. ['add5a2', '嘉陵水绿'],
  10031. ['5e665b', '田螺绿'],
  10032. ['8cc269', '水绿'],
  10033. ['5bae23', '鹦鹉绿'],
  10034. ['dfecd5', '艾背绿'],
  10035. ['cad3c3', '艾绿'],
  10036. ['9fa39a', '镍灰'],
  10037. ['b2cf87', '橄榄石绿'],
  10038. ['96c24e', '芽绿'],
  10039. ['f0f5e5', '嫩菊绿'],
  10040. ['b7d07a', '芦苇绿'],
  10041. ['d0deaa', '姚黄'],
  10042. ['373834', '蒽油绿'],
  10043. ['bacf65', '苹果绿'],
  10044. ['e2e7bf', '海沬绿'],
  10045. ['bec936', '橄榄黄绿'],
  10046. ['d2d97a', '槐花黄绿'],
  10047. ['e2d849', '蝶黄'],
  10048. ['fffef8', '象牙白'],
  10049. ['5e5314', '橄榄绿'],
  10050. ['fffef9', '雪白'],
  10051. ['ad9e5f', '淡灰绿'],
  10052. ['fed71a', '佛手黄'],
  10053. ['f9f4dc', '乳白'],
  10054. ['e4bf11', '香蕉黄'],
  10055. ['d2b116', '新禾绿'],
  10056. ['fbda41', '油菜花黄'],
  10057. ['eed045', '秋葵黄'],
  10058. ['f1ca17', '柚黄'],
  10059. ['d2b42c', '草黄'],
  10060. ['f2ce2b', '硫华黄'],
  10061. ['e2c027', '姜黄'],
  10062. ['645822', '潭水绿'],
  10063. ['fcd217', '金瓜黄'],
  10064. ['f8df70', '麦秆黄'],
  10065. ['dfc243', '蒿黄'],
  10066. ['f8df72', '茉莉黄'],
  10067. ['ffd111', '藤黄'],
  10068. ['ddc871', '芒果黄'],
  10069. ['fffefa', '海参灰'],
  10070. ['867018', '碧螺春绿'],
  10071. ['887322', '苔绿'],
  10072. ['fcd337', '柠檬黄'],
  10073. ['8e804b', '草灰绿'],
  10074. ['fecc11', '向日葵黄'],
  10075. ['fccb16', '素馨黄'],
  10076. ['ffc90c', '乳鸭黄'],
  10077. ['b7ae8f', '月灰'],
  10078. ['f8d86a', '葵扇黄'],
  10079. ['fbcd31', '大豆黄'],
  10080. ['fcc307', '金盏黄'],
  10081. ['e9ddb6', '菊蕾白'],
  10082. ['fcc515', '黄连黄'],
  10083. ['f7e8aa', '杏仁黄'],
  10084. ['e8b004', '谷黄'],
  10085. ['f9c116', '木瓜黄'],
  10086. ['f9d770', '淡茧黄'],
  10087. ['fbc82f', '雅梨黄'],
  10088. ['f1f0ed', '银白'],
  10089. ['5b4913', '棕榈绿'],
  10090. ['f6c430', '鹦鹉冠黄'],
  10091. ['b78d12', '枯绿'],
  10092. ['f9bd10', '浅烙黄'],
  10093. ['f9d367', '淡密黄'],
  10094. ['d9a40e', '芥黄'],
  10095. ['ebb10d', '栀子黄'],
  10096. ['584717', '暗海水绿'],
  10097. ['f7de98', '篾黄'],
  10098. ['f9f1db', '蚌肉白'],
  10099. ['f4ce69', '炒米黄'],
  10100. ['feba07', '琥珀黄'],
  10101. ['8a6913', '灰绿'],
  10102. ['876818', '粽叶绿'],
  10103. ['b6a476', '尘灰'],
  10104. ['fcb70a', '鼬黄'],
  10105. ['f0d695', '象牙黄'],
  10106. ['87723e', '鲛青'],
  10107. ['f8e8c1', '豆汁黄'],
  10108. ['d6a01d', '土黄'],
  10109. ['f7da94', '香水玫瑰黄'],
  10110. ['eaad1a', '虎皮黄'],
  10111. ['fbb612', '鸡蛋黄'],
  10112. ['b5aa90', '银鼠灰'],
  10113. ['f7f4ed', '鱼肚白'],
  10114. ['f8bc31', '初熟杏黄'],
  10115. ['b78b26', '山鸡黄'],
  10116. ['e5d3aa', '莲子白'],
  10117. ['695e45', '蟹壳灰'],
  10118. ['e5b751', '沙石黄'],
  10119. ['f3bf4c', '甘草黄'],
  10120. ['685e48', '燕羽灰'],
  10121. ['fbb929', '鹅掌黄'],
  10122. ['f9d27d', '麦芽糖黄'],
  10123. ['e2c17c', '浅驼色'],
  10124. ['b4a992', '百灵鸟灰'],
  10125. ['f6dead', '酪黄'],
  10126. ['f2e6ce', '荔肉白'],
  10127. ['f8e0b0', '淡肉色'],
  10128. ['393733', '河豚灰'],
  10129. ['835e1d', '蜴蜊绿'],
  10130. ['f8f4ed', '汉白玉'],
  10131. ['fca104', '橙皮黄'],
  10132. ['815f25', '莱阳梨黄'],
  10133. ['fca106', '枇杷黄'],
  10134. ['ffa60f', '金叶黄'],
  10135. ['806332', '苍黄'],
  10136. ['fbf2e3', '粉白'],
  10137. ['fba414', '淡橘橙'],
  10138. ['e4dfd7', '珍珠灰'],
  10139. ['826b48', '龟背黄'],
  10140. ['dad4cb', '浅灰'],
  10141. ['bbb5ac', '铅灰'],
  10142. ['bbb5ac', '中灰'],
  10143. ['ff9900', '雄黄'],
  10144. ['fbb957', '蜜黄'],
  10145. ['dc9123', '风帆黄'],
  10146. ['c09351', '桂皮淡棕'],
  10147. ['f4a83a', '金莺黄'],
  10148. ['f7c173', '肉色'],
  10149. ['e7a23f', '凋叶棕'],
  10150. ['533c1b', '古铜绿'],
  10151. ['f9e8d0', '落英淡粉'],
  10152. ['de9e44', '软木黄'],
  10153. ['f9cb8b', '瓜瓤粉'],
  10154. ['f9a633', '榴萼黄'],
  10155. ['daa45a', '玳瑁黄'],
  10156. ['553b18', '焦茶绿'],
  10157. ['513c20', '蟹壳绿'],
  10158. ['986524', '山鸡褐'],
  10159. ['97846c', '猴毛灰'],
  10160. ['e3bd8d', '鹿角棕'],
  10161. ['4d4030', '淡松烟'],
  10162. ['fb8b05', '万寿菊黄'],
  10163. ['f8c387', '蛋壳黄'],
  10164. ['f28e16', '杏黄'],
  10165. ['503e2a', '橄榄灰'],
  10166. ['4a4035', '鹤灰'],
  10167. ['cfccc9', '玛瑙灰'],
  10168. ['c1b2a3', '淡银灰'],
  10169. ['867e76', '瓦灰'],
  10170. ['847c74', '夜灰'],
  10171. ['fc8c23', '北瓜黄'],
  10172. ['fbecde', '荷花白'],
  10173. ['4f4032', '松鼠灰'],
  10174. ['fbeee2', '淡米粉'],
  10175. ['81776e', '深灰'],
  10176. ['9a8878', '海鸥灰'],
  10177. ['5d3d21', '茶褐'],
  10178. ['66462a', '驼色'],
  10179. ['918072', '银灰'],
  10180. ['d99156', '鹿皮褐'],
  10181. ['c1651a', '槟榔综'],
  10182. ['d4c4b7', '晓灰'],
  10183. ['be7e4a', '淡赭'],
  10184. ['5c3719', '古铜褐'],
  10185. ['de7622', '麂棕'],
  10186. ['db8540', '醉瓜肉'],
  10187. ['80766e', '雁灰'],
  10188. ['f09c5a', '鲑鱼红'],
  10189. ['f97d1c', '橘橙'],
  10190. ['f26b1f', '金黄'],
  10191. ['f8b37f', '玫瑰粉'],
  10192. ['fa7e23', '美人焦橙'],
  10193. ['f9e9cd', '米色'],
  10194. ['b7a091', '蛛网灰'],
  10195. ['945833', '淡咖啡'],
  10196. ['f0945d', '海螺橙'],
  10197. ['964d22', '岩石棕'],
  10198. ['954416', '芒果棕'],
  10199. ['e16723', '陶瓷红'],
  10200. ['fc7930', '菠萝红'],
  10201. ['cf7543', '余烬红'],
  10202. ['f86b1d', '金莲花橙'],
  10203. ['cd6227', '火砖红'],
  10204. ['f6dcce', '初桃粉红'],
  10205. ['d85916', '铁棕'],
  10206. ['f7cfba', '介壳淡粉红'],
  10207. ['f27635', '蟹壳红'],
  10208. ['e46828', '金驼'],
  10209. ['fc6315', '燕颔红'],
  10210. ['b7511d', '淡可可棕'],
  10211. ['ea8958', '晨曦红'],
  10212. ['e8b49a', '玉粉红'],
  10213. ['fb9968', '野蔷薇红'],
  10214. ['edc3ae', '藕荷'],
  10215. ['363433', '长石灰'],
  10216. ['8b614d', '中红灰'],
  10217. ['aa6a4c', '火泥棕'],
  10218. ['a6522c', '绀红'],
  10219. ['fa5d19', '莓酱红'],
  10220. ['71361d', '丁香棕'],
  10221. ['b89485', '淡玫瑰灰'],
  10222. ['f68c60', '瓜瓤红'],
  10223. ['f6ad8f', '淡藏花红'],
  10224. ['732e12', '筍皮棕'],
  10225. ['f7cdbc', '润红'],
  10226. ['ef632b', '龙睛鱼红'],
  10227. ['8c4b31', '淡土黄'],
  10228. ['64483d', '珠母灰'],
  10229. ['f9723d', '芙蓉红'],
  10230. ['cf4813', '落霞红'],
  10231. ['ee8055', '法螺红'],
  10232. ['f8ebe6', '草珠红'],
  10233. ['753117', '咖啡'],
  10234. ['603d30', '中灰驼'],
  10235. ['883a1e', '椰壳棕'],
  10236. ['b14b28', '蟹蝥红'],
  10237. ['873d24', '淡豆沙'],
  10238. ['f6cec1', '淡桃红'],
  10239. ['5b423a', '淡铁灰'],
  10240. ['624941', '石板灰'],
  10241. ['673424', '淡栗棕'],
  10242. ['f43e06', '银朱'],
  10243. ['ef6f48', '草莓红'],
  10244. ['f4c7ba', '洋水仙红'],
  10245. ['ed5126', '朱红'],
  10246. ['f34718', '榴花红'],
  10247. ['f2481b', '柿红'],
  10248. ['652b1c', '可可棕'],
  10249. ['eea08c', '淡罂粟红'],
  10250. ['f04b22', '大红'],
  10251. ['692a1b', '柞叶棕'],
  10252. ['f1441d', '蜻蜓红'],
  10253. ['773d31', '橡树棕'],
  10254. ['eeaa9c', '颊红'],
  10255. ['f0ada0', '桃红'],
  10256. ['863020', '火岩棕'],
  10257. ['f2e7e5', '淡藤萝紫'],
  10258. ['862617', '赭石'],
  10259. ['f5391c', '铁水红'],
  10260. ['f03f24', '胭脂红'],
  10261. ['f33b1f', '极光红'],
  10262. ['f23e23', '红汞红'],
  10263. ['f13c22', '萝卜红'],
  10264. ['f05a46', '曲红'],
  10265. ['f17666', '谷鞘红'],
  10266. ['f15642', '苹果红'],
  10267. ['f25a47', '桂红'],
  10268. ['f2b9b2', '粉红'],
  10269. ['592620', '暗驼棕'],
  10270. ['de2a18', '夕阳红'],
  10271. ['ed3321', '樱桃红'],
  10272. ['f04a3a', '珊瑚红'],
  10273. ['482522', '火山棕'],
  10274. ['5c1e19', '栗棕'],
  10275. ['d42517', '鹤顶红'],
  10276. ['f19790', '舌红'],
  10277. ['ab372f', '鹅血石红'],
  10278. ['5a1f1b', '酱棕'],
  10279. ['ed3b2f', '鱼鳃红'],
  10280. ['bdaead', '芦穗灰'],
  10281. ['eb261a', '丽春红'],
  10282. ['ac1f18', '覆盆子红'],
  10283. ['483332', '海报灰'],
  10284. ['481e1c', '豆沙'],
  10285. ['f1908c', '榴子红'],
  10286. ['ec2b24', '秋海棠红'],
  10287. ['efafad', '无花果红'],
  10288. ['f2cac9', '淡绯'],
  10289. ['4b2e2b', '玫瑰灰'],
  10290. ['ed4845', '淡菽红'],
  10291. ['ed3333', '枸枢红'],
  10292. ['5d3131', '貂紫']
  10293. ];
  10294. // 传入 hsl(0, 0%, 0%) 格式的颜色,返回 h s l 的值组成的数组
  10295. const hslFunc = (color: string) => {
  10296. const hslArr = color.match(/\d+/g);
  10297. return hslArr;
  10298. };
  10299. // 将 colors 转为 rgb 和 hsl 格式,每一项包含 name hex rgb hsl,colorConvertFunc 为转换函数
  10300. type colorObj = {
  10301. name: string;
  10302. hex: string;
  10303. rgb: string[];
  10304. hsl: string[];
  10305. hsl_h: string | null;
  10306. hsl_s: string | null;
  10307. hsl_l: string | null;
  10308. mode: string;
  10309. };
  10310. let colorList: colorObj[] = [];
  10311. colors.forEach((item) => {
  10312. const hex = '#' + item[0];
  10313. const obj = {
  10314. name: item[1],
  10315. hex,
  10316. rgb: colorConvertFunc(hex).rgb.split(','),
  10317. hsl: colorConvertFunc(hex).hsl.split(','),
  10318. hsl_h: hslFunc(colorConvertFunc(hex).hsl)?.[0] ?? null,
  10319. hsl_s: hslFunc(colorConvertFunc(hex).hsl)?.[1] ?? null,
  10320. hsl_l: hslFunc(colorConvertFunc(hex).hsl)?.[2] ?? null,
  10321. mode: hslFunc(colorConvertFunc(hex).hsl)?.[2] !== undefined && Number(hslFunc(colorConvertFunc(hex).hsl)?.[2]) > 50 ? 'light' : 'dark'
  10322. };
  10323. colorList.push(obj);
  10324. });
  10325. // 过滤出 hsl_l 在 20-45 和 55-80 之间的颜色,区分明显
  10326. colorList = colorList.filter((item) => {
  10327. const hslL = item.hsl_l ? Number(item.hsl_l) : null;
  10328. return hslL !== null && ((hslL >= 20 && hslL < 45) || (hslL > 55 && hslL <= 80));
  10329. });
  10330. export default colorList;
  10331. ================================================
  10332. FILE: docs/site/src/data/menuList.ts
  10333. ================================================
  10334. export type MenuListChild = {
  10335. title: string;
  10336. title_zh: string;
  10337. title_en: string;
  10338. nav: string;
  10339. tip: string;
  10340. tip_en: string;
  10341. alias: string;
  10342. };
  10343. export type MenuList = { class: string; class_en: string; childs: MenuListChild[] };
  10344. export const menuList: MenuList[] = [
  10345. {
  10346. class: '通用',
  10347. class_en: 'Universal',
  10348. childs: [
  10349. {
  10350. title: '按钮 Button',
  10351. title_zh: '按钮',
  10352. title_en: 'Button',
  10353. nav: 'button',
  10354. tip: '按下它,让世界变得更美好吧。',
  10355. tip_en: 'Press it and make the world a better place.',
  10356. alias: 'button|按钮'
  10357. },
  10358. {
  10359. title: '底部浮窗 BottomSheet',
  10360. title_zh: '底部浮窗',
  10361. title_en: 'BottomSheet',
  10362. nav: 'bottomSheet',
  10363. tip: '浮窗犹如小偷,突然出现让你焦灼,却也能唤起你的警觉。',
  10364. tip_en: 'The floating window is like a thief, suddenly appearing to make you anxious, but it can also arouse your alertness.',
  10365. alias:
  10366. 'bottomSheet|底部浮窗 | 底部 | 底|部 | 浮窗|bottomSheet 底部浮窗|bottomSheet 底部浮窗 | 底部弹窗|bottomSheet 底部弹窗|bottomSheet 底部弹窗 | 底部弹出框|bottomSheet 底部弹出框|bottomSheet 底部弹出框 | 底部弹出层|bottomSheet 底部弹出层|bottomSheet 底部弹出层'
  10367. },
  10368. {
  10369. title: '图标 Icon',
  10370. title_zh: '图标',
  10371. title_en: 'Icon',
  10372. nav: 'icon',
  10373. tip: '使用 SVG Sprites,请参照指南引入与使用。',
  10374. tip_en: 'Use SVG Sprites, please refer to the guide to import and use.',
  10375. alias: 'icon|图标|svg'
  10376. },
  10377. {
  10378. title: '遮罩 Mask',
  10379. title_zh: '遮罩',
  10380. title_en: 'Mask',
  10381. nav: 'mask',
  10382. tip: '遮罩虽能掩盖身形,却无法掩藏内心。',
  10383. tip_en: 'Although the mask can cover the figure, it cannot hide the heart.',
  10384. alias: 'mask|遮罩 | 遮|罩|mask 遮罩|mask 遮罩 | 遮罩层|mask 遮罩层|mask 遮罩层|Overlay|maskOverlay|mask Overlay'
  10385. },
  10386. {
  10387. title: '弹出层 Popup',
  10388. title_zh: '弹出层',
  10389. title_en: 'Popup',
  10390. nav: 'popup',
  10391. tip: '机会就像弹珠,只有你努力地推它,它才会弹出来。',
  10392. tip_en: 'Opportunity is like a marble, only if you push it hard, it will pop out.',
  10393. alias:
  10394. 'popup|弹出层 | 弹出 | 弹|出 | 层|popup 弹出层|popup 弹出层 | 弹窗|popup 弹窗|popup 弹窗 | 弹出框|popup 弹出框|popup 弹出框 | 弹出层|popup 弹出层|popup 弹出层'
  10395. }
  10396. ]
  10397. },
  10398. {
  10399. class: '布局',
  10400. class_en: 'Layout',
  10401. childs: [
  10402. {
  10403. title: '分割线 Divider',
  10404. title_zh: '分割线',
  10405. title_en: 'Divider',
  10406. nav: 'divider',
  10407. tip: '分开的日子越久,最初的喜悦越发淡薄。',
  10408. tip_en: 'The longer the days are separated, the more the initial joy fades.',
  10409. alias: 'divider|分割线 | 分割|line'
  10410. },
  10411. {
  10412. title: '网格 Grids',
  10413. title_zh: '网格',
  10414. title_en: 'Grids',
  10415. nav: 'grids',
  10416. tip: '可是怎么说,总觉得,我们之间留了太多空白格。',
  10417. tip_en: 'How can I say, I always feel that there are too many blank grids between us.',
  10418. alias: 'grids|网格|grid|row|col|column'
  10419. },
  10420. {
  10421. title: '占位符 Placeholder',
  10422. title_zh: '占位符',
  10423. title_en: 'Placeholder',
  10424. nav: 'placeholder',
  10425. tip: '人生重要的不是所站的位置,而是所朝的方向。',
  10426. tip_en: 'What is important in life is not the position you stand, but the direction you face.',
  10427. alias: 'placeholder|占位符 | 占位'
  10428. },
  10429. {
  10430. title: '骨架屏 Skeleton',
  10431. title_zh: '骨架屏',
  10432. title_en: 'Skeleton',
  10433. nav: 'skeleton',
  10434. tip: '骨架是支撑身体的关键,而人生信念则是支撑生命的骨架。',
  10435. tip_en: 'The skeleton is the key to supporting the body, and the belief in life is the skeleton that supports life.',
  10436. alias: 'skeleton|骨架屏 | 骨架'
  10437. }
  10438. ]
  10439. },
  10440. {
  10441. class: '导航',
  10442. class_en: 'Navigation',
  10443. childs: [
  10444. {
  10445. title: '索引栏 IndexBar',
  10446. title_zh: '索引栏',
  10447. title_en: 'IndexBar',
  10448. nav: 'indexBar',
  10449. tip: '你不迷途知返,我怎么给你以索引?',
  10450. tip_en: "If you don't know the way back, how can I give you an index?",
  10451. alias: 'indexBar|索引栏|indexbar|index|bar|索引|index 栏 | 索引条|index 条|index 条'
  10452. },
  10453. {
  10454. title: '导航栏 NavBar',
  10455. title_zh: '导航栏',
  10456. title_en: 'NavBar',
  10457. nav: 'navBar',
  10458. tip: '没有指引,在黑暗中只能乱撞。',
  10459. tip_en: 'Without guidance, you can only bump in the dark.',
  10460. alias: 'navBar|导航栏|navbar|nav|bar|导航|nav-bar|nav bar'
  10461. },
  10462. {
  10463. title: '分页 Pagination',
  10464. title_zh: '分页',
  10465. title_en: 'Pagination',
  10466. nav: 'pagination',
  10467. tip: '人生就像一部电影,不论多么精彩,也有谢幕的时候。',
  10468. tip_en: 'Life is like a movie, no matter how wonderful it is, there is a curtain call.',
  10469. alias: 'pagination|分页|page|分 | 页|pagination 分页|pagination 分页|page 分页|page 分页'
  10470. },
  10471. {
  10472. title: '步骤条 Steps',
  10473. title_zh: '步骤条',
  10474. title_en: 'Steps',
  10475. nav: 'steps',
  10476. tip: '人生没有白走的路,每一步都算数。',
  10477. tip_en: 'Life has no wasted steps, every step counts.',
  10478. alias: 'steps|step|步骤条 | 步骤|step 条|step 条 | 步骤栏|step 栏|step 栏'
  10479. },
  10480. {
  10481. title: '标签栏 TabBar',
  10482. title_zh: '标签栏',
  10483. title_en: 'TabBar',
  10484. nav: 'tabBar',
  10485. tip: '看脚下一片黑暗,望头顶星光璀璨。',
  10486. tip_en: "Looking down, it's all darkness; looking up, the stars are shining brightly.",
  10487. alias: 'tabBar|标签栏|tabbar|tab|bar|标签|tab 栏'
  10488. },
  10489. {
  10490. title: '标签页 Tabs',
  10491. title_zh: '标签页',
  10492. title_en: 'Tabs',
  10493. nav: 'tabs',
  10494. tip: '偶尔隐藏,是为了在合适的时候更好地绽放。',
  10495. tip_en: 'Occasionally hide, it is to bloom better at the right time.',
  10496. alias: 'tabs|tab|标签页 | 标签|tab 页'
  10497. }
  10498. ]
  10499. },
  10500. {
  10501. class: '数据输入',
  10502. class_en: 'Data entry',
  10503. childs: [
  10504. {
  10505. title: '动作面板 ActionSheet',
  10506. title_zh: '动作面板',
  10507. title_en: 'ActionSheet',
  10508. nav: 'actionSheet',
  10509. tip: '我的世界只有一个选项,就是你。',
  10510. tip_en: 'There is only one option in my world, and that is you.',
  10511. alias:
  10512. 'actionSheet|动作面板 | 动作 | 动|作 | 面板|actionSheet 动作面板|actionSheet 动作面板 | 动作面板|actionSheet 动作面板|actionSheet 动作面板 | 动作面板|actionSheet 动作面板|actionSheet 动作面板'
  10513. },
  10514. {
  10515. title: '异步选择器 AsyncPicker',
  10516. title_zh: '异步选择器',
  10517. title_en: 'AsyncPicker',
  10518. nav: 'asyncPicker',
  10519. tip: '错过的话,就请错过一辈子吧!',
  10520. tip_en: 'If you miss it, please miss it for a lifetime!',
  10521. alias: 'asyncPicker|异步选择器 | 异步|asyncPicker 异步选择器|asyncPicker 异步选择器|async picker|asyncpicker|异步 picker|异步 picker'
  10522. },
  10523. {
  10524. title: '日历 Calendar',
  10525. title_zh: '日历',
  10526. title_en: 'Calendar',
  10527. nav: 'calendar',
  10528. tip: '在无人问津日子里,正是登峰造极的好时机。',
  10529. tip_en: 'In the days when no one cares, it is a good time to reach the peak.',
  10530. alias:
  10531. 'calendar|日历 | 日|历|calendar 日历|calendar 日历 | 日期|calendar 日期|calendar 日期 | 周选择|calendar 周选择|calendar 周选择 | 周|calendar 周|calendar 周 | 日期区间 | 月选择 | 日期范围选择'
  10532. },
  10533. {
  10534. title: '复选框 Checkbox',
  10535. title_zh: '复选框',
  10536. title_en: 'Checkbox',
  10537. nav: 'checkbox',
  10538. tip: '要么全不,要么全部。',
  10539. tip_en: 'Either all or none.',
  10540. alias:
  10541. 'checkbox|复选框 | 复选|checkbox 复选框|checkbox 复选框 | 复选按钮|checkbox 复选按钮|checkbox 复选按钮 | 多选框 | 多选|checkbox 多选框|checkbox 多选框 | 多选按钮|checkbox 多选按钮|checkbox 多选按钮'
  10542. },
  10543. {
  10544. title: '输入框 Input',
  10545. title_zh: '输入框',
  10546. title_en: 'Input',
  10547. nav: 'input',
  10548. tip: '对方正在输入......',
  10549. tip_en: 'The other party is typing...',
  10550. alias:
  10551. 'input|输入框 | 输入|input 输入框|input 输入框|Textarea|textarea|文本域 | 文本框 | 文本|textarea 文本域|textarea 文本域 | 多行输入框 | 多行输入 | 多行|textarea 多行输入框|textarea 多行输入框'
  10552. },
  10553. {
  10554. title: '数字键盘 NumKeyboard',
  10555. title_zh: '数字键盘',
  10556. title_en: 'NumKeyboard',
  10557. nav: 'numKeyboard',
  10558. tip: '3 0624700 | 3 0624770 | 5 34202 13942 | 4314 0624',
  10559. tip_en: '3 0624700 | 3 0624770 | 5 34202 13942 | 4314 0624',
  10560. alias:
  10561. 'numKeyboard|数字键盘 | 数字 | 键盘|numKeyboard 数字键盘|numKeyboard 数字键盘 | 金额键盘|numKeyboard 金额键盘|numKeyboard 金额键盘|number|keyboard|amount|money|'
  10562. },
  10563. {
  10564. title: '选择器 Picker',
  10565. title_zh: '选择器',
  10566. title_en: 'Picker',
  10567. nav: 'picker',
  10568. tip: '采摘花瓣时,你得不到花的美丽。',
  10569. tip_en: 'When you pick petals, you don’t get the beauty of the flower.',
  10570. alias: 'picker|选择器 | 选择|picker 选择器|picker 选择器'
  10571. },
  10572. {
  10573. title: '单选框 Radio',
  10574. title_zh: '单选框',
  10575. title_en: 'Radio',
  10576. nav: 'radio',
  10577. tip: '如果要在正确和善良中选择一个,请选择善良。',
  10578. tip_en: 'If you have to choose between right and good, choose good.',
  10579. alias: 'radio|单选框 | 单选|radio 单选框|radio 单选框 | 单选按钮|radio 单选按钮|radio 单选按钮'
  10580. },
  10581. {
  10582. title: '评分 Rate',
  10583. title_zh: '评分',
  10584. title_en: 'Rate',
  10585. nav: 'rate',
  10586. tip: '散场时,对方剩余的手机电量,就是这场约会的评分。',
  10587. tip_en: 'At the end of the game, the remaining battery power of the other party is the score of this date.',
  10588. alias: 'rate|评分 | 评|分|rate 评分|rate 评分'
  10589. },
  10590. {
  10591. title: '滑块 Slider',
  10592. title_zh: '滑块',
  10593. title_en: 'Slider',
  10594. nav: 'slider',
  10595. tip: '请滑动解锁您的烦恼。',
  10596. tip_en: 'Please slide to unlock your troubles.',
  10597. alias: 'slider|滑块 | 滑|块|slider 滑块|slider 滑块'
  10598. },
  10599. {
  10600. title: '开关 Switch',
  10601. title_zh: '开关',
  10602. title_en: 'Switch',
  10603. nav: 'switch',
  10604. tip: '死亡是一个开关,活着却是一根绳索。',
  10605. tip_en: 'Death is a switch, but life is a rope.',
  10606. alias: 'switch|开关 | 开|关|switch 开关|switch 开关'
  10607. },
  10608. {
  10609. title: '步进器 Stepper',
  10610. title_zh: '步进器',
  10611. title_en: 'Stepper',
  10612. nav: 'stepper',
  10613. tip: '人生如同诗行,或进或退皆成章。保持心灵节奏,生命之诗韵味悠长。',
  10614. tip_en:
  10615. 'Life is like a poem, advancing or retreating all form chapters. Maintain the rhythm of the soul, and the poetic flavor of life will last long.',
  10616. alias: 'stepper|步进器 | 步|进 | 器|stepper 步进器|stepper 步进器'
  10617. },
  10618. {
  10619. title: '时间选择器 TimePicker',
  10620. title_zh: '时间选择器',
  10621. title_en: 'TimePicker',
  10622. nav: 'timePicker',
  10623. tip: '死亡不是失去生命,而是走出了时间的枷锁。',
  10624. tip_en: 'Death is not the loss of life, but the release of the shackles of time.',
  10625. alias:
  10626. 'timePicker|时间选择器 | 时间|timePicker 时间选择器|timePicker 时间选择器|time picker|timepicker|时间 picker|时间 picker|日期选择器 | 日期|datePicker 日期选择器|datePicker 日期选择器|date picker|datepicker|日期 picker|日期 picker'
  10627. }
  10628. ]
  10629. },
  10630. {
  10631. class: '信息展示',
  10632. class_en: 'Info display',
  10633. childs: [
  10634. {
  10635. title: '头像 Avatar',
  10636. title_zh: '头像',
  10637. title_en: 'Avatar',
  10638. nav: 'avatar',
  10639. tip: '其实我发给您的头像,是情侣头像...',
  10640. tip_en: 'Actually, the avatar I sent to you is a couple avatar...',
  10641. alias: 'avatar|头像 | 头|像|avatar 头像|avatar 头像'
  10642. },
  10643. {
  10644. title: '徽标 Badge',
  10645. title_zh: '徽标',
  10646. title_en: 'Badge',
  10647. nav: 'badge',
  10648. tip: '在标记消失之前,回到我身边。',
  10649. tip_en: 'Before the mark disappears, come back to me.',
  10650. alias: 'badge|徽标 | 徽|标|badge 徽标|badge 徽标 | 标记|badge 标记|badge 标记'
  10651. },
  10652. {
  10653. title: '单元格 Cell',
  10654. title_zh: '单元格',
  10655. title_en: 'Cell',
  10656. nav: 'cell',
  10657. tip: '当全世界抛弃您的时候请记住,您身上有几亿细胞都在为你而活。',
  10658. tip_en: 'When the whole world abandons you, remember that there are billions of cells on your body that are living for you.',
  10659. alias: 'cell|单元格 | 单元|cell 单元格|cell 单元格'
  10660. },
  10661. {
  10662. title: '通告栏 NoticeBar',
  10663. title_zh: '通告栏',
  10664. title_en: 'NoticeBar',
  10665. nav: 'noticeBar',
  10666. tip: '我方开放地下城,这是告知,不是商量。',
  10667. tip_en: 'Our side opens the dungeon, this is to inform, not to discuss.',
  10668. alias:
  10669. 'noticeBar|通告栏 | 通告 | 通|栏|noticeBar 通告栏|noticeBar 通告栏 | 通知栏|noticeBar 通知栏|noticeBar 通知栏 | 公告栏|noticeBar 公告栏|noticeBar 公告栏'
  10670. },
  10671. {
  10672. title: '进度条 Progress',
  10673. title_zh: '进度条',
  10674. title_en: 'Progress',
  10675. nav: 'progress',
  10676. tip: '好运进度:▓▓▓▓▓▓▓▓▓▓▓▓ 100%',
  10677. tip_en: 'Good luck progr: ▓▓▓▓▓▓▓▓▓▓▓▓ 100%',
  10678. alias: 'progress|进度条 | 进度 | 进|度|progress 进度条|progress 进度条'
  10679. },
  10680. {
  10681. title: '进度环 ProgressLoop',
  10682. title_zh: '进度环',
  10683. title_en: 'ProgressLoop',
  10684. nav: 'progressLoop',
  10685. tip: '人生不是一个完美的圆环,一旦完美,你就再没有任何可能性。',
  10686. tip_en: 'Life is not a perfect circle. Once perfect, you have no possibility.',
  10687. alias:
  10688. 'progressLoop|进度环 | 进度 | 进|度|progressLoop 进度环|progressLoop 进度环 | 环形进度条|progressLoop 环形进度条|progressLoop 环形进度条|progress loop|progress-loop'
  10689. },
  10690. {
  10691. title: '轮播 Swiper',
  10692. title_zh: '轮播',
  10693. title_en: 'Swiper',
  10694. nav: 'swiper',
  10695. tip: '人世间悲喜烂剧,昼夜轮播不停。',
  10696. tip_en: 'The ups and downs of life, day and night, are not stopping.',
  10697. alias: 'swiper|轮播 | 轮|播|swiper 轮播|swiper 轮播 | 轮播图|swiper 轮播图|swiper 轮播图 | 走马灯|swiper 走马灯|swiper 走马灯|carousel'
  10698. }
  10699. ]
  10700. },
  10701. {
  10702. class: '反馈',
  10703. class_en: 'Feedback',
  10704. childs: [
  10705. {
  10706. title: '对话框 Dialog',
  10707. title_zh: '对话框',
  10708. title_en: 'Dialog',
  10709. nav: 'dialog',
  10710. tip: '无法确定任何事情,尤其是按下“确定”键的那一刻,我最不确定。',
  10711. tip_en: 'Nothing can be determined, especially at the moment when the "OK" button is pressed, I am the most uncertain.',
  10712. alias:
  10713. 'dialog|对话框 | 对话 | 对|话 | 框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框'
  10714. },
  10715. {
  10716. title: '加载 Loading',
  10717. title_zh: '加载',
  10718. title_en: 'Loading',
  10719. nav: 'loading',
  10720. tip: '不要再苦苦等待答案了,没有回复已是答案。',
  10721. tip_en: "Don't wait for the answer, no reply is the answer.",
  10722. alias: 'loading|加载 | 加载中|loading 加载|loading 加载|loading 加载中|loading 加载中|loading 加载中...|loading 加载中...'
  10723. },
  10724. {
  10725. title: '弹框 Modal',
  10726. title_zh: '弹框',
  10727. title_en: 'Modal',
  10728. nav: 'modal',
  10729. tip: '弹框即人生,要么选择关闭,要么选择继续。',
  10730. tip_en: 'The modal is life, either choose to close or choose to continue.',
  10731. alias:
  10732. 'modal|弹框 | 弹|框|modal 弹框|modal 弹框 | 弹窗|modal 弹窗|modal 弹窗 | 弹出框|modal 弹出框|modal 弹出框 | 弹框|modal 弹框|modal 弹框 | 模态框|modal 模态框|modal 模态框'
  10733. },
  10734. {
  10735. title: '轻提示 Toast',
  10736. title_zh: '轻提示',
  10737. title_en: 'Toast',
  10738. nav: 'toast',
  10739. tip: '总有一些东西,要用消失来证明它的珍贵。',
  10740. tip_en: 'There are always some things that have to disappear to prove their value.',
  10741. alias:
  10742. 'toast|轻提示 | 轻|提示|toast 轻提示|toast 轻提示 | 轻弹窗|toast 轻弹窗|toast 轻弹窗 | 轻提示框|toast 轻提示框|toast 轻提示框 | 吐司|toast 吐司|toast 吐司'
  10743. }
  10744. ]
  10745. }
  10746. ];
  10747. ================================================
  10748. FILE: docs/site/src/data/themes/aqua.ts
  10749. ================================================
  10750. import type { ThemeProps } from 'stdf/theme';
  10751. const Aqua: ThemeProps = {
  10752. name: 'Aqua',
  10753. color: {
  10754. primary: {
  10755. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  10756. 100: 'oklch(0.969 0.019 225.712)', // #E8F8FF hsl(198, 100%, 96%)
  10757. 200: 'oklch(0.832 0.048 227.654)', // #A8CFE1 hsl(199, 49%, 77%)
  10758. 300: 'oklch(0.699 0.07 233.534)', // #72A6C3 hsl(202, 40%, 61%)
  10759. 400: 'oklch(0.575 0.083 237.386)', // #4580A4 hsl(203, 41%, 46%)
  10760. 500: 'oklch(0.46 0.09 243.106)', // #235D86 hsl(205, 59%, 33%)
  10761. default: 'oklch(0.355 0.089 248.677)', // #0A3E68 hsl(207, 83%, 22%)
  10762. 700: 'oklch(0.329 0.09 251.443)', // #073661 hsl(209, 87%, 20%)
  10763. 800: 'oklch(0.302 0.09 253.945)', // #042E5A hsl(211, 92%, 18%)
  10764. 900: 'oklch(0.277 0.09 255.696)', // #022753 hsl(213, 95%, 17%)
  10765. 950: 'oklch(0.253 0.091 257.423)' // #00204D hsl(215, 100%, 15%)
  10766. },
  10767. dark: {
  10768. 50: 'oklch(0.997 0.013 111.26)', // #FEFFF5 hsl(66, 100%, 98%)
  10769. 100: 'oklch(0.992 0.03 110.976)', // #FDFFE8 hsl(65, 100%, 96%)
  10770. 200: 'oklch(0.946 0.068 113.937)', // #ECF3BF hsl(68, 68%, 85%)
  10771. 300: 'oklch(0.9 0.101 116.179)', // #DAE799 hsl(70, 62%, 75%)
  10772. 400: 'oklch(0.857 0.13 118.796)', // #C7DC76 hsl(72, 59%, 66%)
  10773. 500: 'oklch(0.812 0.152 121.068)', // #B3D055 hsl(74, 57%, 58%)
  10774. default: 'oklch(0.767 0.167 123.364)', // #9FC438 hsl(76, 56%, 49%)
  10775. 700: 'oklch(0.673 0.157 125.534)', // #7FA624 hsl(78, 64%, 40%)
  10776. 800: 'oklch(0.577 0.143 127.636)', // #618813 hsl(80, 76%, 30%)
  10777. 900: 'oklch(0.479 0.124 129.495)', // #466A08 hsl(82, 86%, 22%)
  10778. 950: 'oklch(0.381 0.104 130.976)' // #2E4D00 hsl(84, 100%, 15%)
  10779. },
  10780. primaryBlack: 'oklch(0.156 0.033 240.386)', // #010E19 hsl(207, 95%, 5%)
  10781. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(207, 5%, 95%)
  10782. darkBlack: 'oklch(0.199 0.046 122.93)', // #121901 hsl(76, 95%, 5%)
  10783. darkWhite: 'oklch(0.964 0.001 106.424)', // #F3F3F2 hsl(76, 5%, 95%)
  10784. functional: {
  10785. success: 'oklch(0.577 0.18 144.916)', // #069327 hsl(134, 92%, 30%)
  10786. warning: 'oklch(0.615 0.147 54.981)', // #c66810 hsl(29, 85%, 42%)
  10787. error: 'oklch(0.559 0.203 26.879)', // #d12929 hsl(0, 67%, 49%)
  10788. info: 'oklch(0.455 0.194 263.236)' // #1649c0 hsl(222, 79%, 42%)
  10789. },
  10790. extend: [
  10791. {
  10792. color: 'oklch(0.345 0.194 290.65)', // #410093 hsl(267, 100%, 29%)
  10793. alias: 'Yahoo!'
  10794. },
  10795. {
  10796. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  10797. alias: 'WeChat'
  10798. },
  10799. {
  10800. color: 'oklch(0.689 0.196 21.407)', // #fd5c63 hsl(357, 98%, 68%)
  10801. alias: 'Airbnb'
  10802. }
  10803. ]
  10804. }
  10805. };
  10806. export default Aqua;
  10807. ================================================
  10808. FILE: docs/site/src/data/themes/azuper.ts
  10809. ================================================
  10810. import type { ThemeProps } from 'stdf/theme';
  10811. const Azuper: ThemeProps = {
  10812. name: 'Azuper',
  10813. color: {
  10814. primary: {
  10815. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  10816. 100: 'oklch(0.967 0.019 230.689)', // #E8F7FF hsl(201, 100%, 96%)
  10817. 200: 'oklch(0.827 0.048 234.484)', // #A9CCE1 hsl(203, 48%, 77%)
  10818. 300: 'oklch(0.692 0.069 240.216)', // #74A2C3 hsl(205, 40%, 61%)
  10819. 400: 'oklch(0.565 0.085 244.974)', // #487BA5 hsl(207, 39%, 47%)
  10820. 500: 'oklch(0.45 0.094 249.497)', // #265887 hsl(209, 56%, 34%)
  10821. default: 'oklch(0.347 0.095 253.302)', // #0D3A69 hsl(211, 78%, 23%)
  10822. 700: 'oklch(0.317 0.097 256.274)', // #093162 hsl(213, 83%, 21%)
  10823. 800: 'oklch(0.291 0.098 258.443)', // #06295B hsl(215, 88%, 19%)
  10824. 900: 'oklch(0.266 0.098 259.566)', // #032254 hsl(217, 93%, 17%)
  10825. 950: 'oklch(0.241 0.099 260.073)' // #001B4D hsl(219, 100%, 15%)
  10826. },
  10827. dark: {
  10828. 50: 'oklch(0.984 0.009 44.894)', // #FFF8F5 hsl(18, 100%, 98%)
  10829. 100: 'oklch(0.963 0.02 45.262)', // #FFEFE8 hsl(18, 100%, 96%)
  10830. 200: 'oklch(0.889 0.047 41.262)', // #F7D1C3 hsl(16, 77%, 87%)
  10831. 300: 'oklch(0.817 0.075 38.298)', // #EFB3A0 hsl(14, 71%, 78%)
  10832. 400: 'oklch(0.747 0.107 34.759)', // #E8947F hsl(12, 70%, 70%)
  10833. 500: 'oklch(0.68 0.138 32.855)', // #E0755F hsl(10, 68%, 63%)
  10834. default: 'oklch(0.621 0.167 31.47)', // #D85742 hsl(8, 66%, 55%)
  10835. 700: 'oklch(0.522 0.165 29.582)', // #B5372A hsl(6, 62%, 44%)
  10836. 800: 'oklch(0.433 0.152 29.344)', // #921F16 hsl(4, 74%, 33%)
  10837. 900: 'oklch(0.348 0.132 28.566)', // #6F0C09 hsl(2, 85%, 24%)
  10838. 950: 'oklch(0.264 0.108 29.234)' // #4D0000 hsl(0, 100%, 15%)
  10839. },
  10840. primaryBlack: 'oklch(0.15 0.035 247.014)', // #010C19 hsl(211, 95%, 5%)
  10841. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(211, 5%, 95%)
  10842. darkBlack: 'oklch(0.148 0.043 37.362)', // #190401 hsl(8, 95%, 5%)
  10843. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(8, 5%, 95%)
  10844. functional: {
  10845. success: 'oklch(0.663 0.189 146.376)', // #21b043 hsl(134, 68%, 41%)
  10846. warning: 'oklch(0.652 0.163 41.893)', // #df6734 hsl(18, 73%, 54%)
  10847. error: 'oklch(0.616 0.196 13.669)', // #e14161 hsl(348, 73%, 57%)
  10848. info: 'oklch(0.523 0.229 273.504)' // #484eea hsl(238, 79%, 60%)
  10849. },
  10850. extend: [
  10851. {
  10852. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  10853. alias: 'Tencent'
  10854. },
  10855. {
  10856. color: 'oklch(0.654 0.154 241.655)', // #0099e5 hsl(200, 100%, 45%)
  10857. alias: '500px'
  10858. },
  10859. {
  10860. color: 'oklch(0.571 0.235 261.561)', // #1769ff hsl(219, 100%, 55%)
  10861. alias: 'Behance'
  10862. }
  10863. ]
  10864. }
  10865. };
  10866. export default Azuper;
  10867. ================================================
  10868. FILE: docs/site/src/data/themes/azurePink.ts
  10869. ================================================
  10870. import type { ThemeProps } from 'stdf/theme';
  10871. const AzurePink: ThemeProps = {
  10872. name: 'AzurePink',
  10873. color: {
  10874. primary: {
  10875. 50: 'oklch(0.977 0.011 274.897)', // #F5F7FF hsl(228, 100%, 98%)
  10876. 100: 'oklch(0.948 0.025 273.503)', // #E8EDFF hsl(227, 100%, 96%)
  10877. 200: 'oklch(0.799 0.073 275.979)', // #B0BAED hsl(230, 63%, 81%)
  10878. 300: 'oklch(0.66 0.12 275.608)', // #7E8BDB hsl(232, 56%, 68%)
  10879. 400: 'oklch(0.531 0.164 274.903)', // #535EC9 hsl(234, 52%, 56%)
  10880. 500: 'oklch(0.421 0.199 271.236)', // #2D36B7 hsl(236, 61%, 45%)
  10881. default: 'oklch(0.341 0.216 266.286)', // #0D12A5 hsl(238, 85%, 35%)
  10882. 700: 'oklch(0.302 0.198 265.961)', // #08088F hsl(240, 89%, 30%)
  10883. 800: 'oklch(0.269 0.175 267.031)', // #090579 hsl(242, 92%, 25%)
  10884. 900: 'oklch(0.233 0.152 268.05)', // #080263 hsl(244, 96%, 20%)
  10885. 950: 'oklch(0.196 0.128 270.599)' // #08004D hsl(246, 100%, 15%)
  10886. },
  10887. dark: {
  10888. 50: 'oklch(0.979 0.011 356.992)', // #FFF5F8 hsl(342, 100%, 98%)
  10889. 100: 'oklch(0.952 0.027 354.511)', // #FFE8F0 hsl(339, 100%, 96%)
  10890. 200: 'oklch(0.863 0.076 354.34)', // #FBBED5 hsl(337, 88%, 87%)
  10891. 300: 'oklch(0.783 0.127 353.824)', // #F795BE hsl(335, 86%, 78%)
  10892. 400: 'oklch(0.713 0.175 354.443)', // #F36DA9 hsl(333, 85%, 69%)
  10893. 500: 'oklch(0.658 0.216 355.121)', // #EF4698 hsl(331, 84%, 61%)
  10894. default: 'oklch(0.621 0.239 357.218)', // #EB2188 hsl(329, 84%, 53%)
  10895. 700: 'oklch(0.54 0.212 354.913)', // #C31575 hsl(327, 81%, 42%)
  10896. 800: 'oklch(0.458 0.183 353.544)', // #9C0B5F hsl(325, 87%, 33%)
  10897. 900: 'oklch(0.37 0.15 351.13)', // #740449 hsl(323, 93%, 24%)
  10898. 950: 'oklch(0.278 0.117 348.207)' // #4D0032 hsl(321, 100%, 15%)
  10899. },
  10900. primaryBlack: 'oklch(0.106 0.061 269.597)', // #010119 hsl(238, 95%, 5%)
  10901. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(238, 5%, 95%)
  10902. darkBlack: 'oklch(0.144 0.055 350.158)', // #19010D hsl(329, 95%, 5%)
  10903. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(329, 5%, 95%)
  10904. functional: {
  10905. success: 'oklch(0.629 0.199 141.373)', // #2ba417 hsl(112, 75%, 37%)
  10906. warning: 'oklch(0.674 0.166 52.005)', // #e37318 hsl(27, 81%, 49%)
  10907. error: 'oklch(0.599 0.177 27.079)', // #d54941 hsl(3, 64%, 55%)
  10908. info: 'oklch(0.492 0.217 261.351)' // #0052d9 hsl(217, 100%, 43%)
  10909. },
  10910. extend: [
  10911. {
  10912. color: 'oklch(0.364 0.191 266.82)', // #1428a0 hsl(231, 78%, 35%)
  10913. alias: 'Samsung'
  10914. },
  10915. {
  10916. color: 'oklch(0.66 0.225 36.296)', // #fd4900 hsl(17, 100%, 50%)
  10917. alias: 'Xiaomi'
  10918. },
  10919. {
  10920. color: 'oklch(0.461 0.116 153.579)', // #046a38 hsl(151, 93%, 22%)
  10921. alias: 'OPPO'
  10922. }
  10923. ]
  10924. }
  10925. };
  10926. export default AzurePink;
  10927. ================================================
  10928. FILE: docs/site/src/data/themes/camelliaRed.ts
  10929. ================================================
  10930. import type { ThemeProps } from 'stdf/theme';
  10931. const CamelliaRed: ThemeProps = {
  10932. name: 'CamelliaRed',
  10933. color: {
  10934. primary: {
  10935. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  10936. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  10937. 200: 'oklch(0.876 0.061 22.144)', // #FCC7C4 hsl(3, 90%, 88%)
  10938. 300: 'oklch(0.799 0.101 20.296)', // #F8A3A2 hsl(1, 86%, 80%)
  10939. 400: 'oklch(0.732 0.143 20.141)', // #F58082 hsl(359, 85%, 73%)
  10940. 500: 'oklch(0.675 0.18 20.489)', // #F15F66 hsl(357, 84%, 66%)
  10941. default: 'oklch(0.632 0.21 21.584)', // #EE3F4D hsl(355, 84%, 59%)
  10942. 700: 'oklch(0.54 0.193 20.999)', // #C6273A hsl(353, 67%, 47%)
  10943. 800: 'oklch(0.449 0.168 20.933)', // #9D1529 hsl(351, 76%, 35%)
  10944. 900: 'oklch(0.36 0.138 20.161)', // #75081C hsl(349, 87%, 25%)
  10945. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  10946. },
  10947. dark: {
  10948. 50: 'oklch(0.99 0.008 319.447)', // #FEFAFF hsl(288, 100%, 99%)
  10949. 100: 'oklch(0.953 0.037 320.346)', // #FBE8FF hsl(290, 100%, 96%)
  10950. 200: 'oklch(0.915 0.065 318.761)', // #F6D6FF hsl(287, 100%, 92%)
  10951. 300: 'oklch(0.877 0.092 317.423)', // #F0C4FF hsl(285, 100%, 88%)
  10952. 400: 'oklch(0.841 0.118 315.933)', // #E9B3FF hsl(283, 100%, 85%)
  10953. 500: 'oklch(0.803 0.145 314.514)', // #E1A1FF hsl(281, 100%, 82%)
  10954. default: 'oklch(0.765 0.171 312.957)', // #D88FFF hsl(279, 100%, 78%)
  10955. 700: 'oklch(0.602 0.188 310.729)', // #A458D2 hsl(277, 58%, 58%)
  10956. 800: 'oklch(0.461 0.184 307.198)', // #742EA6 hsl(275, 57%, 42%)
  10957. 900: 'oklch(0.339 0.159 303.074)', // #4A1179 hsl(273, 75%, 27%)
  10958. 950: 'oklch(0.231 0.124 299.616)' // #28004D hsl(271, 100%, 15%)
  10959. },
  10960. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  10961. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  10962. darkBlack: 'oklch(0.134 0.06 312.473)', // #100119 hsl(279, 95%, 5%)
  10963. darkWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(279, 5%, 95%)
  10964. functional: {
  10965. success: 'oklch(0.726 0.218 138.487)', // #52c41a hsl(100, 77%, 44%)
  10966. warning: 'oklch(0.802 0.165 76.001)', // #faad14 hsl(40, 96%, 53%)
  10967. error: 'oklch(0.673 0.214 24.465)', // #ff4d4f hsl(359, 100%, 65%)
  10968. info: 'oklch(0.599 0.219 259.04)' // #1677ff hsl(215, 100%, 54%)
  10969. },
  10970. extend: [
  10971. {
  10972. color: 'oklch(0.472 0.108 263.58)', // #3b5998 hsl(221, 44%, 41%)
  10973. alias: 'Facebook'
  10974. },
  10975. {
  10976. color: 'oklch(0.602 0.236 28.928)', // #ed1c16 hsl(2, 86%, 51%)
  10977. alias: 'CocaCola'
  10978. },
  10979. {
  10980. color: 'oklch(0.51 0.145 250.251)', // #0068b5 hsl(206, 100%, 36%)
  10981. alias: 'Intel'
  10982. }
  10983. ]
  10984. }
  10985. };
  10986. export default CamelliaRed;
  10987. ================================================
  10988. FILE: docs/site/src/data/themes/chameleon.ts
  10989. ================================================
  10990. import type { ThemeProps } from 'stdf/theme';
  10991. const Chameleon: ThemeProps = {
  10992. name: 'Chameleon',
  10993. color: {
  10994. primary: {
  10995. 50: 'oklch(0.991 0.014 155.599)', // #F5FFF8 hsl(138, 100%, 98%)
  10996. 100: 'oklch(0.979 0.032 155.407)', // #E8FFEF hsl(138, 100%, 96%)
  10997. 200: 'oklch(0.89 0.085 155.743)', // #ADECC3 hsl(141, 62%, 80%)
  10998. 300: 'oklch(0.812 0.128 154.98)', // #78DA9D hsl(143, 57%, 66%)
  10999. 400: 'oklch(0.742 0.153 154.251)', // #4AC77E hsl(145, 53%, 54%)
  11000. 500: 'oklch(0.682 0.167 152.73)', // #23B564 hsl(147, 68%, 42%)
  11001. default: 'oklch(0.623 0.168 150.91)', // #02A24E hsl(149, 98%, 32%)
  11002. 700: 'oklch(0.564 0.146 152.693)', // #018D49 hsl(151, 99%, 28%)
  11003. 800: 'oklch(0.5 0.124 154.785)', // #017742 hsl(153, 98%, 24%)
  11004. 900: 'oklch(0.437 0.104 156.756)', // #006239 hsl(155, 100%, 19%)
  11005. 950: 'oklch(0.371 0.085 159.162)' // #004D2F hsl(157, 100%, 15%)
  11006. },
  11007. dark: {
  11008. 50: 'oklch(0.98 0.014 336.137)', // #FFF5FC hsl(318, 100%, 98%)
  11009. 100: 'oklch(0.955 0.034 333.19)', // #FFE8FA hsl(313, 100%, 96%)
  11010. 200: 'oklch(0.896 0.07 332.956)', // #FACCF1 hsl(312, 82%, 89%)
  11011. 300: 'oklch(0.842 0.108 332.745)', // #F6B1EA hsl(310, 79%, 83%)
  11012. 400: 'oklch(0.793 0.145 331.761)', // #F197E5 hsl(308, 76%, 77%)
  11013. 500: 'oklch(0.75 0.181 330.986)', // #ED7EE2 hsl(306, 76%, 71%)
  11014. default: 'oklch(0.711 0.213 330.284)', // #E866DF hsl(304, 74%, 66%)
  11015. 700: 'oklch(0.6 0.215 329.149)', // #C140BD hsl(302, 51%, 50%)
  11016. 800: 'oklch(0.496 0.202 328.098)', // #9A229A hsl(300, 64%, 37%)
  11017. 900: 'oklch(0.391 0.17 326.834)', // #700D73 hsl(298, 80%, 25%)
  11018. 950: 'oklch(0.284 0.133 324.454)' // #47004D hsl(295, 100%, 15%)
  11019. },
  11020. primaryBlack: 'oklch(0.189 0.042 157.928)', // #01190C hsl(149, 95%, 5%)
  11021. primaryWhite: 'oklch(0.963 0.002 145.562)', // #F2F3F2 hsl(149, 5%, 95%)
  11022. darkBlack: 'oklch(0.151 0.063 331.348)', // #190117 hsl(304, 95%, 5%)
  11023. darkWhite: 'oklch(0.962 0.002 325.59)', // #F3F2F3 hsl(304, 5%, 95%)
  11024. functional: {
  11025. success: 'oklch(0.731 0.191 137.226)', // #67c23a hsl(100, 54%, 49%)
  11026. warning: 'oklch(0.761 0.139 73.316)', // #e6a23c hsl(36, 77%, 57%)
  11027. error: 'oklch(0.699 0.169 22.456)', // #f56c6c hsl(0, 87%, 69%)
  11028. info: 'oklch(0.663 0.01 264.502)' // #909399 hsl(220, 4%, 58%)
  11029. },
  11030. extend: [
  11031. {
  11032. color: 'oklch(0.746 0.16 232.661)', // #00bcff hsl(194, 100%, 44%)
  11033. alias: 'Tailwind'
  11034. },
  11035. {
  11036. color: 'oklch(0.515 0.206 28.695)', // #c20c0c hsl(0, 88%, 40%)
  11037. alias: 'NetEaseCloudMusic'
  11038. },
  11039. {
  11040. color: 'oklch(0.566 0.238 268.917)', // #415fff hsl(231, 100%, 63%)
  11041. alias: 'vivo'
  11042. }
  11043. ]
  11044. }
  11045. };
  11046. export default Chameleon;
  11047. ================================================
  11048. FILE: docs/site/src/data/themes/citrus.ts
  11049. ================================================
  11050. import type { ThemeProps } from 'stdf/theme';
  11051. const Citrus: ThemeProps = {
  11052. name: 'Citrus',
  11053. color: {
  11054. primary: {
  11055. 50: 'oklch(0.985 0.008 236.556)', // #F5FBFF hsl(204, 100%, 98%)
  11056. 100: 'oklch(0.963 0.019 240.727)', // #E8F5FF hsl(206, 100%, 96%)
  11057. 200: 'oklch(0.818 0.048 241.473)', // #A9C8E0 hsl(206, 47%, 77%)
  11058. 300: 'oklch(0.677 0.07 246.931)', // #749CC1 hsl(209, 38%, 61%)
  11059. 400: 'oklch(0.548 0.088 251.698)', // #4974A3 hsl(211, 38%, 46%)
  11060. 500: 'oklch(0.431 0.097 254.641)', // #275184 hsl(213, 54%, 34%)
  11061. default: 'oklch(0.324 0.099 258.036)', // #0E3265 hsl(215, 76%, 23%)
  11062. 700: 'oklch(0.298 0.102 260.178)', // #0A2A5F hsl(217, 81%, 21%)
  11063. 800: 'oklch(0.274 0.103 261.304)', // #062359 hsl(219, 87%, 19%)
  11064. 900: 'oklch(0.251 0.105 262.192)', // #031C53 hsl(221, 93%, 17%)
  11065. 950: 'oklch(0.229 0.106 261.947)' // #00164D hsl(223, 100%, 15%)
  11066. },
  11067. dark: {
  11068. 50: 'oklch(0.997 0.013 106.635)', // #FFFFF5 hsl(60, 100%, 98%)
  11069. 100: 'oklch(0.994 0.03 106.933)', // #FFFFE8 hsl(60, 100%, 96%)
  11070. 200: 'oklch(0.967 0.08 105.52)', // #FBF8B9 hsl(57, 89%, 86%)
  11071. 300: 'oklch(0.937 0.122 105)', // #F6EF8B hsl(56, 86%, 76%)
  11072. 400: 'oklch(0.903 0.152 102.892)', // #F2E35E hsl(54, 85%, 66%)
  11073. 500: 'oklch(0.867 0.168 100.267)', // #EDD533 hsl(52, 84%, 57%)
  11074. default: 'oklch(0.826 0.168 94.589)', // #E9C30A hsl(50, 92%, 48%)
  11075. 700: 'oklch(0.707 0.144 91.085)', // #C29C06 hsl(48, 94%, 39%)
  11076. 800: 'oklch(0.588 0.12 87.218)', // #9B7703 hsl(46, 96%, 31%)
  11077. 900: 'oklch(0.47 0.096 83.886)', // #745501 hsl(44, 98%, 23%)
  11078. 950: 'oklch(0.35 0.072 82.069)' // #4D3600 hsl(42, 100%, 15%)
  11079. },
  11080. primaryBlack: 'oklch(0.147 0.037 249.929)', // #010B19 hsl(215, 95%, 5%)
  11081. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(215, 5%, 95%)
  11082. darkBlack: 'oklch(0.195 0.038 99.68)', // #191501 hsl(50, 95%, 5%)
  11083. darkWhite: 'oklch(0.964 0.001 106.424)', // #F3F3F2 hsl(50, 5%, 95%)
  11084. functional: {
  11085. success: 'oklch(0.637 0.184 146.403)', // #1ba73e hsl(135, 72%, 38%)
  11086. warning: 'oklch(0.495 0.128 47.783)', // #9a460e hsl(24, 83%, 33%)
  11087. error: 'oklch(0.504 0.203 28.76)', // #bd0a0a hsl(0, 90%, 39%)
  11088. info: 'oklch(0.466 0.24 284.096)' // #5628d7 hsl(256, 69%, 50%)
  11089. },
  11090. extend: [
  11091. {
  11092. color: 'oklch(0.703 0.149 235.113)', // oklch(0.703 0.149 235.059) hsl(197, 98%, 47%)
  11093. alias: 'Twitter'
  11094. },
  11095. {
  11096. color: 'oklch(0.702 0.194 38.137)', // oklch(0.702 0.194 38.137) hsl(15, 100%, 61%)
  11097. alias: 'Svelte'
  11098. },
  11099. {
  11100. color: 'oklch(0.716 0.171 53.446)', // #f38020 hsl(27, 90%, 54%)
  11101. alias: 'Cloudflare'
  11102. }
  11103. ]
  11104. }
  11105. };
  11106. export default Citrus;
  11107. ================================================
  11108. FILE: docs/site/src/data/themes/greenJade.ts
  11109. ================================================
  11110. import type { ThemeProps } from 'stdf/theme';
  11111. const GreenJade: ThemeProps = {
  11112. name: 'GreenJade',
  11113. color: {
  11114. primary: {
  11115. 50: 'oklch(0.992 0.011 176.326)', // #F5FFFC hsl(162, 100%, 98%)
  11116. 100: 'oklch(0.982 0.025 181.302)', // #E8FFFA hsl(167, 100%, 96%)
  11117. 200: 'oklch(0.871 0.05 182.107)', // #B1E0D7 hsl(169, 43%, 79%)
  11118. 300: 'oklch(0.765 0.067 183.674)', // #81C1B7 hsl(171, 34%, 63%)
  11119. 400: 'oklch(0.662 0.075 185.315)', // #59A299 hsl(173, 29%, 49%)
  11120. 500: 'oklch(0.561 0.075 188.146)', // #38837D hsl(175, 40%, 37%)
  11121. default: 'oklch(0.46 0.067 190.938)', // #1F6461 hsl(177, 53%, 26%)
  11122. 700: 'oklch(0.44 0.068 193.584)', // #165E5D hsl(179, 62%, 23%)
  11123. 800: 'oklch(0.416 0.066 196.348)', // #0E5758 hsl(181, 73%, 20%)
  11124. 900: 'oklch(0.389 0.064 199.408)', // #064F52 hsl(182, 86%, 17%)
  11125. 950: 'oklch(0.36 0.062 206.153)' // #00464D hsl(186, 100%, 15%)
  11126. },
  11127. dark: {
  11128. 50: 'oklch(0.993 0.011 95.159)', // #FFFDF5 hsl(48, 100%, 98%)
  11129. 100: 'oklch(0.984 0.024 94.062)', // #FFFAE8 hsl(47, 100%, 96%)
  11130. 200: 'oklch(0.963 0.055 93.624)', // #FFF3CA hsl(46, 100%, 90%)
  11131. 300: 'oklch(0.938 0.081 90.541)', // #FFE9AC hsl(44, 100%, 84%)
  11132. 400: 'oklch(0.909 0.106 87.283)', // #FFDD8D hsl(42, 100%, 78%)
  11133. 500: 'oklch(0.877 0.126 83.083)', // #FFCF6F hsl(40, 100%, 72%)
  11134. default: 'oklch(0.844 0.144 77.934)', // #FFBF51 hsl(38, 100%, 66%)
  11135. 700: 'oklch(0.707 0.132 72.908)', // #D29232 hsl(36, 64%, 51%)
  11136. 800: 'oklch(0.574 0.117 66.999)', // #A6691A hsl(34, 73%, 38%)
  11137. 900: 'oklch(0.444 0.097 61.688)', // #79450A hsl(32, 85%, 26%)
  11138. 950: 'oklch(0.315 0.075 58.16)' // #4D2600 hsl(30, 100%, 15%)
  11139. },
  11140. primaryBlack: 'oklch(0.193 0.032 191.218)', // #011918 hsl(177, 95%, 5%)
  11141. primaryWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(177, 5%, 95%)
  11142. darkBlack: 'oklch(0.18 0.034 82.944)', // #191001 hsl(38, 95%, 5%)
  11143. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(38, 5%, 95%)
  11144. functional: {
  11145. success: 'oklch(0.618 0.208 142.486)', // #09a207 hsl(119, 92%, 33%)
  11146. warning: 'oklch(0.677 0.149 65.479)', // #d4810c hsl(35, 89%, 44%)
  11147. error: 'oklch(0.554 0.224 28.911)', // #d70909 hsl(0, 92%, 44%)
  11148. info: 'oklch(0.419 0.238 264.463)' // #062ecb hsl(228, 94%, 41%)
  11149. },
  11150. extend: [
  11151. {
  11152. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  11153. alias: 'Tencent'
  11154. },
  11155. {
  11156. color: 'oklch(0.606 0.23 11.741)', // #ea1d5d hsl(341, 83%, 52%)
  11157. alias: 'Aparat'
  11158. },
  11159. {
  11160. color: 'oklch(0.588 0.134 239.667)', // #0085c3 hsl(199, 100%, 38%)
  11161. alias: 'Dell'
  11162. }
  11163. ]
  11164. }
  11165. };
  11166. export default GreenJade;
  11167. ================================================
  11168. FILE: docs/site/src/data/themes/index.ts
  11169. ================================================
  11170. import { STDFTheme } from 'stdf/theme';
  11171. import Chameleon from './chameleon.js';
  11172. import AzurePink from './azurePink.js';
  11173. import SmartLive from './smartLive.js';
  11174. import CamelliaRed from './camelliaRed.js';
  11175. import Nintendo from './nintendo.js';
  11176. import Skybloom from './skybloom.js';
  11177. import Aqua from './aqua.js';
  11178. import KleinH from './kleinH.js';
  11179. import Azuper from './azuper.js';
  11180. import Citrus from './citrus.js';
  11181. import Lavender from './lavender.js';
  11182. import TealMedley from './tealMedley.js';
  11183. import GreenJade from './greenJade.js';
  11184. export default [
  11185. { name_CN: 'STDF', name: STDFTheme.name, theme: STDFTheme },
  11186. { name_CN: '任天堂', name: Nintendo.name, theme: Nintendo },
  11187. { name_CN: '蔚蓝粉', name: AzurePink.name, theme: AzurePink },
  11188. { name_CN: '变色龙', name: Chameleon.name, theme: Chameleon },
  11189. { name_CN: '慧活力', name: SmartLive.name, theme: SmartLive },
  11190. { name_CN: '蓝采绿', name: Aqua.name, theme: Aqua },
  11191. { name_CN: '山茶红', name: CamelliaRed.name, theme: CamelliaRed },
  11192. { name_CN: '蓝粉梦', name: Skybloom.name, theme: Skybloom },
  11193. { name_CN: '克莱仕', name: KleinH.name, theme: KleinH },
  11194. { name_CN: '石青柿', name: Azuper.name, theme: Azuper },
  11195. { name_CN: '青佛手', name: Citrus.name, theme: Citrus },
  11196. { name_CN: '以初紫', name: Lavender.name, theme: Lavender },
  11197. { name_CN: '青什锦', name: TealMedley.name, theme: TealMedley },
  11198. { name_CN: '绿玉子', name: GreenJade.name, theme: GreenJade }
  11199. ];
  11200. ================================================
  11201. FILE: docs/site/src/data/themes/kleinH.ts
  11202. ================================================
  11203. import type { ThemeProps } from 'stdf/theme';
  11204. const KleinH: ThemeProps = {
  11205. name: 'KleinH',
  11206. color: {
  11207. primary: {
  11208. 50: 'oklch(0.983 0.009 247.912)', // #F5FAFF hsl(210, 100%, 98%)
  11209. 100: 'oklch(0.957 0.021 254.913)', // #E8F2FF hsl(214, 100%, 96%)
  11210. 200: 'oklch(0.817 0.061 257.788)', // #ABC5EB hsl(216, 62%, 80%)
  11211. 300: 'oklch(0.681 0.099 261.163)', // #7699D6 hsl(218, 54%, 65%)
  11212. 400: 'oklch(0.559 0.134 262.606)', // #4871C2 hsl(220, 50%, 52%)
  11213. 500: 'oklch(0.446 0.164 263.584)', // #214BAD hsl(222, 68%, 40%)
  11214. default: 'oklch(0.355 0.183 263.561)', // #022A99 hsl(224, 97%, 30%)
  11215. 700: 'oklch(0.316 0.17 263.812)', // #012086 hsl(226, 99%, 27%)
  11216. 800: 'oklch(0.28 0.155 264.078)', // #011873 hsl(228, 98%, 23%)
  11217. 900: 'oklch(0.242 0.139 263.958)', // #001060 hsl(230, 100%, 19%)
  11218. 950: 'oklch(0.207 0.12 264.016)' // #000A4D hsl(232, 100%, 15%)
  11219. },
  11220. dark: {
  11221. 50: 'oklch(0.991 0.01 87.47)', // #FFFCF5 hsl(42, 100%, 98%)
  11222. 100: 'oklch(0.978 0.022 83.264)', // #FFF7E8 hsl(39, 100%, 96%)
  11223. 200: 'oklch(0.935 0.058 80.464)', // #FEE6BE hsl(38, 97%, 87%)
  11224. 300: 'oklch(0.886 0.094 74.988)', // #FED193 hsl(35, 98%, 79%)
  11225. 400: 'oklch(0.837 0.125 70.641)', // #FDBB69 hsl(33, 97%, 70%)
  11226. 500: 'oklch(0.786 0.153 63.13)', // #FDA140 hsl(31, 98%, 62%)
  11227. default: 'oklch(0.734 0.178 54.177)', // #FC8416 hsl(29, 98%, 54%)
  11228. 700: 'oklch(0.625 0.159 50.796)', // #D0650E hsl(27, 87%, 44%)
  11229. 800: 'oklch(0.515 0.137 47.874)', // #A44907 hsl(25, 92%, 34%)
  11230. 900: 'oklch(0.405 0.113 45.466)', // #783003 hsl(23, 95%, 24%)
  11231. 950: 'oklch(0.295 0.084 45.171)' // #4D1B00 hsl(21, 100%, 15%)
  11232. },
  11233. primaryBlack: 'oklch(0.133 0.043 259.636)', // #010719 hsl(224, 95%, 5%)
  11234. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(224, 5%, 95%)
  11235. darkBlack: 'oklch(0.17 0.034 67.389)', // #190C01 hsl(29, 95%, 5%)
  11236. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(29, 5%, 95%)
  11237. functional: {
  11238. success: 'oklch(0.439 0.132 145.643)', // #07641d hsl(134, 87%, 21%)
  11239. warning: 'oklch(0.566 0.171 39.514)', // #c54711 hsl(18, 84%, 42%)
  11240. error: 'oklch(0.497 0.177 16.155)', // #b0213e hsl(348, 68%, 41%)
  11241. info: 'oklch(0.573 0.096 219.542)' // #1d859f hsl(192, 69%, 37%)
  11242. },
  11243. extend: [
  11244. {
  11245. color: 'oklch(0.686 0.139 231.254)', // #00a8e0 hsl(195, 100%, 44%)
  11246. alias: 'AT&T'
  11247. },
  11248. {
  11249. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  11250. alias: 'WeChat'
  11251. },
  11252. {
  11253. color: 'oklch(0.652 0.199 0.712)', // #ea4c89 hsl(337, 79%, 61%)
  11254. alias: 'Dribbble'
  11255. }
  11256. ]
  11257. }
  11258. };
  11259. export default KleinH;
  11260. ================================================
  11261. FILE: docs/site/src/data/themes/lavender.ts
  11262. ================================================
  11263. import type { ThemeProps } from 'stdf/theme';
  11264. const Lavender: ThemeProps = {
  11265. name: 'Lavender',
  11266. color: {
  11267. primary: {
  11268. 50: 'oklch(0.978 0.015 315.966)', // #FCF5FF hsl(282, 100%, 98%)
  11269. 100: 'oklch(0.95 0.035 315.73)', // #F8E8FF hsl(282, 100%, 96%)
  11270. 200: 'oklch(0.842 0.065 314.453)', // #DBBFE9 hsl(280, 49%, 83%)
  11271. 300: 'oklch(0.739 0.091 312.314)', // #BE9AD4 hsl(277, 40%, 72%)
  11272. 400: 'oklch(0.641 0.109 310.145)', // #A179BE hsl(275, 35%, 61%)
  11273. 500: 'oklch(0.551 0.124 307.99)', // #865CA9 hsl(273, 31%, 51%)
  11274. default: 'oklch(0.467 0.13 305.627)', // #6C4393 hsl(271, 37%, 42%)
  11275. 700: 'oklch(0.392 0.138 302.664)', // #552C81 hsl(269, 49%, 34%)
  11276. 800: 'oklch(0.326 0.14 298.682)', // #401970 hsl(267, 64%, 27%)
  11277. 900: 'oklch(0.269 0.132 293.856)', // #2D0B5E hsl(265, 79%, 21%)
  11278. 950: 'oklch(0.216 0.123 289.042)' // #1D004D hsl(263, 100%, 15%)
  11279. },
  11280. dark: {
  11281. 50: 'oklch(0.971 0.017 349.48)', // #FFF1F7 hsl(334, 100%, 97%)
  11282. 100: 'oklch(0.953 0.029 347.076)', // #FFE8F3 hsl(331, 100%, 96%)
  11283. 200: 'oklch(0.926 0.042 344.642)', // #FCDCED hsl(328, 84%, 93%)
  11284. 300: 'oklch(0.901 0.053 344.002)', // #F9D1E7 hsl(327, 77%, 90%)
  11285. 400: 'oklch(0.874 0.065 342.674)', // #F5C5E1 hsl(325, 71%, 87%)
  11286. 500: 'oklch(0.85 0.078 340.995)', // #F2BADD hsl(323, 68%, 84%)
  11287. default: 'oklch(0.826 0.092 339.861)', // #EFAFD9 hsl(321, 67%, 81%)
  11288. 700: 'oklch(0.654 0.135 340.177)', // #C66DAA hsl(319, 44%, 60%)
  11289. 800: 'oklch(0.512 0.156 340.793)', // #9E3A81 hsl(317, 46%, 42%)
  11290. 900: 'oklch(0.391 0.15 340.551)', // #75155D hsl(315, 70%, 27%)
  11291. 950: 'oklch(0.284 0.123 340.171)' // #4D003C hsl(313, 100%, 15%)
  11292. },
  11293. primaryBlack: 'oklch(0.129 0.059 306.37)', // #0D0119 hsl(271, 95%, 5%)
  11294. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(271, 5%, 95%)
  11295. darkBlack: 'oklch(0.146 0.057 343.966)', // #190110 hsl(321, 95%, 5%)
  11296. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(321, 5%, 95%)
  11297. functional: {
  11298. success: 'oklch(0.784 0.194 147.722)', // #4ad96b hsl(134, 65%, 57%)
  11299. warning: 'oklch(0.693 0.147 42.888)', // #e67a4c hsl(18, 76%, 60%)
  11300. error: 'oklch(0.639 0.192 24.341)', // #e94e4e hsl(0, 78%, 61%)
  11301. info: 'oklch(0.613 0.168 270.082)' // #5e7ae8 hsl(228, 75%, 64%)
  11302. },
  11303. extend: [
  11304. {
  11305. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  11306. alias: 'Tencent'
  11307. },
  11308. {
  11309. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  11310. alias: 'WeChat'
  11311. },
  11312. {
  11313. color: 'oklch(0.343 0.077 256.446)', // #1c3960 hsl(214, 55%, 24%)
  11314. alias: 'Ford'
  11315. }
  11316. ]
  11317. }
  11318. };
  11319. export default Lavender;
  11320. ================================================
  11321. FILE: docs/site/src/data/themes/nintendo.ts
  11322. ================================================
  11323. import type { ThemeProps } from 'stdf/theme';
  11324. const Nintendo: ThemeProps = {
  11325. name: 'Nintendo',
  11326. color: {
  11327. primary: {
  11328. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  11329. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  11330. 200: 'oklch(0.845 0.076 21.796)', // #FAB9B6 hsl(3, 87%, 85%)
  11331. 300: 'oklch(0.745 0.133 21.872)', // #F58886 hsl(1, 85%, 74%)
  11332. 400: 'oklch(0.662 0.188 22.749)', // #F0575A hsl(359, 84%, 64%)
  11333. 500: 'oklch(0.609 0.224 25.256)', // #EB2B34 hsl(357, 83%, 55%)
  11334. default: 'oklch(0.581 0.238 27.862)', // #E60012 hsl(355, 100%, 45%)
  11335. 700: 'oklch(0.508 0.207 26.549)', // #C00016 hsl(353, 100%, 38%)
  11336. 800: 'oklch(0.43 0.174 24.608)', // #990017 hsl(351, 100%, 30%)
  11337. 900: 'oklch(0.351 0.141 21.971)', // #730015 hsl(349, 100%, 23%)
  11338. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  11339. },
  11340. dark: {
  11341. 50: 'oklch(0.992 0.011 189.833)', // #F5FFFE hsl(174, 100%, 98%)
  11342. 100: 'oklch(0.983 0.024 193.6)', // #E8FFFE hsl(177, 100%, 96%)
  11343. 200: 'oklch(0.938 0.067 196.074)', // #B6F9F9 hsl(180, 85%, 85%)
  11344. 300: 'oklch(0.893 0.099 198.69)', // #85F0F4 hsl(182, 84%, 74%)
  11345. 400: 'oklch(0.847 0.12 201.806)', // #57E4EE hsl(184, 82%, 64%)
  11346. 500: 'oklch(0.803 0.131 206.757)', // #2AD6E9 hsl(186, 81%, 54%)
  11347. default: 'oklch(0.752 0.133 215.123)', // #00C3E3 hsl(189, 100%, 45%)
  11348. 700: 'oklch(0.646 0.116 218.359)', // #009EBD hsl(190, 100%, 37%)
  11349. 800: 'oklch(0.535 0.1 223.819)', // #007998 hsl(192, 100%, 30%)
  11350. 900: 'oklch(0.426 0.083 227.589)', // #005772 hsl(194, 100%, 22%)
  11351. 950: 'oklch(0.319 0.064 230.58)' // #00384D hsl(196, 100%, 15%)
  11352. },
  11353. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  11354. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  11355. darkBlack: 'oklch(0.184 0.03 206.812)', // #011619 hsl(188, 95%, 5%)
  11356. darkWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(188, 5%, 95%)
  11357. functional: {
  11358. success: 'oklch(0.669 0.214 144.385)', // #00b42a hsl(134, 100%, 35%)
  11359. warning: 'oklch(0.865 0.176 95.103)', // #f7d00c hsl(50, 94%, 51%)
  11360. error: 'oklch(0.642 0.218 25.88)', // #f53f3f hsl(0, 90%, 60%)
  11361. info: 'oklch(0.549 0.249 263.048)' // #165dff hsl(222, 100%, 54%)
  11362. },
  11363. extend: [
  11364. {
  11365. color: 'oklch(0.492 0.217 261.351)', // #0052d9 hsl(217, 100%, 43%)
  11366. alias: 'Tencent'
  11367. },
  11368. {
  11369. color: 'oklch(0.651 0.212 142.608)', // #1aad19 hsl(120, 75%, 39%)
  11370. alias: 'WeChat'
  11371. },
  11372. {
  11373. color: 'oklch(0.692 0.181 46.213)', // #f37021 hsl(23, 90%, 54%)
  11374. alias: 'Hermès'
  11375. }
  11376. ]
  11377. }
  11378. };
  11379. export default Nintendo;
  11380. ================================================
  11381. FILE: docs/site/src/data/themes/skybloom.ts
  11382. ================================================
  11383. import type { ThemeProps } from 'stdf/theme';
  11384. const Skybloom: ThemeProps = {
  11385. name: 'Skybloom',
  11386. color: {
  11387. primary: {
  11388. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  11389. 100: 'oklch(0.969 0.019 225.712)', // #E8F8FF hsl(198, 100%, 96%)
  11390. 200: 'oklch(0.863 0.05 229.685)', // #B1D9ED hsl(200, 63%, 81%)
  11391. 300: 'oklch(0.759 0.075 234.966)', // #81B9DA hsl(202, 55%, 68%)
  11392. 400: 'oklch(0.66 0.098 240.067)', // #569AC8 hsl(204, 51%, 56%)
  11393. 500: 'oklch(0.566 0.115 244.99)', // #317CB5 hsl(206, 57%, 45%)
  11394. default: 'oklch(0.479 0.13 251.007)', // #125FA3 hsl(208, 80%, 36%)
  11395. 700: 'oklch(0.42 0.122 253.316)', // #0C4D8D hsl(210, 84%, 30%)
  11396. 800: 'oklch(0.359 0.116 256.313)', // #073B78 hsl(212, 89%, 25%)
  11397. 900: 'oklch(0.303 0.105 257.617)', // #032C62 hsl(214, 94%, 20%)
  11398. 950: 'oklch(0.251 0.093 258.021)' // #001F4D hsl(216, 100%, 15%)
  11399. },
  11400. dark: {
  11401. 50: 'oklch(0.975 0.012 23.703)', // #FFF4F3 hsl(5, 100%, 98%)
  11402. 100: 'oklch(0.949 0.025 17.604)', // #FFE8E8 hsl(0, 100%, 96%)
  11403. 200: 'oklch(0.92 0.038 17.861)', // #FDDBDB hsl(0, 90%, 93%)
  11404. 300: 'oklch(0.89 0.05 15.051)', // #FACED0 hsl(357, 82%, 89%)
  11405. 400: 'oklch(0.861 0.063 12.376)', // #F8C1C6 hsl(355, 80%, 87%)
  11406. 500: 'oklch(0.832 0.076 10.667)', // #F5B4BC hsl(353, 77%, 83%)
  11407. default: 'oklch(0.807 0.089 9.599)', // #F3A8B3 hsl(351, 76%, 81%)
  11408. 700: 'oklch(0.635 0.124 9.491)', // #C9687A hsl(349, 47%, 60%)
  11409. 800: 'oklch(0.493 0.139 10.638)', // #A0374E hsl(347, 49%, 42%)
  11410. 900: 'oklch(0.374 0.131 12.448)', // #76142D hsl(345, 71%, 27%)
  11411. 950: 'oklch(0.268 0.107 13.338)' // #4D0016 hsl(343, 100%, 15%)
  11412. },
  11413. primaryBlack: 'oklch(0.156 0.033 240.386)', // #010E19 hsl(208, 95%, 5%)
  11414. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(208, 5%, 95%)
  11415. darkBlack: 'oklch(0.14 0.05 14.109)', // #190104 hsl(351, 95%, 5%)
  11416. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(351, 5%, 95%)
  11417. functional: {
  11418. success: 'oklch(0.7 0.181 152.201)', // #0fbd63 hsl(149, 85%, 40%)
  11419. warning: 'oklch(0.534 0.132 51.034)', // #a75211 hsl(26, 82%, 36%)
  11420. error: 'oklch(0.58 0.211 10.496)', // #d9265c hsl(342, 70%, 50%)
  11421. info: 'oklch(0.458 0.218 283.692)' // #5231c9 hsl(253, 61%, 49%)
  11422. },
  11423. extend: [
  11424. {
  11425. color: 'oklch(0.703 0.149 235.113)', // oklch(0.703 0.149 235.059) hsl(197, 98%, 47%)
  11426. alias: 'Twitter'
  11427. },
  11428. {
  11429. color: 'oklch(0.702 0.194 38.137)', // oklch(0.702 0.194 38.137) hsl(15, 100%, 61%)
  11430. alias: 'Svelte'
  11431. },
  11432. {
  11433. color: 'oklch(0.518 0.199 259.881)', // #0e5fd8 hsl(216, 88%, 45%)
  11434. alias: 'Philips'
  11435. }
  11436. ]
  11437. }
  11438. };
  11439. export default Skybloom;
  11440. ================================================
  11441. FILE: docs/site/src/data/themes/smartLive.ts
  11442. ================================================
  11443. import type { ThemeProps } from 'stdf/theme';
  11444. const SmartLive: ThemeProps = {
  11445. name: 'SmartLive',
  11446. color: {
  11447. primary: {
  11448. 50: 'oklch(0.978 0.015 315.966)', // #FCF5FF hsl(282, 100%, 98%)
  11449. 100: 'oklch(0.95 0.035 315.73)', // #F8E8FF hsl(282, 100%, 96%)
  11450. 200: 'oklch(0.794 0.075 313.533)', // #CDAEDE hsl(279, 42%, 78%)
  11451. 300: 'oklch(0.652 0.103 312.25)', // #A57DBD hsl(278, 33%, 62%)
  11452. 400: 'oklch(0.522 0.119 309.358)', // #7E549D hsl(275, 30%, 47%)
  11453. 500: 'oklch(0.406 0.122 307.073)', // #5B337C hsl(273, 42%, 34%)
  11454. default: 'oklch(0.304 0.112 304.532)', // #3C1A5B hsl(271, 56%, 23%)
  11455. 700: 'oklch(0.28 0.115 301.336)', // #341357 hsl(269, 64%, 21%)
  11456. 800: 'oklch(0.258 0.119 297.251)', // #2C0C54 hsl(267, 75%, 19%)
  11457. 900: 'oklch(0.238 0.12 293.937)', // #250650 hsl(265, 86%, 17%)
  11458. 950: 'oklch(0.216 0.123 289.042)' // #1D004D hsl(263, 100%, 15%)
  11459. },
  11460. dark: {
  11461. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  11462. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  11463. 200: 'oklch(0.902 0.051 19.634)', // #FFD2D1 hsl(1, 100%, 91%)
  11464. 300: 'oklch(0.853 0.08 18.86)', // #FFBABA hsl(0, 100%, 87%)
  11465. 400: 'oklch(0.806 0.111 17.023)', // #FFA2A6 hsl(357, 100%, 82%)
  11466. 500: 'oklch(0.765 0.14 16.578)', // #FF8B93 hsl(356, 100%, 77%)
  11467. default: 'oklch(0.728 0.169 15.672)', // #FF7483 hsl(354, 100%, 73%)
  11468. 700: 'oklch(0.597 0.173 16.54)', // #D2485A hsl(352, 61%, 55%)
  11469. 800: 'oklch(0.482 0.163 17.177)', // #A6263B hsl(350, 63%, 40%)
  11470. 900: 'oklch(0.373 0.138 17.973)', // #790E23 hsl(348, 79%, 27%)
  11471. 950: 'oklch(0.267 0.107 16.66)' // #4D0012 hsl(346, 100%, 15%)
  11472. },
  11473. primaryBlack: 'oklch(0.129 0.059 306.37)', // #0D0119 hsl(271, 95%, 5%)
  11474. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(271, 5%, 95%)
  11475. darkBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(354, 95%, 5%)
  11476. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(354, 5%, 95%)
  11477. functional: {
  11478. success: 'oklch(0.419 0.092 155.284)', // #155b36 hsl(148, 63%, 22%)
  11479. warning: 'oklch(0.666 0.147 65.222)', // #d07e0b hsl(35, 90%, 43%)
  11480. error: 'oklch(0.564 0.223 28.46)', // #da1414 hsl(0, 83%, 47%)
  11481. info: 'oklch(0.728 0.107 239.498)' // #63b0e3 hsl(204, 70%, 64%)
  11482. },
  11483. extend: [
  11484. {
  11485. color: 'oklch(0.713 0.194 130.802)', // #76b900 hsl(82, 100%, 36%)
  11486. alias: 'NVIDIA'
  11487. },
  11488. {
  11489. color: 'oklch(0.726 0.171 4.454)', // #fb7299 hsl(343, 95%, 72%)
  11490. alias: 'bilibili'
  11491. },
  11492. {
  11493. color: 'oklch(0.599 0.219 259.04)', // #1677ff hsl(215, 100%, 54%)
  11494. alias: 'AliPay'
  11495. }
  11496. ]
  11497. }
  11498. };
  11499. export default SmartLive;
  11500. ================================================
  11501. FILE: docs/site/src/data/themes/tealMedley.ts
  11502. ================================================
  11503. import type { ThemeProps } from 'stdf/theme';
  11504. const TealMedley: ThemeProps = {
  11505. name: 'TealMedley',
  11506. color: {
  11507. primary: {
  11508. 50: 'oklch(0.991 0.01 204.917)', // #F5FEFF hsl(186, 100%, 98%)
  11509. 100: 'oklch(0.977 0.021 207.588)', // #E8FCFF hsl(188, 100%, 96%)
  11510. 200: 'oklch(0.877 0.046 213.81)', // #B5DFE9 hsl(192, 54%, 81%)
  11511. 300: 'oklch(0.78 0.063 217.138)', // #89C2D2 hsl(193, 45%, 68%)
  11512. 400: 'oklch(0.686 0.076 222.122)', // #62A5BC hsl(195, 40%, 56%)
  11513. 500: 'oklch(0.595 0.084 226.019)', // #4089A5 hsl(197, 44%, 45%)
  11514. default: 'oklch(0.509 0.088 231.916)', // #256E8F hsl(199, 59%, 35%)
  11515. 700: 'oklch(0.448 0.086 236.944)', // #195B7E hsl(201, 67%, 30%)
  11516. 800: 'oklch(0.389 0.085 242.356)', // #0E496E hsl(203, 77%, 24%)
  11517. 900: 'oklch(0.334 0.081 245.985)', // #06395D hsl(205, 88%, 19%)
  11518. 950: 'oklch(0.28 0.078 249.311)' // #002A4D hsl(207, 100%, 15%)
  11519. },
  11520. dark: {
  11521. 50: 'oklch(0.971 0.015 33.071)', // #FFF2EF hsl(11, 100%, 97%)
  11522. 100: 'oklch(0.957 0.021 31.78)', // #FFECE8 hsl(10, 100%, 96%)
  11523. 200: 'oklch(0.932 0.028 28.52)', // #FBE2DE hsl(8, 78%, 93%)
  11524. 300: 'oklch(0.905 0.036 24.203)', // #F7D7D4 hsl(5, 69%, 90%)
  11525. 400: 'oklch(0.879 0.042 23.456)', // #F2CDCA hsl(5, 61%, 87%)
  11526. 500: 'oklch(0.852 0.051 21.242)', // #EEC2C0 hsl(3, 58%, 84%)
  11527. default: 'oklch(0.825 0.059 18.425)', // #EAB7B7 hsl(0, 55%, 82%)
  11528. 700: 'oklch(0.642 0.102 17.954)', // #C37275 hsl(358, 40%, 61%)
  11529. 800: 'oklch(0.49 0.126 19.197)', // #9B3D43 hsl(356, 44%, 42%)
  11530. 900: 'oklch(0.369 0.126 21.232)', // #741720 hsl(354, 67%, 27%)
  11531. 950: 'oklch(0.265 0.107 22.403)' // #4D000A hsl(352, 100%, 15%)
  11532. },
  11533. primaryBlack: 'oklch(0.167 0.03 228.62)', // #011119 hsl(199, 95%, 5%)
  11534. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(199, 5%, 95%)
  11535. darkBlack: 'oklch(0.138 0.051 27.08)', // #190101 hsl(0, 95%, 5%)
  11536. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(0, 5%, 95%)
  11537. functional: {
  11538. success: 'oklch(0.608 0.142 148.314)', // #38994f hsl(134, 46%, 41%)
  11539. warning: 'oklch(0.776 0.119 100.626)', // #c7b857 hsl(52, 50%, 56%)
  11540. error: 'oklch(0.66 0.146 21.85)', // #dd6969 hsl(0, 63%, 64%)
  11541. info: 'oklch(0.559 0.131 271.419)' // #596dc0 hsl(228, 45%, 55%)
  11542. },
  11543. extend: [
  11544. {
  11545. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  11546. alias: 'Tencent'
  11547. },
  11548. {
  11549. color: 'oklch(0.424 0.097 251.575)', // #205081 hsl(210, 60%, 32%)
  11550. alias: 'Bitbucket'
  11551. },
  11552. {
  11553. color: 'oklch(0.364 0.191 266.82)', // #1428a0 hsl(231, 78%, 35%)
  11554. alias: 'Samsung'
  11555. }
  11556. ]
  11557. }
  11558. };
  11559. export default TealMedley;
  11560. ================================================
  11561. FILE: docs/site/src/lib/index.ts
  11562. ================================================
  11563. // place files you want to import through the `$lib` alias in this folder.
  11564. ================================================
  11565. FILE: docs/site/src/lib/clis/Clis.svelte
  11566. ================================================
  11567. <script lang="ts">
  11568. import { onMount, onDestroy } from 'svelte';
  11569. import codeGroupSvgData from '../../utils/code-group-svg-data';
  11570. const isZh = localStorage.getItem('lang') === 'zh_CN';
  11571. // 将 codeGroupSvgData 随机打乱
  11572. const randomCodeGroupSvgData = codeGroupSvgData.sort(() => Math.random() - 0.5);
  11573. let showCli = $state(0);
  11574. let intervalTime: ReturnType<typeof setInterval>;
  11575. let isClicked = $state(false);
  11576. let isHover = $state(false);
  11577. let textCli = $state('_');
  11578. let times: ReturnType<typeof setInterval>;
  11579. // 写一个函数,模拟打字效果,传入一段文字,返回一个打字效果的函数
  11580. const typeWriter = (text: string, speed: number = 150) => {
  11581. let number = 0;
  11582. times = setInterval(() => {
  11583. number++;
  11584. if (number >= text.length) {
  11585. number = 0;
  11586. textCli = text;
  11587. clearInterval(times);
  11588. } else {
  11589. textCli = text.slice(0, number) + '_';
  11590. }
  11591. }, speed);
  11592. };
  11593. // 动画
  11594. const animationFun = () => {
  11595. typeWriter(randomCodeGroupSvgData[showCli].cli);
  11596. // 每 3 秒切换一次
  11597. intervalTime = setInterval(() => {
  11598. if (showCli === codeGroupSvgData.length - 1) {
  11599. showCli = 0;
  11600. } else {
  11601. showCli++;
  11602. }
  11603. textCli = '_';
  11604. setTimeout(() => {
  11605. typeWriter(randomCodeGroupSvgData[showCli].cli);
  11606. }, 300);
  11607. }, 6000);
  11608. };
  11609. onMount(() => {
  11610. animationFun();
  11611. window.addEventListener('visibilitychange', () => {
  11612. if (document.visibilityState === 'visible') {
  11613. animationFun();
  11614. } else {
  11615. clearInterval(intervalTime);
  11616. clearInterval(times);
  11617. }
  11618. });
  11619. });
  11620. onDestroy(() => {
  11621. clearInterval(intervalTime);
  11622. clearInterval(times);
  11623. });
  11624. </script>
  11625. <div class="inline-flex justify-center">
  11626. <div class="bg-primary/5 dark:bg-dark/10 rounded-l-full text-xs">
  11627. <div class="mr-2 flex h-7 items-center gap-1 pl-3">{@html randomCodeGroupSvgData[showCli].svg}</div>
  11628. </div>
  11629. <button
  11630. type="button"
  11631. onmouseenter={() => (isHover = true)}
  11632. onmouseleave={() => (isHover = false)}
  11633. class="bg-primary/5 dark:bg-dark/10 relative inline-flex cursor-copy items-center justify-center rounded-r-full py-1 pr-3"
  11634. onclick={async () => {
  11635. await navigator.clipboard.writeText(randomCodeGroupSvgData[showCli].cli);
  11636. isClicked = true;
  11637. setTimeout(() => {
  11638. isClicked = false;
  11639. }, 2000);
  11640. }}
  11641. >
  11642. <code class="text-primary dark:text-dark text-sm opacity-80">{textCli}</code>
  11643. <div
  11644. class="bg-primary dark:bg-dark rounded-xs absolute -top-3 left-1/2 size-3 -translate-x-1/2 rotate-45 transition-all {isHover
  11645. ? '-translate-y-1/2 opacity-100'
  11646. : '-translate-y-4 opacity-0'}"
  11647. ></div>
  11648. <div
  11649. class="bg-primary dark:bg-dark absolute -top-8 left-1/2 -translate-x-1/2 rounded-sm px-2 py-1 text-xs text-white transition-all dark:text-black {isHover
  11650. ? 'translate-y-0 opacity-100'
  11651. : '-translate-y-2 opacity-0'}"
  11652. >
  11653. {isZh ? (isClicked ? '已复制' : '复制') : isClicked ? 'Copied' : 'Copy'}
  11654. </div>
  11655. </button>
  11656. </div>
  11657. ================================================
  11658. FILE: docs/site/src/lib/cmdk/CmdK.svelte
  11659. ================================================
  11660. <script lang="ts">
  11661. import { fade, scale } from 'svelte/transition';
  11662. import { menuList, type MenuList, type MenuListChild } from '../../data/menuList';
  11663. import { page } from '$app/stores';
  11664. import { goto } from '$app/navigation';
  11665. import { isCmdKStore } from '../../store';
  11666. //数组二级组成新数组
  11667. const ArrChildFun = (arr: MenuList[]) => {
  11668. let newArr = [];
  11669. for (let e = 0; e < arr.length; e++) {
  11670. newArr.push(...arr[e].childs);
  11671. }
  11672. return newArr;
  11673. };
  11674. const menuChildList: MenuListChild[] = ArrChildFun(menuList); //展开的菜单列表,全部
  11675. const isZh = localStorage.getItem('lang') === 'zh_CN';
  11676. const params = new URLSearchParams('?');
  11677. let cmdKValue = $state(''); //cmd+k 搜索框的值
  11678. let currentIndex = $state(0); //当前选中的索引
  11679. let currentTab: number = $state(0); //当前选中的 tab
  11680. let cmdFocus = $state(false); //cmd+k 搜索框是否获取焦点
  11681. let cmdKInput: HTMLInputElement | null = $state(null); //cmd+k 搜索框的 dom
  11682. let latelyList: MenuListChild[] = $state(localStorage.getItem('latelyList') ? JSON.parse(localStorage.getItem('latelyList') || '') : []); //最近使用的列表
  11683. let isDemoShake = $state(false); //是否显示 demo 抖动动画
  11684. let isGuideShake = $state(false); //是否显示 guide 抖动动画
  11685. let cmdKList = $derived(
  11686. cmdKValue === '' ? latelyList : menuChildList.filter((item: any) => item.alias.indexOf(cmdKValue.toLowerCase()) > -1)
  11687. ); //cmd+k 搜索框的列表
  11688. let currentMenu = $derived(cmdKList[currentIndex]); //当前选中的菜单
  11689. //cmd+k 搜索框的事件
  11690. const cmdKFun = (e: KeyboardEvent) => {
  11691. // 判断是 Windows 还是 Mac,cmd+k 在 Windows 下是 ctrl+k,监听 e.ctrlKey,Mac 监听 metaKey
  11692. const isMac = /macintosh|mac os x/i.test(navigator.userAgent);
  11693. const isWindows = /windows|win32/i.test(navigator.userAgent);
  11694. //按下 cmd+k 触发事件
  11695. if (e.key === 'k' && ((isMac && e.metaKey) || (isWindows && e.ctrlKey))) {
  11696. const latelyListStr = localStorage.getItem('latelyList');
  11697. latelyList = latelyListStr ? JSON.parse(latelyListStr) : [];
  11698. if ($isCmdKStore) {
  11699. isCmdKStore.set(false);
  11700. cmdFocus = false;
  11701. } else {
  11702. isCmdKStore.set(true);
  11703. cmdFocus = true;
  11704. cmdKValue = '';
  11705. currentIndex = 0;
  11706. currentTab = 0;
  11707. setTimeout(() => {
  11708. cmdKInput?.focus();
  11709. }, 0);
  11710. }
  11711. e.preventDefault();
  11712. }
  11713. //按下 esc 触发事件
  11714. if ($isCmdKStore && e.key === 'Escape') {
  11715. // 阻止默认事件
  11716. e.preventDefault();
  11717. //如果搜索框没有获取焦点,按下 esc 获取焦点并选定搜索框的值
  11718. if (!cmdFocus) {
  11719. cmdFocus = true;
  11720. setTimeout(() => {
  11721. cmdKInput?.focus();
  11722. cmdKInput?.select();
  11723. }, 0);
  11724. } else {
  11725. isCmdKStore.set(false);
  11726. cmdFocus = false;
  11727. }
  11728. }
  11729. //显示 cmd+k 搜索框时,按下上下键触发事件
  11730. if ($isCmdKStore && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
  11731. //阻止默认事件,防止下层滚动
  11732. e.preventDefault();
  11733. cmdFocus = false;
  11734. cmdKInput?.blur();
  11735. if (e.key === 'ArrowUp') {
  11736. if (currentIndex === 0 && currentTab === 0) {
  11737. isDemoShake = true;
  11738. setTimeout(() => {
  11739. isDemoShake = false;
  11740. }, 820);
  11741. return;
  11742. }
  11743. if (currentTab === 0) {
  11744. currentIndex = currentIndex === 0 ? cmdKList.length - 1 : currentIndex - 1;
  11745. currentTab = 2;
  11746. } else {
  11747. currentTab--;
  11748. }
  11749. }
  11750. if (e.key === 'ArrowDown') {
  11751. if (currentIndex === cmdKList.length - 1 && currentTab === 2) {
  11752. isGuideShake = true;
  11753. setTimeout(() => {
  11754. isGuideShake = false;
  11755. }, 820);
  11756. return;
  11757. }
  11758. if (currentTab === 2) {
  11759. currentIndex = currentIndex === cmdKList.length - 1 ? 0 : currentIndex + 1;
  11760. currentTab = 0;
  11761. } else {
  11762. currentTab++;
  11763. }
  11764. }
  11765. }
  11766. //显示 cmd+k 搜索框时,按下回车键触发事件
  11767. if ($isCmdKStore && e.key === 'Enter') {
  11768. const nav = currentMenu.nav;
  11769. const tab = currentTab;
  11770. //将当前选中的菜单添加到最近使用的列表中,并存储到 localStorage 中,最多存储 3 条
  11771. if (latelyList.length > 0 && latelyList[0]?.nav) {
  11772. let index = latelyList.findIndex((item) => item.nav === nav);
  11773. if (index > -1) {
  11774. // latelyList 中包含 currentMenu 时,将 currentMenu 移动到最前面
  11775. const newLatelyList = latelyList.filter((item) => item.nav !== nav);
  11776. newLatelyList.unshift(currentMenu);
  11777. latelyList = newLatelyList;
  11778. } else {
  11779. // 如果 latelyList 中不包含 currentMenu,则将 currentMenu 添加到最前面
  11780. latelyList.unshift(currentMenu);
  11781. }
  11782. } else {
  11783. latelyList.push(currentMenu);
  11784. }
  11785. // 如果 latelyList 长度大于 3,则删除最后一个元素
  11786. if (latelyList.length > 3) {
  11787. latelyList.pop();
  11788. }
  11789. if (latelyList.length > 0 && latelyList[0]?.nav) {
  11790. localStorage.setItem('latelyList', JSON.stringify(latelyList));
  11791. }
  11792. isCmdKStore.set(false);
  11793. cmdFocus = false;
  11794. cmdKValue = '';
  11795. params.set('nav', nav);
  11796. params.set('tab', tab.toString());
  11797. goto(`/components?nav=${nav}&tab=${tab}`);
  11798. if ($page.url.pathname.includes('/components')) {
  11799. setTimeout(() => {
  11800. window.location.reload();
  11801. }, 10);
  11802. }
  11803. }
  11804. };
  11805. //点击搜索框的事件
  11806. const clickCmdKFun = (item: MenuListChild, index: number) => {
  11807. const nav = item.nav;
  11808. const tab = index;
  11809. //将当前选中的菜单添加到最近使用的列表中,并存储到 localStorage 中,最多存储 3 条
  11810. if (latelyList.length > 0 && latelyList[0]?.nav) {
  11811. let index = latelyList.findIndex((item) => item.nav === nav);
  11812. if (index > -1) {
  11813. // latelyList 中包含 item 时,将 item 移动到最前面
  11814. const newLatelyList = latelyList.filter((item) => item.nav !== nav);
  11815. newLatelyList.unshift(item);
  11816. latelyList = newLatelyList;
  11817. } else {
  11818. // 如果 latelyList 中不包含 item,则将 item 添加到最前面
  11819. latelyList.unshift(item);
  11820. }
  11821. } else {
  11822. latelyList.push(item);
  11823. }
  11824. // 如果 latelyList 长度大于 3,则删除最后一个元素
  11825. if (latelyList.length > 3) {
  11826. latelyList.pop();
  11827. }
  11828. if (latelyList.length > 0 && latelyList[0]?.nav) {
  11829. localStorage.setItem('latelyList', JSON.stringify(latelyList));
  11830. }
  11831. isCmdKStore.set(false);
  11832. cmdFocus = false;
  11833. cmdKValue = '';
  11834. params.set('nav', nav);
  11835. params.set('tab', tab.toString());
  11836. goto(`/components?nav=${nav}&tab=${tab}`);
  11837. if ($page.url.pathname.includes('/components')) {
  11838. setTimeout(() => {
  11839. window.location.reload();
  11840. }, 10);
  11841. }
  11842. };
  11843. //关闭 cmd+k 搜索框
  11844. const closeCmdKFun = () => {
  11845. isCmdKStore.set(false);
  11846. cmdFocus = false;
  11847. };
  11848. $effect(() => {
  11849. if ($isCmdKStore) {
  11850. // const latelyListStr = localStorage.getItem('latelyList');
  11851. // latelyList = latelyListStr ? JSON.parse(latelyListStr) : [];
  11852. isCmdKStore.set(true);
  11853. cmdFocus = true;
  11854. currentIndex = 0;
  11855. currentTab = 0;
  11856. setTimeout(() => {
  11857. cmdKInput?.focus();
  11858. }, 0);
  11859. }
  11860. });
  11861. </script>
  11862. <svelte:window onkeydown={cmdKFun} />
  11863. <!-- svelte-ignore a11y_click_events_have_key_events -->
  11864. <!-- svelte-ignore a11y_no_static_element_interactions -->
  11865. {#if $isCmdKStore}
  11866. <div
  11867. transition:fade
  11868. class="fixed left-0 top-0 flex h-screen w-screen flex-col bg-black/20 pt-20 text-left backdrop-blur-sm"
  11869. style="z-index: 10000"
  11870. onclick={closeCmdKFun}
  11871. >
  11872. <div
  11873. in:scale={{ duration: 300, delay: 100 }}
  11874. out:scale={{ duration: 300 }}
  11875. class="mx-auto rounded-xl bg-white shadow-lg dark:bg-black"
  11876. onclick={(e: Event) => e.stopPropagation()}
  11877. >
  11878. <div class="flex items-center border-b border-black/10 px-4 py-3 text-sm text-gray-500 dark:border-white/10">
  11879. <div class="">
  11880. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" style="fill: currentColor;">
  11881. <path fill="none" d="M0 0h24v24H0z" />
  11882. <path
  11883. d="M11 2c4.968 0 9 4.032 9 9s-4.032 9-9 9-9-4.032-9-9 4.032-9 9-9zm0 16c3.867 0 7-3.133 7-7 0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7zm8.485.071l2.829 2.828-1.415 1.415-2.828-2.829 1.414-1.414z"
  11884. />
  11885. </svg>
  11886. </div>
  11887. <div class="grow px-3 text-gray-800 dark:text-gray-200">
  11888. <input
  11889. bind:this={cmdKInput}
  11890. bind:value={cmdKValue}
  11891. class="focus:ring-b caret-primary dark:caret-dark focus:outline-hidden w-full placeholder:text-black/20 dark:bg-black dark:placeholder:text-white/30"
  11892. type="text"
  11893. placeholder={isZh ? '请输入组件关键字' : 'Please enter the component keyword'}
  11894. />
  11895. </div>
  11896. <div class="rounded-sm border border-black/10 px-2 py-1 text-xs font-bold dark:border-white/10">ESC</div>
  11897. </div>
  11898. <div class="overflow-y-auto px-6 pb-6" style="max-height: {(document.documentElement.clientHeight * 3) / 4}px">
  11899. {#if cmdKValue === ''}
  11900. <div class="mt-2 text-xs text-black/50 dark:text-white/30">
  11901. {#if latelyList.length === 0}
  11902. {isZh ? `最近无搜索,请输入关键字搜索。` : `No recent searches, please enter a keyword to search.`}
  11903. {:else}
  11904. {isZh ? `最近搜索 ${latelyList.length} 条结果` : `Recent search ${latelyList.length} results`}
  11905. {/if}
  11906. </div>
  11907. {/if}
  11908. {#if cmdKValue !== ''}
  11909. {#if cmdKList.length === 0}
  11910. <div class="mt-2 text-xs text-black/50 dark:text-white/30">
  11911. {isZh ? '没有搜索到结果' : 'No results found'}
  11912. </div>
  11913. {:else}
  11914. <div class="mt-2 text-xs text-black/50 dark:text-white/30">
  11915. {isZh
  11916. ? `搜索到包含 "${cmdKValue}" 的 ${cmdKList.length} 条结果`
  11917. : `Found ${cmdKList.length} results containing "${cmdKValue}"`}
  11918. </div>
  11919. {/if}
  11920. {/if}
  11921. {#each cmdKList as item, index}
  11922. <div class="flex items-center">
  11923. <div
  11924. class="w-lg mr-2 transition-all {index === currentIndex
  11925. ? 'text-primary dark:text-dark text-xl font-bold'
  11926. : 'text-lg text-black dark:text-white'}"
  11927. >
  11928. {isZh ? item?.title : item?.title_en}
  11929. </div>
  11930. <div class="w-full dark:border-white/10">
  11931. <button
  11932. class="my-1 flex w-full cursor-pointer justify-between rounded-sm border py-1 pl-2 {index === currentIndex &&
  11933. currentTab === 0
  11934. ? 'border-primary dark:border-dark text-primary dark:text-dark'
  11935. : 'text-balck border-transparent dark:text-white'}"
  11936. class:animate-shake={isDemoShake && index === 0}
  11937. onclick={() => clickCmdKFun(item, 0)}
  11938. >
  11939. <div>{isZh ? '示例' : 'Demo'}</div>
  11940. <div>
  11941. <svg
  11942. class={index === currentIndex && currentTab === 0 ? 'fill-primary dark:fill-dark' : 'fill-gray-500'}
  11943. xmlns="http://www.w3.org/2000/svg"
  11944. viewBox="0 0 24 24"
  11945. width="24"
  11946. height="24"
  11947. >
  11948. <path fill="none" d="M0 0h24v24H0z" />
  11949. <path d="M12.172 12L9.343 9.172l1.414-1.415L15 12l-4.243 4.243-1.414-1.415z" />
  11950. </svg>
  11951. </div>
  11952. </button>
  11953. <button
  11954. class="my-1 flex w-full cursor-pointer justify-between rounded-sm border py-1 pl-2 {index === currentIndex &&
  11955. currentTab === 1
  11956. ? 'border-primary dark:border-dark text-primary dark:text-dark'
  11957. : 'text-balck border-transparent dark:text-white'}"
  11958. onclick={() => clickCmdKFun(item, 1)}
  11959. >
  11960. <div>API</div>
  11961. <div>
  11962. <svg
  11963. class={index === currentIndex && currentTab === 1 ? 'fill-primary dark:fill-dark' : 'fill-gray-500'}
  11964. xmlns="http://www.w3.org/2000/svg"
  11965. viewBox="0 0 24 24"
  11966. width="24"
  11967. height="24"
  11968. >
  11969. <path fill="none" d="M0 0h24v24H0z" />
  11970. <path d="M12.172 12L9.343 9.172l1.414-1.415L15 12l-4.243 4.243-1.414-1.415z" />
  11971. </svg>
  11972. </div>
  11973. </button>
  11974. <button
  11975. class="my-1 flex w-full cursor-pointer justify-between rounded-sm border py-1 pl-2 {index === currentIndex &&
  11976. currentTab === 2
  11977. ? 'border-primary dark:border-dark text-primary dark:text-dark'
  11978. : 'text-balck border-transparent dark:text-white'}"
  11979. class:animate-shake={isGuideShake && index === cmdKList.length - 1}
  11980. onclick={() => clickCmdKFun(item, 2)}
  11981. >
  11982. <div>{isZh ? '指南' : 'Guide'}</div>
  11983. <div>
  11984. <svg
  11985. class={index === currentIndex && currentTab === 2 ? 'fill-primary dark:fill-dark' : 'fill-gray-500'}
  11986. xmlns="http://www.w3.org/2000/svg"
  11987. viewBox="0 0 24 24"
  11988. width="24"
  11989. height="24"
  11990. >
  11991. <path fill="none" d="M0 0h24v24H0z" />
  11992. <path d="M12.172 12L9.343 9.172l1.414-1.415L15 12l-4.243 4.243-1.414-1.415z" />
  11993. </svg>
  11994. </div>
  11995. </button>
  11996. </div>
  11997. </div>
  11998. {/each}
  11999. </div>
  12000. <div class="flex gap-4 border-t border-black/10 px-4 py-2 text-xs opacity-60 dark:border-white/10">
  12001. <div class="flex gap-1">
  12002. <div class="rounded-xs flex size-4 flex-col items-center justify-center bg-black/10 p-0.5 dark:bg-white/30">
  12003. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="fill-black dark:fill-white">
  12004. <path
  12005. d="M19.0003 13.9999L19.0004 5.00003L17.0004 5L17.0003 11.9999L6.82845 12L10.7782 8.05027L9.36396 6.63606L3 13L9.36396 19.364L10.7782 17.9498L6.8284 14L19.0003 13.9999Z"
  12006. />
  12007. </svg>
  12008. </div>
  12009. {isZh ? '选择' : 'Select'}
  12010. </div>
  12011. <div class="flex gap-1">
  12012. <div class="rounded-xs flex size-4 flex-col items-center justify-center bg-black/10 p-0.5 dark:bg-white/30">
  12013. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="fill-black dark:fill-white">
  12014. <path
  12015. d="M12.9999 16.1716L18.3638 10.8076L19.778 12.2218L11.9999 20L4.22168 12.2218L5.63589 10.8076L10.9999 16.1716V4H12.9999V16.1716Z"
  12016. />
  12017. </svg>
  12018. </div>
  12019. {isZh ? '向下' : 'Down'}
  12020. </div>
  12021. <div class="flex gap-1">
  12022. <div class="rounded-xs flex size-4 flex-col items-center justify-center bg-black/10 p-0.5 dark:bg-white/30">
  12023. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="fill-black dark:fill-white">
  12024. <path
  12025. d="M12.9999 7.82843V20H10.9999V7.82843L5.63589 13.1924L4.22168 11.7782L11.9999 4L19.778 11.7782L18.3638 13.1924L12.9999 7.82843Z"
  12026. />
  12027. </svg>
  12028. </div>
  12029. {isZh ? '向上' : 'Up'}
  12030. </div>
  12031. <div class="flex gap-1">
  12032. <div class="rounded-xs bg-black/10 px-1 text-xs dark:bg-white/30">Esc</div>
  12033. {isZh ? '关闭' : 'Close'}
  12034. </div>
  12035. </div>
  12036. </div>
  12037. </div>
  12038. {/if}
  12039. ================================================
  12040. FILE: docs/site/src/lib/colorCard/ColorCard.svelte
  12041. ================================================
  12042. <script lang="ts">
  12043. let { colorList = [] } = $props();
  12044. </script>
  12045. {#each colorList as color, index}
  12046. <div
  12047. class="flex w-full flex-1 justify-between self-center px-4 transition hover:scale-105 hover:rounded-sm md:py-0 {index > 5
  12048. ? 'text-white'
  12049. : 'text-black'}"
  12050. style="background-color: {color.color};"
  12051. >
  12052. <div class="flex flex-col justify-center text-sm">{color.key}</div>
  12053. <div class="mt-2 flex flex-col justify-center py-1 text-right">
  12054. <div>{color.color || ''}</div>
  12055. </div>
  12056. </div>
  12057. {/each}
  12058. ================================================
  12059. FILE: docs/site/src/lib/fund/Fund.svelte
  12060. ================================================
  12061. <script lang="ts">
  12062. import { fly, fade } from 'svelte/transition';
  12063. import { isShowFundStore } from '../../store';
  12064. const isZh = localStorage.getItem('lang') === 'zh_CN';
  12065. let showWeChatPay = $state(false);
  12066. let showAlipayPay = $state(false);
  12067. // 判断是否是桌面设备
  12068. const isDeskDeviceFunc = () => {
  12069. return window.innerWidth >= 768;
  12070. };
  12071. const isDeskDevice = isDeskDeviceFunc();
  12072. </script>
  12073. <!-- svelte-ignore a11y_click_events_have_key_events -->
  12074. <!-- svelte-ignore a11y_no_static_element_interactions -->
  12075. <div
  12076. transition:fade
  12077. class="fixed left-0 top-0 flex h-screen w-screen flex-col justify-center bg-black/20 backdrop-blur"
  12078. style="z-index: 1000"
  12079. onclick={() => {
  12080. isShowFundStore.set(false);
  12081. }}
  12082. >
  12083. <div
  12084. in:fly={{ y: -400 }}
  12085. class="mx-auto w-full rounded-xl bg-white p-4 shadow-lg md:w-[800px] md:p-8 dark:bg-gray-950"
  12086. onclick={(e: Event) => e.stopPropagation()}
  12087. >
  12088. <div class="flex justify-between">
  12089. <div class="text-xl font-bold">{isZh ? '支持' : 'Support'}</div>
  12090. <div class="h-8">
  12091. <a href="https://github.com/any-tdf/stdf" target="_blank">
  12092. <img src="https://img.shields.io/github/stars/any-tdf/stdf?logo=github&label=stars&color=000" alt="GitHub" />
  12093. </a>
  12094. </div>
  12095. </div>
  12096. {#if isDeskDevice || (!showWeChatPay && !showAlipayPay)}
  12097. <div class="mt-2 text-xs text-gray-500 md:mt-8">
  12098. <p>
  12099. {isZh
  12100. ? 'STDF 是一个免费、开源、简单易用且精心打造的组件库。我们在组件设计开发、工具配套、文档建设等方面倾注了大量心血。如果 STDF 为您带来了便利,希望您能给个 star 或打赏以示支持,感谢您的厚爱!'
  12101. : 'STDF is a free, open-source, easy-to-use, and carefully crafted component library. We have devoted tremendous effort to component design, development tools, and documentation. If STDF has helped you, please consider showing your support with a star or donation. Thank you for your love!'}
  12102. </p>
  12103. <p class="text-md mt-2 font-bold">
  12104. {isZh ? '无论如何,STDF 都将怀着热爱继续前行!' : 'No matter what, STDF will keep moving forward with love!'}
  12105. </p>
  12106. </div>
  12107. {/if}
  12108. <div class="grid {showWeChatPay || showAlipayPay ? 'grid-cols-1' : 'grid-cols-2'} mt-4 gap-2 text-center md:mt-10 md:grid-cols-4">
  12109. <!-- coffee -->
  12110. {#if isDeskDevice || (!showWeChatPay && !showAlipayPay)}
  12111. <div
  12112. class="group flex w-full flex-col justify-center rounded-lg border border-black/10 py-1 md:relative md:w-40 md:py-12 dark:border-white/10"
  12113. >
  12114. <div class="mx-auto h-8 w-6">
  12115. <img class="h-full w-full object-cover" src="/assets/fund/coffee.svg" alt="coffee" />
  12116. </div>
  12117. <a class="mx-2 block md:hidden" href="https://www.buymeacoffee.com/dufu1991" target="_blank">
  12118. <div class="text-center font-bold after:content-['_↗']">Buy Me a Coffee</div>
  12119. <div class="mt-1 text-xs text-gray-500">
  12120. {isZh ? '推荐非中国地区使用' : 'Recommended for Non-China Regions'}
  12121. </div>
  12122. </a>
  12123. <a
  12124. class="absolute inset-1 hidden h-[95%] w-[95%] bg-white px-1 py-12 opacity-0 transition-all duration-500 group-hover:opacity-95 md:block dark:bg-gray-950"
  12125. href="https://www.buymeacoffee.com/dufu1991"
  12126. target="_blank"
  12127. >
  12128. <div class="text-center font-bold after:content-['_↗']">Buy Me a Coffee</div>
  12129. <div class="mt-1 text-xs text-gray-500">
  12130. {isZh ? '推荐非中国地区使用' : 'Recommended for Non-China Regions'}
  12131. </div>
  12132. </a>
  12133. </div>
  12134. {/if}
  12135. <!-- paypal -->
  12136. {#if isDeskDevice || (!showWeChatPay && !showAlipayPay)}
  12137. <div
  12138. class="group flex w-full flex-col justify-center rounded-lg border border-black/10 py-1 md:relative md:w-40 md:py-12 dark:border-white/10"
  12139. >
  12140. <div class="mx-auto h-8 w-8">
  12141. <img class="h-full w-full object-cover" src="/assets/fund/paypal.svg" alt="paypal" />
  12142. </div>
  12143. <a class="mx-2 block md:hidden" href="https://paypal.me/dufu1991" target="_blank">
  12144. <div class="text-center font-bold after:content-['_↗']">PayPal</div>
  12145. <div class="mt-1 text-xs text-gray-500">
  12146. {isZh ? '推荐非中国地区使用' : 'Recommended for Non-China Regions'}
  12147. </div>
  12148. </a>
  12149. <a
  12150. class="absolute inset-1 hidden h-[95%] w-[95%] bg-white px-1 py-12 opacity-0 transition-all duration-500 group-hover:opacity-95 md:block dark:bg-gray-950"
  12151. href="https://paypal.me/dufu1991"
  12152. target="_blank"
  12153. >
  12154. <div class="text-center font-bold after:content-['_↗']">PayPal</div>
  12155. <div class="mt-1 text-xs text-gray-500">
  12156. {isZh ? '推荐非中国地区使用' : 'Recommended for Non-China Regions'}
  12157. </div>
  12158. </a>
  12159. </div>
  12160. {/if}
  12161. <!-- wechat -->
  12162. {#if isDeskDevice || !showAlipayPay}
  12163. <div
  12164. class="group flex w-full flex-col justify-center rounded-lg border border-black/10 py-1 md:relative md:w-40 md:py-12 dark:border-white/10"
  12165. >
  12166. <div class="mx-auto h-8 w-10" class:hidden={showWeChatPay}>
  12167. <img class="h-full w-full object-cover" src="/assets/fund/wechat_pay.svg" alt="wechat" />
  12168. </div>
  12169. <div
  12170. class="mx-2 block md:hidden"
  12171. onclick={() => {
  12172. showWeChatPay = !showWeChatPay;
  12173. }}
  12174. >
  12175. {#if showWeChatPay}
  12176. <div class="mt-1">
  12177. <img class="mx-auto w-3/5 object-cover" src="/assets/fund/wp_code.png" alt="wechat" />
  12178. </div>
  12179. <div class="mt-1 text-xs text-gray-500">
  12180. {isZh ? '微信扫一扫' : 'WeChat Scan'}
  12181. </div>
  12182. {:else}
  12183. <div class="text-center font-bold after:content-['_↗']">
  12184. {isZh ? '微信赞赏' : 'WeChat Reward'}
  12185. </div>
  12186. <div class="mt-1 text-xs text-gray-500">
  12187. {isZh ? '推荐中国地区使用' : 'Recommended for China Regions'}
  12188. </div>
  12189. {/if}
  12190. </div>
  12191. <button
  12192. onclick={() => {
  12193. showWeChatPay = !showWeChatPay;
  12194. }}
  12195. class="absolute inset-1 hidden h-[95%] w-[95%] cursor-pointer bg-white px-1 opacity-0 transition-all duration-500 group-hover:opacity-95 md:block dark:bg-gray-950"
  12196. class:opacity-95={showWeChatPay}
  12197. >
  12198. {#if showWeChatPay}
  12199. <div class="mt-0.5">
  12200. <img class="mx-auto w-[70%] object-cover" src="/assets/fund/wp_code.png" alt="wechat" />
  12201. </div>
  12202. <div class="mt-0.5 text-xs text-gray-500">
  12203. {isZh ? '微信扫一扫' : 'WeChat Scan'}
  12204. </div>
  12205. {:else}
  12206. <div class="mt-12 text-center font-bold after:content-['_↗']">
  12207. {isZh ? '微信赞赏' : 'WeChat Reward'}
  12208. </div>
  12209. <div class="mt-1 text-xs text-gray-500">
  12210. {isZh ? '推荐中国地区使用' : 'Recommended for China Regions'}
  12211. </div>
  12212. {/if}
  12213. </button>
  12214. </div>
  12215. {/if}
  12216. <!-- alipay -->
  12217. {#if isDeskDevice || !showWeChatPay}
  12218. <div
  12219. class="group mx-auto flex w-full flex-col justify-center rounded-lg border border-black/10 py-1 md:relative md:w-40 md:py-12 dark:border-white/10"
  12220. >
  12221. <div class="mx-auto h-8 w-8" class:hidden={showAlipayPay}>
  12222. <img class="h-full w-full object-cover" src="/assets/fund/alipay.svg" alt="alipay" />
  12223. </div>
  12224. <div
  12225. class="mx-2 block md:hidden"
  12226. onclick={() => {
  12227. showAlipayPay = !showAlipayPay;
  12228. }}
  12229. >
  12230. {#if showAlipayPay}
  12231. <div class="m-1">
  12232. <img class="mx-auto w-3/5 object-cover" src="/assets/fund/ap_code.png" alt="alipay" />
  12233. </div>
  12234. <div class="mt-1 text-xs text-gray-500">
  12235. {isZh ? '支付宝扫一扫' : 'Alipay Scan'}
  12236. </div>
  12237. {:else}
  12238. <div class="text-center font-bold after:content-['_↗']">
  12239. {isZh ? '支付宝收款' : 'Alipay Payment'}
  12240. </div>
  12241. <div class="mt-1 text-xs text-gray-500">
  12242. {isZh ? '推荐中国地区使用' : 'Recommended for China Regions'}
  12243. </div>
  12244. {/if}
  12245. </div>
  12246. <button
  12247. onclick={() => {
  12248. showAlipayPay = !showAlipayPay;
  12249. }}
  12250. class="absolute inset-1 hidden h-[95%] w-[95%] cursor-pointer bg-white px-1 opacity-0 transition-all duration-500 group-hover:opacity-95 md:block dark:bg-gray-950"
  12251. class:opacity-95={showAlipayPay}
  12252. >
  12253. {#if showAlipayPay}
  12254. <div class="mt-0.5">
  12255. <img class="mx-auto w-[70%] object-cover" src="/assets/fund/ap_code.png" alt="wechat" />
  12256. </div>
  12257. <div class="mt-0.5 text-xs text-gray-500">
  12258. {isZh ? '支付宝扫一扫' : 'Alipay Scan'}
  12259. </div>
  12260. {:else}
  12261. <div class="mt-12 text-center font-bold after:content-['_↗']">
  12262. {isZh ? '支付宝收款' : 'Alipay Payment'}
  12263. </div>
  12264. <div class="mt-1 text-xs text-gray-500">
  12265. {isZh ? '推荐中国地区使用' : 'Recommended for China Regions'}
  12266. </div>
  12267. {/if}
  12268. </button>
  12269. </div>
  12270. {/if}
  12271. </div>
  12272. <div class="mt-4 text-xs text-gray-500 md:mt-8">
  12273. {isZh
  12274. ? '欢迎在捐赠留言中附上您的 GitHub 或其他社交账号链接,STDF 将在项目仓库和官网中展示感谢!'
  12275. : 'Feel free to include your GitHub or other social media links in the donation message. STDF will gratefully acknowledge your support on our repository and website!'}
  12276. </div>
  12277. </div>
  12278. </div>
  12279. ================================================
  12280. FILE: docs/site/src/lib/header/Header.svelte
  12281. ================================================
  12282. <script lang="ts">
  12283. import { slide, fly } from 'svelte/transition';
  12284. import ModeSwitch from '../modeSwitch/ModeSwitch.svelte';
  12285. import ThemeSwitch from '../themeSwitch/ThemeSwitch.svelte';
  12286. import { isShowNavStore, isShowFundStore, showThemeSwitchStore } from '../../store';
  12287. import { page } from '$app/stores';
  12288. import stdfPackage from '../../../../../packages/stdf/package.json';
  12289. let { showLeftNav = false, showBottonLine = false, onclickCmdK } = $props();
  12290. let currentRoute = $state('/guide');
  12291. $effect(() => {
  12292. currentRoute = $page.url.pathname;
  12293. });
  12294. let showNav = $state(false); //是否显示导航
  12295. const toggleNavFun = () => {
  12296. isShowNavStore.set(!$isShowNavStore);
  12297. };
  12298. //判断是 Mac 系统
  12299. const isMac = navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;
  12300. const cmdkey = isMac ? '⌘' : 'Ctrl';
  12301. const isZh = localStorage.getItem('lang') === 'zh_CN';
  12302. // const dispatch = createEventDispatcher(); //创建事件派发器
  12303. const clickCmdKFun = () => {
  12304. onclickCmdK?.();
  12305. };
  12306. // 切换支持
  12307. const toggleFundFunc = () => {
  12308. isShowFundStore.set(true);
  12309. };
  12310. // 显示主题切换
  12311. const showThemeFunc = () => {
  12312. showThemeSwitchStore.set(!$showThemeSwitchStore);
  12313. };
  12314. let ThemeSwitchDom: HTMLButtonElement | null = $state(null);
  12315. // 监听 window 点击事件,如果点击的不是 ThemeSwitchDom,则隐藏主题切换
  12316. window.addEventListener('click', (e: MouseEvent) => {
  12317. if (ThemeSwitchDom && !ThemeSwitchDom.contains(e.target as Node)) {
  12318. showThemeSwitchStore.set(false);
  12319. }
  12320. });
  12321. let showVersion = $state(false);
  12322. let versionBtnRef: HTMLButtonElement | null = $state(null);
  12323. const switchLangFunc = () => {
  12324. const isHaveParams = window.location.href.includes('?');
  12325. // 如果有参数,则增加 &lang=xxx,否则增加 ?lang=xxx
  12326. const newUrl = isHaveParams
  12327. ? window.location.href + '&lang=' + (isZh ? 'en_US' : 'zh_CN')
  12328. : window.location.href + '?lang=' + (isZh ? 'en_US' : 'zh_CN');
  12329. window.location.href = newUrl;
  12330. };
  12331. </script>
  12332. <svelte:document
  12333. onclick={(e) => {
  12334. if (versionBtnRef && !versionBtnRef.contains(e.target as Node)) {
  12335. showVersion = false;
  12336. }
  12337. }}
  12338. />
  12339. <div class="sticky top-0 z-[100] flex h-14 items-center justify-between border-black/5 backdrop-blur-sm dark:border-white/10">
  12340. {#if showLeftNav}
  12341. <button class="cursor-pointer p-4 md:hidden" onclick={toggleNavFun}>
  12342. {#if !$isShowNavStore}
  12343. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  12344. <path d="M21.0001 4.50004L7.50007 4.5L7.50006 6L21.0001 6.00004V4.50004Z" fill="currentColor" />
  12345. <path d="M5.25007 4.5L3.00098 4.5L3.00098 6L5.25007 6V4.5Z" fill="currentColor" />
  12346. <path d="M7.50007 11.2501L21.0001 11.2501V12.7501L7.50006 12.7501L7.50007 11.2501Z" fill="currentColor" />
  12347. <path d="M3.00098 11.2501H5.25007V12.7501H3.00098L3.00098 11.2501Z" fill="currentColor" />
  12348. <path d="M7.50007 18L21.0001 18V19.5L7.50006 19.5L7.50007 18Z" fill="currentColor" />
  12349. <path d="M3.00098 18H5.25007V19.5H3.00098L3.00098 18Z" fill="currentColor" />
  12350. </svg>
  12351. {:else}
  12352. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
  12353. <path
  12354. fill="currentColor"
  12355. d="M10.4143 4.58594L10.4142 11.0003L16.0003 11.0004L16.0003 13.0004L10.4142 13.0003L10.4141 19.4144L3 12.0002L10.4143 4.58594ZM18.0002 19.0002V5.00018H20.0002V19.0002H18.0002Z"
  12356. />
  12357. </svg>
  12358. {/if}
  12359. </button>
  12360. {/if}
  12361. <div class="flex items-end">
  12362. <a href="/" class="flex items-center justify-between py-2 md:pl-6" aria-label={isZh ? '首页' : 'Home'}>
  12363. <div class="fill-primary flex h-8 w-16 flex-col items-center justify-center">
  12364. <svg viewBox="0 0 90 80">
  12365. <path
  12366. class="fill-primary dark:fill-dark"
  12367. d="M0 0H20H40H50C64.8056 0 77.7325 8.04398 84.6487 20H50H40V22.6757V30H50C55.5229 30 60 34.4771 60 40C60 45.5229 55.5229 50 50 50H40V57.3243V78.7398V80H20V66.4583V20H15.3513H0V0ZM50 80C72.0914 80 90 62.0914 90 40C90 36.547 89.5625 33.1962 88.7398 30H67.3244C69.0261 32.9417 70 36.3571 70 40C70 51.0457 61.0457 60 50 60V80Z"
  12368. />
  12369. <path class="fill-dark dark:fill-primary" d="M20 30V0L0 50H20V80L40 30H20Z" />
  12370. </svg>
  12371. </div>
  12372. </a>
  12373. <!-- 下拉选项,选择版本 -->
  12374. {#if $page.url.pathname === '' || $page.url.pathname === '/'}
  12375. <div class="relative bottom-1">
  12376. <button
  12377. bind:this={versionBtnRef}
  12378. class="flex cursor-pointer py-0.5 pl-2 pr-4 text-xs text-gray-500"
  12379. onclick={() => (showVersion = !showVersion)}
  12380. >
  12381. {stdfPackage.version}
  12382. <span class="absolute -bottom-px left-8 w-5 text-gray-500">
  12383. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
  12384. <path d="M12 15.0006L7.75732 10.758L9.17154 9.34375L12 12.1722L14.8284 9.34375L16.2426 10.758L12 15.0006Z"></path>
  12385. </svg>
  12386. </span>
  12387. </button>
  12388. {#if showVersion}
  12389. <div
  12390. transition:fly={{ duration: 300, y: -20, opacity: 0 }}
  12391. class="absolute left-0 top-10 w-28 rounded-xl bg-white p-4 text-xs shadow-md dark:bg-black dark:shadow-white/10"
  12392. >
  12393. <div class="text-primary dark:text-dark relative flex py-0.5">
  12394. <span class="mr-1">
  12395. <svg xmlns="http://www.w3.org/2000/svg" class="w-4" viewBox="0 0 24 24">
  12396. <path
  12397. fill="currentColor"
  12398. d="M3 20q-.825 0-1.412-.587T1 18V6q0-.825.588-1.412T3 4h18q.825 0 1.413.588T23 6v12q0 .825-.587 1.413T21 20zm1.75-8.5l2.375 3.25q.075.125.2.188T7.6 15h.3q.25 0 .425-.175T8.5 14.4V9.625q0-.275-.175-.45T7.875 9t-.45.175t-.175.45V12.5L4.925 9.25q-.1-.125-.225-.187T4.425 9h-.3q-.275 0-.45.175t-.175.45v4.75q0 .275.175.45t.45.175t.45-.175t.175-.45zM10 15h2.875q.275 0 .45-.175t.175-.45t-.175-.45t-.45-.175H11v-1.1h1.875q.275 0 .45-.175t.175-.45t-.175-.45t-.45-.175H11v-1.15h1.875q.275 0 .45-.175t.175-.45t-.175-.45t-.45-.175H10q-.2 0-.35.15t-.15.35v5q0 .2.15.35T10 15m5.5 0h4q.425 0 .713-.288T20.5 14V9.625q0-.275-.175-.45T19.875 9t-.45.175t-.175.45V13.5h-1.1v-2.875q0-.275-.175-.45t-.45-.175t-.45.175t-.175.45V13.5h-1.15V9.625q0-.275-.175-.45T15.125 9t-.45.175t-.175.45V14q0 .425.288.713T15.5 15"
  12399. />
  12400. </svg>
  12401. </span>
  12402. {stdfPackage.version}
  12403. <span class="absolute bottom-1 left-12 w-3">
  12404. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
  12405. <path d="M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"
  12406. ></path>
  12407. </svg>
  12408. </span>
  12409. </div>
  12410. <div class="my-2 h-px bg-black/5 dark:bg-white/20"></div>
  12411. <a href="/guide/changelog" class="hover:underline">
  12412. <span class="inline-block size-3 translate-y-0.5">
  12413. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
  12414. <path
  12415. d="M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"
  12416. >
  12417. </path>
  12418. </svg>
  12419. </span>
  12420. {isZh ? '更新日志' : 'Changelog'}
  12421. </a>
  12422. <div class="my-2 h-px bg-black/5 dark:bg-white/20"></div>
  12423. <a href="https://0.stdf.design" target="_blank" class="hover:underline">Version 0.x </a>
  12424. </div>
  12425. {/if}
  12426. </div>
  12427. {/if}
  12428. </div>
  12429. <div>
  12430. <div class="cursor-pointer p-4 md:hidden">
  12431. <button onclick={() => (showNav = !showNav)}>
  12432. {#if !showNav}
  12433. <svg width="24" height="24" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
  12434. <path
  12435. d="M12 6v.01M12 12v.01M12 18v.01M12 7a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"
  12436. stroke="currentColor"
  12437. stroke-width="1.5"
  12438. stroke-linecap="round"
  12439. stroke-linejoin="round"
  12440. />
  12441. </svg>
  12442. {:else}
  12443. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
  12444. <path
  12445. fill="currentColor"
  12446. d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"
  12447. />
  12448. </svg>
  12449. {/if}
  12450. </button>
  12451. {#if showNav}
  12452. <!-- 移动端 -->
  12453. <div
  12454. transition:slide={{ duration: 300, axis: 'y' }}
  12455. class="absolute right-2 top-14 flex flex-col space-y-3 rounded-sm border border-black/10 bg-white p-1 pt-4 text-center text-sm font-bold shadow-lg backdrop-blur-sm dark:border-white/20 dark:bg-gray-950 dark:shadow-white/20"
  12456. >
  12457. <!-- AI 问答 -->
  12458. <a
  12459. href="https://deepwiki.com/any-tdf/stdf"
  12460. class="px-4 py-1 text-center"
  12461. target="_blank"
  12462. title={isZh ? '到 DeepWiki 提问' : 'Ask questions on DeepWiki'}
  12463. aria-label={isZh ? '到 DeepWiki 提问' : 'Ask questions on DeepWiki'}
  12464. >
  12465. <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="inline-block" fill="currentColor">
  12466. <path
  12467. d="M20.7134 8.12811L20.4668 8.69379C20.2864 9.10792 19.7136 9.10792 19.5331 8.69379L19.2866 8.12811C18.8471 7.11947 18.0555 6.31641 17.0677 5.87708L16.308 5.53922C15.8973 5.35653 15.8973 4.75881 16.308 4.57612L17.0252 4.25714C18.0384 3.80651 18.8442 2.97373 19.2761 1.93083L19.5293 1.31953C19.7058 0.893489 20.2942 0.893489 20.4706 1.31953L20.7238 1.93083C21.1558 2.97373 21.9616 3.80651 22.9748 4.25714L23.6919 4.57612C24.1027 4.75881 24.1027 5.35653 23.6919 5.53922L22.9323 5.87708C21.9445 6.31641 21.1529 7.11947 20.7134 8.12811ZM10 3H14V5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17H14C17.3137 17 20 14.3137 20 11H22C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3Z"
  12468. >
  12469. </path>
  12470. </svg>
  12471. </a>
  12472. <a
  12473. href={currentRoute.includes('/guide') ? 'javascript:void(0)' : '/guide'}
  12474. class="px-4 py-1 text-center {currentRoute.includes('/guide') ? ' text-primary dark:text-dark' : ''}"
  12475. >
  12476. {isZh ? '指南' : 'Guide'}
  12477. </a>
  12478. <a
  12479. href={currentRoute.includes('/components') ? 'javascript:void(0)' : '/components?nav=button&tab=0'}
  12480. class="px-4 py-1 text-center {currentRoute.includes('/components') ? ' text-primary dark:text-dark' : ''}"
  12481. >
  12482. {isZh ? '组件' : 'Components'}
  12483. </a>
  12484. <button class="relative px-4 py-1 text-center" onclick={showThemeFunc} bind:this={ThemeSwitchDom}>
  12485. {isZh ? '主题' : 'Theme'}
  12486. {#if $showThemeSwitchStore}
  12487. <div
  12488. transition:slide={{ duration: 300, axis: 'x' }}
  12489. class="absolute top-0 h-80 overflow-y-auto rounded-lg bg-white p-3 shadow-lg dark:bg-black/95 dark:shadow-white/40"
  12490. style="right:{isZh ? '66px' : '128px'}"
  12491. >
  12492. <ModeSwitch useViewTransition={false} />
  12493. <ThemeSwitch vertical />
  12494. </div>
  12495. {/if}
  12496. </button>
  12497. <button class="px-4 py-1 text-center" onclick={toggleFundFunc}>
  12498. {isZh ? '支持' : 'Support'}
  12499. </button>
  12500. <!-- 语言切换 -->
  12501. <button
  12502. onclick={switchLangFunc}
  12503. aria-label={isZh ? '跳转英文站点' : 'Jump to Chinese Site'}
  12504. class="cursor-pointer px-4 py-1 text-center"
  12505. >
  12506. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="inline-block">
  12507. <path fill="none" d="M0 0h24v24H0z" />
  12508. <path
  12509. fill="currentColor"
  12510. d="M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"
  12511. />
  12512. </svg>
  12513. </button>
  12514. <!-- GitHub -->
  12515. <a
  12516. href="https://github.com/any-tdf/stdf"
  12517. class="px-4 py-1 text-center"
  12518. target="_blank"
  12519. aria-label={isZh ? '跳转至 GitHub' : 'Jump to GitHub'}
  12520. >
  12521. <svg width="20" height="20" viewBox="0 0 24 24" class="inline-block" xmlns="http://www.w3.org/2000/svg">
  12522. <path
  12523. fill-rule="evenodd"
  12524. clip-rule="evenodd"
  12525. d="M12 2.23999C6.475 2.23999 2 6.71499 2 12.24C2 16.665 4.8625 20.4025 8.8375 21.7275C9.3375 21.815 9.525 21.515 9.525 21.2525C9.525 21.015 9.5125 20.2275 9.5125 19.39C7 19.8525 6.35 18.7775 6.15 18.215C6.0375 17.9275 5.55 17.04 5.125 16.8025C4.775 16.615 4.275 16.1525 5.1125 16.14C5.9 16.1275 6.4625 16.865 6.65 17.165C7.55 18.6775 8.9875 18.2525 9.5625 17.99C9.65 17.34 9.9125 16.9025 10.2 16.6525C7.975 16.4025 5.65 15.54 5.65 11.715C5.65 10.6275 6.0375 9.72749 6.675 9.02749C6.575 8.77749 6.225 7.75249 6.775 6.37749C6.775 6.37749 7.6125 6.11499 9.525 7.40249C10.325 7.17749 11.175 7.06499 12.025 7.06499C12.875 7.06499 13.725 7.17749 14.525 7.40249C16.4375 6.10249 17.275 6.37749 17.275 6.37749C17.825 7.75249 17.475 8.77749 17.375 9.02749C18.0125 9.72749 18.4 10.615 18.4 11.715C18.4 15.5525 16.0625 16.4025 13.8375 16.6525C14.2 16.965 14.5125 17.565 14.5125 18.5025C14.5125 19.84 14.5 20.915 14.5 21.2525C14.5 21.515 14.6875 21.8275 15.1875 21.7275C17.1727 21.0573 18.8977 19.7815 20.1198 18.0795C21.3419 16.3776 21.9995 14.3352 22 12.24C22 6.71499 17.525 2.23999 12 2.23999Z"
  12526. fill="currentColor"
  12527. />
  12528. </svg>
  12529. </a>
  12530. </div>
  12531. {/if}
  12532. </div>
  12533. <!--PC 端-->
  12534. <div class="hidden items-center space-x-2 px-6 font-bold md:flex">
  12535. <!-- AI 问答 -->
  12536. <a
  12537. href="https://deepwiki.com/any-tdf/stdf"
  12538. class="inline-block px-2 py-1"
  12539. target="_blank"
  12540. title={isZh ? '到 DeepWiki 提问' : 'Ask questions on DeepWiki'}
  12541. aria-label={isZh ? '到 DeepWiki 提问' : 'Ask questions on DeepWiki'}
  12542. >
  12543. <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"
  12544. ><path
  12545. d="M20.7134 8.12811L20.4668 8.69379C20.2864 9.10792 19.7136 9.10792 19.5331 8.69379L19.2866 8.12811C18.8471 7.11947 18.0555 6.31641 17.0677 5.87708L16.308 5.53922C15.8973 5.35653 15.8973 4.75881 16.308 4.57612L17.0252 4.25714C18.0384 3.80651 18.8442 2.97373 19.2761 1.93083L19.5293 1.31953C19.7058 0.893489 20.2942 0.893489 20.4706 1.31953L20.7238 1.93083C21.1558 2.97373 21.9616 3.80651 22.9748 4.25714L23.6919 4.57612C24.1027 4.75881 24.1027 5.35653 23.6919 5.53922L22.9323 5.87708C21.9445 6.31641 21.1529 7.11947 20.7134 8.12811ZM10 3H14V5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17H14C17.3137 17 20 14.3137 20 11H22C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3Z"
  12546. ></path></svg
  12547. >
  12548. </a>
  12549. <button
  12550. class="flex cursor-pointer rounded-sm border border-black/10 p-0.5 text-xs font-normal text-black/40 transition-all hover:border-black/20 dark:border-white/10 dark:text-white/40 dark:hover:border-white/20"
  12551. onclick={clickCmdKFun}
  12552. >
  12553. <div class="mr-1 flex flex-col justify-center">
  12554. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" style="fill: currentColor;">
  12555. <path fill="none" d="M0 0h24v24H0z" />
  12556. <path
  12557. d="M11 2c4.968 0 9 4.032 9 9s-4.032 9-9 9-9-4.032-9-9 4.032-9 9-9zm0 16c3.867 0 7-3.133 7-7 0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7zm8.485.071l2.829 2.828-1.415 1.415-2.828-2.829 1.414-1.414z"
  12558. />
  12559. </svg>
  12560. </div>
  12561. <div class="mr-2 flex flex-col justify-center">
  12562. {isZh ? '搜索...' : 'Search...'}
  12563. </div>
  12564. <div class="rounded-sm bg-black/5 px-1 dark:bg-white/5">{cmdkey} K</div>
  12565. </button>
  12566. <a
  12567. href={currentRoute.includes('/guide') ? 'javascript:void(0)' : '/guide'}
  12568. class="px-2 py-1{currentRoute.includes('/guide') ? ' text-primary dark:text-dark' : ''}"
  12569. >
  12570. {isZh ? '指南' : 'Guide'}
  12571. </a>
  12572. <a
  12573. href={currentRoute.includes('/components') ? 'javascript:void(0)' : '/components?nav=button&tab=0'}
  12574. class="inline-block px-2 py-1 text-center{currentRoute.includes('/components')
  12575. ? ' text-primary dark:text-dark pointer-events-none'
  12576. : ''}"
  12577. >
  12578. {isZh ? '组件' : 'Components'}
  12579. </a>
  12580. <!-- svelte-ignore a11y_mouse_events_have_key_events -->
  12581. <button
  12582. class="relative px-2 py-1 text-center"
  12583. onmouseover={() => showThemeSwitchStore.set(true)}
  12584. onmouseout={() => showThemeSwitchStore.set(false)}
  12585. bind:this={ThemeSwitchDom}
  12586. >
  12587. {isZh ? '主题' : 'Theme'}
  12588. {#if $showThemeSwitchStore}
  12589. <div transition:slide={{ duration: 300, axis: 'y' }} class="absolute left-1/2 top-8 -translate-x-1/2 pt-2">
  12590. <div class="rounded-md bg-white px-3 pb-1 pt-2 shadow-lg dark:bg-black/95 dark:shadow-white/10">
  12591. <ModeSwitch useViewTransition={false} />
  12592. <ThemeSwitch vertical />
  12593. </div>
  12594. </div>
  12595. {/if}
  12596. </button>
  12597. <button class="cursor-pointer px-2 py-1 text-center" onclick={toggleFundFunc}>
  12598. {isZh ? '支持' : 'Support'}
  12599. </button>
  12600. <!-- 语言切换 -->
  12601. <button
  12602. onclick={switchLangFunc}
  12603. class="cursor-pointer px-2 py-1 text-center"
  12604. aria-label={isZh ? '跳转英文站点' : 'Jump to Chinese Site'}
  12605. >
  12606. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="inline-block">
  12607. <path fill="none" d="M0 0h24v24H0z" />
  12608. <path
  12609. fill="currentColor"
  12610. d="M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"
  12611. />
  12612. </svg>
  12613. </button>
  12614. <!-- GitHub -->
  12615. <a
  12616. href="https://github.com/any-tdf/stdf"
  12617. class="inline-block px-2 py-1"
  12618. target="_blank"
  12619. aria-label={isZh ? '跳转至 GitHub' : 'Jump to GitHub'}
  12620. >
  12621. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="inline-block">
  12622. <path
  12623. fill-rule="evenodd"
  12624. clip-rule="evenodd"
  12625. d="M12 2.23999C6.475 2.23999 2 6.71499 2 12.24C2 16.665 4.8625 20.4025 8.8375 21.7275C9.3375 21.815 9.525 21.515 9.525 21.2525C9.525 21.015 9.5125 20.2275 9.5125 19.39C7 19.8525 6.35 18.7775 6.15 18.215C6.0375 17.9275 5.55 17.04 5.125 16.8025C4.775 16.615 4.275 16.1525 5.1125 16.14C5.9 16.1275 6.4625 16.865 6.65 17.165C7.55 18.6775 8.9875 18.2525 9.5625 17.99C9.65 17.34 9.9125 16.9025 10.2 16.6525C7.975 16.4025 5.65 15.54 5.65 11.715C5.65 10.6275 6.0375 9.72749 6.675 9.02749C6.575 8.77749 6.225 7.75249 6.775 6.37749C6.775 6.37749 7.6125 6.11499 9.525 7.40249C10.325 7.17749 11.175 7.06499 12.025 7.06499C12.875 7.06499 13.725 7.17749 14.525 7.40249C16.4375 6.10249 17.275 6.37749 17.275 6.37749C17.825 7.75249 17.475 8.77749 17.375 9.02749C18.0125 9.72749 18.4 10.615 18.4 11.715C18.4 15.5525 16.0625 16.4025 13.8375 16.6525C14.2 16.965 14.5125 17.565 14.5125 18.5025C14.5125 19.84 14.5 20.915 14.5 21.2525C14.5 21.515 14.6875 21.8275 15.1875 21.7275C17.1727 21.0573 18.8977 19.7815 20.1198 18.0795C21.3419 16.3776 21.9995 14.3352 22 12.24C22 6.71499 17.525 2.23999 12 2.23999Z"
  12626. fill="currentColor"
  12627. />
  12628. </svg>
  12629. </a>
  12630. </div>
  12631. </div>
  12632. </div>
  12633. ================================================
  12634. FILE: docs/site/src/lib/menu/Menu.svelte
  12635. ================================================
  12636. <script lang="ts">
  12637. let { currentNav = $bindable(''), showNum = true, menuList = [], onclickMenu } = $props();
  12638. import type { MenuListChild } from '../../data/menuList.js';
  12639. const setClick = (menu: MenuListChild) => {
  12640. currentNav = menu.nav;
  12641. onclickMenu(menu);
  12642. };
  12643. const isZh = localStorage.getItem('lang') === 'zh_CN';
  12644. </script>
  12645. <div class="flex flex-col px-2 py-4">
  12646. <span class="pb-3 text-xs text-gray-500">
  12647. {isZh ? '文档更新:' : 'Document last updated:'}
  12648. <br />
  12649. {isZh ? import.meta.env.VITE_BUILD_TIME_ZH : import.meta.env.VITE_BUILD_TIME_EN}
  12650. </span>
  12651. {#each menuList as menu}
  12652. <div class="text-xs">
  12653. {isZh ? menu.class : menu.class_en}{showNum ? `(${menu.childs.length})` : ''}
  12654. </div>
  12655. <div class="my-2 ml-1 flex flex-col gap-3 border-l-2 border-black/10 pr-0 dark:border-white/20">
  12656. {#each menu.childs as child}
  12657. <button
  12658. onclick={(e: MouseEvent) => {
  12659. e.preventDefault();
  12660. // e.self();
  12661. setClick(child);
  12662. }}
  12663. class="box-content -translate-x-0.5 cursor-pointer border-l-2 py-0.5 pl-2 text-left text-sm transition-all hover:font-bold {child.nav ===
  12664. currentNav
  12665. ? 'border-primary text-primary dark:border-dark dark:text-dark font-bold'
  12666. : 'border-transparent'}"
  12667. >
  12668. {isZh ? child.title : child.title_en}
  12669. </button>
  12670. {/each}
  12671. </div>
  12672. {/each}
  12673. </div>
  12674. ================================================
  12675. FILE: docs/site/src/lib/modeSwitch/darkMode.ts
  12676. ================================================
  12677. /**
  12678. * 给 HTML 元素增加或删除 dark 类名,实现 Mode 切换
  12679. * Add or remove the dark class name to the HTML element to implement Mode switching
  12680. * @param {boolean} [isDark] 是否为 dark 模式
  12681. * @returns {void}
  12682. * @example
  12683. */
  12684. export default (isDark = true, ev: MouseEvent, useViewTransition = true) => {
  12685. document.documentElement.style.setProperty('--x', ev.clientX + 'px');
  12686. document.documentElement.style.setProperty('--y', ev.clientY + 'px');
  12687. if (isDark) {
  12688. if ('startViewTransition' in document && useViewTransition) {
  12689. (document as Document & { startViewTransition: (callback: () => void) => void }).startViewTransition(() => {
  12690. document.documentElement.classList.add('dark');
  12691. });
  12692. } else {
  12693. document.documentElement.classList.add('dark');
  12694. }
  12695. } else {
  12696. if ('startViewTransition' in document && useViewTransition) {
  12697. (document as Document & { startViewTransition: (callback: () => void) => void }).startViewTransition(() => {
  12698. document.documentElement.classList.remove('dark');
  12699. });
  12700. } else {
  12701. document.documentElement.classList.remove('dark');
  12702. }
  12703. }
  12704. };
  12705. ================================================
  12706. FILE: docs/site/src/lib/modeSwitch/ModeSwitch.svelte
  12707. ================================================
  12708. <script lang="ts">
  12709. let { useViewTransition = true } = $props();
  12710. import darkMode from './darkMode';
  12711. import { themeStore, sysThemeStore, currentThemeStore } from '../../store';
  12712. let isClick = $state(false);
  12713. //手动切换主题
  12714. const toggleFun = (e: MouseEvent) => {
  12715. // 阻止冒泡
  12716. e.stopPropagation();
  12717. isClick = true;
  12718. setTimeout(() => {
  12719. isClick = false;
  12720. }, 150);
  12721. if ($themeStore === 'light') {
  12722. // 切换到 dark
  12723. themeStore.set('dark');
  12724. currentThemeStore.set('dark');
  12725. localStorage.setItem('theme', 'dark');
  12726. darkMode(true, e, useViewTransition);
  12727. } else if ($themeStore === 'dark') {
  12728. // 切换到 auto
  12729. themeStore.set('auto');
  12730. localStorage.setItem('theme', 'auto');
  12731. if ($sysThemeStore === 'dark') {
  12732. // 系统是暗模式
  12733. darkMode(true, e, useViewTransition);
  12734. currentThemeStore.set('dark');
  12735. } else {
  12736. darkMode(false, e, useViewTransition);
  12737. currentThemeStore.set('light');
  12738. }
  12739. } else {
  12740. // 切换到 light
  12741. themeStore.set('light');
  12742. currentThemeStore.set('light');
  12743. localStorage.setItem('theme', 'light');
  12744. darkMode(false, e, useViewTransition);
  12745. }
  12746. };
  12747. //auto 时,监听系统主题
  12748. const mql: MediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');
  12749. mql.addEventListener('change', (e: MediaQueryListEvent) => {
  12750. if ($themeStore === 'auto') {
  12751. if (e.matches) {
  12752. // 系统是暗模式
  12753. darkMode(true, e as unknown as MouseEvent);
  12754. sysThemeStore.set('dark');
  12755. currentThemeStore.set('dark');
  12756. } else {
  12757. darkMode(false, e as unknown as MouseEvent);
  12758. sysThemeStore.set('light');
  12759. currentThemeStore.set('light');
  12760. }
  12761. }
  12762. });
  12763. const isZh = localStorage.getItem('lang') === 'zh_CN';
  12764. </script>
  12765. <button
  12766. class="mx-auto flex cursor-pointer justify-between rounded-sm bg-black/5 p-0.5 text-center dark:bg-white/10"
  12767. aria-label={isZh
  12768. ? `${$themeStore === 'light' ? '亮模式' : $themeStore === 'dark' ? '暗模式' : '跟随系统'}`
  12769. : `${$themeStore === 'light' ? 'Light' : $themeStore === 'dark' ? 'Dark' : 'System'}`}
  12770. onclick={toggleFun}
  12771. >
  12772. <div
  12773. class:scale-75={isClick}
  12774. class="min-h-full px-1 transition-all duration-150 rounded-sm{$themeStore === 'light' ? ' shadow-xs bg-white/80' : ''}"
  12775. style="color:{$sysThemeStore === 'dark'
  12776. ? $themeStore === 'light'
  12777. ? '#ff3f2e'
  12778. : '#646464'
  12779. : $themeStore === 'light'
  12780. ? '#ff3f2e'
  12781. : $themeStore === 'dark'
  12782. ? '#646464'
  12783. : '#cecece'}"
  12784. >
  12785. <svg width="20" height="20" viewBox="0 0 20 24" fill="none" style="display: inline;" xmlns="http://www.w3.org/2000/svg">
  12786. <path
  12787. fill="currentColor"
  12788. d="M9.99996 3.15217C10.5252 3.15217 10.951 2.72636 10.951 2.20109C10.951 1.67582 10.5252 1.25 9.99996 1.25C9.47469 1.25 9.04887 1.67582 9.04887 2.20109C9.04887 2.72636 9.47469 3.15217 9.99996 3.15217Z"
  12789. />
  12790. <path
  12791. fill="currentColor"
  12792. d="M9.99992 4.29348C6.84829 4.29348 4.2934 6.84838 4.2934 10C4.2934 13.1516 6.84829 15.7065 9.99992 15.7065C13.1515 15.7065 15.7064 13.1516 15.7064 10C15.7064 6.84838 13.1515 4.29348 9.99992 4.29348Z"
  12793. />
  12794. <path
  12795. fill="currentColor"
  12796. d="M16.4673 4.4837C16.4673 5.00896 16.0415 5.43478 15.5162 5.43478C14.991 5.43478 14.5652 5.00896 14.5652 4.4837C14.5652 3.95843 14.991 3.53261 15.5162 3.53261C16.0415 3.53261 16.4673 3.95843 16.4673 4.4837Z"
  12797. />
  12798. <path
  12799. fill="currentColor"
  12800. d="M17.7989 10.9511C18.3241 10.9511 18.75 10.5253 18.75 10C18.75 9.47474 18.3241 9.04891 17.7989 9.04891C17.2736 9.04891 16.8478 9.47474 16.8478 10C16.8478 10.5253 17.2736 10.9511 17.7989 10.9511Z"
  12801. />
  12802. <path
  12803. fill="currentColor"
  12804. d="M16.4673 15.5163C16.4673 16.0416 16.0415 16.4674 15.5162 16.4674C14.991 16.4674 14.5652 16.0416 14.5652 15.5163C14.5652 14.991 14.991 14.5652 15.5162 14.5652C16.0415 14.5652 16.4673 14.991 16.4673 15.5163Z"
  12805. />
  12806. <path
  12807. fill="currentColor"
  12808. d="M9.99996 18.75C10.5252 18.75 10.951 18.3242 10.951 17.7989C10.951 17.2736 10.5252 16.8478 9.99996 16.8478C9.47469 16.8478 9.04887 17.2736 9.04887 17.7989C9.04887 18.3242 9.47469 18.75 9.99996 18.75Z"
  12809. />
  12810. <path
  12811. fill="currentColor"
  12812. d="M5.43469 15.5163C5.43469 16.0416 5.00887 16.4674 4.4836 16.4674C3.95833 16.4674 3.53252 16.0416 3.53252 15.5163C3.53252 14.991 3.95833 14.5652 4.4836 14.5652C5.00887 14.5652 5.43469 14.991 5.43469 15.5163Z"
  12813. />
  12814. <path
  12815. fill="currentColor"
  12816. d="M2.20096 10.9511C2.72623 10.9511 3.15205 10.5253 3.15205 10C3.15205 9.47474 2.72623 9.04891 2.20096 9.04891C1.67569 9.04891 1.24988 9.47474 1.24988 10C1.24988 10.5253 1.67569 10.9511 2.20096 10.9511Z"
  12817. />
  12818. <path
  12819. fill="currentColor"
  12820. d="M5.43469 4.4837C5.43469 5.00896 5.00887 5.43478 4.4836 5.43478C3.95833 5.43478 3.53252 5.00896 3.53252 4.4837C3.53252 3.95843 3.95833 3.53261 4.4836 3.53261C5.00887 3.53261 5.43469 3.95843 5.43469 4.4837Z"
  12821. />
  12822. </svg>
  12823. </div>
  12824. <div
  12825. class:scale-75={isClick}
  12826. class="min-h-full px-1 transition-all duration-150 rounded-sm{$themeStore === 'dark' ? ' shadow-xs bg-black/50' : ''}"
  12827. style="color:{$sysThemeStore === 'light'
  12828. ? $themeStore === 'auto'
  12829. ? '#cecece'
  12830. : $themeStore === 'dark'
  12831. ? '#fff'
  12832. : '#cecece'
  12833. : $themeStore === 'light'
  12834. ? '#cecece'
  12835. : $themeStore === 'auto'
  12836. ? '#646464'
  12837. : '#fff'}"
  12838. >
  12839. <svg width="20" height="20" style="display: inline;position:relative;top:-1px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
  12840. <path
  12841. fill="currentColor"
  12842. d="M9.99993 3.12494C6.20294 3.12494 3.12488 6.203 3.12488 10C3.12488 13.797 6.20294 16.8751 9.99993 16.8751C13.7969 16.8751 16.875 13.797 16.875 10C16.875 9.52352 16.8264 9.0577 16.7337 8.6075C16.6752 8.32295 16.4282 8.11628 16.1378 8.10872C15.8474 8.10117 15.5901 8.29473 15.5168 8.57585C15.1411 10.0167 13.8302 11.0795 12.2727 11.0795C10.4212 11.0795 8.92039 9.57869 8.92039 7.72726C8.92039 6.16969 9.98319 4.85879 11.4241 4.48312C11.7052 4.40983 11.8988 4.15249 11.8912 3.86207C11.8836 3.57165 11.677 3.32473 11.3924 3.26616C10.9422 3.1735 10.4764 3.12494 9.99993 3.12494Z"
  12843. />
  12844. </svg>
  12845. </div>
  12846. <div
  12847. class="min-h-full px-1 transition-all duration-150 rounded-sm{$themeStore === 'auto' && $sysThemeStore === 'light'
  12848. ? ' bg-white/80'
  12849. : ''}{$themeStore === 'auto' && $sysThemeStore === 'dark' ? ' bg-black/50' : ''}{$themeStore === 'auto' && $sysThemeStore === 'light'
  12850. ? ' shadow-xs'
  12851. : ''}"
  12852. style="color:{$themeStore === 'light'
  12853. ? '#cecece'
  12854. : $themeStore === 'dark'
  12855. ? '#646464'
  12856. : $themeStore === 'auto' && $sysThemeStore === 'light'
  12857. ? '#ff3f2e'
  12858. : '#fff'};background-size: 30%;"
  12859. >
  12860. <svg xmlns="http://www.w3.org/2000/svg" style="display: inline;" viewBox="0 0 24 28" width="20" height="20">
  12861. <path
  12862. fill="currentColor"
  12863. d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-2V6a6 6 0 1 1 0 12z"
  12864. />
  12865. </svg>
  12866. </div>
  12867. </button>
  12868. ================================================
  12869. FILE: docs/site/src/lib/tab/Tab.svelte
  12870. ================================================
  12871. <script lang="ts">
  12872. import { fade } from 'svelte/transition';
  12873. import { currentThemeStore, isWideScreenStore } from '../../store';
  12874. // @ts-expect-error - beautify-qrcode 缺少类型定义
  12875. import { encodeData, rendererLine } from 'beautify-qrcode';
  12876. import { page } from '$app/stores';
  12877. let { currentTab = 0, onclickTab } = $props();
  12878. const tabList = [
  12879. { zh: '示例', en: 'Demo' },
  12880. { zh: 'API', en: 'API' },
  12881. { zh: '指南', en: 'Guide' },
  12882. { zh: 'FAQ', en: 'FAQ' },
  12883. { zh: '版本', en: 'Version' }
  12884. ];
  12885. const changeIndexFun = (i: number) => {
  12886. currentTab = i;
  12887. onclickTab?.(i);
  12888. };
  12889. const isZh = localStorage.getItem('lang') === 'zh_CN';
  12890. let showQr = $state(false);
  12891. let QRValue = $state('');
  12892. let A_a1Svg = $state('');
  12893. const mouseenterFun = () => {
  12894. const params = new URLSearchParams('?' + $page.url.searchParams);
  12895. QRValue =
  12896. (import.meta.env.DEV ? location.protocol + '//' + location.hostname + ':8888/' : 'HTTPS://DEMO.STDF.DESIGN/') +
  12897. params.get('nav') +
  12898. (isZh ? '/zh_CN' : '/en_US');
  12899. showQr = true;
  12900. /**
  12901. * A_a1
  12902. * @param {Object} qrcode
  12903. * @param {Object} options
  12904. * @param {String} [options.type] 连线方向 0=>左右 1=>上下 2=>纵横 3=>回环 4=>左上—右下 5=>右上—左下 6=>交叉"
  12905. * @param {String} [options.size] 连线粗细
  12906. * @param {String} [options.opacity] 连线不透明度
  12907. * @param {String} [options.posType] 定位点样式 0=>矩形 1=>圆形 2=>行星 3=>圆角矩形
  12908. * @param {String} [options.otherColor] 连线颜色
  12909. * @param {String} [options.posColor] 定位点颜色
  12910. */
  12911. const qrcode = encodeData({
  12912. text: QRValue,
  12913. isSpace: false
  12914. });
  12915. const color = $currentThemeStore === 'dark' ? 'var(--color-dark)' : 'var(--color-primary)';
  12916. A_a1Svg = rendererLine(qrcode, {
  12917. posType: 2,
  12918. otherColor: color,
  12919. posColor: color
  12920. });
  12921. };
  12922. let showStackblitz = $state(false);
  12923. let stackblitzValue = $state('');
  12924. const showStackblitzFunc = () => {
  12925. const nav = $page.url.searchParams.get('nav');
  12926. stackblitzValue = `https://stackblitz.com/github/any-tdf/demo-stdf?file=src%2Froutes%2F${
  12927. nav
  12928. }%2F${isZh ? 'zh_CN' : 'en_US'}%2F%2Bpage.svelte&startScript=${nav}${isZh ? '' : '_en'}`;
  12929. showStackblitz = true;
  12930. };
  12931. let showCode = $state(false);
  12932. let codeValue = $state('');
  12933. const showCodeFunc = () => {
  12934. const nav = $page.url.searchParams.get('nav');
  12935. // 将 nav 首字母大写
  12936. const navFirst = nav ? nav.slice(0, 1).toUpperCase() + nav.slice(1) : '';
  12937. codeValue = `https://github.com/any-tdf/stdf/blob/main/packages/stdf/src/lib/components/${nav}/${navFirst}.svelte`;
  12938. showCode = true;
  12939. };
  12940. let showFull = $state(false);
  12941. // 全屏
  12942. const changeFullFunc = () => {
  12943. if ($isWideScreenStore) {
  12944. isWideScreenStore.set(false);
  12945. localStorage.setItem('isFull', 'notFull');
  12946. } else {
  12947. isWideScreenStore.set(true);
  12948. localStorage.setItem('isFull', 'full');
  12949. }
  12950. };
  12951. </script>
  12952. <div class="w-82 md:w-102 relative top-14">
  12953. <div class="relative rounded-sm bg-gray-100 p-1 dark:bg-gray-700">
  12954. <!--滑块-->
  12955. <div
  12956. class="absolute top-1 h-10 w-16 rounded-sm bg-white shadow-md transition-all duration-300 md:w-20 dark:bg-black dark:shadow-white/10"
  12957. class:left-1={currentTab === 0}
  12958. class:left-17={currentTab === 1}
  12959. class:md:left-21={currentTab === 1}
  12960. class:left-33={currentTab === 2}
  12961. class:md:left-41={currentTab === 2}
  12962. class:left-49={currentTab === 3}
  12963. class:md:left-61={currentTab === 3}
  12964. class:left-65={currentTab === 4}
  12965. class:md:left-81={currentTab === 4}
  12966. ></div>
  12967. <!--二维码-->
  12968. <a href={QRValue} target="_blank">
  12969. <button
  12970. onmouseleave={() => (showQr = false)}
  12971. onmouseenter={mouseenterFun}
  12972. class="left-106 absolute top-0 hidden h-12 w-12 rounded-sm bg-gray-100 p-3 md:block dark:bg-gray-700"
  12973. >
  12974. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" style="fill: currentColor">
  12975. <path fill="none" d="M0 0h24v24H0z" />
  12976. <path
  12977. d="M16 17v-1h-3v-3h3v2h2v2h-1v2h-2v2h-2v-3h2v-1h1zm5 4h-4v-2h2v-2h2v4zM3 3h8v8H3V3zm2 2v4h4V5H5zm8-2h8v8h-8V3zm2 2v4h4V5h-4zM3 13h8v8H3v-8zm2 2v4h4v-4H5zm13-2h3v2h-3v-2zM6 6h2v2H6V6zm0 10h2v2H6v-2zM16 6h2v2h-2V6z"
  12978. />
  12979. </svg>
  12980. {#if showQr}
  12981. <div
  12982. class="absolute left-0 top-14 z-50 hidden w-60 rounded-sm bg-black p-6 shadow-lg dark:block"
  12983. transition:fade={{ duration: 200 }}
  12984. >
  12985. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  12986. <span>{@html A_a1Svg}</span>
  12987. </div>
  12988. {/if}
  12989. {#if showQr}
  12990. <div
  12991. class="absolute left-0 top-14 z-50 block w-60 rounded-sm bg-white p-6 shadow-lg dark:hidden"
  12992. transition:fade={{ duration: 200 }}
  12993. >
  12994. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  12995. <span>{@html A_a1Svg}</span>
  12996. </div>
  12997. {/if}
  12998. </button>
  12999. </a>
  13000. <!--组件源码-->
  13001. <a href={codeValue} target="_blank">
  13002. <button
  13003. onmouseleave={() => (showCode = false)}
  13004. onmouseenter={showCodeFunc}
  13005. class="absolute left-[30.5rem] top-0 hidden h-12 w-12 rounded-sm bg-gray-100 p-3 md:block dark:bg-gray-700"
  13006. >
  13007. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" style="fill: currentColor">
  13008. <path
  13009. d="M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM4 5V19H20V5H4ZM20 12L16.4645 15.5355L15.0503 14.1213L17.1716 12L15.0503 9.87868L16.4645 8.46447L20 12ZM6.82843 12L8.94975 14.1213L7.53553 15.5355L4 12L7.53553 8.46447L8.94975 9.87868L6.82843 12ZM11.2443 17H9.11597L12.7557 7H14.884L11.2443 17Z"
  13010. />
  13011. </svg>
  13012. {#if showCode}
  13013. <div
  13014. class="{isZh
  13015. ? 'w-28'
  13016. : 'w-52'} absolute left-0 top-14 z-50 h-12 rounded-sm bg-gray-700 py-3 text-center leading-[1.5rem] text-white shadow-lg"
  13017. transition:fade={{ duration: 200 }}
  13018. >
  13019. {isZh ? '组件源码' : 'Component source code'}
  13020. </div>
  13021. {/if}
  13022. </button>
  13023. </a>
  13024. <!--StackBlitz-->
  13025. <a href={stackblitzValue} target="_blank">
  13026. <button
  13027. onmouseleave={() => (showStackblitz = false)}
  13028. onmouseenter={showStackblitzFunc}
  13029. class="absolute left-[34.5rem] top-0 hidden h-12 w-12 rounded-sm bg-gray-100 p-3 md:block dark:bg-gray-700"
  13030. >
  13031. <svg viewBox="0 0 28 28" height="24">
  13032. <path fill="#3275e7" d="M12.747 16.273h-7.46L18.925 1.5l-3.671 10.227h7.46L9.075 26.5l3.671-10.227z" />
  13033. </svg>
  13034. {#if showStackblitz}
  13035. <div
  13036. class="absolute left-0 top-14 z-50 h-12 w-44 rounded-sm bg-gray-700 py-3 text-center leading-[1.5rem] text-white shadow-lg"
  13037. transition:fade={{ duration: 200 }}
  13038. >
  13039. {isZh ? '在 StackBlitz 中打开' : 'Open in StackBlitz'}
  13040. </div>
  13041. {/if}
  13042. </button>
  13043. </a>
  13044. <!-- 宽屏 -->
  13045. <button
  13046. onclick={changeFullFunc}
  13047. onmouseleave={() => (showFull = false)}
  13048. onmouseenter={() => (showFull = true)}
  13049. onfocus={() => (showFull = true)}
  13050. onblur={() => (showFull = false)}
  13051. class="absolute left-[38.5rem] top-0 hidden h-12 w-12 cursor-pointer rounded-sm bg-gray-100 p-3 md:block dark:bg-gray-700"
  13052. >
  13053. {#if $isWideScreenStore}
  13054. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  13055. <path
  13056. d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z"
  13057. fill="currentColor"
  13058. ></path>
  13059. </svg>
  13060. {:else}
  13061. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  13062. <path
  13063. d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"
  13064. fill="currentColor"
  13065. ></path>
  13066. </svg>
  13067. {/if}
  13068. {#if showFull}
  13069. <div
  13070. class="{isZh
  13071. ? 'w-20'
  13072. : 'w-32'} absolute left-0 top-14 z-50 h-12 rounded-sm bg-gray-700 py-3 text-center leading-[1.5rem] text-white shadow-lg"
  13073. transition:fade={{ duration: 200 }}
  13074. >
  13075. {isZh ? '宽屏' : 'Full screen'}
  13076. </div>
  13077. {/if}
  13078. </button>
  13079. <div class="relative flex">
  13080. {#each tabList as item, index}
  13081. <button onclick={() => changeIndexFun(index)} class="w-16 cursor-pointer rounded-sm py-2 text-center md:w-20">
  13082. {isZh ? item.zh : item.en}
  13083. </button>
  13084. {/each}
  13085. </div>
  13086. </div>
  13087. </div>
  13088. ================================================
  13089. FILE: docs/site/src/lib/themeSwitch/ThemeSwitch.svelte
  13090. ================================================
  13091. <script lang="ts">
  13092. import { switchTheme, type ThemeProps } from 'stdf/theme';
  13093. import themes from '../../data/themes/index.js';
  13094. import { currentColorStore } from '../../store.js';
  13095. type ThemeItem = { name: string; name_CN: string; theme: ThemeProps };
  13096. // 横排还是竖排
  13097. export let vertical = false;
  13098. const isZh = localStorage.getItem('lang') === 'zh_CN';
  13099. const selectColorFunc = (e: MouseEvent, item: ThemeItem) => {
  13100. // 阻止冒泡
  13101. e.stopPropagation();
  13102. currentColorStore.set(item.name);
  13103. localStorage.setItem('theme_color', item.name);
  13104. const theme = item.theme;
  13105. switchTheme(theme);
  13106. // 修改 HTML 的 meta name="theme-color" 属性,适配 Safari 的 tab 背景色,需要设置 light 和 dark 两种颜色
  13107. const safariLight = theme.color.primaryWhite;
  13108. const safariDark = theme.color.darkBlack;
  13109. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: light)"
  13110. const lightMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: light)"]');
  13111. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: dark)"
  13112. const darkMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: dark)"]');
  13113. // 如果找到了,就修改它的 content 属性
  13114. if (lightMeta) {
  13115. lightMeta.setAttribute('content', safariLight);
  13116. }
  13117. if (darkMeta) {
  13118. darkMeta.setAttribute('content', safariDark);
  13119. }
  13120. };
  13121. </script>
  13122. <div class="flex {vertical ? 'flex-col gap-1' : 'flex-row gap-2'} my-2 flex-wrap">
  13123. {#each themes as item}
  13124. <button
  13125. class="flex items-center justify-between gap-0.5 border px-0.5 py-1 {$currentColorStore === item.name
  13126. ? 'border-primary dark:border-dark'
  13127. : 'border-gray-100 dark:border-gray-700'} cursor-pointer rounded-sm"
  13128. on:click={(e) => selectColorFunc(e, item)}
  13129. >
  13130. <div class="size-3 {$currentColorStore === item.name ? 'fill-primary dark:fill-dark' : 'fill-gray-300 dark:fill-gray-700'}">
  13131. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  13132. <path
  13133. d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM7.5 12C8.32843 12 9 11.3284 9 10.5C9 9.67157 8.32843 9 7.5 9C6.67157 9 6 9.67157 6 10.5C6 11.3284 6.67157 12 7.5 12ZM16.5 12C17.3284 12 18 11.3284 18 10.5C18 9.67157 17.3284 9 16.5 9C15.6716 9 15 9.67157 15 10.5C15 11.3284 15.6716 12 16.5 12ZM12 9C12.8284 9 13.5 8.32843 13.5 7.5C13.5 6.67157 12.8284 6 12 6C11.1716 6 10.5 6.67157 10.5 7.5C10.5 8.32843 11.1716 9 12 9Z"
  13134. >
  13135. </path>
  13136. </svg>
  13137. </div>
  13138. <div class="flex-1 whitespace-nowrap text-left text-xs font-normal">{isZh ? item.name_CN : item.name}</div>
  13139. <div class="flex justify-between gap-1">
  13140. <!-- theme -->
  13141. <div class="rounded-xs flex overflow-hidden">
  13142. <div class="bg-primary w-3" style="background-color: {item.theme.color.primary.default};"></div>
  13143. <div class="bg-dark w-3" style="background-color: {item.theme.color.dark.default};"></div>
  13144. </div>
  13145. <div class="flex flex-col justify-between gap-px">
  13146. <!-- Functional -->
  13147. <div class="flex gap-px">
  13148. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.success};"></div>
  13149. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.warning};"></div>
  13150. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.error};"></div>
  13151. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.info};"></div>
  13152. </div>
  13153. <!-- Extended -->
  13154. <div class="flex justify-between gap-px">
  13155. {#each item.theme.color.extend as child}
  13156. <div class="size-1.5 rounded" style="background-color: {child.color};"></div>
  13157. {/each}
  13158. </div>
  13159. </div>
  13160. </div>
  13161. </button>
  13162. {/each}
  13163. {#if vertical}
  13164. <a
  13165. href="/guide/generator"
  13166. target="_blank"
  13167. class="text-primary hover:border-primary dark:text-dark dark:hover:border-dark group mt-2 flex items-center justify-center gap-1 rounded-sm border border-gray-100 py-1 text-xs transition-all duration-300 dark:border-gray-700"
  13168. >
  13169. <svg class="size-4 transition-all duration-300 group-hover:scale-95" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  13170. <path
  13171. class="fill-primary dark:fill-dark"
  13172. d="M15.1986 9.94435C14.7649 9.53358 14.4859 8.98601 14.4085 8.39371L14.0056 5.31126L11.275 6.79711C10.7503 7.08262 10.1433 7.17876 9.55608 7.06936L6.49998 6.50003L7.06931 9.55612C7.17871 10.1434 7.08257 10.7503 6.79707 11.275L5.31121 14.0056L8.39367 14.4085C8.98596 14.4859 9.53353 14.7649 9.94431 15.1986L12.0821 17.4555L13.4178 14.6485C13.6745 14.1091 14.109 13.6745 14.6484 13.4179L17.4555 12.0821L15.1986 9.94435ZM15.2238 15.5078L13.0111 20.1579C12.8687 20.4572 12.5107 20.5843 12.2115 20.4419C12.1448 20.4102 12.0845 20.3664 12.0337 20.3127L8.49229 16.574C8.39749 16.4739 8.27113 16.4095 8.13445 16.3917L3.02816 15.7242C2.69958 15.6812 2.46804 15.3801 2.51099 15.0515C2.52056 14.9782 2.54359 14.9074 2.5789 14.8425L5.04031 10.3191C5.1062 10.198 5.12839 10.0579 5.10314 9.92241L4.16 4.85979C4.09931 4.53402 4.3142 4.22074 4.63997 4.16005C4.7126 4.14652 4.78711 4.14652 4.85974 4.16005L9.92237 5.10319C10.0579 5.12843 10.198 5.10625 10.319 5.04036L14.8424 2.57895C15.1335 2.42056 15.4979 2.52812 15.6562 2.81919C15.6916 2.88409 15.7146 2.95495 15.7241 3.02821L16.3916 8.13449C16.4095 8.27118 16.4739 8.39754 16.5739 8.49233L20.3127 12.0337C20.5533 12.2616 20.5636 12.6414 20.3357 12.8819C20.2849 12.9356 20.2246 12.9794 20.1579 13.0111L15.5078 15.2238C15.3833 15.2831 15.283 15.3833 15.2238 15.5078ZM16.0206 17.4349L17.4348 16.0207L21.6775 20.2633L20.2633 21.6775L16.0206 17.4349Z"
  13173. >
  13174. </path>
  13175. </svg>
  13176. {isZh ? '创建新主题' : 'Create new theme'}
  13177. </a>
  13178. {/if}
  13179. </div>
  13180. ================================================
  13181. FILE: docs/site/src/routes/+error.svelte
  13182. ================================================
  13183. <script lang="ts">
  13184. const isZh = localStorage.getItem('lang') === 'zh_CN';
  13185. </script>
  13186. <div class="flex h-screen flex-col items-center justify-center">
  13187. <div class="flex flex-col items-center">
  13188. <div class="flex items-center gap-1">
  13189. <div class="text-primary dark:text-dark mb-4 text-9xl font-bold">4</div>
  13190. <div>
  13191. <svg viewBox="0 0 100 100" class="svg-spin size-20">
  13192. <path
  13193. fill-rule="evenodd"
  13194. clip-rule="evenodd"
  13195. d="M50 0V100C22.3858 100 0 77.6142 0 50C0 22.3858 22.3858 0 50 0Z"
  13196. class="fill-dark"
  13197. />
  13198. <path
  13199. fill-rule="evenodd"
  13200. clip-rule="evenodd"
  13201. d="M50 100V0C77.6142 0 100 22.3858 100 50C100 77.6142 77.6142 100 50 100Z"
  13202. class="fill-primary"
  13203. />
  13204. <circle cx="50" cy="25" r="25" class="fill-primary" />
  13205. <circle cx="50" cy="75" r="25" class="fill-dark" />
  13206. <circle cx="50.25" cy="25.25" r="6.25" class="fill-dark" />
  13207. <circle cx="50.25" cy="75.25" r="6.25" class="fill-primary" />
  13208. </svg>
  13209. </div>
  13210. <div class="text-primary dark:text-dark mb-4 text-9xl font-bold">4</div>
  13211. </div>
  13212. <p class="mb-8 text-black/60 dark:text-white/60">{isZh ? '抱歉,页面未找到' : 'Sorry, page not found'}</p>
  13213. <a href="/" class="bg-primary dark:bg-dark rounded px-6 py-2 text-white hover:opacity-90 dark:text-black">
  13214. {isZh ? '返回首页' : 'Back to home'}
  13215. </a>
  13216. </div>
  13217. </div>
  13218. <style>
  13219. @keyframes svg-spin {
  13220. 0% {
  13221. transform: rotate(360deg);
  13222. }
  13223. 100% {
  13224. transform: rotate(0deg);
  13225. }
  13226. }
  13227. .svg-spin {
  13228. animation: svg-spin 8s linear infinite;
  13229. }
  13230. </style>
  13231. ================================================
  13232. FILE: docs/site/src/routes/+layout.svelte
  13233. ================================================
  13234. <script lang="ts">
  13235. import themes from '../data/themes/index.js';
  13236. import { switchTheme } from 'stdf/theme';
  13237. import Header from '$lib/header/Header.svelte';
  13238. import CmdK from '$lib/cmdk/CmdK.svelte';
  13239. import Fund from '$lib/fund/Fund.svelte';
  13240. import { page } from '$app/stores';
  13241. import { isCmdKStore, isShowFundStore } from '../store.js';
  13242. import '../app.css';
  13243. import { delParamsUrl } from '../utils/index.js';
  13244. let { children } = $props();
  13245. let showLeftNav = $state(false); //是否显示左侧导航
  13246. let isHome = $page.url.pathname === '/' || $page.url.pathname === '';
  13247. //路由改变时,更新左侧导航
  13248. $effect(() => {
  13249. showLeftNav = $page.url.pathname.startsWith('/guide') || $page.url.pathname === '/components';
  13250. });
  13251. // 点击顶部菜单事件
  13252. const headerCmdKFun = () => {
  13253. isCmdKStore.set(true);
  13254. };
  13255. const currentTheme = localStorage.getItem('theme_color') || 'STDF';
  13256. // 设置默认主题色
  13257. themes.forEach((item) => {
  13258. if (item.name === currentTheme) {
  13259. const theme = item.theme;
  13260. switchTheme(theme);
  13261. // 修改 HTML 的 meta name="theme-color" 属性,适配 Safari 的 tab 背景色,需要设置 light 和 dark 两种颜色
  13262. const safariLight = theme.color.primaryWhite;
  13263. const safariDark = theme.color.darkBlack;
  13264. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: light)"
  13265. const lightMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: light)"]');
  13266. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: dark)"
  13267. const darkMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: dark)"]');
  13268. // 如果找到了,就修改它的 content 属性
  13269. if (lightMeta) {
  13270. lightMeta.setAttribute('content', safariLight);
  13271. }
  13272. if (darkMeta) {
  13273. darkMeta.setAttribute('content', safariDark);
  13274. }
  13275. }
  13276. });
  13277. let urlLang = window.location.href.split('?')[1];
  13278. if (!urlLang || (urlLang && !urlLang.includes('lang'))) {
  13279. if (!localStorage.getItem('lang')) {
  13280. //获取浏览器语言前两位
  13281. const lang = navigator.language.substring(0, 2);
  13282. if (lang === 'en') {
  13283. localStorage.setItem('lang', 'en_US');
  13284. } else {
  13285. localStorage.setItem('lang', 'zh_CN');
  13286. }
  13287. }
  13288. } else {
  13289. let urlParams = new URLSearchParams(urlLang);
  13290. localStorage.setItem('lang', urlParams.get('lang') || '');
  13291. setTimeout(() => {
  13292. // window.location.href = window.location.href.replace(/(\?|#)[^'"]*/, '');//去除参数
  13293. const url = new URL(window.location.href);
  13294. url.searchParams.delete('lang');
  13295. window.history.pushState({}, '', url.toString()); //刷新页面
  13296. }, 10);
  13297. }
  13298. if (localStorage.getItem('theme') === 'dark') {
  13299. document.documentElement.classList.add('dark');
  13300. } else if (localStorage.getItem('theme') === 'light') {
  13301. document.documentElement.classList.remove('dark');
  13302. } else {
  13303. if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
  13304. document.documentElement.classList.add('dark');
  13305. } else {
  13306. document.documentElement.classList.remove('dark');
  13307. }
  13308. }
  13309. const isZh = localStorage.getItem('lang') === 'zh_CN';
  13310. // 根据 params 判断当前 URL 是否含有 fund 参数,如果有则显示赞赏弹窗
  13311. const urlFund = window.location.href.split('?')[1];
  13312. const urlParams = new URLSearchParams(urlFund);
  13313. const isFund = urlParams.has('fund');
  13314. if (isFund) {
  13315. isShowFundStore.set(true);
  13316. // 去除 URL 中的 fund 参数
  13317. setTimeout(() => {
  13318. window.history.replaceState({}, '', delParamsUrl(window.location.href, 'fund'));
  13319. }, 10);
  13320. }
  13321. </script>
  13322. <svelte:head>
  13323. <title>STDF - {isZh ? '移动 web 组件库' : 'Mobile web component library'}</title>
  13324. </svelte:head>
  13325. <main class="bg-primaryWhite dark:bg-darkBlack relative min-h-screen text-justify text-black antialiased dark:text-white">
  13326. <Header {showLeftNav} showBottonLine={!isHome} onclickCmdK={headerCmdKFun} />
  13327. <!-- <Router {routes} /> -->
  13328. <!-- <div class="mx-auto max-w-[1536px]"> -->
  13329. {@render children()}
  13330. <!-- </div> -->
  13331. <CmdK />
  13332. <!-- 赞赏 -->
  13333. {#if $isShowFundStore}
  13334. <Fund />
  13335. {/if}
  13336. </main>
  13337. ================================================
  13338. FILE: docs/site/src/routes/+layout.ts
  13339. ================================================
  13340. // 修改 ssr 为 false,使其不再使用服务端渲染,而是使用客户端渲染
  13341. // Change ssr to false to use client-side rendering instead of server-side rendering
  13342. export const ssr = false;
  13343. // 开启预渲染
  13344. // Enable prerendering
  13345. export const prerender = true;
  13346. ================================================
  13347. FILE: docs/site/src/routes/+page.svelte
  13348. ================================================
  13349. <script lang="ts">
  13350. import { onMount } from 'svelte';
  13351. import { fly } from 'svelte/transition';
  13352. import { Confetti } from 'svelte-confetti';
  13353. import { currentThemeStore, currentColorStore } from '../store';
  13354. // @ts-ignore
  13355. import { encodeData, rendererLine } from 'beautify-qrcode';
  13356. import { Tab, Loading, Switch, Avatar, Pagination, Input, Rate, Icon, NoticeBar, Slider, Swiper, Button } from 'stdf';
  13357. import type { SwiperImgProps, SwiperProps } from 'stdf/types';
  13358. import { menuList, type MenuList } from '../data/menuList';
  13359. import themes from '../data/themes/index.js';
  13360. import { switchTheme } from 'stdf/theme';
  13361. import Clis from '../lib/clis/Clis.svelte';
  13362. const isZh = localStorage.getItem('lang') === 'zh_CN';
  13363. // 随机生成 1_0 到 1_53 这种字符串
  13364. const randomNum = Math.floor(Math.random() * 53) + 1;
  13365. const randomNumStr = `1_${randomNum}`;
  13366. const swiperData: SwiperImgProps[] = [
  13367. { type: 'img', url: '/assets/images/home/wall_1.jpg' },
  13368. { type: 'img', url: '/assets/images/home/wall_2.jpg' },
  13369. { type: 'img', url: '/assets/images/home/wall_3.jpg' },
  13370. { type: 'img', url: '/assets/images/home/wall_4.jpg' }
  13371. ];
  13372. const swiperOptions: SwiperProps[] = [
  13373. {
  13374. data: swiperData,
  13375. containerWidth: 390,
  13376. px: '6',
  13377. py: '6',
  13378. indicateInjClass: 'bg-none',
  13379. indicateColor: 'bg-black/5 dark:bg-white/10',
  13380. indicateActiveColor: 'bg-primary dark:bg-dark',
  13381. radius: 'xl',
  13382. indicateStyle: 'longLine'
  13383. },
  13384. {
  13385. data: swiperData,
  13386. containerWidth: 390,
  13387. px: '16',
  13388. py: '6',
  13389. indicateInjClass: 'bg-none',
  13390. indicateColor: 'bg-primary dark:bg-dark',
  13391. indicateActiveColor: 'bg-primary dark:bg-dark',
  13392. radius: 'xl',
  13393. aspectRatio: [3, 1],
  13394. innerInjClass: 'shadow-md shadow-black/20 dark:shadow-white/20',
  13395. translateX: 100
  13396. },
  13397. {
  13398. data: swiperData,
  13399. containerWidth: 390,
  13400. px: '4',
  13401. py: '8',
  13402. indicateInjClass: 'bg-none',
  13403. indicateColor: 'bg-primary dark:bg-dark',
  13404. indicateActiveColor: 'bg-primary dark:bg-dark',
  13405. radius: 'xl',
  13406. rotateY: 90,
  13407. innerInjClass: 'shadow-md shadow-black/20 dark:shadow-white/20'
  13408. },
  13409. {
  13410. data: swiperData,
  13411. containerWidth: 390,
  13412. px: '24',
  13413. py: '8',
  13414. indicateInjClass: 'bg-none',
  13415. indicateColor: 'bg-primary dark:bg-dark',
  13416. indicateActiveColor: 'bg-primary dark:bg-dark',
  13417. innerInjClass: 'shadow-md shadow-black/20 dark:shadow-white/20',
  13418. radius: 'xl',
  13419. aspectRatio: [3, 1],
  13420. translateX: 160,
  13421. notActiveInjClass: 'grayscale'
  13422. },
  13423. {
  13424. data: swiperData,
  13425. indicateStyle: 'longLine',
  13426. containerWidth: 390,
  13427. px: '12',
  13428. py: '8',
  13429. indicateInjClass: 'bg-none',
  13430. indicateColor: 'bg-black/5 dark:bg-white/10',
  13431. indicateActiveColor: 'bg-primary dark:bg-dark',
  13432. radius: 'xl',
  13433. translateZ: 600,
  13434. innerInjClass: 'shadow-md shadow-black/20 dark:shadow-white/20'
  13435. }
  13436. ];
  13437. const swiperOption = swiperOptions[Math.floor(Math.random() * swiperOptions.length)];
  13438. //数组二级组成新数组
  13439. const ArrChildFun = (arr: MenuList[]) => {
  13440. const newArr = [];
  13441. for (let e = 0; e < arr.length; e++) {
  13442. newArr.push(...arr[e].childs);
  13443. }
  13444. return newArr;
  13445. };
  13446. const menuChildList = ArrChildFun(menuList);
  13447. // 从 menuChildList 中随机取 3 个
  13448. const randomMenuChildList = menuChildList.sort(() => Math.random() - 0.5).slice(0, 3);
  13449. const textList = randomMenuChildList.map((item, index) => {
  13450. return `${index + 1}. ${isZh ? item.tip : item.tip_en}`;
  13451. });
  13452. const labels = randomMenuChildList.map((item) => {
  13453. return { text: isZh ? item.title_zh : item.title_en };
  13454. });
  13455. // Avatar radius 随机 'none'|'sm'|'xl'|'2xl'|'3xl'|'full'
  13456. const avatarRadiusList = ['none', 'sm', 'xl', '2xl', '3xl', 'full'] as const;
  13457. const avatarRadius = avatarRadiusList[Math.floor(Math.random() * avatarRadiusList.length)];
  13458. const avatarImgs = ['/assets/images/home/wall_3.jpg', '/assets/images/home/avatar_1.jpg', null];
  13459. const avatar = avatarImgs[Math.floor(Math.random() * avatarImgs.length)];
  13460. // Switch radius 随机 'none'|'middle'|'full' ,inside 随机 'state'|'loading'|null
  13461. const switchRadiusList = ['none', 'middle', 'full'];
  13462. const switchRadius = switchRadiusList[Math.floor(Math.random() * switchRadiusList.length)] as 'none' | 'middle' | 'full';
  13463. const switchInsideList = ['state', 'loading', null];
  13464. const switchInside = switchInsideList[Math.floor(Math.random() * switchInsideList.length)] as 'state' | 'loading' | null;
  13465. // Slider 随机 0-100
  13466. const sliderValue = Math.floor(Math.random() * 100);
  13467. // slider radius 随机 'none'|'full'|'sm'|'xl'
  13468. const sliderRadiusList = ['none', 'full', 'sm', 'xl'];
  13469. const sliderRadius = sliderRadiusList[Math.floor(Math.random() * sliderRadiusList.length)] as 'none' | 'full' | 'sm' | 'xl';
  13470. const sliderShowTipList = ['always', 'never', 'touch'];
  13471. const sliderShowTip = sliderShowTipList[Math.floor(Math.random() * sliderShowTipList.length)] as 'always' | 'never' | 'touch';
  13472. // 列举 20 个与评分相关的 emoji 表情
  13473. const emojiList1 = ['love', 'default'];
  13474. const emojiList2 = ['👍', '👋', '👏', '🌺', '🏆', '🎯', '💯', '🎳', '🎖️'];
  13475. // 随机出一个 emoji,emojiList1 的概率为 0.5,emojiList2 的概率为 0.5
  13476. const emoji =
  13477. Math.random() > 0.5
  13478. ? emojiList1[Math.floor(Math.random() * emojiList1.length)]
  13479. : emojiList2[Math.floor(Math.random() * emojiList2.length)];
  13480. // Tab radius 随机 'none'|'full'|'sm'|'xl'
  13481. const tabRadiusList = ['none', 'full', 'sm', 'xl'];
  13482. const tabRadius = tabRadiusList[Math.floor(Math.random() * tabRadiusList.length)] as 'none' | 'full' | 'sm' | 'xl';
  13483. // lineType 随机 true 或 false
  13484. const lineType = Math.random() > 0.5;
  13485. // Pagination 随机总条数 50 - 200 和当前页,保证当前页在 1 - 总条数/10 之间
  13486. const paginationTotal = Math.floor(Math.random() * 150) + 50;
  13487. const paginationCurrent = Math.floor(Math.random() * (paginationTotal / 10)) + 1;
  13488. // paginationType 随机 'block'|'bold'|'border'
  13489. const paginationTypeList = ['block', 'bold', 'border'];
  13490. const paginationType = paginationTypeList[Math.floor(Math.random() * paginationTypeList.length)] as 'block' | 'bold' | 'border';
  13491. const paginationRadiusList = ['none', 'sm', 'md', 'lg', 'xl', 'full'];
  13492. const paginationRadius = paginationRadiusList[Math.floor(Math.random() * paginationRadiusList.length)] as
  13493. | 'none'
  13494. | 'sm'
  13495. | 'md'
  13496. | 'lg'
  13497. | 'xl'
  13498. | 'full';
  13499. const injPaginationRadiusList = {
  13500. none: 'rounded-none',
  13501. sm: 'rounded-sm',
  13502. md: 'rounded-md',
  13503. lg: 'rounded-lg',
  13504. xl: 'rounded-xl',
  13505. full: 'rounded-full'
  13506. };
  13507. const injPaginationRadius = injPaginationRadiusList[paginationRadius];
  13508. // 随机主题
  13509. const randomThemeFunc = () => {
  13510. const item = themes[Math.floor(Math.random() * themes.length)];
  13511. currentColorStore.set(item.name);
  13512. localStorage.setItem('theme_color', item.name);
  13513. const theme = item.theme;
  13514. switchTheme(theme);
  13515. // 修改 HTML 的 meta name="theme-color" 属性,适配 Safari 的 tab 背景色,需要设置 light 和 dark 两种颜色
  13516. const safariLight = theme.color.primaryWhite;
  13517. const safariDark = theme.color.darkBlack;
  13518. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: light)"
  13519. const lightMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: light)"]');
  13520. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: dark)"
  13521. const darkMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: dark)"]');
  13522. // 如果找到了,就修改它的 content 属性
  13523. if (lightMeta) {
  13524. lightMeta.setAttribute('content', safariLight);
  13525. }
  13526. if (darkMeta) {
  13527. darkMeta.setAttribute('content', safariDark);
  13528. }
  13529. };
  13530. // randomMenuChildList 随机出一个
  13531. const inputList = randomMenuChildList[Math.floor(Math.random() * randomMenuChildList.length)];
  13532. const inputTitle = isZh ? inputList.title_zh : inputList.title_en;
  13533. let inputValue = $state(isZh ? inputList.tip : inputList.tip_en);
  13534. const inputRadiusList = ['none', 'full', 'sm', 'xl'];
  13535. const inputRadius = inputRadiusList[Math.floor(Math.random() * inputRadiusList.length)] as 'none' | 'full' | 'sm' | 'xl';
  13536. const inputStyleList = ['line', 'block'];
  13537. const inputStyle = inputStyleList[Math.floor(Math.random() * inputStyleList.length)] as 'line' | 'block';
  13538. let showInputConfetti = $derived(inputValue === inputTitle);
  13539. // 当 inputValue === inputTitle 时,显示 confetti
  13540. const inputFun = (v: string) => {
  13541. inputValue = v;
  13542. };
  13543. const descList = [
  13544. {
  13545. title: 'Simple',
  13546. titleZh: '简单',
  13547. desc: '代码清晰,文档完善,易于使用。',
  13548. descEn: 'Clear code, complete docs, easy to use.',
  13549. icon: '/assets/images/home/s.jpeg',
  13550. icon_d: '/assets/images/home/s-d.png',
  13551. shwTip: false
  13552. },
  13553. {
  13554. title: 'Tiny',
  13555. titleZh: '轻量',
  13556. desc: '体积小,无依赖,适合移动端。',
  13557. descEn: 'Small size, no deps, for mobile.',
  13558. icon: '/assets/images/home/t.jpeg',
  13559. icon_d: '/assets/images/home/t-d.png',
  13560. shwTip: true
  13561. },
  13562. {
  13563. title: 'Design',
  13564. titleZh: '设计',
  13565. desc: '优化移动端设计交互,支持主题配置。',
  13566. descEn: 'Better mobile design & themes.',
  13567. icon: '/assets/images/home/d.jpeg',
  13568. icon_d: '/assets/images/home/d-d.png',
  13569. shwTip: false
  13570. },
  13571. {
  13572. title: 'Fast',
  13573. titleZh: '快速',
  13574. desc: '配套脚手架,无虚拟 DOM,性能卓越。',
  13575. descEn: 'With CLI, no vDOM, high performance.',
  13576. icon: '/assets/images/home/f.jpeg',
  13577. icon_d: '/assets/images/home/f.jpeg',
  13578. shwTip: false
  13579. }
  13580. ];
  13581. const dominant = {
  13582. title: '优势 & 目标',
  13583. title_en: 'Advantages & Goals',
  13584. data: [
  13585. {
  13586. icon: 'svelte',
  13587. p: '丰富 Svelte 生态,为开发者提供高效、优质的组件库。',
  13588. p_en: 'Enrich the Svelte ecosystem by providing efficient, high-quality component library.'
  13589. },
  13590. {
  13591. icon: 'css3-line',
  13592. p: '简化 CSS 开发流程,让开发者专注业务逻辑实现。',
  13593. p_en: 'Streamline CSS development so developers can focus on business logic implementation.'
  13594. },
  13595. {
  13596. icon: 'contrast-2-line',
  13597. p: '内置暗黑模式与主题系统,轻松构建现代化界面。',
  13598. p_en: 'Built-in dark mode and theming system for easily creating modern interfaces.'
  13599. },
  13600. {
  13601. icon: 'paint-brush-line',
  13602. p: '面向移动端的通用组件库,提供灵活的 UI 定制能力。',
  13603. p_en: 'A versatile mobile component library with flexible UI customization capabilities.'
  13604. },
  13605. {
  13606. icon: 'clockwise-line',
  13607. p: '精心设计的交互体验,流畅的动画过渡,带来极致用户体验。',
  13608. p_en: 'Carefully crafted interactions with smooth animations for ultimate user experience.'
  13609. },
  13610. {
  13611. icon: 'article-line',
  13612. p: '完整的中英文支持,文档、示例和注释清晰完整。',
  13613. p_en: 'Full Chinese and English support with clear documentation, examples and comments.'
  13614. },
  13615. {
  13616. icon: 'file-copy-2-line',
  13617. p: '提供完善的脚手架和插件,助力开发者高效开发。',
  13618. p_en: 'Provides comprehensive scaffolding and plugins for efficient development.'
  13619. },
  13620. {
  13621. icon: 'planet-line',
  13622. p: '强大的国际化支持,内置 60+ 语言包,快速实现多语言应用。',
  13623. p_en: 'Powerful i18n with 60+ built-in language packs for quick multilingual implementation.'
  13624. }
  13625. ]
  13626. };
  13627. const ugly = {
  13628. title: '提前警告',
  13629. title_en: 'Early Warning',
  13630. data: [
  13631. {
  13632. icon: 'medal-line',
  13633. p: 'STDF 不追求高大上的概念,只专注于为您提供简单实用的开发工具。',
  13634. p_en: 'STDF focuses solely on providing practical development tools, without any fancy concepts.'
  13635. },
  13636. {
  13637. icon: 'service-line',
  13638. p: 'Svelte 生态仍在发展中,欢迎您加入我们一起建设更好的 Svelte 社区。',
  13639. p_en: 'The Svelte ecosystem is still growing. We welcome you to join us in building a better Svelte community.'
  13640. },
  13641. {
  13642. icon: 'bard-line',
  13643. p: 'STDF 可能使用到 Vite、SvelteKit 等生态,建议先了解这些项目的核心概念。',
  13644. p_en: 'STDF may use Vite, SvelteKit, etc. We recommend understanding their core concepts first.'
  13645. },
  13646. {
  13647. icon: 'git-close-pull-request-line',
  13648. p: 'STDF 支持 UnoCSS 等 Tailwind CSS 类库,使用前请先掌握相关基础知识。',
  13649. p_en: 'STDF supports Tailwind CSS-like libraries such as UnoCSS. Please master the basics before using them.'
  13650. }
  13651. ]
  13652. };
  13653. // 赞助人员
  13654. const thinkGithub = [
  13655. { name: 'sbscan', amount: 100 },
  13656. { name: 'MuGuiLin', amount: 50 },
  13657. { name: 'yuedanlabs', amount: 10 }
  13658. ];
  13659. const bottomInfo = [
  13660. {
  13661. title: '相关',
  13662. title_en: 'Related',
  13663. list: [
  13664. { title: 'Svelte', title_en: 'Svelte', link: 'https://svelte.dev', _blank: true },
  13665. { title: 'Tailwind', title_en: 'Tailwind', link: 'https://tailwindcss.com', _blank: true },
  13666. { title: 'Remix Icon', title_en: 'Remix Icon', link: 'https://remixicon.com', _blank: true }
  13667. // { title: 'RTDF(计划中)', title_en: 'RTDF(intend)', link: '', _blank: false },
  13668. // { title: 'VTDF(计划中)', title_en: 'VTDF(intend)', link: '', _blank: false },
  13669. ]
  13670. },
  13671. {
  13672. title: '工具',
  13673. title_en: 'Tools',
  13674. list: [
  13675. { title: 'create-stdf', title_en: 'create-stdf', link: 'https://www.npmjs.com/package/create-stdf', _blank: true },
  13676. {
  13677. title: 'rollup-plugin-stdf-icon',
  13678. title_en: 'rollup-plugin-stdf-icon',
  13679. link: 'https://www.npmjs.com/package/rollup-plugin-stdf-icon',
  13680. _blank: true
  13681. },
  13682. {
  13683. title: 'rollup-plugin-md-ts',
  13684. title_en: 'rollup-plugin-md-ts',
  13685. link: 'https://www.npmjs.com/package/rollup-plugin-md-ts',
  13686. _blank: true
  13687. },
  13688. {
  13689. title: 'STDF for VS Code',
  13690. title_en: 'STDF for VS Code',
  13691. link: 'https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension',
  13692. _blank: true
  13693. }
  13694. ]
  13695. },
  13696. {
  13697. title: '帮助',
  13698. title_en: 'Help',
  13699. list: [
  13700. { title: '关于', title_en: 'About', link: '/guide/about', _blank: false },
  13701. { title: '常见问题', title_en: 'FAQ', link: '/guide/faq', _blank: false },
  13702. { title: '更新日志', title_en: 'Changelog', link: '/guide/changelog', _blank: false },
  13703. { title: '开源许可', title_en: 'License', link: 'https://github.com/any-tdf/stdf/blob/main/LICENSE', _blank: true }
  13704. ]
  13705. },
  13706. {
  13707. title: '社区',
  13708. title_en: 'Community',
  13709. list: [
  13710. {
  13711. title: 'QQ 群',
  13712. title_en: 'QQ Group',
  13713. link: 'https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=U8ZlXJ3KVpTI9oZzs1jBnyWc3gVA0h6Y&authKey=ScWu0nU9g8BqNsC7o2eYkESwgVDVz9vzGNZEb17MrEAay9%2F7bTkXDiLJRIzo2vrg&noverify=0&group_code=581073686',
  13714. _blank: true
  13715. },
  13716. { title: 'Discord', title_en: 'Discord', link: 'https://discord.gg/DMkHu8GGre', _blank: true },
  13717. { title: 'QQ 频道', title_en: 'QQ Discord', link: 'https://pd.qq.com/s/fdd8incyr', _blank: true },
  13718. { title: 'Discussions', title_en: 'Discussions', link: 'https://github.com/any-tdf/stdf/discussions', _blank: true }
  13719. ]
  13720. }
  13721. ];
  13722. let showQr = $state(false);
  13723. const io = new IntersectionObserver((entries: IntersectionObserverEntry[]) => {
  13724. for (const item of entries) {
  13725. // isIntersecting 是一个 Boolean 值,判断目标元素当前是否可见
  13726. if (item.isIntersecting) {
  13727. const target = item.target as HTMLElement;
  13728. target.style.opacity = '1';
  13729. target.style.transform = 'translateY(0)';
  13730. setTimeout(() => {
  13731. target.style.transitionDuration = '300ms';
  13732. }, 1000);
  13733. } else {
  13734. // item.target.style.opacity = 0;
  13735. // item.target.style.transform = 'translateY(200px)';
  13736. }
  13737. }
  13738. });
  13739. let A_a1Svg = $state();
  13740. const mouseenterFun = () => {
  13741. /**
  13742. * A_a1
  13743. * @param {Object} qrcode
  13744. * @param {Object} options
  13745. * @param {String} [options.type] 连线方向 0=>左右 1=>上下 2=>纵横 3=>回环 4=>左上—右下 5=>右上—左下 6=>交叉"
  13746. * @param {String} [options.size] 连线粗细
  13747. * @param {String} [options.opacity] 连线不透明度
  13748. * @param {String} [options.posType] 定位点样式 0=>矩形 1=>圆形 2=>行星 3=>圆角矩形
  13749. * @param {String} [options.otherColor] 连线颜色
  13750. * @param {String} [options.posColor] 定位点颜色
  13751. */
  13752. const qrcode = encodeData({
  13753. text: `HTTPS://DEMO.STDF.DESIGN?lang=${isZh ? 'zh_CN' : 'en_US'}`,
  13754. isSpace: false
  13755. });
  13756. const color = $currentThemeStore === 'dark' ? 'var(--color-dark)' : 'var(--color-primary)';
  13757. A_a1Svg = rendererLine(qrcode, { posType: 2, otherColor: color, posColor: color });
  13758. showQr = true;
  13759. };
  13760. let showConfetti = $state(false);
  13761. onMount(() => {
  13762. const intersectionList = document.querySelectorAll('.intersection');
  13763. for (const item of intersectionList) {
  13764. // 开始时 opacity 为 0,不可见,transform 为 translateY(200px)
  13765. const target = item as HTMLElement;
  13766. target.style.opacity = '0';
  13767. target.style.transform = 'translateY(200px)';
  13768. target.style.transitionDuration = '1s';
  13769. io.observe(item);
  13770. }
  13771. });
  13772. </script>
  13773. <!-- <div style="width: 100%; height: 100vh; background: #f0f0f0"> -->
  13774. <!-- </div> -->
  13775. <div class="mx-auto max-w-[1536px]">
  13776. <div class="justify-center lg:flex">
  13777. <div class="flex basis-2/5 flex-col justify-center py-16 text-center md:py-20">
  13778. <div class="relative mb-20 mt-16 flex h-20 flex-col items-center justify-center md:h-28">
  13779. <div class="animate-dynamicsBg absolute rounded-full opacity-50 blur-xl md:opacity-100 md:blur-3xl">
  13780. <svg viewBox="0 0 100 100">
  13781. <path
  13782. fill-rule="evenodd"
  13783. clip-rule="evenodd"
  13784. d="M50 0V100C22.3858 100 0 77.6142 0 50C0 22.3858 22.3858 0 50 0Z"
  13785. class="fill-dark"
  13786. />
  13787. <path
  13788. fill-rule="evenodd"
  13789. clip-rule="evenodd"
  13790. d="M50 100V0C77.6142 0 100 22.3858 100 50C100 77.6142 77.6142 100 50 100Z"
  13791. class="fill-primary"
  13792. />
  13793. <circle cx="50" cy="25" r="25" class="fill-primary" />
  13794. <circle cx="50" cy="75" r="25" class="fill-dark" />
  13795. <circle cx="50.25" cy="25.25" r="6.25" class="fill-dark" />
  13796. <circle cx="50.25" cy="75.25" r="6.25" class="fill-primary" />
  13797. </svg>
  13798. </div>
  13799. <div
  13800. class="absolute h-full w-28 md:w-36"
  13801. style="filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.05)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1));"
  13802. >
  13803. <svg viewBox="0 0 90 80" class="group">
  13804. <path
  13805. class="fill-primary dark:fill-dark"
  13806. d="M0 0H20H40H50C64.8056 0 77.7325 8.04398 84.6487 20H50H40V22.6757V30H50C55.5229 30 60 34.4771 60 40C60 45.5229 55.5229 50 50 50H40V57.3243V78.7398V80H20V66.4583V20H15.3513H0V0ZM50 80C72.0914 80 90 62.0914 90 40C90 36.547 89.5625 33.1962 88.7398 30H67.3244C69.0261 32.9417 70 36.3571 70 40C70 51.0457 61.0457 60 50 60V80Z"
  13807. />
  13808. <path
  13809. style="stroke-dasharray: 400;stroke-dashoffset: 400;"
  13810. class="fill-dark stroke-dark text-dark group-hover:animate-path dark:fill-primary dark:stroke-primary dark:text-primary stroke-1"
  13811. d="M20 30V0L0 50H20V80L40 30H20Z"
  13812. />
  13813. </svg>
  13814. </div>
  13815. </div>
  13816. <div class="text-6xl md:text-8xl">STDF</div>
  13817. <div class="md:text-md mb-10 mt-4 px-4 text-gray-700 md:mb-0 dark:text-gray-300">
  13818. {#if isZh}
  13819. 基于
  13820. <a
  13821. href="https://svelte.dev"
  13822. class="decoration-svelte hover:text-svelte underline underline-offset-2 transition-all"
  13823. target="_blank"
  13824. title={isZh ? '打开 Svelte 官方站点' : 'Open Svelte official website'}
  13825. >
  13826. Svelte
  13827. </a>
  13828. <a
  13829. href="https://tailwindcss.com/"
  13830. class="decoration-tailwind hover:text-tailwind underline underline-offset-2 transition-all"
  13831. target="_blank"
  13832. title={isZh ? '打开 Tailwind CSS 官方站点' : 'Open Tailwind CSS official website'}
  13833. >
  13834. Tailwind
  13835. </a>
  13836. 的移动 web 组件库
  13837. {:else}
  13838. Mobile web component
  13839. <br class="md:hidden" />
  13840. library based on
  13841. <a
  13842. href="https://svelte.dev"
  13843. class="decoration-svelte hover:text-svelte underline underline-offset-2 transition-all"
  13844. target="_blank"
  13845. >
  13846. Svelte
  13847. </a>
  13848. and
  13849. <a
  13850. href="https://tailwindcss.com/"
  13851. class="decoration-tailwind hover:text-tailwind underline underline-offset-2 transition-all"
  13852. target="_blank"
  13853. >
  13854. Tailwind
  13855. </a>
  13856. {/if}
  13857. </div>
  13858. <div class="mb-16 mt-8 flex justify-center gap-8 md:mt-16">
  13859. <a
  13860. href="/guide"
  13861. onmouseenter={() => (showConfetti = true)}
  13862. onmouseleave={() => (showConfetti = false)}
  13863. class="bg-primary hover:bg-primary/80 dark:bg-dark hover:dark:bg-dark/80 group relative rounded-sm px-6 py-2 text-white transition-all dark:text-black"
  13864. >
  13865. <div class="group flex items-center gap-2">
  13866. {isZh ? '开始使用' : 'Get Started'}
  13867. <div class="size-3 translate-y-px">
  13868. <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  13869. <rect
  13870. x="6"
  13871. y="14"
  13872. width="10"
  13873. height="2"
  13874. fill="currentColor"
  13875. class="scale-x-135 -translate-x-2 -translate-y-2 transition-all duration-500 group-hover:translate-x-0 group-hover:translate-y-0"
  13876. />
  13877. <path
  13878. d="M8.48535 7.07129L1.41406 14.1426L0 12.7275L5.65625 7.07031L0 1.41406L1.41406 0L8.48535 7.07129Z"
  13879. fill="currentColor"
  13880. class="translate-x-2 transition-all duration-500 group-hover:translate-x-0"
  13881. />
  13882. </svg>
  13883. </div>
  13884. {#if showConfetti}
  13885. <span class="absolute left-1/2 top-0">
  13886. <Confetti rounded />
  13887. </span>
  13888. {/if}
  13889. </div>
  13890. </a>
  13891. <a
  13892. href={`https://demo.stdf.design?lang=${isZh ? 'zh_CN' : 'en_US'}`}
  13893. target="_blank"
  13894. onmouseleave={() => (showQr = false)}
  13895. onmouseenter={mouseenterFun}
  13896. class="border-primary dark:border-dark relative hidden rounded-sm border border-solid px-6 py-2 transition-all md:block"
  13897. >
  13898. {isZh ? '示例' : 'Demo'}
  13899. {#if showQr}
  13900. <div
  13901. transition:fly={{ duration: 300, x: -10, opacity: 0 }}
  13902. class="z-100 absolute left-full top-0 block w-44 -translate-y-1/3 translate-x-1 rounded-lg border border-black/5 p-2 shadow-lg dark:hidden"
  13903. >
  13904. <span>{@html A_a1Svg}</span>
  13905. </div>
  13906. <div
  13907. transition:fly={{ duration: 300, x: -10, opacity: 0 }}
  13908. class="z-100 absolute left-full top-0 hidden w-44 -translate-y-1/3 translate-x-1 rounded-lg border bg-black p-2 shadow-lg shadow-white/10 dark:block dark:border-white/10"
  13909. >
  13910. <span>{@html A_a1Svg}</span>
  13911. </div>
  13912. {/if}
  13913. </a>
  13914. <a
  13915. href={'https://demo.stdf.design?lang=' + (isZh ? 'zh_CN' : 'en_US')}
  13916. target="_blank"
  13917. class="border-primary dark:border-dark block rounded-sm border border-solid px-6 py-2 transition-all md:hidden"
  13918. >
  13919. {isZh ? '示例' : 'Demo'}
  13920. </a>
  13921. </div>
  13922. <Clis />
  13923. </div>
  13924. <div class="relative mt-10 hidden basis-3/5 xl:mt-0 xl:block">
  13925. <div class="animate-elementUpDownMove1 -translate-x-18 absolute inset-1/2 size-20 -translate-y-12">
  13926. {#if avatar}
  13927. <Avatar size="md" radius={avatarRadius} image={avatar} injClass="shadow-lg dark:shadow-white/10" />
  13928. {:else}
  13929. <Avatar size="md" radius={avatarRadius} injClass="shadow-lg dark:shadow-white/10" />
  13930. {/if}
  13931. </div>
  13932. <div class="animate-elementUpDownMove1 absolute inset-1/2 -translate-x-96 -translate-y-40">
  13933. <Loading type={randomNumStr} theme />
  13934. </div>
  13935. <div class="animate-elementUpDownMove3 absolute inset-1/2 -translate-y-48 translate-x-52">
  13936. <Switch radius={switchRadius} inside={switchInside} active />
  13937. </div>
  13938. <div class="animate-elementUpDownMove6 -translate-y-42 absolute inset-1/2 w-96 -translate-x-72">
  13939. <Tab {labels} radius={tabRadius} {lineType} />
  13940. </div>
  13941. <div
  13942. class="animate-elementUpDownMove5 w-84 absolute inset-1/2 h-24 translate-x-20 translate-y-6 rounded-lg bg-white px-2 shadow-lg dark:bg-black/80 dark:shadow-white/10"
  13943. >
  13944. <Input
  13945. title={inputTitle}
  13946. value={inputValue}
  13947. {inputStyle}
  13948. placeholder={isZh ? `请输入${inputTitle}` : `Input ${inputTitle}`}
  13949. radius={inputRadius}
  13950. lineTransition="left"
  13951. clear
  13952. onchange={inputFun}
  13953. />
  13954. <span class="absolute left-0 top-1/2 {showInputConfetti ? 'block' : 'hidden'}">
  13955. <Confetti infinite rounded x={[-0.5, 0.5]} y={[-0.5, 0.5]} />
  13956. </span>
  13957. </div>
  13958. <div class="animate-elementUpDownMove6 absolute inset-1/2 w-96 translate-x-2 translate-y-48">
  13959. <Pagination
  13960. total={paginationTotal}
  13961. type={paginationType}
  13962. current={paginationCurrent}
  13963. radius={paginationRadius}
  13964. injClass="{injPaginationRadius} shadow-lg dark:shadow-white/10"
  13965. />
  13966. </div>
  13967. <div class="animate-elementUpDownMove4 absolute inset-1/2 w-64 -translate-x-80 -translate-y-8">
  13968. {#if emoji === 'default'}
  13969. <Rate />
  13970. {:else}
  13971. <Rate half opacity="0.2" value={3.5}>
  13972. {#if emoji === 'love'}
  13973. <Icon name="ri-heart-3-fill" injClass="text-[red]" />
  13974. {:else}
  13975. <div class="text-xl">{emoji}</div>
  13976. {/if}
  13977. </Rate>
  13978. {/if}
  13979. </div>
  13980. <div
  13981. class="animate-elementUpDownMove3 h-15 absolute inset-1/2 w-96 -translate-x-96 -translate-y-72 rounded-lg bg-white p-3 shadow-lg dark:bg-black/80 dark:shadow-white/10"
  13982. >
  13983. <NoticeBar vertical {textList}></NoticeBar>
  13984. </div>
  13985. <div class="animate-elementUpDownMove1 absolute inset-1/2 w-64 -translate-y-20 translate-x-32">
  13986. <Slider value={sliderValue} showTip={sliderShowTip} radius={sliderRadius} />
  13987. </div>
  13988. <div class="animate-elementUpDownMove5 h-54 -translate-x-110 absolute inset-1/2 w-[390px] translate-y-16 overflow-hidden">
  13989. <Swiper {...swiperOption} />
  13990. </div>
  13991. <div class="animate-elementUpDownMove1 -translate-y-74 group absolute inset-1/2 w-64 translate-x-32">
  13992. <Button heightIn="2" onclick={randomThemeFunc}>
  13993. <span class="transition-all duration-500 group-hover:translate-x-1">
  13994. {themes.find((item) => item.name === $currentColorStore)?.[isZh ? 'name_CN' : 'name']}
  13995. </span>
  13996. <span
  13997. class="ml-1 size-4 -translate-x-4 text-white opacity-0 transition-all delay-100 duration-500 group-hover:translate-x-0 group-hover:opacity-100 dark:text-black"
  13998. >
  13999. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
  14000. <path
  14001. d="M1.99974 13.0001L1.9996 11.0002L18.1715 11.0002L14.2218 7.05044L15.636 5.63623L22 12.0002L15.636 18.3642L14.2218 16.9499L18.1716 13.0002L1.99974 13.0001Z"
  14002. ></path>
  14003. </svg>
  14004. </span>
  14005. </Button>
  14006. </div>
  14007. </div>
  14008. </div>
  14009. <div class="mt-16 flex flex-wrap justify-around gap-12 px-8 xl:flex-nowrap">
  14010. {#each descList as desc}
  14011. <div
  14012. class="intersection shadow-primary/10 dark:shadow-dark/20 group flex w-full flex-col space-y-5 overflow-hidden rounded-2xl shadow-xl transition-all duration-300 sm:w-2/3 md:w-80 lg:w-96"
  14013. >
  14014. <div class="relative w-full">
  14015. <img
  14016. class="aspect-5/3 block h-full w-full object-cover transition-all duration-500 group-hover:scale-125 dark:hidden"
  14017. src={desc.icon}
  14018. alt=""
  14019. />
  14020. <img
  14021. class="aspect-5/3 hidden h-full w-full object-cover transition-all duration-500 group-hover:scale-125 dark:block"
  14022. src={desc.icon_d}
  14023. alt=""
  14024. />
  14025. <div
  14026. class="text-shadow-lg bg-primary/10 dark:bg-dark/10 absolute bottom-1.5 left-0 right-0 mx-1.5 flex flex-col justify-center rounded-2xl border border-white/30 px-3 py-1.5 text-white backdrop-blur-sm"
  14027. >
  14028. <div class="mb-0.5 text-3xl font-bold transition-all duration-500 group-hover:translate-x-4">{desc.title}</div>
  14029. <div class="text-xs font-bold transition-all duration-500">
  14030. {isZh ? desc.desc : desc.descEn}
  14031. </div>
  14032. </div>
  14033. </div>
  14034. </div>
  14035. {/each}
  14036. </div>
  14037. <div class="px-4 pb-10 md:px-12 md:pb-20" class:text-left={!isZh}>
  14038. <div class="mt-40">
  14039. <div class="intersection my-10 text-center text-2xl font-bold md:my-20 md:text-4xl">
  14040. {isZh ? dominant.title : dominant.title_en}
  14041. </div>
  14042. <div class="grid grid-cols-1 gap-10 md:grid-cols-4">
  14043. {#each dominant.data as item}
  14044. <div
  14045. class="intersection shadow-primary/10 dark:shadow-dark/10 border-primary/10 dark:border-dark/10 group rounded-xl border p-4 shadow-lg"
  14046. >
  14047. <div class="text-primary dark:text-dark size-6 transition-all duration-300 group-hover:scale-110">
  14048. <svg class="fill-current" viewBox="0 0 24 24">
  14049. <use xlink:href="/assets/fonts/home.symbol.svg#{item.icon}" />
  14050. </svg>
  14051. </div>
  14052. <p class="mt-4 text-sm opacity-90">{isZh ? item.p : item.p_en}</p>
  14053. </div>
  14054. {/each}
  14055. </div>
  14056. </div>
  14057. <div class="mt-32 md:mt-48">
  14058. <div class="intersection my-10 text-center text-2xl font-bold md:my-20 md:text-4xl">
  14059. {isZh ? ugly.title : ugly.title_en}
  14060. </div>
  14061. <div class="grid grid-cols-1 gap-10 md:grid-cols-4">
  14062. {#each ugly.data as item}
  14063. <div
  14064. class="intersection shadow-primary/10 dark:shadow-dark/10 border-primary/10 dark:border-dark/10 group rounded-xl border p-4 shadow-lg"
  14065. >
  14066. <div class="text-primary dark:text-dark size-6 transition-all duration-300 group-hover:scale-110">
  14067. <svg class="fill-current" viewBox="0 0 24 24">
  14068. <use xlink:href="/assets/fonts/home.symbol.svg#{item.icon}" />
  14069. </svg>
  14070. </div>
  14071. <p class="mt-4 text-sm opacity-90">{isZh ? item.p : item.p_en}</p>
  14072. </div>
  14073. {/each}
  14074. </div>
  14075. </div>
  14076. </div>
  14077. <!-- <div class="hidden md:flex justify-center mb-20">
  14078. <article class={`prose dark:prose-invert max-w-none text-xs overflow-auto`} style="height:{500}px">
  14079. <pre><code class="hljs">{@html highlightedCode}</code></pre>
  14080. </article>
  14081. <div class=" ml-2 border border-black/10 dark:border-gray-400 w-[392px] grow-0 shrink-0 overflow-auto" style="height:{500}px">
  14082. <img src="/assets/images/home/zh/9.png" alt="" class='w-full' />
  14083. </div>
  14084. </div> -->
  14085. <div class="px-4 pb-10 text-center md:px-12 md:pb-20">
  14086. <div class="intersection my-5 text-2xl font-bold transition-all ease-out md:my-10 md:text-4xl">
  14087. 🎖 {isZh ? '贡献者' : 'Contributors'}
  14088. </div>
  14089. <div class="intersection flex justify-center">
  14090. <a href="https://github.com/any-tdf/stdf/graphs/contributors" target="_blank">
  14091. <img src="https://contrib.nn.ci/api?repo=any-tdf/stdf&cols=7" title={isZh ? '贡献者' : 'Contributors'} alt="" />
  14092. </a>
  14093. </div>
  14094. </div>
  14095. <!-- 赞助者 -->
  14096. <div class="px-4 pb-20 text-center md:px-12 md:pb-40">
  14097. <div class="intersection my-5 text-2xl font-bold transition-all ease-out md:my-10 md:text-4xl">
  14098. 🙏 {isZh ? '赞助者' : 'Sponsors'}
  14099. </div>
  14100. <div class="">
  14101. <div class="intersection mb-4">GitHub</div>
  14102. <div class="flex flex-wrap justify-center gap-4">
  14103. {#each thinkGithub as item}
  14104. <a class="intersection" href={'https://github.com/' + item.name} target="_blank">
  14105. <img
  14106. class="h-16 w-16 overflow-hidden rounded-full"
  14107. src={'https://avatars.githubusercontent.com/' + item.name}
  14108. title={(isZh ? '感谢 ' : 'Thanks ') + item.name}
  14109. alt=""
  14110. />
  14111. </a>
  14112. {/each}
  14113. </div>
  14114. </div>
  14115. </div>
  14116. </div>
  14117. <div class="bg-gray-100 dark:bg-gray-950">
  14118. <div class="mx-auto grid max-w-[1536px] grid-cols-2 gap-10 px-6 py-10 md:grid-cols-4 md:px-20">
  14119. {#each bottomInfo as item}
  14120. <div>
  14121. <div class="mb-2 text-lg font-bold">{isZh ? item.title : item.title_en}</div>
  14122. <div class="flex flex-col gap-2">
  14123. {#each item.list as i}
  14124. <a href={i.link} target={i._blank ? '_blank' : '_self'} title={i.link} class="text-sm hover:underline">
  14125. {isZh ? i.title : i.title_en}
  14126. </a>
  14127. {/each}
  14128. </div>
  14129. </div>
  14130. {/each}
  14131. </div>
  14132. </div>
  14133. <div class="py-4 text-center text-xs">
  14134. <div class="flex justify-center gap-1">
  14135. <div>STDF DESIGN • MADE BY DUFU</div>
  14136. <div>
  14137. {#if isZh}
  14138. • <a href="https://beian.miit.gov.cn" target="_blank">滇 ICP 备 17004037 号 -4</a>
  14139. {/if}
  14140. </div>
  14141. </div>
  14142. </div>
  14143. ================================================
  14144. FILE: docs/site/src/routes/components/+page.svelte
  14145. ================================================
  14146. <script lang="ts">
  14147. import { onMount } from 'svelte';
  14148. import { fly } from 'svelte/transition';
  14149. import { isShowNavStore, isCmdKStore, isWideScreenStore, currentColorStore, currentThemeStore } from '../../store';
  14150. import { menuList, type MenuList } from '../../data/menuList';
  14151. import { page } from '$app/stores';
  14152. import hljs from 'highlight.js';
  14153. import type { MenuListChild } from '../../data/menuList.js';
  14154. import Menu from '$lib/menu/Menu.svelte';
  14155. import Tab from '$lib/tab/Tab.svelte';
  14156. import { goto } from '$app/navigation';
  14157. import Component from './Component.svelte';
  14158. import Guide from './Guide.svelte';
  14159. import Api from './Api.svelte';
  14160. import FAQ from './FAQ.svelte';
  14161. import Version from './Version.svelte';
  14162. let loading = $state(true);
  14163. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14164. const params = $page.url.searchParams;
  14165. //数组二级组成新数组
  14166. const ArrChildFun = (arr: MenuList[]) => {
  14167. let newArr = [];
  14168. for (let e = 0; e < arr.length; e++) {
  14169. newArr.push(...arr[e].childs);
  14170. }
  14171. return newArr;
  14172. };
  14173. let menuChildList = $derived(ArrChildFun(menuList));
  14174. let currentNav = $state<MenuListChild | null>(null);
  14175. let currentTab = $state(0);
  14176. let titleDom: HTMLElement | null = $state(null);
  14177. let demoHeight = $state(0);
  14178. let highlightedCode = $state('');
  14179. let titleWidth = $state(0);
  14180. let visible = $state(true);
  14181. let isShowIframe = $state(true);
  14182. let navBarHeight = $state(0);
  14183. let menuChange = $state(true);
  14184. // 动态导入组件字符串
  14185. const getComponentStrFunc = async (name: string) => {
  14186. const rawObj = await import(`../../../../../packages/stdf/src/routes/${name}/${isZh ? 'zh_CN' : 'en_US'}/+page.svelte?raw`);
  14187. // 将 componentStr 中所有的 from '$lib/index.js' 替换为 from 'stdf'
  14188. // 将 componentStr 中所有的 from '$lib/types/index.js' 替换为 from 'stdf/types'
  14189. return rawObj.default
  14190. .replace(/from ['"]\$lib\/index\.js['"]/g, "from 'stdf'")
  14191. .replace(/from ['"]\$lib\/types\/index\.js['"]/g, "from 'stdf/types'");
  14192. };
  14193. const getDemoHeightFun = () => {
  14194. if (titleDom) {
  14195. demoHeight = document.documentElement.clientHeight - 70 - titleDom.offsetHeight - 100;
  14196. navBarHeight = document.documentElement.clientHeight - 56;
  14197. }
  14198. };
  14199. const initFn = async () => {
  14200. if (params.get('tab')) {
  14201. currentTab = Number(params.get('tab'));
  14202. }
  14203. if (params.get('nav')) {
  14204. currentNav = menuChildList.filter((item) => item.nav === params.get('nav'))[0];
  14205. } else {
  14206. currentNav = menuList[0].childs[1];
  14207. }
  14208. loading = true;
  14209. const componentStr = await getComponentStrFunc(currentNav.nav);
  14210. loading = false;
  14211. highlightedCode = hljs.highlight(componentStr, {
  14212. language: 'svelte',
  14213. ignoreIllegals: true
  14214. }).value;
  14215. };
  14216. onMount(() => {
  14217. if (titleDom) {
  14218. demoHeight = document.documentElement.clientHeight - 70 - titleDom.offsetHeight - 100;
  14219. navBarHeight = document.documentElement.clientHeight - 56;
  14220. }
  14221. window.addEventListener('resize', getDemoHeightFun);
  14222. initFn();
  14223. return () => {
  14224. window.removeEventListener('resize', getDemoHeightFun);
  14225. };
  14226. });
  14227. //监听箭头按键,方便键盘操作
  14228. const handleKeydown = (event: KeyboardEvent) => {
  14229. if ($isCmdKStore) {
  14230. return;
  14231. }
  14232. //左右箭头切换 Tab
  14233. if (event.code === 'ArrowLeft') {
  14234. if (currentTab > 0) {
  14235. isShowIframe = false;
  14236. setTimeout(() => {
  14237. isShowIframe = true;
  14238. }, 10);
  14239. currentTab--;
  14240. params.set('tab', currentTab.toString());
  14241. goto(`/components?nav=${params.get('nav') ? params.get('nav') : 'button'}&tab=${currentTab}`);
  14242. }
  14243. }
  14244. if (event.code === 'ArrowRight') {
  14245. if (currentTab < 4) {
  14246. isShowIframe = false;
  14247. setTimeout(() => {
  14248. isShowIframe = true;
  14249. }, 10);
  14250. currentTab++;
  14251. params.set('tab', currentTab.toString());
  14252. goto(`/components?nav=${params.get('nav') ? params.get('nav') : 'button'}&tab=${currentTab}`);
  14253. }
  14254. }
  14255. //上下箭头切换组件
  14256. if (event.code === 'ArrowUp') {
  14257. let currentMenuIndex = menuChildList.findIndex((item) => item.nav === currentNav?.nav);
  14258. if (currentMenuIndex > 0) {
  14259. visible = false;
  14260. menuChange = false;
  14261. setTimeout(async () => {
  14262. visible = true;
  14263. currentNav = menuChildList[currentMenuIndex - 1];
  14264. params.set('nav', currentNav.nav);
  14265. goto(`/components?nav=${currentNav.nav}&tab=${currentTab}`);
  14266. const componentStr = await getComponentStrFunc(currentNav.nav);
  14267. highlightedCode = hljs.highlight(componentStr, {
  14268. language: 'svelte',
  14269. ignoreIllegals: true
  14270. }).value;
  14271. menuChange = true;
  14272. }, 10);
  14273. }
  14274. }
  14275. if (event.code === 'ArrowDown') {
  14276. let currentMenuIndex = menuChildList.findIndex((item) => item.nav === currentNav?.nav);
  14277. if (currentMenuIndex < menuChildList.length - 1) {
  14278. visible = false;
  14279. setTimeout(async () => {
  14280. visible = true;
  14281. menuChange = false;
  14282. currentNav = menuChildList[currentMenuIndex + 1];
  14283. params.set('nav', currentNav.nav);
  14284. goto(`/components?nav=${currentNav.nav}&tab=${currentTab}`);
  14285. const componentStr = await getComponentStrFunc(currentNav.nav);
  14286. highlightedCode = hljs.highlight(componentStr, {
  14287. language: 'svelte',
  14288. ignoreIllegals: true
  14289. }).value;
  14290. menuChange = true;
  14291. }, 10);
  14292. }
  14293. }
  14294. };
  14295. const menuClickFun = (currentMenu: MenuListChild) => {
  14296. $isShowNavStore && ($isShowNavStore = false);
  14297. visible = false;
  14298. menuChange = false;
  14299. setTimeout(async () => {
  14300. visible = true;
  14301. currentNav = currentMenu;
  14302. params.set('nav', currentMenu.nav);
  14303. goto(`/components?nav=${currentMenu.nav}&tab=${params.get('tab') ? params.get('tab') : '0'}`);
  14304. const componentStr = await getComponentStrFunc(currentMenu.nav);
  14305. highlightedCode = hljs.highlight(componentStr, { language: 'svelte', ignoreIllegals: true }).value;
  14306. menuChange = true;
  14307. }, 10);
  14308. };
  14309. const tabClickFun = (i: number) => {
  14310. isShowIframe = false;
  14311. setTimeout(() => {
  14312. isShowIframe = true;
  14313. }, 10);
  14314. currentTab = i;
  14315. params.set('tab', currentTab.toString());
  14316. goto(`/components?nav=${params.get('nav') ? params.get('nav') : 'button'}&tab=${currentTab}`);
  14317. };
  14318. let QRValue = $derived(
  14319. (import.meta.env.DEV ? location.protocol + '//' + location.hostname + ':8888/' : 'https://demo.stdf.design/') +
  14320. currentNav?.nav +
  14321. (isZh ? '/zh_CN' : '/en_US')
  14322. );
  14323. </script>
  14324. <svelte:window onkeydown={handleKeydown} />
  14325. <div class="flex">
  14326. <div
  14327. class="fixed -left-52 top-14 z-[100] w-52 overflow-y-scroll border-black/10 bg-white transition-all duration-300 md:left-0 md:bg-transparent dark:border-white/20 dark:bg-black dark:md:bg-transparent"
  14328. class:left-0={$isShowNavStore}
  14329. class:-left-52={!$isShowNavStore}
  14330. style="height:{navBarHeight + 'px'}"
  14331. >
  14332. <Menu {menuList} currentNav={currentNav?.nav} onclickMenu={menuClickFun} />
  14333. </div>
  14334. {#if visible}
  14335. <div
  14336. class="mx-auto flex w-full flex-col md:pl-48 {$isWideScreenStore ? 'max-w-full' : 'max-w-[1472px]'}"
  14337. in:fly={{ x: 100, duration: 500 }}
  14338. out:fly={{ x: 100, duration: 100 }}
  14339. >
  14340. <div class="relative z-20 px-4 pt-4 md:flex md:space-x-4 md:px-8" bind:this={titleDom}>
  14341. {#if loading}
  14342. {isZh ? '请等待...' : 'Please wait...'}
  14343. {:else}
  14344. <div class="flex items-center text-2xl font-bold md:text-4xl">
  14345. <div>
  14346. {isZh ? currentNav?.title : currentNav?.title_en}
  14347. </div>
  14348. <a href={QRValue} target="_blank" aria-label={isZh ? '扫码预览' : 'Scan to preview'}>
  14349. <div class="ml-2 h-8 w-8 rounded-sm bg-gray-100 p-1 text-gray-500 md:hidden dark:bg-gray-700">
  14350. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" style="fill: currentColor">
  14351. <path fill="none" d="M0 0h24v24H0z" />
  14352. <path
  14353. d="M13 21v2h-2v-2H3a1 1 0 0 1-1-1V6h20v14a1 1 0 0 1-1 1h-8zm-9-2h16V8H4v11zm9-9h5v2h-5v-2zm0 4h5v2h-5v-2zm-4-4v3h3a3 3 0 1 1-3-3zM2 3h20v2H2V3z"
  14354. />
  14355. </svg>
  14356. </div>
  14357. </a>
  14358. </div>
  14359. <div class="mt-4 text-xs text-gray-500 md:text-sm">
  14360. {isZh ? currentNav?.tip : currentNav?.tip_en}
  14361. </div>
  14362. {/if}
  14363. </div>
  14364. <div class="relative z-10 -mt-14 p-4 md:px-8 md:py-4" bind:clientWidth={titleWidth}>
  14365. <Tab {currentTab} onclickTab={tabClickFun} />
  14366. </div>
  14367. <div class="my-4 ml-4">
  14368. <!-- <div class="h-px bg-black/10 dark:bg-white/20"></div> -->
  14369. </div>
  14370. <div>
  14371. <!-- 示例 -->
  14372. {#if currentTab === 0}
  14373. <div
  14374. in:fly={{ y: 100, duration: 500 }}
  14375. out:fly={{ y: 100, duration: 100 }}
  14376. class="mt-2 flex flex-1 justify-around py-4 md:pl-8 md:pr-4"
  14377. style="width:{titleWidth}px;"
  14378. >
  14379. <div class="bg-codeLight dark:bg-codeDark grow overflow-y-scroll rounded-sm" style="height:{demoHeight}px;">
  14380. <Component {highlightedCode} />
  14381. </div>
  14382. <div
  14383. class="ml-2 hidden w-[392px] shrink-0 grow-0 border border-black/10 md:block dark:border-white/10"
  14384. style="height:{demoHeight}px"
  14385. >
  14386. {#if currentNav?.nav}
  14387. {#if isShowIframe}
  14388. <iframe
  14389. title="Demo"
  14390. id="iframe-id"
  14391. src={import.meta.env.DEV
  14392. ? `http://localhost:8888/${currentNav?.nav}/${isZh ? 'zh_CN' : 'en_US'}?channel=iframe&theme=${$currentColorStore}&darkMode=${$currentThemeStore}&lang=${localStorage.getItem('lang')}`
  14393. : `https://demo.stdf.design/${currentNav?.nav}/${isZh ? 'zh_CN' : 'en_US'}?channel=iframe&theme=${$currentColorStore}&darkMode=${$currentThemeStore}&lang=${localStorage.getItem('lang')}`}
  14394. height={demoHeight - 2}
  14395. width="390"
  14396. ></iframe>
  14397. {:else}
  14398. <div class="text-primary dark:text-dark flex flex-col justify-center" style="width:390px;height:{demoHeight - 2}px;">
  14399. <div>
  14400. <svg class="mx-auto my-1 h-10 w-10 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  14401. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" />
  14402. <path
  14403. class="opacity-75"
  14404. fill="currentColor"
  14405. d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
  14406. />
  14407. </svg>
  14408. </div>
  14409. </div>
  14410. {/if}
  14411. {/if}
  14412. </div>
  14413. </div>
  14414. {/if}
  14415. {#if currentTab === 1}
  14416. <!-- api -->
  14417. {#if menuChange}
  14418. <div class={` left-full mt-4 flex-1 p-4 md:px-8 md:py-4`} style="width:{titleWidth}px;">
  14419. <Api api={currentNav?.nav} />
  14420. </div>
  14421. {/if}
  14422. {/if}
  14423. {#if currentTab === 2}
  14424. <!-- 指南 -->
  14425. {#if menuChange}
  14426. <div class="mx-auto mt-4 flex-1 rounded-sm p-4 md:px-8 md:py-4" style="width:{titleWidth}px;">
  14427. <Guide guide={currentNav?.nav} />
  14428. </div>
  14429. {/if}
  14430. {/if}
  14431. {#if currentTab === 3}
  14432. <!-- FAQ -->
  14433. {#if menuChange}
  14434. <div class={`mt-4 flex-1 rounded-sm p-4 md:px-8 md:py-4 `} style="width:{titleWidth}px;">
  14435. <FAQ guide={currentNav?.nav} />
  14436. </div>
  14437. {/if}
  14438. {/if}
  14439. {#if currentTab === 4}
  14440. <!-- Version -->
  14441. {#if menuChange}
  14442. <div class={`mt-4 flex-1 rounded-sm p-4 md:px-8 md:py-4 `} style="width:{titleWidth}px;">
  14443. <Version guide={currentNav?.nav} />
  14444. </div>
  14445. {/if}
  14446. {/if}
  14447. </div>
  14448. </div>
  14449. {/if}
  14450. </div>
  14451. ================================================
  14452. FILE: docs/site/src/routes/components/Api.svelte
  14453. ================================================
  14454. <script lang="ts">
  14455. import { onMount } from 'svelte';
  14456. import { mdTextToHljs } from './../../utils/index';
  14457. interface Props {
  14458. api?: string;
  14459. }
  14460. let { api = 'button' }: Props = $props();
  14461. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14462. let loading = $state(true);
  14463. const getMdStrFunc = async (nav: string) => {
  14464. loading = true;
  14465. const rawObj = await import(`../../../../mds/components/${nav}/api${isZh ? '' : '_en'}.md`);
  14466. const mdStr = rawObj.default;
  14467. loading = false;
  14468. return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'), 'javascript');
  14469. };
  14470. let apiText: string | null = $state(null);
  14471. onMount(async () => {
  14472. apiText = await getMdStrFunc(api);
  14473. });
  14474. </script>
  14475. <article
  14476. class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
  14477. >
  14478. {#if loading}
  14479. {isZh ? '请等待...' : 'Please wait...'}
  14480. {:else}
  14481. {@html apiText}
  14482. {/if}
  14483. </article>
  14484. <div class="flex gap-2 pb-8 text-xs">
  14485. <a
  14486. href={'https://github.com/any-tdf/stdf/edit/main/docs/mds/components/' + api + '/api' + (isZh ? '' : '_en') + '.md'}
  14487. target="_blank"
  14488. class="text-primary dark:text-dark flex"
  14489. >
  14490. <span class="mr-1 h-4 w-4">
  14491. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
  14492. <path
  14493. d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
  14494. />
  14495. </svg>
  14496. </span>
  14497. {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
  14498. </a>
  14499. </div>
  14500. ================================================
  14501. FILE: docs/site/src/routes/components/Component.svelte
  14502. ================================================
  14503. <script lang="ts">
  14504. let { highlightedCode = '' } = $props();
  14505. </script>
  14506. <article class={`prose max-w-none text-sm dark:prose-invert`}>
  14507. <pre><code class="hljs">{@html highlightedCode}</code></pre>
  14508. </article>
  14509. ================================================
  14510. FILE: docs/site/src/routes/components/FAQ.svelte
  14511. ================================================
  14512. <script lang="ts">
  14513. import { onMount } from 'svelte';
  14514. import { mdTextToHljs } from '../../utils/index';
  14515. interface Props {
  14516. guide?: string;
  14517. }
  14518. let { guide = 'button' }: Props = $props();
  14519. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14520. let loading = $state(true);
  14521. const getMdStrFunc = async (nav: string) => {
  14522. loading = true;
  14523. const rawObj = await import(`../../../../mds/components/${nav}/FAQ${isZh ? '' : '_en'}.md`);
  14524. const mdStr = rawObj.default;
  14525. loading = false;
  14526. return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
  14527. };
  14528. let guideText: string | null = $state(null);
  14529. onMount(async () => {
  14530. guideText = await getMdStrFunc(guide);
  14531. });
  14532. </script>
  14533. <p class="mb-4 text-xs text-black/40 dark:text-white/30">
  14534. {isZh
  14535. ? '注:请将开发中遇到的问题或想法提到 GitHub Issue,后续会筛选出有代表性的问题整理在此处。'
  14536. : 'Note: Please raise any issues or ideas encountered in development to GitHub Issue, and then select representative issues to organize here.'}
  14537. </p>
  14538. <article
  14539. class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
  14540. >
  14541. {#if loading}
  14542. {isZh ? '请等待...' : 'Please wait...'}
  14543. {:else}
  14544. {@html guideText}
  14545. {/if}
  14546. </article>
  14547. <div class="flex gap-2 pb-8 text-xs">
  14548. <a
  14549. href={'https://github.com/any-tdf/stdf/edit/main/docs/mds/components/' + guide + '/FAQ' + (isZh ? '' : '_en') + '.md'}
  14550. target="_blank"
  14551. class="text-primary dark:text-dark flex"
  14552. >
  14553. <span class="mr-1 h-4 w-4">
  14554. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
  14555. <path
  14556. d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
  14557. />
  14558. </svg>
  14559. </span>
  14560. {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
  14561. </a>
  14562. </div>
  14563. ================================================
  14564. FILE: docs/site/src/routes/components/Guide.svelte
  14565. ================================================
  14566. <script lang="ts">
  14567. import { onMount } from 'svelte';
  14568. import { mdTextToHljs } from './../../utils/index';
  14569. import { themeStore, sysThemeStore } from '../../store';
  14570. interface Props {
  14571. guide?: string;
  14572. }
  14573. let { guide = 'button' }: Props = $props();
  14574. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14575. let loading = $state(true);
  14576. let theme = $derived($themeStore === 'auto' ? ($sysThemeStore === 'dark' ? 'dark' : 'light') : $themeStore);
  14577. const getMdStrFunc = async (nav: string) => {
  14578. loading = true;
  14579. const rawObj = await import(`../../../../mds/components/${nav}/guide${isZh ? '' : '_en'}.md`);
  14580. const mdStr = rawObj.default;
  14581. loading = false;
  14582. return mdTextToHljs(
  14583. mdStr
  14584. .replace(/<img src="/g, `<img class="w-full md:w-1/2${theme === 'dark' ? ' invert' : ''}" src="./assets/images/guide/`)
  14585. .replace(/<a href="/g, '<a target="_blank" href="')
  14586. );
  14587. };
  14588. let guideText: string | null = $state(null);
  14589. onMount(async () => {
  14590. guideText = await getMdStrFunc(guide);
  14591. });
  14592. </script>
  14593. <article class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark max-w-none pb-12">
  14594. {#if loading}
  14595. {isZh ? '请等待...' : 'Please wait...'}
  14596. {:else}
  14597. {@html guideText}
  14598. {/if}
  14599. </article>
  14600. <div class="flex gap-2 pb-8 text-xs">
  14601. <a
  14602. href={'https://github.com/any-tdf/stdf/edit/main/docs/mds/components/' + guide + '/guide' + (isZh ? '' : '_en') + '.md'}
  14603. target="_blank"
  14604. class="text-primary dark:text-dark flex"
  14605. >
  14606. <span class="mr-1 h-4 w-4">
  14607. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
  14608. <path
  14609. d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
  14610. />
  14611. </svg>
  14612. </span>
  14613. {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
  14614. </a>
  14615. </div>
  14616. ================================================
  14617. FILE: docs/site/src/routes/components/Version.svelte
  14618. ================================================
  14619. <script lang="ts">
  14620. import { onMount } from 'svelte';
  14621. import { mdTextToHljs } from '../../utils/index';
  14622. interface Props {
  14623. guide?: string;
  14624. }
  14625. let { guide = 'button' }: Props = $props();
  14626. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14627. let loading = $state(true);
  14628. //提取字符中以‘[!tag’开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  14629. const getTags = (str: string) => {
  14630. return str.match(/\[!tag[^\]]+\]/g);
  14631. };
  14632. //提取字符中以‘[!issue‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  14633. const getIssues = (str: string) => {
  14634. return str.match(/\[!issue[^\]]+\]/g);
  14635. };
  14636. //提取字符中以‘[!contribute‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  14637. const getContributes = (str: string) => {
  14638. return str.match(/\[!contribute[^\]]+\]/g);
  14639. };
  14640. // 传入 tag 类型和 index,返回对应的 emoji
  14641. const spanTextFun = (type: string, index: string) => {
  14642. if (type === 'O') {
  14643. return '👏';
  14644. }
  14645. if (type === 'A') {
  14646. return '💪';
  14647. }
  14648. switch (index) {
  14649. case '1':
  14650. return '👊';
  14651. case '2':
  14652. return '✊';
  14653. case '3':
  14654. return '👎';
  14655. default:
  14656. return '👎';
  14657. }
  14658. };
  14659. //替换 Markdown 中的标签
  14660. const mdTextToHljsFun = (string: string) => {
  14661. //替换 tag
  14662. const tagList = getTags(string);
  14663. if (tagList) {
  14664. tagList.forEach((item) => {
  14665. const arr = item.split('|');
  14666. // const span = `<span class="w-2 h-2 text-xs inline-block rounded-full mr-1 ${bgClassFun(arr[1], arr[2])}"></span>`;
  14667. const span = `<span class="mr-1">${spanTextFun(arr[1], arr[2])}</span>`;
  14668. string = string.replace(item, span);
  14669. });
  14670. }
  14671. //替换 issue
  14672. const issueList = getIssues(string);
  14673. if (issueList) {
  14674. issueList.forEach((item) => {
  14675. const arr = item.split('|');
  14676. const span = `<span><a class="size-4 translate-y-0.5 rounded-full overflow-hidden inline-flex items-center justify-center" href="https://github.com/${
  14677. arr[1]
  14678. }" target="_blank"><img class="w-full h-full" src="https://avatars.githubusercontent.com/${
  14679. arr[1]
  14680. }" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '提出 Issue' : 'raise an Issue'}" alt=""></a></span>`;
  14681. string = string.replace(item, span);
  14682. });
  14683. }
  14684. //替换 contribute
  14685. const contributeList = getContributes(string);
  14686. if (contributeList) {
  14687. contributeList.forEach((item) => {
  14688. const arr = item.split('|');
  14689. const span = `<span><a class="size-4 translate-y-0.5 rounded-full overflow-hidden inline-flex items-center justify-center" href="https://github.com/${
  14690. arr[1]
  14691. }" target="_blank"><img class="w-full h-full" src="https://avatars.githubusercontent.com/${
  14692. arr[1]
  14693. }" title="${isZh ? '感谢' : 'Thanks'} ${arr[1]} ${isZh ? '贡献代码' : 'contribute code'}" alt=""></a></span>`;
  14694. string = string.replace(item, span);
  14695. });
  14696. }
  14697. return string;
  14698. };
  14699. const getMdStrFunc = async (nav: string) => {
  14700. loading = true;
  14701. const rawObj = await import(`../../../../mds/components/${nav}/version${isZh ? '' : '_en'}.md`);
  14702. const mdStr = rawObj.default;
  14703. loading = false;
  14704. return mdTextToHljs(mdStr.replace(/<a href="/g, '<a target="_blank" href="'));
  14705. };
  14706. let guideText: string | null = $state(null);
  14707. onMount(async () => {
  14708. const guideTextStr = await getMdStrFunc(guide);
  14709. guideText = mdTextToHljsFun(guideTextStr);
  14710. });
  14711. </script>
  14712. <div class="mb-4 max-w-5xl text-xs text-black/40 dark:text-white/30">
  14713. {isZh
  14714. ? '注:👊、✊、👎 分别表示严重、一般、轻微三个等级的 BUG,👏 表示优化,💪 表示新增。描述后面的头像表示此项的提出者或贡献者,感谢他们。'
  14715. : 'Note: 👊, ✊, and 👎 represent three levels of severity for bugs, with 👊 being the most severe and 👎 the least severe. 👏 means optimization, and 💪 means new feature. The avatar after the description represents the proposer or contributor of the item. We thank them for their contributions. '}
  14716. </div>
  14717. <article
  14718. class="prose dark:prose-invert prose-table:break-all prose-td:whitespace-nowrap md:prose-td:whitespace-normal max-w-none overflow-x-auto pb-12"
  14719. >
  14720. {#if loading}
  14721. {isZh ? '请等待...' : 'Please wait...'}
  14722. {:else}
  14723. {@html guideText}
  14724. {/if}
  14725. </article>
  14726. <div class="flex gap-2 pb-8 text-xs">
  14727. <a
  14728. href={'https://github.com/any-tdf/stdf/edit/main/docs/mds/components/' + guide + '/version' + (isZh ? '' : '_en') + '.md'}
  14729. class="text-primary dark:text-dark flex"
  14730. target="_blank"
  14731. >
  14732. <span class="mr-1 h-4 w-4">
  14733. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
  14734. <path
  14735. d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
  14736. />
  14737. </svg>
  14738. </span>
  14739. {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
  14740. </a>
  14741. </div>
  14742. ================================================
  14743. FILE: docs/site/src/routes/guide/+layout.svelte
  14744. ================================================
  14745. <script lang="ts">
  14746. import { onMount } from 'svelte';
  14747. import { isShowNavStore, isWideScreenStore } from '../../store';
  14748. import Menu from '$lib/menu/Menu.svelte';
  14749. import { page } from '$app/stores';
  14750. import type { MenuListChild } from '../../data/menuList.js';
  14751. import { goto } from '$app/navigation';
  14752. let { children } = $props();
  14753. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14754. type menuListChildsProps = { title: string; title_en: string; nav: string; doc?: string };
  14755. type menuListProps = { class: string; class_en: string; childs: menuListChildsProps[] };
  14756. const menuList: menuListProps[] = [
  14757. {
  14758. class: '常规',
  14759. class_en: 'General',
  14760. childs: [
  14761. { title: '快速上手', title_en: 'Quick start', nav: 'quick-start', doc: 'quickStart' },
  14762. { title: '主题配置', title_en: 'Theme', nav: 'theme', doc: 'theme' },
  14763. { title: '图标', title_en: 'Icon', nav: 'icon', doc: 'icon' },
  14764. {
  14765. title: '国际化',
  14766. title_en: 'Internationalization',
  14767. nav: 'internation',
  14768. doc: 'internation'
  14769. },
  14770. { title: '更新日志', title_en: 'Changelog', nav: 'changelog', doc: 'changelog' },
  14771. { title: '常见问题', title_en: 'FAQ', nav: 'faq', doc: 'faq' },
  14772. {
  14773. title: '贡献指南',
  14774. title_en: 'Contribution Guide',
  14775. nav: 'contribution',
  14776. doc: 'contribution'
  14777. },
  14778. { title: '兼容性', title_en: 'Compatibility', nav: 'compatibility', doc: 'compatibility' }
  14779. ]
  14780. },
  14781. {
  14782. class: '设计',
  14783. class_en: 'Design',
  14784. childs: [
  14785. { title: '色彩', title_en: 'Color', nav: 'color' },
  14786. { title: 'LOGO', title_en: 'LOGO', nav: 'logo' }
  14787. ]
  14788. },
  14789. {
  14790. class: '工具',
  14791. class_en: 'Tools',
  14792. childs: [
  14793. { title: '主题生成器', title_en: 'Theme generator', nav: 'generator' },
  14794. { title: 'IDE 插件', title_en: 'IDE plugin', nav: 'vscode', doc: 'vscode' },
  14795. { title: '脚手架', title_en: 'Create cli', nav: 'create' },
  14796. { title: '图标插件', title_en: 'Icon plugin', nav: 'icon-plugin' },
  14797. { title: 'MD 插件', title_en: 'MD plugin', nav: 'md' },
  14798. { title: '快捷键', title_en: 'Shortcut key', nav: 'shortkey' }
  14799. ]
  14800. },
  14801. {
  14802. class: '其他',
  14803. class_en: 'Other',
  14804. childs: [
  14805. { title: '关于', title_en: 'About', nav: 'about', doc: 'about' },
  14806. { title: '里程碑', title_en: 'Milestone', nav: 'milestone', doc: 'milestone' },
  14807. { title: '计划', title_en: 'Future', nav: 'future', doc: 'future' }
  14808. ]
  14809. }
  14810. ];
  14811. //扁平 menuList
  14812. const flatMenuList: menuListChildsProps[] = [];
  14813. for (let e = 0; e < menuList.length; e++) {
  14814. flatMenuList.push(...menuList[e].childs);
  14815. }
  14816. let currentNav = $state(menuList[0].childs[0]);
  14817. let menuHeight = $state(0);
  14818. const getMenuHeightFun = () => {
  14819. menuHeight = document.documentElement.clientHeight - 56;
  14820. };
  14821. const menuClickFun = (currentMenu: MenuListChild) => {
  14822. if ($isShowNavStore) {
  14823. isShowNavStore.set(false);
  14824. }
  14825. currentNav = currentMenu;
  14826. // 将当前点击的 currentMenu 设置 url 参数
  14827. // window.location.href = '/guide?nav=' + currentMenu.nav;
  14828. goto(`/guide${currentMenu.nav === 'quick-start' ? '' : `/${currentMenu.nav}`}`);
  14829. };
  14830. onMount(() => {
  14831. menuHeight = document.documentElement.clientHeight - 56;
  14832. window.addEventListener('resize', getMenuHeightFun);
  14833. // 根据 $page.url.pathname 获取 currentNav
  14834. const urlNav = flatMenuList.find((item) => ($page.url.pathname.includes(item.nav) ? item : null));
  14835. currentNav = urlNav || flatMenuList[0];
  14836. return () => {
  14837. window.removeEventListener('resize', getMenuHeightFun);
  14838. };
  14839. });
  14840. // 全屏
  14841. const changeFullFunc = () => {
  14842. if ($isWideScreenStore) {
  14843. isWideScreenStore.set(false);
  14844. localStorage.setItem('isFull', 'notFull');
  14845. } else {
  14846. isWideScreenStore.set(true);
  14847. localStorage.setItem('isFull', 'full');
  14848. }
  14849. };
  14850. // 编辑地址处理
  14851. const editUrlFn = (nav: string) => {
  14852. const baseUrl = 'https://github.com/any-tdf/stdf/edit/main/';
  14853. if (nav === 'create') {
  14854. return baseUrl + 'packages/create-stdf/README' + (isZh ? '_CN' : '') + '.md';
  14855. }
  14856. if (nav === 'icon-plugin') {
  14857. return baseUrl + 'packages/rollup-plugin-stdf-icon/README' + (isZh ? '_CN' : '') + '.md';
  14858. }
  14859. return baseUrl + `docs/mds/guide/${flatMenuList.filter((item) => item.nav === nav)[0]?.doc}${isZh ? '' : '_en'}.md`;
  14860. };
  14861. </script>
  14862. <div class="flex">
  14863. <div
  14864. class="fixed -left-52 top-14 z-[100] w-48 overflow-y-scroll border-black/10 bg-white transition-all duration-300 md:left-0 md:bg-transparent dark:border-white/20 dark:bg-black dark:md:bg-transparent"
  14865. class:left-0={$isShowNavStore}
  14866. class:-left-52={!$isShowNavStore}
  14867. style="height:{menuHeight + 'px'}"
  14868. >
  14869. <Menu {menuList} currentNav={currentNav.nav} onclickMenu={menuClickFun} showNum={false} />
  14870. </div>
  14871. <div class="w-screen md:pl-48">
  14872. <!-- {#if !$page.url.pathname.includes('generator')}
  14873. <div class="px-4 py-12 md:px-8 md:py-4">
  14874. <div class="text-4xl font-bold">
  14875. {isZh ? currentNav.title : currentNav.title_en}
  14876. </div>
  14877. </div>
  14878. <div class="h-px bg-black/10 dark:bg-white/20"></div>
  14879. {/if} -->
  14880. <div class="px-4 pt-4 {$page.url.pathname.includes('generator') ? 'md:px-4 md:pt-4' : 'md:px-8 md:pt-12'}">
  14881. {@render children()}
  14882. </div>
  14883. {#if !$page.url.pathname.includes('generator') && currentNav.nav != 'color' && currentNav.nav != 'logo' && currentNav.nav != 'shortkey'}
  14884. <div class="mx-auto flex gap-2 px-4 pb-8 text-xs {$isWideScreenStore ? 'max-w-full md:px-8' : 'max-w-7xl md:px-0'}">
  14885. <a href={editUrlFn(currentNav.nav)} class="text-primary dark:text-dark flex w-full" target="_blank">
  14886. <span class="mr-1 h-4 w-4">
  14887. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="h-4 w-4" style="fill: currentColor;">
  14888. <path
  14889. d="M12.8995 6.85431L17.1421 11.0969L7.24264 20.9964H3V16.7538L12.8995 6.85431ZM14.3137 5.44009L16.435 3.31877C16.8256 2.92825 17.4587 2.92825 17.8492 3.31877L20.6777 6.1472C21.0682 6.53772 21.0682 7.17089 20.6777 7.56141L18.5563 9.68273L14.3137 5.44009Z"
  14890. />
  14891. </svg>
  14892. </span>
  14893. {isZh ? '在 GitHub 上编辑' : 'Edit on GitHub'}
  14894. </a>
  14895. </div>
  14896. {/if}
  14897. </div>
  14898. </div>
  14899. {#if !$page.url.pathname.includes('generator')}
  14900. <button
  14901. class="bg-primary shadow-primary/50 dark:bg-dark dark:shadow-dark/50 fixed bottom-4 right-2 z-50 hidden h-8 w-8 cursor-pointer rounded-full p-1.5 text-white shadow-md md:block dark:text-black"
  14902. onclick={changeFullFunc}
  14903. >
  14904. {#if $isWideScreenStore}
  14905. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
  14906. ><path
  14907. d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z"
  14908. fill="currentColor"
  14909. ></path></svg
  14910. >
  14911. {:else}
  14912. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
  14913. ><path
  14914. d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"
  14915. fill="currentColor"
  14916. ></path></svg
  14917. >
  14918. {/if}
  14919. </button>
  14920. {/if}
  14921. <!-- 为 code-groups 预先编译 tailwind -->
  14922. <div
  14923. class="peer-checked/tab-0-0:border-primary peer-checked/tab-0-1:border-primary peer-checked/tab-0-2:border-primary peer-checked/tab-0-3:border-primary peer-checked/tab-0-4:border-primary peer-checked/tab-0-5:border-primary
  14924. peer-checked/tab-1-0:border-primary peer-checked/tab-1-1:border-primary peer-checked/tab-1-2:border-primary
  14925. peer-checked/tab-1-3:border-primary peer-checked/tab-1-4:border-primary peer-checked/tab-1-5:border-primary
  14926. peer-checked/tab-2-0:border-primary peer-checked/tab-2-1:border-primary peer-checked/tab-2-2:border-primary
  14927. peer-checked/tab-2-3:border-primary peer-checked/tab-2-4:border-primary peer-checked/tab-2-5:border-primary
  14928. peer-checked/tab-3-0:border-primary peer-checked/tab-3-1:border-primary peer-checked/tab-3-2:border-primary
  14929. peer-checked/tab-3-3:border-primary peer-checked/tab-3-4:border-primary peer-checked/tab-3-5:border-primary
  14930. peer-checked/tab-4-0:border-primary peer-checked/tab-4-1:border-primary peer-checked/tab-4-2:border-primary
  14931. peer-checked/tab-4-3:border-primary peer-checked/tab-4-4:border-primary peer-checked/tab-4-5:border-primary
  14932. dark:peer-checked/tab-0-0:border-dark dark:peer-checked/tab-0-1:border-dark dark:peer-checked/tab-0-2:border-dark
  14933. dark:peer-checked/tab-0-3:border-dark dark:peer-checked/tab-0-4:border-dark dark:peer-checked/tab-0-5:border-dark
  14934. dark:peer-checked/tab-1-0:border-dark dark:peer-checked/tab-1-1:border-dark dark:peer-checked/tab-1-2:border-dark
  14935. dark:peer-checked/tab-1-3:border-dark dark:peer-checked/tab-1-4:border-dark dark:peer-checked/tab-1-5:border-dark
  14936. dark:peer-checked/tab-2-0:border-dark dark:peer-checked/tab-2-1:border-dark dark:peer-checked/tab-2-2:border-dark
  14937. dark:peer-checked/tab-2-3:border-dark dark:peer-checked/tab-2-4:border-dark dark:peer-checked/tab-2-5:border-dark
  14938. dark:peer-checked/tab-3-0:border-dark dark:peer-checked/tab-3-1:border-dark dark:peer-checked/tab-3-2:border-dark
  14939. dark:peer-checked/tab-3-3:border-dark dark:peer-checked/tab-3-4:border-dark dark:peer-checked/tab-3-5:border-dark
  14940. dark:peer-checked/tab-4-0:border-dark dark:peer-checked/tab-4-1:border-dark dark:peer-checked/tab-4-2:border-dark
  14941. dark:peer-checked/tab-4-3:border-dark dark:peer-checked/tab-4-4:border-dark dark:peer-checked/tab-4-5:border-dark
  14942. hidden border-b-2 border-black/10 peer-checked/tab-0-0:block
  14943. peer-checked/tab-0-1:block peer-checked/tab-0-2:block peer-checked/tab-0-3:block
  14944. peer-checked/tab-0-4:block peer-checked/tab-0-5:block peer-checked/tab-1-0:block
  14945. peer-checked/tab-1-1:block peer-checked/tab-1-2:block peer-checked/tab-1-3:block
  14946. peer-checked/tab-1-4:block peer-checked/tab-1-5:block peer-checked/tab-2-0:block
  14947. peer-checked/tab-2-1:block peer-checked/tab-2-2:block peer-checked/tab-2-3:block
  14948. peer-checked/tab-2-4:block peer-checked/tab-2-5:block peer-checked/tab-3-0:block
  14949. peer-checked/tab-3-1:block peer-checked/tab-3-2:block peer-checked/tab-3-3:block
  14950. peer-checked/tab-3-4:block peer-checked/tab-3-5:block peer-checked/tab-4-0:block
  14951. peer-checked/tab-4-1:block peer-checked/tab-4-2:block peer-checked/tab-4-3:block
  14952. peer-checked/tab-4-4:block peer-checked/tab-4-5:block dark:border-white/10 dark:bg-[#202020]"
  14953. ></div>
  14954. ================================================
  14955. FILE: docs/site/src/routes/guide/+page.svelte
  14956. ================================================
  14957. <script lang="ts">
  14958. import { mdTextToHljs, groupIconMdPlugin } from '../../utils/index';
  14959. import { isWideScreenStore } from '../../store';
  14960. // @ts-ignore
  14961. import quickStartText from '../../../../mds/guide/quickStart.md';
  14962. // @ts-ignore
  14963. import quickStartText_en from '../../../../mds/guide/quickStart_en.md';
  14964. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14965. const text = groupIconMdPlugin(
  14966. mdTextToHljs(isZh ? quickStartText : quickStartText_en).replace(/<a href="/g, '<a target="_blank" href="')
  14967. );
  14968. </script>
  14969. <article
  14970. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-12 {$isWideScreenStore
  14971. ? 'max-w-full'
  14972. : 'max-w-7xl'}"
  14973. >
  14974. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  14975. {@html text}
  14976. </article>
  14977. ================================================
  14978. FILE: docs/site/src/routes/guide/Create.svelte
  14979. ================================================
  14980. <script>
  14981. import { mdTextToHljs, groupIconMdPlugin } from '../../utils/index.js';
  14982. import { isWideScreenStore } from '../../store.js';
  14983. // @ts-ignore
  14984. import createText from '../../../../../../packages/create-stdf/README_CN.md';
  14985. // @ts-ignore
  14986. import createText_en from '../../../../../../packages/create-stdf/README.md';
  14987. const isZh = localStorage.getItem('lang') === 'zh_CN';
  14988. const text = groupIconMdPlugin(
  14989. (isZh ? mdTextToHljs(createText) : mdTextToHljs(createText_en)).replace(/<a href="/g, '<a target="_blank" href="')
  14990. );
  14991. </script>
  14992. <article
  14993. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark pb-12 {$isWideScreenStore
  14994. ? 'max-w-full'
  14995. : 'max-w-5xl'}"
  14996. >
  14997. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  14998. {@html text}
  14999. </article>
  15000. ================================================
  15001. FILE: docs/site/src/routes/guide/about/+page.svelte
  15002. ================================================
  15003. <script lang="ts">
  15004. import { mdTextToHljs } from '../../../utils/index';
  15005. import { isWideScreenStore } from '../../../store';
  15006. // @ts-ignore
  15007. import text from '../../../../../mds/guide/about.md';
  15008. // @ts-ignore
  15009. import text_en from '../../../../../mds/guide/about_en.md';
  15010. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15011. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15012. </script>
  15013. <article
  15014. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15015. ? 'max-w-full'
  15016. : 'max-w-7xl'}"
  15017. >
  15018. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15019. {@html hljsText}
  15020. </article>
  15021. ================================================
  15022. FILE: docs/site/src/routes/guide/changelog/+page.svelte
  15023. ================================================
  15024. <script lang="ts">
  15025. import { mdTextToHljs } from '../../../utils/index';
  15026. import { isWideScreenStore } from '../../../store';
  15027. // @ts-ignore
  15028. import text from '../../../../../mds/guide/changelog.md';
  15029. // @ts-ignore
  15030. import text_en from '../../../../../mds/guide/changelog_en.md';
  15031. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15032. //提取字符中以‘[!tag’开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  15033. const getTags = (str: string) => str.match(/\[!tag[^\]]+\]/g);
  15034. //提取字符中以‘[!issue‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  15035. const getIssues = (str: string) => str.match(/\[!issue[^\]]+\]/g);
  15036. //提取字符中以‘[!contribute‘开头且以‘]’结尾的所有字符串,组成数组,并返回数组
  15037. const getContributes = (str: string) => str.match(/\[!contribute[^\]]+\]/g);
  15038. const spanTextFun = (type: 'A' | 'B' | 'O', index: '1' | '2' | '3') => {
  15039. const typeMap = { A: '💪', O: '👌' };
  15040. const indexMap = { '1': '👊', '2': '✊', '3': '👎' };
  15041. if (type === 'O' || type === 'A') {
  15042. return typeMap[type];
  15043. } else {
  15044. return indexMap[index];
  15045. }
  15046. };
  15047. //替换 Markdown 中的标签
  15048. const mdTextToHljsFun = (string: string) => {
  15049. //替换 tag
  15050. const tagList = getTags(string);
  15051. if (tagList) {
  15052. tagList.forEach((item) => {
  15053. const arr: string[] = item.split('|');
  15054. const span = `<span class="mr-1">${spanTextFun(arr[1] as 'A' | 'B' | 'O', arr[2] as '1' | '2' | '3')}</span>`;
  15055. string = string.replace(item, span);
  15056. });
  15057. }
  15058. //替换 issue
  15059. const issueList = getIssues(string);
  15060. if (issueList) {
  15061. issueList.forEach((item) => {
  15062. const arr = item.split('|');
  15063. const span = `<span><a href="https://github.com/${
  15064. arr[1]
  15065. }" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
  15066. arr[1]
  15067. }" title="${isZh ? '感谢' : 'Thanks '} ${arr[1]} ${isZh ? '提出 Issue' : 'raise an Issue'}" alt=""></a></span>`;
  15068. string = string.replace(item, span);
  15069. });
  15070. }
  15071. //替换 contribute
  15072. const contributeList = getContributes(string);
  15073. if (contributeList) {
  15074. contributeList.forEach((item) => {
  15075. const arr = item.split('|');
  15076. const span = `<span><a href="https://github.com/${
  15077. arr[1]
  15078. }" target="_blank"><img class="w-4 h-4 ml-1 p-0 m-0 rounded-full overflow-hidden inline" src="https://avatars.githubusercontent.com/${
  15079. arr[1]
  15080. }" title="${isZh ? '感谢' : 'Thanks '} ${arr[1]} ${isZh ? '贡献代码' : 'contribute code'}" alt=""></a></span>`;
  15081. string = string.replace(item, span);
  15082. });
  15083. }
  15084. return string;
  15085. };
  15086. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15087. </script>
  15088. <article
  15089. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 text-xs {$isWideScreenStore
  15090. ? 'max-w-full'
  15091. : 'max-w-7xl'}"
  15092. >
  15093. <p class="mb-4 text-xs text-black/40 dark:text-white/30">
  15094. {isZh
  15095. ? '注:此处仅展示站点更新说明或总体概述,具体组件更新内容请查看组件内部更新日志。描述后面的头像表示此项的提出者或贡献者,感谢他们。发布时间格式均为 GMT+8。'
  15096. : 'Note: Only the site update instructions or general overview are displayed here. For the specific component update content, please refer to the update log inside the component. The avatars after the description represent the submitter or contributor, thank them for their contribution. The release time format is GMT+8.'}
  15097. </p>
  15098. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15099. {@html mdTextToHljsFun(hljsText)}
  15100. </article>
  15101. ================================================
  15102. FILE: docs/site/src/routes/guide/color/+page.svelte
  15103. ================================================
  15104. <script lang="ts">
  15105. import Color from './Color.svelte';
  15106. </script>
  15107. <Color />
  15108. ================================================
  15109. FILE: docs/site/src/routes/guide/color/Color.svelte
  15110. ================================================
  15111. <script lang="ts">
  15112. import { onMount, onDestroy } from 'svelte';
  15113. import ColorCard from '$lib/colorCard/ColorCard.svelte';
  15114. import ModeSwitch from '$lib/modeSwitch/ModeSwitch.svelte';
  15115. import ThemeSwitch from '$lib/themeSwitch/ThemeSwitch.svelte';
  15116. import themes from '../../../data/themes';
  15117. import { currentColorStore, isWideScreenStore } from '../../../store';
  15118. import { colorConvertFunc, colorObjToArr, getOklchOpacity } from '../../../utils';
  15119. import hljs from 'highlight.js';
  15120. import { type ThemeProps, type PrimaryAndDarkColor } from 'stdf/theme';
  15121. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15122. const colorGrayList = [
  15123. { key: 'gray-50', color: 'oklch(0.961 0 0)' },
  15124. { key: 'gray-100', color: 'oklch(0.925 0 0)' },
  15125. { key: 'gray-200', color: 'oklch(0.845 0 0)' },
  15126. { key: 'gray-300', color: 'oklch(0.767 0 0)' },
  15127. { key: 'gray-400', color: 'oklch(0.683 0 0)' },
  15128. { key: 'gray-500', color: 'oklch(0.6 0 0)' },
  15129. { key: 'gray-600', color: 'oklch(0.51 0 0)' },
  15130. { key: 'gray-700', color: 'oklch(0.42 0 0)' },
  15131. { key: 'gray-800', color: 'oklch(0.321 0 0)' },
  15132. { key: 'gray-900', color: 'oklch(0.218 0 0)' },
  15133. { key: 'gray-950', color: 'oklch(0.159 0 0)' }
  15134. ];
  15135. onMount(() => hljs.highlightAll());
  15136. let currentColorObj: ThemeProps | undefined = undefined;
  15137. let primaryColors: PrimaryAndDarkColor | undefined = $state(undefined);
  15138. // primaryColors 转为数组,且 default 在第 6 项
  15139. let primaryColorsList = $derived(colorObjToArr(primaryColors ?? {}));
  15140. let darkColors: PrimaryAndDarkColor | undefined = $state(undefined);
  15141. let darkColorsList = $derived(colorObjToArr(darkColors ?? {}));
  15142. let themeBlack: { primary: string; dark: string } | undefined = $state(undefined);
  15143. let themeWhite: { primary: string; dark: string } | undefined = $state(undefined);
  15144. let stateColor: { success: string; warning: string; error: string; info: string } | undefined = $state(undefined);
  15145. let extendList: { color: string; alias: string }[] | undefined = $state(undefined);
  15146. const unsubscribe = currentColorStore.subscribe((value) => {
  15147. // 根据 $currentColorStore 从 themes 中获取对应的颜色对象
  15148. currentColorObj = themes.find((item) => item.name === value)?.theme;
  15149. // 传入数组,按照 Tailwind 规则生成颜色列表
  15150. const createTWColorFunc = (colorList: string[]) => {
  15151. if (colorList.length !== 11) {
  15152. console.error('颜色列表长度必须为 11');
  15153. return;
  15154. }
  15155. const colorArr: { n: number; hex: string; rgb: string; hsl: string }[] = [];
  15156. colorList.forEach((item, index) => {
  15157. // 第 0 项和最后一项的 key 为 50 和 950,其他项为 100-900,颜色有 hex、rgb、hsl 三种格式,注意 hsl 保留整数
  15158. let colorObj: { n: number; hex: string; rgb: string; hsl: string; oklch: string } = {
  15159. n: 0,
  15160. hex: '',
  15161. rgb: '',
  15162. hsl: '',
  15163. oklch: ''
  15164. };
  15165. if (index === 0) {
  15166. colorObj = {
  15167. n: 50,
  15168. hex: item,
  15169. rgb: colorConvertFunc(item).rgb,
  15170. hsl: colorConvertFunc(item).hsl,
  15171. oklch: colorConvertFunc(item).oklch
  15172. };
  15173. } else if (index === 10) {
  15174. colorObj = {
  15175. n: 950,
  15176. hex: item,
  15177. rgb: colorConvertFunc(item).rgb,
  15178. hsl: colorConvertFunc(item).hsl,
  15179. oklch: colorConvertFunc(item).oklch
  15180. };
  15181. } else {
  15182. colorObj = {
  15183. n: 100 * index,
  15184. hex: item,
  15185. rgb: colorConvertFunc(item).rgb,
  15186. hsl: colorConvertFunc(item).hsl,
  15187. oklch: colorConvertFunc(item).oklch
  15188. };
  15189. }
  15190. colorArr.push(colorObj);
  15191. });
  15192. return colorArr;
  15193. };
  15194. if (!currentColorObj) return;
  15195. primaryColors = currentColorObj.color.primary;
  15196. darkColors = currentColorObj.color.dark;
  15197. // 根据主题色生成主题黑和白
  15198. themeBlack = { primary: currentColorObj.color.primaryBlack, dark: currentColorObj.color.darkBlack };
  15199. themeWhite = { primary: currentColorObj.color.primaryWhite, dark: currentColorObj.color.darkWhite };
  15200. stateColor = currentColorObj.color.functional;
  15201. extendList = currentColorObj.color.extend;
  15202. });
  15203. // svelte 组件销毁时取消订阅
  15204. onDestroy(() => {
  15205. unsubscribe();
  15206. });
  15207. // 传入 rgb(0, 98, 57) 这种格式与透明度,返回 rgba(0, 98, 57, 0.1) 这种格式
  15208. const rgbaFunc = (str = '#000', n = 0.1) => {
  15209. const arr = str.split(',');
  15210. const r = arr[0].split('(')[1];
  15211. const g = arr[1];
  15212. const b = arr[2].split(')')[0];
  15213. return `rgba(${r}, ${g}, ${b}, ${n / 10})`;
  15214. };
  15215. // 传入 hsl(157, 100%, 15%) 这种格式与透明度,返回 hsla(157, 100%, 15%, 0.1) 这种格式
  15216. const hslaFunc = (str = 'hsl(157, 100%, 15%)', n = 0.1) => {
  15217. const arr = str.split(',');
  15218. const h = arr[0].split('(')[1];
  15219. const s = arr[1];
  15220. const l = arr[2].split(')')[0];
  15221. return `hsla(${h}, ${s}, ${l}, ${n / 10})`;
  15222. };
  15223. </script>
  15224. <article
  15225. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15226. ? 'max-w-full'
  15227. : 'max-w-7xl'}"
  15228. >
  15229. <blockquote>
  15230. {isZh
  15231. ? 'STDF 跟随 Tailwind CSS v4 推荐使用 oklch 颜色模式。'
  15232. : 'STDF follows Tailwind CSS v4 recommendation to use the oklch color mode.'}
  15233. </blockquote>
  15234. <div class="mb-4 text-xs">
  15235. {#if isZh}
  15236. 切换亮暗模式,选择下列内置主题可查看配色。到<a href="/guide/generator" target="_blank">主题生成器</a
  15237. >可快速配置颜色系统并生成配置文件。具体使用方法请参考<a href="/guide/theme" target="_blank">主题配置</a>。
  15238. {:else}
  15239. Switch the light and dark mode, select the built-in theme to view the color. To <a href="/guide/generator" target="_blank"
  15240. >Theme Generator</a
  15241. >
  15242. quickly configure the color system and generate the configuration file. For specific usage methods, please refer to
  15243. <a href="/guide/theme" target="_blank">Theme Configuration</a>.
  15244. {/if}
  15245. </div>
  15246. <div class="inline-flex items-center gap-4">
  15247. <ModeSwitch />
  15248. </div>
  15249. <div class="flex items-center gap-4">
  15250. <ThemeSwitch />
  15251. </div>
  15252. <h2>{isZh ? '概述' : 'Overview'}</h2>
  15253. <p>
  15254. {isZh
  15255. ? '使用合理的颜色系统,可以使整个应用配色更加统一和美观。借助 Tailwind 的配置,可以更加方便地实现这一功能,当然也包括暗模式。'
  15256. : "Use a reasonable color system to make the entire application more unified and beautiful. With Tailwind's configuration, this function can be implemented more conveniently, including the dark mode."}
  15257. </p>
  15258. {#if isZh}
  15259. <p>
  15260. STDF 颜色系统包含主题色、功能色、中性色、扩展色四个部分。其中<strong>主题色和功能色是必须的</strong
  15261. >;中性色一般使用默认配置即可;扩展色,也叫辅助色或装饰色,非必需,可根据实际情况自行添加。你可能需要根据你的应用修改成自己的颜色系统。
  15262. </p>
  15263. {:else}
  15264. <p>
  15265. STDF color system includes four parts: theme color, functional color, neutral color, and extended color. Among them, <strong
  15266. >theme color and functional color are required</strong
  15267. >;neutral color generally uses the default configuration; extended color, also called auxiliary color or decorative color, is not
  15268. required, and can be added according to actual circumstances. You may need to modify it to your own color system according to your
  15269. application.
  15270. </p>
  15271. {/if}
  15272. <blockquote>
  15273. {isZh
  15274. ? '颜色有别于技术,是一种主观、感性、难量化的事物,所以颜色的搭配没有好坏之分,只有适合不适合。'
  15275. : 'Color is different from technology, it is a subjective, emotional, and difficult to quantify thing, so there is no good or bad in color combination, only whether it is suitable or not.'}
  15276. </blockquote>
  15277. <h2>{isZh ? '主题色' : 'Theme Color'}</h2>
  15278. <p>
  15279. {isZh
  15280. ? '主题色是应用中最核心、最高频使用的颜色,它可能用于任何地方,比如强调信息、引导操作,并在很大程度上决定了应用整体的颜色基调和配色风格。'
  15281. : 'Theme color is the most core and frequently used color in the application. It may be used anywhere, such as emphasizing information, guiding operations, and largely determining the color tone and color scheme of the application.'}
  15282. </p>
  15283. {#if isZh}
  15284. <p>
  15285. 一般情况,会使用区别于主色的另一种颜色适配暗模式,一种做法是不改变色相,只是将主色变浅提亮使其突出显现在暗背景下;另一种做法是完全取另一种色相,STDF
  15286. 推荐使用后者,以便暗模式下的主色更加明显。所以 STDF
  15287. 内置的主题色分为亮暗模式。当然,如果你需要将亮暗模式都设置为相同色相也是可以的,STDF 提供的<a href="/guide/generator" target="_blank">
  15288. 主题生成器
  15289. </a>支持随意配置。
  15290. </p>
  15291. {:else}
  15292. <p>
  15293. Generally, a different color from the main color is used to adapt to the dark mode. One approach is to keep the same hue but make the
  15294. main color lighter to stand out in the dark background; the other approach is to completely take another hue, STDF recommends the
  15295. latter, so that the main color in the dark mode is more obvious. Therefore, STDF provides two sets of theme colors: one for the light
  15296. mode and one for the dark mode. Of course, if you need to set both the light and dark modes to the same hue, the <a
  15297. href="/guide/generator"
  15298. target="_blank">Theme Generator</a
  15299. > supports arbitrary configuration.
  15300. </p>
  15301. {/if}
  15302. <div class="justify-between md:flex md:space-x-8">
  15303. <div class="flex h-32 flex-1 flex-col justify-between rounded-sm p-4 text-white" style="background-color: {primaryColors?.default};">
  15304. <div class="text-xl font-bold">{isZh ? 'primary(亮模式)' : 'primary (Light Mode)'}</div>
  15305. <div>{primaryColors?.default}</div>
  15306. </div>
  15307. <div
  15308. class="mt-4 flex h-32 flex-1 flex-col justify-between rounded-sm p-4 text-black md:mt-0"
  15309. style="background-color: {darkColors?.default};"
  15310. >
  15311. <div class="text-xl font-bold">{isZh ? 'dark(暗模式)' : 'dark (Dark Mode)'}</div>
  15312. <div>{darkColors?.default}</div>
  15313. </div>
  15314. </div>
  15315. <h3>{isZh ? '梯度色板' : 'Gradient Color Palette'}</h3>
  15316. {#if isZh}
  15317. <p>
  15318. Tailwind 内置了一套 <a href="https://tailwindcss.com/docs/customizing-colors" target="_blank">调色板</a
  15319. >,但这并不能满足自定义的主题色,STDF 参照 Tailwind 的调色板命名规则,使用一套内置算法动态地将主题色计算出 11 种颜色组成梯度色板。其中
  15320. 600 号色作为默认颜色【省略 600 编号】,实际业务中使用淡颜色的场景会多一些,故淡颜色会多一些选择。
  15321. </p>
  15322. {:else}
  15323. <p>
  15324. Tailwind provides a <a href="https://tailwindcss.com/docs/customizing-colors" target="_blank">color palette</a>, but it cannot meet
  15325. the custom theme color, STDF refers to Tailwind's color palette naming rules and uses a set of built-in algorithms to calculate the
  15326. theme color into 11 colors to form a gradient color palette. The 600th color is the default color [omitting the 600 number], and in
  15327. actual business, the scene of using light colors is more common, so there are more choices for light colors.
  15328. </p>
  15329. {/if}
  15330. <div class="justify-between space-y-8 md:flex md:space-x-8 md:space-y-0">
  15331. <div class="flex flex-1 flex-col justify-between rounded-sm bg-white text-sm">
  15332. {#each primaryColorsList as item, index}
  15333. <div
  15334. class="p-4 transition hover:scale-105 hover:rounded-sm {index >= 6 ? 'text-white' : 'text-black'}"
  15335. style="background-color: {item.value};"
  15336. >
  15337. <div class="flex items-center justify-between">
  15338. <div class="flex-1 text-left font-bold">primary{index === 6 ? '' : `-${item.key}`}</div>
  15339. <div class="text-right">
  15340. <div>{item.value}</div>
  15341. </div>
  15342. </div>
  15343. </div>
  15344. {/each}
  15345. </div>
  15346. <div class="flex flex-1 flex-col justify-between rounded-sm bg-white text-sm">
  15347. {#each darkColorsList as item, index}
  15348. <div
  15349. class="p-4 transition hover:scale-105 hover:rounded-sm {index >= 7 ? 'text-white' : 'text-black'}"
  15350. style="background-color: {item.value};"
  15351. >
  15352. <div class="flex items-center justify-between">
  15353. <div class="flex-1 text-left font-bold">dark{index === 6 ? '' : `-${item.key}`}</div>
  15354. <div class="text-right">
  15355. <div>{item.value}</div>
  15356. </div>
  15357. </div>
  15358. </div>
  15359. {/each}
  15360. </div>
  15361. </div>
  15362. <h3>{isZh ? '透明度' : 'Opacity'}</h3>
  15363. <p>
  15364. {isZh
  15365. ? '某些应用场景中,需要使用到主题色的透明度。注意这与上述梯度色板的差异。'
  15366. : 'In some application scenarios, you need to use the opacity of the theme color. Note the difference from the above gradient color palette.'}
  15367. </p>
  15368. <div class="transparent-background justify-between space-y-8 md:flex md:space-x-8 md:space-y-0">
  15369. <div class="flex flex-1 flex-col justify-between rounded-sm text-black">
  15370. {#each [0.05, 0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.9, 0.95] as color}
  15371. <div
  15372. class="p-2 transition hover:scale-105 hover:rounded-sm"
  15373. style="background-color: {getOklchOpacity(primaryColors?.default ?? '', color)};"
  15374. >
  15375. <div class="flex items-center justify-between text-sm">
  15376. <div class="rounded-sm bg-white px-2 py-1">primary/{color * 100}</div>
  15377. <div class="rounded-sm bg-white px-2 py-1 text-right">
  15378. <div>{getOklchOpacity(primaryColors?.default ?? '', color)}</div>
  15379. </div>
  15380. </div>
  15381. </div>
  15382. {/each}
  15383. </div>
  15384. <div class="flex flex-1 flex-col justify-between rounded-sm text-black">
  15385. {#each [0.05, 0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.9, 0.95] as color}
  15386. <div
  15387. class="p-2 transition hover:scale-105 hover:rounded-sm"
  15388. style="background-color: {getOklchOpacity(darkColors?.default ?? '', color)};"
  15389. >
  15390. <div class="flex items-center justify-between text-sm">
  15391. <div class="rounded-sm bg-white px-2 py-1">dark/{color * 100}</div>
  15392. <div class="rounded-sm bg-white px-2 py-1 text-right">
  15393. <div>{getOklchOpacity(darkColors?.default ?? '', color)}</div>
  15394. </div>
  15395. </div>
  15396. </div>
  15397. {/each}
  15398. </div>
  15399. </div>
  15400. <h3>{isZh ? '主题黑白色' : 'Theme Black and White'}</h3>
  15401. <p>
  15402. {isZh
  15403. ? '通常情况下,设计中应避免大面积使用纯黑色 oklch(0 0 0),使用接近纯黑的颜色。同时 STDF 会根据算法计算出两个接近纯黑但是带有主题色的黑色,方便设计搭配。同样也会计算出两个接近纯白但是带有主题色的白色。一般可用于多套主题搭配时的文字颜色,亮暗背景颜色等场景。'
  15404. : 'In most cases, designers should avoid using pure black oklch(0 0 0) on a large scale, and use a color close to pure black. At the same time, STDF will calculate two black colors close to pure black but with a theme color for design. Similarly, it will calculate two white colors close to pure white but with a theme color. Generally, it can be used in the text color of multiple theme combinations, the light and dark background color, etc.'}
  15405. </p>
  15406. <div class="flex-wrap justify-around space-y-4 md:flex md:space-x-4 md:space-y-0">
  15407. {#each [themeBlack?.primary, themeBlack?.dark, themeWhite?.primary, themeWhite?.dark] as item, i}
  15408. <div
  15409. class="flex h-24 flex-1 flex-col justify-between rounded-sm border p-2 {i === 0 || i === 1
  15410. ? 'border-gray-700 text-white'
  15411. : 'border-gray-300 text-black'}"
  15412. style="background-color: {item};"
  15413. >
  15414. <div class="font-bold">
  15415. {i === 0 ? 'primaryBlack' : i === 1 ? 'darkBlack' : i === 2 ? 'primaryWhite' : 'darkWhite'}
  15416. </div>
  15417. <div class="text-sm">{item}</div>
  15418. </div>
  15419. {/each}
  15420. </div>
  15421. <h2>{isZh ? '功能色' : 'Functional Color'}</h2>
  15422. <p>
  15423. {isZh
  15424. ? '功能色是指用于特定场景、特定状态等特殊语义的颜色,通常包含成功、警告、错误、信息四种。当然也都支持类似主题色的透明度写法。'
  15425. : 'Functional color is a color used for specific scenarios, specific states, etc. It usually includes four types: success, warning, error, and information. Of course, it also supports the transparent writing method similar to the theme color.'}
  15426. </p>
  15427. <div class="flex-wrap justify-around space-y-4 md:flex md:space-x-4 md:space-y-0">
  15428. {#each [stateColor?.success, stateColor?.warning, stateColor?.error, stateColor?.info] as item, i}
  15429. <div class="flex h-24 flex-1 flex-col justify-between rounded-sm p-2 text-white" style="background-color: {item};">
  15430. <div class="font-bold">{i === 0 ? 'success' : i === 1 ? 'warning' : i === 2 ? 'error' : 'info'}</div>
  15431. <div class="text-sm">{item}</div>
  15432. </div>
  15433. {/each}
  15434. </div>
  15435. <h2>{isZh ? '中性色' : 'Neutral Color'}</h2>
  15436. <p>
  15437. {isZh
  15438. ? '中性色包含一系列带透明度的黑白色和不同程度的灰色,用于配置亮色与暗模式不同背景、文字、分割线等颜色。'
  15439. : 'Neutral color includes a series of black and white colors with different degrees of transparency and different degrees of gray, used to configure different background, text, and split line colors in the light and dark modes.'}
  15440. </p>
  15441. <p class="text-xs">
  15442. {isZh
  15443. ? '注:当下层为纯色时,带透明度的黑白色与灰色可能看起来一样但实际不一样,请注意区分使用。虽然灰色也可以使用透明度,但是需要透明度的地方一般通过黑白色配合透明度值使用。'
  15444. : 'Note: When the lower layer is a pure color, the black and white colors with transparency may look the same but are actually different, please pay attention to the difference in use. Although gray can also use transparency, but the places that need transparency usually use the black and white colors with transparency.'}
  15445. </p>
  15446. <div class="justify-between space-y-8 text-black md:flex md:space-x-8 md:space-y-0">
  15447. <div class="transparent-background flex flex-1 flex-col justify-between rounded-sm text-sm">
  15448. {#each [0.5, 1, 2, 2.5, 3, 4, 5, 6, 7, 7.5, 8, 9, 9.5] as color}
  15449. <div class="p-2 transition hover:scale-105 hover:rounded-sm" style="background-color: oklch(0 0 0 / {color / 10});">
  15450. <div class="flex items-center justify-between">
  15451. <div class="rounded-sm bg-white px-2 py-1 text-left">
  15452. black{`/${color * 10}`}
  15453. </div>
  15454. <div class="rounded-sm bg-white px-2 py-1">
  15455. <div class="flex-1 text-right">oklch(0 0 0 / {color / 10})</div>
  15456. </div>
  15457. </div>
  15458. </div>
  15459. {/each}
  15460. <div class="p-2 transition hover:scale-105 hover:rounded-sm" style="background-color: oklch(0 0 0);">
  15461. <div class="flex items-center justify-between">
  15462. <div class="rounded-sm bg-white px-2 py-1 text-left">black</div>
  15463. <div class="rounded-sm bg-white px-2 py-1">
  15464. <div class="flex-1 text-right">oklch(0 0 0)</div>
  15465. </div>
  15466. </div>
  15467. </div>
  15468. </div>
  15469. <div class="transparent-background flex flex-1 flex-col justify-between rounded text-sm">
  15470. {#each [0.5, 1, 2, 2.5, 3, 4, 5, 6, 7, 7.5, 8, 9, 9.5] as color}
  15471. <div class="p-2 transition hover:scale-105 hover:rounded-sm" style="background-color: oklch(1 0 0 / {color / 10});">
  15472. <div class="flex items-center justify-between">
  15473. <div class="rounded-sm bg-white px-2 py-1 text-left">
  15474. white{`/${color * 10}`}
  15475. </div>
  15476. <div class="rounded-sm bg-white px-2 py-1">
  15477. <div class="flex-1 text-right">oklch(1 0 0 / {color / 10})</div>
  15478. </div>
  15479. </div>
  15480. </div>
  15481. {/each}
  15482. <div class="p-2 transition hover:scale-105 hover:rounded-sm" style="background-color: oklch(1 0 0);">
  15483. <div class="flex items-center justify-between">
  15484. <div class="rounded-sm bg-white px-2 py-1 text-left">white</div>
  15485. <div class="rounded-sm bg-white px-2 py-1">
  15486. <div class="flex-1 text-right">oklch(1 0 0)</div>
  15487. </div>
  15488. </div>
  15489. </div>
  15490. </div>
  15491. <div class="flex flex-1 flex-col justify-between rounded-sm">
  15492. <ColorCard colorList={colorGrayList} />
  15493. </div>
  15494. </div>
  15495. <h2>{isZh ? '扩展色' : 'Extended Color'}</h2>
  15496. {#if isZh}
  15497. <p>
  15498. 扩展色是一些区分功能色与主题色的非必需装饰性颜色,主要是在需要多个颜色搭配的界面时使用。统一配置可以使全局搭配颜色更加协调,通过
  15499. Tailwind 配置之后写起来也更加方便。数量不限,使用方式不限,使用规则不限。但请注意使用<strong
  15500. >多主题时,不同主题的扩展色数量应保持一致。</strong
  15501. >STDF 内置主题都提供了三种扩展色,请根据你的实际配色方案搭配。当然也都支持类似主题色的透明度写法。
  15502. </p>
  15503. <p>
  15504. 写扩展色类名时使用 extend0、extend1...
  15505. 这种方式不方便记忆,推荐使用颜色的别名。别名的命名规则不限,如颜色名称、品牌、情绪、场景、编号、关联事物......皆可。如下面的
  15506. extend0、extend1、extend2 分别对应当前主题【{themes.find((item) => item.name === $currentColorStore)?.name_CN}】的三个扩展色。STDF
  15507. 提供的<a href="/guide/generator" target="_blank"> 主题生成器 </a>也支持配置别名。
  15508. </p>
  15509. {:else}
  15510. <p>
  15511. Extended color is some non-essential decorative colors that are not required to distinguish between functional colors and theme
  15512. colors. Mainly used in interfaces that need multiple color combinations. Unifying the configuration can make the global color more
  15513. harmonious, and writing it is also more convenient after Tailwind configuration. The number is unlimited, the usage is unlimited, and
  15514. the usage rules are unlimited. But please note that when using multiple themes, the number of extended colors in different themes
  15515. should be kept consistent. STDF provides three extended colors for the built-in themes, please match according to your actual color
  15516. scheme. Of course, it also supports the transparent writing method similar to the theme color.
  15517. </p>
  15518. <p>
  15519. When writing the class name of the extended color, use extend0, extend1..., this method is not convenient to remember, it is
  15520. recommended to use the alias of the color. The naming rules of the alias are unlimited, such as the color name, brand, emotion, scene,
  15521. number, related things... Such as the following extend0, extend1, extend2, which correspond to the three extended colors of the
  15522. current theme [{themes.find((item) => item.name === $currentColorStore)?.name}]. STDF's
  15523. <a href="/guide/generator" target="_blank">Theme Generator</a> also supports configuration aliases.
  15524. </p>
  15525. {/if}
  15526. <div class="flex-wrap justify-around space-y-4 md:flex md:space-x-4 md:space-y-0">
  15527. {#each extendList ?? [] as extend}
  15528. <div class="flex h-24 flex-1 flex-col justify-between rounded-sm p-2 text-white" style="background-color: {extend.color};">
  15529. <div class="font-bold">{extend.alias}</div>
  15530. <div>{extend.color}</div>
  15531. </div>
  15532. {/each}
  15533. </div>
  15534. </article>
  15535. ================================================
  15536. FILE: docs/site/src/routes/guide/compatibility/+page.svelte
  15537. ================================================
  15538. <script lang="ts">
  15539. import { mdTextToHljs } from '../../../utils/index';
  15540. import { isWideScreenStore } from '../../../store';
  15541. // @ts-ignore
  15542. import text from '../../../../../mds/guide/compatibility.md';
  15543. // @ts-ignore
  15544. import text_en from '../../../../../mds/guide/compatibility_en.md';
  15545. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15546. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15547. </script>
  15548. <article
  15549. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15550. ? 'max-w-full'
  15551. : 'max-w-7xl'}"
  15552. >
  15553. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15554. {@html hljsText}
  15555. </article>
  15556. ================================================
  15557. FILE: docs/site/src/routes/guide/contribution/+page.svelte
  15558. ================================================
  15559. <script lang="ts">
  15560. import { mdTextToHljs, groupIconMdPlugin } from '../../../utils/index';
  15561. import { isWideScreenStore } from '../../../store';
  15562. // @ts-ignore
  15563. import text from '../../../../../mds/guide/contribution.md';
  15564. // @ts-ignore
  15565. import text_en from '../../../../../mds/guide/contribution_en.md';
  15566. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15567. const hljsText = groupIconMdPlugin(mdTextToHljs(isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15568. </script>
  15569. <article
  15570. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15571. ? 'max-w-full'
  15572. : 'max-w-7xl'}"
  15573. >
  15574. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15575. {@html hljsText}
  15576. </article>
  15577. ================================================
  15578. FILE: docs/site/src/routes/guide/create/+page.svelte
  15579. ================================================
  15580. <script lang="ts">
  15581. import { mdTextToHljs, groupIconMdPlugin } from '../../../utils/index';
  15582. import { isWideScreenStore } from '../../../store';
  15583. // @ts-ignore
  15584. import createText from '../../../../../../packages/create-stdf/README_CN.md';
  15585. // @ts-ignore
  15586. import createText_en from '../../../../../../packages/create-stdf/README.md';
  15587. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15588. const text = groupIconMdPlugin(
  15589. (isZh ? mdTextToHljs(createText) : mdTextToHljs(createText_en)).replace(/<a href="/g, '<a target="_blank" href="')
  15590. );
  15591. </script>
  15592. <article
  15593. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15594. ? 'max-w-full'
  15595. : 'max-w-7xl'}"
  15596. >
  15597. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15598. {@html text}
  15599. </article>
  15600. ================================================
  15601. FILE: docs/site/src/routes/guide/faq/+page.svelte
  15602. ================================================
  15603. <script lang="ts">
  15604. import { mdTextToHljs } from '../../../utils/index';
  15605. import { isWideScreenStore } from '../../../store';
  15606. // @ts-ignore
  15607. import text from '../../../../../mds/guide/faq.md';
  15608. // @ts-ignore
  15609. import text_en from '../../../../../mds/guide/faq_en.md';
  15610. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15611. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15612. </script>
  15613. <article
  15614. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15615. ? 'max-w-full'
  15616. : 'max-w-7xl'}"
  15617. >
  15618. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15619. {@html hljsText}
  15620. </article>
  15621. ================================================
  15622. FILE: docs/site/src/routes/guide/future/+page.svelte
  15623. ================================================
  15624. <script lang="ts">
  15625. import { mdTextToHljs } from '../../../utils/index';
  15626. import { isWideScreenStore } from '../../../store';
  15627. // @ts-ignore
  15628. import text from '../../../../../mds/guide/future.md';
  15629. // @ts-ignore
  15630. import text_en from '../../../../../mds/guide/future_en.md';
  15631. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15632. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  15633. </script>
  15634. <article
  15635. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  15636. ? 'max-w-full'
  15637. : 'max-w-7xl'}"
  15638. >
  15639. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  15640. {@html hljsText}
  15641. </article>
  15642. ================================================
  15643. FILE: docs/site/src/routes/guide/generator/+page.svelte
  15644. ================================================
  15645. <script lang="ts">
  15646. import { onDestroy, onMount } from 'svelte';
  15647. import { fly } from 'svelte/transition';
  15648. import ClipboardJS from 'clipboard';
  15649. import ModeSwitch from '$lib/modeSwitch/ModeSwitch.svelte';
  15650. import { currentColorStore } from '../../../store';
  15651. import themes from '../../../data/themes';
  15652. import type { STDFTheme } from 'stdf/theme';
  15653. import {
  15654. generatePalette,
  15655. generateThemeBlack,
  15656. generateThemeWhite,
  15657. colorConvertFunc,
  15658. throttle,
  15659. hexToRgb,
  15660. getOklchFunc,
  15661. getHexFunc
  15662. } from '../../../utils';
  15663. import colorList from '../../../data/color';
  15664. import GeneratorPreview from './GeneratorPreview.svelte';
  15665. import hljs from 'highlight.js';
  15666. const isZh = localStorage.getItem('lang') === 'zh_CN';
  15667. let showTip = $state(true);
  15668. let windowWidth = $state(0);
  15669. let windowHeight = $state(0);
  15670. const initTheme = themes.find((item) => item.name === $currentColorStore) as ThemeItem;
  15671. type ThemeItem = {
  15672. name: string;
  15673. name_CN: string;
  15674. theme: typeof STDFTheme;
  15675. };
  15676. const setPropertyFunc = (name: string, value: string) => {
  15677. const rgbStr = value.startsWith('oklch') ? value : hexToRgb(value);
  15678. document.documentElement.style.setProperty(name, rgbStr);
  15679. };
  15680. // 使用 extendList 返回 extendListStr
  15681. const extendListStrFunc = (extendList: { color: string; alias: string }[]) => {
  15682. let extendListStr = ' {';
  15683. extendList.forEach((item) => {
  15684. extendListStr += `
  15685. color: '${colorConvertFunc(item.color).oklch}', // ${item.color} ${colorConvertFunc(item.color).hsl}
  15686. alias: "${item.alias}",
  15687. },`;
  15688. extendListStr += `
  15689. {`;
  15690. });
  15691. // 如果 extendListStr 最后一个是换行符,则删除换行
  15692. extendListStr = extendListStr.slice(0, extendListStr.lastIndexOf('\n'));
  15693. return extendListStr;
  15694. };
  15695. // 使用 extendList 返回 extendListStr2
  15696. const extendListStrFunc2 = (extendList: { color: string; alias: string }[]) => {
  15697. let extendListStr = '';
  15698. extendList.forEach((item, index) => {
  15699. extendListStr += ` --color-extend${index}: ${getOklchFunc(item.color)};
  15700. --color-${item.alias}: ${getOklchFunc(item.color)};
  15701. `;
  15702. });
  15703. // 如果 extendListStr 最后一个是换行符,则删除换行
  15704. extendListStr = extendListStr.slice(0, extendListStr.lastIndexOf('\n'));
  15705. return extendListStr;
  15706. };
  15707. const numbers = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
  15708. let colors = $state([
  15709. { type: 'primary', color: initTheme.theme.color.primary.default, hex: getHexFunc(initTheme.theme.color.primary.default) },
  15710. { type: 'dark', color: initTheme.theme.color.dark.default, hex: getHexFunc(initTheme.theme.color.dark.default) },
  15711. { type: 'success', color: initTheme.theme.color.functional.success, hex: getHexFunc(initTheme.theme.color.functional.success) },
  15712. { type: 'warning', color: initTheme.theme.color.functional.warning, hex: getHexFunc(initTheme.theme.color.functional.warning) },
  15713. { type: 'error', color: initTheme.theme.color.functional.error, hex: getHexFunc(initTheme.theme.color.functional.error) },
  15714. { type: 'info', color: initTheme.theme.color.functional.info, hex: getHexFunc(initTheme.theme.color.functional.info) }
  15715. ]);
  15716. let currentColorObj = {
  15717. name: '',
  15718. color: {
  15719. primary: { default: '' },
  15720. dark: { default: '' },
  15721. functional: { success: '', warning: '', error: '', info: '' },
  15722. extend: [{ color: '', alias: '' }]
  15723. }
  15724. };
  15725. let primaryColors: { hex: string; hsl: string; n: number; rgb: string; oklch: string }[] = $state([]);
  15726. let darkColors: { hex: string; hsl: string; n: number; rgb: string; oklch: string }[] = $state([]);
  15727. let themeBlack = $state({
  15728. primary: { hex: '', hsl: '', rgb: '', oklch: '' },
  15729. dark: { hex: '', hsl: '', rgb: '', oklch: '' }
  15730. });
  15731. let themeWhite = $state({
  15732. primary: { hex: '', hsl: '', rgb: '', oklch: '' },
  15733. dark: { hex: '', hsl: '', rgb: '', oklch: '' }
  15734. });
  15735. let stateColor = $state({ success: '', warning: '', error: '', info: '' });
  15736. let extendList: { color: string; alias: string; hex: string }[] = $state(
  15737. initTheme.theme.color.extend.map((item) => ({ ...item, hex: getHexFunc(item.color) }))
  15738. );
  15739. let name = $state(initTheme.name);
  15740. let showCopyTip = $state(false);
  15741. let showCopyTip2 = $state(false);
  15742. let extendListStr = $derived(extendListStrFunc(extendList));
  15743. let extendListStr2 = $derived(extendListStrFunc2(extendList));
  15744. let configStr = $derived(
  15745. hljs.highlight(
  15746. `// ${isZh ? '主题配置' : 'Theme configuration'}
  15747. name: '${name}',
  15748. color: {
  15749. primary: {
  15750. 50: '${primaryColors[0].oklch}', // ${primaryColors[0].hex} ${primaryColors[0].hsl}
  15751. 100: '${primaryColors[1].oklch}', // ${primaryColors[1].hex} ${primaryColors[1].hsl}
  15752. 200: '${primaryColors[2].oklch}', // ${primaryColors[2].hex} ${primaryColors[2].hsl}
  15753. 300: '${primaryColors[3].oklch}', // ${primaryColors[3].hex} ${primaryColors[3].hsl}
  15754. 400: '${primaryColors[4].oklch}', // ${primaryColors[4].hex} ${primaryColors[4].hsl}
  15755. 500: '${primaryColors[5].oklch}', // ${primaryColors[5].hex} ${primaryColors[5].hsl}
  15756. default: '${primaryColors[6].oklch}', // ${primaryColors[6].hex} ${primaryColors[6].hsl}
  15757. 700: '${primaryColors[7].oklch}', // ${primaryColors[7].hex} ${primaryColors[7].hsl}
  15758. 800: '${primaryColors[8].oklch}', // ${primaryColors[8].hex} ${primaryColors[8].hsl}
  15759. 900: '${primaryColors[9].oklch}', // ${primaryColors[9].hex} ${primaryColors[9].hsl}
  15760. 950: '${primaryColors[10].oklch}', // ${primaryColors[10].hex} ${primaryColors[10].hsl}
  15761. },
  15762. dark: {
  15763. 50: '${darkColors[0].oklch}', // ${darkColors[0].hex} ${darkColors[0].hsl}
  15764. 100: '${darkColors[1].oklch}', // ${darkColors[1].hex} ${darkColors[1].hsl}
  15765. 200: '${darkColors[2].oklch}', // ${darkColors[2].hex} ${darkColors[2].hsl}
  15766. 300: '${darkColors[3].oklch}', // ${darkColors[3].hex} ${darkColors[3].hsl}
  15767. 400: '${darkColors[4].oklch}', // ${darkColors[4].hex} ${darkColors[4].hsl}
  15768. 500: '${darkColors[5].oklch}', // ${darkColors[5].hex} ${darkColors[5].hsl}
  15769. default: '${darkColors[6].oklch}', // ${darkColors[6].hex} ${darkColors[6].hsl}
  15770. 700: '${darkColors[7].oklch}', // ${darkColors[7].hex} ${darkColors[7].hsl}
  15771. 800: '${darkColors[8].oklch}', // ${darkColors[8].hex} ${darkColors[8].hsl}
  15772. 900: '${darkColors[9].oklch}', // ${darkColors[9].hex} ${darkColors[9].hsl}
  15773. 950: '${darkColors[10].oklch}', // ${darkColors[10].hex} ${darkColors[10].hsl}
  15774. },
  15775. primaryBlack: '${getOklchFunc(themeBlack.primary.hex)}', // ${themeBlack.primary.hex} ${themeBlack.primary.hsl}
  15776. primaryWhite: '${getOklchFunc(themeWhite.primary.hex)}', // ${themeWhite.primary.hex} ${themeWhite.primary.hsl}
  15777. darkBlack: '${getOklchFunc(themeBlack.dark.hex)}', // ${themeBlack.dark.hex} ${themeBlack.dark.hsl}
  15778. darkWhite: '${getOklchFunc(themeWhite.dark.hex)}', // ${themeWhite.dark.hex} ${themeWhite.dark.hsl}
  15779. functional: {
  15780. success: '${getOklchFunc(stateColor.success)}', // ${stateColor.success} ${colorConvertFunc(stateColor.success).hsl}
  15781. warning: '${getOklchFunc(stateColor.warning)}', // ${stateColor.warning} ${colorConvertFunc(stateColor.warning).hsl}
  15782. error: '${getOklchFunc(stateColor.error)}', // ${stateColor.error} ${colorConvertFunc(stateColor.error).hsl}
  15783. info: '${getOklchFunc(stateColor.info)}', // ${stateColor.info} ${colorConvertFunc(stateColor.info).hsl}
  15784. },
  15785. extend: [
  15786. ${extendListStr}
  15787. ],
  15788. },`,
  15789. { language: 'javascript', ignoreIllegals: true }
  15790. ).value
  15791. );
  15792. let configStr2 = $derived(
  15793. hljs.highlight(
  15794. `/* ${isZh ? '初始主题 CSS 变量' : 'Initial theme CSS variables'} */
  15795. @theme {
  15796. --color-primary-50: ${primaryColors[0].oklch};
  15797. --color-primary-100: ${primaryColors[1].oklch};
  15798. --color-primary-200: ${primaryColors[2].oklch};
  15799. --color-primary-300: ${primaryColors[3].oklch};
  15800. --color-primary-400: ${primaryColors[4].oklch};
  15801. --color-primary-500: ${primaryColors[5].oklch};
  15802. --color-primary: ${primaryColors[6].oklch};
  15803. --color-primary-700: ${primaryColors[7].oklch};
  15804. --color-primary-800: ${primaryColors[8].oklch};
  15805. --color-primary-900: ${primaryColors[9].oklch};
  15806. --color-primary-950: ${primaryColors[10].oklch};
  15807. --color-dark-50: ${darkColors[0].oklch};
  15808. --color-dark-100: ${darkColors[1].oklch};
  15809. --color-dark-200: ${darkColors[2].oklch};
  15810. --color-dark-300: ${darkColors[3].oklch};
  15811. --color-dark-400: ${darkColors[4].oklch};
  15812. --color-dark-500: ${darkColors[5].oklch};
  15813. --color-dark: ${darkColors[6].oklch};
  15814. --color-dark-700: ${darkColors[7].oklch};
  15815. --color-dark-800: ${darkColors[8].oklch};
  15816. --color-dark-900: ${darkColors[9].oklch};
  15817. --color-dark-950: ${darkColors[10].oklch};
  15818. --color-primaryBlack: ${getOklchFunc(themeBlack.primary.hex)};
  15819. --color-primaryWhite: ${getOklchFunc(themeWhite.primary.hex)};
  15820. --color-darkBlack: ${getOklchFunc(themeBlack.dark.hex)};
  15821. --color-darkWhite: ${getOklchFunc(themeWhite.dark.hex)};
  15822. --color-success: ${getOklchFunc(stateColor.success)};
  15823. --color-warning: ${getOklchFunc(stateColor.warning)};
  15824. --color-error: ${getOklchFunc(stateColor.error)};
  15825. --color-info: ${getOklchFunc(stateColor.info)};
  15826. ${extendListStr2}
  15827. --color-black: oklch(0 0 0);
  15828. --color-white: oklch(1 0 0);
  15829. --color-gray-50: oklch(0.961 0 0);
  15830. --color-gray-100: oklch(0.925 0 0);
  15831. --color-gray-200: oklch(0.845 0 0);
  15832. --color-gray-300: oklch(0.767 0 0);
  15833. --color-gray-400: oklch(0.683 0 0);
  15834. --color-gray-500: oklch(0.6 0 0);
  15835. --color-gray-600: oklch(0.51 0 0);
  15836. --color-gray-700: oklch(0.42 0 0);
  15837. --color-gray-800: oklch(0.321 0 0);
  15838. --color-gray-900: oklch(0.218 0 0);
  15839. --color-gray-950: oklch(0.159 0 0);
  15840. --color-transparent: transparent;
  15841. }
  15842. `,
  15843. { language: 'css', ignoreIllegals: true }
  15844. ).value
  15845. );
  15846. // 统一生成颜色
  15847. const generateFunc = () => {
  15848. // 传入数组,按照 Tailwind 规则生成颜色列表
  15849. const createTWColorFunc = (colorList: string[]) => {
  15850. if (colorList.length !== 11) {
  15851. console.error('颜色列表长度必须为 11');
  15852. return;
  15853. }
  15854. const colorArr: { hex: string; hsl: string; n: number; rgb: string; oklch: string }[] = [];
  15855. colorList.forEach((item, index) => {
  15856. // 第 0 项和最后一项的 key 为 50 和 950,其他项为 100-900,颜色有 hex、rgb、hsl 三种格式,注意 hsl 保留整数
  15857. let colorObj: { hex: string; hsl: string; n: number; rgb: string; oklch: string } = { hex: '', hsl: '', n: 0, rgb: '', oklch: '' };
  15858. if (index === 0) {
  15859. colorObj = {
  15860. n: 50,
  15861. hex: item,
  15862. rgb: colorConvertFunc(item).rgb,
  15863. hsl: colorConvertFunc(item).hsl,
  15864. oklch: colorConvertFunc(item).oklch
  15865. };
  15866. } else if (index === 10) {
  15867. colorObj = {
  15868. n: 950,
  15869. hex: item,
  15870. rgb: colorConvertFunc(item).rgb,
  15871. hsl: colorConvertFunc(item).hsl,
  15872. oklch: colorConvertFunc(item).oklch
  15873. };
  15874. } else {
  15875. colorObj = {
  15876. n: 100 * index,
  15877. hex: item,
  15878. rgb: colorConvertFunc(item).rgb,
  15879. hsl: colorConvertFunc(item).hsl,
  15880. oklch: colorConvertFunc(item).oklch
  15881. };
  15882. }
  15883. colorArr.push(colorObj);
  15884. });
  15885. return colorArr;
  15886. };
  15887. const primaryColorList = generatePalette(currentColorObj.color.primary.default) as string[];
  15888. const darkColorList = generatePalette(currentColorObj.color.dark.default) as string[];
  15889. primaryColors = createTWColorFunc(primaryColorList) as {
  15890. hex: string;
  15891. hsl: string;
  15892. n: number;
  15893. rgb: string;
  15894. oklch: string;
  15895. }[];
  15896. darkColors = createTWColorFunc(darkColorList) as {
  15897. hex: string;
  15898. hsl: string;
  15899. n: number;
  15900. rgb: string;
  15901. oklch: string;
  15902. }[];
  15903. // 根据主题色生成主题黑和白
  15904. const primaryColorB = generateThemeBlack(currentColorObj.color.primary.default);
  15905. const darkColorB = generateThemeBlack(currentColorObj.color.dark.default);
  15906. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: dark)"
  15907. const darkMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: dark)"]');
  15908. // 如果找到了,就修改它的 content 属性
  15909. if (darkMeta) {
  15910. darkMeta.setAttribute('content', darkColorB.hex);
  15911. }
  15912. themeBlack = { primary: primaryColorB, dark: darkColorB };
  15913. const primaryColorW = generateThemeWhite(currentColorObj.color.primary.default);
  15914. // 查找 meta 标签,name="theme-color" 且 media="(prefers-color-scheme: light)"
  15915. const lightMeta = document.querySelector('meta[name="theme-color"][media="(prefers-color-scheme: light)"]');
  15916. // 如果找到了,就修改它的 content 属性
  15917. if (lightMeta) {
  15918. lightMeta.setAttribute('content', primaryColorW.hex);
  15919. }
  15920. const darkColorW = generateThemeWhite(currentColorObj.color.dark.default);
  15921. themeWhite = { primary: primaryColorW, dark: darkColorW };
  15922. stateColor = currentColorObj.color.functional;
  15923. primaryColors.forEach((item) => {
  15924. setPropertyFunc(item.n === 600 ? '--color-primary' : `--color-primary-${item.n}`, item.oklch);
  15925. });
  15926. darkColors.forEach((item) => {
  15927. setPropertyFunc(item.n === 600 ? '--color-dark' : `--color-dark-${item.n}`, item.oklch);
  15928. });
  15929. setPropertyFunc('--color-primaryBlack', primaryColorB.oklch);
  15930. setPropertyFunc('--color-primaryWhite', primaryColorW.oklch);
  15931. setPropertyFunc('--color-darkBlack', darkColorB.oklch);
  15932. setPropertyFunc('--color-darkWhite', darkColorW.oklch);
  15933. };
  15934. const changeFunc = (type = 'primary', e: null | Event, value: string) => {
  15935. const colorValue = e ? (e.target as HTMLInputElement).value : value;
  15936. const primaryObj = currentColorObj.color.primary;
  15937. const darkObj = currentColorObj.color.dark;
  15938. const functionalObj = currentColorObj.color.functional;
  15939. const newColors = [...colors];
  15940. const item = newColors.find((item) => item.type === type);
  15941. if (item) {
  15942. item.color = colorValue.indexOf('#') === 0 ? colorValue : getOklchFunc(colorValue);
  15943. item.hex = colorValue.indexOf('#') === 0 ? colorValue : getHexFunc(colorValue);
  15944. }
  15945. colors = newColors;
  15946. if (type === 'primary') {
  15947. numbers.forEach((item) => {
  15948. if (item === 600) {
  15949. primaryObj['default'] = colorValue;
  15950. } else {
  15951. (primaryObj as unknown as Record<string, string>)[item] = colorValue;
  15952. }
  15953. });
  15954. } else if (type === 'dark') {
  15955. numbers.forEach((item) => {
  15956. if (item === 600) {
  15957. darkObj['default'] = colorValue;
  15958. } else {
  15959. (darkObj as unknown as Record<string, string>)[item] = colorValue;
  15960. }
  15961. });
  15962. } else {
  15963. setPropertyFunc(`--color-functional-${type}`, item?.color ?? '');
  15964. (functionalObj as unknown as Record<string, string>)[type] = colorValue;
  15965. }
  15966. currentColorObj = {
  15967. name: name,
  15968. color: {
  15969. primary: primaryObj,
  15970. dark: darkObj,
  15971. functional: functionalObj,
  15972. extend: extendList
  15973. }
  15974. };
  15975. generateFunc();
  15976. };
  15977. const unsubscribe = currentColorStore.subscribe((value) => {
  15978. // 根据 $currentColorStore 从 themes 中获取对应的颜色对象
  15979. const theme = themes.find((item) => item.name === value);
  15980. if (!theme) {
  15981. return;
  15982. }
  15983. currentColorObj = theme.theme;
  15984. generateFunc();
  15985. // 根据 currentColorObj 设置 colors
  15986. const newColors = [...colors];
  15987. newColors.forEach((item) => {
  15988. if (item.type === 'primary') {
  15989. item.color = currentColorObj.color.primary.default;
  15990. item.hex = getHexFunc(currentColorObj.color.primary.default);
  15991. } else if (item.type === 'dark') {
  15992. item.color = currentColorObj.color.dark.default;
  15993. item.hex = getHexFunc(currentColorObj.color.dark.default);
  15994. } else {
  15995. // 确保 item.type 是 functional 对象中的有效键
  15996. if (item.type in currentColorObj.color.functional) {
  15997. item.color = currentColorObj.color.functional[item.type as keyof typeof currentColorObj.color.functional];
  15998. item.hex = getHexFunc(currentColorObj.color.functional[item.type as keyof typeof currentColorObj.color.functional]);
  15999. }
  16000. }
  16001. });
  16002. colors = newColors;
  16003. name = currentColorObj.name;
  16004. extendList = currentColorObj.color.extend.map((item) => ({ ...item, hex: getHexFunc(item.color) }));
  16005. });
  16006. // svelte 组件销毁时取消订阅
  16007. onDestroy(() => {
  16008. unsubscribe();
  16009. });
  16010. // 随机事件
  16011. const randomFunc = () => {
  16012. // 从 colorList 中随机取出一个 mode 为 dark 的颜色,再随机取出一个 mode 为 light 的颜色
  16013. const randomDarkColor = colorList.filter((item) => item.mode === 'dark')[
  16014. Math.floor(Math.random() * colorList.filter((item) => item.mode === 'dark').length)
  16015. ];
  16016. const randomLightColor = colorList.filter((item) => item.mode === 'light')[
  16017. Math.floor(Math.random() * colorList.filter((item) => item.mode === 'light').length)
  16018. ];
  16019. name = `${randomDarkColor.name}/${randomLightColor.name}`;
  16020. // 根据随机颜色生成主题
  16021. changeFunc('primary', null, randomDarkColor.hex);
  16022. changeFunc('dark', null, randomLightColor.hex);
  16023. // 获取当前 extendList 的长度
  16024. const extendListLength = extendList.length;
  16025. // 从 colorList 中随机取出 extendListLength 个 mode 为 dark 的颜色,作为扩展色
  16026. const randomExtendList = colorList
  16027. .filter((item) => item.mode === 'dark')
  16028. .sort(() => Math.random() - 0.5)
  16029. .slice(0, extendListLength);
  16030. let newExtendList = [];
  16031. newExtendList = randomExtendList.map((item) => {
  16032. return { color: item.hex, alias: item.name, hex: getHexFunc(item.hex) };
  16033. });
  16034. extendList = newExtendList;
  16035. };
  16036. // 重置事件
  16037. const resetFunc = () => {
  16038. // 刷新页面
  16039. window.location.reload();
  16040. };
  16041. // 删除扩展色
  16042. const deleteFunc = (i: number) => {
  16043. let newExtendList = [...extendList];
  16044. newExtendList.splice(i, 1);
  16045. extendList = newExtendList;
  16046. };
  16047. // 选择 extendList 的颜色
  16048. const changeExtendFunc = (e: Event, i: number) => {
  16049. const colorValue = (e.target as HTMLInputElement).value;
  16050. let newExtendList = [...extendList];
  16051. newExtendList[i].color = colorValue;
  16052. extendList = newExtendList;
  16053. };
  16054. // 输入 extendList 的别名
  16055. const inputExtendFunc = (e: Event, i: number) => {
  16056. const aliasValue = (e.target as HTMLInputElement).value;
  16057. let newExtendList = [...extendList];
  16058. newExtendList[i].alias = aliasValue;
  16059. extendList = newExtendList;
  16060. };
  16061. // 新增扩展色
  16062. const addExtendFunc = () => {
  16063. let newExtendList = [...extendList];
  16064. newExtendList.push({ color: '#000000', alias: '', hex: getHexFunc('#000000') });
  16065. extendList = newExtendList;
  16066. };
  16067. // 监听窗口变化
  16068. const windowResizeFun = () => {
  16069. windowWidth = document.documentElement.clientWidth;
  16070. windowHeight = document.documentElement.clientHeight;
  16071. };
  16072. onMount(() => {
  16073. windowWidth = document.documentElement.clientWidth;
  16074. windowHeight = document.documentElement.clientHeight;
  16075. window.addEventListener('resize', windowResizeFun);
  16076. // 复制
  16077. const clipboard = new ClipboardJS('#copyButton', {
  16078. target: () => {
  16079. return document.querySelector('#myCodeBlock')!;
  16080. }
  16081. });
  16082. clipboard.on('success', function () {
  16083. showCopyTip = true;
  16084. setTimeout(() => {
  16085. showCopyTip = false;
  16086. }, 2000);
  16087. });
  16088. clipboard.on('error', function () {
  16089. console.error('无法将内容复制到剪贴板');
  16090. });
  16091. // 复制
  16092. const clipboard2 = new ClipboardJS('#copyButton2', {
  16093. target: () => {
  16094. return document.querySelector('#myCodeBlock2')!;
  16095. }
  16096. });
  16097. clipboard2.on('success', function () {
  16098. showCopyTip2 = true;
  16099. setTimeout(() => {
  16100. showCopyTip2 = false;
  16101. }, 2000);
  16102. });
  16103. clipboard2.on('error', function () {
  16104. console.error('无法将内容复制到剪贴板');
  16105. });
  16106. });
  16107. onDestroy(() => {
  16108. window.removeEventListener('resize', windowResizeFun);
  16109. });
  16110. </script>
  16111. <div class="block md:hidden">{isZh ? '请在桌面端使用!' : 'Please use it on the desktop!'}</div>
  16112. <div class="hidden justify-between md:flex">
  16113. <div>
  16114. <div class="mb-2 text-center font-bold">{isZh ? '配置' : 'Configure'}</div>
  16115. <div class="flex flex-col gap-1 text-center">
  16116. <div class="text-left">{isZh ? '主题名称' : 'Theme name'}</div>
  16117. <div class="flex-1">
  16118. <input
  16119. class="focus:outline-primary dark:focus:outline-dark rounded-xs w-full bg-transparent px-1 py-1 text-xs outline outline-black/10 dark:outline-white/20"
  16120. type="text"
  16121. bind:value={name}
  16122. placeholder={isZh ? '请输入主题名称' : 'Please enter theme name'}
  16123. />
  16124. </div>
  16125. </div>
  16126. <div class="mt-4 flex gap-2">
  16127. <div class="flex flex-col gap-4 text-center">
  16128. <!-- 输入框 主题色与功能色 -->
  16129. {#each colors as item, i}
  16130. <div class="{i === 2 ? 'mt-6' : 'mt-0'} relative">
  16131. <!-- <div class="mb-1 text-left text-xs">{getOklchFunc(item.color)}</div> -->
  16132. <div class="flex items-center gap-2">
  16133. <input
  16134. type="color"
  16135. bind:value={item.hex}
  16136. oninput={(e) => throttle(() => changeFunc(item.type, e, item.color), 100)()}
  16137. class="h-6 w-6 flex-none cursor-pointer"
  16138. style="background-color: {item.color};"
  16139. onclick={() => (showTip = false)}
  16140. />
  16141. <span>{item.type}</span>
  16142. </div>
  16143. {#if i === 0 && showTip}
  16144. <div class="pointer-events-none absolute left-2 top-0 rotate-[135deg]">
  16145. <div class="animate-bounce text-3xl">👇</div>
  16146. </div>
  16147. {/if}
  16148. </div>
  16149. {/each}
  16150. <!-- 扩展色 -->
  16151. <div class="mt-6 flex flex-col gap-4 overflow-y-auto" style="height: {windowHeight - 480}px;">
  16152. {#each extendList as item, i}
  16153. <div class="flex flex-col gap-2">
  16154. <div class="flex gap-2">
  16155. <input
  16156. type="color"
  16157. bind:value={item.hex}
  16158. class="h-6 w-6"
  16159. style="background-color: {item.color};"
  16160. oninput={(e) => throttle(() => changeExtendFunc(e, i), 100)()}
  16161. />
  16162. <div>extend{i}</div>
  16163. <!-- <div class="w-16 flex-none overflow-hidden text-left text-sm leading-6">
  16164. {item.color}
  16165. </div> -->
  16166. <button aria-label="delete" class="rounded-sm bg-black/5 px-1 dark:bg-white/10" onclick={() => deleteFunc(i)}>
  16167. <svg class="h-4 w-6 transition-all hover:scale-90" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  16168. <path
  16169. class="fill-error"
  16170. d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"
  16171. >
  16172. </path>
  16173. </svg>
  16174. </button>
  16175. </div>
  16176. <div class="flex px-0.5">
  16177. <input
  16178. class="focus:outline-primary dark:focus:outline-dark rounded-xs h-6 w-full bg-transparent px-1 py-1 text-xs outline outline-black/10 dark:outline-white/20"
  16179. type="text"
  16180. bind:value={item.alias}
  16181. placeholder={isZh ? `请输入 extend${i} 别名` : `Please enter extend${i} alias`}
  16182. oninput={(e) => throttle(() => inputExtendFunc(e, i))}
  16183. />
  16184. </div>
  16185. </div>
  16186. {/each}
  16187. <div>
  16188. <button
  16189. class="items-centers border-primary dark:border-dark flex w-full justify-center gap-2 rounded-sm border py-1.5 text-sm text-black dark:text-white"
  16190. onclick={addExtendFunc}
  16191. >
  16192. <span>
  16193. <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  16194. <path class="fill-black dark:fill-white" d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path>
  16195. </svg>
  16196. </span>
  16197. {isZh ? '新增' : 'Add'}</button
  16198. >
  16199. </div>
  16200. </div>
  16201. </div>
  16202. </div>
  16203. </div>
  16204. <div class="flex-1">
  16205. <div class="mb-4 text-center font-bold">{isZh ? '色板 & 配置文件' : 'Palette & Profiles'}</div>
  16206. <div class="flex flex-col px-4 text-center text-xs">
  16207. <div class="mb-1 flex flex-1 justify-between gap-1">
  16208. {#each primaryColors as color, index}
  16209. <div
  16210. class="h-12 rounded-sm {index >= 5 ? 'text-primaryWhite' : 'text-primaryBlack'}"
  16211. style="background-color: {color.oklch};flex: {index === 6 ? '2' : '1'}"
  16212. >
  16213. <div class="flex flex-col items-center justify-between">
  16214. <div class="flex-1 leading-10 mt-1{index === 6 ? ' text-xl font-bold' : ''}">
  16215. {index === 6 ? 'primary' : `${color.n}`}
  16216. </div>
  16217. </div>
  16218. </div>
  16219. {/each}
  16220. </div>
  16221. <div class="flex flex-1 justify-between gap-1">
  16222. {#each darkColors as color, index}
  16223. <div
  16224. class="h-12 rounded-sm {index <= 6 ? 'text-darkBlack' : 'text-darkWhite'}"
  16225. style="background-color: {color.oklch};flex: {index === 6 ? '2' : '1'};"
  16226. >
  16227. <div class="flex items-center justify-between">
  16228. <div class="flex-1 leading-10 mt-1{index === 6 ? ' text-xl font-bold' : ''}">
  16229. {index === 6 ? 'dark' : `${color.n}`}
  16230. </div>
  16231. </div>
  16232. </div>
  16233. {/each}
  16234. </div>
  16235. </div>
  16236. <div class="mt-1 flex justify-between gap-1 px-4 text-center text-xs">
  16237. {#each [themeBlack.primary, themeBlack.dark, themeWhite.primary, themeWhite.dark] as item, i}
  16238. <div
  16239. class="h-12 flex-1 rounded-sm border pt-4 {i === 0 || i === 1 ? 'border-gray-700 text-white' : 'border-gray-300 text-black'}"
  16240. style="background-color: {item.oklch};"
  16241. >
  16242. <div>
  16243. {i === 0 ? 'primaryBlack' : i === 1 ? 'darkBlack' : i === 2 ? 'primaryWhite' : 'darkWhite'}
  16244. </div>
  16245. </div>
  16246. {/each}
  16247. </div>
  16248. <!-- 功能色 -->
  16249. <div class="mt-1 flex justify-between gap-1 px-4 text-center text-xs text-white">
  16250. <div class="h-12 flex-1 rounded-sm pt-4" style="background-color: {stateColor.success};">success</div>
  16251. <div class="h-12 flex-1 rounded-sm pt-4" style="background-color: {stateColor.warning};">warning</div>
  16252. <div class="h-12 flex-1 rounded-sm pt-4" style="background-color: {stateColor.error};">error</div>
  16253. <div class="h-12 flex-1 rounded-sm pt-4" style="background-color: {stateColor.info};">info</div>
  16254. </div>
  16255. <!-- 扩展色 -->
  16256. <div class="mt-1 flex h-12 justify-between gap-1 px-4 text-center text-xs text-white">
  16257. {#if extendList}
  16258. {#each extendList as item, i}
  16259. <div class="flex h-12 flex-1 flex-col justify-center gap-1 rounded-sm py-1" style="background-color: {item.color};">
  16260. <div class="text-xs">extend{i}</div>
  16261. <div>{item.alias}</div>
  16262. </div>
  16263. {/each}
  16264. {/if}
  16265. </div>
  16266. <!-- 配置文件 -->
  16267. <div class="mx-4 mt-1 flex" style="height:{windowHeight - 388}px;width:{windowWidth - 858 + 46}px">
  16268. <div class="bg-codeLight dark:bg-codeDark relative mr-1 grow">
  16269. <div class="overflow-auto rounded-sm" style="height:{windowHeight - 388}px;width:{((windowWidth - 858) / 5) * 3 - 6 + 46}px">
  16270. <article class="prose dark:prose-invert max-w-none text-xs">
  16271. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  16272. <pre><code class="hljs" id="myCodeBlock">{@html configStr}</code></pre>
  16273. </article>
  16274. </div>
  16275. <button
  16276. aria-label="copy"
  16277. class="absolute right-0 top-0 rounded-bl-sm bg-black/5 px-3 py-2 text-sm hover:opacity-80 dark:bg-white/10"
  16278. id="copyButton"
  16279. >
  16280. <svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  16281. <path
  16282. class="fill-gray-700 dark:fill-gray-300"
  16283. d="M6 4V8H18V4H20.0066C20.5552 4 21 4.44495 21 4.9934V21.0066C21 21.5552 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5551 3 21.0066V4.9934C3 4.44476 3.44495 4 3.9934 4H6ZM8 2H16V6H8V2Z"
  16284. ></path>
  16285. </svg>
  16286. </button>
  16287. {#if showCopyTip}
  16288. <div in:fly={{ x: 50, duration: 500 }} out:fly={{ x: 50, duration: 300 }} class="absolute right-14 top-1 text-sm">
  16289. {isZh ? '已复制!' : 'Copied!'}
  16290. </div>
  16291. {/if}
  16292. </div>
  16293. <div class="bg-codeLight dark:bg-codeDark relative grow">
  16294. <div class="overflow-auto rounded-sm" style="height:{windowHeight - 388}px;width:{((windowWidth - 858) / 5) * 2 + 4}px">
  16295. <article class="prose dark:prose-invert max-w-none text-xs">
  16296. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  16297. <pre><code class="hljs" id="myCodeBlock2">{@html configStr2}</code></pre>
  16298. </article>
  16299. </div>
  16300. <button
  16301. aria-label="copy"
  16302. class="absolute right-0 top-0 rounded-bl-sm bg-black/5 px-3 py-2 text-sm hover:opacity-80 dark:bg-white/10"
  16303. id="copyButton2"
  16304. >
  16305. <svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  16306. <path
  16307. class="fill-gray-700 dark:fill-gray-300"
  16308. d="M6 4V8H18V4H20.0066C20.5552 4 21 4.44495 21 4.9934V21.0066C21 21.5552 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5551 3 21.0066V4.9934C3 4.44476 3.44495 4 3.9934 4H6ZM8 2H16V6H8V2Z"
  16309. ></path>
  16310. </svg>
  16311. </button>
  16312. {#if showCopyTip2}
  16313. <div in:fly={{ x: 50, duration: 500 }} out:fly={{ x: 50, duration: 300 }} class="absolute right-14 top-1 text-sm">
  16314. {isZh ? '已复制!' : 'Copied!'}
  16315. </div>
  16316. {/if}
  16317. </div>
  16318. </div>
  16319. </div>
  16320. <div class="flex w-[390px] gap-4">
  16321. <div>
  16322. <div class="flex w-full justify-between pb-2">
  16323. <div>
  16324. <button
  16325. class="bg-primary dark:bg-dark cursor-pointer rounded-sm px-4 py-1.5 text-xs text-white hover:opacity-90 dark:text-black"
  16326. onclick={randomFunc}
  16327. >
  16328. {isZh ? '随机主题' : 'Random theme'}
  16329. </button>
  16330. <button
  16331. class="border-primary dark:border-dark ml-2 cursor-pointer rounded-sm border px-4 py-1.5 text-xs text-black hover:opacity-90 dark:text-white"
  16332. onclick={resetFunc}
  16333. >
  16334. {isZh ? '重置' : 'Reset'}
  16335. </button>
  16336. </div>
  16337. <div>
  16338. <ModeSwitch />
  16339. </div>
  16340. </div>
  16341. <div
  16342. class="border-primary/20 bg-primaryWhite dark:border-dark/20 dark:bg-darkBlack h-96 w-[392px] overflow-auto border dark:border-gray-700"
  16343. style="height:{windowHeight - 130}px"
  16344. >
  16345. <GeneratorPreview />
  16346. </div>
  16347. </div>
  16348. </div>
  16349. </div>
  16350. <style>
  16351. input[type='color'] {
  16352. -webkit-appearance: none;
  16353. appearance: none;
  16354. border: none;
  16355. padding: 0;
  16356. border-radius: 2px;
  16357. }
  16358. input[type='color']::-webkit-color-swatch-wrapper {
  16359. padding: 0;
  16360. margin: 0;
  16361. }
  16362. input[type='color']::-webkit-color-swatch {
  16363. border: 1px solid #666;
  16364. border-radius: 2px;
  16365. }
  16366. </style>
  16367. ================================================
  16368. FILE: docs/site/src/routes/guide/generator/Calendar.svelte
  16369. ================================================
  16370. <script lang="ts">
  16371. import { getNowBeforeOrAfterMonth, getCalendarData, getMonthListRange, getDateRange } from 'stdf/utils';
  16372. import { zh_CN, en_US } from 'stdf/lang';
  16373. const isZh = localStorage.getItem('lang') === 'zh_CN';
  16374. // 当前语言
  16375. // current language
  16376. const currentLang = isZh ? zh_CN : en_US;
  16377. const calendarLang = currentLang.calendar;
  16378. // 传入的开始月,默认为当前月前 6 个月
  16379. // 传入的结束月,默认为当前月后 6 个月
  16380. // 选择模式,single 单选,multiple 多选,range 范围选择
  16381. // 是否从周日开始
  16382. // 周末文字是否标红
  16383. // 月数据是否使用卡片样式
  16384. // 是否显示月份水印
  16385. // 月份水印文字大小
  16386. // 显示信息的日期
  16387. // 不允许选择日期集合
  16388. // 圆角风格
  16389. // 自动滚动到某个月时,是否使用动画
  16390. // 高亮显示今天
  16391. /**
  16392. * @typedef {Object} Props
  16393. * @property {any} [startMonth]
  16394. * @property {any} [endMonth]
  16395. * @property {string} [mode]
  16396. * @property {boolean} [startSunday]
  16397. * @property {boolean} [weekendRed]
  16398. * @property {boolean} [monthCard]
  16399. * @property {boolean} [monthMark]
  16400. * @property {string} [monthMarkSize]
  16401. * @property {any} [infoDates]
  16402. * @property {any} [disabledDates]
  16403. * @property {string} [radius]
  16404. * @property {boolean} [useAnimation]
  16405. * @property {boolean} [highlightToday]
  16406. */
  16407. /** @type {Props} */
  16408. let {
  16409. startMonth = getNowBeforeOrAfterMonth(0),
  16410. endMonth = getNowBeforeOrAfterMonth(0),
  16411. mode = 'range',
  16412. startSunday = false,
  16413. weekendRed = false,
  16414. monthCard = true,
  16415. monthMark = false,
  16416. monthMarkSize = 'xl',
  16417. infoDates = [],
  16418. disabledDates = [],
  16419. radius = 'xl',
  16420. useAnimation = true,
  16421. highlightToday = true
  16422. } = $props();
  16423. // 圆角风格样式
  16424. // Rounded style style
  16425. const radiusClass = {
  16426. sm: 'rounded-sm',
  16427. xl: 'rounded-xl',
  16428. '2xl': 'rounded-2xl',
  16429. none: 'rounded-none'
  16430. };
  16431. // 月份水印文字大小样式
  16432. // Month watermark text size style
  16433. const monthMarkSizeClass = {
  16434. '3xl': 'text-3xl',
  16435. '4xl': 'text-4xl',
  16436. '5xl': 'text-5xl',
  16437. '6xl': 'text-6xl',
  16438. '7xl': 'text-7xl',
  16439. '8xl': 'text-8xl',
  16440. '9xl': 'text-9xl'
  16441. };
  16442. // 当天日期字符串,YYYYMMDD,日和天不足两位时前面补 0
  16443. // Today's date string, YYYYMMDD, day and day are not less than two digits, and 0 is filled in front
  16444. const now = new Date();
  16445. const nowYear = now.getFullYear();
  16446. const nowMonth = now.getMonth() + 1;
  16447. const nowDay = now.getDate();
  16448. const todayStr = `${nowYear}${nowMonth < 10 ? '0' + nowMonth : nowMonth}${nowDay < 10 ? '0' + nowDay : nowDay}`;
  16449. // 是否点击了快速选择
  16450. // Whether to click the quick selection
  16451. let isQuickSelect = false;
  16452. // 定义周数据文字
  16453. // Define the week data text
  16454. const weekTexts = startSunday ? calendarLang.weekSundayStartTextList : calendarLang.weekTextList;
  16455. // 传入 startSunday 和位于周的索引,返回是否是周末
  16456. // Pass in startSunday and the index of the week, and return whether it is a weekend
  16457. const isWeekendFunc = (startSunday: boolean, index: number) => {
  16458. if (startSunday) {
  16459. return index === 0 || index === 6;
  16460. } else {
  16461. return index === 5 || index === 6;
  16462. }
  16463. };
  16464. // 根据 startMonth 和 endMonth 将月份数据组成 monthList
  16465. // According to startMonth and endMonth, the month data is assembled into monthList
  16466. const monthList = getMonthListRange(startMonth, endMonth);
  16467. // 循环 monthList,根据每个月份的数据,生成全部的日历数据,其中 month 为当前月,year 为年,data 为日期数组
  16468. // Loop monthList, generate all calendar data according to the data of each month, where month is the current month, year is the year, and data is the date array
  16469. const allMonthData: {
  16470. year: string;
  16471. month: string;
  16472. data: { text: string; info?: string; disabled?: boolean; start?: boolean; end?: boolean }[];
  16473. }[] = monthList.map((monthStr) => {
  16474. return {
  16475. year: monthStr.slice(0, 4),
  16476. month: monthStr.slice(4),
  16477. data: getCalendarData(monthStr, startSunday).map((item) => ({
  16478. text: item,
  16479. info: '',
  16480. disabled: false,
  16481. start: false,
  16482. end: false
  16483. }))
  16484. };
  16485. });
  16486. // 如果 infoDates 不为空,循环 allMonthData,循环 data,循环 infoDates,如果 infoDates 中的日期和 data 中的日期相同,将 infoDates 中的 info 赋值给 data 中的 info
  16487. // If infoDates is not empty, loop allMonthData, loop data, loop infoDates, if the date in infoDates is the same as the date in data, assign the info in infoDates to the info in data
  16488. if (infoDates.length > 0) {
  16489. allMonthData.forEach((item) => {
  16490. item.data.forEach((data) => {
  16491. infoDates.forEach((info) => {
  16492. if (info.date === item.year + item.month + data.text) {
  16493. data.info = info.info;
  16494. }
  16495. });
  16496. });
  16497. });
  16498. }
  16499. // 如果 disabledDates 不为空,循环 allMonthData,循环 data,循环 disabledDates,如果 disabledDates 中的日期和 data 中的日期相同,将 disabledDates 中的 disabled 赋值给 data 中的 disabled
  16500. // If disabledDates is not empty, loop allMonthData, loop data, loop disabledDates, if the date in disabledDates is the same as the date in data, assign the disabled in disabledDates to the disabled in data
  16501. if (disabledDates.length > 0) {
  16502. allMonthData.forEach((item) => {
  16503. item.data.forEach((data) => {
  16504. disabledDates.forEach((disabled) => {
  16505. if (disabled === item.year + item.month + data.text) {
  16506. data.disabled = true;
  16507. }
  16508. });
  16509. });
  16510. });
  16511. }
  16512. // 生成一个随机数,在 5-20 之间,作为选定天数
  16513. // Generate a random number between 5-20 as the selected day
  16514. const randomDayNum = Math.floor(Math.random() * 16) + 5;
  16515. // 从当前月份随机找到连续的 randomDayNum 天,作为 selectedDate 初始值,如 ['20231108', '20231109', '20231110', '20231111', '20231112']
  16516. // From the current month, find randomDayNum consecutive days at random as the initial value of selectedDate, such as ['20231108', '20231109', '20231110', '20231111', '20231112']
  16517. // 先获取当前月份所有日期,再获取当前月份所有日期中的连续 randomDayNum 天
  16518. // First get all the dates of the current month, and then get randomDayNum consecutive days in all the dates of the current month
  16519. let currentMonthAllDays: string[] = [];
  16520. const currentMonth = new Date().getMonth() + 1;
  16521. const currentYear = new Date().getFullYear();
  16522. const currentMonthData = getCalendarData(`${currentYear}${currentMonth < 10 ? '0' + currentMonth : currentMonth}`, startSunday);
  16523. const currentMonthDays = currentMonthData.filter((item) => item).map((item) => item);
  16524. currentMonthDays.forEach((item) => {
  16525. currentMonthAllDays.push(`${currentYear}${currentMonth < 10 ? '0' + currentMonth : currentMonth}${item}`);
  16526. });
  16527. // 从 currentMonthAllDays 随机找到连续的 5 天
  16528. // Find 5 consecutive days at random from currentMonthAllDays
  16529. const randomIndex = Math.floor(Math.random() * (currentMonthAllDays.length - randomDayNum));
  16530. let selectedDate = $state(currentMonthAllDays.slice(randomIndex, randomIndex + randomDayNum));
  16531. // 范围选择时,点击的开始与结束
  16532. // When range selection is clicked, the beginning and end are clicked
  16533. let rangeArr: string[] = [];
  16534. // selectedDate 字符串
  16535. // selectedDate string
  16536. let selectedDateStr = $derived(selectedDate.join(','));
  16537. // 点击日期事件
  16538. // Click date event
  16539. const clickDayFunc = (
  16540. year: string,
  16541. month: string,
  16542. dayData: { text: string; info?: string; disabled?: boolean; start?: boolean; end?: boolean }
  16543. ) => {
  16544. if (!dayData.text) {
  16545. return;
  16546. }
  16547. if (isQuickSelect) {
  16548. isQuickSelect = false;
  16549. selectedDate = [];
  16550. }
  16551. rangeArr.push(`${year}${month}${dayData.text}`);
  16552. if (rangeArr.length === 2) {
  16553. // 将 rangeArr 排序,保证第一个日期小于第二个日期
  16554. // Sort rangeArr to ensure that the first date is less than the second date
  16555. rangeArr.sort((a, b) => {
  16556. return Number(a) - Number(b);
  16557. });
  16558. selectedDate = getDateRange(rangeArr[0], rangeArr[1], disabledDates);
  16559. rangeArr = [];
  16560. } else {
  16561. selectedDate = rangeArr;
  16562. }
  16563. // 对 selectedDate 按照日期排序
  16564. // Sort selectedDate by date
  16565. selectedDate.sort((a, b) => {
  16566. return Number(a) - Number(b);
  16567. });
  16568. };
  16569. </script>
  16570. <div>
  16571. <div class="left-0 top-0 z-10 w-full">
  16572. <div class="flex h-10 items-center justify-around gap-1 px-6 text-center leading-10">
  16573. {#each weekTexts as item, index}
  16574. <div class="flex-1 font-bold{weekendRed && isWeekendFunc(startSunday, index) ? ' text-error' : ''}">
  16575. {item}
  16576. </div>
  16577. {/each}
  16578. </div>
  16579. </div>
  16580. <div class="calendar-container flex flex-col gap-4 overflow-y-auto px-4 py-2 {useAnimation ? 'scroll-smooth' : 'scroll-auto'}">
  16581. {#each allMonthData as item}
  16582. <div class="{monthCard ? 'rounded-xl bg-white shadow-md dark:bg-black dark:shadow-white/5 ' : ''}relative">
  16583. <div class="px-4 pt-4 text-xl text-black/30 dark:text-white/30">
  16584. <span class="mr-2 font-bold text-black dark:text-white">
  16585. {calendarLang.monthTextList[Number(item.month) - 1]}
  16586. </span>
  16587. {item.year}
  16588. </div>
  16589. <div class="grid grid-cols-7 gap-y-1 p-2 text-center">
  16590. {#each item.data as i}
  16591. <button
  16592. class="p-px cursor-pointer{i.text ? ' bg-primary/10 dark:bg-dark/20' : ''}"
  16593. onclick={() => {
  16594. if (!i.disabled) clickDayFunc(item.year, item.month, i);
  16595. }}
  16596. class:!bg-transparent={!selectedDateStr.includes(`${item.year}${item.month}${i.text}`)}
  16597. class:!rounded-l-xl={radius === 'xl' &&
  16598. mode === 'range' &&
  16599. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 || i.start)}
  16600. class:!rounded-r-xl={radius === 'xl' &&
  16601. mode === 'range' &&
  16602. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8 || i.end)}
  16603. class:!rounded-xl={radius === 'xl' && mode !== 'range'}
  16604. class:!rounded-l-2xl={radius === '2xl' &&
  16605. mode === 'range' &&
  16606. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 || i.start)}
  16607. class:!rounded-r-2xl={radius === '2xl' &&
  16608. mode === 'range' &&
  16609. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8 || i.end)}
  16610. class:!rounded-2xl={radius === '2xl' && mode !== 'range'}
  16611. class:!rounded-l-none={radius === 'none' &&
  16612. mode === 'range' &&
  16613. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 || i.start)}
  16614. class:!rounded-r-none={radius === 'none' &&
  16615. mode === 'range' &&
  16616. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8 || i.end)}
  16617. class:!rounded-none={radius === 'none' && mode !== 'range'}
  16618. class:!rounded-l-sm={radius === 'sm' &&
  16619. mode === 'range' &&
  16620. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 || i.start)}
  16621. class:!rounded-r-sm={radius === 'sm' &&
  16622. mode === 'range' &&
  16623. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8 || i.end)}
  16624. class:!rounded-sm={radius === 'sm' && mode !== 'range'}
  16625. >
  16626. <div
  16627. class="{radiusClass[radius as keyof typeof radiusClass] ||
  16628. 'rounded-xl'} relative flex h-full w-full flex-col justify-center {i.info ? 'py-1' : 'py-2'}"
  16629. class:bg-primary={(i.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${i.text}`)) ||
  16630. (i.text &&
  16631. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16632. mode === 'range' &&
  16633. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 ||
  16634. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8))}
  16635. class:dark:bg-dark={(i.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${i.text}`)) ||
  16636. (i.text &&
  16637. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16638. mode === 'range' &&
  16639. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 ||
  16640. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8))}
  16641. class:text-white={(i.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${i.text}`)) ||
  16642. (i.text &&
  16643. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16644. mode === 'range' &&
  16645. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 ||
  16646. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8))}
  16647. class:dark:text-black={(i.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${i.text}`)) ||
  16648. (i.text &&
  16649. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16650. mode === 'range' &&
  16651. (selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === 0 ||
  16652. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) === selectedDateStr.length - 8))}
  16653. class:text-primary={mode === 'range' &&
  16654. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16655. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) !== 0 &&
  16656. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) !== selectedDateStr.length - 8}
  16657. class:dark:text-dark={mode === 'range' &&
  16658. selectedDateStr.includes(`${item.year}${item.month}${i.text}`) &&
  16659. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) !== 0 &&
  16660. selectedDateStr.indexOf(`${item.year}${item.month}${i.text}`) !== selectedDateStr.length - 8}
  16661. class:border={item.year + item.month + i.text === todayStr && highlightToday}
  16662. class:border-primary={item.year + item.month + i.text === todayStr && highlightToday}
  16663. class:dark:border-dark={item.year + item.month + i.text === todayStr && highlightToday}
  16664. >
  16665. <div class="font-bold">
  16666. {i.text ? Number(i.text) : ''}
  16667. </div>
  16668. <div class="text-xs opacity-50">{i.info || ''}</div>
  16669. </div>
  16670. </button>
  16671. {/each}
  16672. </div>
  16673. {#if monthMark}
  16674. <div
  16675. class="pointer-events-none absolute w-full {monthMarkSizeClass[monthMarkSize as keyof typeof monthMarkSizeClass] ??
  16676. 'text-7xl'} left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center font-bold text-black/5 {monthCard
  16677. ? 'dark:text-white/10'
  16678. : 'dark:text-white/5'}"
  16679. >
  16680. {calendarLang.monthTextList[Number(item.month) - 1]}
  16681. </div>
  16682. {/if}
  16683. </div>
  16684. {/each}
  16685. </div>
  16686. </div>
  16687. ================================================
  16688. FILE: docs/site/src/routes/guide/generator/GeneratorPreview.svelte
  16689. ================================================
  16690. <script lang="ts">
  16691. import { Button, Switch, Progress, ProgressLoop, Loading, NoticeBar, Icon, Slider } from 'stdf';
  16692. import Calendar from './Calendar.svelte';
  16693. import { currentThemeStore } from '../../../store';
  16694. const isZh = localStorage.getItem('lang') === 'zh_CN';
  16695. const icons = ['ri-spy-fill', 'ri-chrome-fill', 'ri-riding-line', 'ri-switch-fill'];
  16696. let textList = $derived(['请配置您喜欢的颜色主题!', '这是第一条测试通告!']);
  16697. let textList_en = $derived(['Please configure the color theme you like!', 'This is the first test notice!']);
  16698. </script>
  16699. <NoticeBar textList={isZh ? textList : textList_en} />
  16700. <svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 614 383.76">
  16701. <defs>
  16702. <style>
  16703. .cls-1 {
  16704. isolation: isolate;
  16705. }
  16706. .cls-2 {
  16707. fill: url(#linear-gradient);
  16708. }
  16709. .cls-3 {
  16710. fill: red;
  16711. }
  16712. .cls-moon {
  16713. fill: #fff;
  16714. }
  16715. .cls-4 {
  16716. fill: url(#linear-gradient-2);
  16717. }
  16718. .cls-5 {
  16719. fill: var(--color-primary-500);
  16720. /* fill: #d35f5f; */
  16721. }
  16722. .cls-5-dark {
  16723. fill: var(--color-dark-500);
  16724. /* fill: #d35f5f; */
  16725. }
  16726. .cls-6 {
  16727. fill: var(--color-primary-700);
  16728. /* fill: #841818; */
  16729. }
  16730. .cls-6-dark {
  16731. fill: var(--color-dark-800);
  16732. /* fill: #841818; */
  16733. }
  16734. .cls-7 {
  16735. opacity: 0.61;
  16736. fill: url(#linear-gradient-3);
  16737. }
  16738. .cls-17,
  16739. .cls-21,
  16740. .cls-22,
  16741. .cls-7,
  16742. .cls-8 {
  16743. mix-blend-mode: overlay;
  16744. }
  16745. .cls-8 {
  16746. fill: url(#linear-gradient-4);
  16747. }
  16748. .cls-9 {
  16749. fill: url(#linear-gradient-5);
  16750. }
  16751. .cls-10 {
  16752. fill: url(#linear-gradient-6);
  16753. }
  16754. .cls-11 {
  16755. fill: #260202;
  16756. }
  16757. .cls-12 {
  16758. fill: url(#linear-gradient-7);
  16759. }
  16760. .cls-13 {
  16761. fill: url(#linear-gradient-8);
  16762. }
  16763. .cls-14 {
  16764. fill: url(#linear-gradient-9);
  16765. }
  16766. .cls-15 {
  16767. fill: url(#linear-gradient-10);
  16768. }
  16769. .cls-16 {
  16770. fill: url(#linear-gradient-11);
  16771. }
  16772. .cls-17 {
  16773. fill: url(#linear-gradient-12);
  16774. }
  16775. .cls-18 {
  16776. fill: url(#linear-gradient-13);
  16777. }
  16778. .cls-19 {
  16779. fill: url(#linear-gradient-14);
  16780. }
  16781. .cls-20 {
  16782. fill: url(#linear-gradient-15);
  16783. }
  16784. .cls-21 {
  16785. fill: url(#linear-gradient-16);
  16786. }
  16787. .cls-22 {
  16788. fill: url(#linear-gradient-17);
  16789. }
  16790. .cls-23 {
  16791. fill: url(#linear-gradient-18);
  16792. }
  16793. .cls-24 {
  16794. fill: url(#linear-gradient-19);
  16795. }
  16796. .cls-25 {
  16797. fill: url(#linear-gradient-20);
  16798. }
  16799. .cls-26 {
  16800. fill: url(#linear-gradient-21);
  16801. }
  16802. .cls-27 {
  16803. fill: url(#linear-gradient-22);
  16804. }
  16805. .cls-28 {
  16806. fill: url(#linear-gradient-23);
  16807. }
  16808. .cls-29 {
  16809. fill: url(#linear-gradient-24);
  16810. }
  16811. .cls-30 {
  16812. fill: url(#linear-gradient-25);
  16813. }
  16814. .cls-31 {
  16815. opacity: 0.7;
  16816. mix-blend-mode: screen;
  16817. fill: url(#radial-gradient);
  16818. }
  16819. .cls-moon-light {
  16820. opacity: 0.4;
  16821. mix-blend-mode: screen;
  16822. fill: url(#radial-gradient-moon);
  16823. }
  16824. </style>
  16825. <!-- 背景 -->
  16826. <linearGradient id="linear-gradient" x1="307" y1="369.32" x2="307" y2="23.88" gradientUnits="userSpaceOnUse">
  16827. <stop offset="0" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-400)' : 'var(--color-primary-50)'} />
  16828. <stop offset="1" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-800)' : 'var(--color-primary-500)'} />
  16829. </linearGradient>
  16830. <!-- 山 0 -->
  16831. <linearGradient id="linear-gradient-2" x1="375" y1="390.15" x2="375" y2="207.5" xlink:href="#linear-gradient" />
  16832. <!-- 浅色山与云 -->
  16833. <linearGradient id="linear-gradient-3" x1="481.92" y1="363.2" x2="481.92" y2="267.14" gradientUnits="userSpaceOnUse">
  16834. <stop offset="0" stop-color="#fff" stop-opacity="0" />
  16835. <stop offset="0.12" stop-color="#fff" stop-opacity="0.18" />
  16836. <stop offset="0.3" stop-color="#fff" stop-opacity="0.42" />
  16837. <stop offset="0.48" stop-color="#fff" stop-opacity="0.63" />
  16838. <stop offset="0.64" stop-color="#fff" stop-opacity="0.79" />
  16839. <stop offset="0.78" stop-color="#fff" stop-opacity="0.91" />
  16840. <stop offset="0.91" stop-color="#fff" stop-opacity="0.98" />
  16841. <stop offset="1" stop-color="#fff" />
  16842. </linearGradient>
  16843. <!-- 山 1 -->
  16844. <linearGradient id="linear-gradient-4" x1="293.94" y1="377.42" x2="299.58" y2="307.74" xlink:href="#linear-gradient-3" />
  16845. <!-- 房子下土地 -->
  16846. <linearGradient id="linear-gradient-5" x1="304.08" y1="357.53" x2="589.55" y2="357.53" gradientUnits="userSpaceOnUse">
  16847. <stop
  16848. offset="0"
  16849. stop-color="rgba({$currentThemeStore === 'dark' ? 'var(--color-dark-900), 0.1)' : 'var(--color-primary-900), 0.1'})"
  16850. />
  16851. <stop offset="1" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-900)' : 'var(--color-primary-900)'} />
  16852. </linearGradient>
  16853. <!-- 小树 -->
  16854. <linearGradient id="linear-gradient-6" x1="615.64" y1="385.54" x2="615.64" y2="337.77" gradientUnits="userSpaceOnUse">
  16855. <stop offset="0" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-700)' : 'var(--color-primary-700)'} />
  16856. <stop offset="1" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-500)' : 'var(--color-primary-500)'} />
  16857. </linearGradient>
  16858. <linearGradient id="linear-gradient-7" x1="645.03" y1="386.28" x2="645.03" y2="344.39" xlink:href="#linear-gradient-6" />
  16859. <linearGradient id="linear-gradient-8" x1="530.63" y1="385.84" x2="530.63" y2="340.47" xlink:href="#linear-gradient-6" />
  16860. <linearGradient id="linear-gradient-9" x1="395.26" y1="388.24" x2="395.26" y2="353.31" xlink:href="#linear-gradient-6" />
  16861. <!-- 大树 -->
  16862. <linearGradient id="linear-gradient-10" x1="89.92" y1="448.19" x2="226.82" y2="254.6" gradientUnits="userSpaceOnUse">
  16863. <stop offset="0" stop-color={$currentThemeStore === 'dark' ? 'var(--color-darkBlack)' : 'var(--color-primaryBlack)'} />
  16864. <stop offset="1" stop-color={$currentThemeStore === 'dark' ? 'var(--color-dark-800)' : 'var(--color-primary-800)'} />
  16865. </linearGradient>
  16866. <linearGradient id="linear-gradient-11" x1="141.89" y1="484.94" x2="278.79" y2="291.35" xlink:href="#linear-gradient-10" />
  16867. <!-- 云 -->
  16868. <linearGradient id="linear-gradient-12" x1="169.94" y1="166.78" x2="169.94" y2="82.46" xlink:href="#linear-gradient-3" />
  16869. <!-- 小河 -->
  16870. <linearGradient id="linear-gradient-13" x1="151.99" y1="365.33" x2="582.81" y2="365.33" xlink:href="#linear-gradient" />
  16871. <!-- 土地 -->
  16872. <linearGradient id="linear-gradient-14" x1="243.34" y1="586.07" x2="399.62" y2="365.09" xlink:href="#linear-gradient-10" />
  16873. <linearGradient id="linear-gradient-15" x1="201.81" y1="475.52" x2="208" y2="401.64" xlink:href="#linear-gradient-10" />
  16874. <!-- 云 -->
  16875. <linearGradient id="linear-gradient-16" x1="500.15" y1="179.64" x2="862.56" y2="179.64" xlink:href="#linear-gradient-3" />
  16876. <linearGradient id="linear-gradient-17" x1="532.11" y1="134.72" x2="532.11" y2="80.96" xlink:href="#linear-gradient-3" />
  16877. <!-- 鸟 -->
  16878. <linearGradient id="linear-gradient-18" x1="297.29" y1="245.04" x2="294.84" y2="236.16" xlink:href="#linear-gradient-10" />
  16879. <linearGradient
  16880. id="linear-gradient-19"
  16881. x1="353.05"
  16882. y1="283.25"
  16883. x2="348.44"
  16884. y2="266.53"
  16885. gradientTransform="matrix(1, 0.01, -0.01, 1, 0.8, 4.06)"
  16886. xlink:href="#linear-gradient-10"
  16887. />
  16888. <linearGradient
  16889. id="linear-gradient-20"
  16890. x1="391.03"
  16891. y1="260.57"
  16892. x2="386.96"
  16893. y2="245.77"
  16894. gradientTransform="matrix(0.97, 0.26, -0.26, 0.97, 80.16, -79.02)"
  16895. xlink:href="#linear-gradient-10"
  16896. />
  16897. <linearGradient
  16898. id="linear-gradient-21"
  16899. x1="448.52"
  16900. y1="222.49"
  16901. x2="445.09"
  16902. y2="210.06"
  16903. gradientTransform="translate(108.87 -112.9) rotate(19.64)"
  16904. xlink:href="#linear-gradient-10"
  16905. />
  16906. <!-- 房 -->
  16907. <linearGradient id="linear-gradient-22" x1="512.44" y1="317.53" x2="511.66" y2="307.93" xlink:href="#linear-gradient-6" />
  16908. <linearGradient id="linear-gradient-23" x1="518.15" y1="344.39" x2="518.15" y2="315.46" xlink:href="#linear-gradient-10" />
  16909. <linearGradient id="linear-gradient-24" x1="493.07" y1="353.96" x2="493.07" y2="305.26" xlink:href="#linear-gradient" />
  16910. <linearGradient id="linear-gradient-25" x1="493.07" y1="334.45" x2="493.07" y2="312.8" xlink:href="#linear-gradient-10" />
  16911. <!-- 日光晕 -->
  16912. <radialGradient
  16913. id="radial-gradient"
  16914. cx="353.5"
  16915. cy="241.44"
  16916. r="179"
  16917. gradientTransform="translate(274.26 -179.24) rotate(45)"
  16918. gradientUnits="userSpaceOnUse"
  16919. >
  16920. <stop offset="0" stop-color="red" />
  16921. <stop offset="1" />
  16922. </radialGradient>
  16923. <!-- 月光晕 -->
  16924. <radialGradient
  16925. id="radial-gradient-moon"
  16926. cx="353.5"
  16927. cy="241.44"
  16928. r="179"
  16929. gradientTransform="translate(274.26 -179.24) rotate(45)"
  16930. gradientUnits="userSpaceOnUse"
  16931. >
  16932. <stop offset="0" stop-color="white" />
  16933. <stop offset="1" />
  16934. </radialGradient>
  16935. </defs>
  16936. <!-- <title>2623046</title> -->
  16937. <!-- <g class="cls-1"> -->
  16938. <g id="OBJECTS">
  16939. <rect class="cls-2" width="614" height="383.76" />
  16940. <!-- 太阳 -->
  16941. <circle
  16942. class="cls-3 transition-all duration-1000 dark:translate-y-full"
  16943. cx="348.85"
  16944. cy="246.41"
  16945. r="32.45"
  16946. transform="translate(-114.76 27.34) rotate(-13.1)"
  16947. />
  16948. <!-- 月亮 -->
  16949. <path
  16950. class="cls-moon translate-y-full transition-all duration-1000 dark:translate-y-0"
  16951. d="M311.533 177.529C308.429 178.533 305.117 179.075 301.679 179.075C284.01 179.075 269.687 164.752 269.687 147.083C269.687 141.22 271.265 135.725 274.018 131C260.177 134.77 250 147.428 250 162.464C250 180.472 264.599 195.071 282.607 195.071C295.181 195.071 306.092 187.954 311.533 177.529Z"
  16952. />
  16953. <path
  16954. class="cls-4"
  16955. d="M618.71,258.8c-31.85,23.89-57.07,1.77-104-38.93-47.74-41.43-95.56,9.29-142,37.16S308.37,221.2,238,199.3c-64.75-20.16-125.43,2-170,29.33V441.88H682V264.06C657.67,234.51,642.92,240.64,618.71,258.8Z"
  16956. transform="translate(-68 -58.12)"
  16957. />
  16958. <path
  16959. class="cls-5 dark:hidden"
  16960. d="M549.25,273c-61.05-35.84-89.58,8-144,34.5s-84.93,20-207.71-46.45C147,233.67,103.56,227.38,68,231.24V441.88H682V219.05C613.42,213.69,602.69,304.32,549.25,273Z"
  16961. transform="translate(-68 -58.12)"
  16962. />
  16963. <path
  16964. class="cls-5-dark hidden dark:block"
  16965. d="M549.25,273c-61.05-35.84-89.58,8-144,34.5s-84.93,20-207.71-46.45C147,233.67,103.56,227.38,68,231.24V441.88H682V219.05C613.42,213.69,602.69,304.32,549.25,273Z"
  16966. transform="translate(-68 -58.12)"
  16967. />
  16968. <path
  16969. class="cls-6 dark:hidden"
  16970. d="M604,364.53c-42.8-27.87-35.83-2-95.56,5s-93.23-86.6-169.21-64.7c-45.36,13.07-67,19.91-162.25-11.95-30-10-72.33,5.64-109,19.85V441.88H682V361.3C662.54,371.51,631.08,382.17,604,364.53Z"
  16971. transform="translate(-68 -58.12)"
  16972. />
  16973. <path
  16974. class="cls-6-dark hidden dark:block"
  16975. d="M604,364.53c-42.8-27.87-35.83-2-95.56,5s-93.23-86.6-169.21-64.7c-45.36,13.07-67,19.91-162.25-11.95-30-10-72.33,5.64-109,19.85V441.88H682V361.3C662.54,371.51,631.08,382.17,604,364.53Z"
  16976. transform="translate(-68 -58.12)"
  16977. />
  16978. <path
  16979. class="cls-6 dark:hidden"
  16980. d="M500.77,337.32c-4.93,0-8.92,8.06-8.92,18a34.64,34.64,0,0,0,.39,5.29,8.59,8.59,0,0,0,8.11,7.22v6.77a.42.42,0,1,0,.84,0v-6.77a8.6,8.6,0,0,0,8.12-7.22,36,36,0,0,0,.39-5.29C509.7,345.38,505.7,337.32,500.77,337.32Z"
  16981. transform="translate(-68 -58.12)"
  16982. />
  16983. <path
  16984. class="cls-6 dark:hidden"
  16985. d="M567.8,330.69c-3.49,0-6.31,5.69-6.31,12.71a24.9,24.9,0,0,0,.28,3.74,6.05,6.05,0,0,0,5.73,5.1V357a.3.3,0,0,0,.59,0v-4.79a6.07,6.07,0,0,0,5.74-5.1,24.93,24.93,0,0,0,.27-3.74C574.1,336.38,571.28,330.69,567.8,330.69Z"
  16986. transform="translate(-68 -58.12)"
  16987. />
  16988. <path
  16989. class="cls-6 dark:hidden"
  16990. d="M89.56,290.43c-3.16,0-5.71,5.15-5.71,11.5a23,23,0,0,0,.25,3.39,5.49,5.49,0,0,0,5.19,4.61v4.33a.27.27,0,1,0,.53,0v-4.33A5.49,5.49,0,0,0,95,305.32a23,23,0,0,0,.25-3.39C95.26,295.58,92.71,290.43,89.56,290.43Z"
  16991. transform="translate(-68 -58.12)"
  16992. />
  16993. <path
  16994. class="cls-6 dark:hidden"
  16995. d="M120.66,281.36c-2.86,0-5.18,4.68-5.18,10.45a20.14,20.14,0,0,0,.23,3.07,5,5,0,0,0,4.71,4.19V303a.25.25,0,1,0,.49,0v-3.93a5,5,0,0,0,4.71-4.19,20.14,20.14,0,0,0,.23-3.07C125.85,286,123.52,281.36,120.66,281.36Z"
  16996. transform="translate(-68 -58.12)"
  16997. />
  16998. <path
  16999. class="cls-6 dark:hidden"
  17000. d="M142.78,284.24c-2.34,0-4.24,3.82-4.24,8.54a17,17,0,0,0,.19,2.52,4.09,4.09,0,0,0,3.85,3.43v3.21a.2.2,0,0,0,.4,0v-3.21a4.1,4.1,0,0,0,3.86-3.43,17,17,0,0,0,.18-2.52C147,288.06,145.12,284.24,142.78,284.24Z"
  17001. transform="translate(-68 -58.12)"
  17002. />
  17003. <path
  17004. class="cls-6 dark:hidden"
  17005. d="M375,291.65c-2.34,0-4.24,3.82-4.24,8.54a17,17,0,0,0,.19,2.52,4.09,4.09,0,0,0,3.85,3.43v3.21a.2.2,0,0,0,.4,0v-3.21a4.09,4.09,0,0,0,3.85-3.43,17,17,0,0,0,.19-2.52C379.28,295.47,377.38,291.65,375,291.65Z"
  17006. transform="translate(-68 -58.12)"
  17007. />
  17008. <path
  17009. class="cls-6 dark:hidden"
  17010. d="M343.52,293.91c-2.1,0-3.8,3.43-3.8,7.65a14.68,14.68,0,0,0,.17,2.25,3.65,3.65,0,0,0,3.45,3.07v2.88a.18.18,0,0,0,.18.18.18.18,0,0,0,.17-.18v-2.88a3.64,3.64,0,0,0,3.45-3.07,14.68,14.68,0,0,0,.17-2.25C347.31,297.34,345.61,293.91,343.52,293.91Z"
  17011. transform="translate(-68 -58.12)"
  17012. />
  17013. <path
  17014. class="cls-6 dark:hidden"
  17015. d="M320.29,303.65c-1.63,0-3,2.67-3,6a12.31,12.31,0,0,0,.13,1.75,2.85,2.85,0,0,0,2.69,2.39V316a.14.14,0,0,0,.28,0v-2.24a2.85,2.85,0,0,0,2.69-2.39,12.31,12.31,0,0,0,.13-1.75C323.25,306.32,321.92,303.65,320.29,303.65Z"
  17016. transform="translate(-68 -58.12)"
  17017. />
  17018. <path
  17019. class="cls-6 dark:hidden"
  17020. d="M394.56,301.23c-1.64,0-3,2.67-3,6a12.31,12.31,0,0,0,.13,1.75,2.85,2.85,0,0,0,2.69,2.39v2.24a.14.14,0,0,0,.14.14.14.14,0,0,0,.14-.14v-2.24a2.83,2.83,0,0,0,2.68-2.39,11,11,0,0,0,.13-1.75C397.51,303.9,396.19,301.23,394.56,301.23Z"
  17021. transform="translate(-68 -58.12)"
  17022. />
  17023. <!-- dark tree -->
  17024. <path
  17025. class="cls-6-dark hidden dark:block"
  17026. d="M500.77,337.32c-4.93,0-8.92,8.06-8.92,18a34.64,34.64,0,0,0,.39,5.29,8.59,8.59,0,0,0,8.11,7.22v6.77a.42.42,0,1,0,.84,0v-6.77a8.6,8.6,0,0,0,8.12-7.22,36,36,0,0,0,.39-5.29C509.7,345.38,505.7,337.32,500.77,337.32Z"
  17027. transform="translate(-68 -58.12)"
  17028. />
  17029. <path
  17030. class="cls-6-dark hidden dark:block"
  17031. d="M567.8,330.69c-3.49,0-6.31,5.69-6.31,12.71a24.9,24.9,0,0,0,.28,3.74,6.05,6.05,0,0,0,5.73,5.1V357a.3.3,0,0,0,.59,0v-4.79a6.07,6.07,0,0,0,5.74-5.1,24.93,24.93,0,0,0,.27-3.74C574.1,336.38,571.28,330.69,567.8,330.69Z"
  17032. transform="translate(-68 -58.12)"
  17033. />
  17034. <path
  17035. class="cls-6-dark hidden dark:block"
  17036. d="M89.56,290.43c-3.16,0-5.71,5.15-5.71,11.5a23,23,0,0,0,.25,3.39,5.49,5.49,0,0,0,5.19,4.61v4.33a.27.27,0,1,0,.53,0v-4.33A5.49,5.49,0,0,0,95,305.32a23,23,0,0,0,.25-3.39C95.26,295.58,92.71,290.43,89.56,290.43Z"
  17037. transform="translate(-68 -58.12)"
  17038. />
  17039. <path
  17040. class="cls-6-dark hidden dark:block"
  17041. d="M120.66,281.36c-2.86,0-5.18,4.68-5.18,10.45a20.14,20.14,0,0,0,.23,3.07,5,5,0,0,0,4.71,4.19V303a.25.25,0,1,0,.49,0v-3.93a5,5,0,0,0,4.71-4.19,20.14,20.14,0,0,0,.23-3.07C125.85,286,123.52,281.36,120.66,281.36Z"
  17042. transform="translate(-68 -58.12)"
  17043. />
  17044. <path
  17045. class="cls-6-dark hidden dark:block"
  17046. d="M142.78,284.24c-2.34,0-4.24,3.82-4.24,8.54a17,17,0,0,0,.19,2.52,4.09,4.09,0,0,0,3.85,3.43v3.21a.2.2,0,0,0,.4,0v-3.21a4.1,4.1,0,0,0,3.86-3.43,17,17,0,0,0,.18-2.52C147,288.06,145.12,284.24,142.78,284.24Z"
  17047. transform="translate(-68 -58.12)"
  17048. />
  17049. <path
  17050. class="cls-6-dark hidden dark:block"
  17051. d="M375,291.65c-2.34,0-4.24,3.82-4.24,8.54a17,17,0,0,0,.19,2.52,4.09,4.09,0,0,0,3.85,3.43v3.21a.2.2,0,0,0,.4,0v-3.21a4.09,4.09,0,0,0,3.85-3.43,17,17,0,0,0,.19-2.52C379.28,295.47,377.38,291.65,375,291.65Z"
  17052. transform="translate(-68 -58.12)"
  17053. />
  17054. <path
  17055. class="cls-6-dark hidden dark:block"
  17056. d="M343.52,293.91c-2.1,0-3.8,3.43-3.8,7.65a14.68,14.68,0,0,0,.17,2.25,3.65,3.65,0,0,0,3.45,3.07v2.88a.18.18,0,0,0,.18.18.18.18,0,0,0,.17-.18v-2.88a3.64,3.64,0,0,0,3.45-3.07,14.68,14.68,0,0,0,.17-2.25C347.31,297.34,345.61,293.91,343.52,293.91Z"
  17057. transform="translate(-68 -58.12)"
  17058. />
  17059. <path
  17060. class="cls-6-dark hidden dark:block"
  17061. d="M320.29,303.65c-1.63,0-3,2.67-3,6a12.31,12.31,0,0,0,.13,1.75,2.85,2.85,0,0,0,2.69,2.39V316a.14.14,0,0,0,.28,0v-2.24a2.85,2.85,0,0,0,2.69-2.39,12.31,12.31,0,0,0,.13-1.75C323.25,306.32,321.92,303.65,320.29,303.65Z"
  17062. transform="translate(-68 -58.12)"
  17063. />
  17064. <path
  17065. class="cls-6-dark hidden dark:block"
  17066. d="M394.56,301.23c-1.64,0-3,2.67-3,6a12.31,12.31,0,0,0,.13,1.75,2.85,2.85,0,0,0,2.69,2.39v2.24a.14.14,0,0,0,.14.14.14.14,0,0,0,.14-.14v-2.24a2.83,2.83,0,0,0,2.68-2.39,11,11,0,0,0,.13-1.75C397.51,303.9,396.19,301.23,394.56,301.23Z"
  17067. transform="translate(-68 -58.12)"
  17068. />
  17069. <!-- dark tree -->
  17070. <path
  17071. class="cls-7"
  17072. d="M682,302.9V403H281.83S369.2,293.31,468.3,323.39c33.32,10.11,81.84,21.23,142.45-17.92C635.58,289.43,661.35,293.63,682,302.9Z"
  17073. transform="translate(-68 -58.12)"
  17074. />
  17075. <path
  17076. class="cls-8"
  17077. d="M434.45,360.55c-29.86-19.91-47.78,32.52-127.41-11.28S236.7,324.05,177,331.35c-37.86,4.63-81.84-.61-109-5.07v115.6H518.8C490.07,411.33,451.9,372.18,434.45,360.55Z"
  17078. transform="translate(-68 -58.12)"
  17079. />
  17080. <rect class="cls-9" y="331.3" width="614" height="52.46" />
  17081. <path
  17082. class="cls-10"
  17083. d="M615.64,382.29a11.18,11.18,0,0,0,11.09-9.41,46.08,46.08,0,0,0,.51-6.88c0-12.92-5.2-23.39-11.6-23.39S604,353.08,604,366a46.08,46.08,0,0,0,.51,6.88,11.18,11.18,0,0,0,11.1,9.41Z"
  17084. transform="translate(-68 -58.12)"
  17085. />
  17086. <path
  17087. class="cls-11"
  17088. d="M619.84,358.34a.55.55,0,0,0-.77,0l-2.89,2.89v-7a.55.55,0,0,0-1.09,0v15.39l-4.92-4.92a.54.54,0,0,0-.77.77l5.69,5.69v19.87a.55.55,0,0,0,1.09,0V362.76l0,0,3.64-3.63A.55.55,0,0,0,619.84,358.34Z"
  17089. transform="translate(-68 -58.12)"
  17090. />
  17091. <path
  17092. class="cls-12"
  17093. d="M645,383.44a9.81,9.81,0,0,0,9.73-8.26,40.22,40.22,0,0,0,.45-6c0-11.33-4.56-20.51-10.18-20.51s-10.17,9.18-10.17,20.51a40.25,40.25,0,0,0,.44,6,9.82,9.82,0,0,0,9.73,8.26Z"
  17094. transform="translate(-68 -58.12)"
  17095. />
  17096. <path
  17097. class="cls-11"
  17098. d="M648.72,362.43a.48.48,0,0,0-.68,0L645.51,365v-6.09a.48.48,0,1,0-1,0v13.49l-4.32-4.31a.48.48,0,0,0-.68,0,.48.48,0,0,0,0,.67l5,5v17.42a.48.48,0,1,0,1,0V366.31l0,0,3.19-3.19A.48.48,0,0,0,648.72,362.43Z"
  17099. transform="translate(-68 -58.12)"
  17100. />
  17101. <path
  17102. class="cls-13"
  17103. d="M530.63,382.76a10.63,10.63,0,0,0,10.54-8.94,42.87,42.87,0,0,0,.49-6.54c0-12.27-4.94-22.21-11-22.21s-11,9.94-11,22.21a42.87,42.87,0,0,0,.49,6.54,10.63,10.63,0,0,0,10.53,8.94Z"
  17104. transform="translate(-68 -58.12)"
  17105. />
  17106. <path
  17107. class="cls-11"
  17108. d="M534.63,360a.5.5,0,0,0-.73,0l-2.75,2.74v-6.61a.52.52,0,0,0-1,0v14.62l-4.68-4.67a.52.52,0,0,0-.73.73l5.41,5.4v18.87a.52.52,0,1,0,1,0V364.2h0l3.46-3.45A.52.52,0,0,0,534.63,360Z"
  17109. transform="translate(-68 -58.12)"
  17110. />
  17111. <path
  17112. class="cls-14"
  17113. d="M395.26,385.86a8.16,8.16,0,0,0,8.11-6.88,32.49,32.49,0,0,0,.38-5c0-9.45-3.8-17.11-8.49-17.11s-8.48,7.66-8.48,17.11a33.8,33.8,0,0,0,.37,5,8.18,8.18,0,0,0,8.11,6.88Z"
  17114. transform="translate(-68 -58.12)"
  17115. />
  17116. <path
  17117. class="cls-11"
  17118. d="M398.34,368.35a.4.4,0,0,0-.57,0l-2.11,2.11v-5.09a.39.39,0,0,0-.4-.39.38.38,0,0,0-.39.39v11.26l-3.6-3.6a.4.4,0,0,0-.57,0,.4.4,0,0,0,0,.56l4.17,4.16v14.53a.39.39,0,0,0,.39.4.4.4,0,0,0,.4-.4v-20.7h0l2.66-2.66A.4.4,0,0,0,398.34,368.35Z"
  17119. transform="translate(-68 -58.12)"
  17120. />
  17121. <path
  17122. class="cls-15"
  17123. d="M197.81,242c-15.54,0-28.14,25.4-28.14,56.73a110.33,110.33,0,0,0,1.24,16.69,27.08,27.08,0,0,0,25.58,22.78v21.35a1.32,1.32,0,0,0,2.64,0V338.19a27.1,27.1,0,0,0,25.59-22.78A110.33,110.33,0,0,0,226,298.72C226,267.39,213.36,242,197.81,242Z"
  17124. transform="translate(-68 -58.12)"
  17125. />
  17126. <path
  17127. class="cls-16"
  17128. d="M264.47,266c-13.21,0-23.92,21.59-23.92,48.22a95,95,0,0,0,1,14.19,23,23,0,0,0,21.75,19.36v18.15a1.12,1.12,0,0,0,2.24,0V347.79a23,23,0,0,0,21.76-19.36,95,95,0,0,0,1-14.19C288.4,287.61,277.69,266,264.47,266Z"
  17129. transform="translate(-68 -58.12)"
  17130. />
  17131. <rect class="cls-18" y="346.89" width="614" height="36.87" />
  17132. <path
  17133. class="cls-19"
  17134. d="M682,421.93c-84.8.85-250.57,1.52-382.92-48.11C203.52,338,116.6,343.55,68,357.91v84H682Z"
  17135. transform="translate(-68 -58.12)"
  17136. />
  17137. <path class="cls-20" d="M68,398.32v43.56H344.91C244.58,381.37,128.79,388.5,68,398.32Z" transform="translate(-68 -58.12)" />
  17138. <!-- 云 -->
  17139. <path
  17140. class="cls-17 dark:hidden"
  17141. d="M271.87,160.77H68V127.89c12.36-7.71,30.21-15.11,43.12-4.78,21.72,17.38,34.27-7.24,49.24,4.83s26.07,26.55,56.48,15.45S271.87,160.77,271.87,160.77Z"
  17142. transform="translate(-68 -58.12)"
  17143. />
  17144. <path
  17145. class="cls-21 dark:hidden"
  17146. d="M682,164.66c-6-2.15-12.2-2.09-17.28,2.78-15.93,15.27-52.42-16.59-67.69,4s-92.9.66-96.88,24.55H682Z"
  17147. transform="translate(-68 -58.12)"
  17148. />
  17149. <path
  17150. class="cls-22 animate-cloudMove dark:hidden"
  17151. d="M519.5,117.79c17.43,8.5,31.58-9.9,42.64,2.48s36.55.17,50.27,15.21H451.82S489,102.91,519.5,117.79Z"
  17152. transform="translate(-68 -58.12)"
  17153. />
  17154. <!-- 鸟 -->
  17155. <path
  17156. class="cls-23 dark:hidden"
  17157. d="M294.88,236.75s-1.44-1.72-4.16-.42a4.77,4.77,0,0,1,4.6,2.7s.95-3.86,3.39-4C298.71,235.05,296.84,234.18,294.88,236.75Z"
  17158. transform="translate(-68 -58.12)"
  17159. />
  17160. <path
  17161. class="cls-24 dark:hidden"
  17162. d="M346.92,274.81s-2.68-3.26-7.82-.87c0,0,5.35-.71,8.61,5.17,0,0,1.87-7.25,6.45-7.44C354.16,271.67,350.65,270,346.92,274.81Z"
  17163. transform="translate(-68 -58.12)"
  17164. />
  17165. <path
  17166. class="cls-25 dark:hidden"
  17167. d="M390.73,259s-1.58-3.39-6.51-2.47c0,0,4.74.56,6.24,6.32,0,0,3.19-5.8,7.16-4.95C397.62,257.86,395,255.66,390.73,259Z"
  17168. transform="translate(-68 -58.12)"
  17169. />
  17170. <path
  17171. class="cls-26 dark:hidden"
  17172. d="M457.22,235.33s-1.09-3-5.28-2.52c0,0,3.93.8,4.79,5.73,0,0,3.08-4.64,6.34-3.65C463.07,234.89,461,232.87,457.22,235.33Z"
  17173. transform="translate(-68 -58.12)"
  17174. />
  17175. <!-- 鸟 -->
  17176. <polygon class="cls-27" points="530.69 315.91 505.61 315.91 493.13 306.1 518.22 306.1 530.69 315.91" />
  17177. <rect class="cls-28" x="505.61" y="315.91" width="25.08" height="22.41" />
  17178. <polygon class="cls-29" points="505.61 315.91 505.61 338.32 480.52 338.32 480.52 315.91 493.13 306.1 505.61 315.91" />
  17179. <polygon class="cls-30" points="498.64 324.83 498.64 317.54 493.1 313.17 487.49 317.54 487.49 324.83 498.64 324.83" />
  17180. <circle class="cls-31 dark:hidden" cx="353.5" cy="241.44" r="179" transform="translate(-135.18 262.55) rotate(-45)" />
  17181. <circle class="cls-moon-light hidden dark:block" cx="353.5" cy="241.44" r="179" transform="translate(-135.18 262.55) rotate(-45)" />
  17182. <!-- star -->
  17183. <path
  17184. class="animate-starTwinkle hidden dark:block"
  17185. d="M102 27.5C102 34.0667 105.441 39.5384 110 40.75C105.441 41.9616 102 47.4333 102 54C102 47.4333 98.5591 41.9616 94 40.75C98.5591 39.5384 102 34.0667 102 27.5Z"
  17186. fill="#fff"
  17187. />
  17188. <path
  17189. class="animate-starTwinkle2 hidden dark:block"
  17190. d="M555 21.4444C555 27.2815 558.011 32.1452 562 33.2222C558.011 34.2992 555 39.1629 555 45C555 39.1629 551.989 34.2992 548 33.2222C551.989 32.1452 555 27.2815 555 21.4444Z"
  17191. fill="#fff"
  17192. />
  17193. <path
  17194. class="animate-starTwinkle3 hidden dark:block"
  17195. d="M366 27.3333C366 31.7112 368.151 35.3589 371 36.1667C368.151 36.9744 366 40.6222 366 45C366 40.6222 363.849 36.9744 361 36.1667C363.849 35.3589 366 31.7112 366 27.3333Z"
  17196. fill="#fff"
  17197. />
  17198. <path
  17199. class="animate-starTwinkle4 hidden dark:block"
  17200. d="M534 94.3333C534 98.7112 536.151 102.359 539 103.167C536.151 103.974 534 107.622 534 112C534 107.622 531.849 103.974 529 103.167C531.849 102.359 534 98.7112 534 94.3333Z"
  17201. fill="#fff"
  17202. />
  17203. </g>
  17204. <!-- </g> -->
  17205. </svg>
  17206. <div class="flex justify-between gap-4 p-4">
  17207. <div class="w-1/3">
  17208. <ProgressLoop />
  17209. </div>
  17210. <div class="flex flex-1 flex-col justify-between py-2">
  17211. <div class="flex justify-around">
  17212. <Loading theme />
  17213. <Loading theme type="1_30" />
  17214. <Loading theme type="1_13" />
  17215. </div>
  17216. <div class="flex justify-around">
  17217. <Switch active />
  17218. <Switch active injClass="bg-success dark:bg-success" />
  17219. <Switch active injClass="!bg-error dark:!bg-error" />
  17220. </div>
  17221. </div>
  17222. </div>
  17223. <div class="flex flex-col gap-4 p-4">
  17224. <Progress />
  17225. </div>
  17226. <div class="flex flex-wrap justify-between">
  17227. {#each icons as icon}
  17228. <div class="flex-1 py-2 text-center">
  17229. <Icon name={icon} theme />
  17230. </div>
  17231. {/each}
  17232. </div>
  17233. <div class="p-4">
  17234. <Slider />
  17235. </div>
  17236. <Button>{isZh ? '按钮' : 'Button'}</Button>
  17237. <Calendar />
  17238. ================================================
  17239. FILE: docs/site/src/routes/guide/icon/+page.svelte
  17240. ================================================
  17241. <script lang="ts">
  17242. import { mdTextToHljs } from '../../../utils/index';
  17243. import { isWideScreenStore } from '../../../store';
  17244. // @ts-ignore
  17245. import text from '../../../../../mds/guide/icon.md';
  17246. // @ts-ignore
  17247. import text_en from '../../../../../mds/guide/icon_en.md';
  17248. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17249. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  17250. </script>
  17251. <article
  17252. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17253. ? 'max-w-full'
  17254. : 'max-w-7xl'}"
  17255. >
  17256. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17257. {@html hljsText}
  17258. </article>
  17259. ================================================
  17260. FILE: docs/site/src/routes/guide/icon-plugin/+page.svelte
  17261. ================================================
  17262. <script lang="ts">
  17263. import { mdTextToHljs, groupIconMdPlugin } from '../../../utils/index';
  17264. import { isWideScreenStore } from '../../../store';
  17265. // @ts-ignore
  17266. import iconPluginText from '../../../../../../packages/rollup-plugin-stdf-icon/README_CN.md';
  17267. // @ts-ignore
  17268. import iconPluginText_en from '../../../../../../packages/rollup-plugin-stdf-icon/README.md';
  17269. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17270. const text = mdTextToHljs(
  17271. (isZh ? groupIconMdPlugin(iconPluginText) : groupIconMdPlugin(iconPluginText_en)).replace(/<a href="/g, '<a target="_blank" href="')
  17272. );
  17273. </script>
  17274. <article
  17275. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17276. ? 'max-w-full'
  17277. : 'max-w-7xl'}"
  17278. >
  17279. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17280. {@html text}
  17281. </article>
  17282. ================================================
  17283. FILE: docs/site/src/routes/guide/internation/+page.svelte
  17284. ================================================
  17285. <script lang="ts">
  17286. import { mdTextToHljs } from '../../../utils/index';
  17287. import { isWideScreenStore } from '../../../store';
  17288. // @ts-ignore
  17289. import text from '../../../../../mds/guide/internation.md';
  17290. // @ts-ignore
  17291. import text_en from '../../../../../mds/guide/internation_en.md';
  17292. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17293. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  17294. </script>
  17295. <article
  17296. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17297. ? 'max-w-full'
  17298. : 'max-w-7xl'}"
  17299. >
  17300. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17301. {@html hljsText}
  17302. </article>
  17303. ================================================
  17304. FILE: docs/site/src/routes/guide/logo/+page.svelte
  17305. ================================================
  17306. <script lang="ts">
  17307. import { isWideScreenStore } from '../../../store';
  17308. </script>
  17309. <div class="mx-auto {$isWideScreenStore ? 'max-w-full' : 'max-w-7xl'}">
  17310. <div class="mb-4 flex justify-around gap-3 text-9xl font-bold md:justify-start md:gap-10">
  17311. <div class="text-dark dark:text-primary">S</div>
  17312. <div class="text-primary dark:text-dark">T</div>
  17313. <div class="text-primary dark:text-dark">D</div>
  17314. <div class="text-primary dark:text-dark">F</div>
  17315. </div>
  17316. <div class="max-w-full md:max-w-md">
  17317. <svg class="w-full" viewBox="0 0 91 81" fill="none" xmlns="http://www.w3.org/2000/svg">
  17318. <path
  17319. fill-rule="evenodd"
  17320. clip-rule="evenodd"
  17321. d="M0 1H50C64.8057 1 77.7325 9.04398 84.6487 21H50H40V31H50C55.5229 31 60 35.4771 60 41C60 46.5229 55.5229 51 50 51H40V81H20V21H0V1ZM90 41C90 63.0914 72.0914 81 50 81V61C61.0457 61 70 52.0457 70 41C70 37.3571 69.0261 33.9417 67.3243 31H88.7398C89.5625 34.1962 90 37.547 90 41Z"
  17322. class="fill-primary dark:fill-dark"
  17323. />
  17324. <path fill-rule="evenodd" clip-rule="evenodd" d="M20 1V31H40L20 81V51H0L20 1Z" class="fill-dark dark:fill-primary" />
  17325. <line y1="0.9" x2="90" y2="0.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17326. <line y1="10.9" x2="90" y2="10.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17327. <line y1="20.9" x2="90" y2="20.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17328. <line y1="30.9" x2="90" y2="30.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17329. <line y1="40.9" x2="90" y2="40.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17330. <line y1="50.9" x2="90" y2="50.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17331. <line y1="60.9" x2="90" y2="60.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17332. <line y1="70.9" x2="90" y2="70.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17333. <line y1="80.9" x2="90" y2="80.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17334. <line x1="0.1" y1="1" x2="0.0999965" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17335. <line x1="10.1" y1="1" x2="10.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17336. <line x1="20.1" y1="1" x2="20.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17337. <line x1="30.1" y1="1" x2="30.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17338. <line x1="40.1" y1="1" x2="40.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17339. <line x1="50.1" y1="1" x2="50.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17340. <line x1="60.1" y1="1" x2="60.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17341. <line x1="70.1" y1="1" x2="70.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17342. <line x1="80.1" y1="1" x2="80.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17343. <line x1="90.1" y1="1" x2="90.1" y2="81" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17344. <circle cx="50" cy="41" r="39.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17345. <circle cx="50" cy="41" r="19.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17346. <circle cx="50" cy="41" r="9.9" class="stroke-gray-400 dark:stroke-gray-600" stroke-width="0.2" stroke-dasharray="2 2" />
  17347. </svg>
  17348. </div>
  17349. </div>
  17350. ================================================
  17351. FILE: docs/site/src/routes/guide/md/+page.svelte
  17352. ================================================
  17353. <script lang="ts">
  17354. import { mdTextToHljs, groupIconMdPlugin } from '../../../utils/index';
  17355. import { isWideScreenStore } from '../../../store';
  17356. // @ts-ignore
  17357. import mdPluginText from '../../../../../../packages/rollup-plugin-md-ts/README_CN.md';
  17358. // @ts-ignore
  17359. import mdPluginText_en from '../../../../../../packages/rollup-plugin-md-ts/README.md';
  17360. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17361. const text = mdTextToHljs(
  17362. (isZh ? groupIconMdPlugin(mdPluginText) : groupIconMdPlugin(mdPluginText_en)).replace(/<a href="/g, '<a target="_blank" href="')
  17363. );
  17364. </script>
  17365. <article
  17366. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17367. ? 'max-w-full'
  17368. : 'max-w-7xl'}"
  17369. >
  17370. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17371. {@html text}
  17372. </article>
  17373. ================================================
  17374. FILE: docs/site/src/routes/guide/milestone/+page.svelte
  17375. ================================================
  17376. <script lang="ts">
  17377. import { mdTextToHljs } from '../../../utils/index';
  17378. import { isWideScreenStore } from '../../../store';
  17379. // @ts-ignore
  17380. import text from '../../../../../mds/guide/milestone.md';
  17381. // @ts-ignore
  17382. import text_en from '../../../../../mds/guide/milestone_en.md';
  17383. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17384. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  17385. </script>
  17386. <article
  17387. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17388. ? 'max-w-full'
  17389. : 'max-w-7xl'}"
  17390. >
  17391. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17392. {@html hljsText}
  17393. </article>
  17394. ================================================
  17395. FILE: docs/site/src/routes/guide/shortkey/+page.svelte
  17396. ================================================
  17397. <script lang="ts">
  17398. import { isWideScreenStore } from '../../../store';
  17399. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17400. </script>
  17401. <article
  17402. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto hidden pb-8 md:block {$isWideScreenStore
  17403. ? 'max-w-full'
  17404. : 'max-w-7xl'}"
  17405. >
  17406. {#if isZh}
  17407. <h2>全站</h2>
  17408. <ul>
  17409. <li>唤起或关闭组件快速搜索框:<b>⌘ + K(Ctrl + K)</b>。</li>
  17410. <li>快速搜索显示时:上下方向键切换选项,回车键选择,ESC 键聚焦输入框或关闭。</li>
  17411. </ul>
  17412. <h2>组件页面</h2>
  17413. <ul>
  17414. <li>上下方向键切换组件,左右方向键切换选项卡。</li>
  17415. </ul>
  17416. {:else}
  17417. <h2>The whole website</h2>
  17418. <ul>
  17419. <li>Call up or close the component quick search box: <b>⌘ + K(Ctrl + K)</b>.</li>
  17420. <li>
  17421. When the quick search is displayed: use the up and down arrow keys to switch options, the enter key to select, and the ESC key to
  17422. focus the input box or close it.
  17423. </li>
  17424. </ul>
  17425. <h2>Componenst page</h2>
  17426. <ul>
  17427. <li>Use the up and down arrow keys to switch components, and the left and right arrow keys to switch tabs.</li>
  17428. </ul>
  17429. {/if}
  17430. </article>
  17431. <article class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark block max-w-5xl pb-12 md:hidden">
  17432. {#if isZh}
  17433. <p>快捷键仅用于桌面端。</p>
  17434. {:else}
  17435. <p>Keyboard shortcuts are only available on the desktop site.</p>
  17436. {/if}
  17437. </article>
  17438. ================================================
  17439. FILE: docs/site/src/routes/guide/theme/+page.svelte
  17440. ================================================
  17441. <script lang="ts">
  17442. import { mdTextToHljs } from '../../../utils/index';
  17443. import { isWideScreenStore } from '../../../store';
  17444. // @ts-ignore
  17445. import theme from '../../../../../mds/guide/theme.md';
  17446. // @ts-ignore
  17447. import theme_en from '../../../../../mds/guide/theme_en.md';
  17448. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17449. const text = mdTextToHljs((isZh ? theme : theme_en).replace(/<a href="/g, '<a target="_blank" href="'));
  17450. </script>
  17451. <article
  17452. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-12 {$isWideScreenStore
  17453. ? 'max-w-full'
  17454. : 'max-w-7xl'}"
  17455. >
  17456. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17457. {@html text}
  17458. </article>
  17459. ================================================
  17460. FILE: docs/site/src/routes/guide/vscode/+page.svelte
  17461. ================================================
  17462. <script lang="ts">
  17463. import { mdTextToHljs } from '../../../utils/index';
  17464. import { isWideScreenStore } from '../../../store';
  17465. // @ts-ignore
  17466. import text from '../../../../../mds/guide/vscode.md';
  17467. // @ts-ignore
  17468. import text_en from '../../../../../mds/guide/vscode_en.md';
  17469. const isZh = localStorage.getItem('lang') === 'zh_CN';
  17470. const hljsText = mdTextToHljs((isZh ? text : text_en).replace(/<a href="/g, '<a target="_blank" href="'));
  17471. </script>
  17472. <article
  17473. class="prose dark:prose-invert prose-strong:text-primary dark:prose-strong:text-dark mx-auto pb-8 {$isWideScreenStore
  17474. ? 'max-w-full'
  17475. : 'max-w-7xl'}"
  17476. >
  17477. <!-- eslint-disable-next-line svelte/no-at-html-tags -->
  17478. {@html hljsText}
  17479. </article>
  17480. ================================================
  17481. FILE: docs/site/src/utils/code-group-svg-data.js
  17482. ================================================
  17483. export default [
  17484. {
  17485. name: 'pnpm',
  17486. cli: 'pnpm create stdf',
  17487. svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path fill="#f9ad00" d="M30 10.75h-8.749V2H30Zm-9.626 0h-8.75V2h8.75Zm-9.625 0H2V2h8.749ZM30 20.375h-8.749v-8.75H30Z"/><path fill="#4e4e4e" d="M20.374 20.375h-8.75v-8.75h8.75Zm0 9.625h-8.75v-8.75h8.75ZM30 30h-8.749v-8.75H30Zm-19.251 0H2v-8.75h8.749Z"/></svg>'
  17488. },
  17489. {
  17490. name: 'npm',
  17491. cli: 'npm create stdf@latest',
  17492. svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256"><path fill="#c12127" d="M0 256V0h256v256z"/><path fill="#fff" d="M48 48h160v160h-32V80h-48v128H48z"/></svg>'
  17493. },
  17494. {
  17495. name: 'bun',
  17496. cli: 'bun create stdf',
  17497. svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1.14em" height="1em" viewBox="0 0 256 225"><path d="M228.747 65.588a38 38 0 0 0-1.62-1.62c-.55-.519-1.07-1.102-1.62-1.62c-.551-.52-1.07-1.102-1.62-1.62c-.551-.52-1.07-1.103-1.62-1.621c-.552-.519-1.07-1.102-1.62-1.62c-.552-.519-1.07-1.102-1.621-1.62c-.551-.52-1.07-1.102-1.62-1.62a85.74 85.74 0 0 1 25.632 59.819c0 53.695-54.505 97.377-121.519 97.377c-37.525 0-71.097-13.707-93.424-35.192l1.62 1.62l1.62 1.62l1.62 1.62l1.621 1.621l1.62 1.62l1.62 1.62l1.621 1.62c22.295 22.393 56.612 36.813 95.044 36.813c67.014 0 121.519-43.682 121.519-97.215c0-22.878-9.851-44.557-27.253-61.602"/><path fill="#fbf0df" d="M234.937 114.066c0 49.288-50.779 89.243-113.418 89.243S8.101 163.354 8.101 114.066c0-30.558 19.443-57.552 49.32-73.56C87.3 24.498 105.9 8.101 121.52 8.101s28.97 13.384 64.097 32.405c29.878 16.008 49.32 43.002 49.32 73.56"/><path fill="#f6dece" d="M234.937 114.066a70.2 70.2 0 0 0-2.593-18.73c-8.846 107.909-140.476 113.093-192.227 80.818a129.62 129.62 0 0 0 81.402 27.155c62.542 0 113.418-40.02 113.418-89.243"/><path fill="#fffefc" d="M77.87 34.576c14.484-8.684 33.733-24.984 52.658-25.017a30.1 30.1 0 0 0-9.009-1.458c-7.842 0-16.203 4.05-26.734 10.143c-3.662 2.139-7.453 4.504-11.472 6.967c-7.55 4.666-16.202 9.948-25.924 15.23c-30.85 16.69-49.288 44.201-49.288 73.625v3.856C27.74 48.542 63.417 43.261 77.87 34.576"/><path fill="#ccbea7" d="M112.186 16.3a53.18 53.18 0 0 1-18.244 40.409c-.907.81-.194 2.365.972 1.912c10.92-4.245 25.665-16.948 19.443-42.58c-.259-1.459-2.17-1.07-2.17.259m7.356 0a52.63 52.63 0 0 1 5.217 43.65c-.388 1.134 1.005 2.106 1.783 1.166c7.096-9.073 13.286-27.09-5.25-46.534c-.94-.842-2.398.454-1.75 1.588zm8.944-.551a53.2 53.2 0 0 1 22.198 38.108a1.07 1.07 0 0 0 2.106.357c2.981-11.31 1.296-30.59-23.235-40.604c-1.296-.518-2.138 1.232-1.069 2.01zM68.666 49.45a54.9 54.9 0 0 0 33.928-29.164c.584-1.167 2.43-.713 2.14.583c-5.607 25.924-24.37 31.336-36.035 30.623c-1.232.032-1.2-1.685-.033-2.042"/><path d="M121.519 211.443C54.505 211.443 0 167.761 0 114.066c0-32.405 20.026-62.64 53.566-80.754c9.721-5.184 18.05-10.402 25.47-14.97c4.083-2.528 7.94-4.894 11.666-7.097C102.076 4.505 111.797 0 121.519 0s18.212 3.889 28.84 10.175c3.241 1.847 6.482 3.856 9.949 6.06c8.069 4.99 17.175 10.629 29.164 17.077c33.54 18.115 53.566 48.316 53.566 80.754c0 53.695-54.505 97.377-121.519 97.377m0-203.342c-7.842 0-16.203 4.05-26.734 10.143c-3.662 2.139-7.453 4.504-11.472 6.967c-7.55 4.666-16.202 9.948-25.924 15.23c-30.85 16.69-49.288 44.201-49.288 73.625c0 49.223 50.876 89.276 113.418 89.276s113.418-40.053 113.418-89.276c0-29.424-18.439-56.936-49.32-73.56c-12.25-6.48-21.81-12.573-29.554-17.369c-3.532-2.17-6.773-4.18-9.722-5.962c-9.818-5.833-16.98-9.074-24.822-9.074"/><path fill="#b71422" d="M144.365 137.722a28.94 28.94 0 0 1-9.463 15.263a22.07 22.07 0 0 1-12.962 6.092a22.17 22.17 0 0 1-13.383-6.092a28.94 28.94 0 0 1-9.333-15.263a2.333 2.333 0 0 1 2.593-2.625h39.988a2.333 2.333 0 0 1 2.56 2.625"/><path fill="#ff6164" d="M108.557 153.244a22.4 22.4 0 0 0 13.351 6.157a22.4 22.4 0 0 0 13.318-6.157a34.5 34.5 0 0 0 3.241-3.468a22.13 22.13 0 0 0-15.879-7.485a19.93 19.93 0 0 0-16.202 9.008c.745.681 1.393 1.33 2.171 1.945"/><path d="M109.076 150.684a17.37 17.37 0 0 1 13.577-6.74a19.44 19.44 0 0 1 12.962 5.476a51 51 0 0 0 2.139-2.495a22.68 22.68 0 0 0-15.263-6.254a20.61 20.61 0 0 0-15.846 7.647a31 31 0 0 0 2.43 2.366"/><path d="M121.81 161.021a24.05 24.05 0 0 1-14.42-6.481a30.85 30.85 0 0 1-10.077-16.365a3.89 3.89 0 0 1 .842-3.24a4.57 4.57 0 0 1 3.662-1.653h39.988a4.67 4.67 0 0 1 3.661 1.653a3.86 3.86 0 0 1 .81 3.24A30.85 30.85 0 0 1 136.2 154.54c-3.93 3.717-9 6-14.388 6.481m-19.993-23.98c-.519 0-.648.227-.68.292a26.86 26.86 0 0 0 8.846 14.16a20.2 20.2 0 0 0 11.828 5.672a20.35 20.35 0 0 0 11.828-5.606a26.9 26.9 0 0 0 8.814-14.161a.68.68 0 0 0-.648-.292z"/><g transform="translate(53.792 88.4)"><ellipse cx="117.047" cy="40.183" fill="#febbd0" rx="18.957" ry="11.147"/><ellipse cx="18.957" cy="40.183" fill="#febbd0" rx="18.957" ry="11.147"/><path d="M27.868 35.71a17.855 17.855 0 1 0-17.822-17.854c0 9.848 7.974 17.837 17.822 17.855m80.268 0A17.855 17.855 0 1 0 90.41 17.857c-.018 9.818 7.908 17.801 17.726 17.855"/><path fill="#fff" d="M22.36 18.99a6.708 6.708 0 1 0 .064-13.416a6.708 6.708 0 0 0-.065 13.416m80.267 0a6.708 6.708 0 1 0-.065 0z"/></g></svg>'
  17498. },
  17499. {
  17500. name: 'yarn',
  17501. cli: 'yarn create stdf',
  17502. svg: '<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32"><path fill="#2188b6" d="M28.208 24.409a10.5 10.5 0 0 0-3.959 1.822a23.7 23.7 0 0 1-5.835 2.642a1.63 1.63 0 0 1-.983.55a62 62 0 0 1-6.447.577c-1.163.009-1.876-.3-2.074-.776a1.573 1.573 0 0 1 .866-2.074a4 4 0 0 1-.514-.379c-.171-.171-.352-.514-.406-.388c-.225.55-.343 1.894-.947 2.5c-.83.839-2.4.559-3.328.072c-1.019-.541.072-1.813.072-1.813a.73.73 0 0 1-.992-.343a4.85 4.85 0 0 1-.667-2.949a5.37 5.37 0 0 1 1.749-2.895a9.3 9.3 0 0 1 .658-4.4a10.45 10.45 0 0 1 3.165-3.661S6.628 10.747 7.35 8.817c.469-1.262.658-1.253.812-1.308a3.6 3.6 0 0 0 1.452-.857a5.27 5.27 0 0 1 4.41-1.7S15.2 1.4 16.277 2.09a18.4 18.4 0 0 1 1.533 2.886s1.281-.748 1.425-.469a11.33 11.33 0 0 1 .523 6.132a14 14 0 0 1-2.6 5.411c-.135.225 1.551.938 2.615 3.887c.983 2.7.108 4.96.262 5.212c.027.045.036.063.036.063s1.127.09 3.391-1.308a8.5 8.5 0 0 1 4.277-1.604a1.081 1.081 0 0 1 .469 2.11Z"/></svg>'
  17503. }
  17504. ];
  17505. ================================================
  17506. FILE: docs/site/src/utils/index.ts
  17507. ================================================
  17508. import Color from 'color';
  17509. import { oklch, parse, formatHex } from 'culori';
  17510. import codeGroupSvgData from './code-group-svg-data';
  17511. import hljs from 'highlight.js';
  17512. // @ts-expect-error - highlightjs-svelte 缺少类型定义
  17513. import hljs_svelte from 'highlightjs-svelte';
  17514. hljs_svelte(hljs);
  17515. /**
  17516. * 节流,每 n 毫秒执行一次
  17517. * @param {function} func - 需要节流的函数
  17518. * @param {number} wait - 节流的时间间隔
  17519. * @returns {function} - 返回节流后的函数
  17520. * @example
  17521. * const throttleFunc = throttle(() => console.log(123), 1000)
  17522. */
  17523. export const throttle = <T extends (...args: unknown[]) => void>(func: T, wait: number = 100) => {
  17524. let timer: null | ReturnType<typeof setInterval> = null;
  17525. return function (...args: Parameters<T>) {
  17526. if (timer) {
  17527. return;
  17528. }
  17529. timer = setTimeout(() => {
  17530. func(...args);
  17531. timer = null;
  17532. }, wait);
  17533. };
  17534. };
  17535. /**
  17536. * 字符过滤器,防止 HTML 的特殊字符如 <、>、& 等被转义
  17537. * @param {string} text - 需要处理的字符串
  17538. * @returns {string} - 返回处理后的字符串
  17539. * @example
  17540. * htmlFilter('<div>123</div>') // <div>123</div>
  17541. */
  17542. const htmlFilter = (text: string) => {
  17543. // 抽离成可配置的匹配列表
  17544. const matchList = {
  17545. '&lt;': '<',
  17546. '&gt;': '>',
  17547. '&amp;': '&',
  17548. '&#34;': '"',
  17549. '&quot;': '"',
  17550. '&#39;': "'"
  17551. };
  17552. let regStr = '(' + Object.keys(matchList).toString() + ')';
  17553. // ↑ ------------【*提取匹配列表 key 值*】.【组数转字符串】
  17554. regStr = regStr.replace(/,/g, ')|(');
  17555. // ↑ 通过匹配将其更新为正则的字符串类型
  17556. const regExp = new RegExp(regStr, 'g');
  17557. // ↑ ------- 字符串 转 正则 方法
  17558. return text.replace(regExp, (match) => matchList[match as keyof typeof matchList]);
  17559. // ↑ ------ 替换方法 (正则,当前 key => 返回当前被匹配的 key 值)
  17560. };
  17561. /**
  17562. * 将字符串中的一部分替换成另一部分
  17563. * @param {string} str - 需要处理的字符串
  17564. * @param {string} findText - 需要被替换的部分
  17565. * @param {string} replaceText - 需要替换成的部分
  17566. * @returns {string} - 返回处理后的字符串
  17567. * @example
  17568. * replacePart('http://www.baidu.com?name=1&age=2', 'name=1', 'name=2') // http://www.baidu.com?name=2&age=2
  17569. */
  17570. const replacePart = (str: string, findText: string, replaceText: string) => {
  17571. return str.replace(findText, replaceText);
  17572. };
  17573. /**
  17574. * 将 Markdown 文档中的 code 标签高亮
  17575. * @param {string} mdText - 需要处理的 Markdown 文本
  17576. * @returns {string} - 返回处理后的 Markdown 文本
  17577. * @example
  17578. * mdTextToHljs('```js\nconsole.log(123)\n```') // <code class="hljs language-js"><span class="hljs-built_in">console</span>.log(<span class="hljs-number">123</span>)</code>
  17579. */
  17580. export const mdTextToHljs = (mdText: string, language: string = '') => {
  17581. // 将所有 <td><code> 标签替换为 <td><code class="hljs language-typescript">
  17582. mdText = mdText.replace(/<td><code>/g, `<td><code class="${language ? 'language-' + language : ''}">`);
  17583. if (mdText.indexOf('<code class="') > 0) {
  17584. let apiText = mdText.indexOf('<code class="') > 0 ? htmlFilter(mdText).replace(/<code class="/g, '<code class="hljs ') : mdText;
  17585. const codeTexts = apiText.match(/<code[\s\S]*?<\/code>/g);
  17586. if (!codeTexts) return apiText;
  17587. for (let t = 0; t < codeTexts.length; t++) {
  17588. const languageMatch = codeTexts[t].match(/<code class="hljs language-(.*?)">/);
  17589. const language = languageMatch ? languageMatch[1] : ''; //语言
  17590. const codeMatch = codeTexts[t].match(/<code[\s\S]*?>([\s\S]*?)<\/code>/);
  17591. const code = codeMatch ? codeMatch[1] : '';
  17592. const highlightedCode = language
  17593. ? hljs.highlight(code, {
  17594. language,
  17595. ignoreIllegals: true
  17596. }).value
  17597. : hljs.highlightAuto(code).value;
  17598. // 将高亮代码替换原代码
  17599. const newCode = codeTexts[t].replace(code, highlightedCode);
  17600. apiText = replacePart(apiText, codeTexts[t], newCode);
  17601. }
  17602. return apiText;
  17603. } else {
  17604. return mdText;
  17605. }
  17606. };
  17607. /**
  17608. * 传入解析出来的 md 文档字符,找到其中 ::: code-group 与 ::: 之间的代码块,并将其分组,实现代码块的 tab 分组显示,
  17609. * 其中 label 标签中的内容为 tab 标签的标题,并在文字前面增加一个 icon 标签,icon 标签的 class 内容为 iconfont 的类名
  17610. * @param {string} md - 解析出来的 md 文档字符
  17611. * @returns {string} - 返回处理后的 md 文档字符
  17612. */
  17613. export const groupIconMdPlugin = (md: string) => {
  17614. // 找出自字符中所有的 ::: code-group 与 ::: 之间的字符组成数组
  17615. const codeGroupStrListAll = md.match(/<!-- :::code-groups -->[\s\S]*?<!-- ::: -->/g);
  17616. if (!codeGroupStrListAll) {
  17617. return md;
  17618. }
  17619. const codeGroupStrList = codeGroupStrListAll.map((item) =>
  17620. item
  17621. .replace(/<!-- :::code-groups -->/g, '')
  17622. .replace(/<!-- ::: -->/g, '')
  17623. .split('<!-- :: -->')
  17624. );
  17625. const codeGroupList = codeGroupStrList.map((item) =>
  17626. item.map((subItem) => {
  17627. return {
  17628. tab: subItem.match(/<!-- (.*?) -->/)?.[1],
  17629. code: subItem.replace(/<!-- (.*?) -->/, '')
  17630. };
  17631. })
  17632. );
  17633. const codeGroupHtmlList = codeGroupList.map((item, index) => {
  17634. const arr: { label: string; code: string }[] = [];
  17635. item.forEach((subItem, subIndex) => {
  17636. const label = `
  17637. <input id="tab-${index + '-' + subIndex}" type="radio" name="tab-${index}" class="peer/tab-${index + '-' + subIndex} w-0 hidden" ${
  17638. subIndex === 0 ? 'checked' : ''
  17639. } />
  17640. <label
  17641. for="tab-${index + '-' + subIndex}"
  17642. class="border-b-2 border-black/10 dark:border-white/10 peer-checked/tab-${index + '-' + subIndex}:border-primary dark:peer-checked/tab-${
  17643. index + '-' + subIndex
  17644. }:border-dark transition duration-300 cursor-pointer py-2 px-3 inline-flex items-center gap-1 text-xs"
  17645. >
  17646. ${codeGroupSvgData.find((icon) => icon.name === subItem.tab)?.svg}${subItem.tab}
  17647. </label>
  17648. `;
  17649. const code = `<div class="hidden peer-checked/tab-${index + '-' + subIndex}:block w-full">${subItem.code}</div>`;
  17650. arr.push({ label, code });
  17651. });
  17652. return `
  17653. <section class="flex flex-row flex-wrap bg-black/5 dark:bg-[#202020] rounded-sm mb-4">
  17654. ${arr.map((item) => item.label).join('')}
  17655. ${arr.map((item) => item.code).join('')}
  17656. </section>
  17657. `;
  17658. });
  17659. const replaceCodeGroups = (inputString: string, replacements: string[]) => {
  17660. // 定义正则表达式匹配 <!-- :::code-groups --> 与 <!-- ::: --> 之间的内容
  17661. const regex = /<!--\s*:::code-groups\s*-->(.*?)<!--\s*:::\s*-->/gs;
  17662. let index = 0;
  17663. // 替换匹配到的部分
  17664. inputString = inputString.replace(regex, () => {
  17665. if (index < replacements.length) {
  17666. return replacements[index++];
  17667. }
  17668. return '';
  17669. });
  17670. return inputString;
  17671. };
  17672. return replaceCodeGroups(md, codeGroupHtmlList).replace(/w-full">\n\n<pre>/g, 'w-full">\n\n<pre style="margin: 0;">');
  17673. };
  17674. /**
  17675. * 去除 url 最后一项的?方法
  17676. * @param {string} url - 需要处理的 url
  17677. * @returns {string} - 返回处理后的 url
  17678. * @example
  17679. * delLastParamsUrl('http://www.baidu.com?') // http://www.baidu.com
  17680. */
  17681. const delLastParamsUrl = (url: string) => {
  17682. if (url.lastIndexOf('?') === url.length - 1) {
  17683. url = url.substring(0, url.length - 1);
  17684. }
  17685. return url;
  17686. };
  17687. /**
  17688. * 去除 url 中指定参数的方法
  17689. * @param {string} url - 需要处理的 url
  17690. * @param {string} name - 需要去除的参数名
  17691. * @returns {string} - 返回处理后的 url
  17692. * @example
  17693. * delParamsUrl('http://www.baidu.com?name=1&age=2', 'name') // http://www.baidu.com?age=2
  17694. */
  17695. export const delParamsUrl = (url: string, name: string) => {
  17696. const baseUrl = url.split('?')[0] + '?';
  17697. const query = url.split('?')[1];
  17698. if (query.indexOf(name) > -1) {
  17699. const obj: Record<string, string> = {};
  17700. const arr = query.split('&');
  17701. for (let i = 0; i < arr.length; i++) {
  17702. const key = arr[i].split('=')[0];
  17703. obj[key] = arr[i].split('=')[1];
  17704. }
  17705. delete obj[name];
  17706. url = baseUrl + JSON.stringify(obj).replace(/["{}]/g, '').replace(/:/g, '=').replace(/,/g, '&');
  17707. return delLastParamsUrl(url);
  17708. } else {
  17709. return delLastParamsUrl(url);
  17710. }
  17711. };
  17712. /**
  17713. * 传入 hex 格式的颜色值,将其转换成 oklch 格式,oklch(l c h),其中 lch 为 0-1 之间的值,保留三位小数
  17714. * @param {string} str - 颜色值
  17715. * @returns {string} - 返回 oklch 格式的颜色值
  17716. * @example
  17717. * getOklchFunc('#000') // 'oklch(0 0 0)'
  17718. */
  17719. export const getOklchFunc = (str: string) => {
  17720. const l = oklch(parse(str))?.l || 0;
  17721. const c = oklch(parse(str))?.c || 0;
  17722. const h = oklch(parse(str))?.h || 0;
  17723. return `oklch(${parseFloat(l.toFixed(3))} ${parseFloat(c.toFixed(3))} ${parseFloat(h.toFixed(3))})`;
  17724. };
  17725. /**
  17726. * 传入 oklch 格式色值,将其转为成 hex 格式
  17727. * @param {string} str - 颜色值
  17728. * @returns {string} - 返回 hex 格式的颜色值
  17729. * @example
  17730. * getHexFunc('oklch(0 0 0)') // '#000000'
  17731. */
  17732. export const getHexFunc = (oklchString: string) => {
  17733. // 解析字符串,提取 l, c, h 值
  17734. const match = oklchString.match(/oklch\(([\d.]+)\s+([\d.]+)\s+([\d.]+)\)/);
  17735. if (match) {
  17736. const [_, l, c, h] = match.map(Number); // 转换为数字
  17737. // 创建 OKLCH 对象
  17738. const oklchColor = { mode: 'oklch' as const, l, c, h };
  17739. // 转换为 HEX
  17740. const hexColor = formatHex(oklchColor);
  17741. return hexColor;
  17742. } else {
  17743. return oklchString;
  17744. }
  17745. };
  17746. const formats = ['hex', 'rgb', 'hsl'];
  17747. /**
  17748. * 获取颜色格式
  17749. * @param {string} format - 颜色格式
  17750. * @returns {string} - 返回颜色格式
  17751. * @example
  17752. * getFormat('hex') // hex
  17753. */
  17754. const getFormat = (format: string) => {
  17755. if (!format || formats.indexOf(format) < 0) {
  17756. return 'hex';
  17757. }
  17758. return format;
  17759. };
  17760. /**
  17761. * 获取颜色字符串
  17762. * @param {object} color - 颜色对象
  17763. * @param {string} format - 颜色格式
  17764. * @returns {string} - 返回颜色字符串
  17765. * @example
  17766. * getColorString(Color('#fff'),'rgb') // rgb(255,255,255)
  17767. */
  17768. const getColorString = (color: Color, format: string) => {
  17769. const innerFormat = getFormat(format);
  17770. if (innerFormat === 'hex') {
  17771. return color[innerFormat as 'hex']();
  17772. }
  17773. return color[innerFormat as 'rgb' | 'hsl']().round().string();
  17774. };
  17775. /**
  17776. * 动态梯度算法
  17777. * @param {string} originColor - 颜色值
  17778. * @param {number} i - 中间值
  17779. * @param {string} format - 颜色格式
  17780. * @returns {string} - 返回颜色字符串
  17781. */
  17782. const colorPalette = (originColor: string, i: number, format: string) => {
  17783. const color = Color(originColor.indexOf('#') > -1 ? originColor : getHexFunc(originColor));
  17784. const h = color.hue();
  17785. const s = color.saturationv();
  17786. const v = color.value();
  17787. const hueStep = 2;
  17788. const maxSaturationStep = 100;
  17789. const minSaturationStep = 9;
  17790. const maxValue = 100;
  17791. const minValue = 30;
  17792. const getNewHue = (isLight: boolean, i: number) => {
  17793. let hue;
  17794. if (h >= 60 && h <= 240) {
  17795. hue = isLight ? h - hueStep * i : h + hueStep * i;
  17796. } else {
  17797. hue = isLight ? h + hueStep * i : h - hueStep * i;
  17798. }
  17799. if (hue < 0) {
  17800. hue += 360;
  17801. } else if (hue >= 360) {
  17802. hue -= 360;
  17803. }
  17804. return Math.round(hue);
  17805. };
  17806. const getNewSaturation = (isLight: boolean, i: number) => {
  17807. let newSaturation;
  17808. if (isLight) {
  17809. newSaturation = s <= minSaturationStep ? s : s - ((s - minSaturationStep) / 5) * i;
  17810. } else {
  17811. newSaturation = s + ((maxSaturationStep - s) / 4) * i;
  17812. }
  17813. return newSaturation;
  17814. };
  17815. const getNewValue = (isLight: boolean, i: number) => {
  17816. return isLight ? v + ((maxValue - v) / 5) * i : v <= minValue ? v : v - ((v - minValue) / 4) * i;
  17817. };
  17818. const isLight = i < 6;
  17819. const index = isLight ? 6 - i : i - 6;
  17820. const retColor =
  17821. i === 6
  17822. ? color
  17823. : Color({
  17824. h: getNewHue(isLight, index),
  17825. s: getNewSaturation(isLight, index) < 0 ? 4 : getNewSaturation(isLight, index),
  17826. v: getNewValue(isLight, index)
  17827. });
  17828. return getColorString(retColor, format);
  17829. };
  17830. /**
  17831. * 根据给定颜色通过算法生成指定包含十一个颜色的梯度色板
  17832. * @param {string} color - 颜色值
  17833. * @param {Object} options - 配置项
  17834. * @param {number} options.index - 指定生成的颜色在梯度色板中的位置,取值范围为 1-10,默认为 6
  17835. * @param {boolean} options.list - 是否生成包含十个颜色的梯度色板
  17836. * @param {string} options.format 'hex' | 'rgb' | 'hsl'
  17837. * @return string | string[]
  17838. * @example
  17839. * generatePalette('#0B24FB' { index: 1 }) // '#E8EEFF'
  17840. */
  17841. export const generatePalette = (
  17842. color: string,
  17843. options: { list: boolean; index: number; format: string } = {
  17844. list: true,
  17845. index: 6,
  17846. format: 'hex'
  17847. }
  17848. ) => {
  17849. const { list, index, format } = options;
  17850. if (list) {
  17851. const list = [];
  17852. for (let i = 0; i <= 10; i++) {
  17853. list.push(colorPalette(color, i, format));
  17854. }
  17855. return list;
  17856. }
  17857. return colorPalette(color, index, format);
  17858. };
  17859. /**
  17860. * 根据给定颜色计算出主题黑
  17861. * @param {string} color - 颜色值 hex 格式
  17862. * @return {object} - 返回两项主题黑,包含 hex、rgb、hsl、oklch 四种格式的颜色值
  17863. * @example
  17864. * generateThemeBlack('#0B24FB')
  17865. */
  17866. export const generateThemeBlack = (color: string) => {
  17867. // 将 hex 颜色转换成 hsl 格式
  17868. const colorHsl = Color(color.indexOf('#') > -1 ? color : getHexFunc(color))
  17869. .hsl()
  17870. .round()
  17871. .string();
  17872. // 将 hsl 格式的颜色值转换成数组
  17873. const colorHslArr = colorHsl.split(',');
  17874. // 将 colorHslArr 的 s 和 l 值分别改为 95% 和 5% 生成主题黑
  17875. colorHslArr[1] = ' 95%';
  17876. colorHslArr[2] = ' 5%)';
  17877. // 将 colorHslArr 转换成 hsl 格式
  17878. const blackHsl = colorHslArr.join(',');
  17879. // 将 hsl 格式的颜色值转换成 hex 格式和 rgb 格式
  17880. const blackHex = Color(blackHsl).hex();
  17881. const blackRgb = Color(blackHsl).rgb().round().string();
  17882. // 将 hex 格式转换成 oklch 格式
  17883. const colorOklch = getOklchFunc(blackHex);
  17884. // 返回颜色值
  17885. return { hex: blackHex, rgb: blackRgb, hsl: blackHsl, oklch: colorOklch };
  17886. };
  17887. /**
  17888. * 根据给定颜色计算出主题白
  17889. * @param {string} color - 颜色值 hex 格式
  17890. * @return {object} - 返回两项主题白,包含 hex、rgb、hsl 三种格式的颜色值
  17891. * @example
  17892. * generateThemeWhite('#0B24FB')
  17893. */
  17894. export const generateThemeWhite = (color: string) => {
  17895. // 将 hex 颜色转换成 hsl 格式
  17896. const colorHsl = Color(color.indexOf('#') > -1 ? color : getHexFunc(color))
  17897. .hsl()
  17898. .round()
  17899. .string();
  17900. // 将 hsl 格式的颜色值转换成数组
  17901. const colorHslArr = colorHsl.split(',');
  17902. // 将 colorHslArr 的 s 和 l 值分别改为 95% 和 5% 生成主题黑
  17903. colorHslArr[1] = ' 5%';
  17904. colorHslArr[2] = ' 95%)';
  17905. // 将 colorHslArr 转换成 hsl 格式
  17906. const whiteHsl = colorHslArr.join(',');
  17907. // 将 hsl 格式的颜色值转换成 hex 格式和 rgb 格式
  17908. const whiteHex = Color(whiteHsl).hex();
  17909. const whiteRgb = Color(whiteHsl).rgb().round().string();
  17910. // 返回主题白
  17911. return { hex: whiteHex, rgb: whiteRgb, hsl: whiteHsl, oklch: getOklchFunc(whiteHex) };
  17912. };
  17913. /**
  17914. * 颜色转换函数
  17915. * @param {string} str - 颜色值
  17916. * @returns {object} - 返回 hex、rgb、hsl、oklch 四种格式的颜色值
  17917. * @example
  17918. * colorConvertFunc('#000') // {hex: '#000000', rgb: 'rgb(0,0,0)', hsl: {h: 0, s: 0, l: 0}, oklch: 'oklch(0 0 0)'}
  17919. */
  17920. export const colorConvertFunc = (str: string = '#000') => {
  17921. // 传入 hsl(222, 100%, 98%) 这种字符,将其中的数字四舍五入取整后返回字符
  17922. const getHslFunc = (str: string) => {
  17923. const arr = str.split(',');
  17924. const h = Math.round(Number(arr[0].split('(')[1]));
  17925. const s = Math.round(Number(arr[1].split('%')[0]));
  17926. const l = Math.round(Number(arr[2].split('%')[0]));
  17927. return `hsl(${h}, ${s}%, ${l}%)`;
  17928. };
  17929. const colorObj = Color(str.indexOf('#') > -1 ? str : getHexFunc(str));
  17930. return {
  17931. hex: colorObj.hex(),
  17932. rgb: colorObj.rgb().string(),
  17933. hsl: getHslFunc(colorObj.hsl().string()),
  17934. rgbStr: colorObj.rgb().array().join(', '),
  17935. oklch: getOklchFunc(colorObj.hex())
  17936. };
  17937. };
  17938. /**
  17939. * 传入 hex 格式的颜色值,将其中所有颜色值转换成 rgb 格式
  17940. * @param {string} str - 颜色值
  17941. * @returns {string} - 返回 rgb 格式的颜色值
  17942. * @example
  17943. * hexToRgb('#000') // '0,0,0'
  17944. */
  17945. export const hexToRgb = (str: string) => {
  17946. return Color(str).rgb().array().join(', ');
  17947. };
  17948. /**
  17949. * 将传入的对象转为数组,且 default 在第 6 项
  17950. * @param {object} obj - 需要转换的对象
  17951. * @returns {array} - 返回转换后的数组
  17952. * @example
  17953. * colorObjToArr({ 50: '#50', 100: '#100', 200: '#200', 300: '#300', 400: '#400', 500: '#500', 700: '#700', 800: '#800', 900: '#900', default: '#000' })
  17954. * [{key: '50', value: '#50'}, {key: '100', value: '#100'}, {key: '200', value: '#200'}, {key: '300', value: '#300'}, {key: '400', value: '#400'}, {key: '500', value: '#500'},{key: 'default', value: '#000'},{key: '700', value: '#700'},{key: '800', value: '#800'},{key: '900', value: '#900'}]
  17955. */
  17956. export const colorObjToArr = (obj: Record<string, string>) => {
  17957. // 将 obj 转为数组
  17958. const arr = Object.entries(obj).map(([key, value]) => ({ key, value }));
  17959. // 将最后一项移动到第 6 项
  17960. const lastItem = arr.pop();
  17961. if (lastItem) {
  17962. arr.splice(6, 0, lastItem);
  17963. }
  17964. return arr;
  17965. };
  17966. /**
  17967. * 传入 oklch 格式的颜色值与透明度,返回带透明度的 oklch 格式
  17968. * @param {string} str - 颜色值
  17969. * @param {number} opacity - 透明度
  17970. * @returns {string} - 返回带透明度的 oklch 格式
  17971. * @example
  17972. * getOklchOpacity('oklch(0.5 0.5 0)', 0.5) // 'oklch(0.5 0.5 0 / 0.5)'
  17973. */
  17974. export const getOklchOpacity = (str: string, opacity: number) => {
  17975. // 将最后一个 ) 替换为【/ 透明度】
  17976. return str.replace(/\)$/, ` / ${opacity})`);
  17977. };
  17978. ================================================
  17979. FILE: docs/site/static/assets/favicon_logo/site.webmanifest
  17980. ================================================
  17981. {
  17982. "name": "",
  17983. "short_name": "",
  17984. "icons": [
  17985. { "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
  17986. { "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
  17987. ],
  17988. "theme_color": "#ffffff",
  17989. "background_color": "#ffffff",
  17990. "display": "standalone"
  17991. }
  17992. ================================================
  17993. FILE: docs/site/static/assets/favicon_logo_dark/site.webmanifest
  17994. ================================================
  17995. {
  17996. "name": "",
  17997. "short_name": "",
  17998. "icons": [
  17999. { "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
  18000. { "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
  18001. ],
  18002. "theme_color": "#ffffff",
  18003. "background_color": "#ffffff",
  18004. "display": "standalone"
  18005. }
  18006. ================================================
  18007. FILE: docs/site/static/assets/fonts/JetBrainsMono-Regular.woff2
  18008. ================================================
  18009. [Non-text file]
  18010. ================================================
  18011. FILE: packages/create-stdf/README.md
  18012. ================================================
  18013. [简体中文](https://github.com/any-tdf/stdf/blob/main/packages/create-stdf/README_CN.md)
  18014. # create-stdf
  18015. A CLI for creating new [STDF](https://stdf.design) projects. Just run...
  18016. <!-- :::code-groups -->
  18017. <!-- pnpm -->
  18018. ```sh
  18019. pnpm create stdf
  18020. ```
  18021. <!-- :: -->
  18022. <!-- npm -->
  18023. ```sh
  18024. npm create stdf@latest
  18025. # or
  18026. npm init stdf@latest
  18027. # or
  18028. npx create-stdf@latest
  18029. ```
  18030. <!-- :: -->
  18031. <!-- bun -->
  18032. ```sh
  18033. bun create stdf
  18034. ```
  18035. <!-- :: -->
  18036. <!-- yarn -->
  18037. ```sh
  18038. yarn create stdf
  18039. ```
  18040. <!-- ::: -->
  18041. ...and follow the prompts.
  18042. You can also directly specify the project name and the template you want to use via additional command line options. For example, to create a new project named `my-app` using the **SvelteKit + Tailwind + TypeScript + STDF** template, run:
  18043. <!-- :::code-groups -->
  18044. <!-- pnpm -->
  18045. ```sh
  18046. pnpm create stdf my-app
  18047. ```
  18048. <!-- :: -->
  18049. <!-- npm -->
  18050. ```sh
  18051. npm create stdf@latest my-app
  18052. ```
  18053. <!-- :: -->
  18054. <!-- bun -->
  18055. ```sh
  18056. bun create stdf my-app
  18057. ```
  18058. <!-- :: -->
  18059. <!-- yarn -->
  18060. ```sh
  18061. yarn create stdf my-app
  18062. ```
  18063. <!-- ::: -->
  18064. If you want to use the **SvelteKit + Tailwind + STDF** template, run:
  18065. <!-- :::code-groups -->
  18066. <!-- pnpm -->
  18067. ```sh
  18068. pnpm create stdf my-app --template skt
  18069. # or
  18070. pnpm create stdf my-app -t skt
  18071. ```
  18072. <!-- :: -->
  18073. <!-- npm -->
  18074. ```sh
  18075. npm create stdf@latest my-app --template skt
  18076. # or
  18077. npm create stdf@latest my-app -t skt
  18078. ```
  18079. <!-- :: -->
  18080. <!-- bun -->
  18081. ```sh
  18082. bun create stdf my-app --template skt
  18083. # or
  18084. bun create stdf my-app -t skt
  18085. ```
  18086. <!-- :: -->
  18087. <!-- yarn -->
  18088. ```sh
  18089. yarn create stdf my-app --template skt
  18090. # or
  18091. yarn create stdf my-app -t skt
  18092. ```
  18093. <!-- ::: -->
  18094. Template presets include:
  18095. | Abbreviation | Template | Description |
  18096. | ------------ | ---------------------------------------- | --------------- |
  18097. | sktt | SvelteKit + Tailwind + TypeScript + STDF | Default |
  18098. | skt | SvelteKit + Tailwind + STDF | - |
  18099. | skut | SvelteKit + UnoCSS + TypeScript + STDF | Not adapted yet |
  18100. | sku | SvelteKit + UnoCSS + STDF | Not adapted yet |
  18101. # Options
  18102. | Option | Type | Default | Description |
  18103. | --------------- | ------ | ------- | --------------------------------------------------------------------------- |
  18104. | - | string | - | The name of the project, you can direct input. |
  18105. | -t / --template | string | sktt | The template to use. Available templates are: `skt`, `sku`, `sktt`, `skut`. |
  18106. | -l / --language | string | en_US | The language of the prompts. |
  18107. # Supported Languages
  18108. | Code | Language |
  18109. | ----- | --------------------- |
  18110. | en_US | English (US) |
  18111. | zh_CN | Chinese (Simplified) |
  18112. | zh_TW | Chinese (Traditional) |
  18113. | ja_JP | Japanese |
  18114. | ko_KR | Korean |
  18115. | es_ES | Spanish |
  18116. | ru_RU | Russian |
  18117. | fr_FR | French |
  18118. | de_DE | German |
  18119. | it_IT | Italian |
  18120. For example:
  18121. <!-- :::code-groups -->
  18122. <!-- pnpm -->
  18123. ```sh
  18124. pnpm create stdf my-app -l zh_CN
  18125. ```
  18126. <!-- :: -->
  18127. <!-- npm -->
  18128. ```sh
  18129. npm create stdf@latest my-app -l zh_CN
  18130. ```
  18131. <!-- :: -->
  18132. <!-- bun -->
  18133. ```sh
  18134. bun create stdf my-app -l zh_CN
  18135. ```
  18136. <!-- :: -->
  18137. <!-- yarn -->
  18138. ```sh
  18139. yarn create stdf my-app -l zh_CN
  18140. ```
  18141. <!-- ::: -->
  18142. # License
  18143. This project is licensed under the [MIT License](https://github.com/any-tdf/stdf/blob/main/LICENSE).
  18144. ================================================
  18145. FILE: packages/create-stdf/index.js
  18146. ================================================
  18147. #!/usr/bin/env node
  18148. import './dist/index.js';
  18149. ================================================
  18150. FILE: packages/create-stdf/package.json
  18151. ================================================
  18152. {
  18153. "name": "create-stdf",
  18154. "version": "0.1.2",
  18155. "description": "A CLI for creating new STDF projects",
  18156. "bin": {
  18157. "create-stdf": "index.js"
  18158. },
  18159. "scripts": {
  18160. "build": "rollup -c",
  18161. "update": "node scripts/update",
  18162. "test": "echo \"Error: no test specified\" && exit 1"
  18163. },
  18164. "files": [
  18165. "dist/**",
  18166. "templates/**"
  18167. ],
  18168. "engines": {
  18169. "node": ">=14.14"
  18170. },
  18171. "dependencies": {
  18172. "@clack/prompts": "^0.10.0",
  18173. "fs-extra": "^11.3.0",
  18174. "kleur": "^4.1.5",
  18175. "minimist": "^1.2.8"
  18176. },
  18177. "devDependencies": {
  18178. "@rollup/plugin-terser": "^0.4.4",
  18179. "rollup": "^4.39.0"
  18180. },
  18181. "keywords": [
  18182. "svelte",
  18183. "sveltekit",
  18184. "tailwind",
  18185. "unocss",
  18186. "typescript",
  18187. "stdf",
  18188. "cli",
  18189. "mobile",
  18190. "vite"
  18191. ],
  18192. "author": "any-tdf",
  18193. "funding": "https://stdf.design?fund",
  18194. "license": "MIT",
  18195. "type": "module",
  18196. "homepage": "https://github.com/any-tdf/stdf/blob/main/packages/create-stdf/README.md",
  18197. "repository": {
  18198. "type": "git",
  18199. "url": "https://github.com/any-tdf/stdf"
  18200. },
  18201. "bugs": {
  18202. "url": "https://github.com/any-tdf/stdf/issues?q=is:issue+is:open+create"
  18203. }
  18204. }
  18205. ================================================
  18206. FILE: packages/create-stdf/README_CN.md
  18207. ================================================
  18208. [English](https://github.com/any-tdf/stdf/blob/main/packages/create-stdf/README.md)
  18209. # create-stdf
  18210. 一个用于创建新的 [STDF](https://stdf.design) 项目的命令行工具。只需运行以下命令...
  18211. <!-- :::code-groups -->
  18212. <!-- pnpm -->
  18213. ```sh
  18214. pnpm create stdf
  18215. ```
  18216. <!-- :: -->
  18217. <!-- npm -->
  18218. ```sh
  18219. npm create stdf@latest
  18220. # 或
  18221. npm init stdf@latest
  18222. # 或
  18223. npx create-stdf@latest
  18224. ```
  18225. <!-- :: -->
  18226. <!-- bun -->
  18227. ```sh
  18228. bun create stdf
  18229. ```
  18230. <!-- :: -->
  18231. <!-- yarn -->
  18232. ```sh
  18233. yarn create stdf
  18234. ```
  18235. <!-- ::: -->
  18236. ...然后按照提示进行操作。
  18237. 你也可以通过额外的命令行选项直接指定项目名称和要使用的模板。例如,如果要使用 **SvelteKit + Tailwind + TypeScript + STDF** 模板创建一个名为 `my-app` 的新项目,请运行:
  18238. <!-- :::code-groups -->
  18239. <!-- pnpm -->
  18240. ```sh
  18241. pnpm create stdf my-app
  18242. ```
  18243. <!-- :: -->
  18244. <!-- npm -->
  18245. ```sh
  18246. npm create stdf@latest my-app
  18247. ```
  18248. <!-- :: -->
  18249. <!-- bun -->
  18250. ```sh
  18251. bun create stdf my-app
  18252. ```
  18253. <!-- :: -->
  18254. <!-- yarn -->
  18255. ```sh
  18256. yarn create stdf my-app
  18257. ```
  18258. <!-- ::: -->
  18259. 如果要使用 **SvelteKit + Tailwind + STDF** 模板,请运行:
  18260. <!-- :::code-groups -->
  18261. <!-- pnpm -->
  18262. ```sh
  18263. pnpm create stdf my-app --template skt
  18264. # 或
  18265. pnpm create stdf my-app -t skt
  18266. ```
  18267. <!-- :: -->
  18268. <!-- npm -->
  18269. ```sh
  18270. npm create stdf@latest my-app --template skt
  18271. # 或
  18272. npm create stdf@latest my-app -t skt
  18273. ```
  18274. <!-- :: -->
  18275. <!-- bun -->
  18276. ```sh
  18277. bun create stdf my-app --template skt
  18278. # 或
  18279. bun create stdf my-app -t skt
  18280. ```
  18281. <!-- :: -->
  18282. <!-- yarn -->
  18283. ```sh
  18284. yarn create stdf my-app --template skt
  18285. # 或
  18286. yarn create stdf my-app -t skt
  18287. ```
  18288. <!-- ::: -->
  18289. 模板预设包括:
  18290. | 简写 | 模板 | 描述 |
  18291. | ---- | ---------------------------------------- | -------- |
  18292. | sktt | SvelteKit + Tailwind + TypeScript + STDF | 默认 |
  18293. | skt | SvelteKit + Tailwind + STDF | - |
  18294. | skut | SvelteKit + UnoCSS + TypeScript + STDF | 尚未适配 |
  18295. | sku | SvelteKit + UnoCSS + STDF | 尚未适配 |
  18296. # 命令选项
  18297. | 命令 | 类型 | 默认 | 描述 |
  18298. | --------------- | ------ | ----- | ---------------------------------------------------------- |
  18299. | - | string | - | 项目名称,可以直接输入。 |
  18300. | -t / --template | string | sktt | 要使用的模板。可用的模板有:`skt`、`sku`、`sktt`、`skut`。 |
  18301. | -l / --language | string | en_US | 提示语言。 |
  18302. # 支持的语言
  18303. | 代码 | 语言 |
  18304. | ----- | ------------ |
  18305. | en_US | 英语(美式) |
  18306. | zh_CN | 中文(简体) |
  18307. | zh_TW | 中文(繁体) |
  18308. | ja_JP | 日语 |
  18309. | ko_KR | 韩语 |
  18310. | es_ES | 西班牙语 |
  18311. | ru_RU | 俄语 |
  18312. | fr_FR | 法语 |
  18313. | de_DE | 德语 |
  18314. | it_IT | 意大利语 |
  18315. 例如:
  18316. <!-- :::code-groups -->
  18317. <!-- pnpm -->
  18318. ```sh
  18319. pnpm create stdf my-app -l zh_CN
  18320. ```
  18321. <!-- :: -->
  18322. <!-- npm -->
  18323. ```sh
  18324. npm create stdf@latest my-app -l zh_CN
  18325. ```
  18326. <!-- :: -->
  18327. <!-- bun -->
  18328. ```sh
  18329. bun create stdf my-app -l zh_CN
  18330. ```
  18331. <!-- :: -->
  18332. <!-- yarn -->
  18333. ```sh
  18334. yarn create stdf my-app -l zh_CN
  18335. ```
  18336. <!-- ::: -->
  18337. # 许可证
  18338. 本项目基于 [MIT 许可证](https://github.com/any-tdf/stdf/blob/main/LICENSE)。
  18339. ================================================
  18340. FILE: packages/create-stdf/rollup.config.js
  18341. ================================================
  18342. import terser from '@rollup/plugin-terser';
  18343. export default {
  18344. input: 'src/index.js',
  18345. output: [{ file: 'dist/index.js', format: 'es' }],
  18346. external: ['path', 'fs-extra', '@clack/prompts', 'kleur/colors', 'minimist'],
  18347. plugins: [terser()],
  18348. };
  18349. ================================================
  18350. FILE: packages/create-stdf/scripts/update.js
  18351. ================================================
  18352. import fs from 'node:fs';
  18353. import { exec } from 'node:child_process';
  18354. // 封装函数,传入版本号,需要修改的 package.json 中的 devDependencies 的 key 值,需要修改的文件路径,直接修改 package.json 并重新写入
  18355. // Encapsulate the function, pass in the version number, the key value of devDependencies in package.json that needs to be modified, the file path that needs to be modified, and directly modify package.json and rewrite
  18356. const updatePackageJson = (version, key, path) => {
  18357. const packageJson = JSON.parse(fs.readFileSync(path, 'utf-8'));
  18358. packageJson.devDependencies[key] = `^${version}`;
  18359. fs.writeFileSync(path, JSON.stringify(packageJson, null, 4));
  18360. console.log(`🎉 ${path} 更新成功`);
  18361. };
  18362. // 获取 stdf 最新版本
  18363. // Get the latest version of stdf
  18364. exec('npm show stdf version', (error, stdout, stderr) => {
  18365. if (error) {
  18366. console.error(`执行命令出错:${error.message}`);
  18367. return;
  18368. }
  18369. if (stderr) {
  18370. console.error(`命令错误:${stderr}`);
  18371. return;
  18372. }
  18373. const version = stdout.trim();
  18374. console.log(`👉 stdf 最新版本:${version}`);
  18375. // 更新模板中的 package.json 的 stdf 版本号
  18376. // Update the stdf version number in the template package.json
  18377. updatePackageJson(version, 'stdf', 'templates/skt/package.json');
  18378. updatePackageJson(version, 'stdf', 'templates/sktt/package.json');
  18379. });
  18380. // 获取 rollup-plugin-stdf-icon 最新版本
  18381. // Get the latest version of rollup-plugin-stdf-icon
  18382. exec('npm show rollup-plugin-stdf-icon version', (errorIcon, stdoutIcon, stderrIcon) => {
  18383. if (errorIcon) {
  18384. console.error(`执行命令出错:${errorIcon.message}`);
  18385. return;
  18386. }
  18387. if (stderrIcon) {
  18388. console.error(`命令错误:${stderrIcon}`);
  18389. return;
  18390. }
  18391. const version = stdoutIcon.trim();
  18392. console.log(`👉 rollup-plugin-stdf-icon 最新版本:${version}`);
  18393. // 更新模板中的 package.json 的 rollup-plugin-stdf-icon 版本号
  18394. // Update the rollup-plugin-stdf-icon version number in the template package.json
  18395. updatePackageJson(version, 'rollup-plugin-stdf-icon', 'templates/skt/package.json');
  18396. updatePackageJson(version, 'rollup-plugin-stdf-icon', 'templates/sktt/package.json');
  18397. });
  18398. ================================================
  18399. FILE: packages/create-stdf/src/index.js
  18400. ================================================
  18401. #!/usr/bin/env node
  18402. import fs from 'fs-extra';
  18403. import path from 'node:path';
  18404. import { fileURLToPath } from 'node:url';
  18405. import * as p from '@clack/prompts';
  18406. import { bold, cyan, grey, red, blue } from 'kleur/colors';
  18407. import minimist from 'minimist';
  18408. import * as langAll from './lang';
  18409. // 获取版本号
  18410. // Get version
  18411. // @ts-ignore
  18412. const { version } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
  18413. // 显示版本号
  18414. // Display version number
  18415. console.log(`
  18416. ${grey(`create-stdf@${version}
  18417. `)}`);
  18418. const spinner = p.spinner();
  18419. p.intro('Welcome to use STDF!');
  18420. let lang = langAll.en_US;
  18421. // 获取命令行参数
  18422. // Get command line parameters
  18423. const argv = minimist(process.argv.slice(2));
  18424. // 获取项目名称和模板名称和语言
  18425. // Get project name and template name
  18426. const argvProjectName = argv._[0];
  18427. const argvTemplate = argv.template || argv.t;
  18428. const argvLanguage = argv.language || argv.l;
  18429. // 语言列表
  18430. // Language list
  18431. const languages = [];
  18432. // 循环 langAll 对象,将语言列表中的语言名字替换为对应的语言名字,且按照 sort 排序
  18433. // Loop through the langAll object and replace the language name in the language list with the corresponding language name, and sort by sort
  18434. for (const key in langAll) {
  18435. languages.push({
  18436. value: key,
  18437. label: langAll[key].name,
  18438. sort: langAll[key].sort,
  18439. });
  18440. }
  18441. // 按照 sort 排序
  18442. // Sort by sort
  18443. languages.sort((a, b) => a.sort - b.sort);
  18444. // 如果命令行参数中有语言,且语言列表中有该语言,使用该语言,否则使用英语
  18445. // If there is a language in the command line parameters and the language list has the language, use the language, otherwise use English
  18446. lang = argvLanguage && languages.find(item => item.value === argvLanguage) ? langAll[argvLanguage] : langAll.en_US;
  18447. // 模板列表
  18448. // Template list
  18449. const templateOptions = [
  18450. { value: 'sktt', label: 'SvelteKit + Tailwind + TypeScript', template: 'sktt', finish: true },
  18451. { value: 'skt', label: 'SvelteKit + Tailwind', template: 'skt', finish: true },
  18452. { value: 'skut', label: 'SvelteKit + UnoCSS + TypeScript', template: 'skut', finish: false },
  18453. { value: 'sku', label: 'SvelteKit + UnoCSS', template: 'sku', finish: false },
  18454. ];
  18455. // 包管理工具列表
  18456. // Package management tool list
  18457. const packageManagerOptions = [
  18458. { value: 'npm', label: 'NPM', install: 'npm i', dev: 'npm run dev' },
  18459. { value: 'bun', label: 'Bun', install: 'bun i', dev: 'bun dev' },
  18460. { value: 'pnpm', label: 'PNPM', install: 'pnpm i', dev: 'pnpm dev' },
  18461. { value: 'yarn', label: 'Yarn', install: 'yarn', dev: 'yarn run dev' },
  18462. ];
  18463. // 如果命令行参数中有项目名称,但没有模板名称,直接使用默认模板 skt
  18464. // If there is a project name in the command line parameters, but no template name, use the default template skt directly
  18465. if (argvProjectName && !argvTemplate) {
  18466. createFunc(argvProjectName, templateOptions[0]);
  18467. }
  18468. // 如果命令行参数中有项目名称和模板名称,直接使用命令行参数中的值
  18469. // If there is a project name and template name in the command line parameters, use the value in the command line parameters directly
  18470. else if (argvProjectName && argvTemplate) {
  18471. const item = templateOptions.find(item => item.value === argvTemplate);
  18472. if (!item) {
  18473. p.intro(red(lang.pectn));
  18474. } else if (!item.finish) {
  18475. p.intro(red(item.label + ' ' + lang.hnay));
  18476. } else {
  18477. createFunc(argvProjectName, item);
  18478. }
  18479. } else {
  18480. (async () => {
  18481. // 选择一种语言
  18482. // Select a language
  18483. const languageType = await p.select({
  18484. message: bold('Please select your preferred language'),
  18485. options: languages,
  18486. });
  18487. if (p.isCancel(languageType)) {
  18488. p.cancel(red('⛔ ') + lang.oc);
  18489. process.exit(0);
  18490. }
  18491. lang = langAll[languageType];
  18492. // 选择一个模板
  18493. // Select a template
  18494. let template = await p.select({
  18495. message: bold(lang.psat),
  18496. options: templateOptions.map(item => ({
  18497. ...item,
  18498. label: item.finish ? item.label : `(${lang.hnay}) ${item.label}`,
  18499. })),
  18500. });
  18501. if (p.isCancel(template)) {
  18502. p.cancel(red('⛔ ') + lang.oc);
  18503. process.exit(0);
  18504. }
  18505. // 直到选择的 template 所在项 的 finish 为 true 为止,否则一直重新选择
  18506. // Until the finish of the selected template is true, otherwise keep reselecting
  18507. while (!templateOptions.find(item => item.value === template)?.finish) {
  18508. if (p.isCancel(template)) {
  18509. p.cancel(red('⛔ ') + lang.oc);
  18510. process.exit(0);
  18511. }
  18512. p.intro(red(templateOptions.find(item => item.value === template).label + ' ' + lang.hnay + ' ' + lang.pca));
  18513. template = await p.select({
  18514. message: bold(lang.psat),
  18515. options: templateOptions.map(item => ({
  18516. ...item,
  18517. label: item.finish ? item.label : `(${lang.hnay}) ${item.label}`,
  18518. })),
  18519. });
  18520. }
  18521. // 输入项目名称
  18522. // Enter the project name
  18523. const projectName = await p.text({
  18524. message: bold(lang.pn),
  18525. placeholder: 'stdf-project',
  18526. validate: value => {
  18527. if (!value) {
  18528. // 判断是否为空,提示 “项目名称不能为空”
  18529. // Determine whether it is empty, prompt "Project name cannot be empty"
  18530. return lang.pncbne;
  18531. }
  18532. if (fs.existsSync(value)) {
  18533. // 判断是否已存在,提示 “项目名称已存在”
  18534. // Determine whether it already exists, prompt "Project name already exists"
  18535. return lang.pane;
  18536. }
  18537. },
  18538. });
  18539. if (p.isCancel(projectName)) {
  18540. p.cancel(red('⛔ ') + lang.oc);
  18541. process.exit(0);
  18542. }
  18543. // 使用什么包管理工具 npm / pnpm / yarn / bun / deno
  18544. // What package management tool to use npm / pnpm / yarn / bun / deno
  18545. const packageManager = await p.select({
  18546. message: bold(lang.pm),
  18547. options: packageManagerOptions,
  18548. });
  18549. if (p.isCancel(packageManager)) {
  18550. p.cancel(red('⛔ ') + lang.oc);
  18551. process.exit(0);
  18552. }
  18553. // 根据 template 的值,复制对应目录下的所有文件到当前目录
  18554. // According to the value of template, copy all files under the corresponding directory to the current directory
  18555. templateOptions.forEach(async item => {
  18556. if (item.value === template) {
  18557. createFunc(projectName, item, packageManager);
  18558. }
  18559. });
  18560. })();
  18561. }
  18562. function createFunc(projectName, item, packageManager) {
  18563. // 如果 projectName 是数字,转为字符串
  18564. // If projectName is a number, convert it to a string
  18565. if (typeof projectName === 'number') {
  18566. projectName = projectName.toString();
  18567. }
  18568. // 项目目录
  18569. // Project directory
  18570. const projectDir = path.join(path.resolve(), projectName);
  18571. spinner.start('🚀 ' + lang.cfsing);
  18572. fs.mkdirSync(projectDir);
  18573. // 获取模板目录的绝对路径,考虑到 Windows 系统的兼容性, 使用 path.join
  18574. // Get the absolute path of the template directory, considering the compatibility of the Windows system, use path.join
  18575. // @ts-ignore
  18576. const templatePath = path.resolve(fileURLToPath(import.meta.url), '../..', `templates/${item.template}`);
  18577. // 将 templatePath 目录下的所有文件复制到 projectDir 目录下
  18578. // Copy all files under the templatePath directory to the projectDir directory\
  18579. fs.copy(templatePath, projectDir)
  18580. .then(() => {
  18581. spinner.stop();
  18582. p.outro(`${projectName} - ${lang.pcsucc} 🎉`);
  18583. // 读取 package.json 文件
  18584. // Read the package.json file
  18585. const packageJson = JSON.parse(fs.readFileSync(`${projectDir}/package.json`, 'utf-8'));
  18586. // 将项目内的 package.json 中的 name 属性修改为 projectName
  18587. // Modify the name attribute in package.json in the project to projectName
  18588. packageJson.name = projectName;
  18589. // 将修改后的 packageJson 写入到项目内的 package.json 文件中
  18590. // Write the modified packageJson to the package.json file in the project
  18591. fs.writeFileSync(`${projectDir}/package.json`, JSON.stringify(packageJson, null, 4), 'utf-8');
  18592. // 根据 item.value 的值,判断是否使用了 @sveltejs/kit
  18593. // According to the value of item.value, determine whether @sveltejs/kit is used
  18594. const isHasKit = item.value === 'skt' || item.value === 'sku' || item.value === 'sktt' || item.value === 'skut';
  18595. // 根据 item.value 的值,判断使用 Tailwind 还是 UnoCSS
  18596. // According to the value of item.value, determine whether to use Tailwind or UnoCSS
  18597. const isHasUno = item.value === 'vu' || item.value === 'sku' || item.value === 'vut' || item.value === 'skut';
  18598. // 获得依赖的版本号
  18599. // get the version number of the dependency
  18600. const versions = {
  18601. vite: packageJson.devDependencies.vite.replace('^', ''),
  18602. svelte: packageJson.devDependencies.svelte.replace('^', ''),
  18603. stdf: packageJson.devDependencies.stdf.replace('^', ''),
  18604. };
  18605. if (isHasKit) {
  18606. versions['@sveltejs/kit'] = packageJson.devDependencies['@sveltejs/kit'].replace('^', '');
  18607. }
  18608. if (isHasUno) {
  18609. versions['unocss'] = packageJson.devDependencies.unocss.replace('^', '');
  18610. } else {
  18611. versions['tailwindcss'] = packageJson.devDependencies.tailwindcss.replace('^', '');
  18612. }
  18613. // 将 versions 的键值拼接为 bold('Vite:') cyan(versions.vite) bold('Svelte:') cyan(versions.svelte) 的形式
  18614. // Splice the key value of versions into the form of bold('Vite:') cyan(versions.vite) bold('Svelte:') cyan(versions.svelte)
  18615. let versionsString = '';
  18616. for (const key in versions) {
  18617. versionsString += bold(key) + ': ' + cyan(versions[key]) + ' ';
  18618. }
  18619. // 显示版本号
  18620. // Display version number
  18621. console.log(`📦 ${versionsString}
  18622. `);
  18623. // 显示提示信息
  18624. // Display prompt information
  18625. console.log(
  18626. `👉 ${bold(lang.tgs)}
  18627. ${blue(`1. cd ${projectName}`)}
  18628. ${blue(`2. git init && git add -A && git commit -m "Initial commit"`)}
  18629. ${blue(`3. ${packageManagerOptions.find(item => item.value === packageManager).install}`)}
  18630. ${blue(`4. ${packageManagerOptions.find(item => item.value === packageManager).dev}`)}
  18631. `
  18632. );
  18633. // 显示配置主题色
  18634. // Display configuration theme color
  18635. console.log(
  18636. `🎨 ${grey(isHasUno ? lang.pcyt_vu : lang.pcyt_vt)}
  18637. `
  18638. );
  18639. })
  18640. .catch(err => {
  18641. spinner.stop();
  18642. console.error(red(lang.cferror + '--' + err));
  18643. });
  18644. }
  18645. ================================================
  18646. FILE: packages/create-stdf/src/lang.js
  18647. ================================================
  18648. // 英语 english
  18649. export const en_US = {
  18650. sort: 0,
  18651. name: 'English',
  18652. hnay: 'Has not adapted yet',
  18653. pn: 'Please enter the project name',
  18654. pncbne: 'Project name cannot be empty',
  18655. pane: 'Project name already exists',
  18656. psat: 'Please select a template',
  18657. oc: 'Operation cancelled',
  18658. pca: 'Please choose again',
  18659. pm: 'Please select a package manager',
  18660. cfsing: 'Creating file...',
  18661. pcsucc: 'Project created successfully',
  18662. tgs: 'To get started:',
  18663. pcyt_vt: 'Tip: please configure Initial Color System in src/app.css, reference https://stdf.design/guide/theme',
  18664. pcyt_vu: 'Tip: please configure Initial Color System in src/app.css, reference https://stdf.design/guide/theme',
  18665. cferror: 'Failed to create file',
  18666. pectn: 'Please enter the correct template name!',
  18667. };
  18668. // 简体中文 chinese
  18669. export const zh_CN = {
  18670. sort: 1,
  18671. name: '简体中文',
  18672. hnay: '暂未适配',
  18673. pn: '请输入项目名称',
  18674. pncbne: '项目名称不能为空',
  18675. pane: '项目名称已存在',
  18676. psat: '请选择一个模板',
  18677. oc: '操作已取消',
  18678. pca: '请重新选择',
  18679. pm: '请选择一个包管理工具',
  18680. cfsing: '正在创建文件...',
  18681. pcsucc: '项目创建成功',
  18682. tgs: '开始:',
  18683. pcyt_vt: '提示:请到 src/app.css 配置初始主题色,参考 https://stdf.design/guide/theme',
  18684. pcyt_vu: '提示:请到 src/app.css 配置初始主题色,参考 https://stdf.design/guide/theme',
  18685. cferror: '创建文件失败',
  18686. pectn: '请输入正确的模板名称!',
  18687. };
  18688. // 繁體中文 chinese traditional
  18689. export const zh_TW = {
  18690. sort: 2,
  18691. name: '繁體中文',
  18692. hnay: '暫未適配',
  18693. pn: '請輸入項目名稱',
  18694. pncbne: '項目名稱不能為空',
  18695. pane: '項目名稱已存在',
  18696. psat: '請選擇一個模板',
  18697. oc: '操作已取消',
  18698. pca: '請重新選擇',
  18699. pm: '請選擇一個包管理工具',
  18700. cfsing: '正在創建文件...',
  18701. pcsucc: '項目創建成功',
  18702. tgs: '開始:',
  18703. pcyt_vt: '提示:請到 src/app.css 配置初始主題色,參考 https://stdf.design/guide/theme',
  18704. pcyt_vu: '提示:請到 src/app.css 配置初始主題色,參考 https://stdf.design/guide/theme',
  18705. cferror: '創建文件失敗',
  18706. pectn: '請輸入正確的模板名稱!',
  18707. };
  18708. // 日语 japanese
  18709. export const ja_JP = {
  18710. sort: 3,
  18711. name: '日本語',
  18712. hnay: 'まだ適応されていません',
  18713. pn: 'プロジェクト名を入力してください',
  18714. pncbne: 'プロジェクト名は空にできません',
  18715. pane: 'プロジェクト名が既に存在します',
  18716. psat: 'テンプレートを選択してください',
  18717. oc: '操作がキャンセルされました',
  18718. pca: 'もう一度選択してください',
  18719. pm: 'パッケージマネージャーを選択してください',
  18720. cfsing: 'ファイルを作成しています...',
  18721. pcsucc: 'プロジェクトが正常に作成されました',
  18722. tgs: '開始:',
  18723. pcyt_vt: 'ヒント:src/app.css ファイルで初期カラーシステムを設定し、参考 https://stdf.design/guide/theme',
  18724. pcyt_vu: 'ヒント:src/app.css ファイルで初期カラーシステムを設定し、参考 https://stdf.design/guide/theme',
  18725. cferror: 'ファイルの作成に失敗しました',
  18726. pectn: '正しいテンプレート名を入力してください!',
  18727. };
  18728. // 韩语 korean
  18729. export const ko_KR = {
  18730. sort: 4,
  18731. name: '한국어',
  18732. hnay: '아직 적응하지 못했습니다',
  18733. pn: '프로젝트 이름을 입력하십시오',
  18734. pncbne: '프로젝트 이름은 비워 둘 수 없습니다',
  18735. pane: '프로젝트 이름이 이미 있습니다',
  18736. psat: '템플릿을 선택하십시오',
  18737. oc: '작업이 취소되었습니다',
  18738. pca: '다시 선택하십시오',
  18739. pm: '패키지 관리자를 선택하십시오',
  18740. cfsing: '파일을 만드는 중입니다...',
  18741. pcsucc: '프로젝트가 성공적으로 생성되었습니다',
  18742. tgs: '시작:',
  18743. pcyt_vt: '팁: src/app.css 파일에서 초기 색상 시스템을 구성하고 참조 https://stdf.design/guide/theme',
  18744. pcyt_vu: '팁: src/app.css 파일에서 초기 색상 시스템을 구성하고 참조 https://stdf.design/guide/theme',
  18745. cferror: '파일 생성 실패',
  18746. pectn: '올바른 템플릿 이름을 입력하십시오!',
  18747. };
  18748. // 西班牙语 spanish
  18749. export const es_ES = {
  18750. sort: 5,
  18751. name: 'Español',
  18752. hnay: 'Aún no se ha adaptado',
  18753. pn: 'Por favor ingrese el nombre del proyecto',
  18754. pncbne: 'El nombre del proyecto no puede estar vacío',
  18755. pane: 'El nombre del proyecto ya existe',
  18756. psat: 'Por favor seleccione una plantilla',
  18757. oc: 'Operación cancelada',
  18758. pca: 'Por favor, elija de nuevo',
  18759. pm: 'Por favor seleccione un administrador de paquetes',
  18760. cfsing: 'Creando archivo...',
  18761. pcsucc: 'Proyecto creado con éxito',
  18762. tgs: 'Para empezar:',
  18763. pcyt_vt: 'Consejo: configure su sistema de colores en reference https://stdf.design/guide/theme',
  18764. pcyt_vu: 'Consejo: configure su sistema de colores en reference https://stdf.design/guide/theme',
  18765. cferror: 'Error al crear archivo',
  18766. pectn: '¡Por favor ingrese el nombre de la plantilla correcto!',
  18767. };
  18768. // 俄语 russian
  18769. export const ru_RU = {
  18770. sort: 6,
  18771. name: 'Русский',
  18772. hnay: 'Еще не адаптировано',
  18773. pn: 'Пожалуйста, введите название проекта',
  18774. pncbne: 'Название проекта не может быть пустым',
  18775. pane: 'Название проекта уже существует',
  18776. psat: 'Пожалуйста, выберите шаблон',
  18777. oc: 'Операция отменена',
  18778. pca: 'Пожалуйста, выберите снова',
  18779. pm: 'Пожалуйста, выберите пакетный менеджер',
  18780. cfsing: 'Создание файла...',
  18781. pcsucc: 'Проект успешно создан',
  18782. tgs: 'Чтобы начать:',
  18783. pcyt_vt: 'Совет: настройте свой цветовой систему в ссылке https://stdf.design/guide/theme',
  18784. pcyt_vu: 'Совет: настройте свой цветовой систему в ссылке https://stdf.design/guide/theme',
  18785. cferror: 'Не удалось создать файл',
  18786. pectn: 'Пожалуйста, введите правильное название шаблона!',
  18787. };
  18788. // 法语 french
  18789. export const fr_FR = {
  18790. sort: 7,
  18791. name: 'Français',
  18792. hnay: "N'a pas encore adapté",
  18793. pn: 'Veuillez saisir le nom du projet',
  18794. pncbne: 'Le nom du projet ne peut pas être vide',
  18795. pane: 'Le nom du projet existe déjà',
  18796. psat: 'Veuillez sélectionner un modèle',
  18797. oc: 'Opération annulée',
  18798. pca: 'Veuillez choisir à nouveau',
  18799. pm: 'Veuillez sélectionner un gestionnaire de paquets',
  18800. cfsing: 'Création de fichier...',
  18801. pcsucc: 'Projet créé avec succès',
  18802. tgs: 'Pour commencer:',
  18803. pcyt_vt: 'Conseil: veuillez configurer votre système de couleurs dans reference https://stdf.design/guide/theme',
  18804. pcyt_vu: 'Conseil: veuillez configurer votre système de couleurs dans reference https://stdf.design/guide/theme',
  18805. cferror: 'Échec de la création du fichier',
  18806. pectn: 'Veuillez saisir le nom du modèle correct!',
  18807. };
  18808. // 德语 german
  18809. export const de_DE = {
  18810. sort: 8,
  18811. name: 'Deutsch',
  18812. hnay: 'Noch nicht angepasst',
  18813. pn: 'Bitte geben Sie den Projektnamen ein',
  18814. pncbne: 'Projektname darf nicht leer sein',
  18815. pane: 'Projektname existiert bereits',
  18816. psat: 'Bitte wählen Sie eine Vorlage aus',
  18817. oc: 'Vorgang abgebrochen',
  18818. pca: 'Bitte wählen Sie erneut',
  18819. pm: 'Bitte wählen Sie einen Paketmanager aus',
  18820. cfsing: 'Erstelle Datei...',
  18821. pcsucc: 'Projekt erfolgreich erstellt',
  18822. tgs: 'Um zu beginnen:',
  18823. pcyt_vt: 'Tip: please configure your color system in reference https://stdf.design/guide/theme',
  18824. pcyt_vu: 'Tip: please configure your color system in reference https://stdf.design/guide/theme',
  18825. cferror: 'Fehler beim Erstellen der Datei',
  18826. pectn: 'Bitte geben Sie den richtigen Vorlagennamen ein!',
  18827. };
  18828. // 意大利语 italian
  18829. export const it_IT = {
  18830. sort: 9,
  18831. name: 'Italiano',
  18832. hnay: 'Non ancora adattato',
  18833. pn: 'Inserisci il nome del progetto',
  18834. pncbne: 'Il nome del progetto non può essere vuoto',
  18835. pane: 'Il nome del progetto esiste già',
  18836. psat: 'Seleziona un modello',
  18837. oc: 'Operazione annullata',
  18838. pca: 'Seleziona di nuovo',
  18839. pm: 'Seleziona un gestore di pacchetti',
  18840. cfsing: 'Creazione del file in corso...',
  18841. pcsucc: 'Progetto creato con successo',
  18842. tgs: 'Per iniziare:',
  18843. pcyt_vt: 'Consiglio: configura il tuo sistema di colori in https://stdf.design/guide/theme',
  18844. pcyt_vu: 'Consiglio: configura il tuo sistema di colori in https://stdf.design/guide/theme',
  18845. cferror: 'Impossibile creare il file',
  18846. pectn: 'Inserisci il nome del modello corretto!',
  18847. };
  18848. ================================================
  18849. FILE: packages/create-stdf/templates/skt/README.md
  18850. ================================================
  18851. # SvelteKit + Tailwind + STDF
  18852. This template should help get you started developing with Svelte + Tailwind + STDF in SvelteKit.
  18853. ## Recommended IDE Setup
  18854. - [VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tailwind](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) + [STDF](https://stdf.design) .
  18855. - [WebStorm](https://www.jetbrains.com/webstorm/) + [Svelte](https://www.jetbrains.com/help/webstorm/svelte.html) + [Tailwind](https://www.jetbrains.com/help/webstorm/tailwind-css.html) + [STDF](https://stdf.design) .
  18856. ## More Info
  18857. For more information about quickly create a new project, see the STDF [Quick start](https://stdf.design/guide) guide.
  18858. ================================================
  18859. FILE: packages/create-stdf/templates/skt/eslint.config.js
  18860. ================================================
  18861. import prettier from 'eslint-config-prettier';
  18862. import js from '@eslint/js';
  18863. import { includeIgnoreFile } from '@eslint/compat';
  18864. import svelte from 'eslint-plugin-svelte';
  18865. import globals from 'globals';
  18866. import { fileURLToPath } from 'node:url';
  18867. import svelteConfig from './svelte.config.js';
  18868. const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
  18869. export default [
  18870. includeIgnoreFile(gitignorePath),
  18871. js.configs.recommended,
  18872. ...svelte.configs.recommended,
  18873. prettier,
  18874. ...svelte.configs.prettier,
  18875. {
  18876. languageOptions: {
  18877. globals: { ...globals.browser, ...globals.node }
  18878. }
  18879. },
  18880. {
  18881. files: ['**/*.svelte', '**/*.svelte.js'],
  18882. languageOptions: { parserOptions: { svelteConfig } }
  18883. }
  18884. ];
  18885. ================================================
  18886. FILE: packages/create-stdf/templates/skt/jsconfig.json
  18887. ================================================
  18888. {
  18889. "extends": "./.svelte-kit/tsconfig.json",
  18890. "compilerOptions": {
  18891. "allowJs": true,
  18892. "checkJs": true,
  18893. "esModuleInterop": true,
  18894. "forceConsistentCasingInFileNames": true,
  18895. "resolveJsonModule": true,
  18896. "skipLibCheck": true,
  18897. "sourceMap": true,
  18898. "strict": true,
  18899. "moduleResolution": "bundler"
  18900. }
  18901. // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  18902. // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  18903. //
  18904. // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
  18905. // from the referenced tsconfig.json - TypeScript does not merge them in
  18906. }
  18907. ================================================
  18908. FILE: packages/create-stdf/templates/skt/package.json
  18909. ================================================
  18910. {
  18911. "name": "skt",
  18912. "private": true,
  18913. "version": "0.0.1",
  18914. "type": "module",
  18915. "scripts": {
  18916. "dev": "vite dev",
  18917. "build": "vite build",
  18918. "preview": "vite preview",
  18919. "prepare": "svelte-kit sync || echo ''",
  18920. "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
  18921. "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
  18922. "format": "prettier --write .",
  18923. "lint": "prettier --check . && eslint ."
  18924. },
  18925. "devDependencies": {
  18926. "@eslint/compat": "^1.2.5",
  18927. "@eslint/js": "^9.18.0",
  18928. "@sveltejs/adapter-auto": "^4.0.0",
  18929. "@sveltejs/kit": "^2.16.0",
  18930. "@sveltejs/vite-plugin-svelte": "^5.0.0",
  18931. "@tailwindcss/vite": "^4.0.0",
  18932. "eslint": "^9.18.0",
  18933. "eslint-config-prettier": "^10.0.1",
  18934. "eslint-plugin-svelte": "^3.0.0",
  18935. "globals": "^16.0.0",
  18936. "prettier": "^3.4.2",
  18937. "prettier-plugin-svelte": "^3.3.3",
  18938. "prettier-plugin-tailwindcss": "^0.6.11",
  18939. "rollup-plugin-stdf-icon": "file:../../../rollup-plugin-stdf-icon",
  18940. "svelte": "^5.0.0",
  18941. "svelte-check": "^4.0.0",
  18942. "stdf": "file:../../../stdf",
  18943. "tailwindcss": "^4.0.0",
  18944. "typescript": "^5.0.0",
  18945. "vite": "^6.0.0"
  18946. }
  18947. }
  18948. ================================================
  18949. FILE: packages/create-stdf/templates/skt/svelte.config.js
  18950. ================================================
  18951. import adapter from '@sveltejs/adapter-auto';
  18952. /** @type {import('@sveltejs/kit').Config} */
  18953. const config = {
  18954. kit: {
  18955. // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
  18956. // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
  18957. // See https://svelte.dev/docs/kit/adapters for more information about adapters.
  18958. adapter: adapter()
  18959. }
  18960. };
  18961. export default config;
  18962. ================================================
  18963. FILE: packages/create-stdf/templates/skt/vite.config.js
  18964. ================================================
  18965. import tailwindcss from '@tailwindcss/vite';
  18966. import { sveltekit } from '@sveltejs/kit/vite';
  18967. import { defineConfig } from 'vite';
  18968. import svgSprite from 'rollup-plugin-stdf-icon';
  18969. export default defineConfig({
  18970. plugins: [
  18971. tailwindcss(),
  18972. sveltekit(),
  18973. // 一般来说,一个应用的的 svg 不多时都放在一个文件夹下,合并为一个 symbol 即可。此处演示了不同文件夹下的图标如何合并为不同的 symbol。
  18974. // Generally speaking, when the svg of an application is not much, it is placed in a folder and merged into one symbol. This example shows how the icons in different folders are merged into different symbols.
  18975. svgSprite([
  18976. { inFile: 'src/lib/svgs/Heroicons', outFile: 'static/symbols' },
  18977. { inFile: 'src/lib/svgs/IconPark', outFile: 'static/symbols' },
  18978. { inFile: 'src/lib/svgs/Remix', outFile: 'static/symbols' },
  18979. // 单独为 Cell 与 NavBar 用到的图标创建一个 symbol。详见:https://stdf.design/guide/icon
  18980. // Create a symbol for the icons used by Cell and NavBar. See: https://stdf.design/guide/icon
  18981. { inFile: 'src/lib/symbol', outFile: 'static/fonts' }
  18982. ])
  18983. ]
  18984. });
  18985. ================================================
  18986. FILE: packages/create-stdf/templates/skt/.npmrc
  18987. ================================================
  18988. engine-strict=true
  18989. ================================================
  18990. FILE: packages/create-stdf/templates/skt/.prettierignore
  18991. ================================================
  18992. # Package Managers
  18993. package-lock.json
  18994. pnpm-lock.yaml
  18995. yarn.lock
  18996. bun.lock
  18997. bun.lockb
  18998. ================================================
  18999. FILE: packages/create-stdf/templates/skt/.prettierrc
  19000. ================================================
  19001. {
  19002. "useTabs": true,
  19003. "singleQuote": true,
  19004. "trailingComma": "none",
  19005. "printWidth": 140,
  19006. "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
  19007. "overrides": [
  19008. {
  19009. "files": "*.svelte",
  19010. "options": {
  19011. "parser": "svelte"
  19012. }
  19013. }
  19014. ]
  19015. }
  19016. ================================================
  19017. FILE: packages/create-stdf/templates/skt/src/app.css
  19018. ================================================
  19019. @import 'tailwindcss';
  19020. @custom-variant dark (&:where(.dark, .dark *));
  19021. @theme {
  19022. --color-primary-50: oklch(0.979 0.01 267.36);
  19023. --color-primary-100: oklch(0.95 0.024 270.343);
  19024. --color-primary-200: oklch(0.847 0.074 271.188);
  19025. --color-primary-300: oklch(0.741 0.13 272.232);
  19026. --color-primary-400: oklch(0.634 0.193 271.595);
  19027. --color-primary-500: oklch(0.536 0.252 268.66);
  19028. --color-primary: oklch(0.467 0.296 264.886);
  19029. --color-primary-700: oklch(0.397 0.26 264.877);
  19030. --color-primary-800: oklch(0.331 0.221 264.833);
  19031. --color-primary-900: oklch(0.26 0.178 264.428);
  19032. --color-primary-950: oklch(0.192 0.13 266.64);
  19033. --color-dark-50: oklch(0.995 0.012 101.474);
  19034. --color-dark-100: oklch(0.986 0.025 97.107);
  19035. --color-dark-200: oklch(0.965 0.059 95.884);
  19036. --color-dark-300: oklch(0.938 0.089 92.952);
  19037. --color-dark-400: oklch(0.91 0.114 89.711);
  19038. --color-dark-500: oklch(0.88 0.136 86.375);
  19039. --color-dark: oklch(0.845 0.153 80.597);
  19040. --color-dark-700: oklch(0.71 0.137 75.734);
  19041. --color-dark-800: oklch(0.58 0.118 70.166);
  19042. --color-dark-900: oklch(0.449 0.097 65.209);
  19043. --color-dark-950: oklch(0.321 0.074 62.379);
  19044. --color-primaryBlack: oklch(0.116 0.054 267.087);
  19045. --color-primaryWhite: oklch(0.961 0.001 286.375);
  19046. --color-darkBlack: oklch(0.183 0.035 86.634);
  19047. --color-darkWhite: oklch(0.962 0.001 17.178);
  19048. --color-success: oklch(0.704 0.142 167.084);
  19049. --color-warning: oklch(0.558 0.154 47.186);
  19050. --color-error: oklch(0.564 0.223 28.46);
  19051. --color-info: oklch(0.482 0.14 261.518);
  19052. --color-extend0: oklch(0.703 0.149 235.059);
  19053. --color-Twitter: oklch(0.703 0.149 235.059);
  19054. --color-extend1: oklch(0.702 0.194 38.137);
  19055. --color-Svelte: oklch(0.702 0.194 38.137);
  19056. --color-extend2: oklch(0.482 0.107 161.212);
  19057. --color-Starbucks: oklch(0.482 0.107 161.212);
  19058. --color-black: oklch(0 0 0);
  19059. --color-white: oklch(1 0 0);
  19060. --color-gray-50: oklch(0.961 0 0);
  19061. --color-gray-100: oklch(0.925 0 0);
  19062. --color-gray-200: oklch(0.845 0 0);
  19063. --color-gray-300: oklch(0.767 0 0);
  19064. --color-gray-400: oklch(0.683 0 0);
  19065. --color-gray-500: oklch(0.6 0 0);
  19066. --color-gray-600: oklch(0.51 0 0);
  19067. --color-gray-700: oklch(0.42 0 0);
  19068. --color-gray-800: oklch(0.321 0 0);
  19069. --color-gray-900: oklch(0.218 0 0);
  19070. --color-gray-950: oklch(0.159 0 0);
  19071. --color-transparent: transparent;
  19072. }
  19073. @source "../node_modules/stdf/**/*.svelte";
  19074. html {
  19075. -webkit-tap-highlight-color: transparent;
  19076. }
  19077. ================================================
  19078. FILE: packages/create-stdf/templates/skt/src/app.d.ts
  19079. ================================================
  19080. // See https://svelte.dev/docs/kit/types#app.d.ts
  19081. // for information about these interfaces
  19082. declare global {
  19083. namespace App {
  19084. // interface Error {}
  19085. // interface Locals {}
  19086. // interface PageData {}
  19087. // interface PageState {}
  19088. // interface Platform {}
  19089. }
  19090. }
  19091. export {};
  19092. ================================================
  19093. FILE: packages/create-stdf/templates/skt/src/app.html
  19094. ================================================
  19095. <!doctype html>
  19096. <html>
  19097. <head>
  19098. <meta charset="utf-8" />
  19099. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf.svg" media="(prefers-color-scheme: light)" />
  19100. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf_dark.svg" media="(prefers-color-scheme: dark)" />
  19101. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  19102. <title>SvelteKit + Tailwind + STDF</title>
  19103. %sveltekit.head%
  19104. </head>
  19105. <body data-sveltekit-preload-data="hover" class="bg-primaryWhite dark:bg-darkBlack text-black dark:text-white">
  19106. <div style="display: contents">%sveltekit.body%</div>
  19107. </body>
  19108. </html>
  19109. ================================================
  19110. FILE: packages/create-stdf/templates/skt/src/data/nintendo.ts
  19111. ================================================
  19112. import type { ThemeProps } from 'stdf/theme';
  19113. const Nintendo: ThemeProps = {
  19114. name: 'Nintendo',
  19115. color: {
  19116. primary: {
  19117. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  19118. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  19119. 200: 'oklch(0.845 0.076 21.796)', // #FAB9B6 hsl(3, 87%, 85%)
  19120. 300: 'oklch(0.745 0.133 21.872)', // #F58886 hsl(1, 85%, 74%)
  19121. 400: 'oklch(0.662 0.188 22.749)', // #F0575A hsl(359, 84%, 64%)
  19122. 500: 'oklch(0.609 0.224 25.256)', // #EB2B34 hsl(357, 83%, 55%)
  19123. default: 'oklch(0.581 0.238 27.862)', // #E60012 hsl(355, 100%, 45%)
  19124. 700: 'oklch(0.508 0.207 26.549)', // #C00016 hsl(353, 100%, 38%)
  19125. 800: 'oklch(0.43 0.174 24.608)', // #990017 hsl(351, 100%, 30%)
  19126. 900: 'oklch(0.351 0.141 21.971)', // #730015 hsl(349, 100%, 23%)
  19127. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  19128. },
  19129. dark: {
  19130. 50: 'oklch(0.992 0.011 189.833)', // #F5FFFE hsl(174, 100%, 98%)
  19131. 100: 'oklch(0.983 0.024 193.6)', // #E8FFFE hsl(177, 100%, 96%)
  19132. 200: 'oklch(0.938 0.067 196.074)', // #B6F9F9 hsl(180, 85%, 85%)
  19133. 300: 'oklch(0.893 0.099 198.69)', // #85F0F4 hsl(182, 84%, 74%)
  19134. 400: 'oklch(0.847 0.12 201.806)', // #57E4EE hsl(184, 82%, 64%)
  19135. 500: 'oklch(0.803 0.131 206.757)', // #2AD6E9 hsl(186, 81%, 54%)
  19136. default: 'oklch(0.752 0.133 215.123)', // #00C3E3 hsl(189, 100%, 45%)
  19137. 700: 'oklch(0.646 0.116 218.359)', // #009EBD hsl(190, 100%, 37%)
  19138. 800: 'oklch(0.535 0.1 223.819)', // #007998 hsl(192, 100%, 30%)
  19139. 900: 'oklch(0.426 0.083 227.589)', // #005772 hsl(194, 100%, 22%)
  19140. 950: 'oklch(0.319 0.064 230.58)' // #00384D hsl(196, 100%, 15%)
  19141. },
  19142. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  19143. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  19144. darkBlack: 'oklch(0.184 0.03 206.812)', // #011619 hsl(188, 95%, 5%)
  19145. darkWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(188, 5%, 95%)
  19146. functional: {
  19147. success: 'oklch(0.669 0.214 144.385)', // #00b42a hsl(134, 100%, 35%)
  19148. warning: 'oklch(0.865 0.176 95.103)', // #f7d00c hsl(50, 94%, 51%)
  19149. error: 'oklch(0.642 0.218 25.88)', // #f53f3f hsl(0, 90%, 60%)
  19150. info: 'oklch(0.549 0.249 263.048)' // #165dff hsl(222, 100%, 54%)
  19151. },
  19152. extend: [
  19153. {
  19154. color: 'oklch(0.492 0.217 261.351)', // #0052d9 hsl(217, 100%, 43%)
  19155. alias: 'Tencent'
  19156. },
  19157. {
  19158. color: 'oklch(0.651 0.212 142.608)', // #1aad19 hsl(120, 75%, 39%)
  19159. alias: 'WeChat'
  19160. },
  19161. {
  19162. color: 'oklch(0.692 0.181 46.213)', // #f37021 hsl(23, 90%, 54%)
  19163. alias: 'Hermès'
  19164. }
  19165. ]
  19166. }
  19167. };
  19168. export default Nintendo;
  19169. ================================================
  19170. FILE: packages/create-stdf/templates/skt/src/routes/+layout.js
  19171. ================================================
  19172. // 修改 ssr 为 false,使其不再使用服务端渲染,而是使用客户端渲染
  19173. // Change ssr to false to use client-side rendering instead of server-side rendering
  19174. export const ssr = false;
  19175. ================================================
  19176. FILE: packages/create-stdf/templates/skt/src/routes/+layout.svelte
  19177. ================================================
  19178. <script>
  19179. import '../app.css';
  19180. let { children } = $props();
  19181. </script>
  19182. {@render children()}
  19183. ================================================
  19184. FILE: packages/create-stdf/templates/skt/src/routes/+page.svelte
  19185. ================================================
  19186. <script>
  19187. import { setContext } from 'svelte';
  19188. import { Button, Cell, Icon, Calendar } from 'stdf';
  19189. import { STDFTheme, switchTheme, darkMode } from 'stdf/theme';
  19190. import NintendoTheme from '../data/nintendo';
  19191. import { en_US, zh_CN } from 'stdf/lang';
  19192. import Counter from './Counter.svelte';
  19193. import { browser } from '$app/environment';
  19194. if (browser) {
  19195. //解决 ios 不支持按钮:active 伪类
  19196. // Solve the problem that ios does not support the button: active pseudo class
  19197. document.body.addEventListener('touchstart', function () {
  19198. //...空函数即可
  19199. // ... Empty function is OK
  19200. });
  19201. }
  19202. //切换亮暗模式 (toggle light or dark mode)
  19203. let mode = $state(sessionStorage.getItem('mode') === 'dark' ? 'dark' : 'light');
  19204. $effect(() => {
  19205. if (mode === 'dark') {
  19206. darkMode(true);
  19207. } else {
  19208. darkMode(false);
  19209. }
  19210. });
  19211. const toggleModeFun = () => {
  19212. if (mode === 'dark') {
  19213. // 切换到 (light switch to light)
  19214. mode = 'light';
  19215. darkMode(false);
  19216. sessionStorage.setItem('mode', 'light');
  19217. } else {
  19218. // 切换到 (dark switch to dark)
  19219. mode = 'dark';
  19220. darkMode(true);
  19221. sessionStorage.setItem('mode', 'dark');
  19222. }
  19223. };
  19224. // 设置语言 (setting language)
  19225. let lang = $state(localStorage.getItem('lang') === 'en_US' ? 'en_US' : 'zh_CN');
  19226. setContext('STDF_lang', localStorage.getItem('lang') === 'en_US' ? en_US : zh_CN);
  19227. const toggleLangFun = () => {
  19228. lang = lang === 'zh_CN' ? 'en_US' : 'zh_CN';
  19229. localStorage.setItem('lang', lang);
  19230. window.location.reload();
  19231. };
  19232. // 进度条 (percent)
  19233. let percent = $state(20);
  19234. const reduceFunc = () => {
  19235. if (percent > 0) {
  19236. percent -= 10;
  19237. }
  19238. };
  19239. const increaseFunc = () => {
  19240. if (percent < 100) {
  19241. percent += 10;
  19242. }
  19243. };
  19244. // 日历(calendar)
  19245. let visible = $state(false);
  19246. // 主题(theme)
  19247. let theme = $state('STDF');
  19248. const toggleThemeFun = () => {
  19249. if (theme === 'STDF') {
  19250. theme = 'Nintendo';
  19251. switchTheme(NintendoTheme);
  19252. } else {
  19253. theme = 'STDF';
  19254. switchTheme(STDFTheme);
  19255. }
  19256. };
  19257. </script>
  19258. <div class="flex items-center justify-center gap-2 pt-10 text-center">
  19259. <a class="flex w-10 flex-col items-center" href="https://kit.svelte.dev" target="_blank" rel="noreferrer">
  19260. <img src="/svelte.svg" alt="Svelte Logo" />
  19261. </a>+
  19262. <a class="flex w-10 flex-col items-center" href="https://tailwindcss.com" target="_blank" rel="noreferrer">
  19263. <img src="/tailwindcss.svg" alt="Tailwind Logo" />
  19264. </a>+
  19265. <a class="flex w-8 flex-col items-center" href="https://stdf.design" target="_blank" rel="noreferrer" aria-label="STDF Logo">
  19266. <svg viewBox="0 0 90 80" fill="currentColor">
  19267. <path
  19268. class="text-primary dark:text-dark"
  19269. d="M0 0H20H40H50C64.8056 0 77.7325 8.04398 84.6487 20H50H40V22.6757V30H50C55.5229 30 60 34.4771 60 40C60 45.5229 55.5229 50 50 50H40V57.3243V78.7398V80H20V66.4583V20H15.3513H0V0ZM50 80C72.0914 80 90 62.0914 90 40C90 36.547 89.5625 33.1962 88.7398 30H67.3244C69.0261 32.9417 70 36.3571 70 40C70 51.0457 61.0457 60 50 60V80Z"
  19270. />
  19271. <path class="text-dark dark:text-primary" d="M20 30V0L0 50H20V80L40 30H20Z" />
  19272. </svg>
  19273. </a>
  19274. </div>
  19275. <div class="my-6 text-center text-xs">
  19276. {#if lang === 'zh_CN'}
  19277. <p>这是 SvelteKit + Tailwind + STDF 构建的模板</p>
  19278. <p class="mt-2">点击上方 LOGO 了解更多</p>
  19279. {:else}
  19280. <p>This is a template using SvelteKit + TailwindCSS + STDF</p>
  19281. <p class="mt-2">Click the logo above to learn more</p>
  19282. {/if}
  19283. </div>
  19284. <div class="my-6">
  19285. <a href="about">
  19286. <Cell title={lang === 'zh_CN' ? '跳转 ABOUT' : 'Go to ABOUT'} />
  19287. </a>
  19288. </div>
  19289. <div class="my-6">
  19290. <Cell
  19291. title={lang === 'zh_CN' ? '暗模式' : 'Dark mode'}
  19292. right={{ type: 'switch', switch: { active: mode === 'dark' } }}
  19293. onclick={toggleModeFun}
  19294. />
  19295. </div>
  19296. <div class="mt-8">
  19297. <Counter bind:percent />
  19298. </div>
  19299. <div class="mb-8">
  19300. <Button heightIn="0" group fill="lineTheme">
  19301. <div class="flex w-full">
  19302. <button class="border-primary dark:border-dark flex-1 border-r py-2 active:opacity-80" onclick={reduceFunc}>-10</button>
  19303. <button class="border-primary dark:border-dark flex-1 border-r py-2 active:opacity-80" onclick={increaseFunc}>+10</button>
  19304. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>
  19305. {lang === 'zh_CN' ? '重置' : 'Reset'}
  19306. </button>
  19307. </div>
  19308. </Button>
  19309. </div>
  19310. <div class="my-6">
  19311. <Button fill="lineTheme" onclick={() => (visible = true)}>{lang === 'zh_CN' ? '日历' : 'Calendar'}</Button>
  19312. </div>
  19313. <Calendar bind:visible />
  19314. <div class="my-6 flex justify-between px-8">
  19315. <Icon name="cake" theme path="symbols/Heroicons.svg" />
  19316. <Icon name="riding-line" path="symbols/Remix.svg" />
  19317. <Icon name="spy-line" theme path="symbols/Remix.svg" />
  19318. <Icon name="javascript-fill" injClass="text-[red] dark:text-green" path="symbols/Remix.svg" />
  19319. <Icon name="cup" theme path="symbols/IconPark.svg" />
  19320. </div>
  19321. <div class="px-4 text-xs">
  19322. {lang === 'zh_CN' ? '图标:第一个来自' : 'Icons: The first one comes from'}
  19323. <a class="underline" href="https://heroicons.com">Heroicons</a>
  19324. ,{lang === 'zh_CN' ? '最后一个来自' : 'the last one comes from'}
  19325. <a class="underline" href="https://iconpark.oceanengine.com">IconPark</a>
  19326. ,{lang === 'zh_CN' ? '其余来自' : 'the rest come from'}
  19327. <a class="underline" href="https://remixicon.com">Remix Icon</a> 。
  19328. </div>
  19329. <div class="my-6">
  19330. <Button onclick={toggleLangFun}>{lang === 'zh_CN' ? '切换语言' : 'Toggle language'}</Button>
  19331. <Button fill="lineTheme" onclick={toggleThemeFun}>{lang === 'zh_CN' ? '切换主题' : 'Toggle theme'}</Button>
  19332. </div>
  19333. ================================================
  19334. FILE: packages/create-stdf/templates/skt/src/routes/Counter.svelte
  19335. ================================================
  19336. <script>
  19337. import { Progress } from 'stdf';
  19338. let { percent = $bindable(20) } = $props();
  19339. </script>
  19340. <div class="p-4">
  19341. <Progress {percent} />
  19342. </div>
  19343. ================================================
  19344. FILE: packages/create-stdf/templates/skt/src/routes/about/+page.svelte
  19345. ================================================
  19346. <script>
  19347. import { NavBar } from 'stdf';
  19348. const lang = localStorage.getItem('lang') === 'en_US' ? 'en_US' : 'zh_CN';
  19349. </script>
  19350. <svelte:head>
  19351. <title>About</title>
  19352. <meta name="description" content="About this app" />
  19353. </svelte:head>
  19354. <div class="sticky top-0 z-10">
  19355. <NavBar title={lang === 'zh_CN' ? '关于' : 'ABOUT'} onclickLeft={() => window.history.back()} />
  19356. </div>
  19357. <div class="space-y-10 px-2 py-20 text-center">
  19358. <div class="text-primary dark:text-dark text-3xl">
  19359. {lang === 'zh_CN' ? '这是一个关于页面' : 'This is a about page'}
  19360. </div>
  19361. <div class="text-sm">
  19362. {lang === 'zh_CN'
  19363. ? '仅用于演示 SvelteKit 的路由功能'
  19364. : "Only for demonstration of SvelteKit's routing functionality"}
  19365. </div>
  19366. </div>
  19367. ================================================
  19368. FILE: packages/create-stdf/templates/sktt/README.md
  19369. ================================================
  19370. # SvelteKit + Tailwind + TypeScript + STDF
  19371. This template should help get you started developing with Svelte + Tailwind + TypeScript + STDF in SvelteKit.
  19372. ## Recommended IDE Setup
  19373. - [VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tailwind](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) + [TypeScript](https://typescriptlang.org) + [STDF](https://stdf.design) .
  19374. - [WebStorm](https://www.jetbrains.com/webstorm/) + [Svelte](https://www.jetbrains.com/help/webstorm/svelte.html) + [Tailwind](https://www.jetbrains.com/help/webstorm/tailwind-css.html) + [TypeScript](https://typescriptlang.org) + [STDF](https://stdf.design) .
  19375. ## More Info
  19376. For more information about quickly create a new project, see the STDF [Quick start](https://stdf.design/guide) guide.
  19377. ================================================
  19378. FILE: packages/create-stdf/templates/sktt/eslint.config.js
  19379. ================================================
  19380. import prettier from 'eslint-config-prettier';
  19381. import js from '@eslint/js';
  19382. import { includeIgnoreFile } from '@eslint/compat';
  19383. import svelte from 'eslint-plugin-svelte';
  19384. import globals from 'globals';
  19385. import { fileURLToPath } from 'node:url';
  19386. import ts from 'typescript-eslint';
  19387. import svelteConfig from './svelte.config.js';
  19388. const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
  19389. export default ts.config(
  19390. includeIgnoreFile(gitignorePath),
  19391. js.configs.recommended,
  19392. ...ts.configs.recommended,
  19393. ...svelte.configs.recommended,
  19394. prettier,
  19395. ...svelte.configs.prettier,
  19396. {
  19397. languageOptions: {
  19398. globals: { ...globals.browser, ...globals.node }
  19399. },
  19400. rules: { 'no-undef': 'off' }
  19401. },
  19402. {
  19403. files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
  19404. ignores: ['eslint.config.js', 'svelte.config.js'],
  19405. languageOptions: {
  19406. parserOptions: {
  19407. projectService: true,
  19408. extraFileExtensions: ['.svelte'],
  19409. parser: ts.parser,
  19410. svelteConfig
  19411. }
  19412. }
  19413. }
  19414. );
  19415. ================================================
  19416. FILE: packages/create-stdf/templates/sktt/package.json
  19417. ================================================
  19418. {
  19419. "name": "sktt",
  19420. "private": true,
  19421. "version": "0.0.1",
  19422. "type": "module",
  19423. "scripts": {
  19424. "dev": "vite dev",
  19425. "build": "vite build",
  19426. "preview": "vite preview",
  19427. "prepare": "svelte-kit sync || echo ''",
  19428. "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
  19429. "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
  19430. "format": "prettier --write .",
  19431. "lint": "prettier --check . && eslint ."
  19432. },
  19433. "devDependencies": {
  19434. "@eslint/compat": "^1.2.5",
  19435. "@eslint/js": "^9.18.0",
  19436. "@sveltejs/adapter-auto": "^4.0.0",
  19437. "@sveltejs/kit": "^2.16.0",
  19438. "@sveltejs/vite-plugin-svelte": "^5.0.0",
  19439. "@tailwindcss/vite": "^4.0.0",
  19440. "eslint": "^9.18.0",
  19441. "eslint-config-prettier": "^10.0.1",
  19442. "eslint-plugin-svelte": "^3.0.0",
  19443. "globals": "^16.0.0",
  19444. "prettier": "^3.4.2",
  19445. "prettier-plugin-svelte": "^3.3.3",
  19446. "prettier-plugin-tailwindcss": "^0.6.11",
  19447. "rollup-plugin-stdf-icon": "file:../../../rollup-plugin-stdf-icon",
  19448. "svelte": "^5.0.0",
  19449. "svelte-check": "^4.0.0",
  19450. "stdf": "file:../../../stdf",
  19451. "tailwindcss": "^4.0.0",
  19452. "typescript": "^5.0.0",
  19453. "typescript-eslint": "^8.20.0",
  19454. "vite": "^6.0.0"
  19455. }
  19456. }
  19457. ================================================
  19458. FILE: packages/create-stdf/templates/sktt/svelte.config.js
  19459. ================================================
  19460. import adapter from '@sveltejs/adapter-auto';
  19461. import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
  19462. const config = {
  19463. preprocess: vitePreprocess(),
  19464. kit: { adapter: adapter() }
  19465. };
  19466. export default config;
  19467. ================================================
  19468. FILE: packages/create-stdf/templates/sktt/tsconfig.json
  19469. ================================================
  19470. {
  19471. "extends": "./.svelte-kit/tsconfig.json",
  19472. "compilerOptions": {
  19473. "allowJs": true,
  19474. "checkJs": true,
  19475. "esModuleInterop": true,
  19476. "forceConsistentCasingInFileNames": true,
  19477. "resolveJsonModule": true,
  19478. "skipLibCheck": true,
  19479. "sourceMap": true,
  19480. "strict": true,
  19481. "moduleResolution": "bundler"
  19482. }
  19483. // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  19484. // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  19485. //
  19486. // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
  19487. // from the referenced tsconfig.json - TypeScript does not merge them in
  19488. }
  19489. ================================================
  19490. FILE: packages/create-stdf/templates/sktt/vite.config.ts
  19491. ================================================
  19492. import tailwindcss from '@tailwindcss/vite';
  19493. import { sveltekit } from '@sveltejs/kit/vite';
  19494. import { defineConfig } from 'vite';
  19495. import svgSprite from 'rollup-plugin-stdf-icon';
  19496. export default defineConfig({
  19497. plugins: [
  19498. tailwindcss(),
  19499. sveltekit(),
  19500. // 一般来说,一个应用的的 svg 不多时都放在一个文件夹下,合并为一个 symbol 即可。此处演示了不同文件夹下的图标如何合并为不同的 symbol。
  19501. // Generally speaking, when the svg of an application is not much, it is placed in a folder and merged into one symbol. This example shows how the icons in different folders are merged into different symbols.
  19502. svgSprite([
  19503. { inFile: 'src/lib/svgs/Heroicons', outFile: 'static/symbols' },
  19504. { inFile: 'src/lib/svgs/IconPark', outFile: 'static/symbols' },
  19505. { inFile: 'src/lib/svgs/Remix', outFile: 'static/symbols' },
  19506. // 单独为 Cell 与 NavBar 用到的图标创建一个 symbol。详见:https://stdf.design/guide/icon
  19507. // Create a symbol for the icons used by Cell and NavBar. See: https://stdf.design/guide/icon
  19508. { inFile: 'src/lib/symbol', outFile: 'static/fonts' }
  19509. ])
  19510. ]
  19511. });
  19512. ================================================
  19513. FILE: packages/create-stdf/templates/sktt/.npmrc
  19514. ================================================
  19515. engine-strict=true
  19516. ================================================
  19517. FILE: packages/create-stdf/templates/sktt/.prettierignore
  19518. ================================================
  19519. # Package Managers
  19520. package-lock.json
  19521. pnpm-lock.yaml
  19522. yarn.lock
  19523. bun.lock
  19524. bun.lockb
  19525. ================================================
  19526. FILE: packages/create-stdf/templates/sktt/.prettierrc
  19527. ================================================
  19528. {
  19529. "useTabs": true,
  19530. "singleQuote": true,
  19531. "trailingComma": "none",
  19532. "printWidth": 140,
  19533. "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
  19534. "overrides": [
  19535. {
  19536. "files": "*.svelte",
  19537. "options": {
  19538. "parser": "svelte"
  19539. }
  19540. }
  19541. ]
  19542. }
  19543. ================================================
  19544. FILE: packages/create-stdf/templates/sktt/src/app.css
  19545. ================================================
  19546. @import 'tailwindcss';
  19547. @custom-variant dark (&:where(.dark, .dark *));
  19548. @theme {
  19549. --color-primary-50: oklch(0.979 0.01 267.36);
  19550. --color-primary-100: oklch(0.95 0.024 270.343);
  19551. --color-primary-200: oklch(0.847 0.074 271.188);
  19552. --color-primary-300: oklch(0.741 0.13 272.232);
  19553. --color-primary-400: oklch(0.634 0.193 271.595);
  19554. --color-primary-500: oklch(0.536 0.252 268.66);
  19555. --color-primary: oklch(0.467 0.296 264.886);
  19556. --color-primary-700: oklch(0.397 0.26 264.877);
  19557. --color-primary-800: oklch(0.331 0.221 264.833);
  19558. --color-primary-900: oklch(0.26 0.178 264.428);
  19559. --color-primary-950: oklch(0.192 0.13 266.64);
  19560. --color-dark-50: oklch(0.995 0.012 101.474);
  19561. --color-dark-100: oklch(0.986 0.025 97.107);
  19562. --color-dark-200: oklch(0.965 0.059 95.884);
  19563. --color-dark-300: oklch(0.938 0.089 92.952);
  19564. --color-dark-400: oklch(0.91 0.114 89.711);
  19565. --color-dark-500: oklch(0.88 0.136 86.375);
  19566. --color-dark: oklch(0.845 0.153 80.597);
  19567. --color-dark-700: oklch(0.71 0.137 75.734);
  19568. --color-dark-800: oklch(0.58 0.118 70.166);
  19569. --color-dark-900: oklch(0.449 0.097 65.209);
  19570. --color-dark-950: oklch(0.321 0.074 62.379);
  19571. --color-primaryBlack: oklch(0.116 0.054 267.087);
  19572. --color-primaryWhite: oklch(0.961 0.001 286.375);
  19573. --color-darkBlack: oklch(0.183 0.035 86.634);
  19574. --color-darkWhite: oklch(0.962 0.001 17.178);
  19575. --color-success: oklch(0.704 0.142 167.084);
  19576. --color-warning: oklch(0.558 0.154 47.186);
  19577. --color-error: oklch(0.564 0.223 28.46);
  19578. --color-info: oklch(0.482 0.14 261.518);
  19579. --color-extend0: oklch(0.703 0.149 235.059);
  19580. --color-Twitter: oklch(0.703 0.149 235.059);
  19581. --color-extend1: oklch(0.702 0.194 38.137);
  19582. --color-Svelte: oklch(0.702 0.194 38.137);
  19583. --color-extend2: oklch(0.482 0.107 161.212);
  19584. --color-Starbucks: oklch(0.482 0.107 161.212);
  19585. --color-black: oklch(0 0 0);
  19586. --color-white: oklch(1 0 0);
  19587. --color-gray-50: oklch(0.961 0 0);
  19588. --color-gray-100: oklch(0.925 0 0);
  19589. --color-gray-200: oklch(0.845 0 0);
  19590. --color-gray-300: oklch(0.767 0 0);
  19591. --color-gray-400: oklch(0.683 0 0);
  19592. --color-gray-500: oklch(0.6 0 0);
  19593. --color-gray-600: oklch(0.51 0 0);
  19594. --color-gray-700: oklch(0.42 0 0);
  19595. --color-gray-800: oklch(0.321 0 0);
  19596. --color-gray-900: oklch(0.218 0 0);
  19597. --color-gray-950: oklch(0.159 0 0);
  19598. --color-transparent: transparent;
  19599. }
  19600. @source "../node_modules/stdf/**/*.svelte";
  19601. html {
  19602. -webkit-tap-highlight-color: transparent;
  19603. }
  19604. ================================================
  19605. FILE: packages/create-stdf/templates/sktt/src/app.d.ts
  19606. ================================================
  19607. // See https://svelte.dev/docs/kit/types#app.d.ts
  19608. // for information about these interfaces
  19609. declare global {
  19610. namespace App {
  19611. // interface Error {}
  19612. // interface Locals {}
  19613. // interface PageData {}
  19614. // interface PageState {}
  19615. // interface Platform {}
  19616. }
  19617. }
  19618. export {};
  19619. ================================================
  19620. FILE: packages/create-stdf/templates/sktt/src/app.html
  19621. ================================================
  19622. <!doctype html>
  19623. <html>
  19624. <head>
  19625. <meta charset="utf-8" />
  19626. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf.svg" media="(prefers-color-scheme: light)" />
  19627. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf_dark.svg" media="(prefers-color-scheme: dark)" />
  19628. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  19629. <title>SvelteKit + Tailwind + TypeScript + STDF</title>
  19630. %sveltekit.head%
  19631. </head>
  19632. <body data-sveltekit-preload-data="hover" class="bg-primaryWhite dark:bg-darkBlack text-black dark:text-white">
  19633. <div style="display: contents">%sveltekit.body%</div>
  19634. </body>
  19635. </html>
  19636. ================================================
  19637. FILE: packages/create-stdf/templates/sktt/src/data/nintendo.ts
  19638. ================================================
  19639. import type { ThemeProps } from 'stdf/theme';
  19640. const Nintendo: ThemeProps = {
  19641. name: 'Nintendo',
  19642. color: {
  19643. primary: {
  19644. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  19645. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  19646. 200: 'oklch(0.845 0.076 21.796)', // #FAB9B6 hsl(3, 87%, 85%)
  19647. 300: 'oklch(0.745 0.133 21.872)', // #F58886 hsl(1, 85%, 74%)
  19648. 400: 'oklch(0.662 0.188 22.749)', // #F0575A hsl(359, 84%, 64%)
  19649. 500: 'oklch(0.609 0.224 25.256)', // #EB2B34 hsl(357, 83%, 55%)
  19650. default: 'oklch(0.581 0.238 27.862)', // #E60012 hsl(355, 100%, 45%)
  19651. 700: 'oklch(0.508 0.207 26.549)', // #C00016 hsl(353, 100%, 38%)
  19652. 800: 'oklch(0.43 0.174 24.608)', // #990017 hsl(351, 100%, 30%)
  19653. 900: 'oklch(0.351 0.141 21.971)', // #730015 hsl(349, 100%, 23%)
  19654. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  19655. },
  19656. dark: {
  19657. 50: 'oklch(0.992 0.011 189.833)', // #F5FFFE hsl(174, 100%, 98%)
  19658. 100: 'oklch(0.983 0.024 193.6)', // #E8FFFE hsl(177, 100%, 96%)
  19659. 200: 'oklch(0.938 0.067 196.074)', // #B6F9F9 hsl(180, 85%, 85%)
  19660. 300: 'oklch(0.893 0.099 198.69)', // #85F0F4 hsl(182, 84%, 74%)
  19661. 400: 'oklch(0.847 0.12 201.806)', // #57E4EE hsl(184, 82%, 64%)
  19662. 500: 'oklch(0.803 0.131 206.757)', // #2AD6E9 hsl(186, 81%, 54%)
  19663. default: 'oklch(0.752 0.133 215.123)', // #00C3E3 hsl(189, 100%, 45%)
  19664. 700: 'oklch(0.646 0.116 218.359)', // #009EBD hsl(190, 100%, 37%)
  19665. 800: 'oklch(0.535 0.1 223.819)', // #007998 hsl(192, 100%, 30%)
  19666. 900: 'oklch(0.426 0.083 227.589)', // #005772 hsl(194, 100%, 22%)
  19667. 950: 'oklch(0.319 0.064 230.58)' // #00384D hsl(196, 100%, 15%)
  19668. },
  19669. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  19670. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  19671. darkBlack: 'oklch(0.184 0.03 206.812)', // #011619 hsl(188, 95%, 5%)
  19672. darkWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(188, 5%, 95%)
  19673. functional: {
  19674. success: 'oklch(0.669 0.214 144.385)', // #00b42a hsl(134, 100%, 35%)
  19675. warning: 'oklch(0.865 0.176 95.103)', // #f7d00c hsl(50, 94%, 51%)
  19676. error: 'oklch(0.642 0.218 25.88)', // #f53f3f hsl(0, 90%, 60%)
  19677. info: 'oklch(0.549 0.249 263.048)' // #165dff hsl(222, 100%, 54%)
  19678. },
  19679. extend: [
  19680. {
  19681. color: 'oklch(0.492 0.217 261.351)', // #0052d9 hsl(217, 100%, 43%)
  19682. alias: 'Tencent'
  19683. },
  19684. {
  19685. color: 'oklch(0.651 0.212 142.608)', // #1aad19 hsl(120, 75%, 39%)
  19686. alias: 'WeChat'
  19687. },
  19688. {
  19689. color: 'oklch(0.692 0.181 46.213)', // #f37021 hsl(23, 90%, 54%)
  19690. alias: 'Hermès'
  19691. }
  19692. ]
  19693. }
  19694. };
  19695. export default Nintendo;
  19696. ================================================
  19697. FILE: packages/create-stdf/templates/sktt/src/routes/+layout.js
  19698. ================================================
  19699. // 修改 ssr 为 false,使其不再使用服务端渲染,而是使用客户端渲染
  19700. // Change ssr to false to use client-side rendering instead of server-side rendering
  19701. export const ssr = false;
  19702. ================================================
  19703. FILE: packages/create-stdf/templates/sktt/src/routes/+layout.svelte
  19704. ================================================
  19705. <script lang="ts">
  19706. import '../app.css';
  19707. let { children } = $props();
  19708. </script>
  19709. {@render children()}
  19710. ================================================
  19711. FILE: packages/create-stdf/templates/sktt/src/routes/+page.svelte
  19712. ================================================
  19713. <script lang="ts">
  19714. import { setContext } from 'svelte';
  19715. import { Button, Cell, Icon, Calendar } from 'stdf';
  19716. import { STDFTheme, switchTheme, darkMode } from 'stdf/theme';
  19717. import NintendoTheme from '../data/nintendo';
  19718. import { en_US, zh_CN } from 'stdf/lang';
  19719. import Counter from './Counter.svelte';
  19720. import { browser } from '$app/environment';
  19721. if (browser) {
  19722. //解决 ios 不支持按钮:active 伪类
  19723. // Solve the problem that ios does not support the button: active pseudo class
  19724. document.body.addEventListener('touchstart', function () {
  19725. //...空函数即可
  19726. // ... Empty function is OK
  19727. });
  19728. }
  19729. //切换亮暗模式 (toggle light or dark mode)
  19730. let mode = $state(sessionStorage.getItem('mode') === 'dark' ? 'dark' : 'light');
  19731. $effect(() => {
  19732. if (mode === 'dark') {
  19733. darkMode(true);
  19734. } else {
  19735. darkMode(false);
  19736. }
  19737. });
  19738. const toggleModeFun = () => {
  19739. if (mode === 'dark') {
  19740. // 切换到 (light switch to light)
  19741. mode = 'light';
  19742. darkMode(false);
  19743. sessionStorage.setItem('mode', 'light');
  19744. } else {
  19745. // 切换到 (dark switch to dark)
  19746. mode = 'dark';
  19747. darkMode(true);
  19748. sessionStorage.setItem('mode', 'dark');
  19749. }
  19750. };
  19751. // 设置语言 (setting language)
  19752. let lang = $state(localStorage.getItem('lang') === 'en_US' ? 'en_US' : 'zh_CN');
  19753. setContext('STDF_lang', localStorage.getItem('lang') === 'en_US' ? en_US : zh_CN);
  19754. const toggleLangFun = () => {
  19755. lang = lang === 'zh_CN' ? 'en_US' : 'zh_CN';
  19756. localStorage.setItem('lang', lang);
  19757. window.location.reload();
  19758. };
  19759. // 进度条 (percent)
  19760. let percent = $state(20);
  19761. const reduceFunc = () => {
  19762. if (percent > 0) {
  19763. percent -= 10;
  19764. }
  19765. };
  19766. const increaseFunc = () => {
  19767. if (percent < 100) {
  19768. percent += 10;
  19769. }
  19770. };
  19771. // 日历(calendar)
  19772. let visible = $state(false);
  19773. // 主题(theme)
  19774. let theme = $state('STDF');
  19775. const toggleThemeFun = () => {
  19776. if (theme === 'STDF') {
  19777. theme = 'Nintendo';
  19778. switchTheme(NintendoTheme);
  19779. } else {
  19780. theme = 'STDF';
  19781. switchTheme(STDFTheme);
  19782. }
  19783. };
  19784. </script>
  19785. <div class="flex items-center justify-center gap-2 pt-10 text-center">
  19786. <a class="flex w-10 flex-col items-center" href="https://kit.svelte.dev" target="_blank" rel="noreferrer">
  19787. <img src="/svelte.svg" alt="Svelte Logo" />
  19788. </a>+
  19789. <a class="flex w-10 flex-col items-center" href="https://tailwindcss.com" target="_blank" rel="noreferrer">
  19790. <img src="/tailwindcss.svg" alt="Tailwind Logo" />
  19791. </a>+
  19792. <a class="flex w-10 flex-col items-center" href="https://typescriptlang.org" target="_blank" rel="noreferrer">
  19793. <img src="/typescript.svg" alt="Typescript Logo" />
  19794. </a>+
  19795. <a class="flex w-8 flex-col items-center" href="https://stdf.design" target="_blank" rel="noreferrer" aria-label="STDF Logo">
  19796. <svg viewBox="0 0 90 80" fill="currentColor">
  19797. <path
  19798. class="text-primary dark:text-dark"
  19799. d="M0 0H20H40H50C64.8056 0 77.7325 8.04398 84.6487 20H50H40V22.6757V30H50C55.5229 30 60 34.4771 60 40C60 45.5229 55.5229 50 50 50H40V57.3243V78.7398V80H20V66.4583V20H15.3513H0V0ZM50 80C72.0914 80 90 62.0914 90 40C90 36.547 89.5625 33.1962 88.7398 30H67.3244C69.0261 32.9417 70 36.3571 70 40C70 51.0457 61.0457 60 50 60V80Z"
  19800. />
  19801. <path class="text-dark dark:text-primary" d="M20 30V0L0 50H20V80L40 30H20Z" />
  19802. </svg>
  19803. </a>
  19804. </div>
  19805. <div class="my-6 text-center text-xs">
  19806. {#if lang === 'zh_CN'}
  19807. <p>这是 SvelteKit + Tailwind + TypeScript + STDF 构建的模板</p>
  19808. <p class="mt-2">点击上方 LOGO 了解更多</p>
  19809. {:else}
  19810. <p>This is a template using SvelteKit + TailwindCSS + TypeScript + STDF</p>
  19811. <p class="mt-2">Click the logo above to learn more</p>
  19812. {/if}
  19813. </div>
  19814. <div class="my-6">
  19815. <a href="about">
  19816. <Cell title={lang === 'zh_CN' ? '跳转 ABOUT' : 'Go to ABOUT'} />
  19817. </a>
  19818. </div>
  19819. <div class="my-6">
  19820. <Cell
  19821. title={lang === 'zh_CN' ? '暗模式' : 'Dark mode'}
  19822. right={{ type: 'switch', switch: { active: mode === 'dark' } }}
  19823. onclick={toggleModeFun}
  19824. />
  19825. </div>
  19826. <div class="mt-8">
  19827. <Counter bind:percent />
  19828. </div>
  19829. <div class="mb-8">
  19830. <Button heightIn="0" group fill="lineTheme">
  19831. <div class="flex w-full">
  19832. <button class="border-primary dark:border-dark flex-1 border-r py-2 active:opacity-80" onclick={reduceFunc}>-10</button>
  19833. <button class="border-primary dark:border-dark flex-1 border-r py-2 active:opacity-80" onclick={increaseFunc}>+10</button>
  19834. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>
  19835. {lang === 'zh_CN' ? '重置' : 'Reset'}
  19836. </button>
  19837. </div>
  19838. </Button>
  19839. </div>
  19840. <div class="my-6">
  19841. <Button fill="lineTheme" onclick={() => (visible = true)}>{lang === 'zh_CN' ? '日历' : 'Calendar'}</Button>
  19842. </div>
  19843. <Calendar bind:visible />
  19844. <div class="my-6 flex justify-between px-8">
  19845. <Icon name="cake" theme path="symbols/Heroicons.svg" />
  19846. <Icon name="riding-line" path="symbols/Remix.svg" />
  19847. <Icon name="spy-line" theme path="symbols/Remix.svg" />
  19848. <Icon name="javascript-fill" injClass="text-[red] dark:text-green" path="symbols/Remix.svg" />
  19849. <Icon name="cup" theme path="symbols/IconPark.svg" />
  19850. </div>
  19851. <div class="px-4 text-xs">
  19852. {lang === 'zh_CN' ? '图标:第一个来自' : 'Icons: The first one comes from'}
  19853. <a class="underline" href="https://heroicons.com">Heroicons</a>
  19854. ,{lang === 'zh_CN' ? '最后一个来自' : 'the last one comes from'}
  19855. <a class="underline" href="https://iconpark.oceanengine.com">IconPark</a>
  19856. ,{lang === 'zh_CN' ? '其余来自' : 'the rest come from'} <a class="underline" href="https://remixicon.com">Remix Icon</a> 。
  19857. </div>
  19858. <div class="my-6">
  19859. <Button onclick={toggleLangFun}>{lang === 'zh_CN' ? '切换语言' : 'Toggle language'}</Button>
  19860. <Button fill="lineTheme" onclick={toggleThemeFun}>{lang === 'zh_CN' ? '切换主题' : 'Toggle theme'}</Button>
  19861. </div>
  19862. ================================================
  19863. FILE: packages/create-stdf/templates/sktt/src/routes/Counter.svelte
  19864. ================================================
  19865. <script lang="ts">
  19866. import { Progress } from 'stdf';
  19867. let { percent = $bindable(20) } = $props();
  19868. </script>
  19869. <div class="p-4">
  19870. <Progress {percent} />
  19871. </div>
  19872. ================================================
  19873. FILE: packages/create-stdf/templates/sktt/src/routes/about/+page.svelte
  19874. ================================================
  19875. <script lang="ts">
  19876. import { NavBar } from 'stdf';
  19877. const lang = localStorage.getItem('lang') === 'en_US' ? 'en_US' : 'zh_CN';
  19878. </script>
  19879. <svelte:head>
  19880. <title>About</title>
  19881. <meta name="description" content="About this app" />
  19882. </svelte:head>
  19883. <div class="sticky top-0 z-10">
  19884. <NavBar title={lang === 'zh_CN' ? '关于' : 'ABOUT'} onclickLeft={() => window.history.back()} />
  19885. </div>
  19886. <div class="space-y-10 px-2 py-20 text-center">
  19887. <div class="text-primary dark:text-dark text-3xl">{lang === 'zh_CN' ? '这是一个关于页面' : 'This is a about page'}</div>
  19888. <div class="text-sm">
  19889. {lang === 'zh_CN' ? '仅用于演示 SvelteKit 的路由功能' : "Only for demonstration of SvelteKit's routing functionality"}
  19890. </div>
  19891. </div>
  19892. ================================================
  19893. FILE: packages/rollup-plugin-md-ts/README.md
  19894. ================================================
  19895. [简体中文](https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-md-ts/README_CN.md)
  19896. ## Introduction
  19897. This is a Rollup/Vite plugin that converts Markdown files to HTML strings, based on [marked](https://github.com/markedjs/marked).
  19898. The implementation idea is based on [rollup-plugin-md](https://github.com/xiaofuzi/rollup-plugin-md), adding TypeScript and compatible with Vite's plugin type.
  19899. The STDF doc site <https://stdf.design> uses this plugin.
  19900. ## Parameters
  19901. | Parameter | Type | Default | Description |
  19902. | --------- | ---- | -------- | ------------------------------------------------------------------------------ |
  19903. | marked | `MarkedOptions` | `{}` | [marked](https://github.com/markedjs/marked) options. |
  19904. | include | `string[]` | `['**/*.md']` | The path of the Markdown file to include. |
  19905. | exclude | `string[]` | `[]` | The path of the Markdown file to exclude. |
  19906. The `include` and `exclude` parameters are relative to the project root directory (usually the directory where vite.config.js or vite.config.ts is located).
  19907. ## Installation
  19908. <!-- :::code-groups -->
  19909. <!-- pnpm -->
  19910. ```sh
  19911. pnpm i rollup-plugin-md-ts -D
  19912. ```
  19913. <!-- :: -->
  19914. <!-- npm -->
  19915. ```sh
  19916. npm i rollup-plugin-md-ts -D
  19917. ```
  19918. <!-- :: -->
  19919. <!-- bun -->
  19920. ```sh
  19921. bun add rollup-plugin-md-ts -D
  19922. ```
  19923. <!-- :: -->
  19924. <!-- yarn -->
  19925. ```sh
  19926. yarn add rollup-plugin-md-ts -D
  19927. ```
  19928. <!-- ::: -->
  19929. ## Usage
  19930. Configure in vite.config.js or vite.config.ts:
  19931. ```javascript
  19932. import md from 'rollup-plugin-md-ts';
  19933. export default defineConfig({
  19934. // ...
  19935. plugins: [
  19936. // ...
  19937. md({
  19938. marked: {},
  19939. include: [ './src/**/*.md']
  19940. })
  19941. // ...
  19942. ],
  19943. // ...
  19944. });
  19945. ```
  19946. ## Why Create
  19947. There are already many plugins that can implement similar functions, such as [vite-plugin-markdown](https://www.npmjs.com/package/vite-plugin-markdown), which do not convert the following characters when converting to-do lists, which is exactly the function needed in [STDF](https://stdf.design).
  19948. ```md
  19949. - [ ] TODO
  19950. - [x] DONE
  19951. ```
  19952. ## License
  19953. This project is licensed under the [MIT License](https://github.com/any-tdf/stdf/blob/main/LICENSE).
  19954. ================================================
  19955. FILE: packages/rollup-plugin-md-ts/eslint.config.js
  19956. ================================================
  19957. import prettier from 'eslint-config-prettier';
  19958. import js from '@eslint/js';
  19959. import globals from 'globals';
  19960. import ts from 'typescript-eslint';
  19961. export default ts.config(
  19962. js.configs.recommended,
  19963. ...ts.configs.recommended,
  19964. prettier,
  19965. {
  19966. languageOptions: {
  19967. globals: {
  19968. ...globals.browser,
  19969. ...globals.node
  19970. }
  19971. }
  19972. },
  19973. {
  19974. files: ['**/*.ts'],
  19975. languageOptions: {
  19976. parserOptions: {
  19977. parser: ts.parser
  19978. }
  19979. }
  19980. },
  19981. {
  19982. ignores: ['build/', 'dist/']
  19983. }
  19984. );
  19985. ================================================
  19986. FILE: packages/rollup-plugin-md-ts/package.json
  19987. ================================================
  19988. {
  19989. "name": "rollup-plugin-md-ts",
  19990. "version": "0.0.3",
  19991. "description": "a rollup plugin for markdown files",
  19992. "type": "module",
  19993. "types": "./dist/index.d.ts",
  19994. "exports": {
  19995. ".": {
  19996. "default": "./dist/index.js",
  19997. "types": "./dist/index.d.ts"
  19998. }
  19999. },
  20000. "files": [
  20001. "dist/**"
  20002. ],
  20003. "scripts": {
  20004. "pretest": "npm run build",
  20005. "build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
  20006. "prebuild": "rm -rf dist/*"
  20007. },
  20008. "keywords": [
  20009. "rollup",
  20010. "plugin",
  20011. "md",
  20012. "markdown",
  20013. "typescript",
  20014. "vite",
  20015. "STDF"
  20016. ],
  20017. "author": "any-tdf",
  20018. "funding": "https://stdf.design?fund",
  20019. "license": "MIT",
  20020. "homepage": "https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-md-ts/README.md",
  20021. "repository": {
  20022. "type": "git",
  20023. "url": "https://github.com/any-tdf/stdf"
  20024. },
  20025. "bugs": {
  20026. "url": "https://github.com/any-tdf/stdf/issues?q=is:issue+is:open+md"
  20027. },
  20028. "dependencies": {
  20029. "marked": "^15.0.3",
  20030. "rollup": "^4.28.1",
  20031. "rollup-pluginutils": "^2.8.2"
  20032. },
  20033. "devDependencies": {
  20034. "@eslint/js": "^9.16.0",
  20035. "@rollup/plugin-json": "^6.1.0",
  20036. "@rollup/plugin-node-resolve": "^15.3.0",
  20037. "@rollup/plugin-terser": "^0.4.4",
  20038. "@rollup/plugin-typescript": "^12.1.1",
  20039. "assert": "^2.1.0",
  20040. "eslint": "^9.16.0",
  20041. "eslint-config-prettier": "^9.1.0",
  20042. "fs": "^0.0.1-security",
  20043. "globals": "^15.13.0",
  20044. "mocha": "^11.0.1",
  20045. "source-map-support": "^0.5.21",
  20046. "tslib": "^2.8.1",
  20047. "typescript": "^5.7.2",
  20048. "typescript-eslint": "^8.18.0"
  20049. }
  20050. }
  20051. ================================================
  20052. FILE: packages/rollup-plugin-md-ts/README_CN.md
  20053. ================================================
  20054. [English](https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-md-ts/README.md)
  20055. ## 介绍
  20056. 一款 Rollup/Vite 插件,功能是将 Markdown 文件转换为 HTML 字符串,基于 [marked](https://github.com/markedjs/marked) 。
  20057. 实现思路参考 [rollup-plugin-md](https://github.com/xiaofuzi/rollup-plugin-md) ,增加了 TypeScript 并兼容 Vite 的插件类型。
  20058. STDF 文档站点 <https://stdf.design> 使用了此插件。
  20059. ## 参数
  20060. | 参数 | 类型 | 默认 | 描述 |
  20061. | -------- | ---- | ---------------- | ------------------------------------------------------------------------------ |
  20062. | marked | `MarkedOptions` | `{}` | [marked](https://github.com/markedjs/marked) 的配置。 |
  20063. | include | `string[]` | `['**/*.md']` | 要包含的 Markdown 文件路径。 |
  20064. | exclude | `string[]` | `[]` | 要排除的 Markdown 文件路径。 |
  20065. 其中 include 和 exclude 是相对项目根目录(一般就是 vite.config.js 或 vite.config.ts 所在目录)的相对路径。
  20066. ## 安装
  20067. <!-- :::code-groups -->
  20068. <!-- pnpm -->
  20069. ```sh
  20070. pnpm i rollup-plugin-md-ts -D
  20071. ```
  20072. <!-- :: -->
  20073. <!-- npm -->
  20074. ```sh
  20075. npm i rollup-plugin-md-ts -D
  20076. ```
  20077. <!-- :: -->
  20078. <!-- bun -->
  20079. ```sh
  20080. bun add rollup-plugin-md-ts -D
  20081. ```
  20082. <!-- :: -->
  20083. <!-- yarn -->
  20084. ```sh
  20085. yarn add rollup-plugin-md-ts -D
  20086. ```
  20087. <!-- ::: -->
  20088. ## 使用
  20089. 在 vite.config.js 或 vite.config.ts 中配置:
  20090. ```javascript
  20091. import md from 'rollup-plugin-md-ts';
  20092. export default defineConfig({
  20093. // ...
  20094. plugins: [
  20095. // ...
  20096. md({
  20097. marked: {},
  20098. include: [ './src/**/*.md']
  20099. })
  20100. // ...
  20101. ],
  20102. // ...
  20103. });
  20104. ```
  20105. ## 为何创建
  20106. 其实市面上已经有很多能实现类似功能的插件,比如 [vite-plugin-markdown](https://www.npmjs.com/package/vite-plugin-markdown) ,这些基于 [markdown-it](https://www.npmjs.com/package/markdown-it) 的插件在转换待办事项列表时,并不会转换以下字符,而这个正好是 [STDF](https://stdf.design) 中需要用到的功能。
  20107. ```md
  20108. - [ ] 待办事项
  20109. - [x] 已完成事项
  20110. ```
  20111. ## 许可证
  20112. 本项目基于 [MIT 许可证](https://github.com/any-tdf/stdf/blob/main/LICENSE)。
  20113. ================================================
  20114. FILE: packages/rollup-plugin-md-ts/rollup.config.ts
  20115. ================================================
  20116. import json from '@rollup/plugin-json';
  20117. import typescript from '@rollup/plugin-typescript';
  20118. import terser from '@rollup/plugin-terser';
  20119. import { readFileSync } from 'fs';
  20120. const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
  20121. const external = Object.keys(pkg.dependencies);
  20122. export default {
  20123. input: 'src/index.ts',
  20124. output: [
  20125. {
  20126. dir: 'dist',
  20127. format: 'es',
  20128. file: pkg['main'],
  20129. sourcemap: true,
  20130. compact: true
  20131. }
  20132. ],
  20133. external: external,
  20134. plugins: [
  20135. typescript({
  20136. declaration: true,
  20137. declarationDir: 'dist',
  20138. rootDir: 'src',
  20139. tsconfig: './tsconfig.json'
  20140. }),
  20141. json(),
  20142. terser()
  20143. ]
  20144. };
  20145. ================================================
  20146. FILE: packages/rollup-plugin-md-ts/tsconfig.json
  20147. ================================================
  20148. {
  20149. "compilerOptions": {
  20150. "target": "ES2018",
  20151. "module": "ESNext",
  20152. "moduleResolution": "node",
  20153. "declaration": true,
  20154. "outDir": "./dist",
  20155. "strict": true,
  20156. "esModuleInterop": true,
  20157. "skipLibCheck": true
  20158. },
  20159. "include": ["src/**/*"],
  20160. "exclude": ["node_modules", "dist"]
  20161. }
  20162. ================================================
  20163. FILE: packages/rollup-plugin-md-ts/.prettierrc
  20164. ================================================
  20165. {
  20166. "useTabs": true,
  20167. "singleQuote": true,
  20168. "trailingComma": "none",
  20169. "printWidth": 140,
  20170. "plugins": [],
  20171. "overrides": [
  20172. ]
  20173. }
  20174. ================================================
  20175. FILE: packages/rollup-plugin-md-ts/src/index.ts
  20176. ================================================
  20177. import { marked, MarkedOptions } from 'marked';
  20178. import { createFilter } from 'rollup-pluginutils';
  20179. const ext = /\.md$/;
  20180. export type MDOptions = {
  20181. include?: string[];
  20182. exclude?: string[];
  20183. marked?: MarkedOptions;
  20184. };
  20185. export default function md(options: MDOptions = {}) {
  20186. const filter = createFilter(options.include || ['**/*.md'], options.exclude);
  20187. if (options.marked) {
  20188. marked.setOptions(options.marked);
  20189. }
  20190. return {
  20191. name: 'md',
  20192. // transform 是 rollup 插件必需的方法
  20193. // 用于转换源文件内容
  20194. transform(md: string, id: string) {
  20195. // 检查文件是否是 .md 文件
  20196. if (!ext.test(id)) return null;
  20197. // 检查文件是否匹配 include/exclude 配置
  20198. if (!filter(id)) return null;
  20199. // 使用 marked 解析 markdown,如果没有配置 marked 则返回原始内容
  20200. const data = options.marked ? marked.parse(md, options.marked) : md;
  20201. return {
  20202. // 导出解析后的内容为默认导出
  20203. code: `export default ${JSON.stringify(data.toString())};`,
  20204. // sourcemap 相关
  20205. map: {
  20206. version: 3,
  20207. sources: [id],
  20208. names: [],
  20209. mappings: ''
  20210. }
  20211. };
  20212. }
  20213. };
  20214. }
  20215. ================================================
  20216. FILE: packages/rollup-plugin-stdf-icon/README.md
  20217. ================================================
  20218. [简体中文](https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-stdf-icon/README_CN.md)
  20219. # Introduction
  20220. This is a Rollup plugin that combines all SVG files in specified folders (supports multiple) into a single [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol) for use in [STDF](https://stdf.design) projects. It is compatible with Vite and can be used in other projects created with Vite.
  20221. For more information about the STDF Icon component, please refer to the [Icon Guide](https://stdf.design/components?nav=icon&tab=2).
  20222. # Installation
  20223. <!-- :::code-groups -->
  20224. <!-- pnpm -->
  20225. ```sh
  20226. pnpm i rollup-plugin-stdf-icon -D
  20227. ```
  20228. <!-- :: -->
  20229. <!-- npm -->
  20230. ```sh
  20231. npm i rollup-plugin-stdf-icon -D
  20232. ```
  20233. <!-- :: -->
  20234. <!-- bun -->
  20235. ```sh
  20236. bun add rollup-plugin-stdf-icon -D
  20237. ```
  20238. <!-- :: -->
  20239. <!-- yarn -->
  20240. ```sh
  20241. yarn add rollup-plugin-stdf-icon -D
  20242. ```
  20243. <!-- ::: -->
  20244. # Usage
  20245. Configure the plugin in vite.config.js or vite.config.ts:
  20246. ```js
  20247. // ...
  20248. import svgSprite from 'rollup-plugin-stdf-icon';
  20249. export default defineConfig({
  20250. // ...
  20251. plugins: [
  20252. // ...
  20253. svgSprite(),
  20254. // ...
  20255. ],
  20256. // ...
  20257. });
  20258. ```
  20259. During development, simply place the SVG files you need in the specified input folder (default: `src/lib/symbol`). The plugin will automatically combine them into a single SVG symbol file and output it to the specified output folder (default: `static/fonts`). After building with Vite, the files in the public folder will be copied to the dist folder. Therefore, after building, the combined SVG symbol file will be located in the dist/fonts folder. Please refer to the [Vite Asset Handling](https://vitejs.dev/guide/assets.html#the-public-directory) documentation.
  20260. > Default parameters are optimized for SvelteKit projects. If you need to adapt it for non-SvelteKit projects created with Vite, please modify the configuration in vite.config.js or vite.config.ts.
  20261. Generally, you can simply place the SVG files in the default input folder without the need for additional configuration.
  20262. If you need to modify the input/output folders and the filename of the combined file, or if you need to combine multiple folders, you can customize the configuration in vite.config.js or vite.config.ts:
  20263. ```javascript
  20264. // ...
  20265. svgSprite([
  20266. { inFile: 'src/lib/svgs', outFile: 'static/fonts', fileName: 'symbol' },
  20267. { inFile: 'src/lib/icons', outFile: 'static/fonts', fileName: 'icon' },
  20268. ]),
  20269. // ...
  20270. ```
  20271. This configuration will combine two symbols. **When using the STDF Icon component, please update the path to the corresponding `fonts/symbol.svg` or `fonts/icon.svg`**.
  20272. Note: **The parameter should be an array** representing the configuration for multiple folders. **Each folder configuration should be an object** with `inFile` as the folder where the SVG files to be combined are located, `outFile` as the output path for the combined SVG symbol file, and `fileName` as the filename of the combined SVG symbol file (if not passed, the last folder name of `inFile` will be used). Please ensure the correctness and avoid conflicts in paths and filenames.
  20273. In general, the use of symbols is to combine a series of small, single-color SVG files into one symbol. This allows for easy modification of attributes such as color, size, and opacity when using SVG in a project. Therefore, when default configuring rollup-plugin-stdf-icon, the color attributes of the SVG files themselves are removed. If you need to use multi-color SVG files and want to preserve the colors in the generated symbol, you just need to set the `simple` parameter to `false`.
  20274. # Array Configuration
  20275. | Parameter | Type | Default | Description |
  20276. | --------- | ------ | ---------------- | ------------------------------------------------------------------------------------------------------------- |
  20277. | inFile | `string` | `'src/lib/symbol'` | The folder where all the SVG files to be merged are located. |
  20278. | outFile | `string` | `'static/fonts'` | The output path for the merged SVG symbol file. |
  20279. | fileName | `string` | `'symbol'` | The filename of the merged SVG symbol file (if not passed, the last folder name of `inFile` will be used). |
  20280. | simple | `boolean` | `true` | Whether to use the simple mode, the simple mode will remove the color attributes of the SVG files themselves. |
  20281. # License
  20282. This project is licensed under the [MIT License](https://github.com/any-tdf/stdf/blob/main/LICENSE).
  20283. ================================================
  20284. FILE: packages/rollup-plugin-stdf-icon/package.json
  20285. ================================================
  20286. {
  20287. "name": "rollup-plugin-stdf-icon",
  20288. "version": "0.1.2",
  20289. "description": "A Rollup plugin that combines a series of svg into one symbol for use in the STDF project",
  20290. "main": "dist/index.js",
  20291. "types": "dist/index.d.ts",
  20292. "scripts": {
  20293. "build": "rollup -c",
  20294. "test": "node test/index.js"
  20295. },
  20296. "type": "module",
  20297. "author": "any-tdf",
  20298. "funding": "https://stdf.design?fund",
  20299. "license": "MIT",
  20300. "homepage": "https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-stdf-icon/README.md",
  20301. "repository": {
  20302. "type": "git",
  20303. "url": "https://github.com/any-tdf/stdf"
  20304. },
  20305. "bugs": {
  20306. "url": "https://github.com/any-tdf/stdf/issues?q=is:issue+is:open+icon"
  20307. },
  20308. "files": [
  20309. "dist/**"
  20310. ],
  20311. "engines": {
  20312. "node": ">=14.14"
  20313. },
  20314. "dependencies": {
  20315. "fs-extra": "^11.2.0",
  20316. "svgo": "^3.3.2",
  20317. "svgstore": "^3.0.1"
  20318. },
  20319. "devDependencies": {
  20320. "@rollup/plugin-terser": "^0.4.4",
  20321. "@rollup/plugin-typescript": "^12.1.1",
  20322. "@types/fs-extra": "^11.0.4",
  20323. "@types/node": "^22.10.2",
  20324. "rollup": "^4.28.1",
  20325. "typescript": "^5.7.2"
  20326. },
  20327. "keywords": [
  20328. "stdf",
  20329. "rollup",
  20330. "symbol",
  20331. "sprite",
  20332. "vite",
  20333. "svg",
  20334. "icon"
  20335. ]
  20336. }
  20337. ================================================
  20338. FILE: packages/rollup-plugin-stdf-icon/README_CN.md
  20339. ================================================
  20340. [English](https://github.com/any-tdf/stdf/blob/main/packages/rollup-plugin-stdf-icon/README.md)
  20341. # 介绍
  20342. 一个 Rolup 插件,将指定文件夹(支持多个)内的所有 SVG 组合为一个 [SVG symbol](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol),以在 [STDF](https://stdf.design) 项目中使用。兼容 Vite,也可用于 Vite 创建的其他项目。
  20343. 关于 STDF 的 Icon 组件,请参考 [Icon 指南](https://stdf.design/components?nav=icon&tab=2)。
  20344. # 安装
  20345. <!-- :::code-groups -->
  20346. <!-- pnpm -->
  20347. ```sh
  20348. pnpm i rollup-plugin-stdf-icon -D
  20349. ```
  20350. <!-- :: -->
  20351. <!-- npm -->
  20352. ```sh
  20353. npm i rollup-plugin-stdf-icon -D
  20354. ```
  20355. <!-- :: -->
  20356. <!-- bun -->
  20357. ```sh
  20358. bun add rollup-plugin-stdf-icon -D
  20359. ```
  20360. <!-- :: -->
  20361. <!-- yarn -->
  20362. ```sh
  20363. yarn add rollup-plugin-stdf-icon -D
  20364. ```
  20365. <!-- ::: -->
  20366. # 使用
  20367. 在 vite.config.js 或 vite.config.ts 中配置:
  20368. ```js
  20369. // ...
  20370. import svgSprite from 'rollup-plugin-stdf-icon';
  20371. export default defineConfig({
  20372. // ...
  20373. plugins: [
  20374. // ...
  20375. svgSprite(),
  20376. // ...
  20377. ],
  20378. // ...
  20379. });
  20380. ```
  20381. 开发过程中只需要将用到的 svg 文件放到指定的入口文件夹(默认 `src/lib/symbol`),插件会自动将其合并为一个 SVG symbol 文件,输出到指定的输出文件夹(默认 `static/fonts`)。Vite 构建之后 public 文件夹下的文件会被复制到 dist 文件夹下,所以在构建之后,合并的 SVG symbol 文件会出现在 dist/fonts 文件夹下。请参考 [Vite 配置](https://cn.vitejs.dev/guide/assets.html#the-public-directory)。
  20382. > 默认参数优先适配 SvelteKit 项目,如果需要适配 Vite 创建的非 SvelteKit 项目,请修改 vite.config.js 或 vite.config.ts 中的配置。
  20383. 一般来说,按照默认配置将 svg 文件放到入口文件夹即可,无需过多配置。
  20384. 如果需要修改输入输出文件夹以及合并的文件名,或者同时需要合并多个文件夹,可以在 vite.config.js 或 vite.config.ts 中修改配置:
  20385. ```javascript
  20386. // ...
  20387. svgSprite([
  20388. { inFile: 'src/lib/svgs', outFile: 'static/fonts', fileName: 'symbol' },
  20389. { inFile: 'src/lib/icons', outFile: 'static/fonts', fileName: 'icon' },
  20390. ]),
  20391. // ...
  20392. ```
  20393. 此配置会合并两个 symbol。**此时使用 STDF 的 Icon 组件时,请配合修改 path 为对应的 `fonts/symbol.svg` 或 `fonts/icon.svg`**
  20394. 注意:**传入参数为数组**,表示多个文件夹的配置。**每个文件夹的配置为一个对象**,对象中的 inFile 为将要被合并的 SVG 文件所在的文件夹,outFile 为合并后的 SVG symbol 文件的输出路径,fileName 为合并后的 SVG symbol 文件的文件名(如果不传则取 inFile 的最后一个文件夹名称)。请注意路径与文件名的正确性与冲突。
  20395. 一般来说,使用 symbol 的场景是将一系列小的单色 svg 合并为一个 symbol,可以方便项目使用 svg 时修改颜色、大小、透明度等属性,所以默认配置下 rollup-plugin-stdf-icon 会去除掉 svg 本身的颜色属性。如果需要使用多色 svg,合成的 symbol 需要保留 svg 本身的颜色,只需要将 `simple` 参数设置为 `false`。
  20396. # 数组配置
  20397. | 参数 | 类型 | 默认 | 描述 |
  20398. | -------- | ------ | ---------------- | ------------------------------------------------------------------------------ |
  20399. | inFile | `string` | `'src/lib/symbol'` | 将要被合并的所有 SVG 文件所在的文件夹。 |
  20400. | outFile | `string` | `'static/fonts'` | 合并后的 SVG symbol 文件的输出路径。 |
  20401. | fileName | `string` | `'symbol'` | 合并后的 SVG symbol 文件的文件名(如果不传则取 inFile 的最后一个文件夹名称)。 |
  20402. | simple | `boolean` | `true` | 是否使用简单模式,简单模式会将 svg 自带的颜色去除。 |
  20403. # 许可证
  20404. 本项目基于 [MIT 许可证](https://github.com/any-tdf/stdf/blob/main/LICENSE)。
  20405. ================================================
  20406. FILE: packages/rollup-plugin-stdf-icon/rollup.config.js
  20407. ================================================
  20408. import typescript from '@rollup/plugin-typescript';
  20409. import terser from '@rollup/plugin-terser';
  20410. export default {
  20411. input: 'src/index.ts',
  20412. output: {
  20413. file: 'dist/index.js',
  20414. format: 'esm',
  20415. sourcemap: true,
  20416. },
  20417. plugins: [typescript(), terser()],
  20418. external: ['fs-extra', 'svgo', 'svgstore'],
  20419. };
  20420. ================================================
  20421. FILE: packages/rollup-plugin-stdf-icon/tsconfig.json
  20422. ================================================
  20423. {
  20424. "compilerOptions": {
  20425. "target": "ES2020",
  20426. "module": "ESNext",
  20427. "moduleResolution": "node",
  20428. "esModuleInterop": true,
  20429. "strict": true,
  20430. "skipLibCheck": true,
  20431. "declaration": true,
  20432. "declarationDir": "dist",
  20433. "outDir": "dist",
  20434. "rootDir": "src"
  20435. },
  20436. "include": ["src/**/*"],
  20437. "exclude": ["node_modules", "dist", "test"]
  20438. }
  20439. ================================================
  20440. FILE: packages/rollup-plugin-stdf-icon/src/index.ts
  20441. ================================================
  20442. import fs from 'fs-extra';
  20443. import { optimize } from 'svgo';
  20444. // @ts-expect-error svgstore no declaration file
  20445. import svgstore from 'svgstore';
  20446. interface StdfIconOptions {
  20447. inFile?: string;
  20448. outFile?: string;
  20449. fileName?: string;
  20450. simple?: boolean;
  20451. }
  20452. export default function svgSprite(datas: StdfIconOptions[] = []) {
  20453. // 可接收多组参数,处理多个文件夹内的文件
  20454. // Multiple parameters can be accepted to process files in multiple folders
  20455. const data = datas ? datas : [{ inFile: 'src/lib/symbol', outFile: 'static/fonts', fileName: 'symbol', simple: true }];
  20456. // 循环处理每一组参数
  20457. // Loop through each set of parameters
  20458. if (Array.isArray(data)) {
  20459. // 给出提示,开始处理几个文件夹
  20460. // Give a prompt, how many folders are being processed
  20461. console.log(`[rollup-plugin-stdf-icon]: ⌛ Start processing ${data.length} folders...`);
  20462. for (const item of data) {
  20463. const { inFile, outFile, fileName, simple = true } = item;
  20464. // 如果 fileName 为默认 '',则将 inFile 的最后一个文件夹作为 fileName,注意不同操作系统的路径分隔符
  20465. // If fileName is the default '', then the last folder of inFile is used as fileName, pay attention to the path separator of different operating systems
  20466. const fileNameInner = fileName ? fileName : inFile ? inFile.split('/').pop() : 'symbol';
  20467. if (fileNameInner) {
  20468. handleFile(inFile, outFile, fileNameInner, simple);
  20469. }
  20470. }
  20471. }
  20472. return { name: 'rollup-plugin-stdf-icon' };
  20473. }
  20474. // 处理一个文件夹内的文件
  20475. // Process files in a folder
  20476. function handleFile(inFile: string | undefined, outFile: string | undefined, fileName: string, simple = true) {
  20477. if (!inFile || !outFile) return;
  20478. // 如果 outFile 不存在,则创建
  20479. // If outFile does not exist, create it
  20480. if (!fs.existsSync(outFile)) {
  20481. fs.mkdirSync(outFile);
  20482. }
  20483. // 创建一个空的 svgstore
  20484. // Create an empty svgstore
  20485. const sprites = svgstore({ cleanDefs: true });
  20486. // 循环 icons 目录下的所有 svg 文件
  20487. // Loop through all svg files in the icons directory
  20488. const svgs = fs.readdirSync(inFile);
  20489. for (const svg of svgs) {
  20490. if (!svg.endsWith('.svg')) {
  20491. // 读取 svg 文件内容,如果文件不是 svg 文件,则给出提示并跳过
  20492. // Read the contents of the svg file, if the file is not an svg file, give a prompt and skip
  20493. console.warn(`[rollup-plugin-stdf-icon]: ⏭️ ${inFile}/${svg} is not a svg file, skip it!`);
  20494. } else {
  20495. const code = fs.readFileSync(`${inFile}/${svg}`, 'utf8');
  20496. // 使用 SVGO 进行优化
  20497. // Use SVGO for optimization
  20498. const result = optimize(code);
  20499. // 删除 result 中的 p-id class 等属性
  20500. // Delete p-id class and other attributes in result
  20501. result.data = result.data.replace(/p-id="[^"]*"/g, '').replace(/class="[^"]*"/g, '');
  20502. // 如果 result 中有 fill 属性,属性值不为 none, 则将 fill 属性值设置为 currentColor
  20503. // If there is a fill attribute in result, the attribute value is not none, then set the fill attribute value to currentColor
  20504. if (simple && result.data.indexOf('fill=') > -1 && result.data.indexOf('fill="none"') === -1) {
  20505. result.data = result.data.replace(/fill="[^"]*"/g, 'fill="currentColor"');
  20506. }
  20507. // 如果 result 中有 stroke 属性,属性值不为 none, 则将 stroke 属性值设置为 currentColor
  20508. // If there is a stroke attribute in result, the attribute value is not none, then set the stroke attribute value to currentColor
  20509. if (simple && result.data.indexOf('stroke=') > -1 && result.data.indexOf('stroke="none"') === -1) {
  20510. result.data = result.data.replace(/stroke="[^"]*"/g, 'stroke="currentColor"');
  20511. }
  20512. // 将优化后的 svg 添加到 sprites 中
  20513. // Add the optimized svg to sprites
  20514. sprites.add(svg.replace('.svg', ''), result.data, { copyAttrs: ['fill', 'stroke'] });
  20515. }
  20516. }
  20517. // 已完成合并(inFile)中的多少个 svg 文件至 outFile/fileName.svg
  20518. // Have merged how many svg files in (inFile) to outFile/fileName.svg
  20519. console.log(`[rollup-plugin-stdf-icon]: ✅ ${inFile} has merged ${svgs.length} svg files to ${outFile}/${fileName}.svg`);
  20520. // 删除 sprites 的 <?xml...?> 标签和 <!DOCTYPE...> 标签 和 <defs/> 标签
  20521. // Delete the <?xml...?> tag and <!DOCTYPE...> tag of sprites
  20522. const spritesStr = sprites
  20523. .toString()
  20524. .replace(/<\?xml[^>]*>/g, '')
  20525. .replace(/<!DOCTYPE[^>]*>/g, '')
  20526. .replace(/<defs\/>/g, '');
  20527. // 写入到指定的文件中
  20528. // Write to the specified file
  20529. fs.writeFileSync(`${outFile}/${fileName}.svg`, spritesStr);
  20530. }
  20531. ================================================
  20532. FILE: packages/rollup-plugin-stdf-icon/test/index.js
  20533. ================================================
  20534. import svgSprite from '../dist/index.js';
  20535. // 将会在 test 目录下生成 symbol.svg 文件,内容为 test/icons 目录下所有 svg 文件的 symbol
  20536. // Let the symbol.svg file be generated in the test directory, and the content is the symbol of all svg files in the test/icons directory
  20537. svgSprite([{ inFile: 'test/icons', outFile: 'test', fileName: 'symbol', simple: true }]);
  20538. ================================================
  20539. FILE: packages/stdf/eslint.config.js
  20540. ================================================
  20541. import prettier from 'eslint-config-prettier';
  20542. import js from '@eslint/js';
  20543. import svelte from 'eslint-plugin-svelte';
  20544. import globals from 'globals';
  20545. import ts from 'typescript-eslint';
  20546. export default ts.config(
  20547. js.configs.recommended,
  20548. ...ts.configs.recommended,
  20549. ...svelte.configs['flat/recommended'],
  20550. prettier,
  20551. ...svelte.configs['flat/prettier'],
  20552. {
  20553. languageOptions: {
  20554. globals: {
  20555. ...globals.browser,
  20556. ...globals.node
  20557. }
  20558. }
  20559. },
  20560. {
  20561. files: ['**/*.svelte'],
  20562. languageOptions: {
  20563. parserOptions: {
  20564. parser: ts.parser
  20565. }
  20566. }
  20567. },
  20568. {
  20569. ignores: ['build/', '.svelte-kit/', 'dist/']
  20570. }
  20571. );
  20572. ================================================
  20573. FILE: packages/stdf/package.json
  20574. ================================================
  20575. {
  20576. "name": "stdf",
  20577. "version": "1.0.8",
  20578. "description": "Mobile web component library based on Svelte and Tailwind",
  20579. "author": "any-tdf",
  20580. "funding": "https://stdf.design?fund",
  20581. "license": "MIT",
  20582. "homepage": "https://stdf.design",
  20583. "repository": {
  20584. "type": "git",
  20585. "url": "https://github.com/any-tdf/stdf"
  20586. },
  20587. "keywords": [
  20588. "svelte",
  20589. "tailwind",
  20590. "ui framework",
  20591. "ui 组件库",
  20592. "移动组件库",
  20593. "moblie ui",
  20594. "web component",
  20595. "svelte v5",
  20596. "tailwind v4"
  20597. ],
  20598. "scripts": {
  20599. "dev": "vite dev",
  20600. "build": "vite build",
  20601. "preview": "vite preview",
  20602. "package": "svelte-kit sync && svelte-package && publint",
  20603. "prepublishOnly": "npm run package",
  20604. "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
  20605. "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
  20606. "format": "prettier --write .",
  20607. "lint": "prettier --check . && eslint .",
  20608. "dev_en": "vite --mode english",
  20609. "button": "vite --mode button",
  20610. "icon": "vite --mode icon",
  20611. "navBar": "vite --mode navBar",
  20612. "divider": "vite --mode divider",
  20613. "cell": "vite --mode cell",
  20614. "switch": "vite --mode switch",
  20615. "avatar": "vite --mode avatar",
  20616. "tabs": "vite --mode tabs",
  20617. "tabBar": "vite --mode tabBar",
  20618. "steps": "vite --mode steps",
  20619. "indexBar": "vite --mode indexBar",
  20620. "radio": "vite --mode radio",
  20621. "checkbox": "vite --mode checkbox",
  20622. "input": "vite --mode input",
  20623. "grids": "vite --mode grids",
  20624. "swiper": "vite --mode swiper",
  20625. "placeholder": "vite --mode placeholder",
  20626. "skeleton": "vite --mode skeleton",
  20627. "rate": "vite --mode rate",
  20628. "slider": "vite --mode slider",
  20629. "badge": "vite --mode badge",
  20630. "noticeBar": "vite --mode noticeBar",
  20631. "progress": "vite --mode progress",
  20632. "progressLoop": "vite --mode progressLoop",
  20633. "mask": "vite --mode mask",
  20634. "toast": "vite --mode toast",
  20635. "loading": "vite --mode loading",
  20636. "popup": "vite --mode popup",
  20637. "bottomSheet": "vite --mode bottomSheet",
  20638. "modal": "vite --mode modal",
  20639. "dialog": "vite --mode dialog",
  20640. "actionSheet": "vite --mode actionSheet",
  20641. "picker": "vite --mode picker",
  20642. "asyncPicker": "vite --mode asyncPicker",
  20643. "timePicker": "vite --mode timePicker",
  20644. "calendar": "vite --mode calendar",
  20645. "pagination": "vite --mode pagination",
  20646. "numKeyboard": "vite --mode numKeyboard",
  20647. "button_en": "vite --mode button_en",
  20648. "icon_en": "vite --mode icon_en",
  20649. "navBar_en": "vite --mode navBar_en",
  20650. "divider_en": "vite --mode divider_en",
  20651. "cell_en": "vite --mode cell_en",
  20652. "switch_en": "vite --mode switch_en",
  20653. "avatar_en": "vite --mode avatar_en",
  20654. "tabs_en": "vite --mode tabs_en",
  20655. "tabBar_en": "vite --mode tabBar_en",
  20656. "steps_en": "vite --mode steps_en",
  20657. "indexBar_en": "vite --mode indexBar_en",
  20658. "radio_en": "vite --mode radio_en",
  20659. "checkbox_en": "vite --mode checkbox_en",
  20660. "input_en": "vite --mode input_en",
  20661. "grids_en": "vite --mode grids_en",
  20662. "swiper_en": "vite --mode swiper_en",
  20663. "placeholder_en": "vite --mode placeholder_en",
  20664. "skeleton_en": "vite --mode skeleton_en",
  20665. "rate_en": "vite --mode rate_en",
  20666. "slider_en": "vite --mode slider_en",
  20667. "badge_en": "vite --mode badge_en",
  20668. "noticeBar_en": "vite --mode noticeBar_en",
  20669. "progress_en": "vite --mode progress_en",
  20670. "progressLoop_en": "vite --mode progressLoop_en",
  20671. "mask_en": "vite --mode mask_en",
  20672. "toast_en": "vite --mode toast_en",
  20673. "loading_en": "vite --mode loading_en",
  20674. "popup_en": "vite --mode popup_en",
  20675. "bottomSheet_en": "vite --mode bottomSheet_en",
  20676. "modal_en": "vite --mode modal_en",
  20677. "dialog_en": "vite --mode dialog_en",
  20678. "actionSheet_en": "vite --mode actionSheet_en",
  20679. "picker_en": "vite --mode picker_en",
  20680. "asyncPicker_en": "vite --mode asyncPicker_en",
  20681. "timePicker_en": "vite --mode timePicker_en",
  20682. "calendar_en": "vite --mode calendar_en",
  20683. "pagination_en": "vite --mode pagination_en",
  20684. "numKeyboard_en": "vite --mode numKeyboard_en"
  20685. },
  20686. "files": [
  20687. "dist",
  20688. "!dist/**/*.test.*",
  20689. "!dist/**/*.spec.*"
  20690. ],
  20691. "sideEffects": [
  20692. "**/*.css"
  20693. ],
  20694. "svelte": "./dist/index.js",
  20695. "types": "./dist/index.d.ts",
  20696. "type": "module",
  20697. "exports": {
  20698. ".": {
  20699. "types": "./dist/index.d.ts",
  20700. "svelte": "./dist/index.js"
  20701. },
  20702. "./types": {
  20703. "types": "./dist/types/index.d.ts",
  20704. "svelte": "./dist/types/index.js"
  20705. },
  20706. "./theme": {
  20707. "types": "./dist/theme/index.d.ts",
  20708. "svelte": "./dist/theme/index.js"
  20709. },
  20710. "./lang": {
  20711. "types": "./dist/lang/index.d.ts",
  20712. "svelte": "./dist/lang/index.js"
  20713. },
  20714. "./utils": {
  20715. "types": "./dist/components/utils/index.d.ts",
  20716. "svelte": "./dist/components/utils/index.js"
  20717. }
  20718. },
  20719. "peerDependencies": {
  20720. "svelte": "^5.0.0",
  20721. "tailwindcss": "^4.0.0"
  20722. },
  20723. "devDependencies": {
  20724. "@sveltejs/adapter-static": "^3.0.8",
  20725. "@sveltejs/kit": "^2.19.0",
  20726. "@sveltejs/package": "^2.3.10",
  20727. "@sveltejs/vite-plugin-svelte": "^5.0.3",
  20728. "@tailwindcss/vite": "^4.0.12",
  20729. "eslint": "^9.22.0",
  20730. "eslint-config-prettier": "^10.1.1",
  20731. "eslint-plugin-svelte": "^3.1.0",
  20732. "globals": "^16.0.0",
  20733. "prettier": "^3.5.3",
  20734. "prettier-plugin-svelte": "^3.3.3",
  20735. "prettier-plugin-tailwindcss": "^0.6.11",
  20736. "publint": "^0.3.9",
  20737. "rollup-plugin-stdf-icon": "file:../rollup-plugin-stdf-icon",
  20738. "svelte": "^5.22.6",
  20739. "svelte-check": "^4.1.5",
  20740. "svelte-confetti": "^2.3.1",
  20741. "tailwindcss": "^4.0.12",
  20742. "typescript": "^5.8.2",
  20743. "typescript-eslint": "^8.26.1",
  20744. "vite": "^6.2.1"
  20745. }
  20746. }
  20747. ================================================
  20748. FILE: packages/stdf/svelte.config.js
  20749. ================================================
  20750. import adapter from '@sveltejs/adapter-static';
  20751. import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
  20752. /** @type {import('@sveltejs/kit').Config} */
  20753. const config = {
  20754. // Consult https://svelte.dev/docs/kit/integrations
  20755. // for more information about preprocessors
  20756. preprocess: vitePreprocess(),
  20757. kit: {
  20758. adapter: adapter({ pages: 'build', assets: 'build', fallback: '404.html', precompress: false, strict: true }),
  20759. paths: {
  20760. base: process.argv.includes('dev') ? '' : process.env.BASE_PATH
  20761. }
  20762. }
  20763. };
  20764. export default config;
  20765. ================================================
  20766. FILE: packages/stdf/tsconfig.json
  20767. ================================================
  20768. {
  20769. "extends": "./.svelte-kit/tsconfig.json",
  20770. "compilerOptions": {
  20771. "allowJs": true,
  20772. "checkJs": true,
  20773. "esModuleInterop": true,
  20774. "forceConsistentCasingInFileNames": true,
  20775. "resolveJsonModule": true,
  20776. "skipLibCheck": true,
  20777. "sourceMap": true,
  20778. "strict": true,
  20779. "module": "NodeNext",
  20780. "moduleResolution": "NodeNext"
  20781. }
  20782. }
  20783. ================================================
  20784. FILE: packages/stdf/vite.config.ts
  20785. ================================================
  20786. import { sveltekit } from '@sveltejs/kit/vite';
  20787. import { defineConfig } from 'vite';
  20788. import tailwindcss from '@tailwindcss/vite';
  20789. import svgSprite from 'rollup-plugin-stdf-icon';
  20790. export default defineConfig({
  20791. plugins: [sveltekit(), tailwindcss(), svgSprite([{ inFile: 'src/assets/svgs', outFile: 'static/fonts', fileName: 'symbol' }])],
  20792. server: { hmr: true, host: '0.0.0.0', port: 8888 }
  20793. });
  20794. ================================================
  20795. FILE: packages/stdf/.prettierignore
  20796. ================================================
  20797. # Package Managers
  20798. package-lock.json
  20799. pnpm-lock.yaml
  20800. yarn.lock
  20801. ================================================
  20802. FILE: packages/stdf/.prettierrc
  20803. ================================================
  20804. {
  20805. "useTabs": true,
  20806. "singleQuote": true,
  20807. "trailingComma": "none",
  20808. "printWidth": 140,
  20809. "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
  20810. "overrides": [
  20811. {
  20812. "files": "*.svelte",
  20813. "options": {
  20814. "parser": "svelte"
  20815. }
  20816. }
  20817. ]
  20818. }
  20819. ================================================
  20820. FILE: packages/stdf/src/app.css
  20821. ================================================
  20822. @import 'tailwindcss';
  20823. @custom-variant dark (&:where(.dark, .dark *));
  20824. @theme {
  20825. --color-primary-50: oklch(0.979 0.01 267.36);
  20826. --color-primary-100: oklch(0.95 0.024 270.343);
  20827. --color-primary-200: oklch(0.847 0.074 271.188);
  20828. --color-primary-300: oklch(0.741 0.13 272.232);
  20829. --color-primary-400: oklch(0.634 0.193 271.595);
  20830. --color-primary-500: oklch(0.536 0.252 268.66);
  20831. --color-primary: oklch(0.467 0.296 264.886);
  20832. --color-primary-700: oklch(0.397 0.26 264.877);
  20833. --color-primary-800: oklch(0.331 0.221 264.833);
  20834. --color-primary-900: oklch(0.26 0.178 264.428);
  20835. --color-primary-950: oklch(0.192 0.13 266.64);
  20836. --color-dark-50: oklch(0.995 0.012 101.474);
  20837. --color-dark-100: oklch(0.986 0.025 97.107);
  20838. --color-dark-200: oklch(0.965 0.059 95.884);
  20839. --color-dark-300: oklch(0.938 0.089 92.952);
  20840. --color-dark-400: oklch(0.91 0.114 89.711);
  20841. --color-dark-500: oklch(0.88 0.136 86.375);
  20842. --color-dark: oklch(0.845 0.153 80.597);
  20843. --color-dark-700: oklch(0.71 0.137 75.734);
  20844. --color-dark-800: oklch(0.58 0.118 70.166);
  20845. --color-dark-900: oklch(0.449 0.097 65.209);
  20846. --color-dark-950: oklch(0.321 0.074 62.379);
  20847. --color-primaryBlack: oklch(0.116 0.054 267.087);
  20848. --color-primaryWhite: oklch(0.961 0.001 286.375);
  20849. --color-darkBlack: oklch(0.183 0.035 86.634);
  20850. --color-darkWhite: oklch(0.962 0.001 17.178);
  20851. --color-success: oklch(0.704 0.142 167.084);
  20852. --color-warning: oklch(0.558 0.154 47.186);
  20853. --color-error: oklch(0.564 0.223 28.46);
  20854. --color-info: oklch(0.482 0.14 261.518);
  20855. --color-extend0: oklch(0.703 0.149 235.059);
  20856. --color-Twitter: oklch(0.703 0.149 235.059);
  20857. --color-extend1: oklch(0.702 0.194 38.137);
  20858. --color-Svelte: oklch(0.702 0.194 38.137);
  20859. --color-extend2: oklch(0.482 0.107 161.212);
  20860. --color-Starbucks: oklch(0.482 0.107 161.212);
  20861. --color-black: oklch(0 0 0);
  20862. --color-white: oklch(1 0 0);
  20863. --color-gray-50: oklch(0.961 0 0);
  20864. --color-gray-100: oklch(0.925 0 0);
  20865. --color-gray-200: oklch(0.845 0 0);
  20866. --color-gray-300: oklch(0.767 0 0);
  20867. --color-gray-400: oklch(0.683 0 0);
  20868. --color-gray-500: oklch(0.6 0 0);
  20869. --color-gray-600: oklch(0.51 0 0);
  20870. --color-gray-700: oklch(0.42 0 0);
  20871. --color-gray-800: oklch(0.321 0 0);
  20872. --color-gray-900: oklch(0.218 0 0);
  20873. --color-gray-950: oklch(0.159 0 0);
  20874. --color-transparent: transparent;
  20875. --font-Trueno: 'Trueno', Trueno;
  20876. }
  20877. @font-face {
  20878. font-family: Trueno;
  20879. src: url('/fonts/Trueno.otf') format('opentype');
  20880. }
  20881. *::-webkit-scrollbar {
  20882. width: 6px;
  20883. }
  20884. *::-webkit-scrollbar-thumb {
  20885. border-radius: 3px;
  20886. background-color: oklch(0.6167 0 0 / 30%);
  20887. }
  20888. *::-webkit-scrollbar-track {
  20889. background-color: oklch(0.6167 0 0 / 10%);
  20890. }
  20891. html {
  20892. overflow-y: overlay;
  20893. -webkit-tap-highlight-color: transparent;
  20894. scrollbar-width: none; /* Firefox */
  20895. }
  20896. body::-webkit-scrollbar {
  20897. display: none;
  20898. }
  20899. body {
  20900. -ms-overflow-style: none;
  20901. }
  20902. * {
  20903. -webkit-overflow-scrolling: touch;
  20904. }
  20905. button:focus {
  20906. outline: none;
  20907. }
  20908. ================================================
  20909. FILE: packages/stdf/src/app.d.ts
  20910. ================================================
  20911. // See https://svelte.dev/docs/kit/types#app.d.ts
  20912. // for information about these interfaces
  20913. declare global {
  20914. namespace App {
  20915. // interface Error {}
  20916. // interface Locals {}
  20917. // interface PageData {}
  20918. // interface PageState {}
  20919. // interface Platform {}
  20920. }
  20921. }
  20922. export {};
  20923. ================================================
  20924. FILE: packages/stdf/src/app.html
  20925. ================================================
  20926. <!doctype html>
  20927. <html>
  20928. <head>
  20929. <meta charset="UTF-8" />
  20930. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf_dark.svg" media="(prefers-color-scheme: dark)" />
  20931. <link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/stdf.svg" media="(prefers-color-scheme: light)" />
  20932. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  20933. <title>STDF Demo</title>
  20934. %sveltekit.head%
  20935. </head>
  20936. <body
  20937. data-sveltekit-preload-data="hover"
  20938. class="bg-primaryWhite dark:bg-darkBlack relative min-h-screen w-screen text-justify text-black antialiased dark:text-white"
  20939. >
  20940. <main style="display: contents">%sveltekit.body%</main>
  20941. </body>
  20942. </html>
  20943. ================================================
  20944. FILE: packages/stdf/src/data/aphorisms.ts
  20945. ================================================
  20946. export default [
  20947. // 中文
  20948. { text: '爱是永恒不变的力量,能够超越所有维度,当我归来,你已垂暮,我一次呼吸划过了你一辈子的岁月。', from: '—— 《星际穿越》' },
  20949. { text: '爱一朵花不猜它能开多久,放宽了心情,把什么都变美了。', from: '—— 郭静《在树上唱歌》' },
  20950. { text: '不是所有的坚持都有结果,但是总有一些坚持,能从一寸冰封的土地里,培育出十万朵怒放的蔷薇。', from: '—— 八月长安《最好的我们》' },
  20951. { text: '当没有任何一个人信任你的时候,沉默和坚持就是最好的反击和证明。', from: '—— 《沉默的羔羊》' },
  20952. { text: '既不回头,何必不忘。既然无缘,何需誓言。今日种种,似水无痕。明夕何夕,君已陌路。', from: '—— 《仙剑奇侠传一》' },
  20953. { text: '记忆是相见的另一种方式。', from: '—— 纪伯伦​​​​' },
  20954. { text: '没有值得不值得,只有愿意不愿意。', from: '—— 彩衣' },
  20955. { text: '每朵云都下落不明,每盏月亮都不知所踪。', from: '—— 八月长安《暗恋》' },
  20956. { text: '让人类永远保持理智,是一种奢求。', from: '—— MOSS' },
  20957. { text: '生命的闪耀不坚持到底怎能看到,与其苟延残喘不如纵情燃烧。', from: '—— 《追梦赤子心》' },
  20958. { text: '生活坏到一定程度就会好起来,因为它无法更坏,努力过后,才知道许多事情,坚持坚持,就过来了。', from: '—— 宫崎骏《千与千寻》' },
  20959. {
  20960. text: '我每天醒在鸟声里。我从梦里就听到鸟叫,直到我醒来。我听得出几种极熟悉的叫声,那是每天都叫的,似乎每天都在那个固定的枝头。',
  20961. from: '—— 汪曾祺'
  20962. },
  20963. { text: '我相信人类的勇气可以跨越时间,跨越当下,跨越未来。', from: '—— 《流浪地球 2》' },
  20964. {
  20965. text: '于千万人之中遇见你所要遇见的人,于千万年之中,时间的无涯的荒野里,没有早一步,也没有晚一步,刚巧赶上了,那也没有别的话可说,惟有轻轻地问一声:“噢,你也在这里吗?”',
  20966. from: '—— 张爱玲《爱》'
  20967. },
  20968. { text: '御剑乘风来,除魔天地间,有酒乐逍遥,无酒我亦癫。一饮尽江河,再饮吞日月,千杯醉不倒,唯我酒剑仙。', from: '—— 酒剑仙' },
  20969. { text: '最美的不是下雨天,是曾与你躲过雨的屋檐。', from: '—— 周杰伦《不能说的秘密》' },
  20970. // English
  20971. { text: 'All the splendor in the world is not worth a good friend.', from: '— Voltaire' },
  20972. { text: 'Continuous labor is the life of the iron law, also the art of iron.', from: '— Balzac' },
  20973. {
  20974. text: 'Do not go gentle into that good night; Old age should burn and rave at close of day. Rage, rage against the dying of the light.',
  20975. from: '— Dylan Thomas'
  20976. },
  20977. {
  20978. text: 'Hope is a good thing, maybe the best of things and no good thing ever dies.',
  20979. from: '— The Shawshank Redemption',
  20980. fromItalic: true
  20981. },
  20982. { text: 'Honesty and diligence should be your eternal mates.', from: '— Franklin' },
  20983. { text: 'If a man deceives me once, shame on him; if twice,shame on me.', from: '— John Ray' },
  20984. { text: 'Life is a kind of endless yearning, eager to continue to rise, become more great and noble.', from: '— Du Charm' },
  20985. { text: 'The best way to find yourself is to lose yourself in the service of others.', from: '— Gandhi' },
  20986. { text: 'The best way to cheer yourself up is to try to cheer somebody else up.', from: '— Mark Twain' },
  20987. {
  20988. text: 'The body is always in the end. In addition to thinking, there is no beautiful and interesting things to stay, because thought is life.',
  20989. from: '— Bernard Shaw'
  20990. },
  20991. {
  20992. text: "We should not be at any price to keep our friendship, so that it is defiled. If you have to sacrifice friendship for that great love, that's no way to do it; but if you can keep it, it will be a perfect state.",
  20993. from: '— Tagore'
  20994. }
  20995. ];
  20996. ================================================
  20997. FILE: packages/stdf/src/data/menuList.ts
  20998. ================================================
  20999. export type MenuListChild = {
  21000. title: string;
  21001. title_zh: string;
  21002. title_en: string;
  21003. nav: string;
  21004. tip: string;
  21005. tip_en: string;
  21006. alias: string;
  21007. };
  21008. export type MenuList = { class: string; class_en: string; childs: MenuListChild[] };
  21009. export const menuList: MenuList[] = [
  21010. {
  21011. class: '通用',
  21012. class_en: 'Universal',
  21013. childs: [
  21014. {
  21015. title: '按钮 Button',
  21016. title_zh: '按钮',
  21017. title_en: 'Button',
  21018. nav: 'button',
  21019. tip: '按下它,让世界变得更美好吧。',
  21020. tip_en: 'Press it and make the world a better place.',
  21021. alias: 'button|按钮'
  21022. },
  21023. {
  21024. title: '底部浮窗 BottomSheet',
  21025. title_zh: '底部浮窗',
  21026. title_en: 'BottomSheet',
  21027. nav: 'bottomSheet',
  21028. tip: '浮窗犹如小偷,突然出现让你焦灼,却也能唤起你的警觉。',
  21029. tip_en: 'The floating window is like a thief, suddenly appearing to make you anxious, but it can also arouse your alertness.',
  21030. alias:
  21031. 'bottomSheet|底部浮窗 | 底部 | 底|部 | 浮窗|bottomSheet 底部浮窗|bottomSheet 底部浮窗 | 底部弹窗|bottomSheet 底部弹窗|bottomSheet 底部弹窗 | 底部弹出框|bottomSheet 底部弹出框|bottomSheet 底部弹出框 | 底部弹出层|bottomSheet 底部弹出层|bottomSheet 底部弹出层'
  21032. },
  21033. {
  21034. title: '图标 Icon',
  21035. title_zh: '图标',
  21036. title_en: 'Icon',
  21037. nav: 'icon',
  21038. tip: '使用 SVG Sprites,请参照指南引入与使用。',
  21039. tip_en: 'Use SVG Sprites, please refer to the guide to import and use.',
  21040. alias: 'icon|图标|svg'
  21041. },
  21042. {
  21043. title: '遮罩 Mask',
  21044. title_zh: '遮罩',
  21045. title_en: 'Mask',
  21046. nav: 'mask',
  21047. tip: '遮罩虽能掩盖身形,却无法掩藏内心。',
  21048. tip_en: 'Although the mask can cover the figure, it cannot hide the heart.',
  21049. alias: 'mask|遮罩 | 遮|罩|mask 遮罩|mask 遮罩 | 遮罩层|mask 遮罩层|mask 遮罩层|Overlay|maskOverlay|mask Overlay'
  21050. },
  21051. {
  21052. title: '弹出层 Popup',
  21053. title_zh: '弹出层',
  21054. title_en: 'Popup',
  21055. nav: 'popup',
  21056. tip: '机会就像弹珠,只有你努力地推它,它才会弹出来。',
  21057. tip_en: 'Opportunity is like a marble, only if you push it hard, it will pop out.',
  21058. alias:
  21059. 'popup|弹出层 | 弹出 | 弹|出 | 层|popup 弹出层|popup 弹出层 | 弹窗|popup 弹窗|popup 弹窗 | 弹出框|popup 弹出框|popup 弹出框 | 弹出层|popup 弹出层|popup 弹出层'
  21060. }
  21061. ]
  21062. },
  21063. {
  21064. class: '布局',
  21065. class_en: 'Layout',
  21066. childs: [
  21067. {
  21068. title: '分割线 Divider',
  21069. title_zh: '分割线',
  21070. title_en: 'Divider',
  21071. nav: 'divider',
  21072. tip: '分开的日子越久,最初的喜悦越发淡薄。',
  21073. tip_en: 'The longer the days are separated, the more the initial joy fades.',
  21074. alias: 'divider|分割线 | 分割|line'
  21075. },
  21076. {
  21077. title: '网格 Grids',
  21078. title_zh: '网格',
  21079. title_en: 'Grids',
  21080. nav: 'grids',
  21081. tip: '可是怎么说,总觉得,我们之间留了太多空白格。',
  21082. tip_en: 'How can I say, I always feel that there are too many blank grids between us.',
  21083. alias: 'grids|网格|grid|row|col|column'
  21084. },
  21085. {
  21086. title: '占位符 Placeholder',
  21087. title_zh: '占位符',
  21088. title_en: 'Placeholder',
  21089. nav: 'placeholder',
  21090. tip: '人生重要的不是所站的位置,而是所朝的方向。',
  21091. tip_en: 'What is important in life is not the position you stand, but the direction you face.',
  21092. alias: 'placeholder|占位符 | 占位'
  21093. },
  21094. {
  21095. title: '骨架屏 Skeleton',
  21096. title_zh: '骨架屏',
  21097. title_en: 'Skeleton',
  21098. nav: 'skeleton',
  21099. tip: '骨架是支撑身体的关键,而人生信念则是支撑生命的骨架。',
  21100. tip_en: 'The skeleton is the key to supporting the body, and the belief in life is the skeleton that supports life.',
  21101. alias: 'skeleton|骨架屏 | 骨架'
  21102. }
  21103. ]
  21104. },
  21105. {
  21106. class: '导航',
  21107. class_en: 'Navigation',
  21108. childs: [
  21109. {
  21110. title: '索引栏 IndexBar',
  21111. title_zh: '索引栏',
  21112. title_en: 'IndexBar',
  21113. nav: 'indexBar',
  21114. tip: '你不迷途知返,我怎么给你以索引?',
  21115. tip_en: "If you don't know the way back, how can I give you an index?",
  21116. alias: 'indexBar|索引栏|indexbar|index|bar|索引|index 栏 | 索引条|index 条|index 条'
  21117. },
  21118. {
  21119. title: '导航栏 NavBar',
  21120. title_zh: '导航栏',
  21121. title_en: 'NavBar',
  21122. nav: 'navBar',
  21123. tip: '没有指引,在黑暗中只能乱撞。',
  21124. tip_en: 'Without guidance, you can only bump in the dark.',
  21125. alias: 'navBar|导航栏|navbar|nav|bar|导航|nav-bar|nav bar'
  21126. },
  21127. {
  21128. title: '分页 Pagination',
  21129. title_zh: '分页',
  21130. title_en: 'Pagination',
  21131. nav: 'pagination',
  21132. tip: '人生就像一部电影,不论多么精彩,也有谢幕的时候。',
  21133. tip_en: 'Life is like a movie, no matter how wonderful it is, there is a curtain call.',
  21134. alias: 'pagination|分页|page|分 | 页|pagination 分页|pagination 分页|page 分页|page 分页'
  21135. },
  21136. {
  21137. title: '步骤条 Steps',
  21138. title_zh: '步骤条',
  21139. title_en: 'Steps',
  21140. nav: 'steps',
  21141. tip: '人生没有白走的路,每一步都算数。',
  21142. tip_en: 'Life has no wasted steps, every step counts.',
  21143. alias: 'steps|step|步骤条 | 步骤|step 条|step 条 | 步骤栏|step 栏|step 栏'
  21144. },
  21145. {
  21146. title: '标签栏 TabBar',
  21147. title_zh: '标签栏',
  21148. title_en: 'TabBar',
  21149. nav: 'tabBar',
  21150. tip: '看脚下一片黑暗,望头顶星光璀璨。',
  21151. tip_en: "Looking down, it's all darkness; looking up, the stars are shining brightly.",
  21152. alias: 'tabBar|标签栏|tabbar|tab|bar|标签|tab 栏'
  21153. },
  21154. {
  21155. title: '标签页 Tabs',
  21156. title_zh: '标签页',
  21157. title_en: 'Tabs',
  21158. nav: 'tabs',
  21159. tip: '偶尔隐藏,是为了在合适的时候更好地绽放。',
  21160. tip_en: 'Occasionally hide, it is to bloom better at the right time.',
  21161. alias: 'tabs|tab|标签页 | 标签|tab 页'
  21162. }
  21163. ]
  21164. },
  21165. {
  21166. class: '数据输入',
  21167. class_en: 'Data entry',
  21168. childs: [
  21169. {
  21170. title: '动作面板 ActionSheet',
  21171. title_zh: '动作面板',
  21172. title_en: 'ActionSheet',
  21173. nav: 'actionSheet',
  21174. tip: '我的世界只有一个选项,就是你。',
  21175. tip_en: 'There is only one option in my world, and that is you.',
  21176. alias:
  21177. 'actionSheet|动作面板 | 动作 | 动|作 | 面板|actionSheet 动作面板|actionSheet 动作面板 | 动作面板|actionSheet 动作面板|actionSheet 动作面板 | 动作面板|actionSheet 动作面板|actionSheet 动作面板'
  21178. },
  21179. {
  21180. title: '异步选择器 AsyncPicker',
  21181. title_zh: '异步选择器',
  21182. title_en: 'AsyncPicker',
  21183. nav: 'asyncPicker',
  21184. tip: '错过的话,就请错过一辈子吧!',
  21185. tip_en: 'If you miss it, please miss it for a lifetime!',
  21186. alias: 'asyncPicker|异步选择器 | 异步|asyncPicker 异步选择器|asyncPicker 异步选择器|async picker|asyncpicker|异步 picker|异步 picker'
  21187. },
  21188. {
  21189. title: '日历 Calendar',
  21190. title_zh: '日历',
  21191. title_en: 'Calendar',
  21192. nav: 'calendar',
  21193. tip: '在无人问津日子里,正是登峰造极的好时机。',
  21194. tip_en: 'In the days when no one cares, it is a good time to reach the peak.',
  21195. alias:
  21196. 'calendar|日历 | 日|历|calendar 日历|calendar 日历 | 日期|calendar 日期|calendar 日期 | 周选择|calendar 周选择|calendar 周选择 | 周|calendar 周|calendar 周 | 日期区间 | 月选择 | 日期范围选择'
  21197. },
  21198. {
  21199. title: '复选框 Checkbox',
  21200. title_zh: '复选框',
  21201. title_en: 'Checkbox',
  21202. nav: 'checkbox',
  21203. tip: '要么全不,要么全部。',
  21204. tip_en: 'Either all or none.',
  21205. alias:
  21206. 'checkbox|复选框 | 复选|checkbox 复选框|checkbox 复选框 | 复选按钮|checkbox 复选按钮|checkbox 复选按钮 | 多选框 | 多选|checkbox 多选框|checkbox 多选框 | 多选按钮|checkbox 多选按钮|checkbox 多选按钮'
  21207. },
  21208. {
  21209. title: '输入框 Input',
  21210. title_zh: '输入框',
  21211. title_en: 'Input',
  21212. nav: 'input',
  21213. tip: '对方正在输入......',
  21214. tip_en: 'The other party is typing...',
  21215. alias:
  21216. 'input|输入框 | 输入|input 输入框|input 输入框|Textarea|textarea|文本域 | 文本框 | 文本|textarea 文本域|textarea 文本域 | 多行输入框 | 多行输入 | 多行|textarea 多行输入框|textarea 多行输入框'
  21217. },
  21218. {
  21219. title: '数字键盘 NumKeyboard',
  21220. title_zh: '数字键盘',
  21221. title_en: 'NumKeyboard',
  21222. nav: 'numKeyboard',
  21223. tip: '3 0624700 | 3 0624770 | 5 34202 13942 | 4314 0624',
  21224. tip_en: '3 0624700 | 3 0624770 | 5 34202 13942 | 4314 0624',
  21225. alias:
  21226. 'numKeyboard|数字键盘 | 数字 | 键盘|numKeyboard 数字键盘|numKeyboard 数字键盘 | 金额键盘|numKeyboard 金额键盘|numKeyboard 金额键盘|number|keyboard|amount|money|'
  21227. },
  21228. {
  21229. title: '选择器 Picker',
  21230. title_zh: '选择器',
  21231. title_en: 'Picker',
  21232. nav: 'picker',
  21233. tip: '采摘花瓣时,你得不到花的美丽。',
  21234. tip_en: 'When you pick petals, you don’t get the beauty of the flower.',
  21235. alias: 'picker|选择器 | 选择|picker 选择器|picker 选择器'
  21236. },
  21237. {
  21238. title: '单选框 Radio',
  21239. title_zh: '单选框',
  21240. title_en: 'Radio',
  21241. nav: 'radio',
  21242. tip: '如果要在正确和善良中选择一个,请选择善良。',
  21243. tip_en: 'If you have to choose between right and good, choose good.',
  21244. alias: 'radio|单选框 | 单选|radio 单选框|radio 单选框 | 单选按钮|radio 单选按钮|radio 单选按钮'
  21245. },
  21246. {
  21247. title: '评分 Rate',
  21248. title_zh: '评分',
  21249. title_en: 'Rate',
  21250. nav: 'rate',
  21251. tip: '散场时,对方剩余的手机电量,就是这场约会的评分。',
  21252. tip_en: 'At the end of the game, the remaining battery power of the other party is the score of this date.',
  21253. alias: 'rate|评分 | 评|分|rate 评分|rate 评分'
  21254. },
  21255. {
  21256. title: '滑块 Slider',
  21257. title_zh: '滑块',
  21258. title_en: 'Slider',
  21259. nav: 'slider',
  21260. tip: '请滑动解锁您的烦恼。',
  21261. tip_en: 'Please slide to unlock your troubles.',
  21262. alias: 'slider|滑块 | 滑|块|slider 滑块|slider 滑块'
  21263. },
  21264. {
  21265. title: '开关 Switch',
  21266. title_zh: '开关',
  21267. title_en: 'Switch',
  21268. nav: 'switch',
  21269. tip: '死亡是一个开关,活着却是一根绳索。',
  21270. tip_en: 'Death is a switch, but life is a rope.',
  21271. alias: 'switch|开关 | 开|关|switch 开关|switch 开关'
  21272. },
  21273. {
  21274. title: '步进器 Stepper',
  21275. title_zh: '步进器',
  21276. title_en: 'Stepper',
  21277. nav: 'stepper',
  21278. tip: '人生如同诗行,或进或退皆成章。保持心灵节奏,生命之诗韵味悠长。',
  21279. tip_en:
  21280. 'Life is like a poem, advancing or retreating all form chapters. Maintain the rhythm of the soul, and the poetic flavor of life will last long.',
  21281. alias: 'stepper|步进器 | 步|进 | 器|stepper 步进器|stepper 步进器'
  21282. },
  21283. {
  21284. title: '时间选择器 TimePicker',
  21285. title_zh: '时间选择器',
  21286. title_en: 'TimePicker',
  21287. nav: 'timePicker',
  21288. tip: '死亡不是失去生命,而是走出了时间的枷锁。',
  21289. tip_en: 'Death is not the loss of life, but the release of the shackles of time.',
  21290. alias:
  21291. 'timePicker|时间选择器 | 时间|timePicker 时间选择器|timePicker 时间选择器|time picker|timepicker|时间 picker|时间 picker|日期选择器 | 日期|datePicker 日期选择器|datePicker 日期选择器|date picker|datepicker|日期 picker|日期 picker'
  21292. }
  21293. ]
  21294. },
  21295. {
  21296. class: '信息展示',
  21297. class_en: 'Info display',
  21298. childs: [
  21299. {
  21300. title: '头像 Avatar',
  21301. title_zh: '头像',
  21302. title_en: 'Avatar',
  21303. nav: 'avatar',
  21304. tip: '其实我发给您的头像,是情侣头像...',
  21305. tip_en: 'Actually, the avatar I sent to you is a couple avatar...',
  21306. alias: 'avatar|头像 | 头|像|avatar 头像|avatar 头像'
  21307. },
  21308. {
  21309. title: '徽标 Badge',
  21310. title_zh: '徽标',
  21311. title_en: 'Badge',
  21312. nav: 'badge',
  21313. tip: '在标记消失之前,回到我身边。',
  21314. tip_en: 'Before the mark disappears, come back to me.',
  21315. alias: 'badge|徽标 | 徽|标|badge 徽标|badge 徽标 | 标记|badge 标记|badge 标记'
  21316. },
  21317. {
  21318. title: '单元格 Cell',
  21319. title_zh: '单元格',
  21320. title_en: 'Cell',
  21321. nav: 'cell',
  21322. tip: '当全世界抛弃您的时候请记住,您身上有几亿细胞都在为你而活。',
  21323. tip_en: 'When the whole world abandons you, remember that there are billions of cells on your body that are living for you.',
  21324. alias: 'cell|单元格 | 单元|cell 单元格|cell 单元格'
  21325. },
  21326. {
  21327. title: '通告栏 NoticeBar',
  21328. title_zh: '通告栏',
  21329. title_en: 'NoticeBar',
  21330. nav: 'noticeBar',
  21331. tip: '我方开放地下城,这是告知,不是商量。',
  21332. tip_en: 'Our side opens the dungeon, this is to inform, not to discuss.',
  21333. alias:
  21334. 'noticeBar|通告栏 | 通告 | 通|栏|noticeBar 通告栏|noticeBar 通告栏 | 通知栏|noticeBar 通知栏|noticeBar 通知栏 | 公告栏|noticeBar 公告栏|noticeBar 公告栏'
  21335. },
  21336. {
  21337. title: '进度条 Progress',
  21338. title_zh: '进度条',
  21339. title_en: 'Progress',
  21340. nav: 'progress',
  21341. tip: '好运进度:▓▓▓▓▓▓▓▓▓▓▓▓ 100%',
  21342. tip_en: 'Good luck progr: ▓▓▓▓▓▓▓▓▓▓▓▓ 100%',
  21343. alias: 'progress|进度条 | 进度 | 进|度|progress 进度条|progress 进度条'
  21344. },
  21345. {
  21346. title: '进度环 ProgressLoop',
  21347. title_zh: '进度环',
  21348. title_en: 'ProgressLoop',
  21349. nav: 'progressLoop',
  21350. tip: '人生不是一个完美的圆环,一旦完美,你就再没有任何可能性。',
  21351. tip_en: 'Life is not a perfect circle. Once perfect, you have no possibility.',
  21352. alias:
  21353. 'progressLoop|进度环 | 进度 | 进|度|progressLoop 进度环|progressLoop 进度环 | 环形进度条|progressLoop 环形进度条|progressLoop 环形进度条|progress loop|progress-loop'
  21354. },
  21355. {
  21356. title: '轮播 Swiper',
  21357. title_zh: '轮播',
  21358. title_en: 'Swiper',
  21359. nav: 'swiper',
  21360. tip: '人世间悲喜烂剧,昼夜轮播不停。',
  21361. tip_en: 'The ups and downs of life, day and night, are not stopping.',
  21362. alias: 'swiper|轮播 | 轮|播|swiper 轮播|swiper 轮播 | 轮播图|swiper 轮播图|swiper 轮播图 | 走马灯|swiper 走马灯|swiper 走马灯|carousel'
  21363. }
  21364. ]
  21365. },
  21366. {
  21367. class: '反馈',
  21368. class_en: 'Feedback',
  21369. childs: [
  21370. {
  21371. title: '对话框 Dialog',
  21372. title_zh: '对话框',
  21373. title_en: 'Dialog',
  21374. nav: 'dialog',
  21375. tip: '无法确定任何事情,尤其是按下“确定”键的那一刻,我最不确定。',
  21376. tip_en: 'Nothing can be determined, especially at the moment when the "OK" button is pressed, I am the most uncertain.',
  21377. alias:
  21378. 'dialog|对话框 | 对话 | 对|话 | 框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框 | 对话框|dialog 对话框|dialog 对话框'
  21379. },
  21380. {
  21381. title: '加载 Loading',
  21382. title_zh: '加载',
  21383. title_en: 'Loading',
  21384. nav: 'loading',
  21385. tip: '不要再苦苦等待答案了,没有回复已是答案。',
  21386. tip_en: "Don't wait for the answer, no reply is the answer.",
  21387. alias: 'loading|加载 | 加载中|loading 加载|loading 加载|loading 加载中|loading 加载中|loading 加载中...|loading 加载中...'
  21388. },
  21389. {
  21390. title: '弹框 Modal',
  21391. title_zh: '弹框',
  21392. title_en: 'Modal',
  21393. nav: 'modal',
  21394. tip: '弹框即人生,要么选择关闭,要么选择继续。',
  21395. tip_en: 'The modal is life, either choose to close or choose to continue.',
  21396. alias:
  21397. 'modal|弹框 | 弹|框|modal 弹框|modal 弹框 | 弹窗|modal 弹窗|modal 弹窗 | 弹出框|modal 弹出框|modal 弹出框 | 弹框|modal 弹框|modal 弹框 | 模态框|modal 模态框|modal 模态框'
  21398. },
  21399. {
  21400. title: '轻提示 Toast',
  21401. title_zh: '轻提示',
  21402. title_en: 'Toast',
  21403. nav: 'toast',
  21404. tip: '总有一些东西,要用消失来证明它的珍贵。',
  21405. tip_en: 'There are always some things that have to disappear to prove their value.',
  21406. alias:
  21407. 'toast|轻提示 | 轻|提示|toast 轻提示|toast 轻提示 | 轻弹窗|toast 轻弹窗|toast 轻弹窗 | 轻提示框|toast 轻提示框|toast 轻提示框 | 吐司|toast 吐司|toast 吐司'
  21408. }
  21409. ]
  21410. }
  21411. ];
  21412. ================================================
  21413. FILE: packages/stdf/src/data/themes/aqua.ts
  21414. ================================================
  21415. import type { ThemeProps } from '$lib/theme/types.js';
  21416. const Aqua: ThemeProps = {
  21417. name: 'Aqua',
  21418. color: {
  21419. primary: {
  21420. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  21421. 100: 'oklch(0.969 0.019 225.712)', // #E8F8FF hsl(198, 100%, 96%)
  21422. 200: 'oklch(0.832 0.048 227.654)', // #A8CFE1 hsl(199, 49%, 77%)
  21423. 300: 'oklch(0.699 0.07 233.534)', // #72A6C3 hsl(202, 40%, 61%)
  21424. 400: 'oklch(0.575 0.083 237.386)', // #4580A4 hsl(203, 41%, 46%)
  21425. 500: 'oklch(0.46 0.09 243.106)', // #235D86 hsl(205, 59%, 33%)
  21426. default: 'oklch(0.355 0.089 248.677)', // #0A3E68 hsl(207, 83%, 22%)
  21427. 700: 'oklch(0.329 0.09 251.443)', // #073661 hsl(209, 87%, 20%)
  21428. 800: 'oklch(0.302 0.09 253.945)', // #042E5A hsl(211, 92%, 18%)
  21429. 900: 'oklch(0.277 0.09 255.696)', // #022753 hsl(213, 95%, 17%)
  21430. 950: 'oklch(0.253 0.091 257.423)' // #00204D hsl(215, 100%, 15%)
  21431. },
  21432. dark: {
  21433. 50: 'oklch(0.997 0.013 111.26)', // #FEFFF5 hsl(66, 100%, 98%)
  21434. 100: 'oklch(0.992 0.03 110.976)', // #FDFFE8 hsl(65, 100%, 96%)
  21435. 200: 'oklch(0.946 0.068 113.937)', // #ECF3BF hsl(68, 68%, 85%)
  21436. 300: 'oklch(0.9 0.101 116.179)', // #DAE799 hsl(70, 62%, 75%)
  21437. 400: 'oklch(0.857 0.13 118.796)', // #C7DC76 hsl(72, 59%, 66%)
  21438. 500: 'oklch(0.812 0.152 121.068)', // #B3D055 hsl(74, 57%, 58%)
  21439. default: 'oklch(0.767 0.167 123.364)', // #9FC438 hsl(76, 56%, 49%)
  21440. 700: 'oklch(0.673 0.157 125.534)', // #7FA624 hsl(78, 64%, 40%)
  21441. 800: 'oklch(0.577 0.143 127.636)', // #618813 hsl(80, 76%, 30%)
  21442. 900: 'oklch(0.479 0.124 129.495)', // #466A08 hsl(82, 86%, 22%)
  21443. 950: 'oklch(0.381 0.104 130.976)' // #2E4D00 hsl(84, 100%, 15%)
  21444. },
  21445. primaryBlack: 'oklch(0.156 0.033 240.386)', // #010E19 hsl(207, 95%, 5%)
  21446. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(207, 5%, 95%)
  21447. darkBlack: 'oklch(0.199 0.046 122.93)', // #121901 hsl(76, 95%, 5%)
  21448. darkWhite: 'oklch(0.964 0.001 106.424)', // #F3F3F2 hsl(76, 5%, 95%)
  21449. functional: {
  21450. success: 'oklch(0.577 0.18 144.916)', // #069327 hsl(134, 92%, 30%)
  21451. warning: 'oklch(0.615 0.147 54.981)', // #c66810 hsl(29, 85%, 42%)
  21452. error: 'oklch(0.559 0.203 26.879)', // #d12929 hsl(0, 67%, 49%)
  21453. info: 'oklch(0.455 0.194 263.236)' // #1649c0 hsl(222, 79%, 42%)
  21454. },
  21455. extend: [
  21456. {
  21457. color: 'oklch(0.345 0.194 290.65)', // #410093 hsl(267, 100%, 29%)
  21458. alias: 'Yahoo!'
  21459. },
  21460. {
  21461. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  21462. alias: 'WeChat'
  21463. },
  21464. {
  21465. color: 'oklch(0.689 0.196 21.407)', // #fd5c63 hsl(357, 98%, 68%)
  21466. alias: 'Airbnb'
  21467. }
  21468. ]
  21469. }
  21470. };
  21471. export default Aqua;
  21472. ================================================
  21473. FILE: packages/stdf/src/data/themes/azuper.ts
  21474. ================================================
  21475. import type { ThemeProps } from '$lib/theme/types.js';
  21476. const Azuper: ThemeProps = {
  21477. name: 'Azuper',
  21478. color: {
  21479. primary: {
  21480. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  21481. 100: 'oklch(0.967 0.019 230.689)', // #E8F7FF hsl(201, 100%, 96%)
  21482. 200: 'oklch(0.827 0.048 234.484)', // #A9CCE1 hsl(203, 48%, 77%)
  21483. 300: 'oklch(0.692 0.069 240.216)', // #74A2C3 hsl(205, 40%, 61%)
  21484. 400: 'oklch(0.565 0.085 244.974)', // #487BA5 hsl(207, 39%, 47%)
  21485. 500: 'oklch(0.45 0.094 249.497)', // #265887 hsl(209, 56%, 34%)
  21486. default: 'oklch(0.347 0.095 253.302)', // #0D3A69 hsl(211, 78%, 23%)
  21487. 700: 'oklch(0.317 0.097 256.274)', // #093162 hsl(213, 83%, 21%)
  21488. 800: 'oklch(0.291 0.098 258.443)', // #06295B hsl(215, 88%, 19%)
  21489. 900: 'oklch(0.266 0.098 259.566)', // #032254 hsl(217, 93%, 17%)
  21490. 950: 'oklch(0.241 0.099 260.073)' // #001B4D hsl(219, 100%, 15%)
  21491. },
  21492. dark: {
  21493. 50: 'oklch(0.984 0.009 44.894)', // #FFF8F5 hsl(18, 100%, 98%)
  21494. 100: 'oklch(0.963 0.02 45.262)', // #FFEFE8 hsl(18, 100%, 96%)
  21495. 200: 'oklch(0.889 0.047 41.262)', // #F7D1C3 hsl(16, 77%, 87%)
  21496. 300: 'oklch(0.817 0.075 38.298)', // #EFB3A0 hsl(14, 71%, 78%)
  21497. 400: 'oklch(0.747 0.107 34.759)', // #E8947F hsl(12, 70%, 70%)
  21498. 500: 'oklch(0.68 0.138 32.855)', // #E0755F hsl(10, 68%, 63%)
  21499. default: 'oklch(0.621 0.167 31.47)', // #D85742 hsl(8, 66%, 55%)
  21500. 700: 'oklch(0.522 0.165 29.582)', // #B5372A hsl(6, 62%, 44%)
  21501. 800: 'oklch(0.433 0.152 29.344)', // #921F16 hsl(4, 74%, 33%)
  21502. 900: 'oklch(0.348 0.132 28.566)', // #6F0C09 hsl(2, 85%, 24%)
  21503. 950: 'oklch(0.264 0.108 29.234)' // #4D0000 hsl(0, 100%, 15%)
  21504. },
  21505. primaryBlack: 'oklch(0.15 0.035 247.014)', // #010C19 hsl(211, 95%, 5%)
  21506. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(211, 5%, 95%)
  21507. darkBlack: 'oklch(0.148 0.043 37.362)', // #190401 hsl(8, 95%, 5%)
  21508. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(8, 5%, 95%)
  21509. functional: {
  21510. success: 'oklch(0.663 0.189 146.376)', // #21b043 hsl(134, 68%, 41%)
  21511. warning: 'oklch(0.652 0.163 41.893)', // #df6734 hsl(18, 73%, 54%)
  21512. error: 'oklch(0.616 0.196 13.669)', // #e14161 hsl(348, 73%, 57%)
  21513. info: 'oklch(0.523 0.229 273.504)' // #484eea hsl(238, 79%, 60%)
  21514. },
  21515. extend: [
  21516. {
  21517. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  21518. alias: 'Tencent'
  21519. },
  21520. {
  21521. color: 'oklch(0.654 0.154 241.655)', // #0099e5 hsl(200, 100%, 45%)
  21522. alias: '500px'
  21523. },
  21524. {
  21525. color: 'oklch(0.571 0.235 261.561)', // #1769ff hsl(219, 100%, 55%)
  21526. alias: 'Behance'
  21527. }
  21528. ]
  21529. }
  21530. };
  21531. export default Azuper;
  21532. ================================================
  21533. FILE: packages/stdf/src/data/themes/azurePink.ts
  21534. ================================================
  21535. import type { ThemeProps } from '$lib/theme/types.js';
  21536. const AzurePink: ThemeProps = {
  21537. name: 'AzurePink',
  21538. color: {
  21539. primary: {
  21540. 50: 'oklch(0.977 0.011 274.897)', // #F5F7FF hsl(228, 100%, 98%)
  21541. 100: 'oklch(0.948 0.025 273.503)', // #E8EDFF hsl(227, 100%, 96%)
  21542. 200: 'oklch(0.799 0.073 275.979)', // #B0BAED hsl(230, 63%, 81%)
  21543. 300: 'oklch(0.66 0.12 275.608)', // #7E8BDB hsl(232, 56%, 68%)
  21544. 400: 'oklch(0.531 0.164 274.903)', // #535EC9 hsl(234, 52%, 56%)
  21545. 500: 'oklch(0.421 0.199 271.236)', // #2D36B7 hsl(236, 61%, 45%)
  21546. default: 'oklch(0.341 0.216 266.286)', // #0D12A5 hsl(238, 85%, 35%)
  21547. 700: 'oklch(0.302 0.198 265.961)', // #08088F hsl(240, 89%, 30%)
  21548. 800: 'oklch(0.269 0.175 267.031)', // #090579 hsl(242, 92%, 25%)
  21549. 900: 'oklch(0.233 0.152 268.05)', // #080263 hsl(244, 96%, 20%)
  21550. 950: 'oklch(0.196 0.128 270.599)' // #08004D hsl(246, 100%, 15%)
  21551. },
  21552. dark: {
  21553. 50: 'oklch(0.979 0.011 356.992)', // #FFF5F8 hsl(342, 100%, 98%)
  21554. 100: 'oklch(0.952 0.027 354.511)', // #FFE8F0 hsl(339, 100%, 96%)
  21555. 200: 'oklch(0.863 0.076 354.34)', // #FBBED5 hsl(337, 88%, 87%)
  21556. 300: 'oklch(0.783 0.127 353.824)', // #F795BE hsl(335, 86%, 78%)
  21557. 400: 'oklch(0.713 0.175 354.443)', // #F36DA9 hsl(333, 85%, 69%)
  21558. 500: 'oklch(0.658 0.216 355.121)', // #EF4698 hsl(331, 84%, 61%)
  21559. default: 'oklch(0.621 0.239 357.218)', // #EB2188 hsl(329, 84%, 53%)
  21560. 700: 'oklch(0.54 0.212 354.913)', // #C31575 hsl(327, 81%, 42%)
  21561. 800: 'oklch(0.458 0.183 353.544)', // #9C0B5F hsl(325, 87%, 33%)
  21562. 900: 'oklch(0.37 0.15 351.13)', // #740449 hsl(323, 93%, 24%)
  21563. 950: 'oklch(0.278 0.117 348.207)' // #4D0032 hsl(321, 100%, 15%)
  21564. },
  21565. primaryBlack: 'oklch(0.106 0.061 269.597)', // #010119 hsl(238, 95%, 5%)
  21566. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(238, 5%, 95%)
  21567. darkBlack: 'oklch(0.144 0.055 350.158)', // #19010D hsl(329, 95%, 5%)
  21568. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(329, 5%, 95%)
  21569. functional: {
  21570. success: 'oklch(0.629 0.199 141.373)', // #2ba417 hsl(112, 75%, 37%)
  21571. warning: 'oklch(0.674 0.166 52.005)', // #e37318 hsl(27, 81%, 49%)
  21572. error: 'oklch(0.599 0.177 27.079)', // #d54941 hsl(3, 64%, 55%)
  21573. info: 'oklch(0.492 0.217 261.351)' // #0052d9 hsl(217, 100%, 43%)
  21574. },
  21575. extend: [
  21576. {
  21577. color: 'oklch(0.364 0.191 266.82)', // #1428a0 hsl(231, 78%, 35%)
  21578. alias: 'Samsung'
  21579. },
  21580. {
  21581. color: 'oklch(0.66 0.225 36.296)', // #fd4900 hsl(17, 100%, 50%)
  21582. alias: 'Xiaomi'
  21583. },
  21584. {
  21585. color: 'oklch(0.461 0.116 153.579)', // #046a38 hsl(151, 93%, 22%)
  21586. alias: 'OPPO'
  21587. }
  21588. ]
  21589. }
  21590. };
  21591. export default AzurePink;
  21592. ================================================
  21593. FILE: packages/stdf/src/data/themes/camelliaRed.ts
  21594. ================================================
  21595. import type { ThemeProps } from '$lib/theme/types.js';
  21596. const CamelliaRed: ThemeProps = {
  21597. name: 'CamelliaRed',
  21598. color: {
  21599. primary: {
  21600. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  21601. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  21602. 200: 'oklch(0.876 0.061 22.144)', // #FCC7C4 hsl(3, 90%, 88%)
  21603. 300: 'oklch(0.799 0.101 20.296)', // #F8A3A2 hsl(1, 86%, 80%)
  21604. 400: 'oklch(0.732 0.143 20.141)', // #F58082 hsl(359, 85%, 73%)
  21605. 500: 'oklch(0.675 0.18 20.489)', // #F15F66 hsl(357, 84%, 66%)
  21606. default: 'oklch(0.632 0.21 21.584)', // #EE3F4D hsl(355, 84%, 59%)
  21607. 700: 'oklch(0.54 0.193 20.999)', // #C6273A hsl(353, 67%, 47%)
  21608. 800: 'oklch(0.449 0.168 20.933)', // #9D1529 hsl(351, 76%, 35%)
  21609. 900: 'oklch(0.36 0.138 20.161)', // #75081C hsl(349, 87%, 25%)
  21610. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  21611. },
  21612. dark: {
  21613. 50: 'oklch(0.99 0.008 319.447)', // #FEFAFF hsl(288, 100%, 99%)
  21614. 100: 'oklch(0.953 0.037 320.346)', // #FBE8FF hsl(290, 100%, 96%)
  21615. 200: 'oklch(0.915 0.065 318.761)', // #F6D6FF hsl(287, 100%, 92%)
  21616. 300: 'oklch(0.877 0.092 317.423)', // #F0C4FF hsl(285, 100%, 88%)
  21617. 400: 'oklch(0.841 0.118 315.933)', // #E9B3FF hsl(283, 100%, 85%)
  21618. 500: 'oklch(0.803 0.145 314.514)', // #E1A1FF hsl(281, 100%, 82%)
  21619. default: 'oklch(0.765 0.171 312.957)', // #D88FFF hsl(279, 100%, 78%)
  21620. 700: 'oklch(0.602 0.188 310.729)', // #A458D2 hsl(277, 58%, 58%)
  21621. 800: 'oklch(0.461 0.184 307.198)', // #742EA6 hsl(275, 57%, 42%)
  21622. 900: 'oklch(0.339 0.159 303.074)', // #4A1179 hsl(273, 75%, 27%)
  21623. 950: 'oklch(0.231 0.124 299.616)' // #28004D hsl(271, 100%, 15%)
  21624. },
  21625. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  21626. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  21627. darkBlack: 'oklch(0.134 0.06 312.473)', // #100119 hsl(279, 95%, 5%)
  21628. darkWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(279, 5%, 95%)
  21629. functional: {
  21630. success: 'oklch(0.726 0.218 138.487)', // #52c41a hsl(100, 77%, 44%)
  21631. warning: 'oklch(0.802 0.165 76.001)', // #faad14 hsl(40, 96%, 53%)
  21632. error: 'oklch(0.673 0.214 24.465)', // #ff4d4f hsl(359, 100%, 65%)
  21633. info: 'oklch(0.599 0.219 259.04)' // #1677ff hsl(215, 100%, 54%)
  21634. },
  21635. extend: [
  21636. {
  21637. color: 'oklch(0.472 0.108 263.58)', // #3b5998 hsl(221, 44%, 41%)
  21638. alias: 'Facebook'
  21639. },
  21640. {
  21641. color: 'oklch(0.602 0.236 28.928)', // #ed1c16 hsl(2, 86%, 51%)
  21642. alias: 'CocaCola'
  21643. },
  21644. {
  21645. color: 'oklch(0.51 0.145 250.251)', // #0068b5 hsl(206, 100%, 36%)
  21646. alias: 'Intel'
  21647. }
  21648. ]
  21649. }
  21650. };
  21651. export default CamelliaRed;
  21652. ================================================
  21653. FILE: packages/stdf/src/data/themes/chameleon.ts
  21654. ================================================
  21655. import type { ThemeProps } from '$lib/theme/types.js';
  21656. const Chameleon: ThemeProps = {
  21657. name: 'Chameleon',
  21658. color: {
  21659. primary: {
  21660. 50: 'oklch(0.991 0.014 155.599)', // #F5FFF8 hsl(138, 100%, 98%)
  21661. 100: 'oklch(0.979 0.032 155.407)', // #E8FFEF hsl(138, 100%, 96%)
  21662. 200: 'oklch(0.89 0.085 155.743)', // #ADECC3 hsl(141, 62%, 80%)
  21663. 300: 'oklch(0.812 0.128 154.98)', // #78DA9D hsl(143, 57%, 66%)
  21664. 400: 'oklch(0.742 0.153 154.251)', // #4AC77E hsl(145, 53%, 54%)
  21665. 500: 'oklch(0.682 0.167 152.73)', // #23B564 hsl(147, 68%, 42%)
  21666. default: 'oklch(0.623 0.168 150.91)', // #02A24E hsl(149, 98%, 32%)
  21667. 700: 'oklch(0.564 0.146 152.693)', // #018D49 hsl(151, 99%, 28%)
  21668. 800: 'oklch(0.5 0.124 154.785)', // #017742 hsl(153, 98%, 24%)
  21669. 900: 'oklch(0.437 0.104 156.756)', // #006239 hsl(155, 100%, 19%)
  21670. 950: 'oklch(0.371 0.085 159.162)' // #004D2F hsl(157, 100%, 15%)
  21671. },
  21672. dark: {
  21673. 50: 'oklch(0.98 0.014 336.137)', // #FFF5FC hsl(318, 100%, 98%)
  21674. 100: 'oklch(0.955 0.034 333.19)', // #FFE8FA hsl(313, 100%, 96%)
  21675. 200: 'oklch(0.896 0.07 332.956)', // #FACCF1 hsl(312, 82%, 89%)
  21676. 300: 'oklch(0.842 0.108 332.745)', // #F6B1EA hsl(310, 79%, 83%)
  21677. 400: 'oklch(0.793 0.145 331.761)', // #F197E5 hsl(308, 76%, 77%)
  21678. 500: 'oklch(0.75 0.181 330.986)', // #ED7EE2 hsl(306, 76%, 71%)
  21679. default: 'oklch(0.711 0.213 330.284)', // #E866DF hsl(304, 74%, 66%)
  21680. 700: 'oklch(0.6 0.215 329.149)', // #C140BD hsl(302, 51%, 50%)
  21681. 800: 'oklch(0.496 0.202 328.098)', // #9A229A hsl(300, 64%, 37%)
  21682. 900: 'oklch(0.391 0.17 326.834)', // #700D73 hsl(298, 80%, 25%)
  21683. 950: 'oklch(0.284 0.133 324.454)' // #47004D hsl(295, 100%, 15%)
  21684. },
  21685. primaryBlack: 'oklch(0.189 0.042 157.928)', // #01190C hsl(149, 95%, 5%)
  21686. primaryWhite: 'oklch(0.963 0.002 145.562)', // #F2F3F2 hsl(149, 5%, 95%)
  21687. darkBlack: 'oklch(0.151 0.063 331.348)', // #190117 hsl(304, 95%, 5%)
  21688. darkWhite: 'oklch(0.962 0.002 325.59)', // #F3F2F3 hsl(304, 5%, 95%)
  21689. functional: {
  21690. success: 'oklch(0.731 0.191 137.226)', // #67c23a hsl(100, 54%, 49%)
  21691. warning: 'oklch(0.761 0.139 73.316)', // #e6a23c hsl(36, 77%, 57%)
  21692. error: 'oklch(0.699 0.169 22.456)', // #f56c6c hsl(0, 87%, 69%)
  21693. info: 'oklch(0.663 0.01 264.502)' // #909399 hsl(220, 4%, 58%)
  21694. },
  21695. extend: [
  21696. {
  21697. color: 'oklch(0.746 0.16 232.661)', // #00bcff hsl(194, 100%, 44%)
  21698. alias: 'Tailwind'
  21699. },
  21700. {
  21701. color: 'oklch(0.515 0.206 28.695)', // #c20c0c hsl(0, 88%, 40%)
  21702. alias: 'NetEaseCloudMusic'
  21703. },
  21704. {
  21705. color: 'oklch(0.566 0.238 268.917)', // #415fff hsl(231, 100%, 63%)
  21706. alias: 'vivo'
  21707. }
  21708. ]
  21709. }
  21710. };
  21711. export default Chameleon;
  21712. ================================================
  21713. FILE: packages/stdf/src/data/themes/citrus.ts
  21714. ================================================
  21715. import type { ThemeProps } from '$lib/theme/types.js';
  21716. const Citrus: ThemeProps = {
  21717. name: 'Citrus',
  21718. color: {
  21719. primary: {
  21720. 50: 'oklch(0.985 0.008 236.556)', // #F5FBFF hsl(204, 100%, 98%)
  21721. 100: 'oklch(0.963 0.019 240.727)', // #E8F5FF hsl(206, 100%, 96%)
  21722. 200: 'oklch(0.818 0.048 241.473)', // #A9C8E0 hsl(206, 47%, 77%)
  21723. 300: 'oklch(0.677 0.07 246.931)', // #749CC1 hsl(209, 38%, 61%)
  21724. 400: 'oklch(0.548 0.088 251.698)', // #4974A3 hsl(211, 38%, 46%)
  21725. 500: 'oklch(0.431 0.097 254.641)', // #275184 hsl(213, 54%, 34%)
  21726. default: 'oklch(0.324 0.099 258.036)', // #0E3265 hsl(215, 76%, 23%)
  21727. 700: 'oklch(0.298 0.102 260.178)', // #0A2A5F hsl(217, 81%, 21%)
  21728. 800: 'oklch(0.274 0.103 261.304)', // #062359 hsl(219, 87%, 19%)
  21729. 900: 'oklch(0.251 0.105 262.192)', // #031C53 hsl(221, 93%, 17%)
  21730. 950: 'oklch(0.229 0.106 261.947)' // #00164D hsl(223, 100%, 15%)
  21731. },
  21732. dark: {
  21733. 50: 'oklch(0.997 0.013 106.635)', // #FFFFF5 hsl(60, 100%, 98%)
  21734. 100: 'oklch(0.994 0.03 106.933)', // #FFFFE8 hsl(60, 100%, 96%)
  21735. 200: 'oklch(0.967 0.08 105.52)', // #FBF8B9 hsl(57, 89%, 86%)
  21736. 300: 'oklch(0.937 0.122 105)', // #F6EF8B hsl(56, 86%, 76%)
  21737. 400: 'oklch(0.903 0.152 102.892)', // #F2E35E hsl(54, 85%, 66%)
  21738. 500: 'oklch(0.867 0.168 100.267)', // #EDD533 hsl(52, 84%, 57%)
  21739. default: 'oklch(0.826 0.168 94.589)', // #E9C30A hsl(50, 92%, 48%)
  21740. 700: 'oklch(0.707 0.144 91.085)', // #C29C06 hsl(48, 94%, 39%)
  21741. 800: 'oklch(0.588 0.12 87.218)', // #9B7703 hsl(46, 96%, 31%)
  21742. 900: 'oklch(0.47 0.096 83.886)', // #745501 hsl(44, 98%, 23%)
  21743. 950: 'oklch(0.35 0.072 82.069)' // #4D3600 hsl(42, 100%, 15%)
  21744. },
  21745. primaryBlack: 'oklch(0.147 0.037 249.929)', // #010B19 hsl(215, 95%, 5%)
  21746. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(215, 5%, 95%)
  21747. darkBlack: 'oklch(0.195 0.038 99.68)', // #191501 hsl(50, 95%, 5%)
  21748. darkWhite: 'oklch(0.964 0.001 106.424)', // #F3F3F2 hsl(50, 5%, 95%)
  21749. functional: {
  21750. success: 'oklch(0.637 0.184 146.403)', // #1ba73e hsl(135, 72%, 38%)
  21751. warning: 'oklch(0.495 0.128 47.783)', // #9a460e hsl(24, 83%, 33%)
  21752. error: 'oklch(0.504 0.203 28.76)', // #bd0a0a hsl(0, 90%, 39%)
  21753. info: 'oklch(0.466 0.24 284.096)' // #5628d7 hsl(256, 69%, 50%)
  21754. },
  21755. extend: [
  21756. {
  21757. color: 'oklch(0.703 0.149 235.113)', // oklch(0.703 0.149 235.059) hsl(197, 98%, 47%)
  21758. alias: 'Twitter'
  21759. },
  21760. {
  21761. color: 'oklch(0.702 0.194 38.137)', // oklch(0.702 0.194 38.137) hsl(15, 100%, 61%)
  21762. alias: 'Svelte'
  21763. },
  21764. {
  21765. color: 'oklch(0.716 0.171 53.446)', // #f38020 hsl(27, 90%, 54%)
  21766. alias: 'Cloudflare'
  21767. }
  21768. ]
  21769. }
  21770. };
  21771. export default Citrus;
  21772. ================================================
  21773. FILE: packages/stdf/src/data/themes/greenJade.ts
  21774. ================================================
  21775. import type { ThemeProps } from '$lib/theme/types.js';
  21776. const GreenJade: ThemeProps = {
  21777. name: 'GreenJade',
  21778. color: {
  21779. primary: {
  21780. 50: 'oklch(0.992 0.011 176.326)', // #F5FFFC hsl(162, 100%, 98%)
  21781. 100: 'oklch(0.982 0.025 181.302)', // #E8FFFA hsl(167, 100%, 96%)
  21782. 200: 'oklch(0.871 0.05 182.107)', // #B1E0D7 hsl(169, 43%, 79%)
  21783. 300: 'oklch(0.765 0.067 183.674)', // #81C1B7 hsl(171, 34%, 63%)
  21784. 400: 'oklch(0.662 0.075 185.315)', // #59A299 hsl(173, 29%, 49%)
  21785. 500: 'oklch(0.561 0.075 188.146)', // #38837D hsl(175, 40%, 37%)
  21786. default: 'oklch(0.46 0.067 190.938)', // #1F6461 hsl(177, 53%, 26%)
  21787. 700: 'oklch(0.44 0.068 193.584)', // #165E5D hsl(179, 62%, 23%)
  21788. 800: 'oklch(0.416 0.066 196.348)', // #0E5758 hsl(181, 73%, 20%)
  21789. 900: 'oklch(0.389 0.064 199.408)', // #064F52 hsl(182, 86%, 17%)
  21790. 950: 'oklch(0.36 0.062 206.153)' // #00464D hsl(186, 100%, 15%)
  21791. },
  21792. dark: {
  21793. 50: 'oklch(0.993 0.011 95.159)', // #FFFDF5 hsl(48, 100%, 98%)
  21794. 100: 'oklch(0.984 0.024 94.062)', // #FFFAE8 hsl(47, 100%, 96%)
  21795. 200: 'oklch(0.963 0.055 93.624)', // #FFF3CA hsl(46, 100%, 90%)
  21796. 300: 'oklch(0.938 0.081 90.541)', // #FFE9AC hsl(44, 100%, 84%)
  21797. 400: 'oklch(0.909 0.106 87.283)', // #FFDD8D hsl(42, 100%, 78%)
  21798. 500: 'oklch(0.877 0.126 83.083)', // #FFCF6F hsl(40, 100%, 72%)
  21799. default: 'oklch(0.844 0.144 77.934)', // #FFBF51 hsl(38, 100%, 66%)
  21800. 700: 'oklch(0.707 0.132 72.908)', // #D29232 hsl(36, 64%, 51%)
  21801. 800: 'oklch(0.574 0.117 66.999)', // #A6691A hsl(34, 73%, 38%)
  21802. 900: 'oklch(0.444 0.097 61.688)', // #79450A hsl(32, 85%, 26%)
  21803. 950: 'oklch(0.315 0.075 58.16)' // #4D2600 hsl(30, 100%, 15%)
  21804. },
  21805. primaryBlack: 'oklch(0.193 0.032 191.218)', // #011918 hsl(177, 95%, 5%)
  21806. primaryWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(177, 5%, 95%)
  21807. darkBlack: 'oklch(0.18 0.034 82.944)', // #191001 hsl(38, 95%, 5%)
  21808. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(38, 5%, 95%)
  21809. functional: {
  21810. success: 'oklch(0.618 0.208 142.486)', // #09a207 hsl(119, 92%, 33%)
  21811. warning: 'oklch(0.677 0.149 65.479)', // #d4810c hsl(35, 89%, 44%)
  21812. error: 'oklch(0.554 0.224 28.911)', // #d70909 hsl(0, 92%, 44%)
  21813. info: 'oklch(0.419 0.238 264.463)' // #062ecb hsl(228, 94%, 41%)
  21814. },
  21815. extend: [
  21816. {
  21817. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  21818. alias: 'Tencent'
  21819. },
  21820. {
  21821. color: 'oklch(0.606 0.23 11.741)', // #ea1d5d hsl(341, 83%, 52%)
  21822. alias: 'Aparat'
  21823. },
  21824. {
  21825. color: 'oklch(0.588 0.134 239.667)', // #0085c3 hsl(199, 100%, 38%)
  21826. alias: 'Dell'
  21827. }
  21828. ]
  21829. }
  21830. };
  21831. export default GreenJade;
  21832. ================================================
  21833. FILE: packages/stdf/src/data/themes/index.ts
  21834. ================================================
  21835. import { STDFTheme } from '$lib/theme/index.js';
  21836. import Chameleon from './chameleon.js';
  21837. import AzurePink from './azurePink.js';
  21838. import SmartLive from './smartLive.js';
  21839. import CamelliaRed from './camelliaRed.js';
  21840. import Nintendo from './nintendo.js';
  21841. import Skybloom from './skybloom.js';
  21842. import Aqua from './aqua.js';
  21843. import KleinH from './kleinH.js';
  21844. import Azuper from './azuper.js';
  21845. import Citrus from './citrus.js';
  21846. import Lavender from './lavender.js';
  21847. import TealMedley from './tealMedley.js';
  21848. import GreenJade from './greenJade.js';
  21849. export default [
  21850. { name_CN: 'STDF', name: STDFTheme.name, theme: STDFTheme },
  21851. { name_CN: '任天堂', name: Nintendo.name, theme: Nintendo },
  21852. { name_CN: '蔚蓝粉', name: AzurePink.name, theme: AzurePink },
  21853. { name_CN: '变色龙', name: Chameleon.name, theme: Chameleon },
  21854. { name_CN: '慧活力', name: SmartLive.name, theme: SmartLive },
  21855. { name_CN: '蓝采绿', name: Aqua.name, theme: Aqua },
  21856. { name_CN: '山茶红', name: CamelliaRed.name, theme: CamelliaRed },
  21857. { name_CN: '蓝粉梦', name: Skybloom.name, theme: Skybloom },
  21858. { name_CN: '克莱仕', name: KleinH.name, theme: KleinH },
  21859. { name_CN: '石青柿', name: Azuper.name, theme: Azuper },
  21860. { name_CN: '青佛手', name: Citrus.name, theme: Citrus },
  21861. { name_CN: '以初紫', name: Lavender.name, theme: Lavender },
  21862. { name_CN: '青什锦', name: TealMedley.name, theme: TealMedley },
  21863. { name_CN: '绿玉子', name: GreenJade.name, theme: GreenJade }
  21864. ];
  21865. ================================================
  21866. FILE: packages/stdf/src/data/themes/kleinH.ts
  21867. ================================================
  21868. import type { ThemeProps } from '$lib/theme/types.js';
  21869. const KleinH: ThemeProps = {
  21870. name: 'KleinH',
  21871. color: {
  21872. primary: {
  21873. 50: 'oklch(0.983 0.009 247.912)', // #F5FAFF hsl(210, 100%, 98%)
  21874. 100: 'oklch(0.957 0.021 254.913)', // #E8F2FF hsl(214, 100%, 96%)
  21875. 200: 'oklch(0.817 0.061 257.788)', // #ABC5EB hsl(216, 62%, 80%)
  21876. 300: 'oklch(0.681 0.099 261.163)', // #7699D6 hsl(218, 54%, 65%)
  21877. 400: 'oklch(0.559 0.134 262.606)', // #4871C2 hsl(220, 50%, 52%)
  21878. 500: 'oklch(0.446 0.164 263.584)', // #214BAD hsl(222, 68%, 40%)
  21879. default: 'oklch(0.355 0.183 263.561)', // #022A99 hsl(224, 97%, 30%)
  21880. 700: 'oklch(0.316 0.17 263.812)', // #012086 hsl(226, 99%, 27%)
  21881. 800: 'oklch(0.28 0.155 264.078)', // #011873 hsl(228, 98%, 23%)
  21882. 900: 'oklch(0.242 0.139 263.958)', // #001060 hsl(230, 100%, 19%)
  21883. 950: 'oklch(0.207 0.12 264.016)' // #000A4D hsl(232, 100%, 15%)
  21884. },
  21885. dark: {
  21886. 50: 'oklch(0.991 0.01 87.47)', // #FFFCF5 hsl(42, 100%, 98%)
  21887. 100: 'oklch(0.978 0.022 83.264)', // #FFF7E8 hsl(39, 100%, 96%)
  21888. 200: 'oklch(0.935 0.058 80.464)', // #FEE6BE hsl(38, 97%, 87%)
  21889. 300: 'oklch(0.886 0.094 74.988)', // #FED193 hsl(35, 98%, 79%)
  21890. 400: 'oklch(0.837 0.125 70.641)', // #FDBB69 hsl(33, 97%, 70%)
  21891. 500: 'oklch(0.786 0.153 63.13)', // #FDA140 hsl(31, 98%, 62%)
  21892. default: 'oklch(0.734 0.178 54.177)', // #FC8416 hsl(29, 98%, 54%)
  21893. 700: 'oklch(0.625 0.159 50.796)', // #D0650E hsl(27, 87%, 44%)
  21894. 800: 'oklch(0.515 0.137 47.874)', // #A44907 hsl(25, 92%, 34%)
  21895. 900: 'oklch(0.405 0.113 45.466)', // #783003 hsl(23, 95%, 24%)
  21896. 950: 'oklch(0.295 0.084 45.171)' // #4D1B00 hsl(21, 100%, 15%)
  21897. },
  21898. primaryBlack: 'oklch(0.133 0.043 259.636)', // #010719 hsl(224, 95%, 5%)
  21899. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(224, 5%, 95%)
  21900. darkBlack: 'oklch(0.17 0.034 67.389)', // #190C01 hsl(29, 95%, 5%)
  21901. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(29, 5%, 95%)
  21902. functional: {
  21903. success: 'oklch(0.439 0.132 145.643)', // #07641d hsl(134, 87%, 21%)
  21904. warning: 'oklch(0.566 0.171 39.514)', // #c54711 hsl(18, 84%, 42%)
  21905. error: 'oklch(0.497 0.177 16.155)', // #b0213e hsl(348, 68%, 41%)
  21906. info: 'oklch(0.573 0.096 219.542)' // #1d859f hsl(192, 69%, 37%)
  21907. },
  21908. extend: [
  21909. {
  21910. color: 'oklch(0.686 0.139 231.254)', // #00a8e0 hsl(195, 100%, 44%)
  21911. alias: 'AT&T'
  21912. },
  21913. {
  21914. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  21915. alias: 'WeChat'
  21916. },
  21917. {
  21918. color: 'oklch(0.652 0.199 0.712)', // #ea4c89 hsl(337, 79%, 61%)
  21919. alias: 'Dribbble'
  21920. }
  21921. ]
  21922. }
  21923. };
  21924. export default KleinH;
  21925. ================================================
  21926. FILE: packages/stdf/src/data/themes/lavender.ts
  21927. ================================================
  21928. import type { ThemeProps } from '$lib/theme/types.js';
  21929. const Lavender: ThemeProps = {
  21930. name: 'Lavender',
  21931. color: {
  21932. primary: {
  21933. 50: 'oklch(0.978 0.015 315.966)', // #FCF5FF hsl(282, 100%, 98%)
  21934. 100: 'oklch(0.95 0.035 315.73)', // #F8E8FF hsl(282, 100%, 96%)
  21935. 200: 'oklch(0.842 0.065 314.453)', // #DBBFE9 hsl(280, 49%, 83%)
  21936. 300: 'oklch(0.739 0.091 312.314)', // #BE9AD4 hsl(277, 40%, 72%)
  21937. 400: 'oklch(0.641 0.109 310.145)', // #A179BE hsl(275, 35%, 61%)
  21938. 500: 'oklch(0.551 0.124 307.99)', // #865CA9 hsl(273, 31%, 51%)
  21939. default: 'oklch(0.467 0.13 305.627)', // #6C4393 hsl(271, 37%, 42%)
  21940. 700: 'oklch(0.392 0.138 302.664)', // #552C81 hsl(269, 49%, 34%)
  21941. 800: 'oklch(0.326 0.14 298.682)', // #401970 hsl(267, 64%, 27%)
  21942. 900: 'oklch(0.269 0.132 293.856)', // #2D0B5E hsl(265, 79%, 21%)
  21943. 950: 'oklch(0.216 0.123 289.042)' // #1D004D hsl(263, 100%, 15%)
  21944. },
  21945. dark: {
  21946. 50: 'oklch(0.971 0.017 349.48)', // #FFF1F7 hsl(334, 100%, 97%)
  21947. 100: 'oklch(0.953 0.029 347.076)', // #FFE8F3 hsl(331, 100%, 96%)
  21948. 200: 'oklch(0.926 0.042 344.642)', // #FCDCED hsl(328, 84%, 93%)
  21949. 300: 'oklch(0.901 0.053 344.002)', // #F9D1E7 hsl(327, 77%, 90%)
  21950. 400: 'oklch(0.874 0.065 342.674)', // #F5C5E1 hsl(325, 71%, 87%)
  21951. 500: 'oklch(0.85 0.078 340.995)', // #F2BADD hsl(323, 68%, 84%)
  21952. default: 'oklch(0.826 0.092 339.861)', // #EFAFD9 hsl(321, 67%, 81%)
  21953. 700: 'oklch(0.654 0.135 340.177)', // #C66DAA hsl(319, 44%, 60%)
  21954. 800: 'oklch(0.512 0.156 340.793)', // #9E3A81 hsl(317, 46%, 42%)
  21955. 900: 'oklch(0.391 0.15 340.551)', // #75155D hsl(315, 70%, 27%)
  21956. 950: 'oklch(0.284 0.123 340.171)' // #4D003C hsl(313, 100%, 15%)
  21957. },
  21958. primaryBlack: 'oklch(0.129 0.059 306.37)', // #0D0119 hsl(271, 95%, 5%)
  21959. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(271, 5%, 95%)
  21960. darkBlack: 'oklch(0.146 0.057 343.966)', // #190110 hsl(321, 95%, 5%)
  21961. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(321, 5%, 95%)
  21962. functional: {
  21963. success: 'oklch(0.784 0.194 147.722)', // #4ad96b hsl(134, 65%, 57%)
  21964. warning: 'oklch(0.693 0.147 42.888)', // #e67a4c hsl(18, 76%, 60%)
  21965. error: 'oklch(0.639 0.192 24.341)', // #e94e4e hsl(0, 78%, 61%)
  21966. info: 'oklch(0.613 0.168 270.082)' // #5e7ae8 hsl(228, 75%, 64%)
  21967. },
  21968. extend: [
  21969. {
  21970. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  21971. alias: 'Tencent'
  21972. },
  21973. {
  21974. color: 'oklch(0.651 0.212 142.608)', // oklch(0.651 0.212 142.608) hsl(120, 75%, 39%)
  21975. alias: 'WeChat'
  21976. },
  21977. {
  21978. color: 'oklch(0.343 0.077 256.446)', // #1c3960 hsl(214, 55%, 24%)
  21979. alias: 'Ford'
  21980. }
  21981. ]
  21982. }
  21983. };
  21984. export default Lavender;
  21985. ================================================
  21986. FILE: packages/stdf/src/data/themes/nintendo.ts
  21987. ================================================
  21988. import type { ThemeProps } from '$lib/theme/types.js';
  21989. const Nintendo: ThemeProps = {
  21990. name: 'Nintendo',
  21991. color: {
  21992. primary: {
  21993. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  21994. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  21995. 200: 'oklch(0.845 0.076 21.796)', // #FAB9B6 hsl(3, 87%, 85%)
  21996. 300: 'oklch(0.745 0.133 21.872)', // #F58886 hsl(1, 85%, 74%)
  21997. 400: 'oklch(0.662 0.188 22.749)', // #F0575A hsl(359, 84%, 64%)
  21998. 500: 'oklch(0.609 0.224 25.256)', // #EB2B34 hsl(357, 83%, 55%)
  21999. default: 'oklch(0.581 0.238 27.862)', // #E60012 hsl(355, 100%, 45%)
  22000. 700: 'oklch(0.508 0.207 26.549)', // #C00016 hsl(353, 100%, 38%)
  22001. 800: 'oklch(0.43 0.174 24.608)', // #990017 hsl(351, 100%, 30%)
  22002. 900: 'oklch(0.351 0.141 21.971)', // #730015 hsl(349, 100%, 23%)
  22003. 950: 'oklch(0.266 0.107 17.45)' // #4D0011 hsl(347, 100%, 15%)
  22004. },
  22005. dark: {
  22006. 50: 'oklch(0.992 0.011 189.833)', // #F5FFFE hsl(174, 100%, 98%)
  22007. 100: 'oklch(0.983 0.024 193.6)', // #E8FFFE hsl(177, 100%, 96%)
  22008. 200: 'oklch(0.938 0.067 196.074)', // #B6F9F9 hsl(180, 85%, 85%)
  22009. 300: 'oklch(0.893 0.099 198.69)', // #85F0F4 hsl(182, 84%, 74%)
  22010. 400: 'oklch(0.847 0.12 201.806)', // #57E4EE hsl(184, 82%, 64%)
  22011. 500: 'oklch(0.803 0.131 206.757)', // #2AD6E9 hsl(186, 81%, 54%)
  22012. default: 'oklch(0.752 0.133 215.123)', // #00C3E3 hsl(189, 100%, 45%)
  22013. 700: 'oklch(0.646 0.116 218.359)', // #009EBD hsl(190, 100%, 37%)
  22014. 800: 'oklch(0.535 0.1 223.819)', // #007998 hsl(192, 100%, 30%)
  22015. 900: 'oklch(0.426 0.083 227.589)', // #005772 hsl(194, 100%, 22%)
  22016. 950: 'oklch(0.319 0.064 230.58)' // #00384D hsl(196, 100%, 15%)
  22017. },
  22018. primaryBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(355, 95%, 5%)
  22019. primaryWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(355, 5%, 95%)
  22020. darkBlack: 'oklch(0.184 0.03 206.812)', // #011619 hsl(188, 95%, 5%)
  22021. darkWhite: 'oklch(0.963 0.001 197.138)', // #F2F3F3 hsl(188, 5%, 95%)
  22022. functional: {
  22023. success: 'oklch(0.669 0.214 144.385)', // #00b42a hsl(134, 100%, 35%)
  22024. warning: 'oklch(0.865 0.176 95.103)', // #f7d00c hsl(50, 94%, 51%)
  22025. error: 'oklch(0.642 0.218 25.88)', // #f53f3f hsl(0, 90%, 60%)
  22026. info: 'oklch(0.549 0.249 263.048)' // #165dff hsl(222, 100%, 54%)
  22027. },
  22028. extend: [
  22029. {
  22030. color: 'oklch(0.492 0.217 261.351)', // #0052d9 hsl(217, 100%, 43%)
  22031. alias: 'Tencent'
  22032. },
  22033. {
  22034. color: 'oklch(0.651 0.212 142.608)', // #1aad19 hsl(120, 75%, 39%)
  22035. alias: 'WeChat'
  22036. },
  22037. {
  22038. color: 'oklch(0.692 0.181 46.213)', // #f37021 hsl(23, 90%, 54%)
  22039. alias: 'Hermès'
  22040. }
  22041. ]
  22042. }
  22043. };
  22044. export default Nintendo;
  22045. ================================================
  22046. FILE: packages/stdf/src/data/themes/skybloom.ts
  22047. ================================================
  22048. import type { ThemeProps } from '$lib/theme/types.js';
  22049. const Skybloom: ThemeProps = {
  22050. name: 'Skybloom',
  22051. color: {
  22052. primary: {
  22053. 50: 'oklch(0.987 0.008 225.079)', // #F5FCFF hsl(198, 100%, 98%)
  22054. 100: 'oklch(0.969 0.019 225.712)', // #E8F8FF hsl(198, 100%, 96%)
  22055. 200: 'oklch(0.863 0.05 229.685)', // #B1D9ED hsl(200, 63%, 81%)
  22056. 300: 'oklch(0.759 0.075 234.966)', // #81B9DA hsl(202, 55%, 68%)
  22057. 400: 'oklch(0.66 0.098 240.067)', // #569AC8 hsl(204, 51%, 56%)
  22058. 500: 'oklch(0.566 0.115 244.99)', // #317CB5 hsl(206, 57%, 45%)
  22059. default: 'oklch(0.479 0.13 251.007)', // #125FA3 hsl(208, 80%, 36%)
  22060. 700: 'oklch(0.42 0.122 253.316)', // #0C4D8D hsl(210, 84%, 30%)
  22061. 800: 'oklch(0.359 0.116 256.313)', // #073B78 hsl(212, 89%, 25%)
  22062. 900: 'oklch(0.303 0.105 257.617)', // #032C62 hsl(214, 94%, 20%)
  22063. 950: 'oklch(0.251 0.093 258.021)' // #001F4D hsl(216, 100%, 15%)
  22064. },
  22065. dark: {
  22066. 50: 'oklch(0.975 0.012 23.703)', // #FFF4F3 hsl(5, 100%, 98%)
  22067. 100: 'oklch(0.949 0.025 17.604)', // #FFE8E8 hsl(0, 100%, 96%)
  22068. 200: 'oklch(0.92 0.038 17.861)', // #FDDBDB hsl(0, 90%, 93%)
  22069. 300: 'oklch(0.89 0.05 15.051)', // #FACED0 hsl(357, 82%, 89%)
  22070. 400: 'oklch(0.861 0.063 12.376)', // #F8C1C6 hsl(355, 80%, 87%)
  22071. 500: 'oklch(0.832 0.076 10.667)', // #F5B4BC hsl(353, 77%, 83%)
  22072. default: 'oklch(0.807 0.089 9.599)', // #F3A8B3 hsl(351, 76%, 81%)
  22073. 700: 'oklch(0.635 0.124 9.491)', // #C9687A hsl(349, 47%, 60%)
  22074. 800: 'oklch(0.493 0.139 10.638)', // #A0374E hsl(347, 49%, 42%)
  22075. 900: 'oklch(0.374 0.131 12.448)', // #76142D hsl(345, 71%, 27%)
  22076. 950: 'oklch(0.268 0.107 13.338)' // #4D0016 hsl(343, 100%, 15%)
  22077. },
  22078. primaryBlack: 'oklch(0.156 0.033 240.386)', // #010E19 hsl(208, 95%, 5%)
  22079. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(208, 5%, 95%)
  22080. darkBlack: 'oklch(0.14 0.05 14.109)', // #190104 hsl(351, 95%, 5%)
  22081. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(351, 5%, 95%)
  22082. functional: {
  22083. success: 'oklch(0.7 0.181 152.201)', // #0fbd63 hsl(149, 85%, 40%)
  22084. warning: 'oklch(0.534 0.132 51.034)', // #a75211 hsl(26, 82%, 36%)
  22085. error: 'oklch(0.58 0.211 10.496)', // #d9265c hsl(342, 70%, 50%)
  22086. info: 'oklch(0.458 0.218 283.692)' // #5231c9 hsl(253, 61%, 49%)
  22087. },
  22088. extend: [
  22089. {
  22090. color: 'oklch(0.703 0.149 235.113)', // oklch(0.703 0.149 235.059) hsl(197, 98%, 47%)
  22091. alias: 'Twitter'
  22092. },
  22093. {
  22094. color: 'oklch(0.702 0.194 38.137)', // oklch(0.702 0.194 38.137) hsl(15, 100%, 61%)
  22095. alias: 'Svelte'
  22096. },
  22097. {
  22098. color: 'oklch(0.518 0.199 259.881)', // #0e5fd8 hsl(216, 88%, 45%)
  22099. alias: 'Philips'
  22100. }
  22101. ]
  22102. }
  22103. };
  22104. export default Skybloom;
  22105. ================================================
  22106. FILE: packages/stdf/src/data/themes/smartLive.ts
  22107. ================================================
  22108. import type { ThemeProps } from '$lib/theme/types.js';
  22109. const SmartLive: ThemeProps = {
  22110. name: 'SmartLive',
  22111. color: {
  22112. primary: {
  22113. 50: 'oklch(0.978 0.015 315.966)', // #FCF5FF hsl(282, 100%, 98%)
  22114. 100: 'oklch(0.95 0.035 315.73)', // #F8E8FF hsl(282, 100%, 96%)
  22115. 200: 'oklch(0.794 0.075 313.533)', // #CDAEDE hsl(279, 42%, 78%)
  22116. 300: 'oklch(0.652 0.103 312.25)', // #A57DBD hsl(278, 33%, 62%)
  22117. 400: 'oklch(0.522 0.119 309.358)', // #7E549D hsl(275, 30%, 47%)
  22118. 500: 'oklch(0.406 0.122 307.073)', // #5B337C hsl(273, 42%, 34%)
  22119. default: 'oklch(0.304 0.112 304.532)', // #3C1A5B hsl(271, 56%, 23%)
  22120. 700: 'oklch(0.28 0.115 301.336)', // #341357 hsl(269, 64%, 21%)
  22121. 800: 'oklch(0.258 0.119 297.251)', // #2C0C54 hsl(267, 75%, 19%)
  22122. 900: 'oklch(0.238 0.12 293.937)', // #250650 hsl(265, 86%, 17%)
  22123. 950: 'oklch(0.216 0.123 289.042)' // #1D004D hsl(263, 100%, 15%)
  22124. },
  22125. dark: {
  22126. 50: 'oklch(0.98 0.01 25.073)', // #FFF6F5 hsl(6, 100%, 98%)
  22127. 100: 'oklch(0.953 0.023 24.126)', // #FFEAE8 hsl(5, 100%, 96%)
  22128. 200: 'oklch(0.902 0.051 19.634)', // #FFD2D1 hsl(1, 100%, 91%)
  22129. 300: 'oklch(0.853 0.08 18.86)', // #FFBABA hsl(0, 100%, 87%)
  22130. 400: 'oklch(0.806 0.111 17.023)', // #FFA2A6 hsl(357, 100%, 82%)
  22131. 500: 'oklch(0.765 0.14 16.578)', // #FF8B93 hsl(356, 100%, 77%)
  22132. default: 'oklch(0.728 0.169 15.672)', // #FF7483 hsl(354, 100%, 73%)
  22133. 700: 'oklch(0.597 0.173 16.54)', // #D2485A hsl(352, 61%, 55%)
  22134. 800: 'oklch(0.482 0.163 17.177)', // #A6263B hsl(350, 63%, 40%)
  22135. 900: 'oklch(0.373 0.138 17.973)', // #790E23 hsl(348, 79%, 27%)
  22136. 950: 'oklch(0.267 0.107 16.66)' // #4D0012 hsl(346, 100%, 15%)
  22137. },
  22138. primaryBlack: 'oklch(0.129 0.059 306.37)', // #0D0119 hsl(271, 95%, 5%)
  22139. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(271, 5%, 95%)
  22140. darkBlack: 'oklch(0.139 0.05 18.003)', // #190103 hsl(354, 95%, 5%)
  22141. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(354, 5%, 95%)
  22142. functional: {
  22143. success: 'oklch(0.419 0.092 155.284)', // #155b36 hsl(148, 63%, 22%)
  22144. warning: 'oklch(0.666 0.147 65.222)', // #d07e0b hsl(35, 90%, 43%)
  22145. error: 'oklch(0.564 0.223 28.46)', // #da1414 hsl(0, 83%, 47%)
  22146. info: 'oklch(0.728 0.107 239.498)' // #63b0e3 hsl(204, 70%, 64%)
  22147. },
  22148. extend: [
  22149. {
  22150. color: 'oklch(0.713 0.194 130.802)', // #76b900 hsl(82, 100%, 36%)
  22151. alias: 'NVIDIA'
  22152. },
  22153. {
  22154. color: 'oklch(0.726 0.171 4.454)', // #fb7299 hsl(343, 95%, 72%)
  22155. alias: 'bilibili'
  22156. },
  22157. {
  22158. color: 'oklch(0.599 0.219 259.04)', // #1677ff hsl(215, 100%, 54%)
  22159. alias: 'AliPay'
  22160. }
  22161. ]
  22162. }
  22163. };
  22164. export default SmartLive;
  22165. ================================================
  22166. FILE: packages/stdf/src/data/themes/tealMedley.ts
  22167. ================================================
  22168. import type { ThemeProps } from '$lib/theme/types.js';
  22169. const TealMedley: ThemeProps = {
  22170. name: 'TealMedley',
  22171. color: {
  22172. primary: {
  22173. 50: 'oklch(0.991 0.01 204.917)', // #F5FEFF hsl(186, 100%, 98%)
  22174. 100: 'oklch(0.977 0.021 207.588)', // #E8FCFF hsl(188, 100%, 96%)
  22175. 200: 'oklch(0.877 0.046 213.81)', // #B5DFE9 hsl(192, 54%, 81%)
  22176. 300: 'oklch(0.78 0.063 217.138)', // #89C2D2 hsl(193, 45%, 68%)
  22177. 400: 'oklch(0.686 0.076 222.122)', // #62A5BC hsl(195, 40%, 56%)
  22178. 500: 'oklch(0.595 0.084 226.019)', // #4089A5 hsl(197, 44%, 45%)
  22179. default: 'oklch(0.509 0.088 231.916)', // #256E8F hsl(199, 59%, 35%)
  22180. 700: 'oklch(0.448 0.086 236.944)', // #195B7E hsl(201, 67%, 30%)
  22181. 800: 'oklch(0.389 0.085 242.356)', // #0E496E hsl(203, 77%, 24%)
  22182. 900: 'oklch(0.334 0.081 245.985)', // #06395D hsl(205, 88%, 19%)
  22183. 950: 'oklch(0.28 0.078 249.311)' // #002A4D hsl(207, 100%, 15%)
  22184. },
  22185. dark: {
  22186. 50: 'oklch(0.971 0.015 33.071)', // #FFF2EF hsl(11, 100%, 97%)
  22187. 100: 'oklch(0.957 0.021 31.78)', // #FFECE8 hsl(10, 100%, 96%)
  22188. 200: 'oklch(0.932 0.028 28.52)', // #FBE2DE hsl(8, 78%, 93%)
  22189. 300: 'oklch(0.905 0.036 24.203)', // #F7D7D4 hsl(5, 69%, 90%)
  22190. 400: 'oklch(0.879 0.042 23.456)', // #F2CDCA hsl(5, 61%, 87%)
  22191. 500: 'oklch(0.852 0.051 21.242)', // #EEC2C0 hsl(3, 58%, 84%)
  22192. default: 'oklch(0.825 0.059 18.425)', // #EAB7B7 hsl(0, 55%, 82%)
  22193. 700: 'oklch(0.642 0.102 17.954)', // #C37275 hsl(358, 40%, 61%)
  22194. 800: 'oklch(0.49 0.126 19.197)', // #9B3D43 hsl(356, 44%, 42%)
  22195. 900: 'oklch(0.369 0.126 21.232)', // #741720 hsl(354, 67%, 27%)
  22196. 950: 'oklch(0.265 0.107 22.403)' // #4D000A hsl(352, 100%, 15%)
  22197. },
  22198. primaryBlack: 'oklch(0.167 0.03 228.62)', // #011119 hsl(199, 95%, 5%)
  22199. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(199, 5%, 95%)
  22200. darkBlack: 'oklch(0.138 0.051 27.08)', // #190101 hsl(0, 95%, 5%)
  22201. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(0, 5%, 95%)
  22202. functional: {
  22203. success: 'oklch(0.608 0.142 148.314)', // #38994f hsl(134, 46%, 41%)
  22204. warning: 'oklch(0.776 0.119 100.626)', // #c7b857 hsl(52, 50%, 56%)
  22205. error: 'oklch(0.66 0.146 21.85)', // #dd6969 hsl(0, 63%, 64%)
  22206. info: 'oklch(0.559 0.131 271.419)' // #596dc0 hsl(228, 45%, 55%)
  22207. },
  22208. extend: [
  22209. {
  22210. color: 'oklch(0.492 0.217 261.351)', // oklch(0.492 0.217 261.351) hsl(217, 100%, 43%)
  22211. alias: 'Tencent'
  22212. },
  22213. {
  22214. color: 'oklch(0.424 0.097 251.575)', // #205081 hsl(210, 60%, 32%)
  22215. alias: 'Bitbucket'
  22216. },
  22217. {
  22218. color: 'oklch(0.364 0.191 266.82)', // #1428a0 hsl(231, 78%, 35%)
  22219. alias: 'Samsung'
  22220. }
  22221. ]
  22222. }
  22223. };
  22224. export default TealMedley;
  22225. ================================================
  22226. FILE: packages/stdf/src/lib/index.ts
  22227. ================================================
  22228. export { default as ActionSheet } from './components/actionSheet/ActionSheet.svelte';
  22229. export { default as AsyncPicker } from './components/asyncPicker/AsyncPicker.svelte';
  22230. export { default as Avatar } from './components/avatar/Avatar.svelte';
  22231. export { default as Avatars } from './components/avatar/Avatars.svelte';
  22232. export { default as Badge } from './components/badge/Badge.svelte';
  22233. export { default as BottomSheet } from './components/bottomSheet/BottomSheet.svelte';
  22234. export { default as Button } from './components/button/Button.svelte';
  22235. export { default as Calendar } from './components/calendar/Calendar.svelte';
  22236. export { default as Cell } from './components/cell/Cell.svelte';
  22237. export { default as CellGroup } from './components/cell/CellGroup.svelte';
  22238. export { default as CheckboxItem } from './components/checkbox/CheckboxItem.svelte';
  22239. export { default as Checkbox } from './components/checkbox/Checkbox.svelte';
  22240. export { default as Dialog } from './components/dialog/Dialog.svelte';
  22241. export { default as Divider } from './components/divider/Divider.svelte';
  22242. export { default as Grid } from './components/grids/Grid.svelte';
  22243. export { default as Grids } from './components/grids/Grids.svelte';
  22244. export { default as Icon } from './components/icon/Icon.svelte';
  22245. export { default as IndexBar } from './components/indexBar/IndexBar.svelte';
  22246. export { default as Input } from './components/input/Input.svelte';
  22247. export { default as Loading } from './components/loading/Loading.svelte';
  22248. export { default as Mask } from './components/mask/Mask.svelte';
  22249. export { default as Modal } from './components/modal/Modal.svelte';
  22250. export { default as NavBar } from './components/navBar/NavBar.svelte';
  22251. export { default as NoticeBar } from './components/noticeBar/NoticeBar.svelte';
  22252. export { default as NumKeyboard } from './components/numKeyboard/NumKeyboard.svelte';
  22253. export { default as Pagination } from './components/pagination/Pagination.svelte';
  22254. export { default as Picker } from './components/picker/Picker.svelte';
  22255. export { default as Placeholder } from './components/placeholder/Placeholder.svelte';
  22256. export { default as Popup } from './components/popup/Popup.svelte';
  22257. export { default as Progress } from './components/progress/Progress.svelte';
  22258. export { default as ProgressLoop } from './components/progressLoop/ProgressLoop.svelte';
  22259. export { default as RadioItem } from './components/radio/RadioItem.svelte';
  22260. export { default as Radio } from './components/radio/Radio.svelte';
  22261. export { default as Rate } from './components/rate/Rate.svelte';
  22262. export { default as Skeleton } from './components/skeleton/Skeleton.svelte';
  22263. export { default as Slider } from './components/slider/Slider.svelte';
  22264. export { default as Stepper } from './components/stepper/Stepper.svelte';
  22265. export { default as Steps } from './components/steps/Steps.svelte';
  22266. export { default as Switch } from './components/switch/Switch.svelte';
  22267. export { default as Swiper } from './components/swiper/Swiper.svelte';
  22268. export { default as Tab } from './components/tabs/Tab.svelte';
  22269. export { default as TabBar } from './components/tabBar/TabBar.svelte';
  22270. export { default as TabContent } from './components/tabs/TabContent.svelte';
  22271. export { default as Tabs } from './components/tabs/Tabs.svelte';
  22272. export { default as TimePicker } from './components/timePicker/TimePicker.svelte';
  22273. export { default as Toast } from './components/toast/Toast.svelte';
  22274. ================================================
  22275. FILE: packages/stdf/src/lib/components/actionSheet/ActionSheet.svelte
  22276. ================================================
  22277. <script lang="ts">
  22278. import { getContext } from 'svelte';
  22279. import Popup from '../popup/Popup.svelte';
  22280. import type { ActionSheetProps, ActionProps } from '../../types/index.js';
  22281. import { zh_CN, type LangProps } from '../../lang/index.js';
  22282. // 当前语言
  22283. // current language
  22284. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  22285. const actionSheetLang: LangProps['actionSheet'] = currentLang.actionSheet;
  22286. let {
  22287. visible = $bindable(false),
  22288. title = '',
  22289. titleAlign = 'center',
  22290. actions = [],
  22291. popup = {},
  22292. showCancel = false,
  22293. cancelText = actionSheetLang.cancelText,
  22294. actionClosable = true,
  22295. align = 'center',
  22296. oncancel,
  22297. onclickAction,
  22298. onclose
  22299. }: ActionSheetProps = $props();
  22300. // 静态样式类定义移到组件外部
  22301. // static style class definition moved to component outside
  22302. const STYLE_MAPS = {
  22303. titleAlign: { left: 'text-left', center: 'text-center', right: 'text-right' },
  22304. state: {
  22305. normal: ' ',
  22306. theme: ' text-primary dark:text-dark ',
  22307. danger: ' text-error ',
  22308. disabled: ' text-black/20 dark:text-white/20 '
  22309. },
  22310. imgRadius: { none: 'rounded-none', sm: 'rounded-sm', full: 'rounded-full', lg: 'rounded-lg' },
  22311. align: { left: 'justify-start pl-4', center: 'justify-center', right: 'justify-end pr-4' }
  22312. };
  22313. // 优化高度计算函数
  22314. // optimize height calculation function
  22315. const getTransitionDistance = (title: string, showCancel: boolean, actions: ActionProps[]): number => {
  22316. const BASE_HEIGHTS = { title: 40, cancel: 56, action: 56, actionWithDesc: 60, divider: 1 };
  22317. return (
  22318. (title ? BASE_HEIGHTS.title : 0) +
  22319. (showCancel ? BASE_HEIGHTS.cancel : 0) +
  22320. actions.reduce((total: number, item: ActionProps) => total + (item.desc ? BASE_HEIGHTS.actionWithDesc : BASE_HEIGHTS.action), 0) +
  22321. (actions.length - 1) * BASE_HEIGHTS.divider
  22322. );
  22323. };
  22324. // 优化事件处理函数
  22325. // optimize event handling function
  22326. const handleCancel = () => {
  22327. visible = false;
  22328. oncancel?.();
  22329. onclose?.();
  22330. };
  22331. // 处理选项点击事件
  22332. // handle option click event
  22333. const handleActionClick = (index: number, item: ActionProps) => {
  22334. if (item.style === 'disabled') return;
  22335. onclickAction?.(index, item);
  22336. if (actionClosable) {
  22337. visible = false;
  22338. onclose?.();
  22339. }
  22340. };
  22341. </script>
  22342. <Popup bind:visible size={0} transitionDistance={getTransitionDistance(title, showCancel, actions)} {onclose} {...popup}>
  22343. {#if title}
  22344. <div
  22345. class="flex h-10 flex-col justify-center truncate border-b border-black/5 text-xs text-black/50 dark:border-white/5 dark:text-white/50 {STYLE_MAPS
  22346. .titleAlign[titleAlign] || STYLE_MAPS.titleAlign['left']}"
  22347. >
  22348. {title}
  22349. </div>
  22350. {/if}
  22351. <div>
  22352. {#each actions as item, index}
  22353. <button
  22354. class="{item.style !== 'disabled'
  22355. ? 'active:scale-90 '
  22356. : 'cursor-not-allowed '}transition-all flex w-full items-center gap-2 {STYLE_MAPS.align[align] || STYLE_MAPS.align['center']}"
  22357. disabled={item.style === 'disabled'}
  22358. onclick={() => handleActionClick(index, item)}
  22359. >
  22360. {#if item.showImg}
  22361. <div class="h-6 w-6 overflow-hidden {(item.imgRadius && STYLE_MAPS.imgRadius[item.imgRadius]) || 'rounded-full'}">
  22362. <img class="h-full w-full object-cover" src={item.imgSrc} alt="" />
  22363. </div>
  22364. {/if}
  22365. <div>
  22366. <div
  22367. class="truncate text-center font-bold {(item.style && STYLE_MAPS.state[item.style]) ||
  22368. STYLE_MAPS.state.normal} flex flex-col justify-center {item.desc ? ' h-10' : ' h-14'}"
  22369. >
  22370. {item.content}
  22371. </div>
  22372. {#if item.desc}
  22373. <div class="truncate pb-1 text-center text-xs text-black/50 dark:text-white/40">
  22374. {item.desc}
  22375. </div>
  22376. {/if}
  22377. </div>
  22378. </button>
  22379. {#if index !== actions.length - 1}
  22380. <div class="h-px w-full bg-black/5 dark:bg-white/5"></div>
  22381. {/if}
  22382. {/each}
  22383. </div>
  22384. {#if showCancel}
  22385. <div class="h-2 bg-black/5 dark:bg-white/5"></div>
  22386. <button
  22387. class="flex h-12 w-full items-center transition-all active:scale-90 {STYLE_MAPS.align[align] || STYLE_MAPS.align['center']}"
  22388. onclick={handleCancel}
  22389. >
  22390. <div>
  22391. {cancelText}
  22392. </div>
  22393. </button>
  22394. {/if}
  22395. </Popup>
  22396. ================================================
  22397. FILE: packages/stdf/src/lib/components/asyncPicker/AsyncPicker.svelte
  22398. ================================================
  22399. <script lang="ts">
  22400. import { getContext } from 'svelte';
  22401. import { fly } from 'svelte/transition';
  22402. import Popup from '../popup/Popup.svelte';
  22403. import Loading from '../loading/Loading.svelte';
  22404. import ScrollRadio from '../scrollRadio/ScrollRadio.svelte';
  22405. import type { AsyncPickerProps } from '../../types/index.js';
  22406. import { zh_CN, type LangProps } from '../../lang/index.js';
  22407. // 当前语言
  22408. // current language
  22409. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  22410. const asyncPickerLang: LangProps['asyncPicker'] = currentLang.asyncPicker;
  22411. let {
  22412. visible = $bindable(false),
  22413. data = $bindable([]),
  22414. lastLevel = $bindable(false),
  22415. firstLevel = $bindable(true),
  22416. showRow = 5,
  22417. labelKey = $bindable('label'),
  22418. align = 'center',
  22419. cancelText = asyncPickerLang.defaultCancel,
  22420. confirmText = asyncPickerLang.defaultConfirm,
  22421. title = $bindable(asyncPickerLang.defaultTitle),
  22422. nextText = asyncPickerLang.defaultNext,
  22423. prevText = asyncPickerLang.defaultPrev,
  22424. showSelected = false,
  22425. selectedText = asyncPickerLang.defaultSelected,
  22426. popup = {},
  22427. loading = {},
  22428. oncancel,
  22429. onprev,
  22430. onconfirm,
  22431. onnext,
  22432. onclose
  22433. }: AsyncPickerProps = $props();
  22434. // 用于存储当前选定的所有项和索引
  22435. // Used to store all selected items and indexes
  22436. let items: Record<string, unknown>[] = $state([]);
  22437. let indexs: number[] = $state([]);
  22438. // 当前选中项索引
  22439. // Current selected item index
  22440. let currentIndex = $state(0);
  22441. // 点击左侧按钮
  22442. // Click left button
  22443. const clickLeftFunc = () => {
  22444. if (firstLevel) {
  22445. visible = false;
  22446. oncancel?.();
  22447. } else {
  22448. items = items.slice(0, items.length - 1);
  22449. indexs.pop();
  22450. data = [];
  22451. setTimeout(() => {
  22452. onprev?.();
  22453. currentIndex = 0;
  22454. });
  22455. }
  22456. };
  22457. // 点击右侧按钮,如果是最后一列,则触发 confirm 事件,否则触发 next 事件
  22458. // Click the right button, if it is the last column, trigger the confirm event, otherwise trigger the next event
  22459. const clickRightFunc = () => {
  22460. if (lastLevel) {
  22461. items.push(data[currentIndex]);
  22462. indexs.push(currentIndex);
  22463. data = [];
  22464. visible = false;
  22465. onclose?.();
  22466. currentIndex = 0;
  22467. onconfirm?.(items as [], indexs);
  22468. } else {
  22469. items = [...items, data[currentIndex]];
  22470. indexs.push(currentIndex);
  22471. indexs = indexs;
  22472. data = [];
  22473. setTimeout(() => {
  22474. onnext?.(currentIndex);
  22475. currentIndex = 0;
  22476. });
  22477. }
  22478. };
  22479. // 滚动结束
  22480. // Scroll end
  22481. const scrollEndFunc = (index: number) => {
  22482. currentIndex = index;
  22483. };
  22484. let isLoading = $derived(data.length === 0);
  22485. </script>
  22486. <Popup
  22487. bind:visible
  22488. size={0}
  22489. maskClosable
  22490. transitionDistance={(showRow === 3 ? 64 : showRow === 5 ? 48 : 32) * showRow + 41 + (showSelected ? 32 : 0)}
  22491. {...popup}
  22492. >
  22493. <div class="flex items-center justify-between border-b border-black/10 bg-white dark:border-white/20 dark:bg-black">
  22494. <button
  22495. class="h-10 px-4 leading-10 text-black/60 dark:text-white/60"
  22496. onclick={() => {
  22497. if (!isLoading) clickLeftFunc();
  22498. }}
  22499. >
  22500. {#if isLoading}
  22501. <div class="p-3">
  22502. <Loading width="4" height="4" customColor={['#666']} />
  22503. </div>
  22504. {:else}
  22505. {firstLevel ? cancelText : prevText}
  22506. {/if}
  22507. </button>
  22508. <div>{title}</div>
  22509. <button
  22510. class="text-primary dark:text-dark h-10 px-4 leading-10"
  22511. onclick={() => {
  22512. if (!isLoading) clickRightFunc();
  22513. }}
  22514. >
  22515. {#if isLoading}
  22516. <div class="p-3">
  22517. <Loading width="4" height="4" theme />
  22518. </div>
  22519. {:else}
  22520. {lastLevel ? confirmText : nextText}
  22521. {/if}
  22522. </button>
  22523. </div>
  22524. {#if showSelected}
  22525. <div class="flex w-full gap-3 overflow-x-hidden bg-white px-4 dark:bg-black">
  22526. <div class="h-8 flex-none text-center text-sm leading-8 text-black/60 dark:text-white/60">
  22527. {selectedText}
  22528. </div>
  22529. {#each items as item}
  22530. {#if !isLoading}
  22531. <div
  22532. in:fly|global={{ x: document.documentElement.clientWidth, duration: 500 }}
  22533. out:fly|global={{ x: document.documentElement.clientWidth, duration: 300 }}
  22534. class="h-8 flex-1 truncate px-1 text-center text-sm leading-8"
  22535. >
  22536. {item[labelKey]}
  22537. </div>
  22538. {/if}
  22539. {/each}
  22540. </div>
  22541. {/if}
  22542. <div class="bg-white dark:bg-black">
  22543. <div class="truncate">
  22544. {#if isLoading}
  22545. <div class="flex items-center justify-center" style="height:{(showRow === 3 ? 64 : showRow === 5 ? 48 : 32) * showRow}px">
  22546. <Loading width="28" height="8" type="1_16" theme {...loading} />
  22547. </div>
  22548. {:else}
  22549. <div>
  22550. <ScrollRadio
  22551. data={data as Record<string, string>[]}
  22552. {showRow}
  22553. {labelKey}
  22554. {align}
  22555. autoScrollToLast={false}
  22556. onscrollEnd={scrollEndFunc}
  22557. />
  22558. </div>
  22559. {/if}
  22560. </div>
  22561. </div>
  22562. </Popup>
  22563. ================================================
  22564. FILE: packages/stdf/src/lib/components/avatar/Avatar.svelte
  22565. ================================================
  22566. <script lang="ts">
  22567. import Icon from '../icon/Icon.svelte';
  22568. import type { AvatarProps } from '../../types/index.js';
  22569. let {
  22570. image = '',
  22571. alt = '',
  22572. icon = {},
  22573. altSize = 'md',
  22574. radius = 'sm',
  22575. size = 'base',
  22576. imgSize = 'l',
  22577. line = 'none',
  22578. injClass = '',
  22579. onclick
  22580. }: AvatarProps = $props();
  22581. // 圆角风格样式
  22582. // radius style
  22583. const radiusObj = {
  22584. none: 'rounded-none',
  22585. sm: 'rounded-sm',
  22586. xl: 'rounded-xl',
  22587. '2xl': 'rounded-2xl',
  22588. '3xl': 'rounded-3xl',
  22589. full: 'rounded-full'
  22590. };
  22591. // 头像框大小样式
  22592. // avatar size style
  22593. const sizeObj = {
  22594. xs: 'w-6 h-6',
  22595. sm: 'w-10 h-10',
  22596. base: 'w-12 h-12',
  22597. md: 'w-16 h-16',
  22598. lg: 'w-20 h-20',
  22599. xl: 'w-28 h-28',
  22600. '2xl': 'w-32 h-32'
  22601. };
  22602. // 头像图片大小样式
  22603. // avatar image size style
  22604. const imgSizeObj = { s: 'h-1/3 w-1/3', m: 'h-2/3 w-2/3', l: 'h-full w-full' };
  22605. // 边框风格样式
  22606. // border style
  22607. const lineObj = {
  22608. none: ' ',
  22609. solid: ' border border-solid border-primary dark:border-dark',
  22610. dashed: ' border border-dashed border-primary dark:border-dark',
  22611. dotted: ' border border-dotted border-primary dark:border-dark'
  22612. };
  22613. // 替换文本大小样式
  22614. // replace text size style
  22615. const altSizeObj = {
  22616. xs: 'text-base',
  22617. sm: 'text-2xl',
  22618. md: 'text-4xl',
  22619. lg: 'text-6xl',
  22620. xl: 'text-8xl'
  22621. };
  22622. // 当默认情况时根据 size 计算 Icon 大小
  22623. // when default, calculate Icon size by size
  22624. const iconSizeObj = { xs: 12, sm: 20, base: 24, md: 32, lg: 40, xl: 56, '2xl': 64 };
  22625. </script>
  22626. <button
  22627. class="bg-primary-200 dark:bg-dark-200 flex justify-center overflow-hidden relative{lineObj[line] || ''} {sizeObj[size] ||
  22628. sizeObj.md} {radiusObj[radius] || radiusObj.sm} {injClass}"
  22629. onclick={() => onclick && onclick()}
  22630. >
  22631. {#if image === '' && alt === ''}
  22632. <div class="m-auto">
  22633. <Icon
  22634. size={iconSizeObj[size] || iconSizeObj.base}
  22635. name="ri-user-3-line"
  22636. theme
  22637. {...icon}
  22638. injClass="text-primary-950 dark:text-dark-950"
  22639. />
  22640. </div>
  22641. {:else if image === '' && alt !== ''}
  22642. <div
  22643. class="text-primary-950 dark:text-dark-950 text-center {altSizeObj[altSize] || altSizeObj.md}"
  22644. style="position: absolute;top: 50%;left:50%;transform: translate(-50%, -50%);"
  22645. >
  22646. {alt}
  22647. </div>
  22648. {:else}
  22649. <div class="m-auto text-center">
  22650. <img
  22651. src={image}
  22652. class="inline-block object-cover {imgSizeObj[imgSize] || imgSizeObj.l}"
  22653. alt=""
  22654. style="position: absolute;top: 50%;left:50%;transform: translate(-50%, -50%);"
  22655. />
  22656. </div>
  22657. {/if}
  22658. </button>
  22659. ================================================
  22660. FILE: packages/stdf/src/lib/components/avatar/Avatars.svelte
  22661. ================================================
  22662. <script lang="ts">
  22663. import Avatar from './Avatar.svelte';
  22664. import Icon from '../icon/Icon.svelte';
  22665. import type { AvatarsProps } from '../../types/index.js';
  22666. let {
  22667. data = [],
  22668. radius = 'full',
  22669. size = 'base',
  22670. compact = 5,
  22671. lineWidth = '3',
  22672. reverse = false,
  22673. max = 10,
  22674. top = 'totle',
  22675. injClass = '',
  22676. onclick
  22677. }: AvatarsProps = $props();
  22678. // 圆角风格样式
  22679. // radius style
  22680. const radiusObj = {
  22681. none: 'rounded-none',
  22682. sm: 'rounded-sm',
  22683. xl: 'rounded-xl',
  22684. '2xl': 'rounded-2xl',
  22685. '3xl': 'rounded-3xl',
  22686. full: 'rounded-full'
  22687. };
  22688. // 边框粗细样式
  22689. // border width style
  22690. const lineWidthClass = {
  22691. 0: 'ring-0',
  22692. 1: 'ring-1',
  22693. 2: 'ring-2',
  22694. 3: 'ring',
  22695. 4: 'ring-4',
  22696. 8: 'ring-8'
  22697. };
  22698. // 头像框大小样式
  22699. // avatar size style
  22700. const sizeObj = {
  22701. xs: 'w-6 h-6',
  22702. sm: 'w-10 h-10',
  22703. base: 'w-12 h-12',
  22704. md: 'w-16 h-16',
  22705. lg: 'w-20 h-20',
  22706. xl: 'w-28 h-28',
  22707. '2xl': 'w-32 h-32'
  22708. };
  22709. // 替换文本大小样式
  22710. // replace text size style
  22711. const textSizeObj = {
  22712. xs: 'text-xs',
  22713. sm: 'text-sm',
  22714. base: 'text-lg',
  22715. md: 'text-3xl',
  22716. lg: 'text-4xl',
  22717. xl: 'text-6xl',
  22718. '2xl': 'text-8xl'
  22719. };
  22720. const dataInner = data.slice(0, max);
  22721. </script>
  22722. <button class="flex" onclick={() => onclick && onclick()}>
  22723. {#if reverse}
  22724. <div
  22725. class="relative {lineWidthClass[lineWidth] || lineWidthClass[2]} ring-primaryWhite dark:ring-darkBlack {radiusObj[radius] ||
  22726. radiusObj.sm} {injClass}"
  22727. style="z-index:{dataInner.length}"
  22728. >
  22729. {#if top === 'totle'}
  22730. <div
  22731. class="bg-primary-200 dark:bg-dark-200 text-primary-950 dark:text-dark-950 flex flex-col justify-center overflow-hidden text-center {radiusObj[
  22732. radius
  22733. ] || radiusObj.sm} {sizeObj[size] || sizeObj.md} {textSizeObj[size] || textSizeObj.base}"
  22734. >
  22735. +{data.length}
  22736. </div>
  22737. {:else if top === 'add'}
  22738. <div
  22739. class="bg-primary-200 dark:bg-dark-200 flex flex-col justify-center overflow-hidden text-center {radiusObj[radius] ||
  22740. radiusObj.sm} {sizeObj[size] || sizeObj.md} {textSizeObj[size] || textSizeObj.base}"
  22741. >
  22742. <Icon name="ri-user-add-line" injClass="text-primary-950 dark:text-dark-950" />
  22743. </div>
  22744. {:else if top === null}{:else}
  22745. {@render top?.()}
  22746. {/if}
  22747. </div>
  22748. {/if}
  22749. {#each dataInner as item, i}
  22750. <div
  22751. class="relative {lineWidthClass[lineWidth] || lineWidthClass[2]} ring-primaryWhite dark:ring-darkBlack {radiusObj[radius] ||
  22752. radiusObj.sm} {injClass}"
  22753. style="transform: translateX({-compact * 10 * i - (reverse ? 50 : 0)}%);z-index:{reverse ? dataInner.length - 1 - i : i}"
  22754. >
  22755. <Avatar {radius} {size} {...item} />
  22756. </div>
  22757. {/each}
  22758. {#if !reverse}
  22759. <div
  22760. class="relative {lineWidthClass[lineWidth] || lineWidthClass[2]} ring-primaryWhite dark:ring-darkBlack {radiusObj[radius] ||
  22761. radiusObj.sm} {injClass}"
  22762. style="transform: translateX(-{compact * 10 * dataInner.length}%);z-index:{dataInner.length}"
  22763. >
  22764. {#if top === 'totle'}
  22765. <div
  22766. class="bg-primary-200 dark:bg-dark-200 text-primary-950 dark:text-dark-950 flex flex-col justify-center overflow-hidden text-center {radiusObj[
  22767. radius
  22768. ] || radiusObj.sm} {sizeObj[size] || sizeObj.md} {textSizeObj[size] || textSizeObj.base}"
  22769. >
  22770. +{data.length}
  22771. </div>
  22772. {:else if top === 'add'}
  22773. <div
  22774. class="bg-primary-200 dark:bg-dark-200 flex flex-col justify-center overflow-hidden text-center {radiusObj[radius] ||
  22775. radiusObj.sm} {sizeObj[size] || sizeObj.md} {textSizeObj[size] || textSizeObj.base}"
  22776. >
  22777. <Icon name="ri-user-add-line" injClass="text-primary-950 dark:text-dark-950" />
  22778. </div>
  22779. {:else if top === null}{:else}
  22780. {@render top?.()}
  22781. {/if}
  22782. </div>
  22783. {/if}
  22784. </button>
  22785. ================================================
  22786. FILE: packages/stdf/src/lib/components/badge/Badge.svelte
  22787. ================================================
  22788. <script lang="ts">
  22789. import type { BadgeProps } from '../../types/index.js';
  22790. let {
  22791. text = '',
  22792. radius = 'full',
  22793. isLeft = false,
  22794. isShow = true,
  22795. offsetY = 0,
  22796. offsetX = 0,
  22797. isInner = false,
  22798. injClass = '',
  22799. children
  22800. }: BadgeProps = $props();
  22801. // 圆角风格样式
  22802. // radius style
  22803. const radiusObj = {
  22804. full: ' rounded-full',
  22805. sm: ' rounded-sm',
  22806. none: ' rounded-none',
  22807. leftLeaf: ' rounded-full rounded-br-none',
  22808. rightLeaf: ' rounded-full rounded-bl-none'
  22809. };
  22810. // 通过 radius 配置圆角风格或叶形
  22811. // set radius style or leaf style by radius
  22812. const radiusClass = radius === 'leaf' ? (isLeft ? radiusObj.leftLeaf : radiusObj.rightLeaf) : radiusObj[radius] || radiusObj.full;
  22813. </script>
  22814. {#if isInner}
  22815. <div
  22816. class="px-1 text-xs text-white whitespace-nowrap{radiusClass}{text === ''
  22817. ? ' h-3 w-3'
  22818. : ' '} text-center leading-4 transition-all bg-[red]{injClass === '' ? '' : ` ${injClass}`}"
  22819. style="transform:{isShow ? ' scale(1)' : ' scale(0)'}"
  22820. >
  22821. {text}
  22822. </div>
  22823. {:else}
  22824. <div class="relative">
  22825. {@render children?.()}
  22826. <div
  22827. class="absolute{text === '' ? ' -top-1.5' : ' -top-2'}{isLeft
  22828. ? ' left-0'
  22829. : ' right-0'} px-1 text-xs text-white whitespace-nowrap{radiusClass}{text === ''
  22830. ? ' h-3 w-3'
  22831. : ' '} text-center leading-4 transition-all bg-[red]{injClass === '' ? '' : ` ${injClass}`}"
  22832. style="transform: translateX(calc({isLeft ? '-' : ''}50% {isLeft ? '+' : '-'} {offsetX}px)) translateY({offsetY}px){isShow
  22833. ? ' scale(1)'
  22834. : ' scale(0)'}"
  22835. >
  22836. {text}
  22837. </div>
  22838. </div>
  22839. {/if}
  22840. ================================================
  22841. FILE: packages/stdf/src/lib/components/bottomSheet/BottomSheet.svelte
  22842. ================================================
  22843. <script lang="ts">
  22844. import { onMount, getContext } from 'svelte';
  22845. import { fly } from 'svelte/transition';
  22846. import { throttleWithRAF } from '../utils/index.js';
  22847. import Mask from '../mask/Mask.svelte';
  22848. import Icon from '../icon/Icon.svelte';
  22849. import { zh_CN, type LangProps } from '../../lang/index.js';
  22850. import type { BottomSheetProps } from '../../types/index.js';
  22851. // 当前语言
  22852. // current language
  22853. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  22854. const bottomSheetLang: LangProps['bottomSheet'] = currentLang.bottomSheet;
  22855. let {
  22856. visible = $bindable(false),
  22857. title = bottomSheetLang.title,
  22858. titleAlign = 'left',
  22859. showBackIcon = false,
  22860. closeContent = 'downIcon',
  22861. showDivider = true,
  22862. duration = 450,
  22863. outDuration = 240,
  22864. mask = {},
  22865. maskClosable = false,
  22866. zIndex = 600,
  22867. stayHeightList = [10, 50, 90],
  22868. stayHeightIndex = 1,
  22869. closeHeight = 0,
  22870. radius = 'full',
  22871. children,
  22872. onheightChange,
  22873. onclickMask,
  22874. onclose,
  22875. onback
  22876. }: BottomSheetProps = $props();
  22877. // 固定高度
  22878. // stay height
  22879. let stayHeight = stayHeightList[stayHeightIndex] || stayHeightList[stayHeightList.length - 1];
  22880. // 此时是否正在滑动
  22881. // is sliding or not now
  22882. let isTouch = $state(false);
  22883. // 滑动开始 Y 坐标,px
  22884. // start Y coordinate, px
  22885. let startY = 0;
  22886. // 滑动中 Y 方向当前位置,px
  22887. // current Y coordinate, px
  22888. let currentY = 0;
  22889. // 滑动开始距离顶部高度,%
  22890. // start distance from top, %
  22891. let startTop = $state(100 - stayHeight);
  22892. // 滑动距离,%
  22893. // move distance, %
  22894. let moveDistance = $state(0);
  22895. // 顶部滚动区域高度,%
  22896. // top scroll area height, %
  22897. let scrollTopHeight = $state(5);
  22898. // 顶部滚动区域元素
  22899. // top scroll area element
  22900. let scrollTopDom = $state<HTMLDivElement | null>(null);
  22901. // 当前距离顶部高度,%
  22902. // current distance from top, %
  22903. let currentTop = $state(0);
  22904. $effect(() => {
  22905. currentTop = startTop + moveDistance;
  22906. });
  22907. // 如果 stayHeightList 不是数组,或者元素不是正数,或者元素不是 0-100 之间的数,或者元素不是整数,给出警告。
  22908. // If stayHeightList is not an array, or the element is not a positive number, or the element is not a number between 0 and 100, or the element is not an integer, give a warning.
  22909. if (
  22910. !Array.isArray(stayHeightList) ||
  22911. stayHeightList.some((item) => typeof item !== 'number' || item < 0 || item > 100 || item % 1 !== 0)
  22912. ) {
  22913. console.error(
  22914. '[STDF BottomSheet error]stayHeightList 必须是一个 0-100 之间的正整数数组。(stayHeightList must be an array of positive integers between 0 and 100)'
  22915. );
  22916. }
  22917. // 如果 stayHeightList 元素不是递增的,给出警告。
  22918. // If the elements of stayHeightList are not increasing, give a warning.
  22919. if (stayHeightList.some((item, index) => index > 0 && item <= stayHeightList[index - 1])) {
  22920. console.error(
  22921. '[STDF BottomSheet error]stayHeightList 数组元素必须是升序排列。(stayHeightList array elements must be in ascending order)'
  22922. );
  22923. }
  22924. // 如果 stayHeightIndex 超出 stayHeightList 长度给出警告。
  22925. // If stayHeightIndex exceeds the length of stayHeightList, give a warning.
  22926. if (stayHeightIndex > stayHeightList.length - 1) {
  22927. console.warn(
  22928. '[STDF BottomSheet warn]stayHeightIndex 超出 stayHeightList 长度,将使用 stayHeightList 最后一个值。(stayHeightIndex exceeds the length of stayHeightList, the last value of stayHeightList will be used.)'
  22929. );
  22930. }
  22931. // 如果 closeHeight 大于 stayHeightList 最小值给出警告。
  22932. // If closeHeight is greater than the minimum value of stayHeightList, give a warning.
  22933. if (closeHeight > stayHeightList[0]) {
  22934. console.warn(
  22935. '[STDF BottomSheet warn]closeHeight 大于 stayHeightList 最小值,closeHeight 将失效。(closeHeight is greater than the minimum value of stayHeightList, closeHeight will be invalid.)'
  22936. );
  22937. }
  22938. // 标题对齐方式
  22939. // title align
  22940. const titleAlignClass = { left: ' text-left', center: ' text-center', right: ' text-right' };
  22941. // 窗口圆角风格
  22942. // window radius style
  22943. const windowRadiusClass = { none: ' rounded-none', middle: ' rounded-t-lg', full: ' rounded-t-2xl' };
  22944. // 图标圆角风格
  22945. // icon radius style
  22946. const iconRadiusClass = { none: ' rounded-none', middle: ' rounded-sm', full: ' rounded-full' };
  22947. // 滑动开始
  22948. // start sliding
  22949. /** @type {(e:PointerEvent) => void} */
  22950. const touchstartFun = (e: PointerEvent) => {
  22951. moveDistance = 0;
  22952. startTop = currentTop;
  22953. startY = e.clientY;
  22954. isTouch = true;
  22955. };
  22956. // 滑动中
  22957. // sliding
  22958. /** @type {(e:PointerEvent) => void} */
  22959. const touchmoveFun = (e: PointerEvent) => {
  22960. if (!isTouch) return;
  22961. scrollTopDom?.setPointerCapture(e.pointerId);
  22962. currentY = e.clientY;
  22963. //移动百分比,moveDistance 为正时,向下移动
  22964. //Move percentage, moveDistance is positive when moving down
  22965. moveDistance = ((currentY - startY) / window.innerHeight) * 100;
  22966. //处理向上滑动时超过最大高度情况
  22967. //Handle the case when the maximum height is exceeded when sliding up
  22968. if (moveDistance + startTop < 100 - stayHeightList[stayHeightList.length - 1]) {
  22969. moveDistance = 100 - stayHeightList[stayHeightList.length - 1] - startTop;
  22970. }
  22971. };
  22972. // 滑动结束
  22973. // end sliding
  22974. const touchendFun = () => {
  22975. isTouch = false;
  22976. //计算出每个高度对应的 top 值
  22977. //Calculate the top value corresponding to each height
  22978. let toTopList = stayHeightList.map((item) => 100 - item);
  22979. let min = 100;
  22980. let currentIndex = 0;
  22981. toTopList.forEach((item, index) => {
  22982. if (Math.abs(item - currentTop) < min) {
  22983. min = Math.abs(item - currentTop);
  22984. currentIndex = index;
  22985. }
  22986. });
  22987. currentTop = toTopList[currentIndex];
  22988. //派发事件,传递当前高度
  22989. //Dispatch events and pass the current
  22990. if (onheightChange) {
  22991. onheightChange(stayHeightList[currentIndex]);
  22992. }
  22993. //判断滑动结束时如果位置低于 closeHeight 自动关闭,并派发事件
  22994. //If the position is lower than closeHeight at the end of the slide, it will be automatically closed and the event will be dispatched.
  22995. if (((window.innerHeight - currentY) / window.innerHeight) * 100 < closeHeight && closeHeight > 0) {
  22996. visible = false;
  22997. onclose?.();
  22998. }
  22999. };
  23000. //点击遮罩层
  23001. //click mask
  23002. const clickMaskFn = () => {
  23003. //点击遮罩时派发 clickMask 事件
  23004. //Dispatch clickMask event when clicking mask
  23005. onclickMask?.();
  23006. if (maskClosable) {
  23007. visible = false;
  23008. }
  23009. };
  23010. //点击关闭图标
  23011. //click close icon
  23012. const closeFunc = () => {
  23013. visible = false;
  23014. //点击关闭时派发 close 事件
  23015. //Dispatch close event when clicking close
  23016. onclose?.();
  23017. };
  23018. //点击返回图标
  23019. //click back icon
  23020. const backFunc = () => {
  23021. //点击返回时派发 back 事件
  23022. //Dispatch back event when clicking back
  23023. onback?.();
  23024. };
  23025. // 滚动时禁止 body 滚动
  23026. // Disable body scrolling when scrolling
  23027. $effect(() => {
  23028. if (visible) {
  23029. //当 visible 为 true 时,禁止 body 滚动
  23030. //When visible is true, body scrolling is disabled
  23031. const top = document.documentElement.scrollTop || document.body.scrollTop;
  23032. document.body.style.cssText += `
  23033. position: fixed;
  23034. width: 100vw;
  23035. left: 0;
  23036. top: ${-top}px;
  23037. touch-action:none;
  23038. `;
  23039. } else {
  23040. const top = document.body.style.top;
  23041. document.body.style.cssText += `
  23042. position: static;
  23043. touch-action:auto;
  23044. `;
  23045. window.scrollTo(0, Math.abs(parseFloat(top)));
  23046. }
  23047. });
  23048. onMount(() => {
  23049. if (visible && scrollTopDom) {
  23050. // 滚动内容高度
  23051. // Scroll content height
  23052. scrollTopHeight = scrollTopDom.clientHeight;
  23053. }
  23054. });
  23055. </script>
  23056. {#if visible}
  23057. <Mask visible {duration} {outDuration} {...mask} onclickMask={clickMaskFn} />
  23058. {/if}
  23059. <div class="pointer-events-none fixed inset-0 flex h-screen w-screen flex-col justify-end px-0" style="z-index:{zIndex};">
  23060. {#if visible}
  23061. <div
  23062. class="fixed w-screen bg-white dark:bg-gray-950{windowRadiusClass[radius] || windowRadiusClass['full']} pointer-events-auto{isTouch
  23063. ? ''
  23064. : ' transition-all duration-300'}"
  23065. style="height:{stayHeightList[stayHeightList.length - 1]}%;top:{currentTop}%"
  23066. in:fly={{
  23067. y: (stayHeightList[stayHeightList.length - 1] / 100) * window.innerHeight,
  23068. opacity: 1,
  23069. duration
  23070. }}
  23071. out:fly={{
  23072. y: (stayHeightList[stayHeightList.length - 1] / 100) * window.innerHeight,
  23073. opacity: 1,
  23074. duration: outDuration
  23075. }}
  23076. >
  23077. <div
  23078. onpointerdown={(e: PointerEvent) => touchstartFun(e)}
  23079. onpointermove={(e: PointerEvent) => throttleWithRAF(touchmoveFun)(e)}
  23080. onpointerup={touchendFun}
  23081. bind:this={scrollTopDom}
  23082. class="cursor-move touch-none select-none py-1"
  23083. >
  23084. <div class="h-1 w-8 bg-black/20 dark:bg-white/30 mx-auto{radius === 'none' ? ' rounded-none' : ' rounded-full'}"></div>
  23085. <div class="flex items-center justify-between gap-2 px-3 py-1">
  23086. {#if showBackIcon}
  23087. <button
  23088. class="h-6 w-6 flex-none bg-black/5 dark:bg-white/10 text-center{iconRadiusClass[radius] || iconRadiusClass['full']}"
  23089. onclick={backFunc}
  23090. >
  23091. <Icon name="ri-arrow-left-s-line" alpha={0.4} size={16} top={-2} />
  23092. </button>
  23093. {/if}
  23094. <div class="h-7 truncate text-lg font-bold grow{titleAlignClass[titleAlign] || titleAlignClass['left']}">
  23095. {title}
  23096. </div>
  23097. {#if closeContent === ''}
  23098. <!-- null -->
  23099. {:else if closeContent === 'closeIcon'}
  23100. <button
  23101. class="h-6 w-6 flex-none bg-black/5 dark:bg-white/10 text-center{iconRadiusClass[radius] || iconRadiusClass['full']}"
  23102. onclick={closeFunc}
  23103. >
  23104. <Icon name="ri-close-line" alpha={0.4} size={14} top={-2} />
  23105. </button>
  23106. {:else if closeContent === 'downIcon'}
  23107. <button
  23108. class="h-6 w-6 flex-none bg-black/5 dark:bg-white/10 text-center{iconRadiusClass[radius] || iconRadiusClass['full']}"
  23109. onclick={closeFunc}
  23110. >
  23111. <Icon name="ri-arrow-down-s-line" alpha={0.4} size={16} top={-1} />
  23112. </button>
  23113. {:else}
  23114. <button class="text-primary dark:text-dark cursor-pointer font-bold" onclick={closeFunc}>{closeContent}</button>
  23115. {/if}
  23116. </div>
  23117. </div>
  23118. {#if showDivider}
  23119. <div class="h-px w-full bg-black/5 dark:bg-white/10"></div>
  23120. {/if}
  23121. <div
  23122. class="overflow-auto"
  23123. style="height:{window.innerHeight * ((100 - currentTop) / 100) - scrollTopHeight}px;overscroll-behavior-y: contain;"
  23124. >
  23125. {@render children?.()}
  23126. </div>
  23127. </div>
  23128. {/if}
  23129. </div>
  23130. ================================================
  23131. FILE: packages/stdf/src/lib/components/button/Button.svelte
  23132. ================================================
  23133. <script lang="ts">
  23134. import Icon from '../icon/Icon.svelte';
  23135. import Loading from '../loading/Loading.svelte';
  23136. import type { ButtonProps } from '../../types/index.js';
  23137. let {
  23138. fill = 'base',
  23139. state = 'theme',
  23140. radius = 'sm',
  23141. size = 'big',
  23142. line = 'solid',
  23143. injClass = '',
  23144. love = false,
  23145. heightOut = '2',
  23146. heightIn = '3',
  23147. group = false,
  23148. disabled = false,
  23149. customSize = false,
  23150. customWidth = 0,
  23151. customHeight = 0,
  23152. icon = null,
  23153. loading = null,
  23154. disabledLoading = true,
  23155. type = 'button',
  23156. children,
  23157. onclick
  23158. }: ButtonProps = $props();
  23159. let innerDisabled = $derived(disabled || (loading && disabledLoading));
  23160. // 状态样式
  23161. // State style
  23162. const stateObj = { theme: 'bg-primary dark:bg-dark', success: 'bg-success', warning: 'bg-warning', error: 'bg-error', info: 'bg-info' };
  23163. // 圆角风格样式
  23164. // Corner style style
  23165. const radiusObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', '2xl': 'rounded-2xl', full: 'rounded-full' };
  23166. // 填充模式样式
  23167. // Fill mode style
  23168. const fillObj = {
  23169. base: '',
  23170. line: 'border border-black dark:border-white !text-black dark:!text-white',
  23171. lineLight: 'border border-black/20 dark:border-white/30 !text-black dark:!text-white',
  23172. lineTheme: 'border border-primary dark:border-dark !text-primary dark:!text-dark',
  23173. text: '!text-black dark:!text-white',
  23174. textTheme: '!text-primary dark:!text-dark',
  23175. colorLight: '!bg-black/5 dark:!bg-white/10 !text-black dark:!text-white'
  23176. };
  23177. // 尺寸样式
  23178. // Size style
  23179. const sizeObj = { full: 'w-full', big: 'w-full', md: 'w-1/2', sm: 'w-1/4', auto: 'w-auto' };
  23180. // 边框风格样式
  23181. // Border style style
  23182. const lineObj = { solid: 'border-solid', dashed: 'border-dashed', dotted: 'border-dotted' };
  23183. // 按钮外部高度样式
  23184. // Button outer height style
  23185. const heightOutObj = { '0': 'py-0', '1': 'py-1', '2': 'py-2', '3': 'py-3', '4': 'py-4' };
  23186. // 按钮高度样式
  23187. // Button height style
  23188. const heightInObj = { '0': 'py-0', '1': 'py-1', '2': 'py-2', '3': 'py-3', '4': 'py-4' };
  23189. // 是否块级元素
  23190. // Whether it is a block element
  23191. const block = (size === 'full' || size === 'big') && !customSize;
  23192. // 文字颜色
  23193. // Text color
  23194. const textColor = state === 'theme' ? 'text-white dark:text-black' : 'text-white';
  23195. </script>
  23196. <div
  23197. class="{heightOutObj[heightOut] || heightOutObj['2']} {size === 'big' && !customSize ? 'px-4' : 'px-0'} {block ? 'block' : 'inline'} {love
  23198. ? 'text-xl'
  23199. : ''}"
  23200. >
  23201. <button
  23202. {onclick}
  23203. class="inline-flex items-center justify-center gap-1 truncate {!group && !innerDisabled ? 'active:opacity-80' : ''} {heightInObj[
  23204. heightIn
  23205. ] || heightInObj['3']} {sizeObj[size] || sizeObj.big} {textColor} {lineObj[line] || lineObj.solid} {radiusObj[radius] ||
  23206. radiusObj.sm} {fill === 'base' && (stateObj[state] || stateObj.theme)} {fillObj[fill] || fillObj.base} {injClass} {innerDisabled
  23207. ? 'cursor-not-allowed opacity-50'
  23208. : ''}"
  23209. disabled={innerDisabled}
  23210. style={customSize ? `width:${customWidth}px;height:${customHeight}px;padding:0;` : ''}
  23211. {type}
  23212. >
  23213. {#if loading}
  23214. <Loading {...loading} />
  23215. {/if}
  23216. {#if icon && icon.name}
  23217. <Icon {...icon} />
  23218. {/if}
  23219. {@render children?.()}
  23220. </button>
  23221. </div>
  23222. ================================================
  23223. FILE: packages/stdf/src/lib/components/calendar/Calendar.svelte
  23224. ================================================
  23225. <script lang="ts">
  23226. import { getContext } from 'svelte';
  23227. import Popup from '../popup/Popup.svelte';
  23228. import Button from '../button/Button.svelte';
  23229. import {
  23230. getNowBeforeOrAfterMonth,
  23231. getCalendarData,
  23232. getMonthListRange,
  23233. getDateRange,
  23234. getCurrentWeek,
  23235. getCurrentMonth,
  23236. getCurrentQuarter,
  23237. getDaysRangeWithToday
  23238. } from '../utils/index.js';
  23239. import { zh_CN, type LangProps } from '../../lang/index.js';
  23240. import type { CalendarProps } from '../../types/index.js';
  23241. // 当前语言
  23242. // current language
  23243. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  23244. const calendarLang: LangProps['calendar'] = currentLang.calendar;
  23245. let {
  23246. visible = $bindable(false),
  23247. startMonth = getNowBeforeOrAfterMonth(-6),
  23248. endMonth = getNowBeforeOrAfterMonth(6),
  23249. initMonth = getNowBeforeOrAfterMonth(0),
  23250. mode = 'single',
  23251. startSunday = false,
  23252. weekendRed = false,
  23253. monthCard = true,
  23254. monthMark = false,
  23255. monthMarkSize = '7xl',
  23256. height = 50,
  23257. infoDates = [],
  23258. disabledDates = [],
  23259. radius = 'xl',
  23260. showSelectedDay = true,
  23261. confirmText = calendarLang.confirmText,
  23262. selectedText = calendarLang.selectedText,
  23263. dayText = calendarLang.dayText,
  23264. quickSelects = [],
  23265. includeToday = false,
  23266. useAnimation = true,
  23267. highlightToday = true,
  23268. outFormat = 'YYYYMMDD',
  23269. popup = {},
  23270. button = {},
  23271. clear = true,
  23272. onconfirm,
  23273. onclose
  23274. }: CalendarProps = $props();
  23275. // 圆角风格样式
  23276. // Rounded style style
  23277. const radiusClass = { sm: 'rounded-sm', xl: 'rounded-xl', '2xl': 'rounded-2xl', none: 'rounded-none' };
  23278. // 月份水印文字大小样式
  23279. // Month watermark text size style
  23280. const monthMarkSizeClass = {
  23281. '3xl': 'text-3xl',
  23282. '4xl': 'text-4xl',
  23283. '5xl': 'text-5xl',
  23284. '6xl': 'text-6xl',
  23285. '7xl': 'text-7xl',
  23286. '8xl': 'text-8xl',
  23287. '9xl': 'text-9xl'
  23288. };
  23289. // 当天日期字符串,YYYYMMDD,日和天不足两位时前面补 0
  23290. // Today's date string, YYYYMMDD, day and day are not less than two digits, and 0 is filled in front
  23291. const now = new Date();
  23292. const nowYear = now.getFullYear();
  23293. const nowMonth = now.getMonth() + 1;
  23294. const nowDay = now.getDate();
  23295. const todayStr = `${nowYear}${nowMonth < 10 ? '0' + nowMonth : nowMonth}${nowDay < 10 ? '0' + nowDay : nowDay}`;
  23296. // 滚动元素
  23297. // Scroll element
  23298. let scrollElement = $state<HTMLDivElement | null>(null);
  23299. // 是否点击了快速选择
  23300. // Whether to click the quick selection
  23301. let isQuickSelect = $state(false);
  23302. // 定义周数据文字
  23303. // Define the week data text
  23304. const weekTexts = startSunday ? calendarLang.weekSundayStartTextList : calendarLang.weekTextList;
  23305. // 传入 startSunday 和位于周的索引,返回是否是周末
  23306. // Pass in startSunday and the index of the week, and return whether it is a weekend
  23307. const isWeekendFunc = (startSunday: boolean, index: number) => {
  23308. if (startSunday) {
  23309. return index === 0 || index === 6;
  23310. } else {
  23311. return index === 5 || index === 6;
  23312. }
  23313. };
  23314. // 根据 startMonth 和 endMonth 将月份数据组成 monthList
  23315. // According to startMonth and endMonth, the month data is assembled into monthList
  23316. const monthList = getMonthListRange(startMonth, endMonth);
  23317. // 如果 initMonth 在 startMonth 和 endMonth 之间 initMonthIndex 为 initMonth 在 monthList 中的索引,如果在 startMonth 之前,initMonthIndex 为 0,如果在 endMonth 之后,initMonthIndex 为 monthList.length - 1
  23318. // If initMonth is between startMonth and endMonth, initMonthIndex is the index of initMonth in monthList. If it is before startMonth, initMonthIndex is 0. If it is after endMonth, initMonthIndex is monthList.length - 1
  23319. const initMonthIndex = monthList.findIndex((item) => item === initMonth);
  23320. // 循环 monthList,根据每个月份的数据,生成全部的日历数据,其中 month 为当前月,year 为年,data 为日期数组
  23321. // Loop monthList, generate all calendar data according to the data of each month, where month is the current month, year is the year, and data is the date array
  23322. const allMonthData: {
  23323. year: string;
  23324. month: string;
  23325. days: { text: string; info?: string; disabled?: boolean; start?: boolean; end?: boolean }[];
  23326. }[] = monthList.map((monthStr) => ({
  23327. year: monthStr.slice(0, 4),
  23328. month: monthStr.slice(4),
  23329. days: getCalendarData(monthStr, startSunday).map((item) => ({
  23330. text: item,
  23331. info: '',
  23332. disabled: false,
  23333. start: false,
  23334. end: false
  23335. }))
  23336. }));
  23337. // 如果 infoDates 不为空,循环 allMonthData,循环 data,循环 infoDates,如果 infoDates 中的日期和 data 中的日期相同,将 infoDates 中的 info 赋值给 data 中的 info
  23338. // If infoDates is not empty, loop allMonthData, loop data, loop infoDates, if the date in infoDates is the same as the date in data, assign the info in infoDates to the info in data
  23339. if (infoDates.length > 0) {
  23340. allMonthData.forEach((monthData) => {
  23341. monthData.days.forEach((item) => {
  23342. infoDates.forEach((info) => {
  23343. if (info.text === monthData.year + monthData.month + item.text) {
  23344. item.info = info.info;
  23345. }
  23346. });
  23347. });
  23348. });
  23349. }
  23350. // 如果 disabledDates 不为空,循环 allMonthData,循环 data,循环 disabledDates,如果 disabledDates 中的日期和 data 中的日期相同,将 disabledDates 中的 disabled 赋值给 data 中的 disabled
  23351. // If disabledDates is not empty, loop allMonthData, loop data, loop disabledDates, if the date in disabledDates is the same as the date in data, assign the disabled in disabledDates to the disabled in data
  23352. if (disabledDates.length > 0) {
  23353. allMonthData.forEach((monthData) => {
  23354. monthData.days.forEach((item) => {
  23355. disabledDates.forEach((disabled) => {
  23356. if (disabled === monthData.year + monthData.month + item.text) {
  23357. item.disabled = true;
  23358. }
  23359. });
  23360. });
  23361. });
  23362. }
  23363. // 选中的日期
  23364. // Selected date
  23365. let selectedDate: string[] = $state([]);
  23366. // 范围选择时,点击的开始与结束
  23367. // When range selection is clicked, the beginning and end are clicked
  23368. let rangeArr: string[] = [];
  23369. // selectedDate 字符串
  23370. // selectedDate string
  23371. let selectedDateStr = $state('');
  23372. // 点击日期事件
  23373. // Click date event
  23374. const clickDayFunc = (
  23375. year: string,
  23376. month: string,
  23377. days: { text: string; info?: string; disabled?: boolean; start?: boolean; end?: boolean }
  23378. ) => {
  23379. if (!days.text) {
  23380. return;
  23381. }
  23382. if (isQuickSelect) {
  23383. isQuickSelect = false;
  23384. selectedDate = [];
  23385. }
  23386. if (mode === 'range') {
  23387. rangeArr.push(`${year}${month}${days.text}`);
  23388. if (rangeArr.length === 2) {
  23389. // 将 rangeArr 排序,保证第一个日期小于第二个日期
  23390. // Sort rangeArr to ensure that the first date is less than the second date
  23391. rangeArr.sort((a, b) => Number(a) - Number(b));
  23392. selectedDate = getDateRange(rangeArr[0], rangeArr[1], disabledDates);
  23393. rangeArr = [];
  23394. } else {
  23395. selectedDate = rangeArr;
  23396. }
  23397. } else if (mode === 'multiple') {
  23398. const index = selectedDate.findIndex((item) => item === `${year}${month}${days.text}`);
  23399. if (index === -1) {
  23400. selectedDate.push(`${year}${month}${days.text}`);
  23401. } else {
  23402. selectedDate.splice(index, 1);
  23403. }
  23404. } else {
  23405. selectedDate = [`${year}${month}${days.text}`];
  23406. }
  23407. // 对 selectedDate 按照日期排序
  23408. // Sort selectedDate by date
  23409. selectedDate.sort((a, b) => Number(a) - Number(b));
  23410. selectedDateStr = selectedDate.join(',');
  23411. };
  23412. // 快速选择项目
  23413. // Quick selection item
  23414. let quickSelectItem: string | number = $state('');
  23415. // 点击快速选择
  23416. // Click quick selection
  23417. const quickSelectFunc = (type: string | number) => {
  23418. isQuickSelect = true;
  23419. quickSelectItem = type;
  23420. if (type === 'week') {
  23421. selectedDate = getCurrentWeek(startSunday);
  23422. }
  23423. if (type === 'month') {
  23424. selectedDate = getCurrentMonth();
  23425. }
  23426. if (type === 'quarter') {
  23427. selectedDate = getCurrentQuarter();
  23428. }
  23429. // 如果 type 是数字类型且是整数,表示选择最近几天,负整数表示选择之前几天,正整数表示选择之后几天
  23430. // If type is a number type and is an integer, it means to select the last few days. A negative integer means to select the previous few days, and a positive integer means to select the next few days
  23431. if (typeof type === 'number' && Number.isInteger(type)) {
  23432. selectedDate = getDaysRangeWithToday(type, includeToday);
  23433. }
  23434. // 剔除 disabledDates 中的日期
  23435. // Remove dates in disabledDates
  23436. if (disabledDates && disabledDates.length) {
  23437. disabledDates.forEach((item) => {
  23438. const index = selectedDate.findIndex((date) => date === item);
  23439. if (index !== -1) {
  23440. selectedDate.splice(index, 1);
  23441. }
  23442. });
  23443. }
  23444. selectedDateStr = selectedDate.join(',');
  23445. // 对快速选择做自动滚动
  23446. // Automatic scrolling for quick selection
  23447. if (scrollElement) {
  23448. // 取 selectedDate 的第一个值,再取出前 6 位,再在 monthList 中找到对应的索引,再根据索引计算出滚动的高度
  23449. // Take the first value of selectedDate, then take the first 6 digits, then find the corresponding index in monthList, and then calculate the height of the scroll according to the index
  23450. const index = monthList.findIndex((item) => item === selectedDate[0].slice(0, 6));
  23451. scrollElement.scrollTop = scrollElement.scrollHeight * (index / monthList.length);
  23452. }
  23453. };
  23454. // 传入日期格式与日期字符对象,将其中的前四位对应 format 的 YYYY,中间两位对应 format 的 MM,后两位对应 format 的 DD,返回格式化后的字符串
  23455. // Pass in the date format and date character object, and return the formatted string
  23456. const getDateStrFunc = (format: string, date: string) => {
  23457. const year = date.slice(0, 4);
  23458. const month = date.slice(4, 6);
  23459. const day = date.slice(6, 8);
  23460. format = format.replace('YYYY', year);
  23461. format = format.replace('MM', month);
  23462. format = format.replace('DD', day);
  23463. return format;
  23464. };
  23465. // 点击确定事件
  23466. // Click the confirm event
  23467. const confirmFunc = () => {
  23468. visible = false;
  23469. // 根据传入的 outFormat,循环 selectedDate,将 selectedDate 中的日期使用 getDateStrFunc 转换为 outFormat 格式的日期字符串
  23470. // Loop selectedDate according to the outFormat passed in, and use getDateStrFunc to convert the date in selectedDate to a date string in the outFormat format
  23471. if (selectedDate.length) {
  23472. selectedDate = selectedDate.map((item) => getDateStrFunc(outFormat, item));
  23473. }
  23474. onconfirm?.(selectedDate);
  23475. };
  23476. // 根据 initMonthIndex 在 monthList 中的索引,自动滚动到 scrollElement 高度的百分比
  23477. // Automatically scroll to the percentage of the height of scrollElement according to the index of initMonthIndex in monthList
  23478. $effect(() => {
  23479. if (scrollElement && visible && !isQuickSelect) {
  23480. scrollElement.scrollTop = scrollElement.scrollHeight * (initMonthIndex / monthList.length);
  23481. }
  23482. });
  23483. // 监听 visible 的变化,派发事件
  23484. // Listen to the change of visible, dispatch events
  23485. $effect(() => {
  23486. if (!visible) {
  23487. if (clear) {
  23488. selectedDate = [];
  23489. selectedDateStr = '';
  23490. }
  23491. onclose?.();
  23492. }
  23493. });
  23494. </script>
  23495. <Popup
  23496. bind:visible
  23497. size={0}
  23498. maskClosable
  23499. transitionDistance={(window.innerHeight * height) / 100 + 40 + 64 + (quickSelects.length > 0 && mode === 'range' ? 36 : 0)}
  23500. {...popup}
  23501. >
  23502. <div>
  23503. <div class="sticky left-0 top-0 z-10 w-full bg-gray-50 dark:bg-gray-800">
  23504. {#if quickSelects.length > 0 && mode === 'range'}
  23505. <div class="calendar-container flex flex-nowrap gap-4 overflow-x-auto px-4 pb-1 pt-2">
  23506. {#each quickSelects as item}
  23507. <button
  23508. class="flex-none rounded-sm bg-white px-2 py-1 text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  23509. class:!bg-primary={isQuickSelect && quickSelectItem === item}
  23510. class:text-white={isQuickSelect && quickSelectItem === item}
  23511. class:dark:!bg-dark={isQuickSelect && quickSelectItem === item}
  23512. class:dark:text-black={isQuickSelect && quickSelectItem === item}
  23513. onclick={() => quickSelectFunc(item)}
  23514. >
  23515. {#if item === 'week'}
  23516. {calendarLang.currentWeekText}
  23517. {:else if item === 'month'}
  23518. {calendarLang.currentMonthText}
  23519. {:else if item === 'quarter'}
  23520. {calendarLang.currentQuarterText}
  23521. {:else if Number.isInteger(item) && item < 0}
  23522. {calendarLang.beforeText + ' ' + Math.abs(item) + ' ' + calendarLang.dayText}
  23523. {:else if Number.isInteger(item) && item > 0}
  23524. {calendarLang.afterText + ' ' + Math.abs(item) + ' ' + calendarLang.dayText}
  23525. {:else}
  23526. <!-- else content here -->
  23527. {/if}
  23528. </button>
  23529. {/each}
  23530. </div>
  23531. {/if}
  23532. <div class="flex h-10 items-center justify-around gap-1 px-6 text-center leading-10">
  23533. {#each weekTexts as item, index}
  23534. <div class="flex-1 font-bold{weekendRed && isWeekendFunc(startSunday, index) ? ' text-error' : ''}">
  23535. {item}
  23536. </div>
  23537. {/each}
  23538. </div>
  23539. </div>
  23540. <div
  23541. class="calendar-container flex flex-col gap-4 overflow-y-auto bg-gray-50 px-4 py-2 dark:bg-gray-800 {useAnimation
  23542. ? 'scroll-smooth'
  23543. : 'scroll-auto'}"
  23544. style="height:{(window.innerHeight * height) / 100}px"
  23545. bind:this={scrollElement}
  23546. >
  23547. {#each allMonthData as item}
  23548. <div
  23549. class="{monthCard ? `bg-white shadow-md dark:bg-black dark:shadow-white/5 ${radiusClass[radius] || 'rounded-xl'}` : ''} relative"
  23550. >
  23551. <div class="px-4 pt-4 text-xl text-black/30 dark:text-white/30">
  23552. <span class="mr-2 font-bold text-black dark:text-white">
  23553. {calendarLang.monthTextList[Number(item.month) - 1]}
  23554. </span>
  23555. {item.year}
  23556. </div>
  23557. <div class="grid grid-cols-7 gap-y-1 p-2 text-center">
  23558. {#each item.days as day}
  23559. <button
  23560. class="p-px{day.text ? ' bg-primary/10 dark:bg-dark/20' : ''}"
  23561. onclick={() => {
  23562. if (!day.disabled) clickDayFunc(item.year, item.month, day);
  23563. }}
  23564. class:!bg-transparent={!selectedDateStr.includes(`${item.year}${item.month}${day.text}`)}
  23565. class:!rounded-l-xl={radius === 'xl' &&
  23566. mode === 'range' &&
  23567. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 || day.start)}
  23568. class:!rounded-r-xl={radius === 'xl' &&
  23569. mode === 'range' &&
  23570. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8 || day.end)}
  23571. class:!rounded-xl={radius === 'xl' && mode !== 'range'}
  23572. class:!rounded-l-2xl={radius === '2xl' &&
  23573. mode === 'range' &&
  23574. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 || day.start)}
  23575. class:!rounded-r-2xl={radius === '2xl' &&
  23576. mode === 'range' &&
  23577. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8 || day.end)}
  23578. class:!rounded-2xl={radius === '2xl' && mode !== 'range'}
  23579. class:!rounded-l-none={radius === 'none' &&
  23580. mode === 'range' &&
  23581. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 || day.start)}
  23582. class:!rounded-r-none={radius === 'none' &&
  23583. mode === 'range' &&
  23584. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8 || day.end)}
  23585. class:!rounded-none={radius === 'none' && mode !== 'range'}
  23586. class:!rounded-l-sm={radius === 'sm' &&
  23587. mode === 'range' &&
  23588. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 || day.start)}
  23589. class:!rounded-r-sm={radius === 'sm' &&
  23590. mode === 'range' &&
  23591. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8 || day.end)}
  23592. class:!rounded-sm={radius === 'sm' && mode !== 'range'}
  23593. >
  23594. <div
  23595. class="{radiusClass[radius] || 'rounded-xl'} relative flex h-full w-full flex-col justify-center {day.info
  23596. ? 'py-1'
  23597. : 'py-2'}"
  23598. class:bg-primary={(day.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${day.text}`)) ||
  23599. (day.text &&
  23600. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23601. mode === 'range' &&
  23602. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 ||
  23603. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8))}
  23604. class:dark:bg-dark={(day.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${day.text}`)) ||
  23605. (day.text &&
  23606. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23607. mode === 'range' &&
  23608. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 ||
  23609. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8))}
  23610. class:text-white={(day.text && mode !== 'range' && selectedDateStr.includes(`${item.year}${item.month}${day.text}`)) ||
  23611. (day.text &&
  23612. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23613. mode === 'range' &&
  23614. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 ||
  23615. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8))}
  23616. class:dark:text-black={(day.text &&
  23617. mode !== 'range' &&
  23618. selectedDateStr.includes(`${item.year}${item.month}${day.text}`)) ||
  23619. (day.text &&
  23620. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23621. mode === 'range' &&
  23622. (selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === 0 ||
  23623. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) === selectedDateStr.length - 8))}
  23624. class:text-primary={mode === 'range' &&
  23625. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23626. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) !== 0 &&
  23627. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) !== selectedDateStr.length - 8}
  23628. class:dark:text-dark={mode === 'range' &&
  23629. selectedDateStr.includes(`${item.year}${item.month}${day.text}`) &&
  23630. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) !== 0 &&
  23631. selectedDateStr.indexOf(`${item.year}${item.month}${day.text}`) !== selectedDateStr.length - 8}
  23632. class:border={item.year + item.month + day.text === todayStr && highlightToday}
  23633. class:border-primary={item.year + item.month + day.text === todayStr && highlightToday}
  23634. class:dark:border-dark={item.year + item.month + day.text === todayStr && highlightToday}
  23635. >
  23636. <div class="font-bold">
  23637. {day.text ? Number(day.text) : ''}
  23638. </div>
  23639. <div class="text-xs opacity-50">{day.info || ''}</div>
  23640. {#if day.text && day.disabled}
  23641. <div
  23642. class="absolute left-1/2 top-1/2 h-4/5 w-4/5 -translate-x-1/2 -translate-y-1/2 text-black/60 opacity-40 dark:text-white"
  23643. >
  23644. <svg viewBox="0 0 1024 1024" version="1.1" width="100%" height="100%" style="fill: currentColor;">
  23645. <path
  23646. d="M512 85.333333c235.648 0 426.666667 191.018667 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333zM170.666667 512a341.333333 341.333333 0 0 0 550.016 270.08L241.92 303.36A339.84 339.84 0 0 0 170.666667 512z m341.333333-341.333333a339.882667 339.882667 0 0 0-209.877333 72.106666L781.226667 721.92A341.333333 341.333333 0 0 0 512 170.666667z"
  23647. />
  23648. </svg>
  23649. </div>
  23650. {/if}
  23651. </div>
  23652. </button>
  23653. {/each}
  23654. </div>
  23655. {#if monthMark}
  23656. <div
  23657. class="pointer-events-none absolute w-full {monthMarkSizeClass[monthMarkSize] ||
  23658. 'text-7xl'} left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center font-bold text-black/5 {monthCard
  23659. ? 'dark:text-white/10'
  23660. : 'dark:text-white/5'}"
  23661. >
  23662. {calendarLang.monthTextList[Number(item.month) - 1]}
  23663. </div>
  23664. {/if}
  23665. </div>
  23666. {/each}
  23667. </div>
  23668. <div class="sticky bottom-0 left-0 z-10 w-full bg-gray-50 dark:bg-gray-800">
  23669. <Button {...button} onclick={confirmFunc}>
  23670. {confirmText}
  23671. {showSelectedDay && mode !== 'single' && selectedDateStr.split(',').length > 0
  23672. ? `(${selectedText} ${selectedDate.length} ${dayText})`
  23673. : ''}
  23674. </Button>
  23675. </div>
  23676. </div>
  23677. </Popup>
  23678. <style>
  23679. .calendar-container::-webkit-scrollbar {
  23680. display: none; /* Chrome Safari */
  23681. }
  23682. </style>
  23683. ================================================
  23684. FILE: packages/stdf/src/lib/components/cell/Cell.svelte
  23685. ================================================
  23686. <script lang="ts">
  23687. import Icon from '../icon/Icon.svelte';
  23688. import Switch from '../switch/Switch.svelte';
  23689. import type { CellProps } from '../../types/index.js';
  23690. let {
  23691. title = '',
  23692. detail = '',
  23693. right = 'arrow',
  23694. left = null,
  23695. subTitle = '',
  23696. info = '',
  23697. line = false,
  23698. my = '4',
  23699. mx = '2',
  23700. radius = 'lg',
  23701. switchActive = $bindable(false),
  23702. shadow = 'xs',
  23703. injClass = '',
  23704. love = false,
  23705. clickAll = true,
  23706. leftChild,
  23707. rightChild,
  23708. detailChild,
  23709. onclick
  23710. }: CellProps = $props();
  23711. // 圆角风格样式
  23712. // Rounded style style
  23713. const radiusObj = {
  23714. none: ' rounded-none',
  23715. sm: ' rounded-sm',
  23716. md: ' rounded-md',
  23717. lg: ' rounded-lg',
  23718. xl: ' rounded-xl',
  23719. '2xl': ' rounded-2xl',
  23720. full: ' rounded-full'
  23721. };
  23722. // 阴影风格样式
  23723. // Shadow style style
  23724. const shadowClass = {
  23725. none: ' shadow-none',
  23726. xs: ' shadow-xs dark:shadow-white/5',
  23727. sm: ' shadow-sm dark:shadow-white/5',
  23728. md: ' shadow-md dark:shadow-white/10',
  23729. lg: ' shadow-lg dark:shadow-white/10',
  23730. xl: ' shadow-xl dark:shadow-white/10',
  23731. '2xl': ' shadow-2xl dark:shadow-white/25'
  23732. };
  23733. // 左右间距样式
  23734. // Left and right margin style
  23735. const mxClass = {
  23736. '0': ' mx-0',
  23737. '1': ' mx-1',
  23738. '2': ' mx-2',
  23739. '3': ' mx-3',
  23740. '4': ' mx-4',
  23741. '6': ' mx-6',
  23742. '8': ' mx-8'
  23743. };
  23744. // 上下边距样式
  23745. // Top and bottom margin style
  23746. const myClass = {
  23747. '0': ' my-0',
  23748. '1': ' my-1',
  23749. '2': ' my-2',
  23750. '3': ' my-3',
  23751. '4': ' my-4',
  23752. '6': ' my-6',
  23753. '8': ' my-8'
  23754. };
  23755. // 点击事件
  23756. // Click event
  23757. const setClickFun = () => {
  23758. if (clickAll) {
  23759. if (typeof right === 'object' && right?.type === 'switch' && !right?.switch?.disabled) {
  23760. switchActive = right?.switch?.async ? switchActive : !switchActive;
  23761. }
  23762. // 派发事件
  23763. // Dispatch event
  23764. onclick?.();
  23765. }
  23766. };
  23767. </script>
  23768. <div
  23769. class="bg-white px-3 dark:bg-gray-800{clickAll ? ' active:bg-gray-100 dark:active:bg-gray-600' : ''} {myClass[my] ||
  23770. myClass['4']}{mxClass[mx] || mxClass['2']}{radiusObj[radius] || radiusObj['lg']} {shadowClass[shadow] || shadowClass['xs']}{love
  23771. ? ' text-xl'
  23772. : ''} {injClass}"
  23773. >
  23774. <button
  23775. onclick={setClickFun}
  23776. class="flex w-full items-center justify-between gap-4 py-4{line && my === '0' ? ' border-b border-black/5 dark:border-white/5' : ''}"
  23777. >
  23778. <div class="flex items-center justify-between">
  23779. {#if leftChild}
  23780. {@render leftChild?.()}
  23781. {:else if left}
  23782. <div class="mr-1 flex flex-col justify-center">
  23783. <Icon {...left} />
  23784. </div>
  23785. {:else}{/if}
  23786. <div class="flex flex-col text-left {subTitle === '' ? 'justify-center' : 'justify-between'}">
  23787. <div class="font-medium">{title}</div>
  23788. <div class="text-xs text-gray-500 dark:text-gray-400">{subTitle}</div>
  23789. </div>
  23790. </div>
  23791. <div class="11 flex items-center justify-between">
  23792. <div class="flex flex-col {info === '' ? 'justify-center' : 'justify-between'} text-right">
  23793. {#if detailChild}
  23794. {@render detailChild?.()}
  23795. {:else if detail}
  23796. <div class="text-gray-700 dark:text-gray-300">{detail}</div>
  23797. {:else}{/if}
  23798. <div class="text-xs font-light text-gray-500 dark:text-gray-400">{info}</div>
  23799. </div>
  23800. {#if rightChild}
  23801. {@render rightChild?.()}
  23802. {:else if right === 'arrow'}
  23803. <div class="flex flex-col justify-center text-gray-700 dark:text-gray-300">
  23804. <Icon name="ri-arrow-right-s-line" size={love ? 26 : 20} alpha={0.6} top={-2} />
  23805. </div>
  23806. {:else if typeof right === 'object' && right?.type === 'switch'}
  23807. <div class="ml-1 flex flex-col justify-center">
  23808. <Switch active={switchActive} {...right?.switch} />
  23809. </div>
  23810. {:else if typeof right === 'object' && right?.type === 'icon' && right?.icon}
  23811. <div class="ml-1 flex flex-col justify-center">
  23812. <Icon {...right?.icon} />
  23813. </div>
  23814. {:else}{/if}
  23815. </div>
  23816. </button>
  23817. </div>
  23818. ================================================
  23819. FILE: packages/stdf/src/lib/components/cell/CellGroup.svelte
  23820. ================================================
  23821. <script lang="ts">
  23822. import type { CellGroupProps } from '../../types/index.js';
  23823. let { radius = 'lg', shadow = 'xs', my = '4', mx = '2', children }: CellGroupProps = $props();
  23824. const shadowClass = {
  23825. none: ' shadow-none',
  23826. xs: ' shadow-xs dark:shadow-white/5',
  23827. sm: ' shadow-sm dark:shadow-white/5',
  23828. md: ' shadow-md dark:shadow-white/10',
  23829. lg: ' shadow-lg dark:shadow-white/10',
  23830. xl: ' shadow-xl dark:shadow-white/10',
  23831. '2xl': ' shadow-2xl dark:shadow-white/25'
  23832. };
  23833. const radiusClass = {
  23834. none: ' rounded-none',
  23835. sm: ' rounded-sm',
  23836. md: ' rounded-md',
  23837. lg: ' rounded-lg',
  23838. xl: ' rounded-xl',
  23839. '2xl': ' rounded-2xl',
  23840. full: ' rounded-full'
  23841. };
  23842. const mxClass = { '0': ' mx-0', '1': ' mx-1', '2': ' mx-2', '3': ' mx-3', '4': ' mx-4', '6': ' mx-6', '8': ' mx-8' };
  23843. const myClass = { '0': ' my-0', '1': ' my-1', '2': ' my-2', '3': ' my-3', '4': ' my-4', '6': ' my-6', '8': ' my-8' };
  23844. </script>
  23845. <div
  23846. class="bg-white dark:bg-black overflow-hidden{shadowClass[shadow] || shadowClass['xs']}{radiusClass[radius] || radiusClass['lg']}{myClass[
  23847. my
  23848. ] || myClass['4']}{mxClass[mx] || mxClass['2']}"
  23849. >
  23850. {@render children?.()}
  23851. </div>
  23852. ================================================
  23853. FILE: packages/stdf/src/lib/components/checkbox/Checkbox.svelte
  23854. ================================================
  23855. <script lang="ts">
  23856. import CheckboxItem from './CheckboxItem.svelte';
  23857. import type { CheckboxProps } from '../../types/index.js';
  23858. let {
  23859. data = [],
  23860. layout = 'v',
  23861. checkeds = $bindable([]),
  23862. textPosition = 'r',
  23863. icon = 'default',
  23864. iconChecked = 'default',
  23865. checkboxChild,
  23866. onchange
  23867. }: CheckboxProps = $props();
  23868. const clickItemFn = (name: string) => {
  23869. checkeds = checkeds.includes(name) ? checkeds.filter((v) => v !== name) : [name, ...checkeds];
  23870. onchange?.(checkeds);
  23871. };
  23872. </script>
  23873. <div class={layout === 'inline' ? 'flex flex-wrap' : `flex ${layout === 'h' ? 'justify-between' : 'w-full flex-col space-y-2'}`}>
  23874. {#each data as item}
  23875. {#if checkboxChild}
  23876. {@render checkboxChild({ item })}
  23877. {:else}
  23878. <CheckboxItem {layout} {...item} {textPosition} {icon} {iconChecked} checked={checkeds.includes(item.name)} onclick={clickItemFn}>
  23879. {item.label}
  23880. </CheckboxItem>
  23881. {/if}
  23882. {/each}
  23883. </div>
  23884. ================================================
  23885. FILE: packages/stdf/src/lib/components/checkbox/CheckboxItem.svelte
  23886. ================================================
  23887. <script lang="ts">
  23888. import Icon from '../icon/Icon.svelte';
  23889. import type { CheckboxItemProps } from '../../types/index.js';
  23890. let {
  23891. name = '',
  23892. layout = 'v',
  23893. checked = false,
  23894. textPosition = 'r',
  23895. icon = 'default',
  23896. iconChecked = 'default',
  23897. children,
  23898. onclick
  23899. }: CheckboxItemProps = $props();
  23900. // 点击选项事件
  23901. // Click option event
  23902. const clickRadioFun = () => {
  23903. onclick?.(name);
  23904. };
  23905. </script>
  23906. <button
  23907. onclick={() => clickRadioFun()}
  23908. class="{layout === 'inline' ? 'inline-block' : 'flex'} grow active:opacity-80 {textPosition === 'l' && layout === 'v'
  23909. ? 'justify-between'
  23910. : ''} {textPosition === 'b' || textPosition === 't' ? 'flex-col items-center' : layout === 'h' ? 'justify-center' : 'items-center'}"
  23911. >
  23912. {#if textPosition === 'l' || textPosition === 't'}
  23913. <div class="{textPosition === 'l' && icon !== null ? 'mr-0.5 text-left' : ''} {layout === 'v' ? 'grow' : ''}">
  23914. {@render children?.()}
  23915. {#if layout === 'v'}
  23916. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  23917. {/if}
  23918. </div>
  23919. {/if}
  23920. <div class:hidden={!checked}>
  23921. {#if iconChecked === null}{:else if iconChecked === 'default'}
  23922. <Icon name="ri-checkbox-fill" theme top={textPosition === 't' || textPosition === 'b' ? 0 : -1} />
  23923. {:else}
  23924. <Icon {...iconChecked} theme />
  23925. {/if}
  23926. </div>
  23927. <div class:hidden={checked}>
  23928. {#if icon === null}{:else if icon === 'default'}
  23929. <Icon name="ri-checkbox-line" alpha={0.2} top={textPosition === 't' || textPosition === 'b' ? 0 : -1} />
  23930. {:else}
  23931. <Icon alpha={0.2} {...icon} />
  23932. {/if}
  23933. </div>
  23934. {#if textPosition === 'r' || textPosition === 'b'}
  23935. <div class={textPosition === 'r' && icon !== null ? 'ml-0.5 text-left' : ''}>
  23936. {@render children?.()}
  23937. </div>
  23938. {/if}
  23939. </button>
  23940. ================================================
  23941. FILE: packages/stdf/src/lib/components/dialog/Dialog.svelte
  23942. ================================================
  23943. <script lang="ts">
  23944. import { getContext } from 'svelte';
  23945. import Popup from '../popup/Popup.svelte';
  23946. import Button from '../button/Button.svelte';
  23947. import Icon from '../icon/Icon.svelte';
  23948. import { zh_CN, type LangProps } from '../../lang/index.js';
  23949. import type { DialogProps } from '../../types/index.js';
  23950. // 当前语言
  23951. // current language
  23952. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  23953. const dialogLang: LangProps['dialog'] = currentLang.dialog;
  23954. let {
  23955. visible = $bindable(false),
  23956. title = dialogLang.title,
  23957. titleAlign = 'center',
  23958. content = dialogLang.content,
  23959. popup = {},
  23960. showIcon = false,
  23961. icon = {},
  23962. btnStyle = 'button',
  23963. primaryText = dialogLang.primaryText,
  23964. primaryButton = {},
  23965. secondaryText = dialogLang.secondaryText,
  23966. secondaryButton = {},
  23967. btnRatio = [1, 1],
  23968. btnReverse = false,
  23969. secondaryClose = true,
  23970. btnGap = '2',
  23971. onsecondary,
  23972. onprimary,
  23973. onclose,
  23974. contentChild,
  23975. primaryChild
  23976. }: DialogProps = $props();
  23977. // 标题对齐方式
  23978. // Title alignment
  23979. const titleAlignClass = { left: ' text-left', center: ' text-center', right: ' text-right' };
  23980. // 按钮间距
  23981. // Button spacing
  23982. const btnGapClass = { '0': '', '1': ' gap-1', '2': ' gap-2', '4': ' gap-4', '8': ' gap-8', '12': ' gap-12', '16': ' gap-16' };
  23983. </script>
  23984. <Popup
  23985. bind:visible
  23986. size={0}
  23987. maskClosable={false}
  23988. duration={300}
  23989. outDuration={150}
  23990. position="center"
  23991. radiusPosition="all"
  23992. radius="lg"
  23993. px="4"
  23994. {...popup}
  23995. >
  23996. <div class="px-4 pt-4{btnStyle === 'button' ? ' pb-2' : ''} space-y-4 text-center">
  23997. <div class="font-bold{titleAlignClass[titleAlign] || titleAlignClass['center']}">{title}</div>
  23998. {#if showIcon}
  23999. <div><Icon {...icon} /></div>
  24000. {/if}
  24001. <div>
  24002. {#if contentChild}
  24003. {@render contentChild?.()}
  24004. {:else}
  24005. {content}
  24006. {/if}
  24007. </div>
  24008. <div
  24009. class="flex w-full{btnGapClass[btnGap] || btnGapClass['2']}{btnReverse ? ' flex-row-reverse' : ''}{btnStyle === 'textLine'
  24010. ? ' border-t border-black/10 dark:border-white/10'
  24011. : ''}"
  24012. >
  24013. <div class={btnStyle === 'textLine' && !btnReverse ? 'border-r border-black/10 dark:border-white/10' : ''} style="flex:{btnRatio[1]}">
  24014. <Button
  24015. size="full"
  24016. fill={btnStyle === 'button' ? 'colorLight' : 'text'}
  24017. heightIn={btnStyle === 'button' ? '3' : '2'}
  24018. injClass={btnStyle === 'button' ? '' : 'font-bold'}
  24019. {...secondaryButton}
  24020. onclick={() => {
  24021. if (secondaryClose) {
  24022. visible = false;
  24023. onclose?.();
  24024. }
  24025. onsecondary?.();
  24026. }}
  24027. >
  24028. {secondaryText}
  24029. </Button>
  24030. </div>
  24031. <div class={btnStyle === 'textLine' && btnReverse ? 'border-r border-black/10 dark:border-white/10' : ''} style="flex:{btnRatio[0]}">
  24032. <Button
  24033. size="full"
  24034. fill={btnStyle === 'button' ? 'base' : 'textTheme'}
  24035. heightIn={btnStyle === 'button' ? '3' : '2'}
  24036. injClass={btnStyle === 'button' ? '' : 'font-bold'}
  24037. {...primaryButton}
  24038. onclick={() => onprimary?.()}
  24039. >
  24040. {#if primaryChild}
  24041. {@render primaryChild?.()}
  24042. {:else}
  24043. {primaryText}
  24044. {/if}
  24045. </Button>
  24046. </div>
  24047. </div>
  24048. </div>
  24049. </Popup>
  24050. ================================================
  24051. FILE: packages/stdf/src/lib/components/divider/Divider.svelte
  24052. ================================================
  24053. <script lang="ts">
  24054. import type { DividerProps } from '../../types/index.js';
  24055. let {
  24056. layout = 'h',
  24057. px = '0',
  24058. py = '4',
  24059. text = '',
  24060. align = 'center',
  24061. line = 'solid',
  24062. mx = '1',
  24063. weight = '1',
  24064. injClass = ''
  24065. }: DividerProps = $props();
  24066. // 水平间距样式
  24067. // Horizontal spacing style
  24068. const pxObj = { '0': 'px-0', '4': 'px-4', '8': 'px-8', '16': 'px-16', '36': 'px-36' };
  24069. // 水平高度样式
  24070. // Horizontal height style
  24071. const pyObj = { '0': 'py-0', '4': 'py-4', '8': 'py-8' };
  24072. // 垂直间距样式
  24073. // Vertical spacing style
  24074. const mxObj = { '1': 'm-1', '2': 'm-2', '4': 'm-4' };
  24075. // 线条风格样式
  24076. // Line style style
  24077. const lineObj = { solid: 'border-solid', dashed: 'border-dashed', dotted: 'border-dotted' };
  24078. // 线条粗细样式
  24079. // Line thickness style
  24080. const weightHObj = { '1': 'border-t', '2': 'border-t-2 rounded-full', '4': 'border-t-4 rounded-full' };
  24081. // 线条粗细样式
  24082. // Line thickness style
  24083. const weightWObj = { '1': 'border-r', '2': 'border-r-2 rounded-full', '4': 'border-r-4 rounded-full' };
  24084. </script>
  24085. {#if layout === 'v'}
  24086. <div
  24087. class="inline {weightWObj[weight] || weightWObj['1']} border-black/10 dark:border-white/20 {mxObj[mx] || mxObj['1']} {lineObj[line] ||
  24088. lineObj.solid} {injClass}"
  24089. ></div>
  24090. {:else}
  24091. <div class="flex items-center {pxObj[px] || pxObj['0']} {pyObj[py] || pyObj['4']}">
  24092. {#if (text !== '' && align !== 'left') || text === ''}
  24093. <div
  24094. class="grow {weightHObj[weight] || weightHObj['1']} border-black/10 dark:border-white/20 {lineObj[line] ||
  24095. lineObj.solid} {injClass}"
  24096. ></div>
  24097. {/if}
  24098. {#if text !== ''}
  24099. <div class="mx-2 flex-none text-xs text-gray-400 {injClass}">{text}</div>
  24100. {/if}
  24101. {#if (text !== '' && align !== 'right') || text === ''}
  24102. <div
  24103. class="grow {weightHObj[weight] || weightHObj['1']} border-black/10 dark:border-white/20 {lineObj[line] ||
  24104. lineObj.solid} {injClass}"
  24105. ></div>
  24106. {/if}
  24107. </div>
  24108. {/if}
  24109. ================================================
  24110. FILE: packages/stdf/src/lib/components/grids/Grid.svelte
  24111. ================================================
  24112. <script lang="ts">
  24113. import type { GridProps } from '../../types/index.js';
  24114. let { col = '1', row = '1', children }: GridProps = $props();
  24115. // 根据行数生成样式
  24116. // Generate styles based on the number of rows
  24117. const rowObj = { '1': 'row-span-1', '2': 'row-span-2', '3': 'row-span-3', '4': 'row-span-4', '5': 'row-span-5', '6': 'row-span-6' };
  24118. // 根据列数生成样式
  24119. // Generate styles based on the number of columns
  24120. const colObj = {
  24121. '1': ' col-span-1',
  24122. '2': ' col-span-2',
  24123. '3': ' col-span-3',
  24124. '4': ' col-span-4',
  24125. '5': ' col-span-5',
  24126. '6': ' col-span-6',
  24127. '7': ' col-span-7',
  24128. '8': ' col-span-8',
  24129. '9': ' col-span-9',
  24130. '10': ' col-span-10',
  24131. '11': ' col-span-11',
  24132. '12': ' col-span-12'
  24133. };
  24134. </script>
  24135. <div class="{rowObj[row] || rowObj['1']}{colObj[col] || colObj['1']}">
  24136. {@render children?.()}
  24137. </div>
  24138. ================================================
  24139. FILE: packages/stdf/src/lib/components/grids/Grids.svelte
  24140. ================================================
  24141. <script lang="ts">
  24142. import type { GridsProps } from '../../types/index.js';
  24143. let { cols = '6', gap = '2', mx = '2', my = '2', children }: GridsProps = $props();
  24144. //根据列数生成样式
  24145. // Generate styles based on the number of columns
  24146. const colsObj = {
  24147. '1': ' grid-cols-1',
  24148. '2': ' grid-cols-2',
  24149. '3': ' grid-cols-3',
  24150. '4': ' grid-cols-4',
  24151. '5': ' grid-cols-5',
  24152. '6': ' grid-cols-6',
  24153. '7': ' grid-cols-7',
  24154. '8': ' grid-cols-8',
  24155. '9': ' grid-cols-9',
  24156. '10': ' grid-cols-10',
  24157. '11': ' grid-cols-11',
  24158. '12': ' grid-cols-12'
  24159. };
  24160. //水平外边距样式
  24161. // Horizontal margin style
  24162. const mxObj = { '0': ' mx-0', '1': ' mx-1', '2': ' mx-2', '4': ' mx-4', '8': ' mx-8' };
  24163. //垂直外边距样式
  24164. // Vertical margin style
  24165. const myObj = { '0': ' my-0', '1': ' my-1', '2': ' my-2', '4': ' my-4', '8': ' my-8' };
  24166. //内部间距样式
  24167. // Internal spacing style
  24168. const gapObj = { '0': ' gap-0', '1': ' gap-1', '2': ' gap-2', '4': ' gap-4', '8': ' gap-8' };
  24169. </script>
  24170. <div class="grid{colsObj[cols] || colsObj['6']}{mxObj[mx] || mxObj['2']}{myObj[my] || myObj['2']}{gapObj[gap] || gapObj['2']}">
  24171. {@render children?.()}
  24172. </div>
  24173. ================================================
  24174. FILE: packages/stdf/src/lib/components/icon/Icon.svelte
  24175. ================================================
  24176. <script lang="ts">
  24177. import { getContext } from 'svelte';
  24178. import type { IconProps } from '../../types/index.js';
  24179. let {
  24180. name = '',
  24181. size = 24,
  24182. theme = false,
  24183. alpha = 1,
  24184. path = getContext('STDF-global-icon-svg-path') || 'fonts/symbol.svg',
  24185. top = 0,
  24186. injClass = '',
  24187. children
  24188. }: IconProps = $props();
  24189. </script>
  24190. <i class="relative{theme ? ' text-primary dark:text-dark' : ''} {injClass}" style="top:{top}px;">
  24191. {#if children}
  24192. {@render children()}
  24193. {:else}
  24194. <svg width={size} height={size === 'full' ? '100%' : size} class="inline fill-current" style="fill-opacity: {alpha};">
  24195. <use xlink:href="/{path}#{name}" />
  24196. </svg>
  24197. {/if}
  24198. </i>
  24199. ================================================
  24200. FILE: packages/stdf/src/lib/components/indexBar/IndexBar.svelte
  24201. ================================================
  24202. <script lang="ts">
  24203. import { onMount } from 'svelte';
  24204. import { fly } from 'svelte/transition';
  24205. import { throttleWithRAF } from '../utils/index.js';
  24206. import type { IndexBarProps } from '../../types/index.js';
  24207. let {
  24208. data = [],
  24209. current = $bindable(0),
  24210. top = 0,
  24211. height = 100,
  24212. radius = 'middle',
  24213. scrollAlign = true,
  24214. titleInjClass = '',
  24215. textInjClass = '',
  24216. onclickChild
  24217. }: IndexBarProps = $props();
  24218. // 用于绑定 bar 的高度
  24219. // Used to bind the height of the bar
  24220. let barHeight = $state(0);
  24221. // 主体内容高度累计,用于监听滑动
  24222. // The cumulative height of the main content is used to listen to the slide
  24223. let longSumList: number[] = [];
  24224. // 当前滑动的索引
  24225. // Current sliding index
  24226. let currentTouch = $state(-1);
  24227. // 主体内容元素
  24228. // Main body content element
  24229. let bodyDom: HTMLElement | null = $state(null);
  24230. // Bar 外层距离顶部的距离
  24231. // Bar outside the distance from the top
  24232. let barToTop = 0;
  24233. // bar 元素
  24234. // bar element
  24235. let barDom: HTMLDivElement | null = $state(null);
  24236. let isDown = false; //是否按下 is down
  24237. // 每一个的高度
  24238. // Height of each
  24239. let itemHeight = $derived(barHeight / data.length);
  24240. // 圆角风格样式
  24241. // Rounded style style
  24242. const radiusObj = { none: 'rounded-none', middle: 'rounded-sm', full: 'rounded-full' };
  24243. onMount(() => {
  24244. if (bodyDom) {
  24245. bodyDom.scrollTop = 0;
  24246. }
  24247. for (let t = 0; t < data.length + 1; t++) {
  24248. const long = data.slice(0, t).reduce((sum, current) => {
  24249. return sum + (current?.height ?? 0);
  24250. }, 0);
  24251. longSumList.push(long);
  24252. }
  24253. //如果索引内容区域高度不够,中英文报错
  24254. //If the index content area height is not enough, Chinese and English errors
  24255. if (height < barHeight) {
  24256. console.error('[STDF IndexBar error]注意:索引内容区域高度不够。(Note: The height of the index content area is not enough.)');
  24257. }
  24258. barToTop = top + (height - barHeight) / 2;
  24259. });
  24260. //bar区域滑动开始
  24261. //Bar area sliding start
  24262. const touchBoxStart = (e: PointerEvent) => {
  24263. isDown = true;
  24264. const clientY = e.clientY;
  24265. currentTouch = Math.floor((clientY - barToTop) / itemHeight);
  24266. current = Math.floor((clientY - barToTop) / itemHeight);
  24267. if (bodyDom) {
  24268. bodyDom.scrollTop = data.slice(0, current).reduce((sum, current) => {
  24269. return sum + (current?.height ?? 0);
  24270. }, 0);
  24271. }
  24272. };
  24273. // bar 区域滑动中
  24274. // bar area sliding in the middle
  24275. const touchBoxMove = (e: PointerEvent) => {
  24276. if (!isDown) {
  24277. return;
  24278. }
  24279. if (barDom) {
  24280. barDom.setPointerCapture(e.pointerId);
  24281. }
  24282. const clientY = e.clientY;
  24283. currentTouch = Math.floor((clientY - barToTop) / itemHeight);
  24284. current = Math.floor((clientY - barToTop) / itemHeight);
  24285. if (clientY < barToTop) {
  24286. currentTouch = 0;
  24287. current = 0;
  24288. }
  24289. if (clientY > barHeight + barToTop) {
  24290. currentTouch = data.length - 1;
  24291. current = data.length - 1;
  24292. }
  24293. if (bodyDom) {
  24294. bodyDom.scrollTop = data.slice(0, current).reduce((sum, current) => {
  24295. return sum + (current?.height ?? 0);
  24296. }, 0);
  24297. }
  24298. };
  24299. // bar 区域滑动结束
  24300. // bar area sliding end
  24301. const touchBoxEnd = () => {
  24302. currentTouch = -1;
  24303. isDown = false;
  24304. };
  24305. //监听主体内容滚动
  24306. //Listen to the main content scroll
  24307. const scrollBody = () => {
  24308. if (!bodyDom) {
  24309. return;
  24310. }
  24311. const scrollTop = bodyDom.scrollTop + top;
  24312. for (let w = 0; w < longSumList.length; w++) {
  24313. if (scrollTop - top >= longSumList[w] && scrollTop - top < longSumList[w + 1]) {
  24314. current = w;
  24315. }
  24316. }
  24317. };
  24318. </script>
  24319. <div bind:this={bodyDom} class="overflow-y-auto {scrollAlign && 'snap-y'}" onscroll={scrollBody} style="height:{height}px;">
  24320. {#each data as group, index}
  24321. <div class="snap-start px-4 pt-8" bind:clientHeight={group.height}>
  24322. <div class="text-primary dark:text-dark text-sm {titleInjClass}">{group.title}</div>
  24323. {#each group.child as child, childIndex}
  24324. <button class="w-full py-2 text-left {textInjClass}" onclick={() => onclickChild && onclickChild(index, group, childIndex, child)}>
  24325. {child}
  24326. </button>
  24327. <div class="h-px bg-black/5 dark:bg-white/5"></div>
  24328. {/each}
  24329. </div>
  24330. {/each}
  24331. </div>
  24332. <div
  24333. onpointerdown={touchBoxStart}
  24334. onpointermove={(e) => throttleWithRAF(touchBoxMove)(e)}
  24335. onpointerup={touchBoxEnd}
  24336. bind:clientHeight={barHeight}
  24337. bind:this={barDom}
  24338. class="fixed right-5 flex w-7 cursor-move touch-none select-none flex-col justify-around bg-black/5 p-1 dark:bg-white/5 {radiusObj[
  24339. radius
  24340. ] || radiusObj.middle}"
  24341. style="top:{top + (height - barHeight) / 2}px;min-height:{height / 4}px;"
  24342. >
  24343. {#each data as group, i}
  24344. <div class="relative flex flex-1 flex-col justify-center">
  24345. <div
  24346. class="h-5 w-5 text-center text-xs leading-5 transition-all {current === i
  24347. ? 'bg-primary dark:bg-dark text-white dark:text-black'
  24348. : 'text-gray-600 dark:text-gray-400'} {radiusObj[radius] || radiusObj.middle}"
  24349. >
  24350. {group.index}
  24351. </div>
  24352. {#if currentTouch === i}
  24353. <div
  24354. class="border-primary text-primary dark:border-dark dark:text-dark absolute -left-24 top-1/2 h-14 w-14 -translate-y-2/4 border text-center text-3xl leading-[3.5rem] {radiusObj[
  24355. radius
  24356. ] || radiusObj.middle}"
  24357. transition:fly={{ x: 38, duration: 300 }}
  24358. >
  24359. {group.index}
  24360. </div>
  24361. {/if}
  24362. </div>
  24363. {/each}
  24364. </div>
  24365. ================================================
  24366. FILE: packages/stdf/src/lib/components/input/Input.svelte
  24367. ================================================
  24368. <script lang="ts">
  24369. import { getContext } from 'svelte';
  24370. import Icon from '../icon/Icon.svelte';
  24371. import { zh_CN, type LangProps } from '../../lang/index.js';
  24372. import type { InputProps } from '../../types/index.js';
  24373. // 当前语言
  24374. // current language
  24375. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  24376. const inputLang: LangProps['input'] = currentLang.input;
  24377. let {
  24378. title = '',
  24379. titlePosition = 'out',
  24380. inputPosition = 'left',
  24381. placeholder = '',
  24382. radius = 'sm',
  24383. label1 = null,
  24384. label2 = null,
  24385. label3 = null,
  24386. label4 = null,
  24387. label5 = null,
  24388. label6 = null,
  24389. tip = null,
  24390. data1 = null,
  24391. data2 = null,
  24392. data3 = null,
  24393. value = $bindable(''),
  24394. clear = false,
  24395. inputStyle = 'block',
  24396. lineTransition = null,
  24397. duration = 'base',
  24398. autocomplete = true,
  24399. py = '2',
  24400. disabled = false,
  24401. state: inputState = 'theme',
  24402. type = 'text',
  24403. inputmode = '',
  24404. maxlength = 24,
  24405. textareaMaxlength = 200,
  24406. rows = 2,
  24407. autosize = false,
  24408. negative = false,
  24409. onfocus,
  24410. onblur,
  24411. onchange,
  24412. onclear,
  24413. onclickLabel1,
  24414. onclickLabel2,
  24415. onclickLabel3,
  24416. onclickLabel4,
  24417. onclickLabel5,
  24418. onclickLabel6,
  24419. onkeydown,
  24420. titleChild,
  24421. data1Child,
  24422. data2Child,
  24423. data3Child,
  24424. label1Child,
  24425. label2Child,
  24426. label3Child,
  24427. label4Child,
  24428. label5Child,
  24429. label6Child,
  24430. tipChild
  24431. }: InputProps = $props();
  24432. // 是否获取焦点
  24433. // Whether to get focus
  24434. let focus = $state(false);
  24435. // 中文输入上屏标识
  24436. // Chinese input screening flag
  24437. let flag = true;
  24438. //textarea 元素
  24439. //textarea element
  24440. let textareaDom: HTMLTextAreaElement | undefined = $state(undefined);
  24441. // 输入模式判断
  24442. // Input mode judgment
  24443. const modeFun = (type: string) => {
  24444. switch (type) {
  24445. case 'password':
  24446. return 'text';
  24447. case 'number':
  24448. return 'decimal';
  24449. case 'textarea':
  24450. return 'text';
  24451. default:
  24452. return type;
  24453. }
  24454. };
  24455. // 输入框类型判断
  24456. // Input box type judgment
  24457. const mode = $derived(inputmode === '' ? modeFun(type) : inputmode);
  24458. // 输入框类型判断
  24459. // Input type judgment
  24460. const typeAction = (node: HTMLInputElement | HTMLTextAreaElement) => {
  24461. if (type !== 'textarea' && node instanceof HTMLInputElement) {
  24462. node.type = type === 'password' ? 'password' : 'text';
  24463. }
  24464. };
  24465. // 圆角风格样式
  24466. // Corner style style
  24467. const radiusObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', '2xl': 'rounded-2xl', full: 'rounded-full' };
  24468. // 输入框风格样式
  24469. // Input box style style
  24470. const inputStyleObj = {
  24471. block: 'px-2 ring-2 ring-transparent bg-black/5 dark:bg-white/5 ' + radiusObj[radius] || radiusObj.sm,
  24472. line: 'px-1 border-b bg-transparent border-gray-300 dark:border-gray-500'
  24473. };
  24474. // 状态样式
  24475. // State style
  24476. const stateObj = {
  24477. theme: 'ring-primary dark:ring-dark',
  24478. success: 'ring-success',
  24479. warning: 'ring-warning',
  24480. error: 'ring-error',
  24481. info: 'ring-info'
  24482. };
  24483. // 根据是否获取焦点判断输入框样式
  24484. // Determine the input box style according to whether to get focus
  24485. const inputStyleFocusObj = $derived({
  24486. block: 'px-2 ring-2 bg-transparent ' + stateObj[inputState] || stateObj.theme + radiusObj[radius] || radiusObj.sm,
  24487. line: 'px-1 border-b bg-transparent border-gray-300 dark:border-gray-500'
  24488. });
  24489. // 线性动画样式
  24490. // Linear animation style
  24491. const lineTransitionStateObj = {
  24492. theme: 'bg-primary dark:bg-dark ',
  24493. success: 'bg-success',
  24494. warning: 'bg-warning',
  24495. error: 'bg-error',
  24496. info: 'bg-info'
  24497. };
  24498. // 动画时长样式
  24499. // Animation duration style
  24500. const durationObj = { fast: 'duration-150', base: 'duration-300', slow: 'duration-500', slower: 'duration-1000' };
  24501. // 垂直间距样式
  24502. // Vertical spacing style
  24503. const pyObj = { '0': 'py-0', '0.5': 'py-0.5', '1': 'py-1', '2': 'py-2', '3': 'py-3', '4': 'py-4', '6': 'py-6' };
  24504. // 获取焦点是派发事件
  24505. // Get focus to dispatch events
  24506. const onFocus = () => {
  24507. focus = true;
  24508. onfocus?.(value);
  24509. };
  24510. // 失去焦点时派发事件
  24511. // Dispatch events when focus is lost
  24512. const onBlur = () => {
  24513. focus = false;
  24514. onblur?.(value);
  24515. };
  24516. // 输入内容变化时触发
  24517. // Triggered when input content changes
  24518. const valueChangeFun = (e: HTMLInputElement | HTMLTextAreaElement) => {
  24519. //处理拼音输入时,内容上屏后才做校验
  24520. //Handle pinyin input, content screening after validation
  24521. setTimeout(function () {
  24522. if (flag) {
  24523. if (type === 'textarea' && autosize) {
  24524. if (textareaDom) {
  24525. textareaDom.style.height = textareaDom.scrollHeight + 'px';
  24526. }
  24527. }
  24528. if (type === 'textarea' && e.value.length > textareaMaxlength) {
  24529. //去除最后一个字符
  24530. //Remove the last character
  24531. e.value = e.value.substring(0, textareaMaxlength);
  24532. }
  24533. if (type !== 'textarea' && e.value.length > maxlength) {
  24534. //去除最后一个字符
  24535. //Remove the last character
  24536. e.value = e.value.substring(0, maxlength);
  24537. }
  24538. if (type === 'decimal' || type === 'number') {
  24539. // 数字
  24540. // Number
  24541. if (negative && e.value.startsWith('-')) {
  24542. // 允许第一个字符为负号
  24543. // Allow the first character to be a negative sign
  24544. value =
  24545. '-' +
  24546. e.value
  24547. .substring(1)
  24548. .replace(/[^\d.]+/g, '')
  24549. .replace(/\.{2,}/g, '.')
  24550. .replace(/^(\d*\.\d*)\./, '$1');
  24551. } else {
  24552. // 不允许小数点开头且只允许一个小数点
  24553. // Do not allow decimal points to start and only allow one decimal point
  24554. value = e.value
  24555. .replace(/[^\d.]+/g, '')
  24556. .replace(/^\./, '')
  24557. .replace(/\.{2,}/g, '.')
  24558. .replace(/^(\d*\.\d*)\./, '$1');
  24559. }
  24560. } else if (type === 'numeric') {
  24561. // 整数
  24562. // Integer
  24563. if (negative && e.value.startsWith('-')) {
  24564. // 允许第一个字符为负号
  24565. // Allow the first character to be a negative sign
  24566. value = '-' + e.value.substring(1).replace(/[^\d]+/g, '');
  24567. } else {
  24568. value = e.value.replace(/[^\d]+/g, '');
  24569. }
  24570. } else {
  24571. value = e.value;
  24572. }
  24573. onchange?.(value);
  24574. }
  24575. }, 0);
  24576. };
  24577. //拼音输入时,文字还未上屏触发
  24578. //Triggered when the text has not been screened during pinyin input
  24579. const compositionendFun = () => {
  24580. flag = true;
  24581. };
  24582. //拼音输入时,文字完成上屏触发
  24583. //Triggered when the text is completed during pinyin input
  24584. const compositionstartFun = () => {
  24585. flag = false;
  24586. };
  24587. //清除时触发
  24588. //Triggered when cleared
  24589. const clearFun = () => {
  24590. value = '';
  24591. onclear?.();
  24592. onchange?.('');
  24593. };
  24594. // 键盘事件
  24595. // Keyboard event
  24596. const keydownFunc = (e: KeyboardEvent) => {
  24597. // 派发事件,并传出按键的 key
  24598. // Dispatch events and pass out the key of the key
  24599. onkeydown?.(e.key);
  24600. };
  24601. </script>
  24602. <div class="px-2 {pyObj[py] || pyObj['2']}">
  24603. <label>
  24604. <div class="flex px-2 {title === '' ? 'justify-end' : 'justify-between'}">
  24605. {#if titlePosition === 'out'}
  24606. {#if titleChild}
  24607. {@render titleChild?.()}
  24608. {:else if title === ''}{:else}
  24609. <div class="mb-1 text-sm font-semibold">{title}</div>
  24610. {/if}
  24611. {/if}
  24612. <div class="flex space-x-2 text-xs">
  24613. {#if data1Child}
  24614. {@render data1Child?.()}
  24615. {:else if data1 === ''}{:else}
  24616. {data1}
  24617. {/if}
  24618. {#if data2Child}
  24619. {@render data2Child?.()}
  24620. {:else if data2 === ''}{:else}
  24621. {data2}
  24622. {/if}
  24623. </div>
  24624. </div>
  24625. <div
  24626. class="relative my-0.5 flex items-center space-x-1 whitespace-nowrap text-sm transition-all {durationObj[duration] ||
  24627. durationObj.base} {titlePosition === 'in' ? 'py-1' : 'py-3'} {focus
  24628. ? inputStyleFocusObj[inputStyle] || inputStyleFocusObj.block
  24629. : inputStyleObj[inputStyle] || inputStyleObj.block} {inputStyle === 'block' ? radiusObj[radius] || radiusObj.sm : ''}"
  24630. >
  24631. {#if label1Child}
  24632. {@render label1Child?.()}
  24633. {:else if label1 === null}{:else}
  24634. <button onclick={() => onclickLabel1 && onclickLabel1()}>
  24635. <Icon {...label1} />
  24636. </button>
  24637. {/if}
  24638. {#if label2Child}
  24639. {@render label2Child?.()}
  24640. {:else if label2 === null}{:else}
  24641. <button onclick={() => onclickLabel2 && onclickLabel2()}>
  24642. {label2}
  24643. </button>
  24644. {/if}
  24645. {#if label3Child}
  24646. {@render label3Child?.()}
  24647. {:else if label3 === null}{:else}
  24648. <button onclick={() => onclickLabel3 && onclickLabel3()}>
  24649. <Icon {...label3} />
  24650. </button>
  24651. {/if}
  24652. <div class="flex grow flex-col">
  24653. {#if titlePosition === 'in'}
  24654. <div class="text-xs text-gray-400">{title}</div>
  24655. {/if}
  24656. <div class="flex space-x-1">
  24657. <div class="w-full">
  24658. {#if type === 'textarea'}
  24659. <textarea
  24660. bind:value
  24661. use:typeAction
  24662. {rows}
  24663. inputmode={mode as 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'email' | 'search' | 'url'}
  24664. placeholder={placeholder !== '' ? placeholder : title !== '' ? inputLang.pleaseInput + ' ' + title : ''}
  24665. class="focus:outline-hidden w-full bg-transparent font-semibold text-black dark:text-white {inputPosition === 'left'
  24666. ? 'text-left'
  24667. : 'text-right'} {disabled ? 'cursor-not-allowed opacity-50' : ''}"
  24668. onfocus={onFocus}
  24669. onblur={() => onBlur()}
  24670. oninput={(e) => valueChangeFun(e.currentTarget)}
  24671. oncompositionend={compositionendFun}
  24672. oncompositionstart={compositionstartFun}
  24673. autocomplete={autocomplete === true ? 'on' : 'off'}
  24674. {disabled}
  24675. bind:this={textareaDom}
  24676. onkeydown={keydownFunc}
  24677. ></textarea>
  24678. {:else}
  24679. <input
  24680. bind:value
  24681. use:typeAction
  24682. inputmode={mode as 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'email' | 'search' | 'url'}
  24683. placeholder={placeholder !== '' ? placeholder : title !== '' ? inputLang.pleaseInput + ' ' + title : ''}
  24684. class="focus:outline-hidden w-full whitespace-normal bg-transparent font-semibold text-black dark:text-white {inputPosition ===
  24685. 'left'
  24686. ? 'text-left'
  24687. : 'text-right'} {disabled ? 'cursor-not-allowed opacity-50' : ''}"
  24688. onfocus={onFocus}
  24689. onblur={() => onBlur()}
  24690. oninput={(e) => valueChangeFun(e.currentTarget)}
  24691. oncompositionend={compositionendFun}
  24692. oncompositionstart={compositionstartFun}
  24693. autocomplete={autocomplete === true ? 'on' : 'off'}
  24694. {disabled}
  24695. onkeydown={keydownFunc}
  24696. />
  24697. {/if}
  24698. </div>
  24699. {#if clear && value !== ''}
  24700. <button onclick={() => clearFun()}>
  24701. <Icon name="ri-close-circle-fill" size={16} alpha={0.3} />
  24702. </button>
  24703. {/if}
  24704. </div>
  24705. </div>
  24706. {#if label4Child}
  24707. {@render label4Child?.()}
  24708. {:else if label4 === null}{:else}
  24709. <button onclick={() => onclickLabel4 && onclickLabel4()}>
  24710. <Icon {...label4} />
  24711. </button>
  24712. {/if}
  24713. {#if label5Child}
  24714. {@render label5Child?.()}
  24715. {:else if label5 === null}{:else}
  24716. <button onclick={() => onclickLabel5 && onclickLabel5()}>
  24717. {label5}
  24718. </button>
  24719. {/if}
  24720. {#if label6Child}
  24721. {@render label6Child?.()}
  24722. {:else if label6 === null}{:else}
  24723. <button onclick={() => onclickLabel6 && onclickLabel6()}>
  24724. <Icon {...label6} />
  24725. </button>
  24726. {/if}
  24727. {#if inputStyle === 'line'}
  24728. <div
  24729. class="absolute -bottom-px h-0.5 {lineTransition === null ? 'transition-colors' : 'transition-all'} {durationObj[duration] ||
  24730. durationObj.base} {!focus && lineTransition === null && 'w-full bg-transparent'} {focus &&
  24731. lineTransition === null &&
  24732. `${lineTransitionStateObj[inputState] || lineTransitionStateObj.theme} w-full`} {!focus &&
  24733. lineTransition !== null &&
  24734. `w-0 ${lineTransitionStateObj[inputState] || lineTransitionStateObj.theme}`} {focus &&
  24735. lineTransition !== null &&
  24736. `w-full ${lineTransitionStateObj[inputState] || lineTransitionStateObj.theme}`}"
  24737. style={lineTransition === 'center'
  24738. ? 'left:50%;transform:translateX(calc( -50% - 0.25rem ));-webkit-transform:translateX(calc( -50% - 0.25rem ));'
  24739. : 'left:0;transform:translateX( -0.25rem );-webkit-transform:translateX( -0.25rem );'}
  24740. ></div>
  24741. {/if}
  24742. </div>
  24743. <div class="flex px-2 {tip === null ? 'justify-end' : 'justify-between'}">
  24744. {#if tipChild}
  24745. {@render tipChild?.()}
  24746. {:else if tip === null}{:else}
  24747. <div class="text-xs text-gray-400">
  24748. {tip}
  24749. </div>
  24750. {/if}
  24751. {#if data3Child}
  24752. {@render data3Child?.()}
  24753. {:else if data3 === null}{:else}
  24754. <div class="text-xs">
  24755. {data3}
  24756. </div>
  24757. {/if}
  24758. </div>
  24759. </label>
  24760. </div>
  24761. ================================================
  24762. FILE: packages/stdf/src/lib/components/loading/Loading.svelte
  24763. ================================================
  24764. <script lang="ts">
  24765. import { onMount } from 'svelte';
  24766. import type { LoadingProps } from '../../types/index.js';
  24767. import {
  24768. Loading1_0,
  24769. Loading1_1,
  24770. Loading1_2,
  24771. Loading1_3,
  24772. Loading1_4,
  24773. Loading1_5,
  24774. Loading1_6,
  24775. Loading1_7,
  24776. Loading1_8,
  24777. Loading1_9,
  24778. Loading1_10,
  24779. Loading1_11,
  24780. Loading1_12,
  24781. Loading1_13,
  24782. Loading1_14,
  24783. Loading1_15,
  24784. Loading1_16,
  24785. Loading1_17,
  24786. Loading1_18,
  24787. Loading1_19,
  24788. Loading1_20,
  24789. Loading1_21,
  24790. Loading1_22,
  24791. Loading1_23,
  24792. Loading1_24,
  24793. Loading1_25,
  24794. Loading1_26,
  24795. Loading1_27,
  24796. Loading1_28,
  24797. Loading1_29,
  24798. Loading1_30,
  24799. Loading1_31,
  24800. Loading1_32,
  24801. Loading1_33,
  24802. Loading1_34,
  24803. Loading1_35,
  24804. Loading1_36,
  24805. Loading1_37,
  24806. Loading1_38,
  24807. Loading1_39,
  24808. Loading1_40,
  24809. Loading1_41,
  24810. Loading1_42,
  24811. Loading1_43,
  24812. Loading1_44,
  24813. Loading1_45,
  24814. Loading1_46,
  24815. Loading1_47,
  24816. Loading1_48,
  24817. Loading1_49,
  24818. Loading1_50,
  24819. Loading1_51,
  24820. Loading1_52,
  24821. Loading1_53
  24822. } from './loadings/oneColor/index.js';
  24823. import { Loading2_0, Loading2_1, Loading2_2, Loading2_3, Loading2_4, Loading2_5 } from './loadings/twoColor/index.js';
  24824. import { Loading4_0, Loading4_1, Loading4_2, Loading4_3 } from './loadings/fourColor/index.js';
  24825. let {
  24826. type = '1_0',
  24827. height = '8',
  24828. width = '8',
  24829. theme = false,
  24830. inverse = false,
  24831. customColor = [],
  24832. lazyAnimation = true,
  24833. speed = $bindable(1)
  24834. }: LoadingProps = $props();
  24835. // loading 元素
  24836. // loading element
  24837. let loadingDom: HTMLDivElement | null = $state(null);
  24838. // 容器高度样式
  24839. // container height class
  24840. const heightClass = {
  24841. '2': 'h-2',
  24842. '4': 'h-4',
  24843. '6': 'h-6',
  24844. '8': 'h-8',
  24845. '12': 'h-12',
  24846. '16': 'h-16',
  24847. '20': 'h-20',
  24848. '28': 'h-28',
  24849. '36': 'h-36',
  24850. '48': 'h-48',
  24851. '56': 'h-56',
  24852. '64': 'h-64',
  24853. '72': 'h-72',
  24854. '80': 'h-80',
  24855. '96': 'h-96',
  24856. full: 'h-full'
  24857. };
  24858. // 容器宽度样式
  24859. // container width class
  24860. const widthClass = {
  24861. '2': 'w-2',
  24862. '4': 'w-4',
  24863. '6': 'w-6',
  24864. '8': 'w-8',
  24865. '12': 'w-12',
  24866. '16': 'w-16',
  24867. '20': 'w-20',
  24868. '28': 'w-28',
  24869. '36': 'w-36',
  24870. '48': 'w-48',
  24871. '56': 'w-56',
  24872. '64': 'w-64',
  24873. '72': 'w-72',
  24874. '80': 'w-80',
  24875. '96': 'w-96',
  24876. full: 'w-full'
  24877. };
  24878. // 组合容器高度和宽度样式
  24879. // combine container height and width class
  24880. const sizeFunc = (height: string, width: string) => {
  24881. return heightClass[height as keyof typeof heightClass] + ' ' + widthClass[width as keyof typeof widthClass];
  24882. };
  24883. // 递归获取 dom 的所有后代元素
  24884. // recursively get all descendants of dom
  24885. const getAllChildren = (dom: HTMLElement) => {
  24886. let children: HTMLElement[] = [];
  24887. if (dom?.children?.length) {
  24888. for (let i = 0; i < dom.children.length; i++) {
  24889. children.push(dom.children[i] as HTMLElement);
  24890. children = children.concat(getAllChildren(dom.children[i] as HTMLElement));
  24891. }
  24892. }
  24893. return children;
  24894. };
  24895. //判断 Loading 容器是否在可视区域内,如果不在,则设置所有后代元素的动画状态为 paused
  24896. //determine whether the Loading container is in the visible area. If not, set the animation state of all descendants to paused
  24897. const io = new IntersectionObserver((ele) => {
  24898. ele.forEach((item) => {
  24899. if (!loadingDom) return;
  24900. const loadingChildren = getAllChildren(loadingDom);
  24901. // isIntersecting 是一个 Boolean 值,判断目标元素当前是否可见
  24902. // isIntersecting is a Boolean value that determines whether the target element is currently visible
  24903. if (item.isIntersecting) {
  24904. //loadingDom 所有后代元素的 animation-play-state 设置为 running
  24905. //loadingDom all descendants of the element's animation-play-state set to running
  24906. if (loadingChildren.length > 0) {
  24907. loadingChildren.forEach((item: HTMLElement) => {
  24908. item.style.animationPlayState = 'running';
  24909. });
  24910. }
  24911. } else {
  24912. //loadingDom 所有后代元素的 animation-play-state 设置为 paused
  24913. //loadingDom all descendants of the element's animation-play-state set to paused
  24914. if (loadingChildren.length > 0) {
  24915. loadingChildren.forEach((item: HTMLElement) => {
  24916. item.style.animationPlayState = 'paused';
  24917. });
  24918. }
  24919. }
  24920. });
  24921. });
  24922. onMount(() => {
  24923. if (lazyAnimation && loadingDom) {
  24924. io.observe(loadingDom);
  24925. }
  24926. });
  24927. </script>
  24928. <div bind:this={loadingDom}>
  24929. <!--one-->
  24930. {#if type === '1_0'}
  24931. <Loading1_0 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24932. {:else if type === '1_1'}
  24933. <Loading1_1 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24934. {:else if type === '1_2'}
  24935. <Loading1_2 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24936. {:else if type === '1_3'}
  24937. <Loading1_3 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24938. {:else if type === '1_4'}
  24939. <Loading1_4 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24940. {:else if type === '1_5'}
  24941. <Loading1_5 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24942. {:else if type === '1_6'}
  24943. <Loading1_6 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24944. {:else if type === '1_7'}
  24945. <Loading1_7 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24946. {:else if type === '1_8'}
  24947. <Loading1_8 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24948. {:else if type === '1_9'}
  24949. <Loading1_9 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24950. {:else if type === '1_10'}
  24951. <Loading1_10 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24952. {:else if type === '1_11'}
  24953. <Loading1_11 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24954. {:else if type === '1_12'}
  24955. <Loading1_12 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24956. {:else if type === '1_13'}
  24957. <Loading1_13 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24958. {:else if type === '1_14'}
  24959. <Loading1_14 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24960. {:else if type === '1_15'}
  24961. <Loading1_15 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24962. {:else if type === '1_16'}
  24963. <Loading1_16 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24964. {:else if type === '1_17'}
  24965. <Loading1_17 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24966. {:else if type === '1_18'}
  24967. <Loading1_18 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24968. {:else if type === '1_19'}
  24969. <Loading1_19 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24970. {:else if type === '1_20'}
  24971. <Loading1_20 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24972. {:else if type === '1_21'}
  24973. <Loading1_21 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24974. {:else if type === '1_22'}
  24975. <Loading1_22 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24976. {:else if type === '1_23'}
  24977. <Loading1_23 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24978. {:else if type === '1_24'}
  24979. <Loading1_24 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24980. {:else if type === '1_25'}
  24981. <Loading1_25 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24982. {:else if type === '1_26'}
  24983. <Loading1_26 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24984. {:else if type === '1_27'}
  24985. <Loading1_27 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24986. {:else if type === '1_28'}
  24987. <Loading1_28 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24988. {:else if type === '1_29'}
  24989. <Loading1_29 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24990. {:else if type === '1_30'}
  24991. <Loading1_30 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24992. {:else if type === '1_31'}
  24993. <Loading1_31 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24994. {:else if type === '1_32'}
  24995. <Loading1_32 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24996. {:else if type === '1_33'}
  24997. <Loading1_33 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  24998. {:else if type === '1_34'}
  24999. <Loading1_34 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25000. {:else if type === '1_35'}
  25001. <Loading1_35 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25002. {:else if type === '1_36'}
  25003. <Loading1_36 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25004. {:else if type === '1_37'}
  25005. <Loading1_37 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25006. {:else if type === '1_38'}
  25007. <Loading1_38 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25008. {:else if type === '1_39'}
  25009. <Loading1_39 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25010. {:else if type === '1_40'}
  25011. <Loading1_40 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25012. {:else if type === '1_41'}
  25013. <Loading1_41 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25014. {:else if type === '1_42'}
  25015. <Loading1_42 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25016. {:else if type === '1_43'}
  25017. <Loading1_43 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25018. {:else if type === '1_44'}
  25019. <Loading1_44 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25020. {:else if type === '1_45'}
  25021. <Loading1_45 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25022. {:else if type === '1_46'}
  25023. <Loading1_46 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25024. {:else if type === '1_47'}
  25025. <Loading1_47 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25026. {:else if type === '1_48'}
  25027. <Loading1_48 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25028. {:else if type === '1_49'}
  25029. <Loading1_49 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25030. {:else if type === '1_50'}
  25031. <Loading1_50 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25032. {:else if type === '1_51'}
  25033. <Loading1_51 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25034. {:else if type === '1_52'}
  25035. <Loading1_52 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25036. {:else if type === '1_53'}
  25037. <Loading1_53 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25038. <!--twoColor-->
  25039. {:else if type === '2_0'}
  25040. <Loading2_0 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25041. {:else if type === '2_1'}<Loading2_1 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25042. {:else if type === '2_2'}<Loading2_2 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25043. {:else if type === '2_3'}<Loading2_3 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25044. {:else if type === '2_4'}<Loading2_4 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25045. {:else if type === '2_5'}<Loading2_5 {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25046. <!--fourColor-->
  25047. {:else if type === '4_0'}
  25048. <Loading4_0 size={sizeFunc(height, width)} {customColor} bind:speed />
  25049. {:else if type === '4_1'}
  25050. <Loading4_1 size={sizeFunc(height, width)} {customColor} bind:speed />
  25051. {:else if type === '4_2'}
  25052. <Loading4_2 size={sizeFunc(height, width)} {customColor} bind:speed />
  25053. {:else if type === '4_3'}
  25054. <Loading4_3 size={sizeFunc(height, width)} {customColor} bind:speed />
  25055. {:else}
  25056. <Loading1_0 {theme} {inverse} size={sizeFunc(height, width)} {customColor} bind:speed />
  25057. {/if}
  25058. </div>
  25059. ================================================
  25060. FILE: packages/stdf/src/lib/components/loading/loadings/fourColor/4_0.svelte
  25061. ================================================
  25062. <script lang="ts">
  25063. type Props = { size?: string; customColor?: string[]; speed?: number };
  25064. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25065. </script>
  25066. <div
  25067. class="{size} loading m-auto rounded-full border-4"
  25068. style="border-color: {customColor[0] || '#DA1414'} {customColor[1] || '#11BB8D'} {customColor[2] || '#7356BF'} {customColor[3] ||
  25069. '#FFC043'};animation-duration: {2 / speed}s;-webkit-animation-duration: {2 / speed}s;"
  25070. ></div>
  25071. <style>
  25072. .loading {
  25073. animation: loading-animation 2s ease-in-out infinite alternate;
  25074. }
  25075. @keyframes loading-animation {
  25076. from {
  25077. transform: rotate(0deg);
  25078. }
  25079. to {
  25080. transform: rotate(720deg);
  25081. }
  25082. }
  25083. </style>
  25084. ================================================
  25085. FILE: packages/stdf/src/lib/components/loading/loadings/fourColor/4_1.svelte
  25086. ================================================
  25087. <script lang="ts">
  25088. type Props = { size?: string; customColor?: string[]; speed?: number };
  25089. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25090. </script>
  25091. <div class="{size} relative m-auto rotate-45">
  25092. <div
  25093. class="shape1 absolute left-0 top-0 h-1/3 w-1/3"
  25094. style="background: {customColor[0] || '#DA1414'};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25095. ></div>
  25096. <div
  25097. class="shape2 absolute right-0 top-0 h-1/3 w-1/3"
  25098. style="background: {customColor[1] || '#11BB8D'};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25099. ></div>
  25100. <div
  25101. class="shape3 absolute bottom-0 right-0 h-1/3 w-1/3"
  25102. style="background: {customColor[2] || '#7356BF'};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25103. ></div>
  25104. <div
  25105. class="shape4 absolute bottom-0 left-0 h-1/3 w-1/3"
  25106. style="background: {customColor[3] || '#FFC043'};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25107. ></div>
  25108. </div>
  25109. <style>
  25110. .shape1 {
  25111. animation: animationShape1 0.5s ease infinite alternate;
  25112. }
  25113. .shape2 {
  25114. animation: animationShape2 0.5s ease infinite alternate;
  25115. }
  25116. .shape3 {
  25117. animation: animationShape3 0.5s ease infinite alternate;
  25118. }
  25119. .shape4 {
  25120. animation: animationShape4 0.5s ease infinite alternate;
  25121. }
  25122. @keyframes animationShape1 {
  25123. 0% {
  25124. transform: translate(0, 0);
  25125. }
  25126. 100% {
  25127. transform: translate(16px, 16px);
  25128. }
  25129. }
  25130. @keyframes animationShape2 {
  25131. 0% {
  25132. transform: translate(0, 0);
  25133. }
  25134. 100% {
  25135. transform: translate(-16px, 16px);
  25136. }
  25137. }
  25138. @keyframes animationShape3 {
  25139. 0% {
  25140. transform: translate(0, 0);
  25141. }
  25142. 100% {
  25143. transform: translate(-16px, -16px);
  25144. }
  25145. }
  25146. @keyframes animationShape4 {
  25147. 0% {
  25148. transform: translate(0, 0);
  25149. }
  25150. 100% {
  25151. transform: translate(16px, -16px);
  25152. }
  25153. }
  25154. </style>
  25155. ================================================
  25156. FILE: packages/stdf/src/lib/components/loading/loadings/fourColor/4_2.svelte
  25157. ================================================
  25158. <script lang="ts">
  25159. type Props = { size?: string; customColor?: string[]; speed?: number };
  25160. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25161. </script>
  25162. <div class="{size} loading relative m-auto" style="animation-duration: {1.6 / speed}s;-webkit-animation-duration: {1.6 / speed}s;">
  25163. <div
  25164. class="shape1 absolute h-1/3 w-1/3 rounded-full"
  25165. style="background: {customColor[0] || '#DA1414'};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25166. ></div>
  25167. <div
  25168. class="shape2 absolute h-1/3 w-1/3 rounded-full"
  25169. style="background: {customColor[1] || '#11BB8D'};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25170. ></div>
  25171. <div
  25172. class="shape3 absolute h-1/3 w-1/3 rounded-full"
  25173. style="background: {customColor[2] || '#7356BF'};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25174. ></div>
  25175. <div
  25176. class="shape4 absolute h-1/3 w-1/3 rounded-full"
  25177. style="background: {customColor[3] || '#FFC043'};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25178. ></div>
  25179. </div>
  25180. <style>
  25181. .loading {
  25182. animation: animationContainer 1.6s ease infinite;
  25183. }
  25184. .shape1 {
  25185. animation: animationShape1 0.8s ease infinite alternate;
  25186. }
  25187. .shape2 {
  25188. animation: animationShape2 0.8s ease infinite alternate;
  25189. }
  25190. .shape3 {
  25191. animation: animationShape3 0.8s ease infinite alternate;
  25192. }
  25193. .shape4 {
  25194. animation: animationShape4 0.8s ease infinite alternate;
  25195. }
  25196. @keyframes animationContainer {
  25197. 0% {
  25198. transform: rotate(0);
  25199. }
  25200. 100% {
  25201. transform: rotate(360deg);
  25202. }
  25203. }
  25204. @keyframes animationShape1 {
  25205. 0% {
  25206. top: 0;
  25207. left: 0;
  25208. }
  25209. 100% {
  25210. top: 66.6666666667%;
  25211. left: 66.6666666667%;
  25212. }
  25213. }
  25214. @keyframes animationShape2 {
  25215. 0% {
  25216. top: 0;
  25217. left: 66.6666666667%;
  25218. }
  25219. 100% {
  25220. top: 66.6666666667%;
  25221. left: 0;
  25222. }
  25223. }
  25224. @keyframes animationShape3 {
  25225. 0% {
  25226. top: 66.6666666667%;
  25227. left: 66.6666666667%;
  25228. }
  25229. 100% {
  25230. top: 0;
  25231. left: 0;
  25232. }
  25233. }
  25234. @keyframes animationShape4 {
  25235. 0% {
  25236. top: 66.6666666667%;
  25237. left: 0;
  25238. }
  25239. 100% {
  25240. top: 0;
  25241. left: 66.6666666667%;
  25242. }
  25243. }
  25244. </style>
  25245. ================================================
  25246. FILE: packages/stdf/src/lib/components/loading/loadings/fourColor/4_3.svelte
  25247. ================================================
  25248. <script lang="ts">
  25249. type Props = { size?: string; customColor?: string[]; speed?: number };
  25250. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25251. </script>
  25252. <div class="{size} loading relative m-auto" style="animation-duration: {1.2 / speed}s;-webkit-animation-duration: {1.2 / speed}s;">
  25253. <div
  25254. class="shape1 absolute h-1/2 w-1/2 rounded-tl-full"
  25255. style="background: {customColor[0] || '#DA1414'};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  25256. ></div>
  25257. <div
  25258. class="shape2 absolute h-1/2 w-1/2 rounded-tr-full"
  25259. style="background: {customColor[1] || '#11BB8D'};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  25260. ></div>
  25261. <div
  25262. class="shape3 absolute h-1/2 w-1/2 rounded-br-full"
  25263. style="background: {customColor[2] || '#7356BF'};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  25264. ></div>
  25265. <div
  25266. class="shape4 absolute h-1/2 w-1/2 rounded-bl-full"
  25267. style="background: {customColor[3] || '#FFC043'};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  25268. ></div>
  25269. </div>
  25270. <style>
  25271. .loading {
  25272. animation: animationContainer 1.2s ease infinite;
  25273. }
  25274. .shape1 {
  25275. animation: animationShape1 0.6s ease infinite alternate;
  25276. }
  25277. .shape2 {
  25278. animation: animationShape2 0.6s ease infinite alternate;
  25279. }
  25280. .shape3 {
  25281. animation: animationShape3 0.6s ease infinite alternate;
  25282. }
  25283. .shape4 {
  25284. animation: animationShape4 0.6s ease infinite alternate;
  25285. }
  25286. @keyframes animationContainer {
  25287. 0% {
  25288. transform: rotate(0);
  25289. }
  25290. 100% {
  25291. transform: rotate(360deg);
  25292. }
  25293. }
  25294. @keyframes animationShape1 {
  25295. 0% {
  25296. top: 0;
  25297. left: 0;
  25298. }
  25299. 100% {
  25300. top: -10%;
  25301. left: -10%;
  25302. }
  25303. }
  25304. @keyframes animationShape2 {
  25305. 0% {
  25306. top: 0;
  25307. left: 50%;
  25308. }
  25309. 100% {
  25310. top: -10%;
  25311. left: 60%;
  25312. }
  25313. }
  25314. @keyframes animationShape3 {
  25315. 0% {
  25316. top: 50%;
  25317. left: 50%;
  25318. }
  25319. 100% {
  25320. top: 60%;
  25321. left: 60%;
  25322. }
  25323. }
  25324. @keyframes animationShape4 {
  25325. 0% {
  25326. top: 50%;
  25327. left: 0;
  25328. }
  25329. 100% {
  25330. top: 60%;
  25331. left: -10%;
  25332. }
  25333. }
  25334. </style>
  25335. ================================================
  25336. FILE: packages/stdf/src/lib/components/loading/loadings/fourColor/index.ts
  25337. ================================================
  25338. export { default as Loading4_0 } from './4_0.svelte';
  25339. export { default as Loading4_1 } from './4_1.svelte';
  25340. export { default as Loading4_2 } from './4_2.svelte';
  25341. export { default as Loading4_3 } from './4_3.svelte';
  25342. ================================================
  25343. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_0.svelte
  25344. ================================================
  25345. <script lang="ts">
  25346. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  25347. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25348. const colorClass = () => {
  25349. if (inverse) {
  25350. return theme ? ' text-dark dark:text-primary' : ' text-white dark:text-black';
  25351. } else {
  25352. return theme ? ' text-primary dark:text-dark' : ' text-black dark:text-white';
  25353. }
  25354. };
  25355. </script>
  25356. <div class="{size} m-auto">
  25357. <svg
  25358. viewBox="0 0 24 24"
  25359. class="animate-spin{colorClass()}"
  25360. style="color: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25361. >
  25362. <circle cx="12" cy="12" r="10" stroke-width="4" fill="none" class="opacity-5" stroke="currentColor" />
  25363. <circle
  25364. cx="12"
  25365. cy="12"
  25366. r="10"
  25367. stroke-width="4"
  25368. class="opacity-80"
  25369. stroke="currentColor"
  25370. fill="none"
  25371. stroke-dashoffset="46.07669455648491"
  25372. stroke-dasharray="69.11503837897544"
  25373. stroke-linecap="round"
  25374. />
  25375. </svg>
  25376. </div>
  25377. ================================================
  25378. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_1.svelte
  25379. ================================================
  25380. <script lang="ts">
  25381. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  25382. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25383. const colorClass = () => {
  25384. if (inverse) {
  25385. return theme ? ' border-dark dark:border-primary' : ' border-white dark:border-black';
  25386. } else {
  25387. return theme ? ' border-primary dark:border-dark' : ' border-black dark:border-white';
  25388. }
  25389. };
  25390. </script>
  25391. <div
  25392. class="{size} m-auto border-2{colorClass()} animate-spin rounded-full border-t-transparent dark:border-t-transparent"
  25393. style="border-color: {customColor[0]};border-top-color:transparent;animation-duration: {1 / speed}s;-webkit-animation-duration: {1 /
  25394. speed}s;"
  25395. ></div>
  25396. ================================================
  25397. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_10.svelte
  25398. ================================================
  25399. <script lang="ts">
  25400. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25401. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25402. const colorClass = () => {
  25403. if (inverse) {
  25404. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25405. } else {
  25406. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25407. }
  25408. };
  25409. </script>
  25410. <div class="{size} m-auto flex items-center justify-between">
  25411. {#each [0, 1, 2] as i}
  25412. <div
  25413. class="{colorClass()} loading h-2 w-2 rounded-full"
  25414. style="animation-delay: {i === 1 ? -0.3 : 0}s;background: {customColor[0]};animation-duration: {1 /
  25415. speed}s;-webkit-animation-duration: {1 / speed}s;"
  25416. ></div>
  25417. {/each}
  25418. </div>
  25419. <style>
  25420. .loading {
  25421. animation: loading 1s infinite linear;
  25422. }
  25423. @keyframes loading {
  25424. 50% {
  25425. opacity: 0.2;
  25426. transform: scale(0.75);
  25427. }
  25428. 100% {
  25429. opacity: 1;
  25430. transform: scale(1.2);
  25431. }
  25432. }
  25433. </style>
  25434. ================================================
  25435. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_11.svelte
  25436. ================================================
  25437. <script lang="ts">
  25438. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25439. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25440. const colorClass = () => {
  25441. if (inverse) {
  25442. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25443. } else {
  25444. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25445. }
  25446. };
  25447. </script>
  25448. <div class="{size} relative m-auto">
  25449. {#each [0, 1, 2, 3, 4] as i}
  25450. <div
  25451. class="absolute -left-1/2 top-1/4{colorClass()} loading h-4 w-4 rounded-full opacity-60"
  25452. style="animation-delay: {-0.5 * i}s, {-0.5 * (i + 1)}s;top:calc(5);background: {customColor[0]};animation-duration: {2.5 /
  25453. speed}s;-webkit-animation-duration: {2.5 / speed}s;"
  25454. ></div>
  25455. {/each}
  25456. </div>
  25457. <style>
  25458. .loading {
  25459. animation:
  25460. loading1 2.5s infinite cubic-bezier(0.25, 0, 0.75, 1),
  25461. loading2 2.5s infinite cubic-bezier(0.25, 0, 0.75, 1);
  25462. }
  25463. @keyframes loading1 {
  25464. 50% {
  25465. left: 100%;
  25466. }
  25467. }
  25468. @keyframes loading2 {
  25469. 50% {
  25470. transform: scale(0.3, 0.3);
  25471. }
  25472. }
  25473. </style>
  25474. ================================================
  25475. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_12.svelte
  25476. ================================================
  25477. <script lang="ts">
  25478. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25479. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25480. const colorClass = () => {
  25481. if (inverse) {
  25482. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25483. } else {
  25484. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25485. }
  25486. };
  25487. </script>
  25488. <div class="{size} loading relative m-auto box-border">
  25489. <div
  25490. class="absolute{colorClass()} ball rounded-full"
  25491. style="background: {customColor[0]};animation-duration: {speed >= 1 ? 0.6 / speed : 0.6}s;-webkit-animation-duration: {speed >= 1
  25492. ? 0.6 / speed
  25493. : 0.6}s;"
  25494. ></div>
  25495. <div
  25496. class="absolute top-0 right-0{colorClass()} steps step1"
  25497. style="background: {customColor[0]};animation-duration: {speed >= 1 ? 1.8 / speed : 1.8}s;-webkit-animation-duration: {speed >= 1
  25498. ? 1.8 / speed
  25499. : 1.8}s;"
  25500. ></div>
  25501. <div
  25502. class="absolute top-0 right-0{colorClass()} steps step2"
  25503. style="background: {customColor[0]};animation-duration: {speed >= 1 ? 1.8 / speed : 1.8}s;-webkit-animation-duration: {speed >= 1
  25504. ? 1.8 / speed
  25505. : 1.8}s;"
  25506. ></div>
  25507. <div
  25508. class="absolute top-0 right-0{colorClass()} steps step3"
  25509. style="background: {customColor[0]};animation-duration: {speed >= 1 ? 1.8 / speed : 1.8}s;-webkit-animation-duration: {speed >= 1
  25510. ? 1.8 / speed
  25511. : 1.8}s;"
  25512. ></div>
  25513. </div>
  25514. <style>
  25515. .loading {
  25516. width: 42px;
  25517. height: 32px;
  25518. }
  25519. .ball {
  25520. bottom: 32%;
  25521. left: 18%;
  25522. width: 14px;
  25523. height: 14px;
  25524. transform-origin: center bottom;
  25525. animation: ball-climbing-dot-jump 0.6s ease-in-out infinite;
  25526. }
  25527. .steps {
  25528. width: 14px;
  25529. height: 2px;
  25530. transform: translate(60%, 0);
  25531. animation: ball-climbing-dot-steps 1.8s linear infinite;
  25532. }
  25533. .step1 {
  25534. animation-delay: 0ms;
  25535. }
  25536. .step2 {
  25537. animation-delay: -600ms;
  25538. }
  25539. .step3 {
  25540. animation-delay: -1200ms;
  25541. }
  25542. @keyframes ball-climbing-dot-jump {
  25543. 0% {
  25544. transform: scale(1, 0.8);
  25545. }
  25546. 20% {
  25547. transform: scale(0.8, 1.1);
  25548. }
  25549. 40% {
  25550. transform: scale(1, 1);
  25551. }
  25552. 50% {
  25553. bottom: 125%;
  25554. }
  25555. 46% {
  25556. transform: scale(1, 1);
  25557. }
  25558. 80% {
  25559. transform: scale(0.8, 1.1);
  25560. }
  25561. 90% {
  25562. transform: scale(0.8, 1.1);
  25563. }
  25564. 100% {
  25565. transform: scale(1, 0.8);
  25566. }
  25567. }
  25568. @keyframes ball-climbing-dot-steps {
  25569. 0% {
  25570. top: 0;
  25571. right: 0;
  25572. opacity: 0;
  25573. }
  25574. 50% {
  25575. opacity: 1;
  25576. }
  25577. 100% {
  25578. top: 100%;
  25579. right: 100%;
  25580. opacity: 0;
  25581. }
  25582. }
  25583. </style>
  25584. ================================================
  25585. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_13.svelte
  25586. ================================================
  25587. <script lang="ts">
  25588. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25589. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25590. const colorClass = () => {
  25591. if (inverse) {
  25592. return theme ? ' border-dark dark:border-primary' : ' border-white dark:border-black';
  25593. } else {
  25594. return theme ? ' border-primary dark:border-dark' : ' border-black dark:border-white';
  25595. }
  25596. };
  25597. </script>
  25598. <div class="{size} relative m-auto box-border">
  25599. <div
  25600. class="absolute left-1/2 top-1/2 {size} m-auto border-2 !border-l-transparent !border-r-transparent rounded-full{colorClass()} loading"
  25601. style="border-color: {customColor[0]};animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  25602. ></div>
  25603. <div
  25604. class="absolute left-1/2 top-1/2 m-auto h-1/2 w-1/2 border-2 !border-b-transparent !border-t-transparent rounded-full{colorClass()} loading"
  25605. style="animation-direction: reverse;border-color: {customColor[0]};animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 /
  25606. speed}s;"
  25607. ></div>
  25608. </div>
  25609. <style>
  25610. .loading {
  25611. animation: ball-clip-rotate-multiple-rotate 1.5s ease-in-out infinite;
  25612. }
  25613. @keyframes ball-clip-rotate-multiple-rotate {
  25614. 0% {
  25615. transform: translate(-50%, -50%) rotate(0deg);
  25616. }
  25617. 50% {
  25618. transform: translate(-50%, -50%) rotate(180deg);
  25619. }
  25620. 100% {
  25621. transform: translate(-50%, -50%) rotate(360deg);
  25622. }
  25623. }
  25624. </style>
  25625. ================================================
  25626. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_14.svelte
  25627. ================================================
  25628. <script lang="ts">
  25629. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25630. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25631. const borderClass = () => {
  25632. if (inverse) {
  25633. return theme ? ' border-dark dark:border-primary' : ' border-white dark:border-black';
  25634. } else {
  25635. return theme ? ' border-primary dark:border-dark' : ' border-black dark:border-white';
  25636. }
  25637. };
  25638. const colorClass = () => {
  25639. if (inverse) {
  25640. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25641. } else {
  25642. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25643. }
  25644. };
  25645. </script>
  25646. <div class="{size} relative m-auto">
  25647. <div
  25648. class="absolute h-full w-full border-2 !border-l-transparent !border-r-transparent rounded-full{borderClass()} loading1"
  25649. style="border-color: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25650. ></div>
  25651. <div
  25652. class="absolute left-1/4 top-1/4 h-1/2 w-1/2 rounded-full{colorClass()} loading2"
  25653. style="background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25654. ></div>
  25655. </div>
  25656. <style>
  25657. .loading1 {
  25658. animation: ball-clip-rotate-multiple-rotate 1s ease-in-out infinite;
  25659. }
  25660. .loading2 {
  25661. animation: ball-clip-rotate-pulse-scale 1s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;
  25662. }
  25663. @keyframes ball-clip-rotate-multiple-rotate {
  25664. 0% {
  25665. transform: rotate(0deg);
  25666. }
  25667. 50% {
  25668. transform: rotate(180deg);
  25669. }
  25670. 100% {
  25671. transform: rotate(360deg);
  25672. }
  25673. }
  25674. @keyframes ball-clip-rotate-pulse-scale {
  25675. 0%,
  25676. 100% {
  25677. opacity: 1;
  25678. transform: scale(1);
  25679. }
  25680. 30% {
  25681. opacity: 0.3;
  25682. transform: scale(0.15);
  25683. }
  25684. }
  25685. </style>
  25686. ================================================
  25687. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_15.svelte
  25688. ================================================
  25689. <script lang="ts">
  25690. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  25691. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25692. const colorClass = () => {
  25693. if (inverse) {
  25694. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25695. } else {
  25696. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25697. }
  25698. };
  25699. </script>
  25700. <div class="{size} relative m-auto">
  25701. <div
  25702. class="absolute{colorClass()} loading1 top-1/2 h-1/4 w-1/4 rounded-full"
  25703. style="left:0;background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25704. ></div>
  25705. <div
  25706. class="absolute{colorClass()} loading2 top-1/2 h-1/4 w-1/4 rounded-full"
  25707. style="left:25%;background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25708. ></div>
  25709. <div
  25710. class="absolute{colorClass()} loading3 top-1/2 h-1/4 w-1/4 rounded-full"
  25711. style="left:50%;background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25712. ></div>
  25713. <div
  25714. class="absolute{colorClass()} loading4 top-1/2 h-1/4 w-1/4 rounded-full"
  25715. style="left:75%;background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25716. ></div>
  25717. <div
  25718. class="absolute{colorClass()} loading5 top-1/2 h-1/4 w-1/4 rounded-full"
  25719. style="left:100%;background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  25720. ></div>
  25721. </div>
  25722. <style>
  25723. .loading1 {
  25724. animation: ball-elastic-dots-anim1 1s infinite;
  25725. }
  25726. .loading2 {
  25727. animation: ball-elastic-dots-anim2 1s infinite;
  25728. }
  25729. .loading3 {
  25730. animation: ball-elastic-dots-anim3 1s infinite;
  25731. }
  25732. .loading4 {
  25733. animation: ball-elastic-dots-anim4 1s infinite;
  25734. }
  25735. .loading5 {
  25736. animation: ball-elastic-dots-anim5 1s infinite;
  25737. }
  25738. @keyframes ball-elastic-dots-anim1 {
  25739. 0%,
  25740. 100% {
  25741. left: 0;
  25742. transform: translateX(-50%) translateY(-50%) scale(1);
  25743. }
  25744. 50% {
  25745. left: -50%;
  25746. transform: translateX(-50%) translateY(-50%) scale(0.67);
  25747. }
  25748. }
  25749. @keyframes ball-elastic-dots-anim2 {
  25750. 0%,
  25751. 100% {
  25752. left: 25%;
  25753. transform: translateX(-50%) translateY(-50%) scale(1);
  25754. }
  25755. 50% {
  25756. left: 0%;
  25757. transform: translateX(-50%) translateY(-50%) scale(0.67);
  25758. }
  25759. }
  25760. @keyframes ball-elastic-dots-anim3 {
  25761. 0%,
  25762. 100% {
  25763. left: 50%;
  25764. transform: translateX(-50%) translateY(-50%) scale(1);
  25765. }
  25766. 50% {
  25767. left: 50%;
  25768. transform: translateX(-50%) translateY(-50%) scale(0.67);
  25769. }
  25770. }
  25771. @keyframes ball-elastic-dots-anim4 {
  25772. 0%,
  25773. 100% {
  25774. left: 75%;
  25775. transform: translateX(-50%) translateY(-50%) scale(1);
  25776. }
  25777. 50% {
  25778. left: 100%;
  25779. transform: translateX(-50%) translateY(-50%) scale(0.67);
  25780. }
  25781. }
  25782. @keyframes ball-elastic-dots-anim5 {
  25783. 0%,
  25784. 100% {
  25785. left: 100%;
  25786. transform: translateX(-50%) translateY(-50%) scale(1);
  25787. }
  25788. 50% {
  25789. left: 150%;
  25790. transform: translateX(-50%) translateY(-50%) scale(0.67);
  25791. }
  25792. }
  25793. </style>
  25794. ================================================
  25795. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_16.svelte
  25796. ================================================
  25797. <script lang="ts">
  25798. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25799. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25800. const colorClass = () => {
  25801. if (inverse) {
  25802. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25803. } else {
  25804. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25805. }
  25806. };
  25807. </script>
  25808. <div class="{size} m-auto flex items-center justify-between">
  25809. {#each [0, 1, 2] as i}
  25810. <div
  25811. class="{colorClass()} loading h-2 w-2 rounded-full"
  25812. style="animation-delay: {i * 100 - 300}ms;background: {customColor[0]};animation-duration: {1 /
  25813. speed}s;-webkit-animation-duration: {1 / speed}s;"
  25814. ></div>
  25815. {/each}
  25816. </div>
  25817. <style>
  25818. .loading {
  25819. animation: ball-fall 1s ease-in-out infinite;
  25820. }
  25821. @keyframes ball-fall {
  25822. 0% {
  25823. opacity: 0;
  25824. transform: translateY(-145%);
  25825. }
  25826. 10% {
  25827. opacity: 0.5;
  25828. }
  25829. 20% {
  25830. opacity: 1;
  25831. transform: translateY(0);
  25832. }
  25833. 80% {
  25834. opacity: 1;
  25835. transform: translateY(0);
  25836. }
  25837. 90% {
  25838. opacity: 0.5;
  25839. }
  25840. 100% {
  25841. opacity: 0;
  25842. transform: translateY(145%);
  25843. }
  25844. }
  25845. </style>
  25846. ================================================
  25847. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_17.svelte
  25848. ================================================
  25849. <script lang="ts">
  25850. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  25851. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  25852. const colorClass = () => {
  25853. if (inverse) {
  25854. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25855. } else {
  25856. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25857. }
  25858. };
  25859. </script>
  25860. <div class="{size} m-auto flex items-center justify-between">
  25861. {#each [0, 1, 2] as i}
  25862. <div
  25863. class="{colorClass()} loading h-2 w-2 rounded-full"
  25864. style="animation-delay: {i * 100 - 300}ms;background: {customColor[0]};animation-duration: {1 /
  25865. speed}s;-webkit-animation-duration: {1 / speed}s;"
  25866. ></div>
  25867. {/each}
  25868. </div>
  25869. <style>
  25870. .loading {
  25871. animation: ball-pulse 1s ease infinite;
  25872. }
  25873. @keyframes ball-pulse {
  25874. 0%,
  25875. 60%,
  25876. 100% {
  25877. opacity: 1;
  25878. transform: scale(1);
  25879. }
  25880. 30% {
  25881. opacity: 0.1;
  25882. transform: scale(0.1);
  25883. }
  25884. }
  25885. </style>
  25886. ================================================
  25887. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_18.svelte
  25888. ================================================
  25889. <script lang="ts">
  25890. type Props = { size?: string; customColor?: any[]; speed?: number; theme?: boolean; inverse?: boolean };
  25891. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), theme = false, inverse = false }: Props = $props();
  25892. const colorClass = () => {
  25893. if (inverse) {
  25894. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25895. } else {
  25896. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25897. }
  25898. };
  25899. </script>
  25900. <div class="{size} relative m-auto rotate-45">
  25901. <div
  25902. class="shape1 absolute left-0 top-0 h-1/3 w-1/3 {colorClass()}"
  25903. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25904. ></div>
  25905. <div
  25906. class="shape2 absolute right-0 top-0 h-1/3 w-1/3 {colorClass()}"
  25907. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25908. ></div>
  25909. <div
  25910. class="shape3 absolute bottom-0 right-0 h-1/3 w-1/3 {colorClass()}"
  25911. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25912. ></div>
  25913. <div
  25914. class="shape4 absolute bottom-0 left-0 h-1/3 w-1/3 {colorClass()}"
  25915. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  25916. ></div>
  25917. </div>
  25918. <style>
  25919. .shape1 {
  25920. animation: animationShape1 0.5s ease infinite alternate;
  25921. }
  25922. .shape2 {
  25923. animation: animationShape2 0.5s ease infinite alternate;
  25924. }
  25925. .shape3 {
  25926. animation: animationShape3 0.5s ease infinite alternate;
  25927. }
  25928. .shape4 {
  25929. animation: animationShape4 0.5s ease infinite alternate;
  25930. }
  25931. @keyframes animationShape1 {
  25932. 0% {
  25933. transform: translate(0, 0);
  25934. }
  25935. 100% {
  25936. transform: translate(16px, 16px);
  25937. }
  25938. }
  25939. @keyframes animationShape2 {
  25940. 0% {
  25941. transform: translate(0, 0);
  25942. }
  25943. 100% {
  25944. transform: translate(-16px, 16px);
  25945. }
  25946. }
  25947. @keyframes animationShape3 {
  25948. 0% {
  25949. transform: translate(0, 0);
  25950. }
  25951. 100% {
  25952. transform: translate(-16px, -16px);
  25953. }
  25954. }
  25955. @keyframes animationShape4 {
  25956. 0% {
  25957. transform: translate(0, 0);
  25958. }
  25959. 100% {
  25960. transform: translate(16px, -16px);
  25961. }
  25962. }
  25963. </style>
  25964. ================================================
  25965. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_19.svelte
  25966. ================================================
  25967. <script lang="ts">
  25968. type Props = { size?: string; customColor?: any[]; speed?: number; theme?: boolean; inverse?: boolean };
  25969. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), theme = false, inverse = false }: Props = $props();
  25970. const colorClass = () => {
  25971. if (inverse) {
  25972. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  25973. } else {
  25974. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  25975. }
  25976. };
  25977. </script>
  25978. <div class="{size} loading relative m-auto" style="animation-duration: {1.6 / speed}s;-webkit-animation-duration: {1.6 / speed}s;">
  25979. <div
  25980. class="shape1 absolute h-1/3 w-1/3 rounded-full {colorClass()}"
  25981. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25982. ></div>
  25983. <div
  25984. class="shape2 absolute h-1/3 w-1/3 rounded-full {colorClass()}"
  25985. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25986. ></div>
  25987. <div
  25988. class="shape3 absolute h-1/3 w-1/3 rounded-full {colorClass()}"
  25989. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25990. ></div>
  25991. <div
  25992. class="shape4 absolute h-1/3 w-1/3 rounded-full {colorClass()}"
  25993. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  25994. ></div>
  25995. </div>
  25996. <style>
  25997. .loading {
  25998. animation: animationContainer 1.6s ease infinite;
  25999. }
  26000. .shape1 {
  26001. animation: animationShape1 0.8s ease infinite alternate;
  26002. }
  26003. .shape2 {
  26004. animation: animationShape2 0.8s ease infinite alternate;
  26005. }
  26006. .shape3 {
  26007. animation: animationShape3 0.8s ease infinite alternate;
  26008. }
  26009. .shape4 {
  26010. animation: animationShape4 0.8s ease infinite alternate;
  26011. }
  26012. @keyframes animationContainer {
  26013. 0% {
  26014. transform: rotate(0);
  26015. }
  26016. 100% {
  26017. transform: rotate(360deg);
  26018. }
  26019. }
  26020. @keyframes animationShape1 {
  26021. 0% {
  26022. top: 0;
  26023. left: 0;
  26024. }
  26025. 100% {
  26026. top: 66.6666666667%;
  26027. left: 66.6666666667%;
  26028. }
  26029. }
  26030. @keyframes animationShape2 {
  26031. 0% {
  26032. top: 0;
  26033. left: 66.6666666667%;
  26034. }
  26035. 100% {
  26036. top: 66.6666666667%;
  26037. left: 0;
  26038. }
  26039. }
  26040. @keyframes animationShape3 {
  26041. 0% {
  26042. top: 66.6666666667%;
  26043. left: 66.6666666667%;
  26044. }
  26045. 100% {
  26046. top: 0;
  26047. left: 0;
  26048. }
  26049. }
  26050. @keyframes animationShape4 {
  26051. 0% {
  26052. top: 66.6666666667%;
  26053. left: 0;
  26054. }
  26055. 100% {
  26056. top: 0;
  26057. left: 66.6666666667%;
  26058. }
  26059. }
  26060. </style>
  26061. ================================================
  26062. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_2.svelte
  26063. ================================================
  26064. <script lang="ts">
  26065. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  26066. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26067. const colorClass = () => {
  26068. if (inverse) {
  26069. return theme
  26070. ? ' border-dark/5 border-l-dark/[1] dark:border-primary/5 dark:border-l-primary/[1]'
  26071. : ' border-white/5 border-l-white/[1] dark:border-black/5 dark:border-l-black/[1]';
  26072. } else {
  26073. return theme
  26074. ? ' border-primary/5 border-l-primary/[1] dark:border-dark/5 dark:border-l-dark/[1]'
  26075. : ' border-black/5 border-l-black/[1] dark:border-white/5 dark:border-l-white/[1]';
  26076. }
  26077. };
  26078. </script>
  26079. <div
  26080. class="{size} m-auto animate-spin rounded-full border-2 {colorClass()}"
  26081. style="border-color:{customColor[0] + '0D'};border-left-color:{customColor[0] + 'FF'};animation-duration: {1 /
  26082. speed}s;-webkit-animation-duration: {1 / speed}s;"
  26083. ></div>
  26084. ================================================
  26085. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_20.svelte
  26086. ================================================
  26087. <script lang="ts">
  26088. type Props = { size?: string; customColor?: any[]; speed?: number; theme?: boolean; inverse?: boolean };
  26089. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), theme = false, inverse = false }: Props = $props();
  26090. const colorClass = () => {
  26091. if (inverse) {
  26092. return theme
  26093. ? ' border-dark/5 border-l-dark/[1] dark:border-primary/5 dark:border-l-primary/[1] border-r-dark/[1] dark:border-r-primary/[1]'
  26094. : ' border-white/5 border-l-white/[1] dark:border-black/5 dark:border-l-black/[1] border-r-white/[1] dark:border-r-black/[1]';
  26095. } else {
  26096. return theme
  26097. ? ' border-primary/5 dark:border-dark/5 border-l-primary/[1] dark:border-l-dark/[1] border-r-primary/[1] dark:border-r-dark/[1]'
  26098. : ' border-black/5 dark:border-white/5 border-l-black/[1] dark:border-l-white/[1] border-r-black/[1] dark:border-r-white/[1]';
  26099. }
  26100. };
  26101. </script>
  26102. <div
  26103. class="{size} loading m-auto rounded-full border-4 {colorClass()}"
  26104. style="border-color: {customColor[0] + '0D'} {customColor[0] + 'FF'} {customColor[0] + '0D'} {customColor[0] +
  26105. 'FF'};animation-duration: {2 / speed}s;-webkit-animation-duration: {2 / speed}s;"
  26106. ></div>
  26107. <style>
  26108. .loading {
  26109. animation: loading-animation 2s ease-in-out infinite alternate;
  26110. }
  26111. @keyframes loading-animation {
  26112. from {
  26113. transform: rotate(0deg);
  26114. }
  26115. to {
  26116. transform: rotate(720deg);
  26117. }
  26118. }
  26119. </style>
  26120. ================================================
  26121. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_21.svelte
  26122. ================================================
  26123. <script lang="ts">
  26124. type Props = { size?: string; customColor?: any[]; speed?: number; theme?: boolean; inverse?: boolean };
  26125. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), theme = false, inverse = false }: Props = $props();
  26126. const colorClass = () => {
  26127. if (inverse) {
  26128. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26129. } else {
  26130. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26131. }
  26132. };
  26133. </script>
  26134. <div class="{size} loading relative m-auto" style="animation-duration: {1.2 / speed}s;-webkit-animation-duration: {1.2 / speed}s;">
  26135. <div
  26136. class="shape1 absolute h-1/2 w-1/2 rounded-tl-full {colorClass()}"
  26137. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  26138. ></div>
  26139. <div
  26140. class="shape2 absolute h-1/2 w-1/2 rounded-tr-full {colorClass()}"
  26141. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  26142. ></div>
  26143. <div
  26144. class="shape3 absolute h-1/2 w-1/2 rounded-br-full {colorClass()}"
  26145. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  26146. ></div>
  26147. <div
  26148. class="shape4 absolute h-1/2 w-1/2 rounded-bl-full {colorClass()}"
  26149. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  26150. ></div>
  26151. </div>
  26152. <style>
  26153. .loading {
  26154. animation: animationContainer 1.2s ease infinite;
  26155. }
  26156. .shape1 {
  26157. animation: animationShape1 0.6s ease infinite alternate;
  26158. }
  26159. .shape2 {
  26160. animation: animationShape2 0.6s ease infinite alternate;
  26161. }
  26162. .shape3 {
  26163. animation: animationShape3 0.6s ease infinite alternate;
  26164. }
  26165. .shape4 {
  26166. animation: animationShape4 0.6s ease infinite alternate;
  26167. }
  26168. @keyframes animationContainer {
  26169. 0% {
  26170. transform: rotate(0);
  26171. }
  26172. 100% {
  26173. transform: rotate(360deg);
  26174. }
  26175. }
  26176. @keyframes animationShape1 {
  26177. 0% {
  26178. top: 0;
  26179. left: 0;
  26180. }
  26181. 100% {
  26182. top: -10%;
  26183. left: -10%;
  26184. }
  26185. }
  26186. @keyframes animationShape2 {
  26187. 0% {
  26188. top: 0;
  26189. left: 50%;
  26190. }
  26191. 100% {
  26192. top: -10%;
  26193. left: 60%;
  26194. }
  26195. }
  26196. @keyframes animationShape3 {
  26197. 0% {
  26198. top: 50%;
  26199. left: 50%;
  26200. }
  26201. 100% {
  26202. top: 60%;
  26203. left: 60%;
  26204. }
  26205. }
  26206. @keyframes animationShape4 {
  26207. 0% {
  26208. top: 50%;
  26209. left: 0;
  26210. }
  26211. 100% {
  26212. top: 60%;
  26213. left: -10%;
  26214. }
  26215. }
  26216. </style>
  26217. ================================================
  26218. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_22.svelte
  26219. ================================================
  26220. <script lang="ts">
  26221. type Props = { size?: string; customColor?: any[]; speed?: number; theme?: boolean; inverse?: boolean };
  26222. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26223. const colorClass = () => {
  26224. if (inverse) {
  26225. return theme ? ' text-dark dark:text-primary' : ' text-white dark:text-black';
  26226. } else {
  26227. return theme ? ' text-primary dark:text-dark' : ' text-black dark:text-white';
  26228. }
  26229. };
  26230. </script>
  26231. <div class="{size} m-auto" style="animation-duration: {2 / speed}s;-webkit-animation-duration: {2 / speed}s;">
  26232. <svg
  26233. class="container overflow-visible will-change-transform origin-center{colorClass()}"
  26234. viewBox="0 0 40 40"
  26235. style="color: {customColor[0]}"
  26236. >
  26237. <circle class="track stroke-[5px] opacity-0" stroke="currentColor" cx="20" cy="20" r="17.5" fill="none" />
  26238. <circle
  26239. class="car stroke-[5px]"
  26240. style="animation-duration: {(2 / speed) * 0.75}s;-webkit-animation-duration: {(2 / speed) * 0.75}s;"
  26241. stroke="currentColor"
  26242. cx="20"
  26243. cy="20"
  26244. r="17.5"
  26245. fill="none"
  26246. />
  26247. </svg>
  26248. </div>
  26249. <style>
  26250. .container {
  26251. animation: rotate 2s linear infinite;
  26252. }
  26253. .car {
  26254. stroke-dasharray: 1, 200;
  26255. stroke-dashoffset: 0;
  26256. stroke-linecap: round;
  26257. animation: stretch 1.5s ease-in-out infinite;
  26258. will-change: stroke-dasharray, stroke-dashoffset;
  26259. transition: stroke 0.5s ease;
  26260. }
  26261. .track {
  26262. transition: stroke 0.5s ease;
  26263. }
  26264. @keyframes rotate {
  26265. 100% {
  26266. transform: rotate(360deg);
  26267. }
  26268. }
  26269. @keyframes stretch {
  26270. 0% {
  26271. stroke-dasharray: 0, 150;
  26272. stroke-dashoffset: 0;
  26273. }
  26274. 50% {
  26275. stroke-dasharray: 75, 150;
  26276. stroke-dashoffset: -25;
  26277. }
  26278. 100% {
  26279. stroke-dashoffset: -100;
  26280. }
  26281. }
  26282. </style>
  26283. ================================================
  26284. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_23.svelte
  26285. ================================================
  26286. <script lang="ts">
  26287. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26288. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26289. const colorClass = () => {
  26290. if (inverse) {
  26291. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26292. } else {
  26293. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26294. }
  26295. };
  26296. </script>
  26297. <div class="{size} relative m-auto -translate-x-0.5">
  26298. {#each new Array(12) as item, i}
  26299. <div
  26300. class="absolute left-1/2 flex h-8 w-[3px] flex-col gap-5 rounded-full bg-transparent"
  26301. style="transform: rotate(calc(360deg / -12*{i}));"
  26302. >
  26303. <div
  26304. class="h-1/5 rounded-full line{colorClass()}"
  26305. style="background: {customColor[0]};animation-delay: calc( {1 / speed}s / -12 * {i}); animation-duration: {1 /
  26306. speed}s;-webkit-animation-duration: {1 / speed}s;"
  26307. ></div>
  26308. </div>
  26309. {/each}
  26310. </div>
  26311. <style>
  26312. .line {
  26313. animation: pulse ease-in-out infinite;
  26314. transition: background-color 0.3s ease;
  26315. transform-origin: center bottom;
  26316. }
  26317. @keyframes pulse {
  26318. 0%,
  26319. 80%,
  26320. 100% {
  26321. transform: scaleY(0.75);
  26322. opacity: 0;
  26323. }
  26324. 20% {
  26325. transform: scaleY(1);
  26326. opacity: 1;
  26327. }
  26328. }
  26329. </style>
  26330. ================================================
  26331. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_24.svelte
  26332. ================================================
  26333. <script lang="ts">
  26334. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26335. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26336. const colorClass = () => {
  26337. if (inverse) {
  26338. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  26339. } else {
  26340. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  26341. }
  26342. };
  26343. </script>
  26344. <div class="m-auto">
  26345. <svg class="{size} origin-center overflow-visible" x="0px" y="0px" viewBox="0 0 37 37" preserveAspectRatio="xMidYMid meet">
  26346. <path
  26347. class="opacity-10 {colorClass()}"
  26348. fill="none"
  26349. style="stroke: {customColor[0]};"
  26350. stroke-width="5"
  26351. pathLength="100"
  26352. d="M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
  26353. >
  26354. </path>
  26355. <path
  26356. class="car {colorClass()}"
  26357. fill="none"
  26358. style="stroke: {customColor[0]}; animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  26359. stroke-width="5"
  26360. pathLength="100"
  26361. d="M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
  26362. >
  26363. </path>
  26364. </svg>
  26365. </div>
  26366. <style>
  26367. .car {
  26368. stroke-dasharray: 15, 85;
  26369. stroke-dashoffset: 0;
  26370. stroke-linecap: round;
  26371. animation: travel linear infinite;
  26372. will-change: stroke-dasharray, stroke-dashoffset;
  26373. transition: stroke 0.5s ease;
  26374. }
  26375. @keyframes travel {
  26376. 0% {
  26377. stroke-dashoffset: 0;
  26378. }
  26379. 100% {
  26380. stroke-dashoffset: -100;
  26381. }
  26382. }
  26383. </style>
  26384. ================================================
  26385. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_25.svelte
  26386. ================================================
  26387. <script lang="ts">
  26388. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26389. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26390. const colorClass = () => {
  26391. if (inverse) {
  26392. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  26393. } else {
  26394. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  26395. }
  26396. };
  26397. </script>
  26398. <div class="m-auto">
  26399. <svg class="{size} origin-center overflow-visible will-change-transform" viewBox="0 0 35 35">
  26400. <rect
  26401. class="opacity-10 {colorClass()}"
  26402. style="stroke: {customColor[0]};"
  26403. x="2.5"
  26404. y="2.5"
  26405. fill="none"
  26406. stroke-width="5px"
  26407. width="32.5"
  26408. height="32.5"
  26409. />
  26410. <rect
  26411. class="car {colorClass()}"
  26412. style="stroke: {customColor[0]}; animation-duration: {1.2 / speed}s;-webkit-animation-duration: {1.2 / speed}s;"
  26413. x="2.5"
  26414. y="2.5"
  26415. fill="none"
  26416. stroke-width="5px"
  26417. width="32.5"
  26418. height="32.5"
  26419. pathLength="100"
  26420. />
  26421. </svg>
  26422. </div>
  26423. <style>
  26424. .car {
  26425. stroke-dasharray: 25, 75;
  26426. stroke-dashoffset: 0;
  26427. animation: travel linear infinite;
  26428. will-change: stroke-dasharray, stroke-dashoffset;
  26429. transition: stroke 0.5s ease;
  26430. }
  26431. @keyframes travel {
  26432. 0% {
  26433. stroke-dashoffset: 0;
  26434. }
  26435. 100% {
  26436. stroke-dashoffset: -100;
  26437. }
  26438. }
  26439. </style>
  26440. ================================================
  26441. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_26.svelte
  26442. ================================================
  26443. <script lang="ts">
  26444. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26445. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26446. const colorClass = () => {
  26447. if (inverse) {
  26448. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  26449. } else {
  26450. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  26451. }
  26452. };
  26453. </script>
  26454. <div class="m-auto">
  26455. <svg
  26456. class="{size} origin-center overflow-visible"
  26457. x="0px"
  26458. y="0px"
  26459. viewBox="0 0 37 37"
  26460. height="37"
  26461. width="37"
  26462. preserveAspectRatio="xMidYMid meet"
  26463. >
  26464. <path
  26465. class="opacity-10{colorClass()}"
  26466. fill="none"
  26467. style="stroke: {customColor[0]};"
  26468. stroke-width="5"
  26469. pathLength="100"
  26470. d="M36.63 31.746 c0 -13.394 -7.3260000000000005 -25.16 -18.13 -31.375999999999998 C7.696 6.66 0.37 18.352 0.37 31.746 c5.328 3.108 11.544 4.8839999999999995 18.13 4.8839999999999995 S31.301999999999996 34.854 36.63 31.746z"
  26471. ></path>
  26472. <path
  26473. class="car{colorClass()}"
  26474. fill="none"
  26475. style="stroke: {customColor[0]}; animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  26476. stroke-width="5"
  26477. pathLength="100"
  26478. d="M36.63 31.746 c0 -13.394 -7.3260000000000005 -25.16 -18.13 -31.375999999999998 C7.696 6.66 0.37 18.352 0.37 31.746 c5.328 3.108 11.544 4.8839999999999995 18.13 4.8839999999999995 S31.301999999999996 34.854 36.63 31.746z"
  26479. ></path>
  26480. </svg>
  26481. </div>
  26482. <style>
  26483. .car {
  26484. fill: none;
  26485. stroke-dasharray: 15, 85;
  26486. stroke-dashoffset: 0;
  26487. stroke-linecap: round;
  26488. animation: travel linear infinite;
  26489. will-change: stroke-dasharray, stroke-dashoffset;
  26490. transition: stroke 0.5s ease;
  26491. }
  26492. @keyframes travel {
  26493. 0% {
  26494. stroke-dashoffset: 0;
  26495. }
  26496. 100% {
  26497. stroke-dashoffset: 100;
  26498. }
  26499. }
  26500. </style>
  26501. ================================================
  26502. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_27.svelte
  26503. ================================================
  26504. <script lang="ts">
  26505. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26506. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26507. const colorClass = () => {
  26508. if (inverse) {
  26509. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26510. } else {
  26511. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26512. }
  26513. };
  26514. </script>
  26515. <div class="{size} container relative m-auto flex items-center" style="animation-duration: {2 / speed}s;">
  26516. {#each [0, -0.835, -0.668, -0.501, -0.334, -0.167] as item}
  26517. <div
  26518. class="dot absolute left-0 right-0 flex"
  26519. style="animation-duration: {2 / speed}s; animation-delay: calc({2 / speed}s * {item} * 0.5);"
  26520. >
  26521. <div
  26522. class="h-1.5 w-1.5 rounded-full{colorClass()}"
  26523. style="background-color: {customColor[0]}; animation-delay: calc({2 / speed}s * {item} * 0.5);"
  26524. ></div>
  26525. </div>
  26526. {/each}
  26527. </div>
  26528. <style>
  26529. .container {
  26530. animation: smoothRotate linear infinite;
  26531. }
  26532. .dot {
  26533. animation: rotate ease-in-out infinite;
  26534. }
  26535. @keyframes rotate {
  26536. 0% {
  26537. transform: rotate(0deg);
  26538. }
  26539. 65%,
  26540. 100% {
  26541. transform: rotate(360deg);
  26542. }
  26543. }
  26544. @keyframes smoothRotate {
  26545. 0% {
  26546. transform: rotate(0deg);
  26547. }
  26548. 100% {
  26549. transform: rotate(360deg);
  26550. }
  26551. }
  26552. </style>
  26553. ================================================
  26554. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_28.svelte
  26555. ================================================
  26556. <script lang="ts">
  26557. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26558. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26559. const colorClass = () => {
  26560. if (inverse) {
  26561. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26562. } else {
  26563. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26564. }
  26565. };
  26566. </script>
  26567. <div class="{size} relative m-auto flex items-center">
  26568. {#each [0, -0.875, -0.75, -0.625, -0.5, -0.375, -0.25, -0.125] as item, i}
  26569. <div class="absolute left-0 right-0 flex" style="transform: rotate(calc(360deg / 8 * {i})); ">
  26570. <div
  26571. class="dot h-1.5 w-1.5 rounded-full{colorClass()}"
  26572. style="background-color: {customColor[0]};animation-duration: {1 / speed}s ; animation-delay: calc({1 / speed}s * {item});"
  26573. ></div>
  26574. </div>
  26575. {/each}
  26576. </div>
  26577. <style>
  26578. .dot {
  26579. animation: pulse ease-in-out infinite;
  26580. }
  26581. @keyframes pulse {
  26582. 0%,
  26583. 100% {
  26584. transform: scale(0);
  26585. opacity: 0.5;
  26586. }
  26587. 50% {
  26588. transform: scale(1);
  26589. opacity: 1;
  26590. }
  26591. }
  26592. </style>
  26593. ================================================
  26594. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_29.svelte
  26595. ================================================
  26596. <script lang="ts">
  26597. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26598. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26599. const colorClass = () => {
  26600. if (inverse) {
  26601. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26602. } else {
  26603. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26604. }
  26605. };
  26606. </script>
  26607. <div class="{size} container relative m-auto flex items-center">
  26608. {#each [0, -0.125, -0.25, -0.375, -0.5, -0.625, -0.75, -0.875] as item, i}
  26609. <div class="absolute left-0 right-0 flex" style="transform: rotate({i * 45}deg); animation-duration: {0.3 / speed}s">
  26610. <div
  26611. class="dot h-1.5 w-1.5 rounded-full{colorClass()}"
  26612. style="background-color: {customColor[0]}; transform: translateX(12px); animation-duration: {0.9 /
  26613. speed}s; animation-delay: calc({0.9 / speed}s * {item});"
  26614. ></div>
  26615. </div>
  26616. {/each}
  26617. </div>
  26618. <style>
  26619. .container {
  26620. animation: rotate linear infinite;
  26621. }
  26622. .dot {
  26623. animation: oscillate ease-in-out infinite alternate;
  26624. }
  26625. @keyframes oscillate {
  26626. 0% {
  26627. transform: translateX(12px) scale(0);
  26628. opacity: 0.25;
  26629. }
  26630. 100% {
  26631. transform: translateX(0) scale(1);
  26632. opacity: 1;
  26633. }
  26634. }
  26635. @keyframes rotate {
  26636. 0% {
  26637. transform: rotate(0deg);
  26638. }
  26639. 100% {
  26640. transform: rotate(360deg);
  26641. }
  26642. }
  26643. </style>
  26644. ================================================
  26645. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_3.svelte
  26646. ================================================
  26647. <script lang="ts">
  26648. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  26649. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26650. const colorClass = () => {
  26651. if (inverse) {
  26652. return theme ? ' border-dark dark:border-primary' : ' border-white dark:border-black';
  26653. } else {
  26654. return theme ? ' text-primary dark:text-dark' : ' text-black dark:text-white';
  26655. }
  26656. };
  26657. </script>
  26658. <div
  26659. class="{size} m-auto border-2 rounded-full{colorClass()} animate-spin border-b-transparent border-t-transparent dark:border-b-transparent dark:border-t-transparent"
  26660. style="border-color: {customColor[0]};border-top-color:transparent;border-bottom-color:transparent;animation-duration: {1 /
  26661. speed}s;-webkit-animation-duration: {1 / speed}s;"
  26662. ></div>
  26663. ================================================
  26664. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_30.svelte
  26665. ================================================
  26666. <script lang="ts">
  26667. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26668. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26669. const colorClass = () => {
  26670. if (inverse) {
  26671. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26672. } else {
  26673. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26674. }
  26675. };
  26676. </script>
  26677. <div class="{size} m-auto flex items-end justify-between">
  26678. {#each [0, -0.36, -0.2] as item}
  26679. <div class="cube h-2 w-2" style="animation-duration: {1.75 / speed}s; animation-delay: calc({1.75 / speed}s * {item})">
  26680. <div
  26681. class="cube__inner h-2 w-2 rounded-xs{colorClass()}"
  26682. style="background-color: {customColor[0]}; animation-duration: {1.75 / speed}s; animation-delay: calc({1.75 / speed}s * {item})"
  26683. ></div>
  26684. </div>
  26685. {/each}
  26686. </div>
  26687. <style>
  26688. .cube {
  26689. animation: jump ease-in-out infinite;
  26690. }
  26691. .cube__inner {
  26692. animation: morph ease-in-out infinite;
  26693. }
  26694. @keyframes jump {
  26695. 0% {
  26696. transform: translateY(0px);
  26697. }
  26698. 30% {
  26699. transform: translateY(0px);
  26700. animation-timing-function: ease-out;
  26701. }
  26702. 50% {
  26703. transform: translateY(-200%);
  26704. animation-timing-function: ease-in;
  26705. }
  26706. 75% {
  26707. transform: translateY(0px);
  26708. animation-timing-function: ease-in;
  26709. }
  26710. }
  26711. @keyframes morph {
  26712. 0% {
  26713. transform: scaleY(1);
  26714. }
  26715. 10% {
  26716. transform: scaleY(1);
  26717. }
  26718. 20%,
  26719. 25% {
  26720. transform: scaleY(0.8) scaleX(1.3);
  26721. animation-timing-function: ease-in-out;
  26722. }
  26723. 30% {
  26724. transform: scaleY(1.15) scaleX(0.9);
  26725. animation-timing-function: ease-in-out;
  26726. }
  26727. 40% {
  26728. transform: scaleY(1);
  26729. }
  26730. 70%,
  26731. 85%,
  26732. 100% {
  26733. transform: scaleY(1);
  26734. }
  26735. 75% {
  26736. transform: scaleY(0.8) scaleX(1.2);
  26737. }
  26738. }
  26739. </style>
  26740. ================================================
  26741. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_31.svelte
  26742. ================================================
  26743. <script lang="ts">
  26744. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  26745. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26746. const colorClass = () => {
  26747. if (inverse) {
  26748. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26749. } else {
  26750. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26751. }
  26752. };
  26753. </script>
  26754. <div class="{size} m-auto flex items-center justify-between">
  26755. {#each [-0.45, -0.3, -0.15, 0] as item}
  26756. <div
  26757. class="bar h-full w-[3px]{colorClass()}"
  26758. style="background-color: {customColor[0]}; animation-duration: {1 / speed}s; animation-delay: {1 * item}s"
  26759. ></div>
  26760. {/each}
  26761. </div>
  26762. <style>
  26763. .bar {
  26764. animation: grow ease-in-out infinite;
  26765. }
  26766. @keyframes grow {
  26767. 0%,
  26768. 100% {
  26769. transform: scaleY(0.3);
  26770. }
  26771. 50% {
  26772. transform: scaleY(1);
  26773. }
  26774. }
  26775. </style>
  26776. ================================================
  26777. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_32.svelte
  26778. ================================================
  26779. <script lang="ts">
  26780. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26781. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26782. const colorClass = () => {
  26783. if (inverse) {
  26784. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26785. } else {
  26786. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26787. }
  26788. };
  26789. </script>
  26790. <div class="{size} relative m-auto">
  26791. <div
  26792. class="line1 absolute w-1 h-1{colorClass()}"
  26793. style="background-color: {customColor[0]}; top: calc(50% - 2px); left: calc(50% - 2px); animation-duration: {4 / speed}s;"
  26794. ></div>
  26795. <div class="line2 absolute w-1 h-1{colorClass()}" style="background-color: {customColor[0]}; animation-duration: {4 / speed}s;"></div>
  26796. <div
  26797. class="line2 absolute w-1 h-1{colorClass()}"
  26798. style="background-color: {customColor[0]}; animation-duration: {4 / speed}s; animation-delay: calc({4 / speed}s * -0.5);"
  26799. ></div>
  26800. </div>
  26801. <style>
  26802. .line1 {
  26803. animation: center-line ease infinite;
  26804. }
  26805. .line2 {
  26806. animation: explore ease infinite;
  26807. }
  26808. @keyframes center-line {
  26809. 0%,
  26810. 25%,
  26811. 50%,
  26812. 75%,
  26813. 100% {
  26814. transform: scaleX(1) scaleY(1);
  26815. }
  26816. 12.5%,
  26817. 62.5% {
  26818. transform: scaleX(8) scaleY(1);
  26819. }
  26820. 37.5%,
  26821. 87.5% {
  26822. transform: scaleX(1) scaleY(8);
  26823. }
  26824. }
  26825. @keyframes explore {
  26826. 0%,
  26827. 100% {
  26828. transform: scaleX(1) scaleY(1) translate(0%, 0%);
  26829. transform-origin: top left;
  26830. top: 0;
  26831. left: 0;
  26832. }
  26833. 12.5% {
  26834. transform: scaleX(8) scaleY(1) translate(0%, 0%);
  26835. transform-origin: top left;
  26836. top: 0;
  26837. left: 0;
  26838. }
  26839. 12.50001% {
  26840. transform: scaleX(8) scaleY(1) translate(0%, 0%);
  26841. transform-origin: top right;
  26842. top: 0;
  26843. left: initial;
  26844. right: 0;
  26845. }
  26846. 25% {
  26847. transform: scaleX(1) scaleY(1) translate(0%, 0%);
  26848. transform-origin: top right;
  26849. top: 0;
  26850. left: initial;
  26851. right: 0;
  26852. }
  26853. 37.5% {
  26854. transform: scaleX(1) scaleY(8) translate(0%, 0%);
  26855. transform-origin: top right;
  26856. top: 0;
  26857. left: initial;
  26858. right: 0;
  26859. }
  26860. 37.5001% {
  26861. transform: scaleX(1) scaleY(8) translate(0%, 0%);
  26862. transform-origin: bottom right;
  26863. top: initial;
  26864. bottom: 0;
  26865. left: initial;
  26866. right: 0;
  26867. }
  26868. 50% {
  26869. transform: scaleX(1) scaleY(1) translate(0%, 0%);
  26870. transform-origin: bottom right;
  26871. top: initial;
  26872. bottom: 0;
  26873. left: initial;
  26874. right: 0;
  26875. }
  26876. 62.5% {
  26877. transform: scaleX(8) scaleY(1) translate(0%, 0%);
  26878. transform-origin: bottom right;
  26879. top: initial;
  26880. bottom: 0;
  26881. left: initial;
  26882. right: 0;
  26883. }
  26884. 62.5001% {
  26885. transform: scaleX(8) scaleY(1) translate(0%, 0%);
  26886. transform-origin: bottom left;
  26887. top: initial;
  26888. bottom: 0;
  26889. left: 0;
  26890. }
  26891. 75% {
  26892. transform: scaleX(1) scaleY(1) translate(0%, 0%);
  26893. transform-origin: bottom left;
  26894. top: initial;
  26895. bottom: 0;
  26896. left: 0;
  26897. }
  26898. 87.5% {
  26899. transform: scaleX(1) scaleY(8) translate(0%, 0%);
  26900. transform-origin: bottom left;
  26901. top: initial;
  26902. bottom: 0;
  26903. left: 0;
  26904. }
  26905. 87.5001% {
  26906. transform: scaleX(1) scaleY(8) translate(0%, 0%);
  26907. transform-origin: top left;
  26908. top: 0;
  26909. left: 0;
  26910. }
  26911. }
  26912. </style>
  26913. ================================================
  26914. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_33.svelte
  26915. ================================================
  26916. <script lang="ts">
  26917. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26918. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26919. const colorClass = () => {
  26920. if (inverse) {
  26921. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  26922. } else {
  26923. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  26924. }
  26925. };
  26926. </script>
  26927. <div class="{size} container relative m-auto flex flex-col" style="animation-duration: {3.5 / speed}s;">
  26928. <div
  26929. class="isolation absolute flex h-[13.92px] w-[13.92px] items-center justify-center overflow-hidden"
  26930. style="top: 8.25%; left: 8.25%; border-radius: 50% 50% calc(32px / 15);"
  26931. >
  26932. <div class="absolute left-0 top-0 h-full w-full opacity-10{colorClass()}" style="background-color: {customColor[0]};"></div>
  26933. <div
  26934. class="half1 relative w-full origin-bottom-right h-full{colorClass()}"
  26935. style="background-color: {customColor[0]}; animation-duration: {3.5 / speed}s;"
  26936. ></div>
  26937. </div>
  26938. <div
  26939. class="isolation absolute flex h-[13.92px] w-[13.92px] items-center justify-center overflow-hidden"
  26940. style="bottom: 8.25%; right: 8.25%; transform: rotate(180deg); align-self: flex-end; border-radius: 50% 50% calc(32px / 15);"
  26941. >
  26942. <div class="absolute left-0 top-0 h-full w-full opacity-10{colorClass()}" style="background-color: {customColor[0]};"></div>
  26943. <div
  26944. class="half2 relative h-full w-full origin-bottom-right z-10{colorClass()}"
  26945. style="background-color: {customColor[0]}; animation-delay: -{3.5 / speed / 2}s; animation-duration: {3.5 / speed}s;"
  26946. ></div>
  26947. </div>
  26948. </div>
  26949. <style>
  26950. .container {
  26951. animation: rotate ease-in-out infinite;
  26952. }
  26953. .half1 {
  26954. animation: flow linear infinite both;
  26955. border-radius: 0 0 1.6px 0;
  26956. transform: rotate(45deg) translate(-3%, 50%) scaleX(1.2);
  26957. }
  26958. .half2 {
  26959. animation: flow linear infinite both;
  26960. border-radius: 0 0 1.6px 0;
  26961. transform: rotate(45deg) translate(-3%, 50%) scaleX(1.2);
  26962. }
  26963. @keyframes flow {
  26964. 0% {
  26965. transform: rotate(45deg) translate(-3%, 50%) scaleX(1.2);
  26966. }
  26967. 30% {
  26968. transform: rotate(45deg) translate(115%, 50%) scaleX(1.2);
  26969. }
  26970. 30.001%,
  26971. 50% {
  26972. transform: rotate(0deg) translate(-85%, -85%) scaleX(1);
  26973. }
  26974. 80%,
  26975. 100% {
  26976. transform: rotate(0deg) translate(0%, 0%) scaleX(1);
  26977. }
  26978. }
  26979. @keyframes rotate {
  26980. 0%,
  26981. 30% {
  26982. transform: rotate(45deg);
  26983. }
  26984. 50%,
  26985. 80% {
  26986. transform: rotate(225deg);
  26987. }
  26988. 100% {
  26989. transform: rotate(405deg);
  26990. }
  26991. }
  26992. </style>
  26993. ================================================
  26994. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_34.svelte
  26995. ================================================
  26996. <script lang="ts">
  26997. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  26998. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  26999. const colorClass = () => {
  27000. if (inverse) {
  27001. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27002. } else {
  27003. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27004. }
  27005. };
  27006. </script>
  27007. <div class="{size} flex flex-col justify-center">
  27008. <div class="{size} relative m-auto overflow-hidden rounded-full" style="height:4px">
  27009. <div class="absolute h-full w-full opacity-10{colorClass()}" style="background-color: {customColor[0]};"></div>
  27010. <div
  27011. class="container h-full w-full rounded-full{colorClass()}"
  27012. style="background-color: {customColor[0]}; animation-duration: {1.5 / speed}s"
  27013. ></div>
  27014. </div>
  27015. </div>
  27016. <style>
  27017. .container {
  27018. animation: zoom ease-in-out infinite;
  27019. }
  27020. @keyframes zoom {
  27021. 0% {
  27022. transform: translateX(-100%);
  27023. }
  27024. 100% {
  27025. transform: translateX(100%);
  27026. }
  27027. }
  27028. </style>
  27029. ================================================
  27030. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_35.svelte
  27031. ================================================
  27032. <script lang="ts">
  27033. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27034. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27035. const colorClass = () => {
  27036. if (inverse) {
  27037. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27038. } else {
  27039. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27040. }
  27041. };
  27042. </script>
  27043. <div class="{size} flex flex-col justify-center">
  27044. <div class="{size} relative m-auto overflow-hidden rounded-full" style="height:4px">
  27045. <div class="absolute h-full w-full opacity-10{colorClass()}" style="background-color: {customColor[0]};"></div>
  27046. <div
  27047. class="container h-full w-full rounded-full{colorClass()}"
  27048. style="background-color: {customColor[0]}; animation-duration: {2 / speed}s"
  27049. ></div>
  27050. </div>
  27051. </div>
  27052. <style>
  27053. .container {
  27054. animation: zoom ease-in-out infinite;
  27055. }
  27056. @keyframes zoom {
  27057. 0%,
  27058. 100% {
  27059. transform: translateX(-95%);
  27060. }
  27061. 50% {
  27062. transform: translateX(95%);
  27063. }
  27064. }
  27065. </style>
  27066. ================================================
  27067. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_36.svelte
  27068. ================================================
  27069. <script lang="ts">
  27070. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27071. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27072. const colorClass = () => {
  27073. if (inverse) {
  27074. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  27075. } else {
  27076. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  27077. }
  27078. };
  27079. </script>
  27080. <div class="{size} m-auto flex flex-col justify-center">
  27081. <svg
  27082. class="{size} m-auto h-full w-full origin-center overflow-visible"
  27083. x="0px"
  27084. y="0px"
  27085. viewBox="0 0 55 23.1"
  27086. preserveAspectRatio="xMidYMid meet"
  27087. >
  27088. <path
  27089. class="opacity-10{colorClass()}"
  27090. fill="none"
  27091. style="stroke: {customColor[0]};"
  27092. stroke-width="5"
  27093. pathLength="100"
  27094. d="M26.7,12.2c3.5,3.4,7.4,7.8,12.7,7.8c5.5,0,9.6-4.4,9.6-9.5C49,5,45.1,1,39.8,1c-5.5,0-9.5,4.2-13.1,7.8l-3.4,3.3c-3.6,3.6-7.6,7.8-13.1,7.8C4.9,20,1,16,1,10.5C1,5.4,5.1,1,10.6,1c5.3,0,9.2,4.5,12.7,7.8L26.7,12.2z"
  27095. />
  27096. <path
  27097. class="car{colorClass()}"
  27098. fill="none"
  27099. style="stroke: {customColor[0]}; animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  27100. stroke-width="5"
  27101. pathLength="100"
  27102. d="M26.7,12.2c3.5,3.4,7.4,7.8,12.7,7.8c5.5,0,9.6-4.4,9.6-9.5C49,5,45.1,1,39.8,1c-5.5,0-9.5,4.2-13.1,7.8l-3.4,3.3c-3.6,3.6-7.6,7.8-13.1,7.8C4.9,20,1,16,1,10.5C1,5.4,5.1,1,10.6,1c5.3,0,9.2,4.5,12.7,7.8L26.7,12.2z"
  27103. />
  27104. </svg>
  27105. </div>
  27106. <style>
  27107. .car {
  27108. stroke-dasharray: 15, 85;
  27109. stroke-dashoffset: 0;
  27110. stroke-linecap: round;
  27111. animation: travel linear infinite;
  27112. will-change: stroke-dasharray, stroke-dashoffset;
  27113. }
  27114. @keyframes travel {
  27115. 0% {
  27116. stroke-dashoffset: 0;
  27117. }
  27118. 100% {
  27119. stroke-dashoffset: 100;
  27120. }
  27121. }
  27122. </style>
  27123. ================================================
  27124. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_37.svelte
  27125. ================================================
  27126. <script lang="ts">
  27127. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27128. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27129. const colorClass = () => {
  27130. if (inverse) {
  27131. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  27132. } else {
  27133. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  27134. }
  27135. };
  27136. </script>
  27137. <div class="{size} m-auto">
  27138. <svg
  27139. class="h-full w-full origin-center overflow-visible"
  27140. x="0px"
  27141. y="0px"
  27142. viewBox="0 0 40 40"
  27143. height="40"
  27144. width="40"
  27145. preserveAspectRatio="xMidYMid meet"
  27146. >
  27147. <path
  27148. class="opacity-10{colorClass()}"
  27149. style="stroke: {customColor[0]};"
  27150. fill="none"
  27151. stroke-width="4"
  27152. pathLength="100"
  27153. d="M29.760000000000005 18.72 c0 7.28 -3.9200000000000004 13.600000000000001 -9.840000000000002 16.96 c -2.8800000000000003 1.6800000000000002 -6.24 2.64 -9.840000000000002 2.64 c -3.6 0 -6.88 -0.96 -9.76 -2.64 c0 -7.28 3.9200000000000004 -13.52 9.840000000000002 -16.96 c2.8800000000000003 -1.6800000000000002 6.24 -2.64 9.76 -2.64 S26.880000000000003 17.040000000000003 29.760000000000005 18.72 c5.84 3.3600000000000003 9.76 9.68 9.840000000000002 16.96 c -2.8800000000000003 1.6800000000000002 -6.24 2.64 -9.76 2.64 c -3.6 0 -6.88 -0.96 -9.840000000000002 -2.64 c -5.84 -3.3600000000000003 -9.76 -9.68 -9.76 -16.96 c0 -7.28 3.9200000000000004 -13.600000000000001 9.76 -16.96 C25.84 5.120000000000001 29.760000000000005 11.440000000000001 29.760000000000005 18.72z"
  27154. >
  27155. </path>
  27156. <path
  27157. class="car{colorClass()}"
  27158. style="stroke: {customColor[0]}; animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  27159. fill="none"
  27160. stroke-width="4"
  27161. pathLength="100"
  27162. d="M29.760000000000005 18.72 c0 7.28 -3.9200000000000004 13.600000000000001 -9.840000000000002 16.96 c -2.8800000000000003 1.6800000000000002 -6.24 2.64 -9.840000000000002 2.64 c -3.6 0 -6.88 -0.96 -9.76 -2.64 c0 -7.28 3.9200000000000004 -13.52 9.840000000000002 -16.96 c2.8800000000000003 -1.6800000000000002 6.24 -2.64 9.76 -2.64 S26.880000000000003 17.040000000000003 29.760000000000005 18.72 c5.84 3.3600000000000003 9.76 9.68 9.840000000000002 16.96 c -2.8800000000000003 1.6800000000000002 -6.24 2.64 -9.76 2.64 c -3.6 0 -6.88 -0.96 -9.840000000000002 -2.64 c -5.84 -3.3600000000000003 -9.76 -9.68 -9.76 -16.96 c0 -7.28 3.9200000000000004 -13.600000000000001 9.76 -16.96 C25.84 5.120000000000001 29.760000000000005 11.440000000000001 29.760000000000005 18.72z"
  27163. >
  27164. </path>
  27165. </svg>
  27166. </div>
  27167. <style>
  27168. .car {
  27169. stroke-dasharray: 15, 85;
  27170. stroke-dashoffset: 0;
  27171. stroke-linecap: round;
  27172. animation: travel linear infinite;
  27173. will-change: stroke-dasharray, stroke-dashoffset;
  27174. }
  27175. @keyframes travel {
  27176. 0% {
  27177. stroke-dashoffset: 0;
  27178. }
  27179. 100% {
  27180. stroke-dashoffset: -100;
  27181. }
  27182. }
  27183. </style>
  27184. ================================================
  27185. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_38.svelte
  27186. ================================================
  27187. <script lang="ts">
  27188. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27189. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27190. const colorClass = () => {
  27191. if (inverse) {
  27192. return theme ? ' stroke-dark dark:stroke-primary' : ' stroke-white dark:stroke-black';
  27193. } else {
  27194. return theme ? ' stroke-primary dark:stroke-dark' : ' stroke-black dark:stroke-white';
  27195. }
  27196. };
  27197. </script>
  27198. <div class="{size} m-auto">
  27199. <svg
  27200. class="h-full w-full origin-center overflow-visible"
  27201. x="0px"
  27202. y="0px"
  27203. viewBox="0 0 50 31.25"
  27204. height="31.25"
  27205. width="50"
  27206. preserveAspectRatio="xMidYMid meet"
  27207. >
  27208. <path
  27209. class="track opacity-10{colorClass()}"
  27210. style="stroke: {customColor[0]};"
  27211. stroke-width="4"
  27212. fill="none"
  27213. pathLength="100"
  27214. d="M0.625 21.5 h10.25 l3.75 -5.875 l7.375 15 l9.75 -30 l7.375 20.875 v0 h10.25"
  27215. />
  27216. <path
  27217. class="car{colorClass()}"
  27218. style="stroke: {customColor[0]}; animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  27219. stroke-width="4"
  27220. fill="none"
  27221. pathLength="100"
  27222. d="M0.625 21.5 h10.25 l3.75 -5.875 l7.375 15 l9.75 -30 l7.375 20.875 v0 h10.25"
  27223. />
  27224. </svg>
  27225. </div>
  27226. <style>
  27227. .car {
  27228. stroke-dasharray: 100;
  27229. stroke-dashoffset: 0;
  27230. stroke-linecap: round;
  27231. stroke-linejoin: round;
  27232. animation:
  27233. travel ease-in-out infinite,
  27234. fade ease-out infinite;
  27235. will-change: stroke-dasharray, stroke-dashoffset;
  27236. }
  27237. .track {
  27238. stroke-linecap: round;
  27239. stroke-linejoin: round;
  27240. }
  27241. @keyframes travel {
  27242. 0% {
  27243. stroke-dashoffset: 100;
  27244. }
  27245. 75% {
  27246. stroke-dashoffset: 0;
  27247. }
  27248. }
  27249. @keyframes fade {
  27250. 0% {
  27251. opacity: 0;
  27252. }
  27253. 20%,
  27254. 55% {
  27255. opacity: 1;
  27256. }
  27257. 100% {
  27258. opacity: 0;
  27259. }
  27260. }
  27261. </style>
  27262. ================================================
  27263. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_39.svelte
  27264. ================================================
  27265. <script lang="ts">
  27266. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27267. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27268. const colorClass = () => {
  27269. if (inverse) {
  27270. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27271. } else {
  27272. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27273. }
  27274. };
  27275. </script>
  27276. <div class="{size} m-auto flex flex-col items-center justify-center">
  27277. {#each [0, 1, 2, 3, 4, 5] as item}
  27278. <div class="relative w-full" style="height: calc(32px / 6);">
  27279. <div
  27280. class="slice absolute top-0 h-full rounded-full shrink-0{colorClass()}"
  27281. style="background-color: {customColor[0]};left: calc(50% - 32px / 12);width: calc(100% / 6);animation-duration: {2.5 /
  27282. speed}s;animation-delay: {-(2.5 / speed / 6) * item}s;"
  27283. ></div>
  27284. <div
  27285. class="slice absolute top-0 h-full rounded-full shrink-0{colorClass()}"
  27286. style="background-color: {customColor[0]};left: calc(50% - 32px / 12);width: calc(100% / 6);animation-duration: {2.5 /
  27287. speed}s;animation-delay: {-(2.5 / speed / 2) - (2.5 / speed / 6) * item}s;"
  27288. ></div>
  27289. </div>
  27290. {/each}
  27291. </div>
  27292. <style>
  27293. .slice {
  27294. animation: orbit linear infinite;
  27295. }
  27296. @keyframes orbit {
  27297. 0% {
  27298. transform: translateX(calc(32px * 0.25)) scale(0.73684);
  27299. opacity: 0.65;
  27300. }
  27301. 5% {
  27302. transform: translateX(calc(32px * 0.235)) scale(0.684208);
  27303. opacity: 0.58;
  27304. }
  27305. 10% {
  27306. transform: translateX(calc(32px * 0.182)) scale(0.631576);
  27307. opacity: 0.51;
  27308. }
  27309. 15% {
  27310. transform: translateX(calc(32px * 0.129)) scale(0.578944);
  27311. opacity: 0.44;
  27312. }
  27313. 20% {
  27314. transform: translateX(calc(32px * 0.076)) scale(0.526312);
  27315. opacity: 0.37;
  27316. }
  27317. 25% {
  27318. transform: translateX(0%) scale(0.47368);
  27319. opacity: 0.3;
  27320. }
  27321. 30% {
  27322. transform: translateX(calc(32px * -0.076)) scale(0.526312);
  27323. opacity: 0.37;
  27324. }
  27325. 35% {
  27326. transform: translateX(calc(32px * -0.129)) scale(0.578944);
  27327. opacity: 0.44;
  27328. }
  27329. 40% {
  27330. transform: translateX(calc(32px * -0.182)) scale(0.631576);
  27331. opacity: 0.51;
  27332. }
  27333. 45% {
  27334. transform: translateX(calc(32px * -0.235)) scale(0.684208);
  27335. opacity: 0.58;
  27336. }
  27337. 50% {
  27338. transform: translateX(calc(32px * -0.25)) scale(0.73684);
  27339. opacity: 0.65;
  27340. }
  27341. 55% {
  27342. transform: translateX(calc(32px * -0.235)) scale(0.789472);
  27343. opacity: 0.72;
  27344. }
  27345. 60% {
  27346. transform: translateX(calc(32px * -0.182)) scale(0.842104);
  27347. opacity: 0.79;
  27348. }
  27349. 65% {
  27350. transform: translateX(calc(32px * -0.129)) scale(0.894736);
  27351. opacity: 0.86;
  27352. }
  27353. 70% {
  27354. transform: translateX(calc(32px * -0.076)) scale(0.947368);
  27355. opacity: 0.93;
  27356. }
  27357. 75% {
  27358. transform: translateX(0%) scale(1);
  27359. opacity: 1;
  27360. }
  27361. 80% {
  27362. transform: translateX(calc(32px * 0.076)) scale(0.947368);
  27363. opacity: 0.93;
  27364. }
  27365. 85% {
  27366. transform: translateX(calc(32px * 0.129)) scale(0.894736);
  27367. opacity: 0.86;
  27368. }
  27369. 90% {
  27370. transform: translateX(calc(32px * 0.182)) scale(0.842104);
  27371. opacity: 0.79;
  27372. }
  27373. 95% {
  27374. transform: translateX(calc(32px * 0.235)) scale(0.789472);
  27375. opacity: 0.72;
  27376. }
  27377. 100% {
  27378. transform: translateX(calc(32px * 0.25)) scale(0.73684);
  27379. opacity: 0.65;
  27380. }
  27381. }
  27382. </style>
  27383. ================================================
  27384. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_4.svelte
  27385. ================================================
  27386. <script lang="ts">
  27387. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  27388. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27389. const colorClass = () => {
  27390. if (inverse) {
  27391. return theme ? ' border-dark dark:border-primary' : ' border-white dark:border-black';
  27392. } else {
  27393. return theme ? ' border-primary dark:border-dark' : ' border-black dark:border-white';
  27394. }
  27395. };
  27396. </script>
  27397. <div class="{size} m-auto flex flex-col justify-center">
  27398. <div
  27399. class="relative m-auto h-8 w-8 border-2 rounded-full{colorClass()} animate-spin border-b-transparent border-t-transparent dark:border-b-transparent dark:border-t-transparent"
  27400. style="border-color: {customColor[0]};border-top-color:transparent;border-bottom-color:transparent;animation-duration: {1 /
  27401. speed}s;-webkit-animation-duration: {1 / speed}s;"
  27402. >
  27403. <div
  27404. class="absolute{colorClass()} border-l-[5px] border-r-[5px] border-t-[5px] border-l-transparent border-r-transparent dark:border-l-transparent dark:border-r-transparent"
  27405. style="transform: rotate(225deg);border-color: {customColor[0]};border-right-color:transparent;border-left-color:transparent;"
  27406. ></div>
  27407. <div
  27408. class="absolute bottom-0 right-0{colorClass()} border-l-[5px] border-r-[5px] border-t-[5px] border-l-transparent border-r-transparent dark:border-l-transparent dark:border-r-transparent"
  27409. style="transform: rotate(45deg);border-color: {customColor[0]};border-right-color:transparent;border-left-color:transparent;"
  27410. ></div>
  27411. </div>
  27412. </div>
  27413. ================================================
  27414. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_40.svelte
  27415. ================================================
  27416. <script lang="ts">
  27417. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27418. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27419. const colorClass = () => {
  27420. if (inverse) {
  27421. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27422. } else {
  27423. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27424. }
  27425. };
  27426. const brList = [
  27427. [24, -35],
  27428. [16, -6],
  27429. [8, 23],
  27430. [-1, 51],
  27431. [38, -17.5],
  27432. [30, 10],
  27433. [22, 39],
  27434. [14, 67],
  27435. [53, -0.8],
  27436. [44.5, 27],
  27437. [36, 55.7],
  27438. [28.7, 84.3],
  27439. [66.8, 15],
  27440. [58.8, 43],
  27441. [50, 72],
  27442. [42, 100]
  27443. ];
  27444. </script>
  27445. <div class="{size} relative m-auto flex items-center">
  27446. {#each [-0.48, -0.4, -0.32, -0.24, -0.4, -0.32, -0.24, -0.16, -0.32, -0.24, -0.16, -0.08, -0.24, -0.16, -0.08, -0] as item, i}
  27447. <div
  27448. class="dot absolute h-1 w-1 rounded-full{colorClass()}"
  27449. style="background-color: {customColor[0]};bottom: calc({brList[i][0]}% + 1.6px);right: calc({brList[
  27450. i
  27451. ][1]}% + 1.6px);animation-duration: {1.5 / speed}s;animation-delay: {(1.5 / speed) * item}s"
  27452. ></div>
  27453. {/each}
  27454. </div>
  27455. <style>
  27456. .dot {
  27457. animation: jump ease-in-out infinite;
  27458. }
  27459. @keyframes jump {
  27460. 0%,
  27461. 100% {
  27462. transform: translateY(120%);
  27463. }
  27464. 50% {
  27465. transform: translateY(-120%);
  27466. }
  27467. }
  27468. </style>
  27469. ================================================
  27470. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_41.svelte
  27471. ================================================
  27472. <script lang="ts">
  27473. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27474. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27475. const colorClass = () => {
  27476. if (inverse) {
  27477. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27478. } else {
  27479. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27480. }
  27481. };
  27482. </script>
  27483. <div class="{size} relative m-auto">
  27484. <div
  27485. class="container absolute left-2.5 top-2.5 h-3 w-3 rounded-full{colorClass()}"
  27486. style="background-color: {customColor[0]};animation-duration: {1.5 / speed}s;"
  27487. ></div>
  27488. <div
  27489. class="container absolute left-2.5 top-2.5 h-3 w-3 rounded-full{colorClass()}"
  27490. style="background-color: {customColor[0]};animation-duration: {1.5 / speed}s;animation-delay: {0.75 / speed}s"
  27491. ></div>
  27492. </div>
  27493. <style>
  27494. .container {
  27495. animation: orbit linear infinite;
  27496. }
  27497. @keyframes orbit {
  27498. 0% {
  27499. transform: translateX(calc(32px * 0.25)) scale(0.73684);
  27500. opacity: 0.65;
  27501. }
  27502. 5% {
  27503. transform: translateX(calc(32px * 0.235)) scale(0.684208);
  27504. opacity: 0.58;
  27505. }
  27506. 10% {
  27507. transform: translateX(calc(32px * 0.182)) scale(0.631576);
  27508. opacity: 0.51;
  27509. }
  27510. 15% {
  27511. transform: translateX(calc(32px * 0.129)) scale(0.578944);
  27512. opacity: 0.44;
  27513. }
  27514. 20% {
  27515. transform: translateX(calc(32px * 0.076)) scale(0.526312);
  27516. opacity: 0.37;
  27517. }
  27518. 25% {
  27519. transform: translateX(0%) scale(0.47368);
  27520. opacity: 0.3;
  27521. }
  27522. 30% {
  27523. transform: translateX(calc(32px * -0.076)) scale(0.526312);
  27524. opacity: 0.37;
  27525. }
  27526. 35% {
  27527. transform: translateX(calc(32px * -0.129)) scale(0.578944);
  27528. opacity: 0.44;
  27529. }
  27530. 40% {
  27531. transform: translateX(calc(32px * -0.182)) scale(0.631576);
  27532. opacity: 0.51;
  27533. }
  27534. 45% {
  27535. transform: translateX(calc(32px * -0.235)) scale(0.684208);
  27536. opacity: 0.58;
  27537. }
  27538. 50% {
  27539. transform: translateX(calc(32px * -0.25)) scale(0.73684);
  27540. opacity: 0.65;
  27541. }
  27542. 55% {
  27543. transform: translateX(calc(32px * -0.235)) scale(0.789472);
  27544. opacity: 0.72;
  27545. }
  27546. 60% {
  27547. transform: translateX(calc(32px * -0.182)) scale(0.842104);
  27548. opacity: 0.79;
  27549. }
  27550. 65% {
  27551. transform: translateX(calc(32px * -0.129)) scale(0.894736);
  27552. opacity: 0.86;
  27553. }
  27554. 70% {
  27555. transform: translateX(calc(32px * -0.076)) scale(0.947368);
  27556. opacity: 0.93;
  27557. }
  27558. 75% {
  27559. transform: translateX(0%) scale(1);
  27560. opacity: 1;
  27561. }
  27562. 80% {
  27563. transform: translateX(calc(32px * 0.076)) scale(0.947368);
  27564. opacity: 0.93;
  27565. }
  27566. 85% {
  27567. transform: translateX(calc(32px * 0.129)) scale(0.894736);
  27568. opacity: 0.86;
  27569. }
  27570. 90% {
  27571. transform: translateX(calc(32px * 0.182)) scale(0.842104);
  27572. opacity: 0.79;
  27573. }
  27574. 95% {
  27575. transform: translateX(calc(32px * 0.235)) scale(0.789472);
  27576. opacity: 0.72;
  27577. }
  27578. 100% {
  27579. transform: translateX(calc(32px * 0.25)) scale(0.73684);
  27580. opacity: 0.65;
  27581. }
  27582. }
  27583. </style>
  27584. ================================================
  27585. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_42.svelte
  27586. ================================================
  27587. <script lang="ts">
  27588. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27589. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27590. const colorClass = () => {
  27591. if (inverse) {
  27592. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27593. } else {
  27594. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27595. }
  27596. };
  27597. </script>
  27598. <div class="{size} container relative m-auto inline-block" style="animation-duration: {1.5 / speed}s;">
  27599. {#each [120, -120, 0] as item}
  27600. <div class="absolute h-full" style="transform: rotate({item}deg);left: 37.5%;width:25%;">
  27601. <div
  27602. class="dot absolute left-0 top-0 h-0 w-full rounded-full{colorClass()}"
  27603. style="background-color: {customColor[0]};padding-bottom: 100%;animation-duration: {1.5 / speed}s;"
  27604. ></div>
  27605. </div>
  27606. {/each}
  27607. </div>
  27608. <style>
  27609. .container {
  27610. animation: spin infinite linear;
  27611. }
  27612. .dot {
  27613. animation: wobble infinite ease-in-out;
  27614. }
  27615. @keyframes spin {
  27616. 0% {
  27617. transform: rotate(0deg);
  27618. }
  27619. 100% {
  27620. transform: rotate(360deg);
  27621. }
  27622. }
  27623. @keyframes wobble {
  27624. 0%,
  27625. 100% {
  27626. transform: translateY(0%);
  27627. }
  27628. 50% {
  27629. transform: translateY(65%);
  27630. }
  27631. }
  27632. </style>
  27633. ================================================
  27634. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_43.svelte
  27635. ================================================
  27636. <script lang="ts">
  27637. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27638. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27639. const colorClass = () => {
  27640. if (inverse) {
  27641. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27642. } else {
  27643. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27644. }
  27645. };
  27646. </script>
  27647. <div class="{size} m-auto flex flex-col justify-center">
  27648. <div class="flex items-center justify-between">
  27649. {#each [-0.45, -0.3, -0.15, 0] as item}
  27650. <div
  27651. class="dot h-1.5 w-1.5 rounded-full{colorClass()}"
  27652. style="background-color: {customColor[0]};animation-duration: {1 / speed}s;animation-delay: {(1 / speed) * item}s"
  27653. ></div>
  27654. {/each}
  27655. </div>
  27656. </div>
  27657. <style>
  27658. .dot {
  27659. animation: jump ease-in-out infinite;
  27660. }
  27661. @keyframes jump {
  27662. 0%,
  27663. 100% {
  27664. transform: translateY(100%);
  27665. }
  27666. 50% {
  27667. transform: translateY(-100%);
  27668. }
  27669. }
  27670. </style>
  27671. ================================================
  27672. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_44.svelte
  27673. ================================================
  27674. <script lang="ts">
  27675. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27676. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27677. const colorClass = () => {
  27678. if (inverse) {
  27679. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27680. } else {
  27681. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27682. }
  27683. };
  27684. </script>
  27685. <div class="{size} relative m-auto">
  27686. {#each [0, 0.4, 0.8] as item, i}
  27687. <div
  27688. class="dot absolute left-0 top-0 flex h-full w-full items-center"
  27689. style="animation-duration: {2.5 / speed}s;transform: translateX({32 * item}px);animation-delay: {2.5 / speed / (-1.5 * i)}s"
  27690. >
  27691. <div class="w-2 rounded-full h-2{colorClass()}" style="background-color: {customColor[0]};"></div>
  27692. </div>
  27693. {/each}
  27694. </div>
  27695. <style>
  27696. .dot {
  27697. animation: leapFrog ease infinite;
  27698. }
  27699. @keyframes leapFrog {
  27700. 0% {
  27701. transform: translateX(0) rotate(0deg);
  27702. }
  27703. 33.333% {
  27704. transform: translateX(0) rotate(180deg);
  27705. }
  27706. 66.666% {
  27707. transform: translateX(calc(32px * -0.38)) rotate(180deg);
  27708. }
  27709. 99.999% {
  27710. transform: translateX(calc(32px * -0.78)) rotate(180deg);
  27711. }
  27712. 100% {
  27713. transform: translateX(0) rotate(0deg);
  27714. }
  27715. }
  27716. </style>
  27717. ================================================
  27718. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_45.svelte
  27719. ================================================
  27720. <script lang="ts">
  27721. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27722. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27723. const colorClass = () => {
  27724. if (inverse) {
  27725. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27726. } else {
  27727. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27728. }
  27729. };
  27730. </script>
  27731. <div class="{size} m-auto flex items-center justify-center">
  27732. {#each [0, 1, 2, 3] as item}
  27733. <div
  27734. class="dot relative flex h-full w-1/4 items-center"
  27735. class:dot1={item === 0}
  27736. class:dot2={item === 3}
  27737. style="transform-origin: center top;animation-duration: {1.5 / speed}s;"
  27738. >
  27739. <div class="h-1/4 w-full rounded-full{colorClass()}" style="background-color: {customColor[0]};"></div>
  27740. </div>
  27741. {/each}
  27742. </div>
  27743. <style>
  27744. .dot1 {
  27745. animation: swing linear infinite;
  27746. }
  27747. .dot2 {
  27748. animation: swing2 linear infinite;
  27749. }
  27750. @keyframes swing {
  27751. 0% {
  27752. transform: rotate(0deg);
  27753. animation-timing-function: ease-out;
  27754. }
  27755. 25% {
  27756. transform: rotate(70deg);
  27757. animation-timing-function: ease-in;
  27758. }
  27759. 50% {
  27760. transform: rotate(0deg);
  27761. animation-timing-function: linear;
  27762. }
  27763. }
  27764. @keyframes swing2 {
  27765. 0% {
  27766. transform: rotate(0deg);
  27767. animation-timing-function: linear;
  27768. }
  27769. 50% {
  27770. transform: rotate(0deg);
  27771. animation-timing-function: ease-out;
  27772. }
  27773. 75% {
  27774. transform: rotate(-70deg);
  27775. animation-timing-function: ease-in;
  27776. }
  27777. }
  27778. </style>
  27779. ================================================
  27780. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_46.svelte
  27781. ================================================
  27782. <script lang="ts">
  27783. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27784. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27785. const colorClass = () => {
  27786. if (inverse) {
  27787. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27788. } else {
  27789. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27790. }
  27791. };
  27792. </script>
  27793. <div class="{size} m-auto flex flex-col justify-center">
  27794. <div class="relative flex h-1/5 w-full -translate-x-[10%] items-center justify-between">
  27795. {#each [0, -0.2, -0.4, -0.6, -0.8] as item}
  27796. <div
  27797. class="dot absolute h-full w-1/5 rounded-full{colorClass()}"
  27798. style="background-color: {customColor[0]};animation-delay: {(2.5 / speed) * item}s;animation-duration: {2.5 / speed}s"
  27799. ></div>
  27800. {/each}
  27801. </div>
  27802. </div>
  27803. <style>
  27804. .dot {
  27805. animation: stream linear infinite both;
  27806. }
  27807. @keyframes stream {
  27808. 0%,
  27809. 100% {
  27810. transform: translateX(0) scale(0);
  27811. }
  27812. 50% {
  27813. transform: translateX(16px) scale(1);
  27814. }
  27815. 99.999% {
  27816. transform: translateX(32px) scale(0);
  27817. }
  27818. }
  27819. </style>
  27820. ================================================
  27821. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_47.svelte
  27822. ================================================
  27823. <script lang="ts">
  27824. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27825. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27826. const colorClass = () => {
  27827. if (inverse) {
  27828. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27829. } else {
  27830. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27831. }
  27832. };
  27833. </script>
  27834. <div class="{size} m-auto flex flex-col justify-center">
  27835. <div class="relative flex items-center justify-between">
  27836. {#each [-0.375, -0.25, -0.125] as item}
  27837. <div
  27838. class="dot h-2 w-2 rounded-full{colorClass()}"
  27839. style="background-color: {customColor[0]};animation-duration: {1.3 / speed}s;animation-delay: {(1.3 / speed) * item}s"
  27840. ></div>
  27841. {/each}
  27842. </div>
  27843. </div>
  27844. <style>
  27845. .dot {
  27846. animation: pulse ease-in-out infinite both;
  27847. }
  27848. @keyframes pulse {
  27849. 0%,
  27850. 100% {
  27851. transform: scale(0);
  27852. }
  27853. 50% {
  27854. transform: scale(1);
  27855. }
  27856. }
  27857. </style>
  27858. ================================================
  27859. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_48.svelte
  27860. ================================================
  27861. <script lang="ts">
  27862. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27863. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27864. const colorClass = () => {
  27865. if (inverse) {
  27866. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27867. } else {
  27868. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27869. }
  27870. };
  27871. </script>
  27872. <div class="{size} relative m-auto flex -rotate-90 items-center">
  27873. {#each [1, 0.9, 0.6, 0.4] as item, i}
  27874. <div
  27875. class="dot absolute left-0 flex h-full w-full flex-col items-center"
  27876. style="animation-duration: {1.6 / speed}s;animation-delay: {(1.6 / speed) * -(0.4 - i * 0.09)}s;"
  27877. >
  27878. <div
  27879. class="h-1/4 w-1/4 rounded-full{colorClass()}"
  27880. style="background-color: {customColor[0]};opacity: {item};transform: scale({1 - 0.1 * i});"
  27881. ></div>
  27882. </div>
  27883. {/each}
  27884. </div>
  27885. <style>
  27886. .dot {
  27887. animation: swing linear infinite;
  27888. }
  27889. @keyframes swing {
  27890. 0% {
  27891. transform: rotate(0deg);
  27892. }
  27893. 15% {
  27894. transform: rotate(0deg);
  27895. }
  27896. 50% {
  27897. transform: rotate(180deg);
  27898. }
  27899. 65% {
  27900. transform: rotate(180deg);
  27901. }
  27902. 100% {
  27903. transform: rotate(0deg);
  27904. }
  27905. }
  27906. </style>
  27907. ================================================
  27908. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_49.svelte
  27909. ================================================
  27910. <script lang="ts">
  27911. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27912. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27913. const colorClass = () => {
  27914. if (inverse) {
  27915. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27916. } else {
  27917. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27918. }
  27919. };
  27920. </script>
  27921. <div class="{size} relative m-auto">
  27922. {#each [0, -2] as item}
  27923. <div
  27924. class="dot absolute left-0 top-0 h-full w-full rounded-full{colorClass()}"
  27925. style="background-color: {customColor[0]};animation-duration: {2 / speed}s;animation-delay: {2 / speed / item}s;"
  27926. ></div>
  27927. {/each}
  27928. </div>
  27929. <style>
  27930. .dot {
  27931. animation: pulse linear infinite;
  27932. }
  27933. @keyframes pulse {
  27934. 0% {
  27935. transform: scale(0);
  27936. opacity: 1;
  27937. }
  27938. 100% {
  27939. transform: scale(1);
  27940. opacity: 0;
  27941. }
  27942. }
  27943. </style>
  27944. ================================================
  27945. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_5.svelte
  27946. ================================================
  27947. <script lang="ts">
  27948. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  27949. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27950. const colorClass = () => {
  27951. if (inverse) {
  27952. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27953. } else {
  27954. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27955. }
  27956. };
  27957. </script>
  27958. <div
  27959. class="{size} m-auto rounded-full{colorClass()}"
  27960. style="background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  27961. ></div>
  27962. <style>
  27963. div {
  27964. animation: ball-scale infinite linear 1s;
  27965. }
  27966. @keyframes ball-scale {
  27967. 0% {
  27968. transform: scale(0.1);
  27969. opacity: 1;
  27970. }
  27971. 100% {
  27972. transform: scale(1);
  27973. opacity: 0;
  27974. }
  27975. }
  27976. </style>
  27977. ================================================
  27978. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_50.svelte
  27979. ================================================
  27980. <script lang="ts">
  27981. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  27982. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  27983. const colorClass = () => {
  27984. if (inverse) {
  27985. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  27986. } else {
  27987. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  27988. }
  27989. };
  27990. </script>
  27991. <div class="{size} relative m-auto">
  27992. {#each [0, -2] as item}
  27993. <div
  27994. class="dot absolute left-0 top-0 h-full w-full rounded-full{colorClass()}"
  27995. style="background-color: {customColor[0]};animation-duration: {2 / speed}s;animation-delay: {2 / speed / item}s;"
  27996. ></div>
  27997. {/each}
  27998. </div>
  27999. <style>
  28000. .dot {
  28001. animation: pulse linear infinite;
  28002. }
  28003. @keyframes pulse {
  28004. 0%,
  28005. 100% {
  28006. transform: scale(0);
  28007. opacity: 1;
  28008. }
  28009. 50% {
  28010. transform: scale(1);
  28011. opacity: 0.25;
  28012. }
  28013. }
  28014. </style>
  28015. ================================================
  28016. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_51.svelte
  28017. ================================================
  28018. <script lang="ts">
  28019. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28020. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28021. const colorClass = () => {
  28022. if (inverse) {
  28023. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28024. } else {
  28025. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28026. }
  28027. };
  28028. </script>
  28029. <div class="{size} relative m-auto">
  28030. {#each [0, -0.25, -0.5, -0.75] as item}
  28031. <div
  28032. class="dot absolute left-0 top-0 h-full w-full rounded-full{colorClass()}"
  28033. style="background-color: {customColor[0]};animation-duration: {2 / speed}s;animation-delay: {(2 / speed) * item}s"
  28034. ></div>
  28035. {/each}
  28036. </div>
  28037. <style>
  28038. .dot {
  28039. animation: pulse linear infinite;
  28040. }
  28041. @keyframes pulse {
  28042. 0% {
  28043. transform: scale(0);
  28044. opacity: 1;
  28045. }
  28046. 100% {
  28047. transform: scale(1);
  28048. opacity: 0;
  28049. }
  28050. }
  28051. </style>
  28052. ================================================
  28053. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_52.svelte
  28054. ================================================
  28055. <script lang="ts">
  28056. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28057. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28058. const colorClass = () => {
  28059. if (inverse) {
  28060. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28061. } else {
  28062. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28063. }
  28064. };
  28065. </script>
  28066. <div class="{size} relative m-auto">
  28067. {#each [[-0.375, 1], [-0.375, 0.8], [-0.3, 0.6], [-0.225, 0.4], [-0.15, 0.2], [-0.075, 0.1]] as item}
  28068. <div
  28069. class="line absolute left-0 h-1 w-full rounded-full{colorClass()}"
  28070. style="background-color: {customColor[0]};top: calc(50% - 2px);animation-duration: {0.9 / speed}s;animation-delay: {(0.9 / speed) *
  28071. item[0]}s;opacity: {item[1]};"
  28072. ></div>
  28073. {/each}
  28074. </div>
  28075. <style>
  28076. .line {
  28077. animation: rotate ease-in-out infinite alternate;
  28078. }
  28079. @keyframes rotate {
  28080. 0% {
  28081. transform: rotate(0deg);
  28082. }
  28083. 100% {
  28084. transform: rotate(180deg);
  28085. }
  28086. }
  28087. </style>
  28088. ================================================
  28089. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_53.svelte
  28090. ================================================
  28091. <script lang="ts">
  28092. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28093. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28094. const colorClass = () => {
  28095. if (inverse) {
  28096. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28097. } else {
  28098. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28099. }
  28100. };
  28101. </script>
  28102. <div class="{size} relative m-auto">
  28103. {#each [[-0.375, 1], [-0.375, 0.8], [-0.3, 0.6], [-0.225, 0.4], [-0.15, 0.2], [-0.075, 0.1]] as item}
  28104. <div
  28105. class="line absolute left-0 h-1 w-full rounded-full{colorClass()}"
  28106. style="background-color: {customColor[0]};top: 50%;animation-duration: {0.9 / speed}s;animation-delay: {(0.9 / speed) *
  28107. item[0]}s;opacity: {item[1]};"
  28108. ></div>
  28109. {/each}
  28110. </div>
  28111. <style>
  28112. .line {
  28113. animation: rotate ease-in-out infinite;
  28114. }
  28115. @keyframes rotate {
  28116. 0% {
  28117. transform: rotate(0deg);
  28118. }
  28119. 100% {
  28120. transform: rotate(180deg);
  28121. }
  28122. }
  28123. </style>
  28124. ================================================
  28125. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_6.svelte
  28126. ================================================
  28127. <script lang="ts">
  28128. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28129. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28130. const colorClass = () => {
  28131. if (inverse) {
  28132. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28133. } else {
  28134. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28135. }
  28136. };
  28137. </script>
  28138. <div class="relative {size} m-auto">
  28139. <div
  28140. class="absolute{colorClass()} loading1 h-1/3 w-1/3 rounded-full"
  28141. style="background: {customColor[0]};animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  28142. ></div>
  28143. <div
  28144. class="absolute{colorClass()} loading2 h-1/3 w-1/3 rounded-full"
  28145. style="background: {customColor[0]};animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 / speed}s;"
  28146. ></div>
  28147. </div>
  28148. <style>
  28149. .loading1 {
  28150. animation: loading1 1.5s infinite;
  28151. }
  28152. .loading2 {
  28153. animation: loading2 1.5s infinite;
  28154. }
  28155. @keyframes loading1 {
  28156. 0% {
  28157. transform: translate(200%, 200%);
  28158. }
  28159. 25% {
  28160. transform: translate(0, 200%);
  28161. }
  28162. 50% {
  28163. transform: translate(0, 0);
  28164. }
  28165. 75% {
  28166. transform: translate(200%, 0);
  28167. }
  28168. 100% {
  28169. transform: translate(200%, 200%);
  28170. }
  28171. }
  28172. @keyframes loading2 {
  28173. 0% {
  28174. transform: translate(0, 0);
  28175. }
  28176. 25% {
  28177. transform: translate(200%, 0);
  28178. }
  28179. 50% {
  28180. transform: translate(200%, 200%);
  28181. }
  28182. 75% {
  28183. transform: translate(0, 200%);
  28184. }
  28185. 100% {
  28186. transform: translate(0, 0);
  28187. }
  28188. }
  28189. </style>
  28190. ================================================
  28191. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_7.svelte
  28192. ================================================
  28193. <script lang="ts">
  28194. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28195. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28196. const colorClass = () => {
  28197. if (inverse) {
  28198. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28199. } else {
  28200. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28201. }
  28202. };
  28203. </script>
  28204. <div class="{size} m-auto flex items-center">
  28205. <div
  28206. class="flex-1{colorClass()} loading1 h-1/2 w-1/2 rounded-full"
  28207. style="background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  28208. ></div>
  28209. <div
  28210. class="flex-1{colorClass()} loading2 h-1/2 w-1/2 rounded-full"
  28211. style="background: {customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  28212. ></div>
  28213. </div>
  28214. <style>
  28215. .loading1 {
  28216. animation: loading infinite 1s -0.4s cubic-bezier(0.2, 0.68, 0.18, 1.08);
  28217. }
  28218. .loading2 {
  28219. animation: loading infinite 1s cubic-bezier(0.2, 0.68, 0.18, 1.08);
  28220. }
  28221. @keyframes loading {
  28222. 0% {
  28223. transform: scale(1);
  28224. opacity: 1;
  28225. }
  28226. 50% {
  28227. transform: scale(0.1);
  28228. opacity: 0.6;
  28229. }
  28230. 100% {
  28231. transform: scale(1);
  28232. opacity: 1;
  28233. }
  28234. }
  28235. </style>
  28236. ================================================
  28237. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_8.svelte
  28238. ================================================
  28239. <script lang="ts">
  28240. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: string[]; speed?: number };
  28241. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28242. const colorClass = () => {
  28243. if (inverse) {
  28244. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28245. } else {
  28246. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28247. }
  28248. };
  28249. </script>
  28250. <div
  28251. class="{size} loading m-auto flex items-center justify-between"
  28252. style="animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  28253. >
  28254. <div class="{colorClass()} h-2 w-2 rounded-full" style="background: {customColor[0]}"></div>
  28255. <div class="{colorClass()} h-2 w-2 rounded-full" style="background: {customColor[0]}"></div>
  28256. <div class="{colorClass()} h-2 w-2 rounded-full" style="background: {customColor[0]}"></div>
  28257. </div>
  28258. <style>
  28259. .loading {
  28260. animation: loading 1s cubic-bezier(0.7, -0.13, 0.22, 0.86) infinite;
  28261. }
  28262. @keyframes loading {
  28263. 0% {
  28264. transform: rotate(0deg) scale(1);
  28265. }
  28266. 50% {
  28267. transform: rotate(180deg) scale(0.6);
  28268. }
  28269. 100% {
  28270. transform: rotate(360deg) scale(1);
  28271. }
  28272. }
  28273. </style>
  28274. ================================================
  28275. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/1_9.svelte
  28276. ================================================
  28277. <script lang="ts">
  28278. type Props = { theme?: boolean; inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28279. let { theme = false, inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28280. const colorClass = () => {
  28281. if (inverse) {
  28282. return theme ? ' bg-dark dark:bg-primary' : ' bg-white dark:bg-black';
  28283. } else {
  28284. return theme ? ' bg-primary dark:bg-dark' : ' bg-black dark:bg-white';
  28285. }
  28286. };
  28287. </script>
  28288. <div class="relative {size} m-auto">
  28289. {#each [0, 1, 2] as i}
  28290. <div
  28291. class="absolute{colorClass()} loading h-1/3 w-1/3 rounded-full"
  28292. style="animation-delay: {i - 2}s;background: {customColor[0]};animation-duration: {1.5 / speed}s;-webkit-animation-duration: {1.5 /
  28293. speed}s;"
  28294. ></div>
  28295. {/each}
  28296. </div>
  28297. <style>
  28298. .loading {
  28299. animation: loading 1.5s linear infinite;
  28300. }
  28301. @keyframes loading {
  28302. 0% {
  28303. transform: translate(200%, 200%);
  28304. }
  28305. 25% {
  28306. transform: translate(0, 200%);
  28307. }
  28308. 50% {
  28309. transform: translate(0, 0);
  28310. }
  28311. 75% {
  28312. transform: translate(200%, 0);
  28313. }
  28314. 100% {
  28315. transform: translate(200%, 200%);
  28316. }
  28317. }
  28318. </style>
  28319. ================================================
  28320. FILE: packages/stdf/src/lib/components/loading/loadings/oneColor/index.ts
  28321. ================================================
  28322. export { default as Loading1_0 } from './1_0.svelte';
  28323. export { default as Loading1_1 } from './1_1.svelte';
  28324. export { default as Loading1_2 } from './1_2.svelte';
  28325. export { default as Loading1_3 } from './1_3.svelte';
  28326. export { default as Loading1_4 } from './1_4.svelte';
  28327. export { default as Loading1_5 } from './1_5.svelte';
  28328. export { default as Loading1_6 } from './1_6.svelte';
  28329. export { default as Loading1_7 } from './1_7.svelte';
  28330. export { default as Loading1_8 } from './1_8.svelte';
  28331. export { default as Loading1_9 } from './1_9.svelte';
  28332. export { default as Loading1_10 } from './1_10.svelte';
  28333. export { default as Loading1_11 } from './1_11.svelte';
  28334. export { default as Loading1_12 } from './1_12.svelte';
  28335. export { default as Loading1_13 } from './1_13.svelte';
  28336. export { default as Loading1_14 } from './1_14.svelte';
  28337. export { default as Loading1_15 } from './1_15.svelte';
  28338. export { default as Loading1_16 } from './1_16.svelte';
  28339. export { default as Loading1_17 } from './1_17.svelte';
  28340. export { default as Loading1_18 } from './1_18.svelte';
  28341. export { default as Loading1_19 } from './1_19.svelte';
  28342. export { default as Loading1_20 } from './1_20.svelte';
  28343. export { default as Loading1_21 } from './1_21.svelte';
  28344. export { default as Loading1_22 } from './1_22.svelte';
  28345. export { default as Loading1_23 } from './1_23.svelte';
  28346. export { default as Loading1_24 } from './1_24.svelte';
  28347. export { default as Loading1_25 } from './1_25.svelte';
  28348. export { default as Loading1_26 } from './1_26.svelte';
  28349. export { default as Loading1_27 } from './1_27.svelte';
  28350. export { default as Loading1_28 } from './1_28.svelte';
  28351. export { default as Loading1_29 } from './1_29.svelte';
  28352. export { default as Loading1_30 } from './1_30.svelte';
  28353. export { default as Loading1_31 } from './1_31.svelte';
  28354. export { default as Loading1_32 } from './1_32.svelte';
  28355. export { default as Loading1_33 } from './1_33.svelte';
  28356. export { default as Loading1_34 } from './1_34.svelte';
  28357. export { default as Loading1_35 } from './1_35.svelte';
  28358. export { default as Loading1_36 } from './1_36.svelte';
  28359. export { default as Loading1_37 } from './1_37.svelte';
  28360. export { default as Loading1_38 } from './1_38.svelte';
  28361. export { default as Loading1_39 } from './1_39.svelte';
  28362. export { default as Loading1_40 } from './1_40.svelte';
  28363. export { default as Loading1_41 } from './1_41.svelte';
  28364. export { default as Loading1_42 } from './1_42.svelte';
  28365. export { default as Loading1_43 } from './1_43.svelte';
  28366. export { default as Loading1_44 } from './1_44.svelte';
  28367. export { default as Loading1_45 } from './1_45.svelte';
  28368. export { default as Loading1_46 } from './1_46.svelte';
  28369. export { default as Loading1_47 } from './1_47.svelte';
  28370. export { default as Loading1_48 } from './1_48.svelte';
  28371. export { default as Loading1_49 } from './1_49.svelte';
  28372. export { default as Loading1_50 } from './1_50.svelte';
  28373. export { default as Loading1_51 } from './1_51.svelte';
  28374. export { default as Loading1_52 } from './1_52.svelte';
  28375. export { default as Loading1_53 } from './1_53.svelte';
  28376. ================================================
  28377. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_0.svelte
  28378. ================================================
  28379. <script lang="ts">
  28380. type Props = { inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28381. let { inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28382. const outerBorderClass = () => {
  28383. return inverse ? ' border-white/10 dark:border-black/10' : ' border-black/10 dark:border-white/10';
  28384. };
  28385. const innerColorClass = () => {
  28386. return inverse
  28387. ? ' border-transparent dark:border-transparent border-l-dark dark:border-l-primary'
  28388. : ' border-transparent dark:border-transparent border-l-primary dark:border-l-dark';
  28389. };
  28390. </script>
  28391. <div
  28392. class="{size} m-auto rounded-full border-2 p-0.5 animate-spin{outerBorderClass()}"
  28393. style="border-color:{customColor[0]};animation-duration: {1 / speed}s;-webkit-animation-duration: {1 / speed}s;"
  28394. >
  28395. <div
  28396. class="h-full w-full border-2 rounded-full{innerColorClass()}"
  28397. style="border-color:{customColor[1] && 'transparent'};border-left-color:{customColor[1]}"
  28398. ></div>
  28399. </div>
  28400. ================================================
  28401. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_1.svelte
  28402. ================================================
  28403. <script lang="ts">
  28404. type Props = { inverse?: boolean; size?: string; customColor?: any[]; speed?: number };
  28405. let { inverse = false, size = 'w-8 h-8', customColor = [], speed = $bindable(1) }: Props = $props();
  28406. const outerBorderClass = () => {
  28407. return inverse ? ' border-white/10 dark:border-black/10' : ' border-black/10 dark:border-white/10';
  28408. };
  28409. const innerColorClass = () => {
  28410. return inverse
  28411. ? ' border-transparent dark:border-transparent border-l-dark dark:border-l-primary'
  28412. : ' border-transparent dark:border-transparent border-l-primary dark:border-l-dark';
  28413. };
  28414. </script>
  28415. <div
  28416. class="{size} m-auto rounded-full border-2 p-0.5 animate-spin{innerColorClass()}"
  28417. style="border-color:{customColor[1] && 'transparent'};border-left-color:{customColor[1]};animation-duration: {1 /
  28418. speed}s;-webkit-animation-duration: {1 / speed}s;"
  28419. >
  28420. <div class="h-full w-full border-2 rounded-full{outerBorderClass()}" style="border-color:{customColor[0]};"></div>
  28421. </div>
  28422. ================================================
  28423. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_2.svelte
  28424. ================================================
  28425. <script lang="ts">
  28426. type Props = { size?: string; customColor?: any[]; speed?: number; inverse?: boolean };
  28427. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), inverse = false }: Props = $props();
  28428. const borderClass = () => {
  28429. return inverse
  28430. ? 'border-white/5 dark:border-black/5 border-l-dark dark:border-l-primary border-r-dark dark:border-r-primary'
  28431. : 'border-black/5 dark:border-white/5 border-l-primary dark:border-l-dark border-r-primary dark:border-r-dark';
  28432. };
  28433. </script>
  28434. <div
  28435. class="{size} loading m-auto rounded-full border-4 {borderClass()}"
  28436. style="border-color: {customColor[0] || (inverse ? '' : '')} {customColor[1] || (inverse ? '' : '')} {customColor[0] ||
  28437. (inverse ? '' : '')} {customColor[1] || (inverse ? '' : '')};animation-duration: {2 / speed}s;-webkit-animation-duration: {2 / speed}s;"
  28438. ></div>
  28439. <style>
  28440. .loading {
  28441. animation: loading-animation 2s ease-in-out infinite alternate;
  28442. }
  28443. @keyframes loading-animation {
  28444. from {
  28445. transform: rotate(0deg);
  28446. }
  28447. to {
  28448. transform: rotate(720deg);
  28449. }
  28450. }
  28451. </style>
  28452. ================================================
  28453. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_3.svelte
  28454. ================================================
  28455. <script lang="ts">
  28456. type Props = { size?: string; customColor?: any[]; speed?: number; inverse?: boolean };
  28457. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), inverse = false }: Props = $props();
  28458. const bgClass = () => {
  28459. return inverse ? 'bg-dark dark:bg-primary' : 'bg-primary dark:bg-dark';
  28460. };
  28461. const bgClass2 = () => {
  28462. return inverse ? 'bg-white/50 dark:bg-black/50' : 'bg-black/50 dark:bg-white/50';
  28463. };
  28464. </script>
  28465. <div class="{size} relative m-auto rotate-45">
  28466. <div
  28467. class="shape1 absolute left-0 top-0 h-1/3 w-1/3 {bgClass()}"
  28468. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  28469. ></div>
  28470. <div
  28471. class="shape2 absolute right-0 top-0 h-1/3 w-1/3 {bgClass2()}"
  28472. style="background: {customColor[1]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  28473. ></div>
  28474. <div
  28475. class="shape3 absolute bottom-0 right-0 h-1/3 w-1/3 {bgClass()}"
  28476. style="background: {customColor[0]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  28477. ></div>
  28478. <div
  28479. class="shape4 absolute bottom-0 left-0 h-1/3 w-1/3 {bgClass2()}"
  28480. style="background: {customColor[1]};animation-duration: {0.5 / speed}s;-webkit-animation-duration: {0.5 / speed}s;"
  28481. ></div>
  28482. </div>
  28483. <style>
  28484. .shape1 {
  28485. animation: animationShape1 0.5s ease infinite alternate;
  28486. }
  28487. .shape2 {
  28488. animation: animationShape2 0.5s ease infinite alternate;
  28489. }
  28490. .shape3 {
  28491. animation: animationShape3 0.5s ease infinite alternate;
  28492. }
  28493. .shape4 {
  28494. animation: animationShape4 0.5s ease infinite alternate;
  28495. }
  28496. @keyframes animationShape1 {
  28497. 0% {
  28498. transform: translate(0, 0);
  28499. }
  28500. 100% {
  28501. transform: translate(16px, 16px);
  28502. }
  28503. }
  28504. @keyframes animationShape2 {
  28505. 0% {
  28506. transform: translate(0, 0);
  28507. }
  28508. 100% {
  28509. transform: translate(-16px, 16px);
  28510. }
  28511. }
  28512. @keyframes animationShape3 {
  28513. 0% {
  28514. transform: translate(0, 0);
  28515. }
  28516. 100% {
  28517. transform: translate(-16px, -16px);
  28518. }
  28519. }
  28520. @keyframes animationShape4 {
  28521. 0% {
  28522. transform: translate(0, 0);
  28523. }
  28524. 100% {
  28525. transform: translate(16px, -16px);
  28526. }
  28527. }
  28528. </style>
  28529. ================================================
  28530. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_4.svelte
  28531. ================================================
  28532. <script lang="ts">
  28533. type Props = { size?: string; customColor?: any[]; speed?: number; inverse?: boolean };
  28534. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), inverse = false } = $props();
  28535. const bgClass = () => {
  28536. return inverse ? 'bg-dark dark:bg-primary' : 'bg-primary dark:bg-dark';
  28537. };
  28538. const bgClass2 = () => {
  28539. return inverse ? 'bg-white/50 dark:bg-black/50' : 'bg-black/50 dark:bg-white/50';
  28540. };
  28541. </script>
  28542. <div class="{size} loading relative m-auto" style="animation-duration: {1.6 / speed}s;-webkit-animation-duration: {1.6 / speed}s;">
  28543. <div
  28544. class="shape1 absolute h-1/3 w-1/3 rounded-full {bgClass()}"
  28545. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  28546. ></div>
  28547. <div
  28548. class="shape2 absolute h-1/3 w-1/3 rounded-full {bgClass2()}"
  28549. style="background: {customColor[1]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  28550. ></div>
  28551. <div
  28552. class="shape3 absolute h-1/3 w-1/3 rounded-full {bgClass()}"
  28553. style="background: {customColor[0]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  28554. ></div>
  28555. <div
  28556. class="shape4 absolute h-1/3 w-1/3 rounded-full {bgClass2()}"
  28557. style="background: {customColor[1]};animation-duration: {0.8 / speed}s;-webkit-animation-duration: {0.8 / speed}s;"
  28558. ></div>
  28559. </div>
  28560. <style>
  28561. .loading {
  28562. animation: animationContainer 1.6s ease infinite;
  28563. }
  28564. .shape1 {
  28565. animation: animationShape1 0.8s ease infinite alternate;
  28566. }
  28567. .shape2 {
  28568. animation: animationShape2 0.8s ease infinite alternate;
  28569. }
  28570. .shape3 {
  28571. animation: animationShape3 0.8s ease infinite alternate;
  28572. }
  28573. .shape4 {
  28574. animation: animationShape4 0.8s ease infinite alternate;
  28575. }
  28576. @keyframes animationContainer {
  28577. 0% {
  28578. transform: rotate(0);
  28579. }
  28580. 100% {
  28581. transform: rotate(360deg);
  28582. }
  28583. }
  28584. @keyframes animationShape1 {
  28585. 0% {
  28586. top: 0;
  28587. left: 0;
  28588. }
  28589. 100% {
  28590. top: 66.6666666667%;
  28591. left: 66.6666666667%;
  28592. }
  28593. }
  28594. @keyframes animationShape2 {
  28595. 0% {
  28596. top: 0;
  28597. left: 66.6666666667%;
  28598. }
  28599. 100% {
  28600. top: 66.6666666667%;
  28601. left: 0;
  28602. }
  28603. }
  28604. @keyframes animationShape3 {
  28605. 0% {
  28606. top: 66.6666666667%;
  28607. left: 66.6666666667%;
  28608. }
  28609. 100% {
  28610. top: 0;
  28611. left: 0;
  28612. }
  28613. }
  28614. @keyframes animationShape4 {
  28615. 0% {
  28616. top: 66.6666666667%;
  28617. left: 0;
  28618. }
  28619. 100% {
  28620. top: 0;
  28621. left: 66.6666666667%;
  28622. }
  28623. }
  28624. </style>
  28625. ================================================
  28626. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/2_5.svelte
  28627. ================================================
  28628. <script lang="ts">
  28629. type Props = { size?: string; customColor?: any[]; speed?: number; inverse?: boolean };
  28630. let { size = 'w-8 h-8', customColor = [], speed = $bindable(1), inverse = false } = $props();
  28631. const bgClass = () => {
  28632. return inverse ? 'bg-dark dark:bg-primary' : 'bg-primary dark:bg-dark';
  28633. };
  28634. const bgClass2 = () => {
  28635. return inverse ? 'bg-white/50 dark:bg-black/50' : 'bg-black/50 dark:bg-white/50';
  28636. };
  28637. </script>
  28638. <div class="{size} loading relative m-auto" style="animation-duration: {1.2 / speed}s;-webkit-animation-duration: {1.2 / speed}s;">
  28639. <div
  28640. class="shape1 absolute h-1/2 w-1/2 rounded-tl-full {bgClass()}"
  28641. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  28642. ></div>
  28643. <div
  28644. class="shape2 absolute h-1/2 w-1/2 rounded-tr-full {bgClass2()}"
  28645. style="background: {customColor[1]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  28646. ></div>
  28647. <div
  28648. class="shape3 absolute h-1/2 w-1/2 rounded-br-full {bgClass()}"
  28649. style="background: {customColor[0]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  28650. ></div>
  28651. <div
  28652. class="shape4 absolute h-1/2 w-1/2 rounded-bl-full {bgClass2()}"
  28653. style="background: {customColor[1]};animation-duration: {0.6 / speed}s;-webkit-animation-duration: {0.6 / speed}s;"
  28654. ></div>
  28655. </div>
  28656. <style>
  28657. .loading {
  28658. animation: animationContainer 1.2s ease infinite;
  28659. }
  28660. .shape1 {
  28661. animation: animationShape1 0.6s ease infinite alternate;
  28662. }
  28663. .shape2 {
  28664. animation: animationShape2 0.6s ease infinite alternate;
  28665. }
  28666. .shape3 {
  28667. animation: animationShape3 0.6s ease infinite alternate;
  28668. }
  28669. .shape4 {
  28670. animation: animationShape4 0.6s ease infinite alternate;
  28671. }
  28672. @keyframes animationContainer {
  28673. 0% {
  28674. transform: rotate(0);
  28675. }
  28676. 100% {
  28677. transform: rotate(360deg);
  28678. }
  28679. }
  28680. @keyframes animationShape1 {
  28681. 0% {
  28682. top: 0;
  28683. left: 0;
  28684. }
  28685. 100% {
  28686. top: -10%;
  28687. left: -10%;
  28688. }
  28689. }
  28690. @keyframes animationShape2 {
  28691. 0% {
  28692. top: 0;
  28693. left: 50%;
  28694. }
  28695. 100% {
  28696. top: -10%;
  28697. left: 60%;
  28698. }
  28699. }
  28700. @keyframes animationShape3 {
  28701. 0% {
  28702. top: 50%;
  28703. left: 50%;
  28704. }
  28705. 100% {
  28706. top: 60%;
  28707. left: 60%;
  28708. }
  28709. }
  28710. @keyframes animationShape4 {
  28711. 0% {
  28712. top: 50%;
  28713. left: 0;
  28714. }
  28715. 100% {
  28716. top: 60%;
  28717. left: -10%;
  28718. }
  28719. }
  28720. </style>
  28721. ================================================
  28722. FILE: packages/stdf/src/lib/components/loading/loadings/twoColor/index.ts
  28723. ================================================
  28724. export { default as Loading2_0 } from './2_0.svelte';
  28725. export { default as Loading2_1 } from './2_1.svelte';
  28726. export { default as Loading2_2 } from './2_2.svelte';
  28727. export { default as Loading2_3 } from './2_3.svelte';
  28728. export { default as Loading2_4 } from './2_4.svelte';
  28729. export { default as Loading2_5 } from './2_5.svelte';
  28730. ================================================
  28731. FILE: packages/stdf/src/lib/components/mask/Mask.svelte
  28732. ================================================
  28733. <script lang="ts">
  28734. import { fade } from 'svelte/transition';
  28735. import type { MaskProps } from '../../types/index.js';
  28736. let {
  28737. visible = false,
  28738. opacity = '0.5',
  28739. clickable = false,
  28740. inverse = false,
  28741. backdropBlur = 'none',
  28742. duration = 150,
  28743. outDuration = 0,
  28744. zIndex = 500,
  28745. children,
  28746. onclickMask
  28747. }: MaskProps = $props();
  28748. //遮罩模糊度样式
  28749. // Mask blur style
  28750. const backdropBlurClass = {
  28751. none: '',
  28752. xs: ' backdrop-blur-xs',
  28753. sm: ' backdrop-blur-sm',
  28754. md: ' backdrop-blur-md',
  28755. lg: ' backdrop-blur-lg',
  28756. xl: ' backdrop-blur-xl',
  28757. '2xl': ' backdrop-blur-2xl',
  28758. '3xl': ' backdrop-blur-3xl'
  28759. };
  28760. // 遮罩背景色
  28761. // Mask background color
  28762. const bgClass = {
  28763. '0': ' bg-transparent',
  28764. '0.1': ' bg-black/10 dark:bg-white/10',
  28765. '0.2': ' bg-black/20 dark:bg-white/20',
  28766. '0.3': ' bg-black/30 dark:bg-white/30',
  28767. '0.4': ' bg-black/40 dark:bg-white/40',
  28768. '0.5': ' bg-black/50 dark:bg-white/50',
  28769. '0.6': ' bg-black/60 dark:bg-white/60',
  28770. '0.7': ' bg-black/70 dark:bg-white/70',
  28771. '0.8': ' bg-black/80 dark:bg-white/80',
  28772. '0.9': ' bg-black/90 dark:bg-white/90',
  28773. '1': ' bg-black dark:bg-white'
  28774. };
  28775. // 遮罩背景色反色
  28776. // Mask background color reverse color
  28777. const bgClassInverse = {
  28778. '0': ' bg-transparent',
  28779. '0.1': ' bg-white/10 dark:bg-black/10',
  28780. '0.2': ' bg-white/20 dark:bg-black/20',
  28781. '0.3': ' bg-white/30 dark:bg-black/30',
  28782. '0.4': ' bg-white/40 dark:bg-black/40',
  28783. '0.5': ' bg-white/50 dark:bg-black/50',
  28784. '0.6': ' bg-white/60 dark:bg-black/60',
  28785. '0.7': ' bg-white/70 dark:bg-black/70',
  28786. '0.8': ' bg-white/80 dark:bg-black/80',
  28787. '0.9': ' bg-white/90 dark:bg-black/90',
  28788. '1': ' bg-white dark:bg-black'
  28789. };
  28790. </script>
  28791. {#if visible}
  28792. <button
  28793. in:fade|global={{ duration }}
  28794. out:fade|global={{ duration: outDuration }}
  28795. onclick={() => onclickMask && onclickMask?.()}
  28796. class="fixed h-screen w-screen inset-0{inverse
  28797. ? bgClassInverse[opacity] || bgClassInverse['0.5']
  28798. : bgClass[opacity] || bgClass['0.5']}{clickable ? ' pointer-events-none' : ''}{backdropBlurClass[backdropBlur] ||
  28799. backdropBlurClass['none']}"
  28800. style="z-index:{zIndex}"
  28801. >
  28802. {@render children?.()}
  28803. </button>
  28804. {/if}
  28805. ================================================
  28806. FILE: packages/stdf/src/lib/components/modal/Modal.svelte
  28807. ================================================
  28808. <script lang="ts">
  28809. import { getContext } from 'svelte';
  28810. import Popup from '../popup/Popup.svelte';
  28811. import Button from '../button/Button.svelte';
  28812. import Icon from '../icon/Icon.svelte';
  28813. import { zh_CN, type LangProps } from '../../lang/index.js';
  28814. import type { ModalProps } from '../../types/index.js';
  28815. // 当前语言
  28816. // current language
  28817. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  28818. const modalLang: LangProps['modal'] = currentLang.modal;
  28819. let {
  28820. visible = $bindable(false),
  28821. title = modalLang.title,
  28822. titleAlign = 'center',
  28823. content = modalLang.content,
  28824. popup = {},
  28825. showIcon = false,
  28826. icon = {},
  28827. showBtn = true,
  28828. btnText = modalLang.btnText,
  28829. button = {},
  28830. contentChild,
  28831. onclose
  28832. }: ModalProps = $props();
  28833. // 标题对齐方式样式
  28834. // Title alignment style
  28835. const titleAlignClass = { left: ' text-left', center: ' text-center', right: ' text-right' };
  28836. // 关闭并派发事件
  28837. // Close and dispatch events
  28838. const closeModalFunc = () => {
  28839. visible = false;
  28840. onclose?.();
  28841. };
  28842. </script>
  28843. <Popup
  28844. bind:visible
  28845. size={0}
  28846. duration={300}
  28847. outDuration={150}
  28848. maskClosable={!showBtn}
  28849. position="center"
  28850. radiusPosition="all"
  28851. radius="lg"
  28852. px="8"
  28853. {...popup}
  28854. >
  28855. <div class="px-4 pt-4 {showBtn ? 'pb-2' : 'pb-4'} space-y-4 text-center">
  28856. <div class="font-bold{titleAlignClass[titleAlign] || titleAlignClass['center']}">{title}</div>
  28857. {#if showIcon}
  28858. <div><Icon {...icon} /></div>
  28859. {/if}
  28860. <div>
  28861. {#if contentChild}
  28862. {@render contentChild()}
  28863. {:else}
  28864. {content}
  28865. {/if}
  28866. </div>
  28867. {#if showBtn}
  28868. <div><Button size="full" {...button} onclick={closeModalFunc}>{btnText}</Button></div>
  28869. {/if}
  28870. </div>
  28871. </Popup>
  28872. ================================================
  28873. FILE: packages/stdf/src/lib/components/navBar/NavBar.svelte
  28874. ================================================
  28875. <script lang="ts">
  28876. import { getContext } from 'svelte';
  28877. import Icon from '../icon/Icon.svelte';
  28878. import type { NavBarProps } from '../../types/index.js';
  28879. import { zh_CN, type LangProps } from '../../lang/index.js';
  28880. // 当前语言
  28881. // current language
  28882. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  28883. const navBarLang: LangProps['navBar'] = currentLang.navBar;
  28884. let {
  28885. title = navBarLang.title,
  28886. titleAlign = 'left',
  28887. left = 'back',
  28888. rights = [],
  28889. line = true,
  28890. injClass = '',
  28891. love = false,
  28892. onclickLeft,
  28893. onclickRight,
  28894. titleChild,
  28895. leftChild,
  28896. rightChild
  28897. }: NavBarProps = $props();
  28898. //图标大小
  28899. //Icon size
  28900. const iconSize = love ? 30 : 24;
  28901. // 标题对齐方式
  28902. // Title alignment
  28903. const titleAlignClass = { left: 'text-left', center: 'text-center', right: 'text-right' };
  28904. </script>
  28905. <div
  28906. class="flex h-12 w-full justify-between border-black/10 leading-[3rem] dark:border-white/10 {line
  28907. ? 'border-b '
  28908. : ' '}bg-white dark:bg-black/50{love ? ' text-xl' : ''}{injClass === '' ? '' : ' ' + injClass}"
  28909. >
  28910. {#if leftChild}
  28911. {@render leftChild()}
  28912. {:else if left === 'back'}
  28913. <button class="min-w-[3rem] text-center lining-nums active:opacity-80" onclick={() => onclickLeft && onclickLeft()}>
  28914. <Icon name="ri-arrow-left-s-line" size={iconSize} top={-2} />
  28915. </button>
  28916. {:else if left === null}
  28917. <div class="h-full w-4"></div>
  28918. {:else}
  28919. <button class="min-w-[3rem] text-center lining-nums active:opacity-80" onclick={() => onclickLeft && onclickLeft()}>
  28920. <Icon {...left} />
  28921. </button>
  28922. {/if}
  28923. <div class="flex-1 truncate" class:pl-2={left === null}>
  28924. {#if titleChild}
  28925. {@render titleChild()}
  28926. {:else}
  28927. <div class={titleAlignClass[titleAlign] || titleAlignClass['left']}>{title}</div>
  28928. {/if}
  28929. </div>
  28930. <div class="flex">
  28931. {#if rightChild}
  28932. {@render rightChild()}
  28933. {:else if rights.length > 0}
  28934. {#each rights as icon, i}
  28935. <button class="w-12 text-center active:opacity-80" onclick={() => onclickRight && onclickRight(i)}>
  28936. <Icon {...icon} size={iconSize} />
  28937. </button>
  28938. {/each}
  28939. {:else}{/if}
  28940. </div>
  28941. </div>
  28942. ================================================
  28943. FILE: packages/stdf/src/lib/components/noticeBar/NoticeBar.svelte
  28944. ================================================
  28945. <script lang="ts">
  28946. import { onMount } from 'svelte';
  28947. import Icon from '../icon/Icon.svelte';
  28948. import type { NoticeBarProps } from '../../types/index.js';
  28949. let {
  28950. textList = [],
  28951. leftIcon = {},
  28952. rightIcon = 'close',
  28953. fontSize = 'sm',
  28954. space = 100,
  28955. speed = 30,
  28956. vertical = false,
  28957. duration = 500,
  28958. interval = 4,
  28959. injClass = '',
  28960. leftChild,
  28961. rightChild,
  28962. onclickRight
  28963. }: NoticeBarProps = $props();
  28964. // 如果 textList 不是数组给出中英文报错
  28965. // If textList is not an array, give Chinese and English error
  28966. if (!Array.isArray(textList)) {
  28967. console.error('[STDF NoticeBar error]textList 必须是数组。(textList must be an array.)');
  28968. }
  28969. // 如果 textList 为空数组给出中英文报错
  28970. // If textList is an empty array, give Chinese and English error
  28971. if (textList.length === 0) {
  28972. console.error('[STDF NoticeBar error]textList must not be empty.');
  28973. }
  28974. // 字体大小样式
  28975. // Font size style
  28976. const fontSizeClass = { xs: ' text-xs', sm: ' text-sm', base: ' text-base', lg: ' text-lg' };
  28977. // 动画时长样式
  28978. // Animation duration style
  28979. const durationClass = {
  28980. '100': ' duration-100',
  28981. '300': ' duration-300',
  28982. '500': ' duration-500',
  28983. '700': ' duration-700',
  28984. '1000': ' duration-1000'
  28985. };
  28986. let left = $state(speed);
  28987. let boxDom = $state<HTMLDivElement | null>(null);
  28988. let outBoxDom = $state<HTMLDivElement | null>(null);
  28989. let boxWidth = $state(0);
  28990. let outBoxWidth = $state(0);
  28991. let outBoxHeight = $state(0);
  28992. let requestAnimationFrameFlag = $state<number | undefined>(undefined);
  28993. let startTime = 0;
  28994. let fps = 0;
  28995. //垂直滚动时的处理
  28996. //Processing when scrolling vertically
  28997. let times: ReturnType<typeof setInterval>;
  28998. let currentIndex = $state(0);
  28999. let textListVertical = [...textList, textList[0]];
  29000. let isTransition = $state(true);
  29001. const stepFun = (time: number) => {
  29002. fps = time - startTime;
  29003. startTime = time;
  29004. left -= (speed * fps) / 1000;
  29005. requestAnimationFrameFlag = requestAnimationFrame(stepFun);
  29006. if (left < -boxWidth / 2) {
  29007. left = 0;
  29008. }
  29009. };
  29010. let newTextList = $state([...textList, ...textList]);
  29011. onMount(() => {
  29012. if (!vertical) {
  29013. boxWidth = boxDom?.getBoundingClientRect().width || 0;
  29014. }
  29015. outBoxWidth = outBoxDom?.getBoundingClientRect().width || 0;
  29016. outBoxHeight = outBoxDom?.getBoundingClientRect().height || 0;
  29017. if (!vertical && boxWidth / 2 - space < outBoxWidth) {
  29018. newTextList = textList;
  29019. left = 0;
  29020. return;
  29021. }
  29022. requestAnimationFrameFlag = requestAnimationFrame(stepFun);
  29023. if (vertical) {
  29024. if (textListVertical.length > 1) {
  29025. times = setInterval(() => {
  29026. currentIndex++;
  29027. if (currentIndex === textListVertical.length - 1) {
  29028. setTimeout(() => {
  29029. currentIndex = 0;
  29030. isTransition = false;
  29031. }, duration);
  29032. } else {
  29033. isTransition = true;
  29034. }
  29035. }, interval * 1000);
  29036. }
  29037. }
  29038. return () => {
  29039. if (vertical && times !== null) {
  29040. clearInterval(times);
  29041. } else if (requestAnimationFrameFlag) {
  29042. cancelAnimationFrame(requestAnimationFrameFlag);
  29043. }
  29044. };
  29045. });
  29046. let isShow = $state(true);
  29047. let isShowClose = $state(true);
  29048. const clickFun = () => {
  29049. if (rightIcon === 'close') {
  29050. isShow = false;
  29051. setTimeout(() => {
  29052. isShowClose = false;
  29053. }, 200);
  29054. }
  29055. onclickRight?.();
  29056. };
  29057. </script>
  29058. {#if isShowClose}
  29059. <div
  29060. class="bg-primary/10 text-primary dark:bg-dark/10 flex justify-between dark:text-dark{fontSizeClass[fontSize] ||
  29061. fontSizeClass['sm']} p-2{!rightIcon ? ' pr-2' : ' pr-0'} transition-all duration-300{isShow ? '' : ' scale-0'}{injClass === ''
  29062. ? ''
  29063. : ` ${injClass}`}"
  29064. >
  29065. <div class={!leftIcon ? '' : 'mr-1'}>
  29066. {#if leftChild}
  29067. {@render leftChild()}
  29068. {:else if !leftIcon}{:else}
  29069. <Icon name="ri-volume-down-line" size={20} top={-1} {...leftIcon} />
  29070. {/if}
  29071. </div>
  29072. {#if vertical}
  29073. <div class="grow" bind:this={outBoxDom}>
  29074. <div class="relative overflow-hidden" style="height:{outBoxHeight}px;">
  29075. {#each textListVertical as item, i}
  29076. <div
  29077. class="absolute truncate{isTransition ? ' transition-all' : ' transition-none'}{durationClass[duration] ||
  29078. durationClass['500']}"
  29079. style="top:{-(currentIndex - i) * outBoxHeight}px;width:{outBoxWidth}px"
  29080. >
  29081. {item}
  29082. </div>
  29083. {/each}
  29084. </div>
  29085. </div>
  29086. {:else}
  29087. <div class="relative grow overflow-hidden" bind:this={outBoxDom}>
  29088. <div class="absolute whitespace-nowrap" style="left:{left}px" bind:this={boxDom}>
  29089. {#each newTextList as item}
  29090. <div class="inline-block" style="margin-right:{space}px">{item}</div>
  29091. {/each}
  29092. </div>
  29093. </div>
  29094. {/if}
  29095. <button class={!rightIcon ? '' : 'pl-2 pr-4'} onclick={clickFun}>
  29096. {#if rightChild}
  29097. {@render rightChild()}
  29098. {:else if !rightIcon}{:else if rightIcon === 'close'}
  29099. <Icon name="ri-close-line" size={20} top={-1} />
  29100. {:else if rightIcon === 'arrow'}
  29101. <Icon name="ri-arrow-right-s-line" size={20} top={-1} />
  29102. {/if}
  29103. </button>
  29104. </div>
  29105. {/if}
  29106. ================================================
  29107. FILE: packages/stdf/src/lib/components/numKeyboard/NumKeyboard.svelte
  29108. ================================================
  29109. <script lang="ts">
  29110. import { getContext } from 'svelte';
  29111. import Popup from '../popup/Popup.svelte';
  29112. import Icon from '../icon/Icon.svelte';
  29113. import { zh_CN, type LangProps } from '../../lang/index.js';
  29114. import type { NumKeyboardProps } from '../../types/index.js';
  29115. // 当前语言
  29116. // current language
  29117. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  29118. const commonLang: LangProps['common'] = currentLang.common;
  29119. let {
  29120. type = 'button',
  29121. value = $bindable(''),
  29122. visible = $bindable(true),
  29123. height = '12',
  29124. space = '2',
  29125. p = '2',
  29126. reverse = false,
  29127. done = true,
  29128. dot = true,
  29129. close = false,
  29130. doneText = commonLang.done,
  29131. doneDisabled = $bindable(false),
  29132. radius = 'sm',
  29133. clear = false,
  29134. panelClass = '',
  29135. keyClass = '',
  29136. doneClass = '',
  29137. popup = {},
  29138. onclick,
  29139. onopen,
  29140. onclose
  29141. }: NumKeyboardProps = $props();
  29142. // 高度 class
  29143. // Height class
  29144. const heightClass = { '8': 'h-8', '10': 'h-10', '12': 'h-12', '14': 'h-14', '16': 'h-16', '20': 'h-20' };
  29145. // 根据高度动态数字大小
  29146. // Dynamic number size based on height
  29147. const fontSizeClass = { '8': 'text-sm', '10': 'text-base', '12': 'text-xl', '14': 'text-2xl', '16': 'text-2xl', '20': 'text-2xl' };
  29148. // 间距 class
  29149. // spacing class
  29150. const gapClass = { '0': 'gap-0', '1': 'gap-1', '2': 'gap-2', '3': 'gap-3', '4': 'gap-4' };
  29151. // 内边距 class
  29152. // padding class
  29153. const pClass = { '0': 'p-0', '1': 'p-1', '2': 'p-2', '3': 'p-3', '4': 'p-4' };
  29154. // 圆角 class
  29155. // radius class
  29156. const radiusClass = {
  29157. none: 'rounded-none',
  29158. sm: 'rounded-sm',
  29159. md: 'rounded-md',
  29160. lg: 'rounded-lg',
  29161. xl: 'rounded-xl',
  29162. '2xl': 'rounded-2xl',
  29163. '3xl': 'rounded-3xl',
  29164. full: 'rounded-full'
  29165. };
  29166. // 根据 p、gap、height 计算出键盘高度
  29167. // Calculate the keyboard height based on p, gap, height
  29168. const keyboardHeight = () => {
  29169. const pNum = parseInt(p);
  29170. const gapNum = type === 'button' ? parseInt(space) : 0;
  29171. const heightNum = parseInt(height);
  29172. return (pNum * 2 + gapNum * 3 + heightNum * 4) * 4 + (type === 'block' ? 4 : 0);
  29173. };
  29174. // 按钮式 class
  29175. // Button type class
  29176. const buttonClass = `flex flex-col justify-center items-center shadow-xs font-bold active:scale-95 transition-all duration-100 ${
  29177. heightClass[height] || 'h-12'
  29178. } ${fontSizeClass[height] || 'text-base'} ${radiusClass[radius] || 'rounded-sm'}${keyClass ? ' ' + keyClass : ''}`;
  29179. // 块式 class
  29180. // Block type class
  29181. const blockClass = `flex flex-col justify-center items-center font-bold active:opacity-40 transition-all duration-100 ${
  29182. heightClass[height] || 'h-12'
  29183. } ${fontSizeClass[height] || 'text-base'}${keyClass ? ' ' + keyClass : ''}`;
  29184. // 根据 type 类型,生成不同的基础样式
  29185. // Generate different basic styles based on type type
  29186. const baseClassFunc = (key: string | number) => {
  29187. if (type === 'button') {
  29188. return key === 'done' ? buttonClass : 'bg-white dark:bg-gray-700 ' + buttonClass;
  29189. } else {
  29190. return key === 'done' ? blockClass : 'bg-white dark:bg-gray-700 ' + blockClass;
  29191. }
  29192. };
  29193. // 处理 0 占据的格数
  29194. // Handle the number of grids occupied by 0
  29195. const zeroColFunc = () => {
  29196. // 不显示完成,右下角显示删除按钮,0 最多占 2 格
  29197. // If you don't show it, the delete button will be displayed in the lower right corner, and 0 will occupy up to 2 grids
  29198. if (!done) {
  29199. return dot || close ? 'col-span-1' : 'col-span-2';
  29200. } else {
  29201. return dot && close ? 'col-span-1' : dot || close ? 'col-span-2' : 'col-span-3';
  29202. }
  29203. };
  29204. // 点击按键事件
  29205. // Click the button event
  29206. const clickFunc = (key: string) => {
  29207. // 当 key 不是 close 或 done 时,拼接字符串,是删除时,删除最后一个字符
  29208. // When key is not close or done, splice the string, delete the last character when it is deleted
  29209. if (key !== 'close' && key !== 'done') {
  29210. if (key === 'delete') {
  29211. value = value.slice(0, value.length - 1);
  29212. } else {
  29213. value += key;
  29214. }
  29215. }
  29216. // close 和 done 事件都会关闭
  29217. // Both close and done events will be closed
  29218. if (key === 'close' || (key === 'done' && !doneDisabled)) {
  29219. visible = false;
  29220. }
  29221. // 派发事件,传递出两个参数,输入的数字字符串和本次点击的类型
  29222. // Dispatch events, pass out two parameters, the input number string and the type of this click
  29223. onclick?.(key);
  29224. };
  29225. // 激活与关闭键盘事件
  29226. // Activate and close the keyboard event
  29227. $effect(() => {
  29228. if (visible) {
  29229. if (clear) {
  29230. value = '';
  29231. }
  29232. onopen?.(keyboardHeight());
  29233. } else {
  29234. onclose?.();
  29235. }
  29236. });
  29237. </script>
  29238. <Popup bind:visible size={0} mask={{ opacity: '0' }} transitionDistance={keyboardHeight()} {...popup}>
  29239. <div
  29240. class="bg-gray-100 text-center dark:bg-gray-950 {type === 'block' ? 'border-t border-gray-100 dark:border-gray-950' : ''} {pClass[p] ||
  29241. 'p-2'}{panelClass ? ' ' + panelClass : ''}"
  29242. >
  29243. <div class="grid {type === 'button' ? gapClass[space] || 'gap-2' : 'gap-px'} {done ? 'grid-cols-4' : 'grid-cols-3'}">
  29244. {#each reverse ? ['7', '8', '9'] : ['1', '2', '3'] as item}
  29245. <button class={baseClassFunc(item)} onclick={() => clickFunc(item)}>{item} </button>
  29246. {/each}
  29247. {#if done}
  29248. <button class={baseClassFunc('delete')} onclick={() => clickFunc('delete')}>
  29249. <Icon name="ri-delete-back-2-line" size={Number(height) * 2} />
  29250. </button>
  29251. {/if}
  29252. {#each ['4', '5', '6'] as item}
  29253. <button class={baseClassFunc(item)} onclick={() => clickFunc(item)}>{item} </button>
  29254. {/each}
  29255. {#if done}
  29256. <button
  29257. class="{baseClassFunc('done')} bg-primary dark:bg-dark row-span-3 h-full text-white dark:text-black {doneDisabled
  29258. ? '!opacity-50 transition-none active:!scale-100'
  29259. : ''}{doneClass ? '' + doneClass : ''}"
  29260. onclick={() => clickFunc('done')}
  29261. >
  29262. {doneText}
  29263. </button>
  29264. {/if}
  29265. {#each reverse ? ['1', '2', '3'] : ['7', '8', '9'] as item}
  29266. <button class={baseClassFunc(item)} onclick={() => clickFunc(item)}>{item} </button>
  29267. {/each}
  29268. {#if dot}
  29269. <button class={baseClassFunc('.')} onclick={() => clickFunc('.')}>.</button>
  29270. {/if}
  29271. {#if done ? close : !dot && close}
  29272. <button class={baseClassFunc('close')} onclick={() => clickFunc('close')}>
  29273. <Icon name="ri-skip-down-line" size={Number(height) * 2} />
  29274. </button>
  29275. {/if}
  29276. <button class={baseClassFunc('0') + ' ' + zeroColFunc()} onclick={() => clickFunc('0')}>0</button>
  29277. {#if !done}
  29278. <button class={baseClassFunc('delete')} onclick={() => clickFunc('delete')}>
  29279. <Icon name="ri-delete-back-2-line" size={Number(height) * 2} />
  29280. </button>
  29281. {/if}
  29282. </div>
  29283. </div>
  29284. </Popup>
  29285. ================================================
  29286. FILE: packages/stdf/src/lib/components/pagination/Page.svelte
  29287. ================================================
  29288. <script lang="ts">
  29289. import type { Snippet } from 'svelte';
  29290. type Props = {
  29291. active?: boolean;
  29292. radius?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'none';
  29293. type?: 'border' | 'block' | 'bold';
  29294. children?: Snippet;
  29295. onclick?: () => void;
  29296. };
  29297. let { active = false, radius = 'md', type = 'border', children, onclick }: Props = $props();
  29298. const typeClass = {
  29299. border: 'border-primary dark:border-dark text-primary dark:text-dark',
  29300. block: 'bg-primary text-white dark:bg-dark dark:text-black',
  29301. bold: 'font-bold text-primary dark:text-dark border-transparent'
  29302. };
  29303. const radiusClass = {
  29304. sm: 'rounded-sm',
  29305. md: 'rounded-md',
  29306. lg: 'rounded-lg',
  29307. xl: 'rounded-xl',
  29308. full: 'rounded-full',
  29309. none: 'rounded-none'
  29310. };
  29311. </script>
  29312. <button
  29313. {onclick}
  29314. class="flex-1 border py-2 {active
  29315. ? typeClass[type] || typeClass.border
  29316. : 'border-transparent' + (type === 'bold' ? ' opacity-50' : '')} {radiusClass[radius] || radiusClass.md}"
  29317. >
  29318. {@render children?.()}
  29319. </button>
  29320. ================================================
  29321. FILE: packages/stdf/src/lib/components/pagination/Pagination.svelte
  29322. ================================================
  29323. <script lang="ts">
  29324. import { getContext } from 'svelte';
  29325. import Icon from '../icon/Icon.svelte';
  29326. import Page from './Page.svelte';
  29327. import SecondPageNext from './SecondPageNext.svelte';
  29328. import SecondPagePre from './SecondPagePre.svelte';
  29329. import { zh_CN, type LangProps } from '../../lang/index.js';
  29330. import type { PaginationProps } from '../../types/index.js';
  29331. // 当前语言
  29332. // current language
  29333. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  29334. const commonLang: LangProps['common'] = currentLang.common;
  29335. const paginationLang: LangProps['pagination'] = currentLang.pagination;
  29336. let {
  29337. total = 0,
  29338. pageSize = 10,
  29339. current = $bindable(1),
  29340. maxShowPage = 7,
  29341. radius = 'md',
  29342. type = 'bold',
  29343. pageCol = 3,
  29344. showNextOmitPage = $bindable(false),
  29345. showPreOmitPage = $bindable(false),
  29346. injClass = '',
  29347. noDataText = commonLang.noData,
  29348. onePageText = paginationLang.defaultOnlyOnePage,
  29349. continuous = false,
  29350. onchange,
  29351. onnext,
  29352. onpre
  29353. }: PaginationProps = $props();
  29354. // 总页数
  29355. // totalPage
  29356. let totalPage = $derived(Math.ceil(total / pageSize));
  29357. // 当前页码大于等于 maxShowPage-3 时,不显示前面的省略号
  29358. // current >= maxShowPage-3, not show pre ellipsis
  29359. let showPreEllipsis = $derived(current > maxShowPage - 2);
  29360. // 当前页码小于等于 totalPage - (maxShowPage-3) 时,不显示后面的省略号
  29361. // current <= totalPage - (maxShowPage-3), not show next ellipsis
  29362. let showNextEllipsis = $derived(current <= maxShowPage - 2 || current <= totalPage - (maxShowPage - 3));
  29363. // 当显示前面的省略号时,中间显示的页码数 middleShowPage 个数为 maxShowPage - 4,内容为当前页码(maxShowPage为5)或者当前页码和前后一项(maxShowPage为7)或者当前页码和前后两项(maxShowPage为9)
  29364. // when show pre ellipsis, middleShowPage length is maxShowPage - 4, content is current page (maxShowPage is 5) or current page and pre/next one (maxShowPage is 7) or current page and pre/next two (maxShowPage is 9)
  29365. let middleShowPage = $state<number[]>([]);
  29366. // 前省略号内页码数组
  29367. // pre ellipsis page array
  29368. let preEllipsisPages = $state<number[]>([]);
  29369. // 后省略号内页码数组
  29370. // next ellipsis page array
  29371. let nextEllipsisPages = $state<number[]>([]);
  29372. $effect(() => {
  29373. // 当页码变化时对一系列数据动态计算
  29374. // Dynamic calculation of a series of data when the page number changes
  29375. if (showPreEllipsis && showNextEllipsis) {
  29376. if (maxShowPage === 5) {
  29377. middleShowPage = [current];
  29378. } else if (maxShowPage === 7) {
  29379. middleShowPage = [current - 1, current, current + 1];
  29380. } else if (maxShowPage === 9) {
  29381. middleShowPage = [current - 2, current - 1, current, current + 1, current + 2];
  29382. } else if (maxShowPage === 11) {
  29383. middleShowPage = [current - 3, current - 2, current - 1, current, current + 1, current + 2, current + 3];
  29384. }
  29385. } else {
  29386. middleShowPage = [];
  29387. }
  29388. });
  29389. $effect(() => {
  29390. // 当仅显示后省略号时
  29391. // when only show next ellipsis
  29392. if (!showPreEllipsis && showNextEllipsis) {
  29393. // 此时 nextEllipsisPages 为 maxShowPage - 2 到 总页码数 - 1
  29394. // nextEllipsisPages is maxShowPage - 2 to total page - 1
  29395. nextEllipsisPages = Array.from({ length: totalPage }, (v, k) => k + 1).slice(maxShowPage - 2, totalPage - 1);
  29396. }
  29397. });
  29398. $effect(() => {
  29399. // 当仅显示前省略号时
  29400. // when only show pre ellipsis
  29401. if (showPreEllipsis && !showNextEllipsis) {
  29402. // 此时 preEllipsisPages 为 2 到 总页码数 - (maxShowPage-2)
  29403. // preEllipsisPages is 2 to total page - (maxShowPage-2)
  29404. preEllipsisPages = Array.from({ length: totalPage }, (v, k) => k + 1).slice(1, totalPage - (maxShowPage - 2));
  29405. }
  29406. });
  29407. $effect(() => {
  29408. // 当显示前后省略号时
  29409. // when show pre and next ellipsis
  29410. if (showPreEllipsis && showNextEllipsis) {
  29411. // 此时 nextEllipsisPages 为 middleShowPage 最后一项 +1,到总页码数组的最后第二项
  29412. // nextEllipsisPages is middleShowPage last item +1, to total page array last second item
  29413. nextEllipsisPages = Array.from({ length: totalPage }, (v, k) => k + 1).slice(
  29414. middleShowPage[middleShowPage.length - 1],
  29415. totalPage - 1
  29416. );
  29417. // 此时 preEllipsisPages 为 2 到 middleShowPage 第一项 -1
  29418. // preEllipsisPages is 2 to middleShowPage first item -1
  29419. preEllipsisPages = Array.from({ length: totalPage }, (v, k) => k + 1).slice(1, middleShowPage[0] - 1);
  29420. }
  29421. });
  29422. $effect(() => {
  29423. // 特殊情况处理
  29424. // Special case handling
  29425. if (totalPage <= maxShowPage) {
  29426. showNextOmitPage = false;
  29427. }
  29428. });
  29429. // 点击后省略号事件
  29430. // click next ellipsis event
  29431. const clickNextEllipsisFunc = () => {
  29432. if (nextEllipsisPages.length > 0) {
  29433. showNextOmitPage = !showNextOmitPage;
  29434. }
  29435. };
  29436. // 点击前省略号事件
  29437. // click pre ellipsis event
  29438. const clickPreEllipsisFunc = () => {
  29439. if (preEllipsisPages.length > 0) {
  29440. showPreOmitPage = !showPreOmitPage;
  29441. }
  29442. };
  29443. // 页码改变的回调,参数是改变后的页码及每页条数
  29444. // onChange
  29445. const onChangeFn = () => {
  29446. showNextOmitPage = false;
  29447. showPreOmitPage = false;
  29448. onchange?.(current);
  29449. };
  29450. // 点击下一页
  29451. // click next page
  29452. const nextFunc = () => {
  29453. if (current < totalPage) {
  29454. current++;
  29455. onnext?.(current);
  29456. onChangeFn();
  29457. }
  29458. };
  29459. // 点击上一页
  29460. // click pre page
  29461. const preFunc = () => {
  29462. if (current > 1) {
  29463. current--;
  29464. onpre?.(current);
  29465. onChangeFn();
  29466. }
  29467. };
  29468. // 点击页码
  29469. // click page
  29470. const clickItemFunc = (index: number) => {
  29471. current = index;
  29472. onChangeFn();
  29473. };
  29474. // 点击省略页码事件
  29475. // click second page item event
  29476. const clickSecondPageItemFunc = (index: number) => {
  29477. current = index;
  29478. showNextOmitPage = false;
  29479. showPreOmitPage = false;
  29480. onChangeFn();
  29481. };
  29482. // 类型样式
  29483. // type class
  29484. const typeClass = {
  29485. border: 'border-primary dark:border-dark text-primary dark:text-dark',
  29486. block: 'bg-primary text-white dark:bg-dark dark:text-black',
  29487. bold: 'font-bold text-primary dark:text-dark border-transparent'
  29488. };
  29489. // 圆角样式
  29490. // radius class
  29491. const radiusClass = {
  29492. sm: 'rounded-sm',
  29493. md: 'rounded-md',
  29494. lg: 'rounded-lg',
  29495. xl: 'rounded-xl',
  29496. full: 'rounded-full',
  29497. none: 'rounded-none'
  29498. };
  29499. </script>
  29500. <div class="relative flex justify-between bg-white py-1 text-center text-sm dark:bg-black {injClass}">
  29501. <button
  29502. class="flex-1 border border-transparent py-2 transition-all {current > 1
  29503. ? 'text-primary dark:text-dark'
  29504. : 'text-primary/30 dark:text-dark/30'} {radiusClass[radius] || radiusClass.md} active:scale-75"
  29505. onclick={preFunc}
  29506. >
  29507. <Icon name="ri-arrow-left-s-line" size={18} />
  29508. </button>
  29509. {#if totalPage === 0}
  29510. <div class="flex-1 border border-transparent py-2">{noDataText}</div>
  29511. {:else if totalPage === 1}
  29512. <div class="flex-1 border border-transparent py-2">{onePageText}</div>
  29513. {:else if totalPage > 1 && totalPage <= maxShowPage}
  29514. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  29515. {#each new Array(totalPage) as _, index}
  29516. <Page active={current === index + 1} {type} {radius} onclick={() => !continuous && clickItemFunc(index + 1)}>
  29517. {index + 1}
  29518. </Page>
  29519. {/each}
  29520. {:else}
  29521. <Page active={current === 1} {type} {radius} onclick={() => !continuous && clickItemFunc(1)}>1</Page>
  29522. {#if showPreEllipsis}
  29523. <button
  29524. class="flex-1 border py-2 {showPreOmitPage
  29525. ? typeClass[type] || typeClass.border
  29526. : 'border-transparent' + (type === 'bold' ? ' opacity-50' : '')} {radiusClass[radius] || radiusClass.md}"
  29527. onclick={() => !continuous && clickPreEllipsisFunc()}
  29528. >
  29529. {#if type === 'bold' && showPreOmitPage}
  29530. <Icon name="ri-more-fill" size={18} />
  29531. {:else}
  29532. <Icon name="ri-more-line" size={18} />
  29533. {/if}
  29534. </button>
  29535. {/if}
  29536. {#if !showPreEllipsis && current <= maxShowPage - 1}
  29537. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  29538. {#each new Array(maxShowPage - 3) as _, index}
  29539. <Page active={current === index + 2} {type} {radius} onclick={() => !continuous && clickItemFunc(index + 2)}>
  29540. {index + 2}
  29541. </Page>
  29542. {/each}
  29543. {/if}
  29544. {#if middleShowPage.length > 0}
  29545. {#each middleShowPage as item, index}
  29546. <Page active={index === (middleShowPage.length - 1) / 2} {type} {radius} onclick={() => !continuous && clickItemFunc(item)}>
  29547. {item}
  29548. </Page>
  29549. {/each}
  29550. {/if}
  29551. {#if !showNextEllipsis && current > totalPage - (maxShowPage - 3)}
  29552. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  29553. {#each new Array(maxShowPage - 3) as _, index}
  29554. <Page
  29555. active={current === totalPage + index + 3 - maxShowPage}
  29556. {type}
  29557. {radius}
  29558. onclick={() => !continuous && clickItemFunc(totalPage + index + 3 - maxShowPage)}
  29559. >
  29560. {totalPage + index + 3 - maxShowPage}
  29561. </Page>
  29562. {/each}
  29563. {/if}
  29564. {#if showNextEllipsis}
  29565. <button
  29566. class="flex-1 border py-2 {showNextOmitPage
  29567. ? typeClass[type] || typeClass.border
  29568. : 'border-transparent' + (type === 'bold' ? ' opacity-50' : '')} {radiusClass[radius] || radiusClass.md}"
  29569. onclick={() => !continuous && clickNextEllipsisFunc()}
  29570. >
  29571. {#if type === 'bold' && showNextOmitPage}
  29572. <Icon name="ri-more-fill" size={18} />
  29573. {:else}
  29574. <Icon name="ri-more-line" size={18} />
  29575. {/if}
  29576. </button>
  29577. {/if}
  29578. <Page active={current === totalPage} {type} {radius} onclick={() => !continuous && clickItemFunc(totalPage)}>{totalPage}</Page>
  29579. {/if}
  29580. <button
  29581. class="flex-1 border border-transparent py-2 transition-all {current < totalPage
  29582. ? 'text-primary dark:text-dark'
  29583. : 'text-primary/30 dark:text-dark/30'} {radiusClass[radius] || radiusClass.md} active:scale-75"
  29584. onclick={nextFunc}
  29585. >
  29586. <Icon name="ri-arrow-right-s-line" size={20} />
  29587. </button>
  29588. {#if showNextOmitPage}
  29589. <SecondPageNext {pageCol} Pages={nextEllipsisPages} {type} {radius} onclickItem={clickSecondPageItemFunc} {maxShowPage} />
  29590. {/if}
  29591. {#if showPreOmitPage}
  29592. <SecondPagePre {pageCol} Pages={preEllipsisPages} {type} {radius} onclickItem={clickSecondPageItemFunc} {maxShowPage} />
  29593. {/if}
  29594. </div>
  29595. ================================================
  29596. FILE: packages/stdf/src/lib/components/pagination/SecondPageNext.svelte
  29597. ================================================
  29598. <script lang="ts">
  29599. import Page from './Page.svelte';
  29600. type Props = {
  29601. pageCol: number;
  29602. Pages: number[];
  29603. maxShowPage: number;
  29604. radius: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'none';
  29605. type: 'border' | 'block' | 'bold';
  29606. onclickItem: (index: number) => void;
  29607. };
  29608. let { pageCol = 3, Pages = [], maxShowPage = 9, radius = 'md', type = 'bold', onclickItem }: Props = $props();
  29609. </script>
  29610. {#if Pages.length > 0}
  29611. <div
  29612. class="second-page-contents absolute -top-3 grid max-h-[7.25rem] -translate-y-full translate-x-1/2 gap-y-2 divide-x overflow-y-auto rounded-lg bg-white p-1 shadow-sm dark:bg-black dark:shadow-white/10"
  29613. style="width: calc({(pageCol / (maxShowPage + 2)) * 100}% + 8px);right:{(2.5 / (maxShowPage + 2)) *
  29614. 100}%;grid-template-columns: repeat({pageCol}, minmax(0, 1fr));"
  29615. >
  29616. {#each Pages as item}
  29617. <Page onclick={() => onclickItem && onclickItem(item)} {type} {radius}>{item}</Page>
  29618. {/each}
  29619. </div>
  29620. <div
  29621. class="absolute -top-3 h-0 w-0 translate-x-1/2 border-8 border-t-8 border-transparent border-t-white dark:border-t-black"
  29622. style="right:{(2.5 / (maxShowPage + 2)) * 100}%;"
  29623. ></div>
  29624. {/if}
  29625. <style>
  29626. .second-page-contents::-webkit-scrollbar {
  29627. display: none; /* Chrome Safari */
  29628. }
  29629. </style>
  29630. ================================================
  29631. FILE: packages/stdf/src/lib/components/pagination/SecondPagePre.svelte
  29632. ================================================
  29633. <script lang="ts">
  29634. import Page from './Page.svelte';
  29635. type Props = {
  29636. pageCol: number;
  29637. Pages: number[];
  29638. maxShowPage: number;
  29639. radius: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'none';
  29640. type: 'border' | 'block' | 'bold';
  29641. onclickItem: (index: number) => void;
  29642. };
  29643. let { pageCol = 3, Pages = [], maxShowPage = 7, radius = 'md', type = 'bold', onclickItem }: Props = $props();
  29644. </script>
  29645. {#if Pages.length > 0}
  29646. <div
  29647. class="second-page-contents absolute -top-3 grid max-h-[7.25rem] -translate-x-1/2 -translate-y-full gap-y-2 overflow-y-auto rounded-lg bg-white p-1 shadow-sm dark:bg-black dark:shadow-white/10"
  29648. style="width: calc({(pageCol / (maxShowPage + 2)) * 100}% + 8px);left:{(2.5 / (maxShowPage + 2)) *
  29649. 100}%;grid-template-columns: repeat({pageCol}, minmax(0, 1fr));"
  29650. >
  29651. {#each Pages as item}
  29652. <Page onclick={() => onclickItem && onclickItem(item)} {type} {radius}>{item}</Page>
  29653. {/each}
  29654. </div>
  29655. <div
  29656. class="absolute -top-3 h-0 w-0 -translate-x-1/2 border-8 border-t-8 border-transparent border-t-white dark:border-t-black"
  29657. style="left:{(2.5 / (maxShowPage + 2)) * 100}%;"
  29658. ></div>
  29659. {/if}
  29660. <style>
  29661. .second-page-contents::-webkit-scrollbar {
  29662. display: none; /* Chrome Safari */
  29663. }
  29664. </style>
  29665. ================================================
  29666. FILE: packages/stdf/src/lib/components/picker/Picker.svelte
  29667. ================================================
  29668. <script lang="ts">
  29669. import { getContext } from 'svelte';
  29670. import Popup from '../popup/Popup.svelte';
  29671. import ScrollRadio from '../scrollRadio/ScrollRadio.svelte';
  29672. import { zh_CN, type LangProps } from '../../lang/index.js';
  29673. import type { PickerProps, PickerDatasProps, PickerDataChildProps } from '../../types/index.js';
  29674. // 当前语言
  29675. // current language
  29676. const currentLang: LangProps = getContext('STDF_lang') || zh_CN;
  29677. const pickerLang: LangProps['picker'] = currentLang.picker;
  29678. let {
  29679. visible = $bindable(false),
  29680. datas = [],
  29681. autoScrollToLast = true,
  29682. cancelText = pickerLang.defaultCancel,
  29683. confirmText = pickerLang.defaultConfirm,
  29684. title = pickerLang.defaultTitle,
  29685. isLinkage = false,
  29686. linkageInitIndexs = [],
  29687. linkageShowRows = [],
  29688. linkageFlexs = [],
  29689. linkageLabelKeys = [],
  29690. linkageAligns = [],
  29691. linkageChildrenKey = 'children',
  29692. popup = {},
  29693. onclose,
  29694. onconfirm,
  29695. oncancel
  29696. }: PickerProps = $props();
  29697. // 内部使用的 datas
  29698. // Datas used internally
  29699. let newDatas: PickerDatasProps[] | PickerDataChildProps[] = $state(datas);
  29700. // $effect(() => {
  29701. // newDatas = datas;
  29702. // });
  29703. // 如果是多级联动,对 newDatas 进行处理,使其结构符合 ScrollRadio 组件的结构
  29704. // If it is multi-level linkage, process newDatas to make its structure conform to the structure of the ScrollRadio component
  29705. if (isLinkage) {
  29706. const newLinkageData: PickerDatasProps[] = [];
  29707. // 多级联动时递归处理 newDatas,取原始数据每一级的第一条数据,组成新的数据结构
  29708. // When multi-level linkage, recursively process newDatas to take the first piece of data in each level of the original data to form a new data structure
  29709. const newDatasFormatFunc = (data: PickerDatasProps[] | PickerDataChildProps[], index: number) => {
  29710. if (data && data.length > 0) {
  29711. const newData = data.map((item: PickerDatasProps | PickerDataChildProps) => {
  29712. const label = linkageLabelKeys[index]
  29713. ? (item as Record<string, string>)[linkageLabelKeys[index]]
  29714. : (item as { label: string }).label;
  29715. return { label };
  29716. });
  29717. newLinkageData.push({ data: newData, showRow: 5, labelKey: 'label' });
  29718. if (data[0] && typeof data[0] === 'object' && linkageChildrenKey in data[0]) {
  29719. const children = (data[0] as { [key: string]: PickerDataChildProps[] })[linkageChildrenKey];
  29720. newDatasFormatFunc(children, index + 1);
  29721. }
  29722. }
  29723. };
  29724. if (datas.length > 0) {
  29725. newDatasFormatFunc(datas, 0);
  29726. newDatas = newLinkageData;
  29727. }
  29728. }
  29729. let scrollEndIndexs: number[] = [];
  29730. let lastSelectedIndexs: number[] = $state([]);
  29731. let showRowsArr: number[] = [];
  29732. const initFn = () => {
  29733. // 对 datas 处理,如果没有设置 initIndex 则默认为 0,如果没有设置 showRow 则默认为 5
  29734. // Process datas, if initIndex is not set, it is default to 0, if showRow is not set, it is default to 5
  29735. newDatas = newDatas.map((item, index) => {
  29736. if (!item.initIndex) {
  29737. (item as PickerDatasProps).initIndex = 0;
  29738. }
  29739. if (!item.showRow) {
  29740. item.showRow = 5;
  29741. }
  29742. if (!(item as PickerDatasProps).lastSelectedIndex) {
  29743. (item as PickerDatasProps).lastSelectedIndex = 0;
  29744. }
  29745. if (!item.flex) {
  29746. item.flex = 1;
  29747. }
  29748. if (!item.align) {
  29749. item.align = 'center';
  29750. }
  29751. if (isLinkage) {
  29752. if (linkageInitIndexs[index]) {
  29753. item.initIndex = linkageInitIndexs[index];
  29754. } else {
  29755. item.initIndex = 0;
  29756. }
  29757. if (linkageShowRows[index]) {
  29758. (item as PickerDatasProps).showRow = linkageShowRows[index] as 3 | 5 | 7;
  29759. }
  29760. if (linkageFlexs[index]) {
  29761. item.flex = linkageFlexs[index];
  29762. }
  29763. if (linkageAligns[index]) {
  29764. item.align = linkageAligns[index];
  29765. }
  29766. if (!item.lastSelectedIndex) {
  29767. item.lastSelectedIndex = 0;
  29768. }
  29769. }
  29770. return item;
  29771. }) as PickerDatasProps[];
  29772. // 滚动结束时选中项组成的数组
  29773. // An array of selected items when scrolling ends
  29774. scrollEndIndexs = newDatas.map((item: PickerDatasProps | PickerDataChildProps) => item.initIndex as number);
  29775. // 上次所有选中项,由上次单列选中项组成的数组,初始值为 datas 中每项的 initIndex
  29776. // All last selected items, an array of last single column selected items, the initial value is the initIndex of each item in datas
  29777. lastSelectedIndexs = newDatas.map((item) => item.initIndex as number);
  29778. // 循环 newDatas,将 每项的 showRow 组成一个数组 showRowsArr
  29779. // Loop newDatas to form an array showRowsArr of each item's showRow
  29780. showRowsArr = newDatas.map((item) => item.showRow as number);
  29781. };
  29782. initFn();
  29783. // 找出 showRowsArr 中最大值
  29784. // Find the maximum value in showRowsArr
  29785. const maxShowRows = showRowsArr.length > 0 ? Math.max(...showRowsArr.filter((n): n is number => typeof n === 'number')) : 5;
  29786. // 多级联动时,根据当前选中项的索引,需要知道滚动的上级、当前级、下级以及所有级的数据
  29787. // When multi-level linkage, according to the index of the currently selected item, you need to know the data of the scrolling upper level, current level, next level and all levels
  29788. let preLevelData: PickerDataChildProps[] | PickerDatasProps[] = [];
  29789. let currentLevelData: PickerDataChildProps[] | PickerDatasProps[] = [];
  29790. // let nextLevelData = [];
  29791. let allLevelData: (PickerDataChildProps[] | PickerDatasProps[])[] = [];
  29792. // 根据原始数据 datas 的层级,allLevelData 的长度为 datas 的层级,递归处理 datas 中每一级直至没有 children,将每一级的第一项取出,放到 allLevelData 中
  29793. // According to the level of the original data datas, the length of allLevelData is the level of datas, and the data in each level of datas is processed recursively until there is no children, and the first item of each level is taken out and placed in allLevelData
  29794. const getAllLevelDataFunc = (data: PickerDatasProps[] | PickerDataChildProps[], level: number) => {
  29795. if (data && data.length > 0) {
  29796. if (!allLevelData[level]) {
  29797. allLevelData[level] = [];
  29798. }
  29799. // 使用类型断言确保类型安全
  29800. const firstItem = data[0] as PickerDatasProps & PickerDataChildProps;
  29801. allLevelData[level].push(firstItem);
  29802. if (linkageChildrenKey in firstItem && firstItem[linkageChildrenKey]) {
  29803. getAllLevelDataFunc(firstItem[linkageChildrenKey] as PickerDataChildProps[], level + 1);
  29804. }
  29805. }
  29806. };
  29807. if (isLinkage) {
  29808. getAllLevelDataFunc(datas, 0);
  29809. }
  29810. // 点击取消按钮
  29811. // Click cancel button
  29812. const clickCancelFunc = () => {
  29813. visible = false;
  29814. oncancel?.();
  29815. onclose?.();
  29816. };
  29817. // 点击确定按钮
  29818. // Click confirm button
  29819. const clickConfirmFunc = () => {
  29820. visible = false;
  29821. onclose?.();
  29822. lastSelectedIndexs = scrollEndIndexs;
  29823. let items: { [key: string]: string }[] = [];
  29824. if (isLinkage) {
  29825. // 获取 lastSelectedIndexs 的长度为 n,取 allLevelData 前面的 n 项,作为暂时数组 tempItems
  29826. // Get the length of lastSelectedIndexs as n, take the first n items of allLevelData as the temporary array tempItems
  29827. const tempItems = allLevelData.slice(0, lastSelectedIndexs.length);
  29828. // 将 tempItems 中的每一项按照 lastSelectedIndexs 的索引取出,组成一个新数组 items
  29829. // Take each item in tempItems out according to the index of lastSelectedIndexs to form a new array items
  29830. items = tempItems.map((item: PickerDatasProps[] | PickerDataChildProps[], index: number) => {
  29831. const selectedIndex = lastSelectedIndexs[index];
  29832. if (Array.isArray(item)) {
  29833. return item[selectedIndex] as { [key: string]: string };
  29834. }
  29835. return item;
  29836. });
  29837. } else {
  29838. // 循环 datas 与 scrollEndIndexs,按照 scrollEndIndexs 将 datas 中的 data 对应的��组成一个新数组
  29839. // Loop datas and scrollEndIndexs to form a new array of values corresponding to data in datas according to scrollEndIndexs
  29840. items = datas.map((item: PickerDatasProps | PickerDataChildProps, index: number) => {
  29841. const data = (item as PickerDatasProps).data;
  29842. if (Array.isArray(data)) {
  29843. return data[scrollEndIndexs[index]] as { [key: string]: string };
  29844. }
  29845. return data as { [key: string]: string };
  29846. }) as { [key: string]: string }[];
  29847. }
  29848. onconfirm?.(items, lastSelectedIndexs);
  29849. };
  29850. // 滚动结束
  29851. // Scroll end
  29852. const scrollEndFunc = (i: number, col: number) => {
  29853. // col 为当前滚动结束的列的索引
  29854. // index 为当前滚动结束的列的选中项的索引
  29855. const index = i;
  29856. scrollEndIndexs[col] = index;
  29857. if (isLinkage) {
  29858. // 任何列滚动之后,使传入的 linkageInitIndexs 都会失效,将所有下级的初始选中项设置为 0
  29859. // After any column scrolls, the linkageInitIndexs passed in will all be invalid, and set the initial selected item of all lower levels to 0
  29860. for (let i = col + 1; i < newDatas.length; i++) {
  29861. newDatas[i].initIndex = 0;
  29862. }
  29863. // 递归计算当前列的数据
  29864. // Recursively calculate the data of the current column
  29865. if (col === 0) {
  29866. preLevelData = [];
  29867. currentLevelData = datas as PickerDatasProps[];
  29868. allLevelData[0] = datas as PickerDatasProps[];
  29869. } else {
  29870. preLevelData = allLevelData[col - 1] as PickerDatasProps[];
  29871. if (preLevelData[scrollEndIndexs[col - 1]]) {
  29872. const children = preLevelData[scrollEndIndexs[col - 1]][linkageChildrenKey as keyof PickerDatasProps] as PickerDataChildProps[];
  29873. currentLevelData = Array.isArray(children) ? (children as PickerDataChildProps[]) : [];
  29874. } else {
  29875. currentLevelData = [];
  29876. }
  29877. }
  29878. // 递归计算后面的所有列数据
  29879. // Tail recursion to calculate the data of all columns behind
  29880. const recursionFunc = (col: number, currentLevelData: PickerDataChildProps[] | PickerDatasProps[]) => {
  29881. const nextCol = col + 1;
  29882. if (nextCol < newDatas.length) {
  29883. const nextLevelData =
  29884. currentLevelData.length === 1
  29885. ? currentLevelData[0]
  29886. ? (currentLevelData[0] as PickerDatasProps)[linkageChildrenKey as keyof PickerDatasProps]
  29887. : []
  29888. : currentLevelData[index]
  29889. ? ((currentLevelData[index] as PickerDatasProps)[linkageChildrenKey as keyof PickerDatasProps] as PickerDataChildProps[])
  29890. : [];
  29891. if (nextLevelData && Array.isArray(nextLevelData) && nextLevelData.length > 0) {
  29892. const nextData = (nextLevelData as PickerDataChildProps[]).map((item: PickerDataChildProps) =>
  29893. linkageLabelKeys[col + 1] ? { label: item[linkageLabelKeys[col + 1]] } : { label: item.label }
  29894. );
  29895. // 将数据置空,此列数据为空,此列将立即消失,然后通过 setTimeout 立即设置数据,使得数据更新后,此列才会出现
  29896. // Set the data to empty, the data of this column is empty, this column will disappear immediately, and then set the data immediately through setTimeout, so that the data is updated, this column will appear
  29897. newDatas[nextCol].data = [];
  29898. setTimeout(() => {
  29899. newDatas[nextCol].data = nextData;
  29900. });
  29901. allLevelData[nextCol] = nextLevelData;
  29902. recursionFunc(nextCol, nextLevelData);
  29903. } else {
  29904. // 如果下一级没数据,则将下一级的数据置空
  29905. // If there is no data in the next level, set the data of the next level to empty
  29906. // 也可以用来解决数据层级超级大的时候,递归计算数据的性能问题,暂时将后面的数据置空,等到有数据的时候再设置,避免选择数据与视图不同步的问题
  29907. // It can also be used to solve the performance problem of recursive calculation of data when the data hierarchy is super large. Temporarily set the data behind to empty, and set it when there is data, to avoid the problem that the selected data and the view are not synchronized
  29908. newDatas[nextCol].data = [];
  29909. }
  29910. }
  29911. };
  29912. recursionFunc(col, currentLevelData);
  29913. }
  29914. };
  29915. </script>
  29916. <Popup
  29917. bind:visible
  29918. size={0}
  29919. maskClosable
  29920. transitionDistance={(maxShowRows === 3 ? 64 : maxShowRows === 5 ? 48 : 32) * maxShowRows + 41}
  29921. {...popup}
  29922. >
  29923. <div class="flex items-center justify-between border-b border-black/10 bg-white dark:border-white/20 dark:bg-black">
  29924. <button class="h-10 cursor-pointer px-4 leading-10 text-black/60 dark:text-white/60" onclick={clickCancelFunc}>{cancelText}</button>
  29925. <div>{title}</div>
  29926. <button class="h-10 cursor-pointer px-4 leading-10 text-primary dark:text-dark" onclick={clickConfirmFunc}>{confirmText}</button>
  29927. </div>
  29928. <div class="flex items-center justify-around gap-1 bg-white dark:bg-black">
  29929. {#each newDatas as item, col}
  29930. <div class="truncate" style="flex:{item.flex || 1}">
  29931. {#if (item as PickerDatasProps).data.length > 0}
  29932. <ScrollRadio
  29933. {...item}
  29934. lastSelectedIndex={lastSelectedIndexs[col]}
  29935. {autoScrollToLast}
  29936. onscrollEnd={(index) => scrollEndFunc(index, col)}
  29937. />
  29938. {/if}
  29939. </div>
  29940. {/each}
  29941. </div>
  29942. </Popup>
  29943. ================================================
  29944. FILE: packages/stdf/src/lib/components/placeholder/Placeholder.svelte
  29945. ================================================
  29946. <script lang="ts">
  29947. import type { PlaceholderProps } from '../../types/index.js';
  29948. let { py = '4', height = 'full', radius = 'md', shadow = 'none', injClass = '', children }: PlaceholderProps = $props();
  29949. // 上下内边距样式
  29950. // up down padding style
  29951. const pyObj = { '0': ' py-0', '1': ' py-1', '2': ' py-2', '3': ' py-3', '4': ' py-4', '8': ' py-8' };
  29952. // 阴影样式
  29953. // shadow style
  29954. const shadowObj = {
  29955. none: ' shadow-none',
  29956. xs: ' shadow-xs dark:shadow-white/5',
  29957. sm: 'shadow-sm dark:shadow-white/10',
  29958. md: ' shadow-md dark:shadow-white/10',
  29959. lg: ' shadow-lg dark:shadow-white/10',
  29960. xl: ' shadow-xl dark:shadow-white/10',
  29961. '2xl': ' shadow-2xl dark:shadow-white/20'
  29962. };
  29963. // 圆角样式
  29964. // radius style
  29965. const radiusObj = {
  29966. none: ' rounded-none',
  29967. sm: ' rounded-sm',
  29968. md: ' rounded-md',
  29969. xl: ' rounded-xl',
  29970. '2xl': ' rounded-2xl',
  29971. '3xl': ' rounded-3xl',
  29972. full: ' rounded-full'
  29973. };
  29974. // 高度样式
  29975. // height style
  29976. const heightObj = {
  29977. full: ' h-full',
  29978. '1': ' h-1',
  29979. '2': ' h-2',
  29980. '4': ' h-4',
  29981. '8': ' h-8',
  29982. '16': ' h-16',
  29983. '24': ' h-24',
  29984. '32': ' h-32',
  29985. '48': ' h-48',
  29986. '64': ' h-64',
  29987. '96': ' h-96'
  29988. };
  29989. </script>
  29990. <div
  29991. class="flex flex-col justify-center bg-black/5 dark:bg-white/5 text-center{heightObj[height] || heightObj.full}{pyObj[py] ||
  29992. pyObj['4']}{radiusObj[radius] || radiusObj.md}{shadowObj[shadow] || shadowObj.none}{injClass === '' ? '' : ` ${injClass}`}"
  29993. >
  29994. {@render children?.()}
  29995. </div>
  29996. ================================================
  29997. FILE: packages/stdf/src/lib/components/popup/Popup.svelte
  29998. ================================================
  29999. <script lang="ts">
  30000. import * as eases from 'svelte/easing';
  30001. import Mask from '../mask/Mask.svelte';
  30002. import Transition from './Transition.svelte';
  30003. import type { PopupProps } from '../../types/index.js';
  30004. let {
  30005. visible = $bindable(false),
  30006. size = 40,
  30007. position = 'bottom',
  30008. duration = 450,
  30009. outDuration = 240,
  30010. easeType = 'cubicOut',
  30011. easeOutType = 'cubicOut',
  30012. px = '0',
  30013. py = '0',
  30014. mask = {},
  30015. maskClosable = true,
  30016. radiusPosition = 'top',
  30017. radius = 'none',
  30018. transitionDistance = 0,
  30019. transparent = false,
  30020. allowBodyScroll = false,
  30021. zIndex = 600,
  30022. dynamicFixed = true,
  30023. hideScrollbar = false,
  30024. children,
  30025. onclose,
  30026. onclickMask
  30027. }: PopupProps = $props();
  30028. // 通过不同位置结合圆角参数,生成不同的 class
  30029. // Generate different classes by combining different positions and corner parameters
  30030. const radiusFun = () => {
  30031. const radioMap = {
  30032. none: 'rounded-none',
  30033. sm: 'rounded-sm',
  30034. md: 'rounded-md',
  30035. lg: 'rounded-lg',
  30036. xl: 'rounded-xl',
  30037. '2xl': 'rounded-2xl',
  30038. '3xl': 'rounded-3xl',
  30039. full: 'rounded-full'
  30040. };
  30041. const radiusTopMap = {
  30042. none: 'rounded-t-none',
  30043. sm: 'rounded-t-sm',
  30044. md: 'rounded-t-md',
  30045. lg: 'rounded-t-lg',
  30046. xl: 'rounded-t-xl',
  30047. '2xl': 'rounded-t-2xl',
  30048. '3xl': 'rounded-t-3xl',
  30049. full: 'rounded-t-full'
  30050. };
  30051. const radiusBottomMap = {
  30052. none: 'rounded-b-none',
  30053. sm: 'rounded-b-sm',
  30054. md: 'rounded-b-md',
  30055. lg: 'rounded-b-lg',
  30056. xl: 'rounded-b-xl',
  30057. '2xl': 'rounded-b-2xl',
  30058. '3xl': 'rounded-b-3xl',
  30059. full: 'rounded-b-full'
  30060. };
  30061. const radiusLeftMap = {
  30062. none: 'rounded-l-none',
  30063. sm: 'rounded-l-sm',
  30064. md: 'rounded-l-md',
  30065. lg: 'rounded-l-lg',
  30066. xl: 'rounded-l-xl',
  30067. '2xl': 'rounded-l-2xl',
  30068. '3xl': 'rounded-l-3xl',
  30069. full: 'rounded-l-full'
  30070. };
  30071. const radiusRightMap = {
  30072. none: 'rounded-r-none',
  30073. sm: 'rounded-r-sm',
  30074. md: 'rounded-r-md',
  30075. lg: 'rounded-r-lg',
  30076. xl: 'rounded-r-xl',
  30077. '2xl': 'rounded-r-2xl',
  30078. '3xl': 'rounded-r-3xl',
  30079. full: 'rounded-r-full'
  30080. };
  30081. if (radiusPosition === 'all') {
  30082. return radioMap[radius];
  30083. } else if (radiusPosition === 'top') {
  30084. return radiusTopMap[radius];
  30085. } else if (radiusPosition === 'bottom') {
  30086. return radiusBottomMap[radius];
  30087. } else if (radiusPosition === 'left') {
  30088. return radiusLeftMap[radius];
  30089. } else if (radiusPosition === 'right') {
  30090. return radiusRightMap[radius];
  30091. } else {
  30092. return '';
  30093. }
  30094. };
  30095. // 通过不同位置,生成不同的布局 class
  30096. // Generate different layout classes by different positions
  30097. const positionClass = {
  30098. bottom: ' flex-col justify-end',
  30099. top: ' flex-col justify-start',
  30100. left: ' justify-start',
  30101. right: ' justify-end',
  30102. center: ' flex-col justify-center'
  30103. };
  30104. // 点击遮罩时派发事件
  30105. // Dispatch events when clicking the mask
  30106. const clickMask = () => {
  30107. onclickMask?.();
  30108. if (maskClosable) {
  30109. visible = false;
  30110. onclose?.();
  30111. }
  30112. };
  30113. // 根据不同位置,生成不同的出现动画参数
  30114. // Generate different transition parameters by different positions
  30115. const transitionParamsFun = () => {
  30116. if (position === 'bottom') {
  30117. return {
  30118. y: size === 0 ? transitionDistance : (window.innerHeight * size) / 100,
  30119. duration,
  30120. easing: eases[easeType],
  30121. opacity: 1
  30122. };
  30123. } else if (position === 'top') {
  30124. return {
  30125. y: -(size === 0 ? transitionDistance : (window.innerHeight * size) / 100),
  30126. duration,
  30127. easing: eases[easeType],
  30128. opacity: 1
  30129. };
  30130. } else if (position === 'left') {
  30131. return {
  30132. x: -(size === 0 ? transitionDistance : (window.innerWidth * size) / 100),
  30133. duration,
  30134. easing: eases[easeType],
  30135. opacity: 1
  30136. };
  30137. } else if (position === 'right') {
  30138. return { x: size === 0 ? transitionDistance : (window.innerWidth * size) / 100, duration, easing: eases[easeType], opacity: 1 };
  30139. } else {
  30140. return { easing: eases[easeType], duration, opacity: 1 };
  30141. }
  30142. };
  30143. // 根据不同位置,生成不同的消失动画参数
  30144. // Generate different transition parameters by different positions
  30145. const transitionOutParamsFun = () => {
  30146. if (position === 'bottom') {
  30147. return {
  30148. y: size === 0 ? transitionDistance : (window.innerHeight * size) / 100,
  30149. duration: outDuration,
  30150. easing: eases[easeOutType],
  30151. opacity: 1
  30152. };
  30153. } else if (position === 'top') {
  30154. return {
  30155. y: -(size === 0 ? transitionDistance : (window.innerHeight * size) / 100),
  30156. duration: outDuration,
  30157. easing: eases[easeOutType],
  30158. opacity: 1
  30159. };
  30160. } else if (position === 'left') {
  30161. return {
  30162. x: -(size === 0 ? transitionDistance : (window.innerWidth * size) / 100),
  30163. duration: outDuration,
  30164. easing: eases[easeOutType],
  30165. opacity: 1
  30166. };
  30167. } else if (position === 'right') {
  30168. return {
  30169. x: size === 0 ? transitionDistance : (window.innerWidth * size) / 100,
  30170. duration: outDuration,
  30171. easing: eases[easeOutType],
  30172. opacity: 1
  30173. };
  30174. } else {
  30175. return { duration: outDuration, easing: eases[easeOutType], opacity: 1 };
  30176. }
  30177. };
  30178. // 监听 visible 与是否允许 body 滚动,动态控制 body 滚动
  30179. // Listen to the change of visible and allowBodyScroll, and dynamically control the body scroll
  30180. $effect(() => {
  30181. if (visible && !allowBodyScroll) {
  30182. const top = document.documentElement.scrollTop || document.body.scrollTop;
  30183. document.body.style.cssText += `
  30184. position: fixed;
  30185. width: 100vw;
  30186. left: 0;
  30187. top: ${-top}px;
  30188. touch-action:none;
  30189. `;
  30190. } else {
  30191. const top = document.body.style.top;
  30192. document.body.style.cssText += `
  30193. position: static;
  30194. touch-action:auto;
  30195. `;
  30196. window.scrollTo(0, Math.abs(parseFloat(top)));
  30197. }
  30198. });
  30199. // 页面滚动时,动态计算窗口高度
  30200. // Dynamically calculate the window height when the page scrolls
  30201. let innerHeight = $state(0);
  30202. $effect(() => {
  30203. innerHeight = window.innerHeight;
  30204. });
  30205. if (dynamicFixed) {
  30206. //解决 Safari 和 Chrome 或其他浏览器滚动时工具栏隐藏与显示引发的窗口高度变化问题
  30207. //Solve the problem of window height change caused by Safari and Chrome or other browsers hiding and showing the toolbar when scrolling
  30208. window.addEventListener('resize', () => {
  30209. innerHeight = window.innerHeight;
  30210. });
  30211. }
  30212. </script>
  30213. {#if visible}
  30214. <Mask visible {duration} {outDuration} {...mask} onclickMask={clickMask} />
  30215. {/if}
  30216. {#if visible}
  30217. <div
  30218. class="fixed inset-0 h-screen w-screen flex{positionClass[position] || positionClass['bottom']} pointer-events-none px-0"
  30219. style="z-index:{zIndex};height:{innerHeight}px"
  30220. >
  30221. <Transition
  30222. {visible}
  30223. {size}
  30224. {position}
  30225. {px}
  30226. {py}
  30227. transitionParams={transitionParamsFun()}
  30228. transitionOutParams={transitionOutParamsFun()}
  30229. >
  30230. <div
  30231. class="w-full h-full{transparent ? ' bg-transparent' : ' bg-white dark:bg-gray-950'} {radiusFun()} overflow-y-auto"
  30232. class:popup-container={hideScrollbar}
  30233. >
  30234. {@render children?.()}
  30235. </div>
  30236. </Transition>
  30237. </div>
  30238. {/if}
  30239. <style>
  30240. .popup-container::-webkit-scrollbar {
  30241. display: none; /* Chrome Safari */
  30242. }
  30243. </style>
  30244. ================================================
  30245. FILE: packages/stdf/src/lib/components/popup/Transition.svelte
  30246. ================================================
  30247. <script lang="ts">
  30248. import type { Snippet } from 'svelte';
  30249. import { fly, scale, type ScaleParams, type FlyParams } from 'svelte/transition';
  30250. type Props = {
  30251. visible?: boolean;
  30252. size?: number;
  30253. transitionParams?: ScaleParams | FlyParams;
  30254. transitionOutParams?: ScaleParams | FlyParams;
  30255. position?: string;
  30256. px?: string;
  30257. py?: string;
  30258. children?: Snippet;
  30259. };
  30260. let {
  30261. visible = false,
  30262. size = 40,
  30263. transitionParams = {},
  30264. transitionOutParams = {},
  30265. position = 'bottom',
  30266. px = '0',
  30267. py = '0',
  30268. children
  30269. }: Props = $props();
  30270. const sizeClass = { bottom: 'w-full', top: 'w-full', left: 'h-full', right: 'h-full', center: 'w-full' };
  30271. const sizeStyle = {
  30272. bottom: `height:${size === 0 ? 'auto' : size + '%'}`,
  30273. top: `height:${size === 0 ? 'auto' : size + '%'}`,
  30274. left: `width:${size === 0 ? 'auto' : size + '%'}`,
  30275. right: `width:${size === 0 ? 'auto' : size + '%'}`,
  30276. center: `height:${size === 0 ? 'auto' : size + '%'}`
  30277. };
  30278. const pxClass = {
  30279. '0': ' px-0',
  30280. '1': ' px-1',
  30281. '2': ' px-2',
  30282. '3': ' px-3',
  30283. '4': ' px-4',
  30284. '5': ' px-5',
  30285. '6': ' px-6',
  30286. '8': ' px-8',
  30287. '10': ' px-10',
  30288. '12': ' px-12',
  30289. '16': ' px-16',
  30290. '20': ' px-20'
  30291. };
  30292. const pyClass = {
  30293. '0': ' py-0',
  30294. '1': ' py-1',
  30295. '2': ' py-2',
  30296. '3': ' py-3',
  30297. '4': ' py-4',
  30298. '5': ' py-5',
  30299. '6': ' py-6',
  30300. '8': ' py-8',
  30301. '10': ' py-10',
  30302. '12': ' py-12',
  30303. '16': ' py-16',
  30304. '24': ' py-24',
  30305. '32': ' py-32',
  30306. '48': ' py-48',
  30307. '64': ' py-64'
  30308. };
  30309. </script>
  30310. {#if visible}
  30311. {#if position === 'center'}
  30312. <div
  30313. out:scale|global={transitionOutParams}
  30314. in:scale|global={transitionParams}
  30315. class="{sizeClass[position as keyof typeof sizeClass] || sizeClass['bottom']}{pxClass[px as keyof typeof pxClass] ||
  30316. pxClass['0']}{pyClass[py as keyof typeof pyClass] || pyClass['0']} pointer-events-auto"
  30317. style={sizeStyle[position as keyof typeof sizeStyle] || sizeStyle['bottom']}
  30318. >
  30319. {@render children?.()}
  30320. </div>
  30321. {:else}
  30322. <div
  30323. in:fly|global={transitionParams}
  30324. out:fly|global={transitionOutParams}
  30325. class="{sizeClass[position as keyof typeof sizeClass] || sizeClass['bottom']}{pxClass[px as keyof typeof pxClass] ||
  30326. pxClass['0']}{pyClass[py as keyof typeof pyClass] || pyClass['0']} pointer-events-auto"
  30327. style={sizeStyle[position as keyof typeof sizeStyle] || sizeStyle['bottom']}
  30328. >
  30329. {@render children?.()}
  30330. </div>
  30331. {/if}
  30332. {/if}
  30333. ================================================
  30334. FILE: packages/stdf/src/lib/components/progress/Progress.svelte
  30335. ================================================
  30336. <script lang="ts">
  30337. import type { ProgressProps } from '../../types/index.js';
  30338. let {
  30339. percent = 66,
  30340. percentPosition = 'right',
  30341. height = '2',
  30342. radius = 'full',
  30343. inactive = false,
  30344. overflowPercent = 10,
  30345. duration = '300',
  30346. injClass = '',
  30347. trackInjClass = '',
  30348. children
  30349. }: ProgressProps = $props();
  30350. // 高度样式
  30351. // height class
  30352. const heightClass = { '1': ' h-1', '2': ' h-2', '3': ' h-3', '4': ' h-4' };
  30353. // 圆角样式
  30354. // radius class
  30355. const radiusClass = { full: ' rounded-full', middle: ' rounded-sm', none: ' rounded-none' };
  30356. // 动画时间样式
  30357. // duration class
  30358. const durationClass = {
  30359. '150': ' duration-150',
  30360. '300': ' duration-300',
  30361. '500': ' duration-500',
  30362. '700': ' duration-700',
  30363. '1000': ' duration-1000'
  30364. };
  30365. </script>
  30366. <div class="flex items-center justify-between space-x-2">
  30367. <div
  30368. class="relative w-full bg-black/10 dark:bg-white/20{percentPosition === 'inner'
  30369. ? ''
  30370. : heightClass[height] || heightClass['2']}{radiusClass[radius] || radiusClass['full']}{trackInjClass === ''
  30371. ? ''
  30372. : ` ${trackInjClass}`}"
  30373. >
  30374. <div
  30375. class="{inactive ? 'bg-primary-300 dark:bg-dark-800' : 'bg-primary dark:bg-dark'} transition-all{durationClass[duration] ||
  30376. durationClass['300']}{percentPosition === 'inner' ? '' : heightClass[height] || heightClass['2']}{radiusClass[radius] ||
  30377. radiusClass['full']}{injClass === '' ? '' : ` ${injClass}`}"
  30378. style="width:{percent}%;"
  30379. >
  30380. {#if percentPosition === 'inner'}
  30381. <div
  30382. class="px-1 py-0.5 text-right text-xs whitespace-nowrap{percent < overflowPercent
  30383. ? ' translate-x-full text-black dark:text-white'
  30384. : ' text-white dark:text-black'}"
  30385. >
  30386. {#if children}
  30387. {@render children?.()}
  30388. {:else}
  30389. {percent}%
  30390. {/if}
  30391. </div>
  30392. {/if}
  30393. </div>
  30394. {#if percentPosition === 'block'}
  30395. <div
  30396. class="absolute top-1/2 {inactive
  30397. ? ' bg-primary-300 dark:bg-dark-800'
  30398. : ' bg-primary dark:bg-dark'} px-1 py-0.5 text-xs text-white transition-all dark:text-black duration-300{radiusClass[radius] ||
  30399. radiusClass['full']} -translate-y-1/2 -translate-x-1/2{injClass === '' ? '' : ` ${injClass}`}"
  30400. style="left:{percent}%;"
  30401. >
  30402. {#if children}
  30403. {@render children?.()}
  30404. {:else}
  30405. {percent}%
  30406. {/if}
  30407. </div>
  30408. {/if}
  30409. </div>
  30410. {#if percentPosition === 'right'}
  30411. {#if children}
  30412. {@render children?.()}
  30413. {:else}
  30414. <div class="text-xs">{percent}%</div>
  30415. {/if}
  30416. {/if}
  30417. </div>
  30418. ================================================
  30419. FILE: packages/stdf/src/lib/components/progressLoop/ProgressLoop.svelte
  30420. ================================================
  30421. <script lang="ts">
  30422. import type { ProgressLoopProps } from '../../types/index.js';
  30423. let {
  30424. percent = 66,
  30425. strokeWidth = 2,
  30426. butt = false,
  30427. reverse = false,
  30428. duration = '300',
  30429. gradient = null,
  30430. injClass = '',
  30431. trackInjClass = '',
  30432. children
  30433. }: ProgressLoopProps = $props();
  30434. // 通过百分比计算半径
  30435. // calculate radius by percent
  30436. const r = 12 - strokeWidth / 2;
  30437. // 计算圆周长
  30438. // calculate circle length
  30439. const circleLen = 2 * Math.PI * r;
  30440. // 动画时间 class
  30441. // animation duration class
  30442. const durationClass = {
  30443. '150': ' duration-150',
  30444. '300': ' duration-300',
  30445. '500': ' duration-500',
  30446. '700': ' duration-700',
  30447. '1000': ' duration-1000'
  30448. };
  30449. </script>
  30450. <div class="relative">
  30451. <svg viewBox="0 0 24 24" class="-rotate-90{reverse ? ' -scale-y-100' : ''}">
  30452. <circle
  30453. cx="12"
  30454. cy="12"
  30455. {r}
  30456. stroke-width={strokeWidth}
  30457. fill="none"
  30458. class="stroke-black/5 dark:stroke-white/5{trackInjClass === '' ? '' : ` ${trackInjClass}`}"
  30459. ></circle>
  30460. {#if gradient && gradient.length === 2}
  30461. <defs>
  30462. <linearGradient id="gradient_ProgressLoop">
  30463. <stop offset="0%" style="stop-color: {gradient[1]};" />
  30464. <stop offset="100%" style="stop-color: {gradient[0]};" />
  30465. </linearGradient>
  30466. </defs>
  30467. {/if}
  30468. <circle
  30469. cx="12"
  30470. cy="12"
  30471. {r}
  30472. stroke-width={strokeWidth}
  30473. class="{!gradient || gradient.length < 2 ? 'stroke-primary dark:stroke-dark ' : ''}transition-all {durationClass[duration] ||
  30474. durationClass['300']}{injClass === '' ? '' : ` ${injClass}`}"
  30475. fill="none"
  30476. stroke-dashoffset={circleLen - (percent / 100) * circleLen || 0}
  30477. stroke-dasharray={circleLen}
  30478. stroke-linecap={butt ? 'butt' : 'round'}
  30479. stroke="url(#gradient_ProgressLoop)"
  30480. ></circle>
  30481. </svg>
  30482. <div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2">
  30483. {#if children}
  30484. {@render children?.()}
  30485. {:else}
  30486. <div class="text-xs">{percent}%</div>
  30487. {/if}
  30488. </div>
  30489. </div>
  30490. ================================================
  30491. FILE: packages/stdf/src/lib/components/radio/Radio.svelte
  30492. ================================================
  30493. <script lang="ts">
  30494. import RadioItem from './RadioItem.svelte';
  30495. import type { RadioProps } from '../../types/index.js';
  30496. let {
  30497. data = [],
  30498. value = $bindable(''),
  30499. layout = 'v',
  30500. textPosition = 'r',
  30501. icon = 'default',
  30502. iconChecked = 'default',
  30503. radioChild,
  30504. onchange
  30505. }: RadioProps = $props();
  30506. const clickItemFn = (name: string) => {
  30507. value = name;
  30508. onchange?.(value);
  30509. };
  30510. </script>
  30511. <div class={layout === 'inline' ? 'flex flex-wrap' : `flex ${layout === 'h' ? 'justify-between' : 'w-full flex-col space-y-2'}`}>
  30512. {#each data as item}
  30513. {#if radioChild}
  30514. {@render radioChild({ item })}
  30515. {:else}
  30516. <RadioItem
  30517. {layout}
  30518. {...item}
  30519. {textPosition}
  30520. {icon}
  30521. {iconChecked}
  30522. checked={value === item.name}
  30523. onclick={() => clickItemFn(item.name)}
  30524. >
  30525. {item.label}
  30526. </RadioItem>
  30527. {/if}
  30528. {/each}
  30529. </div>
  30530. ================================================
  30531. FILE: packages/stdf/src/lib/components/radio/RadioItem.svelte
  30532. ================================================
  30533. <script lang="ts">
  30534. import Icon from '../icon/Icon.svelte';
  30535. import type { RadioItemProps } from '../../types/index.js';
  30536. let {
  30537. name = '',
  30538. textPosition = 'r',
  30539. layout = 'v',
  30540. checked = false,
  30541. icon = 'default',
  30542. iconChecked = 'default',
  30543. children,
  30544. onclick
  30545. }: RadioItemProps = $props();
  30546. // 点击选项事件
  30547. // Click option event
  30548. const clickRadioFun = () => {
  30549. onclick?.(name);
  30550. };
  30551. </script>
  30552. <button
  30553. onclick={() => clickRadioFun()}
  30554. class="{layout === 'inline' ? 'inline-block' : 'flex'} grow active:opacity-80 {textPosition === 'l' && layout === 'v'
  30555. ? 'justify-between'
  30556. : ''} {textPosition === 'b' || textPosition === 't' ? 'flex-col items-center' : layout === 'h' ? 'justify-center' : 'items-center'}"
  30557. >
  30558. {#if textPosition === 'l' || textPosition === 't'}
  30559. <div class="{textPosition === 'l' && icon !== null ? 'mr-0.5 text-left' : ''} {layout === 'v' ? 'grow' : ''}">
  30560. {@render children?.()}
  30561. {#if layout === 'v'}
  30562. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  30563. {/if}
  30564. </div>
  30565. {/if}
  30566. <div class:hidden={!checked}>
  30567. {#if iconChecked === null}{:else if iconChecked === 'default'}
  30568. <Icon name="ri-radio-button-line" theme top={textPosition === 't' || textPosition === 'b' ? 0 : -1} />
  30569. {:else}
  30570. <Icon {...iconChecked} theme />
  30571. {/if}
  30572. </div>
  30573. <div class:hidden={checked}>
  30574. {#if icon === null}{:else if icon === 'default'}
  30575. <Icon name="ri-checkbox-blank-circle-line" alpha={0.2} top={textPosition === 't' || textPosition === 'b' ? 0 : -1} />
  30576. {:else}
  30577. <Icon alpha={0.2} {...icon} />
  30578. {/if}
  30579. </div>
  30580. {#if textPosition === 'r' || textPosition === 'b'}
  30581. <div class={textPosition === 'r' && icon !== null ? 'ml-0.5 text-left' : ''}>
  30582. {@render children?.()}
  30583. </div>
  30584. {/if}
  30585. </button>
  30586. ================================================
  30587. FILE: packages/stdf/src/lib/components/rate/Rate.svelte
  30588. ================================================
  30589. <script lang="ts">
  30590. import { getContext } from 'svelte';
  30591. import Icon from '../icon/Icon.svelte';
  30592. import type { RateProps } from '../../types/index.js';
  30593. import { zh_CN, type LangProps } from '../../lang/index.js';
  30594. // 当前语言
  30595. // current language
  30596. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  30597. const rateLang: LangProps['rate'] = currentLang.rate;
  30598. let {
  30599. value = $bindable(4),
  30600. total = 5,
  30601. height = 24,
  30602. width = 24,
  30603. opacity = '0.2',
  30604. space = '3',
  30605. half = false,
  30606. zero = false,
  30607. vertical = false,
  30608. disabled = false,
  30609. readonly = false,
  30610. animation = 'current',
  30611. children,
  30612. onclick
  30613. }: RateProps = $props();
  30614. // 对传入数据进行一些报错或警告处理
  30615. // some error or warning processing for the incoming data
  30616. if (value > total) {
  30617. console.error(rateLang.error1);
  30618. }
  30619. if (total % 1 !== 0) {
  30620. console.error(rateLang.error2);
  30621. }
  30622. if (!half && value % 1 !== 0) {
  30623. console.error(rateLang.error3);
  30624. }
  30625. if (half && value % 0.5 !== 0) {
  30626. console.error(rateLang.error4);
  30627. }
  30628. if (width < 20 || height < 20) {
  30629. console.error(rateLang.error5);
  30630. }
  30631. // 间距样式
  30632. // space style
  30633. const spaceObj = { '0': ' gap-0', '1': ' gap-1', '2': ' gap-2', '3': ' gap-3', '4': ' gap-4', '8': ' gap-8' };
  30634. // 透明度样式
  30635. // opacity style
  30636. const opacityObj = {
  30637. '0.05': ' opacity-5',
  30638. '0.1': ' opacity-10',
  30639. '0.2': ' opacity-20',
  30640. '0.3': ' opacity-30',
  30641. '0.4': ' opacity-40',
  30642. '0.5': ' opacity-50',
  30643. '0.6': ' opacity-60',
  30644. '0.7': ' opacity-70',
  30645. '0.8': ' opacity-80',
  30646. '0.9': ' opacity-90',
  30647. '1': ' opacity-100'
  30648. };
  30649. // 是否缩放
  30650. // whether to scale
  30651. let isScale = $state(false);
  30652. // 点击索引
  30653. // click index
  30654. let clickIndex = $state(0);
  30655. // 点击事件
  30656. // click event
  30657. const clickFun = (index: number) => {
  30658. if (disabled || readonly) {
  30659. return;
  30660. }
  30661. isScale = true;
  30662. clickIndex = index;
  30663. setTimeout(() => {
  30664. isScale = false;
  30665. }, 80);
  30666. if (half) {
  30667. if (index === 0) {
  30668. if (zero) {
  30669. if (value === 0 || value > 1) {
  30670. value = 0.5;
  30671. } else if (value === 0.5) {
  30672. value = 1;
  30673. } else {
  30674. value = 0;
  30675. }
  30676. } else {
  30677. if (value === 0 || value >= 1) {
  30678. value = 0.5;
  30679. } else {
  30680. value = 1;
  30681. }
  30682. }
  30683. } else {
  30684. value = value === index + 0.5 ? index + 1 : index + 0.5;
  30685. }
  30686. } else {
  30687. if (zero && index === 0) {
  30688. value = value !== 1 ? 1 : 0;
  30689. } else {
  30690. value = index + 1;
  30691. }
  30692. }
  30693. // 派发事件
  30694. // dispatch event
  30695. onclick?.(value);
  30696. };
  30697. // 处理允许半选情况时的样式
  30698. // handle the style when half selection is allowed
  30699. const isActiveFun = (index: number, value: number, half: boolean, vertical: boolean, i: number) => {
  30700. if (half) {
  30701. if (vertical) {
  30702. if (i === 0) {
  30703. return index + 0.5 < value;
  30704. }
  30705. if (i === 1) {
  30706. return index + 0.5 < value;
  30707. }
  30708. if (i === 2) {
  30709. return index + 0.5 <= value;
  30710. }
  30711. if (i === 3) {
  30712. return index + 0.5 <= value;
  30713. }
  30714. } else {
  30715. if (i === 0) {
  30716. return index + 0.5 <= value;
  30717. }
  30718. if (i === 1) {
  30719. return index + 0.5 < value;
  30720. }
  30721. if (i === 2) {
  30722. return index + 0.5 <= value;
  30723. }
  30724. if (i === 3) {
  30725. return index + 0.5 < value;
  30726. }
  30727. }
  30728. } else {
  30729. return index + 1 <= value;
  30730. }
  30731. };
  30732. </script>
  30733. <div class="inset-0 inline-flex flex-wrap{spaceObj[space] || spaceObj['4']}{disabled ? ' opacity-50' : ''}">
  30734. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  30735. {#each new Array(Math.floor(total)) as _, index}
  30736. <button
  30737. class="flex flex-wrap transition-all{disabled ? ' cursor-not-allowed' : ' cursor-pointer'}{animation === 'active'
  30738. ? clickIndex >= index && isScale
  30739. ? ' scale-75'
  30740. : ''
  30741. : animation === 'current'
  30742. ? clickIndex === index && isScale
  30743. ? ' scale-75'
  30744. : ''
  30745. : ''}"
  30746. style="height:{height}px;width:{width}px;"
  30747. onclick={() => clickFun(index)}
  30748. >
  30749. {#each [0, 1, 2, 3] as i}
  30750. <div
  30751. class="overflow-hidden{isActiveFun(index, value, half, vertical, i) ? '' : ` grayscale${opacityObj[opacity] || ' opacity-30'}`}"
  30752. style="height:{height / 2}px;width:{width / 2}px;"
  30753. >
  30754. <div style="transform:translateX({i === 0 || i === 2 ? 0 : -(width / 2)}px) translateY({i < 2 ? 0 : -(height / 2)}px)">
  30755. {#if children}
  30756. {@render children?.()}
  30757. {:else}
  30758. <Icon name="ri-star-fill" theme size={height} top={height < 24 ? height - 24 : 0} />
  30759. {/if}
  30760. </div>
  30761. </div>
  30762. {/each}
  30763. </button>
  30764. {/each}
  30765. </div>
  30766. ================================================
  30767. FILE: packages/stdf/src/lib/components/scrollRadio/ScrollRadio.svelte
  30768. ================================================
  30769. <script lang="ts">
  30770. import { onMount } from 'svelte';
  30771. type Props = {
  30772. data?: Record<string, string>[];
  30773. showRow?: 3 | 5 | 7;
  30774. initIndex?: number;
  30775. labelKey?: string;
  30776. autoScrollToLast?: boolean;
  30777. useAnimation?: boolean;
  30778. lastSelectedIndex?: number;
  30779. align?: 'center' | 'left' | 'right';
  30780. onscrollEnd?: (index: number, isTouch: boolean) => void;
  30781. };
  30782. let {
  30783. data = [],
  30784. showRow = 5,
  30785. initIndex = 0,
  30786. labelKey = 'label',
  30787. autoScrollToLast = true,
  30788. useAnimation = true,
  30789. lastSelectedIndex = 0,
  30790. align = 'center',
  30791. onscrollEnd
  30792. }: Props = $props();
  30793. // 是否触摸
  30794. // Whether to touch
  30795. let isTouch = $state(false);
  30796. // 对齐方式样式
  30797. // Alignment style
  30798. const alignClass = { center: 'text-center', left: 'text-left', right: 'text-right' };
  30799. // 单条高度对象
  30800. // Single height object
  30801. const itemHeightObj = { '3': 4, '5': 3, '7': 2 };
  30802. // 实际显示行数
  30803. // Actual number of rows displayed
  30804. const showRowsInner = showRow === 3 || showRow === 5 || showRow === 7 ? showRow : 5;
  30805. // 单条高度
  30806. // Single height
  30807. const itemHeight = itemHeightObj[showRowsInner];
  30808. // 定义空对象 emptyObj,当 showRowsInner 为 3 时,newData 前后各补足一条 emptyObj,当 showRowsInner 为 5 时,newData 前后各补足两条 emptyObj,当 showRowsInner 为 7 时,newData 前后各补足三条 emptyObj
  30809. // Define empty object emptyObj, when showRowsInner is 3, newData is supplemented with one emptyObj at the front and back, when showRowsInner is 5, newData is supplemented with two emptyObj at the front and back, when showRowsInner is 7, newData is supplemented with three emptyObj at the front and back
  30810. const emptyObj: Record<string, string> = {};
  30811. emptyObj[labelKey] = '';
  30812. const newData =
  30813. showRowsInner === 3
  30814. ? [...[emptyObj], ...data, ...[emptyObj]]
  30815. : showRowsInner === 5
  30816. ? [...[emptyObj, emptyObj], ...data, ...[emptyObj, emptyObj]]
  30817. : [...[emptyObj, emptyObj, emptyObj], ...data, ...[emptyObj, emptyObj, emptyObj]];
  30818. // 滚动元素
  30819. // Scroll element
  30820. let scrollElement = $state<HTMLDivElement | null>(null);
  30821. // 当前选中项索引
  30822. // Current selected item index
  30823. let currentIndex = 0;
  30824. onMount(() => {
  30825. if (scrollElement) {
  30826. // 监听 scrollElement 的滚动事件,同时考虑节流,滚动结束时,计算当前最中间的元素的索引
  30827. // Listen to the scroll event of scrollElement, and consider throttling at the same time. The index of the element in the middle is calculated when the scroll ends
  30828. let scrollTimer: ReturnType<typeof setTimeout>;
  30829. scrollElement.addEventListener('scroll', (e: Event) => {
  30830. if (scrollTimer) clearTimeout(scrollTimer);
  30831. scrollTimer = setTimeout(() => {
  30832. const scrollTop = (e.target as HTMLElement)?.scrollTop;
  30833. currentIndex = Math.round(scrollTop / (itemHeight * 16));
  30834. onscrollEnd?.(currentIndex, isTouch);
  30835. });
  30836. });
  30837. }
  30838. });
  30839. $effect(() => {
  30840. if (scrollElement) {
  30841. if (autoScrollToLast) {
  30842. scrollElement.scrollTop = lastSelectedIndex * itemHeight * 16;
  30843. } else {
  30844. scrollElement.scrollTop = initIndex * itemHeight * 16;
  30845. }
  30846. }
  30847. });
  30848. </script>
  30849. <div class="picker-contents relative overflow-auto" style="height:{itemHeight * showRowsInner}rem;">
  30850. <div
  30851. class="picker-contents snap-y overflow-auto {useAnimation ? 'scroll-smooth' : 'scroll-auto'}"
  30852. style="height:{itemHeight * showRowsInner}rem;"
  30853. bind:this={scrollElement}
  30854. onscroll={() => {
  30855. isTouch = true;
  30856. }}
  30857. >
  30858. {#each newData as item}
  30859. <div class="{alignClass[align] || alignClass.center} flex snap-center flex-col justify-center px-2" style="height:{itemHeight}rem;">
  30860. <div class="truncate">{item[labelKey]}</div>
  30861. </div>
  30862. {/each}
  30863. <div
  30864. class="pointer-events-none absolute inset-0 w-full border-b border-t border-white dark:border-black"
  30865. style="height:{itemHeight * showRowsInner}rem"
  30866. >
  30867. <div
  30868. class="border-b border-black/10 bg-gradient-to-b from-white to-white/60 dark:border-white/20 dark:from-black dark:to-black/60"
  30869. style="height:{itemHeight * ((showRowsInner - 1) / 2)}rem;"
  30870. ></div>
  30871. <div style="height:{itemHeight}rem;"></div>
  30872. <div
  30873. class="border-t border-black/10 bg-gradient-to-t from-white to-white/60 dark:border-white/20 dark:from-black dark:to-black/60"
  30874. style="height:{itemHeight * ((showRowsInner - 1) / 2)}rem;"
  30875. ></div>
  30876. </div>
  30877. </div>
  30878. </div>
  30879. <style>
  30880. .picker-contents::-webkit-scrollbar {
  30881. display: none; /* Chrome Safari */
  30882. }
  30883. </style>
  30884. ================================================
  30885. FILE: packages/stdf/src/lib/components/skeleton/Skeleton.svelte
  30886. ================================================
  30887. <script lang="ts">
  30888. import Icon from '../icon/Icon.svelte';
  30889. import type { SkeletonProps } from '../../types/index.js';
  30890. let { type = 'div', width = '6', height = '6', radius = 'sm', space = '1', lines = 3, iconRatio = 0.6 }: SkeletonProps = $props();
  30891. const radiusObj = {
  30892. none: ' rounded-none',
  30893. sm: ' rounded-sm',
  30894. md: ' rounded-md',
  30895. xl: ' rounded-xl',
  30896. '2xl': ' rounded-2xl',
  30897. '3xl': ' rounded-3xl',
  30898. full: ' rounded-full'
  30899. };
  30900. const widthObj = {
  30901. full: ' w-full',
  30902. '2': ' w-2',
  30903. '4': ' w-4',
  30904. '6': ' w-6',
  30905. '8': ' w-8',
  30906. '12': ' w-12',
  30907. '16': ' w-16',
  30908. '24': ' w-24',
  30909. '32': ' w-32',
  30910. '48': ' w-48',
  30911. '64': ' w-64',
  30912. '96': ' w-96'
  30913. };
  30914. const heightObj = {
  30915. '1': ' h-1',
  30916. '2': ' h-2',
  30917. '4': ' h-4',
  30918. '6': ' h-6',
  30919. '8': ' h-8',
  30920. '12': ' h-12',
  30921. '16': ' h-16',
  30922. '24': ' h-24',
  30923. '32': ' h-32',
  30924. '48': ' h-48',
  30925. '64': ' h-64',
  30926. '96': ' h-96'
  30927. };
  30928. const paddingObj = { '0.5': ' p-0.5', '1': ' p-1', '2': ' p-2', '4': ' p-4' };
  30929. const randomArr = ['w-1/2', 'w-1/3', 'w-2/3', 'w-1/4', 'w-3/4', 'w-2/5', 'w-3/5', 'w-4/5', 'w-5/6'];
  30930. const typeIconFun = (type: string) => {
  30931. const typeMap = {
  30932. img: 'ri-image-2-fill',
  30933. video: 'ri-movie-2-fill',
  30934. code: 'ri-code-box-fill',
  30935. qrcode: 'ri-qr-code-fill',
  30936. barcode: 'ri-barcode-fill'
  30937. };
  30938. return typeMap[type as keyof typeof typeMap] || typeMap.qrcode;
  30939. };
  30940. </script>
  30941. <div
  30942. class="animate-pulse {type === 'p' || width === 'full' ? 'block' : 'inline-block'}{paddingObj[space as keyof typeof paddingObj] ||
  30943. paddingObj['1']}"
  30944. >
  30945. {#if type === 'p'}
  30946. <div class="flex flex-col space-y-2">
  30947. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  30948. {#each new Array(lines - 1) as _}
  30949. <div class="bg-black/20 dark:bg-white/20 w-full{heightObj[height] || heightObj['6']}{radiusObj[radius] || radiusObj.sm}"></div>
  30950. {/each}
  30951. <div
  30952. class="bg-black/20 dark:bg-white/20 {randomArr[Math.floor(Math.random() * randomArr.length)]}{heightObj[height] ||
  30953. heightObj['6']}{radiusObj[radius] || radiusObj.sm}"
  30954. ></div>
  30955. </div>
  30956. {:else}
  30957. <div
  30958. class="bg-black/20 dark:bg-white/20{widthObj[width] || widthObj.full}{heightObj[height] || heightObj['6']}{radiusObj[radius] ||
  30959. radiusObj.sm} flex flex-col justify-center"
  30960. >
  30961. {#if type === 'img' || type === 'video' || type === 'code' || type === 'qrcode' || type === 'barcode'}
  30962. <div class="m-auto" style="width:{iconRatio * 100 + '%'}">
  30963. <Icon name={typeIconFun(type)} size="full" alpha={0.2} />
  30964. </div>
  30965. {/if}
  30966. </div>
  30967. {/if}
  30968. </div>
  30969. ================================================
  30970. FILE: packages/stdf/src/lib/components/slider/Slider.svelte
  30971. ================================================
  30972. <script lang="ts">
  30973. import { onMount } from 'svelte';
  30974. import { fly } from 'svelte/transition';
  30975. import { throttleWithRAF, debounce, stepNumberFun } from '../utils/index.js';
  30976. import type { SliderProps } from '../../types/index.js';
  30977. let {
  30978. value = $bindable(40),
  30979. step = 1,
  30980. minRange = 0,
  30981. maxRange = 100,
  30982. isRange = false,
  30983. valueRange = $bindable([20, 60]),
  30984. startValue = $bindable(20),
  30985. endValue = $bindable(60),
  30986. showTip = 'touch',
  30987. radius = 'full',
  30988. lineBlock = false,
  30989. disabled = false,
  30990. readonly = false,
  30991. children,
  30992. onchange
  30993. }: SliderProps = $props();
  30994. //滑动条 dom slider dom
  30995. let lineDom = $state<HTMLDivElement | null>(null);
  30996. //滑块 dom block dom
  30997. let blockDom = $state<HTMLDivElement | null>(null);
  30998. //滑块宽度 block width
  30999. let blockWidth = $state(0);
  31000. //滑块条起始位置 slider start position
  31001. let lineDomStartX = $state(0);
  31002. //滑块条结束位置 slider end position
  31003. let lineDomEndX = $state(0);
  31004. //滑块条宽度 slider width
  31005. let lineDomWidth = $state(0);
  31006. //初始位置 initial position
  31007. let currentX = $state(0);
  31008. $effect(() => {
  31009. currentX = ((value - minRange) / (maxRange - minRange)) * lineDomWidth;
  31010. });
  31011. //区间选择时开始位置 start position
  31012. let currentStartX = $state(0);
  31013. $effect(() => {
  31014. currentStartX = ((startValue - minRange) / (maxRange - minRange)) * lineDomWidth;
  31015. });
  31016. //区间选择时结束位置 end position
  31017. let currentEndX = $state(0);
  31018. $effect(() => {
  31019. currentEndX = ((endValue - minRange) / (maxRange - minRange)) * lineDomWidth;
  31020. });
  31021. //当前移动的滑块 current move block
  31022. let currentMove = $state('none');
  31023. //是否按下 is down
  31024. let isDown = false;
  31025. const radiusObj = { none: ' rounded-none', sm: ' rounded-sm', xl: ' rounded-xl', full: ' rounded-full' };
  31026. const touchLineStart = (e: PointerEvent) => {
  31027. if (disabled || readonly) {
  31028. return;
  31029. }
  31030. isDown = true;
  31031. const clientX = e.clientX;
  31032. if (isRange) {
  31033. //判断点击位置距离哪一个更近
  31034. // Determine which one is closer to the click position
  31035. if (startValue === endValue) {
  31036. if (clientX - lineDomStartX <= currentStartX) {
  31037. // 点击的是开始滑块
  31038. // Click on the start block
  31039. currentMove = 'start';
  31040. currentStartX = clientX - lineDomStartX;
  31041. } else {
  31042. // 点击的是结束滑块
  31043. // Click on the end block
  31044. currentMove = 'end';
  31045. currentEndX = clientX - lineDomStartX;
  31046. }
  31047. } else if (Math.abs(clientX - currentStartX - lineDomStartX) < Math.abs(clientX - currentEndX - lineDomStartX)) {
  31048. // 点击的是开始滑块
  31049. // Click on the start block
  31050. currentMove = 'start';
  31051. currentStartX = clientX - lineDomStartX;
  31052. } else {
  31053. // 点击的是结束滑块
  31054. // Click on the end block
  31055. currentMove = 'end';
  31056. currentEndX = clientX - lineDomStartX;
  31057. }
  31058. startValue = stepNumberFun(minRange + (currentStartX / lineDomWidth) * (maxRange - minRange), step);
  31059. endValue = stepNumberFun(minRange + (currentEndX / lineDomWidth) * (maxRange - minRange), step);
  31060. onchange?.(0, [startValue, endValue]);
  31061. } else {
  31062. currentMove = 'one';
  31063. currentX = clientX - lineDomStartX;
  31064. value = stepNumberFun((currentX / lineDomWidth) * (maxRange - minRange), step);
  31065. onchange?.(value);
  31066. }
  31067. };
  31068. const touchLineMove = (e: PointerEvent) => {
  31069. if (!lineDom?.hasPointerCapture(e.pointerId)) {
  31070. lineDom?.setPointerCapture(e.pointerId);
  31071. }
  31072. if (disabled || readonly) {
  31073. return;
  31074. }
  31075. if (!isDown) {
  31076. return;
  31077. }
  31078. const clientX = e.clientX;
  31079. if (isRange) {
  31080. if (currentMove === 'start') {
  31081. if (clientX <= lineDomStartX) {
  31082. currentStartX = 0;
  31083. } else if (clientX >= currentEndX + blockWidth / 2) {
  31084. currentStartX = currentEndX;
  31085. } else {
  31086. currentStartX = clientX - lineDomStartX;
  31087. }
  31088. } else {
  31089. if (clientX <= currentStartX + blockWidth / 2) {
  31090. currentEndX = currentStartX;
  31091. } else if (clientX >= lineDomEndX) {
  31092. currentEndX = lineDomEndX - lineDomStartX;
  31093. } else {
  31094. currentEndX = clientX - lineDomStartX;
  31095. //由于开启了防抖,有极短时间内会出现 currentEndX 大于 lineDomEndX 的情况,所以这里做了一个判断
  31096. //Due to the opening of the anti-shake, there will be a situation where currentEndX is greater than lineDomEndX in a very short time, so a judgment is made here
  31097. currentEndX = currentEndX < currentStartX ? currentStartX : currentEndX;
  31098. }
  31099. }
  31100. startValue = stepNumberFun(minRange + (currentStartX / lineDomWidth) * (maxRange - minRange), step);
  31101. endValue = stepNumberFun(minRange + (currentEndX / lineDomWidth) * (maxRange - minRange), step);
  31102. onchange?.(0, [startValue, endValue]);
  31103. } else {
  31104. if (clientX <= lineDomStartX) {
  31105. currentX = 0;
  31106. } else if (clientX >= lineDomEndX) {
  31107. currentX = lineDomEndX - lineDomStartX;
  31108. } else {
  31109. currentX = clientX - lineDomStartX;
  31110. }
  31111. value = stepNumberFun(minRange + (currentX / lineDomWidth) * (maxRange - minRange), step);
  31112. onchange?.(value);
  31113. }
  31114. };
  31115. const touchLineEnd = (e: PointerEvent) => {
  31116. if (lineDom?.hasPointerCapture(e.pointerId)) {
  31117. lineDom?.releasePointerCapture(e.pointerId);
  31118. }
  31119. currentMove = 'none';
  31120. isDown = false;
  31121. };
  31122. const handleResize = () => {
  31123. if (!lineDom) return;
  31124. lineDomStartX = lineDom.getBoundingClientRect().left;
  31125. lineDomEndX = lineDom.getBoundingClientRect().right;
  31126. lineDomWidth = lineDom.getBoundingClientRect().width;
  31127. currentX = ((value - minRange) / (maxRange - minRange)) * lineDomWidth; //挂载完成之后初始位置 initial position after mounting
  31128. currentStartX = ((startValue - minRange) / (maxRange - minRange)) * lineDomWidth; //区间选择开始位置 initial position after mounting
  31129. currentEndX = ((endValue - minRange) / (maxRange - minRange)) * lineDomWidth; //区间选择结束位置 initial position after mounting
  31130. if (isRange && blockDom) {
  31131. blockWidth = blockDom.getBoundingClientRect().width;
  31132. }
  31133. };
  31134. onMount(() => {
  31135. handleResize();
  31136. window.addEventListener('resize', debounce(handleResize, 200));
  31137. });
  31138. </script>
  31139. <div class="relative h-7{disabled ? ' opacity-50' : ''}">
  31140. <div
  31141. onpointerdown={touchLineStart}
  31142. onpointermove={(e) => throttleWithRAF(touchLineMove)(e)}
  31143. onpointerup={touchLineEnd}
  31144. class="absolute flex h-7 w-full cursor-move touch-none flex-col justify-center"
  31145. bind:this={lineDom}
  31146. >
  31147. {#if children}
  31148. {@render children()}
  31149. {:else}
  31150. <div class="h-1 w-full bg-black/10 dark:bg-white/20{radiusObj[radius] || radiusObj['full']}">
  31151. {#if isRange}
  31152. <div
  31153. class="bg-primary dark:bg-dark h-1{radiusObj[radius] || radiusObj['full']}"
  31154. style="width:{currentEndX - currentStartX}px;transform: translateX({currentStartX}px);"
  31155. ></div>
  31156. {:else}
  31157. <div class="bg-primary dark:bg-dark h-1{radiusObj[radius] || radiusObj['full']}" style="width:{currentX}px"></div>
  31158. {/if}
  31159. </div>
  31160. {/if}
  31161. </div>
  31162. {#if isRange}
  31163. <div class="pointer-events-none absolute flex h-7 w-full flex-col justify-center">
  31164. <div
  31165. class="{lineBlock
  31166. ? 'border-primary dark:border-dark h-6 w-6 border bg-white dark:bg-black'
  31167. : 'bg-primary ring-primary/10 dark:bg-dark dark:ring-dark/10 h-5 w-5 ring-4'}{radiusObj[radius] || radiusObj['full']}"
  31168. style="transform: translateX(calc({currentStartX}px - 50%));"
  31169. >
  31170. {#if showTip === 'always' || (currentMove === 'start' && showTip !== 'never')}
  31171. <div
  31172. class="absolute -top-9 bg-black/90 py-1 text-xs text-white dark:bg-white dark:text-black px-2{radius === 'none'
  31173. ? ' rounded-none'
  31174. : ' rounded-sm'}"
  31175. style="left: 50%;transform: translateX(-50%);"
  31176. in:fly={{ y: 8, duration: 500 }}
  31177. out:fly={{ y: 8, duration: 300 }}
  31178. >
  31179. {startValue}
  31180. <div
  31181. class="absolute h-0 w-0 border-4 border-t-4 border-transparent border-t-black/90 dark:border-t-white"
  31182. style="top:100%;left:50%;transform: translateX(-50%)"
  31183. ></div>
  31184. </div>
  31185. {/if}
  31186. </div>
  31187. </div>
  31188. <div class="pointer-events-none absolute flex h-7 w-full flex-col justify-center">
  31189. <div
  31190. class="{lineBlock
  31191. ? 'border-primary dark:border-dark h-6 w-6 border bg-white dark:bg-black'
  31192. : 'bg-primary ring-primary/10 dark:bg-dark dark:ring-dark/10 h-5 w-5 ring-4'}{radiusObj[radius] || radiusObj['full']}"
  31193. style="transform: translateX(calc({currentEndX}px - 50%));"
  31194. bind:this={blockDom}
  31195. >
  31196. {#if showTip === 'always' || (currentMove === 'end' && showTip !== 'never')}
  31197. <div
  31198. class="absolute -top-9 bg-black/90 py-1 text-xs text-white dark:bg-white dark:text-black px-2{radius === 'none'
  31199. ? ' rounded-none'
  31200. : ' rounded-sm'}"
  31201. style="left: 50%;transform: translateX(-50%);"
  31202. in:fly={{ y: 8, duration: 500 }}
  31203. out:fly={{ y: 8, duration: 300 }}
  31204. >
  31205. {endValue}
  31206. <div
  31207. class="absolute h-0 w-0 border-4 border-t-4 border-transparent border-t-black/90 dark:border-t-white"
  31208. style="top:100%;left:50%;transform: translateX(-50%)"
  31209. ></div>
  31210. </div>
  31211. {/if}
  31212. </div>
  31213. </div>
  31214. {:else}
  31215. <div class="pointer-events-none absolute flex h-7 w-full flex-col justify-center">
  31216. <div
  31217. class="{lineBlock
  31218. ? 'border-primary dark:border-dark h-6 w-6 border bg-white dark:bg-black'
  31219. : 'bg-primary ring-primary/10 dark:bg-dark dark:ring-dark/10 h-5 w-5 ring-4'}{radiusObj[radius] || radiusObj['full']}"
  31220. style="transform: translateX(calc({currentX}px - 50%));"
  31221. >
  31222. {#if showTip === 'always' || (currentMove === 'one' && showTip !== 'never')}
  31223. <div
  31224. class="absolute -top-9 bg-black/90 py-1 text-xs text-white dark:bg-white dark:text-black px-2{radius === 'none'
  31225. ? ' rounded-none'
  31226. : ' rounded-sm'}"
  31227. style="left: 50%;transform: translateX(-50%);"
  31228. in:fly={{ y: 8, duration: 500 }}
  31229. out:fly={{ y: 8, duration: 300 }}
  31230. >
  31231. {value}
  31232. <div
  31233. class="absolute h-0 w-0 border-4 border-t-4 border-transparent border-t-black/90 dark:border-t-white"
  31234. style="top:100%;left:50%;transform: translateX(-50%)"
  31235. ></div>
  31236. </div>
  31237. {/if}
  31238. </div>
  31239. </div>
  31240. {/if}
  31241. </div>
  31242. ================================================
  31243. FILE: packages/stdf/src/lib/components/stepper/Stepper.svelte
  31244. ================================================
  31245. <script lang="ts">
  31246. import Icon from '../icon/Icon.svelte';
  31247. import Loading from '../loading/Loading.svelte';
  31248. import type { StepperProps } from '../../types/index.js';
  31249. let {
  31250. value = $bindable(10),
  31251. min = 0,
  31252. max = 100,
  31253. step = 1,
  31254. vertical = false,
  31255. numberHighlight = false,
  31256. theme = true,
  31257. radius = 'sm',
  31258. decimal = 0,
  31259. async = false,
  31260. asyncLoading = false,
  31261. loading = {},
  31262. padding = true,
  31263. injClassOut = '',
  31264. injClassBtn = '',
  31265. injClassNum = '',
  31266. onchange,
  31267. ondecrease,
  31268. onincrease
  31269. }: StepperProps = $props();
  31270. // 圆角
  31271. // Round
  31272. const roundObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', full: 'rounded-full' };
  31273. // 减少
  31274. // Decrease
  31275. const decreaseFn = () => {
  31276. if (!async) {
  31277. if (value > min) {
  31278. value = Math.max(min, value - step);
  31279. onchange?.(value);
  31280. }
  31281. }
  31282. ondecrease?.();
  31283. };
  31284. // 增加
  31285. // Increase
  31286. const increaseFn = () => {
  31287. if (!async) {
  31288. if (value < max) {
  31289. value = Math.min(max, value + step);
  31290. onchange?.(value);
  31291. }
  31292. }
  31293. onincrease?.();
  31294. };
  31295. </script>
  31296. <div
  31297. class="inline-flex items-center bg-gray-100 dark:bg-gray-800 {roundObj[radius] || 'rounded-sm'} {padding
  31298. ? 'p-1'
  31299. : 'p-0'} overflow-hidden {injClassOut} {vertical ? 'flex-col-reverse' : 'flex-row'}"
  31300. >
  31301. <button
  31302. onclick={decreaseFn}
  31303. class="{vertical ? 'w-full' : 'w-9'} h-9 {roundObj[radius] ||
  31304. 'rounded-sm'} flex flex-col items-center {injClassBtn} justify-center{numberHighlight
  31305. ? ''
  31306. : theme
  31307. ? ' bg-primary/5 dark:bg-dark/10'
  31308. : ' bg-white dark:bg-black'}"
  31309. disabled={async || value === min}
  31310. aria-label="decrease"
  31311. >
  31312. <span class={async || value === min ? 'opacity-20' : ''}>
  31313. <Icon name="ri-subtract-line" theme={theme && (numberHighlight ? false : true)} />
  31314. </span>
  31315. </button>
  31316. {#if async && asyncLoading}
  31317. <div class="h-9 px-2 {roundObj[radius] || 'rounded-sm'} flex flex-col items-center justify-center">
  31318. <Loading width="6" height="6" {...loading} />
  31319. </div>
  31320. {:else}
  31321. <div
  31322. class="h-9 px-4 {roundObj[radius] || 'rounded-sm'} flex flex-col items-center {injClassNum} justify-center{numberHighlight
  31323. ? theme
  31324. ? ' bg-primary/5 text-primary dark:bg-dark/10 dark:text-dark'
  31325. : ' bg-white dark:bg-black'
  31326. : ''}"
  31327. >
  31328. {value.toFixed(decimal)}
  31329. </div>
  31330. {/if}
  31331. <button
  31332. onclick={increaseFn}
  31333. class="{vertical ? 'w-full' : 'w-9'} h-9 {roundObj[radius] ||
  31334. 'rounded-sm'} flex flex-col items-center {injClassBtn} justify-center{numberHighlight
  31335. ? ''
  31336. : theme
  31337. ? ' bg-primary/5 dark:bg-dark/10'
  31338. : ' bg-white dark:bg-black'}"
  31339. aria-label="increase"
  31340. disabled={async || value === max}
  31341. >
  31342. <span class={async || value === max ? 'opacity-20' : ''}>
  31343. <Icon name="ri-add-line" theme={theme && (numberHighlight ? false : true)} />
  31344. </span>
  31345. </button>
  31346. </div>
  31347. ================================================
  31348. FILE: packages/stdf/src/lib/components/steps/Steps.svelte
  31349. ================================================
  31350. <script lang="ts">
  31351. import Icon from '../icon/Icon.svelte';
  31352. import type { StepsProps } from '../../types/index.js';
  31353. let { steps = [], current = 1, radius = 'sm', barBorder = true, vertical = false }: StepsProps = $props();
  31354. const radiusObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', full: 'rounded-full' };
  31355. let width = $state(0);
  31356. let heightList = $state<number[]>([]);
  31357. const getClientHeight = (node: HTMLElement) => {
  31358. heightList.push(node.clientHeight);
  31359. };
  31360. </script>
  31361. {#if vertical}
  31362. <div class="flex flex-col justify-between">
  31363. {#each steps as item, i}
  31364. <div class="relative flex items-center py-3" use:getClientHeight>
  31365. {#if item.step?.bar || item.finishStep?.bar}
  31366. <div class="my-4 mr-10 pl-4">
  31367. <div
  31368. class="absolute w-0.5 transition-all {i < current - 1 ? 'bg-primary dark:bg-dark' : 'bg-black/30 dark:bg-white/30'}"
  31369. style="height:{i === steps.length - 1 ? '0px' : heightList[i] - 30 + 'px'};top:42px;left:30px"
  31370. ></div>
  31371. <div
  31372. class="absolute box-border h-[30px] w-[30px] overflow-hidden border transition-all duration-300 {i < current - 1
  31373. ? 'border-primary dark:border-dark text-primary dark:text-dark'
  31374. : i === current - 1
  31375. ? 'border-primary dark:border-dark bg-primary dark:bg-dark text-white dark:text-black'
  31376. : 'border-black/30 text-black/30 dark:border-white/30 dark:text-white/30'} {radiusObj[radius] || radiusObj.sm} {!barBorder
  31377. ? '!border-transparent'
  31378. : ''}"
  31379. style="top:12px"
  31380. >
  31381. {#if item.step?.bar?.type === 'icon' || item.finishStep?.bar?.type === 'icon'}
  31382. <div class="m-auto h-4 w-4">
  31383. <Icon
  31384. {...item.step?.bar?.type === 'icon' ? item.step?.bar : {}}
  31385. name={item.finishStep && i < current && item.finishStep?.bar?.type === 'icon'
  31386. ? item.finishStep?.bar?.content?.name
  31387. : item.step?.bar?.type === 'icon'
  31388. ? item.step?.bar?.content?.name
  31389. : ''}
  31390. size={16}
  31391. top={0}
  31392. />
  31393. </div>
  31394. {/if}
  31395. {#if item.step?.bar?.type === 'image' || item.finishStep?.bar?.type === 'image'}
  31396. <img
  31397. class="object-cover"
  31398. src={item.step?.bar?.type === 'image'
  31399. ? item.step?.bar?.content || ''
  31400. : item.finishStep?.bar?.type === 'image'
  31401. ? item.finishStep?.bar?.content || ''
  31402. : ''}
  31403. alt=""
  31404. />
  31405. {/if}
  31406. {#if item.step?.bar?.type === 'string' || item.finishStep?.bar?.type === 'string'}
  31407. <div class="m-auto mt-1 h-5 w-5 text-center text-sm leading-5">
  31408. {(item.step?.bar?.type === 'string' && item.step?.bar?.content) ||
  31409. (item.finishStep?.bar?.type === 'string' && item.finishStep?.bar?.content)}
  31410. </div>
  31411. {/if}
  31412. </div>
  31413. </div>
  31414. {:else}
  31415. <div class="mr-6 pl-4">
  31416. <div
  31417. class="absolute w-0.5 transition-all {i < current - 1 ? 'bg-primary dark:bg-dark' : 'bg-black/30 dark:bg-white/30'}"
  31418. style="height:{i === steps.length - 1 ? '0px' : heightList[i] - 10 + 'px'};top:26px;left:20px"
  31419. ></div>
  31420. <div
  31421. class="absolute h-2.5 w-2.5 border transition-all duration-300 {i < current - 1
  31422. ? 'border-primary dark:border-dark'
  31423. : i === current - 1
  31424. ? 'border-primary dark:border-dark bg-primary dark:bg-dark'
  31425. : 'border-black/30 dark:border-white/30'} {radiusObj[radius] || radiusObj.sm}"
  31426. style="top:16px"
  31427. ></div>
  31428. </div>
  31429. {/if}
  31430. <div class="pr-4">
  31431. <div
  31432. class="font-medium transition-all duration-300 {i < current - 1
  31433. ? 'text-black dark:text-white'
  31434. : i === current - 1
  31435. ? 'text-primary dark:text-dark'
  31436. : 'text-black/30 dark:text-white/30'}"
  31437. >
  31438. {item.finishStep && i < current - 1 ? item.finishStep.title : item.step.title}
  31439. </div>
  31440. {#if item.step?.desc || item.finishStep?.desc}
  31441. <div class="text-xs transition-all duration-300{i <= current - 1 ? '' : ' text-black/30 dark:text-white/30'}">
  31442. {item.finishStep && i < current - 1
  31443. ? item.finishStep.desc
  31444. ? item.finishStep.desc
  31445. : ''
  31446. : item.step?.desc
  31447. ? item.step?.desc
  31448. : ''}
  31449. </div>
  31450. {/if}
  31451. {#if item.step?.injComponent || item.finishStep?.injComponent}
  31452. {@const SvelteComponent = item.step?.injComponent || item.finishStep?.injComponent}
  31453. <SvelteComponent />
  31454. {/if}
  31455. </div>
  31456. </div>
  31457. {/each}
  31458. </div>
  31459. {:else}
  31460. <div class="mt-4 flex justify-between" bind:clientWidth={width}>
  31461. {#each steps as item, i}
  31462. <div class="flex flex-1 flex-col items-center space-y-2">
  31463. {#if item.step?.bar || item.finishStep?.bar}
  31464. <div class="relative w-full pb-8">
  31465. <div
  31466. class="relative h-0.5 transition-all {i < current - 1 ? 'bg-primary dark:bg-dark' : 'bg-black/30 dark:bg-white/30'}"
  31467. style="top:16px;width:{i === steps.length - 1 ? '0' : width / steps.length - 30}px;left:calc(50% + 15px)"
  31468. ></div>
  31469. <div
  31470. class="absolute box-border h-[30px] w-[30px] overflow-hidden border transition-all duration-300 {i < current - 1
  31471. ? 'border-primary dark:border-dark text-primary dark:text-dark'
  31472. : i === current - 1
  31473. ? 'border-primary dark:border-dark bg-primary dark:bg-dark text-white dark:text-black'
  31474. : 'border-black/30 text-black/30 dark:border-white/30 dark:text-white/30'} {radiusObj[radius] || radiusObj.sm} {!barBorder
  31475. ? '!border-transparent'
  31476. : ''}"
  31477. style="left:calc(50% - 15px)"
  31478. >
  31479. {#if item.step?.bar?.type === 'icon' || item.finishStep?.bar?.type === 'icon'}
  31480. <div class="m-auto h-4 w-4">
  31481. <Icon
  31482. {...item.step?.bar?.type === 'icon' ? item.step?.bar : {}}
  31483. name={item.finishStep && i < current && item.finishStep?.bar?.type === 'icon'
  31484. ? item.finishStep?.bar?.content?.name
  31485. : item.step?.bar?.type === 'icon'
  31486. ? item.step?.bar?.content?.name
  31487. : ''}
  31488. size={16}
  31489. top={0}
  31490. />
  31491. </div>
  31492. {/if}
  31493. {#if item.step?.bar?.type === 'image' || item.finishStep?.bar?.type === 'image'}
  31494. <img
  31495. class=" object-cover"
  31496. src={item.step?.bar?.type === 'image'
  31497. ? item.step?.bar?.content || ''
  31498. : item.finishStep?.bar?.type === 'image'
  31499. ? item.finishStep?.bar?.content || ''
  31500. : ''}
  31501. alt=""
  31502. />
  31503. {/if}
  31504. {#if item.step?.bar?.type === 'string' || item.finishStep?.bar?.type === 'string'}
  31505. <div class="m-auto mt-1 h-5 w-5 text-center text-sm leading-5">
  31506. {(item.step?.bar?.type === 'string' && item.step?.bar?.content) ||
  31507. (item.finishStep?.bar?.type === 'string' && item.finishStep?.bar?.content)}
  31508. </div>
  31509. {/if}
  31510. </div>
  31511. </div>
  31512. {:else}
  31513. <div class="relative w-full py-2">
  31514. <div
  31515. class="relative h-0.5 transition-all {i < current - 1 ? 'bg-primary dark:bg-dark' : 'bg-black/30 dark:bg-white/30'} {i ===
  31516. steps.length - 1
  31517. ? 'w-px'
  31518. : ''}"
  31519. style="width:{i === steps.length - 1 ? '0' : width / steps.length - 9}px;top:0;left:calc(50% + 5px)"
  31520. ></div>
  31521. <div
  31522. class="absolute top-1 h-2.5 w-2.5 border transition-all duration-300 {i < current - 1
  31523. ? 'border-primary dark:border-dark'
  31524. : i === current - 1
  31525. ? 'border-primary dark:border-dark bg-primary dark:bg-dark'
  31526. : 'border-black/30 dark:border-white/30'} {radiusObj[radius] || radiusObj.sm}"
  31527. style="left:calc(50% - 5px)"
  31528. ></div>
  31529. </div>
  31530. {/if}
  31531. <div
  31532. class="text-center text-sm font-medium transition-all duration-300 {i < current - 1
  31533. ? 'text-black dark:text-white'
  31534. : i === current - 1
  31535. ? 'text-primary dark:text-dark'
  31536. : 'text-black/30 dark:text-white/30'}"
  31537. >
  31538. {item.finishStep && i < current - 1 ? item.finishStep.title : item.step?.title}
  31539. </div>
  31540. </div>
  31541. {/each}
  31542. </div>
  31543. {/if}
  31544. ================================================
  31545. FILE: packages/stdf/src/lib/components/swiper/Swiper.svelte
  31546. ================================================
  31547. <script lang="ts">
  31548. import { onMount } from 'svelte';
  31549. import type { SwiperProps, SwiperImgProps, SwiperComponentProps } from '../../types/index.js';
  31550. let {
  31551. data = [],
  31552. interval = 4,
  31553. duration = 1000,
  31554. autoplay = true,
  31555. lazyplay = true,
  31556. initActive = 0,
  31557. indicatePosition = 'inner',
  31558. indicateAlign = 'center',
  31559. indicateStyle = 'pointLine',
  31560. indicateRadius = true,
  31561. indicateInjClass = '',
  31562. indicateColor = '',
  31563. indicateActiveColor = '',
  31564. aspectRatio = [16, 9],
  31565. containerWidth = 0,
  31566. px = '0',
  31567. py = '0',
  31568. translateX = 0,
  31569. translateZ = 0,
  31570. rotateX = 0,
  31571. rotateY = 0,
  31572. rotateZ = 0,
  31573. activeInjClass = '',
  31574. notActiveInjClass = '',
  31575. radius = 'none',
  31576. innerInjClass = '',
  31577. triggerLong = 30,
  31578. notTriggerLong = 10,
  31579. triggerSpeed = 0.5,
  31580. onchange,
  31581. onclick
  31582. }: SwiperProps = $props();
  31583. let width = containerWidth === 0 ? document.body.clientWidth : containerWidth; //宽度 width
  31584. let active = $state(data.length > 1 ? initActive + 1 : 1); //当前激活的 item current active item
  31585. let currentIndicate = $state(data.length > 1 ? initActive : 0); //当前激活的指示器 current active indicate
  31586. let longTransition = $state(true); //长线指示器过渡 long line indicate transition
  31587. let long = $state(false); //长线指示器是否较长状态 long line indicate is long
  31588. let once = $state(true); //是否是第首次轮播,处理轮播间隔与过渡时间的差异 is first time play, handle interval and duration difference
  31589. let translateXTransition = $state(true); //是否进行过渡动画 is transition animation
  31590. let initialState = true; //是否是初始状态 is initial state
  31591. let startX = 0; //滑动开始 X 坐标 when start touch x position
  31592. let moveX = $state(0); //滑动移动 X 坐标 when move touch x position
  31593. let startTime = 0; //滑动开始时间 when start touch time
  31594. let endTime = 0; //滑动结束时间 when end touch time
  31595. let isMove = false; //是否滑动 is touch move
  31596. // let transition = true;
  31597. let swiperDom = $state<HTMLElement | null>(null); //Swiper 容器
  31598. let movePercent = $derived(moveX / width); //滑动距离占总宽度的百分比 touch width percent
  31599. //实现无限轮播,复制一个新数组,防止改变原数组
  31600. // implement infinite loop, copy a new array to prevent change original array
  31601. const dataNew: (SwiperComponentProps | SwiperImgProps)[] =
  31602. data.length > 1
  31603. ? [data[data.length - 1], ...data, data[0], data[1]]
  31604. : data.length === 1
  31605. ? [data[data.length - 1], ...data, data[0]]
  31606. : data;
  31607. const indicateAlignObj = { left: 'justify-start', center: 'justify-center', right: 'justify-end' };
  31608. const pxObj = { '0': '', '1': 'px-1', '2': 'px-2', '4': 'px-4', '6': 'px-6', '8': 'px-8', '12': 'px-12', '16': 'px-16', '24': 'px-24' };
  31609. const pyObj = { '0': '', '1': 'py-1', '2': 'py-2', '4': 'py-4', '6': 'py-6', '8': 'py-8', '12': 'py-12' };
  31610. const radiusObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', '2xl': 'rounded-2xl', full: 'rounded-full' };
  31611. //根据 indicateStyle 和是否激活生成不同样式的 indicate
  31612. //generate different style indicate according to indicateStyle and isActive
  31613. const indicateStyleInnerFun = (indicateStyle: string, isActive: boolean, indicateColor: string, indicateActiveColor: string) => {
  31614. switch (indicateStyle) {
  31615. case 'point':
  31616. return isActive
  31617. ? `w-1.5 h-1.5 ${indicateActiveColor === '' ? 'bg-white' : indicateActiveColor}`
  31618. : `w-1.5 h-1.5 ${indicateColor === '' ? 'bg-white/40' : indicateColor}`;
  31619. case 'line':
  31620. return isActive
  31621. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-white' : indicateActiveColor}`
  31622. : `w-6 h-1 ${indicateColor === '' ? 'bg-white/40' : indicateColor}`;
  31623. case 'pointLine':
  31624. return isActive
  31625. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-white' : indicateActiveColor}`
  31626. : `w-1 h-1 ${indicateColor === '' ? 'bg-white' : indicateColor}`;
  31627. case 'longLine':
  31628. return isActive
  31629. ? `w-16 h-1 ${indicateColor === '' ? 'bg-white/40' : indicateColor}`
  31630. : `w-1 h-1 ${indicateColor === '' ? 'bg-white/40' : indicateColor}`;
  31631. default:
  31632. console.log('传入的 indicateStyle 不在备选参数之内,将使用默认值!');
  31633. return isActive
  31634. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-white' : indicateActiveColor}`
  31635. : `w-1 h-1 ${indicateColor === '' ? 'bg-white' : indicateColor}`;
  31636. }
  31637. };
  31638. const indicateStyleOutFun = (indicateStyle: string, isActive: boolean, indicateColor: string, indicateActiveColor: string) => {
  31639. switch (indicateStyle) {
  31640. case 'point':
  31641. return isActive
  31642. ? `w-1.5 h-1.5 ${indicateActiveColor === '' ? 'bg-primary dark:bg-dark' : indicateActiveColor}`
  31643. : `w-1.5 h-1.5 ${indicateColor === '' ? 'bg-black/20 dark:bg-white/40' : indicateColor}`;
  31644. case 'line':
  31645. return isActive
  31646. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-primary dark:bg-dark' : indicateActiveColor}`
  31647. : `w-6 h-1 ${indicateColor === '' ? 'bg-black/20 dark:bg-white/40' : indicateColor}`;
  31648. case 'pointLine':
  31649. return isActive
  31650. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-primary dark:bg-dark' : indicateActiveColor}`
  31651. : `w-1 h-1 ${indicateColor === '' ? 'bg-primary dark:bg-dark' : indicateColor}`;
  31652. case 'longLine':
  31653. return isActive
  31654. ? `w-16 h-1 ${indicateColor === '' ? 'bg-black/5 dark:bg-white/10' : indicateColor}`
  31655. : `w-1 h-1 ${indicateColor === '' ? 'bg-black/20 dark:bg-white/40' : indicateColor}`;
  31656. default:
  31657. console.log('传入的 indicateStyle 不在备选参数之内,将使用默认值!');
  31658. return isActive
  31659. ? `w-6 h-1 ${indicateActiveColor === '' ? 'bg-primary dark:bg-dark' : indicateActiveColor}`
  31660. : `w-1 h-1 ${indicateColor === '' ? 'bg-primary dark:bg-dark' : indicateColor}`;
  31661. }
  31662. };
  31663. //对需要处理的偏移与旋转数值进行处理
  31664. //process the offset and rotate value that need to be processed
  31665. const translateXFun = (i: number, active: number, translateX: number) => {
  31666. if (i === active) {
  31667. return '0px';
  31668. }
  31669. if (i < active) {
  31670. return `${translateX}px`;
  31671. }
  31672. if (i > active) {
  31673. return `${-translateX}px`;
  31674. }
  31675. };
  31676. const translateZFun = (i: number, active: number, translateZ: number, movePercent: number) =>
  31677. i === active
  31678. ? `${0 - Math.abs(translateZ * (isMove ? movePercent : 0))}px`
  31679. : `${-translateZ + Math.abs(translateZ * (isMove ? movePercent : 0))}px`;
  31680. const rotateXFun = (i: number, active: number, rotateX: number, movePercent: number) => {
  31681. if (i === active) {
  31682. return `${-rotateX * (isMove ? movePercent : 0)}deg`;
  31683. }
  31684. if (i < active) {
  31685. return `${rotateX - rotateX * (isMove ? movePercent : 0)}deg`;
  31686. }
  31687. if (i > active) {
  31688. return `${-rotateX - rotateX * (isMove ? movePercent : 0)}deg`;
  31689. }
  31690. };
  31691. const rotateYFun = (i: number, active: number, rotateY: number, movePercent: number) => {
  31692. if (i === active) {
  31693. return `${-rotateY * (isMove ? movePercent : 0)}deg`;
  31694. }
  31695. if (i < active) {
  31696. return `${rotateY - rotateY * (isMove ? movePercent : 0)}deg`;
  31697. }
  31698. if (i > active) {
  31699. return `${-rotateY - rotateY * (isMove ? movePercent : 0)}deg`;
  31700. }
  31701. };
  31702. const rotateZFun = (i: number, active: number, rotateZ: number, movePercent: number) => {
  31703. if (i === active) {
  31704. return `${-rotateZ * (isMove ? movePercent : 0)}deg`;
  31705. }
  31706. if (i < active) {
  31707. return `${rotateZ - rotateZ * (isMove ? movePercent : 0)}deg`;
  31708. }
  31709. if (i > active) {
  31710. return `${-rotateZ - rotateZ * (isMove ? movePercent : 0)}deg`;
  31711. }
  31712. };
  31713. const zIndexFun = (i: number, active: number, dataNew: (SwiperComponentProps | SwiperImgProps)[]) => {
  31714. if (i === active) {
  31715. return i + 2;
  31716. }
  31717. if (i < active) {
  31718. return -(dataNew.length - i - 1) + dataNew.length;
  31719. }
  31720. if (i > active) {
  31721. return 2 * active - i + 2;
  31722. }
  31723. };
  31724. //定时器
  31725. // timer
  31726. let intervalTime: ReturnType<typeof setInterval>;
  31727. //定时器执行函数
  31728. // timer function
  31729. const intervalTimeFun = () => {
  31730. intervalTime = setInterval(() => {
  31731. once = false;
  31732. initialState = false;
  31733. active++;
  31734. currentIndicate++;
  31735. long = false;
  31736. longTransition = false;
  31737. setTimeout(() => {
  31738. long = autoplay;
  31739. longTransition = true;
  31740. }, duration);
  31741. if (active === dataNew.length - 2) {
  31742. //最后一个
  31743. // the last one
  31744. currentIndicate = 0;
  31745. setTimeout(() => {
  31746. // 切换动画完成后,关闭过渡动画,同时将展示的部分偷偷替换为最开始的样子。
  31747. // After the switching animation is completed, turn off the transition animation, and at the same time, the displayed part is secretly replaced with the original appearance.
  31748. active = 1;
  31749. // transition = false;
  31750. translateXTransition = false;
  31751. }, duration);
  31752. } else {
  31753. //开启过渡
  31754. // turn on transition
  31755. // transition = true;
  31756. translateXTransition = !initialState;
  31757. }
  31758. //派发 Swiper 容器 change 事件,i 表示当前容器索引值
  31759. // dispatch the Swiper container change event, i indicates the current container index value
  31760. onchange?.(currentIndicate);
  31761. }, interval * 1000);
  31762. };
  31763. //判断 Swiper 容器是否在可视区域内,如果在,则开启定时器,否则不开启定时器
  31764. // Determine whether the Swiper container is in the visible area. If it is, start the timer, otherwise do not start the timer
  31765. const io = new IntersectionObserver((entries) => {
  31766. entries.forEach((item) => {
  31767. // isIntersecting 是一个 Boolean 值,判断目标元素当前是否可见
  31768. // isIntersecting is a Boolean value that determines whether the target element is currently visible
  31769. if (item.isIntersecting) {
  31770. if (autoplay) {
  31771. if (intervalTime) {
  31772. clearInterval(intervalTime); //清除定时器 clear timer
  31773. }
  31774. intervalTimeFun();
  31775. }
  31776. } else {
  31777. if (intervalTime) {
  31778. clearInterval(intervalTime); //清除定时器 clear timer
  31779. }
  31780. }
  31781. });
  31782. });
  31783. onMount(() => {
  31784. if (duration >= interval * 1000) {
  31785. console.log('间隔时间必须大于过渡时间');
  31786. return false;
  31787. }
  31788. // 加载完成后,通过定时器使 item 自动轮播。
  31789. // After loading, use the timer to make the item automatically rotate.
  31790. if (data.length < 2 || !autoplay) return false;
  31791. long = false;
  31792. longTransition = false;
  31793. setTimeout(() => {
  31794. long = autoplay;
  31795. longTransition = true;
  31796. }, 0);
  31797. //懒轮播
  31798. if (lazyplay) {
  31799. if (swiperDom) {
  31800. io.observe(swiperDom);
  31801. }
  31802. } else {
  31803. if (autoplay && intervalTime) {
  31804. clearInterval(intervalTime); //清除定时器 clear timer
  31805. intervalTimeFun();
  31806. }
  31807. }
  31808. return () => {
  31809. if (intervalTime) {
  31810. clearInterval(intervalTime); //清除定时器 clear timer
  31811. }
  31812. };
  31813. });
  31814. //点击事件
  31815. // click event
  31816. const clickImgFun = () => {
  31817. //派发 Swiper 容器点击事件,currentIndicate 表示点击的容器索引值
  31818. // dispatch the Swiper container click event, currentIndicate indicates the index value of the clicked container
  31819. onclick?.(currentIndicate);
  31820. };
  31821. //滑动开始
  31822. // slide start
  31823. const touchstartFun = (e: PointerEvent) => {
  31824. // 阻止默认事件
  31825. // prevent default event
  31826. e.preventDefault();
  31827. isMove = true;
  31828. startTime = new Date().getTime();
  31829. translateXTransition = false;
  31830. startX = e.clientX;
  31831. };
  31832. //滑动中
  31833. // slideing
  31834. const touchmoveFun = (e: PointerEvent) => {
  31835. if (!isMove) return false;
  31836. if (swiperDom) {
  31837. swiperDom.setPointerCapture(e.pointerId);
  31838. }
  31839. if (intervalTime) {
  31840. clearInterval(intervalTime); //清除定时器 clear timer
  31841. }
  31842. moveX = e.clientX - startX;
  31843. };
  31844. //滑动结束
  31845. // slide end
  31846. const touchendFun = () => {
  31847. endTime = new Date().getTime();
  31848. const moveXABS = Math.abs(moveX); //滑动距离,moveX 绝对值。slide distance, moveX absolute value
  31849. const timeLong = endTime - startTime; //滑动时间 slide time
  31850. const speed = moveXABS / timeLong; //滑动速度阈值 slide speed threshold
  31851. //滑动距离大于等于容器宽度 triggerLong/100 不用考虑滑动速度,都触发切换。
  31852. //滑动距离小于等于容器宽度 notTriggerLong/100,无论速度快慢都不触发切换。
  31853. //滑动距离大于容器宽度 notTriggerLong/100 且小于 triggerLong/100,需要判断滑动速度,用一个速度阈值来判断。阈值大于等于 triggerSpeed 切换,否则不切换。
  31854. // The sliding distance is greater than or equal to the container width triggerLong/100, and the sliding speed does not need to be considered, and the switching is triggered.
  31855. // The sliding distance is less than or equal to the container width notTriggerLong/100, and the switching is not triggered regardless of the speed.
  31856. // The sliding distance is greater than the container width notTriggerLong/100 and less than triggerLong/100, the sliding speed needs to be judged, and a speed threshold is used to judge. The threshold is greater than or equal to triggerSpeed to switch, otherwise it will not switch.
  31857. isMove = false;
  31858. translateXTransition = true;
  31859. long = false;
  31860. longTransition = false;
  31861. setTimeout(() => {
  31862. long = autoplay;
  31863. longTransition = true;
  31864. }, duration);
  31865. if (moveX <= -(width * (triggerLong / 100))) {
  31866. //左滑
  31867. // slide left
  31868. moveX = 0;
  31869. currentIndicate++;
  31870. active++;
  31871. if (active === dataNew.length - 2) {
  31872. //最后一个
  31873. // the last one
  31874. currentIndicate = 0;
  31875. setTimeout(() => {
  31876. // 切换动画完成后,关闭过渡动画,同时将展示的部分偷偷替换为最开始的样子。
  31877. // After the switching animation is completed, turn off the transition animation, and at the same time, replace the displayed part with the original appearance.
  31878. active = 1;
  31879. translateXTransition = false;
  31880. }, duration);
  31881. }
  31882. } else if (moveX >= width * (triggerLong / 100)) {
  31883. moveX = 0;
  31884. currentIndicate--;
  31885. active--;
  31886. if (active === 0) {
  31887. //第 0 个
  31888. // the first one
  31889. currentIndicate = dataNew.length - 4;
  31890. setTimeout(() => {
  31891. // 切换动画完成后,关闭过渡动画,同时将展示的部分偷偷替换为最开始的样子。
  31892. // After the switching animation is completed, turn off the transition animation, and at the same time, replace the displayed part with the original appearance.
  31893. active = dataNew.length - 3;
  31894. translateXTransition = false;
  31895. }, duration);
  31896. }
  31897. } else if (moveXABS > (notTriggerLong / 100) * width && moveXABS < width * (triggerLong / 100)) {
  31898. if (moveX < 0 && speed >= triggerSpeed) {
  31899. //左滑
  31900. // slide left
  31901. moveX = 0;
  31902. currentIndicate++;
  31903. active++;
  31904. if (active === dataNew.length - 2) {
  31905. //最后一个
  31906. // last one
  31907. currentIndicate = 0;
  31908. setTimeout(() => {
  31909. // 切换动画完成后,关闭过渡动画,同时将展示的部分偷偷替换为最开始的样子。
  31910. // After the switching animation is completed, turn off the transition animation, and at the same time, replace the displayed part with the original appearance.
  31911. active = 1;
  31912. translateXTransition = false;
  31913. }, duration);
  31914. }
  31915. } else if (moveX > 0 && speed >= triggerSpeed) {
  31916. //右滑
  31917. // slide right
  31918. moveX = 0;
  31919. currentIndicate--;
  31920. active--;
  31921. if (active === 0) {
  31922. //第 0 个
  31923. // the first one
  31924. currentIndicate = dataNew.length - 4;
  31925. setTimeout(() => {
  31926. // 切换动画完成后,关闭过渡动画,同时将展示的部分偷偷替换为最开始的样子。
  31927. // After the switching animation is completed, turn off the transition animation, and at the same time, replace the displayed part with the original appearance.
  31928. active = dataNew.length - 3;
  31929. translateXTransition = false;
  31930. }, duration);
  31931. }
  31932. } else {
  31933. moveX = 0;
  31934. }
  31935. } else {
  31936. moveX = 0;
  31937. }
  31938. if (autoplay) {
  31939. if (intervalTime) {
  31940. clearInterval(intervalTime); //清除定时器 clear timer
  31941. }
  31942. intervalTimeFun();
  31943. } else {
  31944. //派发 Swiper 容器 change 事件,i 表示当前容器索引值
  31945. // Dispatch the Swiper container change event, i indicates the current container index value
  31946. onchange?.(currentIndicate);
  31947. }
  31948. };
  31949. </script>
  31950. <div
  31951. bind:this={swiperDom}
  31952. onpointerdown={touchstartFun}
  31953. onpointermove={touchmoveFun}
  31954. onpointerup={touchendFun}
  31955. class="cursor-move touch-none"
  31956. >
  31957. <!-- 轮播容器 -->
  31958. <!-- Carousel container -->
  31959. <div class="relative overflow-hidden" style="width:{width}px;height:{(width * aspectRatio[1]) / aspectRatio[0]}px;perspective:{width}px;">
  31960. <!-- 通过循环 dataNew 渲染多个 item -->
  31961. <!-- Render multiple item through loop dataNew -->
  31962. {#each dataNew as item, i}
  31963. <div
  31964. class="absolute {pxObj[px] || ''} {pyObj[py] || ''} {translateXTransition ? 'transition-all' : 'transition-none'} {i === active
  31965. ? activeInjClass
  31966. : notActiveInjClass}"
  31967. style="width:{width}px;height:{(width * aspectRatio[1]) / aspectRatio[0]}px;left:{width * (i - active) +
  31968. moveX}px;transition-duration: {duration}ms;z-index:{zIndexFun(i, active, dataNew)};transform:translateX({translateXFun(
  31969. i,
  31970. active,
  31971. translateX
  31972. )}) translateZ({translateZFun(i, active, translateZ, movePercent)}) rotateX({rotateXFun(
  31973. i,
  31974. active,
  31975. rotateX,
  31976. movePercent
  31977. )}) rotateY({rotateYFun(i, active, rotateY, movePercent)}) rotateZ({rotateZFun(i, active, rotateZ, movePercent)});"
  31978. >
  31979. {#if item.type === 'img'}
  31980. <button type="button" onclick={clickImgFun} class="h-full w-full">
  31981. <img class="h-full w-full object-cover {radiusObj[radius] || ''} {innerInjClass}" src={item.url} alt="" />
  31982. </button>
  31983. {/if}
  31984. {#if item.type === 'component'}
  31985. <div class="h-full w-full {radiusObj[radius] || ''} {innerInjClass}">
  31986. <item.component />
  31987. </div>
  31988. {/if}
  31989. </div>
  31990. {/each}
  31991. <!-- 轮播指示器 (内部) -->
  31992. <!-- Carousel indicator (inner) -->
  31993. <div
  31994. class:hidden={data.length < 2 || indicatePosition === 'out' || indicatePosition === null}
  31995. class="absolute bottom-0 z-50 flex w-full space-x-2 bg-gradient-to-b from-black/0 to-black/40 px-4 pb-2 pt-4 {indicateInjClass} {indicateAlignObj[
  31996. indicateAlign
  31997. ] || indicateAlignObj.center}"
  31998. >
  31999. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  32000. {#each data as _, i}
  32001. <div
  32002. class="{indicateStyleInnerFun(indicateStyle, currentIndicate === i, indicateColor, indicateActiveColor)} {indicateRadius &&
  32003. 'rounded-full'} transition-all"
  32004. style="transition-duration: {duration}ms;"
  32005. >
  32006. {#if indicateStyle === 'longLine'}
  32007. <div
  32008. class="absolute h-1 transition-all {long ? 'ease-linear' : ''} {indicateRadius && 'rounded-full'} {long &&
  32009. currentIndicate === i
  32010. ? 'w-16'
  32011. : 'w-1'} {indicateActiveColor === '' ? 'bg-white' : indicateActiveColor}"
  32012. style={longTransition
  32013. ? `transition-duration: ${currentIndicate === 0 && once ? interval * 1000 : interval * 1000 - duration}ms`
  32014. : `transition-duration:${duration}ms`}
  32015. ></div>
  32016. {/if}
  32017. </div>
  32018. {/each}
  32019. </div>
  32020. </div>
  32021. <!-- 轮播指示器 (外部) -->
  32022. <!-- Carousel indicator (outer) -->
  32023. <div
  32024. class:hidden={data.length < 2 || indicatePosition === 'inner' || indicatePosition === null}
  32025. class="flex w-full space-x-2 px-4 py-3 {indicateAlignObj[indicateAlign] || indicateAlignObj.center} {indicateInjClass}"
  32026. >
  32027. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  32028. {#each data as _, i}
  32029. <div
  32030. class="{indicateStyleOutFun(indicateStyle, currentIndicate === i, indicateColor, indicateActiveColor)} {indicateRadius &&
  32031. 'rounded-full'} transition-all"
  32032. style="transition-duration: {duration}ms;"
  32033. >
  32034. {#if indicateStyle === 'longLine'}
  32035. <div
  32036. class="absolute h-1 transition-all {long ? 'ease-linear' : ''} {indicateRadius && 'rounded-full'} {long && currentIndicate === i
  32037. ? 'w-16'
  32038. : 'w-1'} {indicateActiveColor === '' ? 'bg-primary dark:bg-dark' : indicateActiveColor}"
  32039. style={longTransition
  32040. ? `transition-duration: ${currentIndicate === 0 && once ? interval * 1000 : interval * 1000 - duration}ms;`
  32041. : `transition-duration:${duration}ms`}
  32042. ></div>
  32043. {/if}
  32044. </div>
  32045. {/each}
  32046. </div>
  32047. </div>
  32048. ================================================
  32049. FILE: packages/stdf/src/lib/components/switch/Switch.svelte
  32050. ================================================
  32051. <script lang="ts">
  32052. import Loading from '../loading/Loading.svelte';
  32053. import type { SwitchProps } from '../../types/index.js';
  32054. let {
  32055. active = false,
  32056. radius = 'middle',
  32057. inside = null,
  32058. injClass = '',
  32059. disabled = false,
  32060. async = false,
  32061. loading = {},
  32062. trueChild,
  32063. falseChild,
  32064. onchange,
  32065. onclick
  32066. }: SwitchProps = $props();
  32067. // 是否处于纵向拉长状态 is in the vertical elongation state
  32068. let isLong = $state(false);
  32069. const radiusObj = { none: 'rounded-none', middle: 'rounded-sm', full: 'rounded-full' };
  32070. const setChangeFun = () => {
  32071. if (!disabled) {
  32072. if (!async) {
  32073. active = !active;
  32074. onchange?.(active);
  32075. }
  32076. onclick?.();
  32077. }
  32078. };
  32079. $effect(() => {
  32080. if (!disabled) {
  32081. active = active;
  32082. isLong = true;
  32083. setTimeout(() => {
  32084. isLong = false;
  32085. }, 150);
  32086. }
  32087. });
  32088. </script>
  32089. <button
  32090. onclick={setChangeFun}
  32091. class="relative flex h-6 w-12 justify-around transition-all duration-500 active:opacity-80 {radiusObj[radius] || radiusObj.middle} {active
  32092. ? `bg-primary dark:bg-dark ${injClass}`
  32093. : 'bg-black/10 dark:bg-white/20'} {disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}"
  32094. >
  32095. <div
  32096. class="absolute top-0.5 h-5 w-5 bg-white text-center text-xs leading-5 text-black/80 transition-all duration-300 dark:bg-black dark:text-white/90 {radiusObj[
  32097. radius
  32098. ] || radiusObj.middle}"
  32099. style="left:{active ? '1.625rem' : '0.125rem'};transform:{isLong ? 'scaleX(1.3)' : 'scaleX(1)'}"
  32100. >
  32101. {#if inside === 'state'}
  32102. <span class:hidden={!active}><div class="ml-2 mt-1 h-3 w-1 rounded-full bg-black/80 dark:bg-white/90"></div></span>
  32103. <span class:hidden={active}><div class="ml-1 mt-1 h-3 w-3 rounded-full border-2 border-black/80 dark:border-white/90"></div></span>
  32104. {:else if inside === 'loading'}
  32105. <div class="m-0.5">
  32106. <Loading width="full" height="full" {...loading} />
  32107. </div>
  32108. {:else if trueChild && falseChild}
  32109. <span class={active ? '' : 'hidden'}>{@render trueChild?.()}</span>
  32110. <span class={!active ? '' : 'hidden'}>{@render falseChild?.()}</span>
  32111. {:else if Array.isArray(inside) && inside.length === 2}
  32112. <span class={active ? '' : 'hidden'}>{inside[1]} </span>
  32113. <span class={!active ? '' : 'hidden'}>{inside[0]} </span>
  32114. {:else}{/if}
  32115. </div>
  32116. </button>
  32117. ================================================
  32118. FILE: packages/stdf/src/lib/components/tabBar/TabBar.svelte
  32119. ================================================
  32120. <script lang="ts">
  32121. import Icon from '../icon/Icon.svelte';
  32122. import type { TabBarProps } from '../../types/index.js';
  32123. let {
  32124. labels = [],
  32125. active = $bindable(0),
  32126. line = false,
  32127. lineW = 4,
  32128. love = false,
  32129. injClass = '',
  32130. tabInjClass = '',
  32131. activeTabInjClass = '',
  32132. activeInjClass = '',
  32133. onchange
  32134. }: TabBarProps = $props();
  32135. const clickFun = (i: number) => {
  32136. active = i;
  32137. onchange?.(active);
  32138. };
  32139. let tabW = $state(0);
  32140. let activeW = $derived(tabW / labels.length / lineW);
  32141. let activeLeft = $derived(active * (tabW / labels.length) + tabW / labels.length / 2 - activeW / 2);
  32142. </script>
  32143. <div bind:clientWidth={tabW} class="relative bg-white dark:bg-gray-800 {injClass}" style="padding-bottom: env(safe-area-inset-bottom);">
  32144. {#if line}
  32145. <div
  32146. class="bg-primary dark:bg-dark absolute bottom-px mx-auto h-[2px] rounded-full transition-all {activeInjClass}"
  32147. style="width: {lineW < 1 ? tabW / labels.length : activeW < 2 ? 2 : activeW}px;left: {lineW < 1
  32148. ? active * (tabW / labels.length)
  32149. : activeLeft}px;"
  32150. ></div>
  32151. {/if}
  32152. <div class="flex justify-between">
  32153. {#each labels as label, i}
  32154. <button
  32155. onclick={() => clickFun(i)}
  32156. class="flex flex-1 flex-col items-center justify-center py-1 text-center active:opacity-80 {i === active
  32157. ? 'text-primary dark:text-dark'
  32158. : 'text-black/80 dark:text-white/90'} {love ? 'text-lg' : 'text-sm'} {tabInjClass} {i === active && activeTabInjClass}"
  32159. >
  32160. {#if label.icon}
  32161. <div class:py-2={!label.text}>
  32162. <i class:hidden={i !== active}>
  32163. <Icon
  32164. {...label.icon}
  32165. name={label.activeIcon ? label.activeIcon.name : label.icon.name}
  32166. size={i === active
  32167. ? label.activeIcon?.size !== 'full' && label.activeIcon?.size
  32168. ? label.activeIcon.size * (love ? 1.2 : 1)
  32169. : label.icon.size !== 'full' && label.icon.size
  32170. ? label.icon.size * (love ? 1.2 : 1)
  32171. : undefined
  32172. : label.icon.size !== 'full' && label.icon.size
  32173. ? label.icon.size * (love ? 1.2 : 1)
  32174. : undefined}
  32175. top={0}
  32176. />
  32177. </i>
  32178. <i class:hidden={i === active}>
  32179. <Icon
  32180. {...label.icon}
  32181. name={label.icon.name}
  32182. size={i === active
  32183. ? label.activeIcon?.size !== 'full' && label.activeIcon?.size
  32184. ? label.activeIcon.size * (love ? 1.2 : 1)
  32185. : label.icon.size !== 'full' && label.icon.size
  32186. ? label.icon.size * (love ? 1.2 : 1)
  32187. : undefined
  32188. : label.icon.size !== 'full' && label.icon.size
  32189. ? label.icon.size * (love ? 1.2 : 1)
  32190. : undefined}
  32191. top={0}
  32192. />
  32193. </i>
  32194. </div>
  32195. {/if}
  32196. {#if label.text}
  32197. <div class="{label.icon ? 'mt-[2px]' : 'py-1 text-lg'} {i === active && !label.icon ? ' font-bold' : ''}">
  32198. {label.text}
  32199. </div>
  32200. {/if}
  32201. </button>
  32202. {/each}
  32203. </div>
  32204. </div>
  32205. ================================================
  32206. FILE: packages/stdf/src/lib/components/tabs/Tab.svelte
  32207. ================================================
  32208. <script lang="ts">
  32209. import Icon from '../icon/Icon.svelte';
  32210. import type { TabProps } from '../../types/index.js';
  32211. let {
  32212. labels = [],
  32213. active = $bindable(0),
  32214. lineType = false,
  32215. radius = 'sm',
  32216. duration = 'base',
  32217. layout = 'h',
  32218. love = false,
  32219. injClass = '',
  32220. tabInjClass = '',
  32221. activeTabInjClass = '',
  32222. activeInjClass = '',
  32223. mx = '2',
  32224. overflow = false,
  32225. showNum = 3,
  32226. autoScroll = true,
  32227. onclickTab
  32228. }: TabProps = $props();
  32229. const radiusObj = { none: 'rounded-none', sm: 'rounded-sm', xl: 'rounded-xl', full: 'rounded-full' };
  32230. const durationObj = { fast: 'duration-150', base: 'duration-300', slow: 'duration-500', slower: 'duration-1000' };
  32231. const mxClass = {
  32232. '0': 'mx-0',
  32233. '1': 'mx-1',
  32234. '2': 'mx-2',
  32235. '3': 'mx-3',
  32236. '4': 'mx-4',
  32237. '6': 'mx-6',
  32238. '8': 'mx-8',
  32239. '12': 'mx-12',
  32240. '16': 'mx-16',
  32241. '20': 'mx-20'
  32242. };
  32243. const clickTabFun = (i: number) => {
  32244. active = i;
  32245. onclickTab?.(i);
  32246. };
  32247. let tabW = $state(0);
  32248. let tabH = $state(0);
  32249. let activeW = $derived(layout === 'h' ? (tabW - 4) / labels.length : tabW - 4);
  32250. let activeH = $derived(layout === 'h' ? tabH - 4 : (tabH - 4) / labels.length);
  32251. let activeLeft = $derived(layout === 'h' ? 2 + active * ((tabW - 4) / labels.length) : 2);
  32252. let activeTop = $derived(layout === 'h' ? (lineType ? tabH - 2 : 2) : 2 + active * ((tabH - 4) / labels.length));
  32253. // 溢出模式下的变量
  32254. // variables in overflow mode
  32255. let ofTabW = $state(0);
  32256. let ofTabH = $state(0);
  32257. let itemW = $derived((ofTabW - 4) / (showNum + 0.5));
  32258. let ofActiveW = $derived((ofTabW - 4) / (showNum + 0.5));
  32259. let ofActiveH = $derived(ofTabH - 4);
  32260. let ofActiveLeft = $derived(2 + active * ((ofTabW - 4) / (showNum + 0.5)));
  32261. let ofDom = $state<HTMLDivElement | null>(null);
  32262. let showIndexs = $state(new Array(showNum + 1).fill(0).map((item, index) => index));
  32263. // 监听 active 变化,当 active 变化时,如果 active 不在可视区域内,则滚动 ofDom,使 active 显示在中间
  32264. // listen to the change of active, when active changes, if active is not in the visible area, scroll ofDom to make active display in the middle
  32265. $effect(() => {
  32266. if (ofDom && active !== undefined && autoScroll) {
  32267. // 如果 active >= showIndexs 的最后一个元素或 <= showIndexs 的第一个元素,则滚动 ofDom,滚动至 active*itemW
  32268. // If active >= the last element of showIndexs or <= the first element of showIndexs, scroll ofDom to active*itemW
  32269. if (active >= showIndexs[showIndexs.length - 1] || active <= showIndexs[0]) {
  32270. ofDom.scrollLeft = (active - 1) * itemW;
  32271. showIndexs = new Array(showNum + 1).fill(0).map((item, index) => index + active - 1);
  32272. }
  32273. }
  32274. });
  32275. </script>
  32276. {#if overflow && layout === 'h'}
  32277. <div
  32278. bind:clientWidth={ofTabW}
  32279. bind:clientHeight={ofTabH}
  32280. bind:this={ofDom}
  32281. class="{lineType ? '' : 'bg-black/5 dark:bg-white/10'} no-scrollbar relative overflow-auto scroll-smooth p-0.5 {radiusObj[radius] ||
  32282. radiusObj.sm} {mxClass[mx] || mxClass['2']} {injClass}"
  32283. >
  32284. {#if lineType}
  32285. <div class="absolute bottom-0 h-0.5 w-full bg-black/5 dark:bg-white/5" style="width: {itemW * labels.length}px"></div>
  32286. {/if}
  32287. <div
  32288. class="{lineType ? '' : 'dark:shadow-xs shadow-sm dark:shadow-white/10'} absolute transition-all {durationObj[duration] ||
  32289. durationObj.base} {radiusObj[radius] || radiusObj.sm} {lineType
  32290. ? 'bg-primary dark:bg-dark bottom-0'
  32291. : 'bg-white dark:bg-gray-950'} {activeInjClass}"
  32292. style="width: {ofActiveW}px;height: {lineType ? 2 : ofActiveH}px;left: {ofActiveLeft}px;"
  32293. ></div>
  32294. <div class="relative flex whitespace-nowrap" style="width: {itemW * labels.length + 2}px;">
  32295. {#each labels as label, i}
  32296. <button
  32297. class="flex shrink-0 justify-center overflow-hidden py-1 font-medium {love ? 'text-lg' : 'text-sm'} leading-6 {radiusObj[
  32298. radius
  32299. ] || radiusObj.sm} {tabInjClass} {i === active ? activeTabInjClass : ''}"
  32300. style="width: {itemW}px"
  32301. onclick={() => clickTabFun(i)}
  32302. >
  32303. {#if label.icon}
  32304. <div class="mr-0.5 {durationObj[duration] || durationObj.base}">
  32305. <Icon {...label.icon} />
  32306. </div>
  32307. {/if}
  32308. {#if label.text}
  32309. <div class="transition-all {durationObj[duration] || durationObj.base}">{label.text}</div>
  32310. {/if}
  32311. </button>
  32312. {/each}
  32313. </div>
  32314. </div>
  32315. {:else}
  32316. <div
  32317. bind:clientWidth={tabW}
  32318. bind:clientHeight={tabH}
  32319. class="{lineType && layout !== 'v' ? '' : 'bg-black/5 dark:bg-white/10'} relative p-0.5 {radiusObj[radius] || radiusObj.sm} {mxClass[
  32320. mx
  32321. ] || mxClass['2']} {injClass}"
  32322. >
  32323. {#if lineType && layout !== 'v'}
  32324. <div class="absolute bottom-0 h-0.5 w-full bg-black/5 dark:bg-white/5" style="width: {tabW - 4}px"></div>
  32325. {/if}
  32326. <div
  32327. class="{lineType && layout !== 'v' ? '' : 'dark:shadow-xs shadow-sm dark:shadow-white/10'} absolute transition-all {durationObj[
  32328. duration
  32329. ] || durationObj.base} {radiusObj[radius] || radiusObj.sm} {lineType && layout !== 'v'
  32330. ? 'bg-primary dark:bg-dark bottom-0'
  32331. : 'bg-white dark:bg-gray-950'} {activeInjClass}"
  32332. style="width: {activeW}px;height: {lineType && layout !== 'v' ? 2 : activeH}px;left: {activeLeft}px;top: {activeTop}px"
  32333. ></div>
  32334. <div class="relative {layout === 'h' ? 'flex justify-between' : 'whitespace-nowrap px-4'}">
  32335. {#each labels as label, i}
  32336. <button
  32337. class="flex flex-1 justify-center {layout === 'h' ? 'py-1' : 'py-2'} overflow-hidden font-medium {love
  32338. ? 'text-lg'
  32339. : 'text-sm'} leading-6 {radiusObj[radius] || radiusObj.sm} {tabInjClass} {i === active ? activeTabInjClass : ''}"
  32340. onclick={() => clickTabFun(i)}
  32341. >
  32342. {#if label.icon}
  32343. <div class="mr-0.5 {durationObj[duration] || durationObj.base}">
  32344. <Icon {...label.icon} />
  32345. </div>
  32346. {/if}
  32347. {#if label.text}
  32348. <div class="transition-all {durationObj[duration] || durationObj.base}">{label.text}</div>
  32349. {/if}
  32350. </button>
  32351. {/each}
  32352. </div>
  32353. </div>
  32354. {/if}
  32355. <style>
  32356. .no-scrollbar::-webkit-scrollbar {
  32357. display: none;
  32358. }
  32359. </style>
  32360. ================================================
  32361. FILE: packages/stdf/src/lib/components/tabs/TabContent.svelte
  32362. ================================================
  32363. <script lang="ts">
  32364. import type { TabContentProps } from '../../types/index.js';
  32365. let { show = true, children }: TabContentProps = $props();
  32366. </script>
  32367. <div class:hidden={!show} class="flex-1">
  32368. {@render children?.()}
  32369. </div>
  32370. ================================================
  32371. FILE: packages/stdf/src/lib/components/tabs/Tabs.svelte
  32372. ================================================
  32373. <script lang="ts">
  32374. import Tab from './Tab.svelte';
  32375. import type { TabsProps } from '../../types/index.js';
  32376. let { tab = {}, duration = 'base', position = 't', active = $bindable(0), transition = true, onchange, children }: TabsProps = $props();
  32377. const clickTabFun = (a: number) => {
  32378. active = a;
  32379. onchange?.(a);
  32380. };
  32381. let width = $state(window.innerWidth);
  32382. const durationObj = { fast: 'duration-150', base: 'duration-300', slow: 'duration-500', slower: 'duration-1000' };
  32383. </script>
  32384. {#if transition}
  32385. {#if position === 't'}
  32386. <Tab {active} {duration} {...tab} onclickTab={clickTabFun} />
  32387. <div class="overflow-hidden" bind:clientWidth={width}>
  32388. <div
  32389. class="relative flex transition-all {durationObj[duration] || durationObj.base}"
  32390. style="width: {(tab?.labels?.length ?? 0) * width}px;left: -{active * width}px"
  32391. >
  32392. {#if children}{@render children({ active })}{/if}
  32393. </div>
  32394. </div>
  32395. {/if}
  32396. {#if position === 'b'}
  32397. <div class="overflow-hidden" bind:clientWidth={width}>
  32398. <div
  32399. class="relative flex transition-all {durationObj[duration] || durationObj.base}"
  32400. style="width: {(tab?.labels?.length ?? 0) * width}px;left: -{active * width}px"
  32401. >
  32402. {#if children}{@render children({ active })}{/if}
  32403. </div>
  32404. </div>
  32405. <Tab {active} {...tab} onclickTab={clickTabFun} />
  32406. {/if}
  32407. {#if position === 'l'}
  32408. <div class="flex">
  32409. <div>
  32410. <Tab {active} {...tab} onclickTab={clickTabFun} layout="v" />
  32411. </div>
  32412. <div class="grow">
  32413. {#if children}{@render children({ active })}{/if}
  32414. </div>
  32415. </div>
  32416. {/if}
  32417. {#if position === 'r'}
  32418. <div class="flex">
  32419. <div class="grow">
  32420. {#if children}{@render children({ active })}{/if}
  32421. </div>
  32422. <div>
  32423. <Tab {active} {...tab} onclickTab={clickTabFun} layout="v" />
  32424. </div>
  32425. </div>
  32426. {/if}
  32427. {:else}
  32428. {#if position === 't'}
  32429. <Tab {active} {duration} {...tab} onclickTab={clickTabFun} />
  32430. {#if children}{@render children({ active })}{/if}
  32431. {/if}
  32432. {#if position === 'b'}
  32433. {#if children}{@render children({ active })}{/if}
  32434. <Tab {active} {...tab} onclickTab={clickTabFun} />
  32435. {/if}
  32436. {#if position === 'l'}
  32437. <div class="flex">
  32438. <div>
  32439. <Tab {active} {...tab} onclickTab={clickTabFun} layout="v" />
  32440. </div>
  32441. <div class="grow">
  32442. {#if children}{@render children({ active })}{/if}
  32443. </div>
  32444. </div>
  32445. {/if}
  32446. {#if position === 'r'}
  32447. <div class="flex">
  32448. <div class="grow">
  32449. {#if children}{@render children({ active })}{/if}
  32450. </div>
  32451. <div>
  32452. <Tab {active} {...tab} onclickTab={clickTabFun} layout="v" />
  32453. </div>
  32454. </div>
  32455. {/if}
  32456. {/if}
  32457. ================================================
  32458. FILE: packages/stdf/src/lib/components/timePicker/TimePicker.svelte
  32459. ================================================
  32460. <script lang="ts">
  32461. import { getContext } from 'svelte';
  32462. import Popup from '../popup/Popup.svelte';
  32463. import ScrollRadio from '../scrollRadio/ScrollRadio.svelte';
  32464. import { getDayNum } from '../utils/index.js';
  32465. import { zh_CN, type LangProps } from '../../lang/index.js';
  32466. import type { TimePickerProps, TimePickerObjProps } from '../../types/index.js';
  32467. // 当前语言
  32468. // current language
  32469. const currentLang = (getContext('STDF_lang') || zh_CN) as LangProps;
  32470. const timePickerLang: LangProps['timePicker'] = currentLang.timePicker;
  32471. let {
  32472. visible = $bindable(false),
  32473. type = 'YYYYMMDDhhmmss',
  32474. yearProps = {},
  32475. monthProps = {},
  32476. dayProps = {},
  32477. hourProps = {},
  32478. minuteProps = {},
  32479. secondProps = {},
  32480. initYear = '',
  32481. initMonth = '',
  32482. initDay = '',
  32483. initHour = '',
  32484. initMinute = '',
  32485. initSecond = '',
  32486. minuteStep = 1,
  32487. secondStep = 1,
  32488. yearRange = [],
  32489. monthRange = [1, 12],
  32490. hourRange = [0, 23],
  32491. minuteRange = [0, 59],
  32492. secondRange = [0, 59],
  32493. showTips = true,
  32494. cancelText = timePickerLang.defaultCancel,
  32495. confirmText = timePickerLang.defaultConfirm,
  32496. title = timePickerLang.defaultTitle,
  32497. yearText = timePickerLang.defaultYear,
  32498. monthText = timePickerLang.defaultMonth,
  32499. dayText = timePickerLang.defaultDay,
  32500. hourText = timePickerLang.defaultHour,
  32501. minuteText = timePickerLang.defaultMinute,
  32502. secondText = timePickerLang.defaultSecond,
  32503. outFormat = '',
  32504. popup = {},
  32505. onclose,
  32506. onconfirm,
  32507. oncancel
  32508. }: TimePickerProps = $props();
  32509. // 获取当前时间,取出对应的年月日时分秒,转成字符,月、日、时、分、秒小于 10 的前面补 0
  32510. // Get the current time, take out the corresponding year, month, day, hour, minute, and second, convert to a character, and add 0 to the front of month, day, hour, minute, and second less than 10
  32511. const now = new Date();
  32512. const currentYear = now.getFullYear().toString();
  32513. const currentMonth = (now.getMonth() + 1 < 10 ? '0' + (now.getMonth() + 1) : now.getMonth() + 1).toString();
  32514. const currentDay = (now.getDate() < 10 ? '0' + now.getDate() : now.getDate()).toString();
  32515. const currentHour = (now.getHours() < 10 ? '0' + now.getHours() : now.getHours()).toString();
  32516. const currentMinute = (now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()).toString();
  32517. const currentSecond = (now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()).toString();
  32518. // 总共可以传入 13 种 type,做一个映射,方便后面使用
  32519. // A total of 13 types can be passed in, do a mapping, and it is convenient to use later
  32520. const typeMap = {
  32521. YYYY: 'YYYY',
  32522. MM: 'MM',
  32523. hh: 'hh',
  32524. mm: 'mm',
  32525. ss: 'ss',
  32526. YYYYMM: 'YYYYMM',
  32527. hhmm: 'hhmm',
  32528. mmss: 'mmss',
  32529. YYYYMMDD: 'YYYYMMDD',
  32530. hhmmss: 'hhmmss',
  32531. YYYYMMDDhh: 'YYYYMMDDhh',
  32532. YYYYMMDDhhmm: 'YYYYMMDDhhmm',
  32533. YYYYMMDDhhmmss: 'YYYYMMDDhhmmss'
  32534. };
  32535. // 定义 typeInner,对不在 typeMap 的 type 做一个过滤,不在 typeMap 的 type 设置为默认值 YMDhms
  32536. // Define typeInner, filter out types that are not in typeMap, and set types that are not in typeMap to the default value YMDhms
  32537. let typeInner = typeMap[type] || 'YYYYMMDDhhmmss';
  32538. // 如果 yearRange 长度为2且后一项大于前一项,表示限定区间,否则取当前年的的前后 10 年
  32539. // If the length of yearRange is 2 and the second item is greater than the first item, it means that the range is limited, otherwise the previous and next 10 years of the current year are taken
  32540. let yearData = [];
  32541. if (yearRange.length === 2 && yearRange[1] > yearRange[0]) {
  32542. for (let i = yearRange[0]; i <= yearRange[1]; i++) {
  32543. yearData.push({ label: i.toString() });
  32544. }
  32545. } else {
  32546. for (let i = now.getFullYear() - 10; i <= now.getFullYear() + 10; i++) {
  32547. yearData.push({ label: i.toString() });
  32548. }
  32549. }
  32550. // 月份列数据,固定 12 个月,如果有限定区间
  32551. // Month column data, fixed 12 months, if there is a limited range, it needs to be judged according to the year
  32552. const baseMonthData: { label: string }[] = [];
  32553. if (monthRange.length === 2 && monthRange[1] > monthRange[0] && monthRange[0] >= 1 && monthRange[1] <= 12) {
  32554. for (let i = monthRange[0]; i <= monthRange[1]; i++) {
  32555. baseMonthData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32556. }
  32557. } else {
  32558. for (let i = 1; i <= 12; i++) {
  32559. baseMonthData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32560. }
  32561. }
  32562. // 小时列数据,根据限定小时区间计算
  32563. // Hour column data, fixed 24 hours
  32564. const baseHourData: { label: string }[] = [];
  32565. if (hourRange.length === 2 && hourRange[1] > hourRange[0] && hourRange[0] >= 0 && hourRange[1] <= 23) {
  32566. for (let i = hourRange[0]; i <= hourRange[1]; i++) {
  32567. baseHourData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32568. }
  32569. } else {
  32570. for (let i = 0; i < 24; i++) {
  32571. baseHourData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32572. }
  32573. }
  32574. // 分钟列数据,根据限定分钟区间计算
  32575. // Minute column data, calculated according to the limited minute range
  32576. const baseMinuteData: { label: string }[] = [];
  32577. if (minuteRange.length === 2 && minuteRange[1] > minuteRange[0] && minuteRange[0] >= 0 && minuteRange[1] <= 59) {
  32578. for (let i = minuteRange[0]; i <= minuteRange[1]; i += minuteStep) {
  32579. baseMinuteData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32580. }
  32581. } else {
  32582. for (let i = 0; i < 60; i += minuteStep) {
  32583. baseMinuteData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32584. }
  32585. }
  32586. // 秒列数据,根据限定秒区间计算
  32587. // Second column data, calculated according to the limited second range
  32588. const baseSecondData: { label: string }[] = [];
  32589. if (secondRange.length === 2 && secondRange[1] > secondRange[0] && secondRange[0] >= 0 && secondRange[1] <= 59) {
  32590. for (let i = secondRange[0]; i <= secondRange[1]; i += secondStep) {
  32591. baseSecondData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32592. }
  32593. } else {
  32594. for (let i = 0; i < 60; i += secondStep) {
  32595. baseSecondData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32596. }
  32597. }
  32598. // 找出 yearProps、monthProps、dayProps、hourProps、minuteProps、secondProps 中 showRow 的最大值
  32599. // Find the maximum value of showRow in yearProps, monthProps, dayProps, hourProps, minuteProps, and secondProps
  32600. const showRowsArr: number[] = [];
  32601. showRowsArr.push(yearProps.showRow || 5);
  32602. showRowsArr.push(monthProps.showRow || 5);
  32603. showRowsArr.push(dayProps.showRow || 5);
  32604. showRowsArr.push(hourProps.showRow || 5);
  32605. showRowsArr.push(minuteProps.showRow || 5);
  32606. showRowsArr.push(secondProps.showRow || 5);
  32607. const maxShowRows = Math.max(...showRowsArr);
  32608. // 天数列数据
  32609. // Day column data
  32610. let baseDayData = $state<{ label: string }[]>([]);
  32611. // 根据当前年月初始一次天数列数据
  32612. // Initialize the day column data according to the current year and month
  32613. const tempDayData = [];
  32614. for (let i = 1; i <= getDayNum(currentYear, currentMonth); i++) {
  32615. tempDayData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32616. }
  32617. baseDayData = tempDayData;
  32618. // 初始时年份索引
  32619. // Initial year index
  32620. const initYearIndex =
  32621. initYear === ''
  32622. ? yearData.findIndex((item) => item.label === currentYear)
  32623. : yearData.findIndex((item) => item.label === initYear?.toString());
  32624. // 初始时月份索引
  32625. // Initial month index
  32626. const initMonthIndex =
  32627. initMonth === ''
  32628. ? baseMonthData.findIndex((item) => item.label === currentMonth)
  32629. : baseMonthData.findIndex((item) => item.label === initMonth.toString());
  32630. // 初始时天数索引
  32631. // Initial day index
  32632. let initDayIndex = $state(
  32633. initDay === ''
  32634. ? tempDayData.findIndex((item) => item.label === currentDay)
  32635. : tempDayData.findIndex((item) => item.label === initDay.toString())
  32636. );
  32637. // 初始时小时索引
  32638. // Initial hour index
  32639. const initHourIndex =
  32640. initHour === ''
  32641. ? baseHourData.findIndex((item) => item.label === currentHour)
  32642. : baseHourData.findIndex((item) => item.label === initHour.toString());
  32643. // 初始时分钟索引
  32644. // Initial minute index
  32645. const initMinuteIndex =
  32646. initMinute === ''
  32647. ? baseMinuteData.findIndex((item) => item.label === currentMinute)
  32648. : baseMinuteData.findIndex((item) => item.label === initMinute.toString());
  32649. // 初始时秒索引
  32650. // Initial second index
  32651. const initSecondIndex =
  32652. initSecond === ''
  32653. ? baseSecondData.findIndex((item) => item.label === currentSecond)
  32654. : baseSecondData.findIndex((item) => item.label === initSecond.toString());
  32655. // 年月日时分秒初始索引
  32656. // Year, month, day, hour, minute, second initial index
  32657. let yearIndex = 0;
  32658. let monthIndex = 0;
  32659. let dayIndex = 0;
  32660. let hourIndex = 0;
  32661. let minuteIndex = 0;
  32662. let secondIndex = 0;
  32663. // 根据年份和月份获取对应的天数,更新 baseDayData
  32664. // Get the number of days corresponding to the year and month according to the year and month, and update baseDayData
  32665. const updateDayDataFunc = (dayNum: number) => {
  32666. baseDayData = [];
  32667. for (let i = 1; i <= dayNum; i++) {
  32668. baseDayData.push({ label: (i < 10 ? '0' + i : i).toString() });
  32669. }
  32670. };
  32671. // 初始一下生成天数数据
  32672. // Generate day data initially
  32673. updateDayDataFunc(getDayNum(yearData[yearIndex].label, baseMonthData[monthIndex].label));
  32674. // 年数据滚动结束时的回调函数
  32675. // Callback function when the year data scrolling ends
  32676. const scrollEndYearFunc = (index: number, isTouch: boolean) => {
  32677. yearIndex = index;
  32678. // 如果月份是 2 月,需要重新计算天数
  32679. // If the month is February, the number of days needs to be recalculated
  32680. if (isTouch && baseMonthData[monthIndex].label === '02') {
  32681. baseDayData = [];
  32682. initDayIndex = 0;
  32683. setTimeout(() => {
  32684. updateDayDataFunc(getDayNum(yearData[yearIndex].label, baseMonthData[monthIndex].label));
  32685. });
  32686. }
  32687. };
  32688. // 月数据滚动结束时的回调函数
  32689. // Callback function when the month data scrolling ends
  32690. const scrollEndMonthFunc = (index: number, isTouch: boolean) => {
  32691. monthIndex = index;
  32692. // 根据年份和月份获取对应的天数
  32693. // Get the number of days corresponding to the year and month according to the year and month
  32694. if (isTouch) {
  32695. baseDayData = [];
  32696. initDayIndex = 0;
  32697. setTimeout(() => {
  32698. updateDayDataFunc(getDayNum(yearData[yearIndex].label, baseMonthData[monthIndex].label));
  32699. });
  32700. }
  32701. };
  32702. // 点击取消按钮的回调函数
  32703. // Callback function when clicking the cancel button
  32704. const clickCancelFunc = () => {
  32705. visible = false;
  32706. oncancel?.();
  32707. onclose?.();
  32708. };
  32709. // 传入时间格式与时间对象,返回时间字符串
  32710. // Pass in the time format and time object, return the time string
  32711. const getTimeStr = (format: string, timeObj: TimePickerObjProps) => {
  32712. const { YYYY, MM, DD, hh, mm, ss } = timeObj;
  32713. const timeStr = format.replace('YYYY', YYYY).replace('MM', MM).replace('DD', DD).replace('hh', hh).replace('mm', mm).replace('ss', ss);
  32714. return timeStr;
  32715. };
  32716. // 点击确定按钮的回调函数
  32717. // Callback function when clicking the confirm button
  32718. const clickConfirmFunc = () => {
  32719. visible = false;
  32720. onclose?.();
  32721. const outData: TimePickerObjProps = { YYYY: '', MM: '', DD: '', hh: '', mm: '', ss: '' };
  32722. if (typeInner.includes('YYYY')) {
  32723. outData.YYYY = yearData[yearIndex].label;
  32724. }
  32725. if (typeInner.includes('MM')) {
  32726. outData.MM = baseMonthData[monthIndex].label;
  32727. }
  32728. if (typeInner.includes('DD')) {
  32729. outData.DD = baseDayData[dayIndex].label;
  32730. }
  32731. if (typeInner.includes('hh')) {
  32732. outData.hh = baseHourData[hourIndex].label;
  32733. }
  32734. if (typeInner.includes('mm')) {
  32735. outData.mm = baseMinuteData[minuteIndex].label;
  32736. }
  32737. if (typeInner.includes('ss')) {
  32738. outData.ss = baseSecondData[secondIndex].label;
  32739. }
  32740. // 如果 outFormat 为空,则根据 type 格式
  32741. // If outFormat is empty, format according to type
  32742. if (outFormat === '') {
  32743. // 预先根据 typeInner 生成一份 defaultOutFormat 字符,年月日之间用 - 连接,时分秒之间用 : 连接,年月日和时分秒之间用空格连接
  32744. // Generate a copy of defaultOutFormat characters according to typeInner in advance, and connect the year, month and day with -, and connect the hour, minute and second with :, and connect the year, month, day and hour, minute and second with spaces
  32745. let defaultOutFormat = typeInner
  32746. .replace(/YYYY/g, 'YYYY-')
  32747. .replace(/MM/g, 'MM-')
  32748. .replace(/DD/g, 'DD ')
  32749. .replace(/hh/g, 'hh:')
  32750. .replace(/mm/g, 'mm:')
  32751. .replace(/ss/g, 'ss');
  32752. // 如果 defaultOutFormat 以 - 或 : 或空格 结尾,则去掉最后一个字符
  32753. // If defaultOutFormat ends with - or : or space, remove the last character
  32754. if (defaultOutFormat.endsWith('-') || defaultOutFormat.endsWith(':') || defaultOutFormat.endsWith(' ')) {
  32755. defaultOutFormat = defaultOutFormat.slice(0, -1);
  32756. }
  32757. onconfirm?.(getTimeStr(defaultOutFormat, outData), outData);
  32758. } else {
  32759. // 将 outFormat 里面 YYYY MM DD hh mm ss 替换为对应的 outData 中的值
  32760. // Replace YYYY MM DD hh mm ss in outFormat with the corresponding value in outData
  32761. const outFormatInner = outFormat
  32762. .replace(/YYYY/g, outData.YYYY)
  32763. .replace(/MM/g, outData.MM)
  32764. .replace(/DD/g, outData.DD)
  32765. .replace(/hh/g, outData.hh)
  32766. .replace(/mm/g, outData.mm)
  32767. .replace(/ss/g, outData.ss);
  32768. // 如果 outFormat 为空,则返回时间对象,否则返回时间字符串
  32769. // If outFormat is empty, return the time object, otherwise return the time string
  32770. onconfirm?.(getTimeStr(outFormatInner, outData), outData);
  32771. }
  32772. };
  32773. </script>
  32774. <Popup
  32775. bind:visible
  32776. size={0}
  32777. maskClosable
  32778. transitionDistance={(maxShowRows === 3 ? 64 : maxShowRows === 5 ? 48 : 32) * maxShowRows + 41 + (showTips ? 32 : 0)}
  32779. {...popup}
  32780. >
  32781. <div class="flex items-center justify-between border-b border-black/10 bg-white dark:border-white/20 dark:bg-black">
  32782. <button class="h-10 cursor-pointer px-4 leading-10 text-black/60 dark:text-white/60" onclick={clickCancelFunc}>{cancelText}</button>
  32783. <div>{title}</div>
  32784. <button class="text-primary dark:text-dark h-10 cursor-pointer px-4 leading-10" onclick={clickConfirmFunc}>{confirmText}</button>
  32785. </div>
  32786. {#if showTips}
  32787. <div
  32788. class="flex h-8 items-center justify-around gap-1 bg-white text-center text-sm leading-8 text-black/60 dark:bg-black dark:text-white/60"
  32789. >
  32790. {#if typeInner.includes('Y')}
  32791. <div class="px-2" style="flex:{yearProps.flex || '1'};text-align:{yearProps.align}">{yearText}</div>{/if}
  32792. {#if typeInner.includes('M')}
  32793. <div class="px-2" style="flex:{monthProps.flex || '1'};text-align:{monthProps.align}">{monthText}</div>{/if}
  32794. {#if typeInner.includes('D')}
  32795. <div class="px-2" style="flex:{dayProps.flex || '1'};text-align:{dayProps.align}">{dayText}</div>{/if}
  32796. {#if typeInner.includes('h')}
  32797. <div class="px-2" style="flex:{hourProps.flex || '1'};text-align:{hourProps.align}">{hourText}</div>{/if}
  32798. {#if typeInner.includes('m')}
  32799. <div class="px-2" style="flex:{minuteProps.flex || '1'};text-align:{minuteProps.align}">{minuteText}</div>{/if}
  32800. {#if typeInner.includes('s')}
  32801. <div class="px-2" style="flex:{secondProps.flex || '1'};text-align:{secondProps.align}">{secondText}</div>{/if}
  32802. </div>
  32803. {/if}
  32804. <div class="flex items-center justify-around gap-1 bg-white dark:bg-black">
  32805. {#if typeInner.includes('Y')}
  32806. <div class="truncate" style="flex:{yearProps.flex || '1'}">
  32807. <ScrollRadio data={yearData} initIndex={initYearIndex} autoScrollToLast={false} {...yearProps} onscrollEnd={scrollEndYearFunc} />
  32808. </div>
  32809. {/if}
  32810. {#if typeInner.includes('M')}
  32811. <div class="truncate" style="flex:{monthProps.flex || '1'}">
  32812. <ScrollRadio data={baseMonthData} lastSelectedIndex={initMonthIndex} {...monthProps} onscrollEnd={scrollEndMonthFunc} />
  32813. </div>
  32814. {/if}
  32815. {#if baseDayData.length > 0 && typeInner.includes('D')}
  32816. <div class="truncate" style="flex:{dayProps.flex || '1'}">
  32817. <ScrollRadio data={baseDayData} lastSelectedIndex={initDayIndex} {...dayProps} onscrollEnd={(index) => (dayIndex = index)} />
  32818. </div>
  32819. {/if}
  32820. {#if typeInner.includes('h')}
  32821. <div class="truncate" style="flex:{hourProps.flex || '1'}">
  32822. <ScrollRadio data={baseHourData} lastSelectedIndex={initHourIndex} {...hourProps} onscrollEnd={(index) => (hourIndex = index)} />
  32823. </div>
  32824. {/if}
  32825. {#if typeInner.includes('m')}
  32826. <div class="truncate" style="flex:{minuteProps.flex || '1'}">
  32827. <ScrollRadio
  32828. data={baseMinuteData}
  32829. lastSelectedIndex={initMinuteIndex}
  32830. {...minuteProps}
  32831. onscrollEnd={(index) => (minuteIndex = index)}
  32832. />
  32833. </div>
  32834. {/if}
  32835. {#if typeInner.includes('s')}
  32836. <div class="truncate" style="flex:{secondProps.flex || '1'}">
  32837. <ScrollRadio
  32838. data={baseSecondData}
  32839. lastSelectedIndex={initSecondIndex}
  32840. {...secondProps}
  32841. onscrollEnd={(index) => (secondIndex = index)}
  32842. />
  32843. </div>
  32844. {/if}
  32845. </div>
  32846. </Popup>
  32847. ================================================
  32848. FILE: packages/stdf/src/lib/components/toast/Toast.svelte
  32849. ================================================
  32850. <script lang="ts">
  32851. import Loading from '../loading/Loading.svelte';
  32852. import Icon from '../icon/Icon.svelte';
  32853. import Mask from '../mask/Mask.svelte';
  32854. import Transition from './Transition.svelte';
  32855. import type { ToastProps } from '../../types/index.js';
  32856. let {
  32857. message = '',
  32858. visible = $bindable(false),
  32859. duration = 2000,
  32860. position = 'center',
  32861. py = '0',
  32862. radius = 'sm',
  32863. transitionType = 'scale',
  32864. transitionParams = {},
  32865. outDuration = 0,
  32866. zIndex = 1000,
  32867. type = null,
  32868. mask = {},
  32869. loading = {},
  32870. icon = {},
  32871. clickable = false,
  32872. dynamicFixed = true,
  32873. children,
  32874. onclose
  32875. }: ToastProps = $props();
  32876. $effect(() => {
  32877. if (visible) {
  32878. if (duration === 0) {
  32879. //不自动关闭 not auto close
  32880. } else {
  32881. setTimeout(() => {
  32882. visible = false;
  32883. onclose?.();
  32884. }, duration);
  32885. }
  32886. }
  32887. });
  32888. const typeObj = { success: 'checkbox-circle', error: 'close-circle', warning: 'error-warning', info: 'information' };
  32889. const positionClass = { center: ' justify-center', top: ' justify-start', bottom: ' justify-end' };
  32890. const pyClass = { '0': ' py-0', '10': ' py-10', '20': ' py-20', '40': ' py-40', '60': ' py-60', '80': ' py-80' };
  32891. const radiusClass = {
  32892. sm: ' rounded-sm',
  32893. full: ' rounded-full',
  32894. none: ' rounded-none',
  32895. xs: ' rounded-xs',
  32896. md: ' rounded-md',
  32897. lg: ' rounded-lg',
  32898. xl: ' rounded-xl',
  32899. '2xl': ' rounded-2xl'
  32900. };
  32901. const typeColor = { success: 'text-success', error: 'text-error', warning: 'text-warning', info: 'text-info' };
  32902. //解决 Safari 和 Chrome 或其他浏览器滚动时工具栏隐藏与显示引发的窗口高度变化问题
  32903. // First we get the viewport height and we multiple it by 1% to get a value for a vh unit
  32904. // let vh = window.innerHeight * 0.01;
  32905. // // Then we set the value in the --vh custom property to the root of the document
  32906. // document.documentElement.style.setProperty('--vh', `${vh}px`);
  32907. // // We listen to the resize event
  32908. // window.addEventListener('resize', () => {
  32909. // // We execute the same script as before
  32910. // let vh = window.innerHeight * 0.01;
  32911. // document.documentElement.style.setProperty('--vh', `${vh}px`);
  32912. // });
  32913. let innerHeight = $state(0);
  32914. $effect(() => {
  32915. innerHeight = window.innerHeight;
  32916. });
  32917. if (dynamicFixed) {
  32918. //解决 Safari 和 Chrome 或其他浏览器滚动时工具栏隐藏与显示引发的窗口高度变化问题
  32919. // First we get the viewport height and we multiple it by 1% to get a value for a vh unit
  32920. window.addEventListener('resize', () => {
  32921. innerHeight = window.innerHeight;
  32922. });
  32923. }
  32924. </script>
  32925. {#if visible}
  32926. <Mask {visible} {clickable} opacity="0" {outDuration} {...mask} />
  32927. {/if}
  32928. {#if visible}
  32929. <div
  32930. class="fixed inset-0 flex h-screen w-screen flex-col{positionClass[position] || positionClass['center']}{position === 'center'
  32931. ? ''
  32932. : pyClass[py] || pyClass['20']} w-full h-full${clickable ? ' pointer-events-none' : ''}"
  32933. style="z-index:{zIndex};height:{innerHeight}px;"
  32934. >
  32935. <Transition {visible} {transitionType} {transitionParams} {outDuration}>
  32936. <div class="flex justify-center px-10">
  32937. <div
  32938. class="inline-block bg-black/90 text-center dark:bg-white/90 p-4{radiusClass[radius] ||
  32939. radiusClass.sm} text-white dark:text-black"
  32940. >
  32941. {#if children}
  32942. {@render children()}
  32943. {:else}
  32944. {#if type !== null}
  32945. <div class="mb-2">
  32946. {#if type === 'loading'}
  32947. <Loading inverse {...loading} />
  32948. {:else if type === 'icon'}
  32949. <Icon size={30} {...icon} />
  32950. {:else if type === 'success' || type === 'error' || type === 'warning' || type === 'info'}
  32951. <Icon name={`ri-${typeObj[type]}-line`} injClass={typeColor[type]} size={30} {...icon} />
  32952. {:else}{/if}
  32953. </div>
  32954. {/if}
  32955. <div>
  32956. {message}
  32957. </div>
  32958. {/if}
  32959. </div>
  32960. </div>
  32961. </Transition>
  32962. </div>
  32963. {/if}
  32964. ================================================
  32965. FILE: packages/stdf/src/lib/components/toast/Transition.svelte
  32966. ================================================
  32967. <script lang="ts">
  32968. import type { Snippet } from 'svelte';
  32969. import {
  32970. fade,
  32971. fly,
  32972. blur,
  32973. slide,
  32974. scale,
  32975. type ScaleParams,
  32976. type FlyParams,
  32977. type SlideParams,
  32978. type BlurParams,
  32979. type FadeParams
  32980. } from 'svelte/transition';
  32981. type Props = {
  32982. visible: boolean;
  32983. transitionType: 'scale' | 'fly' | 'slide' | 'blur' | 'fade' | null;
  32984. transitionParams: ScaleParams | FlyParams | SlideParams | BlurParams | FadeParams;
  32985. outDuration: number;
  32986. children: Snippet;
  32987. };
  32988. let { visible = false, transitionType = 'scale', transitionParams = {}, outDuration = 0, children }: Props = $props();
  32989. </script>
  32990. {#if visible}
  32991. {#if transitionType === 'scale'}
  32992. <div in:scale|global={{ duration: 300, ...transitionParams }} out:scale|global={{ ...transitionParams, duration: outDuration }}>
  32993. {@render children?.()}
  32994. </div>
  32995. {:else if transitionType === 'fly'}
  32996. <div in:fly|global={{ duration: 300, ...transitionParams }} out:fly|global={{ ...transitionParams, duration: outDuration }}>
  32997. {@render children?.()}
  32998. </div>
  32999. {:else if transitionType === 'fade'}
  33000. <div in:fade|global={{ duration: 300, ...transitionParams }} out:fade|global={{ ...transitionParams, duration: outDuration }}>
  33001. {@render children?.()}
  33002. </div>
  33003. {:else if transitionType === 'slide'}
  33004. <div in:slide|global={{ duration: 300, ...transitionParams }} out:slide|global={{ ...transitionParams, duration: outDuration }}>
  33005. {@render children?.()}
  33006. </div>
  33007. {:else if transitionType === 'blur'}
  33008. <div in:blur|global={{ duration: 300, ...transitionParams }} out:blur|global={{ ...transitionParams, duration: outDuration }}>
  33009. {@render children?.()}
  33010. </div>
  33011. {:else}
  33012. {@render children?.()}
  33013. {/if}
  33014. {/if}
  33015. ================================================
  33016. FILE: packages/stdf/src/lib/components/utils/index.ts
  33017. ================================================
  33018. /**
  33019. * 防抖
  33020. * debounce
  33021. * @example
  33022. * const fn = () => console.log('hello world');
  33023. * const debounceFn = debounce(fn, 1000);
  33024. */
  33025. export const debounce = <T extends (...args: unknown[]) => unknown>(fn: T, delay = 10): ((...args: Parameters<T>) => void) => {
  33026. let timer: ReturnType<typeof setTimeout> | null = null;
  33027. return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
  33028. if (timer) {
  33029. clearTimeout(timer);
  33030. }
  33031. timer = setTimeout(() => {
  33032. fn.apply(this, args);
  33033. timer = null;
  33034. }, delay);
  33035. };
  33036. };
  33037. /**
  33038. * 节流
  33039. * throttle
  33040. * @example
  33041. * const fn = () => console.log('hello world');
  33042. * const throttleFn = throttle(fn, 1000);
  33043. */
  33044. export const throttle = <T extends (...args: unknown[]) => unknown>(fn: T, delay = 50): ((...args: Parameters<T>) => void) => {
  33045. let timer: ReturnType<typeof setTimeout> | null = null;
  33046. return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
  33047. if (timer) {
  33048. return;
  33049. }
  33050. timer = setTimeout(() => {
  33051. fn.apply(this, args);
  33052. timer = null;
  33053. }, delay);
  33054. };
  33055. };
  33056. /**
  33057. * 节流
  33058. * throttle With requestAnimationFrame
  33059. * @example
  33060. * const fn = () => console.log('hello world');
  33061. * const throttleWithRAFFn = throttleWithRAF(fn, 1000);
  33062. */
  33063. export const throttleWithRAF = <T extends (e: PointerEvent) => void>(fn: T, delay = 16): ((...args: Parameters<T>) => void) => {
  33064. let timeoutId: ReturnType<typeof setTimeout> | undefined = undefined;
  33065. let rafId: number | undefined = undefined;
  33066. let lastExec = 0;
  33067. const throttledFn = function (this: unknown, ...args: Parameters<T>) {
  33068. const now = performance.now();
  33069. const remainingTime = delay - (now - lastExec);
  33070. if (rafId === undefined && timeoutId === undefined) {
  33071. // 如果没有 rafId 和 timeoutId,说明没有正在进行的动画帧或定时器
  33072. // If there is no rafId and timeoutId, it means there is no animation frame or timer in progress.
  33073. rafId = requestAnimationFrame(() => {
  33074. // 在动画帧开始时执行函数
  33075. // Executes a function at the beginning of an animation frame
  33076. fn.apply(this, args);
  33077. lastExec = performance.now();
  33078. rafId = undefined;
  33079. });
  33080. } else if (remainingTime <= 0) {
  33081. // 如果超过了延迟时间,取消当前的定时器,然后在下一个动画帧执行
  33082. // If the delay time is exceeded, cancel the current timer and execute it in the next animation frame.
  33083. clearTimeout(timeoutId);
  33084. timeoutId = undefined;
  33085. rafId = requestAnimationFrame(() => {
  33086. fn.apply(this, args);
  33087. lastExec = performance.now();
  33088. rafId = undefined;
  33089. });
  33090. } else {
  33091. // 如果还有剩余时间,设置定时器
  33092. // If there is time left, set the timer
  33093. clearTimeout(timeoutId);
  33094. timeoutId = setTimeout(() => {
  33095. rafId = requestAnimationFrame(() => {
  33096. fn.apply(this, args);
  33097. lastExec = performance.now();
  33098. rafId = undefined;
  33099. });
  33100. }, remainingTime);
  33101. }
  33102. };
  33103. throttledFn.clear = () => {
  33104. if (timeoutId !== null) {
  33105. clearTimeout(timeoutId);
  33106. timeoutId = undefined;
  33107. }
  33108. if (rafId !== undefined) {
  33109. cancelAnimationFrame(rafId);
  33110. rafId = undefined;
  33111. }
  33112. };
  33113. return throttledFn;
  33114. };
  33115. /**
  33116. * 将数字按照步长进行四舍五入
  33117. * Round the number according to the step length
  33118. * @example
  33119. * stepNumberFun(18, 5) // 20
  33120. */
  33121. export const stepNumberFun: (num: number, step?: number) => number = (num, step = 1) => {
  33122. //将 step 乘 10,转换为整数,避免小数计算精度问题
  33123. // Multiply step by 10, convert to integer, avoid decimal calculation precision problem
  33124. const stepNum = step * 10;
  33125. return (Math.round((num * 10) / stepNum) * stepNum) / 10;
  33126. };
  33127. /**
  33128. * 传入 Dom 和一段字符串,返回占页面的宽度
  33129. * Pass in Dom and a string, return the width occupied by the page
  33130. * @example
  33131. * getDomWidth(document.body, 'hello world') // 100
  33132. */
  33133. export const getDomWidth: (dom: HTMLElement, str: string) => number = (dom, str) => {
  33134. const span: HTMLSpanElement = document.createElement('span');
  33135. span.innerHTML = str;
  33136. span.style.visibility = 'hidden';
  33137. dom.appendChild(span);
  33138. const width = span.getBoundingClientRect().width;
  33139. dom.removeChild(span);
  33140. return width;
  33141. };
  33142. /**
  33143. * 根据年份和月份获取对应的天数
  33144. * Get the number of days corresponding to the year and month according to the year and month
  33145. * @example
  33146. * getDayNum('2020', '02') // 29
  33147. */
  33148. export const getDayNum: (year: string, month: string) => number = (year, month) => {
  33149. if (month === '02') {
  33150. return isLeapYear(Number(year)) ? 29 : 28;
  33151. } else if (month === '04' || month === '06' || month === '09' || month === '11') {
  33152. return 30;
  33153. } else {
  33154. return 31;
  33155. }
  33156. };
  33157. /**
  33158. * 是否是闰年
  33159. * Is it a leap year
  33160. * @example
  33161. * isLeapYear(2020) // true
  33162. */
  33163. export const isLeapYear: (year: number) => boolean = (year) => {
  33164. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  33165. };
  33166. /**
  33167. * 返回当前日期所处周的开始与结束日期组成的数组,日期格式为 YYYYMMDD
  33168. * return an array of start and end date of current week, date format is YYYYMMDD
  33169. * @example
  33170. * getWeekRange() // ['20200518', '20200524']
  33171. */
  33172. export const getWeekRange: () => string[] = () => {
  33173. const now = new Date();
  33174. const year = now.getFullYear();
  33175. const month = now.getMonth();
  33176. const day = now.getDate();
  33177. const week = now.getDay();
  33178. const start = new Date(year, month, day - week + 1);
  33179. const end = new Date(year, month, day + (7 - week));
  33180. return [start, end].map((date) => {
  33181. const year = date.getFullYear();
  33182. const month = date.getMonth() + 1;
  33183. const day = date.getDate();
  33184. return `${year}${month < 10 ? `0${month}` : month}${day < 10 ? `0${day}` : day}`;
  33185. });
  33186. };
  33187. /**
  33188. * 返回当前日期所处月的开始与结束日期组成的数组,日期格式为 YYYYMMDD
  33189. * return an array of start and end date of current month, date format is YYYYMMDD
  33190. * @returns {Array}
  33191. * @example
  33192. * getMonthRange() // ['20200501', '20200531']
  33193. */
  33194. export const getMonthRange: () => string[] = () => {
  33195. const now = new Date();
  33196. const year = now.getFullYear();
  33197. const month = now.getMonth();
  33198. const start = new Date(year, month, 1);
  33199. const end = new Date(year, month + 1, 0);
  33200. return [start, end].map((date) => {
  33201. const year = date.getFullYear();
  33202. const month = date.getMonth() + 1;
  33203. const day = date.getDate();
  33204. return `${year}${month < 10 ? `0${month}` : month}${day < 10 ? `0${day}` : day}`;
  33205. });
  33206. };
  33207. /**
  33208. * 传入年月数据 YYYYMM,返回开始日是周几
  33209. * Pass in year and month data YYYYMM, return the start day of the week
  33210. * @example
  33211. * getStartDay('202005') // 6
  33212. */
  33213. export const getStartDay: (yearMonth: string) => number = (yearMonth) => {
  33214. const year = yearMonth.slice(0, 4);
  33215. const month = yearMonth.slice(4);
  33216. return new Date(`${year}-${month}-01`).getDay();
  33217. };
  33218. /**
  33219. * 传入正数或者负数 n,返回当前月往前或者往后的 n 个月的年月数据,格式为 YYYYMM,不足两位的月份前面补 0
  33220. * Pass in a positive or negative number n, return the year and month data of the current month forward or backward n months, the format is YYYYMM, and the month less than two digits is filled with 0
  33221. * @example
  33222. * getYearMonth(1) // '202006'
  33223. */
  33224. export const getNowBeforeOrAfterMonth: (n: number) => string = (n) => {
  33225. const now = new Date();
  33226. const year = now.getFullYear();
  33227. const month = now.getMonth() + 1;
  33228. const newMonth = month + n;
  33229. if (newMonth > 12) {
  33230. return `${year + 1}${newMonth - 12 < 10 ? `0${newMonth - 12}` : newMonth - 12}`;
  33231. } else if (newMonth < 1) {
  33232. return `${year - 1}${newMonth + 12 < 10 ? `0${newMonth + 12}` : newMonth + 12}`;
  33233. } else {
  33234. return `${year}${newMonth < 10 ? `0${newMonth}` : newMonth}`;
  33235. }
  33236. };
  33237. /**
  33238. * 传入年月数据 YYYYMM,根据当月 1 日的周几,返回当月的日历数据数组。如果 startSunday 为 true 从周日开始,否则从周一开始,1 日之前的数据为空字符串,之后的数据为空字符串并去除
  33239. * Pass in year and month data YYYYMM, return the calendar data array according to the week of the first day of the month. If startSunday is true, start from Sunday, otherwise start from Monday. The data before 1 day is an empty string, and the data after 1 day is an empty string and is removed
  33240. * @example
  33241. * getCalendarData('202005') // ['','','','','','','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','']
  33242. */
  33243. export const getCalendarData: (yearMonth: string, startSunday?: boolean) => string[] = (yearMonth, startSunday) => {
  33244. const year = yearMonth.slice(0, 4);
  33245. const month = yearMonth.slice(4);
  33246. const startDay = getStartDay(yearMonth);
  33247. const dayNum = getDayNum(year, month);
  33248. const data: { day: string; [key: string]: unknown }[] = [];
  33249. for (let i = 0; i < (startDay > 0 ? startDay - (startSunday ? 0 : 1) : 7 - (startSunday ? 0 : 1)); i++) {
  33250. data.push({ day: '' });
  33251. }
  33252. for (let i = 1; i <= dayNum; i++) {
  33253. data.push({ day: i.toString().padStart(2, '0') });
  33254. }
  33255. for (let i = 0; i < 42 - startDay - (startSunday ? 0 : 1) - dayNum; i++) {
  33256. data.push({ day: '' });
  33257. }
  33258. // 去除结尾的所有空字符
  33259. // Remove all empty characters at the end
  33260. while (data[data.length - 1].day === '') {
  33261. data.pop();
  33262. }
  33263. // 如果 day 是 00 或 0 的替换为空字
  33264. // If day is 00, replace it with an empty character
  33265. data.forEach((item: { day: string; [key: string]: unknown }) => {
  33266. if (item.day === '00' || item.day === '0') {
  33267. item.day = '';
  33268. }
  33269. });
  33270. // 循环 data,如果 day 不为 '',则计算出 day 是周几,放在 week
  33271. // Loop data, if day is not '', then calculate that day is what day of the week, put it in week
  33272. data.forEach((item: { day: string; [key: string]: unknown }) => {
  33273. if (item.day !== '') {
  33274. item.week = new Date(`${year}-${month}-${item.day}`).getDay();
  33275. }
  33276. });
  33277. // 循环 data,如果当天是月末,endDay 为 true,否则为 false
  33278. // Loop data, if today is the end of the month, endDay is true, otherwise it is false
  33279. data.forEach((item: { day: string; [key: string]: unknown }, index: number) => {
  33280. if (item.day !== '') {
  33281. item.endDay = index === data.length - 1;
  33282. item.startDay = item.day === '01';
  33283. }
  33284. });
  33285. // 根据从周一开始还是周末开始,循环 data,如果 day 不为 '',判断每天是 周第一天 还是 周最后一天,分别放在 weekStartDay 和 weekEndDay
  33286. // According to whether it starts from Monday or Sunday, loop data, if day is not '', judge whether each day is the first day of the week or the last day of the week, and put it in weekStartDay and weekEndDay respectively
  33287. if (!startSunday) {
  33288. data.forEach((item: { day: string; [key: string]: unknown }) => {
  33289. if (item.day !== '') {
  33290. item.weekStartDay = item.week === 1;
  33291. item.weekEndDay = item.week === 0;
  33292. }
  33293. });
  33294. } else {
  33295. data.forEach((item: { day: string; [key: string]: unknown }) => {
  33296. if (item.day !== '') {
  33297. item.weekStartDay = item.week === 0;
  33298. item.weekEndDay = item.week === 6;
  33299. }
  33300. });
  33301. }
  33302. // 根据每一天的 startDay 和 weekStartDay,endDay 和 weekEndDay,只要有一项是 true,就是月第一天或周第一天,放在 start 和 end 中
  33303. // According to the startDay and weekStartDay of each day, endDay and weekEndDay, as long as one item is true, it is the first day of the month or the first day of the week, put it in start and end
  33304. data.forEach((item: { day: string; [key: string]: unknown }) => {
  33305. if (item.day !== '') {
  33306. item.start = item.startDay || item.weekStartDay;
  33307. item.end = item.endDay || item.weekEndDay;
  33308. }
  33309. });
  33310. return data.map((item: { day: string; [key: string]: unknown }) => item.day);
  33311. };
  33312. /**
  33313. * 传入格式为 YYYYMM 的开始与结束月份字符串,返回这两月份之间的所有月份数据数组,格式为 YYYYMM,不足两位的月份前面补 0
  33314. * Pass in the start and end month strings in the format of YYYYMM, return the data array of all months between these two months, the format is YYYYMM, and the month less than two digits is filled with 0
  33315. * @example
  33316. * getMonthListRange('202005', '202007') // ['202005', '202006', '202007']
  33317. */
  33318. export const getMonthListRange: (startMonthStr: string, endMonthStr: string) => string[] = (startMonthStr, endMonthStr) => {
  33319. const startYear = startMonthStr.slice(0, 4);
  33320. const startMonth = startMonthStr.slice(4);
  33321. const endYear = endMonthStr.slice(0, 4);
  33322. const endMonth = endMonthStr.slice(4);
  33323. const data = [];
  33324. if (startYear === endYear) {
  33325. for (let i = Number(startMonth); i <= Number(endMonth); i++) {
  33326. data.push(`${startYear}${i < 10 ? `0${i}` : i}`);
  33327. }
  33328. } else {
  33329. for (let i = Number(startMonth); i <= 12; i++) {
  33330. data.push(`${startYear}${i < 10 ? `0${i}` : i}`);
  33331. }
  33332. for (let i = 1; i <= Number(endMonth); i++) {
  33333. data.push(`${endYear}${i < 10 ? `0${i}` : i}`);
  33334. }
  33335. }
  33336. return data;
  33337. };
  33338. /**
  33339. * 传入开始与结束日期 YYYYMMDD,需要剔除的日期组成的数组 disabledDates。返回中间的所有日期数组,包含开始与结束日期,月与日不足两位的前面补 0,格式为 YYYYMMDD
  33340. * Pass in the start and end date YYYYMMDD, the array of disabled dates to be removed. Return the array of all dates in the middle, including the start and end dates, and the month and day less than two digits are filled with 0, in the format of YYYYMMDD
  33341. * @example
  33342. * getDateRange('20200501', '20200503') // ['20200501', '20200502', '20200503']
  33343. */
  33344. export const getDateRange: (startDate: string, endDate: string, disabledDates: string[]) => string[] = (
  33345. startDate,
  33346. endDate,
  33347. disabledDates
  33348. ) => {
  33349. // 将 startDate 与 endDate 转化为 YYYY-MM-DD 格式
  33350. // Convert startDate and endDate to YYYY-MM-DD format
  33351. const startYear = startDate.slice(0, 4);
  33352. const startMonth = startDate.slice(4, 6);
  33353. const startDay = startDate.slice(6);
  33354. const endYear = endDate.slice(0, 4);
  33355. const endMonth = endDate.slice(4, 6);
  33356. const endDay = endDate.slice(6);
  33357. const startTimeStr = new Date(`${startYear}-${startMonth}-${startDay}`).getTime();
  33358. const endTimeStr = new Date(`${endYear}-${endMonth}-${endDay}`).getTime();
  33359. const startTime = new Date(startTimeStr).getTime();
  33360. const endTime = new Date(endTimeStr).getTime();
  33361. const data: string[] = [];
  33362. for (let i = startTime; i <= endTime; i += 24 * 60 * 60 * 1000) {
  33363. const date = new Date(i);
  33364. const year = date.getFullYear();
  33365. const month = date.getMonth() + 1;
  33366. const day = date.getDate();
  33367. data.push(`${year}${month < 10 ? `0${month}` : month}${day < 10 ? `0${day}` : day}`);
  33368. }
  33369. // 剔除 disabledDates 中的日期
  33370. // Remove dates in disabledDates
  33371. if (disabledDates && disabledDates.length) {
  33372. disabledDates.forEach((item) => {
  33373. const index = data.indexOf(item);
  33374. if (index > -1) {
  33375. data.splice(index, 1);
  33376. }
  33377. });
  33378. }
  33379. return data;
  33380. };
  33381. /**
  33382. * 传入 startSunday,返回当天所处周的所有日期数组,日期格式为 YYYYMMDD,月与日不足两位的前面补 0
  33383. * Pass in startSunday, return the array of all dates in the week of the current day, the date format is YYYYMMDD, and the month and day less than two digits are filled with 0
  33384. * @example
  33385. * getWeekRange(true) // ['20200531', '20200601', '20200602', '20200603', '20200604', '20200605', '20200606']
  33386. */
  33387. export const getCurrentWeek: (startSunday: boolean) => string[] = (startSunday) => {
  33388. const now = new Date();
  33389. const year = now.getFullYear();
  33390. const month = now.getMonth() + 1;
  33391. const date = now.getDate();
  33392. const day = now.getDay();
  33393. const weekDates: string[] = [];
  33394. if (startSunday) {
  33395. for (let i = 0; i < 7; i++) {
  33396. const newDate = new Date(year, month - 1, date - day + i);
  33397. const newYear = newDate.getFullYear();
  33398. const newMonth = newDate.getMonth() + 1;
  33399. const newDateNum = newDate.getDate();
  33400. weekDates.push(`${newYear}${newMonth.toString().padStart(2, '0')}${newDateNum.toString().padStart(2, '0')}`);
  33401. }
  33402. } else {
  33403. for (let i = 1; i < 8; i++) {
  33404. const newDate = new Date(year, month - 1, date - day + i);
  33405. const newYear = newDate.getFullYear();
  33406. const newMonth = newDate.getMonth() + 1;
  33407. const newDateNum = newDate.getDate();
  33408. weekDates.push(`${newYear}${newMonth.toString().padStart(2, '0')}${newDateNum.toString().padStart(2, '0')}`);
  33409. }
  33410. }
  33411. return weekDates;
  33412. };
  33413. /**
  33414. * 返回当天所处月份的所有日期数组,日期格式为 YYYYMMDD,月与日不足两位的前面补 0
  33415. * Return the array of all dates in the month of the current day, the date format is YYYYMMDD, and the month and day less than two digits are filled with 0
  33416. * @example
  33417. * getCurrentMonth() // ['20200501', '20200502', '20200503', ...]
  33418. */
  33419. export const getCurrentMonth: () => string[] = () => {
  33420. const now = new Date();
  33421. const year = now.getFullYear();
  33422. const month = now.getMonth() + 1;
  33423. const days = new Date(year, month, 0).getDate();
  33424. const dates: string[] = [];
  33425. for (let i = 1; i <= days; i++) {
  33426. dates.push(`${year}${month.toString().padStart(2, '0')}${i.toString().padStart(2, '0')}`);
  33427. }
  33428. return dates;
  33429. };
  33430. /**
  33431. * 返回当天所处季度的所有日期数组,日期格式为 YYYYMMDD,月与日不足两位的前面补 0
  33432. * Pass in the date, return the array of all dates in the quarter of the current day, the date format is YYYYMMDD, and the month and day less than two digits are filled with 0
  33433. * @example
  33434. * getCurrentQuarter() // ['20200401', '20200402', '20200403', ...]
  33435. */
  33436. export const getCurrentQuarter: () => string[] = () => {
  33437. const now = new Date();
  33438. const year = now.getFullYear();
  33439. const month = now.getMonth() + 1;
  33440. const quarter = Math.floor((month - 1) / 3) + 1;
  33441. const startMonth = (quarter - 1) * 3 + 1;
  33442. const endMonth = quarter * 3;
  33443. const days: string[] = [];
  33444. for (let i = startMonth; i <= endMonth; i++) {
  33445. const daysInMonth = new Date(year, i, 0).getDate();
  33446. for (let j = 1; j <= daysInMonth; j++) {
  33447. days.push(`${year}${i.toString().padStart(2, '0')}${j.toString().padStart(2, '0')}`);
  33448. }
  33449. }
  33450. return days;
  33451. };
  33452. /**
  33453. * 传入正数或负数天数 n 和是否从今天开始计算 today,返回对应的前后日期组成的数组,日期格式为 YYYYMMDD,月与日不足两位的前面补 0
  33454. * Pass in a positive or negative number of days n, whether to include today hasToday, return the array of dates before and after the current day, the date format is YYYYMMDD, and the month and day less than two digits are filled with 0
  33455. * @example
  33456. * getDaysRangeWithToday(3) // ['20200501', '20200502', '20200503']
  33457. */
  33458. export const getDaysRangeWithToday: (n: number, today: boolean) => string[] = (n = 0, today = true) => {
  33459. const now = new Date();
  33460. let fakeToday = now;
  33461. if (today) {
  33462. fakeToday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
  33463. } else {
  33464. if (n < 0) {
  33465. fakeToday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
  33466. } else if (n > 0) {
  33467. fakeToday = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
  33468. } else {
  33469. fakeToday = now;
  33470. }
  33471. }
  33472. const dates: string[] = [];
  33473. for (let i = 0; i < Math.abs(n); i++) {
  33474. const date = new Date(fakeToday.getTime() + (n > 0 ? i : -i) * 24 * 60 * 60 * 1000);
  33475. dates.push(`${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`);
  33476. }
  33477. // 对日期排序
  33478. // Sort dates
  33479. dates.sort((a, b) => Number(a) - Number(b));
  33480. return dates;
  33481. };
  33482. ================================================
  33483. FILE: packages/stdf/src/lib/lang/ar_EG.ts
  33484. ================================================
  33485. import type { LangProps } from './index.js';
  33486. const ar_EG: LangProps = {
  33487. common: {
  33488. slotEmpty: 'محتويات الفتحة فارغة!',
  33489. loading: 'جار التحميل ...',
  33490. noData: 'لا يوجد بيانات',
  33491. noMoreData: 'لا توجد بيانات إضافية',
  33492. done: 'تم'
  33493. },
  33494. actionSheet: {
  33495. cancelText: 'إلغاء'
  33496. },
  33497. bottomSheet: {
  33498. title: 'العنوان'
  33499. },
  33500. dialog: {
  33501. title: 'تلميح',
  33502. content: 'المحتوى',
  33503. primaryText: 'تأكيد',
  33504. secondaryText: 'إلغاء'
  33505. },
  33506. input: {
  33507. pleaseInput: 'الرجاء إدخال'
  33508. },
  33509. modal: {
  33510. title: 'العنوان',
  33511. content: 'المحتوى',
  33512. btnText: 'أراهن'
  33513. },
  33514. navBar: {
  33515. title: 'العنوان'
  33516. },
  33517. pagination: {
  33518. defaultOnlyOnePage: 'فقط صفحة واحدة'
  33519. },
  33520. picker: {
  33521. defaultTitle: 'الرجاء الاختيار',
  33522. defaultCancel: 'إلغاء',
  33523. defaultConfirm: 'تأكيد'
  33524. },
  33525. asyncPicker: {
  33526. defaultTitle: 'الرجاء الاختيار',
  33527. defaultCancel: 'إلغاء',
  33528. defaultConfirm: 'تأكيد',
  33529. defaultNext: 'التالي',
  33530. defaultPrev: 'السابق',
  33531. defaultSelected: 'المختار'
  33532. },
  33533. rate: {
  33534. error1: 'لا يمكن أن يكون القيمة أكبر من الإجمالي!',
  33535. error2: 'يجب أن يتم إزالة الإجمالي بمقدار 1!',
  33536. error3: 'يجب أن تكون القيمة أقل بمقدار 1 عندما لا تكون مختارة نصفياً!',
  33537. error4: 'يجب أن يتم إزالة القيمة بمقدار 0.5 عند الاختيار بشكل نصفي!',
  33538. error5: 'العرض أو الارتفاع أقل من 20، والذي يجعل النقر على التليفون المحمول صعبًا!'
  33539. },
  33540. timePicker: {
  33541. defaultTitle: 'الرجاء الاختيار',
  33542. defaultCancel: 'إلغاء',
  33543. defaultConfirm: 'تأكيد',
  33544. defaultYear: 'سنة',
  33545. defaultMonth: 'شهر',
  33546. defaultDay: 'يوم',
  33547. defaultHour: 'ساعة',
  33548. defaultMinute: 'دقيقة',
  33549. defaultSecond: 'ثانية'
  33550. },
  33551. calendar: {
  33552. weekTextList: ['الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت', 'الأحد'],
  33553. weekSundayStartTextList: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
  33554. monthTextList: ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
  33555. confirmText: 'تأكيد',
  33556. selectedText: 'المحددة',
  33557. dayText: 'يوم',
  33558. beforeText: 'الأخيرة',
  33559. afterText: 'المستقبل',
  33560. currentWeekText: 'هذا الأسبوع',
  33561. currentMonthText: 'هذا الشهر',
  33562. currentQuarterText: 'هذه الفصل'
  33563. }
  33564. };
  33565. export default ar_EG;
  33566. ================================================
  33567. FILE: packages/stdf/src/lib/lang/az_AZ.ts
  33568. ================================================
  33569. import type { LangProps } from './index.js';
  33570. const az_AZ: LangProps = {
  33571. common: {
  33572. slotEmpty: 'Slotun məzmunu boşdur!',
  33573. loading: 'Yüklənir...',
  33574. noData: 'Məlumat yoxdur',
  33575. noMoreData: 'Artıq məlumat yoxdur',
  33576. done: 'Hazır'
  33577. },
  33578. actionSheet: {
  33579. cancelText: 'Ləğv et'
  33580. },
  33581. bottomSheet: {
  33582. title: 'Başlıq'
  33583. },
  33584. dialog: {
  33585. title: 'Xəbərdarlıq',
  33586. content: 'Məzmun',
  33587. primaryText: 'Təsdiq',
  33588. secondaryText: 'Ləğv et'
  33589. },
  33590. input: {
  33591. pleaseInput: 'Daxil edin'
  33592. },
  33593. modal: {
  33594. title: 'Başlıq',
  33595. content: 'Məzmun',
  33596. btnText: 'Gördüm'
  33597. },
  33598. navBar: {
  33599. title: 'Başlıq'
  33600. },
  33601. pagination: {
  33602. defaultOnlyOnePage: 'Yalnız bir səhifə'
  33603. },
  33604. picker: {
  33605. defaultTitle: 'Seçin',
  33606. defaultCancel: 'Ləğv et',
  33607. defaultConfirm: 'Təsdiq et'
  33608. },
  33609. asyncPicker: {
  33610. defaultTitle: 'Seçin',
  33611. defaultCancel: 'Ləğv et',
  33612. defaultConfirm: 'Təsdiq et',
  33613. defaultNext: 'Növbəti',
  33614. defaultPrev: 'Əvvəlki',
  33615. defaultSelected: 'Seçildi'
  33616. },
  33617. rate: {
  33618. error1: 'Dəyər Ümumi dəyərdən böyük ola bilməz!',
  33619. error2: 'Ümumi 1 çıxılmalıdır!',
  33620. error3: 'Yarım seçildiyi zaman dəyər 1 çıxılmalıdır!',
  33621. error4: 'Yarım seçilmədiyində Dəyər 0.5 azalır !',
  33622. error5: 'Genişlik və ya hündürlük 20 -dən kiçikdir, mobil terminalda klik etmək çətindir!'
  33623. },
  33624. timePicker: {
  33625. defaultTitle: 'Seçin',
  33626. defaultCancel: 'Ləğv et',
  33627. defaultConfirm: 'Təsdiq et',
  33628. defaultYear: 'İl',
  33629. defaultMonth: 'Ay',
  33630. defaultDay: 'Gün',
  33631. defaultHour: 'Saat',
  33632. defaultMinute: 'Dəqiqə',
  33633. defaultSecond: 'Saniyə'
  33634. },
  33635. calendar: {
  33636. weekTextList: ['B.', 'Ç.', 'Ç.a.', 'Ç.', 'C.', 'C.a.', 'Ş.'],
  33637. weekSundayStartTextList: ['Ş.', 'B.', 'Ç.', 'Ç.a.', 'Ç.', 'C.', 'C.a.'],
  33638. monthTextList: ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'],
  33639. confirmText: 'Təsdiq et',
  33640. selectedText: 'Seçilib',
  33641. dayText: 'gün',
  33642. beforeText: 'Son',
  33643. afterText: 'Gələcək',
  33644. currentWeekText: 'Bu həftə',
  33645. currentMonthText: 'Bu ay',
  33646. currentQuarterText: 'Bu rəbə'
  33647. }
  33648. };
  33649. export default az_AZ;
  33650. ================================================
  33651. FILE: packages/stdf/src/lib/lang/bg_BG.ts
  33652. ================================================
  33653. import type { LangProps } from './index.js';
  33654. const bg_BG: LangProps = {
  33655. common: {
  33656. slotEmpty: 'Съдържанието на слота е празно!',
  33657. loading: 'Зареждане...',
  33658. noData: 'Няма данни',
  33659. noMoreData: 'Няма повече данни',
  33660. done: 'Готово'
  33661. },
  33662. actionSheet: {
  33663. cancelText: 'Отказ'
  33664. },
  33665. bottomSheet: {
  33666. title: 'Заглавие'
  33667. },
  33668. dialog: {
  33669. title: 'Подсказка',
  33670. content: 'Съдържание',
  33671. primaryText: 'Потвърди',
  33672. secondaryText: 'Откажи'
  33673. },
  33674. input: {
  33675. pleaseInput: 'Моля, въведете'
  33676. },
  33677. modal: {
  33678. title: 'Заглавие',
  33679. content: 'Съдържание',
  33680. btnText: 'Разбрах'
  33681. },
  33682. navBar: {
  33683. title: 'Заглавие'
  33684. },
  33685. pagination: {
  33686. defaultOnlyOnePage: 'Само една'
  33687. },
  33688. picker: {
  33689. defaultTitle: 'Моля, изберете',
  33690. defaultCancel: 'Отказ',
  33691. defaultConfirm: 'Потвърди'
  33692. },
  33693. asyncPicker: {
  33694. defaultTitle: 'Моля, изберете',
  33695. defaultCancel: 'Отказ',
  33696. defaultConfirm: 'Потвърди',
  33697. defaultNext: 'Следващ',
  33698. defaultPrev: 'Предишен',
  33699. defaultSelected: 'Избрано'
  33700. },
  33701. rate: {
  33702. error1: 'Стойността не може да бъде по-голяма от общата!',
  33703. error2: 'Общата трябва да се раздели с 1!',
  33704. error3: 'Стойността трябва да се раздели с 1, когато не е наполовина избрана!',
  33705. error4: 'Стойността трябва да се раздели с 0,5, когато е наполовина избрана!',
  33706. error5: 'Широчината или височината има стойност по-малка от 20, което прави щракването на мобилното устройство трудно!'
  33707. },
  33708. timePicker: {
  33709. defaultTitle: 'Моля, изберете',
  33710. defaultCancel: 'Отказ',
  33711. defaultConfirm: 'Потвърди',
  33712. defaultYear: 'Година',
  33713. defaultMonth: 'Месец',
  33714. defaultDay: 'Ден',
  33715. defaultHour: 'Час',
  33716. defaultMinute: 'Минута',
  33717. defaultSecond: 'Секунда'
  33718. },
  33719. calendar: {
  33720. weekTextList: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Нд'],
  33721. weekSundayStartTextList: ['Нд', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
  33722. monthTextList: ['Януари', 'Февруари', 'Март', 'Април', 'Май', 'Юни', 'Юли', 'Август', 'Септември', 'Октомври', 'Ноември', 'Декември'],
  33723. confirmText: 'Потвърди',
  33724. selectedText: 'Избрано',
  33725. dayText: 'ден',
  33726. beforeText: 'Последен',
  33727. afterText: 'Следващ',
  33728. currentWeekText: 'Тази седмица',
  33729. currentMonthText: 'Този месец',
  33730. currentQuarterText: 'Това тримесечие'
  33731. }
  33732. };
  33733. export default bg_BG;
  33734. ================================================
  33735. FILE: packages/stdf/src/lib/lang/bn_BD.ts
  33736. ================================================
  33737. import type { LangProps } from './index.js';
  33738. const bn_BD: LangProps = {
  33739. common: {
  33740. slotEmpty: 'স্লটের উপাদান খালি!',
  33741. loading: 'লোড হচ্ছে ...',
  33742. noData: 'কোন তথ্য নেই',
  33743. noMoreData: 'আর কোন তথ্য নেই',
  33744. done: 'সম্পন্ন'
  33745. },
  33746. actionSheet: {
  33747. cancelText: 'বাতিল'
  33748. },
  33749. bottomSheet: {
  33750. title: 'শিরোনাম'
  33751. },
  33752. dialog: {
  33753. title: 'উপদেশ',
  33754. content: 'বিষয়বস্তু',
  33755. primaryText: 'হ্যাঁ',
  33756. secondaryText: 'না'
  33757. },
  33758. input: {
  33759. pleaseInput: 'অনুগ্রহপূর্বক প্রবেশ করুন'
  33760. },
  33761. modal: {
  33762. title: 'শিরোনাম',
  33763. content: 'বিষয়বস্তু',
  33764. btnText: 'ঠিক আছে'
  33765. },
  33766. navBar: {
  33767. title: 'শিরোনাম'
  33768. },
  33769. pagination: {
  33770. defaultOnlyOnePage: 'শুধুমাত্র একটি'
  33771. },
  33772. picker: {
  33773. defaultTitle: 'অনুগ্রহ করে নির্বাচন করুন',
  33774. defaultCancel: 'বাতিল',
  33775. defaultConfirm: 'নিশ্চিত করুন'
  33776. },
  33777. asyncPicker: {
  33778. defaultTitle: 'অনুগ্রহ করে নির্বাচন করুন',
  33779. defaultCancel: 'বাতিল',
  33780. defaultConfirm: 'নিশ্চিত করুন',
  33781. defaultNext: 'পরবর্তী',
  33782. defaultPrev: 'আগে',
  33783. defaultSelected: 'নির্বাচিত'
  33784. },
  33785. rate: {
  33786. error1: 'মানটি সম্পূর্ণ প্রতিবেদন থেকে বেশি হতে পারে না!',
  33787. error2: 'সম্পূর্ণ প্রতিবেদনের সাথে গুণফল করতে হবে!',
  33788. error3: 'মানটি বেশি নয়, তখন সাম্প্রতিক নয়!',
  33789. error4: 'মানটি আধ হওয়া উচিত, তখন সে সাম্প্রতিক হিসাবে উন্নয়ন করা হবে!',
  33790. error5: 'উচ্চতা বা প্রস্থ এমন মান যা মোবাইল ডিভাইসে ক্লিক করা অসহজ করে দেয়!'
  33791. },
  33792. timePicker: {
  33793. defaultTitle: 'অনুগ্রহ করে নির্বাচন করুন',
  33794. defaultCancel: 'বাতিল',
  33795. defaultConfirm: 'নিশ্চিত করুন',
  33796. defaultYear: 'বছর',
  33797. defaultMonth: 'মাস',
  33798. defaultDay: 'দিন',
  33799. defaultHour: 'ঘন্টা',
  33800. defaultMinute: 'মিনিট',
  33801. defaultSecond: 'সেকেন্ড'
  33802. },
  33803. calendar: {
  33804. weekTextList: ['সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি', 'রবি'],
  33805. weekSundayStartTextList: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'],
  33806. monthTextList: [
  33807. 'জানুয়ারী',
  33808. 'ফেব্রুয়ারী',
  33809. 'মার্চ',
  33810. 'এপ্রিল',
  33811. 'মে',
  33812. 'জুন',
  33813. 'জুলাই',
  33814. 'আগস্ট',
  33815. 'সেপ্টেম্বর',
  33816. 'অক্টোবর',
  33817. 'নভেম্বর',
  33818. 'ডিসেম্বর'
  33819. ],
  33820. confirmText: 'নিশ্চিত করুন',
  33821. selectedText: 'নির্বাচিত',
  33822. dayText: 'দিন',
  33823. beforeText: 'পূর্ববর্তী',
  33824. afterText: 'পরবর্তী',
  33825. currentWeekText: 'এই সপ্তাহে',
  33826. currentMonthText: 'এই মাসে',
  33827. currentQuarterText: 'এই ত্রৈমাসিকে'
  33828. }
  33829. };
  33830. export default bn_BD;
  33831. ================================================
  33832. FILE: packages/stdf/src/lib/lang/ca_ES.ts
  33833. ================================================
  33834. import type { LangProps } from './index.js';
  33835. const ca_ES: LangProps = {
  33836. common: {
  33837. slotEmpty: 'La ranura està buida!',
  33838. loading: "S'està carregant ...",
  33839. noData: 'No hi ha dades disponibles',
  33840. noMoreData: 'No hi ha més dades',
  33841. done: 'Fet'
  33842. },
  33843. actionSheet: {
  33844. cancelText: 'Cancel·lar'
  33845. },
  33846. bottomSheet: {
  33847. title: 'Títol'
  33848. },
  33849. dialog: {
  33850. title: 'Avís',
  33851. content: 'Contingut',
  33852. primaryText: "D'acord",
  33853. secondaryText: 'Cancel·lar'
  33854. },
  33855. input: {
  33856. pleaseInput: 'Si us plau, introdueixi'
  33857. },
  33858. modal: {
  33859. title: 'Títol',
  33860. content: 'Contingut',
  33861. btnText: "D'acord"
  33862. },
  33863. navBar: {
  33864. title: 'Títol'
  33865. },
  33866. pagination: {
  33867. defaultOnlyOnePage: 'Només una pàgina'
  33868. },
  33869. picker: {
  33870. defaultTitle: 'Si us plau, trieu',
  33871. defaultCancel: 'Cancel·lar',
  33872. defaultConfirm: 'Confirmar'
  33873. },
  33874. asyncPicker: {
  33875. defaultTitle: 'Si us plau, trieu',
  33876. defaultCancel: 'Cancel·lar',
  33877. defaultConfirm: 'Confirmar',
  33878. defaultNext: 'Següent',
  33879. defaultPrev: 'Anterior',
  33880. defaultSelected: 'Seleccionat'
  33881. },
  33882. rate: {
  33883. error1: 'El valor no pot ser més gran que la seva informació de retroaliment completa!',
  33884. error2: "El valor s'ha de puntuar amb la seva informació de retroaliment completa!",
  33885. error3: 'El valor no és gran, llavors no és fresc!',
  33886. error4: 'El valor ha de ser imparell, llavors es desenvolupa com a fresc!',
  33887. error5: "L'alçada o l'amplada del valor és difícil de tocar al dispositiu mòbil!"
  33888. },
  33889. timePicker: {
  33890. defaultTitle: 'Si us plau, trieu',
  33891. defaultCancel: 'Cancel·lar',
  33892. defaultConfirm: 'Confirmar',
  33893. defaultYear: 'Any',
  33894. defaultMonth: 'Mes',
  33895. defaultDay: 'Dia',
  33896. defaultHour: 'Hora',
  33897. defaultMinute: 'Minut',
  33898. defaultSecond: 'Segon'
  33899. },
  33900. calendar: {
  33901. weekTextList: ['Dl', 'Dt', 'Dc', 'Dj', 'Dv', 'Ds', 'Dg'],
  33902. weekSundayStartTextList: ['Dg', 'Dl', 'Dt', 'Dc', 'Dj', 'Dv', 'Ds'],
  33903. monthTextList: ['Gener', 'Febrer', 'Març', 'Abril', 'Maig', 'Juny', 'Juliol', 'Agost', 'Setembre', 'Octubre', 'Novembre', 'Desembre'],
  33904. confirmText: 'Confirmar',
  33905. selectedText: 'Seleccionat',
  33906. dayText: 'Dia',
  33907. beforeText: 'Abans',
  33908. afterText: 'Després',
  33909. currentWeekText: 'Aquesta setmana',
  33910. currentMonthText: 'Aquest mes',
  33911. currentQuarterText: 'Aquest trimestre'
  33912. }
  33913. };
  33914. export default ca_ES;
  33915. ================================================
  33916. FILE: packages/stdf/src/lib/lang/cs_CZ.ts
  33917. ================================================
  33918. import type { LangProps } from './index.js';
  33919. const cs_CZ: LangProps = {
  33920. common: {
  33921. slotEmpty: 'Slot je prázdný!',
  33922. loading: 'Načítání...',
  33923. noData: 'Žádná data',
  33924. noMoreData: 'Žádná další data',
  33925. done: 'Hotovo'
  33926. },
  33927. actionSheet: {
  33928. cancelText: 'Zrušit'
  33929. },
  33930. bottomSheet: {
  33931. title: 'Název'
  33932. },
  33933. dialog: {
  33934. title: 'Upozornění',
  33935. content: 'Obsah',
  33936. primaryText: 'OK',
  33937. secondaryText: 'Zrušit'
  33938. },
  33939. input: {
  33940. pleaseInput: 'Prosím, zadejte'
  33941. },
  33942. modal: {
  33943. title: 'Název',
  33944. content: 'Obsah',
  33945. btnText: 'OK'
  33946. },
  33947. navBar: {
  33948. title: 'Název'
  33949. },
  33950. pagination: {
  33951. defaultOnlyOnePage: 'Jen jedna stránka'
  33952. },
  33953. picker: {
  33954. defaultTitle: 'Prosím vyberte',
  33955. defaultCancel: 'Zrušit',
  33956. defaultConfirm: 'Potvrdit'
  33957. },
  33958. asyncPicker: {
  33959. defaultTitle: 'Prosím vyberte',
  33960. defaultCancel: 'Zrušit',
  33961. defaultConfirm: 'Potvrdit',
  33962. defaultNext: 'Další',
  33963. defaultPrev: 'Předchozí',
  33964. defaultSelected: 'Vybráno'
  33965. },
  33966. rate: {
  33967. error1: 'Hodnocení nemůže být větší než celková zpětná vazba!',
  33968. error2: 'Hodnocení musí být vyplněno alespoň celou jednou!',
  33969. error3: 'Hodnocení není velké, pak že ježek spí!',
  33970. error4: 'Hodnocení musí být liché, pak se vyvíjí jako ježek!',
  33971. error5: 'Výška nebo šířka hodnocení je na mobilním zařízení obtížně dotykatelná!'
  33972. },
  33973. timePicker: {
  33974. defaultTitle: 'Prosím vyberte',
  33975. defaultCancel: 'Zrušit',
  33976. defaultConfirm: 'Potvrdit',
  33977. defaultYear: 'Rok',
  33978. defaultMonth: 'Měsíc',
  33979. defaultDay: 'Den',
  33980. defaultHour: 'Hodina',
  33981. defaultMinute: 'Minuta',
  33982. defaultSecond: 'Sekunda'
  33983. },
  33984. calendar: {
  33985. weekTextList: ['Po', 'Út', 'St', 'Čt', 'Pá', 'So', 'Ne'],
  33986. weekSundayStartTextList: ['Ne', 'Po', 'Út', 'St', 'Čt', 'Pá', 'So'],
  33987. monthTextList: ['Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'],
  33988. confirmText: 'Potvrdit',
  33989. selectedText: 'Vybraná',
  33990. dayText: '. den',
  33991. beforeText: 'Před',
  33992. afterText: 'Po',
  33993. currentWeekText: 'Tento týden',
  33994. currentMonthText: 'Tento měsíc',
  33995. currentQuarterText: 'Toto čtvrtletí'
  33996. }
  33997. };
  33998. export default cs_CZ;
  33999. ================================================
  34000. FILE: packages/stdf/src/lib/lang/da_DK.ts
  34001. ================================================
  34002. import type { LangProps } from './index.js';
  34003. const da_DK: LangProps = {
  34004. common: {
  34005. slotEmpty: 'Slot er tom!',
  34006. loading: 'Indlæser...',
  34007. noData: 'Ingen data',
  34008. noMoreData: 'Ingen flere data',
  34009. done: 'Færdig'
  34010. },
  34011. actionSheet: {
  34012. cancelText: 'Annuller'
  34013. },
  34014. bottomSheet: {
  34015. title: 'Titel'
  34016. },
  34017. dialog: {
  34018. title: 'Advarsel',
  34019. content: 'Indhold',
  34020. primaryText: 'OK',
  34021. secondaryText: 'Annuller'
  34022. },
  34023. input: {
  34024. pleaseInput: 'Indtast venligst'
  34025. },
  34026. modal: {
  34027. title: 'Titel',
  34028. content: 'Indhold',
  34029. btnText: 'OK'
  34030. },
  34031. navBar: {
  34032. title: 'Titel'
  34033. },
  34034. pagination: {
  34035. defaultOnlyOnePage: 'Kun en side'
  34036. },
  34037. picker: {
  34038. defaultTitle: 'Vælg venligst',
  34039. defaultCancel: 'Annuller',
  34040. defaultConfirm: 'Bekræft'
  34041. },
  34042. asyncPicker: {
  34043. defaultTitle: 'Vælg venligst',
  34044. defaultCancel: 'Annuller',
  34045. defaultConfirm: 'Bekræft',
  34046. defaultNext: 'Næste',
  34047. defaultPrev: 'Tidligere',
  34048. defaultSelected: 'Valgt'
  34049. },
  34050. rate: {
  34051. error1: 'Bedømmelsen må ikke være større end din samlede feedback!',
  34052. error2: 'Bedømmelse skal være udarbejdet mindst en hel!',
  34053. error3: 'Bedømmelse er ikke stor, så pindsvinet sover!',
  34054. error4: 'Bedømmelse skal være ulige, så udvikler sig som en pindsvin!',
  34055. error5: 'Højden eller bredden af bedømmelsen er svær at røre mobil!'
  34056. },
  34057. timePicker: {
  34058. defaultTitle: 'Vælg venligst',
  34059. defaultCancel: 'Annuller',
  34060. defaultConfirm: 'Bekræft',
  34061. defaultYear: 'År',
  34062. defaultMonth: 'Måned',
  34063. defaultDay: 'Dag',
  34064. defaultHour: 'Time',
  34065. defaultMinute: 'Minut',
  34066. defaultSecond: 'Anden'
  34067. },
  34068. calendar: {
  34069. weekTextList: ['Ma', 'Ti', 'On', 'To', 'Fr', 'Lø', 'Sø'],
  34070. weekSundayStartTextList: ['Sø', 'Ma', 'Ti', 'On', 'To', 'Fr', 'Lø'],
  34071. monthTextList: ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December'],
  34072. confirmText: 'Bekræft',
  34073. selectedText: 'Valgt',
  34074. dayText: '. dag',
  34075. beforeText: 'Før',
  34076. afterText: 'Efter',
  34077. currentWeekText: 'Denne uge',
  34078. currentMonthText: 'Denne måned',
  34079. currentQuarterText: 'Dette kvartal'
  34080. }
  34081. };
  34082. export default da_DK;
  34083. ================================================
  34084. FILE: packages/stdf/src/lib/lang/de_DE.ts
  34085. ================================================
  34086. import type { LangProps } from './index.js';
  34087. const de_DE: LangProps = {
  34088. common: {
  34089. slotEmpty: 'Slot ist leer!',
  34090. loading: 'Laden...',
  34091. noData: 'Keine Daten',
  34092. noMoreData: 'Keine weiteren Daten',
  34093. done: 'Fertig'
  34094. },
  34095. actionSheet: {
  34096. cancelText: 'Abbrechen'
  34097. },
  34098. bottomSheet: {
  34099. title: 'Titel'
  34100. },
  34101. dialog: {
  34102. title: 'Warnung',
  34103. content: 'Inhalt',
  34104. primaryText: 'OK',
  34105. secondaryText: 'Abbrechen'
  34106. },
  34107. input: {
  34108. pleaseInput: 'Bitte geben Sie ein'
  34109. },
  34110. modal: {
  34111. title: 'Titel',
  34112. content: 'Inhalt',
  34113. btnText: 'OK'
  34114. },
  34115. navBar: {
  34116. title: 'Titel'
  34117. },
  34118. pagination: {
  34119. defaultOnlyOnePage: 'Nur eine'
  34120. },
  34121. picker: {
  34122. defaultTitle: 'Bitte wählen',
  34123. defaultCancel: 'Abbrechen',
  34124. defaultConfirm: 'Bestätigen'
  34125. },
  34126. asyncPicker: {
  34127. defaultTitle: 'Bitte wählen',
  34128. defaultCancel: 'Abbrechen',
  34129. defaultConfirm: 'Bestätigen',
  34130. defaultNext: 'Weiter',
  34131. defaultPrev: 'Zurück',
  34132. defaultSelected: 'Ausgewählt'
  34133. },
  34134. rate: {
  34135. error1: 'Bewertung darf nicht größer als Ihr Gesamt-Feedback sein!',
  34136. error2: 'Bewertung muss mindestens einmal vollständig ausgefüllt werden!',
  34137. error3: 'Bewertung ist nicht groß, so schläft der Igel!',
  34138. error4: 'Bewertung muss ungerade sein, damit sie sich wie ein Igel entwickelt!',
  34139. error5: 'Die Höhe oder Breite der Bewertung ist auf dem Mobiltelefon schwer zu berühren!'
  34140. },
  34141. timePicker: {
  34142. defaultTitle: 'Bitte wählen',
  34143. defaultCancel: 'Abbrechen',
  34144. defaultConfirm: 'Bestätigen',
  34145. defaultYear: 'Jahr',
  34146. defaultMonth: 'Monat',
  34147. defaultDay: 'Tag',
  34148. defaultHour: 'Stunde',
  34149. defaultMinute: 'Minute',
  34150. defaultSecond: 'Zweite'
  34151. },
  34152. calendar: {
  34153. weekTextList: ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],
  34154. weekSundayStartTextList: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
  34155. monthTextList: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
  34156. confirmText: 'Bestätigen',
  34157. selectedText: 'Ausgewählt',
  34158. dayText: '. Tag',
  34159. beforeText: 'Vor',
  34160. afterText: 'Nach',
  34161. currentWeekText: 'Diese Woche',
  34162. currentMonthText: 'Dieser Monat',
  34163. currentQuarterText: 'Dieses Quartal'
  34164. }
  34165. };
  34166. export default de_DE;
  34167. ================================================
  34168. FILE: packages/stdf/src/lib/lang/el_GR.ts
  34169. ================================================
  34170. import type { LangProps } from './index.js';
  34171. const el_GR: LangProps = {
  34172. common: {
  34173. slotEmpty: 'Το slot είναι άδειο!',
  34174. loading: 'Φόρτωση...',
  34175. noData: 'Δεν υπάρχουν δεδομένα',
  34176. noMoreData: 'Δεν υπάρχουν άλλα δεδομένα',
  34177. done: 'Έγινε'
  34178. },
  34179. actionSheet: {
  34180. cancelText: 'Ακύρωση'
  34181. },
  34182. bottomSheet: {
  34183. title: 'Τίτλος'
  34184. },
  34185. dialog: {
  34186. title: 'Προειδοποίηση',
  34187. content: 'Περιεχόμενο',
  34188. primaryText: 'ΟΚ',
  34189. secondaryText: 'Ακύρωση'
  34190. },
  34191. input: {
  34192. pleaseInput: 'Παρακαλώ εισάγετε'
  34193. },
  34194. modal: {
  34195. title: 'Τίτλος',
  34196. content: 'Περιεχόμενο',
  34197. btnText: 'ΟΚ'
  34198. },
  34199. navBar: {
  34200. title: 'Τίτλος'
  34201. },
  34202. pagination: {
  34203. defaultOnlyOnePage: 'Μόνο μία'
  34204. },
  34205. picker: {
  34206. defaultTitle: 'Παρακαλώ επιλέξτε',
  34207. defaultCancel: 'Ακύρωση',
  34208. defaultConfirm: 'Επιβεβαίωση'
  34209. },
  34210. asyncPicker: {
  34211. defaultTitle: 'Παρακαλώ επιλέξτε',
  34212. defaultCancel: 'Ακύρωση',
  34213. defaultConfirm: 'Επιβεβαίωση',
  34214. defaultNext: 'Επόμενο',
  34215. defaultPrev: 'Προηγούμενο',
  34216. defaultSelected: 'Επιλεγμένο'
  34217. },
  34218. rate: {
  34219. error1: 'Η βαθμολογία δεν πρέπει να είναι μεγαλύτερη από τη συνολική ανατροφοδότησή σας!',
  34220. error2: 'Η βαθμολογία πρέπει να συμπληρώνεται στο σύνολό της τουλάχιστον μία φορά!',
  34221. error3: 'Η βαθμολογία δεν είναι μεγάλη, οπότε το σκαντζόχοιρο κοιμάται!',
  34222. error4: 'Η βαθμολογία πρέπει να είναι μονός αριθμός, ώστε να αναπτύσσεται όπως ένα σκαντζόχοιρος!',
  34223. error5: 'Το ύψος ή η πλάτος της βαθμολογίας είναι δύσκολο να αγγίξει στο κινητό!'
  34224. },
  34225. timePicker: {
  34226. defaultTitle: 'Παρακαλώ επιλέξτε',
  34227. defaultCancel: 'Ακύρωση',
  34228. defaultConfirm: 'Επιβεβαίωση',
  34229. defaultYear: 'Έτος',
  34230. defaultMonth: 'Μήνας',
  34231. defaultDay: 'Ημέρα',
  34232. defaultHour: 'Ώρα',
  34233. defaultMinute: 'Λεπτό',
  34234. defaultSecond: 'Δευτερόλεπτο'
  34235. },
  34236. calendar: {
  34237. weekTextList: ['Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα', 'Κυ'],
  34238. weekSundayStartTextList: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'],
  34239. monthTextList: [
  34240. 'Ιανουάριος',
  34241. 'Φεβρουάριος',
  34242. 'Μάρτιος',
  34243. 'Απρίλιος',
  34244. 'Μάιος',
  34245. 'Ιούνιος',
  34246. 'Ιούλιος',
  34247. 'Αύγουστος',
  34248. 'Σεπτέμβριος',
  34249. 'Οκτώβριος',
  34250. 'Νοέμβριος',
  34251. 'Δεκέμβριος'
  34252. ],
  34253. confirmText: 'Επιβεβαίωση',
  34254. selectedText: 'Επιλεγμένο',
  34255. dayText: 'η μέρα',
  34256. beforeText: 'Πριν από',
  34257. afterText: 'Μετά',
  34258. currentWeekText: 'Αυτήν την εβδομάδα',
  34259. currentMonthText: 'Αυτό το μήνα',
  34260. currentQuarterText: 'Αυτό το τρίμηνο'
  34261. }
  34262. };
  34263. export default el_GR;
  34264. ================================================
  34265. FILE: packages/stdf/src/lib/lang/en_GB.ts
  34266. ================================================
  34267. import type { LangProps } from './index.js';
  34268. const en_GB: LangProps = {
  34269. common: {
  34270. slotEmpty: 'Slot is empty!',
  34271. loading: 'Loading...',
  34272. noData: 'No data',
  34273. noMoreData: 'No more data',
  34274. done: 'Done'
  34275. },
  34276. actionSheet: {
  34277. cancelText: 'Cancel'
  34278. },
  34279. bottomSheet: {
  34280. title: 'Title'
  34281. },
  34282. dialog: {
  34283. title: 'Warning',
  34284. content: 'Content',
  34285. primaryText: 'OK',
  34286. secondaryText: 'Cancel'
  34287. },
  34288. input: {
  34289. pleaseInput: 'Please input'
  34290. },
  34291. modal: {
  34292. title: 'Title',
  34293. content: 'Content',
  34294. btnText: 'OK'
  34295. },
  34296. navBar: {
  34297. title: 'Title'
  34298. },
  34299. pagination: {
  34300. defaultOnlyOnePage: 'Only one'
  34301. },
  34302. picker: {
  34303. defaultTitle: 'Please select',
  34304. defaultCancel: 'Cancel',
  34305. defaultConfirm: 'Confirm'
  34306. },
  34307. asyncPicker: {
  34308. defaultTitle: 'Please select',
  34309. defaultCancel: 'Cancel',
  34310. defaultConfirm: 'Confirm',
  34311. defaultNext: 'Next',
  34312. defaultPrev: 'Prev',
  34313. defaultSelected: 'Selected'
  34314. },
  34315. rate: {
  34316. error1: 'Rating should not be greater than your overall feedback!',
  34317. error2: 'Rating should be completed at least once as a whole!',
  34318. error3: 'Rating is not high, so the hedgehog is sleeping!',
  34319. error4: 'Rating should be an odd number, so that it can develop into a hedgehog!',
  34320. error5: 'The height or width of the rating is difficult to touch on the mobile phone!'
  34321. },
  34322. timePicker: {
  34323. defaultTitle: 'Please select',
  34324. defaultCancel: 'Cancel',
  34325. defaultConfirm: 'Confirm',
  34326. defaultYear: 'Year',
  34327. defaultMonth: 'Month',
  34328. defaultDay: 'Day',
  34329. defaultHour: 'Hour',
  34330. defaultMinute: 'Minute',
  34331. defaultSecond: 'Second'
  34332. },
  34333. calendar: {
  34334. weekTextList: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  34335. weekSundayStartTextList: ['Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr'],
  34336. monthTextList: [
  34337. 'January',
  34338. 'February',
  34339. 'March',
  34340. 'April',
  34341. 'May',
  34342. 'June',
  34343. 'July',
  34344. 'August',
  34345. 'September',
  34346. 'October',
  34347. 'November',
  34348. 'December'
  34349. ],
  34350. confirmText: 'Confirm',
  34351. selectedText: 'Selected',
  34352. dayText: 'day',
  34353. beforeText: 'Before',
  34354. afterText: 'After',
  34355. currentWeekText: 'This week',
  34356. currentMonthText: 'This month',
  34357. currentQuarterText: 'This quarter'
  34358. }
  34359. };
  34360. export default en_GB;
  34361. ================================================
  34362. FILE: packages/stdf/src/lib/lang/en_US.ts
  34363. ================================================
  34364. import type { LangProps } from './index.js';
  34365. const en_US: LangProps = {
  34366. common: {
  34367. slotEmpty: 'The content of the slot is empty!',
  34368. loading: 'Loading...',
  34369. noData: 'No data',
  34370. noMoreData: 'No more data',
  34371. done: 'Done'
  34372. },
  34373. actionSheet: {
  34374. cancelText: 'Cancel'
  34375. },
  34376. bottomSheet: {
  34377. title: 'Title'
  34378. },
  34379. dialog: {
  34380. title: 'Hint',
  34381. content: 'Content',
  34382. primaryText: 'Confirm',
  34383. secondaryText: 'Cancel'
  34384. },
  34385. input: {
  34386. pleaseInput: 'Please enter'
  34387. },
  34388. modal: {
  34389. title: 'Title',
  34390. content: 'Content',
  34391. btnText: 'I see'
  34392. },
  34393. navBar: {
  34394. title: 'Title'
  34395. },
  34396. pagination: {
  34397. defaultOnlyOnePage: 'Only one page'
  34398. },
  34399. picker: {
  34400. defaultTitle: 'Please choose',
  34401. defaultCancel: 'Cancel',
  34402. defaultConfirm: 'Confirm'
  34403. },
  34404. asyncPicker: {
  34405. defaultTitle: 'Please choose',
  34406. defaultCancel: 'Cancel',
  34407. defaultConfirm: 'Confirm',
  34408. defaultNext: 'Next',
  34409. defaultPrev: 'Previous',
  34410. defaultSelected: 'Selected'
  34411. },
  34412. rate: {
  34413. error1: 'Value cannot be greater than Total!',
  34414. error2: 'Total must be removed by 1!',
  34415. error3: 'Value must be removed by 1 when non -semi -elected!',
  34416. error4: 'Value must be removed by 0.5 when half elected!',
  34417. error5: 'Width or height is less than 20, which makes the mobile terminal click difficult!'
  34418. },
  34419. timePicker: {
  34420. defaultTitle: 'Please choose',
  34421. defaultCancel: 'Cancel',
  34422. defaultConfirm: 'Confirm',
  34423. defaultYear: 'Year',
  34424. defaultMonth: 'Month',
  34425. defaultDay: 'Day',
  34426. defaultHour: 'Hour',
  34427. defaultMinute: 'Minute',
  34428. defaultSecond: 'Second'
  34429. },
  34430. calendar: {
  34431. weekTextList: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  34432. weekSundayStartTextList: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  34433. monthTextList: [
  34434. 'January',
  34435. 'February',
  34436. 'March',
  34437. 'April',
  34438. 'May',
  34439. 'June',
  34440. 'July',
  34441. 'August',
  34442. 'September',
  34443. 'October',
  34444. 'November',
  34445. 'December'
  34446. ],
  34447. confirmText: 'Confirm',
  34448. selectedText: 'Selected',
  34449. dayText: 'day',
  34450. beforeText: 'Recent',
  34451. afterText: 'Future',
  34452. currentWeekText: 'This week',
  34453. currentMonthText: 'This month',
  34454. currentQuarterText: 'This quarter'
  34455. }
  34456. };
  34457. export default en_US;
  34458. ================================================
  34459. FILE: packages/stdf/src/lib/lang/es_ES.ts
  34460. ================================================
  34461. import type { LangProps } from './index.js';
  34462. const es_ES: LangProps = {
  34463. common: {
  34464. slotEmpty: '¡El slot está vacío!',
  34465. loading: 'Cargando...',
  34466. noData: 'Sin datos',
  34467. noMoreData: 'No hay más datos',
  34468. done: 'Hecho'
  34469. },
  34470. actionSheet: {
  34471. cancelText: 'Cancelar'
  34472. },
  34473. bottomSheet: {
  34474. title: 'Título'
  34475. },
  34476. dialog: {
  34477. title: 'Advertencia',
  34478. content: 'Contenido',
  34479. primaryText: 'OK',
  34480. secondaryText: 'Cancelar'
  34481. },
  34482. input: {
  34483. pleaseInput: 'Por favor, introduzca'
  34484. },
  34485. modal: {
  34486. title: 'Título',
  34487. content: 'Contenido',
  34488. btnText: 'OK'
  34489. },
  34490. navBar: {
  34491. title: 'Título'
  34492. },
  34493. pagination: {
  34494. defaultOnlyOnePage: 'Solo una página'
  34495. },
  34496. picker: {
  34497. defaultTitle: 'Por favor seleccione',
  34498. defaultCancel: 'Cancelar',
  34499. defaultConfirm: 'Confirmar'
  34500. },
  34501. asyncPicker: {
  34502. defaultTitle: 'Por favor seleccione',
  34503. defaultCancel: 'Cancelar',
  34504. defaultConfirm: 'Confirmar',
  34505. defaultNext: 'Siguiente',
  34506. defaultPrev: 'Anterior',
  34507. defaultSelected: 'Seleccionado'
  34508. },
  34509. rate: {
  34510. error1: '¡La calificación no debe ser mayor que su retroalimentación general!',
  34511. error2: '¡Debe completar la calificación al menos una vez en su totalidad!',
  34512. error3: '¡La calificación no es alta, por lo que el puercoespín está durmiendo!',
  34513. error4: '¡La calificación debe ser un número impar, para que pueda convertirse en un puercoespín!',
  34514. error5: '¡La altura o anchura de la calificación es difícil de tocar en el teléfono móvil!'
  34515. },
  34516. timePicker: {
  34517. defaultTitle: 'Por favor seleccione',
  34518. defaultCancel: 'Cancelar',
  34519. defaultConfirm: 'Confirmar',
  34520. defaultYear: 'Año',
  34521. defaultMonth: 'Mes',
  34522. defaultDay: 'Día',
  34523. defaultHour: 'Hora',
  34524. defaultMinute: 'Minuto',
  34525. defaultSecond: 'Segundo'
  34526. },
  34527. calendar: {
  34528. weekTextList: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
  34529. weekSundayStartTextList: ['Sáb', 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie'],
  34530. monthTextList: [
  34531. 'Enero',
  34532. 'Febrero',
  34533. 'Marzo',
  34534. 'Abril',
  34535. 'Mayo',
  34536. 'Junio',
  34537. 'Julio',
  34538. 'Agosto',
  34539. 'Septiembre',
  34540. 'Octubre',
  34541. 'Noviembre',
  34542. 'Diciembre'
  34543. ],
  34544. confirmText: 'Confirmar',
  34545. selectedText: 'Seleccionado',
  34546. dayText: 'día',
  34547. beforeText: 'Antes',
  34548. afterText: 'Después',
  34549. currentWeekText: 'Esta semana',
  34550. currentMonthText: 'Este mes',
  34551. currentQuarterText: 'Este trimestre'
  34552. }
  34553. };
  34554. export default es_ES;
  34555. ================================================
  34556. FILE: packages/stdf/src/lib/lang/et_EE.ts
  34557. ================================================
  34558. import type { LangProps } from './index.js';
  34559. const et_EE: LangProps = {
  34560. common: {
  34561. slotEmpty: 'Pesa on tühi!',
  34562. loading: 'Laadimine...',
  34563. noData: 'Andmeid pole',
  34564. noMoreData: 'Rohkem andmeid pole',
  34565. done: 'Valmis'
  34566. },
  34567. actionSheet: {
  34568. cancelText: 'Tühista'
  34569. },
  34570. bottomSheet: {
  34571. title: 'Pealkiri'
  34572. },
  34573. dialog: {
  34574. title: 'Hoiatus',
  34575. content: 'Sisu',
  34576. primaryText: 'OK',
  34577. secondaryText: 'Tühista'
  34578. },
  34579. input: {
  34580. pleaseInput: 'Palun sisesta'
  34581. },
  34582. modal: {
  34583. title: 'Pealkiri',
  34584. content: 'Sisu',
  34585. btnText: 'OK'
  34586. },
  34587. navBar: {
  34588. title: 'Pealkiri'
  34589. },
  34590. pagination: {
  34591. defaultOnlyOnePage: 'Ainult üks leht'
  34592. },
  34593. picker: {
  34594. defaultTitle: 'Palun valige',
  34595. defaultCancel: 'Tühista',
  34596. defaultConfirm: 'Kinnita'
  34597. },
  34598. asyncPicker: {
  34599. defaultTitle: 'Palun valige',
  34600. defaultCancel: 'Tühista',
  34601. defaultConfirm: 'Kinnita',
  34602. defaultNext: 'Järgmine',
  34603. defaultPrev: 'Eelmine',
  34604. defaultSelected: 'Valitud'
  34605. },
  34606. rate: {
  34607. error1: 'Hinnang ei tohiks olla suurem kui kogu teie tagasiside!',
  34608. error2: 'Hinnang tuleks täita vähemalt üks kord tervikuna!',
  34609. error3: 'Hinnang pole kõrge, nii et siil magab!',
  34610. error4: 'Hinnang peaks olema paaritu arv, et see võiks areneda siiliks!',
  34611. error5: 'Hinnangu kõrgus või laius on mobiiltelefonil raskesti puudutatav!'
  34612. },
  34613. timePicker: {
  34614. defaultTitle: 'Palun valige',
  34615. defaultCancel: 'Tühista',
  34616. defaultConfirm: 'Kinnita',
  34617. defaultYear: 'Aasta',
  34618. defaultMonth: 'Kuu',
  34619. defaultDay: 'Päev',
  34620. defaultHour: 'Tund',
  34621. defaultMinute: 'Minut',
  34622. defaultSecond: 'Sekund'
  34623. },
  34624. calendar: {
  34625. weekTextList: ['P', 'E', 'T', 'K', 'N', 'R', 'L'],
  34626. weekSundayStartTextList: ['L', 'P', 'E', 'T', 'K', 'N', 'R'],
  34627. monthTextList: [
  34628. 'Jaanuar',
  34629. 'Veebruar',
  34630. 'Märts',
  34631. 'Aprill',
  34632. 'Mai',
  34633. 'Juuni',
  34634. 'Juuli',
  34635. 'August',
  34636. 'September',
  34637. 'Oktoober',
  34638. 'November',
  34639. 'Detsember'
  34640. ],
  34641. confirmText: 'Kinnita',
  34642. selectedText: 'Valitud',
  34643. dayText: 'päev',
  34644. beforeText: 'Enne',
  34645. afterText: 'Pärast',
  34646. currentWeekText: 'See nädal',
  34647. currentMonthText: 'See kuu',
  34648. currentQuarterText: 'See kvartal'
  34649. }
  34650. };
  34651. export default et_EE;
  34652. ================================================
  34653. FILE: packages/stdf/src/lib/lang/eu_ES.ts
  34654. ================================================
  34655. import type { LangProps } from './index.js';
  34656. const eu_ES: LangProps = {
  34657. common: {
  34658. slotEmpty: 'Slot-a hutsik dago!',
  34659. loading: 'Kargatzen...',
  34660. noData: 'Datu gabe',
  34661. noMoreData: 'Ez dago gehio datu',
  34662. done: 'Eginda'
  34663. },
  34664. actionSheet: {
  34665. cancelText: 'Utzi'
  34666. },
  34667. bottomSheet: {
  34668. title: 'Izenburua'
  34669. },
  34670. dialog: {
  34671. title: 'Kontuz!',
  34672. content: 'Edukia',
  34673. primaryText: 'Onartu',
  34674. secondaryText: 'Utzi'
  34675. },
  34676. input: {
  34677. pleaseInput: 'Mesedez sartu'
  34678. },
  34679. modal: {
  34680. title: 'Izenburua',
  34681. content: 'Edukia',
  34682. btnText: 'Onartu'
  34683. },
  34684. navBar: {
  34685. title: 'Izenburua'
  34686. },
  34687. pagination: {
  34688. defaultOnlyOnePage: 'Orri bakarra'
  34689. },
  34690. picker: {
  34691. defaultTitle: 'Aukeratu mesedez',
  34692. defaultCancel: 'Utzi',
  34693. defaultConfirm: 'Onartu'
  34694. },
  34695. asyncPicker: {
  34696. defaultTitle: 'Aukeratu mesedez',
  34697. defaultCancel: 'Utzi',
  34698. defaultConfirm: 'Onartu',
  34699. defaultNext: 'Hurrengoa',
  34700. defaultPrev: 'Aurrekoa',
  34701. defaultSelected: 'Aukeratuta'
  34702. },
  34703. rate: {
  34704. error1: 'Kalifikazioa ezin da zure iruzkina orokorrean baino handiagoa izan!',
  34705. error2: 'Kalifikazioa gutxienez osatu behar da oso bat aldiz!',
  34706. error3: 'Kalifikazioa ez da handia, beraz oxela altxatuta dago!',
  34707. error4: 'Kalifikazioa zenbaki bakoitzean asmatu behar da, sihinez armadillo bihurtzeko!',
  34708. error5: 'Kalifikazioaren altuera edo zabalera txarto sakatzea da telefono mugikorrean!'
  34709. },
  34710. timePicker: {
  34711. defaultTitle: 'Aukeratu mesedez',
  34712. defaultCancel: 'Utzi',
  34713. defaultConfirm: 'Onartu',
  34714. defaultYear: 'Urtea',
  34715. defaultMonth: 'Hilabetea',
  34716. defaultDay: 'Eguna',
  34717. defaultHour: 'Ordua',
  34718. defaultMinute: 'Minutua',
  34719. defaultSecond: 'Segundoa'
  34720. },
  34721. calendar: {
  34722. weekTextList: ['Ig.', 'Al.', 'Ar.', 'Az.', 'Og.', 'Or.', 'La.'],
  34723. weekSundayStartTextList: ['La.', 'Ig.', 'Al.', 'Ar.', 'Az.', 'Og.', 'Or.'],
  34724. monthTextList: [
  34725. 'Urtarrila',
  34726. 'Otsaila',
  34727. 'Martxoa',
  34728. 'Apirila',
  34729. 'Maiatza',
  34730. 'Ekaina',
  34731. 'Uztaila',
  34732. 'Abuztua',
  34733. 'Iraila',
  34734. 'Urria',
  34735. 'Azaroa',
  34736. 'Abendua'
  34737. ],
  34738. confirmText: 'Onartu',
  34739. selectedText: 'Aukeratuta',
  34740. dayText: 'eguna',
  34741. beforeText: 'Aurretik',
  34742. afterText: 'Ondoren',
  34743. currentWeekText: 'Aste hau',
  34744. currentMonthText: 'Hilabete hau',
  34745. currentQuarterText: 'Gertaera hau'
  34746. }
  34747. };
  34748. export default eu_ES;
  34749. ================================================
  34750. FILE: packages/stdf/src/lib/lang/fa_IR.ts
  34751. ================================================
  34752. import type { LangProps } from './index.js';
  34753. const fa_IR: LangProps = {
  34754. common: {
  34755. slotEmpty: 'اسلات خالی است!',
  34756. loading: 'در حال بارگذاری...',
  34757. noData: 'هیچ داده‌ای موجود نیست',
  34758. noMoreData: 'دیگر داده‌ای موجود نیست',
  34759. done: 'انجام شد'
  34760. },
  34761. actionSheet: {
  34762. cancelText: 'لغو'
  34763. },
  34764. bottomSheet: {
  34765. title: 'عنوان'
  34766. },
  34767. dialog: {
  34768. title: 'هشدار',
  34769. content: 'محتوا',
  34770. primaryText: 'تایید',
  34771. secondaryText: 'لغو'
  34772. },
  34773. input: {
  34774. pleaseInput: 'لطفا وارد کنید'
  34775. },
  34776. modal: {
  34777. title: 'عنوان',
  34778. content: 'محتوا',
  34779. btnText: 'تایید'
  34780. },
  34781. navBar: {
  34782. title: 'عنوان'
  34783. },
  34784. pagination: {
  34785. defaultOnlyOnePage: 'فقط یک صفحه وجود دارد'
  34786. },
  34787. picker: {
  34788. defaultTitle: 'لطفا انتخاب کنید',
  34789. defaultCancel: 'لغو',
  34790. defaultConfirm: 'تایید'
  34791. },
  34792. asyncPicker: {
  34793. defaultTitle: 'لطفا انتخاب کنید',
  34794. defaultCancel: 'لغو',
  34795. defaultConfirm: 'تایید',
  34796. defaultNext: 'بعدی',
  34797. defaultPrev: 'قبلی',
  34798. defaultSelected: 'انتخاب شده'
  34799. },
  34800. rate: {
  34801. error1: 'رتبه‌بندی نباید از کل بازخورد شما بیشتر باشد!',
  34802. error2: 'رتبه‌بندی باید حداقل یکبار کامل شود!',
  34803. error3: 'رتبه‌بندی بخش‌بخش است، بنابراین خزنده در حال خوابیدن است!',
  34804. error4: 'رتبه‌بندی باید یک عدد فرد باشد تا بتواند به خزنده تبدیل شود!',
  34805. error5: 'ارتفاع یا عرض ارزیابی بسیار سخت بر روی تلفن همراه است!'
  34806. },
  34807. timePicker: {
  34808. defaultTitle: 'لطفا انتخاب کنید',
  34809. defaultCancel: 'لغو',
  34810. defaultConfirm: 'تایید',
  34811. defaultYear: 'سال',
  34812. defaultMonth: 'ماه',
  34813. defaultDay: 'روز',
  34814. defaultHour: 'ساعت',
  34815. defaultMinute: 'دقیقه',
  34816. defaultSecond: 'ثانیه'
  34817. },
  34818. calendar: {
  34819. weekTextList: ['یک', 'دو', 'سه', 'چهار', 'پنج', 'جمعه', 'شنبه'],
  34820. weekSundayStartTextList: ['ش', 'ی', 'د', 'س', 'چ', 'پ', 'ج'],
  34821. monthTextList: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'می', 'ژوئن', 'جولای', 'آگوست', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'],
  34822. confirmText: 'تایید',
  34823. selectedText: 'انتخاب شده',
  34824. dayText: 'روز',
  34825. beforeText: 'پیش',
  34826. afterText: 'بعد',
  34827. currentWeekText: 'هفته جاری',
  34828. currentMonthText: 'ماه جاری',
  34829. currentQuarterText: 'سه ماهه جاری'
  34830. }
  34831. };
  34832. export default fa_IR;
  34833. ================================================
  34834. FILE: packages/stdf/src/lib/lang/fi_FI.ts
  34835. ================================================
  34836. import type { LangProps } from './index.js';
  34837. const fi_FI: LangProps = {
  34838. common: {
  34839. slotEmpty: 'Paikka on tyhjä!',
  34840. loading: 'Ladataan...',
  34841. noData: 'Ei dataa',
  34842. noMoreData: 'Ei enempää tietoja',
  34843. done: 'Valmis'
  34844. },
  34845. actionSheet: {
  34846. cancelText: 'Peruuta'
  34847. },
  34848. bottomSheet: {
  34849. title: 'Otsikko'
  34850. },
  34851. dialog: {
  34852. title: 'Varoitus',
  34853. content: 'Sisältö',
  34854. primaryText: 'Vahvista',
  34855. secondaryText: 'Peruuta'
  34856. },
  34857. input: {
  34858. pleaseInput: 'Kirjoita tähän'
  34859. },
  34860. modal: {
  34861. title: 'Otsikko',
  34862. content: 'Sisältö',
  34863. btnText: 'OK'
  34864. },
  34865. navBar: {
  34866. title: 'Otsikko'
  34867. },
  34868. pagination: {
  34869. defaultOnlyOnePage: 'Vain yksi sivu'
  34870. },
  34871. picker: {
  34872. defaultTitle: 'Valitse',
  34873. defaultCancel: 'Peruuta',
  34874. defaultConfirm: 'OK'
  34875. },
  34876. asyncPicker: {
  34877. defaultTitle: 'Valitse',
  34878. defaultCancel: 'Peruuta',
  34879. defaultConfirm: 'OK',
  34880. defaultNext: 'Seuraava',
  34881. defaultPrev: 'Edellinen',
  34882. defaultSelected: 'Valittu'
  34883. },
  34884. rate: {
  34885. error1: 'Arvostelun ei pitäisi olla suurempi kuin yhteenvetosi!',
  34886. error2: 'Arvostelu on täytettävä vähintään kerran!',
  34887. error3: 'Arvostelu on osioittain, joten pöllö nukkuu!',
  34888. error4: 'Arvostelun on oltava yksi parittomista numeroista muuttaakseen sen kiharaksi!',
  34889. error5: 'Arvostelun korkeus tai leveys on liian pieni puhelimessa!'
  34890. },
  34891. timePicker: {
  34892. defaultTitle: 'Valitse',
  34893. defaultCancel: 'Peruuta',
  34894. defaultConfirm: 'OK',
  34895. defaultYear: 'Vuosi',
  34896. defaultMonth: 'Kuukausi',
  34897. defaultDay: 'Päivä',
  34898. defaultHour: 'Tunti',
  34899. defaultMinute: 'Minuutti',
  34900. defaultSecond: 'Sekunti'
  34901. },
  34902. calendar: {
  34903. weekTextList: ['Su', 'Ma', 'Ti', 'Ke', 'To', 'Pe', 'La'],
  34904. weekSundayStartTextList: ['Su', 'Ma', 'Ti', 'Ke', 'To', 'Pe', 'La'],
  34905. monthTextList: [
  34906. 'Tammikuu',
  34907. 'Helmikuu',
  34908. 'Maaliskuu',
  34909. 'Huhtikuu',
  34910. 'Toukokuu',
  34911. 'Kesäkuu',
  34912. 'Heinäkuu',
  34913. 'Elokuu',
  34914. 'Syyskuu',
  34915. 'Lokakuu',
  34916. 'Marraskuu',
  34917. 'Joulukuu'
  34918. ],
  34919. confirmText: 'OK',
  34920. selectedText: 'Valittu',
  34921. dayText: 'Päivä',
  34922. beforeText: 'Ennen',
  34923. afterText: 'Jälkeen',
  34924. currentWeekText: 'Nykyinen viikko',
  34925. currentMonthText: 'Nykyinen kuukausi',
  34926. currentQuarterText: 'Nykyinen neljännesvuosi'
  34927. }
  34928. };
  34929. export default fi_FI;
  34930. ================================================
  34931. FILE: packages/stdf/src/lib/lang/fr_BE.ts
  34932. ================================================
  34933. import type { LangProps } from './index.js';
  34934. const fr_BE: LangProps = {
  34935. common: {
  34936. slotEmpty: 'Emplacement libre!',
  34937. loading: 'Chargement en cours...',
  34938. noData: 'Aucune donnée',
  34939. noMoreData: 'Plus de données',
  34940. done: 'Terminé'
  34941. },
  34942. actionSheet: {
  34943. cancelText: 'Annuler'
  34944. },
  34945. bottomSheet: {
  34946. title: 'Titre'
  34947. },
  34948. dialog: {
  34949. title: 'Avertissement',
  34950. content: 'Contenu',
  34951. primaryText: 'Confirmer',
  34952. secondaryText: 'Annuler'
  34953. },
  34954. input: {
  34955. pleaseInput: 'Veuillez renseigner'
  34956. },
  34957. modal: {
  34958. title: 'Titre',
  34959. content: 'Contenu',
  34960. btnText: 'OK'
  34961. },
  34962. navBar: {
  34963. title: 'Titre'
  34964. },
  34965. pagination: {
  34966. defaultOnlyOnePage: 'Une seule page'
  34967. },
  34968. picker: {
  34969. defaultTitle: 'Choisir',
  34970. defaultCancel: 'Annuler',
  34971. defaultConfirm: 'OK'
  34972. },
  34973. asyncPicker: {
  34974. defaultTitle: 'Sélectionner',
  34975. defaultCancel: 'Annuler',
  34976. defaultConfirm: 'OK',
  34977. defaultNext: 'Suivant',
  34978. defaultPrev: 'Précédent',
  34979. defaultSelected: 'Sélectionné'
  34980. },
  34981. rate: {
  34982. error1: "L'évaluation ne doit pas être supérieure à votre résumé !",
  34983. error2: "L'évaluation doit être remplie au moins une fois !",
  34984. error3: "L'évaluation est en morceaux, alors la chouette est endormie !",
  34985. error4: "L'évaluation doit être un nombre impair pour la rendre chouette!",
  34986. error5: "La hauteur ou la largeur de l'évaluation est trop petite sur un téléphone !"
  34987. },
  34988. timePicker: {
  34989. defaultTitle: 'Choisir',
  34990. defaultCancel: 'Annuler',
  34991. defaultConfirm: 'OK',
  34992. defaultYear: 'Année',
  34993. defaultMonth: 'Mois',
  34994. defaultDay: 'Jour',
  34995. defaultHour: 'Heure',
  34996. defaultMinute: 'Minute',
  34997. defaultSecond: 'Seconde'
  34998. },
  34999. calendar: {
  35000. weekTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35001. weekSundayStartTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35002. monthTextList: [
  35003. 'Janvier',
  35004. 'Février',
  35005. 'Mars',
  35006. 'Avril',
  35007. 'Mai',
  35008. 'Juin',
  35009. 'Juillet',
  35010. 'Août',
  35011. 'Septembre',
  35012. 'Octobre',
  35013. 'Novembre',
  35014. 'Décembre'
  35015. ],
  35016. confirmText: 'OK',
  35017. selectedText: 'Sélectionné',
  35018. dayText: 'Jour',
  35019. beforeText: 'Avant',
  35020. afterText: 'Après',
  35021. currentWeekText: 'Semaine en cours',
  35022. currentMonthText: 'Mois en cours',
  35023. currentQuarterText: 'Trimestre en cours'
  35024. }
  35025. };
  35026. export default fr_BE;
  35027. ================================================
  35028. FILE: packages/stdf/src/lib/lang/fr_CA.ts
  35029. ================================================
  35030. import type { LangProps } from './index.js';
  35031. const fr_CA: LangProps = {
  35032. common: {
  35033. slotEmpty: 'Emplacement libre!',
  35034. loading: 'Chargement en cours...',
  35035. noData: 'Aucune donnée',
  35036. noMoreData: 'Plus de données',
  35037. done: 'Terminé'
  35038. },
  35039. actionSheet: {
  35040. cancelText: 'Annuler'
  35041. },
  35042. bottomSheet: {
  35043. title: 'Titre'
  35044. },
  35045. dialog: {
  35046. title: 'Avertissement',
  35047. content: 'Contenu',
  35048. primaryText: 'Confirmer',
  35049. secondaryText: 'Annuler'
  35050. },
  35051. input: {
  35052. pleaseInput: 'Veuillez renseigner'
  35053. },
  35054. modal: {
  35055. title: 'Titre',
  35056. content: 'Contenu',
  35057. btnText: 'OK'
  35058. },
  35059. navBar: {
  35060. title: 'Titre'
  35061. },
  35062. pagination: {
  35063. defaultOnlyOnePage: 'Une seule page'
  35064. },
  35065. picker: {
  35066. defaultTitle: 'Choisir',
  35067. defaultCancel: 'Annuler',
  35068. defaultConfirm: 'OK'
  35069. },
  35070. asyncPicker: {
  35071. defaultTitle: 'Sélectionner',
  35072. defaultCancel: 'Annuler',
  35073. defaultConfirm: 'OK',
  35074. defaultNext: 'Suivant',
  35075. defaultPrev: 'Précédent',
  35076. defaultSelected: 'Sélectionné'
  35077. },
  35078. rate: {
  35079. error1: "L'évaluation ne doit pas être supérieure à votre résumé !",
  35080. error2: "L'évaluation doit être remplie au moins une fois !",
  35081. error3: "L'évaluation est en morceaux, alors la chouette est endormie !",
  35082. error4: "L'évaluation doit être un nombre impair pour la rendre chouette!",
  35083. error5: "La hauteur ou la largeur de l'évaluation est trop petite sur un téléphone !"
  35084. },
  35085. timePicker: {
  35086. defaultTitle: 'Choisir',
  35087. defaultCancel: 'Annuler',
  35088. defaultConfirm: 'OK',
  35089. defaultYear: 'Année',
  35090. defaultMonth: 'Mois',
  35091. defaultDay: 'Jour',
  35092. defaultHour: 'Heure',
  35093. defaultMinute: 'Minute',
  35094. defaultSecond: 'Seconde'
  35095. },
  35096. calendar: {
  35097. weekTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35098. weekSundayStartTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35099. monthTextList: [
  35100. 'Janvier',
  35101. 'Février',
  35102. 'Mars',
  35103. 'Avril',
  35104. 'Mai',
  35105. 'Juin',
  35106. 'Juillet',
  35107. 'Août',
  35108. 'Septembre',
  35109. 'Octobre',
  35110. 'Novembre',
  35111. 'Décembre'
  35112. ],
  35113. confirmText: 'OK',
  35114. selectedText: 'Sélectionné',
  35115. dayText: 'Jour',
  35116. beforeText: 'Avant',
  35117. afterText: 'Après',
  35118. currentWeekText: 'Semaine en cours',
  35119. currentMonthText: 'Mois en cours',
  35120. currentQuarterText: 'Trimestre en cours'
  35121. }
  35122. };
  35123. export default fr_CA;
  35124. ================================================
  35125. FILE: packages/stdf/src/lib/lang/fr_FR.ts
  35126. ================================================
  35127. import type { LangProps } from './index.js';
  35128. const fr_FR: LangProps = {
  35129. common: {
  35130. slotEmpty: 'Emplacement libre!',
  35131. loading: 'Chargement en cours...',
  35132. noData: 'Aucune donnée',
  35133. noMoreData: 'Plus de données',
  35134. done: 'Terminé'
  35135. },
  35136. actionSheet: {
  35137. cancelText: 'Annuler'
  35138. },
  35139. bottomSheet: {
  35140. title: 'Titre'
  35141. },
  35142. dialog: {
  35143. title: 'Avertissement',
  35144. content: 'Contenu',
  35145. primaryText: 'Confirmer',
  35146. secondaryText: 'Annuler'
  35147. },
  35148. input: {
  35149. pleaseInput: 'Veuillez renseigner'
  35150. },
  35151. modal: {
  35152. title: 'Titre',
  35153. content: 'Contenu',
  35154. btnText: 'OK'
  35155. },
  35156. navBar: {
  35157. title: 'Titre'
  35158. },
  35159. pagination: {
  35160. defaultOnlyOnePage: 'Une seule page'
  35161. },
  35162. picker: {
  35163. defaultTitle: 'Choisir',
  35164. defaultCancel: 'Annuler',
  35165. defaultConfirm: 'OK'
  35166. },
  35167. asyncPicker: {
  35168. defaultTitle: 'Sélectionner',
  35169. defaultCancel: 'Annuler',
  35170. defaultConfirm: 'OK',
  35171. defaultNext: 'Suivant',
  35172. defaultPrev: 'Précédent',
  35173. defaultSelected: 'Sélectionné'
  35174. },
  35175. rate: {
  35176. error1: "L'évaluation ne doit pas être supérieure à votre résumé !",
  35177. error2: "L'évaluation doit être remplie au moins une fois !",
  35178. error3: "L'évaluation est en morceaux, alors la chouette est endormie !",
  35179. error4: "L'évaluation doit être un nombre impair pour la rendre chouette!",
  35180. error5: "La hauteur ou la largeur de l'évaluation est trop petite sur un téléphone !"
  35181. },
  35182. timePicker: {
  35183. defaultTitle: 'Choisir',
  35184. defaultCancel: 'Annuler',
  35185. defaultConfirm: 'OK',
  35186. defaultYear: 'Année',
  35187. defaultMonth: 'Mois',
  35188. defaultDay: 'Jour',
  35189. defaultHour: 'Heure',
  35190. defaultMinute: 'Minute',
  35191. defaultSecond: 'Seconde'
  35192. },
  35193. calendar: {
  35194. weekTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35195. weekSundayStartTextList: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  35196. monthTextList: [
  35197. 'Janvier',
  35198. 'Février',
  35199. 'Mars',
  35200. 'Avril',
  35201. 'Mai',
  35202. 'Juin',
  35203. 'Juillet',
  35204. 'Août',
  35205. 'Septembre',
  35206. 'Octobre',
  35207. 'Novembre',
  35208. 'Décembre'
  35209. ],
  35210. confirmText: 'OK',
  35211. selectedText: 'Sélectionné',
  35212. dayText: 'Jour',
  35213. beforeText: 'Avant',
  35214. afterText: 'Après',
  35215. currentWeekText: 'Semaine en cours',
  35216. currentMonthText: 'Mois en cours',
  35217. currentQuarterText: 'Trimestre en cours'
  35218. }
  35219. };
  35220. export default fr_FR;
  35221. ================================================
  35222. FILE: packages/stdf/src/lib/lang/ga_IE.ts
  35223. ================================================
  35224. import type { LangProps } from './index.js';
  35225. const ga_IE: LangProps = {
  35226. common: {
  35227. slotEmpty: 'Sábháil oscailte!',
  35228. loading: 'Lodáil i gceist...',
  35229. noData: 'Níl aon sonraí ann',
  35230. noMoreData: 'Níl tuilleadh sonraí',
  35231. done: 'Déanta'
  35232. },
  35233. actionSheet: {
  35234. cancelText: 'Cealaigh'
  35235. },
  35236. bottomSheet: {
  35237. title: 'Teideal'
  35238. },
  35239. dialog: {
  35240. title: 'Rabhadh',
  35241. content: 'Ábhar',
  35242. primaryText: 'Deimhnigh',
  35243. secondaryText: 'Cealaigh'
  35244. },
  35245. input: {
  35246. pleaseInput: 'Cuir isteach le do thoil'
  35247. },
  35248. modal: {
  35249. title: 'Teideal',
  35250. content: 'Ábhar',
  35251. btnText: 'Ceart go leor'
  35252. },
  35253. navBar: {
  35254. title: 'Teideal'
  35255. },
  35256. pagination: {
  35257. defaultOnlyOnePage: 'Níl ach leathanach amháin ann'
  35258. },
  35259. picker: {
  35260. defaultTitle: 'Roghnaigh',
  35261. defaultCancel: 'Cealaigh',
  35262. defaultConfirm: 'Ceart go leor'
  35263. },
  35264. asyncPicker: {
  35265. defaultTitle: 'Roghnaigh',
  35266. defaultCancel: 'Cealaigh',
  35267. defaultConfirm: 'Ceart go leor',
  35268. defaultNext: 'Ar aghaidh',
  35269. defaultPrev: 'Anois siar',
  35270. defaultSelected: 'Roghnaithe'
  35271. },
  35272. rate: {
  35273. error1: 'Ní féidir an luacháil a bheith níos mó ná do chuid tuairimí!',
  35274. error2: 'Caithfidh an luacháil a líonadh ar a laghad amháin!',
  35275. error3: 'Tá an luacháil briste, is ea, taitníonn an t-úll dom!',
  35276. error4: 'Ní mór don luacháil a bheith uimhriúil leis an t-úll a dhéanamh astu!',
  35277. error5: 'Tá an méid nó an leithead an luachála ró-ghairid ar fón póca!'
  35278. },
  35279. timePicker: {
  35280. defaultTitle: 'Roghnaigh',
  35281. defaultCancel: 'Cealaigh',
  35282. defaultConfirm: 'Ceart go leor',
  35283. defaultYear: 'Bliain',
  35284. defaultMonth: 'Mí',
  35285. defaultDay: 'Lá',
  35286. defaultHour: 'Uair',
  35287. defaultMinute: 'Nóiméad',
  35288. defaultSecond: 'Soicind'
  35289. },
  35290. calendar: {
  35291. weekTextList: ['Domh', 'Luan', 'Mái', 'Céa', 'Déa', 'Aoi', 'Sat'],
  35292. weekSundayStartTextList: ['Déa', 'Luan', 'Mái', 'Céa', 'Déa', 'Aoi', 'Sat'],
  35293. monthTextList: [
  35294. 'Eanáir',
  35295. 'Feabhra',
  35296. 'Márta',
  35297. 'Aibreán',
  35298. 'Bealtaine',
  35299. 'Meitheamh',
  35300. 'Iúil',
  35301. 'Lúnasa',
  35302. 'Meán Fómhair',
  35303. 'Deireadh Fomhair',
  35304. 'Samhain',
  35305. 'Nollaig'
  35306. ],
  35307. confirmText: 'Ceart go leor',
  35308. selectedText: 'Roghnaithe',
  35309. dayText: 'Lá',
  35310. beforeText: 'Roimh',
  35311. afterText: 'Tar éis',
  35312. currentWeekText: 'Seachtain reatha',
  35313. currentMonthText: 'Mí reatha',
  35314. currentQuarterText: 'Ráithe reatha'
  35315. }
  35316. };
  35317. export default ga_IE;
  35318. ================================================
  35319. FILE: packages/stdf/src/lib/lang/gl_ES.ts
  35320. ================================================
  35321. import type { LangProps } from './index.js';
  35322. const gl_ES: LangProps = {
  35323. common: {
  35324. slotEmpty: 'ranura vacía!',
  35325. loading: 'Cargando...',
  35326. noData: 'Ningún dato',
  35327. noMoreData: 'No hay más datos',
  35328. done: 'Hecho'
  35329. },
  35330. actionSheet: {
  35331. cancelText: 'Cancelar'
  35332. },
  35333. bottomSheet: {
  35334. title: 'Título'
  35335. },
  35336. dialog: {
  35337. title: 'Aviso',
  35338. content: 'Contenido',
  35339. primaryText: 'Confirmar',
  35340. secondaryText: 'Cancelar'
  35341. },
  35342. input: {
  35343. pleaseInput: 'Por favor introduzca'
  35344. },
  35345. modal: {
  35346. title: 'Título',
  35347. content: 'Contenido',
  35348. btnText: 'De acuerdo'
  35349. },
  35350. navBar: {
  35351. title: 'Título'
  35352. },
  35353. pagination: {
  35354. defaultOnlyOnePage: 'Solo hay una página'
  35355. },
  35356. picker: {
  35357. defaultTitle: 'Elixir',
  35358. defaultCancel: 'Cancelar',
  35359. defaultConfirm: 'De acuerdo'
  35360. },
  35361. asyncPicker: {
  35362. defaultTitle: 'Seleccionar',
  35363. defaultCancel: 'Cancelar',
  35364. defaultConfirm: 'De acuerdo',
  35365. defaultNext: 'Próximo',
  35366. defaultPrev: 'Anterior',
  35367. defaultSelected: 'Seleccionados'
  35368. },
  35369. rate: {
  35370. error1: '¡La valoración no puede ser mayor que el resumen!',
  35371. error2: '¡La valoración debe ser completada al menos una vez!',
  35372. error3: 'La valoración está rota, ¡así que la lechuza está durmiendo!',
  35373. error4: '¡La valoración debe ser un número impar para hacerla genial!',
  35374. error5: '¡La altura o ancho de la valoración es demasiado pequeña en un teléfono!'
  35375. },
  35376. timePicker: {
  35377. defaultTitle: 'Elixir',
  35378. defaultCancel: 'Cancelar',
  35379. defaultConfirm: 'De acuerdo',
  35380. defaultYear: 'Año',
  35381. defaultMonth: 'Mes',
  35382. defaultDay: 'Día',
  35383. defaultHour: 'Hora',
  35384. defaultMinute: 'Minuto',
  35385. defaultSecond: 'Segundo'
  35386. },
  35387. calendar: {
  35388. weekTextList: ['Dom', 'Lun', 'Mar', 'Mér', 'Xov', 'Ven', 'Sáb'],
  35389. weekSundayStartTextList: ['Dom', 'Lun', 'Mar', 'Mér', 'Xob', 'Ven', 'Sáb'],
  35390. monthTextList: ['Xan', 'Feb', 'Maz', 'Abr', 'Mai', 'Xun', 'Xul', 'Ago', 'Set', 'Out', 'Nov', 'Dec'],
  35391. confirmText: 'De acuerdo',
  35392. selectedText: 'Seleccionados',
  35393. dayText: 'Día',
  35394. beforeText: 'Antes',
  35395. afterText: 'Despois',
  35396. currentWeekText: 'Semana actual',
  35397. currentMonthText: 'Este mes',
  35398. currentQuarterText: 'Este cuarto'
  35399. }
  35400. };
  35401. export default gl_ES;
  35402. ================================================
  35403. FILE: packages/stdf/src/lib/lang/he_IL.ts
  35404. ================================================
  35405. import type { LangProps } from './index.js';
  35406. const he_IL: LangProps = {
  35407. common: {
  35408. slotEmpty: 'ריק!',
  35409. loading: 'טוען...',
  35410. noData: 'אין נתונים',
  35411. noMoreData: 'אין יותר נתונים',
  35412. done: 'סיום'
  35413. },
  35414. actionSheet: {
  35415. cancelText: 'בטל'
  35416. },
  35417. bottomSheet: {
  35418. title: 'כותרת'
  35419. },
  35420. dialog: {
  35421. title: 'הודעה',
  35422. content: 'תוכן',
  35423. primaryText: 'אישור',
  35424. secondaryText: 'בטל'
  35425. },
  35426. input: {
  35427. pleaseInput: 'אנא הזן'
  35428. },
  35429. modal: {
  35430. title: 'כותרת',
  35431. content: 'תוכן',
  35432. btnText: 'אישור'
  35433. },
  35434. navBar: {
  35435. title: 'כותרת'
  35436. },
  35437. pagination: {
  35438. defaultOnlyOnePage: 'רק דף אחד'
  35439. },
  35440. picker: {
  35441. defaultTitle: 'בחר',
  35442. defaultCancel: 'בטל',
  35443. defaultConfirm: 'אישור'
  35444. },
  35445. asyncPicker: {
  35446. defaultTitle: 'בחר',
  35447. defaultCancel: 'בטל',
  35448. defaultConfirm: 'אישור',
  35449. defaultNext: 'הבא',
  35450. defaultPrev: 'הקודם',
  35451. defaultSelected: 'נבחרים'
  35452. },
  35453. rate: {
  35454. error1: 'הדירוג לא יכול להיות גבוה יותר מהסיכומים!',
  35455. error2: 'נדרש להשלים את הדירוג לפחות פעם אחת!',
  35456. error3: 'הדירוג שבור, לכן אני אוהב את התפוח שלי לישון!',
  35457. error4: 'הדירוג חייב להיות מספר אי-זוגי כדי להיות מגניב!',
  35458. error5: 'הגובה או הרוחב של הדירוג קטן מדי בטלפון!'
  35459. },
  35460. timePicker: {
  35461. defaultTitle: 'בחר',
  35462. defaultCancel: 'בטל',
  35463. defaultConfirm: 'אישור',
  35464. defaultYear: 'שנה',
  35465. defaultMonth: 'חודש',
  35466. defaultDay: 'יום',
  35467. defaultHour: 'שעה',
  35468. defaultMinute: 'דקה',
  35469. defaultSecond: 'שניה'
  35470. },
  35471. calendar: {
  35472. weekTextList: ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'],
  35473. weekSundayStartTextList: ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'],
  35474. monthTextList: ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'],
  35475. confirmText: 'אישור',
  35476. selectedText: 'נבחרים',
  35477. dayText: 'יום',
  35478. beforeText: 'לפני',
  35479. afterText: 'אחרי',
  35480. currentWeekText: 'שבוע נוכחי',
  35481. currentMonthText: 'חודש נוכחי',
  35482. currentQuarterText: 'רבעון נוכחי'
  35483. }
  35484. };
  35485. export default he_IL;
  35486. ================================================
  35487. FILE: packages/stdf/src/lib/lang/hi_IN.ts
  35488. ================================================
  35489. import type { LangProps } from './index.js';
  35490. const hi_IN: LangProps = {
  35491. common: {
  35492. slotEmpty: 'खाली!',
  35493. loading: 'लोड हो रहा है...',
  35494. noData: 'कोई डेटा नहीं',
  35495. noMoreData: 'और डेटा नहीं',
  35496. done: 'पूरा कर लिया'
  35497. },
  35498. actionSheet: {
  35499. cancelText: 'रद्द करें'
  35500. },
  35501. bottomSheet: {
  35502. title: 'शीर्षक'
  35503. },
  35504. dialog: {
  35505. title: 'सूचना',
  35506. content: 'सामग्री',
  35507. primaryText: 'अभिप्राय दर्ज करें',
  35508. secondaryText: 'रद्द करें'
  35509. },
  35510. input: {
  35511. pleaseInput: 'कृपया इनपुट करें'
  35512. },
  35513. modal: {
  35514. title: 'शीर्षक',
  35515. content: 'सामग्री',
  35516. btnText: 'ठीक है'
  35517. },
  35518. navBar: {
  35519. title: 'शीर्षक'
  35520. },
  35521. pagination: {
  35522. defaultOnlyOnePage: 'केवल एक पृष्ठ'
  35523. },
  35524. picker: {
  35525. defaultTitle: 'चयन करें',
  35526. defaultCancel: 'रद्द करें',
  35527. defaultConfirm: 'ठीक है'
  35528. },
  35529. asyncPicker: {
  35530. defaultTitle: 'चयन करें',
  35531. defaultCancel: 'रद्द करें',
  35532. defaultConfirm: 'ठीक है',
  35533. defaultNext: 'अगला',
  35534. defaultPrev: 'पिछला',
  35535. defaultSelected: 'चयनित'
  35536. },
  35537. rate: {
  35538. error1: 'रेटिंग जमा आंकड़े से अधिक नहीं हो सकती!',
  35539. error2: 'कम से कम एक बार रेटिंग पूर्ण करनी चाहिए!',
  35540. error3: 'रेटिंग टूटी हुई है, इसलिए मैं अपनी गुलाब की नींद को पसंद करता हूँ!',
  35541. error4: 'रेटिंग केवल विषम संख्या होनी चाहिए ताकि यह ग्रेट हो सके!',
  35542. error5: 'फोन पर रेटिंग का ऊंचाई या चौड़ाई बहुत कम है!'
  35543. },
  35544. timePicker: {
  35545. defaultTitle: 'चयन करें',
  35546. defaultCancel: 'रद्द करें',
  35547. defaultConfirm: 'ठीक है',
  35548. defaultYear: 'वर्ष',
  35549. defaultMonth: 'महीना',
  35550. defaultDay: 'दिन',
  35551. defaultHour: 'घंटा',
  35552. defaultMinute: 'मिनट',
  35553. defaultSecond: 'सेकंड'
  35554. },
  35555. calendar: {
  35556. weekTextList: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
  35557. weekSundayStartTextList: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
  35558. monthTextList: ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'],
  35559. confirmText: 'ठीक है',
  35560. selectedText: 'चयनित',
  35561. dayText: 'दिन',
  35562. beforeText: 'पूर्व',
  35563. afterText: 'बाद',
  35564. currentWeekText: 'वर्तमान सप्ताह',
  35565. currentMonthText: 'वर्तमान महीना',
  35566. currentQuarterText: 'वर्तमान तिमाही'
  35567. }
  35568. };
  35569. export default hi_IN;
  35570. ================================================
  35571. FILE: packages/stdf/src/lib/lang/hr_HR.ts
  35572. ================================================
  35573. import type { LangProps } from './index.js';
  35574. const hr_HR: LangProps = {
  35575. common: {
  35576. slotEmpty: 'Sadržaj ulaza je prazan!',
  35577. loading: 'Učitavanje...',
  35578. noData: 'Nema dostupnih podataka',
  35579. noMoreData: 'Nema više podataka',
  35580. done: 'Gotovo'
  35581. },
  35582. actionSheet: {
  35583. cancelText: 'Otkaži'
  35584. },
  35585. bottomSheet: {
  35586. title: 'Naslov'
  35587. },
  35588. dialog: {
  35589. title: 'Savjet',
  35590. content: 'Sadržaj',
  35591. primaryText: 'Potvrdi',
  35592. secondaryText: 'Otkaži'
  35593. },
  35594. input: {
  35595. pleaseInput: 'Molimo unesite'
  35596. },
  35597. modal: {
  35598. title: 'Naslov',
  35599. content: 'Sadržaj',
  35600. btnText: 'Razumijem'
  35601. },
  35602. navBar: {
  35603. title: 'Naslov'
  35604. },
  35605. pagination: {
  35606. defaultOnlyOnePage: 'Samo jedna stranica'
  35607. },
  35608. picker: {
  35609. defaultTitle: 'Odaberite',
  35610. defaultCancel: 'Otkaži',
  35611. defaultConfirm: 'Potvrdi'
  35612. },
  35613. asyncPicker: {
  35614. defaultTitle: 'Odaberite',
  35615. defaultCancel: 'Otkaži',
  35616. defaultConfirm: 'Potvrdi',
  35617. defaultNext: 'Sljedeći',
  35618. defaultPrev: 'Prethodni',
  35619. defaultSelected: 'Odabran'
  35620. },
  35621. rate: {
  35622. error1: 'Vrijednost ne smije biti veća od Ukupno!',
  35623. error2: 'Ukupno se mora smanjiti za 1!',
  35624. error3: 'Vrijednost se mora smanjiti za 1 ako nije pola odabrana!',
  35625. error4: 'Vrijednost se mora smanjiti za 0,5 ako je pola odabrana!',
  35626. error5: 'Širina ili visina manja je od 20, što otežava klikanje u mobilnom uređaju!'
  35627. },
  35628. timePicker: {
  35629. defaultTitle: 'Odaberite',
  35630. defaultCancel: 'Otkaži',
  35631. defaultConfirm: 'Potvrdi',
  35632. defaultYear: 'Godina',
  35633. defaultMonth: 'Mjesec',
  35634. defaultDay: 'Dan',
  35635. defaultHour: 'Sat',
  35636. defaultMinute: 'Minute',
  35637. defaultSecond: 'Sekunde'
  35638. },
  35639. calendar: {
  35640. weekTextList: ['Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub', 'Ned'],
  35641. weekSundayStartTextList: ['Ned', 'Pon', 'Uto', 'Sri', 'Čet', 'Pet', 'Sub'],
  35642. monthTextList: [
  35643. 'Siječanj',
  35644. 'Veljača',
  35645. 'Ožujak',
  35646. 'Travanj',
  35647. 'Svibanj',
  35648. 'Lipanj',
  35649. 'Srpanj',
  35650. 'Kolovoz',
  35651. 'Rujan',
  35652. 'Listopad',
  35653. 'Studeni',
  35654. 'Prosinac'
  35655. ],
  35656. confirmText: 'Potvrdi',
  35657. selectedText: 'Odabrano',
  35658. dayText: 'Dan',
  35659. beforeText: 'Nedavno',
  35660. afterText: 'Budućnost',
  35661. currentWeekText: 'Ovaj tjedan',
  35662. currentMonthText: 'Ovaj mjesec',
  35663. currentQuarterText: 'Ovo tromjesečje'
  35664. }
  35665. };
  35666. export default hr_HR;
  35667. ================================================
  35668. FILE: packages/stdf/src/lib/lang/hu_HU.ts
  35669. ================================================
  35670. import type { LangProps } from './index.js';
  35671. const hu_HU: LangProps = {
  35672. common: {
  35673. slotEmpty: 'A bemenet tartalma üres!',
  35674. loading: 'Betöltés...',
  35675. noData: 'Nincsenek adatok',
  35676. noMoreData: 'Nincs több adat',
  35677. done: 'Kész'
  35678. },
  35679. actionSheet: {
  35680. cancelText: 'Mégsem'
  35681. },
  35682. bottomSheet: {
  35683. title: 'Cím'
  35684. },
  35685. dialog: {
  35686. title: 'Tipp',
  35687. content: 'Tartalom',
  35688. primaryText: 'Megerősít',
  35689. secondaryText: 'Mégsem'
  35690. },
  35691. input: {
  35692. pleaseInput: 'Kérem írja be'
  35693. },
  35694. modal: {
  35695. title: 'Cím',
  35696. content: 'Tartalom',
  35697. btnText: 'Értettem'
  35698. },
  35699. navBar: {
  35700. title: 'Cím'
  35701. },
  35702. pagination: {
  35703. defaultOnlyOnePage: 'Csak egy oldal'
  35704. },
  35705. picker: {
  35706. defaultTitle: 'Kérem válasszon',
  35707. defaultCancel: 'Mégsem',
  35708. defaultConfirm: 'Megerősít'
  35709. },
  35710. asyncPicker: {
  35711. defaultTitle: 'Kérem válasszon',
  35712. defaultCancel: 'Mégsem',
  35713. defaultConfirm: 'Megerősít',
  35714. defaultNext: 'Következő',
  35715. defaultPrev: 'Előző',
  35716. defaultSelected: 'Kiválasztott'
  35717. },
  35718. rate: {
  35719. error1: 'Az érték nem lehet nagyobb, mint az Összeg!',
  35720. error2: 'Az Összeget 1-gyel csökkenteni kell!',
  35721. error3: 'Az értéket 1-gyel csökkenteni kell, ha nem félkiválasztva!',
  35722. error4: 'Az értéknek 0,5-tel kell csökkennie, ha félkiválasztva!',
  35723. error5: 'A szélesség vagy a magasság 20-nál kisebb, ami nehezíti a mobil eszközön történő kattintást!'
  35724. },
  35725. timePicker: {
  35726. defaultTitle: 'Kérem válasszon',
  35727. defaultCancel: 'Mégsem',
  35728. defaultConfirm: 'Megerősít',
  35729. defaultYear: 'Év',
  35730. defaultMonth: 'Hónap',
  35731. defaultDay: 'Nap',
  35732. defaultHour: 'Óra',
  35733. defaultMinute: 'Perc',
  35734. defaultSecond: 'Másodperc'
  35735. },
  35736. calendar: {
  35737. weekTextList: ['Hét', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat', 'Vasárnap'],
  35738. weekSundayStartTextList: ['Vas', 'Hét', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
  35739. monthTextList: [
  35740. 'Január',
  35741. 'Február',
  35742. 'Március',
  35743. 'Április',
  35744. 'Május',
  35745. 'Június',
  35746. 'Július',
  35747. 'Augusztus',
  35748. 'Szeptember',
  35749. 'Október',
  35750. 'November',
  35751. 'December'
  35752. ],
  35753. confirmText: 'Megerősít',
  35754. selectedText: 'Kiválasztva',
  35755. dayText: 'Nap',
  35756. beforeText: 'Friss',
  35757. afterText: 'Jövő',
  35758. currentWeekText: 'Ezen a héten',
  35759. currentMonthText: 'Ebben a hónapban',
  35760. currentQuarterText: 'Ebben a negyedévben'
  35761. }
  35762. };
  35763. export default hu_HU;
  35764. ================================================
  35765. FILE: packages/stdf/src/lib/lang/hy_AM.ts
  35766. ================================================
  35767. import type { LangProps } from './index.js';
  35768. const hy_AM: LangProps = {
  35769. common: {
  35770. slotEmpty: 'Մուտքագրման բույլերի պարամետրերը դատարկ են!',
  35771. loading: 'Բեռնում...',
  35772. noData: 'Ոչ մի տվյալ',
  35773. noMoreData: 'Տվյալները ավելի չկան',
  35774. done: 'Ավարտված'
  35775. },
  35776. actionSheet: {
  35777. cancelText: 'Չեղարկել'
  35778. },
  35779. bottomSheet: {
  35780. title: 'Գլխավորություն'
  35781. },
  35782. dialog: {
  35783. title: 'Հիշողություն',
  35784. content: 'Բոլոր բանալիներ՝',
  35785. primaryText: 'Կատարել',
  35786. secondaryText: 'Չեղարկել'
  35787. },
  35788. input: {
  35789. pleaseInput: 'Խնդրում եմ մուտքագրել'
  35790. },
  35791. modal: {
  35792. title: 'Վերնագիր',
  35793. content: 'Բոլոր բանալիներ՝',
  35794. btnText: 'Ես հասկացավի՞ք'
  35795. },
  35796. navBar: {
  35797. title: 'Վերնագիր'
  35798. },
  35799. pagination: {
  35800. defaultOnlyOnePage: 'Միայն մեկ էջ'
  35801. },
  35802. picker: {
  35803. defaultTitle: 'Ընտրեք',
  35804. defaultCancel: 'Չեղարկել',
  35805. defaultConfirm: 'Կատարել'
  35806. },
  35807. asyncPicker: {
  35808. defaultTitle: 'Ընտրեք',
  35809. defaultCancel: 'Չեղարկել',
  35810. defaultConfirm: 'Կատարել',
  35811. defaultNext: 'Հաջորդը',
  35812. defaultPrev: 'Նախորդը',
  35813. defaultSelected: 'Ընտրված'
  35814. },
  35815. rate: {
  35816. error1: 'Արժեքը չի կարող լինել Ընդհանուրից մեծանալուց!',
  35817. error2: 'Պետք է Հետևանքը մեկով նվազել!',
  35818. error3: 'Արժեքը պետք է մեկով նվազել, եթե կետը դեռևս ընտրված չէ!',
  35819. error4: 'Արժեքը պետք է նվազել 0,5-ով, եթե կետը ընտրված է!',
  35820. error5: 'Շարադաշտը կամ բույլերի բարձրությունը փոքր է 20-ից, որը դանդաղելի է շարադաշտերում!'
  35821. },
  35822. timePicker: {
  35823. defaultTitle: 'Ընտրեք',
  35824. defaultCancel: 'Չեղարկել',
  35825. defaultConfirm: 'Կատարել',
  35826. defaultYear: 'Տարի',
  35827. defaultMonth: 'Ամիս',
  35828. defaultDay: 'Օր',
  35829. defaultHour: 'Ժամ',
  35830. defaultMinute: 'Րոպե',
  35831. defaultSecond: 'Վայրկյան'
  35832. },
  35833. calendar: {
  35834. weekTextList: ['Հինգշաբթի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'],
  35835. weekSundayStartTextList: ['Կիր', 'Երկ', 'Երք', 'Չոր', 'Հնգ', 'Ուրբ', 'Շբթ'],
  35836. monthTextList: [
  35837. 'Հունվար',
  35838. 'Փետրվար',
  35839. 'Մարտ',
  35840. 'Ապրիլ',
  35841. 'Մայիս',
  35842. 'Հունիս',
  35843. 'Հուլիս',
  35844. 'Օգոստոս',
  35845. 'Սեպտեմբեր',
  35846. 'Հոկտեմբեր',
  35847. 'Նոյեմբեր',
  35848. 'Դեկտեմբեր'
  35849. ],
  35850. confirmText: 'Կատարել',
  35851. selectedText: 'Ընտրված',
  35852. dayText: 'Օր',
  35853. beforeText: 'Անձնական',
  35854. afterText: 'Առաջացած',
  35855. currentWeekText: 'Այս շաբաթ',
  35856. currentMonthText: 'Այս ամսվա մեջ',
  35857. currentQuarterText: 'Այս եռամսյա մեջ'
  35858. }
  35859. };
  35860. export default hy_AM;
  35861. ================================================
  35862. FILE: packages/stdf/src/lib/lang/id_ID.ts
  35863. ================================================
  35864. import type { LangProps } from './index.js';
  35865. const id_ID: LangProps = {
  35866. common: {
  35867. slotEmpty: 'Isi slot kosong!',
  35868. loading: 'Sedang memuat...',
  35869. noData: 'Tidak ada data',
  35870. noMoreData: 'Tidak ada lagi data',
  35871. done: 'Selesai'
  35872. },
  35873. actionSheet: {
  35874. cancelText: 'Batal'
  35875. },
  35876. bottomSheet: {
  35877. title: 'Judul'
  35878. },
  35879. dialog: {
  35880. title: 'Petunjuk',
  35881. content: 'Konten',
  35882. primaryText: 'Konfirmasi',
  35883. secondaryText: 'Batal'
  35884. },
  35885. input: {
  35886. pleaseInput: 'Silakan masukkan'
  35887. },
  35888. modal: {
  35889. title: 'Judul',
  35890. content: 'Konten',
  35891. btnText: 'Saya mengerti'
  35892. },
  35893. navBar: {
  35894. title: 'Judul'
  35895. },
  35896. pagination: {
  35897. defaultOnlyOnePage: 'Hanya satu halaman'
  35898. },
  35899. picker: {
  35900. defaultTitle: 'Silakan pilih',
  35901. defaultCancel: 'Batal',
  35902. defaultConfirm: 'Konfirmasi'
  35903. },
  35904. asyncPicker: {
  35905. defaultTitle: 'Silakan pilih',
  35906. defaultCancel: 'Batal',
  35907. defaultConfirm: 'Konfirmasi',
  35908. defaultNext: 'Berikutnya',
  35909. defaultPrev: 'Sebelumnya',
  35910. defaultSelected: 'Terpilih'
  35911. },
  35912. rate: {
  35913. error1: 'Nilai tidak boleh lebih besar dari Total!',
  35914. error2: 'Total harus dikurangi 1!',
  35915. error3: 'Nilai harus dikurangi 1 ketika tidak terpilih!',
  35916. error4: 'Nilai harus dikurangi 0,5 ketika terpilih setengah!',
  35917. error5: 'Lebar atau tinggi kurang dari 20, yang membuat klik pada terminal seluler sulit!'
  35918. },
  35919. timePicker: {
  35920. defaultTitle: 'Silakan pilih',
  35921. defaultCancel: 'Batal',
  35922. defaultConfirm: 'Konfirmasi',
  35923. defaultYear: 'Tahun',
  35924. defaultMonth: 'Bulan',
  35925. defaultDay: 'Hari',
  35926. defaultHour: 'Jam',
  35927. defaultMinute: 'Menit',
  35928. defaultSecond: 'Kedua'
  35929. },
  35930. calendar: {
  35931. weekTextList: ['Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab', 'Ming'],
  35932. weekSundayStartTextList: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
  35933. monthTextList: [
  35934. 'Januari',
  35935. 'Februari',
  35936. 'Maret',
  35937. 'April',
  35938. 'Mei',
  35939. 'Juni',
  35940. 'Juli',
  35941. 'Agustus',
  35942. 'September',
  35943. 'Oktober',
  35944. 'November',
  35945. 'Desember'
  35946. ],
  35947. confirmText: 'Konfirmasi',
  35948. selectedText: 'Terpilih',
  35949. dayText: 'hari',
  35950. beforeText: 'Terakhir',
  35951. afterText: 'Masa depan',
  35952. currentWeekText: 'Minggu Ini',
  35953. currentMonthText: 'Bulan Ini',
  35954. currentQuarterText: 'Kuartal Ini'
  35955. }
  35956. };
  35957. export default id_ID;
  35958. ================================================
  35959. FILE: packages/stdf/src/lib/lang/index.ts
  35960. ================================================
  35961. export { default as ar_EG } from './ar_EG.js';
  35962. export { default as az_AZ } from './az_AZ.js';
  35963. export { default as bg_BG } from './bg_BG.js';
  35964. export { default as bn_BD } from './bn_BD.js';
  35965. export { default as ca_ES } from './ca_ES.js';
  35966. export { default as cs_CZ } from './cs_CZ.js';
  35967. export { default as da_DK } from './da_DK.js';
  35968. export { default as de_DE } from './de_DE.js';
  35969. export { default as el_GR } from './el_GR.js';
  35970. export { default as en_GB } from './en_GB.js';
  35971. export { default as en_US } from './en_US.js';
  35972. export { default as es_ES } from './es_ES.js';
  35973. export { default as et_EE } from './et_EE.js';
  35974. export { default as eu_ES } from './eu_ES.js';
  35975. export { default as fa_IR } from './fa_IR.js';
  35976. export { default as fi_FI } from './fi_FI.js';
  35977. export { default as fr_BE } from './fr_BE.js';
  35978. export { default as fr_CA } from './fr_CA.js';
  35979. export { default as fr_FR } from './fr_FR.js';
  35980. export { default as ga_IE } from './ga_IE.js';
  35981. export { default as gl_ES } from './gl_ES.js';
  35982. export { default as he_IL } from './he_IL.js';
  35983. export { default as hi_IN } from './hi_IN.js';
  35984. export { default as hr_HR } from './hr_HR.js';
  35985. export { default as hu_HU } from './hu_HU.js';
  35986. export { default as hy_AM } from './hy_AM.js';
  35987. export { default as id_ID } from './id_ID.js';
  35988. export { default as is_IS } from './is_IS.js';
  35989. export { default as it_IT } from './it_IT.js';
  35990. export { default as ja_JP } from './ja_JP.js';
  35991. export { default as ka_GE } from './ka_GE.js';
  35992. export { default as kk_KZ } from './kk_KZ.js';
  35993. export { default as km_KH } from './km_KH.js';
  35994. export { default as kmr_IQ } from './kmr_IQ.js';
  35995. export { default as kn_IN } from './kn_IN.js';
  35996. export { default as ko_KR } from './ko_KR.js';
  35997. export { default as lt_LT } from './lt_LT.js';
  35998. export { default as lv_LV } from './lv_LV.js';
  35999. export { default as mk_MK } from './mk_MK.js';
  36000. export { default as ml_IN } from './ml_IN.js';
  36001. export { default as mn_MN } from './mn_MN.js';
  36002. export { default as ms_MY } from './ms_MY.js';
  36003. export { default as nb_NO } from './nb_NO.js';
  36004. export { default as ne_NP } from './ne_NP.js';
  36005. export { default as nl_BE } from './nl_BE.js';
  36006. export { default as nl_NL } from './nl_NL.js';
  36007. export { default as pl_PL } from './pl_PL.js';
  36008. export { default as pt_BR } from './pt_BR.js';
  36009. export { default as pt_PT } from './pt_PT.js';
  36010. export { default as ro_RO } from './ro_RO.js';
  36011. export { default as ru_RU } from './ru_RU.js';
  36012. export { default as si_LK } from './si_LK.js';
  36013. export { default as sk_SK } from './sk_SK.js';
  36014. export { default as sl_SI } from './sl_SI.js';
  36015. export { default as sr_RS } from './sr_RS.js';
  36016. export { default as sv_SE } from './sv_SE.js';
  36017. export { default as ta_IN } from './ta_IN.js';
  36018. export { default as th_TH } from './th_TH.js';
  36019. export { default as tk_TK } from './tk_TK.js';
  36020. export { default as tr_TR } from './tr_TR.js';
  36021. export { default as uk_UA } from './uk_UA.js';
  36022. export { default as ur_PK } from './ur_PK.js';
  36023. export { default as vi_VN } from './vi_VN.js';
  36024. export { default as zh_CN } from './zh_CN.js';
  36025. export { default as zh_HK } from './zh_HK.js';
  36026. export { default as zh_TW } from './zh_TW.js';
  36027. export type LangProps = {
  36028. common: {
  36029. slotEmpty: string;
  36030. loading: string;
  36031. noData: string;
  36032. noMoreData: string;
  36033. done: string;
  36034. };
  36035. actionSheet: {
  36036. cancelText: string;
  36037. };
  36038. bottomSheet: {
  36039. title: string;
  36040. };
  36041. dialog: {
  36042. title: string;
  36043. content: string;
  36044. primaryText: string;
  36045. secondaryText: string;
  36046. };
  36047. input: {
  36048. pleaseInput: string;
  36049. };
  36050. modal: {
  36051. title: string;
  36052. content: string;
  36053. btnText: string;
  36054. };
  36055. navBar: {
  36056. title: string;
  36057. };
  36058. pagination: {
  36059. defaultOnlyOnePage: string;
  36060. };
  36061. picker: {
  36062. defaultTitle: string;
  36063. defaultCancel: string;
  36064. defaultConfirm: string;
  36065. };
  36066. asyncPicker: {
  36067. defaultTitle: string;
  36068. defaultCancel: string;
  36069. defaultConfirm: string;
  36070. defaultNext: string;
  36071. defaultPrev: string;
  36072. defaultSelected: string;
  36073. };
  36074. rate: {
  36075. error1: string;
  36076. error2: string;
  36077. error3: string;
  36078. error4: string;
  36079. error5: string;
  36080. };
  36081. timePicker: {
  36082. defaultTitle: string;
  36083. defaultCancel: string;
  36084. defaultConfirm: string;
  36085. defaultYear: string;
  36086. defaultMonth: string;
  36087. defaultDay: string;
  36088. defaultHour: string;
  36089. defaultMinute: string;
  36090. defaultSecond: string;
  36091. };
  36092. calendar: {
  36093. weekTextList: string[];
  36094. weekSundayStartTextList: string[];
  36095. monthTextList: string[];
  36096. confirmText: string;
  36097. selectedText: string;
  36098. dayText: string;
  36099. beforeText: string;
  36100. afterText: string;
  36101. currentWeekText: string;
  36102. currentMonthText: string;
  36103. currentQuarterText: string;
  36104. };
  36105. };
  36106. ================================================
  36107. FILE: packages/stdf/src/lib/lang/is_IS.ts
  36108. ================================================
  36109. import type { LangProps } from './index.js';
  36110. const is_IS: LangProps = {
  36111. common: {
  36112. slotEmpty: 'Hlaða tómi!',
  36113. loading: 'Hleður...',
  36114. noData: 'Engin gögn',
  36115. noMoreData: 'Engin fleiri gögn',
  36116. done: 'Lokið'
  36117. },
  36118. actionSheet: {
  36119. cancelText: 'Hætta við'
  36120. },
  36121. bottomSheet: {
  36122. title: 'Titill'
  36123. },
  36124. dialog: {
  36125. title: 'Ábending',
  36126. content: 'Efni',
  36127. primaryText: 'Staðfesta',
  36128. secondaryText: 'Hætta við'
  36129. },
  36130. input: {
  36131. pleaseInput: 'Vinsamlegast sláðu inn'
  36132. },
  36133. modal: {
  36134. title: 'Titill',
  36135. content: 'Efni',
  36136. btnText: 'Ég skil'
  36137. },
  36138. navBar: {
  36139. title: 'Titill'
  36140. },
  36141. pagination: {
  36142. defaultOnlyOnePage: 'Aðeins ein síða'
  36143. },
  36144. picker: {
  36145. defaultTitle: 'Veldu vinsamlegast',
  36146. defaultCancel: 'Hætta við',
  36147. defaultConfirm: 'Staðfesta'
  36148. },
  36149. asyncPicker: {
  36150. defaultTitle: 'Veldu vinsamlegast',
  36151. defaultCancel: 'Hætta við',
  36152. defaultConfirm: 'Staðfesta',
  36153. defaultNext: 'Næsta',
  36154. defaultPrev: 'Fyrra',
  36155. defaultSelected: 'Valinn'
  36156. },
  36157. rate: {
  36158. error1: 'Gildið má ekki vera stærri en Heild!',
  36159. error2: 'Heild verður þá breytt ef gildi sleppt er!',
  36160. error3: 'Gildi verður breytt þegar það er ekki valið!',
  36161. error4: 'Gildi verður breytt þegar það er valið að hálft!',
  36162. error5: 'Breidd eða hæð minni en 20, sem gerir smella á fararmiða erfið á símanum!'
  36163. },
  36164. timePicker: {
  36165. defaultTitle: 'Veldu vinsamlegast',
  36166. defaultCancel: 'Hætta við',
  36167. defaultConfirm: 'Staðfesta',
  36168. defaultYear: 'Ár',
  36169. defaultMonth: 'Mánuður',
  36170. defaultDay: 'Dagur',
  36171. defaultHour: 'Klst.',
  36172. defaultMinute: 'Mín.',
  36173. defaultSecond: 'Sek.'
  36174. },
  36175. calendar: {
  36176. weekTextList: ['Mán', 'Þri', 'Mið', 'Fim', 'Fös', 'Lau', 'Sun'],
  36177. weekSundayStartTextList: ['Sun', 'Mán', 'Þri', 'Mið', 'Fim', 'Fös', 'Lau'],
  36178. monthTextList: ['Janúar', 'Febrúar', 'Mars', 'Apríl', 'Maí', 'Júní', 'Júlí', 'Ágúst', 'September', 'Október', 'Nóvember', 'Desember'],
  36179. confirmText: 'Staðfesta',
  36180. selectedText: 'Valinn',
  36181. dayText: 'dagur',
  36182. beforeText: 'Fyrir',
  36183. afterText: 'Eftir',
  36184. currentWeekText: 'Þessi vika',
  36185. currentMonthText: 'Þessi mánuður',
  36186. currentQuarterText: 'Þessi fjórðungur'
  36187. }
  36188. };
  36189. export default is_IS;
  36190. ================================================
  36191. FILE: packages/stdf/src/lib/lang/it_IT.ts
  36192. ================================================
  36193. import type { LangProps } from './index.js';
  36194. const it_IT: LangProps = {
  36195. common: {
  36196. slotEmpty: 'Il contenuto dello slot è vuoto!',
  36197. loading: 'Caricamento...',
  36198. noData: 'Nessun dato',
  36199. noMoreData: 'Non ci sono più dati',
  36200. done: 'Fatto'
  36201. },
  36202. actionSheet: {
  36203. cancelText: 'Annulla'
  36204. },
  36205. bottomSheet: {
  36206. title: 'Titolo'
  36207. },
  36208. dialog: {
  36209. title: 'Suggerimento',
  36210. content: 'Contenuto',
  36211. primaryText: 'Conferma',
  36212. secondaryText: 'Annulla'
  36213. },
  36214. input: {
  36215. pleaseInput: 'Si prega di inserire'
  36216. },
  36217. modal: {
  36218. title: 'Titolo',
  36219. content: 'Contenuto',
  36220. btnText: 'Ho capito'
  36221. },
  36222. navBar: {
  36223. title: 'Titolo'
  36224. },
  36225. pagination: {
  36226. defaultOnlyOnePage: 'Solo una pagina'
  36227. },
  36228. picker: {
  36229. defaultTitle: 'Si prega di scegliere',
  36230. defaultCancel: 'Annulla',
  36231. defaultConfirm: 'Conferma'
  36232. },
  36233. asyncPicker: {
  36234. defaultTitle: 'Si prega di scegliere',
  36235. defaultCancel: 'Annulla',
  36236. defaultConfirm: 'Conferma',
  36237. defaultNext: 'Successivo',
  36238. defaultPrev: 'Precedente',
  36239. defaultSelected: 'Selezionato'
  36240. },
  36241. rate: {
  36242. error1: 'Il valore non può essere maggiore di Totale!',
  36243. error2: 'Il Totale deve essere sottratto di 1!',
  36244. error3: 'Il valore deve essere sottratto di 1 quando non selezionato!',
  36245. error4: 'Il valore deve essere sottratto di 0,5 quando selezionato a metà!',
  36246. error5: 'Larghezza o altezza inferiore a 20, rende difficoltoso il clic sul terminale mobile!'
  36247. },
  36248. timePicker: {
  36249. defaultTitle: 'Si prega di scegliere',
  36250. defaultCancel: 'Annulla',
  36251. defaultConfirm: 'Conferma',
  36252. defaultYear: 'Anno',
  36253. defaultMonth: 'Mese',
  36254. defaultDay: 'Giorno',
  36255. defaultHour: 'Ora',
  36256. defaultMinute: 'Minuto',
  36257. defaultSecond: 'Secondo'
  36258. },
  36259. calendar: {
  36260. weekTextList: ['Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab', 'Dom'],
  36261. weekSundayStartTextList: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'],
  36262. monthTextList: [
  36263. 'Gennaio',
  36264. 'Febbraio',
  36265. 'Marzo',
  36266. 'Aprile',
  36267. 'Maggio',
  36268. 'Giugno',
  36269. 'Luglio',
  36270. 'Agosto',
  36271. 'Settembre',
  36272. 'Ottobre',
  36273. 'Novembre',
  36274. 'Dicembre'
  36275. ],
  36276. confirmText: 'Conferma',
  36277. selectedText: 'Selezionato',
  36278. dayText: 'giorno',
  36279. beforeText: 'Recente',
  36280. afterText: 'Futuro',
  36281. currentWeekText: 'Questa settimana',
  36282. currentMonthText: 'Questo mese',
  36283. currentQuarterText: 'Questo trimestre'
  36284. }
  36285. };
  36286. export default it_IT;
  36287. ================================================
  36288. FILE: packages/stdf/src/lib/lang/ja_JP.ts
  36289. ================================================
  36290. import type { LangProps } from './index.js';
  36291. const ja_JP: LangProps = {
  36292. common: {
  36293. slotEmpty: 'スロットの内容が空です!',
  36294. loading: '読み込み中...',
  36295. noData: 'データがありません',
  36296. noMoreData: 'これ以上のデータはありません',
  36297. done: '完了'
  36298. },
  36299. actionSheet: {
  36300. cancelText: 'キャンセル'
  36301. },
  36302. bottomSheet: {
  36303. title: 'タイトル'
  36304. },
  36305. dialog: {
  36306. title: '注意',
  36307. content: '内容',
  36308. primaryText: '確認する',
  36309. secondaryText: 'キャンセル'
  36310. },
  36311. input: {
  36312. pleaseInput: '入力してください'
  36313. },
  36314. modal: {
  36315. title: 'タイトル',
  36316. content: '内容',
  36317. btnText: '了解'
  36318. },
  36319. navBar: {
  36320. title: 'タイトル'
  36321. },
  36322. pagination: {
  36323. defaultOnlyOnePage: '1 ページのみ'
  36324. },
  36325. picker: {
  36326. defaultTitle: '選んでください',
  36327. defaultCancel: 'キャンセル',
  36328. defaultConfirm: '確認'
  36329. },
  36330. asyncPicker: {
  36331. defaultTitle: '選んでください',
  36332. defaultCancel: 'キャンセル',
  36333. defaultConfirm: '確認',
  36334. defaultNext: '次へ',
  36335. defaultPrev: '前へ',
  36336. defaultSelected: '選択済み'
  36337. },
  36338. rate: {
  36339. error1: 'value は total を上回ることはできません!',
  36340. error2: 'total は 1 で割り切れる必要があります!',
  36341. error3: '半選択時、value は 1 で割り切れる必要があります!',
  36342. error4: '半選択時、value は 0.5 で割り切れる必要があります!',
  36343. error5: 'width または height が 20 未満の場合、モバイル端末でのクリックが困難になる可能性があります!'
  36344. },
  36345. timePicker: {
  36346. defaultTitle: '選んでください',
  36347. defaultCancel: 'キャンセル',
  36348. defaultConfirm: '確認',
  36349. defaultYear: '年',
  36350. defaultMonth: '月',
  36351. defaultDay: '日',
  36352. defaultHour: '時',
  36353. defaultMinute: '分',
  36354. defaultSecond: '秒'
  36355. },
  36356. calendar: {
  36357. weekTextList: ['月', '火', '水', '木', '金', '土', '日'],
  36358. weekSundayStartTextList: ['日', '月', '火', '水', '木', '金', '土'],
  36359. monthTextList: ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'],
  36360. confirmText: '確認',
  36361. selectedText: '選択済み',
  36362. dayText: '日',
  36363. beforeText: '最近',
  36364. afterText: '未来',
  36365. currentWeekText: '今週',
  36366. currentMonthText: '今月',
  36367. currentQuarterText: '今四半期'
  36368. }
  36369. };
  36370. export default ja_JP;
  36371. ================================================
  36372. FILE: packages/stdf/src/lib/lang/ka_GE.ts
  36373. ================================================
  36374. import type { LangProps } from './index.js';
  36375. const ka_GE: LangProps = {
  36376. common: {
  36377. slotEmpty: 'შიდა ლექში არის ცარიელი!',
  36378. loading: 'იტვირთება...',
  36379. noData: 'მონაცემები არ არის',
  36380. noMoreData: 'არ არის უფრო მეტი მონაცემი',
  36381. done: 'დასრულებულია'
  36382. },
  36383. actionSheet: {
  36384. cancelText: 'გაუქმება'
  36385. },
  36386. bottomSheet: {
  36387. title: 'სათაური'
  36388. },
  36389. dialog: {
  36390. title: 'შეტყობინება',
  36391. content: 'შინაარსი',
  36392. primaryText: 'დადასტურება',
  36393. secondaryText: 'გაუქმება'
  36394. },
  36395. input: {
  36396. pleaseInput: 'შეიყვანეთ'
  36397. },
  36398. modal: {
  36399. title: 'სათაური',
  36400. content: 'შინაარსი',
  36401. btnText: 'გაგეცემა'
  36402. },
  36403. navBar: {
  36404. title: 'სათაური'
  36405. },
  36406. pagination: {
  36407. defaultOnlyOnePage: 'მხოლოდ 1 გვერდი'
  36408. },
  36409. picker: {
  36410. defaultTitle: 'აირჩიეთ',
  36411. defaultCancel: 'გაუქმება',
  36412. defaultConfirm: 'დადასტურება'
  36413. },
  36414. asyncPicker: {
  36415. defaultTitle: 'აირჩიეთ',
  36416. defaultCancel: 'გაუქმება',
  36417. defaultConfirm: 'დადასტურება',
  36418. defaultNext: 'შემდეგი',
  36419. defaultPrev: 'წინა',
  36420. defaultSelected: 'არჩეულია'
  36421. },
  36422. rate: {
  36423. error1: 'value არ შეიძლება დაემატოს total-ზე!',
  36424. error2: 'total-ის მნიშვნელობა უნდა 1-ით გაყოფილი იყოს!',
  36425. error3: 'ნახეთ error2-ი!',
  36426. error4: 'ნახეთ error2-ი!',
  36427. error5:
  36428. 'სიგრძის ან სიმაღლის მნიშვნელობა 20-ზე ნაკლები შეიძლება ნაკლები ვიქნებოდეს, რაც მობილურ მოწყობილობებში ბადალაში დაკლიკების შესაძლებლობას უზრუნველყოფს!'
  36429. },
  36430. timePicker: {
  36431. defaultTitle: 'აირჩიეთ',
  36432. defaultCancel: 'გაუქმება',
  36433. defaultConfirm: 'დადასტურება',
  36434. defaultYear: 'წელი',
  36435. defaultMonth: 'თვე',
  36436. defaultDay: 'დღე',
  36437. defaultHour: 'საათი',
  36438. defaultMinute: 'წუთი',
  36439. defaultSecond: 'წამი'
  36440. },
  36441. calendar: {
  36442. weekTextList: ['ორ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ', 'კვ'],
  36443. weekSundayStartTextList: ['კვ', 'ორ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'],
  36444. monthTextList: [
  36445. 'იანვარი',
  36446. 'თებერვალი',
  36447. 'მარტი',
  36448. 'აპრილი',
  36449. 'მაისი',
  36450. 'ივნისი',
  36451. 'ივლისი',
  36452. 'აგვისტო',
  36453. 'სექტემბერი',
  36454. 'ოქტომბერი',
  36455. 'ნოემბერი',
  36456. 'დეკემბერი'
  36457. ],
  36458. confirmText: 'დადასტურება',
  36459. selectedText: 'არჩეულია',
  36460. dayText: 'დღე',
  36461. beforeText: 'უახლესი',
  36462. afterText: 'მომდევნო',
  36463. currentWeekText: 'ამ კვირაში',
  36464. currentMonthText: 'ამ თვეში',
  36465. currentQuarterText: 'ამ კვარტალში'
  36466. }
  36467. };
  36468. export default ka_GE;
  36469. ================================================
  36470. FILE: packages/stdf/src/lib/lang/kk_KZ.ts
  36471. ================================================
  36472. import type { LangProps } from './index.js';
  36473. const kk_KZ: LangProps = {
  36474. common: {
  36475. slotEmpty: 'Слот әдісі бос!',
  36476. loading: 'Жүктеу...',
  36477. noData: 'Деректер жоқ',
  36478. noMoreData: 'Көбірек деректер жоқ',
  36479. done: 'Аяқталды'
  36480. },
  36481. actionSheet: {
  36482. cancelText: 'Болдырмау'
  36483. },
  36484. bottomSheet: {
  36485. title: 'Тақырып'
  36486. },
  36487. dialog: {
  36488. title: 'Ескерту',
  36489. content: 'Мазмұн',
  36490. primaryText: 'Растау',
  36491. secondaryText: 'Болдырмау'
  36492. },
  36493. input: {
  36494. pleaseInput: 'Құпия сөзді енгізіңіз'
  36495. },
  36496. modal: {
  36497. title: 'Тақырып',
  36498. content: 'Мазмұн',
  36499. btnText: 'Көрдім'
  36500. },
  36501. navBar: {
  36502. title: 'Тақырып'
  36503. },
  36504. pagination: {
  36505. defaultOnlyOnePage: 'Тек 1 бет'
  36506. },
  36507. picker: {
  36508. defaultTitle: 'Таңдаңыз',
  36509. defaultCancel: 'Болдырмау',
  36510. defaultConfirm: 'Растау'
  36511. },
  36512. asyncPicker: {
  36513. defaultTitle: 'Таңдаңыз',
  36514. defaultCancel: 'Болдырмау',
  36515. defaultConfirm: 'Растау',
  36516. defaultNext: 'Келесі',
  36517. defaultPrev: 'Алдыңғы',
  36518. defaultSelected: 'Таңдалған'
  36519. },
  36520. rate: {
  36521. error1: 'Құны жиынтықтан үлкен болмауы тиіс!',
  36522. error2: 'Құны жиынтықты 1-ге бөлу керек!',
  36523. error3: 'Немесе-таңдалмаған жағдайында құны 1-ге бөлу керек!',
  36524. error4: 'Немесе-бір орындамаған жағдайында құны 0,5 дейін бөлу керек!',
  36525. error5: 'Ені-биіктігі 20-тен аз, мобильді терминалда түртіну және басу көзін арттыру мүмкіндігін қамтіды!'
  36526. },
  36527. timePicker: {
  36528. defaultTitle: 'Таңдаңыз',
  36529. defaultCancel: 'Болдырмау',
  36530. defaultConfirm: 'Растау',
  36531. defaultYear: 'Жыл',
  36532. defaultMonth: 'Ай',
  36533. defaultDay: 'Күн',
  36534. defaultHour: 'Сағат',
  36535. defaultMinute: 'Минут',
  36536. defaultSecond: 'Секунд'
  36537. },
  36538. calendar: {
  36539. weekTextList: ['Дс', 'Сс', 'Ср', 'Бс', 'Бс', 'Жм', 'Жк'],
  36540. weekSundayStartTextList: ['Жк', 'Дс', 'Сс', 'Ср', 'Бс', 'Бс', 'Жм'],
  36541. monthTextList: ['Қаңтар', 'Ақпан', 'Наурыз', 'Сәуір', 'Мамыр', 'Маусым', 'Шілде', 'Тамыз', 'Қыркүйек', 'Қазан', 'Қараша', 'Желтоқсан'],
  36542. confirmText: 'Растау',
  36543. selectedText: 'Таңдалды',
  36544. dayText: 'күн',
  36545. beforeText: 'соңғы',
  36546. afterText: 'келесі',
  36547. currentWeekText: 'Бұл апта',
  36548. currentMonthText: 'Бұл ай',
  36549. currentQuarterText: 'Бұл тоқсаны'
  36550. }
  36551. };
  36552. export default kk_KZ;
  36553. ================================================
  36554. FILE: packages/stdf/src/lib/lang/km_KH.ts
  36555. ================================================
  36556. import type { LangProps } from './index.js';
  36557. const km_KH: LangProps = {
  36558. common: {
  36559. slotEmpty: 'គ្មានទិន្នន័យទេ។',
  36560. loading: 'កំពុងផ្ទុកទិន្នន័យ ...',
  36561. noData: 'គ្មានទិន្នន័យទេ',
  36562. noMoreData: 'គ្មានទិន្នន័យផ្សេងទៀតទេ',
  36563. done: 'ធ្វើរួចរាល់'
  36564. },
  36565. actionSheet: {
  36566. cancelText: 'បោះបង់'
  36567. },
  36568. bottomSheet: {
  36569. title: 'ចំណងជើង'
  36570. },
  36571. dialog: {
  36572. title: 'សារ',
  36573. content: 'មាតិកាពីរប់ពីវាលបរិបទ។',
  36574. primaryText: 'យល់ព្រម',
  36575. secondaryText: 'បោះបង់'
  36576. },
  36577. input: {
  36578. pleaseInput: 'សូមបំពេញ'
  36579. },
  36580. modal: {
  36581. title: 'ចំណងជើង',
  36582. content: 'មាតិកាពីរប់ពីវាលបរិបទ',
  36583. btnText: 'ផ្ដល់'
  36584. },
  36585. navBar: {
  36586. title: 'ចំណងជើង'
  36587. },
  36588. pagination: {
  36589. defaultOnlyOnePage: 'មានតែទំព័រមួយទំព័រប៉ុណ្ណោះ'
  36590. },
  36591. picker: {
  36592. defaultTitle: 'ជ្រើសរើស',
  36593. defaultCancel: 'បោះបង់',
  36594. defaultConfirm: 'យល់ព្រម'
  36595. },
  36596. asyncPicker: {
  36597. defaultTitle: 'ជ្រើសរើស',
  36598. defaultCancel: 'បោះបង់',
  36599. defaultConfirm: 'យល់ព្រម',
  36600. defaultNext: 'បន្ទាប់',
  36601. defaultPrev: 'មុន',
  36602. defaultSelected: 'បានជ្រើសរើស'
  36603. },
  36604. rate: {
  36605. error1: 'មិនអាចបន្ថែមតម្លៃទៅលើសរុបបានទេ!',
  36606. error2: 'តម្លៃលើសសរុបគឺត្រូវតែស្មើនឹង ១',
  36607. error3: 'មើល Error2!',
  36608. error4: 'មើល Error2!',
  36609. error5: 'ប្រវែងឬកម្រិតអតិបរិមាណ 20 ឬទាប់គ្នា អាចត្រូវបានខូចខាត ។ មាននៅក្នុងទូរស័ព្ទទំនេរ យ៉ាងតិចការស្វែងរកវាបានបញ្ចូល!'
  36610. },
  36611. timePicker: {
  36612. defaultTitle: 'ជ្រើសរើស',
  36613. defaultCancel: 'បោះបង់',
  36614. defaultConfirm: 'យល់ព្រម',
  36615. defaultYear: 'ឆ្នាំ',
  36616. defaultMonth: 'ខែ',
  36617. defaultDay: 'ថ្ងៃ',
  36618. defaultHour: 'ម៉ោង',
  36619. defaultMinute: 'នាទី',
  36620. defaultSecond: 'វិនាទីទីមួយ'
  36621. },
  36622. calendar: {
  36623. weekTextList: ['ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៖', 'សុក្រ', 'សៅរ៏', 'អាទិត្យ'],
  36624. weekSundayStartTextList: ['អាទិត្យ', 'ចន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៖', 'សុក្រ', 'សៅរ៏'],
  36625. monthTextList: ['មករា', 'កុម្ភៈ', 'មិនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហាកុអ្វីស្រា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'],
  36626. confirmText: 'យល់ព្រម',
  36627. selectedText: 'បានជ្រើសរើស',
  36628. dayText: 'ថ្ងៃ',
  36629. beforeText: 'មុន',
  36630. afterText: 'បន្ទាប់',
  36631. currentWeekText: 'សប្តាហ៍នេះ',
  36632. currentMonthText: 'ខែនេះ',
  36633. currentQuarterText: 'ត្រីមាសនេះ'
  36634. }
  36635. };
  36636. export default km_KH;
  36637. ================================================
  36638. FILE: packages/stdf/src/lib/lang/kmr_IQ.ts
  36639. ================================================
  36640. import type { LangProps } from './index.js';
  36641. const kmr_IQ: LangProps = {
  36642. common: {
  36643. slotEmpty: 'Agahî tune',
  36644. loading: 'Daxistin...',
  36645. noData: 'Agahî tune',
  36646. noMoreData: 'Agahî din tune',
  36647. done: 'Têkildar'
  36648. },
  36649. actionSheet: {
  36650. cancelText: 'Betalke'
  36651. },
  36652. bottomSheet: {
  36653. title: 'Navnîş'
  36654. },
  36655. dialog: {
  36656. title: 'Birêvebirin',
  36657. content: 'Gotar ji her cihê.',
  36658. primaryText: 'Bighîje',
  36659. secondaryText: 'Betalke'
  36660. },
  36661. input: {
  36662. pleaseInput: 'Ji kerema xwe bixwîne'
  36663. },
  36664. modal: {
  36665. title: 'Nav',
  36666. content: 'Gotar ji her cihê.',
  36667. btnText: 'Bighîje'
  36668. },
  36669. navBar: {
  36670. title: 'Nav'
  36671. },
  36672. pagination: {
  36673. defaultOnlyOnePage: 'Tenê yek rûpel'
  36674. },
  36675. picker: {
  36676. defaultTitle: 'Hilbijêre',
  36677. defaultCancel: 'Betalke',
  36678. defaultConfirm: 'Bighîje'
  36679. },
  36680. asyncPicker: {
  36681. defaultTitle: 'Hilbijêre',
  36682. defaultCancel: 'Betalke',
  36683. defaultConfirm: 'Bighîje',
  36684. defaultNext: 'Paşve',
  36685. defaultPrev: 'Pêşve',
  36686. defaultSelected: 'Hilbijandin'
  36687. },
  36688. rate: {
  36689. error1: 'Em nikarin hîn bêtir star bidin!',
  36690. error2: 'Starên ji xwe re dbê ne wek yek tê hesibandin!',
  36691. error3: 'Di error2 de bifikirin!',
  36692. error4: 'Di error2 de bifikirin!',
  36693. error5: 'Di telefonê we de dê klavyeya we jorîn û nîqaşan jî bi rê ve bibe!'
  36694. },
  36695. timePicker: {
  36696. defaultTitle: 'Hilbijêre',
  36697. defaultCancel: 'Betalke',
  36698. defaultConfirm: 'Bighîje',
  36699. defaultYear: 'Sal',
  36700. defaultMonth: 'Meh',
  36701. defaultDay: 'Roj',
  36702. defaultHour: 'Seet',
  36703. defaultMinute: 'Daqîqey',
  36704. defaultSecond: 'Second'
  36705. },
  36706. calendar: {
  36707. weekTextList: ['Yekşem', 'Duşem', 'Sêşem', 'Çarşem', 'Pêncşem', 'În', 'Şemî'],
  36708. weekSundayStartTextList: ['Şemî', 'Yekşem', 'Duşem', 'Sêşem', 'Çarşem', 'Pêncşem', 'În'],
  36709. monthTextList: [
  36710. 'Rêbendan',
  36711. 'Gulan',
  36712. 'Hezîran',
  36713. 'Tîrmeh',
  36714. 'Tebax',
  36715. 'Tîrmeh',
  36716. 'Tebax',
  36717. 'Rezber',
  36718. 'Kewçêr',
  36719. 'Serewend',
  36720. 'Mijdar',
  36721. 'Kanûn'
  36722. ],
  36723. confirmText: 'Bighîje',
  36724. selectedText: 'Hilbijandin',
  36725. dayText: 'Roj',
  36726. beforeText: 'Pêve',
  36727. afterText: 'Pêş',
  36728. currentWeekText: 'Ji bo herî dawî ji bo asta',
  36729. currentMonthText: 'Ji bo herî dawî ji bo asta',
  36730. currentQuarterText: 'Ji bo herî dawî ji bo asta'
  36731. }
  36732. };
  36733. export default kmr_IQ;
  36734. ================================================
  36735. FILE: packages/stdf/src/lib/lang/kn_IN.ts
  36736. ================================================
  36737. import type { LangProps } from './index.js';
  36738. const kn_IN: LangProps = {
  36739. common: {
  36740. slotEmpty: 'ಸ್ಲಾಟ್ ಖಾಲಿಯಾಗಿದೆ!',
  36741. loading: 'ಲೋಡ್ ಆಗುತ್ತಿದೆ...',
  36742. noData: 'ಡೇಟಾ ಇಲ್ಲ',
  36743. noMoreData: 'ಹೆಚ್ಚು ಡೇಟಾ ಇಲ್ಲ',
  36744. done: 'ಮುಗಿದಿದೆ'
  36745. },
  36746. actionSheet: {
  36747. cancelText: 'ರದ್ದುಮಾಡಿ'
  36748. },
  36749. bottomSheet: {
  36750. title: 'ಶೀರ್ಷಿಕೆ'
  36751. },
  36752. dialog: {
  36753. title: 'ಎಚ್ಚರಿಕೆ',
  36754. content: 'ವಿಷಯ',
  36755. primaryText: 'ಪ್ರಾಥಮಿಕ',
  36756. secondaryText: 'ರದ್ದುಪಡಿಸಿ'
  36757. },
  36758. input: {
  36759. pleaseInput: 'ದಯವಿಟ್ಟು ಪಾಸ್‌ವರ್ಡ್ ಅನ್ನು ನಮೂದಿಸಿ'
  36760. },
  36761. modal: {
  36762. title: 'ಶೀರ್ಷಿಕೆ',
  36763. content: 'ವಿಷಯ',
  36764. btnText: 'ಗ್ರಹಿಸಿ'
  36765. },
  36766. navBar: {
  36767. title: 'ಶೀರ್ಷಿಕೆ'
  36768. },
  36769. pagination: {
  36770. defaultOnlyOnePage: 'ಒಂದು ಪುಟ ಮಾತ್ರ'
  36771. },
  36772. picker: {
  36773. defaultTitle: 'ಆಯ್ಕೆ ಮಾಡಿ',
  36774. defaultCancel: 'ರದ್ದುಮಾಡಿ',
  36775. defaultConfirm: 'ದೃಢೀಕರಿಸು'
  36776. },
  36777. asyncPicker: {
  36778. defaultTitle: 'ಆಯ್ಕೆ ಮಾಡಿ',
  36779. defaultCancel: 'ರದ್ದುಮಾಡಿ',
  36780. defaultConfirm: 'ದೃಢೀಕರಿಸು',
  36781. defaultNext: 'ಮುಂದಿನ',
  36782. defaultPrev: 'ಹಿಂದಿನ',
  36783. defaultSelected: 'ಆಯ್ಕೆಯಾಗಿದೆ'
  36784. },
  36785. rate: {
  36786. error1: 'ಮೊತ್ತವನ್ನು ಕಡಿಮೆಗೊಳಿಸಿ!',
  36787. error2: 'ಮೊತ್ತವನ್ನು 1 ನಿಂದ ವಿಭಜಿಸಬೇಕು!',
  36788. error3: 'ಅಥವಾ ಅನುಸ್ತಾಪಿಸಲಾಗದ ಸಂದರ್ಭದಲ್ಲಿ, ಮೊತ್ತವನ್ನು 1 ನಿಂದ ವಿಭಜಿಸಬೇಕು!',
  36789. error4: 'ಅಥವಾ ಒಂದು ಸ್ಥಾನವನ್ನು ನೀಡಬೇಕಾದ ಸಂದರ್ಭದಲ್ಲಿ, ಮೊತ್ತವನ್ನು 0.5 ರವರೆಗೆ ವಿಭಜಿಸಬೇಕು!',
  36790. error5: 'ಗಾತ್ರದ ಅಳತೆ 20 ಕ್ಕಿಂತ ಕಡಿಮೆಯಿರಬೇಕು, ಮೊಬೈಲ್ ಟೆರ್ಮಿನಲ್‌ನಲ್ಲಿ ಗುರುತಿಸುವುದು ಮತ್ತು ನೀರ್ಗಲ್ಲಿನ ಮೂಲಕ ಬೇಯಿಸುವುದು ಸಾಧ್ಯವಿಲ್ಲ!'
  36791. },
  36792. timePicker: {
  36793. defaultTitle: 'ಆಯ್ದಿಸಿ',
  36794. defaultCancel: 'ರದ್ದುಮಾಡಿ',
  36795. defaultConfirm: 'ದೃಢೀಕರಿಸು',
  36796. defaultYear: 'ವರ್ಷ',
  36797. defaultMonth: 'ತಿಂಗಳು',
  36798. defaultDay: 'ದಿನ',
  36799. defaultHour: 'ಘಂಟೆ',
  36800. defaultMinute: 'ನಿಮಿಷ',
  36801. defaultSecond: 'ಸೆಕೆಂಡ್'
  36802. },
  36803. calendar: {
  36804. weekTextList: ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'],
  36805. weekSundayStartTextList: ['ಶನಿ', 'ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ'],
  36806. monthTextList: [
  36807. 'ಜನವರಿ',
  36808. 'ಫೆಬ್ರವರಿ',
  36809. 'ಮಾರ್ಚ್',
  36810. 'ಏಪ್ರಿಲ್',
  36811. 'ಮೇ',
  36812. 'ಜೂನ್',
  36813. 'ಜುಲೈ',
  36814. 'ಆಗಸ್ಟ್',
  36815. 'ಸೆಪ್ಟೆಂಬರ್',
  36816. 'ಅಕ್ಟೋಬರ್',
  36817. 'ನವೆಂಬರ್',
  36818. 'ಡಿಸೆಂಬರ್'
  36819. ],
  36820. confirmText: 'ದೃಢೀಕರಿಸು',
  36821. selectedText: 'ಆಯ್ದಲ್ಲಿದೆ',
  36822. dayText: 'ದಿನ',
  36823. beforeText: 'ಕೊನೆಯದೊಂದು',
  36824. afterText: 'ಮುಂದೆ',
  36825. currentWeekText: 'ಈ ವಾರ',
  36826. currentMonthText: 'ಈ ತಿಂಗಳು',
  36827. currentQuarterText: 'ಈ ತ್ರೈಮಾಸಿಕ'
  36828. }
  36829. };
  36830. export default kn_IN;
  36831. ================================================
  36832. FILE: packages/stdf/src/lib/lang/ko_KR.ts
  36833. ================================================
  36834. import type { LangProps } from './index.js';
  36835. const ko_KR: LangProps = {
  36836. common: {
  36837. slotEmpty: '슬롯이 비어 있습니다!',
  36838. loading: '로딩 중...',
  36839. noData: '데이터가 없습니다',
  36840. noMoreData: '데이터가 더 이상 없습니다',
  36841. done: '완료'
  36842. },
  36843. actionSheet: {
  36844. cancelText: '취소'
  36845. },
  36846. bottomSheet: {
  36847. title: '제목'
  36848. },
  36849. dialog: {
  36850. title: '경고',
  36851. content: '내용',
  36852. primaryText: '확인',
  36853. secondaryText: '취소'
  36854. },
  36855. input: {
  36856. pleaseInput: '비밀번호를 입력해주세요'
  36857. },
  36858. modal: {
  36859. title: '제목',
  36860. content: '내용',
  36861. btnText: '확인'
  36862. },
  36863. navBar: {
  36864. title: '제목'
  36865. },
  36866. pagination: {
  36867. defaultOnlyOnePage: '한 페이지만 있습니다'
  36868. },
  36869. picker: {
  36870. defaultTitle: '선택해주세요',
  36871. defaultCancel: '취소',
  36872. defaultConfirm: '확인'
  36873. },
  36874. asyncPicker: {
  36875. defaultTitle: '선택해주세요',
  36876. defaultCancel: '취소',
  36877. defaultConfirm: '확인',
  36878. defaultNext: '다음',
  36879. defaultPrev: '이전',
  36880. defaultSelected: '선택됨'
  36881. },
  36882. rate: {
  36883. error1: '합계를 감소시키십시오!',
  36884. error2: '합계를 1 로 나누십시오!',
  36885. error3: '또는 합계를 1 로 나눌 수 없는 경우',
  36886. error4: '또는 값이 0.5 미만인 경우!',
  36887. error5: '측정 값은 20 보다 작아야합니다. 모바일 단말기에서 식별하거나 물을 통해 측정할 수 없습니다!'
  36888. },
  36889. timePicker: {
  36890. defaultTitle: '선택해주세요',
  36891. defaultCancel: '취소',
  36892. defaultConfirm: '확인',
  36893. defaultYear: '년',
  36894. defaultMonth: '월',
  36895. defaultDay: '일',
  36896. defaultHour: '시간',
  36897. defaultMinute: '분',
  36898. defaultSecond: '초'
  36899. },
  36900. calendar: {
  36901. weekTextList: ['일', '월', '화', '수', '목', '금', '토'],
  36902. weekSundayStartTextList: ['토', '일', '월', '화', '수', '목', '금'],
  36903. monthTextList: ['1 월', '2 월', '3 월', '4 월', '5 월', '6 월', '7 월', '8 월', '9 월', '10 월', '11 월', '12 월'],
  36904. confirmText: '확인',
  36905. selectedText: '선택됨',
  36906. dayText: '일',
  36907. beforeText: '이전',
  36908. afterText: '이후',
  36909. currentWeekText: '이번 주',
  36910. currentMonthText: '이번 달',
  36911. currentQuarterText: '이번 분기'
  36912. }
  36913. };
  36914. export default ko_KR;
  36915. ================================================
  36916. FILE: packages/stdf/src/lib/lang/lt_LT.ts
  36917. ================================================
  36918. import type { LangProps } from './index.js';
  36919. const lt_LT: LangProps = {
  36920. common: {
  36921. slotEmpty: 'Slotas tuščias!',
  36922. loading: 'Įkeliama...',
  36923. noData: 'Nėra duomenų',
  36924. noMoreData: 'Daugiau duomenų nėra',
  36925. done: 'Atlikta'
  36926. },
  36927. actionSheet: {
  36928. cancelText: 'Atšaukti'
  36929. },
  36930. bottomSheet: {
  36931. title: 'Pavadinimas'
  36932. },
  36933. dialog: {
  36934. title: 'Įspėjimas',
  36935. content: 'Turinys',
  36936. primaryText: 'Patvirtinti',
  36937. secondaryText: 'Atšaukti'
  36938. },
  36939. input: {
  36940. pleaseInput: 'Įveskite slaptažodį'
  36941. },
  36942. modal: {
  36943. title: 'Pavadinimas',
  36944. content: 'Turinys',
  36945. btnText: 'Patvirtinti'
  36946. },
  36947. navBar: {
  36948. title: 'Pavadinimas'
  36949. },
  36950. pagination: {
  36951. defaultOnlyOnePage: 'Tik vienas puslapis'
  36952. },
  36953. picker: {
  36954. defaultTitle: 'Pasirinkite',
  36955. defaultCancel: 'Atšaukti',
  36956. defaultConfirm: 'Patvirtinti'
  36957. },
  36958. asyncPicker: {
  36959. defaultTitle: 'Pasirinkite',
  36960. defaultCancel: 'Atšaukti',
  36961. defaultConfirm: 'Patvirtinti',
  36962. defaultNext: 'Kitas',
  36963. defaultPrev: 'Ankstesnis',
  36964. defaultSelected: 'Pasirinkta'
  36965. },
  36966. rate: {
  36967. error1: 'Suma mažesnė už sumą!',
  36968. error2: 'Suma negali būti padalyta iš 1!',
  36969. error3: 'Arba suma negali būti padalyta iš 1',
  36970. error4: 'Arba vertė yra mažesnė nei 0,5!',
  36971. error5: 'Matavimo vertė turi būti mažesnė nei 20. Ją sunku nustatyti naudojant mobilųjį įrenginį arba per vandenį!'
  36972. },
  36973. timePicker: {
  36974. defaultTitle: 'Pasirinkite',
  36975. defaultCancel: 'Atšaukti',
  36976. defaultConfirm: 'Patvirtinti',
  36977. defaultYear: 'Metai',
  36978. defaultMonth: 'Mėnesis',
  36979. defaultDay: 'Diena',
  36980. defaultHour: 'Valanda',
  36981. defaultMinute: 'Minutė',
  36982. defaultSecond: 'Sekundė'
  36983. },
  36984. calendar: {
  36985. weekTextList: ['Se', 'Pr', 'An', 'Tr', 'Ke', 'Pe', 'Še'],
  36986. weekSundayStartTextList: ['Še', 'Pr', 'An', 'Tr', 'Ke', 'Pe', 'Se'],
  36987. monthTextList: [
  36988. 'Sausio',
  36989. 'Vasario',
  36990. 'Kovo',
  36991. 'Balandžio',
  36992. 'Gegužės',
  36993. 'Birželio',
  36994. 'Liepos',
  36995. 'Rugpjūčio',
  36996. 'Rugsėjo',
  36997. 'Spalio',
  36998. 'Lapkričio',
  36999. 'Gruodžio'
  37000. ],
  37001. confirmText: 'Patvirtinti',
  37002. selectedText: 'Pasirinkta',
  37003. dayText: 'Di',
  37004. beforeText: 'Ankstesnė',
  37005. afterText: 'Sekanti',
  37006. currentWeekText: 'Ši savaitė',
  37007. currentMonthText: 'Šis mėnuo',
  37008. currentQuarterText: 'Šis ketvirtis'
  37009. }
  37010. };
  37011. export default lt_LT;
  37012. ================================================
  37013. FILE: packages/stdf/src/lib/lang/lv_LV.ts
  37014. ================================================
  37015. import type { LangProps } from './index.js';
  37016. const lv_LV: LangProps = {
  37017. common: {
  37018. slotEmpty: 'Slots ir tukšs!',
  37019. loading: 'Ielādē...',
  37020. noData: 'Nav datu',
  37021. noMoreData: 'Nav vairāk datu',
  37022. done: 'Pabeigts'
  37023. },
  37024. actionSheet: {
  37025. cancelText: 'Atcelt'
  37026. },
  37027. bottomSheet: {
  37028. title: 'Nosaukums'
  37029. },
  37030. dialog: {
  37031. title: 'Brīdinājums',
  37032. content: 'Saturs',
  37033. primaryText: 'Apstiprināt',
  37034. secondaryText: 'Atcelt'
  37035. },
  37036. input: {
  37037. pleaseInput: 'Lūdzu, ievadiet paroli'
  37038. },
  37039. modal: {
  37040. title: 'Nosaukums',
  37041. content: 'Saturs',
  37042. btnText: 'Apstiprināt'
  37043. },
  37044. navBar: {
  37045. title: 'Nosaukums'
  37046. },
  37047. pagination: {
  37048. defaultOnlyOnePage: 'Tikai viena lapa'
  37049. },
  37050. picker: {
  37051. defaultTitle: 'Izvēlieties',
  37052. defaultCancel: 'Atcelt',
  37053. defaultConfirm: 'Apstiprināt'
  37054. },
  37055. asyncPicker: {
  37056. defaultTitle: 'Izvēlieties',
  37057. defaultCancel: 'Atcelt',
  37058. defaultConfirm: 'Apstiprināt',
  37059. defaultNext: 'Nākamais',
  37060. defaultPrev: 'Iepriekšējais',
  37061. defaultSelected: 'Izvēlēts'
  37062. },
  37063. rate: {
  37064. error1: 'Summa ir mazāka par summu!',
  37065. error2: 'Summu nevar dalīt ar 1!',
  37066. error3: 'Vai arī summu nevar dalīt ar 1',
  37067. error4: 'Vai vertība ir mazāka par 0,5!',
  37068. error5: 'Mērījuma vērtībai jābūt mazākai par 20. To ir grūti noteikt, izmantojot mobilos ierīces vai caur ūdeni!'
  37069. },
  37070. timePicker: {
  37071. defaultTitle: 'Izvēlieties',
  37072. defaultCancel: 'Atcelt',
  37073. defaultConfirm: 'Apstiprināt',
  37074. defaultYear: 'Gads',
  37075. defaultMonth: 'Mēnesis',
  37076. defaultDay: 'Diena',
  37077. defaultHour: 'Stunda',
  37078. defaultMinute: 'Minūte',
  37079. defaultSecond: 'Sekunde'
  37080. },
  37081. calendar: {
  37082. weekTextList: ['Sv', 'Pr', 'Ot', 'Tr', 'Ce', 'Pk', 'Se'],
  37083. weekSundayStartTextList: ['Se', 'Pr', 'Ot', 'Tr', 'Ce', 'Pk', 'Sv'],
  37084. monthTextList: [
  37085. 'Janvāris',
  37086. 'Februāris',
  37087. 'Marts',
  37088. 'Aprīlis',
  37089. 'Maijs',
  37090. 'Jūnijs',
  37091. 'Jūlijs',
  37092. 'Augusts',
  37093. 'Septembris',
  37094. 'Oktobris',
  37095. 'Novembris',
  37096. 'Decembris'
  37097. ],
  37098. confirmText: 'Apstiprināt',
  37099. selectedText: 'Izvēlētais',
  37100. dayText: 'Di',
  37101. beforeText: 'Iepriekšējais',
  37102. afterText: 'Nākamais',
  37103. currentWeekText: 'Šonedēļ',
  37104. currentMonthText: 'Šomēnes',
  37105. currentQuarterText: 'Šajā ceturksnī'
  37106. }
  37107. };
  37108. export default lv_LV;
  37109. ================================================
  37110. FILE: packages/stdf/src/lib/lang/mk_MK.ts
  37111. ================================================
  37112. import type { LangProps } from './index.js';
  37113. const mk_MK: LangProps = {
  37114. common: {
  37115. slotEmpty: 'Слотот е празен!',
  37116. loading: 'Вчитување...',
  37117. noData: 'Нема податоци',
  37118. noMoreData: 'Нема повеќе податоци',
  37119. done: 'Завршено'
  37120. },
  37121. actionSheet: {
  37122. cancelText: 'Откажи'
  37123. },
  37124. bottomSheet: {
  37125. title: 'Наслов'
  37126. },
  37127. dialog: {
  37128. title: 'Предупредување',
  37129. content: 'Содржина',
  37130. primaryText: 'Потврди',
  37131. secondaryText: 'Откажи'
  37132. },
  37133. input: {
  37134. pleaseInput: 'Внесете лозинка'
  37135. },
  37136. modal: {
  37137. title: 'Наслов',
  37138. content: 'Содржина',
  37139. btnText: 'Потврди'
  37140. },
  37141. navBar: {
  37142. title: 'Наслов'
  37143. },
  37144. pagination: {
  37145. defaultOnlyOnePage: 'Само една страница'
  37146. },
  37147. picker: {
  37148. defaultTitle: 'Избери',
  37149. defaultCancel: 'Откажи',
  37150. defaultConfirm: 'Потврди'
  37151. },
  37152. asyncPicker: {
  37153. defaultTitle: 'Избери',
  37154. defaultCancel: 'Откажи',
  37155. defaultConfirm: 'Потврди',
  37156. defaultNext: 'Следно',
  37157. defaultPrev: 'Претходно',
  37158. defaultSelected: 'Избрано'
  37159. },
  37160. rate: {
  37161. error1: 'Сумата е помала од дозволената предност!',
  37162. error2: 'Сумата не може да биде делива со 1!',
  37163. error3: 'Во спротивно, сумата не може да биде делива со 1',
  37164. error4: 'Или вредноста е помала од 0,5!',
  37165. error5: 'Мерната вредност мора да биде помала од 20. Тоа е тешко да се одреди со мобилен уред или преку вода!'
  37166. },
  37167. timePicker: {
  37168. defaultTitle: 'Избери',
  37169. defaultCancel: 'Откажи',
  37170. defaultConfirm: 'Потврди',
  37171. defaultYear: 'Година',
  37172. defaultMonth: 'Месец',
  37173. defaultDay: 'Ден',
  37174. defaultHour: 'Час',
  37175. defaultMinute: 'Минута',
  37176. defaultSecond: 'Секунда'
  37177. },
  37178. calendar: {
  37179. weekTextList: ['Не', 'По', 'Вт', 'Ср', 'Че', 'Пе', 'Сабота'],
  37180. weekSundayStartTextList: ['Сабота', 'Не', 'По', 'Вт', 'Ср', 'Че', 'Пе'],
  37181. monthTextList: [
  37182. 'Јануари',
  37183. 'Февруари',
  37184. 'Март',
  37185. 'Април',
  37186. 'Мај',
  37187. 'Јуни',
  37188. 'Јули',
  37189. 'Август',
  37190. 'Септември',
  37191. 'Октомври',
  37192. 'Ноември',
  37193. 'Декември'
  37194. ],
  37195. confirmText: 'Потврди',
  37196. selectedText: 'Избрано',
  37197. dayText: 'Ден',
  37198. beforeText: 'Претходно',
  37199. afterText: 'Следно',
  37200. currentWeekText: 'Оваа недела',
  37201. currentMonthText: 'Овој месец',
  37202. currentQuarterText: 'Оваа тромесечје'
  37203. }
  37204. };
  37205. export default mk_MK;
  37206. ================================================
  37207. FILE: packages/stdf/src/lib/lang/ml_IN.ts
  37208. ================================================
  37209. import type { LangProps } from './index.js';
  37210. const ml_IN: LangProps = {
  37211. common: {
  37212. slotEmpty: 'സ്ലോട്ട് ശൂന്യമാണ്!',
  37213. loading: 'ലോഡുചെയ്യുന്നു...',
  37214. noData: 'ഡാറ്റായില്ല',
  37215. noMoreData: 'കൂടുതൽ ഡാറ്റാ ഇല്ല',
  37216. done: 'ചെയ്തു'
  37217. },
  37218. actionSheet: {
  37219. cancelText: 'റദ്ദാക്കുക'
  37220. },
  37221. bottomSheet: {
  37222. title: 'ശീർഷകം'
  37223. },
  37224. dialog: {
  37225. title: 'മുന്നറിയിപ്പ്',
  37226. content: 'ഉള്ളടക്കം',
  37227. primaryText: 'സ്ഥിരീകരിക്കുക',
  37228. secondaryText: 'റദ്ദാക്കുക'
  37229. },
  37230. input: {
  37231. pleaseInput: 'പാസ്സ്വേഡ് നൽകുക'
  37232. },
  37233. modal: {
  37234. title: 'ശീർഷകം',
  37235. content: 'ഉള്ളടക്കം',
  37236. btnText: 'സ്ഥിരീകരിക്കുക'
  37237. },
  37238. navBar: {
  37239. title: 'ശീർഷകം'
  37240. },
  37241. pagination: {
  37242. defaultOnlyOnePage: 'ഒരു പേജ് മാത്രം'
  37243. },
  37244. picker: {
  37245. defaultTitle: 'തിരഞ്ഞെടുക്കുക',
  37246. defaultCancel: 'റദ്ദാക്കുക',
  37247. defaultConfirm: 'സ്ഥിരീകരിക്കുക'
  37248. },
  37249. asyncPicker: {
  37250. defaultTitle: 'തിരഞ്ഞെടുക്കുക',
  37251. defaultCancel: 'റദ്ദാക്കുക',
  37252. defaultConfirm: 'സ്ഥിരീകരിക്കുക',
  37253. defaultNext: 'അടുത്തത്',
  37254. defaultPrev: 'മുന്നത്തെ',
  37255. defaultSelected: 'തിരഞ്ഞെടുത്തു'
  37256. },
  37257. rate: {
  37258. error1: 'മൊത്തം പ്രധാനതയും കുറഞ്ഞ പ്രധാനതയിൽ കൂടാതെ ആണ്!',
  37259. error2: 'മൂല്യം 1 നോക്കിയാൽ പൂർണ്ണമായി നിർണ്ണയിക്കാം എന്നില്ല!',
  37260. error3: 'പൂർണ്ണമായോ അല്ലാതെ മൂല്യം 1 നോക്കുക എന്നില്ല',
  37261. error4: 'അല്പം കൂടാതെ മൂല്യം 0.5 നോക്കുക!',
  37262. error5:
  37263. 'കമ്പെർസർ ഇടയ്ക്കാൾ വിളിക്കുന്ന മൊത്തം 20 കൂടുതലാണ്. മൊബൈൽ ഉപകരണങ്ങളോടും ഉൾനാടൻ ഉപകരണങ്ങളോടും അതു പുലർത്തിയിട്ടുള്ളതായിരിക്കും!'
  37264. },
  37265. timePicker: {
  37266. defaultTitle: 'തിരഞ്ഞെടുക്കുക',
  37267. defaultCancel: 'റദ്ദാക്കുക',
  37268. defaultConfirm: 'സ്ഥിരീകരിക്കുക',
  37269. defaultYear: 'വർഷം',
  37270. defaultMonth: 'മാസം',
  37271. defaultDay: 'ദിവസം',
  37272. defaultHour: 'മണിക്കൂർ',
  37273. defaultMinute: 'മിനിറ്റ്',
  37274. defaultSecond: 'സെക്കൻഡ്'
  37275. },
  37276. calendar: {
  37277. weekTextList: ['ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'],
  37278. weekSundayStartTextList: ['ശനി', 'ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി'],
  37279. monthTextList: [
  37280. 'ജനുവരി',
  37281. 'ഫെബ്രുവരി',
  37282. 'മാർച്ച്',
  37283. 'ഏപ്രിൽ',
  37284. 'മേയ്',
  37285. 'ജൂൺ',
  37286. 'ജൂലൈ',
  37287. 'ഓഗസ്റ്റ്',
  37288. 'സെപ്റ്റംബർ',
  37289. 'ഒക്ടോബർ',
  37290. 'നവംബർ',
  37291. 'ഡിസംബർ'
  37292. ],
  37293. confirmText: 'സ്ഥിരീകരിക്കുക',
  37294. selectedText: 'തിരഞ്ഞെടുത്തത്',
  37295. dayText: 'ദിവസം',
  37296. beforeText: 'മുമ്പത്തെ',
  37297. afterText: 'പിന്നിടുന്നു',
  37298. currentWeekText: 'ഈ ആഴ്ച',
  37299. currentMonthText: 'ഈ മാസം',
  37300. currentQuarterText: 'ഈ ക്വാർട്ടർ'
  37301. }
  37302. };
  37303. export default ml_IN;
  37304. ================================================
  37305. FILE: packages/stdf/src/lib/lang/mn_MN.ts
  37306. ================================================
  37307. import type { LangProps } from './index.js';
  37308. const mn_MN: LangProps = {
  37309. common: {
  37310. slotEmpty: 'Слот хоосон байна!',
  37311. loading: 'Уншиж байна ...',
  37312. noData: 'Өгөгдөл байхгүй байна',
  37313. noMoreData: 'Дараагийн өгөгдөл байхгүй байна',
  37314. done: 'Дууссан'
  37315. },
  37316. actionSheet: {
  37317. cancelText: 'Цуцлах'
  37318. },
  37319. bottomSheet: {
  37320. title: 'Гарчиг'
  37321. },
  37322. dialog: {
  37323. title: 'Санал хүсэлт',
  37324. content: 'Агуулга',
  37325. primaryText: 'Захиалах',
  37326. secondaryText: 'Цуцлах'
  37327. },
  37328. input: {
  37329. pleaseInput: 'Нууц үгээ оруулна уу'
  37330. },
  37331. modal: {
  37332. title: 'Гарчиг',
  37333. content: 'Агуулга',
  37334. btnText: 'Батлах'
  37335. },
  37336. navBar: {
  37337. title: 'Гарчиг'
  37338. },
  37339. pagination: {
  37340. defaultOnlyOnePage: 'Зөвхөн 1-р хуудас'
  37341. },
  37342. picker: {
  37343. defaultTitle: 'Сонгох',
  37344. defaultCancel: 'Цуцлах',
  37345. defaultConfirm: 'Батлах'
  37346. },
  37347. asyncPicker: {
  37348. defaultTitle: 'Сонгох',
  37349. defaultCancel: 'Цуцлах',
  37350. defaultConfirm: 'Батлах',
  37351. defaultNext: 'Дараагийн',
  37352. defaultPrev: 'Өмнөх',
  37353. defaultSelected: 'Сонгосон'
  37354. },
  37355. rate: {
  37356. error1: 'Нийт түрээсийн тооны улмаас бага байх боломжгүй!',
  37357. error2: 'Үнэлгээ 1-ээс их аль болохгүй!',
  37358. error3: '1-ын үнэлгээр хангах эсвэл үнэлэхийн тулд үнэлгээгүй байх ёстой',
  37359. error4: 'Удаан тохиолдолд 0.5-с ихгүй үнэлгээтэй байх ёстой!',
  37360. error5:
  37361. 'Компьютер ашиглахад үр дүнг 20-с ихгүй гаргаж болохгүй. Мобайл эсвэл тухайн оронд ашиглах үйлчилгээний үзүүлэлтүүд дээрээ багтын сайн сайхныг анхаарна уу!'
  37362. },
  37363. timePicker: {
  37364. defaultTitle: 'Сонгох',
  37365. defaultCancel: 'Цуцлах',
  37366. defaultConfirm: 'Батлах',
  37367. defaultYear: 'Жил',
  37368. defaultMonth: 'Сар',
  37369. defaultDay: 'Өдөр',
  37370. defaultHour: 'Цаг',
  37371. defaultMinute: 'Минут',
  37372. defaultSecond: 'Секунд'
  37373. },
  37374. calendar: {
  37375. weekTextList: ['Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба', 'Ням'],
  37376. weekSundayStartTextList: ['Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба'],
  37377. monthTextList: ['Хулгана', 'Үхэр', 'Бар', 'Туулай', 'Луу', 'Могой', 'Морь', 'Найман', 'Ес', 'Арваннэгүүд', 'Арванхоёр', 'Арвангахай'],
  37378. confirmText: 'Батлах',
  37379. selectedText: 'Сонгосон',
  37380. dayText: 'Өдөр',
  37381. beforeText: 'Өмнөх',
  37382. afterText: 'Дараах',
  37383. currentWeekText: 'Энэ долоо хоног',
  37384. currentMonthText: 'Энэ сар',
  37385. currentQuarterText: 'Энэ улирал'
  37386. }
  37387. };
  37388. export default mn_MN;
  37389. ================================================
  37390. FILE: packages/stdf/src/lib/lang/ms_MY.ts
  37391. ================================================
  37392. import type { LangProps } from './index.js';
  37393. const ms_MY: LangProps = {
  37394. common: {
  37395. slotEmpty: 'Ruang kosong!',
  37396. loading: 'Membaca ...',
  37397. noData: 'Tiada data',
  37398. noMoreData: 'Tiada lagi data',
  37399. done: 'Selesai'
  37400. },
  37401. actionSheet: {
  37402. cancelText: 'Batal'
  37403. },
  37404. bottomSheet: {
  37405. title: 'Tajuk'
  37406. },
  37407. dialog: {
  37408. title: 'Permintaan',
  37409. content: 'Kandungan',
  37410. primaryText: 'Tempah',
  37411. secondaryText: 'Batal'
  37412. },
  37413. input: {
  37414. pleaseInput: 'Sila masukkan kata laluan'
  37415. },
  37416. modal: {
  37417. title: 'Tajuk',
  37418. content: 'Kandungan',
  37419. btnText: 'Tetapkan'
  37420. },
  37421. navBar: {
  37422. title: 'Tajuk'
  37423. },
  37424. pagination: {
  37425. defaultOnlyOnePage: 'Hanya satu halaman'
  37426. },
  37427. picker: {
  37428. defaultTitle: 'Pilih',
  37429. defaultCancel: 'Batal',
  37430. defaultConfirm: 'Sahkan'
  37431. },
  37432. asyncPicker: {
  37433. defaultTitle: 'Pilih',
  37434. defaultCancel: 'Batal',
  37435. defaultConfirm: 'Sahkan',
  37436. defaultNext: 'Seterusnya',
  37437. defaultPrev: 'Sebelumnya',
  37438. defaultSelected: 'Dipilih'
  37439. },
  37440. rate: {
  37441. error1: 'Nilai Rating tidak boleh lebih rendah daripada jumlah kelajuan!',
  37442. error2: 'Komen tidak boleh diikat kepada satu bintang!',
  37443. error3: 'Komen atau rating perlu diisi',
  37444. error4: 'Rating perlu diberikan setidaknya setengah bintang!',
  37445. error5:
  37446. 'Komputer tidak dapat melaksanakan rating noreview yang lebih besar dari 20, gunakan aplikasi pembantu pada telefon bimbit atau periksa kembali perkhidmatan yang anda gunakan!'
  37447. },
  37448. timePicker: {
  37449. defaultTitle: 'Pilih',
  37450. defaultCancel: 'Batal',
  37451. defaultConfirm: 'Sahkan',
  37452. defaultYear: 'Tahun',
  37453. defaultMonth: 'Bulan',
  37454. defaultDay: 'Hari',
  37455. defaultHour: 'Jam',
  37456. defaultMinute: 'Minit',
  37457. defaultSecond: 'Saat'
  37458. },
  37459. calendar: {
  37460. weekTextList: ['Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu', 'Ahad'],
  37461. weekSundayStartTextList: ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'],
  37462. monthTextList: ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'],
  37463. confirmText: 'Sahkan',
  37464. selectedText: 'Dipilih',
  37465. dayText: 'Hari',
  37466. beforeText: 'Sebelum',
  37467. afterText: 'Selepas',
  37468. currentWeekText: 'Minggu ini',
  37469. currentMonthText: 'Bulan ini',
  37470. currentQuarterText: 'Suku Tahun Ini'
  37471. }
  37472. };
  37473. export default ms_MY;
  37474. ================================================
  37475. FILE: packages/stdf/src/lib/lang/nb_NO.ts
  37476. ================================================
  37477. import type { LangProps } from './index.js';
  37478. const nb_NO: LangProps = {
  37479. common: {
  37480. slotEmpty: 'Innholdet i sporet er tomt!',
  37481. loading: 'Laster...',
  37482. noData: 'Ingen data',
  37483. noMoreData: 'Ingen flere data',
  37484. done: 'Ferdig'
  37485. },
  37486. actionSheet: {
  37487. cancelText: 'Avbryt'
  37488. },
  37489. bottomSheet: {
  37490. title: 'Tittel'
  37491. },
  37492. dialog: {
  37493. title: 'Hint',
  37494. content: 'Innhold',
  37495. primaryText: 'Bekreft',
  37496. secondaryText: 'Avbryt'
  37497. },
  37498. input: {
  37499. pleaseInput: 'Vennligst skriv inn'
  37500. },
  37501. modal: {
  37502. title: 'Tittel',
  37503. content: 'Innhold',
  37504. btnText: 'Jeg forstår'
  37505. },
  37506. navBar: {
  37507. title: 'Tittel'
  37508. },
  37509. pagination: {
  37510. defaultOnlyOnePage: 'Bare en side'
  37511. },
  37512. picker: {
  37513. defaultTitle: 'Vennligst velg',
  37514. defaultCancel: 'Avbryt',
  37515. defaultConfirm: 'Bekreft'
  37516. },
  37517. asyncPicker: {
  37518. defaultTitle: 'Vennligst velg',
  37519. defaultCancel: 'Avbryt',
  37520. defaultConfirm: 'Bekreft',
  37521. defaultNext: 'Neste',
  37522. defaultPrev: 'Forrige',
  37523. defaultSelected: 'Valgt'
  37524. },
  37525. rate: {
  37526. error1: 'Verdien kan ikke være større enn totalen!',
  37527. error2: 'Totalen må være redusert med 1!',
  37528. error3: 'Verdien må reduseres med 1 når ikke-halvselektiv!',
  37529. error4: 'Verdien må reduseres med 0,5 når halvselektiv!',
  37530. error5: 'Bredde eller høyde er mindre enn 20, noe som gjør mobilterminalen vanskelig å klikke!'
  37531. },
  37532. timePicker: {
  37533. defaultTitle: 'Vennligst velg',
  37534. defaultCancel: 'Avbryt',
  37535. defaultConfirm: 'Bekreft',
  37536. defaultYear: 'År',
  37537. defaultMonth: 'Måned',
  37538. defaultDay: 'Dag',
  37539. defaultHour: 'Time',
  37540. defaultMinute: 'Minutt',
  37541. defaultSecond: 'Sekund'
  37542. },
  37543. calendar: {
  37544. weekTextList: ['Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør', 'Søn'],
  37545. weekSundayStartTextList: ['Søn', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'Lør'],
  37546. monthTextList: ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'],
  37547. confirmText: 'Bekreft',
  37548. selectedText: 'Valgt',
  37549. dayText: 'dag',
  37550. beforeText: 'Siste',
  37551. afterText: 'Fremtidig',
  37552. currentWeekText: 'Denne uken',
  37553. currentMonthText: 'Denne måneden',
  37554. currentQuarterText: 'Dette kvartalet'
  37555. }
  37556. };
  37557. export default nb_NO;
  37558. ================================================
  37559. FILE: packages/stdf/src/lib/lang/ne_NP.ts
  37560. ================================================
  37561. import type { LangProps } from './index.js';
  37562. const ne_NP: LangProps = {
  37563. common: {
  37564. slotEmpty: 'स्लटको सामग्री खाली छ!',
  37565. loading: 'लोड हुदैछ...',
  37566. noData: 'कुनै डाटा छैन',
  37567. noMoreData: 'अझै डेटा छैन',
  37568. done: 'गरियो'
  37569. },
  37570. actionSheet: {
  37571. cancelText: 'रद्द गर्नुहोस्'
  37572. },
  37573. bottomSheet: {
  37574. title: 'शीर्षक'
  37575. },
  37576. dialog: {
  37577. title: 'संकेत',
  37578. content: 'सामग्री',
  37579. primaryText: 'पुष्टि गर्नुहोस्',
  37580. secondaryText: 'रद्द गर्नुहोस्'
  37581. },
  37582. input: {
  37583. pleaseInput: 'कृपया टाइप गर्नुहोस्'
  37584. },
  37585. modal: {
  37586. title: 'शीर्षक',
  37587. content: 'सामग्री',
  37588. btnText: 'मैं समझता हूँ'
  37589. },
  37590. navBar: {
  37591. title: 'शीर्षक'
  37592. },
  37593. pagination: {
  37594. defaultOnlyOnePage: 'केवल एक पृष्ठ'
  37595. },
  37596. picker: {
  37597. defaultTitle: 'कृपया छान्नुहोस्',
  37598. defaultCancel: 'रद्द गर्नुहोस्',
  37599. defaultConfirm: 'पुष्टि गर्नुहोस्'
  37600. },
  37601. asyncPicker: {
  37602. defaultTitle: 'कृपया छान्नुहोस्',
  37603. defaultCancel: 'रद्द गर्नुहोस्',
  37604. defaultConfirm: 'पुष्टि गर्नुहोस्',
  37605. defaultNext: 'त्यसपछि',
  37606. defaultPrev: 'पहिलो',
  37607. defaultSelected: 'Selected'
  37608. },
  37609. rate: {
  37610. error1: 'मात्रा पूर्णबाट ठुलो हुँदैन!',
  37611. error2: 'संपूर्ण एकबट कम हुनुपर्छ!',
  37612. error3: 'गैर-अर्ध चयन गरिएकोमा मान एकबाट कम हुनुपर्छ!',
  37613. error4: 'अर्ध चयन गरिएकोमा मान अर्धबाट कम हुनुपर्छ!',
  37614. error5: 'चौड़ाई वा उचाई 20 भन्दा कम छ जस्ले मोबाइल टर्मिनलमा क्लिक गर्न दुखद।'
  37615. },
  37616. timePicker: {
  37617. defaultTitle: 'कृपया छान्नुहोस्',
  37618. defaultCancel: 'रद्द गर्नुहोस्',
  37619. defaultConfirm: 'पुष्टि गर्नुहोस्',
  37620. defaultYear: 'वर्ष',
  37621. defaultMonth: 'महिना',
  37622. defaultDay: 'दिन',
  37623. defaultHour: 'घण्टा',
  37624. defaultMinute: 'मिनेट',
  37625. defaultSecond: 'सेकेन्ड'
  37626. },
  37627. calendar: {
  37628. weekTextList: ['सोम', 'मंगल', 'बुध', 'बिही', 'शुक्र', 'शनि', 'आइत'],
  37629. weekSundayStartTextList: ['आइत', 'सोम', 'मंगल', 'बुध', 'बिही', 'शुक्र', 'शनि'],
  37630. monthTextList: ['जनवरी', 'फरवरी', 'मार्च', 'अप्रिल', 'मे', 'जून', 'जुलाई', 'अगस्त', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'],
  37631. confirmText: 'पुष्टि गर्नुहोस्',
  37632. selectedText: 'चयन गरिएको',
  37633. dayText: 'दिन',
  37634. beforeText: 'हालको',
  37635. afterText: 'भविष्य',
  37636. currentWeekText: 'यो हप्ता',
  37637. currentMonthText: 'यो महिना',
  37638. currentQuarterText: 'यो तिमीहरूको तिमी'
  37639. }
  37640. };
  37641. export default ne_NP;
  37642. ================================================
  37643. FILE: packages/stdf/src/lib/lang/nl_BE.ts
  37644. ================================================
  37645. import type { LangProps } from './index.js';
  37646. const nl_BE: LangProps = {
  37647. common: {
  37648. slotEmpty: 'Deze sleuf is leeg!',
  37649. loading: 'Bezig met laden...',
  37650. noData: 'Geen gegevens',
  37651. noMoreData: 'Geen extra gegevens',
  37652. done: 'Gedaan'
  37653. },
  37654. actionSheet: {
  37655. cancelText: 'Annuleren'
  37656. },
  37657. bottomSheet: {
  37658. title: 'Titel'
  37659. },
  37660. dialog: {
  37661. title: 'Titel',
  37662. content: 'Inhoud',
  37663. primaryText: 'Bevestigen',
  37664. secondaryText: 'Annuleren'
  37665. },
  37666. input: {
  37667. pleaseInput: 'Voer in'
  37668. },
  37669. modal: {
  37670. title: 'Titel',
  37671. content: 'Inhoud',
  37672. btnText: 'Begrepen'
  37673. },
  37674. navBar: {
  37675. title: 'Titel'
  37676. },
  37677. pagination: {
  37678. defaultOnlyOnePage: 'Slechts één pagina'
  37679. },
  37680. picker: {
  37681. defaultTitle: 'Selecteer alstublieft',
  37682. defaultCancel: 'Annuleren',
  37683. defaultConfirm: 'Bevestigen'
  37684. },
  37685. asyncPicker: {
  37686. defaultTitle: 'Selecteer alstublieft',
  37687. defaultCancel: 'Annuleren',
  37688. defaultConfirm: 'Bevestigen',
  37689. defaultNext: 'Volgende',
  37690. defaultPrev: 'Vorige',
  37691. defaultSelected: 'Geselecteerd'
  37692. },
  37693. rate: {
  37694. error1: 'Waardering moet minimaal compleet zijn!',
  37695. error2: 'Waardering mag niet minder dan één zijn!',
  37696. error3: 'Een gedeeltelijke selectie moet meer dan 1 waarde hebben!',
  37697. error4: 'Een gedeeltelijke selectie moet minder dan 1 waarde hebben!',
  37698. error5: 'Breedte of hoogte kleiner dan 20, niet toegestaan om op mobiel te klikken.'
  37699. },
  37700. timePicker: {
  37701. defaultTitle: 'Selecteer alstublieft',
  37702. defaultCancel: 'Annuleren',
  37703. defaultConfirm: 'Bevestigen',
  37704. defaultYear: 'Jaar',
  37705. defaultMonth: 'Maand',
  37706. defaultDay: 'Dag',
  37707. defaultHour: 'Uur',
  37708. defaultMinute: 'Minuut',
  37709. defaultSecond: 'Seconde'
  37710. },
  37711. calendar: {
  37712. weekTextList: ['Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za', 'Zo'],
  37713. weekSundayStartTextList: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'],
  37714. monthTextList: [
  37715. 'Januari',
  37716. 'Februari',
  37717. 'Maart',
  37718. 'April',
  37719. 'Mei',
  37720. 'Juni',
  37721. 'Juli',
  37722. 'Augustus',
  37723. 'September',
  37724. 'Oktober',
  37725. 'November',
  37726. 'December'
  37727. ],
  37728. confirmText: 'Bevestigen',
  37729. selectedText: 'Geselecteerd',
  37730. dayText: 'Dag',
  37731. beforeText: 'Vóór',
  37732. afterText: 'Na',
  37733. currentWeekText: 'Deze week',
  37734. currentMonthText: 'Deze maand',
  37735. currentQuarterText: 'Dit kwartaal'
  37736. }
  37737. };
  37738. export default nl_BE;
  37739. ================================================
  37740. FILE: packages/stdf/src/lib/lang/nl_NL.ts
  37741. ================================================
  37742. import type { LangProps } from './index.js';
  37743. const nl_NL: LangProps = {
  37744. common: {
  37745. slotEmpty: 'Deze slot is leeg!',
  37746. loading: 'Laden...',
  37747. noData: 'Geen data',
  37748. noMoreData: 'Geen extra data',
  37749. done: 'Gedaan'
  37750. },
  37751. actionSheet: {
  37752. cancelText: 'Annuleren'
  37753. },
  37754. bottomSheet: {
  37755. title: 'Titel'
  37756. },
  37757. dialog: {
  37758. title: 'Titel',
  37759. content: 'Inhoud',
  37760. primaryText: 'Bevestigen',
  37761. secondaryText: 'Annuleren'
  37762. },
  37763. input: {
  37764. pleaseInput: 'Voer in'
  37765. },
  37766. modal: {
  37767. title: 'Titel',
  37768. content: 'Inhoud',
  37769. btnText: 'Oké'
  37770. },
  37771. navBar: {
  37772. title: 'Titel'
  37773. },
  37774. pagination: {
  37775. defaultOnlyOnePage: 'Slechts één pagina'
  37776. },
  37777. picker: {
  37778. defaultTitle: 'Selecteer alstublieft',
  37779. defaultCancel: 'Annuleren',
  37780. defaultConfirm: 'Bevestigen'
  37781. },
  37782. asyncPicker: {
  37783. defaultTitle: 'Selecteer alstublieft',
  37784. defaultCancel: 'Annuleren',
  37785. defaultConfirm: 'Bevestigen',
  37786. defaultNext: 'Volgende',
  37787. defaultPrev: 'Vorige',
  37788. defaultSelected: 'Geselecteerd'
  37789. },
  37790. rate: {
  37791. error1: 'Waardering mag niet leeg zijn!',
  37792. error2: 'Waardering moet meer dan 1 zijn!',
  37793. error3: 'Een gedeeltelijke selectie moet meer dan 1 waarde hebben!',
  37794. error4: 'Een gedeeltelijke selectie moet minder dan 1 waarde hebben!',
  37795. error5: 'Breedte of hoogte kleiner dan 20, niet toegestaan om op mobiel te klikken.'
  37796. },
  37797. timePicker: {
  37798. defaultTitle: 'Selecteer alstublieft',
  37799. defaultCancel: 'Annuleren',
  37800. defaultConfirm: 'Bevestigen',
  37801. defaultYear: 'Jaar',
  37802. defaultMonth: 'Maand',
  37803. defaultDay: 'Dag',
  37804. defaultHour: 'Uur',
  37805. defaultMinute: 'Minuut',
  37806. defaultSecond: 'Seconde'
  37807. },
  37808. calendar: {
  37809. weekTextList: ['Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za', 'Zo'],
  37810. weekSundayStartTextList: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'],
  37811. monthTextList: [
  37812. 'Januari',
  37813. 'Februari',
  37814. 'Maart',
  37815. 'April',
  37816. 'Mei',
  37817. 'Juni',
  37818. 'Juli',
  37819. 'Augustus',
  37820. 'September',
  37821. 'Oktober',
  37822. 'November',
  37823. 'December'
  37824. ],
  37825. confirmText: 'Bevestigen',
  37826. selectedText: 'Geselecteerd',
  37827. dayText: 'Dag',
  37828. beforeText: 'Vóór',
  37829. afterText: 'Na',
  37830. currentWeekText: 'Deze week',
  37831. currentMonthText: 'Deze maand',
  37832. currentQuarterText: 'Dit kwartaal'
  37833. }
  37834. };
  37835. export default nl_NL;
  37836. ================================================
  37837. FILE: packages/stdf/src/lib/lang/pl_PL.ts
  37838. ================================================
  37839. import type { LangProps } from './index.js';
  37840. const pl_PL: LangProps = {
  37841. common: {
  37842. slotEmpty: 'To miejsce jest puste!',
  37843. loading: 'Wczytywanie...',
  37844. noData: 'Brak danych',
  37845. noMoreData: 'Brak dalszych danych',
  37846. done: 'Gotowe'
  37847. },
  37848. actionSheet: {
  37849. cancelText: 'Anuluj'
  37850. },
  37851. bottomSheet: {
  37852. title: 'Tytuł'
  37853. },
  37854. dialog: {
  37855. title: 'Tytuł',
  37856. content: 'Treść',
  37857. primaryText: 'Potwierdź',
  37858. secondaryText: 'Anuluj'
  37859. },
  37860. input: {
  37861. pleaseInput: 'Wprowadź'
  37862. },
  37863. modal: {
  37864. title: 'Tytuł',
  37865. content: 'Treść',
  37866. btnText: 'OK'
  37867. },
  37868. navBar: {
  37869. title: 'Tytuł'
  37870. },
  37871. pagination: {
  37872. defaultOnlyOnePage: 'Tylko jedna strona'
  37873. },
  37874. picker: {
  37875. defaultTitle: 'Proszę wybrać',
  37876. defaultCancel: 'Anuluj',
  37877. defaultConfirm: 'OK'
  37878. },
  37879. asyncPicker: {
  37880. defaultTitle: 'Proszę wybrać',
  37881. defaultCancel: 'Anuluj',
  37882. defaultConfirm: 'OK',
  37883. defaultNext: 'Następny',
  37884. defaultPrev: 'Poprzedni',
  37885. defaultSelected: 'Wybrano'
  37886. },
  37887. rate: {
  37888. error1: 'Ocena nie może być pusta!',
  37889. error2: 'Ocena musi być większa niż 1!',
  37890. error3: 'Częściowa ocena musi zawierać co najmniej 1 wartość!',
  37891. error4: 'Częściowa ocena nie może zawierać więcej niż 1 wartość!',
  37892. error5: 'Szerokość lub wysokość mniejsza niż 20, nie można kliknąć na urządzeniach mobilnych.'
  37893. },
  37894. timePicker: {
  37895. defaultTitle: 'Proszę wybrać',
  37896. defaultCancel: 'Anuluj',
  37897. defaultConfirm: 'OK',
  37898. defaultYear: 'Rok',
  37899. defaultMonth: 'Miesiąc',
  37900. defaultDay: 'Dzień',
  37901. defaultHour: 'Godzina',
  37902. defaultMinute: 'Minuta',
  37903. defaultSecond: 'Sekunda'
  37904. },
  37905. calendar: {
  37906. weekTextList: ['Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob', 'Niedz'],
  37907. weekSundayStartTextList: ['Niedz', 'Pn', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'],
  37908. monthTextList: [
  37909. 'Styczeń',
  37910. 'Luty',
  37911. 'Marzec',
  37912. 'Kwiecień',
  37913. 'Maj',
  37914. 'Czerwiec',
  37915. 'Lipiec',
  37916. 'Sierpień',
  37917. 'Wrzesień',
  37918. 'Październik',
  37919. 'Listopad',
  37920. 'Grudzień'
  37921. ],
  37922. confirmText: 'OK',
  37923. selectedText: 'Wybrano',
  37924. dayText: 'Dzień',
  37925. beforeText: 'Przed',
  37926. afterText: 'Po',
  37927. currentWeekText: 'Bieżący tydzień',
  37928. currentMonthText: 'Bieżący miesiąc',
  37929. currentQuarterText: 'Bieżący kwartał'
  37930. }
  37931. };
  37932. export default pl_PL;
  37933. ================================================
  37934. FILE: packages/stdf/src/lib/lang/pt_BR.ts
  37935. ================================================
  37936. import type { LangProps } from './index.js';
  37937. const pt_BR: LangProps = {
  37938. common: {
  37939. slotEmpty: 'Este espaço está vazio!',
  37940. loading: 'Carregando...',
  37941. noData: 'Sem dados',
  37942. noMoreData: 'Não há mais dados',
  37943. done: 'Feito'
  37944. },
  37945. actionSheet: {
  37946. cancelText: 'Cancelar'
  37947. },
  37948. bottomSheet: {
  37949. title: 'Título'
  37950. },
  37951. dialog: {
  37952. title: 'Título',
  37953. content: 'Conteúdo',
  37954. primaryText: 'Confirmar',
  37955. secondaryText: 'Cancelar'
  37956. },
  37957. input: {
  37958. pleaseInput: 'Por favor, insira'
  37959. },
  37960. modal: {
  37961. title: 'Título',
  37962. content: 'Conteúdo',
  37963. btnText: 'OK'
  37964. },
  37965. navBar: {
  37966. title: 'Título'
  37967. },
  37968. pagination: {
  37969. defaultOnlyOnePage: 'Apenas uma página'
  37970. },
  37971. picker: {
  37972. defaultTitle: 'Por favor selecione',
  37973. defaultCancel: 'Cancelar',
  37974. defaultConfirm: 'Confirmar'
  37975. },
  37976. asyncPicker: {
  37977. defaultTitle: 'Por favor selecione',
  37978. defaultCancel: 'Cancelar',
  37979. defaultConfirm: 'Confirmar',
  37980. defaultNext: 'Próximo',
  37981. defaultPrev: 'Anterior',
  37982. defaultSelected: 'Selecionado'
  37983. },
  37984. rate: {
  37985. error1: 'A avaliação não pode estar vazia!',
  37986. error2: 'A avaliação precisa ser maior que 1!',
  37987. error3: 'Uma avaliação parcial deve ter pelo menos 1 valor!',
  37988. error4: 'Uma avaliação parcial não pode ter mais de 1 valor!',
  37989. error5: 'Largura ou altura inferior a 20, não permitido clicar em dispositivos móveis.'
  37990. },
  37991. timePicker: {
  37992. defaultTitle: 'Por favor selecione',
  37993. defaultCancel: 'Cancelar',
  37994. defaultConfirm: 'Confirmar',
  37995. defaultYear: 'Ano',
  37996. defaultMonth: 'Mês',
  37997. defaultDay: 'Dia',
  37998. defaultHour: 'Hora',
  37999. defaultMinute: 'Minuto',
  38000. defaultSecond: 'Segundo'
  38001. },
  38002. calendar: {
  38003. weekTextList: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'],
  38004. weekSundayStartTextList: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
  38005. monthTextList: [
  38006. 'Janeiro',
  38007. 'Fevereiro',
  38008. 'Março',
  38009. 'Abril',
  38010. 'Maio',
  38011. 'Junho',
  38012. 'Julho',
  38013. 'Agosto',
  38014. 'Setembro',
  38015. 'Outubro',
  38016. 'Novembro',
  38017. 'Dezembro'
  38018. ],
  38019. confirmText: 'Confirmar',
  38020. selectedText: 'Selecionado',
  38021. dayText: 'Dia',
  38022. beforeText: 'Antes',
  38023. afterText: 'Depois',
  38024. currentWeekText: 'Esta semana',
  38025. currentMonthText: 'Este mês',
  38026. currentQuarterText: 'Este trimestre'
  38027. }
  38028. };
  38029. export default pt_BR;
  38030. ================================================
  38031. FILE: packages/stdf/src/lib/lang/pt_PT.ts
  38032. ================================================
  38033. import type { LangProps } from './index.js';
  38034. const pt_PT: LangProps = {
  38035. common: {
  38036. slotEmpty: 'Este espaço está vazio!',
  38037. loading: 'A carregar...',
  38038. noData: 'Sem dados',
  38039. noMoreData: 'Não há mais dados',
  38040. done: 'Feito'
  38041. },
  38042. actionSheet: {
  38043. cancelText: 'Cancelar'
  38044. },
  38045. bottomSheet: {
  38046. title: 'Título'
  38047. },
  38048. dialog: {
  38049. title: 'Título',
  38050. content: 'Conteúdo',
  38051. primaryText: 'Confirmar',
  38052. secondaryText: 'Cancelar'
  38053. },
  38054. input: {
  38055. pleaseInput: 'Por favor, insira'
  38056. },
  38057. modal: {
  38058. title: 'Título',
  38059. content: 'Conteúdo',
  38060. btnText: 'OK'
  38061. },
  38062. navBar: {
  38063. title: 'Título'
  38064. },
  38065. pagination: {
  38066. defaultOnlyOnePage: 'Apenas uma página'
  38067. },
  38068. picker: {
  38069. defaultTitle: 'Por favor selecione',
  38070. defaultCancel: 'Cancelar',
  38071. defaultConfirm: 'Confirmar'
  38072. },
  38073. asyncPicker: {
  38074. defaultTitle: 'Por favor selecione',
  38075. defaultCancel: 'Cancelar',
  38076. defaultConfirm: 'Confirmar',
  38077. defaultNext: 'Próximo',
  38078. defaultPrev: 'Anterior',
  38079. defaultSelected: 'Selecionado'
  38080. },
  38081. rate: {
  38082. error1: 'A avaliação não pode estar vazia!',
  38083. error2: 'A avaliação precisa ser maior que 1!',
  38084. error3: 'Uma avaliação parcial deve ter pelo menos 1 valor!',
  38085. error4: 'Uma avaliação parcial não pode ter mais de 1 valor!',
  38086. error5: 'Largura ou altura inferior a 20, não permitido clicar em dispositivos móveis.'
  38087. },
  38088. timePicker: {
  38089. defaultTitle: 'Por favor selecione',
  38090. defaultCancel: 'Cancelar',
  38091. defaultConfirm: 'Confirmar',
  38092. defaultYear: 'Ano',
  38093. defaultMonth: 'Mês',
  38094. defaultDay: 'Dia',
  38095. defaultHour: 'Hora',
  38096. defaultMinute: 'Minuto',
  38097. defaultSecond: 'Segundo'
  38098. },
  38099. calendar: {
  38100. weekTextList: ['Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'],
  38101. weekSundayStartTextList: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
  38102. monthTextList: [
  38103. 'Janeiro',
  38104. 'Fevereiro',
  38105. 'Março',
  38106. 'Abril',
  38107. 'Maio',
  38108. 'Junho',
  38109. 'Julho',
  38110. 'Agosto',
  38111. 'Setembro',
  38112. 'Outubro',
  38113. 'Novembro',
  38114. 'Dezembro'
  38115. ],
  38116. confirmText: 'Confirmar',
  38117. selectedText: 'Selecionado',
  38118. dayText: 'Dia',
  38119. beforeText: 'Antes',
  38120. afterText: 'Depois',
  38121. currentWeekText: 'Esta semana',
  38122. currentMonthText: 'Este mês',
  38123. currentQuarterText: 'Este trimestre'
  38124. }
  38125. };
  38126. export default pt_PT;
  38127. ================================================
  38128. FILE: packages/stdf/src/lib/lang/ro_RO.ts
  38129. ================================================
  38130. import type { LangProps } from './index.js';
  38131. const ro_RO: LangProps = {
  38132. common: {
  38133. slotEmpty: 'Acest spațiu este gol!',
  38134. loading: 'Se încarcă...',
  38135. noData: 'Fără date',
  38136. noMoreData: 'Nu mai există date',
  38137. done: 'Gata'
  38138. },
  38139. actionSheet: {
  38140. cancelText: 'Anulează'
  38141. },
  38142. bottomSheet: {
  38143. title: 'Titlu'
  38144. },
  38145. dialog: {
  38146. title: 'Titlu',
  38147. content: 'Conținut',
  38148. primaryText: 'Confirmă',
  38149. secondaryText: 'Anulează'
  38150. },
  38151. input: {
  38152. pleaseInput: 'Introduceți'
  38153. },
  38154. modal: {
  38155. title: 'Titlu',
  38156. content: 'Conținut',
  38157. btnText: 'OK'
  38158. },
  38159. navBar: {
  38160. title: 'Titlu'
  38161. },
  38162. pagination: {
  38163. defaultOnlyOnePage: 'Doar o pagină'
  38164. },
  38165. picker: {
  38166. defaultTitle: 'Selectați vă rog',
  38167. defaultCancel: 'Anulează',
  38168. defaultConfirm: 'Confirmă'
  38169. },
  38170. asyncPicker: {
  38171. defaultTitle: 'Selectați vă rog',
  38172. defaultCancel: 'Anulează',
  38173. defaultConfirm: 'Confirmă',
  38174. defaultNext: 'Următorul',
  38175. defaultPrev: 'Anteriorul',
  38176. defaultSelected: 'Selectat'
  38177. },
  38178. rate: {
  38179. error1: 'Evaluarea nu poate fi goală!',
  38180. error2: 'Evaluarea trebuie să fie mai mare de 1!',
  38181. error3: 'O evaluare parțială trebuie să aibă cel puțin 1 valoare!',
  38182. error4: 'O evaluare parțială nu poate avea mai mult de 1 valoare!',
  38183. error5: 'Lățimea sau înălțimea este mai mică de 20, fără clic disponibil pe dispozitivele mobile.'
  38184. },
  38185. timePicker: {
  38186. defaultTitle: 'Selectați vă rog',
  38187. defaultCancel: 'Anulează',
  38188. defaultConfirm: 'Confirmă',
  38189. defaultYear: 'An',
  38190. defaultMonth: 'Lună',
  38191. defaultDay: 'Zi',
  38192. defaultHour: 'Oră',
  38193. defaultMinute: 'Minut',
  38194. defaultSecond: 'Secundă'
  38195. },
  38196. calendar: {
  38197. weekTextList: ['Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm', 'Dum'],
  38198. weekSundayStartTextList: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'],
  38199. monthTextList: [
  38200. 'Ianuarie',
  38201. 'Februarie',
  38202. 'Martie',
  38203. 'Aprilie',
  38204. 'Mai',
  38205. 'Iunie',
  38206. 'Iulie',
  38207. 'August',
  38208. 'Septembrie',
  38209. 'Octombrie',
  38210. 'Noiembrie',
  38211. 'Decembrie'
  38212. ],
  38213. confirmText: 'Confirmă',
  38214. selectedText: 'Selectat',
  38215. dayText: 'Zi',
  38216. beforeText: 'Anterior',
  38217. afterText: 'Următor',
  38218. currentWeekText: 'Săptămâna aceasta',
  38219. currentMonthText: 'Luna aceasta',
  38220. currentQuarterText: 'Acest trimestru'
  38221. }
  38222. };
  38223. export default ro_RO;
  38224. ================================================
  38225. FILE: packages/stdf/src/lib/lang/ru_RU.ts
  38226. ================================================
  38227. import type { LangProps } from './index.js';
  38228. const ru_RU: LangProps = {
  38229. common: {
  38230. slotEmpty: 'Это место пустое!',
  38231. loading: 'Загрузка...',
  38232. noData: 'Нет данных',
  38233. noMoreData: 'Больше нет данных',
  38234. done: 'Готово'
  38235. },
  38236. actionSheet: {
  38237. cancelText: 'Отмена'
  38238. },
  38239. bottomSheet: {
  38240. title: 'Заголовок'
  38241. },
  38242. dialog: {
  38243. title: 'Заголовок',
  38244. content: 'Содержание',
  38245. primaryText: 'Подтвердить',
  38246. secondaryText: 'Отмена'
  38247. },
  38248. input: {
  38249. pleaseInput: 'Пожалуйста, введите'
  38250. },
  38251. modal: {
  38252. title: 'Заголовок',
  38253. content: 'Содержание',
  38254. btnText: 'OK'
  38255. },
  38256. navBar: {
  38257. title: 'Заголовок'
  38258. },
  38259. pagination: {
  38260. defaultOnlyOnePage: 'Только одна страница'
  38261. },
  38262. picker: {
  38263. defaultTitle: 'Пожалуйста, выберите',
  38264. defaultCancel: 'Отмена',
  38265. defaultConfirm: 'Подтвердить'
  38266. },
  38267. asyncPicker: {
  38268. defaultTitle: 'Пожалуйста, выберите',
  38269. defaultCancel: 'Отмена',
  38270. defaultConfirm: 'Подтвердить',
  38271. defaultNext: 'Следующий',
  38272. defaultPrev: 'Предыдущий',
  38273. defaultSelected: 'Выбрано'
  38274. },
  38275. rate: {
  38276. error1: 'Рейтинг не может быть пустым!',
  38277. error2: 'Рейтинг должен быть больше 1!',
  38278. error3: 'Для частичной оценки нужно хотя бы 1 значение!',
  38279. error4: 'Для частичной оценки не может быть более 1 значения!',
  38280. error5: 'Ширина или высота меньше 20, на мобильных устройствах нельзя нажать.'
  38281. },
  38282. timePicker: {
  38283. defaultTitle: 'Пожалуйста, выберите',
  38284. defaultCancel: 'Отмена',
  38285. defaultConfirm: 'Подтвердить',
  38286. defaultYear: 'Год',
  38287. defaultMonth: 'Месяц',
  38288. defaultDay: 'День',
  38289. defaultHour: 'Час',
  38290. defaultMinute: 'Минута',
  38291. defaultSecond: 'Секунда'
  38292. },
  38293. calendar: {
  38294. weekTextList: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
  38295. weekSundayStartTextList: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
  38296. monthTextList: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
  38297. confirmText: 'Подтвердить',
  38298. selectedText: 'Выбрано',
  38299. dayText: 'День',
  38300. beforeText: 'До',
  38301. afterText: 'После',
  38302. currentWeekText: 'Текущая неделя',
  38303. currentMonthText: 'Текущий месяц',
  38304. currentQuarterText: 'Текущий квартал'
  38305. }
  38306. };
  38307. export default ru_RU;
  38308. ================================================
  38309. FILE: packages/stdf/src/lib/lang/si_LK.ts
  38310. ================================================
  38311. import type { LangProps } from './index.js';
  38312. const si_LK: LangProps = {
  38313. common: {
  38314. slotEmpty: 'මේ ස්මන්තිය හිස් විය!',
  38315. loading: 'පූරණය වෙමින්...',
  38316. noData: 'දත්ත නැත',
  38317. noMoreData: 'තවත් දත්ත නැත',
  38318. done: 'ක්‍රියාත්මක කරන ලදි'
  38319. },
  38320. actionSheet: {
  38321. cancelText: 'එපා'
  38322. },
  38323. bottomSheet: {
  38324. title: 'මාතෘකාව'
  38325. },
  38326. dialog: {
  38327. title: 'මාතෘකාව',
  38328. content: 'අන්‍යකාරය',
  38329. primaryText: 'තහවුරු කරන්න',
  38330. secondaryText: 'ඉවත් කරන්න'
  38331. },
  38332. input: {
  38333. pleaseInput: 'කරුණාකර ඇතුලත් කරන්න'
  38334. },
  38335. modal: {
  38336. title: 'මාතෘකාව',
  38337. content: 'අන්‍යකාරය',
  38338. btnText: 'හරි'
  38339. },
  38340. navBar: {
  38341. title: 'මාතෘකාව'
  38342. },
  38343. pagination: {
  38344. defaultOnlyOnePage: 'එක් පිටුවක් පමණක් පවතී'
  38345. },
  38346. picker: {
  38347. defaultTitle: 'කරුණාකර තෝරන්න',
  38348. defaultCancel: 'අවලංගු කරන්න',
  38349. defaultConfirm: 'තහවුරු කරන්න'
  38350. },
  38351. asyncPicker: {
  38352. defaultTitle: 'කරුණාකර තෝරන්න',
  38353. defaultCancel: 'අවලංගු කරන්න',
  38354. defaultConfirm: 'තහවුරු කරන්න',
  38355. defaultNext: 'ඊළඟ',
  38356. defaultPrev: 'පෙර',
  38357. defaultSelected: 'තෝරා ඇත'
  38358. },
  38359. rate: {
  38360. error1: 'ශීර්ෂය හිස්ව නොවේ!',
  38361. error2: 'ශීර්ෂය 1 වනිදා වඩාත්ම වැඩි විය යුතුය!',
  38362. error3: 'පැරණි ශීර්ෂය සඳහා හොඳ අගය 1 ක් වැඩි විය යුතුය!',
  38363. error4: 'පැරණි ශීර්ෂය සඳහා වැඩි 1 ක් වන විට 1 අගයක්දි විය යුතුය!',
  38364. error5: 'පළල හෝ උස සීමාව 20 ට වඩා අඩු බව, ජංගම දුරකථන ඇතුළත් සහිතව ඇතිවිය හැකිය.'
  38365. },
  38366. timePicker: {
  38367. defaultTitle: 'කරුණාකර තෝරන්න',
  38368. defaultCancel: 'අවලංගු කරන්න',
  38369. defaultConfirm: 'තහවුරු කරන්න',
  38370. defaultYear: 'වර්ෂය',
  38371. defaultMonth: 'මාසය',
  38372. defaultDay: 'දිනය',
  38373. defaultHour: 'පැය',
  38374. defaultMinute: 'මිනිත්තුව',
  38375. defaultSecond: 'තත්පර'
  38376. },
  38377. calendar: {
  38378. weekTextList: ['අඟ', 'අක්ති', 'බදාදා', 'බදාරහත්', 'පෙරවරු', 'සිකුරාදා', 'ඉරිදා'],
  38379. weekSundayStartTextList: ['ඉරිදා', 'අඟ', 'අක්ති', 'බදාදා', 'බදාරහත්', 'පෙරවරු', 'සිකුරාදා'],
  38380. monthTextList: [
  38381. 'ජනවාරි',
  38382. 'පෙබරවාරිය',
  38383. 'මාර්තු',
  38384. 'අප්‍රේල්',
  38385. 'මැයි',
  38386. 'ජූනි',
  38387. 'ජූලි',
  38388. 'අගෝස්තු',
  38389. 'සැප්තැම්බර්',
  38390. 'ඔක්තෝබර්',
  38391. 'නොවැම්බර්',
  38392. 'දෙසැම්බර්'
  38393. ],
  38394. confirmText: 'තහවුරු කරන්න',
  38395. selectedText: 'තෝරා ඇත',
  38396. dayText: 'දිනය',
  38397. beforeText: 'පෙර',
  38398. afterText: 'පසුව',
  38399. currentWeekText: 'මෙම සතිය',
  38400. currentMonthText: 'මෙම මාසය',
  38401. currentQuarterText: 'මෙම කාර්තුව'
  38402. }
  38403. };
  38404. export default si_LK;
  38405. ================================================
  38406. FILE: packages/stdf/src/lib/lang/sk_SK.ts
  38407. ================================================
  38408. import type { LangProps } from './index.js';
  38409. const sk_SK: LangProps = {
  38410. common: {
  38411. slotEmpty: 'Toto miesto je prázdne!',
  38412. loading: 'Načítavam...',
  38413. noData: 'Žiadne dáta',
  38414. noMoreData: 'Žiadne ďalšie dáta',
  38415. done: 'Hotovo'
  38416. },
  38417. actionSheet: {
  38418. cancelText: 'Zrušiť'
  38419. },
  38420. bottomSheet: {
  38421. title: 'Titulok'
  38422. },
  38423. dialog: {
  38424. title: 'Titulok',
  38425. content: 'Obsah',
  38426. primaryText: 'Confirm',
  38427. secondaryText: 'Cancel'
  38428. },
  38429. input: {
  38430. pleaseInput: 'Prosím zadajte'
  38431. },
  38432. modal: {
  38433. title: 'Titulok',
  38434. content: 'Obsah',
  38435. btnText: 'OK'
  38436. },
  38437. navBar: {
  38438. title: 'Titulok'
  38439. },
  38440. pagination: {
  38441. defaultOnlyOnePage: 'Len jedna stránka'
  38442. },
  38443. picker: {
  38444. defaultTitle: 'Prosím vyberte',
  38445. defaultCancel: 'Zrušiť',
  38446. defaultConfirm: 'Potvrdiť'
  38447. },
  38448. asyncPicker: {
  38449. defaultTitle: 'Prosím vyberte',
  38450. defaultCancel: 'Zrušiť',
  38451. defaultConfirm: 'Potvrdiť',
  38452. defaultNext: 'Ďalšie',
  38453. defaultPrev: 'Predchádzajúce',
  38454. defaultSelected: 'Vybrané'
  38455. },
  38456. rate: {
  38457. error1: 'Hodnotenie sa nepodarilo!',
  38458. error2: 'Hodnotenie musí byť aspoň 1 hviezdička!',
  38459. error3: 'Dobré hodnotenie musí byť minimálne 1 hviezdička!',
  38460. error4: 'Priemerné hodnotenie musí byť aspoň 1 hviezdička!',
  38461. error5: 'Dĺžka komentáru musí byť kratšia ako 20 znakov.'
  38462. },
  38463. timePicker: {
  38464. defaultTitle: 'Vyberte čas',
  38465. defaultCancel: 'Zrušiť',
  38466. defaultConfirm: 'Potvrdiť',
  38467. defaultYear: 'Rok',
  38468. defaultMonth: 'Mesiac',
  38469. defaultDay: 'Deň',
  38470. defaultHour: 'Hodina',
  38471. defaultMinute: 'Minúta',
  38472. defaultSecond: 'Sekunda'
  38473. },
  38474. calendar: {
  38475. weekTextList: ['Po', 'Ut', 'St', 'Št', 'Pi', 'So', 'Ne'],
  38476. weekSundayStartTextList: ['Ne', 'Po', 'Ut', 'St', 'Št', 'Pi', 'So'],
  38477. monthTextList: ['Január', 'Február', 'Marec', 'Apríl', 'Máj', 'Jún', 'Júl', 'August', 'September', 'Október', 'November', 'December'],
  38478. confirmText: 'Potvrdiť',
  38479. selectedText: 'Vybrané',
  38480. dayText: 'Deň',
  38481. beforeText: 'Pred',
  38482. afterText: 'Po',
  38483. currentWeekText: 'Tento týždeň',
  38484. currentMonthText: 'Tento mesiac',
  38485. currentQuarterText: 'Tento štvrťrok'
  38486. }
  38487. };
  38488. export default sk_SK;
  38489. ================================================
  38490. FILE: packages/stdf/src/lib/lang/sl_SI.ts
  38491. ================================================
  38492. import type { LangProps } from './index.js';
  38493. const sl_SI: LangProps = {
  38494. common: {
  38495. slotEmpty: 'To mesto je prazno!',
  38496. loading: 'Nalaganje ...',
  38497. noData: 'Ni podatkov',
  38498. noMoreData: 'Ni več podatkov',
  38499. done: 'Končano'
  38500. },
  38501. actionSheet: {
  38502. cancelText: 'Prekliči'
  38503. },
  38504. bottomSheet: {
  38505. title: 'Naslov'
  38506. },
  38507. dialog: {
  38508. title: 'Naslov',
  38509. content: 'Vsebina',
  38510. primaryText: 'Potrdi',
  38511. secondaryText: 'Prekliči'
  38512. },
  38513. input: {
  38514. pleaseInput: 'Prosim vnesite'
  38515. },
  38516. modal: {
  38517. title: 'Naslov',
  38518. content: 'Vsebina',
  38519. btnText: 'V redu'
  38520. },
  38521. navBar: {
  38522. title: 'Naslov'
  38523. },
  38524. pagination: {
  38525. defaultOnlyOnePage: 'Samo ena stran'
  38526. },
  38527. picker: {
  38528. defaultTitle: 'Prosim izberite',
  38529. defaultCancel: 'Prekliči',
  38530. defaultConfirm: 'Potrdi'
  38531. },
  38532. asyncPicker: {
  38533. defaultTitle: 'Prosim izberite',
  38534. defaultCancel: 'Prekliči',
  38535. defaultConfirm: 'Potrdi',
  38536. defaultNext: 'Naslednja',
  38537. defaultPrev: 'Prejšnja',
  38538. defaultSelected: 'Izbrano'
  38539. },
  38540. rate: {
  38541. error1: 'Ocenjevanju ni uspelo!',
  38542. error2: 'Ocena mora biti vsaj 1 zvezdica!',
  38543. error3: 'Dobra ocena mora biti vsaj 1 zvezdica!',
  38544. error4: 'Povprečna ocena mora biti vsaj 1 zvezdica!',
  38545. error5: 'Dolžina komentarja mora biti krajša od 20 znakov.'
  38546. },
  38547. timePicker: {
  38548. defaultTitle: 'Izberite čas',
  38549. defaultCancel: 'Prekliči',
  38550. defaultConfirm: 'Potrdi',
  38551. defaultYear: 'Leto',
  38552. defaultMonth: 'Mesec',
  38553. defaultDay: 'Dan',
  38554. defaultHour: 'Ura',
  38555. defaultMinute: 'Minuta',
  38556. defaultSecond: 'Sekunda'
  38557. },
  38558. calendar: {
  38559. weekTextList: ['Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob', 'Ned'],
  38560. weekSundayStartTextList: ['Ned', 'Pon', 'Tor', 'Sre', 'Čet', 'Pet', 'Sob'],
  38561. monthTextList: [
  38562. 'Januar',
  38563. 'Februar',
  38564. 'Marec',
  38565. 'April',
  38566. 'Maj',
  38567. 'Junij',
  38568. 'Julij',
  38569. 'Avgust',
  38570. 'September',
  38571. 'Oktober',
  38572. 'November',
  38573. 'December'
  38574. ],
  38575. confirmText: 'Potrdi',
  38576. selectedText: 'Izbrano',
  38577. dayText: 'Dan',
  38578. beforeText: 'Pred',
  38579. afterText: 'Po',
  38580. currentWeekText: 'Ta teden',
  38581. currentMonthText: 'Ta mesec',
  38582. currentQuarterText: 'To četrtletje'
  38583. }
  38584. };
  38585. export default sl_SI;
  38586. ================================================
  38587. FILE: packages/stdf/src/lib/lang/sr_RS.ts
  38588. ================================================
  38589. import type { LangProps } from './index.js';
  38590. const sr_RS: LangProps = {
  38591. common: {
  38592. slotEmpty: 'Ovo mesto je prazno!',
  38593. loading: 'Učitavam...',
  38594. noData: 'Nema podataka',
  38595. noMoreData: 'Nema više podataka',
  38596. done: 'Gotovo'
  38597. },
  38598. actionSheet: {
  38599. cancelText: 'Otkaži'
  38600. },
  38601. bottomSheet: {
  38602. title: 'Naslov'
  38603. },
  38604. dialog: {
  38605. title: 'Naslov',
  38606. content: 'Sadržaj',
  38607. primaryText: 'Potvrdi',
  38608. secondaryText: 'Otkaži'
  38609. },
  38610. input: {
  38611. pleaseInput: 'Molimo unesite'
  38612. },
  38613. modal: {
  38614. title: 'Naslov',
  38615. content: 'Sadržaj',
  38616. btnText: 'U redu'
  38617. },
  38618. navBar: {
  38619. title: 'Naslov'
  38620. },
  38621. pagination: {
  38622. defaultOnlyOnePage: 'Samo jedna stranica'
  38623. },
  38624. picker: {
  38625. defaultTitle: 'Molimo odaberite',
  38626. defaultCancel: 'Otkaži',
  38627. defaultConfirm: 'Potvrdi'
  38628. },
  38629. asyncPicker: {
  38630. defaultTitle: 'Molimo odaberite',
  38631. defaultCancel: 'Otkaži',
  38632. defaultConfirm: 'Potvrdi',
  38633. defaultNext: 'Sledeće',
  38634. defaultPrev: 'Pređašnje',
  38635. defaultSelected: 'Izabrano'
  38636. },
  38637. rate: {
  38638. error1: 'Ocenjivanje nije uspelo!',
  38639. error2: 'Ocena mora da bude bar 1 zvezdica!',
  38640. error3: 'Dobra ocena mora da bude minimalno 1 zvezdica!',
  38641. error4: 'Prosečna ocena mora da bude bar 1 zvezdica!',
  38642. error5: 'Duljina komentara mora da bude kraća od 20 znakova.'
  38643. },
  38644. timePicker: {
  38645. defaultTitle: 'Odaberite vrijeme',
  38646. defaultCancel: 'Otkaži',
  38647. defaultConfirm: 'Potvrdi',
  38648. defaultYear: 'Godina',
  38649. defaultMonth: 'Mesec',
  38650. defaultDay: 'Dan',
  38651. defaultHour: 'Sati',
  38652. defaultMinute: 'Minute',
  38653. defaultSecond: 'Sekunde'
  38654. },
  38655. calendar: {
  38656. weekTextList: ['Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub', 'Ned'],
  38657. weekSundayStartTextList: ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'],
  38658. monthTextList: ['Januar', 'Februar', 'Mart', 'April', 'Maj', 'Jun', 'Jul', 'Avgust', 'Septembar', 'Oktobar', 'Novembar', 'Decembar'],
  38659. confirmText: 'Potvrdi',
  38660. selectedText: 'Izabrano',
  38661. dayText: 'Dan',
  38662. beforeText: 'Pre',
  38663. afterText: 'Posle',
  38664. currentWeekText: 'Ovaj tjedan',
  38665. currentMonthText: 'Ovaj mjesec',
  38666. currentQuarterText: 'Ovaj kvartal'
  38667. }
  38668. };
  38669. export default sr_RS;
  38670. ================================================
  38671. FILE: packages/stdf/src/lib/lang/sv_SE.ts
  38672. ================================================
  38673. import type { LangProps } from './index.js';
  38674. const sv_SE: LangProps = {
  38675. common: {
  38676. slotEmpty: 'Det finns ingen information att visa!',
  38677. loading: 'Laddar...',
  38678. noData: 'Inga data',
  38679. noMoreData: 'Ingen mer data',
  38680. done: 'Klar'
  38681. },
  38682. actionSheet: {
  38683. cancelText: 'Avbryt'
  38684. },
  38685. bottomSheet: {
  38686. title: 'Titel'
  38687. },
  38688. dialog: {
  38689. title: 'Titel',
  38690. content: 'Innehåll',
  38691. primaryText: 'Bekräfta',
  38692. secondaryText: 'Avbryt'
  38693. },
  38694. input: {
  38695. pleaseInput: 'Vänligen fyll i'
  38696. },
  38697. modal: {
  38698. title: 'Titel',
  38699. content: 'Innehåll',
  38700. btnText: 'OK'
  38701. },
  38702. navBar: {
  38703. title: 'Titel'
  38704. },
  38705. pagination: {
  38706. defaultOnlyOnePage: 'Endast en sida'
  38707. },
  38708. picker: {
  38709. defaultTitle: 'Vänligen välj',
  38710. defaultCancel: 'Avbryt',
  38711. defaultConfirm: 'Bekräfta'
  38712. },
  38713. asyncPicker: {
  38714. defaultTitle: 'Vänligen välj',
  38715. defaultCancel: 'Avbryt',
  38716. defaultConfirm: 'Bekräfta',
  38717. defaultNext: 'Nästa',
  38718. defaultPrev: 'Föregående',
  38719. defaultSelected: 'Vald'
  38720. },
  38721. rate: {
  38722. error1: 'Betygsättning misslyckades!',
  38723. error2: 'Betygsättningen måste vara minst en stjärna!',
  38724. error3: 'En bra betyg måste vara minst en stjärna!',
  38725. error4: 'Genomsnittligt betyg måste vara minst en stjärna!',
  38726. error5: 'Kommentarens längd måste vara mindre än 20 tecken.'
  38727. },
  38728. timePicker: {
  38729. defaultTitle: 'Välj tid',
  38730. defaultCancel: 'Avbryt',
  38731. defaultConfirm: 'Bekräfta',
  38732. defaultYear: 'År',
  38733. defaultMonth: 'Månad',
  38734. defaultDay: 'Dag',
  38735. defaultHour: 'Timme',
  38736. defaultMinute: 'Minut',
  38737. defaultSecond: 'Sekund'
  38738. },
  38739. calendar: {
  38740. weekTextList: ['Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör', 'Sön'],
  38741. weekSundayStartTextList: ['Sön', 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör'],
  38742. monthTextList: [
  38743. 'Januari',
  38744. 'Februari',
  38745. 'Mars',
  38746. 'April',
  38747. 'Maj',
  38748. 'Juni',
  38749. 'Juli',
  38750. 'Augusti',
  38751. 'September',
  38752. 'Oktober',
  38753. 'November',
  38754. 'December'
  38755. ],
  38756. confirmText: 'Bekräfta',
  38757. selectedText: 'Vald',
  38758. dayText: 'Dag',
  38759. beforeText: 'Före',
  38760. afterText: 'Efter',
  38761. currentWeekText: 'Denna vecka',
  38762. currentMonthText: 'Denna månad',
  38763. currentQuarterText: 'Detta kvartal'
  38764. }
  38765. };
  38766. export default sv_SE;
  38767. ================================================
  38768. FILE: packages/stdf/src/lib/lang/ta_IN.ts
  38769. ================================================
  38770. import type { LangProps } from './index.js';
  38771. const ta_IN: LangProps = {
  38772. common: {
  38773. slotEmpty: 'காண்பிக்க தகவல் இல்லை!',
  38774. loading: 'ஏற்றுகிறது...',
  38775. noData: 'தரவு இல்லை',
  38776. noMoreData: 'மேலும் தரவு இல்லை',
  38777. done: 'முடிந்தது'
  38778. },
  38779. actionSheet: {
  38780. cancelText: 'ரத்துசெய்'
  38781. },
  38782. bottomSheet: {
  38783. title: 'தலைப்பு'
  38784. },
  38785. dialog: {
  38786. title: 'தலைப்பு',
  38787. content: 'உள்ளீடு',
  38788. primaryText: 'உறுதிசெய்',
  38789. secondaryText: 'ரத்துசெய்'
  38790. },
  38791. input: {
  38792. pleaseInput: 'தயவு செய்து உள்ளிடவும்'
  38793. },
  38794. modal: {
  38795. title: 'தலைப்பு',
  38796. content: 'உள்ளீடு',
  38797. btnText: 'சரி'
  38798. },
  38799. navBar: {
  38800. title: 'தலைப்பு'
  38801. },
  38802. pagination: {
  38803. defaultOnlyOnePage: 'ஒரு பக்கம் மட்டுமே'
  38804. },
  38805. picker: {
  38806. defaultTitle: 'தயவு செய்து தேர்ந்தெடுக்கவும்',
  38807. defaultCancel: 'ரத்துசெய்',
  38808. defaultConfirm: 'உறுதிசெய்'
  38809. },
  38810. asyncPicker: {
  38811. defaultTitle: 'தயவு செய்து தேர்ந்தெடுக்கவும்',
  38812. defaultCancel: 'ரத்துசெய்',
  38813. defaultConfirm: 'உறுதிசெய்',
  38814. defaultNext: 'அடுத்து',
  38815. defaultPrev: 'முன்',
  38816. defaultSelected: 'தேர்ந்தெடுக்கப்பட்டது'
  38817. },
  38818. rate: {
  38819. error1: 'மதிப்பீடு தோல்வி!',
  38820. error2: 'மதிப்பீடு ஒரு ஸ்டார் குறைவாக இருக்க வேண்டும்!',
  38821. error3: 'ஒரு நல்ல மதிப்பீடு ஒரு ஸ்டார் குறைவாக இருக்க வேண்டும்!',
  38822. error4: 'சராசரி மதிப்பீடு ஒரு ஸ்டார் குறைவாக இருக்க வேண்டும்!',
  38823. error5: 'கருத்து முறையும் குறுகியவற்றை விட குறைவுகளை வேண்டுகின்றது.'
  38824. },
  38825. timePicker: {
  38826. defaultTitle: 'நேரத்தை தேர்ந்தெடுக்கவும்',
  38827. defaultCancel: 'ரத்துசெய்',
  38828. defaultConfirm: 'உறுதிசெய்',
  38829. defaultYear: 'ஆண்டு',
  38830. defaultMonth: 'மாதம்',
  38831. defaultDay: 'நாள்',
  38832. defaultHour: 'மணி',
  38833. defaultMinute: 'நிமிடம்',
  38834. defaultSecond: 'நொடி'
  38835. },
  38836. calendar: {
  38837. weekTextList: ['திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'வெள்ளிக்கிழமை', 'ஞாயிறு'],
  38838. weekSundayStartTextList: ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'வெள்ளிக்கிழமை'],
  38839. monthTextList: [
  38840. 'ஜனவரி',
  38841. 'பிப்ரவரி',
  38842. 'மார்ச்',
  38843. 'ஏப்ரல்',
  38844. 'மே',
  38845. 'ஜூன்',
  38846. 'ஜூலை',
  38847. 'ஆகஸ்ட்',
  38848. 'செப்டம்பர்',
  38849. 'அக்டோபர்',
  38850. 'நவம்பர்',
  38851. 'டிசம்பர்'
  38852. ],
  38853. confirmText: 'உறுதிசெய்',
  38854. selectedText: 'தேர்ந்தெடுக்கப்பட்டது',
  38855. dayText: 'நாள்',
  38856. beforeText: 'முன்னுரில்',
  38857. afterText: 'பின்னுரில்',
  38858. currentWeekText: 'இந்த வாரம்',
  38859. currentMonthText: 'இந்த மாதம்',
  38860. currentQuarterText: 'இந்த காலாண்டு'
  38861. }
  38862. };
  38863. export default ta_IN;
  38864. ================================================
  38865. FILE: packages/stdf/src/lib/lang/th_TH.ts
  38866. ================================================
  38867. import type { LangProps } from './index.js';
  38868. const th_TH: LangProps = {
  38869. common: {
  38870. slotEmpty: 'ไม่มีข้อมูล',
  38871. loading: 'กำลังโหลด...',
  38872. noData: 'ไม่มีข้อมูล',
  38873. noMoreData: 'ไม่มีข้อมูลเพิ่มเติม',
  38874. done: 'เสร็จสิ้น'
  38875. },
  38876. actionSheet: {
  38877. cancelText: 'ยกเลิก'
  38878. },
  38879. bottomSheet: {
  38880. title: 'กรุณาเลือก'
  38881. },
  38882. dialog: {
  38883. title: 'แจ้งเตือน',
  38884. content: 'ข้อความ',
  38885. primaryText: 'ตกลง',
  38886. secondaryText: 'ยกเลิก'
  38887. },
  38888. input: {
  38889. pleaseInput: 'กรุณากรอกข้อมูล'
  38890. },
  38891. modal: {
  38892. title: 'กรุณายืนยัน',
  38893. content: 'ข้อความ',
  38894. btnText: 'ตกลง'
  38895. },
  38896. navBar: {
  38897. title: 'หัวเรื่อง'
  38898. },
  38899. pagination: {
  38900. defaultOnlyOnePage: 'เพียงหน้าเดียว'
  38901. },
  38902. picker: {
  38903. defaultTitle: 'กรุณาเลือก',
  38904. defaultCancel: 'ยกเลิก',
  38905. defaultConfirm: 'ตกลง'
  38906. },
  38907. asyncPicker: {
  38908. defaultTitle: 'กรุณาเลือก',
  38909. defaultCancel: 'ยกเลิก',
  38910. defaultConfirm: 'ตกลง',
  38911. defaultNext: 'ต่อไป',
  38912. defaultPrev: 'ก่อนหน้า',
  38913. defaultSelected: 'เลือกแล้ว'
  38914. },
  38915. rate: {
  38916. error1: 'การประเมินผลล้มเหลว!',
  38917. error2: 'การประเมินผลต้องมีอย่างน้อย 1 ดาว!',
  38918. error3: 'การประเมินที่ดีต้องน้อยกว่าหรือเท่ากับ 1 ดาว!',
  38919. error4: 'การประเมินเฉลี่ยต้องน้อยกว่าหรือเท่ากับ 1 ดาว!',
  38920. error5: 'การให้คะแนนต้องน้อยกว่าหรือเท่ากับขีดจำกัด!'
  38921. },
  38922. timePicker: {
  38923. defaultTitle: 'กรุณาเลือกเวลา',
  38924. defaultCancel: 'ยกเลิก',
  38925. defaultConfirm: 'ตกลง',
  38926. defaultYear: 'ปี',
  38927. defaultMonth: 'เดือน',
  38928. defaultDay: 'วัน',
  38929. defaultHour: 'ชั่วโมง',
  38930. defaultMinute: 'นาที',
  38931. defaultSecond: 'วินาที'
  38932. },
  38933. calendar: {
  38934. weekTextList: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
  38935. weekSundayStartTextList: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
  38936. monthTextList: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'],
  38937. confirmText: 'ตกลง',
  38938. selectedText: 'ที่เลือก',
  38939. dayText: 'วัน',
  38940. beforeText: 'ก่อนหน้า',
  38941. afterText: 'หลังจาก',
  38942. currentWeekText: 'สัปดาห์นี้',
  38943. currentMonthText: 'เดือนนี้',
  38944. currentQuarterText: 'ไตรมาสนี้'
  38945. }
  38946. };
  38947. export default th_TH;
  38948. ================================================
  38949. FILE: packages/stdf/src/lib/lang/tk_TK.ts
  38950. ================================================
  38951. import type { LangProps } from './index.js';
  38952. const tk_TK: LangProps = {
  38953. common: {
  38954. slotEmpty: 'Maglumat ýok',
  38955. loading: 'Ýüklenýär...',
  38956. noData: 'Maglumat ýok',
  38957. noMoreData: 'Köp maglumat ýok',
  38958. done: 'Tamam'
  38959. },
  38960. actionSheet: {
  38961. cancelText: 'Gurnama'
  38962. },
  38963. bottomSheet: {
  38964. title: 'Saýlaň'
  38965. },
  38966. dialog: {
  38967. title: 'Bildiriş',
  38968. content: 'Mazmun',
  38969. primaryText: 'OK',
  38970. secondaryText: 'Gurnama'
  38971. },
  38972. input: {
  38973. pleaseInput: 'Eçow giriziň'
  38974. },
  38975. modal: {
  38976. title: 'Tassyklaň',
  38977. content: 'Mazmun',
  38978. btnText: 'OK'
  38979. },
  38980. navBar: {
  38981. title: 'Başlyk'
  38982. },
  38983. pagination: {
  38984. defaultOnlyOnePage: 'Bir sahypa'
  38985. },
  38986. picker: {
  38987. defaultTitle: 'Saýlaň',
  38988. defaultCancel: 'Gurnama',
  38989. defaultConfirm: 'OK'
  38990. },
  38991. asyncPicker: {
  38992. defaultTitle: 'Saýlaň',
  38993. defaultCancel: 'Gurnama',
  38994. defaultConfirm: 'OK',
  38995. defaultNext: 'Indiki',
  38996. defaultPrev: 'Öňki',
  38997. defaultSelected: 'Saýlandy'
  38998. },
  38999. rate: {
  39000. error1: 'Derecelendirme doly bolmady!',
  39001. error2: 'Iň az bir ýyldyz derejesi gerekli!',
  39002. error3: 'Dürli derecelendirme-iň az bir ýyldyz derejesi talap edýär!',
  39003. error4: 'Ýekinç derecelendiriljegine iň az bir ýyldyz derejesi talap edýär!',
  39004. error5: 'Derecelendirme-gatnaşyklaryň derejeleri pişirilme-gatnaşygyndan ýokarny!'
  39005. },
  39006. timePicker: {
  39007. defaultTitle: 'Zaman saýlaň',
  39008. defaultCancel: 'Gurnama',
  39009. defaultConfirm: 'OK',
  39010. defaultYear: 'Ýyl',
  39011. defaultMonth: 'Aý',
  39012. defaultDay: 'Gün',
  39013. defaultHour: 'Sagat',
  39014. defaultMinute: 'Munyt',
  39015. defaultSecond: 'Saniýe'
  39016. },
  39017. calendar: {
  39018. weekTextList: ['Ys', 'Ys', 'Ar', 'Çä', 'Pe', 'Ýa', 'Şe'],
  39019. weekSundayStartTextList: ['Ýs', 'Ýs', 'Ar', 'Çä', 'Pe', 'Ýa', 'Şe'],
  39020. monthTextList: ['Ýan', 'Few', 'Mar', 'Apr', 'Maý', 'Iýun', 'Iýul', 'Awg', 'Sen', 'Okt', 'Noý', 'Dek'],
  39021. confirmText: 'OK',
  39022. selectedText: 'Saýlandy',
  39023. dayText: 'Gün',
  39024. beforeText: 'Öňki',
  39025. afterText: 'Soňky',
  39026. currentWeekText: 'Bu hepde',
  39027. currentMonthText: 'Bu aý',
  39028. currentQuarterText: 'Bu çärýek'
  39029. }
  39030. };
  39031. export default tk_TK;
  39032. ================================================
  39033. FILE: packages/stdf/src/lib/lang/tr_TR.ts
  39034. ================================================
  39035. import type { LangProps } from './index.js';
  39036. const tr_TR: LangProps = {
  39037. common: {
  39038. slotEmpty: 'Veri yok',
  39039. loading: 'Yükleniyor...',
  39040. noData: 'Veri yok',
  39041. noMoreData: 'Daha fazla veri yok',
  39042. done: 'Tamam'
  39043. },
  39044. actionSheet: {
  39045. cancelText: 'İptal'
  39046. },
  39047. bottomSheet: {
  39048. title: 'Lütfen seçiniz'
  39049. },
  39050. dialog: {
  39051. title: 'Uyarı',
  39052. content: 'İçerik',
  39053. primaryText: 'Tamam',
  39054. secondaryText: 'İptal'
  39055. },
  39056. input: {
  39057. pleaseInput: 'Lütfen giriş yapınız'
  39058. },
  39059. modal: {
  39060. title: 'Onay',
  39061. content: 'İçerik',
  39062. btnText: 'Tamam'
  39063. },
  39064. navBar: {
  39065. title: 'Başlık'
  39066. },
  39067. pagination: {
  39068. defaultOnlyOnePage: 'Sadece bir sayfa'
  39069. },
  39070. picker: {
  39071. defaultTitle: 'Lütfen seçiniz',
  39072. defaultCancel: 'İptal',
  39073. defaultConfirm: 'Tamam'
  39074. },
  39075. asyncPicker: {
  39076. defaultTitle: 'Lütfen seçiniz',
  39077. defaultCancel: 'İptal',
  39078. defaultConfirm: 'Tamam',
  39079. defaultNext: 'Sonraki',
  39080. defaultPrev: 'Önceki',
  39081. defaultSelected: 'Seçili'
  39082. },
  39083. rate: {
  39084. error1: 'Oylama başarısız oldu!',
  39085. error2: 'En az 1 yıldız değerlendirmesi gereklidir!',
  39086. error3: 'İyi bir değerlendirme en az 1 yıldız değerlendirmesi gerektirir!',
  39087. error4: 'Ortalama derecelendirme 1 yıldızın altında olmalıdır!',
  39088. error5: 'Oylama, sınırın altında olmalıdır!'
  39089. },
  39090. timePicker: {
  39091. defaultTitle: 'Lütfen bir tarih seçin',
  39092. defaultCancel: 'İptal',
  39093. defaultConfirm: 'Tamam',
  39094. defaultYear: 'Yıl',
  39095. defaultMonth: 'Ay',
  39096. defaultDay: 'Gün',
  39097. defaultHour: 'Saat',
  39098. defaultMinute: 'Dakika',
  39099. defaultSecond: 'Saniye'
  39100. },
  39101. calendar: {
  39102. weekTextList: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
  39103. weekSundayStartTextList: ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
  39104. monthTextList: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
  39105. confirmText: 'Tamam',
  39106. selectedText: 'Seçildi',
  39107. dayText: 'Gün',
  39108. beforeText: 'Önce',
  39109. afterText: 'Sonra',
  39110. currentWeekText: 'Bu hafta',
  39111. currentMonthText: 'Bu ay',
  39112. currentQuarterText: 'Bu çeyrek'
  39113. }
  39114. };
  39115. export default tr_TR;
  39116. ================================================
  39117. FILE: packages/stdf/src/lib/lang/uk_UA.ts
  39118. ================================================
  39119. import type { LangProps } from './index.js';
  39120. const uk_UA: LangProps = {
  39121. common: {
  39122. slotEmpty: 'Немає даних',
  39123. loading: 'Завантаження...',
  39124. noData: 'Немає даних',
  39125. noMoreData: 'Немає більше даних',
  39126. done: 'Готово'
  39127. },
  39128. actionSheet: {
  39129. cancelText: 'Скасувати'
  39130. },
  39131. bottomSheet: {
  39132. title: 'Виберіть'
  39133. },
  39134. dialog: {
  39135. title: 'Повідомлення',
  39136. content: 'Зміст',
  39137. primaryText: 'OK',
  39138. secondaryText: 'Скасувати'
  39139. },
  39140. input: {
  39141. pleaseInput: 'Будь ласка, введіть'
  39142. },
  39143. modal: {
  39144. title: 'Підтвердження',
  39145. content: 'Зміст',
  39146. btnText: 'OK'
  39147. },
  39148. navBar: {
  39149. title: 'Назва'
  39150. },
  39151. pagination: {
  39152. defaultOnlyOnePage: 'Тільки одна сторінка'
  39153. },
  39154. picker: {
  39155. defaultTitle: 'Виберіть',
  39156. defaultCancel: 'Скасувати',
  39157. defaultConfirm: 'OK'
  39158. },
  39159. asyncPicker: {
  39160. defaultTitle: 'Виберіть',
  39161. defaultCancel: 'Скасувати',
  39162. defaultConfirm: 'OK',
  39163. defaultNext: 'Далі',
  39164. defaultPrev: 'Назад',
  39165. defaultSelected: 'Обрано'
  39166. },
  39167. rate: {
  39168. error1: 'Невдала оцінка!',
  39169. error2: 'Необхідно хоча б одну зірку!',
  39170. error3: 'Для правильної оцінки потрібно хоча б одну зірку!',
  39171. error4: 'Для середньої оцінки потрібно хоча б одну зірку!',
  39172. error5: 'Оцінка не відповідає принципам рейтингування!'
  39173. },
  39174. timePicker: {
  39175. defaultTitle: 'Виберіть час',
  39176. defaultCancel: 'Скасувати',
  39177. defaultConfirm: 'OK',
  39178. defaultYear: 'Рік',
  39179. defaultMonth: 'Місяць',
  39180. defaultDay: 'День',
  39181. defaultHour: 'Година',
  39182. defaultMinute: 'Хвилина',
  39183. defaultSecond: 'Секунда'
  39184. },
  39185. calendar: {
  39186. weekTextList: ['Нд', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
  39187. weekSundayStartTextList: ['Нд', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
  39188. monthTextList: [
  39189. 'Січень',
  39190. 'Лютий',
  39191. 'Березень',
  39192. 'Квітень',
  39193. 'Травень',
  39194. 'Червень',
  39195. 'Липень',
  39196. 'Серпень',
  39197. 'Вересень',
  39198. 'Жовтень',
  39199. 'Листопад',
  39200. 'Грудень'
  39201. ],
  39202. confirmText: 'OK',
  39203. selectedText: 'Обрано',
  39204. dayText: 'День ',
  39205. beforeText: 'До ',
  39206. afterText: 'Після ',
  39207. currentWeekText: 'Поточний тиждень',
  39208. currentMonthText: 'Поточний місяць',
  39209. currentQuarterText: 'Поточний квартал'
  39210. }
  39211. };
  39212. export default uk_UA;
  39213. ================================================
  39214. FILE: packages/stdf/src/lib/lang/ur_PK.ts
  39215. ================================================
  39216. import type { LangProps } from './index.js';
  39217. const ur_PK: LangProps = {
  39218. common: {
  39219. slotEmpty: 'کوئی ڈیٹا نہیں',
  39220. loading: 'لوڈ ہو رہا ہے ...',
  39221. noData: 'کوئی ڈیٹا نہیں',
  39222. noMoreData: 'کوئی زیادہ ڈیٹا نہیں',
  39223. done: 'تمام'
  39224. },
  39225. actionSheet: {
  39226. cancelText: 'منسوخ'
  39227. },
  39228. bottomSheet: {
  39229. title: 'منتخب کریں'
  39230. },
  39231. dialog: {
  39232. title: 'الرٹ',
  39233. content: 'مواد',
  39234. primaryText: 'ٹھیک ہے',
  39235. secondaryText: 'منسوخ'
  39236. },
  39237. input: {
  39238. pleaseInput: 'براہ کرم انپٹ کریں'
  39239. },
  39240. modal: {
  39241. title: 'تصدیق کریں',
  39242. content: 'مواد',
  39243. btnText: 'ٹھیک ہے'
  39244. },
  39245. navBar: {
  39246. title: 'عنوان'
  39247. },
  39248. pagination: {
  39249. defaultOnlyOnePage: 'صرف ایک صفحہ'
  39250. },
  39251. picker: {
  39252. defaultTitle: 'منتخب کریں',
  39253. defaultCancel: 'منسوخ',
  39254. defaultConfirm: 'ٹھیک ہے'
  39255. },
  39256. asyncPicker: {
  39257. defaultTitle: 'منتخب کریں',
  39258. defaultCancel: 'منسوخ',
  39259. defaultConfirm: 'ٹھیک ہے',
  39260. defaultNext: 'اگلا',
  39261. defaultPrev: 'پچھلا',
  39262. defaultSelected: 'منتخب'
  39263. },
  39264. rate: {
  39265. error1: 'درجہ بندی ناکام ہوگی!',
  39266. error2: 'کم از کم ایک ستارہ درجہ ضروری ہے!',
  39267. error3: 'ایک درست درجہ کے لئے کم از کم ایک ستارہ کی درجہ بندی درکار ہے!',
  39268. error4: 'ایک اوسط درجہ کے لئے کم از کم ایک ستارہ کی درجہ بندی درکار ہے!',
  39269. error5: 'ریٹنگ بالکل مناسب نہیں ہے!'
  39270. },
  39271. timePicker: {
  39272. defaultTitle: 'وقت منتخب کریں',
  39273. defaultCancel: 'منسوخ',
  39274. defaultConfirm: 'ٹھیک ہے',
  39275. defaultYear: 'سال',
  39276. defaultMonth: 'مہینہ',
  39277. defaultDay: 'دن',
  39278. defaultHour: 'گھنٹہ',
  39279. defaultMinute: 'منٹ',
  39280. defaultSecond: 'سیکنڈ'
  39281. },
  39282. calendar: {
  39283. weekTextList: ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'],
  39284. weekSundayStartTextList: ['ایک', 'دو', 'تین', 'چار', 'پانچ', 'چھہ', 'ہفتہ'],
  39285. monthTextList: ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'],
  39286. confirmText: 'ٹھیک ہے',
  39287. selectedText: 'منتخب شدہ',
  39288. dayText: 'دن',
  39289. beforeText: 'پہلے',
  39290. afterText: 'بعد میں',
  39291. currentWeekText: 'اس ہفتے',
  39292. currentMonthText: 'اس مہینہ',
  39293. currentQuarterText: 'اس ترکیب'
  39294. }
  39295. };
  39296. export default ur_PK;
  39297. ================================================
  39298. FILE: packages/stdf/src/lib/lang/vi_VN.ts
  39299. ================================================
  39300. import type { LangProps } from './index.js';
  39301. const vi_VN: LangProps = {
  39302. common: {
  39303. slotEmpty: 'Không có dữ liệu',
  39304. loading: 'Đang tải...',
  39305. noData: 'Không có dữ liệu',
  39306. noMoreData: 'Không còn dữ liệu',
  39307. done: 'Xong'
  39308. },
  39309. actionSheet: {
  39310. cancelText: 'Hủy'
  39311. },
  39312. bottomSheet: {
  39313. title: 'Chọn'
  39314. },
  39315. dialog: {
  39316. title: 'Thông báo',
  39317. content: 'Nội dung',
  39318. primaryText: 'OK',
  39319. secondaryText: 'Hủy'
  39320. },
  39321. input: {
  39322. pleaseInput: 'Vui lòng nhập'
  39323. },
  39324. modal: {
  39325. title: 'Xác nhận',
  39326. content: 'Nội dung',
  39327. btnText: 'OK'
  39328. },
  39329. navBar: {
  39330. title: 'Tiêu đề'
  39331. },
  39332. pagination: {
  39333. defaultOnlyOnePage: 'Chỉ có một trang'
  39334. },
  39335. picker: {
  39336. defaultTitle: 'Chọn',
  39337. defaultCancel: 'Hủy',
  39338. defaultConfirm: 'OK'
  39339. },
  39340. asyncPicker: {
  39341. defaultTitle: 'Chọn',
  39342. defaultCancel: 'Hủy',
  39343. defaultConfirm: 'OK',
  39344. defaultNext: 'Tiếp theo',
  39345. defaultPrev: 'Trước đó',
  39346. defaultSelected: 'Đã chọn'
  39347. },
  39348. rate: {
  39349. error1: 'Đánh giá không thành công!',
  39350. error2: 'Cần ít nhất một sao!',
  39351. error3: 'Cần ít nhất một sao để đánh giá chính xác!',
  39352. error4: 'Cần ít nhất một sao để đánh giá trung bình!',
  39353. error5: 'Đánh giá không phù hợp với nguyên tắc đánh giá!'
  39354. },
  39355. timePicker: {
  39356. defaultTitle: 'Chọn thời gian',
  39357. defaultCancel: 'Hủy',
  39358. defaultConfirm: 'OK',
  39359. defaultYear: 'Năm',
  39360. defaultMonth: 'Tháng',
  39361. defaultDay: 'Ngày',
  39362. defaultHour: 'Giờ',
  39363. defaultMinute: 'Phút',
  39364. defaultSecond: 'Giây'
  39365. },
  39366. calendar: {
  39367. weekTextList: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
  39368. weekSundayStartTextList: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
  39369. monthTextList: [
  39370. 'Tháng 1',
  39371. 'Tháng 2',
  39372. 'Tháng 3',
  39373. 'Tháng 4',
  39374. 'Tháng 5',
  39375. 'Tháng 6',
  39376. 'Tháng 7',
  39377. 'Tháng 8',
  39378. 'Tháng 9',
  39379. 'Tháng 10',
  39380. 'Tháng 11',
  39381. 'Tháng 12'
  39382. ],
  39383. confirmText: 'OK',
  39384. selectedText: 'Đã chọn',
  39385. dayText: 'Ngày ',
  39386. beforeText: 'Trước ',
  39387. afterText: 'Sau ',
  39388. currentWeekText: 'Tuần này',
  39389. currentMonthText: 'Tháng này',
  39390. currentQuarterText: 'Quý này'
  39391. }
  39392. };
  39393. export default vi_VN;
  39394. ================================================
  39395. FILE: packages/stdf/src/lib/lang/zh_CN.ts
  39396. ================================================
  39397. import type { LangProps } from './index.js';
  39398. const zh_CN: LangProps = {
  39399. common: {
  39400. slotEmpty: '插槽内容为空!',
  39401. loading: '加载中...',
  39402. noData: '暂无数据',
  39403. noMoreData: '没有更多数据了',
  39404. done: '完成'
  39405. },
  39406. actionSheet: {
  39407. cancelText: '取消'
  39408. },
  39409. bottomSheet: {
  39410. title: '标题'
  39411. },
  39412. dialog: {
  39413. title: '提示',
  39414. content: '内容',
  39415. primaryText: '确定',
  39416. secondaryText: '取消'
  39417. },
  39418. input: {
  39419. pleaseInput: '请输入'
  39420. },
  39421. modal: {
  39422. title: '标题',
  39423. content: '内容',
  39424. btnText: '我知道了'
  39425. },
  39426. navBar: {
  39427. title: '标题'
  39428. },
  39429. pagination: {
  39430. defaultOnlyOnePage: '只有一页'
  39431. },
  39432. picker: {
  39433. defaultTitle: '请选择',
  39434. defaultCancel: '取消',
  39435. defaultConfirm: '确定'
  39436. },
  39437. asyncPicker: {
  39438. defaultTitle: '请选择',
  39439. defaultCancel: '取消',
  39440. defaultConfirm: '确定',
  39441. defaultNext: '下一步',
  39442. defaultPrev: '上一步',
  39443. defaultSelected: '已选'
  39444. },
  39445. rate: {
  39446. error1: 'value 不能大于 total!',
  39447. error2: 'total 必须能被 1 整除!',
  39448. error3: '非半选时 value 必须能被 1 整除!',
  39449. error4: '半选时 value 必须能被 0.5 整除!',
  39450. error5: 'width 或 height 小于 20 会使移动端点击困难!'
  39451. },
  39452. timePicker: {
  39453. defaultTitle: '请选择',
  39454. defaultCancel: '取消',
  39455. defaultConfirm: '确定',
  39456. defaultYear: '年',
  39457. defaultMonth: '月',
  39458. defaultDay: '日',
  39459. defaultHour: '时',
  39460. defaultMinute: '分',
  39461. defaultSecond: '秒'
  39462. },
  39463. calendar: {
  39464. weekTextList: ['一', '二', '三', '四', '五', '六', '日'],
  39465. weekSundayStartTextList: ['日', '一', '二', '三', '四', '五', '六'],
  39466. monthTextList: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  39467. confirmText: '确认',
  39468. selectedText: '已选',
  39469. dayText: '天',
  39470. beforeText: '最近',
  39471. afterText: '未来',
  39472. currentWeekText: '本周',
  39473. currentMonthText: '本月',
  39474. currentQuarterText: '本季度'
  39475. }
  39476. };
  39477. export default zh_CN;
  39478. ================================================
  39479. FILE: packages/stdf/src/lib/lang/zh_HK.ts
  39480. ================================================
  39481. import type { LangProps } from './index.js';
  39482. const zh_HK: LangProps = {
  39483. common: {
  39484. slotEmpty: '插槽內容為空!',
  39485. loading: '載入中...',
  39486. noData: '暫無數據',
  39487. noMoreData: '沒有更多數據了',
  39488. done: '完成'
  39489. },
  39490. actionSheet: {
  39491. cancelText: '取消'
  39492. },
  39493. bottomSheet: {
  39494. title: '標題'
  39495. },
  39496. dialog: {
  39497. title: '提示',
  39498. content: '內容',
  39499. primaryText: '確定',
  39500. secondaryText: '取消'
  39501. },
  39502. input: {
  39503. pleaseInput: '請輸入'
  39504. },
  39505. modal: {
  39506. title: '標題',
  39507. content: '內容',
  39508. btnText: '我知道了'
  39509. },
  39510. navBar: {
  39511. title: '標題'
  39512. },
  39513. pagination: {
  39514. defaultOnlyOnePage: '只有一頁'
  39515. },
  39516. picker: {
  39517. defaultTitle: '請選擇',
  39518. defaultCancel: '取消',
  39519. defaultConfirm: '確定'
  39520. },
  39521. asyncPicker: {
  39522. defaultTitle: '請選擇',
  39523. defaultCancel: '取消',
  39524. defaultConfirm: '確定',
  39525. defaultNext: '下一步',
  39526. defaultPrev: '上一步',
  39527. defaultSelected: '已選'
  39528. },
  39529. rate: {
  39530. error1: 'value 不能大於 total !',
  39531. error2: 'total 必須能被 1 整除!',
  39532. error3: '非半選時 value 必須能被 1 整除!',
  39533. error4: '半選時 value 必須能被 0.5 整除!',
  39534. error5: 'width 或 height 小於 20 會使移動端點擊困難!'
  39535. },
  39536. timePicker: {
  39537. defaultTitle: '請選擇',
  39538. defaultCancel: '取消',
  39539. defaultConfirm: '確定',
  39540. defaultYear: '年',
  39541. defaultMonth: '月',
  39542. defaultDay: '日',
  39543. defaultHour: '時',
  39544. defaultMinute: '分',
  39545. defaultSecond: '秒'
  39546. },
  39547. calendar: {
  39548. weekTextList: ['一', '二', '三', '四', '五', '六', '日'],
  39549. weekSundayStartTextList: ['日', '一', '二', '三', '四', '五', '六'],
  39550. monthTextList: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  39551. confirmText: '確認',
  39552. selectedText: '已選',
  39553. dayText: '天',
  39554. beforeText: '最近',
  39555. afterText: '未來',
  39556. currentWeekText: '本週',
  39557. currentMonthText: '本月',
  39558. currentQuarterText: '本季度'
  39559. }
  39560. };
  39561. export default zh_HK;
  39562. ================================================
  39563. FILE: packages/stdf/src/lib/lang/zh_TW.ts
  39564. ================================================
  39565. import type { LangProps } from './index.js';
  39566. const zh_TW: LangProps = {
  39567. common: {
  39568. slotEmpty: '插槽內容為空!',
  39569. loading: '載入中...',
  39570. noData: '暫無數據',
  39571. noMoreData: '沒有更多數據了',
  39572. done: '完成'
  39573. },
  39574. actionSheet: {
  39575. cancelText: '取消'
  39576. },
  39577. bottomSheet: {
  39578. title: '標題'
  39579. },
  39580. dialog: {
  39581. title: '提示',
  39582. content: '內容',
  39583. primaryText: '確定',
  39584. secondaryText: '取消'
  39585. },
  39586. input: {
  39587. pleaseInput: '請輸入'
  39588. },
  39589. modal: {
  39590. title: '標題',
  39591. content: '內容',
  39592. btnText: '我知道了'
  39593. },
  39594. navBar: {
  39595. title: '標題'
  39596. },
  39597. pagination: {
  39598. defaultOnlyOnePage: '只有一頁'
  39599. },
  39600. picker: {
  39601. defaultTitle: '請選擇',
  39602. defaultCancel: '取消',
  39603. defaultConfirm: '確定'
  39604. },
  39605. asyncPicker: {
  39606. defaultTitle: '請選擇',
  39607. defaultCancel: '取消',
  39608. defaultConfirm: '確定',
  39609. defaultNext: '下一步',
  39610. defaultPrev: '上一步',
  39611. defaultSelected: '已選'
  39612. },
  39613. rate: {
  39614. error1: 'value 不能大於 total !',
  39615. error2: 'total 必須能被 1 整除!',
  39616. error3: '非半選時 value 必須能被 1 整除!',
  39617. error4: '半選時 value 必須能被 0.5 整除!',
  39618. error5: 'width 或 height 小於 20 會使移動端點擊困難!'
  39619. },
  39620. timePicker: {
  39621. defaultTitle: '請選擇',
  39622. defaultCancel: '取消',
  39623. defaultConfirm: '確定',
  39624. defaultYear: '年',
  39625. defaultMonth: '月',
  39626. defaultDay: '日',
  39627. defaultHour: '時',
  39628. defaultMinute: '分',
  39629. defaultSecond: '秒'
  39630. },
  39631. calendar: {
  39632. weekTextList: ['一', '二', '三', '四', '五', '六', '日'],
  39633. weekSundayStartTextList: ['日', '一', '二', '三', '四', '五', '六'],
  39634. monthTextList: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  39635. confirmText: '確認',
  39636. selectedText: '已選',
  39637. dayText: '天',
  39638. beforeText: '最近',
  39639. afterText: '未來',
  39640. currentWeekText: '本週',
  39641. currentMonthText: '本月',
  39642. currentQuarterText: '本季度'
  39643. }
  39644. };
  39645. export default zh_TW;
  39646. ================================================
  39647. FILE: packages/stdf/src/lib/theme/darkMode.ts
  39648. ================================================
  39649. /**
  39650. * 给 HTML 元素增加或删除 dark 类名,实现 Mode 切换
  39651. * Add or remove the dark class name to the HTML element to implement Mode switching
  39652. * @example
  39653. * darkMode(true) // 开启 dark 模式
  39654. * darkMode(false) // 关闭 dark 模式
  39655. */
  39656. const darkMode = (isDark: boolean = true): void => {
  39657. if (isDark) {
  39658. document.documentElement.classList.add('dark');
  39659. } else {
  39660. document.documentElement.classList.remove('dark');
  39661. }
  39662. };
  39663. export default darkMode;
  39664. ================================================
  39665. FILE: packages/stdf/src/lib/theme/index.ts
  39666. ================================================
  39667. import darkMode from './darkMode.js';
  39668. import switchTheme from './switchTheme.js';
  39669. import STDFTheme from './stdf.js';
  39670. import type { ThemeProps, PrimaryAndDarkColor } from './types.js';
  39671. export { darkMode, switchTheme, STDFTheme, type ThemeProps, type PrimaryAndDarkColor };
  39672. ================================================
  39673. FILE: packages/stdf/src/lib/theme/stdf.ts
  39674. ================================================
  39675. import type { ThemeProps } from './types.js';
  39676. const STDFTheme: ThemeProps = {
  39677. name: 'STDF',
  39678. color: {
  39679. primary: {
  39680. 50: 'oklch(0.979 0.01 267.36)', // #F5F8FF hsl(222, 100%, 98%)
  39681. 100: 'oklch(0.95 0.024 270.343)', // #E8EEFF hsl(224, 100%, 96%)
  39682. 200: 'oklch(0.847 0.074 271.188)', // #BBCBFE hsl(226, 97%, 87%)
  39683. 300: 'oklch(0.741 0.13 272.232)', // #8FA5FD hsl(228, 97%, 78%)
  39684. 400: 'oklch(0.634 0.193 271.595)', // #637CFD hsl(230, 98%, 69%)
  39685. 500: 'oklch(0.536 0.252 268.66)', // #3751FC hsl(232, 97%, 60%)
  39686. default: 'oklch(0.467 0.296 264.886)', // #0B24FB hsl(234, 97%, 51%)
  39687. 700: 'oklch(0.397 0.26 264.877)', // #0714CF hsl(236, 94%, 42%)
  39688. 800: 'oklch(0.331 0.221 264.833)', // #0409A4 hsl(238, 95%, 33%)
  39689. 900: 'oklch(0.26 0.178 264.428)', // #010178 hsl(240, 98%, 24%)
  39690. 950: 'oklch(0.192 0.13 266.64)' // #03004D hsl(242, 100%, 15%)
  39691. },
  39692. dark: {
  39693. 50: 'oklch(0.995 0.012 101.474)', // #FFFEF5 hsl(54, 100%, 98%)
  39694. 100: 'oklch(0.986 0.025 97.107)', // #FFFBE8 hsl(50, 100%, 96%)
  39695. 200: 'oklch(0.965 0.059 95.884)', // #FFF4C7 hsl(48, 100%, 89%)
  39696. 300: 'oklch(0.938 0.089 92.952)', // #FFEAA6 hsl(46, 100%, 83%)
  39697. 400: 'oklch(0.91 0.114 89.711)', // #FFDE85 hsl(44, 100%, 76%)
  39698. 500: 'oklch(0.88 0.136 86.375)', // #FFD164 hsl(42, 100%, 70%)
  39699. default: 'oklch(0.845 0.153 80.597)', // #FFC043 hsl(40, 100%, 63%)
  39700. 700: 'oklch(0.71 0.137 75.734)', // #D29429 hsl(38, 67%, 49%)
  39701. 800: 'oklch(0.58 0.118 70.166)', // #A66C16 hsl(36, 77%, 37%)
  39702. 900: 'oklch(0.449 0.097 65.209)', // #794808 hsl(34, 88%, 25%)
  39703. 950: 'oklch(0.321 0.074 62.379)' // #4D2900 hsl(32, 100%, 15%)
  39704. },
  39705. primaryBlack: 'oklch(0.116 0.054 267.087)', // #010319 hsl(234, 95%, 5%)
  39706. primaryWhite: 'oklch(0.961 0.001 286.375)', // #F2F2F3 hsl(234, 5%, 95%)
  39707. darkBlack: 'oklch(0.183 0.035 86.634)', // #191101 hsl(40, 95%, 5%)
  39708. darkWhite: 'oklch(0.962 0.001 17.178)', // #F3F2F2 hsl(40, 5%, 95%)
  39709. functional: {
  39710. success: 'oklch(0.704 0.142 167.084)', // #11bb8d hsl(164, 83%, 40%)
  39711. warning: 'oklch(0.558 0.154 47.186)', // #b95000 hsl(26, 100%, 36%)
  39712. error: 'oklch(0.564 0.223 28.46)', // #da1414 hsl(0, 83%, 47%)
  39713. info: 'oklch(0.482 0.14 261.518)' // #2e5aac hsl(219, 58%, 43%)
  39714. },
  39715. extend: [
  39716. {
  39717. color: 'oklch(0.703 0.149 235.059)', // #00acee hsl(197, 100%, 47%)
  39718. alias: 'Twitter'
  39719. },
  39720. {
  39721. color: 'oklch(0.702 0.194 38.137)', // #ff6937 hsl(15, 100%, 61%)
  39722. alias: 'Svelte'
  39723. },
  39724. {
  39725. color: 'oklch(0.482 0.107 161.212)', // #00704a hsl(160, 100%, 22%)
  39726. alias: 'Starbucks'
  39727. }
  39728. ]
  39729. }
  39730. };
  39731. export default STDFTheme;
  39732. ================================================
  39733. FILE: packages/stdf/src/lib/theme/switchTheme.ts
  39734. ================================================
  39735. import type { ThemeProps } from './types.js';
  39736. /**
  39737. * 给 HTML 元素设置 CSS 变量,用于切换主题
  39738. * Let the HTML element set the CSS variable for switching themes
  39739. * @example
  39740. * setPropertyFunc('--primary', '#000000');
  39741. */
  39742. const setPropertyFunc: (name: string, value: string) => void = (name, value) => {
  39743. document.documentElement.style.setProperty(name, value);
  39744. };
  39745. /**
  39746. * 切换主题
  39747. * Switch theme
  39748. * @example
  39749. * import { stdfTheme } from 'stdf/theme';
  39750. * switchTheme(stdfTheme);
  39751. */
  39752. const switchTheme = (theme: ThemeProps): void => {
  39753. const { color } = theme;
  39754. for (const [key, value] of Object.entries(color.primary)) {
  39755. setPropertyFunc(key === 'default' ? '--color-primary' : `--color-primary-${key}`, value);
  39756. }
  39757. for (const [key, value] of Object.entries(color.dark)) {
  39758. setPropertyFunc(key === 'default' ? '--color-dark' : `--color-dark-${key}`, value);
  39759. }
  39760. setPropertyFunc('--color-success', color.functional.success);
  39761. setPropertyFunc('--color-warning', color.functional.warning);
  39762. setPropertyFunc('--color-error', color.functional.error);
  39763. setPropertyFunc('--color-info', color.functional.info);
  39764. setPropertyFunc('--color-primaryBlack', color.primaryBlack);
  39765. setPropertyFunc('--color-primaryWhite', color.primaryWhite);
  39766. setPropertyFunc('--color-darkBlack', color.darkBlack);
  39767. setPropertyFunc('--color-darkWhite', color.darkWhite);
  39768. if (color.extend.length > 0) {
  39769. color.extend.forEach((item, i) => {
  39770. if ('color' in item) {
  39771. setPropertyFunc(`--color-extend${i}`, item.color);
  39772. setPropertyFunc(`--color-${item.alias}`, item.color);
  39773. }
  39774. });
  39775. }
  39776. };
  39777. export default switchTheme;
  39778. ================================================
  39779. FILE: packages/stdf/src/lib/theme/types.ts
  39780. ================================================
  39781. export type PrimaryAndDarkColor = {
  39782. 50: string;
  39783. 100: string;
  39784. 200: string;
  39785. 300: string;
  39786. 400: string;
  39787. 500: string;
  39788. default: string;
  39789. 700: string;
  39790. 800: string;
  39791. 900: string;
  39792. 950: string;
  39793. };
  39794. export type ThemeProps = {
  39795. name: string;
  39796. color: {
  39797. primary: PrimaryAndDarkColor;
  39798. dark: PrimaryAndDarkColor;
  39799. primaryBlack: string;
  39800. primaryWhite: string;
  39801. darkBlack: string;
  39802. darkWhite: string;
  39803. functional: { success: string; warning: string; error: string; info: string };
  39804. extend: { color: string; alias: string }[];
  39805. };
  39806. };
  39807. ================================================
  39808. FILE: packages/stdf/src/lib/types/index.ts
  39809. ================================================
  39810. import type { Snippet, Component } from 'svelte';
  39811. export type ActionProps = {
  39812. content: string;
  39813. style?: 'normal' | 'theme' | 'danger' | 'disabled';
  39814. desc?: string;
  39815. showImg?: boolean;
  39816. imgRadius?: 'none' | 'sm' | 'full' | 'lg';
  39817. imgSrc?: string;
  39818. };
  39819. export type ActionSheetProps = {
  39820. visible?: boolean;
  39821. title?: string;
  39822. titleAlign?: 'left' | 'center' | 'right';
  39823. actions?: ActionProps[];
  39824. popup?: PopupProps;
  39825. showCancel?: boolean;
  39826. cancelText?: string;
  39827. actionClosable?: boolean;
  39828. align?: 'left' | 'center' | 'right';
  39829. oncancel?: () => void;
  39830. onclickAction?: (index: number, action: ActionProps) => void;
  39831. onclose?: () => void;
  39832. };
  39833. export type AsyncPickerProps = {
  39834. visible?: boolean;
  39835. data?: Record<string, unknown>[];
  39836. lastLevel?: boolean;
  39837. firstLevel?: boolean;
  39838. showRow?: 3 | 5 | 7;
  39839. labelKey?: string;
  39840. align?: 'left' | 'center' | 'right';
  39841. cancelText?: string;
  39842. confirmText?: string;
  39843. title?: string;
  39844. nextText?: string;
  39845. prevText?: string;
  39846. showSelected?: boolean;
  39847. selectedText?: string;
  39848. popup?: PopupProps;
  39849. loading?: LoadingProps;
  39850. oncancel?: () => void;
  39851. onprev?: () => void;
  39852. onconfirm?: (items: Record<string, unknown>[], indexs: number[]) => void;
  39853. onnext?: (index: number) => void;
  39854. onclose?: () => void;
  39855. };
  39856. export type AvatarProps = {
  39857. image?: string;
  39858. alt?: string;
  39859. icon?: IconProps;
  39860. altSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
  39861. radius?: 'none' | 'sm' | 'xl' | '2xl' | '3xl' | 'full';
  39862. size?: 'xs' | 'sm' | 'base' | 'md' | 'lg' | 'xl' | '2xl';
  39863. imgSize?: 's' | 'm' | 'l';
  39864. line?: 'none' | 'solid' | 'dashed' | 'dotted';
  39865. injClass?: string;
  39866. onclick?: () => void;
  39867. };
  39868. export type AvatarsProps = {
  39869. data: AvatarProps[];
  39870. radius?: 'none' | 'sm' | 'xl' | '2xl' | '3xl' | 'full';
  39871. size?: 'xs' | 'sm' | 'base' | 'md' | 'lg' | 'xl' | '2xl';
  39872. compact?: number;
  39873. lineWidth?: '0' | '1' | '2' | '3' | '4' | '8';
  39874. reverse?: boolean;
  39875. max?: number;
  39876. top?: 'totle' | 'add' | null | Snippet;
  39877. injClass?: string;
  39878. onclick?: () => void;
  39879. };
  39880. export type BadgeProps = {
  39881. text?: string;
  39882. radius?: 'full' | 'sm' | 'none' | 'leaf';
  39883. isLeft?: boolean;
  39884. isShow?: boolean;
  39885. offsetY?: number;
  39886. offsetX?: number;
  39887. isInner?: boolean;
  39888. injClass?: string;
  39889. children?: Snippet;
  39890. };
  39891. export type BottomSheetProps = {
  39892. visible?: boolean;
  39893. title?: string;
  39894. titleAlign?: 'left' | 'center' | 'right';
  39895. showBackIcon?: boolean;
  39896. closeContent?: 'downIcon' | 'closeIcon' | '' | string;
  39897. showDivider?: boolean;
  39898. duration?: number;
  39899. outDuration?: number;
  39900. mask?: MaskProps;
  39901. maskClosable?: boolean;
  39902. zIndex?: number;
  39903. stayHeightList?: number[];
  39904. stayHeightIndex?: number;
  39905. closeHeight?: number;
  39906. radius?: 'none' | 'middle' | 'full';
  39907. children?: Snippet;
  39908. onheightChange?: (height: number) => void;
  39909. onclickMask?: () => void;
  39910. onclose?: () => void;
  39911. onback?: () => void;
  39912. };
  39913. export type ButtonProps = {
  39914. fill?: 'base' | 'line' | 'lineLight' | 'lineTheme' | 'text' | 'textTheme' | 'colorLight';
  39915. state?: 'theme' | 'success' | 'warning' | 'error' | 'info';
  39916. radius?: 'none' | 'sm' | 'xl' | '2xl' | 'full';
  39917. size?: 'full' | 'big' | 'md' | 'sm' | 'auto';
  39918. line?: 'solid' | 'dashed' | 'dotted';
  39919. injClass?: string;
  39920. love?: boolean;
  39921. heightOut?: '0' | '1' | '2' | '3' | '4';
  39922. heightIn?: '0' | '1' | '2' | '3' | '4';
  39923. group?: boolean;
  39924. disabled?: boolean;
  39925. customSize?: boolean;
  39926. customWidth?: number;
  39927. customHeight?: number;
  39928. icon?: IconProps | null;
  39929. loading?: LoadingProps | null;
  39930. disabledLoading?: boolean;
  39931. type?: 'submit' | 'reset' | 'button';
  39932. children?: Snippet;
  39933. onclick?: () => void;
  39934. };
  39935. export type InfoDateProps = { text: string; info: string };
  39936. export type CalendarProps = {
  39937. visible?: boolean;
  39938. startMonth?: string;
  39939. endMonth?: string;
  39940. initMonth?: string;
  39941. mode?: 'single' | 'multiple' | 'range';
  39942. startSunday?: boolean;
  39943. weekendRed?: boolean;
  39944. monthCard?: boolean;
  39945. monthMark?: boolean;
  39946. monthMarkSize?: '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
  39947. height?: number;
  39948. infoDates?: InfoDateProps[];
  39949. disabledDates?: string[];
  39950. radius?: 'none' | 'sm' | 'xl' | '2xl';
  39951. showSelectedDay?: boolean;
  39952. confirmText?: string;
  39953. selectedText?: string;
  39954. dayText?: string;
  39955. quickSelects?: ('week' | 'month' | 'quarter' | number)[];
  39956. includeToday?: boolean;
  39957. useAnimation?: boolean;
  39958. highlightToday?: boolean;
  39959. outFormat?: string;
  39960. popup?: PopupProps;
  39961. button?: ButtonProps;
  39962. clear?: boolean;
  39963. onconfirm?: (dates: string[]) => void;
  39964. onclose?: () => void;
  39965. };
  39966. export type CellRightProps = { type: 'switch' | 'icon'; switch?: SwitchProps; icon?: IconProps };
  39967. export type CellProps = {
  39968. title?: string;
  39969. detail?: string;
  39970. right?: null | 'arrow' | CellRightProps;
  39971. left?: null | IconProps;
  39972. subTitle?: string;
  39973. info?: string;
  39974. line?: boolean;
  39975. my?: '0' | '1' | '2' | '3' | '4' | '6' | '8';
  39976. mx?: '0' | '1' | '2' | '3' | '4' | '6' | '8';
  39977. radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
  39978. switchActive?: boolean;
  39979. shadow?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
  39980. injClass?: string;
  39981. love?: boolean;
  39982. clickAll?: boolean;
  39983. leftChild?: Snippet;
  39984. rightChild?: Snippet;
  39985. detailChild?: Snippet;
  39986. onclick?: () => void;
  39987. };
  39988. export type CellGroupProps = {
  39989. radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
  39990. shadow?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
  39991. my?: '0' | '1' | '2' | '3' | '4' | '6' | '8';
  39992. mx?: '0' | '1' | '2' | '3' | '4' | '6' | '8';
  39993. children?: Snippet;
  39994. };
  39995. export type CheckboxItemProps = {
  39996. name: string;
  39997. label?: string;
  39998. layout?: 'h' | 'v' | 'inline';
  39999. textPosition?: 'l' | 'r' | 't' | 'b';
  40000. icon?: null | 'default' | IconProps;
  40001. iconChecked?: null | 'default' | IconProps;
  40002. checked?: boolean;
  40003. children?: Snippet;
  40004. onclick?: (name: string) => void;
  40005. };
  40006. export type CheckboxProps = {
  40007. data: CheckboxItemProps[];
  40008. layout?: 'h' | 'v' | 'inline';
  40009. checkeds?: string[];
  40010. textPosition?: 'l' | 'r' | 't' | 'b';
  40011. icon?: null | 'default' | IconProps;
  40012. iconChecked?: null | 'default' | IconProps;
  40013. checkboxChild?: Snippet<[{ item: CheckboxItemProps & Record<string, unknown> }]>;
  40014. onchange?: (checkeds: string[]) => void;
  40015. };
  40016. export type DialogProps = {
  40017. visible?: boolean;
  40018. title?: string;
  40019. titleAlign?: 'left' | 'center' | 'right';
  40020. content?: string;
  40021. popup?: PopupProps;
  40022. showIcon?: boolean;
  40023. icon?: IconProps;
  40024. btnStyle?: 'button' | 'text' | 'textLine';
  40025. primaryText?: string;
  40026. primaryButton?: ButtonProps;
  40027. secondaryText?: string;
  40028. secondaryButton?: ButtonProps;
  40029. btnRatio?: [number, number];
  40030. btnReverse?: boolean;
  40031. secondaryClose?: boolean;
  40032. btnGap?: '0' | '1' | '2' | '4' | '8' | '12' | '16';
  40033. onsecondary?: () => void;
  40034. onprimary?: () => void;
  40035. onclose?: () => void;
  40036. contentChild?: Snippet;
  40037. primaryChild?: Snippet;
  40038. };
  40039. export type DividerProps = {
  40040. layout?: 'h' | 'v';
  40041. px?: '0' | '4' | '8' | '16' | '36';
  40042. py?: '0' | '4' | '8';
  40043. text?: string;
  40044. align?: 'left' | 'center' | 'right';
  40045. line?: 'solid' | 'dashed' | 'dotted';
  40046. mx?: '1' | '2' | '4';
  40047. weight?: '1' | '2' | '4';
  40048. injClass?: string;
  40049. };
  40050. export type GridProps = {
  40051. col?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
  40052. row?: '1' | '2' | '3' | '4' | '5' | '6';
  40053. children?: Snippet;
  40054. };
  40055. export type GridsProps = {
  40056. cols?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
  40057. gap?: '0' | '1' | '2' | '4' | '8';
  40058. mx?: '0' | '1' | '2' | '4' | '8';
  40059. my?: '0' | '1' | '2' | '4' | '8';
  40060. children?: Snippet;
  40061. };
  40062. export type IconProps = {
  40063. name?: string;
  40064. size?: number | 'full';
  40065. theme?: boolean;
  40066. alpha?: number;
  40067. path?: string;
  40068. top?: number;
  40069. injClass?: string;
  40070. children?: Snippet;
  40071. onclick?: () => void;
  40072. };
  40073. export type IndexBarItemProps = {
  40074. index: string;
  40075. title: string;
  40076. child: string[];
  40077. height?: number;
  40078. };
  40079. export type IndexBarProps = {
  40080. data: IndexBarItemProps[];
  40081. current?: number;
  40082. top?: number;
  40083. height: number;
  40084. radius?: 'none' | 'middle' | 'full';
  40085. scrollAlign?: boolean;
  40086. titleInjClass?: string;
  40087. textInjClass?: string;
  40088. onclickChild?: (index: number, group: IndexBarItemProps, childIndex: number, child: string) => void;
  40089. };
  40090. export type InputProps = {
  40091. title?: string;
  40092. titlePosition?: 'in' | 'out' | null;
  40093. inputPosition?: 'left' | 'right';
  40094. placeholder?: string;
  40095. radius?: 'none' | 'sm' | 'xl' | 'full';
  40096. inputStyle?: 'block' | 'line';
  40097. lineTransition?: null | 'center' | 'left';
  40098. duration?: 'fast' | 'base' | 'slow' | 'slower';
  40099. autocomplete?: boolean;
  40100. py?: '0' | '0.5' | '1' | '2' | '3' | '4' | '6';
  40101. disabled?: boolean;
  40102. state?: 'theme' | 'success' | 'warning' | 'error' | 'info';
  40103. type?: 'text' | 'decimal' | 'email' | 'none' | 'numeric' | 'search' | 'tel' | 'url' | 'password' | 'number' | 'textarea';
  40104. inputmode?: 'text' | 'decimal' | 'email' | 'none' | 'numeric' | 'search' | 'tel' | 'url' | '';
  40105. maxlength?: number;
  40106. textareaMaxlength?: number;
  40107. rows?: number;
  40108. autosize?: boolean;
  40109. negative?: boolean;
  40110. label1?: null | IconProps;
  40111. label2?: null | string;
  40112. label3?: null | IconProps;
  40113. label4?: null | IconProps;
  40114. label5?: null | string;
  40115. label6?: null | IconProps;
  40116. tip?: string | null;
  40117. data1?: null | string;
  40118. data2?: null | string;
  40119. data3?: null | string;
  40120. value?: string;
  40121. clear?: boolean;
  40122. onfocus?: (value: string) => void;
  40123. onblur?: (value: string) => void;
  40124. onchange?: (value: string) => void;
  40125. onclear?: () => void;
  40126. onclickLabel1?: () => void;
  40127. onclickLabel2?: () => void;
  40128. onclickLabel3?: () => void;
  40129. onclickLabel4?: () => void;
  40130. onclickLabel5?: () => void;
  40131. onclickLabel6?: () => void;
  40132. onkeydown?: (key: string) => void;
  40133. titleChild?: Snippet;
  40134. data1Child?: Snippet;
  40135. data2Child?: Snippet;
  40136. data3Child?: Snippet;
  40137. label1Child?: Snippet;
  40138. label2Child?: Snippet;
  40139. label3Child?: Snippet;
  40140. label4Child?: Snippet;
  40141. label5Child?: Snippet;
  40142. label6Child?: Snippet;
  40143. tipChild?: Snippet;
  40144. };
  40145. export type LoadingProps = {
  40146. type?: string;
  40147. height?: '2' | '4' | '6' | '8' | '12' | '16' | '20' | '28' | '36' | '48' | '56' | '64' | '72' | '80' | '96' | 'full';
  40148. width?: '2' | '4' | '6' | '8' | '12' | '16' | '20' | '28' | '36' | '48' | '56' | '64' | '72' | '80' | '96' | 'full';
  40149. theme?: boolean;
  40150. inverse?: boolean;
  40151. customColor?: string[];
  40152. lazyAnimation?: boolean;
  40153. speed?: number;
  40154. };
  40155. export type MaskProps = {
  40156. visible?: boolean;
  40157. opacity?: '0' | '0.1' | '0.2' | '0.3' | '0.4' | '0.5' | '0.6' | '0.7' | '0.8' | '0.9' | '1';
  40158. clickable?: boolean;
  40159. inverse?: boolean;
  40160. backdropBlur?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
  40161. duration?: number;
  40162. outDuration?: number;
  40163. zIndex?: number;
  40164. children?: Snippet;
  40165. onclickMask?: () => void;
  40166. };
  40167. export type ModalProps = {
  40168. visible?: boolean;
  40169. title?: string;
  40170. titleAlign?: 'left' | 'center' | 'right';
  40171. content?: string;
  40172. popup?: PopupProps;
  40173. showIcon?: boolean;
  40174. icon?: IconProps;
  40175. showBtn?: boolean;
  40176. btnText?: string;
  40177. button?: ButtonProps;
  40178. contentChild?: Snippet;
  40179. onclose?: () => void;
  40180. };
  40181. export type NavBarProps = {
  40182. title?: string;
  40183. titleAlign?: 'left' | 'center' | 'right';
  40184. left?: 'back' | null | IconProps;
  40185. rights?: IconProps[];
  40186. line?: boolean;
  40187. injClass?: string;
  40188. love?: boolean;
  40189. onclickLeft?: () => void;
  40190. onclickRight?: (index: number) => void;
  40191. titleChild?: Snippet;
  40192. leftChild?: Snippet;
  40193. rightChild?: Snippet;
  40194. };
  40195. export type NoticeBarProps = {
  40196. textList: string[];
  40197. leftIcon?: IconProps | null;
  40198. rightIcon?: 'close' | 'arrow' | null;
  40199. fontSize?: 'xs' | 'sm' | 'base' | 'lg';
  40200. space?: number;
  40201. speed?: number;
  40202. vertical?: boolean;
  40203. duration?: 100 | 300 | 500 | 700 | 1000;
  40204. interval?: number;
  40205. injClass?: string;
  40206. leftChild?: Snippet;
  40207. rightChild?: Snippet;
  40208. onclickRight?: () => void;
  40209. };
  40210. export type NumKeyboardProps = {
  40211. value?: string;
  40212. type?: 'button' | 'block';
  40213. visible?: boolean;
  40214. height?: '8' | '10' | '12' | '14' | '16' | '20';
  40215. space?: '0' | '1' | '2' | '3' | '4';
  40216. p?: '0' | '1' | '2' | '3' | '4';
  40217. reverse?: boolean;
  40218. done?: boolean;
  40219. dot?: boolean;
  40220. close?: boolean;
  40221. doneText?: string;
  40222. doneDisabled?: boolean;
  40223. radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
  40224. clear?: boolean;
  40225. panelClass?: string;
  40226. keyClass?: string;
  40227. doneClass?: string;
  40228. popup?: PopupProps;
  40229. onclick?: (key: string) => void;
  40230. onopen?: (height: number) => void;
  40231. onclose?: () => void;
  40232. };
  40233. export type PaginationProps = {
  40234. total: number;
  40235. pageSize?: number;
  40236. current?: number;
  40237. maxShowPage?: 5 | 7 | 9 | 11;
  40238. radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
  40239. type?: 'border' | 'block' | 'bold';
  40240. pageCol?: number;
  40241. showNextOmitPage?: boolean;
  40242. showPreOmitPage?: boolean;
  40243. injClass?: string;
  40244. noDataText?: string;
  40245. onePageText?: string;
  40246. continuous?: boolean;
  40247. onchange?: (current: number) => void;
  40248. onnext?: (current: number) => void;
  40249. onpre?: (current: number) => void;
  40250. };
  40251. export type PickerDataChildProps = {
  40252. [key: string]: string | PickerDataChildProps[] | undefined | number;
  40253. children?: PickerDataChildProps[];
  40254. initIndex?: number;
  40255. };
  40256. export type PickerDatasProps = {
  40257. data: { [key: string]: string }[];
  40258. showRow?: 3 | 5 | 7;
  40259. initIndex?: number;
  40260. useAnimation?: boolean;
  40261. labelKey?: string;
  40262. flex?: number;
  40263. align?: 'left' | 'center' | 'right';
  40264. lastSelectedIndex?: number;
  40265. };
  40266. export type PickerProps = {
  40267. visible?: boolean;
  40268. datas?: PickerDatasProps[] | PickerDataChildProps[];
  40269. autoScrollToLast?: boolean;
  40270. cancelText?: string;
  40271. confirmText?: string;
  40272. title?: string;
  40273. isLinkage?: boolean;
  40274. linkageInitIndexs?: number[];
  40275. linkageShowRows?: number[];
  40276. linkageFlexs?: number[];
  40277. linkageAligns?: ('left' | 'center' | 'right')[];
  40278. linkageLabelKeys?: string[];
  40279. linkageChildrenKey?: string;
  40280. popup?: PopupProps;
  40281. onclose?: () => void;
  40282. onconfirm?: (items: { [key: string]: string }[], indexs: number[]) => void;
  40283. oncancel?: () => void;
  40284. };
  40285. export type PlaceholderProps = {
  40286. py?: '0' | '1' | '2' | '3' | '4' | '8';
  40287. height?: 'full' | '1' | '2' | '4' | '8' | '16' | '24' | '32' | '48' | '64' | '96';
  40288. radius?: 'none' | 'sm' | 'md' | 'xl' | '2xl' | '3xl' | 'full';
  40289. shadow?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
  40290. injClass?: string;
  40291. children?: Snippet;
  40292. };
  40293. export type PopupProps = {
  40294. visible?: boolean;
  40295. size?: number;
  40296. position?: 'center' | 'top' | 'bottom' | 'left' | 'right';
  40297. duration?: number;
  40298. outDuration?: number;
  40299. easeType?: SvelteEasingProps;
  40300. easeOutType?: SvelteEasingProps;
  40301. px?: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12' | '16' | '20';
  40302. py?: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12' | '16' | '24' | '32' | '48' | '64';
  40303. mask?: MaskProps;
  40304. maskClosable?: boolean;
  40305. radiusPosition?: 'all' | 'top' | 'bottom' | 'left' | 'right';
  40306. radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
  40307. transitionDistance?: number;
  40308. transparent?: boolean;
  40309. allowBodyScroll?: boolean;
  40310. zIndex?: number;
  40311. dynamicFixed?: boolean;
  40312. hideScrollbar?: boolean;
  40313. children?: Snippet;
  40314. onclose?: () => void;
  40315. onclickMask?: () => void;
  40316. };
  40317. export type ProgressProps = {
  40318. percent?: number;
  40319. percentPosition?: 'inner' | 'right' | 'block' | null;
  40320. height?: '1' | '2' | '3' | '4';
  40321. radius?: 'full' | 'middle' | 'none';
  40322. inactive?: boolean;
  40323. overflowPercent?: number;
  40324. duration?: '150' | '300' | '500' | '700' | '1000';
  40325. injClass?: string;
  40326. trackInjClass?: string;
  40327. children?: Snippet;
  40328. };
  40329. export type ProgressLoopProps = {
  40330. percent?: number;
  40331. strokeWidth?: number;
  40332. butt?: boolean;
  40333. reverse?: boolean;
  40334. duration?: '150' | '300' | '500' | '700' | '1000';
  40335. gradient?: [string, string] | null;
  40336. injClass?: string;
  40337. trackInjClass?: string;
  40338. children?: Snippet;
  40339. };
  40340. export type RadioItemProps = {
  40341. name: string;
  40342. label?: string;
  40343. layout?: 'v' | 'h' | 'inline';
  40344. textPosition?: 'l' | 'r' | 't' | 'b';
  40345. icon?: 'default' | null | IconProps;
  40346. iconChecked?: 'default' | null | IconProps;
  40347. checked?: boolean;
  40348. children?: Snippet;
  40349. onclick?: (name: string) => void;
  40350. };
  40351. export type RadioProps = {
  40352. data: RadioItemProps[];
  40353. layout?: 'v' | 'h' | 'inline';
  40354. value?: string;
  40355. textPosition?: 'l' | 'r' | 't' | 'b';
  40356. icon?: 'default' | null | IconProps;
  40357. iconChecked?: 'default' | null | IconProps;
  40358. radioChild?: Snippet<[{ item: RadioItemProps & Record<string, unknown> }]>;
  40359. onchange?: (value: string) => void;
  40360. };
  40361. export type RateProps = {
  40362. value?: number;
  40363. total?: number;
  40364. height?: number;
  40365. width?: number;
  40366. opacity?: '0.05' | '0.1' | '0.2' | '0.3' | '0.4' | '0.5' | '0.6' | '0.7' | '0.8' | '0.9' | '1';
  40367. space?: '0' | '1' | '2' | '3' | '4' | '8';
  40368. half?: boolean;
  40369. zero?: boolean;
  40370. vertical?: boolean;
  40371. disabled?: boolean;
  40372. readonly?: boolean;
  40373. animation?: 'current' | 'active' | null;
  40374. children?: Snippet;
  40375. onclick?: (value: number) => void;
  40376. };
  40377. export type SkeletonProps = {
  40378. type?: 'div' | 'p' | 'img' | 'video' | 'code' | 'qrcode' | 'barcode';
  40379. width?: 'full' | '2' | '4' | '6' | '8' | '12' | '16' | '24' | '32' | '48' | '64' | '96';
  40380. height?: '1' | '2' | '4' | '6' | '8' | '12' | '16' | '24' | '32' | '48' | '64' | '96';
  40381. radius?: 'none' | 'sm' | 'md' | 'xl' | '2xl' | '3xl' | 'full';
  40382. space?: '0.5' | '1' | '2' | '4' | '8';
  40383. lines?: number;
  40384. iconRatio?: number;
  40385. };
  40386. export type SliderProps = {
  40387. value?: number;
  40388. step?: number;
  40389. minRange?: number;
  40390. maxRange?: number;
  40391. isRange?: boolean;
  40392. valueRange?: [number, number];
  40393. startValue?: number;
  40394. endValue?: number;
  40395. showTip?: 'always' | 'touch' | 'never';
  40396. radius?: 'none' | 'sm' | 'xl' | 'full';
  40397. lineBlock?: boolean;
  40398. disabled?: boolean;
  40399. readonly?: boolean;
  40400. children?: Snippet;
  40401. onchange?: (value: number, valueRange?: [number, number]) => void;
  40402. };
  40403. export type StepperProps = {
  40404. value?: number;
  40405. min?: number;
  40406. max?: number;
  40407. step?: number;
  40408. vertical?: boolean;
  40409. numberHighlight?: boolean;
  40410. theme?: boolean;
  40411. radius?: 'none' | 'sm' | 'xl' | 'full';
  40412. decimal?: number;
  40413. async?: boolean;
  40414. asyncLoading?: boolean;
  40415. loading?: LoadingProps;
  40416. padding?: boolean;
  40417. injClassOut?: string;
  40418. injClassBtn?: string;
  40419. injClassNum?: string;
  40420. onchange?: (value: number) => void;
  40421. ondecrease?: () => void;
  40422. onincrease?: () => void;
  40423. };
  40424. export type StepsStepBarIconProps = { type: 'icon'; content: IconProps };
  40425. export type StepsStepBarImageProps = { type: 'image'; content: string };
  40426. export type StepsStepBarStringProps = { type: 'string'; content: string };
  40427. export type StepsStepProps = {
  40428. title?: string;
  40429. desc?: string;
  40430. bar?: StepsStepBarIconProps | StepsStepBarImageProps | StepsStepBarStringProps;
  40431. injComponent?: Component;
  40432. };
  40433. export type StepsFinishStepProps = {
  40434. title?: string;
  40435. desc?: string;
  40436. bar?: StepsStepBarIconProps | StepsStepBarImageProps | StepsStepBarStringProps;
  40437. injComponent?: Component;
  40438. };
  40439. export type StepsItemProps = {
  40440. step: StepsStepProps;
  40441. finishStep?: StepsFinishStepProps;
  40442. height?: number;
  40443. };
  40444. export type StepsProps = {
  40445. steps: StepsItemProps[];
  40446. current?: number;
  40447. radius?: 'none' | 'sm' | 'xl' | 'full';
  40448. barBorder?: boolean;
  40449. vertical?: boolean;
  40450. };
  40451. export type SwiperImgProps = { type: 'img'; url: string };
  40452. export type SwiperComponentProps = { type: 'component'; component: Component };
  40453. export type SwiperProps = {
  40454. data: (SwiperImgProps | SwiperComponentProps)[];
  40455. interval?: number;
  40456. duration?: number;
  40457. autoplay?: boolean;
  40458. lazyplay?: boolean;
  40459. initActive?: number;
  40460. indicatePosition?: 'inner' | 'out' | null;
  40461. indicateAlign?: 'center' | 'right' | 'left';
  40462. indicateStyle?: 'point' | 'line' | 'pointLine' | 'longLine';
  40463. indicateRadius?: boolean;
  40464. indicateInjClass?: string;
  40465. indicateColor?: string;
  40466. indicateActiveColor?: string;
  40467. aspectRatio?: [number, number];
  40468. containerWidth?: number;
  40469. px?: '0' | '1' | '2' | '4' | '6' | '8' | '12' | '16' | '24';
  40470. py?: '0' | '1' | '2' | '4' | '6' | '8' | '12';
  40471. translateX?: number;
  40472. translateZ?: number;
  40473. rotateX?: number;
  40474. rotateY?: number;
  40475. rotateZ?: number;
  40476. activeInjClass?: string;
  40477. notActiveInjClass?: string;
  40478. radius?: 'none' | 'sm' | 'xl' | '2xl' | 'full';
  40479. triggerLong?: number;
  40480. notTriggerLong?: number;
  40481. triggerSpeed?: number;
  40482. innerInjClass?: string;
  40483. onchange?: (current: number) => void;
  40484. onclick?: (current: number) => void;
  40485. };
  40486. export type SwitchProps = {
  40487. active?: boolean;
  40488. radius?: 'none' | 'middle' | 'full';
  40489. inside?: 'state' | 'loading' | [string, string] | null;
  40490. injClass?: string;
  40491. disabled?: boolean;
  40492. async?: boolean;
  40493. loading?: LoadingProps;
  40494. trueChild?: Snippet;
  40495. falseChild?: Snippet;
  40496. onchange?: (active: boolean) => void;
  40497. onclick?: () => void;
  40498. };
  40499. export type TabBarLabelProps = { text?: string; icon?: IconProps; activeIcon?: IconProps };
  40500. export type TabBarProps = {
  40501. labels: TabBarLabelProps[];
  40502. active?: number;
  40503. line?: boolean;
  40504. lineW?: number;
  40505. love?: boolean;
  40506. injClass?: string;
  40507. tabInjClass?: string;
  40508. activeTabInjClass?: string;
  40509. activeInjClass?: string;
  40510. onchange?: (active: number) => void;
  40511. };
  40512. export type TabContentProps = { show?: boolean; children?: Snippet };
  40513. export type TabLabelProps = { text?: string; icon?: IconProps };
  40514. export type TabProps = {
  40515. labels?: TabLabelProps[];
  40516. active?: number;
  40517. lineType?: boolean;
  40518. radius?: 'none' | 'sm' | 'xl' | 'full';
  40519. duration?: 'fast' | 'base' | 'slow' | 'slower';
  40520. layout?: 'h' | 'v';
  40521. love?: boolean;
  40522. injClass?: string;
  40523. tabInjClass?: string;
  40524. activeTabInjClass?: string;
  40525. activeInjClass?: string;
  40526. mx?: '0' | '1' | '2' | '3' | '4' | '6' | '8' | '12' | '16' | '20';
  40527. overflow?: boolean;
  40528. showNum?: number;
  40529. autoScroll?: boolean;
  40530. onclickTab?: (active: number) => void;
  40531. };
  40532. export type TabsProps = {
  40533. tab: TabProps;
  40534. duration?: 'fast' | 'base' | 'slow' | 'slower';
  40535. position?: 't' | 'b' | 'l' | 'r';
  40536. transition?: boolean;
  40537. active?: number;
  40538. onchange?: (active: number) => void;
  40539. children?: Snippet<[{ active: number }]>;
  40540. };
  40541. export type TimePickerItemProps = {
  40542. showRow?: 3 | 5 | 7;
  40543. flex?: number;
  40544. align?: 'left' | 'center' | 'right';
  40545. };
  40546. export type TimePickerObjProps = {
  40547. YYYY: string;
  40548. MM: string;
  40549. DD: string;
  40550. hh: string;
  40551. mm: string;
  40552. ss: string;
  40553. };
  40554. export type TimePickerTypeProps =
  40555. | 'YYYY'
  40556. | 'MM'
  40557. | 'hh'
  40558. | 'mm'
  40559. | 'ss'
  40560. | 'YYYYMM'
  40561. | 'hhmm'
  40562. | 'mmss'
  40563. | 'YYYYMMDD'
  40564. | 'hhmmss'
  40565. | 'YYYYMMDDhh'
  40566. | 'YYYYMMDDhhmm'
  40567. | 'YYYYMMDDhhmmss';
  40568. export type TimePickerProps = {
  40569. visible?: boolean;
  40570. type?: TimePickerTypeProps;
  40571. yearProps?: TimePickerItemProps;
  40572. monthProps?: TimePickerItemProps;
  40573. dayProps?: TimePickerItemProps;
  40574. hourProps?: TimePickerItemProps;
  40575. minuteProps?: TimePickerItemProps;
  40576. secondProps?: TimePickerItemProps;
  40577. initYear?: string;
  40578. initMonth?: string;
  40579. initDay?: string;
  40580. initHour?: string;
  40581. initMinute?: string;
  40582. initSecond?: string;
  40583. minuteStep?: number;
  40584. secondStep?: number;
  40585. yearRange?: [number, number] | [];
  40586. monthRange?: [number, number];
  40587. hourRange?: [number, number];
  40588. minuteRange?: [number, number];
  40589. secondRange?: [number, number];
  40590. showTips?: boolean;
  40591. cancelText?: string;
  40592. confirmText?: string;
  40593. title?: string;
  40594. yearText?: string;
  40595. monthText?: string;
  40596. dayText?: string;
  40597. hourText?: string;
  40598. minuteText?: string;
  40599. secondText?: string;
  40600. outFormat?: string;
  40601. popup?: PopupProps;
  40602. oncancel?: () => void;
  40603. onconfirm?: (timeStr: string, timeObj: TimePickerObjProps) => void;
  40604. onclose?: () => void;
  40605. };
  40606. export type ToastProps = {
  40607. message?: string;
  40608. visible?: boolean;
  40609. duration?: number;
  40610. position?: 'center' | 'top' | 'bottom';
  40611. py?: '0' | '10' | '20' | '40' | '60' | '80';
  40612. radius?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
  40613. transitionType?: 'scale' | 'fly' | 'fade' | 'slide' | 'blur' | null;
  40614. transitionParams?: object;
  40615. outDuration?: number;
  40616. type?: 'success' | 'error' | 'warning' | 'info' | 'loading' | 'icon' | null;
  40617. mask?: MaskProps;
  40618. loading?: LoadingProps;
  40619. icon?: IconProps;
  40620. zIndex?: number;
  40621. clickable?: boolean;
  40622. dynamicFixed?: boolean;
  40623. children?: Snippet;
  40624. onclose?: () => void;
  40625. };
  40626. export type SvelteEasingProps =
  40627. | 'backIn'
  40628. | 'backInOut'
  40629. | 'backOut'
  40630. | 'bounceIn'
  40631. | 'bounceInOut'
  40632. | 'bounceOut'
  40633. | 'circIn'
  40634. | 'circInOut'
  40635. | 'circOut'
  40636. | 'cubicIn'
  40637. | 'cubicInOut'
  40638. | 'cubicOut'
  40639. | 'elasticIn'
  40640. | 'elasticInOut'
  40641. | 'elasticOut'
  40642. | 'expoIn'
  40643. | 'expoInOut'
  40644. | 'expoOut'
  40645. | 'linear'
  40646. | 'quadIn'
  40647. | 'quadInOut'
  40648. | 'quadOut'
  40649. | 'quartIn'
  40650. | 'quartInOut'
  40651. | 'quartOut'
  40652. | 'quintIn'
  40653. | 'quintInOut'
  40654. | 'quintOut'
  40655. | 'sineIn'
  40656. | 'sineInOut'
  40657. | 'sineOut';
  40658. ================================================
  40659. FILE: packages/stdf/src/routes/+layout.svelte
  40660. ================================================
  40661. <script lang="ts">
  40662. import { setContext, onMount } from 'svelte';
  40663. import { page } from '$app/stores';
  40664. import { goto } from '$app/navigation';
  40665. import { NavBar, Icon } from '$lib/index.js';
  40666. import { zh_CN, en_US } from '$lib/lang/index.js';
  40667. import '../app.css';
  40668. import { menuList, type MenuListChild } from '../data/menuList.js';
  40669. import ThemeSwitch from './components/ThemeSwitch.svelte';
  40670. import { darkMode } from '$lib/theme/index.js';
  40671. import { switchTheme } from '$lib/theme/index.js';
  40672. import themes from '../data/themes/index.js';
  40673. let { children } = $props();
  40674. // 循环 menuList,将所有元素的 childs 组成一个数组
  40675. // Cycle menuList, and combine the childs of all elements into an array
  40676. const menuListArr: MenuListChild[] = menuList.reduce((acc: MenuListChild[], cur) => {
  40677. if (cur.childs) {
  40678. acc.push(...cur.childs);
  40679. }
  40680. return acc;
  40681. }, []);
  40682. // 使用 `URLSearchParams` 对象来获取 URL 查询参数
  40683. // Use the `URLSearchParams` object to get the URL query parameters
  40684. const urlParams = new URLSearchParams($page.url.search);
  40685. const channel = urlParams.get('channel');
  40686. // 判断是否是 iframe
  40687. // judge whether it is iframe
  40688. const isIframe = channel && channel === 'iframe' ? '1' : '0';
  40689. // 设置 iframe
  40690. // setting iframe
  40691. setContext('iframe', isIframe);
  40692. let lang = 'zh_CN';
  40693. if (isIframe === '1') {
  40694. // 获取 url 中的 theme 和 darkMode 和 lang
  40695. // get theme, darkMode and lang from url
  40696. const urlTheme = urlParams.get('theme');
  40697. const urlDarkMode = urlParams.get('darkMode');
  40698. const currentTheme = themes.find((item) => item.name === urlTheme);
  40699. if (currentTheme) {
  40700. switchTheme(currentTheme.theme);
  40701. }
  40702. if (urlDarkMode === 'dark') {
  40703. darkMode();
  40704. localStorage.setItem('theme', 'dark');
  40705. } else if (urlDarkMode === 'light') {
  40706. darkMode(false);
  40707. localStorage.setItem('theme', 'light');
  40708. }
  40709. const urlLang = urlParams.get('lang');
  40710. if (urlLang) {
  40711. lang = urlLang;
  40712. }
  40713. }
  40714. // 环境变量
  40715. // environment variables
  40716. const mode = import.meta.env.MODE;
  40717. // mode 是否是指定组件模式
  40718. // whether mode is specified component mode
  40719. const isComponentMode = mode != 'production' && mode != 'development' && mode != 'english';
  40720. let showLeft = $derived(!(isIframe === '1' || $page.url.pathname === '/' || isComponentMode));
  40721. let theme = $state(localStorage.getItem('theme') === 'dark' ? 'dark' : 'light');
  40722. // 设置亮暗模式
  40723. // Set light and dark mode
  40724. if (localStorage.getItem('theme') === 'dark') {
  40725. darkMode();
  40726. } else if (localStorage.getItem('theme') === 'light') {
  40727. darkMode(false);
  40728. } else {
  40729. darkMode(false);
  40730. }
  40731. //手动切换亮暗模式
  40732. // manually switch light and dark mode
  40733. const toggleFun = () => {
  40734. if (theme === 'dark') {
  40735. // 切换到 light
  40736. // switch to light
  40737. theme = 'light';
  40738. localStorage.setItem('theme', 'light');
  40739. darkMode(false);
  40740. } else {
  40741. // 切换到 dark
  40742. // switch to dark
  40743. theme = 'dark';
  40744. localStorage.setItem('theme', 'dark');
  40745. darkMode();
  40746. }
  40747. };
  40748. // 判断 mode 是否是 English 模式
  40749. // Determine whether mode is English mode
  40750. const englishMode = mode.slice(-3) === '_en' || mode === 'english';
  40751. if (englishMode) {
  40752. // 固定为英文
  40753. // Fixed to English
  40754. lang = 'en_US';
  40755. } else {
  40756. // 根据 url 或 urlParams 或 sessionStorage 获取语言,优先级为 urlParams > url > sessionStorage
  40757. // Get the language according to the url or urlParams or sessionStorage, the priority is urlParams > url > sessionStorage
  40758. // 如果 urlParams 中有 ?lang=en_US,则设置为英文,如果有 ?lang=zh_CN,则设置为中文
  40759. // If there is ?lang=en_US in urlParams, set it to English, if there is ?lang=zh_CN, set it to Chinese
  40760. const urlParamsLang = urlParams.get('lang');
  40761. if (urlParamsLang) {
  40762. lang = urlParamsLang;
  40763. // 将 url 的 ?lang=en_US 或 ?lang=zh_CN 去掉
  40764. // Remove ?lang=en_US or ?lang=zh_CN from url
  40765. setTimeout(() => {
  40766. history.replaceState(null, '', location.href.replace(`?lang=${urlParamsLang}`, ''));
  40767. }, 100);
  40768. } else {
  40769. // 如果 URL 中包含 /en_US/ 或 /zh_CN/,则设置为英文或中文
  40770. // If the URL contains /en_US/ or /zh_CN/, set it to English or Chinese
  40771. const urlLang = $page.url.pathname.split('/')[1];
  40772. if (urlLang === 'en_US' || urlLang === 'zh_CN') {
  40773. lang = urlLang;
  40774. } else {
  40775. // 如果 sessionStorage 中有 lang,则设置为 sessionStorage 中的 lang
  40776. // If there is lang in sessionStorage, set it to lang in sessionStorage
  40777. const sessionStorageLang = sessionStorage.getItem('lang');
  40778. if (sessionStorageLang) {
  40779. lang = sessionStorageLang;
  40780. } else {
  40781. // 如果 sessionStorage 中没有 lang,则设置为中文
  40782. // If there is no lang in sessionStorage, set it to Chinese
  40783. lang = 'zh_CN';
  40784. }
  40785. }
  40786. }
  40787. }
  40788. sessionStorage.setItem('lang', lang);
  40789. const isZh = lang === 'zh_CN';
  40790. setContext('STDF_lang', isZh ? zh_CN : en_US);
  40791. onMount(() => {
  40792. if (isComponentMode) {
  40793. // 英文模式去掉 mode 后面的 _en 作为 nav
  40794. // English mode removes _en after mode as nav
  40795. const nav = englishMode ? mode.slice(0, -3) : mode;
  40796. goto(`/${nav}/${englishMode ? 'en_US' : 'zh_CN'}`);
  40797. }
  40798. });
  40799. let showTheme = $state(false);
  40800. // 切换主题
  40801. // switch theme
  40802. const switchThemeFunc = () => {
  40803. showTheme = !showTheme;
  40804. };
  40805. </script>
  40806. <div class="sticky top-0 z-[100]">
  40807. <NavBar
  40808. title={$page.url.pathname === '/'
  40809. ? isZh
  40810. ? 'STDF 示例'
  40811. : 'STDF Demo'
  40812. : menuListArr.filter((item) => item.nav === $page.url.pathname.split('/')[1])[0][isZh ? 'title_zh' : 'title_en'] +
  40813. (isZh ? '示例' : ' Demo')}
  40814. left={showLeft ? 'back' : null}
  40815. injClass="bg-white/60 dark:bg-black/60 backdrop-blur-sm"
  40816. onclickLeft={() => window.history.back()}
  40817. >
  40818. {#snippet rightChild()}
  40819. <div class="flex text-center">
  40820. {#if isIframe === '0'}
  40821. <div class="h-12 w-10">
  40822. <a href="https://github.com/any-tdf/stdf" target="_blank" rel="noreferrer">
  40823. <Icon name="ri-github-fill" />
  40824. </a>
  40825. </div>
  40826. <div class="h-12 w-10">
  40827. <a
  40828. href={`https://stdf.design${$page.url.pathname === '/' ? '' : `/components?nav=${$page.url.pathname.split('/')[1]}&tab=0`}`}
  40829. target="_blank"
  40830. rel="noreferrer"
  40831. >
  40832. <Icon name="ri-compass-line" />
  40833. </a>
  40834. </div>
  40835. {/if}
  40836. <button class="h-12 w-10" onclick={toggleFun} aria-label={theme === 'dark' ? '切换到亮色模式' : '切换到暗色模式'}>
  40837. <Icon name={theme === 'dark' ? 'ri-moon-fill' : 'ri-sun-line'} theme />
  40838. </button>
  40839. <button class="h-12 w-10" onclick={switchThemeFunc} aria-label="切换主题">
  40840. <Icon name="ri-palette-line" theme />
  40841. </button>
  40842. </div>
  40843. {/snippet}
  40844. </NavBar>
  40845. </div>
  40846. {@render children?.()}
  40847. <div
  40848. class="fixed z-[1000] {showTheme
  40849. ? 'right-0'
  40850. : '-right-80'} top-12 rounded-lg bg-white px-2 shadow-sm transition-all duration-500 dark:bg-black"
  40851. >
  40852. <ThemeSwitch />
  40853. </div>
  40854. ================================================
  40855. FILE: packages/stdf/src/routes/+layout.ts
  40856. ================================================
  40857. // 修改 ssr 为 false,使其不再使用服务端渲染,而是使用客户端渲染
  40858. // Change ssr to false to use client-side rendering instead of server-side rendering
  40859. export const ssr = false;
  40860. export const prerender = true;
  40861. ================================================
  40862. FILE: packages/stdf/src/routes/+page.svelte
  40863. ================================================
  40864. <script lang="ts">
  40865. import { CellGroup, Cell } from '$lib/index.js';
  40866. import { menuList, type MenuListChild } from '../data/menuList.js';
  40867. const menuListArr: MenuListChild[] = menuList.reduce((acc, cur) => {
  40868. if (cur.childs) {
  40869. acc.push(...cur.childs);
  40870. }
  40871. return acc;
  40872. }, [] as MenuListChild[]);
  40873. const isZh = sessionStorage.getItem('lang') === 'zh_CN';
  40874. const changeLangFunc = () => {
  40875. sessionStorage.setItem('lang', isZh ? 'en_US' : 'zh_CN');
  40876. window.location.reload();
  40877. };
  40878. </script>
  40879. <div class="mb-2 mt-8 flex h-14 flex-col items-center justify-center">
  40880. <svg viewBox="0 0 90 80">
  40881. <path
  40882. class="fill-primary dark:fill-dark"
  40883. d="M0 0H20H40H50C64.8056 0 77.7325 8.04398 84.6487 20H50H40V22.6757V30H50C55.5229 30 60 34.4771 60 40C60 45.5229 55.5229 50 50 50H40V57.3243V78.7398V80H20V66.4583V20H15.3513H0V0ZM50 80C72.0914 80 90 62.0914 90 40C90 36.547 89.5625 33.1962 88.7398 30H67.3244C69.0261 32.9417 70 36.3571 70 40C70 51.0457 61.0457 60 50 60V80Z"
  40884. />
  40885. <path class="fill-dark dark:fill-primary" d="M20 30V0L0 50H20V80L40 30H20Z" />
  40886. </svg>
  40887. </div>
  40888. <a href="https://stdf.design" target="_blank" rel="noreferrer">
  40889. <div class="text-center text-lg underline">stdf.design</div>
  40890. </a>
  40891. <div class="flex flex-col py-4">
  40892. <div>
  40893. {#each menuList as menu (menu.class)}
  40894. <div class="mb-2 mt-8 px-4 text-sm text-gray-500">{isZh ? menu.class : menu.class_en}</div>
  40895. <CellGroup>
  40896. {#each menu.childs as child, i (child.nav)}
  40897. <a href={child.nav + (isZh ? '/zh_CN' : '/en_US')}>
  40898. <Cell
  40899. title={isZh ? child.title : child.title_en}
  40900. mx="0"
  40901. my="0"
  40902. shadow="none"
  40903. radius="none"
  40904. line={i !== menu.childs.length - 1}
  40905. />
  40906. </a>
  40907. {/each}
  40908. </CellGroup>
  40909. {/each}
  40910. </div>
  40911. <div class="p-4">{isZh ? '当前组件总数:' : 'Current number of components: '}{menuListArr.length}</div>
  40912. <div class="text-primary dark:text-dark flex justify-around p-4 text-xs underline">
  40913. <button on:click={changeLangFunc} class="text-primary dark:text-dark">{isZh ? 'English' : '简体中文'}</button>
  40914. </div>
  40915. </div>
  40916. ================================================
  40917. FILE: packages/stdf/src/routes/actionSheet/en_US/+page.svelte
  40918. ================================================
  40919. <!-- ActionSheet Demo -->
  40920. <script lang="ts">
  40921. import { Cell, ActionSheet, Toast } from '$lib/index.js';
  40922. import { type ActionProps } from '$lib/types/index.js';
  40923. let visible1 = $state(false);
  40924. let visible2 = $state(false);
  40925. let visible3 = $state(false);
  40926. let visible4 = $state(false);
  40927. let visible5 = $state(false);
  40928. let visible6 = $state(false);
  40929. let visible7 = $state(false);
  40930. let visible8 = $state(false);
  40931. let visible9 = $state(false);
  40932. let visible10 = $state(false);
  40933. let visible11 = $state(false);
  40934. let visible12 = $state(false);
  40935. const actions = [{ content: 'Option one' }, { content: 'Option two' }, { content: 'Option three' }];
  40936. const actions1: ActionProps[] = [
  40937. { content: 'Normal option' },
  40938. { content: 'Theme option', style: 'theme' },
  40939. { content: 'Disabled option', style: 'disabled' },
  40940. { content: 'Danger option', style: 'danger' }
  40941. ];
  40942. const actions2: ActionProps[] = [
  40943. { content: 'Option one' },
  40944. { content: 'Option two', desc: 'Here is the description information' },
  40945. { content: 'Option three', style: 'danger', desc: 'Here is the description information' }
  40946. ];
  40947. const actions3: ActionProps[] = [
  40948. { content: 'Lina', showImg: true, imgSrc: '/assets/images/dota_火女.png', imgRadius: 'sm' },
  40949. { content: 'SB', showImg: true, imgSrc: '/assets/images/dota_小牛.png', imgRadius: 'sm' },
  40950. { content: 'Morph', showImg: true, imgSrc: '/assets/images/dota_水人.png', imgRadius: 'sm' }
  40951. ];
  40952. const actions4: ActionProps[] = [
  40953. { content: 'Apple', showImg: true, imgSrc: '/assets/logos/apple.png', imgRadius: 'none' },
  40954. { content: 'Google', showImg: true, imgSrc: '/assets/logos/google.png', imgRadius: 'none' },
  40955. { content: 'Microsoft', showImg: true, imgSrc: '/assets/logos/microsoft.png', imgRadius: 'none' },
  40956. { content: 'Adobe', showImg: true, imgSrc: '/assets/logos/adobe.png', imgRadius: 'none' },
  40957. { content: 'Figma', showImg: true, imgSrc: '/assets/logos/figma.png', imgRadius: 'none' }
  40958. ];
  40959. let toastVisible1 = $state(false);
  40960. let toastVisible2 = $state(false);
  40961. let toastVisible3 = $state(false);
  40962. let index = $state(0);
  40963. let item = $state({ content: '' });
  40964. const clickActionFunc = (i: number, action: ActionProps) => {
  40965. index = i;
  40966. item = action;
  40967. toastVisible3 = true;
  40968. };
  40969. </script>
  40970. <div class="py-4">
  40971. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  40972. <ActionSheet bind:visible={visible1} {actions} />
  40973. <Cell title="With cancel operation and click mask not closable" onclick={() => (visible2 = true)} />
  40974. <ActionSheet bind:visible={visible2} {actions} showCancel popup={{ maskClosable: false }} />
  40975. <Cell title="Different styles" onclick={() => (visible3 = true)} />
  40976. <ActionSheet bind:visible={visible3} actions={actions1} />
  40977. <Cell title="With title and description information" onclick={() => (visible4 = true)} />
  40978. <ActionSheet bind:visible={visible4} actions={actions2} title="Here is the title, which can briefly explain the following operations." />
  40979. <Cell title="Top corner rounded" onclick={() => (visible5 = true)} />
  40980. <ActionSheet bind:visible={visible5} {actions} popup={{ radius: 'xl' }} />
  40981. <Cell title="With spacing on both sides" onclick={() => (visible6 = true)} />
  40982. <ActionSheet bind:visible={visible6} {actions} popup={{ radius: 'xl', px: '2' }} />
  40983. <Cell title="Listen to close event" onclick={() => (visible7 = true)} />
  40984. <ActionSheet bind:visible={visible7} {actions} onclose={() => (toastVisible1 = true)} />
  40985. <Toast bind:visible={toastVisible1} message="Closed ActionSheet!" />
  40986. <Cell title="Listen to cancel event" onclick={() => (visible8 = true)} />
  40987. <ActionSheet bind:visible={visible8} {actions} showCancel oncancel={() => (toastVisible2 = true)} />
  40988. <Toast bind:visible={toastVisible2} message="Clicked cancel!" />
  40989. <Cell title="Listen to option click event" onclick={() => (visible9 = true)} />
  40990. <ActionSheet bind:visible={visible9} {actions} onclickAction={clickActionFunc} />
  40991. <Toast bind:visible={toastVisible3} message={`Clicked the ${index + 1} item, ${item.content}!`} />
  40992. <Cell title="Click option not close" onclick={() => (visible10 = true)} />
  40993. <ActionSheet bind:visible={visible10} {actions} actionClosable={false} />
  40994. <Cell title="Option with image" onclick={() => (visible11 = true)} />
  40995. <ActionSheet bind:visible={visible11} actions={actions3} />
  40996. <Cell title="Option left aligned" onclick={() => (visible12 = true)} />
  40997. <ActionSheet bind:visible={visible12} actions={actions4} align="left" />
  40998. </div>
  40999. ================================================
  41000. FILE: packages/stdf/src/routes/actionSheet/zh_CN/+page.svelte
  41001. ================================================
  41002. <!-- ActionSheet Demo -->
  41003. <script lang="ts">
  41004. import { Cell, ActionSheet, Toast } from '$lib/index.js';
  41005. import { type ActionProps } from '$lib/types/index.js';
  41006. let visible1 = $state(false);
  41007. let visible2 = $state(false);
  41008. let visible3 = $state(false);
  41009. let visible4 = $state(false);
  41010. let visible5 = $state(false);
  41011. let visible6 = $state(false);
  41012. let visible7 = $state(false);
  41013. let visible8 = $state(false);
  41014. let visible9 = $state(false);
  41015. let visible10 = $state(false);
  41016. let visible11 = $state(false);
  41017. let visible12 = $state(false);
  41018. const actions: ActionProps[] = [{ content: '选项一' }, { content: '选项二' }, { content: '选项三' }];
  41019. const actions1: ActionProps[] = [
  41020. { content: '常规选项' },
  41021. { content: '主题选项', style: 'theme' },
  41022. { content: '禁用选项', style: 'disabled' },
  41023. { content: '警告选项', style: 'danger' }
  41024. ];
  41025. const actions2: ActionProps[] = [
  41026. { content: '选项一' },
  41027. { content: '选项二', desc: '这里是描述信息' },
  41028. { content: '选项三', style: 'danger', desc: '这里是描述信息' }
  41029. ];
  41030. const actions3: ActionProps[] = [
  41031. { content: '火女', showImg: true, imgSrc: '/assets/images/dota_火女.png', imgRadius: 'sm' },
  41032. { content: '小牛', showImg: true, imgSrc: '/assets/images/dota_小牛.png', imgRadius: 'sm' },
  41033. { content: '水人', showImg: true, imgSrc: '/assets/images/dota_水人.png', imgRadius: 'sm' }
  41034. ];
  41035. const actions4: ActionProps[] = [
  41036. { content: 'Apple', showImg: true, imgSrc: '/assets/logos/apple.png', imgRadius: 'none' },
  41037. { content: 'Google', showImg: true, imgSrc: '/assets/logos/google.png', imgRadius: 'none' },
  41038. { content: 'Microsoft', showImg: true, imgSrc: '/assets/logos/microsoft.png', imgRadius: 'none' },
  41039. { content: 'Adobe', showImg: true, imgSrc: '/assets/logos/adobe.png', imgRadius: 'none' },
  41040. { content: 'Figma', showImg: true, imgSrc: '/assets/logos/figma.png', imgRadius: 'none' }
  41041. ];
  41042. let toastVisible1 = $state(false);
  41043. let toastVisible2 = $state(false);
  41044. let toastVisible3 = $state(false);
  41045. let index = $state(0);
  41046. let item = $state({ content: '' });
  41047. const clickActionFunc = (i: number, action: ActionProps) => {
  41048. index = i;
  41049. item = action;
  41050. toastVisible3 = true;
  41051. };
  41052. </script>
  41053. <div class="py-4">
  41054. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  41055. <ActionSheet bind:visible={visible1} {actions} />
  41056. <Cell title="有取消操作且点击遮罩不可关闭" onclick={() => (visible2 = true)} />
  41057. <ActionSheet bind:visible={visible2} {actions} showCancel popup={{ maskClosable: false }} />
  41058. <Cell title="不同样式" onclick={() => (visible3 = true)} />
  41059. <ActionSheet bind:visible={visible3} actions={actions1} />
  41060. <Cell title="带标题和描述信息" onclick={() => (visible4 = true)} />
  41061. <ActionSheet bind:visible={visible4} actions={actions2} title="这里是标题,可以简要说明以下操作。" />
  41062. <Cell title="顶部来点圆角" onclick={() => (visible5 = true)} />
  41063. <ActionSheet bind:visible={visible5} {actions} popup={{ radius: 'xl' }} />
  41064. <Cell title="两侧有间距" onclick={() => (visible6 = true)} />
  41065. <ActionSheet bind:visible={visible6} {actions} popup={{ radius: 'xl', px: '2' }} />
  41066. <Cell title="监听关闭事件" onclick={() => (visible7 = true)} />
  41067. <ActionSheet bind:visible={visible7} {actions} onclose={() => (toastVisible1 = true)} />
  41068. <Toast bind:visible={toastVisible1} message="关闭了 ActionSheet!" />
  41069. <Cell title="监听取消事件" onclick={() => (visible8 = true)} />
  41070. <ActionSheet bind:visible={visible8} {actions} showCancel oncancel={() => (toastVisible2 = true)} />
  41071. <Toast bind:visible={toastVisible2} message="点击了取消!" />
  41072. <Cell title="监听选项点击事件" onclick={() => (visible9 = true)} />
  41073. <ActionSheet bind:visible={visible9} {actions} onclickAction={clickActionFunc} />
  41074. <Toast bind:visible={toastVisible3} message={`点击了第 ${index + 1} 项,${item.content}!`} />
  41075. <Cell title="点击选项不关闭" onclick={() => (visible10 = true)} />
  41076. <ActionSheet bind:visible={visible10} {actions} actionClosable={false} />
  41077. <Cell title="选项带图片" onclick={() => (visible11 = true)} />
  41078. <ActionSheet bind:visible={visible11} actions={actions3} />
  41079. <Cell title="选项左对齐" onclick={() => (visible12 = true)} />
  41080. <ActionSheet bind:visible={visible12} actions={actions4} align="left" />
  41081. </div>
  41082. ================================================
  41083. FILE: packages/stdf/src/routes/asyncPicker/en_US/+page.svelte
  41084. ================================================
  41085. <!-- AsyncPicker Demo -->
  41086. <script lang="ts">
  41087. import { AsyncPicker, Cell } from '$lib/index.js';
  41088. // For the sake of clarity, the reference data is placed in the data_en.js file, which can be viewed at the bottom of this page.
  41089. import { linkageData, linkageDiffLabeData } from './data_en.js';
  41090. let visible1 = $state(false);
  41091. let visible2 = $state(false);
  41092. let visible3 = $state(false);
  41093. let visible4 = $state(false);
  41094. let visible5 = $state(false);
  41095. let visible6 = $state(false);
  41096. let visible7 = $state(false);
  41097. let visible8 = $state(false);
  41098. let visible9 = $state(false);
  41099. let data = $state(linkageData);
  41100. let currentLevel = $state(0);
  41101. let lastLevel = $state(false);
  41102. let firstLevel = $state(true);
  41103. let level1Data = $state(linkageData[0].children);
  41104. let titleBind = $state('Please select state');
  41105. // Simulate data obtained after 2 seconds
  41106. const nextFunc = (index: number) => {
  41107. if (currentLevel === 0) {
  41108. const nextData = linkageData[index].children;
  41109. level1Data = nextData;
  41110. setTimeout(() => {
  41111. data = nextData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41112. currentLevel = 1;
  41113. titleBind = 'Please select county';
  41114. firstLevel = false;
  41115. }, 2000);
  41116. } else if (currentLevel === 1) {
  41117. const nextData = level1Data[index].children;
  41118. setTimeout(() => {
  41119. data = nextData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41120. currentLevel = 2;
  41121. titleBind = 'Please select district';
  41122. lastLevel = true;
  41123. }, 2000);
  41124. } else {
  41125. console.log('Last level');
  41126. }
  41127. };
  41128. const prevFunc = () => {
  41129. if (currentLevel === 1) {
  41130. const prevData = linkageData;
  41131. setTimeout(() => {
  41132. data = prevData;
  41133. currentLevel = 0;
  41134. titleBind = 'Please select state';
  41135. firstLevel = true;
  41136. }, 2000);
  41137. } else if (currentLevel === 2) {
  41138. const prevData = level1Data;
  41139. setTimeout(() => {
  41140. data = prevData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41141. currentLevel = 1;
  41142. titleBind = 'Please select county';
  41143. lastLevel = false;
  41144. }, 2000);
  41145. } else {
  41146. console.log('First level');
  41147. }
  41148. };
  41149. let allIndexs: number[] = $state([]);
  41150. let allItems: { label: string }[] = $state([]);
  41151. const getAllDataFunc = (items: { label: string }[], indexs: number[]) => {
  41152. allItems = items;
  41153. allIndexs = indexs;
  41154. };
  41155. // 每一级对应的 labelKey 不同时的处理逻辑
  41156. let diffLabelKeyData = $state(linkageDiffLabeData);
  41157. let labelKey = $state('province');
  41158. let diffLabelKeyCurrentLevel = $state(0);
  41159. let diffLabelKeyLastLevel = $state(false);
  41160. let diffLabelKeyFirstLevel = $state(true);
  41161. let diffLabelKeyLevel1Data = $state(linkageDiffLabeData[0].children);
  41162. const diffLabelKeyNextFunc = (index: number) => {
  41163. if (diffLabelKeyCurrentLevel === 0) {
  41164. const nextData = linkageDiffLabeData[index].children;
  41165. diffLabelKeyLevel1Data = nextData;
  41166. setTimeout(() => {
  41167. diffLabelKeyData = nextData as unknown as { province: string; children: { city: string; children: { region: string }[] }[] }[];
  41168. labelKey = 'city';
  41169. diffLabelKeyCurrentLevel = 1;
  41170. diffLabelKeyFirstLevel = false;
  41171. }, 2000);
  41172. } else if (diffLabelKeyCurrentLevel === 1) {
  41173. const nextData = diffLabelKeyLevel1Data[index].children;
  41174. setTimeout(() => {
  41175. diffLabelKeyData = nextData as unknown as { province: string; children: { city: string; children: { region: string }[] }[] }[];
  41176. diffLabelKeyCurrentLevel = 2;
  41177. labelKey = 'region';
  41178. diffLabelKeyLastLevel = true;
  41179. }, 2000);
  41180. } else {
  41181. console.log('Last level');
  41182. }
  41183. };
  41184. const diffLabelKeyPrevFunc = () => {
  41185. if (diffLabelKeyCurrentLevel === 1) {
  41186. const prevData = linkageDiffLabeData;
  41187. setTimeout(() => {
  41188. diffLabelKeyData = prevData;
  41189. diffLabelKeyCurrentLevel = 0;
  41190. diffLabelKeyFirstLevel = true;
  41191. labelKey = 'province';
  41192. }, 2000);
  41193. } else if (diffLabelKeyCurrentLevel === 2) {
  41194. const prevData = diffLabelKeyLevel1Data;
  41195. setTimeout(() => {
  41196. diffLabelKeyData = prevData as unknown as { province: string; children: { city: string; children: { region: string }[] }[] }[];
  41197. diffLabelKeyCurrentLevel = 1;
  41198. labelKey = 'city';
  41199. diffLabelKeyLastLevel = false;
  41200. }, 2000);
  41201. } else {
  41202. console.log('First level');
  41203. }
  41204. };
  41205. </script>
  41206. <div class="py-4">
  41207. <div class="px-4">
  41208. {#if allItems.length}
  41209. Currently selected:
  41210. {#each allItems as item}
  41211. <span class="mr-2 text-primary dark:text-dark">{item.label}</span>
  41212. {/each}
  41213. {:else}
  41214. <div>Please select data</div>
  41215. {/if}
  41216. </div>
  41217. <div class="px-4">
  41218. {#if allIndexs.length}
  41219. The index values of current selections in their respective columns are:
  41220. {#each allIndexs as index}
  41221. <span class="mr-2 text-primary dark:text-dark">{index}</span>
  41222. {/each}
  41223. {:else}
  41224. <div>Please select data</div>
  41225. {/if}
  41226. </div>
  41227. <Cell
  41228. title="Basic Usage"
  41229. onclick={() => {
  41230. visible1 = true;
  41231. data = linkageData;
  41232. lastLevel = false;
  41233. firstLevel = true;
  41234. currentLevel = 0;
  41235. level1Data = linkageData[0].children;
  41236. }}
  41237. />
  41238. <AsyncPicker
  41239. bind:visible={visible1}
  41240. bind:data
  41241. bind:lastLevel
  41242. bind:firstLevel
  41243. onnext={nextFunc}
  41244. onprev={prevFunc}
  41245. onconfirm={getAllDataFunc as (items: Record<string, unknown>[], indexs: number[]) => void}
  41246. />
  41247. <Cell
  41248. title="Show 7 Rows"
  41249. onclick={() => {
  41250. visible2 = true;
  41251. data = linkageData;
  41252. lastLevel = false;
  41253. firstLevel = true;
  41254. currentLevel = 0;
  41255. level1Data = linkageData[0].children;
  41256. }}
  41257. />
  41258. <AsyncPicker bind:visible={visible2} bind:data bind:lastLevel bind:firstLevel onnext={nextFunc} onprev={prevFunc} showRow={7} />
  41259. <Cell
  41260. title="Left Align"
  41261. onclick={() => {
  41262. visible3 = true;
  41263. data = linkageData;
  41264. lastLevel = false;
  41265. firstLevel = true;
  41266. currentLevel = 0;
  41267. level1Data = linkageData[0].children;
  41268. }}
  41269. />
  41270. <AsyncPicker bind:visible={visible3} bind:data bind:lastLevel bind:firstLevel align="left" onnext={nextFunc} onprev={prevFunc} />
  41271. <Cell
  41272. title="Custom Next/Previous Text"
  41273. onclick={() => {
  41274. visible5 = true;
  41275. data = linkageData;
  41276. lastLevel = false;
  41277. firstLevel = true;
  41278. currentLevel = 0;
  41279. level1Data = linkageData[0].children;
  41280. }}
  41281. />
  41282. <AsyncPicker
  41283. bind:visible={visible5}
  41284. bind:data
  41285. bind:lastLevel
  41286. bind:firstLevel
  41287. onnext={nextFunc}
  41288. onprev={prevFunc}
  41289. nextText="Continue"
  41290. prevText="Back"
  41291. />
  41292. <Cell
  41293. title="Different labelKey for Each Level"
  41294. onclick={() => {
  41295. visible4 = true;
  41296. diffLabelKeyData = linkageDiffLabeData;
  41297. labelKey = 'province';
  41298. diffLabelKeyCurrentLevel = 0;
  41299. diffLabelKeyLastLevel = false;
  41300. diffLabelKeyFirstLevel = true;
  41301. diffLabelKeyLevel1Data = linkageDiffLabeData[0].children;
  41302. }}
  41303. />
  41304. <AsyncPicker
  41305. bind:visible={visible4}
  41306. bind:data={diffLabelKeyData}
  41307. bind:lastLevel={diffLabelKeyLastLevel}
  41308. bind:firstLevel={diffLabelKeyFirstLevel}
  41309. bind:labelKey
  41310. onnext={diffLabelKeyNextFunc}
  41311. onprev={diffLabelKeyPrevFunc}
  41312. />
  41313. <Cell
  41314. title="Different Loading Effect"
  41315. onclick={() => {
  41316. visible6 = true;
  41317. data = linkageData;
  41318. lastLevel = false;
  41319. firstLevel = true;
  41320. currentLevel = 0;
  41321. level1Data = linkageData[0].children;
  41322. }}
  41323. />
  41324. <AsyncPicker
  41325. bind:visible={visible6}
  41326. bind:data
  41327. bind:lastLevel
  41328. bind:firstLevel
  41329. onnext={nextFunc}
  41330. onprev={prevFunc}
  41331. loading={{ type: '1_15', width: '12', height: '12' }}
  41332. />
  41333. <Cell
  41334. title="Rounded Top Corners"
  41335. onclick={() => {
  41336. visible8 = true;
  41337. data = linkageData;
  41338. lastLevel = false;
  41339. firstLevel = true;
  41340. currentLevel = 0;
  41341. level1Data = linkageData[0].children;
  41342. }}
  41343. />
  41344. <AsyncPicker
  41345. bind:visible={visible8}
  41346. bind:data
  41347. bind:lastLevel
  41348. bind:firstLevel
  41349. onnext={nextFunc}
  41350. onprev={prevFunc}
  41351. popup={{ radius: 'xl' }}
  41352. />
  41353. <Cell
  41354. title="Show Selected Options"
  41355. onclick={() => {
  41356. visible7 = true;
  41357. data = linkageData;
  41358. lastLevel = false;
  41359. firstLevel = true;
  41360. currentLevel = 0;
  41361. level1Data = linkageData[0].children;
  41362. }}
  41363. />
  41364. <AsyncPicker bind:visible={visible7} bind:data bind:lastLevel bind:firstLevel onnext={nextFunc} onprev={prevFunc} showSelected />
  41365. <Cell
  41366. title="Dynamic Title"
  41367. onclick={() => {
  41368. visible9 = true;
  41369. data = linkageData;
  41370. lastLevel = false;
  41371. firstLevel = true;
  41372. currentLevel = 0;
  41373. titleBind = 'Please select state';
  41374. level1Data = linkageData[0].children;
  41375. }}
  41376. />
  41377. <AsyncPicker
  41378. bind:visible={visible9}
  41379. bind:data
  41380. bind:lastLevel
  41381. bind:firstLevel
  41382. bind:title={titleBind}
  41383. onnext={nextFunc}
  41384. onprev={prevFunc}
  41385. />
  41386. </div>
  41387. <!--
  41388. const linkageData = [
  41389. {
  41390. label: 'California',
  41391. children: [
  41392. {
  41393. label: 'Los Angeles',
  41394. children: [
  41395. { label: 'Downtown' },
  41396. { label: 'Hollywood' },
  41397. { label: 'Venice' },
  41398. { label: 'Santa Monica' },
  41399. { label: 'Beverly Hills' }
  41400. ]
  41401. },
  41402. {
  41403. label: 'San Francisco',
  41404. children: [
  41405. { label: 'Downtown' },
  41406. { label: 'Mission District' },
  41407. { label: 'North Beach' },
  41408. { label: 'Chinatown' },
  41409. { label: 'Haight-Ashbury' }
  41410. ]
  41411. },
  41412. {
  41413. label: 'San Diego',
  41414. children: [
  41415. { label: 'Downtown' },
  41416. { label: 'La Jolla' },
  41417. { label: 'Pacific Beach' },
  41418. { label: 'Mission Beach' },
  41419. { label: 'Coronado' }
  41420. ]
  41421. }
  41422. ]
  41423. },
  41424. {
  41425. label: 'New York',
  41426. children: [
  41427. {
  41428. label: 'New York City',
  41429. children: [{ label: 'Manhattan' }, { label: 'Brooklyn' }, { label: 'Queens' }, { label: 'The Bronx' }, { label: 'Staten Island' }]
  41430. },
  41431. {
  41432. label: 'Buffalo',
  41433. children: [
  41434. { label: 'Downtown' },
  41435. { label: 'North Buffalo' },
  41436. { label: 'South Buffalo' },
  41437. { label: 'East Side' },
  41438. { label: 'West Side' }
  41439. ]
  41440. }
  41441. ]
  41442. },
  41443. {
  41444. label: 'Texas',
  41445. children: [
  41446. {
  41447. label: 'Houston',
  41448. children: [{ label: 'Downtown' }, { label: 'Midtown' }, { label: 'The Heights' }, { label: 'River Oaks' }, { label: 'Memorial' }]
  41449. },
  41450. {
  41451. label: 'Dallas',
  41452. children: [{ label: 'Downtown' }, { label: 'Uptown' }, { label: 'Deep Ellum' }, { label: 'Oak Lawn' }, { label: 'Highland Park' }]
  41453. },
  41454. {
  41455. label: 'Austin',
  41456. children: [
  41457. { label: 'Downtown' },
  41458. { label: 'South Congress' },
  41459. { label: 'East Austin' },
  41460. { label: 'West Lake Hills' },
  41461. { label: 'North Loop' }
  41462. ]
  41463. }
  41464. ]
  41465. },
  41466. {
  41467. label: 'Florida',
  41468. children: [
  41469. {
  41470. label: 'Miami',
  41471. children: [
  41472. { label: 'Downtown' },
  41473. { label: 'South Beach' },
  41474. { label: 'Brickell' },
  41475. { label: 'Coconut Grove' },
  41476. { label: 'Little Havana' }
  41477. ]
  41478. },
  41479. {
  41480. label: 'Orlando',
  41481. children: [
  41482. { label: 'Downtown' },
  41483. { label: 'Winter Park' },
  41484. { label: 'Lake Nona' },
  41485. { label: 'College Park' },
  41486. { label: 'Baldwin Park' }
  41487. ]
  41488. }
  41489. ]
  41490. },
  41491. {
  41492. label: 'Illinois',
  41493. children: [
  41494. {
  41495. label: 'Chicago',
  41496. children: [
  41497. { label: 'The Loop' },
  41498. { label: 'River North' },
  41499. { label: 'Lincoln Park' },
  41500. { label: 'Wicker Park' },
  41501. { label: 'Gold Coast' }
  41502. ]
  41503. },
  41504. {
  41505. label: 'Springfield',
  41506. children: [{ label: 'Downtown' }, { label: 'West Side' }, { label: 'East Side' }, { label: 'North End' }, { label: 'South Side' }]
  41507. }
  41508. ]
  41509. }
  41510. ];
  41511. const linkageDiffLabeData = [
  41512. {
  41513. province: 'California',
  41514. children: [
  41515. {
  41516. city: 'Los Angeles',
  41517. children: [
  41518. { region: 'Downtown' },
  41519. { region: 'Hollywood' },
  41520. { region: 'Venice' },
  41521. { region: 'Santa Monica' },
  41522. { region: 'Beverly Hills' },
  41523. { region: 'Pasadena' },
  41524. { region: 'Long Beach' }
  41525. ]
  41526. },
  41527. {
  41528. city: 'San Francisco',
  41529. children: [
  41530. { region: 'Downtown' },
  41531. { region: 'Mission District' },
  41532. { region: 'North Beach' },
  41533. { region: 'Chinatown' },
  41534. { region: 'Haight-Ashbury' },
  41535. { region: 'Castro' },
  41536. { region: 'Pacific Heights' }
  41537. ]
  41538. },
  41539. {
  41540. city: 'San Diego',
  41541. children: [
  41542. { region: 'Downtown' },
  41543. { region: 'La Jolla' },
  41544. { region: 'Pacific Beach' },
  41545. { region: 'Mission Beach' },
  41546. { region: 'Coronado' },
  41547. { region: 'North Park' },
  41548. { region: 'Hillcrest' }
  41549. ]
  41550. }
  41551. ]
  41552. },
  41553. {
  41554. province: 'New York',
  41555. children: [
  41556. {
  41557. city: 'New York City',
  41558. children: [
  41559. { region: 'Manhattan' },
  41560. { region: 'Brooklyn' },
  41561. { region: 'Queens' },
  41562. { region: 'The Bronx' },
  41563. { region: 'Staten Island' },
  41564. { region: 'Upper East Side' },
  41565. { region: 'Upper West Side' },
  41566. { region: 'Greenwich Village' }
  41567. ]
  41568. },
  41569. {
  41570. city: 'Buffalo',
  41571. children: [
  41572. { region: 'Downtown' },
  41573. { region: 'North Buffalo' },
  41574. { region: 'South Buffalo' },
  41575. { region: 'East Side' },
  41576. { region: 'West Side' },
  41577. { region: 'Elmwood Village' }
  41578. ]
  41579. }
  41580. ]
  41581. }
  41582. ];
  41583. export { linkageData, linkageDiffLabeData };
  41584. -->
  41585. ================================================
  41586. FILE: packages/stdf/src/routes/asyncPicker/en_US/data_en.js
  41587. ================================================
  41588. const linkageData = [
  41589. {
  41590. label: 'California',
  41591. children: [
  41592. {
  41593. label: 'Los Angeles',
  41594. children: [
  41595. { label: 'Downtown' },
  41596. { label: 'Hollywood' },
  41597. { label: 'Venice' },
  41598. { label: 'Santa Monica' },
  41599. { label: 'Beverly Hills' }
  41600. ]
  41601. },
  41602. {
  41603. label: 'San Francisco',
  41604. children: [
  41605. { label: 'Downtown' },
  41606. { label: 'Mission District' },
  41607. { label: 'North Beach' },
  41608. { label: 'Chinatown' },
  41609. { label: 'Haight-Ashbury' }
  41610. ]
  41611. },
  41612. {
  41613. label: 'San Diego',
  41614. children: [
  41615. { label: 'Downtown' },
  41616. { label: 'La Jolla' },
  41617. { label: 'Pacific Beach' },
  41618. { label: 'Mission Beach' },
  41619. { label: 'Coronado' }
  41620. ]
  41621. }
  41622. ]
  41623. },
  41624. {
  41625. label: 'New York',
  41626. children: [
  41627. {
  41628. label: 'New York City',
  41629. children: [{ label: 'Manhattan' }, { label: 'Brooklyn' }, { label: 'Queens' }, { label: 'The Bronx' }, { label: 'Staten Island' }]
  41630. },
  41631. {
  41632. label: 'Buffalo',
  41633. children: [
  41634. { label: 'Downtown' },
  41635. { label: 'North Buffalo' },
  41636. { label: 'South Buffalo' },
  41637. { label: 'East Side' },
  41638. { label: 'West Side' }
  41639. ]
  41640. }
  41641. ]
  41642. },
  41643. {
  41644. label: 'Texas',
  41645. children: [
  41646. {
  41647. label: 'Houston',
  41648. children: [{ label: 'Downtown' }, { label: 'Midtown' }, { label: 'The Heights' }, { label: 'River Oaks' }, { label: 'Memorial' }]
  41649. },
  41650. {
  41651. label: 'Dallas',
  41652. children: [{ label: 'Downtown' }, { label: 'Uptown' }, { label: 'Deep Ellum' }, { label: 'Oak Lawn' }, { label: 'Highland Park' }]
  41653. },
  41654. {
  41655. label: 'Austin',
  41656. children: [
  41657. { label: 'Downtown' },
  41658. { label: 'South Congress' },
  41659. { label: 'East Austin' },
  41660. { label: 'West Lake Hills' },
  41661. { label: 'North Loop' }
  41662. ]
  41663. }
  41664. ]
  41665. },
  41666. {
  41667. label: 'Florida',
  41668. children: [
  41669. {
  41670. label: 'Miami',
  41671. children: [
  41672. { label: 'Downtown' },
  41673. { label: 'South Beach' },
  41674. { label: 'Brickell' },
  41675. { label: 'Coconut Grove' },
  41676. { label: 'Little Havana' }
  41677. ]
  41678. },
  41679. {
  41680. label: 'Orlando',
  41681. children: [
  41682. { label: 'Downtown' },
  41683. { label: 'Winter Park' },
  41684. { label: 'Lake Nona' },
  41685. { label: 'College Park' },
  41686. { label: 'Baldwin Park' }
  41687. ]
  41688. }
  41689. ]
  41690. },
  41691. {
  41692. label: 'Illinois',
  41693. children: [
  41694. {
  41695. label: 'Chicago',
  41696. children: [
  41697. { label: 'The Loop' },
  41698. { label: 'River North' },
  41699. { label: 'Lincoln Park' },
  41700. { label: 'Wicker Park' },
  41701. { label: 'Gold Coast' }
  41702. ]
  41703. },
  41704. {
  41705. label: 'Springfield',
  41706. children: [{ label: 'Downtown' }, { label: 'West Side' }, { label: 'East Side' }, { label: 'North End' }, { label: 'South Side' }]
  41707. }
  41708. ]
  41709. }
  41710. ];
  41711. const linkageDiffLabeData = [
  41712. {
  41713. province: 'California',
  41714. children: [
  41715. {
  41716. city: 'Los Angeles',
  41717. children: [
  41718. { region: 'Downtown' },
  41719. { region: 'Hollywood' },
  41720. { region: 'Venice' },
  41721. { region: 'Santa Monica' },
  41722. { region: 'Beverly Hills' },
  41723. { region: 'Pasadena' },
  41724. { region: 'Long Beach' }
  41725. ]
  41726. },
  41727. {
  41728. city: 'San Francisco',
  41729. children: [
  41730. { region: 'Downtown' },
  41731. { region: 'Mission District' },
  41732. { region: 'North Beach' },
  41733. { region: 'Chinatown' },
  41734. { region: 'Haight-Ashbury' },
  41735. { region: 'Castro' },
  41736. { region: 'Pacific Heights' }
  41737. ]
  41738. },
  41739. {
  41740. city: 'San Diego',
  41741. children: [
  41742. { region: 'Downtown' },
  41743. { region: 'La Jolla' },
  41744. { region: 'Pacific Beach' },
  41745. { region: 'Mission Beach' },
  41746. { region: 'Coronado' },
  41747. { region: 'North Park' },
  41748. { region: 'Hillcrest' }
  41749. ]
  41750. }
  41751. ]
  41752. },
  41753. {
  41754. province: 'New York',
  41755. children: [
  41756. {
  41757. city: 'New York City',
  41758. children: [
  41759. { region: 'Manhattan' },
  41760. { region: 'Brooklyn' },
  41761. { region: 'Queens' },
  41762. { region: 'The Bronx' },
  41763. { region: 'Staten Island' },
  41764. { region: 'Upper East Side' },
  41765. { region: 'Upper West Side' },
  41766. { region: 'Greenwich Village' }
  41767. ]
  41768. },
  41769. {
  41770. city: 'Buffalo',
  41771. children: [
  41772. { region: 'Downtown' },
  41773. { region: 'North Buffalo' },
  41774. { region: 'South Buffalo' },
  41775. { region: 'East Side' },
  41776. { region: 'West Side' },
  41777. { region: 'Elmwood Village' }
  41778. ]
  41779. }
  41780. ]
  41781. }
  41782. ];
  41783. export { linkageData, linkageDiffLabeData };
  41784. ================================================
  41785. FILE: packages/stdf/src/routes/asyncPicker/zh_CN/+page.svelte
  41786. ================================================
  41787. <script lang="ts">
  41788. import { AsyncPicker, Cell } from '$lib/index.js';
  41789. // 为避免 Demo 页面杂乱,具体参考数据放在 data.js 文件内,可查看此页面底部注释。
  41790. import { linkageData, linkageDiffLabeData } from './data.js';
  41791. let visible1 = $state(false);
  41792. let visible2 = $state(false);
  41793. let visible3 = $state(false);
  41794. let visible4 = $state(false);
  41795. let visible5 = $state(false);
  41796. let visible6 = $state(false);
  41797. let visible7 = $state(false);
  41798. let visible8 = $state(false);
  41799. let visible9 = $state(false);
  41800. let data: { label: string; children: { label: string; children: { label: string }[] }[] }[] = $state(linkageData);
  41801. let currentLevel = $state(0);
  41802. let lastLevel = $state(false);
  41803. let firstLevel = $state(true);
  41804. let level1Data = $state(linkageData[0].children);
  41805. let titleBind = $state('请选择省级');
  41806. // 模拟 2 秒后获取到数据
  41807. const nextFunc = (index: number) => {
  41808. if (currentLevel === 0) {
  41809. const nextData = linkageData[index].children;
  41810. level1Data = nextData;
  41811. setTimeout(() => {
  41812. data = nextData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41813. currentLevel = 1;
  41814. titleBind = '请选择市级';
  41815. firstLevel = false;
  41816. }, 2000);
  41817. } else if (currentLevel === 1) {
  41818. const nextData = level1Data[index].children;
  41819. setTimeout(() => {
  41820. data = nextData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41821. currentLevel = 2;
  41822. titleBind = '请选择区级';
  41823. lastLevel = true;
  41824. }, 2000);
  41825. } else {
  41826. console.log('最后一级');
  41827. }
  41828. };
  41829. const prevFunc = () => {
  41830. if (currentLevel === 1) {
  41831. const prevData = linkageData;
  41832. setTimeout(() => {
  41833. data = prevData;
  41834. currentLevel = 0;
  41835. titleBind = '请选择省级';
  41836. firstLevel = true;
  41837. }, 2000);
  41838. } else if (currentLevel === 2) {
  41839. const prevData = level1Data;
  41840. setTimeout(() => {
  41841. data = prevData as { label: string; children: { label: string; children: { label: string }[] }[] }[];
  41842. currentLevel = 1;
  41843. titleBind = '请选择市级';
  41844. lastLevel = false;
  41845. }, 2000);
  41846. } else {
  41847. console.log('第一级');
  41848. }
  41849. };
  41850. let allIndexs: number[] = $state([]);
  41851. let allItems: { label: string }[] = $state([]);
  41852. const getAllDataFunc = (items: { label: string }[], indexs: number[]) => {
  41853. allItems = items;
  41854. allIndexs = indexs;
  41855. };
  41856. // 每一级对应的 labelKey 不同时的处理逻辑
  41857. type DiffLabelKeyDataCity = { city: string; children: { region: string }[] };
  41858. type DiffLabelKeyData = { province: string; children: DiffLabelKeyDataCity[] };
  41859. let diffLabelKeyData: DiffLabelKeyData[] = $state(linkageDiffLabeData);
  41860. let labelKey = $state('province');
  41861. let diffLabelKeyCurrentLevel = $state(0);
  41862. let diffLabelKeyLastLevel = $state(false);
  41863. let diffLabelKeyFirstLevel = $state(true);
  41864. let diffLabelKeyLevel1Data: DiffLabelKeyDataCity[] = $state(linkageDiffLabeData[0].children);
  41865. const diffLabelKeyNextFunc = (index: number) => {
  41866. if (diffLabelKeyCurrentLevel === 0) {
  41867. const nextData: DiffLabelKeyDataCity[] = linkageDiffLabeData[index].children;
  41868. diffLabelKeyLevel1Data = nextData;
  41869. setTimeout(() => {
  41870. diffLabelKeyData = nextData as unknown as DiffLabelKeyData[];
  41871. labelKey = 'city';
  41872. diffLabelKeyCurrentLevel = 1;
  41873. diffLabelKeyFirstLevel = false;
  41874. }, 2000);
  41875. } else if (diffLabelKeyCurrentLevel === 1) {
  41876. const nextData = diffLabelKeyLevel1Data[index].children;
  41877. setTimeout(() => {
  41878. diffLabelKeyData = nextData as unknown as DiffLabelKeyData[];
  41879. diffLabelKeyCurrentLevel = 2;
  41880. labelKey = 'region';
  41881. diffLabelKeyLastLevel = true;
  41882. }, 2000);
  41883. } else {
  41884. console.log('最后一级');
  41885. }
  41886. };
  41887. const diffLabelKeyPrevFunc = () => {
  41888. if (diffLabelKeyCurrentLevel === 1) {
  41889. const prevData = linkageDiffLabeData;
  41890. setTimeout(() => {
  41891. diffLabelKeyData = prevData as unknown as DiffLabelKeyData[];
  41892. diffLabelKeyCurrentLevel = 0;
  41893. diffLabelKeyFirstLevel = true;
  41894. labelKey = 'province';
  41895. }, 2000);
  41896. } else if (diffLabelKeyCurrentLevel === 2) {
  41897. const prevData = diffLabelKeyLevel1Data;
  41898. setTimeout(() => {
  41899. diffLabelKeyData = prevData as unknown as DiffLabelKeyData[];
  41900. diffLabelKeyCurrentLevel = 1;
  41901. labelKey = 'city';
  41902. diffLabelKeyLastLevel = false;
  41903. }, 2000);
  41904. } else {
  41905. console.log('第一级');
  41906. }
  41907. };
  41908. </script>
  41909. <div class="py-4">
  41910. <div class="px-4">
  41911. {#if allItems.length}
  41912. 当前选定了:
  41913. {#each allItems as item}
  41914. <span class="mr-2 text-primary dark:text-dark">{item.label}</span>
  41915. {/each}
  41916. {:else}
  41917. <div>请选定数据</div>
  41918. {/if}
  41919. </div>
  41920. <div class="px-4">
  41921. {#if allIndexs.length}
  41922. 当前选定值位于所在列的索引值分别为:
  41923. {#each allIndexs as index}
  41924. <span class="mr-2 text-primary dark:text-dark">{index}</span>
  41925. {/each}
  41926. {:else}
  41927. <div>请选定数据</div>
  41928. {/if}
  41929. </div>
  41930. <Cell
  41931. title="基础用法"
  41932. onclick={() => {
  41933. visible1 = true;
  41934. data = linkageData;
  41935. lastLevel = false;
  41936. firstLevel = true;
  41937. currentLevel = 0;
  41938. level1Data = linkageData[0].children;
  41939. }}
  41940. />
  41941. <AsyncPicker
  41942. bind:visible={visible1}
  41943. bind:data
  41944. bind:lastLevel
  41945. bind:firstLevel
  41946. onnext={nextFunc}
  41947. onprev={prevFunc}
  41948. onconfirm={getAllDataFunc as (items: Record<string, unknown>[], indexs: number[]) => void}
  41949. />
  41950. <Cell
  41951. title="可见 7 行数为"
  41952. onclick={() => {
  41953. visible2 = true;
  41954. data = linkageData;
  41955. lastLevel = false;
  41956. firstLevel = true;
  41957. currentLevel = 0;
  41958. level1Data = linkageData[0].children;
  41959. }}
  41960. />
  41961. <AsyncPicker bind:visible={visible2} bind:data bind:lastLevel bind:firstLevel onnext={nextFunc} onprev={prevFunc} showRow={7} />
  41962. <Cell
  41963. title="左对齐"
  41964. onclick={() => {
  41965. visible3 = true;
  41966. data = linkageData;
  41967. lastLevel = false;
  41968. firstLevel = true;
  41969. currentLevel = 0;
  41970. level1Data = linkageData[0].children;
  41971. }}
  41972. />
  41973. <AsyncPicker bind:visible={visible3} bind:data bind:lastLevel bind:firstLevel align="left" onnext={nextFunc} onprev={prevFunc} />
  41974. <Cell
  41975. title="自定义上下一步文字"
  41976. onclick={() => {
  41977. visible5 = true;
  41978. data = linkageData;
  41979. lastLevel = false;
  41980. firstLevel = true;
  41981. currentLevel = 0;
  41982. level1Data = linkageData[0].children;
  41983. }}
  41984. />
  41985. <AsyncPicker
  41986. bind:visible={visible5}
  41987. bind:data
  41988. bind:lastLevel
  41989. bind:firstLevel
  41990. onnext={nextFunc}
  41991. onprev={prevFunc}
  41992. nextText="继续"
  41993. prevText="返回"
  41994. />
  41995. <Cell
  41996. title="不同级别使用不同的 labelKey"
  41997. onclick={() => {
  41998. visible4 = true;
  41999. diffLabelKeyData = linkageDiffLabeData;
  42000. labelKey = 'province';
  42001. diffLabelKeyCurrentLevel = 0;
  42002. diffLabelKeyLastLevel = false;
  42003. diffLabelKeyFirstLevel = true;
  42004. diffLabelKeyLevel1Data = linkageDiffLabeData[0].children;
  42005. }}
  42006. />
  42007. <AsyncPicker
  42008. bind:visible={visible4}
  42009. bind:data={diffLabelKeyData}
  42010. bind:lastLevel={diffLabelKeyLastLevel}
  42011. bind:firstLevel={diffLabelKeyFirstLevel}
  42012. bind:labelKey
  42013. onnext={diffLabelKeyNextFunc}
  42014. onprev={diffLabelKeyPrevFunc}
  42015. />
  42016. <Cell
  42017. title="换一个 Loading 效果"
  42018. onclick={() => {
  42019. visible6 = true;
  42020. data = linkageData;
  42021. lastLevel = false;
  42022. firstLevel = true;
  42023. currentLevel = 0;
  42024. level1Data = linkageData[0].children;
  42025. }}
  42026. />
  42027. <AsyncPicker
  42028. bind:visible={visible6}
  42029. bind:data
  42030. bind:lastLevel
  42031. bind:firstLevel
  42032. onnext={nextFunc}
  42033. onprev={prevFunc}
  42034. loading={{ type: '1_15', width: '12', height: '12' }}
  42035. />
  42036. <Cell
  42037. title="顶部来点圆角"
  42038. onclick={() => {
  42039. visible8 = true;
  42040. data = linkageData;
  42041. lastLevel = false;
  42042. firstLevel = true;
  42043. currentLevel = 0;
  42044. level1Data = linkageData[0].children;
  42045. }}
  42046. />
  42047. <AsyncPicker
  42048. bind:visible={visible8}
  42049. bind:data
  42050. bind:lastLevel
  42051. bind:firstLevel
  42052. onnext={nextFunc}
  42053. onprev={prevFunc}
  42054. popup={{ radius: 'xl' }}
  42055. />
  42056. <Cell
  42057. title="显示已选选项"
  42058. onclick={() => {
  42059. visible7 = true;
  42060. data = linkageData;
  42061. lastLevel = false;
  42062. firstLevel = true;
  42063. currentLevel = 0;
  42064. level1Data = linkageData[0].children;
  42065. }}
  42066. />
  42067. <AsyncPicker bind:visible={visible7} bind:data bind:lastLevel bind:firstLevel onnext={nextFunc} onprev={prevFunc} showSelected />
  42068. <Cell
  42069. title="动态改变标题"
  42070. onclick={() => {
  42071. visible9 = true;
  42072. data = linkageData;
  42073. lastLevel = false;
  42074. firstLevel = true;
  42075. currentLevel = 0;
  42076. titleBind = '请选择省级';
  42077. level1Data = linkageData[0].children;
  42078. }}
  42079. />
  42080. <AsyncPicker
  42081. bind:visible={visible9}
  42082. bind:data
  42083. bind:lastLevel
  42084. bind:firstLevel
  42085. bind:title={titleBind}
  42086. onnext={nextFunc}
  42087. onprev={prevFunc}
  42088. />
  42089. </div>
  42090. <!--
  42091. const linkageData = [
  42092. {
  42093. label: '云南',
  42094. children: [
  42095. {
  42096. label: '昆明',
  42097. children: [
  42098. { label: '盘龙区' },
  42099. { label: '五华区' },
  42100. { label: '官渡区' },
  42101. { label: '西山区' },
  42102. { label: '东川区' },
  42103. { label: '呈贡区' },
  42104. { label: '晋宁区' },
  42105. { label: '富民县' },
  42106. { label: '宜良县' },
  42107. { label: '石林彝族自治县' },
  42108. { label: '嵩明县' },
  42109. { label: '禄劝彝族苗族自治县' },
  42110. { label: '寻甸回族彝族自治县' },
  42111. { label: '安宁市' },
  42112. ],
  42113. },
  42114. {
  42115. label: '曲靖',
  42116. children: [
  42117. { label: '麒麟区' },
  42118. { label: '沾益区' },
  42119. { label: '马龙县' },
  42120. { label: '陆良县' },
  42121. { label: '师宗县' },
  42122. { label: '罗平县' },
  42123. { label: '富源县' },
  42124. { label: '会泽县' },
  42125. { label: '宣威市' },
  42126. ],
  42127. },
  42128. {
  42129. label: '玉溪',
  42130. children: [
  42131. { label: '红塔区' },
  42132. { label: '江川区' },
  42133. { label: '澄江县' },
  42134. { label: '通海县' },
  42135. { label: '华宁县' },
  42136. { label: '易门县' },
  42137. { label: '峨山彝族自治县' },
  42138. { label: '新平彝族傣族自治县' },
  42139. { label: '元江哈尼族彝族傣族自治县' },
  42140. ],
  42141. },
  42142. {
  42143. label: '保山',
  42144. children: [
  42145. { label: '隆阳区' },
  42146. { label: '施甸县' },
  42147. { label: '龙陵县' },
  42148. { label: '昌宁县' },
  42149. { label: '腾冲市' },
  42150. { label: '龙陵县' },
  42151. ],
  42152. },
  42153. {
  42154. label: '丽江',
  42155. children: [
  42156. { label: '古城区' },
  42157. { label: '永胜县' },
  42158. { label: '华坪县' },
  42159. { label: '玉龙纳西族自治县' },
  42160. { label: '宁蒗彝族自治县' },
  42161. ],
  42162. },
  42163. {
  42164. label: '普洱',
  42165. children: [
  42166. { label: '思茅区' },
  42167. { label: '宁洱哈尼族彝族自治县' },
  42168. { label: '墨江哈尼族自治县' },
  42169. { label: '景东彝族自治县' },
  42170. { label: '景谷傣族彝族自治县' },
  42171. { label: '镇沅彝族哈尼族拉祜族自治县' },
  42172. { label: '江城哈尼族彝族自治县' },
  42173. { label: '孟连傣族拉祜族佤族自治县' },
  42174. { label: '澜沧拉祜族自治县' },
  42175. { label: '西盟佤族自治县' },
  42176. ],
  42177. },
  42178. {
  42179. label: '临沧',
  42180. children: [
  42181. { label: '临翔区' },
  42182. { label: '凤庆县' },
  42183. { label: '云县' },
  42184. { label: '永德县' },
  42185. { label: '镇康县' },
  42186. { label: '双江拉祜族佤族布朗族傣族自治县' },
  42187. { label: '耿马傣族佤族自治县' },
  42188. { label: '沧源佤族自治县' },
  42189. ],
  42190. },
  42191. {
  42192. label: '楚雄',
  42193. children: [
  42194. { label: '楚雄市' },
  42195. { label: '双柏县' },
  42196. { label: '牟定县' },
  42197. { label: '南华县' },
  42198. { label: '姚安县' },
  42199. { label: '大姚县' },
  42200. { label: '永仁县' },
  42201. { label: '元谋县' },
  42202. { label: '武定县' },
  42203. { label: '禄丰县' },
  42204. ],
  42205. },
  42206. {
  42207. label: '红河',
  42208. children: [
  42209. { label: '个旧市' },
  42210. { label: '开远市' },
  42211. { label: '蒙自市' },
  42212. { label: '弥勒市' },
  42213. { label: '屏边苗族自治县' },
  42214. { label: '建水县' },
  42215. { label: '石屏县' },
  42216. { label: '泸西县' },
  42217. { label: '元阳县' },
  42218. { label: '红河县' },
  42219. { label: '金平苗族瑶族傣族自治县' },
  42220. { label: '绿春县' },
  42221. { label: '河口瑶族自治县' },
  42222. ],
  42223. },
  42224. {
  42225. label: '文山',
  42226. children: [
  42227. { label: '文山市' },
  42228. { label: '砚山县' },
  42229. { label: '西畴县' },
  42230. { label: '麻栗坡县' },
  42231. { label: '马关县' },
  42232. { label: '丘北县' },
  42233. { label: '广南县' },
  42234. { label: '富宁县' },
  42235. ],
  42236. },
  42237. ],
  42238. },
  42239. {
  42240. label: '广东',
  42241. children: [
  42242. {
  42243. label: '广州',
  42244. children: [
  42245. { label: '天河区' },
  42246. { label: '海珠区' },
  42247. { label: '荔湾区' },
  42248. { label: '越秀区' },
  42249. { label: '白云区' },
  42250. { label: '黄埔区' },
  42251. ],
  42252. },
  42253. {
  42254. label: '深圳',
  42255. children: [
  42256. { label: '罗湖区' },
  42257. { label: '福田区' },
  42258. { label: '南山区' },
  42259. { label: '宝安区' },
  42260. { label: '龙岗区' },
  42261. { label: '盐田区' },
  42262. ],
  42263. },
  42264. {
  42265. label: '珠海',
  42266. children: [{ label: '香洲区' }, { label: '斗门区' }, { label: '金湾区' }],
  42267. },
  42268. {
  42269. label: '汕头',
  42270. children: [
  42271. { label: '龙湖区' },
  42272. { label: '金平区' },
  42273. { label: '濠江区' },
  42274. { label: '潮阳区' },
  42275. { label: '潮南区' },
  42276. { label: '澄海区' },
  42277. ],
  42278. },
  42279. {
  42280. label: '佛山',
  42281. children: [{ label: '禅城区' }, { label: '南海区' }, { label: '顺德区' }, { label: '三水区' }, { label: '高明区' }],
  42282. },
  42283. ],
  42284. },
  42285. {
  42286. label: '四川',
  42287. children: [
  42288. {
  42289. label: '成都',
  42290. children: [
  42291. { label: '锦江区' },
  42292. { label: '青羊区' },
  42293. { label: '金牛区' },
  42294. { label: '武侯区' },
  42295. { label: '成华区' },
  42296. { label: '龙泉驿区' },
  42297. ],
  42298. },
  42299. {
  42300. label: '绵阳',
  42301. children: [
  42302. { label: '涪城区' },
  42303. { label: '游仙区' },
  42304. { label: '安州区' },
  42305. { label: '三台县' },
  42306. { label: '盐亭县' },
  42307. { label: '梓潼县' },
  42308. ],
  42309. },
  42310. {
  42311. label: '自贡',
  42312. children: [
  42313. { label: '自流井区' },
  42314. { label: '贡井区' },
  42315. { label: '大安区' },
  42316. { label: '沿滩区' },
  42317. { label: '荣县' },
  42318. { label: '富顺县' },
  42319. ],
  42320. },
  42321. {
  42322. label: '攀枝花',
  42323. children: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  42324. },
  42325. ],
  42326. },
  42327. {
  42328. label: '北京',
  42329. children: [
  42330. {
  42331. label: '北京市',
  42332. children: [
  42333. { label: '东城区' },
  42334. { label: '西城区' },
  42335. { label: '朝阳区' },
  42336. { label: '丰台区' },
  42337. { label: '石景山区' },
  42338. { label: '海淀区' },
  42339. ],
  42340. },
  42341. ],
  42342. },
  42343. {
  42344. label: '浙江',
  42345. children: [
  42346. {
  42347. label: '杭州',
  42348. children: [
  42349. { label: '上城区' },
  42350. { label: '下城区' },
  42351. { label: '江干区' },
  42352. { label: '拱墅区' },
  42353. { label: '西湖区' },
  42354. { label: '滨江区' },
  42355. ],
  42356. },
  42357. {
  42358. label: '宁波',
  42359. children: [
  42360. { label: '海曙区' },
  42361. { label: '江东区' },
  42362. { label: '江北区' },
  42363. { label: '北仑区' },
  42364. { label: '镇海区' },
  42365. { label: '鄞州区' },
  42366. ],
  42367. },
  42368. {
  42369. label: '温州',
  42370. children: [
  42371. { label: '鹿城区' },
  42372. { label: '龙湾区' },
  42373. { label: '瓯海区' },
  42374. { label: '洞头区' },
  42375. { label: '永嘉县' },
  42376. { label: '平阳县' },
  42377. ],
  42378. },
  42379. {
  42380. label: '嘉兴',
  42381. children: [
  42382. { label: '南湖区' },
  42383. { label: '秀洲区' },
  42384. { label: '嘉善县' },
  42385. { label: '海盐县' },
  42386. { label: '海宁市' },
  42387. { label: '平湖市' },
  42388. ],
  42389. },
  42390. {
  42391. label: '湖州',
  42392. children: [{ label: '吴兴区' }, { label: '南浔区' }, { label: '德清县' }, { label: '长兴县' }, { label: '安吉县' }],
  42393. },
  42394. ],
  42395. },
  42396. ];
  42397. const linkageDiffLabeData = [
  42398. {
  42399. province: '云南',
  42400. children: [
  42401. {
  42402. city: '昆明',
  42403. children: [
  42404. { region: '盘龙区' },
  42405. { region: '五华区' },
  42406. { region: '官渡区' },
  42407. { region: '西山区' },
  42408. { region: '东川区' },
  42409. { region: '呈贡区' },
  42410. { region: '晋宁区' },
  42411. { region: '富民县' },
  42412. { region: '宜良县' },
  42413. { region: '石林彝族自治县' },
  42414. { region: '嵩明县' },
  42415. { region: '禄劝彝族苗族自治县' },
  42416. { region: '寻甸回族彝族自治县' },
  42417. { region: '安宁市' },
  42418. ],
  42419. },
  42420. {
  42421. city: '曲靖',
  42422. children: [
  42423. { region: '麒麟区' },
  42424. { region: '沾益区' },
  42425. { region: '马龙县' },
  42426. { region: '陆良县' },
  42427. { region: '师宗县' },
  42428. { region: '罗平县' },
  42429. { region: '富源县' },
  42430. { region: '会泽县' },
  42431. { region: '宣威市' },
  42432. ],
  42433. },
  42434. {
  42435. city: '玉溪',
  42436. children: [
  42437. { region: '红塔区' },
  42438. { region: '江川区' },
  42439. { region: '澄江县' },
  42440. { region: '通海县' },
  42441. { region: '华宁县' },
  42442. { region: '易门县' },
  42443. { region: '峨山彝族自治县' },
  42444. { region: '新平彝族傣族自治县' },
  42445. { region: '元江哈尼族彝族傣族自治县' },
  42446. ],
  42447. },
  42448. {
  42449. city: '保山',
  42450. children: [
  42451. { region: '隆阳区' },
  42452. { region: '施甸县' },
  42453. { region: '龙陵县' },
  42454. { region: '昌宁县' },
  42455. { region: '腾冲市' },
  42456. { region: '龙陵县' },
  42457. ],
  42458. },
  42459. {
  42460. city: '丽江',
  42461. children: [
  42462. { region: '古城区' },
  42463. { region: '永胜县' },
  42464. { region: '华坪县' },
  42465. { region: '玉龙纳西族自治县' },
  42466. { region: '宁蒗彝族自治县' },
  42467. ],
  42468. },
  42469. {
  42470. city: '普洱',
  42471. children: [
  42472. { region: '思茅区' },
  42473. { region: '宁洱哈尼族彝族自治县' },
  42474. { region: '墨江哈尼族自治县' },
  42475. { region: '景东彝族自治县' },
  42476. { region: '景谷傣族彝族自治县' },
  42477. { region: '镇沅彝族哈尼族拉祜族自治县' },
  42478. { region: '江城哈尼族彝族自治县' },
  42479. { region: '孟连傣族拉祜族佤族自治县' },
  42480. { region: '澜沧拉祜族自治县' },
  42481. { region: '西盟佤族自治县' },
  42482. ],
  42483. },
  42484. ],
  42485. },
  42486. {
  42487. province: '广东',
  42488. children: [
  42489. {
  42490. city: '广州',
  42491. children: [
  42492. { region: '天河区' },
  42493. { region: '海珠区' },
  42494. { region: '荔湾区' },
  42495. { region: '越秀区' },
  42496. { region: '白云区' },
  42497. { region: '黄埔区' },
  42498. ],
  42499. },
  42500. {
  42501. city: '深圳',
  42502. children: [
  42503. { region: '罗湖区' },
  42504. { region: '福田区' },
  42505. { region: '南山区' },
  42506. { region: '宝安区' },
  42507. { region: '龙岗区' },
  42508. { region: '盐田区' },
  42509. ],
  42510. },
  42511. ],
  42512. },
  42513. ];
  42514. export { linkageData, linkageDiffLabeData }; -->
  42515. ================================================
  42516. FILE: packages/stdf/src/routes/asyncPicker/zh_CN/data.js
  42517. ================================================
  42518. const linkageData = [
  42519. {
  42520. label: '云南',
  42521. children: [
  42522. {
  42523. label: '昆明',
  42524. children: [
  42525. { label: '盘龙区' },
  42526. { label: '五华区' },
  42527. { label: '官渡区' },
  42528. { label: '西山区' },
  42529. { label: '东川区' },
  42530. { label: '呈贡区' },
  42531. { label: '晋宁区' },
  42532. { label: '富民县' },
  42533. { label: '宜良县' },
  42534. { label: '石林彝族自治县' },
  42535. { label: '嵩明县' },
  42536. { label: '禄劝彝族苗族自治县' },
  42537. { label: '寻甸回族彝族自治县' },
  42538. { label: '安宁市' },
  42539. ],
  42540. },
  42541. {
  42542. label: '曲靖',
  42543. children: [
  42544. { label: '麒麟区' },
  42545. { label: '沾益区' },
  42546. { label: '马龙县' },
  42547. { label: '陆良县' },
  42548. { label: '师宗县' },
  42549. { label: '罗平县' },
  42550. { label: '富源县' },
  42551. { label: '会泽县' },
  42552. { label: '宣威市' },
  42553. ],
  42554. },
  42555. {
  42556. label: '玉溪',
  42557. children: [
  42558. { label: '红塔区' },
  42559. { label: '江川区' },
  42560. { label: '澄江县' },
  42561. { label: '通海县' },
  42562. { label: '华宁县' },
  42563. { label: '易门县' },
  42564. { label: '峨山彝族自治县' },
  42565. { label: '新平彝族傣族自治县' },
  42566. { label: '元江哈尼族彝族傣族自治县' },
  42567. ],
  42568. },
  42569. {
  42570. label: '保山',
  42571. children: [
  42572. { label: '隆阳区' },
  42573. { label: '施甸县' },
  42574. { label: '龙陵县' },
  42575. { label: '昌宁县' },
  42576. { label: '腾冲市' },
  42577. { label: '龙陵县' },
  42578. ],
  42579. },
  42580. {
  42581. label: '丽江',
  42582. children: [
  42583. { label: '古城区' },
  42584. { label: '永胜县' },
  42585. { label: '华坪县' },
  42586. { label: '玉龙纳西族自治县' },
  42587. { label: '宁蒗彝族自治县' },
  42588. ],
  42589. },
  42590. {
  42591. label: '普洱',
  42592. children: [
  42593. { label: '思茅区' },
  42594. { label: '宁洱哈尼族彝族自治县' },
  42595. { label: '墨江哈尼族自治县' },
  42596. { label: '景东彝族自治县' },
  42597. { label: '景谷傣族彝族自治县' },
  42598. { label: '镇沅彝族哈尼族拉祜族自治县' },
  42599. { label: '江城哈尼族彝族自治县' },
  42600. { label: '孟连傣族拉祜族佤族自治县' },
  42601. { label: '澜沧拉祜族自治县' },
  42602. { label: '西盟佤族自治县' },
  42603. ],
  42604. },
  42605. {
  42606. label: '临沧',
  42607. children: [
  42608. { label: '临翔区' },
  42609. { label: '凤庆县' },
  42610. { label: '云县' },
  42611. { label: '永德县' },
  42612. { label: '镇康县' },
  42613. { label: '双江拉祜族佤族布朗族傣族自治县' },
  42614. { label: '耿马傣族佤族自治县' },
  42615. { label: '沧源佤族自治县' },
  42616. ],
  42617. },
  42618. {
  42619. label: '楚雄',
  42620. children: [
  42621. { label: '楚雄市' },
  42622. { label: '双柏县' },
  42623. { label: '牟定县' },
  42624. { label: '南华县' },
  42625. { label: '姚安县' },
  42626. { label: '大姚县' },
  42627. { label: '永仁县' },
  42628. { label: '元谋县' },
  42629. { label: '武定县' },
  42630. { label: '禄丰县' },
  42631. ],
  42632. },
  42633. {
  42634. label: '红河',
  42635. children: [
  42636. { label: '个旧市' },
  42637. { label: '开远市' },
  42638. { label: '蒙自市' },
  42639. { label: '弥勒市' },
  42640. { label: '屏边苗族自治县' },
  42641. { label: '建水县' },
  42642. { label: '石屏县' },
  42643. { label: '泸西县' },
  42644. { label: '元阳县' },
  42645. { label: '红河县' },
  42646. { label: '金平苗族瑶族傣族自治县' },
  42647. { label: '绿春县' },
  42648. { label: '河口瑶族自治县' },
  42649. ],
  42650. },
  42651. {
  42652. label: '文山',
  42653. children: [
  42654. { label: '文山市' },
  42655. { label: '砚山县' },
  42656. { label: '西畴县' },
  42657. { label: '麻栗坡县' },
  42658. { label: '马关县' },
  42659. { label: '丘北县' },
  42660. { label: '广南县' },
  42661. { label: '富宁县' },
  42662. ],
  42663. },
  42664. ],
  42665. },
  42666. {
  42667. label: '广东',
  42668. children: [
  42669. {
  42670. label: '广州',
  42671. children: [
  42672. { label: '天河区' },
  42673. { label: '海珠区' },
  42674. { label: '荔湾区' },
  42675. { label: '越秀区' },
  42676. { label: '白云区' },
  42677. { label: '黄埔区' },
  42678. ],
  42679. },
  42680. {
  42681. label: '深圳',
  42682. children: [
  42683. { label: '罗湖区' },
  42684. { label: '福田区' },
  42685. { label: '南山区' },
  42686. { label: '宝安区' },
  42687. { label: '龙岗区' },
  42688. { label: '盐田区' },
  42689. ],
  42690. },
  42691. {
  42692. label: '珠海',
  42693. children: [{ label: '香洲区' }, { label: '斗门区' }, { label: '金湾区' }],
  42694. },
  42695. {
  42696. label: '汕头',
  42697. children: [
  42698. { label: '龙湖区' },
  42699. { label: '金平区' },
  42700. { label: '濠江区' },
  42701. { label: '潮阳区' },
  42702. { label: '潮南区' },
  42703. { label: '澄海区' },
  42704. ],
  42705. },
  42706. {
  42707. label: '佛山',
  42708. children: [{ label: '禅城区' }, { label: '南海区' }, { label: '顺德区' }, { label: '三水区' }, { label: '高明区' }],
  42709. },
  42710. ],
  42711. },
  42712. {
  42713. label: '四川',
  42714. children: [
  42715. {
  42716. label: '成都',
  42717. children: [
  42718. { label: '锦江区' },
  42719. { label: '青羊区' },
  42720. { label: '金牛区' },
  42721. { label: '武侯区' },
  42722. { label: '成华区' },
  42723. { label: '龙泉驿区' },
  42724. ],
  42725. },
  42726. {
  42727. label: '绵阳',
  42728. children: [
  42729. { label: '涪城区' },
  42730. { label: '游仙区' },
  42731. { label: '安州区' },
  42732. { label: '三台县' },
  42733. { label: '盐亭县' },
  42734. { label: '梓潼县' },
  42735. ],
  42736. },
  42737. {
  42738. label: '自贡',
  42739. children: [
  42740. { label: '自流井区' },
  42741. { label: '贡井区' },
  42742. { label: '大安区' },
  42743. { label: '沿滩区' },
  42744. { label: '荣县' },
  42745. { label: '富顺县' },
  42746. ],
  42747. },
  42748. {
  42749. label: '攀枝花',
  42750. children: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  42751. },
  42752. ],
  42753. },
  42754. {
  42755. label: '北京',
  42756. children: [
  42757. {
  42758. label: '北京市',
  42759. children: [
  42760. { label: '东城区' },
  42761. { label: '西城区' },
  42762. { label: '朝阳区' },
  42763. { label: '丰台区' },
  42764. { label: '石景山区' },
  42765. { label: '海淀区' },
  42766. ],
  42767. },
  42768. ],
  42769. },
  42770. {
  42771. label: '浙江',
  42772. children: [
  42773. {
  42774. label: '杭州',
  42775. children: [
  42776. { label: '上城区' },
  42777. { label: '下城区' },
  42778. { label: '江干区' },
  42779. { label: '拱墅区' },
  42780. { label: '西湖区' },
  42781. { label: '滨江区' },
  42782. ],
  42783. },
  42784. {
  42785. label: '宁波',
  42786. children: [
  42787. { label: '海曙区' },
  42788. { label: '江东区' },
  42789. { label: '江北区' },
  42790. { label: '北仑区' },
  42791. { label: '镇海区' },
  42792. { label: '鄞州区' },
  42793. ],
  42794. },
  42795. {
  42796. label: '温州',
  42797. children: [
  42798. { label: '鹿城区' },
  42799. { label: '龙湾区' },
  42800. { label: '瓯海区' },
  42801. { label: '洞头区' },
  42802. { label: '永嘉县' },
  42803. { label: '平阳县' },
  42804. ],
  42805. },
  42806. {
  42807. label: '嘉兴',
  42808. children: [
  42809. { label: '南湖区' },
  42810. { label: '秀洲区' },
  42811. { label: '嘉善县' },
  42812. { label: '海盐县' },
  42813. { label: '海宁市' },
  42814. { label: '平湖市' },
  42815. ],
  42816. },
  42817. {
  42818. label: '湖州',
  42819. children: [{ label: '吴兴区' }, { label: '南浔区' }, { label: '德清县' }, { label: '长兴县' }, { label: '安吉县' }],
  42820. },
  42821. ],
  42822. },
  42823. ];
  42824. const linkageDiffLabeData = [
  42825. {
  42826. province: '云南',
  42827. children: [
  42828. {
  42829. city: '昆明',
  42830. children: [
  42831. { region: '盘龙区' },
  42832. { region: '五华区' },
  42833. { region: '官渡区' },
  42834. { region: '西山区' },
  42835. { region: '东川区' },
  42836. { region: '呈贡区' },
  42837. { region: '晋宁区' },
  42838. { region: '富民县' },
  42839. { region: '宜良县' },
  42840. { region: '石林彝族自治县' },
  42841. { region: '嵩明县' },
  42842. { region: '禄劝彝族苗族自治县' },
  42843. { region: '寻甸回族彝族自治县' },
  42844. { region: '安宁市' },
  42845. ],
  42846. },
  42847. {
  42848. city: '曲靖',
  42849. children: [
  42850. { region: '麒麟区' },
  42851. { region: '沾益区' },
  42852. { region: '马龙县' },
  42853. { region: '陆良县' },
  42854. { region: '师宗县' },
  42855. { region: '罗平县' },
  42856. { region: '富源县' },
  42857. { region: '会泽县' },
  42858. { region: '宣威市' },
  42859. ],
  42860. },
  42861. {
  42862. city: '玉溪',
  42863. children: [
  42864. { region: '红塔区' },
  42865. { region: '江川区' },
  42866. { region: '澄江县' },
  42867. { region: '通海县' },
  42868. { region: '华宁县' },
  42869. { region: '易门县' },
  42870. { region: '峨山彝族自治县' },
  42871. { region: '新平彝族傣族自治县' },
  42872. { region: '元江哈尼族彝族傣族自治县' },
  42873. ],
  42874. },
  42875. {
  42876. city: '保山',
  42877. children: [
  42878. { region: '隆阳区' },
  42879. { region: '施甸县' },
  42880. { region: '龙陵县' },
  42881. { region: '昌宁县' },
  42882. { region: '腾冲市' },
  42883. { region: '龙陵县' },
  42884. ],
  42885. },
  42886. {
  42887. city: '丽江',
  42888. children: [
  42889. { region: '古城区' },
  42890. { region: '永胜县' },
  42891. { region: '华坪县' },
  42892. { region: '玉龙纳西族自治县' },
  42893. { region: '宁蒗彝族自治县' },
  42894. ],
  42895. },
  42896. {
  42897. city: '普洱',
  42898. children: [
  42899. { region: '思茅区' },
  42900. { region: '宁洱哈尼族彝族自治县' },
  42901. { region: '墨江哈尼族自治县' },
  42902. { region: '景东彝族自治县' },
  42903. { region: '景谷傣族彝族自治县' },
  42904. { region: '镇沅彝族哈尼族拉祜族自治县' },
  42905. { region: '江城哈尼族彝族自治县' },
  42906. { region: '孟连傣族拉祜族佤族自治县' },
  42907. { region: '澜沧拉祜族自治县' },
  42908. { region: '西盟佤族自治县' },
  42909. ],
  42910. },
  42911. ],
  42912. },
  42913. {
  42914. province: '广东',
  42915. children: [
  42916. {
  42917. city: '广州',
  42918. children: [
  42919. { region: '天河区' },
  42920. { region: '海珠区' },
  42921. { region: '荔湾区' },
  42922. { region: '越秀区' },
  42923. { region: '白云区' },
  42924. { region: '黄埔区' },
  42925. ],
  42926. },
  42927. {
  42928. city: '深圳',
  42929. children: [
  42930. { region: '罗湖区' },
  42931. { region: '福田区' },
  42932. { region: '南山区' },
  42933. { region: '宝安区' },
  42934. { region: '龙岗区' },
  42935. { region: '盐田区' },
  42936. ],
  42937. },
  42938. ],
  42939. },
  42940. ];
  42941. export { linkageData, linkageDiffLabeData };
  42942. ================================================
  42943. FILE: packages/stdf/src/routes/avatar/en_US/+page.svelte
  42944. ================================================
  42945. <!-- Avatar Demo -->
  42946. <script lang="ts">
  42947. import { Avatar, Avatars, Divider, Icon } from '$lib/index.js';
  42948. const icons = [
  42949. { name: 'ri-aliens-fill', theme: true, top: -1, size: 16 },
  42950. { name: 'ri-user-smile-line', top: -1 },
  42951. { name: 'ri-shield-user-line', theme: true, top: 0, size: 32 },
  42952. { name: 'ri-emotion-line', theme: true, top: -1, size: 46 }
  42953. ];
  42954. const imgNames = [
  42955. 'dota_火女.png',
  42956. 'dota_火枪.png',
  42957. 'dota_小牛.png',
  42958. 'wall_1.jpg',
  42959. 'dota_斯温.png',
  42960. 'dota_水人.png',
  42961. 'wall_2.jpg',
  42962. 'wall_3.jpg',
  42963. 'wall_4.jpg',
  42964. 'avatar_1.jpg',
  42965. 'dota_火枪.png',
  42966. 'dota_小牛.png',
  42967. 'dota_斯温.png'
  42968. ];
  42969. const data = imgNames.map((name) => ({ image: `/assets/images/${name}` }));
  42970. </script>
  42971. <div class="px-4 py-8">
  42972. <div class="font-bold">Different rounded corners</div>
  42973. <div class="mb-8 mt-4 flex justify-between">
  42974. <Avatar radius="none" />
  42975. <Avatar />
  42976. <Avatar radius="xl" />
  42977. <Avatar radius="2xl" />
  42978. <Avatar radius="full" />
  42979. </div>
  42980. <div class="font-bold">Different picture types and size</div>
  42981. <div class="mb-8 mt-4 flex justify-between">
  42982. <Avatar image="/assets/images/avatar_2.png" imgSize="s" />
  42983. <Avatar image="/assets/images/avatar_2.png" imgSize="m" />
  42984. <Avatar image="/assets/images/avatar_2.png" />
  42985. <Avatar image="/assets/images/avatar_1.jpg" />
  42986. </div>
  42987. <div class="font-bold">Custom background color</div>
  42988. <div class="mb-8 mt-4 flex justify-between">
  42989. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-success" />
  42990. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-[#D65786]" />
  42991. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white" />
  42992. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-[rgba(0,0,0,0)]" />
  42993. </div>
  42994. <div class="font-bold">Different border</div>
  42995. <div class="mb-8 mt-4 flex justify-between">
  42996. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="solid" />
  42997. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="dashed" />
  42998. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="dotted" />
  42999. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="solid" injClass="border-[red] dark:border-extend1" />
  43000. </div>
  43001. <div class="font-bold">Replace text</div>
  43002. <div class="mb-8 mt-4 flex justify-between">
  43003. <Avatar alt="A" altSize="xs" />
  43004. <Avatar alt="A" altSize="sm" />
  43005. <Avatar alt="A" />
  43006. <Avatar alt="A" altSize="lg" />
  43007. </div>
  43008. <div class="font-bold">Replace Icon</div>
  43009. <div class="mb-8 mt-4 flex justify-between">
  43010. {#each icons as icon}
  43011. <Avatar {icon} />
  43012. {/each}
  43013. </div>
  43014. <div class="font-bold">Different size</div>
  43015. <div class="flex justify-between">
  43016. <div class="mb-8 mt-4 flex flex-col items-center space-y-4">
  43017. <Avatar size="xs" icon={{ name: 'ri-bear-smile-line', size: 16, theme: true }} />
  43018. <Avatar size="sm" image="/assets/images/avatar_1.jpg" />
  43019. <Avatar line="solid" />
  43020. <Avatar size="lg" image="/assets/images/avatar_2.png" imgSize="m" />
  43021. <Avatar size="xl" alt="A" altSize="xl" />
  43022. </div>
  43023. <div class="mb-8 mt-4 flex flex-col items-center space-y-4">
  43024. <Avatar radius="full" size="xs" icon={{ name: 'ri-bear-smile-line', size: 16, theme: true }} />
  43025. <Avatar radius="full" size="sm" image="/assets/images/avatar_1.jpg" />
  43026. <Avatar radius="full" line="solid" />
  43027. <Avatar radius="full" size="lg" image="/assets/images/avatar_2.png" imgSize="m" />
  43028. <Avatar radius="full" size="xl" alt="A" altSize="xl" />
  43029. </div>
  43030. </div>
  43031. <Divider />
  43032. <div class="my-4 text-2xl font-bold">Avatar group</div>
  43033. <div class="mb-2 mt-6 font-bold">Default</div>
  43034. <Avatars {data} />
  43035. <div class="mb-2 mt-6 font-bold">smaller</div>
  43036. <Avatars {data} size="sm" lineWidth="1" />
  43037. <div class="mb-2 mt-6 font-bold">loose</div>
  43038. <Avatars {data} compact={4} />
  43039. <div class="mb-2 mt-6 font-bold">Border thick point</div>
  43040. <Avatars {data} lineWidth="8" />
  43041. <div class="mb-2 mt-6 font-bold">Make the corners smaller</div>
  43042. <Avatars {data} radius="2xl" />
  43043. <div class="mb-2 mt-6 font-bold">Reverse</div>
  43044. <Avatars {data} reverse />
  43045. <div class="mb-2 mt-6 font-bold">A maximum of 6 are displayed</div>
  43046. <Avatars {data} max={6} />
  43047. <div class="mb-2 mt-6 font-bold">Top layer display increase</div>
  43048. <Avatars {data} top="add" />
  43049. <div class="mb-2 mt-6 font-bold">Do not show top layer</div>
  43050. <Avatars {data} top={null} />
  43051. <div class="mb-2 mt-6 font-bold">Custom top layer</div>
  43052. <Avatars {data}>
  43053. {#snippet top()}
  43054. <button class="relative flex h-12 w-12 justify-center overflow-hidden rounded-full bg-primary-200 dark:bg-dark-200">
  43055. <div class="flex h-full w-full items-center justify-center text-primary-950 dark:text-dark-950">
  43056. <Icon name="ri-svelte-line" />
  43057. </div>
  43058. </button>
  43059. {/snippet}
  43060. </Avatars>
  43061. </div>
  43062. ================================================
  43063. FILE: packages/stdf/src/routes/avatar/zh_CN/+page.svelte
  43064. ================================================
  43065. <!-- Avatar Demo -->
  43066. <script lang="ts">
  43067. import { Avatar, Avatars, Divider, Icon } from '$lib/index.js';
  43068. const icons = [
  43069. { name: 'ri-aliens-fill', theme: true, top: -1, size: 16 },
  43070. { name: 'ri-user-smile-line', top: -1 },
  43071. { name: 'ri-shield-user-line', theme: true, top: 0, size: 32 },
  43072. { name: 'ri-emotion-line', theme: true, top: -1, size: 46 }
  43073. ];
  43074. const imgNames = [
  43075. 'dota_火女.png',
  43076. 'dota_火枪.png',
  43077. 'dota_小牛.png',
  43078. 'wall_1.jpg',
  43079. 'dota_斯温.png',
  43080. 'dota_水人.png',
  43081. 'wall_2.jpg',
  43082. 'wall_3.jpg',
  43083. 'wall_4.jpg',
  43084. 'avatar_1.jpg',
  43085. 'dota_火枪.png',
  43086. 'dota_小牛.png',
  43087. 'dota_斯温.png'
  43088. ];
  43089. const data = imgNames.map((name) => ({ image: `/assets/images/${name}` }));
  43090. </script>
  43091. <div class="px-4 py-8">
  43092. <div class="font-bold">不同圆角</div>
  43093. <div class="mb-8 mt-4 flex justify-between">
  43094. <Avatar radius="none" />
  43095. <Avatar />
  43096. <Avatar radius="xl" />
  43097. <Avatar radius="2xl" />
  43098. <Avatar radius="full" />
  43099. </div>
  43100. <div class="font-bold">不同图片类型与大小</div>
  43101. <div class="mb-8 mt-4 flex justify-between">
  43102. <Avatar image="/assets/images/avatar_2.png" imgSize="s" />
  43103. <Avatar image="/assets/images/avatar_2.png" imgSize="m" />
  43104. <Avatar image="/assets/images/avatar_2.png" />
  43105. <Avatar image="/assets/images/avatar_1.jpg" />
  43106. </div>
  43107. <div class="font-bold">自定义背景色</div>
  43108. <div class="mb-8 mt-4 flex justify-between">
  43109. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-success" />
  43110. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-[#D65786]" />
  43111. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white" />
  43112. <Avatar image="/assets/images/avatar_2.png" imgSize="m" injClass="!bg-[rgba(0,0,0,0)]" />
  43113. </div>
  43114. <div class="font-bold">不同边框</div>
  43115. <div class="mb-8 mt-4 flex justify-between">
  43116. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="solid" />
  43117. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="dashed" />
  43118. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="dotted" />
  43119. <Avatar image="/assets/images/avatar_2.png" imgSize="m" line="solid" injClass="border-[red] dark:border-extend1" />
  43120. </div>
  43121. <div class="font-bold">替换文本</div>
  43122. <div class="mb-8 mt-4 flex justify-between">
  43123. <Avatar alt="张" altSize="xs" />
  43124. <Avatar alt="张" altSize="sm" />
  43125. <Avatar alt="张" />
  43126. <Avatar alt="张" altSize="lg" />
  43127. </div>
  43128. <div class="font-bold">替换 Icon</div>
  43129. <div class="mb-8 mt-4 flex justify-between">
  43130. {#each icons as icon}
  43131. <Avatar {icon} />
  43132. {/each}
  43133. </div>
  43134. <div class="font-bold">不同大小</div>
  43135. <div class="flex justify-between">
  43136. <div class="mb-8 mt-4 flex flex-col items-center space-y-4">
  43137. <Avatar size="xs" icon={{ name: 'ri-bear-smile-line', theme: true }} />
  43138. <Avatar size="sm" image="/assets/images/avatar_1.jpg" />
  43139. <Avatar line="solid" />
  43140. <Avatar size="lg" image="/assets/images/avatar_2.png" imgSize="m" />
  43141. <Avatar size="xl" alt="张" altSize="xl" />
  43142. </div>
  43143. <div class="mb-8 mt-4 flex flex-col items-center space-y-4">
  43144. <Avatar radius="full" size="xs" icon={{ name: 'ri-bear-smile-line', theme: true }} />
  43145. <Avatar radius="full" size="sm" image="/assets/images/avatar_1.jpg" />
  43146. <Avatar radius="full" line="solid" />
  43147. <Avatar radius="full" size="lg" image="/assets/images/avatar_2.png" imgSize="m" />
  43148. <Avatar radius="full" size="xl" alt="张" altSize="xl" />
  43149. </div>
  43150. </div>
  43151. <Divider />
  43152. <div class="my-4 text-2xl font-bold">头像组</div>
  43153. <div class="mb-2 mt-6 font-bold">默认</div>
  43154. <Avatars {data} />
  43155. <div class="mb-2 mt-6 font-bold">小点</div>
  43156. <Avatars {data} size="sm" lineWidth="1" />
  43157. <div class="mb-2 mt-6 font-bold">宽松一点</div>
  43158. <Avatars {data} compact={4} />
  43159. <div class="mb-2 mt-6 font-bold">边框粗点</div>
  43160. <Avatars {data} lineWidth="8" />
  43161. <div class="mb-2 mt-6 font-bold">圆角小点</div>
  43162. <Avatars {data} radius="2xl" />
  43163. <div class="mb-2 mt-6 font-bold">反向</div>
  43164. <Avatars {data} reverse />
  43165. <div class="mb-2 mt-6 font-bold">最多显示 6 个</div>
  43166. <Avatars {data} max={6} />
  43167. <div class="mb-2 mt-6 font-bold">顶层显示增加</div>
  43168. <Avatars {data} top="add" />
  43169. <div class="mb-2 mt-6 font-bold">不显示顶层</div>
  43170. <Avatars {data} top={null} />
  43171. <div class="mb-2 mt-6 font-bold">自定义顶层</div>
  43172. <Avatars {data}>
  43173. {#snippet top()}
  43174. <button class="relative flex h-12 w-12 justify-center overflow-hidden rounded-full bg-primary-200 dark:bg-dark-200">
  43175. <div class="flex h-full w-full items-center justify-center text-primary-950 dark:text-dark-950">
  43176. <Icon name="ri-svelte-line" />
  43177. </div>
  43178. </button>
  43179. {/snippet}
  43180. </Avatars>
  43181. </div>
  43182. ================================================
  43183. FILE: packages/stdf/src/routes/badge/en_US/+page.svelte
  43184. ================================================
  43185. <!-- Badge Demo -->
  43186. <script lang="ts">
  43187. import { Badge, Avatar, Button, Icon, Input, Cell } from '$lib/index.js';
  43188. let isShow = true;
  43189. </script>
  43190. <div class="pb-4 pt-1">
  43191. <div class="mx-4 mt-8 text-lg font-bold">Basic usage</div>
  43192. <div class="flex justify-around p-4">
  43193. <Badge><Avatar /></Badge>
  43194. <Badge text="24"><Avatar /></Badge>
  43195. <Badge text="99+"><Avatar /></Badge>
  43196. <Badge text="New"><Avatar /></Badge>
  43197. </div>
  43198. <div class="mx-4 mt-8 text-lg font-bold">Different rounded corners</div>
  43199. <div class="flex justify-around p-4">
  43200. <Badge radius="sm"><Avatar /></Badge>
  43201. <Badge text="24" radius="none"><Avatar /></Badge>
  43202. <Badge text="24" radius="sm"><Avatar /></Badge>
  43203. <Badge text="Hot" radius="leaf"><Avatar /></Badge>
  43204. </div>
  43205. <div class="mx-4 mt-8 text-lg font-bold">Located on the left</div>
  43206. <div class="flex justify-around p-4">
  43207. <Badge isLeft><Avatar /></Badge>
  43208. <Badge isLeft text="24"><Avatar /></Badge>
  43209. <Badge isLeft text="24" radius="leaf"><Avatar /></Badge>
  43210. <Badge isLeft text="sharp"><Avatar /></Badge>
  43211. </div>
  43212. <div class="mx-4 mt-8 text-lg font-bold">Match other components</div>
  43213. <div class="flex justify-around p-4">
  43214. <Badge text="Cool" radius="leaf" offsetX={-6}><Icon name="ri-spy-fill" /></Badge>
  43215. <Badge text="Great" radius="leaf" offsetX={-10}><Icon name="ri-medal-fill" /></Badge>
  43216. <Badge text="Happy" radius="leaf" offsetX={-12}><Icon name="ri-cake-2-fill" /></Badge>
  43217. </div>
  43218. <Badge text="Hot" offsetX={18} offsetY={8}><Button>Match Button</Button></Badge>
  43219. <Badge text="Required" offsetX={30} offsetY={26}><Input title="Match Input" /></Badge>
  43220. <Cell title="Match Cell">
  43221. {#snippet detailChild()}
  43222. <Badge isInner />
  43223. {/snippet}
  43224. </Cell>
  43225. <Cell title="Match Cell" line={false}>
  43226. {#snippet detailChild()}
  43227. <Badge text="99+" isInner />
  43228. {/snippet}
  43229. </Cell>
  43230. <Cell title="Match no radius corner Cell" radius="none">
  43231. {#snippet detailChild()}
  43232. <Badge text="new version" radius="sm" isInner />
  43233. {/snippet}
  43234. </Cell>
  43235. <Cell title="Match full radius Cell" radius="full">
  43236. {#snippet detailChild()}
  43237. <Badge isInner />
  43238. {/snippet}
  43239. </Cell>
  43240. <div class="mx-4 mt-8 text-lg font-bold">Badge animation</div>
  43241. <div class="flex justify-around p-4">
  43242. <Badge {isShow}><Avatar /></Badge>
  43243. <Badge text="24" {isShow}><Avatar /></Badge>
  43244. <Badge text="24" radius="sm" {isShow}><Avatar /></Badge>
  43245. <Badge text="Hot" radius="leaf" {isShow}><Avatar /></Badge>
  43246. </div>
  43247. <Cell title={!isShow ? 'Hidden' : 'Show'}>
  43248. {#snippet detailChild()}
  43249. <Badge isInner {isShow} />
  43250. {/snippet}
  43251. </Cell>
  43252. <Button onclick={() => (isShow = !isShow)}>Click {isShow ? 'Hidden' : 'Show'} Badge</Button>
  43253. <div class="mx-4 mt-8 text-lg font-bold">Custom background color and border</div>
  43254. <div class="flex justify-around p-4">
  43255. <Badge text="Theme" injClass="!bg-primary dark:!bg-dark text-white dark:text-black"><Avatar /></Badge>
  43256. <Badge text="New" injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]"><Avatar /></Badge>
  43257. <Badge radius="sm" injClass="ring-2 ring-[#ebeef2] dark:ring-[#414248]"><Avatar image="/assets/images/avatar_1.jpg" /></Badge>
  43258. <Badge offsetX={9} offsetY={9} injClass="ring-2 ring-[#ebeef2] dark:ring-[#414248]">
  43259. <Avatar radius="full" image="/assets/images/avatar_1.jpg" />
  43260. </Badge>
  43261. </div>
  43262. </div>
  43263. ================================================
  43264. FILE: packages/stdf/src/routes/badge/zh_CN/+page.svelte
  43265. ================================================
  43266. <!-- Badge Demo -->
  43267. <script lang="ts">
  43268. import { Badge, Avatar, Button, Icon, Input, Cell } from '$lib/index.js';
  43269. let isShow = $state(true);
  43270. </script>
  43271. <div class="pb-4 pt-1">
  43272. <div class="mx-4 mt-8 text-lg font-bold">基础用法</div>
  43273. <div class="flex justify-around p-4">
  43274. <Badge><Avatar /></Badge>
  43275. <Badge text="24"><Avatar /></Badge>
  43276. <Badge text="99+"><Avatar /></Badge>
  43277. <Badge text="New"><Avatar /></Badge>
  43278. </div>
  43279. <div class="mx-4 mt-8 text-lg font-bold">不同圆角</div>
  43280. <div class="flex justify-around p-4">
  43281. <Badge radius="sm"><Avatar /></Badge>
  43282. <Badge text="24" radius="none"><Avatar /></Badge>
  43283. <Badge text="24" radius="sm"><Avatar /></Badge>
  43284. <Badge text="Hot" radius="leaf"><Avatar /></Badge>
  43285. </div>
  43286. <div class="mx-4 mt-8 text-lg font-bold">位于左侧</div>
  43287. <div class="flex justify-around p-4">
  43288. <Badge isLeft><Avatar /></Badge>
  43289. <Badge isLeft text="24"><Avatar /></Badge>
  43290. <Badge isLeft text="24" radius="leaf"><Avatar /></Badge>
  43291. <Badge isLeft text="厉害"><Avatar /></Badge>
  43292. </div>
  43293. <div class="mx-4 mt-8 text-lg font-bold">搭配其他组件</div>
  43294. <div class="flex justify-around p-4">
  43295. <Badge text="帅" radius="leaf"><Icon name="ri-spy-fill" /></Badge>
  43296. <Badge text="棒" radius="leaf"><Icon name="ri-medal-fill" /></Badge>
  43297. <Badge text="Happy" radius="leaf" offsetX={-12}><Icon name="ri-cake-2-fill" /></Badge>
  43298. </div>
  43299. <Badge text="Hot" offsetX={18} offsetY={8}><Button>搭配 Button</Button></Badge>
  43300. <Badge text="必填" offsetX={18} offsetY={26}><Input title="搭配 Input" /></Badge>
  43301. <Cell title="搭配 Cell">
  43302. {#snippet detailChild()}
  43303. <Badge isInner />
  43304. {/snippet}
  43305. </Cell>
  43306. <Cell title="搭配 Cell" line={false}>
  43307. {#snippet detailChild()}
  43308. <Badge text="99+" isInner />
  43309. {/snippet}
  43310. </Cell>
  43311. <Cell title="搭配无圆角 Cell" radius="none">
  43312. {#snippet detailChild()}
  43313. <Badge text="新版本" radius="sm" isInner />
  43314. {/snippet}
  43315. </Cell>
  43316. <Cell title="搭配全圆角 Cell" radius="full">
  43317. {#snippet detailChild()}
  43318. <Badge isInner />
  43319. {/snippet}
  43320. </Cell>
  43321. <div class="mx-4 mt-8 text-lg font-bold">徽标动画</div>
  43322. <div class="flex justify-around p-4">
  43323. <Badge {isShow}><Avatar /></Badge>
  43324. <Badge text="24" {isShow}><Avatar /></Badge>
  43325. <Badge text="24" radius="sm" {isShow}><Avatar /></Badge>
  43326. <Badge text="Hot" radius="leaf" {isShow}><Avatar /></Badge>
  43327. </div>
  43328. <Cell title={!isShow ? '隐藏' : '显示'}>
  43329. {#snippet detailChild()}
  43330. <Badge isInner {isShow} />
  43331. {/snippet}
  43332. </Cell>
  43333. <Button onclick={() => (isShow = !isShow)}>点击{isShow ? '隐藏' : '显示'}徽标</Button>
  43334. <div class="mx-4 mt-8 text-lg font-bold">自定义背景色与边框</div>
  43335. <div class="flex justify-around p-4">
  43336. <Badge text="Theme" injClass="!bg-primary dark:!bg-dark text-white dark:text-black"><Avatar /></Badge>
  43337. <Badge text="New" injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]"><Avatar /></Badge>
  43338. <Badge radius="sm" injClass="ring-2 ring-[#ebeef2] dark:ring-[#414248]"><Avatar image="/assets/images/avatar_1.jpg" /></Badge>
  43339. <Badge offsetX={9} offsetY={9} injClass="ring-2 ring-[#ebeef2] dark:ring-[#414248]">
  43340. <Avatar radius="full" image="/assets/images/avatar_1.jpg" />
  43341. </Badge>
  43342. </div>
  43343. </div>
  43344. ================================================
  43345. FILE: packages/stdf/src/routes/bottomSheet/en_US/+page.svelte
  43346. ================================================
  43347. <!-- BottomSheet Demo -->
  43348. <script lang="ts">
  43349. import { BottomSheet, Cell, Toast, Button } from '$lib/index.js';
  43350. import Aphorism from '../../components/Aphorism.svelte';
  43351. let visible1 = $state(false);
  43352. let visible2 = $state(false);
  43353. let visible3 = $state(false);
  43354. let visible4 = $state(false);
  43355. let visible5 = $state(false);
  43356. let visible6 = $state(false);
  43357. let visible7 = $state(false);
  43358. let visible8 = $state(false);
  43359. let visible9 = $state(false);
  43360. let visible10 = $state(false);
  43361. let visible11 = $state(false);
  43362. let visible12 = $state(false);
  43363. let visible13 = $state(false);
  43364. let visible14 = $state(false);
  43365. let toastBackVisible = $state(false);
  43366. let toastCloseVisible = $state(false);
  43367. const stayHeightList = [40, 60, 80];
  43368. let currentHeight = $state(60);
  43369. const heightChangeFunc = (height: number) => (currentHeight = height);
  43370. </script>
  43371. <div class="py-4">
  43372. <Cell title="Basic Usage" onclick={() => (visible1 = true)} />
  43373. <BottomSheet bind:visible={visible1} title="This area supports sliding">
  43374. <div class="flex h-full flex-col justify-center text-center">
  43375. <div>This is the content area</div>
  43376. </div>
  43377. </BottomSheet>
  43378. <Cell title="Content area scrolling" onclick={() => (visible8 = true)} />
  43379. <BottomSheet bind:visible={visible8}>
  43380. <Aphorism num={12} />
  43381. </BottomSheet>
  43382. <Cell title="With back button" onclick={() => (visible2 = true)} />
  43383. <BottomSheet
  43384. bind:visible={visible2}
  43385. showBackIcon
  43386. title="Click back and close to trigger events"
  43387. onback={() => (toastBackVisible = true)}
  43388. onclose={() => (toastCloseVisible = true)}
  43389. >
  43390. <Aphorism num={12} />
  43391. </BottomSheet>
  43392. <Toast bind:visible={toastBackVisible} message="Triggered BottomSheet return event!" />
  43393. <Toast bind:visible={toastCloseVisible} message="Triggered BottomSheet close event!" />
  43394. <Cell title="Initial height is 90" onclick={() => (visible3 = true)} />
  43395. <BottomSheet bind:visible={visible3} stayHeightIndex={2}>
  43396. <Aphorism num={12} />
  43397. </BottomSheet>
  43398. <Cell title="Fixed height is 40/60/80" onclick={() => (visible4 = true)} />
  43399. <BottomSheet
  43400. bind:visible={visible4}
  43401. {stayHeightList}
  43402. onheightChange={heightChangeFunc}
  43403. title={`Current fixed height is ${currentHeight}`}
  43404. >
  43405. <Aphorism num={12} />
  43406. </BottomSheet>
  43407. <Cell title="Click mask to close" onclick={() => (visible5 = true)} />
  43408. <BottomSheet bind:visible={visible5} maskClosable>
  43409. <Aphorism num={2} />
  43410. </BottomSheet>
  43411. <Cell title="Transition time is 1 second" onclick={() => (visible6 = true)} />
  43412. <BottomSheet bind:visible={visible6} duration={1000}>
  43413. <Aphorism num={12} />
  43414. </BottomSheet>
  43415. <Cell title="Mask completely transparent and blurry" onclick={() => (visible7 = true)} />
  43416. <BottomSheet bind:visible={visible7} mask={{ opacity: '0', backdropBlur: 'sm' }}>
  43417. <Aphorism num={2} />
  43418. </BottomSheet>
  43419. <Cell title="Header does not display any content" onclick={() => (visible9 = true)} />
  43420. <BottomSheet bind:visible={visible9} showDivider={false} closeContent="" title="">
  43421. <div class="flex h-full flex-col justify-around px-4 py-8 text-center">
  43422. <div>Header area</div>
  43423. <div>Title</div>
  43424. <div>Back and close icon</div>
  43425. <div>Divider</div>
  43426. <div>None</div>
  43427. <div>Position still reserved as a sliding touch area</div>
  43428. <div class="mb-8">
  43429. <Button onclick={() => (visible9 = false)}>Close</Button>
  43430. </div>
  43431. </div>
  43432. </BottomSheet>
  43433. <Cell title="Hide close icon and center title" onclick={() => (visible10 = true)} />
  43434. <BottomSheet bind:visible={visible10} closeContent="" titleAlign="center" maskClosable title="Click mask to close">
  43435. <Aphorism num={2} />
  43436. </BottomSheet>
  43437. <Cell title="Another close icon" onclick={() => (visible13 = true)} />
  43438. <BottomSheet bind:visible={visible13} closeContent="closeIcon">
  43439. <Aphorism num={2} />
  43440. </BottomSheet>
  43441. <Cell title="Custom close text" onclick={() => (visible14 = true)} />
  43442. <BottomSheet bind:visible={visible14} closeContent="Complete">
  43443. <Aphorism num={2} />
  43444. </BottomSheet>
  43445. <Cell title="Different rounded style" onclick={() => (visible12 = true)} />
  43446. <BottomSheet bind:visible={visible12} radius="middle" showBackIcon>
  43447. <Aphorism num={2} />
  43448. </BottomSheet>
  43449. <Cell title="Slide to bottom to close" onclick={() => (visible11 = true)} />
  43450. <BottomSheet bind:visible={visible11} closeHeight={10} closeContent="">
  43451. <div class="p-4">
  43452. Set closeHeight to 10. If the position distance is less than 10% of the page height when sliding ends, it will be automatically
  43453. closed.
  43454. </div>
  43455. </BottomSheet>
  43456. </div>
  43457. <!-- Aphorism.svelte -->
  43458. <!--
  43459. <script lang="ts">
  43460. // 引入数据
  43461. // import data
  43462. import aphorisms from '../../data/aphorisms';
  43463. /**
  43464. * @typedef {Object} Props
  43465. * @property {number} [num] - number of items to display
  43466. * @property {boolean} [compact] - whether to use compact mode
  43467. */
  43468. /** @type {Props} */
  43469. let { num = 0, compact = false } = $props();
  43470. // 从 aphorisms 随机取出 num 条数据
  43471. // get num items from aphorisms randomly
  43472. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  43473. </script>
  43474. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  43475. {#each aphorismsList as item}
  43476. <div class:py-6={num > 1}>
  43477. <div class="text-sm text-justify">{item.text}</div>
  43478. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  43479. </div>
  43480. {/each}
  43481. </div>
  43482. -->
  43483. ================================================
  43484. FILE: packages/stdf/src/routes/bottomSheet/zh_CN/+page.svelte
  43485. ================================================
  43486. <!-- BottomSheet Demo -->
  43487. <script lang="ts">
  43488. import { BottomSheet, Cell, Toast, Button } from '$lib/index.js';
  43489. import Aphorism from '../../components/Aphorism.svelte';
  43490. let visible1 = $state(false);
  43491. let visible2 = $state(false);
  43492. let visible3 = $state(false);
  43493. let visible4 = $state(false);
  43494. let visible5 = $state(false);
  43495. let visible6 = $state(false);
  43496. let visible7 = $state(false);
  43497. let visible8 = $state(false);
  43498. let visible9 = $state(false);
  43499. let visible10 = $state(false);
  43500. let visible11 = $state(false);
  43501. let visible12 = $state(false);
  43502. let visible13 = $state(false);
  43503. let visible14 = $state(false);
  43504. let toastBackVisible = $state(false);
  43505. let toastCloseVisible = $state(false);
  43506. const stayHeightList = [40, 60, 80];
  43507. let currentHeight = $state(60);
  43508. const heightChangeFunc = (height: number) => (currentHeight = height);
  43509. </script>
  43510. <div class="py-4">
  43511. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  43512. <BottomSheet bind:visible={visible1} title="此区域支持滑动">
  43513. <div class="flex h-full flex-col justify-center text-center">
  43514. <div>这里是内容区域</div>
  43515. </div>
  43516. </BottomSheet>
  43517. <Cell title="内容区域滚动" onclick={() => (visible8 = true)} />
  43518. <BottomSheet bind:visible={visible8}>
  43519. <Aphorism num={12} />
  43520. </BottomSheet>
  43521. <Cell title="有返回按钮" onclick={() => (visible2 = true)} />
  43522. <BottomSheet
  43523. bind:visible={visible2}
  43524. showBackIcon
  43525. title="点击返回与关闭可触发事件"
  43526. onback={() => (toastBackVisible = true)}
  43527. onclose={() => (toastCloseVisible = true)}
  43528. >
  43529. <Aphorism num={12} />
  43530. </BottomSheet>
  43531. <Toast bind:visible={toastBackVisible} message="触发了 BottomSheet 返回事件!" />
  43532. <Toast bind:visible={toastCloseVisible} message="触发了 BottomSheet 关闭事件!" />
  43533. <Cell title="初始高度为 90" onclick={() => (visible3 = true)} />
  43534. <BottomSheet bind:visible={visible3} stayHeightIndex={2}>
  43535. <Aphorism num={12} />
  43536. </BottomSheet>
  43537. <Cell title="固定高度为 40/60/80" onclick={() => (visible4 = true)} />
  43538. <BottomSheet bind:visible={visible4} {stayHeightList} onheightChange={heightChangeFunc} title={`当前固定高度为${currentHeight}`}>
  43539. <Aphorism num={12} />
  43540. </BottomSheet>
  43541. <Cell title="点击遮罩可关闭" onclick={() => (visible5 = true)} />
  43542. <BottomSheet bind:visible={visible5} maskClosable>
  43543. <Aphorism num={2} />
  43544. </BottomSheet>
  43545. <Cell title="出现过渡时间为 1 秒" onclick={() => (visible6 = true)} />
  43546. <BottomSheet bind:visible={visible6} duration={1000}>
  43547. <Aphorism num={12} />
  43548. </BottomSheet>
  43549. <Cell title="遮罩完全透明且模糊" onclick={() => (visible7 = true)} />
  43550. <BottomSheet bind:visible={visible7} mask={{ opacity: '0', backdropBlur: 'sm' }}>
  43551. <Aphorism num={2} />
  43552. </BottomSheet>
  43553. <Cell title="头部不显示任何内容" onclick={() => (visible9 = true)} />
  43554. <BottomSheet bind:visible={visible9} showDivider={false} closeContent="" title="">
  43555. <div class="flex h-full flex-col justify-around px-4 py-8 text-center">
  43556. <div>头部区域</div>
  43557. <div>标题</div>
  43558. <div>返回与关闭图标</div>
  43559. <div>分割线</div>
  43560. <div>都不显示</div>
  43561. <div>位置依旧保留作为滑动触控区域</div>
  43562. <div class="mb-8">
  43563. <Button onclick={() => (visible9 = false)}>关闭</Button>
  43564. </div>
  43565. </div>
  43566. </BottomSheet>
  43567. <Cell title="隐藏关闭图标且标题居中" onclick={() => (visible10 = true)} />
  43568. <BottomSheet bind:visible={visible10} closeContent="" titleAlign="center" maskClosable title="点击遮罩关闭">
  43569. <Aphorism num={2} />
  43570. </BottomSheet>
  43571. <Cell title="另一种关闭图标" onclick={() => (visible13 = true)} />
  43572. <BottomSheet bind:visible={visible13} closeContent="closeIcon">
  43573. <Aphorism num={2} />
  43574. </BottomSheet>
  43575. <Cell title="关闭区域自定义文字" onclick={() => (visible14 = true)} />
  43576. <BottomSheet bind:visible={visible14} closeContent="完成">
  43577. <Aphorism num={2} />
  43578. </BottomSheet>
  43579. <Cell title="图标不同圆角风格" onclick={() => (visible12 = true)} />
  43580. <BottomSheet bind:visible={visible12} radius="middle" showBackIcon>
  43581. <Aphorism num={2} />
  43582. </BottomSheet>
  43583. <Cell title="可下滑到底部关闭" onclick={() => (visible11 = true)} />
  43584. <BottomSheet bind:visible={visible11} closeHeight={10} closeContent="">
  43585. <div class="p-4">将 closeHeight 设置为 10,如果滑动结束时位置距离页面底部小于页面高度的 10% 则自动关闭。</div>
  43586. </BottomSheet>
  43587. </div>
  43588. <!-- Aphorism.svelte -->
  43589. <!--
  43590. <script lang=""ts>
  43591. // 引入数据
  43592. // import data
  43593. import aphorisms from '../../data/aphorisms';
  43594. /**
  43595. * @typedef {Object} Props
  43596. * @property {number} [num] - number of items to display
  43597. * @property {boolean} [compact] - whether to use compact mode
  43598. */
  43599. /** @type {Props} */
  43600. let { num = 0, compact = false } = $props();
  43601. // 从 aphorisms 随机取出 num 条数据
  43602. // get num items from aphorisms randomly
  43603. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  43604. </script>
  43605. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  43606. {#each aphorismsList as item}
  43607. <div class:py-6={num > 1}>
  43608. <div class="text-sm text-justify">{item.text}</div>
  43609. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  43610. </div>
  43611. {/each}
  43612. </div>
  43613. -->
  43614. ================================================
  43615. FILE: packages/stdf/src/routes/button/en_US/+page.svelte
  43616. ================================================
  43617. <!-- Button Demo -->
  43618. <script lang="ts">
  43619. import { Button, Icon, Toast, Loading } from '$lib/index.js';
  43620. let visible = $state(false);
  43621. </script>
  43622. <div class="flex flex-col space-y-8 py-8">
  43623. <div>
  43624. <div class="p-4 font-bold">Different states</div>
  43625. <Button>Default</Button>
  43626. <Button state="success">Success</Button>
  43627. <Button state="warning">Warning</Button>
  43628. <Button state="error">Error</Button>
  43629. <Button state="info">Information</Button>
  43630. </div>
  43631. <div>
  43632. <div class="p-4 font-bold">Different rounded style</div>
  43633. <Button>Default</Button>
  43634. <Button radius="none">No rounded</Button>
  43635. <Button radius="xl">Large rounded corner</Button>
  43636. <Button radius="2xl">Larger corner</Button>
  43637. <Button radius="full">Full rounded corner</Button>
  43638. </div>
  43639. <div>
  43640. <div class="p-4 font-bold">Different fill mode</div>
  43641. <Button>Default</Button>
  43642. <Button fill="line">Colorless linear</Button>
  43643. <Button fill="lineLight">Light color linearity</Button>
  43644. <Button fill="lineTheme">Theme color linear</Button>
  43645. <Button fill="text">Colorless pure text</Button>
  43646. <Button fill="textTheme">Pure text of theme color</Button>
  43647. <Button fill="colorLight">Light color filling</Button>
  43648. </div>
  43649. <div>
  43650. <div class="p-4 font-bold">Different border style</div>
  43651. <Button fill="lineTheme">Solid line</Button>
  43652. <Button fill="lineTheme" line="dashed">Dashed line</Button>
  43653. <Button fill="lineTheme" line="dotted">Dotted line</Button>
  43654. </div>
  43655. <div>
  43656. <div class="p-4 font-bold">Different size</div>
  43657. <Button size="full" radius="none">There is no rounded corner</Button>
  43658. <Button>Default</Button>
  43659. <Button size="md">Medium</Button>
  43660. <Button size="sm">Small</Button>
  43661. <Button size="auto">AUTO</Button>
  43662. <Button size="auto">
  43663. <div class="px-1">
  43664. <Icon name="ri-plane-fill" size={20} top={-2} />
  43665. </div>
  43666. </Button>
  43667. </div>
  43668. <div>
  43669. <div class="p-4 font-bold">Different heights</div>
  43670. <Button heightOut="0">The external height is 0</Button>
  43671. <Button heightIn="0">Internal height is 0</Button>
  43672. </div>
  43673. <div>
  43674. <div class="p-4 font-bold">Fixed size</div>
  43675. <div class="flex items-center justify-around">
  43676. <Button customSize customWidth={40} customHeight={40} radius="full">W</Button>
  43677. <Button customSize customWidth={40} customHeight={40} radius="xl">&</Button>
  43678. <Button customSize customWidth={40} customHeight={40}>H</Button>
  43679. <Button customSize customWidth={40} customHeight={40} radius="none">equal</Button>
  43680. <Button fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43681. <Icon name="ri-plane-fill" size={20} top={-2} />
  43682. </Button>
  43683. <Button radius="full" fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43684. <Icon name="ri-plane-fill" size={20} top={-2} />
  43685. </Button>
  43686. <Button radius="full" line="dashed" fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43687. <Icon name="ri-plane-fill" size={20} top={-2} />
  43688. </Button>
  43689. <Button radius="full" customSize customWidth={24} customHeight={24} heightIn="0">
  43690. <Icon name="ri-plane-fill" size={12} top={-2} />
  43691. </Button>
  43692. </div>
  43693. </div>
  43694. <div>
  43695. <div class="p-4 font-bold">Disable</div>
  43696. <Button disabled>Disable</Button>
  43697. <Button fill="lineTheme" disabled>Disable</Button>
  43698. </div>
  43699. <div>
  43700. <div class="p-4 font-bold">With icon</div>
  43701. <Button icon={{ name: 'ri-share-forward-2-fill', size: 18, top: -2 }}>Throw the two way foil</Button>
  43702. <Button fill="lineTheme" icon={{ name: 'ri-mic-off-fill', size: 16, top: -2 }}>Start the surface wall plan</Button>
  43703. </div>
  43704. <div>
  43705. <div class="p-4 font-bold">With loading (disabled by default)</div>
  43706. <Button loading={{ inverse: true, height: '6', width: '6' }}>Loading</Button>
  43707. <Button loading={{ inverse: true, width: '16', height: '6', type: '1_28' }}>Loading</Button>
  43708. <Button loading={{ inverse: true, height: '6', width: '6' }} disabledLoading={false}>Loading</Button>
  43709. </div>
  43710. <div>
  43711. <div class="p-4 font-bold">With icon (passed through Snippet)</div>
  43712. <Button>
  43713. <Icon name="ri-share-forward-2-fill" size={18} top={-2} />
  43714. Throw the two way foil
  43715. </Button>
  43716. <Button fill="lineTheme">
  43717. <Icon name="ri-mic-off-fill" size={16} top={-2} />
  43718. Start the surface wall plan
  43719. </Button>
  43720. </div>
  43721. <div>
  43722. <div class="p-4 font-bold">Load (passed through Snippet)</div>
  43723. <Button>
  43724. <Loading inverse height="6" width="6" />
  43725. </Button>
  43726. <Button>
  43727. <Loading inverse width="16" height="6" type="1_17" />
  43728. </Button>
  43729. </div>
  43730. <div>
  43731. <div class="p-4 font-bold">Love version</div>
  43732. <Button love>Care version button</Button>
  43733. <Button love fill="lineTheme">
  43734. <Icon name="ri-hand-heart-line" size={22} top={-2} />
  43735. Care version button
  43736. </Button>
  43737. </div>
  43738. <div>
  43739. <div class="p-4 font-bold">Customize</div>
  43740. <Button injClass="bg-[#C84031] dark:bg-[#77B941]">Solid color filling</Button>
  43741. <Button injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white">Gradient filling</Button>
  43742. <Button fill="line" injClass="border-[#C84031] dark:border-[#77B941] !text-[#C84031] dark:!text-[#77B941]">Linear</Button>
  43743. <Button injClass="shadow-md shadow-black/30 dark:shadow-white/30">Shadow</Button>
  43744. <Button radius="full" injClass="shadow-lg shadow-primary/40 dark:shadow-dark/40">Shadow</Button>
  43745. </div>
  43746. <div>
  43747. <div class="p-4 font-bold">Button group</div>
  43748. <Button fill="lineTheme" heightIn="0" group>
  43749. <div class="flex w-full">
  43750. <button class="flex-1 border-r border-primary py-2 active:opacity-80 dark:border-dark">
  43751. <Icon name="ri-apps-2-line" size={18} top={-2} />
  43752. Application
  43753. </button>
  43754. <button class="flex-1 border-r border-primary py-2 active:opacity-80 dark:border-dark">
  43755. <Icon name="ri-star-line" size={18} top={-2} />
  43756. Collect
  43757. </button>
  43758. <button class="flex-1 py-2 active:opacity-80" onclick={() => (visible = true)}>
  43759. <Icon name="ri-share-forward-line" size={18} top={-2} />
  43760. Share
  43761. </button>
  43762. </div>
  43763. </Button>
  43764. <Button radius="full" heightIn="0" group>
  43765. <div class="flex w-full">
  43766. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black">
  43767. <Icon name="ri-apps-2-line" size={18} top={-2} />
  43768. Application
  43769. </button>
  43770. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black">
  43771. <Icon name="ri-star-line" size={18} top={-2} />
  43772. Collect
  43773. </button>
  43774. <button class="flex-1 py-2 active:opacity-80" onclick={() => (visible = true)}>
  43775. <Icon name="ri-share-forward-line" size={18} top={-2} />
  43776. Share
  43777. </button>
  43778. </div>
  43779. </Button>
  43780. </div>
  43781. </div>
  43782. <Toast bind:visible message="Click share in the button group!" />
  43783. ================================================
  43784. FILE: packages/stdf/src/routes/button/zh_CN/+page.svelte
  43785. ================================================
  43786. <!-- Button Demo -->
  43787. <script lang="ts">
  43788. import { Button, Icon, Toast, Loading } from '$lib/index.js';
  43789. let visible = $state(false);
  43790. </script>
  43791. <div class="flex flex-col space-y-8 py-8">
  43792. <div>
  43793. <div class="p-4 font-bold">不同状态色</div>
  43794. <Button>默认</Button>
  43795. <Button state="success">成功</Button>
  43796. <Button state="warning">警告</Button>
  43797. <Button state="error">错误</Button>
  43798. <Button state="info">信息</Button>
  43799. </div>
  43800. <div>
  43801. <div class="p-4 font-bold">不同圆角风格</div>
  43802. <Button>默认</Button>
  43803. <Button radius="none">无圆角</Button>
  43804. <Button radius="xl">大圆角</Button>
  43805. <Button radius="2xl">更大圆角</Button>
  43806. <Button radius="full">全圆角</Button>
  43807. </div>
  43808. <div>
  43809. <div class="p-4 font-bold">不同填充模式</div>
  43810. <Button>默认</Button>
  43811. <Button fill="line">无色线性</Button>
  43812. <Button fill="lineLight">浅色线性</Button>
  43813. <Button fill="lineTheme">主题色线性</Button>
  43814. <Button fill="text">无色纯文本</Button>
  43815. <Button fill="textTheme">主题色纯文本</Button>
  43816. <Button fill="colorLight">浅色填充</Button>
  43817. </div>
  43818. <div>
  43819. <div class="p-4 font-bold">不同边框风格</div>
  43820. <Button fill="lineTheme">实线</Button>
  43821. <Button fill="lineTheme" line="dashed">虚线</Button>
  43822. <Button fill="lineTheme" line="dotted">点线</Button>
  43823. </div>
  43824. <div>
  43825. <div class="p-4 font-bold">不同大小</div>
  43826. <Button size="full" radius="none">通栏且无圆角</Button>
  43827. <Button>默认</Button>
  43828. <Button size="md">中号</Button>
  43829. <Button size="sm">小号</Button>
  43830. <Button size="auto">AUTO</Button>
  43831. <Button size="auto">
  43832. <div class="px-1">
  43833. <Icon name="ri-plane-fill" size={20} top={-2} />
  43834. </div>
  43835. </Button>
  43836. </div>
  43837. <div>
  43838. <div class="p-4 font-bold">不同高度</div>
  43839. <Button heightOut="0">外部高度为 0</Button>
  43840. <Button heightIn="0">内部高度为 0</Button>
  43841. </div>
  43842. <div>
  43843. <div class="p-4 font-bold">固定大小</div>
  43844. <div class="flex items-center justify-around">
  43845. <Button customSize customWidth={40} customHeight={40} radius="full">宽</Button>
  43846. <Button customSize customWidth={40} customHeight={40} radius="xl">高</Button>
  43847. <Button customSize customWidth={40} customHeight={40}>一</Button>
  43848. <Button customSize customWidth={40} customHeight={40} radius="none">致</Button>
  43849. <Button fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43850. <Icon name="ri-plane-fill" size={20} top={-2} />
  43851. </Button>
  43852. <Button radius="full" fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43853. <Icon name="ri-plane-fill" size={20} top={-2} />
  43854. </Button>
  43855. <Button radius="full" line="dashed" fill="lineTheme" customSize customWidth={40} customHeight={40}>
  43856. <Icon name="ri-plane-fill" size={20} top={-2} />
  43857. </Button>
  43858. <Button radius="full" customSize customWidth={24} customHeight={24} heightIn="0">
  43859. <Icon name="ri-plane-fill" size={12} top={-2} />
  43860. </Button>
  43861. </div>
  43862. </div>
  43863. <div>
  43864. <div class="p-4 font-bold">禁用</div>
  43865. <Button disabled>禁用</Button>
  43866. <Button fill="lineTheme" disabled>禁用</Button>
  43867. </div>
  43868. <div>
  43869. <div class="p-4 font-bold">带图标</div>
  43870. <Button icon={{ name: 'ri-share-forward-2-fill', size: 18, top: -2 }}>投掷二向箔</Button>
  43871. <Button fill="lineTheme" icon={{ name: 'ri-mic-off-fill', size: 16, top: -2 }}>启动面壁计划</Button>
  43872. </div>
  43873. <div>
  43874. <div class="p-4 font-bold">带加载(默认禁用)</div>
  43875. <Button loading={{ inverse: true, height: '6', width: '6' }}>加载中</Button>
  43876. <Button loading={{ inverse: true, height: '6', width: '6', type: '1_28' }}>加载中</Button>
  43877. <Button loading={{ inverse: true, height: '6', width: '6' }} disabledLoading={false}>加载中</Button>
  43878. </div>
  43879. <div>
  43880. <div class="p-4 font-bold">带图标(通过 Snippet 传入)</div>
  43881. <Button>
  43882. <Icon name="ri-share-forward-2-fill" size={18} top={-2} />
  43883. 投掷二向箔
  43884. </Button>
  43885. <Button fill="lineTheme">
  43886. <Icon name="ri-mic-off-fill" size={16} top={-2} />
  43887. 启动面壁计划
  43888. </Button>
  43889. </div>
  43890. <div>
  43891. <div class="p-4 font-bold">加载(通过 Snippet 传入)</div>
  43892. <Button>
  43893. <Loading inverse height="6" width="6" />
  43894. </Button>
  43895. <Button>
  43896. <Loading inverse width="16" height="6" type="1_17" />
  43897. </Button>
  43898. </div>
  43899. <div>
  43900. <div class="p-4 font-bold">关爱版</div>
  43901. <Button love>关爱版按钮</Button>
  43902. <Button love fill="lineTheme">
  43903. <Icon name="ri-hand-heart-line" size={22} top={-2} />
  43904. 关爱版按钮
  43905. </Button>
  43906. </div>
  43907. <div>
  43908. <div class="p-4 font-bold">自定义</div>
  43909. <Button injClass="bg-[#C84031] dark:bg-[#77B941]">纯色填充</Button>
  43910. <Button injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white">渐变填充</Button>
  43911. <Button fill="line" injClass="border-[#C84031] dark:border-[#77B941] !text-[#C84031] dark:!text-[#77B941]">线性</Button>
  43912. <Button injClass="shadow-md shadow-black/30 dark:shadow-white/30">阴影</Button>
  43913. <Button radius="full" injClass="shadow-lg shadow-primary/40 dark:shadow-dark/40">颜色阴影</Button>
  43914. </div>
  43915. <div>
  43916. <div class="p-4 font-bold">按钮组</div>
  43917. <Button fill="lineTheme" heightIn="0" group>
  43918. <div class="flex w-full">
  43919. <button class="flex-1 border-r border-primary py-2 active:opacity-80 dark:border-dark">
  43920. <Icon name="ri-apps-2-line" size={18} top={-2} />
  43921. 应用
  43922. </button>
  43923. <button class="flex-1 border-r border-primary py-2 active:opacity-80 dark:border-dark">
  43924. <Icon name="ri-star-line" size={18} top={-2} />
  43925. 收藏
  43926. </button>
  43927. <button class="flex-1 py-2 active:opacity-80" onclick={() => (visible = true)}>
  43928. <Icon name="ri-share-forward-line" size={18} top={-2} />
  43929. 分享
  43930. </button>
  43931. </div>
  43932. </Button>
  43933. <Button radius="full" heightIn="0" group>
  43934. <div class="flex w-full">
  43935. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black">
  43936. <Icon name="ri-apps-2-line" size={18} top={-2} />
  43937. 应用
  43938. </button>
  43939. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black">
  43940. <Icon name="ri-star-line" size={18} top={-2} />
  43941. 收藏
  43942. </button>
  43943. <button class="flex-1 py-2 active:opacity-80" onclick={() => (visible = true)}>
  43944. <Icon name="ri-share-forward-line" size={18} top={-2} />
  43945. 分享
  43946. </button>
  43947. </div>
  43948. </Button>
  43949. </div>
  43950. </div>
  43951. <Toast bind:visible message="点击了按钮组中的分享!" />
  43952. ================================================
  43953. FILE: packages/stdf/src/routes/calendar/en_US/+page.svelte
  43954. ================================================
  43955. <!-- Calendar Demo -->
  43956. <script lang="ts">
  43957. import { Cell, Calendar } from '$lib/index.js';
  43958. import type { InfoDateProps } from '$lib/types/index.js';
  43959. let visible1 = $state(false);
  43960. let visible2 = $state(false);
  43961. let visible3 = $state(false);
  43962. let visible4 = $state(false);
  43963. let visible5 = $state(false);
  43964. let visible6 = $state(false);
  43965. let visible7 = $state(false);
  43966. let visible8 = $state(false);
  43967. let visible9 = $state(false);
  43968. let visible10 = $state(false);
  43969. let visible11 = $state(false);
  43970. let visible12 = $state(false);
  43971. let visible13 = $state(false);
  43972. let visible14 = $state(false);
  43973. let visible15 = $state(false);
  43974. let visible16 = $state(false);
  43975. let visible17 = $state(false);
  43976. let visible18 = $state(false);
  43977. let visible19 = $state(false);
  43978. let visible20 = $state(false);
  43979. let visible21 = $state(false);
  43980. let visible22 = $state(false);
  43981. let visible23 = $state(false);
  43982. let visible24 = $state(false);
  43983. // The 6 days after the current date randomly takes out the INFODATES array, the Date format is yyyymmdd, and the month and day make up for 2 digits
  43984. const now = new Date();
  43985. const infoDates: InfoDateProps[] = $state([]);
  43986. for (let i = 0; i < 6; i++) {
  43987. const date = new Date(now.getTime() + i * 24 * 60 * 60 * 1000);
  43988. infoDates.push({
  43989. text: `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`,
  43990. info: ''
  43991. });
  43992. }
  43993. // Loop infoDates, in turn, each item is converted to an object, date is the date, and info is respectively departure, check-in, shopping, photography, check-out, and return
  43994. infoDates.forEach((date, index) => {
  43995. infoDates[index] = {
  43996. text: date.text,
  43997. info: ['Set off', 'Stay', 'Shopping', 'Photo', 'Leave', 'Return'][index]
  43998. };
  43999. });
  44000. // For a total of 14 days before the current date and 7 days after 7 days, the formation of the array DisableDates. The DATE format is yyyymmdd, and the month and day are added.
  44001. const disabledDates: string[] = [];
  44002. const before7 = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
  44003. for (let i = 0; i < 14; i++) {
  44004. const date = new Date(before7.getTime() + i * 24 * 60 * 60 * 1000);
  44005. disabledDates.push(
  44006. `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`
  44007. );
  44008. }
  44009. // Pass the number N and return to the month of the N -month month in the current month. The format is yyyymm, and the month is added 2 digits.
  44010. const getInitMonth = (n: number) => {
  44011. const now = new Date();
  44012. const year = now.getFullYear();
  44013. const month = now.getMonth() + 1;
  44014. const newMonth = month - n;
  44015. if (newMonth > 0) {
  44016. return `${year}${newMonth.toString().padStart(2, '0')}`;
  44017. } else {
  44018. return `${year - 1}${(12 + newMonth).toString().padStart(2, '0')}`;
  44019. }
  44020. };
  44021. const initMonth = getInitMonth(3);
  44022. const quickSelectsDay = [-5, -2, 3, 7];
  44023. let selectedDates: string[] = $state([]);
  44024. const getSelectedDatesFunc = (dates: string[]) => {
  44025. selectedDates = dates;
  44026. };
  44027. let selectedFormatDates: string[] = $state([]);
  44028. const getSelectedFormatDatesFunc = (dates: string[]) => {
  44029. selectedFormatDates = dates;
  44030. };
  44031. </script>
  44032. <div class="py-4">
  44033. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  44034. <Calendar bind:visible={visible1} />
  44035. <Cell title="Choice" onclick={() => (visible7 = true)} />
  44036. <Calendar bind:visible={visible7} mode="multiple" />
  44037. <Cell title="Range selection" onclick={() => (visible8 = true)} />
  44038. <Calendar bind:visible={visible8} mode="range" />
  44039. <Cell title="Starting from Sunday" onclick={() => (visible2 = true)} />
  44040. <Calendar bind:visible={visible2} startSunday />
  44041. <Cell title="Weekend text marking red" onclick={() => (visible3 = true)} />
  44042. <Calendar bind:visible={visible3} weekendRed />
  44043. <Cell title="No card style but add watermark" onclick={() => (visible4 = true)} />
  44044. <Calendar bind:visible={visible4} monthCard={false} monthMark />
  44045. <Cell title="Higher" onclick={() => (visible5 = true)} />
  44046. <Calendar bind:visible={visible5} height={60} />
  44047. <Cell title="Customize the date of display information" onclick={() => (visible6 = true)} />
  44048. <Calendar bind:visible={visible6} {infoDates} />
  44049. <Cell title="Do not round the corner" onclick={() => (visible9 = true)} />
  44050. <Calendar bind:visible={visible9} mode="range" radius="none" />
  44051. <Cell title="Increase the corner" onclick={() => (visible10 = true)} />
  44052. <Calendar bind:visible={visible10} mode="range" radius="2xl" />
  44053. <Cell title="Turn off the animation when rolling" onclick={() => (visible18 = true)} />
  44054. <Calendar bind:visible={visible18} useAnimation={false} />
  44055. <Cell title="Configure confirmation button style" onclick={() => (visible11 = true)} />
  44056. <Calendar bind:visible={visible11} button={{ radius: 'full' }} />
  44057. <Cell title="Top rounded corner" onclick={() => (visible19 = true)} />
  44058. <Calendar bind:visible={visible19} popup={{ radius: 'xl' }} />
  44059. <Cell title="Definition start and end month" onclick={() => (visible12 = true)} />
  44060. <Calendar bind:visible={visible12} startMonth="202101" endMonth="202106" />
  44061. <Cell title="Customize the unsalented date" onclick={() => (visible13 = true)} />
  44062. <Calendar bind:visible={visible13} {disabledDates} mode="range" />
  44063. <Cell title="No showed days have been displayed" onclick={() => (visible14 = true)} />
  44064. <Calendar bind:visible={visible14} mode="range" showSelectedDay={false} />
  44065. <Cell title="Customized initial display month" subTitle="Third month before the current month" onclick={() => (visible15 = true)} />
  44066. <Calendar bind:visible={visible15} {initMonth} />
  44067. <Cell title="Show some fast selection items" onclick={() => (visible16 = true)} />
  44068. <Calendar bind:visible={visible16} mode="range" quickSelects={['week', 'month', 'quarter', -3, -7, -30, 3, 7, 30]} />
  44069. <Cell title="Quickly choose to include that day" onclick={() => (visible23 = true)} />
  44070. <Calendar bind:visible={visible23} mode="range" quickSelects={quickSelectsDay} includeToday />
  44071. <Cell title="Select this week from Sunday" onclick={() => (visible17 = true)} />
  44072. <Calendar bind:visible={visible17} mode="range" startSunday quickSelects={['week']} />
  44073. <div class="px-4">
  44074. {#if selectedDates.length}
  44075. The following is the following total {selectedDates.length} day:
  44076. {:else}
  44077. <div>Please select the date</div>
  44078. {/if}
  44079. </div>
  44080. <div class="grid grid-cols-4 gap-2 p-2 text-primary dark:text-dark">
  44081. {#each selectedDates as item}
  44082. <div class="text-center">{item}</div>
  44083. {/each}
  44084. </div>
  44085. <Cell title="Get the selection date of returning" onclick={() => (visible20 = true)} />
  44086. <Calendar bind:visible={visible20} mode="range" onconfirm={getSelectedDatesFunc} />
  44087. <div class="px-4">
  44088. {#if selectedFormatDates.length}
  44089. The following is the following total {selectedFormatDates.length} day:
  44090. {:else}
  44091. <div>Please select the date</div>
  44092. {/if}
  44093. </div>
  44094. <div class="grid grid-cols-3 gap-2 p-2 text-sm text-primary dark:text-dark">
  44095. {#each selectedFormatDates as item}
  44096. <div class="text-center">{item}</div>
  44097. {/each}
  44098. </div>
  44099. <Cell title="Customized date format" onclick={() => (visible21 = true)} />
  44100. <Calendar bind:visible={visible21} mode="range" outFormat="M/D/Y" onconfirm={getSelectedFormatDatesFunc} />
  44101. <Cell title="Turn off today's highlight display" onclick={() => (visible22 = true)} />
  44102. <Calendar bind:visible={visible22} highlightToday={false} />
  44103. <Cell title="Do not clear the selected date when closing" onclick={() => (visible24 = true)} />
  44104. <Calendar bind:visible={visible24} mode="range" clear={false} />
  44105. </div>
  44106. ================================================
  44107. FILE: packages/stdf/src/routes/calendar/zh_CN/+page.svelte
  44108. ================================================
  44109. <!-- Calendar Demo -->
  44110. <script lang="ts">
  44111. import { Cell, Calendar } from '$lib/index.js';
  44112. import type { InfoDateProps } from '$lib/types/index.js';
  44113. let visible1 = $state(false);
  44114. let visible2 = $state(false);
  44115. let visible3 = $state(false);
  44116. let visible4 = $state(false);
  44117. let visible5 = $state(false);
  44118. let visible6 = $state(false);
  44119. let visible7 = $state(false);
  44120. let visible8 = $state(false);
  44121. let visible9 = $state(false);
  44122. let visible10 = $state(false);
  44123. let visible11 = $state(false);
  44124. let visible12 = $state(false);
  44125. let visible13 = $state(false);
  44126. let visible14 = $state(false);
  44127. let visible15 = $state(false);
  44128. let visible16 = $state(false);
  44129. let visible17 = $state(false);
  44130. let visible18 = $state(false);
  44131. let visible19 = $state(false);
  44132. let visible20 = $state(false);
  44133. let visible21 = $state(false);
  44134. let visible22 = $state(false);
  44135. let visible23 = $state(false);
  44136. let visible24 = $state(false);
  44137. // 随机取出当前日期后的 6 天,组成 infoDates 数组,其中 date 格式为 YYYYMMDD,月和日补足 2 位
  44138. const now = new Date();
  44139. const infoDates: InfoDateProps[] = $state([]);
  44140. for (let i = 0; i < 6; i++) {
  44141. const date = new Date(now.getTime() + i * 24 * 60 * 60 * 1000);
  44142. infoDates.push({
  44143. text: `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`,
  44144. info: ''
  44145. });
  44146. }
  44147. // 循环 infoDates ,按照顺序,将每一项转为对象,date 为日期,info分别为出发、入住、购物、 拍照、离店、回程
  44148. infoDates.forEach((date, index) => {
  44149. infoDates[index] = {
  44150. text: date.text,
  44151. info: ['出发', '入住', '购物', '拍照', '离店', '回程'][index]
  44152. };
  44153. });
  44154. // 获取当前日期的前 7 天和后 7 天共 14 天,组成数组 disabledDates,其中 date 格式为 YYYYMMDD,月和日补足 2 位
  44155. const disabledDates: string[] = [];
  44156. const before7 = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
  44157. for (let i = 0; i < 14; i++) {
  44158. const date = new Date(before7.getTime() + i * 24 * 60 * 60 * 1000);
  44159. disabledDates.push(
  44160. `${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}`
  44161. );
  44162. }
  44163. // 传入数字 n,返回当前月份往前推第 n 个月的月份,格式为 YYYYMM,月份补足2位
  44164. const getInitMonth = (n: number) => {
  44165. const now = new Date();
  44166. const year = now.getFullYear();
  44167. const month = now.getMonth() + 1;
  44168. const newMonth = month - n;
  44169. if (newMonth > 0) {
  44170. return `${year}${newMonth.toString().padStart(2, '0')}`;
  44171. } else {
  44172. return `${year - 1}${(12 + newMonth).toString().padStart(2, '0')}`;
  44173. }
  44174. };
  44175. const initMonth = getInitMonth(3);
  44176. const quickSelectsDay = [-5, -2, 3, 7];
  44177. let selectedDates: string[] = $state([]);
  44178. const getSelectedDatesFunc = (dates: string[]) => {
  44179. selectedDates = dates;
  44180. };
  44181. let selectedFormatDates: string[] = $state([]);
  44182. const getSelectedFormatDatesFunc = (dates: string[]) => {
  44183. selectedFormatDates = dates;
  44184. };
  44185. </script>
  44186. <div class="py-4">
  44187. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  44188. <Calendar bind:visible={visible1} />
  44189. <Cell title="多选" onclick={() => (visible7 = true)} />
  44190. <Calendar bind:visible={visible7} mode="multiple" />
  44191. <Cell title="范围选择" onclick={() => (visible8 = true)} />
  44192. <Calendar bind:visible={visible8} mode="range" />
  44193. <Cell title="从周日开始" onclick={() => (visible2 = true)} />
  44194. <Calendar bind:visible={visible2} startSunday />
  44195. <Cell title="周末文字标红" onclick={() => (visible3 = true)} />
  44196. <Calendar bind:visible={visible3} weekendRed />
  44197. <Cell title="不使用卡片样式且加水印" onclick={() => (visible4 = true)} />
  44198. <Calendar bind:visible={visible4} monthCard={false} monthMark />
  44199. <Cell title="高一点" onclick={() => (visible5 = true)} />
  44200. <Calendar bind:visible={visible5} height={60} />
  44201. <Cell title="自定义显示信息的日期" onclick={() => (visible6 = true)} />
  44202. <Calendar bind:visible={visible6} {infoDates} />
  44203. <Cell title="不要圆角" onclick={() => (visible9 = true)} />
  44204. <Calendar bind:visible={visible9} mode="range" radius="none" />
  44205. <Cell title="加大圆角" onclick={() => (visible10 = true)} />
  44206. <Calendar bind:visible={visible10} mode="range" radius="2xl" />
  44207. <Cell title="滚动时关闭动画" onclick={() => (visible18 = true)} />
  44208. <Calendar bind:visible={visible18} useAnimation={false} />
  44209. <Cell title="配置确认按钮样式" onclick={() => (visible11 = true)} />
  44210. <Calendar bind:visible={visible11} button={{ radius: 'full' }} />
  44211. <Cell title="顶部来点圆角" onclick={() => (visible19 = true)} />
  44212. <Calendar bind:visible={visible19} popup={{ radius: 'xl' }} />
  44213. <Cell title="定义开始与结束月" onclick={() => (visible12 = true)} />
  44214. <Calendar bind:visible={visible12} startMonth="202101" endMonth="202106" />
  44215. <Cell title="自定义不可选日期" onclick={() => (visible13 = true)} />
  44216. <Calendar bind:visible={visible13} {disabledDates} mode="range" />
  44217. <Cell title="多选或范围选择时不显示已选天数" onclick={() => (visible14 = true)} />
  44218. <Calendar bind:visible={visible14} mode="range" showSelectedDay={false} />
  44219. <Cell title="自定义初始显示月份" subTitle="开始月份为当前月份前第三个月" onclick={() => (visible15 = true)} />
  44220. <Calendar bind:visible={visible15} {initMonth} />
  44221. <Cell title="展示一些快速选择项" onclick={() => (visible16 = true)} />
  44222. <Calendar bind:visible={visible16} mode="range" quickSelects={['week', 'month', 'quarter', -3, -7, -30, 3, 7, 30]} />
  44223. <Cell title="快速选择天数时包含当天" onclick={() => (visible23 = true)} />
  44224. <Calendar bind:visible={visible23} mode="range" quickSelects={quickSelectsDay} includeToday />
  44225. <Cell title="从周日开始快速选择本周" onclick={() => (visible17 = true)} />
  44226. <Calendar bind:visible={visible17} mode="range" startSunday quickSelects={['week']} />
  44227. <div class="px-4">
  44228. {#if selectedDates.length}
  44229. 当前选定了以下共 {selectedDates.length} 天:
  44230. {:else}
  44231. <div>请选定日期</div>
  44232. {/if}
  44233. </div>
  44234. <div class="grid grid-cols-4 gap-2 p-2 text-primary dark:text-dark">
  44235. {#each selectedDates as item}
  44236. <div class="text-center">{item}</div>
  44237. {/each}
  44238. </div>
  44239. <Cell title="获取返回的选定日期" onclick={() => (visible20 = true)} />
  44240. <Calendar bind:visible={visible20} mode="range" onconfirm={getSelectedDatesFunc} />
  44241. <div class="px-4">
  44242. {#if selectedFormatDates.length}
  44243. 当前选定了以下共 {selectedFormatDates.length} 天:
  44244. {:else}
  44245. <div>请选定日期</div>
  44246. {/if}
  44247. </div>
  44248. <div class="grid grid-cols-3 gap-2 p-2 text-sm text-primary dark:text-dark">
  44249. {#each selectedFormatDates as item}
  44250. <div class="text-center">{item}</div>
  44251. {/each}
  44252. </div>
  44253. <Cell title="自定义返回的日期格式" onclick={() => (visible21 = true)} />
  44254. <Calendar bind:visible={visible21} mode="range" outFormat="YYYY年MM月DD日" onconfirm={getSelectedFormatDatesFunc} />
  44255. <Cell title="今日日期关闭高亮显示" onclick={() => (visible22 = true)} />
  44256. <Calendar bind:visible={visible22} highlightToday={false} />
  44257. <Cell title="关闭时不清空已选日期" onclick={() => (visible24 = true)} />
  44258. <Calendar bind:visible={visible24} mode="range" clear={false} />
  44259. </div>
  44260. ================================================
  44261. FILE: packages/stdf/src/routes/cell/en_US/+page.svelte
  44262. ================================================
  44263. <!-- Cell Demo -->
  44264. <script lang="ts">
  44265. import { Cell, CellGroup, Toast } from '$lib/index.js';
  44266. let visible = $state(false);
  44267. </script>
  44268. <div class="flex flex-col space-y-8 py-8">
  44269. <div>
  44270. <Cell title="Basic Usage" />
  44271. <Cell title="With Detail" detail="Zeroing" />
  44272. <Cell title="Detail with Snippet">
  44273. {#snippet detailChild()}
  44274. <span class="text-primary dark:text-dark text-xs">I'm Snippet</span>
  44275. {/snippet}
  44276. </Cell>
  44277. <Cell title="No Arrow" right={null} />
  44278. <Cell title="Display Only" right={null} clickAll={false} />
  44279. <Cell title="Click Event" detail="Click Me" onclick={() => (visible = true)} />
  44280. <Toast bind:visible message="You clicked me!" />
  44281. <Cell title="Detail without Arrow" detail="Zeroing" right={null} />
  44282. <Cell title="Switch (Click Row)" right={{ type: 'switch' }} />
  44283. <Cell title="Switch with Detail" detail="Description" right={{ type: 'switch' }} />
  44284. <Cell title="Switch with Text" right={{ type: 'switch', switch: { inside: ['😭', '😄'] } }} />
  44285. <Cell title="Rounded Switch" right={{ type: 'switch', switch: { radius: 'full' } }} />
  44286. <Cell title="Switch Only" clickAll={false} right={{ type: 'switch' }} />
  44287. <Cell title="Left Icon" left={{ name: 'ri-bank-line', size: 20, theme: true, top: -2 }} />
  44288. <Cell title="Right Icon" right={{ type: 'icon', icon: { name: 'ri-battery-charge-line', size: 20, theme: true } }} />
  44289. <Cell title="Left Image">
  44290. {#snippet leftChild()}
  44291. <div class="mr-1 shrink-0">
  44292. <img class="h-6 w-6" src="/assets/images/icon_颁奖.png" alt="" />
  44293. </div>
  44294. {/snippet}
  44295. </Cell>
  44296. <Cell title="Both Side Images">
  44297. {#snippet leftChild()}
  44298. <div class="mr-1 shrink-0">
  44299. <img class="h-6 w-6" src="/assets/images/icon_评价.png" alt="" />
  44300. </div>
  44301. {/snippet}
  44302. {#snippet rightChild()}
  44303. <div class="mr-1 shrink-0">
  44304. <img class="h-6 w-6" src="/assets/images/icon_美食.png" alt="" />
  44305. </div>
  44306. {/snippet}
  44307. </Cell>
  44308. <Cell title="Larger Image">
  44309. {#snippet leftChild()}
  44310. <div class="mr-1 shrink-0">
  44311. <img class="h-10 w-10" src="/assets/images/icon_会员.png" alt="" />
  44312. </div>
  44313. {/snippet}
  44314. </Cell>
  44315. <Cell title="With Subtitle" subTitle="I'm subtitle" />
  44316. <Cell title="Subtitle and Detail" subTitle="I'm subtitle" detail="Zeroing" />
  44317. <Cell title="Secondary Info" detail="Zeroing" info="Reboot" />
  44318. <Cell title="Both Secondary" subTitle="I'm subtitle" detail="Zeroing" info="Reboot" />
  44319. <Cell title="Both Secondary" subTitle="I'm subtitle" detail="With Arrow" info="Reboot" />
  44320. <Cell
  44321. title="Both Secondary"
  44322. subTitle="With Left Icon"
  44323. detail="With Arrow"
  44324. info="Reboot"
  44325. left={{ name: 'ri-shopping-basket-line', theme: true }}
  44326. />
  44327. <Cell title="All Features" subTitle="Left Custom Image" detail="Right Arrow" info="No Border">
  44328. {#snippet leftChild()}
  44329. <div class="mr-1 shrink-0">
  44330. <img class="h-10 w-10" src="/assets/images/icon_火车票.png" alt="" />
  44331. </div>
  44332. {/snippet}
  44333. </Cell>
  44334. <Cell
  44335. title="Long title that wraps automatically when it exceeds the width of the container."
  44336. subTitle="Long subtitle that also wraps automatically when it exceeds the width."
  44337. />
  44338. <Cell
  44339. title="Large image with long title that wraps automatically. Try other combinations yourself."
  44340. subTitle="Short subtitle"
  44341. line={false}
  44342. >
  44343. {#snippet leftChild()}
  44344. <div class="mr-1 shrink-0">
  44345. <img class="h-20 w-20" src="/assets/images/icon_外卖.png" alt="" />
  44346. </div>
  44347. {/snippet}
  44348. </Cell>
  44349. </div>
  44350. <CellGroup>
  44351. <Cell title="Group Usage" mx="0" my="0" shadow="none" line radius="none" />
  44352. <Cell title="Group Usage" mx="0" my="0" shadow="none" radius="none" />
  44353. </CellGroup>
  44354. <CellGroup mx="0" radius="none">
  44355. <Cell title="Group Usage" detail="No Margin" mx="0" my="0" shadow="none" line radius="none" />
  44356. <Cell title="Group Usage" detail="No Radius" mx="0" my="0" shadow="none" radius="none" />
  44357. </CellGroup>
  44358. <CellGroup shadow="xl" radius="2xl">
  44359. <Cell title="Group Usage" detail="Large Shadow" mx="0" my="0" shadow="none" line radius="none" />
  44360. <Cell title="Group Usage" detail="Large Radius" mx="0" my="0" shadow="none" radius="none" />
  44361. </CellGroup>
  44362. <div>
  44363. <Cell title="No Margin" mx="0" radius="none" />
  44364. <Cell title="No Radius" radius="none" />
  44365. <Cell title="Base Radius" radius="sm" />
  44366. <Cell title="Medium Radius" radius="md" />
  44367. <Cell title="Large Radius" radius="lg" />
  44368. <Cell title="XL Radius" radius="xl" />
  44369. <Cell title="2XL Radius" radius="2xl" />
  44370. <Cell title="Full Radius" radius="full" />
  44371. <Cell title="Large Shadow" shadow="lg" />
  44372. </div>
  44373. <div>
  44374. <Cell title="Custom Text Color" injClass="text-primary dark:text-dark" />
  44375. <Cell title="Custom Background" injClass="!bg-extend0/20 active:!bg-extend0/10" line={false} />
  44376. </div>
  44377. <div>
  44378. <Cell love title="Care Version" />
  44379. <Cell love title="Care Version" detail="Care" />
  44380. <Cell love title="Care Version" left={{ name: 'ri-hand-heart-line', theme: true }} />
  44381. </div>
  44382. </div>
  44383. ================================================
  44384. FILE: packages/stdf/src/routes/cell/zh_CN/+page.svelte
  44385. ================================================
  44386. <!-- Cell Demo -->
  44387. <script lang="ts">
  44388. import { Cell, CellGroup, Toast } from '$lib/index.js';
  44389. let visible = $state(false);
  44390. </script>
  44391. <div class="flex flex-col space-y-8 py-8">
  44392. <div>
  44393. <Cell title="基础用法" />
  44394. <Cell title="右侧有详情" detail="归零者" />
  44395. <Cell title="详情使用 Snippet">
  44396. {#snippet detailChild()}
  44397. <span class="text-primary dark:text-dark text-xs">我是 Snippet</span>
  44398. {/snippet}
  44399. </Cell>
  44400. <Cell title="右侧无箭头" right={null} />
  44401. <Cell title="纯展示,无点击效果" right={null} clickAll={false} />
  44402. <Cell title="点击事件" detail="请点击我" onclick={() => (visible = true)} />
  44403. <Toast bind:visible message="你戳到我了!" />
  44404. <Cell title="右侧有详情无箭头" detail="归零者" right={null} />
  44405. <Cell title="右侧开关(点击整行皆可触发开关)" right={{ type: 'switch' }} />
  44406. <Cell title="开关带详情" detail="解释一下" right={{ type: 'switch' }} />
  44407. <Cell title="开关带文字" right={{ type: 'switch', switch: { inside: ['😭', '😄'] } }} />
  44408. <Cell title="开关全圆角" right={{ type: 'switch', switch: { radius: 'full' } }} />
  44409. <Cell title="仅点击开关触发" clickAll={false} right={{ type: 'switch' }} />
  44410. <Cell title="左侧使用 Icon 组件" left={{ name: 'ri-bank-line', size: 20, theme: true, top: -2 }} />
  44411. <Cell title="右侧使用 Icon 组件" right={{ type: 'icon', icon: { name: 'ri-battery-charge-line', size: 20, theme: true } }} />
  44412. <Cell title="左侧自定义图片">
  44413. {#snippet leftChild()}
  44414. <div class="mr-1 shrink-0">
  44415. <img class="h-6 w-6" src="/assets/images/icon_颁奖.png" alt="" />
  44416. </div>
  44417. {/snippet}
  44418. </Cell>
  44419. <Cell title="左右都自定义图片">
  44420. {#snippet leftChild()}
  44421. <div class="mr-1 shrink-0">
  44422. <img class="h-6 w-6" src="/assets/images/icon_评价.png" alt="" />
  44423. </div>
  44424. {/snippet}
  44425. {#snippet rightChild()}
  44426. <div class="mr-1 shrink-0">
  44427. <img class="h-6 w-6" src="/assets/images/icon_美食.png" alt="" />
  44428. </div>
  44429. {/snippet}
  44430. </Cell>
  44431. <Cell title="来张大点的图">
  44432. {#snippet leftChild()}
  44433. <div class="mr-1 shrink-0">
  44434. <img class="h-10 w-10" src="/assets/images/icon_会员.png" alt="" />
  44435. </div>
  44436. {/snippet}
  44437. </Cell>
  44438. <Cell title="左侧有次级标题" subTitle="我是次,但我不次" />
  44439. <Cell title="有次级标题和右侧详情" subTitle="我是次,但我不次" detail="归零者" />
  44440. <Cell title="右侧有次级信息" detail="归零者" info="重启者" />
  44441. <Cell title="左右侧都有次级内容" subTitle="我是次,但我不次" detail="归零者" info="重启者" />
  44442. <Cell title="左右侧都有次级内容" subTitle="我是次,但我不次" detail="再来个箭头" info="重启者" />
  44443. <Cell
  44444. title="右右侧都有次级内容"
  44445. subTitle="左侧再来个 Icon"
  44446. detail="再来个箭头"
  44447. info="重启者"
  44448. left={{ name: 'ri-shopping-basket-line', theme: true }}
  44449. />
  44450. <Cell title="图片什么也来吧" subTitle="左侧自定义图片" detail="右侧箭头" info="底部无分割线">
  44451. {#snippet leftChild()}
  44452. <div class="mr-1 shrink-0">
  44453. <img class="h-10 w-10" src="/assets/images/icon_火车票.png" alt="" />
  44454. </div>
  44455. {/snippet}
  44456. </Cell>
  44457. <Cell
  44458. title="标题超长长长长长长长长长长长长长长长长长长长,自动换行。"
  44459. subTitle="我这个次级标题也很长长长长长长长长长长长长长长长长长长长长长长长长长长。"
  44460. />
  44461. <Cell title="左侧自定义大图片,标题超长,自动换行。其余的搭配自己去尝试吧。" subTitle="我这个次级标题也很...哦不长了。" line={false}>
  44462. {#snippet leftChild()}
  44463. <div class="mr-1 shrink-0">
  44464. <img class="h-20 w-20" src="/assets/images/icon_外卖.png" alt="" />
  44465. </div>
  44466. {/snippet}
  44467. </Cell>
  44468. </div>
  44469. <CellGroup>
  44470. <Cell title="组合使用" mx="0" my="0" shadow="none" line radius="none" />
  44471. <Cell title="组合使用" mx="0" my="0" shadow="none" radius="none" />
  44472. </CellGroup>
  44473. <CellGroup mx="0" radius="none">
  44474. <Cell title="组合使用" detail="无横向间距" mx="0" my="0" shadow="none" line radius="none" />
  44475. <Cell title="组合使用" detail="无圆角" mx="0" my="0" shadow="none" radius="none" />
  44476. </CellGroup>
  44477. <CellGroup shadow="xl" radius="2xl">
  44478. <Cell title="组合使用" detail="加大投影" mx="0" my="0" shadow="none" line radius="none" />
  44479. <Cell title="组合使用" detail="加大圆角" mx="0" my="0" shadow="none" radius="none" />
  44480. </CellGroup>
  44481. <div>
  44482. <Cell title="左右无间距" mx="0" radius="none" />
  44483. <Cell title="无圆角" radius="none" />
  44484. <Cell title="基础圆角" radius="sm" />
  44485. <Cell title="中等圆角" radius="md" />
  44486. <Cell title="大圆角" radius="lg" />
  44487. <Cell title="加大圆角" radius="xl" />
  44488. <Cell title="更大圆角" radius="2xl" />
  44489. <Cell title="全圆角" radius="full" />
  44490. <Cell title="加大投影" shadow="lg" />
  44491. </div>
  44492. <div>
  44493. <Cell title="自定义文字颜色" injClass="text-primary dark:text-dark" />
  44494. <Cell title="自定义背景颜色" injClass="!bg-extend0/20 active:!bg-extend0/10" line={false} />
  44495. </div>
  44496. <div>
  44497. <Cell love title="关爱版" />
  44498. <Cell love title="关爱版" detail="关爱版" />
  44499. <Cell love title="关爱版" left={{ name: 'ri-hand-heart-line', theme: true }} />
  44500. </div>
  44501. </div>
  44502. ================================================
  44503. FILE: packages/stdf/src/routes/checkbox/en_US/+page.svelte
  44504. ================================================
  44505. <!-- Checkbox Demo -->
  44506. <script lang="ts">
  44507. import { quintOut } from 'svelte/easing';
  44508. import { crossfade } from 'svelte/transition';
  44509. import { flip } from 'svelte/animate';
  44510. import { Checkbox, CheckboxItem, Divider, Button, Icon } from '$lib/index.js';
  44511. import type { CheckboxItemProps } from '$lib/types/index.js';
  44512. const dota: CheckboxItemProps[] = [
  44513. { label: 'Jugg', name: 'Juggernaut' },
  44514. { label: 'SB', name: 'Spirit Breaker' },
  44515. { label: 'KOTL', name: 'Keeper of the Light' },
  44516. { label: 'Mag', name: 'Magnus' }
  44517. ];
  44518. let checkeds: string[] = $state([]);
  44519. const clickItemFn = (name: string) => {
  44520. checkeds = checkeds.includes(name) ? checkeds.filter((v) => v !== name) : [name, ...checkeds];
  44521. };
  44522. let checkedsCustom: string[] = $state([]);
  44523. const clickCustomFn = (name: string) => {
  44524. checkedsCustom = checkedsCustom.includes(name) ? checkedsCustom.filter((v) => v !== name) : [name, ...checkedsCustom];
  44525. };
  44526. const dotaInlines: CheckboxItemProps[] = [
  44527. { label: 'Lina', name: 'Lina' },
  44528. { label: 'SB', name: 'Spirit Breaker' },
  44529. { label: 'Morph', name: 'Morphling' },
  44530. { label: 'Sniper', name: 'Sniper' },
  44531. { label: 'Sven', name: 'Sven' },
  44532. { label: 'Invoker', name: 'Invoker' },
  44533. { label: 'Tide', name: 'Tidehunter' },
  44534. { label: 'Bat', name: 'Batrider' },
  44535. { label: 'Mag', name: 'Magnus' }
  44536. ];
  44537. let checkInlines: string[] = $state(['Spirit Breaker', 'Morphling']);
  44538. const dotaInlineFun = (name: string) => {
  44539. checkInlines = checkInlines.includes(name) ? checkInlines.filter((v) => v !== name) : [name, ...checkInlines];
  44540. };
  44541. const dotaImgs: (CheckboxItemProps & { imgName: string })[] = [
  44542. { label: 'Lina', name: 'Lina', imgName: '火女' },
  44543. { label: 'SB', name: 'Spirit Breaker', imgName: '小牛' },
  44544. { label: 'Morph', name: 'Morphling', imgName: '水人' },
  44545. { label: 'Sniper', name: 'Sniper', imgName: '火枪' },
  44546. { label: 'Sven', name: 'Sven', imgName: '斯温' }
  44547. ];
  44548. let imgCheckeds: string[] = $state(['Lina']);
  44549. const dotaImgsFun = (name: string) => {
  44550. imgCheckeds = imgCheckeds.includes(name) ? imgCheckeds.filter((v) => v !== name) : [name, ...imgCheckeds];
  44551. };
  44552. const dotaLong: CheckboxItemProps[] = [
  44553. { name: 'Jugg', label: 'Juggernaut is a melee agility hero who can quickly engage in combat.' },
  44554. { name: 'SB', label: 'Barathrum, Spirit Breaker is a powerful ganking strength melee hero.' },
  44555. { name: 'KOTL', label: 'Ezalor, Keeper of the Light, is a famous support intelligence hero.' },
  44556. { name: 'Mag', label: 'Magnus? Why not ban Magnus? Why not ban Magnus?' }
  44557. ];
  44558. const dotaVoices: (CheckboxItemProps & { voices: string[] })[] = [
  44559. { name: 'Invoker', label: 'Invoker', voices: ['"From the first point was begat a line."'] },
  44560. { name: 'Storm', label: 'Storm', voices: ['"Hey, wake up! Get some coffee, our tower is under attack."'] },
  44561. {
  44562. name: 'Batrider',
  44563. label: 'Batrider',
  44564. voices: [
  44565. '"Oh Lina, wanna be my queen?"',
  44566. '"Oh Windrunner, no need to run from me."',
  44567. '"Crystal Maiden, you\'re like a tall glass of water."'
  44568. ]
  44569. },
  44570. { name: 'Tidehunter', label: 'Tidehunter', voices: ['"I could eat a sea cucumber."'] }
  44571. ];
  44572. let voiceCheckeds: string[] = $state([]);
  44573. const dotaVoicesFun = (name: string) => {
  44574. voiceCheckeds = voiceCheckeds.includes(name) ? voiceCheckeds.filter((v) => v !== name) : [name, ...voiceCheckeds];
  44575. };
  44576. const dotaAll = [
  44577. { name: 'Lina', label: 'Lina' },
  44578. { name: 'SB', label: 'Spirit Breaker' },
  44579. { name: 'Morph', label: 'Morphling' },
  44580. { name: 'Sniper', label: 'Sniper' },
  44581. { name: 'Sven', label: 'Sven' },
  44582. { name: 'Invoker', label: 'Invoker' },
  44583. { name: 'Tide', label: 'Tidehunter' },
  44584. { name: 'Bat', label: 'Batrider' },
  44585. { name: 'Mag', label: 'Magnus' }
  44586. ];
  44587. let checkDotas = $state(['Sniper', 'Sven']);
  44588. let noCheckDotas = $derived(dotaAll.filter((a) => !checkDotas.some((b) => b === a.name)).map((a) => a.name));
  44589. // Select All
  44590. const checkAllFun = () => {
  44591. checkDotas = dotaAll.map((a) => a.name);
  44592. };
  44593. // Select None
  44594. const checkNoneFun = () => {
  44595. checkDotas = [];
  44596. };
  44597. // Reverse Selection
  44598. const checkReverseFun = () => {
  44599. checkDotas = dotaAll.filter((a) => !checkDotas.some((b) => b === a.name)).map((a) => a.name);
  44600. };
  44601. const animates = ['Lina', 'SB', 'Morph', 'Sniper', 'Sven', 'Invoker', 'Tide', 'Bat', 'Mag'];
  44602. let animateNos = $state(['Lina', 'SB', 'Morph', 'Sniper', 'Sven', 'Invoker']);
  44603. let animateYess: string[] = $derived(animates.filter((a) => !animateNos.some((b) => b === a)));
  44604. const checkAnimateNoFun = (name: string) => {
  44605. animateNos = animateNos.filter((a) => a !== name);
  44606. };
  44607. const checkAnimaYesFun = (name: string) => {
  44608. animateNos = [name, ...animateNos];
  44609. };
  44610. const [send, receive] = crossfade({
  44611. duration: (d) => Math.sqrt(d * 150),
  44612. fallback(node) {
  44613. const style = getComputedStyle(node);
  44614. const transform = style.transform === 'none' ? '' : style.transform;
  44615. return {
  44616. duration: 600,
  44617. easing: quintOut,
  44618. css: (t) => `
  44619. transform: ${transform} scale(${t});
  44620. opacity: ${t}
  44621. `
  44622. };
  44623. }
  44624. });
  44625. // Set height to avoid page height changes affecting click experience
  44626. let heights = $state(0);
  44627. let animateHeight = $derived(heights * animates.length + 50);
  44628. </script>
  44629. <div class="px-4">
  44630. <div class="mb-4 mt-8 text-2xl font-bold">Horizontal Layout</div>
  44631. <div class="mb-4 mt-6 text-lg font-bold">Basic Usage</div>
  44632. <Checkbox layout="h" data={dota} />
  44633. <Divider />
  44634. <div class="mb-4 mt-8 text-lg font-bold">Text Position</div>
  44635. <Checkbox layout="h" data={dota} textPosition="l" />
  44636. <Divider />
  44637. <Checkbox layout="h" data={dota} textPosition="b" />
  44638. <Divider />
  44639. <Checkbox layout="h" data={dota} textPosition="t" />
  44640. <Divider />
  44641. <div class="mb-4 mt-8 text-lg font-bold">Custom Icons</div>
  44642. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-blank-circle-line' }} iconChecked={{ name: 'ri-radio-button-fill' }} />
  44643. <Divider />
  44644. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-circle-line' }} iconChecked={{ name: 'ri-checkbox-circle-fill' }} />
  44645. <Divider />
  44646. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-multiple-line' }} iconChecked={{ name: 'ri-checkbox-multiple-fill' }} />
  44647. <Divider />
  44648. <Checkbox layout="h" data={dota} icon={{ name: 'ri-check-line' }} iconChecked={{ name: 'ri-check-fill' }} />
  44649. <Divider />
  44650. <Checkbox layout="h" data={dota} icon={{ name: 'ri-check-double-line' }} iconChecked={{ name: 'ri-check-double-line' }} />
  44651. <Divider />
  44652. <div class="mb-4 mt-8 text-lg font-bold">Snippet as Button Component</div>
  44653. <Checkbox layout="h" data={dota}>
  44654. {#snippet checkboxChild({ item })}
  44655. <Button
  44656. fill={checkeds.includes(item.name) ? 'base' : 'lineLight'}
  44657. injClass="px-2 !py-1"
  44658. onclick={() => {
  44659. clickItemFn(item.name);
  44660. }}
  44661. >
  44662. {item.label}
  44663. </Button>
  44664. {/snippet}
  44665. </Checkbox>
  44666. <Divider />
  44667. <div class="mb-4 mt-8 text-lg font-bold">Snippet as Custom Element</div>
  44668. <Checkbox layout="h" data={dota}>
  44669. {#snippet checkboxChild({ item })}
  44670. <button
  44671. class="rounded-sm border px-5 py-0.5 text-sm {checkedsCustom.includes(item.name)
  44672. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  44673. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  44674. onclick={() => {
  44675. clickCustomFn(item.name);
  44676. }}
  44677. >
  44678. {item.label}
  44679. </button>
  44680. {/snippet}
  44681. </Checkbox>
  44682. <Divider />
  44683. <div class="mb-4 mt-8 text-lg font-bold">Image Options</div>
  44684. <Checkbox layout="h" data={dotaImgs}>
  44685. {#snippet checkboxChild({ item })}
  44686. <div class="flex flex-col items-center">
  44687. <!-- svelte-ignore a11y_click_events_have_key_events -->
  44688. <!-- svelte-ignore a11y_no_static_element_interactions -->
  44689. <div
  44690. class="mb-1 h-12 w-12 overflow-hidden rounded-sm {imgCheckeds.includes(item.name) ? 'ring-primary dark:ring-dark ring-2' : ''}"
  44691. onclick={() => {
  44692. dotaImgsFun(item.name);
  44693. }}
  44694. >
  44695. <img class="h-full w-full object-cover" src={`/assets/images/dota_${item.imgName}.png`} alt="" />
  44696. </div>
  44697. <div>
  44698. <Icon
  44699. name={imgCheckeds.includes(item.name) ? 'ri-arrow-up-s-fill' : 'ri-arrow-up-s-line'}
  44700. theme={imgCheckeds.includes(item.name)}
  44701. alpha={imgCheckeds.includes(item.name) ? 1 : 0.2}
  44702. />
  44703. </div>
  44704. </div>
  44705. {/snippet}
  44706. </Checkbox>
  44707. <div class="text-sm">
  44708. {imgCheckeds.length > 0 ? 'Selected' : 'No heroes selected'}
  44709. <span class="text-[red]">{imgCheckeds.join(' + ')}</span>
  44710. </div>
  44711. <Divider />
  44712. </div>
  44713. <div class="px-4">
  44714. <div class="mb-4 text-2xl font-bold">Inline Layout</div>
  44715. <div class="mb-4 mt-8 text-lg font-bold">Snippet Inline Layout</div>
  44716. <Checkbox layout="inline" data={dotaInlines}>
  44717. {#snippet checkboxChild({ item })}
  44718. <!-- svelte-ignore a11y_click_events_have_key_events -->
  44719. <!-- svelte-ignore a11y_no_static_element_interactions -->
  44720. <div
  44721. class="m-1 rounded-sm border px-2 py-0.5 text-sm {checkInlines.includes(item.name)
  44722. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  44723. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  44724. onclick={() => {
  44725. dotaInlineFun(item.name);
  44726. }}
  44727. >
  44728. {item.label}
  44729. </div>
  44730. {/snippet}
  44731. </Checkbox>
  44732. <div class="mt-2 text-xs">Selected: {checkInlines.join('-')}</div>
  44733. </div>
  44734. <Divider />
  44735. <div class="px-4 pb-8">
  44736. <div class="mb-4 text-2xl font-bold">Vertical Layout</div>
  44737. <div class="mb-4 mt-8 text-lg font-bold">Basic Usage</div>
  44738. <Checkbox data={dota} />
  44739. <Divider />
  44740. <div class="mb-4 mt-8 text-lg font-bold">Long Text Options</div>
  44741. <Checkbox data={dotaLong} />
  44742. <Divider />
  44743. <div class="mb-4 mt-8 text-lg font-bold">Left Aligned Text</div>
  44744. <Checkbox data={dota} textPosition="l" />
  44745. <div class="mb-4 mt-8 text-lg font-bold">Complex Options && Custom Selection Effect</div>
  44746. <Checkbox data={dotaVoices}>
  44747. {#snippet checkboxChild({ item })}
  44748. <!-- svelte-ignore a11y_click_events_have_key_events -->
  44749. <!-- svelte-ignore a11y_no_static_element_interactions -->
  44750. <div class="flex cursor-pointer items-center" onclick={() => dotaVoicesFun(item.name)}>
  44751. <div>
  44752. <Icon
  44753. name={voiceCheckeds.includes(item.name) ? 'ri-checkbox-fill' : 'ri-checkbox-line'}
  44754. theme={voiceCheckeds.includes(item.name)}
  44755. alpha={voiceCheckeds.includes(item.name) ? 1 : 0.2}
  44756. />
  44757. </div>
  44758. <div class="ml-2 grow {voiceCheckeds.includes(item.name) ? 'text-primary dark:text-dark' : ''}">
  44759. {item.label}
  44760. {#each item.voices as string[] as voice}
  44761. <div class="text-xs">{voice}</div>
  44762. {/each}
  44763. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  44764. </div>
  44765. </div>
  44766. {/snippet}
  44767. </Checkbox>
  44768. <div class="mb-4 mt-8 text-lg font-bold">Batch Operations</div>
  44769. <Checkbox data={dotaAll} bind:checkeds={checkDotas} />
  44770. <div class="mt-2 text-xs">Selected: {checkDotas.map((a) => dotaAll.find((b) => b.name === a)?.label).join('-')}</div>
  44771. <div class="mt-2 text-xs">Unselected: {noCheckDotas.map((a) => dotaAll.find((b) => b.name === a)?.label).join('-')}</div>
  44772. <div class="mt-2 flex">
  44773. <div class="flex-1">
  44774. <Button fill="lineTheme" heightIn="1" onclick={checkAllFun}>All</Button>
  44775. </div>
  44776. <div class="flex-1">
  44777. <Button fill="lineTheme" heightIn="1" onclick={checkNoneFun}>None</Button>
  44778. </div>
  44779. <div class="flex-1">
  44780. <Button fill="lineTheme" heightIn="1" onclick={checkReverseFun}>Reverse</Button>
  44781. </div>
  44782. </div>
  44783. <Divider />
  44784. <div class="mb-4 mt-8 text-lg font-bold">With Animation</div>
  44785. <div class="flex justify-center" style="height: {animateHeight}px;">
  44786. <div class="flex-1">
  44787. <div class="pb-2">Unselected</div>
  44788. {#each animateNos as item (item)}
  44789. <div in:receive={{ key: item }} out:send={{ key: item }} animate:flip={{ duration: 600 }} bind:clientHeight={heights}>
  44790. <CheckboxItem name={item} checked={!animateNos.includes(item)} onclick={checkAnimateNoFun}>{item}</CheckboxItem>
  44791. </div>
  44792. {/each}
  44793. </div>
  44794. <div class="flex-1">
  44795. <div class="pb-2">Selected</div>
  44796. {#each animateYess as item (item)}
  44797. <div in:receive={{ key: item }} out:send={{ key: item }} animate:flip={{ duration: 600 }}>
  44798. <CheckboxItem name={item} checked={animateYess.includes(item)} onclick={checkAnimaYesFun}>{item}</CheckboxItem>
  44799. </div>
  44800. {/each}
  44801. </div>
  44802. </div>
  44803. </div>
  44804. ================================================
  44805. FILE: packages/stdf/src/routes/checkbox/zh_CN/+page.svelte
  44806. ================================================
  44807. <!-- Checkbox Demo -->
  44808. <script lang="ts">
  44809. import { quintOut } from 'svelte/easing';
  44810. import { crossfade } from 'svelte/transition';
  44811. import { flip } from 'svelte/animate';
  44812. import { Checkbox, CheckboxItem, Divider, Button, Icon } from '$lib/index.js';
  44813. import type { CheckboxItemProps } from '$lib/types/index.js';
  44814. const dota: CheckboxItemProps[] = [
  44815. { label: '主宰', name: '奶棒人' },
  44816. { label: '白牛', name: '令狐冲' },
  44817. { label: '光法', name: '光之守卫' },
  44818. { label: '猛犸', name: '马格纳斯' }
  44819. ];
  44820. let checkeds: string[] = $state([]);
  44821. const clickItemFn = (name: string) => {
  44822. checkeds = checkeds.includes(name) ? checkeds.filter((v) => v !== name) : [name, ...checkeds];
  44823. };
  44824. let checkedsCustom: string[] = $state([]);
  44825. const clickCustomFn = (name: string) => {
  44826. checkedsCustom = checkedsCustom.includes(name) ? checkedsCustom.filter((v) => v !== name) : [name, ...checkedsCustom];
  44827. };
  44828. const dotaInlines: CheckboxItemProps[] = [
  44829. { label: '火女', name: '火女' },
  44830. { label: '小牛', name: '小牛' },
  44831. { label: '水人', name: '水人' },
  44832. { label: '火枪', name: '火枪' },
  44833. { label: '斯温', name: '斯温' },
  44834. { label: '祈求者', name: '祈求者' },
  44835. { label: '潮汐', name: '潮汐' },
  44836. { label: '蝙蝠', name: '蝙蝠' },
  44837. { label: '猛犸', name: '猛犸' }
  44838. ];
  44839. let checkInlines: string[] = $state(['小牛', '水人']);
  44840. const dotaInlineFun = (name: string) => {
  44841. checkInlines = checkInlines.includes(name) ? checkInlines.filter((v) => v !== name) : [name, ...checkInlines];
  44842. };
  44843. const dotaImgs: CheckboxItemProps[] = [
  44844. { label: '火女', name: '火女' },
  44845. { label: '小牛', name: '小牛' },
  44846. { label: '水人', name: '水人' },
  44847. { label: '火枪', name: '火枪' },
  44848. { label: '斯温', name: '斯温' }
  44849. ];
  44850. let imgCheckeds: string[] = $state(['火女']);
  44851. const dotaImgsFun = (name: string) => {
  44852. imgCheckeds = imgCheckeds.includes(name) ? imgCheckeds.filter((v) => v !== name) : [name, ...imgCheckeds];
  44853. };
  44854. const dotaLong: CheckboxItemProps[] = [
  44855. { name: '主宰', label: '主宰是一个近战敏捷英雄,他能够迅速切入战斗。' },
  44856. { name: '白牛', label: '巴拉森,裂魂人是一个强大的 Gank 型的力量型近战英雄。' },
  44857. { name: '光法', label: '伊扎洛,光之守卫,他是一个著名的辅助性智力英雄。' },
  44858. { name: '猛犸', label: '猛犸?为什么不 BAN 猛犸?为什么不 BAN 猛犸?' }
  44859. ];
  44860. const dotaVoices: (CheckboxItemProps & { voices: string[] })[] = [
  44861. { name: '祈求者', label: '祈求者', voices: ['“来自于伟大的奥秘。”'] },
  44862. { name: '风暴之灵', label: '风暴之灵', voices: ['“喂~快醒醒,快喝点咖啡,我方上塔正遭受攻击。”'] },
  44863. {
  44864. name: '蝙蝠骑士',
  44865. label: '蝙蝠骑士',
  44866. voices: ['“哦,莉娜,当我的压寨夫人怎么样?”', '“哦,风行者,见着我你不用跑。”', '“水晶室女,你就像一个装满冰水的高脚杯。”']
  44867. },
  44868. { name: '潮汐猎人', label: '潮汐猎人', voices: ['“我还能吃下一根海藻。”'] }
  44869. ];
  44870. let voiceCheckeds: string[] = $state([]);
  44871. const dotaVoicesFun = (name: string) => {
  44872. voiceCheckeds = voiceCheckeds.includes(name) ? voiceCheckeds.filter((v) => v !== name) : [name, ...voiceCheckeds];
  44873. };
  44874. const dotaAll: CheckboxItemProps[] = [
  44875. { name: '火女', label: '火女' },
  44876. { name: '小牛', label: '小牛' },
  44877. { name: '水人', label: '水人' },
  44878. { name: '火枪', label: '火枪' },
  44879. { name: '斯温', label: '斯温' },
  44880. { name: '祈求者', label: '祈求者' },
  44881. { name: '潮汐', label: '潮汐' },
  44882. { name: '蝙蝠', label: '蝙蝠' },
  44883. { name: '猛犸', label: '猛犸' }
  44884. ];
  44885. let checkDotas = $state(['火枪', '斯温']);
  44886. let noCheckDotas = $derived(dotaAll.filter((a) => !checkDotas.some((b) => b === a.name)).map((a) => a.name));
  44887. // 全选
  44888. const checkAllFun = () => {
  44889. checkDotas = dotaAll.map((a) => a.name);
  44890. };
  44891. // 全不选
  44892. const checkNoneFun = () => {
  44893. checkDotas = [];
  44894. };
  44895. // 反选
  44896. const checkReverseFun = () => {
  44897. checkDotas = dotaAll.filter((a) => !checkDotas.some((b) => b === a.name)).map((a) => a.name);
  44898. };
  44899. const animates = ['火女', '小牛', '水人', '火枪', '斯温', '祈求者', '潮汐', '蝙蝠', '猛犸'];
  44900. let animateNos = $state(['火女', '小牛', '水人', '火枪', '斯温', '祈求者']);
  44901. let animateYess = $derived(animates.filter((a) => !animateNos.some((b) => b === a)));
  44902. const checkAnimateNoFun = (name: string) => {
  44903. animateNos = animateNos.filter((a) => a !== name);
  44904. };
  44905. const checkAnimaYesFun = (name: string) => {
  44906. animateNos = [name, ...animateNos];
  44907. };
  44908. const [send, receive] = crossfade({
  44909. duration: (d) => Math.sqrt(d * 150),
  44910. fallback(node) {
  44911. const style = getComputedStyle(node);
  44912. const transform = style.transform === 'none' ? '' : style.transform;
  44913. return {
  44914. duration: 600,
  44915. easing: quintOut,
  44916. css: (t) => `
  44917. transform: ${transform} scale(${t});
  44918. opacity: ${t}
  44919. `
  44920. };
  44921. }
  44922. });
  44923. // 设定高度,避免页面高度变化影响点击体验。
  44924. let heights = $state(0);
  44925. let animateHeight = $derived(heights * animates.length + 50);
  44926. </script>
  44927. <div class="px-4">
  44928. <div class="mb-4 mt-8 text-2xl font-bold">横向排列</div>
  44929. <div class="mb-4 mt-6 text-lg font-bold">简单用法</div>
  44930. <Checkbox layout="h" data={dota} />
  44931. <Divider />
  44932. <div class="mb-4 mt-8 text-lg font-bold">文字在不同位置</div>
  44933. <Checkbox layout="h" data={dota} textPosition="l" />
  44934. <Divider />
  44935. <Checkbox layout="h" data={dota} textPosition="b" />
  44936. <Divider />
  44937. <Checkbox layout="h" data={dota} textPosition="t" />
  44938. <Divider />
  44939. <div class="mb-4 mt-8 text-lg font-bold">自定义图标</div>
  44940. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-blank-circle-line' }} iconChecked={{ name: 'ri-radio-button-fill' }} />
  44941. <Divider />
  44942. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-circle-line' }} iconChecked={{ name: 'ri-checkbox-circle-fill' }} />
  44943. <Divider />
  44944. <Checkbox layout="h" data={dota} icon={{ name: 'ri-checkbox-multiple-line' }} iconChecked={{ name: 'ri-checkbox-multiple-fill' }} />
  44945. <Divider />
  44946. <Checkbox layout="h" data={dota} icon={{ name: 'ri-check-line' }} iconChecked={{ name: 'ri-check-fill' }} />
  44947. <Divider />
  44948. <Checkbox layout="h" data={dota} icon={{ name: 'ri-check-double-line' }} iconChecked={{ name: 'ri-check-double-line' }} />
  44949. <Divider />
  44950. <div class="mb-4 mt-8 text-lg font-bold">Snippet 为 Button 组件</div>
  44951. <Checkbox layout="h" data={dota}>
  44952. {#snippet checkboxChild({ item })}
  44953. <Button
  44954. fill={checkeds.includes(item.name) ? 'base' : 'lineLight'}
  44955. injClass="px-2 !py-1"
  44956. onclick={() => {
  44957. clickItemFn(item.name);
  44958. }}
  44959. >
  44960. {item.label}
  44961. </Button>
  44962. {/snippet}
  44963. </Checkbox>
  44964. <Divider />
  44965. <div class="mb-4 mt-8 text-lg font-bold">Snippet 为自定义元素</div>
  44966. <Checkbox layout="h" data={dota}>
  44967. {#snippet checkboxChild({ item })}
  44968. <button
  44969. class="rounded-sm border px-5 py-0.5 text-sm {checkedsCustom.includes(item.name)
  44970. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  44971. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  44972. onclick={() => {
  44973. clickCustomFn(item.name);
  44974. }}
  44975. >
  44976. {item.label}
  44977. </button>
  44978. {/snippet}
  44979. </Checkbox>
  44980. <Divider />
  44981. <div class="mb-4 mt-8 text-lg font-bold">图片选项</div>
  44982. <Checkbox layout="h" data={dotaImgs}>
  44983. {#snippet checkboxChild({ item })}
  44984. <div class="flex flex-col items-center">
  44985. <!-- svelte-ignore a11y_click_events_have_key_events -->
  44986. <!-- svelte-ignore a11y_no_static_element_interactions -->
  44987. <div
  44988. class="mb-1 h-12 w-12 overflow-hidden rounded-sm {imgCheckeds.includes(item.name) ? 'ring-primary dark:ring-dark ring-2' : ''}"
  44989. onclick={() => {
  44990. dotaImgsFun(item.name);
  44991. }}
  44992. >
  44993. <img class="h-full w-full object-cover" src={`/assets/images/dota_${item.name}.png`} alt="" />
  44994. </div>
  44995. <div>
  44996. <Icon
  44997. name={imgCheckeds.includes(item.name) ? 'ri-arrow-up-s-fill' : 'ri-arrow-up-s-line'}
  44998. theme={imgCheckeds.includes(item.name)}
  44999. alpha={imgCheckeds.includes(item.name) ? 1 : 0.2}
  45000. />
  45001. </div>
  45002. </div>
  45003. {/snippet}
  45004. </Checkbox>
  45005. <div class="text-sm">
  45006. {imgCheckeds.length > 0 ? '已选' : '未选择任何英雄'}
  45007. <span class="text-[red]">{imgCheckeds.join(' + ')}</span>
  45008. </div>
  45009. <Divider />
  45010. </div>
  45011. <div class="px-4">
  45012. <div class="mb-4 text-2xl font-bold">行内元素排列</div>
  45013. <div class="mb-4 mt-8 text-lg font-bold">Snippet 行内元素排列</div>
  45014. <Checkbox layout="inline" data={dotaInlines}>
  45015. {#snippet checkboxChild({ item })}
  45016. <!-- svelte-ignore a11y_click_events_have_key_events -->
  45017. <!-- svelte-ignore a11y_no_static_element_interactions -->
  45018. <div
  45019. class="m-1 rounded-sm border px-2 py-0.5 text-sm {checkInlines.includes(item.name)
  45020. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  45021. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  45022. onclick={() => {
  45023. dotaInlineFun(item.name);
  45024. }}
  45025. >
  45026. {item.label}
  45027. </div>
  45028. {/snippet}
  45029. </Checkbox>
  45030. <div class="mt-2 text-xs">已选:{checkInlines.join('-')}</div>
  45031. </div>
  45032. <Divider />
  45033. <div class="px-4 pb-8">
  45034. <div class="mb-4 text-2xl font-bold">纵向排列</div>
  45035. <div class="mb-4 mt-8 text-lg font-bold">基础用法</div>
  45036. <Checkbox data={dota} />
  45037. <Divider />
  45038. <div class="mb-4 mt-8 text-lg font-bold">长文字选项</div>
  45039. <Checkbox data={dotaLong} />
  45040. <Divider />
  45041. <div class="mb-4 mt-8 text-lg font-bold">文字靠左</div>
  45042. <Checkbox data={dota} textPosition="l" />
  45043. <div class="mb-4 mt-8 text-lg font-bold">复杂选项 && 自定义选中效果</div>
  45044. <Checkbox data={dotaVoices}>
  45045. {#snippet checkboxChild({ item })}
  45046. <!-- svelte-ignore a11y_click_events_have_key_events -->
  45047. <!-- svelte-ignore a11y_no_static_element_interactions -->
  45048. <div class="flex cursor-pointer items-center" onclick={() => dotaVoicesFun(item.name)}>
  45049. <div>
  45050. <Icon
  45051. name={voiceCheckeds.includes(item.name) ? 'ri-checkbox-fill' : 'ri-checkbox-line'}
  45052. theme={voiceCheckeds.includes(item.name)}
  45053. alpha={voiceCheckeds.includes(item.name) ? 1 : 0.2}
  45054. />
  45055. </div>
  45056. <div class="ml-2 grow {voiceCheckeds.includes(item.name) ? 'text-primary dark:text-dark' : ''}">
  45057. {item.label}
  45058. {#each item.voices as string[] as voice}
  45059. <div class="text-xs">{voice}</div>
  45060. {/each}
  45061. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  45062. </div>
  45063. </div>
  45064. {/snippet}
  45065. </Checkbox>
  45066. <div class="mb-4 mt-8 text-lg font-bold">批量操作</div>
  45067. <Checkbox data={dotaAll} bind:checkeds={checkDotas} />
  45068. <div class="mt-2 text-xs">已选:{checkDotas.map((a) => dotaAll.find((b) => b.name === a)?.label).join('-')}</div>
  45069. <div class="mt-2 text-xs">未选:{noCheckDotas.map((a) => dotaAll.find((b) => b.name === a)?.label).join('-')}</div>
  45070. <div class="mt-2 flex">
  45071. <div class="flex-1">
  45072. <Button fill="lineTheme" heightIn="1" onclick={checkAllFun}>全选</Button>
  45073. </div>
  45074. <div class="flex-1">
  45075. <Button fill="lineTheme" heightIn="1" onclick={checkNoneFun}>全不选</Button>
  45076. </div>
  45077. <div class="flex-1">
  45078. <Button fill="lineTheme" heightIn="1" onclick={checkReverseFun}>反选</Button>
  45079. </div>
  45080. </div>
  45081. <Divider />
  45082. <div class="mb-4 mt-8 text-lg font-bold">带动画</div>
  45083. <div class="flex justify-center" style="height: {animateHeight}px;">
  45084. <div class="flex-1">
  45085. <div class="pb-2">未选</div>
  45086. {#each animateNos as item (item)}
  45087. <div in:receive={{ key: item }} out:send={{ key: item }} animate:flip={{ duration: 600 }} bind:clientHeight={heights}>
  45088. <CheckboxItem name={item} checked={!animateNos.includes(item)} onclick={checkAnimateNoFun}>{item}</CheckboxItem>
  45089. </div>
  45090. {/each}
  45091. </div>
  45092. <div class="flex-1">
  45093. <div class="pb-2">已选</div>
  45094. {#each animateYess as item (item)}
  45095. <div in:receive={{ key: item }} out:send={{ key: item }} animate:flip={{ duration: 600 }}>
  45096. <CheckboxItem name={item} checked={animateYess.includes(item)} onclick={checkAnimaYesFun}>{item}</CheckboxItem>
  45097. </div>
  45098. {/each}
  45099. </div>
  45100. </div>
  45101. </div>
  45102. ================================================
  45103. FILE: packages/stdf/src/routes/components/Aphorism.svelte
  45104. ================================================
  45105. <script lang="ts">
  45106. // 引入数据
  45107. // import data
  45108. import aphorisms from '../../data/aphorisms.js';
  45109. /**
  45110. * @typedef {Object} Props
  45111. * @property {number} [num] - number of items to display
  45112. * @property {boolean} [compact] - whether to use compact mode
  45113. */
  45114. /** @type {Props} */
  45115. let { num = 0, compact = false } = $props();
  45116. // 从 aphorisms 随机取出 num 条数据
  45117. // get num items from aphorisms randomly
  45118. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  45119. </script>
  45120. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  45121. {#each aphorismsList as item}
  45122. <div class:py-6={num > 1}>
  45123. <div class="text-justify text-sm">{item.text}</div>
  45124. <div class="mt-1 text-right" class:italic={item.fromItalic}>{item.from}</div>
  45125. </div>
  45126. {/each}
  45127. </div>
  45128. ================================================
  45129. FILE: packages/stdf/src/routes/components/ThemeSwitch.svelte
  45130. ================================================
  45131. <script lang="ts">
  45132. import { switchTheme } from '$lib/theme/index.js';
  45133. import themes from '../../data/themes/index.js';
  45134. const isZh = sessionStorage.getItem('lang') === 'zh_CN';
  45135. let currentColor = $state('STDF');
  45136. const selectColorFunc = (e: MouseEvent, item: (typeof themes)[number]) => {
  45137. // 阻止冒泡
  45138. // Prevent bubbling
  45139. e.stopPropagation();
  45140. currentColor = item.name;
  45141. switchTheme(item.theme);
  45142. };
  45143. </script>
  45144. <div class="my-2 flex flex-col flex-wrap gap-1">
  45145. {#each themes as item (item.name)}
  45146. <button
  45147. class="flex items-center justify-between gap-0.5 border px-0.5 py-1 {currentColor === item.name
  45148. ? 'border-primary dark:border-dark'
  45149. : 'border-gray-100 dark:border-gray-700'} cursor-pointer rounded-sm"
  45150. onclick={(e) => selectColorFunc(e, item)}
  45151. >
  45152. <div class="size-3 {currentColor === item.name ? 'fill-primary dark:fill-dark' : 'fill-gray-300 dark:fill-gray-700'}">
  45153. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  45154. <path
  45155. d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM7.5 12C8.32843 12 9 11.3284 9 10.5C9 9.67157 8.32843 9 7.5 9C6.67157 9 6 9.67157 6 10.5C6 11.3284 6.67157 12 7.5 12ZM16.5 12C17.3284 12 18 11.3284 18 10.5C18 9.67157 17.3284 9 16.5 9C15.6716 9 15 9.67157 15 10.5C15 11.3284 15.6716 12 16.5 12ZM12 9C12.8284 9 13.5 8.32843 13.5 7.5C13.5 6.67157 12.8284 6 12 6C11.1716 6 10.5 6.67157 10.5 7.5C10.5 8.32843 11.1716 9 12 9Z"
  45156. >
  45157. </path>
  45158. </svg>
  45159. </div>
  45160. <div class="flex-1 whitespace-nowrap text-left text-xs font-normal">{isZh ? item.name_CN : item.name}</div>
  45161. <div class="flex justify-between gap-1">
  45162. <!-- theme -->
  45163. <div class="rounded-xs flex overflow-hidden">
  45164. <div class="bg-primary w-3" style="background-color: {item.theme.color.primary.default};"></div>
  45165. <div class="bg-dark w-3" style="background-color: {item.theme.color.dark.default};"></div>
  45166. </div>
  45167. <div class="flex flex-col justify-between gap-px">
  45168. <!-- Functional -->
  45169. <div class="flex gap-px">
  45170. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.success};"></div>
  45171. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.warning};"></div>
  45172. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.error};"></div>
  45173. <div class="size-1.5 rounded" style="background-color: {item.theme.color.functional.info};"></div>
  45174. </div>
  45175. <!-- Extended -->
  45176. <div class="flex justify-between gap-px">
  45177. {#each item.theme.color?.extend ?? [] as child (child.alias)}
  45178. <div class="size-1.5 rounded" style="background-color: {child.color};"></div>
  45179. {/each}
  45180. </div>
  45181. </div>
  45182. </div>
  45183. </button>
  45184. {/each}
  45185. </div>
  45186. ================================================
  45187. FILE: packages/stdf/src/routes/dialog/en_US/+page.svelte
  45188. ================================================
  45189. <!-- Dialog Demo -->
  45190. <script lang="ts">
  45191. import { Dialog, Cell, Toast, Loading } from '$lib/index.js';
  45192. import Aphorism from '../../components/Aphorism.svelte';
  45193. let visible1 = $state(false);
  45194. let visible2 = $state(false);
  45195. let visible3 = $state(false);
  45196. let visible4 = $state(false);
  45197. let visible5 = $state(false);
  45198. let visible6 = $state(false);
  45199. let visible7 = $state(false);
  45200. let visible8 = $state(false);
  45201. let visible9 = $state(false);
  45202. let visible10 = $state(false);
  45203. let visible11 = $state(false);
  45204. let visible12 = $state(false);
  45205. let visible13 = $state(false);
  45206. let visible14 = $state(false);
  45207. let visible15 = $state(false);
  45208. let visible16 = $state(false);
  45209. let visible17 = $state(false);
  45210. let visible18 = $state(false);
  45211. let visible19 = $state(false);
  45212. let toastVisible = $state(false);
  45213. let toastVisible2 = $state(false);
  45214. let toastVisible3 = $state(false);
  45215. let toastVisible4 = $state(false);
  45216. $effect(() => {
  45217. if (visible8) {
  45218. setTimeout(() => {
  45219. visible8 = false;
  45220. }, 3000);
  45221. }
  45222. });
  45223. let loading = $state(false);
  45224. const somethingFnc = () => {
  45225. loading = true;
  45226. setTimeout(() => {
  45227. loading = false;
  45228. visible18 = false;
  45229. toastVisible4 = true;
  45230. }, 3000);
  45231. };
  45232. </script>
  45233. <div class="py-4">
  45234. <Cell title="Basic Usage" onclick={() => (visible1 = true)} />
  45235. <Dialog bind:visible={visible1} title="Li Xiaoyao" content="Go to Fairy Island?" />
  45236. <Cell title="Content with Snippet" onclick={() => (visible2 = true)} />
  45237. <Dialog bind:visible={visible2}>
  45238. {#snippet contentChild()}
  45239. <Aphorism num={1} compact />
  45240. {/snippet}
  45241. </Dialog>
  45242. <Cell title="No Title" onclick={() => (visible3 = true)} />
  45243. <Dialog bind:visible={visible3} title="" />
  45244. <Cell title="Close on Mask Click" onclick={() => (visible5 = true)} />
  45245. <Dialog bind:visible={visible5} popup={{ maskClosable: true }} />
  45246. <Cell title="Custom Icon" onclick={() => (visible6 = true)} />
  45247. <Dialog
  45248. bind:visible={visible6}
  45249. content="Please wear a mask!"
  45250. showIcon
  45251. icon={{ name: 'ri-surgical-mask-fill', size: 40, injClass: 'text-[#48a1b4]' }}
  45252. secondaryText="No mask"
  45253. primaryText="OK"
  45254. />
  45255. <Cell title="Scrollable Content" onclick={() => (visible4 = true)} />
  45256. <Dialog bind:visible={visible4}>
  45257. {#snippet contentChild()}
  45258. <div class="max-h-56 overflow-auto">
  45259. <Aphorism num={6} compact />
  45260. </div>
  45261. {/snippet}
  45262. </Dialog>
  45263. <Cell title="Bounce Animation" onclick={() => (visible11 = true)} />
  45264. <Dialog bind:visible={visible11} content="Bounce transition" popup={{ easeType: 'backOut' }} />
  45265. <Cell title="Left Title" onclick={() => (visible7 = true)} />
  45266. <Dialog bind:visible={visible7} title="Left Title" titleAlign="left" />
  45267. <Cell title="Auto Close" onclick={() => (visible8 = true)} />
  45268. <Dialog bind:visible={visible8} content="Don't move! Closing in 3s!" />
  45269. <Cell title="Primary Button Ratio" onclick={() => (visible9 = true)} />
  45270. <Dialog bind:visible={visible9} btnRatio={[3, 2]} />
  45271. <Cell title="Reverse Button Order" onclick={() => (visible10 = true)} />
  45272. <Dialog bind:visible={visible10} btnReverse />
  45273. <Cell title="Larger Button Gap" onclick={() => (visible19 = true)} />
  45274. <Dialog bind:visible={visible19} btnGap="16" />
  45275. <Cell title="Text Buttons" onclick={() => (visible12 = true)} />
  45276. <Dialog bind:visible={visible12} btnStyle="text" />
  45277. <Cell title="Text Buttons with Line" onclick={() => (visible13 = true)} />
  45278. <Dialog bind:visible={visible13} btnStyle="textLine" />
  45279. <Cell title="Rounded Buttons" onclick={() => (visible15 = true)} />
  45280. <Dialog bind:visible={visible15} primaryButton={{ radius: 'full' }} secondaryButton={{ radius: 'full' }} />
  45281. <Cell title="Secondary Event" onclick={() => (visible14 = true)} />
  45282. <Dialog bind:visible={visible14} onsecondary={() => (toastVisible = true)} />
  45283. <Toast bind:visible={toastVisible} message="Cancelled!" />
  45284. <Cell title="Close Event" onclick={() => (visible16 = true)} />
  45285. <Dialog bind:visible={visible16} onclose={() => (toastVisible2 = true)} />
  45286. <Toast bind:visible={toastVisible2} message="Dialog closed!" />
  45287. <Cell title="Primary Event" onclick={() => (visible17 = true)} />
  45288. <Dialog bind:visible={visible17} onprimary={() => (toastVisible3 = true)} />
  45289. <Toast bind:visible={toastVisible3} message="Confirmed!" />
  45290. <Cell title="Async Primary Event" onclick={() => (visible18 = true)} />
  45291. <Dialog bind:visible={visible18} onprimary={somethingFnc} title="Ghost" content="Enter the Demon Tower?">
  45292. {#snippet primaryChild()}
  45293. <span>
  45294. {#if loading}
  45295. <Loading inverse width="12" height="6" type="1_17" />
  45296. {:else}
  45297. Enter
  45298. {/if}
  45299. </span>
  45300. {/snippet}
  45301. </Dialog>
  45302. <Toast bind:visible={toastVisible4} message="Entered the tower!" />
  45303. </div>
  45304. <!-- Aphorism.svelte -->
  45305. <!--
  45306. <script lang="ts">
  45307. // 引入数据
  45308. // import data
  45309. import aphorisms from '../../data/aphorisms';
  45310. /**
  45311. * @typedef {Object} Props
  45312. * @property {number} [num] - number of items to display
  45313. * @property {boolean} [compact] - whether to use compact mode
  45314. */
  45315. /** @type {Props} */
  45316. let { num = 0, compact = false } = $props();
  45317. // 从 aphorisms 随机取出 num 条数据
  45318. // get num items from aphorisms randomly
  45319. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  45320. </script>
  45321. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  45322. {#each aphorismsList as item}
  45323. <div class:py-6={num > 1}>
  45324. <div class="text-sm text-justify">{item.text}</div>
  45325. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  45326. </div>
  45327. {/each}
  45328. </div>
  45329. -->
  45330. ================================================
  45331. FILE: packages/stdf/src/routes/dialog/zh_CN/+page.svelte
  45332. ================================================
  45333. <!-- Dialog Demo -->
  45334. <script lang="ts">
  45335. import { Dialog, Cell, Toast, Loading } from '$lib/index.js';
  45336. import Aphorism from '../../components/Aphorism.svelte';
  45337. let visible1 = $state(false);
  45338. let visible2 = $state(false);
  45339. let visible3 = $state(false);
  45340. let visible4 = $state(false);
  45341. let visible5 = $state(false);
  45342. let visible6 = $state(false);
  45343. let visible7 = $state(false);
  45344. let visible8 = $state(false);
  45345. let visible9 = $state(false);
  45346. let visible10 = $state(false);
  45347. let visible11 = $state(false);
  45348. let visible12 = $state(false);
  45349. let visible13 = $state(false);
  45350. let visible14 = $state(false);
  45351. let visible15 = $state(false);
  45352. let visible16 = $state(false);
  45353. let visible17 = $state(false);
  45354. let visible18 = $state(false);
  45355. let visible19 = $state(false);
  45356. let toastVisible = $state(false);
  45357. let toastVisible2 = $state(false);
  45358. let toastVisible3 = $state(false);
  45359. let toastVisible4 = $state(false);
  45360. $effect(() => {
  45361. if (visible8) {
  45362. setTimeout(() => {
  45363. visible8 = false;
  45364. }, 3000);
  45365. }
  45366. });
  45367. let loading = $state(false);
  45368. const somethingFnc = () => {
  45369. loading = true;
  45370. setTimeout(() => {
  45371. loading = false;
  45372. visible18 = false;
  45373. toastVisible4 = true;
  45374. }, 3000);
  45375. };
  45376. </script>
  45377. <div class="py-4">
  45378. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  45379. <Dialog bind:visible={visible1} title="李逍遥" content="你确认前往仙灵岛吗?" />
  45380. <Cell title="内容使用 Snippet" onclick={() => (visible2 = true)} />
  45381. <Dialog bind:visible={visible2}>
  45382. {#snippet contentChild()}
  45383. <Aphorism num={1} compact />
  45384. {/snippet}
  45385. </Dialog>
  45386. <Cell title="不显示标题" onclick={() => (visible3 = true)} />
  45387. <Dialog bind:visible={visible3} title="" />
  45388. <Cell title="点击遮罩关闭" onclick={() => (visible5 = true)} />
  45389. <Dialog bind:visible={visible5} popup={{ maskClosable: true }} />
  45390. <Cell title="自定义图标" onclick={() => (visible6 = true)} />
  45391. <Dialog
  45392. bind:visible={visible6}
  45393. content="请佩戴口罩!"
  45394. showIcon
  45395. icon={{ name: 'ri-surgical-mask-fill', size: 40, injClass: 'text-[#48a1b4]' }}
  45396. secondaryText="没携带"
  45397. primaryText="好的"
  45398. />
  45399. <Cell title="内容使用 Snippet 且滚动" onclick={() => (visible4 = true)} />
  45400. <Dialog bind:visible={visible4}>
  45401. {#snippet contentChild()}
  45402. <div class="max-h-56 overflow-auto">
  45403. <Aphorism num={6} compact />
  45404. </div>
  45405. {/snippet}
  45406. </Dialog>
  45407. <Cell title="另一种动画效果" onclick={() => (visible11 = true)} />
  45408. <Dialog bind:visible={visible11} content="回弹过渡" popup={{ easeType: 'backOut' }} />
  45409. <Cell title="标题居左" onclick={() => (visible7 = true)} />
  45410. <Dialog bind:visible={visible7} title="标题居左" titleAlign="left" />
  45411. <Cell title="自动关闭" onclick={() => (visible8 = true)} />
  45412. <Dialog bind:visible={visible8} content="别动!3 秒后我立即消失!" />
  45413. <Cell title="主按钮占比多一点" onclick={() => (visible9 = true)} />
  45414. <Dialog bind:visible={visible9} btnRatio={[3, 2]} />
  45415. <Cell title="主次按钮位置反转" onclick={() => (visible10 = true)} />
  45416. <Dialog bind:visible={visible10} btnReverse />
  45417. <Cell title="按钮间距大一点" onclick={() => (visible19 = true)} />
  45418. <Dialog bind:visible={visible19} btnGap="16" />
  45419. <Cell title="按钮为纯文字" onclick={() => (visible12 = true)} />
  45420. <Dialog bind:visible={visible12} btnStyle="text" />
  45421. <Cell title="按钮为纯文字有分割线" onclick={() => (visible13 = true)} />
  45422. <Dialog bind:visible={visible13} btnStyle="textLine" />
  45423. <Cell title="全圆角按钮" onclick={() => (visible15 = true)} />
  45424. <Dialog bind:visible={visible15} primaryButton={{ radius: 'full' }} secondaryButton={{ radius: 'full' }} />
  45425. <Cell title="监听次要事件" onclick={() => (visible14 = true)} />
  45426. <Dialog bind:visible={visible14} onsecondary={() => (toastVisible = true)} />
  45427. <Toast bind:visible={toastVisible} message="点击了取消!" />
  45428. <Cell title="监听关闭事件" onclick={() => (visible16 = true)} />
  45429. <Dialog bind:visible={visible16} onclose={() => (toastVisible2 = true)} />
  45430. <Toast bind:visible={toastVisible2} message="关闭了 Dialog!" />
  45431. <Cell title="监听主要事件" onclick={() => (visible17 = true)} />
  45432. <Dialog bind:visible={visible17} onprimary={() => (toastVisible3 = true)} />
  45433. <Toast bind:visible={toastVisible3} message="点击了确认!" />
  45434. <Cell title="异步执行主要事件" onclick={() => (visible18 = true)} />
  45435. <Dialog bind:visible={visible18} onprimary={somethingFnc} title="小鬼" content="你一定要进入锁妖塔吗?">
  45436. {#snippet primaryChild()}
  45437. <span>
  45438. {#if loading}
  45439. <Loading inverse width="12" height="6" type="1_17" />
  45440. {:else}
  45441. 进入
  45442. {/if}
  45443. </span>
  45444. {/snippet}
  45445. </Dialog>
  45446. <Toast bind:visible={toastVisible4} message="已进入锁妖塔!" />
  45447. </div>
  45448. <!-- Aphorism.svelte -->
  45449. <!--
  45450. <script lang=""ts>
  45451. // 引入数据
  45452. // import data
  45453. import aphorisms from '../../data/aphorisms';
  45454. /**
  45455. * @typedef {Object} Props
  45456. * @property {number} [num] - number of items to display
  45457. * @property {boolean} [compact] - whether to use compact mode
  45458. */
  45459. /** @type {Props} */
  45460. let { num = 0, compact = false } = $props();
  45461. // 从 aphorisms 随机取出 num 条数据
  45462. // get num items from aphorisms randomly
  45463. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  45464. </script>
  45465. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  45466. {#each aphorismsList as item}
  45467. <div class:py-6={num > 1}>
  45468. <div class="text-sm text-justify">{item.text}</div>
  45469. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  45470. </div>
  45471. {/each}
  45472. </div>
  45473. -->
  45474. ================================================
  45475. FILE: packages/stdf/src/routes/divider/en_US/+page.svelte
  45476. ================================================
  45477. <!-- Divider Demo -->
  45478. <script lang="ts">
  45479. import { Divider } from '$lib/index.js';
  45480. </script>
  45481. <div class="flex flex-col space-y-8 py-8">
  45482. <div>
  45483. <div class="p-4 font-bold">Different lengths</div>
  45484. <Divider />
  45485. <Divider px="4" />
  45486. <Divider px="8" />
  45487. <Divider px="16" />
  45488. <Divider px="36" />
  45489. </div>
  45490. <div>
  45491. <div class="p-4 font-bold">Text</div>
  45492. <Divider text="The Guzheng Project" />
  45493. <Divider px="4" text="Red Cliff Base" />
  45494. </div>
  45495. <div>
  45496. <div class="p-4 font-bold">Different heights</div>
  45497. <div class="px-4 text-sm">Start</div>
  45498. <Divider py="0" />
  45499. <div class="px-4 text-sm">Height is 0</div>
  45500. <Divider />
  45501. <div class="px-4 text-sm">Height is 4</div>
  45502. <Divider py="8" />
  45503. <div class="px-4 text-sm">Height is 8</div>
  45504. </div>
  45505. <div>
  45506. <div class="p-4 font-bold">Text position</div>
  45507. <Divider text="Left" align="left" />
  45508. <Divider text="Center" />
  45509. <Divider text="Right" align="right" />
  45510. </div>
  45511. <div>
  45512. <div class="p-4 font-bold">Line style</div>
  45513. <Divider text="Solid" />
  45514. <Divider line="dashed" text="Dashed" />
  45515. <Divider line="dotted" text="Dotted" />
  45516. </div>
  45517. <div>
  45518. <div class="p-4 font-bold">Custom color</div>
  45519. <Divider injClass="!border-[blue] dark:!border-[yellow]" />
  45520. <Divider text="Custom line" injClass="!border-[red] dark:!border-[purple]" />
  45521. <Divider text="Custom text" injClass="!text-[red]" />
  45522. <Divider text="Custom line and text" injClass="!border-[red] !text-[blue] dark:!text-[purple]" />
  45523. <Divider line="dashed" text="Custom dashed line" injClass="!border-[#FF5722]" />
  45524. </div>
  45525. <div class="px-4">
  45526. <div class="py-4 font-bold">Vertical divider</div>
  45527. <div class="text-sm">
  45528. Three days in the sky<Divider layout="v" />Three days in a row<Divider layout="v" />Human computer
  45529. </div>
  45530. </div>
  45531. <div>
  45532. <div class="p-4 font-bold">Different weights</div>
  45533. <Divider />
  45534. <Divider weight="2" />
  45535. <Divider weight="4" />
  45536. <div class="px-4 text-sm">
  45537. Guardian<Divider layout="v" />Three days in the sky<Divider layout="v" weight="2" />Three days in a row<Divider
  45538. layout="v"
  45539. weight="4"
  45540. />Human computer
  45541. </div>
  45542. </div>
  45543. <div class="px-4">
  45544. <div class="py-4 font-bold">Custom vertical divider</div>
  45545. <div class="text-sm">
  45546. Increase spacing
  45547. <Divider layout="v" mx="4" />
  45548. Custom
  45549. <Divider layout="v" mx="4" injClass="!border-[red] dark:!border-[purple]" />
  45550. Color
  45551. <Divider line="dashed" layout="v" mx="4" injClass="!border-[red] dark:!border-[purple]" />
  45552. Line style
  45553. </div>
  45554. </div>
  45555. </div>
  45556. ================================================
  45557. FILE: packages/stdf/src/routes/divider/zh_CN/+page.svelte
  45558. ================================================
  45559. <!-- Divider Demo -->
  45560. <script lang="ts">
  45561. import { Divider } from '$lib/index.js';
  45562. </script>
  45563. <div class="flex flex-col space-y-8 py-8">
  45564. <div>
  45565. <div class="p-4 font-bold">不同长度</div>
  45566. <Divider />
  45567. <Divider px="4" />
  45568. <Divider px="8" />
  45569. <Divider px="16" />
  45570. <Divider px="36" />
  45571. </div>
  45572. <div>
  45573. <div class="p-4 font-bold">包含文字</div>
  45574. <Divider text="古筝计划" />
  45575. <Divider px="4" text="红岸基地" />
  45576. </div>
  45577. <div>
  45578. <div class="p-4 font-bold">不同高度</div>
  45579. <div class="px-4 text-sm">开始</div>
  45580. <Divider py="0" />
  45581. <div class="px-4 text-sm">高度为 0</div>
  45582. <Divider />
  45583. <div class="px-4 text-sm">高度为 4</div>
  45584. <Divider py="8" />
  45585. <div class="px-4 text-sm">高度为 8</div>
  45586. </div>
  45587. <div>
  45588. <div class="p-4 font-bold">文字位置</div>
  45589. <Divider text="左侧" align="left" />
  45590. <Divider text="居中" />
  45591. <Divider text="右侧" align="right" />
  45592. </div>
  45593. <div>
  45594. <div class="p-4 font-bold">线条风格</div>
  45595. <Divider text="实线" />
  45596. <Divider line="dashed" text="虚线" />
  45597. <Divider line="dotted" text="点线" />
  45598. </div>
  45599. <div>
  45600. <div class="p-4 font-bold">自定义颜色</div>
  45601. <Divider injClass="!border-[blue] dark:!border-[yellow]" />
  45602. <Divider text="自定义线条" injClass="!border-[red] dark:!border-[purple]" />
  45603. <Divider text="自定义文字" injClass="!text-[red]" />
  45604. <Divider text="自定义线条与文字" injClass="!border-[red] !text-[blue] dark:!text-[purple]" />
  45605. <Divider line="dashed" text="自定义虚线" injClass="!border-[#FF5722]" />
  45606. </div>
  45607. <div class="px-4">
  45608. <div class="py-4 font-bold">垂直分割线</div>
  45609. <div class="text-sm">
  45610. 三日凌空<Divider layout="v" />三日连珠<Divider layout="v" />人列计算机
  45611. </div>
  45612. </div>
  45613. <div>
  45614. <div class="p-4 font-bold">不同粗细</div>
  45615. <Divider />
  45616. <Divider weight="2" />
  45617. <Divider weight="4" />
  45618. <div class="px-4 text-sm">
  45619. 执剑人<Divider layout="v" />三日凌空<Divider layout="v" weight="2" />三日连珠<Divider layout="v" weight="4" />人列计算机
  45620. </div>
  45621. </div>
  45622. <div class="px-4">
  45623. <div class="py-4 font-bold">自定义垂直分割线</div>
  45624. <div class="text-sm">
  45625. 加大间距
  45626. <Divider layout="v" mx="4" />
  45627. 自定义
  45628. <Divider layout="v" mx="4" injClass="!border-[red] dark:!border-[purple]" />
  45629. 颜色
  45630. <Divider line="dashed" layout="v" mx="4" injClass="!border-[red] dark:!border-[purple]" />
  45631. 与线条风格
  45632. </div>
  45633. </div>
  45634. </div>
  45635. ================================================
  45636. FILE: packages/stdf/src/routes/grids/en_US/+page.svelte
  45637. ================================================
  45638. <!-- Grids Demo -->
  45639. <script lang="ts">
  45640. import { Grids, Grid, Placeholder, Switch, Icon, Button } from '$lib/index.js';
  45641. const devices = ['iOS', 'Android', 'Windows', 'macOS', 'Ubuntu'];
  45642. let curentIndex = $state(0);
  45643. let currentDevice = $derived(devices[curentIndex]);
  45644. const changeDeviceFun = () => {
  45645. if (curentIndex === devices.length - 1) {
  45646. curentIndex = 0;
  45647. } else {
  45648. curentIndex++;
  45649. }
  45650. };
  45651. let color = $state(false);
  45652. let colorCss = $derived(`${color ? ' bg-gradient-to-tr from-extend0/70 to-extend2/70' : ' bg-gray-100 dark:bg-gray-700'}`);
  45653. const changeColorFun = (active: boolean) => {
  45654. color = active;
  45655. };
  45656. // Get current date
  45657. const date = new Date();
  45658. // Get current month in Chinese
  45659. const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  45660. const monthIndex = date.getMonth();
  45661. let month = $derived(monthArr[monthIndex]);
  45662. const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  45663. const hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
  45664. const minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
  45665. let time = $derived(`${hour}:${minute}`);
  45666. // Get Chinese week
  45667. const week = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  45668. let weekDay = $derived(week[date.getDay()]);
  45669. </script>
  45670. <div class="mt-8 px-4 font-bold">Using Placeholder Example 3﹡4</div>
  45671. <Grids cols="4">
  45672. <Grid row="3">
  45673. <Placeholder>3﹡1</Placeholder>
  45674. </Grid>
  45675. <Grid col="3">
  45676. <Placeholder>1﹡3</Placeholder>
  45677. </Grid>
  45678. <Grid row="2">
  45679. <Placeholder>2﹡1</Placeholder>
  45680. </Grid>
  45681. <Grid col="2">
  45682. <Placeholder>1﹡2</Placeholder>
  45683. </Grid>
  45684. <Grid>
  45685. <Placeholder>1﹡1</Placeholder>
  45686. </Grid>
  45687. <Grid>
  45688. <Placeholder>1﹡1</Placeholder>
  45689. </Grid>
  45690. </Grids>
  45691. <div class="mt-8 px-4 font-bold">Using Placeholder Example 4﹡6</div>
  45692. <Grids>
  45693. <Grid row="3" col="2">
  45694. <Placeholder>3﹡2</Placeholder>
  45695. </Grid>
  45696. <Grid col="3">
  45697. <Placeholder>1﹡3</Placeholder>
  45698. </Grid>
  45699. <Grid row="4">
  45700. <Placeholder>4﹡1</Placeholder>
  45701. </Grid>
  45702. <Grid row="2">
  45703. <Placeholder>2﹡1</Placeholder>
  45704. </Grid>
  45705. <Grid>
  45706. <Placeholder>1﹡1</Placeholder>
  45707. </Grid>
  45708. <Grid>
  45709. <Placeholder>1﹡1</Placeholder>
  45710. </Grid>
  45711. <Grid>
  45712. <Placeholder>1﹡1</Placeholder>
  45713. </Grid>
  45714. <Grid>
  45715. <Placeholder>1﹡1</Placeholder>
  45716. </Grid>
  45717. <Grid>
  45718. <Placeholder>1﹡1</Placeholder>
  45719. </Grid>
  45720. <Grid col="4">
  45721. <Placeholder>1﹡4</Placeholder>
  45722. </Grid>
  45723. </Grids>
  45724. <div class="mt-8 px-4 font-bold">Increase Margin and Cell Gap</div>
  45725. <Grids cols="4" gap="4" mx="8" my="8">
  45726. <Grid row="3">
  45727. <Placeholder>3﹡1</Placeholder>
  45728. </Grid>
  45729. <Grid col="3">
  45730. <Placeholder>1﹡3</Placeholder>
  45731. </Grid>
  45732. <Grid row="2">
  45733. <Placeholder>2﹡1</Placeholder>
  45734. </Grid>
  45735. <Grid col="2">
  45736. <Placeholder>1﹡2</Placeholder>
  45737. </Grid>
  45738. <Grid>
  45739. <Placeholder>1﹡1</Placeholder>
  45740. </Grid>
  45741. <Grid>
  45742. <Placeholder>1﹡1</Placeholder>
  45743. </Grid>
  45744. </Grids>
  45745. <div class="mt-8 px-4 font-bold">Scene Example 6﹡5</div>
  45746. <div class="pb-8 pt-2">
  45747. <div class={`mx-2 rounded-xl p-2 shadow-sm transition duration-300${colorCss}`}>
  45748. <Grids cols="5" mx="0" my="0">
  45749. <Grid row="3">
  45750. <div
  45751. class="flex h-full flex-col justify-between rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45752. >
  45753. <div>{weekDay}</div>
  45754. <div class="text-4xl">{day}</div>
  45755. <div class="text-gray-600">{month}</div>
  45756. </div>
  45757. </Grid>
  45758. <Grid row="2">
  45759. <div
  45760. class="flex h-full flex-col justify-center rounded-lg bg-white p-1 text-center text-xl font-bold shadow-sm dark:bg-black dark:shadow-white/10"
  45761. >
  45762. {time}
  45763. </div>
  45764. </Grid>
  45765. <Grid row="2">
  45766. <div
  45767. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45768. >
  45769. <div class="flex justify-center">
  45770. <Switch radius="full" onchange={changeColorFun}>
  45771. {#snippet falseChild()}
  45772. <div><Icon name="ri-paint-brush-line" size={12} /></div>
  45773. {/snippet}
  45774. {#snippet trueChild()}
  45775. <div><Icon name="ri-paint-brush-fill" size={12} theme /></div>
  45776. {/snippet}
  45777. </Switch>
  45778. </div>
  45779. <div>Colorful</div>
  45780. </div>
  45781. </Grid>
  45782. <Grid row="2" col="2">
  45783. <div
  45784. class="flex h-full flex-col justify-center rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45785. >
  45786. <Button fill="lineTheme" radius="full" onclick={changeDeviceFun}>Device</Button>
  45787. </div>
  45788. </Grid>
  45789. <Grid row="2" col="2">
  45790. <div
  45791. class="flex h-full justify-around rounded-lg bg-white p-1 py-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45792. >
  45793. <div class="flex flex-col justify-center">
  45794. {#if currentDevice === 'iOS'}
  45795. <Icon name="ri-apple-fill" size={30} />
  45796. {:else if currentDevice === 'Android'}
  45797. <Icon name="ri-android-fill" size={30} />
  45798. {:else if currentDevice === 'Windows'}
  45799. <Icon name="ri-windows-fill" size={30} />
  45800. {:else if currentDevice === 'macOS'}
  45801. <Icon name="ri-command-fill" size={30} />
  45802. {:else}
  45803. <Icon name="ri-ubuntu-fill" size={30} />
  45804. {/if}
  45805. </div>
  45806. <div class="flex flex-col justify-around">
  45807. <div class="text-sm">
  45808. {#if currentDevice === 'iOS'}
  45809. A15 Bionic
  45810. {:else if currentDevice === 'Android'}
  45811. Snapdragon
  45812. {:else if currentDevice === 'Windows'}
  45813. AMD YES
  45814. {:else if currentDevice === 'macOS'}
  45815. M1 Ultra
  45816. {:else}
  45817. Intel
  45818. {/if}
  45819. </div>
  45820. <div>
  45821. {#if currentDevice === 'iOS'}
  45822. iPhone
  45823. {:else if currentDevice === 'Android'}
  45824. Android
  45825. {:else if currentDevice === 'Windows'}
  45826. Windows
  45827. {:else if currentDevice === 'macOS'}
  45828. MacBook Pro
  45829. {:else}
  45830. Ubuntu
  45831. {/if}
  45832. </div>
  45833. </div>
  45834. </div>
  45835. </Grid>
  45836. <Grid row="2">
  45837. <div
  45838. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45839. >
  45840. <div class="flex justify-center">
  45841. <Switch radius="full">
  45842. {#snippet falseChild()}
  45843. <div><Icon name="ri-bluetooth-line" size={12} top={-1} /></div>
  45844. {/snippet}
  45845. {#snippet trueChild()}
  45846. <div><Icon name="ri-bluetooth-connect-line" size={12} theme top={-1} /></div>
  45847. {/snippet}
  45848. </Switch>
  45849. </div>
  45850. <div>Bluetooth</div>
  45851. </div>
  45852. </Grid>
  45853. <Grid row="4">
  45854. <div
  45855. class="flex h-full flex-col items-center justify-around rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45856. >
  45857. <div class="w-1/2 overflow-hidden">
  45858. <img class="block dark:hidden" src="/assets/stdf_512px.png" alt="" />
  45859. <img class="hidden dark:block" src="/assets/stdf_dark_512px.png" alt="" />
  45860. </div>
  45861. <div>STDF</div>
  45862. </div>
  45863. </Grid>
  45864. <Grid row="3">
  45865. <div
  45866. class="flex h-full flex-col justify-around rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45867. >
  45868. <div>92%</div>
  45869. <div class="animate-pulse">
  45870. <Icon name="ri-battery-2-charge-line" size={30} injClass="text-extend1" />
  45871. </div>
  45872. <div>充电中</div>
  45873. </div>
  45874. </Grid>
  45875. <Grid row="2">
  45876. <div
  45877. class="flex h-full flex-col justify-center rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45878. >
  45879. {#if currentDevice === 'iOS'}
  45880. <Icon name="ri-smartphone-line" size={30} />
  45881. {:else if currentDevice === 'Android'}
  45882. <Icon name="ri-tablet-line" size={30} />
  45883. {:else if currentDevice === 'Windows'}
  45884. <Icon name="ri-computer-line" size={30} />
  45885. {:else if currentDevice === 'macOS'}
  45886. <Icon name="ri-macbook-fill" size={30} />
  45887. {:else}
  45888. <Icon name="ri-ubuntu-line" size={30} />
  45889. {/if}
  45890. </div>
  45891. </Grid>
  45892. <Grid row="2">
  45893. <div
  45894. class="flex h-full flex-col items-center justify-around rounded-lg bg-white py-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45895. >
  45896. <div>
  45897. <Icon name="ri-sun-line" size={20} />
  45898. </div>
  45899. <div>
  45900. <div>68%</div>
  45901. </div>
  45902. </div>
  45903. </Grid>
  45904. <Grid row="2">
  45905. <div
  45906. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  45907. >
  45908. <div class="flex justify-center">
  45909. <Switch radius="full">
  45910. {#snippet falseChild()}
  45911. <div><Icon name="ri-wifi-off-line" size={12} /></div>
  45912. {/snippet}
  45913. {#snippet trueChild()}
  45914. <div><Icon name="ri-wifi-line" size={12} theme /></div>
  45915. {/snippet}
  45916. </Switch>
  45917. </div>
  45918. <div>Wi-Fi</div>
  45919. </div>
  45920. </Grid>
  45921. </Grids>
  45922. </div>
  45923. </div>
  45924. ================================================
  45925. FILE: packages/stdf/src/routes/grids/zh_CN/+page.svelte
  45926. ================================================
  45927. <!-- Grids Demo -->
  45928. <script lang="ts">
  45929. import { Grids, Grid, Placeholder, Switch, Icon, Button } from '$lib/index.js';
  45930. const devices = ['iOS', 'Android', 'Windows', 'macOS', 'Ubuntu'];
  45931. let curentIndex: number = $state(0);
  45932. let currentDevice: string = $derived(devices[curentIndex]);
  45933. const changeDeviceFun = () => {
  45934. if (curentIndex === devices.length - 1) {
  45935. curentIndex = 0;
  45936. } else {
  45937. curentIndex++;
  45938. }
  45939. };
  45940. let color = $state(false);
  45941. let colorCss = $derived(color ? ' bg-gradient-to-tr from-extend0/70 to-extend2/70' : ' bg-gray-100 dark:bg-gray-700');
  45942. const changeColorFun = (active: boolean) => {
  45943. color = active;
  45944. };
  45945. //获取当前时间
  45946. const date = new Date();
  45947. //获取当前月份转为汉字
  45948. const monthArr = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
  45949. const monthIndex = date.getMonth();
  45950. let month = $derived(monthArr[monthIndex]);
  45951. const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  45952. const hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
  45953. const minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
  45954. let time = $derived(`${hour}:${minute}`);
  45955. //获取中文周几
  45956. const week = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
  45957. let weekDay = $derived(week[date.getDay()]);
  45958. </script>
  45959. <div class="mt-8 px-4 font-bold">使用占位符示例 3﹡4</div>
  45960. <Grids cols="4">
  45961. <Grid row="3">
  45962. <Placeholder>3﹡1</Placeholder>
  45963. </Grid>
  45964. <Grid col="3">
  45965. <Placeholder>1﹡3</Placeholder>
  45966. </Grid>
  45967. <Grid row="2">
  45968. <Placeholder>2﹡1</Placeholder>
  45969. </Grid>
  45970. <Grid col="2">
  45971. <Placeholder>1﹡2</Placeholder>
  45972. </Grid>
  45973. <Grid>
  45974. <Placeholder>1﹡1</Placeholder>
  45975. </Grid>
  45976. <Grid>
  45977. <Placeholder>1﹡1</Placeholder>
  45978. </Grid>
  45979. </Grids>
  45980. <div class="mt-8 px-4 font-bold">使用占位符示例 4﹡6</div>
  45981. <Grids>
  45982. <Grid row="3" col="2">
  45983. <Placeholder>3﹡2</Placeholder>
  45984. </Grid>
  45985. <Grid col="3">
  45986. <Placeholder>1﹡3</Placeholder>
  45987. </Grid>
  45988. <Grid row="4">
  45989. <Placeholder>4﹡1</Placeholder>
  45990. </Grid>
  45991. <Grid row="2">
  45992. <Placeholder>2﹡1</Placeholder>
  45993. </Grid>
  45994. <Grid>
  45995. <Placeholder>1﹡1</Placeholder>
  45996. </Grid>
  45997. <Grid>
  45998. <Placeholder>1﹡1</Placeholder>
  45999. </Grid>
  46000. <Grid>
  46001. <Placeholder>1﹡1</Placeholder>
  46002. </Grid>
  46003. <Grid>
  46004. <Placeholder>1﹡1</Placeholder>
  46005. </Grid>
  46006. <Grid>
  46007. <Placeholder>1﹡1</Placeholder>
  46008. </Grid>
  46009. <Grid col="4">
  46010. <Placeholder>1﹡4</Placeholder>
  46011. </Grid>
  46012. </Grids>
  46013. <div class="mt-8 px-4 font-bold">增加外边距与单元格间距</div>
  46014. <Grids cols="4" gap="4" mx="8" my="8">
  46015. <Grid row="3">
  46016. <Placeholder>3﹡1</Placeholder>
  46017. </Grid>
  46018. <Grid col="3">
  46019. <Placeholder>1﹡3</Placeholder>
  46020. </Grid>
  46021. <Grid row="2">
  46022. <Placeholder>2﹡1</Placeholder>
  46023. </Grid>
  46024. <Grid col="2">
  46025. <Placeholder>1﹡2</Placeholder>
  46026. </Grid>
  46027. <Grid>
  46028. <Placeholder>1﹡1</Placeholder>
  46029. </Grid>
  46030. <Grid>
  46031. <Placeholder>1﹡1</Placeholder>
  46032. </Grid>
  46033. </Grids>
  46034. <div class="mt-8 px-4 font-bold">场景示例 6﹡5</div>
  46035. <div class="pb-8 pt-2">
  46036. <div class="mx-2 rounded-xl p-2 shadow-sm transition duration-300{colorCss}">
  46037. <Grids cols="5" mx="0" my="0">
  46038. <Grid row="3">
  46039. <div
  46040. class="flex h-full flex-col justify-between rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46041. >
  46042. <div>{weekDay}</div>
  46043. <div class="text-4xl">{day}</div>
  46044. <div class="text-gray-600">{month}</div>
  46045. </div>
  46046. </Grid>
  46047. <Grid row="2">
  46048. <div
  46049. class="flex h-full flex-col justify-center rounded-lg bg-white p-1 text-center text-xl font-bold shadow-sm dark:bg-black dark:shadow-white/10"
  46050. >
  46051. {time}
  46052. </div>
  46053. </Grid>
  46054. <Grid row="2">
  46055. <div
  46056. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46057. >
  46058. <div class="flex justify-center">
  46059. <Switch radius="full" onchange={changeColorFun}>
  46060. {#snippet falseChild()}
  46061. <div><Icon name="ri-paint-brush-line" size={12} /></div>
  46062. {/snippet}
  46063. {#snippet trueChild()}
  46064. <div><Icon name="ri-paint-brush-fill" size={12} theme /></div>
  46065. {/snippet}
  46066. </Switch>
  46067. </div>
  46068. <div>彩色</div>
  46069. </div>
  46070. </Grid>
  46071. <Grid row="2" col="2">
  46072. <div
  46073. class="flex h-full flex-col justify-center rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46074. >
  46075. <Button fill="lineTheme" radius="full" onclick={changeDeviceFun}>切换设备</Button>
  46076. </div>
  46077. </Grid>
  46078. <Grid row="2" col="2">
  46079. <div
  46080. class="flex h-full justify-around rounded-lg bg-white p-1 py-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46081. >
  46082. <div class="flex flex-col justify-center">
  46083. {#if currentDevice === 'iOS'}
  46084. <Icon name="ri-apple-fill" size={30} />
  46085. {:else if currentDevice === 'Android'}
  46086. <Icon name="ri-android-fill" size={30} />
  46087. {:else if currentDevice === 'Windows'}
  46088. <Icon name="ri-windows-fill" size={30} />
  46089. {:else if currentDevice === 'macOS'}
  46090. <Icon name="ri-command-fill" size={30} />
  46091. {:else}
  46092. <Icon name="ri-ubuntu-fill" size={30} />
  46093. {/if}
  46094. </div>
  46095. <div class="flex flex-col justify-around">
  46096. <div class="text-sm">
  46097. {#if currentDevice === 'iOS'}
  46098. A15 Bionic
  46099. {:else if currentDevice === 'Android'}
  46100. 骁龙 8 Gen1
  46101. {:else if currentDevice === 'Windows'}
  46102. AMD YES
  46103. {:else if currentDevice === 'macOS'}
  46104. M1 Ultra
  46105. {:else}
  46106. Intel
  46107. {/if}
  46108. </div>
  46109. <div>
  46110. {#if currentDevice === 'iOS'}
  46111. iPhone
  46112. {:else if currentDevice === 'Android'}
  46113. Android
  46114. {:else if currentDevice === 'Windows'}
  46115. Windows
  46116. {:else if currentDevice === 'macOS'}
  46117. MacBook Pro
  46118. {:else}
  46119. Ubuntu
  46120. {/if}
  46121. </div>
  46122. </div>
  46123. </div>
  46124. </Grid>
  46125. <Grid row="2">
  46126. <div
  46127. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46128. >
  46129. <div class="flex justify-center">
  46130. <Switch radius="full">
  46131. {#snippet falseChild()}
  46132. <div><Icon name="ri-bluetooth-line" size={12} top={-1} /></div>
  46133. {/snippet}
  46134. {#snippet trueChild()}
  46135. <div><Icon name="ri-bluetooth-connect-line" size={12} theme top={-1} /></div>
  46136. {/snippet}
  46137. </Switch>
  46138. </div>
  46139. <div>蓝 牙</div>
  46140. </div>
  46141. </Grid>
  46142. <Grid row="4">
  46143. <div
  46144. class="flex h-full flex-col items-center justify-around rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46145. >
  46146. <div class="w-1/2 overflow-hidden">
  46147. <img class="block dark:hidden" src="/assets/stdf_512px.png" alt="" />
  46148. <img class="hidden dark:block" src="/assets/stdf_dark_512px.png" alt="" />
  46149. </div>
  46150. <div>STDF</div>
  46151. </div>
  46152. </Grid>
  46153. <Grid row="3">
  46154. <div
  46155. class="flex h-full flex-col justify-around rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46156. >
  46157. <div>92%</div>
  46158. <div class="animate-pulse">
  46159. <Icon name="ri-battery-2-charge-line" size={30} injClass="text-extend1" />
  46160. </div>
  46161. <div>充电中</div>
  46162. </div>
  46163. </Grid>
  46164. <Grid row="2">
  46165. <div
  46166. class="flex h-full flex-col justify-center rounded-lg bg-white text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46167. >
  46168. {#if currentDevice === 'iOS'}
  46169. <Icon name="ri-smartphone-line" size={30} />
  46170. {:else if currentDevice === 'Android'}
  46171. <Icon name="ri-tablet-line" size={30} />
  46172. {:else if currentDevice === 'Windows'}
  46173. <Icon name="ri-computer-line" size={30} />
  46174. {:else if currentDevice === 'macOS'}
  46175. <Icon name="ri-macbook-fill" size={30} />
  46176. {:else}
  46177. <Icon name="ri-ubuntu-line" size={30} />
  46178. {/if}
  46179. </div>
  46180. </Grid>
  46181. <Grid row="2">
  46182. <div
  46183. class="flex h-full flex-col items-center justify-around rounded-lg bg-white py-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46184. >
  46185. <div>
  46186. <Icon name="ri-sun-line" size={20} />
  46187. </div>
  46188. <div>
  46189. <div>68%</div>
  46190. </div>
  46191. </div>
  46192. </Grid>
  46193. <Grid row="2">
  46194. <div
  46195. class="flex h-full flex-col justify-around rounded-lg bg-white p-1 text-center text-xs shadow-sm dark:bg-black dark:shadow-white/10"
  46196. >
  46197. <div class="flex justify-center">
  46198. <Switch radius="full">
  46199. {#snippet falseChild()}
  46200. <div><Icon name="ri-wifi-off-line" size={12} /></div>
  46201. {/snippet}
  46202. {#snippet trueChild()}
  46203. <div><Icon name="ri-wifi-line" size={12} theme /></div>
  46204. {/snippet}
  46205. </Switch>
  46206. </div>
  46207. <div>Wi-Fi</div>
  46208. </div>
  46209. </Grid>
  46210. </Grids>
  46211. </div>
  46212. </div>
  46213. ================================================
  46214. FILE: packages/stdf/src/routes/icon/en_US/+page.svelte
  46215. ================================================
  46216. <!-- Icon Demo, Please make sure you have been introduced symbol.svg file. -->
  46217. <script lang="ts">
  46218. import { Icon } from '$lib/index.js';
  46219. const icons = ['ri-spy-fill', 'ri-chrome-fill', 'ri-riding-line', 'ri-switch-fill'];
  46220. </script>
  46221. <div class="felx felx-col space-y-12 px-4 py-8">
  46222. <div>
  46223. <div class="mb-2 text-xl font-bold">Basic usage</div>
  46224. <div class="flex flex-wrap justify-between">
  46225. {#each icons as icon}
  46226. <div class="flex-1 py-2 text-center">
  46227. <Icon name={icon} />
  46228. <div class="mt-2 text-xs">{icon}</div>
  46229. </div>
  46230. {/each}
  46231. </div>
  46232. </div>
  46233. <div>
  46234. <div class="mb-2 text-xl font-bold">Follow the theme color</div>
  46235. <div class="flex flex-wrap justify-between">
  46236. {#each icons as icon}
  46237. <div class="flex-1 py-2 text-center">
  46238. <Icon name={icon} theme />
  46239. </div>
  46240. {/each}
  46241. </div>
  46242. </div>
  46243. <div>
  46244. <div class="mb-2 text-xl font-bold">Different size</div>
  46245. <div class="flex flex-wrap justify-between">
  46246. {#each icons as icon, i}
  46247. <div class="flex-1 py-2 text-center">
  46248. <Icon name={icon} size={18 + i * 6} />
  46249. <div class="mt-2 text-xs">{18 + i * 6}</div>
  46250. </div>
  46251. {/each}
  46252. </div>
  46253. </div>
  46254. <div>
  46255. <div class="mb-2 text-xl font-bold">Different transparency</div>
  46256. <div class="flex flex-wrap justify-between">
  46257. {#each icons as icon, i}
  46258. <div class="flex-1 py-2 text-center">
  46259. <Icon name={icon} alpha={Number((0.2 + i * 0.2).toFixed(1))} />
  46260. <div class="mt-2 text-xs">{(0.2 + i * 0.2).toFixed(1)}</div>
  46261. </div>
  46262. {/each}
  46263. </div>
  46264. </div>
  46265. <div>
  46266. <div class="mb-2 text-xl font-bold">
  46267. Custom color<span class="ml-2 text-xs font-normal">By injClass</span>
  46268. </div>
  46269. <div class="flex flex-wrap justify-between">
  46270. {#each icons as icon}
  46271. <div class="flex-1 py-2 text-center">
  46272. <Icon name={icon} injClass="text-[red] dark:text-[green]" />
  46273. </div>
  46274. {/each}
  46275. </div>
  46276. </div>
  46277. <div>
  46278. <div class="mb-2 text-xl font-bold">
  46279. Custom color<span class="ml-2 text-xs font-normal">by Snippet</span>
  46280. </div>
  46281. <div class="flex flex-wrap justify-between">
  46282. {#each icons as icon}
  46283. <div class="flex-1 py-2 text-center">
  46284. <Icon><i class="text-[#266CF6] dark:text-[#C84031]"> <Icon name={icon} /></i></Icon>
  46285. </div>
  46286. {/each}
  46287. </div>
  46288. </div>
  46289. <div>
  46290. <div class="mb-2 text-xl font-bold">Snippet</div>
  46291. <div class="flex flex-wrap justify-between">
  46292. {#each icons as icon, index}
  46293. <div class="flex-1 py-2 text-center">
  46294. <Icon>
  46295. <svg
  46296. height="24"
  46297. width="24"
  46298. aria-hidden="true"
  46299. viewBox="0 0 16 16"
  46300. data-view-component="true"
  46301. style="display: inline;"
  46302. class={index % 2 ? 'fill-primary dark:fill-dark' : 'fill-black dark:fill-white'}
  46303. >
  46304. <path
  46305. fill-rule="evenodd"
  46306. d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
  46307. />
  46308. </svg>
  46309. </Icon>
  46310. </div>
  46311. {/each}
  46312. </div>
  46313. </div>
  46314. <div>
  46315. <div class="mb-2 text-xl font-bold">Offset</div>
  46316. <div class="flex flex-wrap justify-between">
  46317. {#each icons as icon, i}
  46318. <div class="flex-1 py-2 text-center">
  46319. <Icon name={icons[1]} top={-4 + i * 2} />
  46320. top:{-4 + i * 2}
  46321. </div>
  46322. {/each}
  46323. </div>
  46324. </div>
  46325. </div>
  46326. ================================================
  46327. FILE: packages/stdf/src/routes/icon/zh_CN/+page.svelte
  46328. ================================================
  46329. <!-- Icon Demo,请确保已引入 symbol.svg 文件。 -->
  46330. <script lang="ts">
  46331. import { Icon } from '$lib/index.js';
  46332. const icons = ['ri-spy-fill', 'ri-chrome-fill', 'ri-riding-line', 'ri-switch-fill'];
  46333. </script>
  46334. <div class="felx felx-col space-y-12 px-4 py-8">
  46335. <div>
  46336. <div class="mb-2 text-xl font-bold">基础用法</div>
  46337. <div class="flex flex-wrap justify-between">
  46338. {#each icons as icon}
  46339. <div class="flex-1 py-2 text-center">
  46340. <Icon name={icon} />
  46341. <div class="mt-2 text-xs">{icon}</div>
  46342. </div>
  46343. {/each}
  46344. </div>
  46345. </div>
  46346. <div>
  46347. <div class="mb-2 text-xl font-bold">跟随主题色</div>
  46348. <div class="flex flex-wrap justify-between">
  46349. {#each icons as icon}
  46350. <div class="flex-1 py-2 text-center">
  46351. <Icon name={icon} theme />
  46352. </div>
  46353. {/each}
  46354. </div>
  46355. </div>
  46356. <div>
  46357. <div class="mb-2 text-xl font-bold">不同大小</div>
  46358. <div class="flex flex-wrap justify-between">
  46359. {#each icons as icon, i}
  46360. <div class="flex-1 py-2 text-center">
  46361. <Icon name={icon} size={18 + i * 6} />
  46362. <div class="mt-2 text-xs">{18 + i * 6}</div>
  46363. </div>
  46364. {/each}
  46365. </div>
  46366. </div>
  46367. <div>
  46368. <div class="mb-2 text-xl font-bold">不同透明度</div>
  46369. <div class="flex flex-wrap justify-between">
  46370. {#each icons as icon, i}
  46371. <div class="flex-1 py-2 text-center">
  46372. <Icon name={icon} alpha={Number((0.2 + i * 0.2).toFixed(1))} />
  46373. <div class="mt-2 text-xs">{(0.2 + i * 0.2).toFixed(1)}</div>
  46374. </div>
  46375. {/each}
  46376. </div>
  46377. </div>
  46378. <div>
  46379. <div class="mb-2 text-xl font-bold">
  46380. 自定义颜色<span class="ml-2 text-xs font-normal">通过 injClass</span>
  46381. </div>
  46382. <div class="flex flex-wrap justify-between">
  46383. {#each icons as icon}
  46384. <div class="flex-1 py-2 text-center">
  46385. <Icon name={icon} injClass="text-[red] dark:text-[green]" />
  46386. </div>
  46387. {/each}
  46388. </div>
  46389. </div>
  46390. <div>
  46391. <div class="mb-2 text-xl font-bold">
  46392. 自定义颜色<span class="ml-2 text-xs font-normal">通过 Snippet</span>
  46393. </div>
  46394. <div class="flex flex-wrap justify-between">
  46395. {#each icons as icon}
  46396. <div class="flex-1 py-2 text-center">
  46397. <Icon><i class="text-[#266CF6] dark:text-[#C84031]"><Icon name={icon} /></i></Icon>
  46398. </div>
  46399. {/each}
  46400. </div>
  46401. </div>
  46402. <div>
  46403. <div class="mb-2 text-xl font-bold">Snippet</div>
  46404. <div class="flex flex-wrap justify-between">
  46405. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  46406. {#each icons as _, index}
  46407. <div class="flex-1 py-2 text-center">
  46408. <Icon>
  46409. <svg
  46410. height="24"
  46411. width="24"
  46412. aria-hidden="true"
  46413. viewBox="0 0 16 16"
  46414. data-view-component="true"
  46415. style="display: inline;"
  46416. class={index % 2 ? 'fill-primary dark:fill-dark' : 'fill-black dark:fill-white'}
  46417. >
  46418. <path
  46419. fill-rule="evenodd"
  46420. d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
  46421. />
  46422. </svg>
  46423. </Icon>
  46424. </div>
  46425. {/each}
  46426. </div>
  46427. </div>
  46428. <div>
  46429. <div class="mb-2 text-xl font-bold">偏移</div>
  46430. <div class="flex flex-wrap justify-between">
  46431. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  46432. {#each icons as _, i}
  46433. <div class="flex-1 py-2 text-center">
  46434. <Icon name={icons[1]} top={-4 + i * 2} />
  46435. top:{-4 + i * 2}
  46436. </div>
  46437. {/each}
  46438. </div>
  46439. </div>
  46440. </div>
  46441. ================================================
  46442. FILE: packages/stdf/src/routes/indexBar/en_US/+page.svelte
  46443. ================================================
  46444. <!-- IndexBar Demo -->
  46445. <script lang="ts">
  46446. import { IndexBar, Button, Toast } from '$lib/index.js';
  46447. import type { IndexBarItemProps } from '$lib/types/index.js';
  46448. const addressList: IndexBarItemProps[] = [
  46449. { index: 'A', title: 'A', child: ['Macau', 'Anning', 'Anqing', 'Anshan'] },
  46450. { index: 'B', title: 'B', child: ['Beijing', 'Baoding', 'Baotou', 'Baoji'] },
  46451. { index: 'C', title: 'C', child: ['Chengde', 'Cangzhou', 'Chifeng'] },
  46452. { index: 'D', title: 'D', child: ['Datong', 'Dalian', 'Dali'] },
  46453. { index: 'E', title: 'E', child: ['Enshi', 'Ordos', 'Emeishan'] },
  46454. { index: 'F', title: 'F', child: ['Fushun', 'Foshan', 'Fuquan'] },
  46455. { index: 'G', title: 'G', child: ['Gejiu', 'Guilin', 'Ganzhou'] },
  46456. { index: 'H', title: 'H', child: ['Handan', 'Hohhot', 'Hulunbuir'] },
  46457. { index: 'J', title: 'J', child: ['Jilin', 'Jiuquan', 'Jinjiang'] },
  46458. { index: 'K', title: 'K', child: ['Kunming', 'Kunshan', 'Kaifeng'] },
  46459. { index: 'L', title: 'L', child: ['Lhasa', 'Lanzhou', 'Luzhou'] },
  46460. { index: 'M', title: 'M', child: ['Mianyang', 'Maans', 'Mudanjiang'] },
  46461. { index: 'N', title: 'N', child: ['Nanchang', 'Nanjing', 'Ningbo'] },
  46462. { index: 'P', title: 'P', child: ['Putian', 'Panzhihua', 'Pingdingshan'] },
  46463. { index: 'Q', title: 'Q', child: ['Qujing', 'Qingdao', 'Qiqihar'] },
  46464. { index: 'R', title: 'R', child: ['Ruili', 'Ruian', 'Ruijin'] },
  46465. { index: 'S', title: 'S', child: ['Sanya', 'Shanghai', 'Shenzhen'] },
  46466. { index: 'T', title: 'T', child: ['Taizhou', 'Taiyuan', 'Tianjin'] },
  46467. { index: 'W', title: 'W', child: ['Wuhan', 'Wuxi', 'Wuhu'] },
  46468. { index: 'X', title: 'X', child: ['Xi an', 'Xiamen', 'Xuanwei'] },
  46469. { index: 'Y', title: 'Y', child: ['Yiwu', 'Yinchuan', 'Yuxi'] },
  46470. { index: 'Z', title: 'Z', child: ['Zhaotong', 'Zunyi', 'Zhangjiajie'] }
  46471. ];
  46472. const emojiList: IndexBarItemProps[] = [
  46473. { index: '😀', title: 'Smileys & Emotion', child: ['😂', '🥰', '🥱', '🧐'] },
  46474. { index: '👋', title: 'People & Body', child: ['👌', '🤝', '👨‍💻', '💪'] },
  46475. { index: '🐵', title: 'Animals & Nature', child: ['🦄', '🌱', '🦁', '🐶'] },
  46476. { index: '🍎', title: 'Food & Drink', child: ['🍑', '🍞', '🍽️', '🍩'] },
  46477. { index: '🌍', title: 'Travel & Places', child: ['🏔️', '🚆', '✈️', '🛵'] },
  46478. { index: '🏆', title: 'Activities', child: ['⚽', '🎨', '🏀', '🧨'] },
  46479. { index: '📱', title: 'Objects', child: ['🎩', '💻', '🎒', '📖'] },
  46480. { index: '⚠️', title: 'Symbols', child: ['🚫', '⚛️', '🛄', '🔱'] },
  46481. { index: '🏁', title: 'Flags', child: ['🇨🇳', '🇺🇸', '🇧🇻', '🇦🇹'] }
  46482. ];
  46483. const movieTVList: IndexBarItemProps[] = [
  46484. {
  46485. index: '三',
  46486. title: '三体',
  46487. child: [
  46488. '地球往事',
  46489. '黑暗森林',
  46490. '死神永生',
  46491. '科学边界',
  46492. '射手和农场主',
  46493. '寂静的春天',
  46494. '宇宙闪烁',
  46495. '地球叛军',
  46496. '古筝行动',
  46497. '智子',
  46498. '面壁者',
  46499. '咒语',
  46500. '黑暗森林',
  46501. '危机纪元',
  46502. '威慑纪元',
  46503. '广播纪元',
  46504. '掩体纪元',
  46505. '银河纪元',
  46506. '时间开始',
  46507. '时间之外,我们的宇宙'
  46508. ]
  46509. },
  46510. {
  46511. index: '流',
  46512. title: '流浪地球',
  46513. child: [
  46514. '人类的勇气和坚毅必将被镌刻在星空之下。',
  46515. '希望是像钻石一样珍贵的东西!',
  46516. '希望,希望是我们唯一回家的方向。',
  46517. '让人类永远保持理智,是一种奢求。',
  46518. '道路千万条,安全第一条;行车不规范,亲人两行泪!',
  46519. '那时候人们还没注意到太阳,人们更喜欢叫做钱的东西。',
  46520. '为了我们的孩子,没有什么不能失去的了',
  46521. 'moss 没有叛逃!',
  46522. '火石没了,我老婆孩子全他妈白死了!'
  46523. ]
  46524. },
  46525. {
  46526. index: '仙',
  46527. title: '仙剑奇侠传',
  46528. child: [
  46529. '既不回头,何必不忘。既然无缘,何必誓言。',
  46530. '没有值得不值得,只有愿意不愿意。',
  46531. '不曾得到,谈何放下。既已得到,又如何放下。',
  46532. '轮回的是故人,不变的是初心!',
  46533. '明夕何夕,君已陌路。',
  46534. '我曾经也拥有过爱,只是,我放弃了。',
  46535. '你以为每天看到的东西,就会抓得住吗?',
  46536. '世有无情人,却有痴情妖。',
  46537. '君子,小人,皆在一念思量。',
  46538. '到家了,一定要叫醒我,我怕我醒不过来。',
  46539. '如果得道就是牺牲所有人来成全自己,我宁愿执迷不悟。',
  46540. '我们今日一别,让我们十年后再相见,不见不散!',
  46541. '一杯愁绪,几段情缘,莫过,与君对酒当歌。'
  46542. ]
  46543. }
  46544. ];
  46545. const navHeight = 48;
  46546. const bottomHeight = 50;
  46547. const height = window.innerHeight - navHeight - bottomHeight;
  46548. /**
  46549. * @type {'base' | 'full' | 'none'}
  46550. */
  46551. let radius: 'middle' | 'full' | 'none' = $state('middle');
  46552. let dataFlag = $state(0);
  46553. let scrollAlign = $state(true);
  46554. let injClassList: string[] = $state([]);
  46555. const changeRadiusFun = () => {
  46556. radius = radius === 'middle' ? 'full' : radius === 'full' ? 'none' : 'middle';
  46557. };
  46558. const changeListFun = () => {
  46559. dataFlag = dataFlag === 0 ? 1 : dataFlag === 1 ? 2 : 0;
  46560. };
  46561. const changeScrollAlignFun = () => {
  46562. scrollAlign = !scrollAlign;
  46563. };
  46564. const changeClassFun = () => {
  46565. injClassList = !injClassList.length ? ['!text-3xl text-center', 'text-xs text-center !py-1'] : [];
  46566. };
  46567. let visible = $state(false);
  46568. let toastObj = $state({ index: 0, group: { title: '' }, childIndex: 0, child: '' });
  46569. </script>
  46570. {#if dataFlag === 0}
  46571. <IndexBar
  46572. data={addressList}
  46573. {radius}
  46574. {height}
  46575. {scrollAlign}
  46576. titleInjClass={injClassList[0]}
  46577. textInjClass={injClassList[1]}
  46578. top={navHeight}
  46579. onclickChild={(index, group, childIndex, child) => {
  46580. toastObj = { index, group, childIndex, child };
  46581. visible = true;
  46582. }}
  46583. />
  46584. {:else if dataFlag === 1}
  46585. <IndexBar
  46586. data={emojiList}
  46587. {radius}
  46588. {height}
  46589. {scrollAlign}
  46590. titleInjClass={injClassList[0]}
  46591. textInjClass={injClassList[1]}
  46592. top={navHeight}
  46593. onclickChild={(index, group, childIndex, child) => {
  46594. toastObj = { index, group, childIndex, child };
  46595. visible = true;
  46596. }}
  46597. />
  46598. {:else}
  46599. <IndexBar
  46600. data={movieTVList}
  46601. {radius}
  46602. {height}
  46603. {scrollAlign}
  46604. titleInjClass={injClassList[0]}
  46605. textInjClass={injClassList[1]}
  46606. top={navHeight}
  46607. onclickChild={(index, group, childIndex, child) => {
  46608. toastObj = { index, group, childIndex, child };
  46609. visible = true;
  46610. }}
  46611. />
  46612. {/if}
  46613. <Toast
  46614. bind:visible
  46615. message={`Clicked ${toastObj.index + 1} group(${toastObj.group.title}) ${toastObj.childIndex + 1} item(${toastObj.child})`}
  46616. />
  46617. <div class="sticky bottom-0 z-10 flex justify-between bg-white/90 px-2 dark:bg-black/90">
  46618. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeListFun}>Switch data</Button>
  46619. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeScrollAlignFun}>
  46620. {scrollAlign ? 'open' : 'close'} Align
  46621. </Button>
  46622. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeRadiusFun}>Switch rounded</Button>
  46623. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeClassFun}>Switch style</Button>
  46624. </div>
  46625. ================================================
  46626. FILE: packages/stdf/src/routes/indexBar/zh_CN/+page.svelte
  46627. ================================================
  46628. <!-- IndexBar Demo -->
  46629. <script lang="ts">
  46630. import { IndexBar, Button, Toast } from '$lib/index.js';
  46631. import type { IndexBarItemProps } from '$lib/types/index.js';
  46632. const addressList: IndexBarItemProps[] = [
  46633. { index: 'A', title: 'A', child: ['澳门', '安宁', '安庆', '鞍山'] },
  46634. { index: 'B', title: 'B', child: ['北京', '保定', '包头', '宝鸡'] },
  46635. { index: 'C', title: 'C', child: ['承德', '沧州', '赤峰'] },
  46636. { index: 'D', title: 'D', child: ['大同', '大连', '大理'] },
  46637. { index: 'E', title: 'E', child: ['恩施', '鄂尔多斯', '峨眉山'] },
  46638. { index: 'F', title: 'F', child: ['抚顺', '佛山', '福泉'] },
  46639. { index: 'G', title: 'G', child: ['个旧', '桂林', '赣州'] },
  46640. { index: 'H', title: 'H', child: ['邯郸', '呼和浩特', '呼伦贝尔'] },
  46641. { index: 'J', title: 'J', child: ['吉林', '酒泉', '晋江'] },
  46642. { index: 'K', title: 'K', child: ['昆明', '昆山', '开封'] },
  46643. { index: 'L', title: 'L', child: ['拉萨', '兰州', '泸州'] },
  46644. { index: 'M', title: 'M', child: ['绵阳', '马鞍山', '牡丹江'] },
  46645. { index: 'N', title: 'N', child: ['南昌', '南京', '宁波'] },
  46646. { index: 'P', title: 'P', child: ['莆田', '攀枝花', '平顶山'] },
  46647. { index: 'Q', title: 'Q', child: ['曲靖', '青岛', '齐齐哈尔'] },
  46648. { index: 'R', title: 'R', child: ['瑞丽', '瑞安', '瑞金'] },
  46649. { index: 'S', title: 'S', child: ['三亚', '上海', '深圳'] },
  46650. { index: 'T', title: 'T', child: ['台州', '太原', '天津'] },
  46651. { index: 'W', title: 'W', child: ['武汉', '无锡', '芜湖'] },
  46652. { index: 'X', title: 'X', child: ['西安', '厦门', '宣威'] },
  46653. { index: 'Y', title: 'Y', child: ['义乌', '银川', '玉溪'] },
  46654. { index: 'Z', title: 'Z', child: ['昭通', '遵义', '张家界'] }
  46655. ];
  46656. const emojiList: IndexBarItemProps[] = [
  46657. { index: '😀', title: '表情与情感', child: ['😂', '🥰', '🥱', '🧐'] },
  46658. { index: '👋', title: '人物与身体', child: ['👌', '🤝', '👨‍💻', '💪'] },
  46659. { index: '🐵', title: '动物与自然', child: ['🦄', '🌱', '🦁', '🐶'] },
  46660. { index: '🍎', title: '食物与饮料', child: ['🍑', '🍞', '🍽️', '🍩'] },
  46661. { index: '🌍', title: '旅行与地理', child: ['🏔️', '🚆', '✈️', '🛵'] },
  46662. { index: '🏆', title: '活动', child: ['⚽', '🎨', '🏀', '🧨'] },
  46663. { index: '📱', title: '物品', child: ['🎩', '💻', '🎒', '📖'] },
  46664. { index: '⚠️', title: '符号标志', child: ['🚫', '⚛️', '🛄', '🔱'] },
  46665. { index: '🏁', title: '旗帜', child: ['🇨🇳', '🇺🇸', '🇧🇻', '🇦🇹'] }
  46666. ];
  46667. const movieTVList: IndexBarItemProps[] = [
  46668. {
  46669. index: '三',
  46670. title: '三体',
  46671. child: [
  46672. '地球往事',
  46673. '黑暗森林',
  46674. '死神永生',
  46675. '科学边界',
  46676. '射手和农场主',
  46677. '寂静的春天',
  46678. '宇宙闪烁',
  46679. '地球叛军',
  46680. '古筝行动',
  46681. '智子',
  46682. '面壁者',
  46683. '咒语',
  46684. '黑暗森林',
  46685. '危机纪元',
  46686. '威慑纪元',
  46687. '广播纪元',
  46688. '掩体纪元',
  46689. '银河纪元',
  46690. '时间开始',
  46691. '时间之外,我们的宇宙'
  46692. ]
  46693. },
  46694. {
  46695. index: '流',
  46696. title: '流浪地球',
  46697. child: [
  46698. '人类的勇气和坚毅必将被镌刻在星空之下。',
  46699. '希望是像钻石一样珍贵的东西!',
  46700. '希望,希望是我们唯一回家的方向。',
  46701. '让人类永远保持理智,是一种奢求。',
  46702. '道路千万条,安全第一条;行车不规范,亲人两行泪!',
  46703. '那时候人们还没注意到太阳,人们更喜欢叫做钱的东西。',
  46704. '为了我们的孩子,没有什么不能失去的了',
  46705. 'moss 没有叛逃!',
  46706. '火石没了,我老婆孩子全他妈白死了!'
  46707. ]
  46708. },
  46709. {
  46710. index: '仙',
  46711. title: '仙剑奇侠传',
  46712. child: [
  46713. '既不回头,何必不忘。既然无缘,何必誓言。',
  46714. '没有值得不值得,只有愿意不愿意。',
  46715. '不曾得到,谈何放下。既已得到,又如何放下。',
  46716. '轮回的是故人,不变的是初心!',
  46717. '明夕何夕,君已陌路。',
  46718. '我曾经也拥有过爱,只是,我放弃了。',
  46719. '你以为每天看到的东西,就会抓得住吗?',
  46720. '世有无情人,却有痴情妖。',
  46721. '君子,小人,皆在一念思量。',
  46722. '到家了,一定要叫醒我,我怕我醒不过来。',
  46723. '如果得道就是牺牲所有人来成全自己,我宁愿执迷不悟。',
  46724. '我们今日一别,让我们十年后再相见,不见不散!',
  46725. '一杯愁绪,几段情缘,莫过,与君对酒当歌。'
  46726. ]
  46727. }
  46728. ];
  46729. const navHeight = 48;
  46730. const bottomHeight = 50;
  46731. const height = window.innerHeight - navHeight - bottomHeight;
  46732. /**
  46733. * @type {'base' | 'full' | 'none'}
  46734. */
  46735. let radius: 'middle' | 'full' | 'none' = $state('middle');
  46736. let dataFlag = $state(0);
  46737. let scrollAlign = $state(true);
  46738. let injClassList: string[] = $state([]);
  46739. const changeRadiusFun = () => {
  46740. radius = radius === 'middle' ? 'full' : radius === 'full' ? 'none' : 'middle';
  46741. };
  46742. const changeListFun = () => {
  46743. dataFlag = dataFlag === 0 ? 1 : dataFlag === 1 ? 2 : 0;
  46744. };
  46745. const changeScrollAlignFun = () => {
  46746. scrollAlign = !scrollAlign;
  46747. };
  46748. const changeClassFun = () => {
  46749. injClassList = !injClassList.length ? ['!text-3xl text-center', 'text-xs text-center !py-1'] : [];
  46750. };
  46751. let visible = $state(false);
  46752. let toastObj = $state({ index: 0, group: { title: '' }, childIndex: 0, child: '' });
  46753. </script>
  46754. {#if dataFlag === 0}
  46755. <IndexBar
  46756. data={addressList}
  46757. {radius}
  46758. {height}
  46759. {scrollAlign}
  46760. titleInjClass={injClassList[0]}
  46761. textInjClass={injClassList[1]}
  46762. top={navHeight}
  46763. onclickChild={(index, group, childIndex, child) => {
  46764. toastObj = { index, group, childIndex, child };
  46765. visible = true;
  46766. }}
  46767. />
  46768. {:else if dataFlag === 1}
  46769. <IndexBar
  46770. data={emojiList}
  46771. {radius}
  46772. {height}
  46773. {scrollAlign}
  46774. titleInjClass={injClassList[0]}
  46775. textInjClass={injClassList[1]}
  46776. top={navHeight}
  46777. onclickChild={(index, group, childIndex, child) => {
  46778. toastObj = { index, group, childIndex, child };
  46779. visible = true;
  46780. }}
  46781. />
  46782. {:else}
  46783. <IndexBar
  46784. data={movieTVList}
  46785. {radius}
  46786. {height}
  46787. {scrollAlign}
  46788. titleInjClass={injClassList[0]}
  46789. textInjClass={injClassList[1]}
  46790. top={navHeight}
  46791. onclickChild={(index, group, childIndex, child) => {
  46792. toastObj = { index, group, childIndex, child };
  46793. visible = true;
  46794. }}
  46795. />
  46796. {/if}
  46797. <Toast
  46798. bind:visible
  46799. message={`点击了第 ${toastObj.index + 1} 组(${toastObj.group.title})中的第 ${toastObj.childIndex + 1} 项(${toastObj.child})`}
  46800. />
  46801. <div class="sticky bottom-0 z-10 flex justify-between bg-white/90 px-2 dark:bg-black/90">
  46802. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeListFun}>切换数据</Button>
  46803. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeScrollAlignFun}>
  46804. {scrollAlign ? '关闭' : '开启'}滚动对齐
  46805. </Button>
  46806. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeRadiusFun}>切换圆角</Button>
  46807. <Button fill="lineTheme" size="auto" injClass="text-xs px-2" onclick={changeClassFun}>切换样式</Button>
  46808. </div>
  46809. ================================================
  46810. FILE: packages/stdf/src/routes/input/en_US/+page.svelte
  46811. ================================================
  46812. <!-- Input Demo -->
  46813. <script lang="ts">
  46814. import { Input, Button, Icon, Toast } from '$lib/index.js';
  46815. let value = $state('Initial text');
  46816. let visible = $state(false);
  46817. let IdCard = $state('');
  46818. // Get browser information to determine if it is a mobile device
  46819. const isMobile = /Mobi|Android|iPhone/i.test(navigator.userAgent);
  46820. let placeholderIdCard = $state('');
  46821. $effect(() => {
  46822. placeholderIdCard = IdCard === '' ? 'Please enter ID card number' : '';
  46823. });
  46824. const clickLabel4Fun = () => {
  46825. placeholderIdCard = 'Recognition completed in 2 seconds......';
  46826. setTimeout(() => {
  46827. IdCard = '1234567890XXX-XX';
  46828. }, 2000);
  46829. };
  46830. let mobileLength = $state(0);
  46831. const changeStateFun = (v: string) => {
  46832. mobileLength = v.length;
  46833. };
  46834. let mobileState: 'success' | 'theme' | 'error' = $derived(mobileLength === 11 ? 'success' : mobileLength === 0 ? 'theme' : 'error');
  46835. // Key pressed
  46836. let key = $state('');
  46837. </script>
  46838. <div class="px-4 pt-8 text-xl font-bold">Basic Usage</div>
  46839. <Input title="Text" />
  46840. <div class="px-4 pt-8 text-xl font-bold">Without Title</div>
  46841. <Input placeholder="Please enter text" />
  46842. <div class="px-4 pt-8 text-xl font-bold">Custom Placeholder</div>
  46843. <Input title="Text" placeholder="I am a custom placeholder" />
  46844. <div class="px-4 pt-8 text-xl font-bold">
  46845. Different Input Types
  46846. {#if !isMobile}
  46847. <span class="ml-2 text-xs opacity-50">Please check keyboard types on mobile devices</span>
  46848. {/if}
  46849. </div>
  46850. <Input title="Any Text (Regular Keyboard)" />
  46851. <Input title="Password" type="password" />
  46852. <Input title="Number (Any)" type="number" />
  46853. <Input title="Number (Integer)" type="numeric" />
  46854. <Input title="Number (Decimal Allowed)" type="decimal" />
  46855. <Input title="Number (Allow Negative)" type="number" negative />
  46856. <Input title="Email" type="email" />
  46857. <Input title="Phone Number" type="tel" />
  46858. <Input title="URL" type="url" />
  46859. <Input title="Search Content" type="search" />
  46860. <Input title="Text (No Virtual Keyboard)" type="none" />
  46861. <div class="px-4 pt-8 text-xl font-bold">Line Style</div>
  46862. <Input title="Text" inputStyle="line" />
  46863. <Input title="Text (Center Line Transition)" inputStyle="line" lineTransition="center" />
  46864. <Input title="Text (Left Line Transition)" inputStyle="line" lineTransition="left" />
  46865. <div class="px-4 pt-8 text-xl font-bold">Different Transition Times</div>
  46866. <Input title="Fast Transition" duration="fast" />
  46867. <Input title="Normal Transition" />
  46868. <Input title="Slower Transition" duration="slower" />
  46869. <Input title="Normal Line Transition" inputStyle="line" lineTransition="center" />
  46870. <Input title="Slower Line Transition" inputStyle="line" lineTransition="center" duration="slower" />
  46871. <div class="px-4 pt-8 text-xl font-bold">Different Title Positions</div>
  46872. <Input title="Title (External)" />
  46873. <Input title="Title (Internal)" titlePosition="in" />
  46874. <Input title="Title (None)" titlePosition={null} />
  46875. <div class="px-4 pt-8 text-xl font-bold">Different Input Text Positions</div>
  46876. <Input title="Text" />
  46877. <Input title="Text" inputPosition="right" />
  46878. <div class="px-4 pt-8 text-xl font-bold">Different Border Radius Styles</div>
  46879. <Input title="Text" />
  46880. <Input title="Text" radius="xl" />
  46881. <Input title="Text" radius="full" />
  46882. <Input title="Text" radius="none" />
  46883. <Input title="Line Style (Radius Invalid)" radius="full" inputStyle="line" />
  46884. <div class="px-4 pt-8 text-xl font-bold">Different Vertical Spacing</div>
  46885. <Input placeholder="Please enter text (Spacing 0)" py="0" inputStyle="line" />
  46886. <Input placeholder="Please enter text (Spacing 0)" py="0" inputStyle="line" />
  46887. <Input placeholder="Please enter text (Spacing 0)" py="0" inputStyle="line" />
  46888. <Input placeholder="Please enter text (Spacing 4)" py="4" inputStyle="line" />
  46889. <Input placeholder="Please enter text (Spacing 4)" py="4" inputStyle="line" />
  46890. <Input placeholder="Please enter text (Spacing 4)" py="4" inputStyle="line" />
  46891. <div class="px-4 pt-8 text-xl font-bold">With Clear Button</div>
  46892. <Input title="Text" clear />
  46893. <div class="px-4 pt-8 text-xl font-bold">Disabled</div>
  46894. <Input title="Text" disabled value="Disabled" />
  46895. <div class="px-4 pt-8 text-xl font-bold">Different States</div>
  46896. <Input title="Success" state="success" />
  46897. <Input title="Warning" state="warning" />
  46898. <Input title="Error" state="error" />
  46899. <Input title="Info" state="info" />
  46900. <Input title="Warning & Line" inputStyle="line" state="error" />
  46901. <Input title="Warning & Line & Animation" inputStyle="line" state="error" lineTransition="center" />
  46902. <Input
  46903. title="Dynamic State Change"
  46904. type="tel"
  46905. placeholder="Please enter 11-digit phone number"
  46906. maxlength={11}
  46907. state={mobileState}
  46908. onchange={changeStateFun}
  46909. />
  46910. <div class="px-4 pt-8 text-xl font-bold">Left Icon</div>
  46911. <Input title="Password" type="password" label1={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  46912. <Input
  46913. title="Username"
  46914. label1={{ name: 'ri-arrow-down-s-line', size: 16, alpha: 0.5 }}
  46915. label3={{ name: 'ri-shield-user-line', size: 16, alpha: 0.5 }}
  46916. />
  46917. <div class="px-4 pt-8 text-xl font-bold">Left Text</div>
  46918. <Input title="Account" label2="Account" />
  46919. <div class="px-4 pt-8 text-xl font-bold">Left Icon and Text</div>
  46920. <Input title="Password" type="password" label1={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} label2="Password" />
  46921. <div class="px-4 pt-8 text-xl font-bold">Left Text and Icon</div>
  46922. <Input title="Password" type="password" label2="Password" label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  46923. <div class="px-4 pt-8 text-xl font-bold">Left Icon, Text, Icon</div>
  46924. <Input
  46925. title="Password"
  46926. type="password"
  46927. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46928. label2="Password"
  46929. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  46930. />
  46931. <div class="px-4 pt-8 text-xl font-bold">Right Icon</div>
  46932. <Input title="ID Card" label4={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }} />
  46933. <Input
  46934. title="Username"
  46935. label4={{ name: 'ri-arrow-down-s-line', size: 16, alpha: 0.5 }}
  46936. label6={{ name: 'ri-shield-user-line', size: 16, alpha: 0.5 }}
  46937. />
  46938. <div class="px-4 pt-8 text-xl font-bold">Right Text</div>
  46939. <Input title="Amount" type="number" label5="Yuan" />
  46940. <div class="px-4 pt-8 text-xl font-bold">Right Icon and Text</div>
  46941. <Input title="Password" type="password" label4={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} label5="Password" />
  46942. <div class="px-4 pt-8 text-xl font-bold">Right Text and Icon</div>
  46943. <Input title="Password" type="password" label5="Password" label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  46944. <div class="px-4 pt-8 text-xl font-bold">Right Icon, Text, Icon</div>
  46945. <Input
  46946. title="Password"
  46947. type="password"
  46948. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46949. label5="Password"
  46950. label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  46951. />
  46952. <div class="px-4 pt-8 text-xl font-bold">Left Text and Right Icon</div>
  46953. <Input label2="ID Card" label6={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }} placeholder="Please enter ID card number" />
  46954. <div class="px-4 pt-8 text-xl font-bold">All Six Items</div>
  46955. <Input
  46956. title="Password"
  46957. type="password"
  46958. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46959. label2="Password"
  46960. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  46961. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46962. label5="Password"
  46963. label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  46964. />
  46965. <div class="px-4 pt-8 text-xl font-bold">Tips and Data Items</div>
  46966. <Input title="Text" tip="Tip message" />
  46967. <Input title="Text" data1="Data item 1" />
  46968. <Input title="Text" data1="Data item 1" data2="Data item 2" />
  46969. <Input title="Text" data3="Data item 3" />
  46970. <Input title="Text" data1="Data item 1" tip="Tip message" />
  46971. <Input title="Text" data3="Data item 3" tip="Tip message" />
  46972. <div class="px-4 pt-8 text-xl font-bold">All Configurable Items</div>
  46973. <Input
  46974. title="Title"
  46975. placeholder="Please enter text"
  46976. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46977. label2="Label 2"
  46978. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  46979. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  46980. label5="Label 5"
  46981. label6={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }}
  46982. data1="Data item 1"
  46983. data2="Data item 2"
  46984. data3="Data item 3"
  46985. tip="Tip message"
  46986. clear
  46987. />
  46988. <div class="px-4 pt-8 text-xl font-bold">label1 and label4 Using Snippet</div>
  46989. <Input title="Verification Code">
  46990. {#snippet label1Child()}
  46991. <div>
  46992. <svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16">
  46993. <path
  46994. d="M511.198384 637.07798c-17.170101 0-31.08202 13.911919-31.08202 31.08202v124.302222c0 17.157172 13.924848 31.08202 31.08202 31.08202s31.069091-13.924848 31.069091-31.08202v-124.302222c0-17.170101-13.911919-31.08202-31.069091-31.08202z m0 0"
  46995. fill="#515151"
  46996. />
  46997. <path
  46998. d="M759.815758 513.331717V264.145455C759.815758 126.823434 648.520404 15.515152 511.198384 15.515152c-137.309091 0-248.630303 111.308283-248.630303 248.630303v249.186262C223.702626 565.20404 200.40404 629.423838 200.40404 699.229091c0 171.649293 139.145051 310.794343 310.794344 310.794343s310.794343-139.145051 310.794343-310.794343c0-69.805253-23.311515-134.025051-62.176969-185.897374zM324.719192 264.145455c0-102.994747 83.497374-186.479192 186.479192-186.479192 102.981818 0 186.466263 83.484444 186.466262 186.479192v186.88c-51.975758-39.111111-116.402424-62.577778-186.466262-62.577778s-134.490505 23.453737-186.479192 62.577778V264.145455z m186.479192 683.726868c-137.309091 0-248.630303-111.321212-248.630303-248.643232 0-137.309091 111.308283-248.617374 248.630303-248.617374 132.628687 0 248.617374 115.988687 248.617374 248.617374 0 137.32202-111.295354 248.643232-248.617374 248.643232z m0 0"
  46999. fill="#515151"
  47000. />
  47001. </svg>
  47002. </div>
  47003. {/snippet}
  47004. {#snippet label4Child()}
  47005. <div>
  47006. <Button size="auto" heightOut="0" heightIn="1" fill="lineTheme">
  47007. <div class="px-2">Get Code</div>
  47008. </Button>
  47009. </div>
  47010. {/snippet}
  47011. </Input>
  47012. <div class="px-4 pt-8 text-xl font-bold">Dynamic Display</div>
  47013. <Input
  47014. title="Dynamic label5"
  47015. type="tel"
  47016. placeholder="Please enter 11-digit phone number"
  47017. maxlength={11}
  47018. state={mobileState}
  47019. onchange={changeStateFun}
  47020. >
  47021. {#snippet label5Child()}
  47022. <div>
  47023. {#if mobileLength === 11}
  47024. <Icon name="ri-check-fill" injClass="text-success" size={14} />
  47025. {:else if mobileLength === 0}{:else}
  47026. <Icon name="ri-close-fill" injClass="text-error" size={14} />
  47027. {/if}
  47028. </div>
  47029. {/snippet}
  47030. </Input>
  47031. <div class="px-4 pt-8 text-xl font-bold">Bind Value</div>
  47032. <Input title="Text" bind:value />
  47033. <Button onclick={() => (visible = true)}>Show Current Value</Button>
  47034. <Toast bind:visible message={`Current input text: ${value}`} />
  47035. <div class="px-4 pt-8 text-xl font-bold">Click label4 Trigger Event</div>
  47036. <Input
  47037. title="ID Card"
  47038. placeholder={placeholderIdCard}
  47039. bind:value={IdCard}
  47040. label4={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }}
  47041. onclickLabel4={clickLabel4Fun}
  47042. clear
  47043. />
  47044. <div class="px-4 pt-8 text-xl font-bold">Textarea</div>
  47045. <Input placeholder="Please enter content" type="textarea" />
  47046. <div class="px-4 pt-8 text-xl font-bold">Textarea Auto Height</div>
  47047. <Input placeholder="Please enter content" type="textarea" autosize />
  47048. <div class="px-4 pt-4 text-xl font-bold">Listen to Keydown Event</div>
  47049. <div class="px-4 pt-4">You pressed {key}</div>
  47050. <Input placeholder="Please enter content" onkeydown={(v) => (key = v)} />
  47051. ================================================
  47052. FILE: packages/stdf/src/routes/input/zh_CN/+page.svelte
  47053. ================================================
  47054. <!-- Input Demo -->
  47055. <script lang="ts">
  47056. import { Input, Button, Icon, Toast } from '$lib/index.js';
  47057. let value = $state('初始文本');
  47058. let visible = $state(false);
  47059. let IdCard = $state('');
  47060. // 通过获取浏览器信息判断是否是移动设备
  47061. const isMobile = /Mobi|Android|iPhone/i.test(navigator.userAgent);
  47062. let placeholderIdCard = $state('');
  47063. $effect(() => {
  47064. placeholderIdCard = IdCard === '' ? '请输入身份证号' : '';
  47065. });
  47066. const clickLabel4Fun = () => {
  47067. placeholderIdCard = '两秒后识别完毕......';
  47068. setTimeout(() => {
  47069. IdCard = '1234567890XXX-XX';
  47070. }, 2000);
  47071. };
  47072. let mobileLength = $state(0);
  47073. const changeStateFun = (v: string) => {
  47074. mobileLength = v.length;
  47075. };
  47076. let mobileState: 'success' | 'theme' | 'error' = $derived(mobileLength === 11 ? 'success' : mobileLength === 0 ? 'theme' : 'error');
  47077. // 按键 key
  47078. let key = $state('');
  47079. </script>
  47080. <div class="px-4 pt-8 text-xl font-bold">基础用法</div>
  47081. <Input title="文本" />
  47082. <div class="px-4 pt-8 text-xl font-bold">不带标题</div>
  47083. <Input placeholder="请输入文本" />
  47084. <div class="px-4 pt-8 text-xl font-bold">自定义 placeholder</div>
  47085. <Input title="文本" placeholder="我是自定义的 placeholder" />
  47086. <div class="px-4 pt-8 text-xl font-bold">
  47087. 不同输入类型
  47088. {#if !isMobile}
  47089. <span class="ml-2 text-xs opacity-50">请在移动设备查看键盘类型</span>
  47090. {/if}
  47091. </div>
  47092. <Input title="任意文本(常规键盘)" />
  47093. <Input title="密码" type="password" />
  47094. <Input title="数字(任意)" type="number" />
  47095. <Input title="数字(整数)" type="numeric" />
  47096. <Input title="数字(允许小数点)" type="decimal" />
  47097. <Input title="数字(允许负数)" type="number" negative />
  47098. <Input title="邮箱" type="email" />
  47099. <Input title="电话号码" type="tel" />
  47100. <Input title="链接地址" type="url" />
  47101. <Input title="搜索内容" type="search" />
  47102. <Input title="文本(不使用虚拟键盘)" type="none" />
  47103. <div class="px-4 pt-8 text-xl font-bold">线性风格</div>
  47104. <Input title="文本" inputStyle="line" />
  47105. <Input title="文本(线条居中过渡)" inputStyle="line" lineTransition="center" />
  47106. <Input title="文本(线条左侧过渡)" inputStyle="line" lineTransition="left" />
  47107. <div class="px-4 pt-8 text-xl font-bold">不同过渡时间</div>
  47108. <Input title="过渡快" duration="fast" />
  47109. <Input title="过渡正常" />
  47110. <Input title="过渡较慢" duration="slower" />
  47111. <Input title="线性过渡正常" inputStyle="line" lineTransition="center" />
  47112. <Input title="线性过渡较慢" inputStyle="line" lineTransition="center" duration="slower" />
  47113. <div class="px-4 pt-8 text-xl font-bold">不同标题位置</div>
  47114. <Input title="标题(外部)" />
  47115. <Input title="标题(内部)" titlePosition="in" />
  47116. <Input title="标题(无)" titlePosition={null} />
  47117. <div class="px-4 pt-8 text-xl font-bold">不同输入文字位置</div>
  47118. <Input title="文本" />
  47119. <Input title="文本" inputPosition="right" />
  47120. <div class="px-4 pt-8 text-xl font-bold">不同圆角风格</div>
  47121. <Input title="文本" />
  47122. <Input title="文本" radius="xl" />
  47123. <Input title="文本" radius="full" />
  47124. <Input title="文本" radius="none" />
  47125. <Input title="线性风格圆角无效" radius="full" inputStyle="line" />
  47126. <div class="px-4 pt-8 text-xl font-bold">不同垂直间距</div>
  47127. <Input placeholder="请输入文本(间距为 0)" py="0" inputStyle="line" />
  47128. <Input placeholder="请输入文本(间距为 0)" py="0" inputStyle="line" />
  47129. <Input placeholder="请输入文本(间距为 0)" py="0" inputStyle="line" />
  47130. <Input placeholder="请输入文本(间距为 4)" py="4" inputStyle="line" />
  47131. <Input placeholder="请输入文本(间距为 4)" py="4" inputStyle="line" />
  47132. <Input placeholder="请输入文本(间距为 4)" py="4" inputStyle="line" />
  47133. <div class="px-4 pt-8 text-xl font-bold">带清除</div>
  47134. <Input title="文本" clear />
  47135. <div class="px-4 pt-8 text-xl font-bold">禁用</div>
  47136. <Input title="文本" disabled value="已禁用" />
  47137. <div class="px-4 pt-8 text-xl font-bold">不同状态色</div>
  47138. <Input title="成功" state="success" />
  47139. <Input title="警告" state="warning" />
  47140. <Input title="错误" state="error" />
  47141. <Input title="信息" state="info" />
  47142. <Input title="警告&线性" inputStyle="line" state="error" />
  47143. <Input title="警告&线性&动画" inputStyle="line" state="error" lineTransition="center" />
  47144. <Input title="动态改变状态色" type="tel" placeholder="请输入11位手机号" maxlength={11} state={mobileState} onchange={changeStateFun} />
  47145. <div class="px-4 pt-8 text-xl font-bold">左侧带图标</div>
  47146. <Input title="密码" type="password" label1={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  47147. <Input
  47148. title="用户名"
  47149. label1={{ name: 'ri-arrow-down-s-line', size: 16, alpha: 0.5 }}
  47150. label3={{ name: 'ri-shield-user-line', size: 16, alpha: 0.5 }}
  47151. />
  47152. <div class="px-4 pt-8 text-xl font-bold">左侧带文字</div>
  47153. <Input title="账号" label2="账号" />
  47154. <div class="px-4 pt-8 text-xl font-bold">左侧带图标与文字</div>
  47155. <Input title="密码" type="password" label1={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} label2="密码" />
  47156. <div class="px-4 pt-8 text-xl font-bold">左侧带文字与图标</div>
  47157. <Input title="密码" type="password" label2="密码" label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  47158. <div class="px-4 pt-8 text-xl font-bold">左侧带图标、文字、图标</div>
  47159. <Input
  47160. title="密码"
  47161. type="password"
  47162. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47163. label2="密码"
  47164. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  47165. />
  47166. <div class="px-4 pt-8 text-xl font-bold">右侧带图标</div>
  47167. <Input title="身份证号" label4={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }} />
  47168. <Input
  47169. title="用户名"
  47170. label4={{ name: 'ri-arrow-down-s-line', size: 16, alpha: 0.5 }}
  47171. label6={{ name: 'ri-shield-user-line', size: 16, alpha: 0.5 }}
  47172. />
  47173. <div class="px-4 pt-8 text-xl font-bold">右侧带文字</div>
  47174. <Input title="金额" type="number" label5="元" />
  47175. <div class="px-4 pt-8 text-xl font-bold">右侧带图标与文字</div>
  47176. <Input title="密码" type="password" label4={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} label5="密码" />
  47177. <div class="px-4 pt-8 text-xl font-bold">右侧带文字与图标</div>
  47178. <Input title="密码" type="password" label5="密码" label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }} />
  47179. <div class="px-4 pt-8 text-xl font-bold">右侧带图标、文字、图标</div>
  47180. <Input
  47181. title="密码"
  47182. type="password"
  47183. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47184. label5="密码"
  47185. label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  47186. />
  47187. <div class="px-4 pt-8 text-xl font-bold">左侧带文字右侧带图标</div>
  47188. <Input label2="身份证号" label6={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }} placeholder="请输入身份证号" />
  47189. <div class="px-4 pt-8 text-xl font-bold">左右六项全带</div>
  47190. <Input
  47191. title="密码"
  47192. type="password"
  47193. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47194. label2="密码"
  47195. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  47196. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47197. label5="密码"
  47198. label6={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  47199. />
  47200. <div class="px-4 pt-8 text-xl font-bold">提示信息与数据项组合</div>
  47201. <Input title="文本" tip="提示信息" />
  47202. <Input title="文本" data1="数据项1" />
  47203. <Input title="文本" data1="数据项1" data2="数据项2" />
  47204. <Input title="文本" data3="数据项3" />
  47205. <Input title="文本" data1="数据项1" tip="提示信息" />
  47206. <Input title="文本" data3="数据项3" tip="提示信息" />
  47207. <div class="px-4 pt-8 text-xl font-bold">展示所有可配置项</div>
  47208. <Input
  47209. title="标题"
  47210. placeholder="请输入文本"
  47211. label1={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47212. label2="标签 2"
  47213. label3={{ name: 'ri-lock-line', size: 16, alpha: 0.5 }}
  47214. label4={{ name: 'ri-bank-line', size: 16, alpha: 0.5 }}
  47215. label5="标签 5"
  47216. label6={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }}
  47217. data1="数据项 1"
  47218. data2="数据项 2"
  47219. data3="数据项 3"
  47220. tip="提示信息"
  47221. clear
  47222. />
  47223. <div class="px-4 pt-8 text-xl font-bold">label1 和 label4 使用 Snippet</div>
  47224. <Input title="验证码">
  47225. {#snippet label1Child()}
  47226. <div>
  47227. <svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="16" height="16">
  47228. <path
  47229. d="M511.198384 637.07798c-17.170101 0-31.08202 13.911919-31.08202 31.08202v124.302222c0 17.157172 13.924848 31.08202 31.08202 31.08202s31.069091-13.924848 31.069091-31.08202v-124.302222c0-17.170101-13.911919-31.08202-31.069091-31.08202z m0 0"
  47230. fill="#515151"
  47231. />
  47232. <path
  47233. d="M759.815758 513.331717V264.145455C759.815758 126.823434 648.520404 15.515152 511.198384 15.515152c-137.309091 0-248.630303 111.308283-248.630303 248.630303v249.186262C223.702626 565.20404 200.40404 629.423838 200.40404 699.229091c0 171.649293 139.145051 310.794343 310.794344 310.794343s310.794343-139.145051 310.794343-310.794343c0-69.805253-23.311515-134.025051-62.176969-185.897374zM324.719192 264.145455c0-102.994747 83.497374-186.479192 186.479192-186.479192 102.981818 0 186.466263 83.484444 186.466262 186.479192v186.88c-51.975758-39.111111-116.402424-62.577778-186.466262-62.577778s-134.490505 23.453737-186.479192 62.577778V264.145455z m186.479192 683.726868c-137.309091 0-248.630303-111.321212-248.630303-248.643232 0-137.309091 111.308283-248.617374 248.630303-248.617374 132.628687 0 248.617374 115.988687 248.617374 248.617374 0 137.32202-111.295354 248.643232-248.617374 248.643232z m0 0"
  47234. fill="#515151"
  47235. />
  47236. </svg>
  47237. </div>
  47238. {/snippet}
  47239. {#snippet label4Child()}
  47240. <div>
  47241. <Button size="auto" heightOut="0" heightIn="1" fill="lineTheme">
  47242. <div class="px-2">获取验证码</div>
  47243. </Button>
  47244. </div>
  47245. {/snippet}
  47246. </Input>
  47247. <div class="px-4 pt-8 text-xl font-bold">动态显示</div>
  47248. <Input title="动态显示 label5" type="tel" placeholder="请输入11位手机号" maxlength={11} state={mobileState} onchange={changeStateFun}>
  47249. {#snippet label5Child()}
  47250. <div>
  47251. {#if mobileLength === 11}
  47252. <Icon name="ri-check-fill" injClass="text-success" size={14} />
  47253. {:else if mobileLength === 0}{:else}
  47254. <Icon name="ri-close-fill" injClass="text-error" size={14} />
  47255. {/if}
  47256. </div>
  47257. {/snippet}
  47258. </Input>
  47259. <div class="px-4 pt-8 text-xl font-bold">绑定 value</div>
  47260. <Input title="文本" bind:value />
  47261. <Button onclick={() => (visible = true)}>显示当前值</Button>
  47262. <Toast bind:visible message={`当前输入文本:${value}`} />
  47263. <div class="px-4 pt-8 text-xl font-bold">点击 label4 触发事件</div>
  47264. <Input
  47265. title="身份证号"
  47266. placeholder={placeholderIdCard}
  47267. bind:value={IdCard}
  47268. label4={{ name: 'ri-qr-scan-line', size: 16, alpha: 0.5 }}
  47269. onclickLabel4={clickLabel4Fun}
  47270. clear
  47271. />
  47272. <div class="px-4 pt-8 text-xl font-bold">textarea</div>
  47273. <Input placeholder="请输入内容" type="textarea" />
  47274. <div class="px-4 pt-8 text-xl font-bold">textarea 自动高度</div>
  47275. <Input placeholder="请输入内容" type="textarea" autosize />
  47276. <div class="px-4 pt-4 text-xl font-bold">监听 keydown 事件</div>
  47277. <div class="px-4 pt-4">你按下了 {key}</div>
  47278. <Input placeholder="请输入内容" onkeydown={(v) => (key = v)} />
  47279. ================================================
  47280. FILE: packages/stdf/src/routes/loading/en_US/+page.svelte
  47281. ================================================
  47282. <!--Loading Demo-->
  47283. <script lang="ts">
  47284. import { Loading, Tabs, TabContent, Button } from '$lib/index.js';
  47285. //Input the number and return an array of randomly generated colors
  47286. const randomColorArr = (num: number) => {
  47287. // Generate a random hexadecimal color
  47288. const randomColor = () => '#' + ('00000' + ((Math.random() * 0x1000000) << 0).toString(16)).slice(-6);
  47289. let arr = [];
  47290. for (let i = 0; i < num; i++) {
  47291. arr.push(randomColor());
  47292. }
  47293. return arr;
  47294. };
  47295. const arr1 = new Array(54);
  47296. const arr2 = new Array(6);
  47297. const arr4 = new Array(4);
  47298. const labels = [{ text: 'One color' }, { text: 'Two color' }, { text: 'Four color' }, { text: 'Other' }];
  47299. const speedBtns = [0.5, 1, 2];
  47300. let speed = $state(1);
  47301. </script>
  47302. <div class="py-4">
  47303. <Tabs tab={{ labels }}>
  47304. <TabContent>
  47305. <div class="py-4">
  47306. <div class="flex text-center text-sm font-bold">
  47307. {#each ['Default', 'Theme', 'Custom', 'Inverse', 'Inv theme'] as item}
  47308. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47309. {/each}
  47310. </div>
  47311. <div class="grid grid-cols-5">
  47312. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47313. {#each arr1 as _, i}
  47314. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47315. <div class="h-8 w-8">
  47316. <Loading type={'1_' + i} bind:speed />
  47317. </div>
  47318. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47319. </div>
  47320. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47321. <div class="h-8 w-8">
  47322. <Loading type={'1_' + i} theme bind:speed />
  47323. </div>
  47324. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47325. </div>
  47326. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47327. <div class="h-8 w-8">
  47328. <Loading type={'1_' + i} theme customColor={randomColorArr(1)} bind:speed />
  47329. </div>
  47330. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47331. </div>
  47332. <div
  47333. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47334. >
  47335. <div class="h-8 w-8">
  47336. <Loading type={'1_' + i} inverse bind:speed />
  47337. </div>
  47338. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47339. </div>
  47340. <div
  47341. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47342. >
  47343. <div class="h-8 w-8">
  47344. <Loading type={'1_' + i} theme inverse bind:speed />
  47345. </div>
  47346. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47347. </div>
  47348. {/each}
  47349. </div>
  47350. </div>
  47351. <div class="p-4 text-xs">Continually updated...</div>
  47352. </TabContent>
  47353. <TabContent>
  47354. <div class="py-4">
  47355. <div class="flex text-center text-sm font-bold">
  47356. {#each ['Default', 'Custom', 'Inverse'] as item}
  47357. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47358. {/each}
  47359. </div>
  47360. <div class="grid grid-cols-3">
  47361. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47362. {#each arr2 as _, i}
  47363. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47364. <div class="h-8 w-8">
  47365. <Loading type={'2_' + i} bind:speed />
  47366. </div>
  47367. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47368. </div>
  47369. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47370. <div class="h-8 w-8">
  47371. <Loading type={'2_' + i} customColor={randomColorArr(2)} bind:speed />
  47372. </div>
  47373. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47374. </div>
  47375. <div
  47376. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47377. >
  47378. <div class="h-8 w-8">
  47379. <Loading type={'2_' + i} inverse bind:speed />
  47380. </div>
  47381. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47382. </div>
  47383. {/each}
  47384. </div>
  47385. </div>
  47386. <div class="p-4 text-xs">Continually updated...</div>
  47387. </TabContent>
  47388. <TabContent>
  47389. <div class="py-4">
  47390. <div class="flex text-center text-sm font-bold">
  47391. {#each ['Default', 'Custom', 'Default', 'Custom'] as item}
  47392. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47393. {/each}
  47394. </div>
  47395. <div class="grid grid-cols-4">
  47396. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47397. {#each arr4 as _, i}
  47398. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47399. <div class="h-8 w-8">
  47400. <Loading type={'4_' + i} bind:speed />
  47401. </div>
  47402. <div class="mt-8 text-center text-xs">{'4_' + i}</div>
  47403. </div>
  47404. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47405. <div class="h-8 w-8">
  47406. <Loading type={'4_' + i} customColor={randomColorArr(4)} bind:speed />
  47407. </div>
  47408. <div class="mt-8 text-center text-xs">{'4_' + i}</div>
  47409. </div>
  47410. {/each}
  47411. </div>
  47412. </div>
  47413. <div class="p-4 text-xs">Continually updated...</div>
  47414. </TabContent>
  47415. <TabContent>
  47416. <div class="py-4"></div>
  47417. <div class="p-4 text-xs">Continually updated...</div>
  47418. </TabContent>
  47419. </Tabs>
  47420. </div>
  47421. <!-- The button group fixed at the bottom, control speed -->
  47422. <div class="sticky bottom-0 left-0 z-10 flex w-full justify-between gap-3 bg-white/60 px-2 backdrop-blur-sm dark:bg-black/60">
  47423. {#each speedBtns as item}
  47424. <div class="flex-1">
  47425. <Button fill={speed === item ? 'base' : 'lineTheme'} size="full" injClass="text-xs px-2" onclick={() => (speed = item)}>
  47426. {item}x speed
  47427. </Button>
  47428. </div>
  47429. {/each}
  47430. </div>
  47431. ================================================
  47432. FILE: packages/stdf/src/routes/loading/zh_CN/+page.svelte
  47433. ================================================
  47434. <!--Loading Demo-->
  47435. <script lang="ts">
  47436. import { Loading, Tabs, TabContent, Button } from '$lib/index.js';
  47437. //传入个数,返回随机生成的颜色数组
  47438. const randomColorArr = (num: number) => {
  47439. //随机生成 16 进制颜色
  47440. const randomColor = () => '#' + ('00000' + ((Math.random() * 0x1000000) << 0).toString(16)).slice(-6);
  47441. let arr = [];
  47442. for (let i = 0; i < num; i++) {
  47443. arr.push(randomColor());
  47444. }
  47445. return arr;
  47446. };
  47447. const arr1 = new Array(54);
  47448. const arr2 = new Array(6);
  47449. const arr4 = new Array(4);
  47450. const labels = [{ text: '单色' }, { text: '双色' }, { text: '四色' }, { text: '其他' }];
  47451. const speedBtns = [0.5, 1, 2];
  47452. let speed = $state(1);
  47453. </script>
  47454. <div class="py-4">
  47455. <Tabs tab={{ labels }}>
  47456. <TabContent>
  47457. <div class="py-4">
  47458. <div class="flex text-center text-sm font-bold">
  47459. {#each ['默认色', '主题色', '自选色', '反差色', '反主色'] as item}
  47460. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47461. {/each}
  47462. </div>
  47463. <div class="grid grid-cols-5">
  47464. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47465. {#each arr1 as _, i}
  47466. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47467. <div class="h-8 w-8">
  47468. <Loading type={'1_' + i} bind:speed />
  47469. </div>
  47470. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47471. </div>
  47472. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47473. <div class="h-8 w-8">
  47474. <Loading type={'1_' + i} theme bind:speed />
  47475. </div>
  47476. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47477. </div>
  47478. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47479. <div class="h-8 w-8">
  47480. <Loading type={'1_' + i} theme customColor={randomColorArr(1)} bind:speed />
  47481. </div>
  47482. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47483. </div>
  47484. <div
  47485. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47486. >
  47487. <div class="h-8 w-8">
  47488. <Loading type={'1_' + i} inverse bind:speed />
  47489. </div>
  47490. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47491. </div>
  47492. <div
  47493. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47494. >
  47495. <div class="h-8 w-8">
  47496. <Loading type={'1_' + i} theme inverse bind:speed />
  47497. </div>
  47498. <div class="mt-8 text-center text-xs">{'1_' + i}</div>
  47499. </div>
  47500. {/each}
  47501. </div>
  47502. </div>
  47503. <div class="p-4 text-xs">持续更新...</div>
  47504. </TabContent>
  47505. <TabContent>
  47506. <div class="py-4">
  47507. <div class="flex text-center text-sm font-bold">
  47508. {#each ['默认色', '自选色', '反差色'] as item}
  47509. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47510. {/each}
  47511. </div>
  47512. <div class="grid grid-cols-3">
  47513. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47514. {#each arr2 as _, i}
  47515. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47516. <div class="h-8 w-8">
  47517. <Loading type={'2_' + i} bind:speed />
  47518. </div>
  47519. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47520. </div>
  47521. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47522. <div class="h-8 w-8">
  47523. <Loading type={'2_' + i} customColor={randomColorArr(2)} bind:speed />
  47524. </div>
  47525. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47526. </div>
  47527. <div
  47528. class="bg-darkBlack dark:bg-darkWhite flex w-full flex-col items-center border border-white/5 py-6 text-white dark:border-black/5 dark:text-black"
  47529. >
  47530. <div class="h-8 w-8">
  47531. <Loading type={'2_' + i} inverse bind:speed />
  47532. </div>
  47533. <div class="mt-8 text-center text-xs">{'2_' + i}</div>
  47534. </div>
  47535. {/each}
  47536. </div>
  47537. </div>
  47538. <div class="p-4 text-xs">持续更新...</div>
  47539. </TabContent>
  47540. <TabContent>
  47541. <div class="py-4">
  47542. <div class="flex text-center text-sm font-bold">
  47543. {#each ['默认色', '自选色', '默认色', '自选色'] as item}
  47544. <div class="flex-1 border border-black/5 py-2 dark:border-white/5">{item}</div>
  47545. {/each}
  47546. </div>
  47547. <div class="grid grid-cols-4">
  47548. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  47549. {#each arr4 as _, i}
  47550. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47551. <div class="h-8 w-8">
  47552. <Loading type={'4_' + i} bind:speed />
  47553. </div>
  47554. <div class="mt-8 text-center text-xs">{'4_' + i}</div>
  47555. </div>
  47556. <div class="flex w-full flex-col items-center border border-black/5 py-6 dark:border-white/5">
  47557. <div class="h-8 w-8">
  47558. <Loading type={'4_' + i} customColor={randomColorArr(4)} bind:speed />
  47559. </div>
  47560. <div class="mt-8 text-center text-xs">{'4_' + i}</div>
  47561. </div>
  47562. {/each}
  47563. </div>
  47564. </div>
  47565. <div class="p-4 text-xs">持续更新...</div>
  47566. </TabContent>
  47567. <TabContent>
  47568. <div class="py-4"></div>
  47569. <div class="p-4 text-xs">持续更新...</div>
  47570. </TabContent>
  47571. </Tabs>
  47572. </div>
  47573. <!-- 固定在底部的按钮组,控制速度 -->
  47574. <div class="sticky bottom-0 left-0 z-10 flex w-full justify-between gap-3 bg-white/60 px-2 backdrop-blur-sm dark:bg-black/60">
  47575. {#each speedBtns as item}
  47576. <div class="flex-1">
  47577. <Button fill={speed === item ? 'base' : 'lineTheme'} size="full" injClass="text-xs px-2" onclick={() => (speed = item)}>
  47578. {item} 倍速
  47579. </Button>
  47580. </div>
  47581. {/each}
  47582. </div>
  47583. ================================================
  47584. FILE: packages/stdf/src/routes/mask/en_US/+page.svelte
  47585. ================================================
  47586. <!-- Mask Demo -->
  47587. <script lang="ts">
  47588. import { Mask, Toast, Cell, Button, Popup } from '$lib/index.js';
  47589. let visible1 = $state(false);
  47590. let visible2 = $state(false);
  47591. let visible3 = $state(false);
  47592. let visible4 = $state(false);
  47593. let visible5 = $state(false);
  47594. let visible6 = $state(false);
  47595. let visible7 = $state(false);
  47596. let visible8 = $state(false);
  47597. let visible9 = $state(false);
  47598. let visible10 = $state(false);
  47599. let visible11 = $state(false);
  47600. let isClick = $state(false);
  47601. </script>
  47602. <div class="py-4">
  47603. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  47604. <Mask visible={visible1} onclickMask={() => (visible1 = false)} />
  47605. <Cell title="Transparency is 0.1" onclick={() => (visible2 = true)} />
  47606. <Mask visible={visible2} opacity="0.1" onclickMask={() => (visible2 = false)} />
  47607. <Cell title="Transparency is 0.8" onclick={() => (visible3 = true)} />
  47608. <Mask visible={visible3} opacity="0.8" onclickMask={() => (visible3 = false)} />
  47609. <Cell title="Click through" detail="Please close manually" onclick={() => (visible4 = true)} />
  47610. <Mask visible={visible4} clickable />
  47611. <div class="flex">
  47612. <div class="flex-1"><Button onclick={() => (isClick = !isClick)}>{isClick ? 'Click on me' : 'Click through'}</Button></div>
  47613. <div class="flex-1"><Button onclick={() => (visible4 = false)}>Manual shutdown</Button></div>
  47614. </div>
  47615. <Cell title="Reverse color mask" onclick={() => (visible5 = true)} />
  47616. <Mask visible={visible5} inverse onclickMask={() => (visible5 = false)} />
  47617. <Cell title="Blur mask" onclick={() => (visible6 = true)} />
  47618. <Mask visible={visible6} backdropBlur="xs" opacity="0" onclickMask={() => (visible6 = false)} />
  47619. <Cell title="Increase ambiguity" onclick={() => (visible7 = true)} />
  47620. <Mask visible={visible7} backdropBlur="xl" opacity="0" onclickMask={() => (visible7 = false)} />
  47621. <Cell title="Increased the animation time" onclick={() => (visible8 = true)} />
  47622. <Mask visible={visible8} duration={1000} onclickMask={() => (visible8 = false)} />
  47623. <Cell title="Increased the duration of vanishing animation" onclick={() => (visible9 = true)} />
  47624. <Mask visible={visible9} outDuration={1000} onclickMask={() => (visible9 = false)} />
  47625. <Cell title="Toast Use in" onclick={() => (visible10 = true)} />
  47626. <Toast bind:visible={visible10} message="Transparency is 0" />
  47627. <Cell title="Popup Use in" onclick={() => (visible11 = true)} />
  47628. <Popup bind:visible={visible11} />
  47629. </div>
  47630. ================================================
  47631. FILE: packages/stdf/src/routes/mask/zh_CN/+page.svelte
  47632. ================================================
  47633. <!-- Mask Demo -->
  47634. <script lang="ts">
  47635. import { Mask, Toast, Cell, Button, Popup } from '$lib/index.js';
  47636. let visible1 = $state(false);
  47637. let visible2 = $state(false);
  47638. let visible3 = $state(false);
  47639. let visible4 = $state(false);
  47640. let visible5 = $state(false);
  47641. let visible6 = $state(false);
  47642. let visible7 = $state(false);
  47643. let visible8 = $state(false);
  47644. let visible9 = $state(false);
  47645. let visible10 = $state(false);
  47646. let visible11 = $state(false);
  47647. let isClick = $state(false);
  47648. </script>
  47649. <div class="py-4">
  47650. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  47651. <Mask visible={visible1} onclickMask={() => (visible1 = false)} />
  47652. <Cell title="透明度为 0.1" onclick={() => (visible2 = true)} />
  47653. <Mask visible={visible2} opacity="0.1" onclickMask={() => (visible2 = false)} />
  47654. <Cell title="透明度为 0.8" onclick={() => (visible3 = true)} />
  47655. <Mask visible={visible3} opacity="0.8" onclickMask={() => (visible3 = false)} />
  47656. <Cell title="点击穿透" detail="请手动关闭" onclick={() => (visible4 = true)} />
  47657. <Mask visible={visible4} clickable />
  47658. <div class="flex">
  47659. <div class="flex-1"><Button onclick={() => (isClick = !isClick)}>{isClick ? '已经点到我了' : '测试点击穿透'}</Button></div>
  47660. <div class="flex-1"><Button onclick={() => (visible4 = false)}>手动关闭</Button></div>
  47661. </div>
  47662. <Cell title="反色遮罩" onclick={() => (visible5 = true)} />
  47663. <Mask visible={visible5} inverse onclickMask={() => (visible5 = false)} />
  47664. <Cell title="模糊遮罩" onclick={() => (visible6 = true)} />
  47665. <Mask visible={visible6} backdropBlur="xs" opacity="0" onclickMask={() => (visible6 = false)} />
  47666. <Cell title="加大模糊度" onclick={() => (visible7 = true)} />
  47667. <Mask visible={visible7} backdropBlur="xl" opacity="0" onclickMask={() => (visible7 = false)} />
  47668. <Cell title="增加出现动画时长" onclick={() => (visible8 = true)} />
  47669. <Mask visible={visible8} duration={1000} onclickMask={() => (visible8 = false)} />
  47670. <Cell title="增加消失动画时长" onclick={() => (visible9 = true)} />
  47671. <Mask visible={visible9} outDuration={1000} onclickMask={() => (visible9 = false)} />
  47672. <Cell title="Toast 中使用" onclick={() => (visible10 = true)} />
  47673. <Toast bind:visible={visible10} message="透明度为 0" />
  47674. <Cell title="Popup 中使用" onclick={() => (visible11 = true)} />
  47675. <Popup bind:visible={visible11} />
  47676. </div>
  47677. ================================================
  47678. FILE: packages/stdf/src/routes/modal/en_US/+page.svelte
  47679. ================================================
  47680. <!-- Modal Demo -->
  47681. <script lang="ts">
  47682. import { Modal, Cell, Toast } from '$lib/index.js';
  47683. import Aphorism from '../../components/Aphorism.svelte';
  47684. let visible1 = $state(false);
  47685. let visible2 = $state(false);
  47686. let visible3 = $state(false);
  47687. let visible4 = $state(false);
  47688. let visible5 = $state(false);
  47689. let visible6 = $state(false);
  47690. let visible7 = $state(false);
  47691. let visible8 = $state(false);
  47692. let visible9 = $state(false);
  47693. let visible10 = $state(false);
  47694. let visible11 = $state(false);
  47695. let visible12 = $state(false);
  47696. let visible13 = $state(false);
  47697. let visible14 = $state(false);
  47698. let visible15 = $state(false);
  47699. let toastVisible = $state(false);
  47700. $effect(() => {
  47701. if (visible15) {
  47702. setTimeout(() => {
  47703. visible15 = false;
  47704. }, 3000);
  47705. }
  47706. });
  47707. </script>
  47708. <div class="py-4">
  47709. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  47710. <Modal bind:visible={visible1} title="Do you understand?" content="Those who stay will suffer the most" btnText="I see" />
  47711. <Cell title="Content usage Snippet" onclick={() => (visible2 = true)} />
  47712. <Modal bind:visible={visible2}>
  47713. {#snippet contentChild()}
  47714. <Aphorism num={1} compact />
  47715. {/snippet}
  47716. </Modal>
  47717. <Cell title="Do not show the title" onclick={() => (visible3 = true)} />
  47718. <Modal bind:visible={visible3} title="" />
  47719. <Cell title="Do not show button" onclick={() => (visible4 = true)} />
  47720. <Modal bind:visible={visible4} showBtn={false}>
  47721. {#snippet contentChild()}
  47722. <Aphorism num={1} compact />
  47723. {/snippet}
  47724. </Modal>
  47725. <Cell title="Click the mask to close" onclick={() => (visible5 = true)} />
  47726. <Modal bind:visible={visible5} popup={{ maskClosable: true }} />
  47727. <Cell title="Custom icon" onclick={() => (visible6 = true)} />
  47728. <Modal
  47729. bind:visible={visible6}
  47730. content="Please wear a mask!"
  47731. showIcon
  47732. icon={{ name: 'ri-surgical-mask-fill', size: 40, injClass: 'text-[#48a1b4]' }}
  47733. />
  47734. <Cell title="Error status button" onclick={() => (visible8 = true)} />
  47735. <Modal bind:visible={visible8} btnText="I was wrong." button={{ state: 'error' }} />
  47736. <Cell title="Full rounded corner button" onclick={() => (visible9 = true)} />
  47737. <Modal bind:visible={visible9} button={{ radius: 'full' }} />
  47738. <Cell title="Theme color plain text button" onclick={() => (visible12 = true)} />
  47739. <Modal bind:visible={visible12} button={{ fill: 'textTheme' }} />
  47740. <Cell title="Content uses Snippet and scrolls" onclick={() => (visible10 = true)} />
  47741. <Modal bind:visible={visible10}>
  47742. {#snippet contentChild()}
  47743. <div class="h-56 overflow-auto">
  47744. <Aphorism num={6} compact />
  47745. </div>
  47746. {/snippet}
  47747. </Modal>
  47748. <Cell title="Show narrow" onclick={() => (visible7 = true)} />
  47749. <Modal bind:visible={visible7} popup={{ px: '20' }} />
  47750. <Cell title="Another animation effect" onclick={() => (visible11 = true)} />
  47751. <Modal bind:visible={visible11} content="Rebound transition" popup={{ easeType: 'backOut' }} />
  47752. <Cell title="Listening shutdown event" onclick={() => (visible13 = true)} />
  47753. <Modal bind:visible={visible13} onclose={() => (toastVisible = true)} />
  47754. <Toast bind:visible={toastVisible} message="Shut down Modal!" />
  47755. <Cell title="Heading left" onclick={() => (visible14 = true)} />
  47756. <Modal bind:visible={visible14} title="Heading left" titleAlign="left" />
  47757. <Cell title="Automatic shutdown" onclick={() => (visible15 = true)} />
  47758. <Modal bind:visible={visible15} content="Don't move! I'll be gone in three seconds!" />
  47759. </div>
  47760. <!-- Aphorism.svelte -->
  47761. <!--
  47762. <script lang="ts">
  47763. // 引入数据
  47764. // import data
  47765. import aphorisms from '../../data/aphorisms';
  47766. /**
  47767. * @typedef {Object} Props
  47768. * @property {number} [num] - number of items to display
  47769. * @property {boolean} [compact] - whether to use compact mode
  47770. */
  47771. /** @type {Props} */
  47772. let { num = 0, compact = false } = $props();
  47773. // 从 aphorisms 随机取出 num 条数据
  47774. // get num items from aphorisms randomly
  47775. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  47776. </script>
  47777. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  47778. {#each aphorismsList as item}
  47779. <div class:py-6={num > 1}>
  47780. <div class="text-sm text-justify">{item.text}</div>
  47781. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  47782. </div>
  47783. {/each}
  47784. </div>
  47785. -->
  47786. ================================================
  47787. FILE: packages/stdf/src/routes/modal/zh_CN/+page.svelte
  47788. ================================================
  47789. <!-- Modal Demo -->
  47790. <script lang="ts">
  47791. import { Modal, Cell, Toast } from '$lib/index.js';
  47792. import Aphorism from '../../components/Aphorism.svelte';
  47793. let visible1 = $state(false);
  47794. let visible2 = $state(false);
  47795. let visible3 = $state(false);
  47796. let visible4 = $state(false);
  47797. let visible5 = $state(false);
  47798. let visible6 = $state(false);
  47799. let visible7 = $state(false);
  47800. let visible8 = $state(false);
  47801. let visible9 = $state(false);
  47802. let visible10 = $state(false);
  47803. let visible11 = $state(false);
  47804. let visible12 = $state(false);
  47805. let visible13 = $state(false);
  47806. let visible14 = $state(false);
  47807. let visible15 = $state(false);
  47808. let toastVisible = $state(false);
  47809. $effect(() => {
  47810. if (visible15) {
  47811. setTimeout(() => {
  47812. visible15 = false;
  47813. }, 3000);
  47814. }
  47815. });
  47816. </script>
  47817. <div class="py-4">
  47818. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  47819. <Modal bind:visible={visible1} title="您明白吗?" content="留下来的人才是最痛苦的" btnText="我明白了" />
  47820. <Cell title="内容使用 Snippet" onclick={() => (visible2 = true)} />
  47821. <Modal bind:visible={visible2}>
  47822. {#snippet contentChild()}
  47823. <Aphorism num={1} compact />
  47824. {/snippet}
  47825. </Modal>
  47826. <Cell title="不显示标题" onclick={() => (visible3 = true)} />
  47827. <Modal bind:visible={visible3} title="" />
  47828. <Cell title="不显示按钮" onclick={() => (visible4 = true)} />
  47829. <Modal bind:visible={visible4} showBtn={false}>
  47830. {#snippet contentChild()}
  47831. <Aphorism num={1} compact />
  47832. {/snippet}
  47833. </Modal>
  47834. <Cell title="点击遮罩关闭" onclick={() => (visible5 = true)} />
  47835. <Modal bind:visible={visible5} popup={{ maskClosable: true }} />
  47836. <Cell title="自定义图标" onclick={() => (visible6 = true)} />
  47837. <Modal
  47838. bind:visible={visible6}
  47839. content="请佩戴口罩!"
  47840. showIcon
  47841. icon={{ name: 'ri-surgical-mask-fill', size: 40, injClass: 'text-[#48a1b4]' }}
  47842. />
  47843. <Cell title="错误状态按钮" onclick={() => (visible8 = true)} />
  47844. <Modal bind:visible={visible8} btnText="我错了" button={{ state: 'error' }} />
  47845. <Cell title="全圆角按钮" onclick={() => (visible9 = true)} />
  47846. <Modal bind:visible={visible9} button={{ radius: 'full' }} />
  47847. <Cell title="主题色纯文本按钮" onclick={() => (visible12 = true)} />
  47848. <Modal bind:visible={visible12} button={{ fill: 'textTheme' }} />
  47849. <Cell title="内容使用 Snippet 且滚动" onclick={() => (visible10 = true)} />
  47850. <Modal bind:visible={visible10}>
  47851. {#snippet contentChild()}
  47852. <div class="h-56 overflow-auto">
  47853. <Aphorism num={6} compact />
  47854. </div>
  47855. {/snippet}
  47856. </Modal>
  47857. <Cell title="显示窄一点" onclick={() => (visible7 = true)} />
  47858. <Modal bind:visible={visible7} popup={{ px: '20' }} />
  47859. <Cell title="另一种动画效果" onclick={() => (visible11 = true)} />
  47860. <Modal bind:visible={visible11} content="回弹过渡" popup={{ easeType: 'backOut' }} />
  47861. <Cell title="监听关闭事件" onclick={() => (visible13 = true)} />
  47862. <Modal bind:visible={visible13} onclose={() => (toastVisible = true)} />
  47863. <Toast bind:visible={toastVisible} message="关闭了 Modal!" />
  47864. <Cell title="标题居左" onclick={() => (visible14 = true)} />
  47865. <Modal bind:visible={visible14} title="标题居左" titleAlign="left" />
  47866. <Cell title="自动关闭" onclick={() => (visible15 = true)} />
  47867. <Modal bind:visible={visible15} content="别动!3 秒后我立即消失!" />
  47868. </div>
  47869. <!-- Aphorism.svelte -->
  47870. <!--
  47871. <script lang=""ts>
  47872. // 引入数据
  47873. // import data
  47874. import aphorisms from '../../data/aphorisms';
  47875. /**
  47876. * @typedef {Object} Props
  47877. * @property {number} [num] - number of items to display
  47878. * @property {boolean} [compact] - whether to use compact mode
  47879. */
  47880. /** @type {Props} */
  47881. let { num = 0, compact = false } = $props();
  47882. // 从 aphorisms 随机取出 num 条数据
  47883. // get num items from aphorisms randomly
  47884. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  47885. </script>
  47886. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  47887. {#each aphorismsList as item}
  47888. <div class:py-6={num > 1}>
  47889. <div class="text-sm text-justify">{item.text}</div>
  47890. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  47891. </div>
  47892. {/each}
  47893. </div>
  47894. -->
  47895. ================================================
  47896. FILE: packages/stdf/src/routes/navBar/en_US/+page.svelte
  47897. ================================================
  47898. <!-- NavBar Demo -->
  47899. <script lang="ts">
  47900. import { NavBar, Icon, Toast } from '$lib/index.js';
  47901. const icons1 = [{ name: 'ri-paint-brush-line', theme: true }, { name: 'ri-share-line' }];
  47902. const icons2 = [{ name: 'ri-command-line' }, { name: 'ri-drag-move-line' }];
  47903. const icons3 = [{ name: 'ri-indent-decrease' }, { name: 'ri-service-line' }];
  47904. const icons4 = [{ name: 'ri-hand-heart-line', theme: true }, { name: 'ri-parent-line' }];
  47905. let visible1 = $state(false);
  47906. let visible2 = $state(false);
  47907. let rightIndex = $state(0);
  47908. let visible3 = $state(false);
  47909. </script>
  47910. <div class="flex flex-col space-y-8 py-8">
  47911. <NavBar title="Basic usage" />
  47912. <NavBar title="Use Icon on the right side" rights={icons1} />
  47913. <NavBar title="Title centered" titleAlign="center" rights={[{ name: 'ri-command-line' }]} />
  47914. <NavBar title="Click on the left" onclickLeft={() => (visible1 = true)} />
  47915. <Toast bind:visible={visible1} message="Clicked on the left!" />
  47916. <NavBar
  47917. title="Click on the right"
  47918. rights={icons2}
  47919. onclickRight={(index) => {
  47920. visible2 = true;
  47921. rightIndex = index;
  47922. }}
  47923. />
  47924. <Toast bind:visible={visible2} message={`The index of the clicked right icon is ${rightIndex}.`} />
  47925. <NavBar title="No left and bottom dividers, long text" left={null} line={false} rights={icons3} />
  47926. <NavBar title="Custom background color by injClass" injClass="!bg-[#e0e0e0] dark:!bg-[green]" />
  47927. <NavBar>
  47928. {#snippet titleChild()}
  47929. <div class="text-[red] dark:text-[green]">Custom text color by Snippet</div>
  47930. {/snippet}
  47931. </NavBar>
  47932. <NavBar>
  47933. {#snippet titleChild()}
  47934. <div class="flex h-12 flex-col justify-around text-xs">
  47935. <div class="text-sm">title Snippet renders</div>
  47936. <div>right Snippet renders</div>
  47937. </div>
  47938. {/snippet}
  47939. {#snippet rightChild()}
  47940. <div>
  47941. <button class="text-primary dark:text-dark h-12 w-12 cursor-pointer text-center" onclick={() => (visible3 = true)}>Hello</button>
  47942. </div>
  47943. {/snippet}
  47944. </NavBar>
  47945. <Toast bind:visible={visible3} message="Clicked on the right Snippet content!" />
  47946. <NavBar title="Love version" love rights={icons4} />
  47947. <NavBar injClass="!bg-transparent" line={false}>
  47948. {#snippet leftChild()}
  47949. <div class="m-2 h-8 w-8 rounded-full bg-white text-center leading-8 dark:bg-black/50">
  47950. <Icon name="ri-home-7-line" size={18} top={-2} />
  47951. </div>
  47952. {/snippet}
  47953. {#snippet titleChild()}
  47954. <div class="my-2 h-8 rounded-full bg-white px-3 text-sm leading-8 dark:bg-black/50">custom styles by injClass and Snippet</div>
  47955. {/snippet}
  47956. {#snippet rightChild()}
  47957. <div class="m-2 h-8 w-8 rounded-full bg-white text-center leading-8 dark:bg-black/50">
  47958. <Icon name="ri-customer-service-2-line" size={18} top={-2} />
  47959. </div>
  47960. {/snippet}
  47961. </NavBar>
  47962. </div>
  47963. ================================================
  47964. FILE: packages/stdf/src/routes/navBar/zh_CN/+page.svelte
  47965. ================================================
  47966. <!-- NavBar Demo -->
  47967. <script lang="ts">
  47968. import { NavBar, Icon, Toast } from '$lib/index.js';
  47969. const icons1 = [{ name: 'ri-paint-brush-line', theme: true }, { name: 'ri-share-line' }];
  47970. const icons2 = [{ name: 'ri-command-line' }, { name: 'ri-drag-move-line' }];
  47971. const icons3 = [{ name: 'ri-indent-decrease' }, { name: 'ri-service-line' }];
  47972. const icons4 = [{ name: 'ri-hand-heart-line', theme: true }, { name: 'ri-parent-line' }];
  47973. let visible1 = $state(false);
  47974. let visible2 = $state(false);
  47975. let rightIndex = $state(0);
  47976. let visible3 = $state(false);
  47977. </script>
  47978. <div class="flex flex-col space-y-8 py-8">
  47979. <NavBar title="基础用法" />
  47980. <NavBar title="右侧使用 Icon" rights={icons1} />
  47981. <NavBar title="标题居中" titleAlign="center" rights={[{ name: 'ri-command-line' }]} />
  47982. <NavBar title="点击左侧" onclickLeft={() => (visible1 = true)} />
  47983. <Toast bind:visible={visible1} message="点击了左侧!" />
  47984. <NavBar
  47985. title="点击右侧"
  47986. rights={icons2}
  47987. onclickRight={(index) => {
  47988. visible2 = true;
  47989. rightIndex = index;
  47990. }}
  47991. />
  47992. <Toast bind:visible={visible2} message={`点击的右侧图标索引值是 ${rightIndex}。`} />
  47993. <NavBar title="无左侧与底分割线,文字过长长长长长长长" left={null} line={false} rights={icons3} />
  47994. <NavBar title="自定义背景颜色 by injClass" injClass="!bg-[#e0e0e0] dark:!bg-[green]" />
  47995. <NavBar>
  47996. {#snippet titleChild()}
  47997. <div class="text-[red] dark:text-[green]">自定义文字颜色 by Snippet</div>
  47998. {/snippet}
  47999. </NavBar>
  48000. <NavBar>
  48001. {#snippet titleChild()}
  48002. <div class="flex h-12 flex-col justify-around text-xs">
  48003. <div class="text-sm">title 插槽渲染标题区域</div>
  48004. <div>right 插槽渲染右侧且可点击</div>
  48005. </div>
  48006. {/snippet}
  48007. {#snippet rightChild()}
  48008. <div>
  48009. <button class="text-primary dark:text-dark h-12 w-12 cursor-pointer text-center" onclick={() => (visible3 = true)}>Hello</button>
  48010. </div>
  48011. {/snippet}
  48012. </NavBar>
  48013. <Toast bind:visible={visible3} message="点击了右侧插槽内容!" />
  48014. <NavBar title="关爱版导航栏" love rights={icons4} />
  48015. <NavBar injClass="!bg-transparent" line={false}>
  48016. {#snippet leftChild()}
  48017. <div class="m-2 h-8 w-8 rounded-full bg-white text-center leading-8 dark:bg-black/50">
  48018. <Icon name="ri-home-7-line" size={18} top={-2} />
  48019. </div>
  48020. {/snippet}
  48021. {#snippet titleChild()}
  48022. <div class="my-2 h-8 rounded-full bg-white px-3 text-sm leading-8 dark:bg-black/50">injClass 与 Snippet 结合自定义样式</div>
  48023. {/snippet}
  48024. {#snippet rightChild()}
  48025. <div class="m-2 h-8 w-8 rounded-full bg-white text-center leading-8 dark:bg-black/50">
  48026. <Icon name="ri-customer-service-2-line" size={18} top={-2} />
  48027. </div>
  48028. {/snippet}
  48029. </NavBar>
  48030. </div>
  48031. ================================================
  48032. FILE: packages/stdf/src/routes/noticeBar/en_US/+page.svelte
  48033. ================================================
  48034. <!-- NoticeBar Demo -->
  48035. <script lang="ts">
  48036. import { NoticeBar, Toast } from '$lib/index.js';
  48037. let textList = ['1. This is the first announcement!', '2. This is the second notice!'];
  48038. let textLongList = [
  48039. '1. This message long, long, long, long, long, long, long, long, long, long, long, long, long!',
  48040. '2. This is the second notice!'
  48041. ];
  48042. let visible = $state(false);
  48043. </script>
  48044. <div class="m-4 mt-8 text-lg font-bold">Basic usage</div>
  48045. <NoticeBar {textList}></NoticeBar>
  48046. <div class="m-4 mt-8 text-lg font-bold">The announcements are short and do not scroll</div>
  48047. <NoticeBar textList={['1. Short notice!', '2. Short notice!']}></NoticeBar>
  48048. <div class="m-4 mt-8 text-lg font-bold">Set notification spacing</div>
  48049. <NoticeBar space={200} {textList}></NoticeBar>
  48050. <div class="m-4 mt-8 text-lg font-bold">Set rolling speed</div>
  48051. <NoticeBar speed={100} {textList}></NoticeBar>
  48052. <div class="m-4 mt-8 text-lg font-bold">Right arrow (listen for click events)</div>
  48053. <NoticeBar rightIcon="arrow" {textList} onclickRight={() => (visible = true)}></NoticeBar>
  48054. <Toast bind:visible message="Click the right arrow!"></Toast>
  48055. <div class="m-4 mt-8 text-lg font-bold">No content on the right</div>
  48056. <NoticeBar rightIcon={null} {textList}></NoticeBar>
  48057. <div class="m-4 mt-8 text-lg font-bold">Nothing on the left</div>
  48058. <NoticeBar leftIcon={null} {textList}></NoticeBar>
  48059. <div class="m-4 mt-8 text-lg font-bold">Set text size</div>
  48060. <NoticeBar fontSize="lg" {textList}></NoticeBar>
  48061. <div class="m-4 mt-8 text-lg font-bold">Custom left</div>
  48062. <NoticeBar leftIcon={{ name: 'ri-notification-2-line', size: 16, top: -1 }} {textList}></NoticeBar>
  48063. <div class="my-4"></div>
  48064. <NoticeBar leftIcon={{ name: 'ri-wireless-charging-line', size: 16, top: -1 }} {textList}></NoticeBar>
  48065. <div class="my-4"></div>
  48066. <NoticeBar {textList}>
  48067. {#snippet leftChild()}🥳{/snippet}
  48068. </NoticeBar>
  48069. <div class="m-4 mt-8 text-lg font-bold">Custom right</div>
  48070. <NoticeBar {textList}>
  48071. {#snippet rightChild()}🥳{/snippet}
  48072. </NoticeBar>
  48073. <div class="m-4 mt-8 text-lg font-bold">Vertical rolling</div>
  48074. <NoticeBar vertical {textList}></NoticeBar>
  48075. <div class="m-4 mt-8 text-lg font-bold">Scroll transition to 1 second</div>
  48076. <NoticeBar vertical duration={1000} {textList}></NoticeBar>
  48077. <div class="m-4 mt-8 text-lg font-bold">The scrolling interval is 8 seconds</div>
  48078. <NoticeBar vertical interval={8} {textList}></NoticeBar>
  48079. <div class="m-4 mt-8 text-lg font-bold">Excessively long text</div>
  48080. <NoticeBar vertical textList={textLongList}></NoticeBar>
  48081. <div class="m-4 mt-8 text-lg font-bold">Single bar does not roll</div>
  48082. <NoticeBar vertical textList={[textLongList[0]]}></NoticeBar>
  48083. <div class="m-4 mt-8 text-lg font-bold">Custom style</div>
  48084. <NoticeBar injClass="!text-error !bg-error/10" {textList}></NoticeBar>
  48085. <div class="my-4"></div>
  48086. <NoticeBar leftIcon={{ name: 'ri-check-line', size: 16, top: -1 }} injClass="!text-success !bg-success/10" {textList}></NoticeBar>
  48087. <div class="my-4"></div>
  48088. <NoticeBar injClass="!text-extend0 !bg-extend0/10" {textList}></NoticeBar>
  48089. <div class="pb-8"></div>
  48090. ================================================
  48091. FILE: packages/stdf/src/routes/noticeBar/zh_CN/+page.svelte
  48092. ================================================
  48093. <!-- NoticeBar Demo -->
  48094. <script lang="ts">
  48095. import { NoticeBar, Toast } from '$lib/index.js';
  48096. let textList = ['1. 这是第一条通告内容!', '2. 这是第二条通告内容!'];
  48097. let textLongList = ['1. 这条通告超长长长长长长长长长长长长长长长长长长长长长!', '2. 这是第二条通告内容!'];
  48098. let visible = $state(false);
  48099. </script>
  48100. <div class="m-4 mt-8 text-lg font-bold">基础用法</div>
  48101. <NoticeBar {textList}></NoticeBar>
  48102. <div class="m-4 mt-8 text-lg font-bold">通告内容较短不滚动</div>
  48103. <NoticeBar textList={['1. 短通告!', '2. 短通告!']}></NoticeBar>
  48104. <div class="m-4 mt-8 text-lg font-bold">设定通告间距</div>
  48105. <NoticeBar space={200} {textList}></NoticeBar>
  48106. <div class="m-4 mt-8 text-lg font-bold">设定滚动速度</div>
  48107. <NoticeBar speed={100} {textList}></NoticeBar>
  48108. <div class="m-4 mt-8 text-lg font-bold">右侧箭头(监听点击事件)</div>
  48109. <NoticeBar rightIcon="arrow" {textList} onclickRight={() => (visible = true)}></NoticeBar>
  48110. <Toast bind:visible message="点击了右侧箭头!"></Toast>
  48111. <div class="m-4 mt-8 text-lg font-bold">右侧无内容</div>
  48112. <NoticeBar rightIcon={null} {textList}></NoticeBar>
  48113. <div class="m-4 mt-8 text-lg font-bold">左侧无内容</div>
  48114. <NoticeBar leftIcon={null} {textList}></NoticeBar>
  48115. <div class="m-4 mt-8 text-lg font-bold">设定文字大小</div>
  48116. <NoticeBar fontSize="lg" {textList}></NoticeBar>
  48117. <div class="m-4 mt-8 text-lg font-bold">自定义左侧</div>
  48118. <NoticeBar leftIcon={{ name: 'ri-notification-2-line', size: 16, top: -1 }} {textList}></NoticeBar>
  48119. <div class="my-4"></div>
  48120. <NoticeBar leftIcon={{ name: 'ri-wireless-charging-line', size: 16, top: -1 }} {textList}></NoticeBar>
  48121. <div class="my-4"></div>
  48122. <NoticeBar {textList}>
  48123. {#snippet leftChild()}🥳{/snippet}
  48124. </NoticeBar>
  48125. <div class="m-4 mt-8 text-lg font-bold">自定义右侧</div>
  48126. <NoticeBar {textList}>
  48127. {#snippet rightChild()}🥳{/snippet}
  48128. </NoticeBar>
  48129. <div class="m-4 mt-8 text-lg font-bold">垂直滚动</div>
  48130. <NoticeBar vertical {textList}></NoticeBar>
  48131. <div class="m-4 mt-8 text-lg font-bold">滚动过渡为 1 秒</div>
  48132. <NoticeBar vertical duration={1000} {textList}></NoticeBar>
  48133. <div class="m-4 mt-8 text-lg font-bold">滚动间隔为 8 秒</div>
  48134. <NoticeBar vertical interval={8} {textList}></NoticeBar>
  48135. <div class="m-4 mt-8 text-lg font-bold">文字过长</div>
  48136. <NoticeBar vertical textList={textLongList}></NoticeBar>
  48137. <div class="m-4 mt-8 text-lg font-bold">单条不滚动</div>
  48138. <NoticeBar vertical textList={[textLongList[0]]}></NoticeBar>
  48139. <div class="m-4 mt-8 text-lg font-bold">自定义样式</div>
  48140. <NoticeBar injClass="!text-error !bg-error/10" {textList}></NoticeBar>
  48141. <div class="my-4"></div>
  48142. <NoticeBar leftIcon={{ name: 'ri-check-line', size: 16, top: -1 }} injClass="!text-success !bg-success/10" {textList}></NoticeBar>
  48143. <div class="my-4"></div>
  48144. <NoticeBar injClass="!text-extend0 !bg-extend0/10" {textList}></NoticeBar>
  48145. <div class="pb-8"></div>
  48146. ================================================
  48147. FILE: packages/stdf/src/routes/numKeyboard/en_US/+page.svelte
  48148. ================================================
  48149. <!-- NumKeyboard Demo -->
  48150. <script lang="ts">
  48151. import { NumKeyboard, Cell, Toast } from '$lib/index.js';
  48152. import { Confetti } from 'svelte-confetti';
  48153. let visible1 = $state(false);
  48154. let visible2 = $state(false);
  48155. let visible3 = $state(false);
  48156. let visible4 = $state(false);
  48157. let visible5 = $state(false);
  48158. let visible6 = $state(false);
  48159. let visible7 = $state(false);
  48160. let visible8 = $state(false);
  48161. let visible9 = $state(false);
  48162. let visible10 = $state(false);
  48163. let visible11 = $state(false);
  48164. let visible12 = $state(false);
  48165. let visible13 = $state(false);
  48166. let visible14 = $state(false);
  48167. let visible15 = $state(false);
  48168. let visible16 = $state(false);
  48169. let visible17 = $state(false);
  48170. let visible18 = $state(false);
  48171. let visible19 = $state(false);
  48172. let visible20 = $state(false);
  48173. let visible21 = $state(false);
  48174. // Demo for click event listening
  48175. let visibleToast = $state(false);
  48176. let key = $state('');
  48177. const clickFunc = (k: string) => {
  48178. key = k;
  48179. visibleToast = true;
  48180. };
  48181. // Demo for open and close event listening
  48182. let loveDom: HTMLElement | null = $state(null);
  48183. // Distance from loveDom to window bottom
  48184. let loveDomBottom = 0;
  48185. let value = $state('');
  48186. let top = $state(0);
  48187. const openFunc = (height: number) => {
  48188. // If loveDom is less than keyboard height from window bottom, move loveDom up by keyboard height
  48189. loveDomBottom = window.innerHeight - (loveDom?.getBoundingClientRect().bottom || 0);
  48190. top = loveDomBottom < height ? -(height - loveDomBottom) - 50 : 0;
  48191. };
  48192. let value21 = $state('');
  48193. // Demo for getting content
  48194. let valueClear = $state('');
  48195. </script>
  48196. <Cell title="Basic Usage" onclick={() => (visible1 = true)} />
  48197. <NumKeyboard bind:visible={visible1} />
  48198. <div class="px-4">Content: {value21}</div>
  48199. <Cell title="Get Content" onclick={() => (visible21 = true)} />
  48200. <NumKeyboard bind:visible={visible21} bind:value={value21} />
  48201. <div class="px-4">Content: {valueClear}</div>
  48202. <Cell title="Clear Content When Open" onclick={() => (visible20 = true)} />
  48203. <NumKeyboard bind:visible={visible20} bind:value={valueClear} clear />
  48204. <Cell title="Hide Done Button" onclick={() => (visible2 = true)} />
  48205. <NumKeyboard bind:visible={visible2} done={false} />
  48206. <Cell title="Show Close Button" onclick={() => (visible3 = true)} />
  48207. <NumKeyboard bind:visible={visible3} close />
  48208. <Cell title="Show Close & Hide Done" subTitle="Must hide decimal point" onclick={() => (visible9 = true)} />
  48209. <NumKeyboard bind:visible={visible9} close dot={false} done={false} />
  48210. <Cell title="Reverse Number Order" onclick={() => (visible4 = true)} />
  48211. <NumKeyboard bind:visible={visible4} reverse />
  48212. <Cell title="Increase Key Height" onclick={() => (visible5 = true)} />
  48213. <NumKeyboard bind:visible={visible5} height="16" />
  48214. <Cell title="Increase Spacing" onclick={() => (visible6 = true)} />
  48215. <NumKeyboard bind:visible={visible6} space="4" p="4" />
  48216. <Cell title="Hide Decimal Point" onclick={() => (visible7 = true)} />
  48217. <NumKeyboard bind:visible={visible7} close dot={false} />
  48218. <Cell title="Hide All Optional Elements" onclick={() => (visible8 = true)} />
  48219. <NumKeyboard bind:visible={visible8} done={false} dot={false} />
  48220. <Cell title="Block Style" onclick={() => (visible10 = true)} />
  48221. <NumKeyboard bind:visible={visible10} type="block" height="14" p="0" />
  48222. <Cell title="Custom Done Text" onclick={() => (visible18 = true)} />
  48223. <NumKeyboard bind:visible={visible18} doneText="Transfer" />
  48224. <Cell title="Click Event Listening" onclick={() => (visible11 = true)} />
  48225. <NumKeyboard bind:visible={visible11} onclick={clickFunc} />
  48226. <Toast bind:visible={visibleToast} duration={500} message={`Clicked ${key}`}></Toast>
  48227. <div
  48228. class="bg-primary dark:bg-dark shadow-primary/30 dark:shadow-dark/30 relative mx-16 h-10 rounded-full text-center text-xl leading-10 text-white shadow-lg transition-all dark:text-black"
  48229. style="top:{top}px"
  48230. bind:this={loveDom}
  48231. >
  48232. {value}
  48233. {#if value === '5201314'}
  48234. <span class="absolute left-1/2"><Confetti rounded amount={100} /></span>
  48235. {/if}
  48236. </div>
  48237. <Cell title="Please Enter 5201314" onclick={() => (visible12 = true)} />
  48238. <NumKeyboard bind:visible={visible12} doneDisabled={value !== '5201314'} bind:value onopen={openFunc} onclose={() => (top = 0)} />
  48239. <Cell title="Larger Key Border Radius" onclick={() => (visible13 = true)} />
  48240. <NumKeyboard bind:visible={visible13} radius="2xl" />
  48241. <Cell title="Inject Done Button Class" onclick={() => (visible14 = true)} />
  48242. <NumKeyboard bind:visible={visible14} doneClass="!bg-gradient-to-r from-[#9820a8] to-[#d16b98]" />
  48243. <Cell title="Inject Panel & Key Class" onclick={() => (visible15 = true)} />
  48244. <NumKeyboard
  48245. bind:visible={visible15}
  48246. panelClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]"
  48247. keyClass="!bg-transparent border border-white/40 !text-white"
  48248. />
  48249. <Cell title="Custom Transition" subTitle="Via popup" onclick={() => (visible16 = true)} />
  48250. <NumKeyboard bind:visible={visible16} popup={{ duration: 1000, easeType: 'bounceOut' }} />
  48251. <Cell title="Opaque Background When Active" subTitle="Via popup mask" onclick={() => (visible17 = true)} />
  48252. <NumKeyboard bind:visible={visible17} popup={{ mask: { opacity: '0.4' } }} />
  48253. <Cell title="Custom Key Font" subTitle="Need to load font in CSS and configure in @theme" onclick={() => (visible19 = true)} />
  48254. <NumKeyboard bind:visible={visible19} keyClass="font-Trueno" />
  48255. ================================================
  48256. FILE: packages/stdf/src/routes/numKeyboard/zh_CN/+page.svelte
  48257. ================================================
  48258. <!-- NumKeyboard Demo -->
  48259. <script lang="ts">
  48260. import { NumKeyboard, Cell, Toast } from '$lib/index.js';
  48261. import { Confetti } from 'svelte-confetti';
  48262. let visible1 = $state(false);
  48263. let visible2 = $state(false);
  48264. let visible3 = $state(false);
  48265. let visible4 = $state(false);
  48266. let visible5 = $state(false);
  48267. let visible6 = $state(false);
  48268. let visible7 = $state(false);
  48269. let visible8 = $state(false);
  48270. let visible9 = $state(false);
  48271. let visible10 = $state(false);
  48272. let visible11 = $state(false);
  48273. let visible12 = $state(false);
  48274. let visible13 = $state(false);
  48275. let visible14 = $state(false);
  48276. let visible15 = $state(false);
  48277. let visible16 = $state(false);
  48278. let visible17 = $state(false);
  48279. let visible18 = $state(false);
  48280. let visible19 = $state(false);
  48281. let visible20 = $state(false);
  48282. let visible21 = $state(false);
  48283. // 演示监听点击事件
  48284. let visibleToast = $state(false);
  48285. let key = $state('');
  48286. const clickFunc = (k: string) => {
  48287. key = k;
  48288. visibleToast = true;
  48289. };
  48290. // 演示监听开启与关闭事件
  48291. let loveDom: HTMLElement | null = $state(null);
  48292. // loveDom 距离窗口底部的距离
  48293. let loveDomBottom = 0;
  48294. let value = $state('');
  48295. let top = $state(0);
  48296. const openFunc = (height: number) => {
  48297. // 如果 loveDom 距离窗口底部小于键盘高度,就把 loveDom 向上移动键盘高度
  48298. loveDomBottom = window.innerHeight - (loveDom?.getBoundingClientRect().bottom || 0);
  48299. top = loveDomBottom < height ? -(height - loveDomBottom) - 50 : 0;
  48300. };
  48301. let value21 = $state('');
  48302. // 演示清空内容
  48303. let valueClear = $state('');
  48304. </script>
  48305. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  48306. <NumKeyboard bind:visible={visible1} />
  48307. <div class="px-4">输入了: {value21}</div>
  48308. <Cell title="获取内容" onclick={() => (visible21 = true)} />
  48309. <NumKeyboard bind:visible={visible21} bind:value={value21} />
  48310. <div class="px-4">输入了: {valueClear}</div>
  48311. <Cell title="打开时清空内容" onclick={() => (visible20 = true)} />
  48312. <NumKeyboard bind:visible={visible20} bind:value={valueClear} clear />
  48313. <Cell title="不显示完成" onclick={() => (visible2 = true)} />
  48314. <NumKeyboard bind:visible={visible2} done={false} />
  48315. <Cell title="显示关闭" onclick={() => (visible3 = true)} />
  48316. <NumKeyboard bind:visible={visible3} close />
  48317. <Cell title="显示关闭不显示完成" subTitle="必须隐藏小数点" onclick={() => (visible9 = true)} />
  48318. <NumKeyboard bind:visible={visible9} close dot={false} done={false} />
  48319. <Cell title="数字上下反向" onclick={() => (visible4 = true)} />
  48320. <NumKeyboard bind:visible={visible4} reverse />
  48321. <Cell title="增高按键高度" onclick={() => (visible5 = true)} />
  48322. <NumKeyboard bind:visible={visible5} height="16" />
  48323. <Cell title="增大间距" onclick={() => (visible6 = true)} />
  48324. <NumKeyboard bind:visible={visible6} space="4" p="4" />
  48325. <Cell title="不显示小数点" onclick={() => (visible7 = true)} />
  48326. <NumKeyboard bind:visible={visible7} close dot={false} />
  48327. <Cell title="不必要的全部不显示" onclick={() => (visible8 = true)} />
  48328. <NumKeyboard bind:visible={visible8} done={false} dot={false} />
  48329. <Cell title="块式" onclick={() => (visible10 = true)} />
  48330. <NumKeyboard bind:visible={visible10} type="block" height="14" p="0" />
  48331. <Cell title="自定义完成文字" onclick={() => (visible18 = true)} />
  48332. <NumKeyboard bind:visible={visible18} doneText="转账" />
  48333. <Cell title="监听点击事件" onclick={() => (visible11 = true)} />
  48334. <NumKeyboard bind:visible={visible11} onclick={clickFunc} />
  48335. <Toast bind:visible={visibleToast} duration={500} message={`点击了 ${key}`}></Toast>
  48336. <div
  48337. class="bg-primary dark:bg-dark shadow-primary/30 dark:shadow-dark/30 relative mx-16 h-10 rounded-full text-center text-xl leading-10 text-white shadow-lg transition-all dark:text-black"
  48338. style="top:{top}px"
  48339. bind:this={loveDom}
  48340. >
  48341. {value}
  48342. {#if value === '5201314'}
  48343. <span class="absolute left-1/2"><Confetti rounded amount={100} /></span>
  48344. {/if}
  48345. </div>
  48346. <Cell title="请输入 5201314" onclick={() => (visible12 = true)} />
  48347. <NumKeyboard bind:visible={visible12} doneDisabled={value !== '5201314'} bind:value onopen={openFunc} onclose={() => (top = 0)} />
  48348. <Cell title="增大按键圆角" onclick={() => (visible13 = true)} />
  48349. <NumKeyboard bind:visible={visible13} radius="2xl" />
  48350. <Cell title="完成按键注入 Class" onclick={() => (visible14 = true)} />
  48351. <NumKeyboard bind:visible={visible14} doneClass="!bg-gradient-to-r from-[#9820a8] to-[#d16b98]" />
  48352. <Cell title="面板与按键注入 Class" onclick={() => (visible15 = true)} />
  48353. <NumKeyboard
  48354. bind:visible={visible15}
  48355. panelClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]"
  48356. keyClass="!bg-transparent border border-white/40 !text-white"
  48357. />
  48358. <Cell title="自定义过渡动画" subTitle="通过 popup" onclick={() => (visible16 = true)} />
  48359. <NumKeyboard bind:visible={visible16} popup={{ duration: 1000, easeType: 'bounceOut' }} />
  48360. <Cell title="激活时背景不透明" subTitle="通过 popup 内的 mask" onclick={() => (visible17 = true)} />
  48361. <NumKeyboard bind:visible={visible17} popup={{ mask: { opacity: '0.4' } }} />
  48362. <Cell title="自定义按键字体" subTitle="需要 CSS 加载字体并在 @theme 中配置" onclick={() => (visible19 = true)} />
  48363. <NumKeyboard bind:visible={visible19} keyClass="font-Trueno" />
  48364. ================================================
  48365. FILE: packages/stdf/src/routes/pagination/en_US/+page.svelte
  48366. ================================================
  48367. <script lang="ts">
  48368. import { onMount } from 'svelte';
  48369. import { Pagination, Loading } from '$lib/index.js';
  48370. import aphorisms from '../../../data/aphorisms.js';
  48371. // total, usually from backend
  48372. const total = 200;
  48373. // current page
  48374. let current = $state(1);
  48375. // simulate request data
  48376. let data: { text: string; from: string; fromItalic?: boolean }[] = $state([]);
  48377. let currentPage = $state(1);
  48378. let pageSize = 4;
  48379. let totalData = $state(0);
  48380. let loading = $state(false);
  48381. const getData = () => {
  48382. loading = true;
  48383. // use setTimeout to simulate request
  48384. setTimeout(() => {
  48385. loading = false;
  48386. // get pageSize data from aphorisms randomly
  48387. data = aphorisms.sort(() => Math.random() - 0.5).slice(0, pageSize);
  48388. totalData = 64;
  48389. }, 2000);
  48390. };
  48391. const changePageFunc = (c: number) => {
  48392. currentPage = c;
  48393. getData();
  48394. };
  48395. // initial request first page
  48396. onMount(() => {
  48397. getData();
  48398. });
  48399. </script>
  48400. <div class="m-4 mt-24 text-lg font-bold">Basic usage</div>
  48401. <Pagination {total} />
  48402. <div class="mx-4 mt-8 text-lg font-bold">Event listening</div>
  48403. <div class="mx-4 mb-2 text-sm">Current page: {current}</div>
  48404. <Pagination {total} onpre={(c) => (current = c)} onnext={(c) => (current = c)} onchange={(c) => (current = c)} />
  48405. <div class="mx-4 mt-24 text-lg font-bold">Initial display omitted page</div>
  48406. <div class="mx-4 mb-4 text-xs">Can be used to guide users</div>
  48407. <Pagination {total} showNextOmitPage />
  48408. <div class="m-4 mt-8 text-lg font-bold">Set initial page</div>
  48409. <Pagination {total} current={10} />
  48410. <div class="mx-4 mt-8 text-lg font-bold">Max display 11 pages</div>
  48411. <div class="mx-4 mb-4 text-xs">Display more pages but the page number is small</div>
  48412. <Pagination maxShowPage={11} {total} />
  48413. <div class="mx-4 mt-8 text-lg font-bold">Max display 5 pages</div>
  48414. <div class="mx-4 mb-4 text-xs">Suitable for scenes with a small paging area</div>
  48415. <div class="flex items-center">
  48416. <div class="px-4">This is my territory</div>
  48417. <div class="flex-1">
  48418. <Pagination maxShowPage={5} {total} />
  48419. </div>
  48420. </div>
  48421. <div class="m-4 mt-8 text-lg font-bold">No data</div>
  48422. <Pagination total={0} />
  48423. <div class="m-4 mt-8 text-lg font-bold">Only one page</div>
  48424. <Pagination total={8} />
  48425. <div class="mx-4 mt-8 text-lg font-bold">Total pages are less than the maximum display pages</div>
  48426. <div class="mx-4 mb-4 text-xs">No omitted page</div>
  48427. <Pagination total={70} />
  48428. <div class="mx-4 mt-8 text-lg font-bold">Total pages are less than the maximum display pages</div>
  48429. <div class="mx-4 mb-4 text-xs">No omitted page</div>
  48430. <Pagination total={90} maxShowPage={7} />
  48431. <div class="mx-4 mt-8 text-lg font-bold">Total pages are many</div>
  48432. <div class="mx-4 mb-4 text-xs">Will exist two omitted pages</div>
  48433. <Pagination {total} />
  48434. <div class="m-4 mt-8 text-lg font-bold">Each page is only 3 items</div>
  48435. <Pagination total={50} pageSize={3} />
  48436. <div class="m-4 mt-8 text-lg font-bold">Highlighted page is border</div>
  48437. <Pagination {total} type="border" />
  48438. <div class="m-4 mt-8 text-lg font-bold">Highlighted page is block</div>
  48439. <Pagination {total} type="block" />
  48440. <div class="m-4 mt-8 text-lg font-bold">Increase the radius of the highlighted page</div>
  48441. <Pagination {total} type="block" radius="xl" />
  48442. <div class="m-4 mt-8 text-lg font-bold">Omitted page column is 2</div>
  48443. <Pagination {total} pageCol={2} />
  48444. <div class="m-4 mt-8 text-lg font-bold">Inject injClass</div>
  48445. <Pagination {total} injClass="mx-2 rounded-full shadow-md dark:shadow-white/10" />
  48446. <div class="m-4 mt-8 text-lg font-bold">Simulate request</div>
  48447. <div class="relative min-h-[20rem] divide-y divide-black/5 px-4 py-8 dark:divide-white/5">
  48448. {#each data as item}
  48449. <div class:py-6={pageSize > 1}>
  48450. <div class="text-justify text-sm">{item.text}</div>
  48451. <div class="mt-1 text-right" class:italic={item.fromItalic}>{item.from}</div>
  48452. </div>
  48453. {/each}
  48454. {#if loading}
  48455. <div class="absolute inset-0 flex h-full w-full flex-col justify-center gap-8 text-center backdrop-blur-sm">
  48456. <div>Querying the {currentPage} page data...</div>
  48457. <Loading />
  48458. </div>
  48459. {/if}
  48460. </div>
  48461. <Pagination {pageSize} total={totalData} onchange={changePageFunc} />
  48462. <div class="mx-4 mt-8 text-lg font-bold">Continuous mode</div>
  48463. <div class="mx-4 mb-4 text-xs">Only allow clicking on the previous and next pages</div>
  48464. <Pagination {total} continuous />
  48465. <div class="pb-10"></div>
  48466. ================================================
  48467. FILE: packages/stdf/src/routes/pagination/zh_CN/+page.svelte
  48468. ================================================
  48469. <script lang="ts">
  48470. import { onMount } from 'svelte';
  48471. import { Pagination, Loading } from '$lib/index.js';
  48472. import aphorisms from '../../../data/aphorisms.js';
  48473. // 总数,一般是后端接口返回
  48474. const total = 200;
  48475. // 当前页码,演示事件监听
  48476. let current = $state(1);
  48477. // 模拟请求数据
  48478. let data: { text: string; from: string; fromItalic?: boolean }[] = $state([]);
  48479. let currentPage = $state(1);
  48480. let pageSize = 4;
  48481. let totalData = $state(0);
  48482. let loading = $state(false);
  48483. const getData = () => {
  48484. loading = true;
  48485. // 使用 setTimeout 模拟请求
  48486. setTimeout(() => {
  48487. loading = false;
  48488. //从 aphorisms 随机取出 pageSize 条数据
  48489. data = aphorisms.sort(() => Math.random() - 0.5).slice(0, pageSize);
  48490. totalData = 64;
  48491. }, 2000);
  48492. };
  48493. const changePageFunc = (c: number) => {
  48494. currentPage = c;
  48495. getData();
  48496. };
  48497. // 初始请求第一页
  48498. onMount(() => {
  48499. getData();
  48500. });
  48501. </script>
  48502. <div class="m-4 mt-24 text-lg font-bold">基础用法</div>
  48503. <Pagination {total} />
  48504. <div class="mx-4 mt-8 text-lg font-bold">事件监听</div>
  48505. <div class="mx-4 mb-2 text-sm">当前页码:{current}</div>
  48506. <Pagination {total} onpre={(c) => (current = c)} onnext={(c) => (current = c)} onchange={(c) => (current = c)} />
  48507. <div class="mx-4 mt-24 text-lg font-bold">初始展示省略页码</div>
  48508. <div class="mx-4 mb-4 text-xs">可用于引导用户</div>
  48509. <Pagination {total} showNextOmitPage />
  48510. <div class="m-4 mt-8 text-lg font-bold">设置初始页</div>
  48511. <Pagination {total} current={10} />
  48512. <div class="mx-4 mt-8 text-lg font-bold">最大显示 11 页</div>
  48513. <div class="mx-4 mb-4 text-xs">同时显示较多页但页码较小</div>
  48514. <Pagination maxShowPage={11} {total} />
  48515. <div class="mx-4 mt-8 text-lg font-bold">最大显示 5 页</div>
  48516. <div class="mx-4 mb-4 text-xs">适合分页区域较小的场景</div>
  48517. <div class="flex items-center">
  48518. <div class="px-4">这是我的地盘</div>
  48519. <div class="flex-1">
  48520. <Pagination maxShowPage={5} {total} />
  48521. </div>
  48522. </div>
  48523. <div class="m-4 mt-8 text-lg font-bold">无数据</div>
  48524. <Pagination total={0} />
  48525. <div class="m-4 mt-8 text-lg font-bold">仅一页</div>
  48526. <Pagination total={8} />
  48527. <div class="mx-4 mt-8 text-lg font-bold">总页数未超过最大显示页数</div>
  48528. <div class="mx-4 mb-4 text-xs">不会存在省略页码</div>
  48529. <Pagination total={70} />
  48530. <div class="mx-4 mt-8 text-lg font-bold">总页数超过最大显示页数但不算多</div>
  48531. <div class="mx-4 mb-4 text-xs">不会同时存在前后两个省略页码</div>
  48532. <Pagination total={90} maxShowPage={7} />
  48533. <div class="mx-4 mt-8 text-lg font-bold">总页数很多</div>
  48534. <div class="mx-4 mb-4 text-xs">会同时存在前后两个省略页码</div>
  48535. <Pagination {total} />
  48536. <div class="m-4 mt-8 text-lg font-bold">每页仅 3 项</div>
  48537. <Pagination total={50} pageSize={3} />
  48538. <div class="m-4 mt-8 text-lg font-bold">高亮页码为边框</div>
  48539. <Pagination {total} type="border" />
  48540. <div class="m-4 mt-8 text-lg font-bold">高亮页码为块状</div>
  48541. <Pagination {total} type="block" />
  48542. <div class="m-4 mt-8 text-lg font-bold">增加高亮页码圆角</div>
  48543. <Pagination {total} type="block" radius="xl" />
  48544. <div class="m-4 mt-8 text-lg font-bold">省略页码列数为 2</div>
  48545. <Pagination {total} pageCol={2} />
  48546. <div class="m-4 mt-8 text-lg font-bold">注入 injClass</div>
  48547. <Pagination {total} injClass="mx-2 rounded-full shadow-md dark:shadow-white/10" />
  48548. <div class="m-4 mt-8 text-lg font-bold">模拟请求</div>
  48549. <div class="relative min-h-[20rem] divide-y divide-black/5 px-4 py-8 dark:divide-white/5">
  48550. {#each data as item}
  48551. <div class:py-6={pageSize > 1}>
  48552. <div class="text-justify text-sm">{item.text}</div>
  48553. <div class="mt-1 text-right" class:italic={item.fromItalic}>{item.from}</div>
  48554. </div>
  48555. {/each}
  48556. {#if loading}
  48557. <div class="absolute inset-0 flex h-full w-full flex-col justify-center gap-8 text-center backdrop-blur-sm">
  48558. <div>查询第 {currentPage} 页数据...</div>
  48559. <Loading />
  48560. </div>
  48561. {/if}
  48562. </div>
  48563. <Pagination {pageSize} total={totalData} onchange={changePageFunc} />
  48564. <div class="mx-4 mt-8 text-lg font-bold">连续模式</div>
  48565. <div class="mx-4 mb-4 text-xs">只允许点击上下页</div>
  48566. <Pagination {total} continuous />
  48567. <div class="pb-10"></div>
  48568. ================================================
  48569. FILE: packages/stdf/src/routes/picker/en_US/+page.svelte
  48570. ================================================
  48571. <!-- Picker Demo -->
  48572. <script lang="ts">
  48573. import { Picker, Cell } from '$lib/index.js';
  48574. // For the sake of clarity, the specific reference data is placed in the data_en.js file, which can be viewed at the bottom of this page.
  48575. import {
  48576. someProvinceList,
  48577. weekList,
  48578. amOrPmList,
  48579. timeList,
  48580. cityList,
  48581. linkageData,
  48582. linkagDiffLabelKeyData,
  48583. linkagCustomChildrenKeyData
  48584. } from './data_en.js';
  48585. const datas = [{ data: someProvinceList }];
  48586. const col3Datas = [{ data: weekList }, { data: amOrPmList }, { data: timeList }];
  48587. let visible1 = $state(false);
  48588. let visible2 = $state(false);
  48589. let visible3 = $state(false);
  48590. let visible4 = $state(false);
  48591. let visible5 = $state(false);
  48592. let visible6 = $state(false);
  48593. let visible7 = $state(false);
  48594. let visible8 = $state(false);
  48595. let visible9 = $state(false);
  48596. let visible10 = $state(false);
  48597. let visible11 = $state(false);
  48598. let visible12 = $state(false);
  48599. let visible13 = $state(false);
  48600. let visible14 = $state(false);
  48601. let visible15 = $state(false);
  48602. let visible16 = $state(false);
  48603. let visible17 = $state(false);
  48604. let visible18 = $state(false);
  48605. let visible19 = $state(false);
  48606. let visible20 = $state(false);
  48607. let visible21 = $state(false);
  48608. let visible22 = $state(false);
  48609. let currentDetail = $state('Please select');
  48610. let allItems: { [key: string]: string }[] = $state([]);
  48611. let allIndexs: number[] = $state([]);
  48612. </script>
  48613. <div class="py-4">
  48614. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  48615. <Picker bind:visible={visible1} {datas} />
  48616. <Cell title="Custom title" onclick={() => (visible2 = true)} />
  48617. <Picker bind:visible={visible2} title="Please select state" {datas} />
  48618. <Cell title="Visible 7 rows" onclick={() => (visible3 = true)} />
  48619. <Picker bind:visible={visible3} datas={[{ data: someProvinceList, showRow: 7 }]} />
  48620. <Cell title="Close automatic scrolling to the last selected item" onclick={() => (visible4 = true)} />
  48621. <Picker bind:visible={visible4} {datas} autoScrollToLast={false} />
  48622. <Cell
  48623. title="Initial selection is always the 4th item"
  48624. onclick={() => (visible5 = true)}
  48625. subTitle="Need to close automatic selection of the last selected item"
  48626. />
  48627. <Picker bind:visible={visible5} datas={[{ data: someProvinceList, initIndex: 3 }]} autoScrollToLast={false} />
  48628. <Cell title="Cancel animation when scrolling" onclick={() => (visible6 = true)} />
  48629. <Picker bind:visible={visible6} datas={[{ data: someProvinceList, useAnimation: false }]} />
  48630. <Cell title="Custom label key value" onclick={() => (visible7 = true)} />
  48631. <Picker bind:visible={visible7} datas={[{ data: cityList, labelKey: 'cityName' }]} title="Please select city" />
  48632. <Cell title="Right display selected item" detail={currentDetail} onclick={() => (visible8 = true)} />
  48633. <Picker bind:visible={visible8} {datas} onconfirm={(items) => (currentDetail = items[0].label)} />
  48634. <Cell title="Single column left alignment" onclick={() => (visible20 = true)} />
  48635. <Picker bind:visible={visible20} datas={[{ data: someProvinceList, align: 'left' }]} />
  48636. <Cell title="Multi-column picker" onclick={() => (visible9 = true)} />
  48637. <Picker bind:visible={visible9} datas={col3Datas} />
  48638. <Cell title="Different column visibility rows" onclick={() => (visible10 = true)} />
  48639. <Picker bind:visible={visible10} datas={[{ data: weekList }, { data: amOrPmList, showRow: 3 }, { data: timeList, showRow: 7 }]} />
  48640. <Cell title="Different column flex ratios" onclick={() => (visible11 = true)} />
  48641. <Picker
  48642. bind:visible={visible11}
  48643. datas={[
  48644. { data: weekList, flex: 3 },
  48645. { data: amOrPmList, flex: 1 },
  48646. { data: timeList, flex: 2 }
  48647. ]}
  48648. />
  48649. <Cell title="Different column alignments" onclick={() => (visible21 = true)} />
  48650. <Picker
  48651. bind:visible={visible21}
  48652. datas={[
  48653. { data: weekList, align: 'left' },
  48654. { data: amOrPmList, align: 'center' },
  48655. { data: timeList, align: 'right' }
  48656. ]}
  48657. />
  48658. <Cell title="Multi-level linkage" onclick={() => (visible12 = true)} />
  48659. <Picker bind:visible={visible12} datas={linkageData} isLinkage />
  48660. <Cell title="Multi-level linkage different visible rows" onclick={() => (visible13 = true)} />
  48661. <Picker bind:visible={visible13} datas={linkageData} linkageShowRows={[3, 5, 7]} isLinkage />
  48662. <Cell title="Multi-level linkage different flex ratios" onclick={() => (visible14 = true)} />
  48663. <Picker bind:visible={visible14} datas={linkageData} linkageFlexs={[1, 2, 3]} isLinkage />
  48664. <Cell title="Multi-level linkage custom label key for each level" onclick={() => (visible15 = true)} />
  48665. <Picker bind:visible={visible15} datas={linkagDiffLabelKeyData} linkageLabelKeys={['province', 'city', 'region']} isLinkage />
  48666. <Cell title="Multi-level linkage custom key for each level's children" onclick={() => (visible16 = true)} />
  48667. <Picker bind:visible={visible16} datas={linkagCustomChildrenKeyData} linkageChildrenKey="child" isLinkage />
  48668. <Cell title="Multi-level linkage different alignments" onclick={() => (visible22 = true)} />
  48669. <Picker bind:visible={visible22} datas={linkageData} linkageAligns={['right', 'center', 'left']} isLinkage />
  48670. <Cell title="Multi-level linkage set initial selected items for each column" onclick={() => (visible17 = true)} />
  48671. <Picker bind:visible={visible17} datas={linkageData} linkageInitIndexs={[0, 1, 8]} isLinkage />
  48672. <div class="px-4">
  48673. {#if allItems.length}
  48674. Currently selected:
  48675. {#each allItems as item}
  48676. <span class="mr-2 text-primary dark:text-dark">{item.label}</span>
  48677. {/each}
  48678. {:else}
  48679. <div>Please select data</div>
  48680. {/if}
  48681. </div>
  48682. <div class="px-4">
  48683. {#if allIndexs.length}
  48684. Currently selected value is located at the index of each column:
  48685. {#each allIndexs as index}
  48686. <span class="mr-2 text-primary dark:text-dark">{index}</span>
  48687. {/each}
  48688. {:else}
  48689. <div>Please select data</div>
  48690. {/if}
  48691. </div>
  48692. <Cell title="Get selected data" onclick={() => (visible18 = true)} />
  48693. <Picker
  48694. bind:visible={visible18}
  48695. datas={col3Datas}
  48696. onconfirm={(items, indexs) => {
  48697. allItems = items;
  48698. allIndexs = indexs;
  48699. }}
  48700. />
  48701. <Cell title="Top corner rounded" onclick={() => (visible19 = true)} />
  48702. <Picker bind:visible={visible19} {datas} popup={{ radius: 'xl' }} />
  48703. </div>
  48704. <!-- data_en.js -->
  48705. <!--
  48706. const someProvinceList = [
  48707. { label: 'California' },
  48708. { label: 'New York' },
  48709. { label: 'Texas' },
  48710. { label: 'Florida' },
  48711. { label: 'Illinois' },
  48712. { label: 'Pennsylvania' },
  48713. { label: 'Ohio' },
  48714. { label: 'Michigan' },
  48715. { label: 'Georgia' },
  48716. { label: 'Virginia' },
  48717. { label: 'Washington' },
  48718. { label: 'Arizona' },
  48719. { label: 'Massachusetts' },
  48720. { label: 'Tennessee' },
  48721. ];
  48722. const weekList = [
  48723. { label: 'Monday' },
  48724. { label: 'Tuesday' },
  48725. { label: 'Wednesday' },
  48726. { label: 'Thursday' },
  48727. { label: 'Friday' },
  48728. { label: 'Saturday' },
  48729. { label: 'Sunday' },
  48730. ];
  48731. const amOrPmList = [{ label: 'AM' }, { label: 'PM' }];
  48732. const timeList = [
  48733. { label: '01:00' },
  48734. { label: '02:00' },
  48735. { label: '03:00' },
  48736. { label: '04:00' },
  48737. { label: '05:00' },
  48738. { label: '06:00' },
  48739. { label: '07:00' },
  48740. { label: '08:00' },
  48741. { label: '09:00' },
  48742. { label: '10:00' },
  48743. { label: '11:00' },
  48744. { label: '12:00' },
  48745. ];
  48746. const cityList = [
  48747. { cityName: 'losangeles' },
  48748. { cityName: 'sandiego' },
  48749. { cityName: 'sanfrancisco' },
  48750. { cityName: 'sacramento' },
  48751. { cityName: 'fresno' },
  48752. { cityName: 'oakland' },
  48753. { cityName: 'sanjose' },
  48754. { cityName: 'bakersfield' },
  48755. { cityName: 'anaheim' },
  48756. { cityName: 'riverside' },
  48757. { cityName: 'stockton' },
  48758. ];
  48759. const linkageData = [
  48760. {
  48761. label: 'California',
  48762. children: [
  48763. {
  48764. label: 'Los Angeles',
  48765. children: [
  48766. { label: 'Downtown' },
  48767. { label: 'Hollywood' },
  48768. { label: 'Beverly Hills' },
  48769. { label: 'Santa Monica' },
  48770. { label: 'Pasadena' },
  48771. ],
  48772. },
  48773. {
  48774. label: 'San Francisco',
  48775. children: [
  48776. { label: 'Downtown' },
  48777. { label: 'Mission District' },
  48778. { label: 'North Beach' },
  48779. { label: 'Chinatown' },
  48780. { label: 'Haight-Ashbury' },
  48781. { label: 'Castro' },
  48782. ],
  48783. },
  48784. {
  48785. label: 'San Diego',
  48786. children: [
  48787. { label: 'Downtown' },
  48788. { label: 'La Jolla' },
  48789. { label: 'Pacific Beach' },
  48790. { label: 'Mission Beach' },
  48791. { label: 'Coronado' },
  48792. ],
  48793. },
  48794. {
  48795. label: 'Sacramento',
  48796. children: [
  48797. { label: 'Downtown' },
  48798. { label: 'Midtown' },
  48799. { label: 'East Sacramento' },
  48800. { label: 'Land Park' },
  48801. { label: 'Natomas' },
  48802. { label: 'Arden-Arcade' },
  48803. ],
  48804. },
  48805. {
  48806. label: 'Oakland',
  48807. children: [{ label: 'Downtown' }, { label: 'Lake Merritt' }, { label: 'Rockridge' }],
  48808. },
  48809. {
  48810. label: 'San Jose',
  48811. children: [
  48812. { label: 'Downtown' },
  48813. { label: 'Willow Glen' },
  48814. { label: 'Almaden Valley' },
  48815. { label: 'Berryessa' },
  48816. { label: 'Evergreen' },
  48817. ],
  48818. },
  48819. {
  48820. label: 'Fresno',
  48821. children: [
  48822. { label: 'Downtown' },
  48823. { label: 'Tower District' },
  48824. { label: 'River Park' },
  48825. { label: 'Fig Garden' },
  48826. { label: 'Woodward Park' },
  48827. ],
  48828. },
  48829. {
  48830. label: 'Long Beach',
  48831. children: [
  48832. { label: 'Downtown' },
  48833. { label: 'Belmont Shore' },
  48834. { label: 'Bixby Knolls' },
  48835. { label: 'Naples' },
  48836. { label: 'Alamitos Beach' },
  48837. { label: 'Rose Park' },
  48838. ],
  48839. },
  48840. {
  48841. label: 'Bakersfield',
  48842. children: [{ label: 'Downtown' }, { label: 'Rosedale' }, { label: 'Oildale' }, { label: 'Seven Oaks' }, { label: 'Stockdale' }],
  48843. },
  48844. {
  48845. label: 'Anaheim',
  48846. children: [
  48847. { label: 'Downtown' },
  48848. { label: 'Anaheim Hills' },
  48849. { label: 'The Colony' },
  48850. { label: 'The Platinum Triangle' },
  48851. { label: 'West Anaheim' },
  48852. { label: 'East Anaheim' },
  48853. { label: 'South Anaheim' },
  48854. { label: 'Resort District' },
  48855. ],
  48856. },
  48857. ],
  48858. },
  48859. {
  48860. label: 'Texas',
  48861. children: [
  48862. {
  48863. label: 'Houston',
  48864. children: [
  48865. { label: 'Downtown' },
  48866. { label: 'Midtown' },
  48867. { label: 'Heights' },
  48868. { label: 'River Oaks' },
  48869. { label: 'Memorial' },
  48870. { label: 'Medical Center' },
  48871. ],
  48872. },
  48873. {
  48874. label: 'Dallas',
  48875. children: [
  48876. { label: 'Downtown' },
  48877. { label: 'Uptown' },
  48878. { label: 'Deep Ellum' },
  48879. { label: 'Oak Lawn' },
  48880. { label: 'Bishop Arts' },
  48881. { label: 'Knox Henderson' },
  48882. ],
  48883. },
  48884. {
  48885. label: 'Austin',
  48886. children: [{ label: 'Downtown' }, { label: 'South Congress' }, { label: 'East Austin' }],
  48887. },
  48888. {
  48889. label: 'San Antonio',
  48890. children: [
  48891. { label: 'Downtown' },
  48892. { label: 'Alamo Heights' },
  48893. { label: 'Pearl District' },
  48894. { label: 'King William' },
  48895. { label: 'Stone Oak' },
  48896. ],
  48897. },
  48898. ],
  48899. },
  48900. {
  48901. label: 'Illinois',
  48902. children: [
  48903. {
  48904. label: 'Chicago',
  48905. children: [
  48906. { label: 'Loop' },
  48907. { label: 'River North' },
  48908. { label: 'Lincoln Park' },
  48909. { label: 'Wicker Park' },
  48910. { label: 'Gold Coast' },
  48911. { label: 'Lakeview' },
  48912. ],
  48913. },
  48914. {
  48915. label: 'Springfield',
  48916. children: [
  48917. { label: 'Downtown' },
  48918. { label: 'West Side' },
  48919. { label: 'East Side' },
  48920. { label: 'North End' },
  48921. { label: 'South Side' },
  48922. { label: 'Jerome' },
  48923. ],
  48924. },
  48925. {
  48926. label: 'Rockford',
  48927. children: [
  48928. { label: 'Downtown' },
  48929. { label: 'East Side' },
  48930. { label: 'North End' },
  48931. { label: 'Rural Oaks' },
  48932. { label: 'Churchill Grove' },
  48933. { label: 'Signal Hill' },
  48934. ],
  48935. },
  48936. {
  48937. label: 'Peoria',
  48938. children: [
  48939. { label: 'Downtown' },
  48940. { label: 'West Bluff' },
  48941. { label: 'East Bluff' },
  48942. { label: 'North Valley' },
  48943. { label: 'South Side' },
  48944. ],
  48945. },
  48946. ],
  48947. },
  48948. {
  48949. label: 'New York',
  48950. children: [
  48951. {
  48952. label: 'New York City',
  48953. children: [
  48954. { label: 'Manhattan' },
  48955. { label: 'Brooklyn' },
  48956. { label: 'Queens' },
  48957. { label: 'The Bronx' },
  48958. { label: 'Staten Island' },
  48959. { label: 'Harlem' },
  48960. ],
  48961. },
  48962. ],
  48963. },
  48964. {
  48965. label: 'Washington',
  48966. children: [
  48967. {
  48968. label: 'Seattle',
  48969. children: [
  48970. { label: 'Downtown' },
  48971. { label: 'Capitol Hill' },
  48972. { label: 'Ballard' },
  48973. { label: 'Fremont' },
  48974. { label: 'Queen Anne' },
  48975. { label: 'South Lake Union' },
  48976. ],
  48977. },
  48978. {
  48979. label: 'Spokane',
  48980. children: [
  48981. { label: 'Downtown' },
  48982. { label: 'South Hill' },
  48983. { label: 'North Side' },
  48984. { label: 'West Central' },
  48985. { label: 'East Central' },
  48986. { label: 'Riverside' },
  48987. ],
  48988. },
  48989. {
  48990. label: 'Tacoma',
  48991. children: [
  48992. { label: 'Downtown' },
  48993. { label: 'North End' },
  48994. { label: 'South End' },
  48995. { label: 'East Side' },
  48996. { label: 'West End' },
  48997. { label: 'Central' },
  48998. ],
  48999. },
  49000. {
  49001. label: 'Vancouver',
  49002. children: [
  49003. { label: 'Downtown' },
  49004. { label: 'Uptown' },
  49005. { label: 'Hazel Dell' },
  49006. { label: 'Salmon Creek' },
  49007. { label: "Fisher's Landing" },
  49008. { label: 'Cascade Park' },
  49009. ],
  49010. },
  49011. {
  49012. label: 'Bellevue',
  49013. children: [
  49014. { label: 'Downtown' },
  49015. { label: 'West Bellevue' },
  49016. { label: 'Crossroads' },
  49017. { label: 'Eastgate' },
  49018. { label: 'Factoria' },
  49019. ],
  49020. },
  49021. ],
  49022. },
  49023. ];
  49024. const linkagDiffLabelKeyData = [
  49025. {
  49026. province: 'California',
  49027. children: [
  49028. {
  49029. city: 'Los Angeles',
  49030. children: [
  49031. { region: 'Downtown' },
  49032. { region: 'Hollywood' },
  49033. { region: 'Beverly Hills' },
  49034. { region: 'Santa Monica' },
  49035. { region: 'Pasadena' },
  49036. { region: 'Venice Beach' },
  49037. { region: 'Westwood' },
  49038. ],
  49039. },
  49040. {
  49041. city: 'San Francisco',
  49042. children: [
  49043. { region: 'Downtown' },
  49044. { region: 'Mission District' },
  49045. { region: 'North Beach' },
  49046. { region: 'Chinatown' },
  49047. { region: 'Haight-Ashbury' },
  49048. { region: 'Castro' },
  49049. ],
  49050. },
  49051. {
  49052. city: 'San Diego',
  49053. children: [
  49054. { region: 'Downtown' },
  49055. { region: 'La Jolla' },
  49056. { region: 'Pacific Beach' },
  49057. { region: 'Mission Beach' },
  49058. { region: 'Coronado' },
  49059. { region: 'North Park' },
  49060. ],
  49061. },
  49062. ],
  49063. },
  49064. {
  49065. province: 'Florida',
  49066. children: [
  49067. {
  49068. city: 'Miami',
  49069. children: [
  49070. { region: 'Downtown' },
  49071. { region: 'South Beach' },
  49072. { region: 'Brickell' },
  49073. { region: 'Coconut Grove' },
  49074. { region: 'Little Havana' },
  49075. { region: 'Coral Gables' },
  49076. ],
  49077. },
  49078. {
  49079. city: 'Orlando',
  49080. children: [
  49081. { region: 'Downtown' },
  49082. { region: 'Winter Park' },
  49083. { region: 'Lake Nona' },
  49084. { region: 'College Park' },
  49085. { region: 'Baldwin Park' },
  49086. { region: 'Mills 50' },
  49087. ],
  49088. },
  49089. {
  49090. city: 'Tampa',
  49091. children: [{ region: 'Downtown' }, { region: 'Hyde Park' }, { region: 'Ybor City' }, { region: 'Channelside' }],
  49092. },
  49093. ],
  49094. },
  49095. {
  49096. province: 'Illinois',
  49097. children: [
  49098. {
  49099. city: 'Chicago',
  49100. children: [
  49101. { region: 'Loop' },
  49102. { region: 'River North' },
  49103. { region: 'Lincoln Park' },
  49104. { region: 'Wicker Park' },
  49105. { region: 'Gold Coast' },
  49106. { region: 'Lakeview' },
  49107. ],
  49108. },
  49109. {
  49110. city: 'Springfield',
  49111. children: [
  49112. { region: 'Downtown' },
  49113. { region: 'West Side' },
  49114. { region: 'East Side' },
  49115. { region: 'North End' },
  49116. { region: 'South Side' },
  49117. { region: 'Jerome' },
  49118. ],
  49119. },
  49120. {
  49121. city: 'Peoria',
  49122. children: [
  49123. { region: 'Downtown' },
  49124. { region: 'West Bluff' },
  49125. { region: 'East Bluff' },
  49126. { region: 'North Valley' },
  49127. { region: 'South Side' },
  49128. ],
  49129. },
  49130. ],
  49131. },
  49132. {
  49133. province: 'New York',
  49134. children: [
  49135. {
  49136. city: 'New York City',
  49137. children: [
  49138. { region: 'Manhattan' },
  49139. { region: 'Brooklyn' },
  49140. { region: 'Queens' },
  49141. { region: 'The Bronx' },
  49142. { region: 'Staten Island' },
  49143. { region: 'Harlem' },
  49144. ],
  49145. },
  49146. ],
  49147. },
  49148. ];
  49149. const linkagCustomChildrenKeyData = [
  49150. {
  49151. label: 'California',
  49152. child: [
  49153. {
  49154. label: 'Los Angeles',
  49155. child: [
  49156. { label: 'Downtown' },
  49157. { label: 'Hollywood' },
  49158. { label: 'Beverly Hills' },
  49159. { label: 'Santa Monica' },
  49160. { label: 'Pasadena' },
  49161. { label: 'Venice Beach' },
  49162. { label: 'Westwood' },
  49163. ],
  49164. },
  49165. {
  49166. label: 'San Francisco',
  49167. child: [
  49168. { label: 'Downtown' },
  49169. { label: 'Mission District' },
  49170. { label: 'North Beach' },
  49171. { label: 'Chinatown' },
  49172. { label: 'Haight-Ashbury' },
  49173. { label: 'Castro' },
  49174. ],
  49175. },
  49176. {
  49177. label: 'San Diego',
  49178. child: [
  49179. { label: 'Downtown' },
  49180. { label: 'La Jolla' },
  49181. { label: 'Pacific Beach' },
  49182. { label: 'Mission Beach' },
  49183. { label: 'Coronado' },
  49184. { label: 'North Park' },
  49185. ],
  49186. },
  49187. ],
  49188. },
  49189. {
  49190. label: 'Florida',
  49191. child: [
  49192. {
  49193. label: 'Miami',
  49194. child: [
  49195. { label: 'Downtown' },
  49196. { label: 'South Beach' },
  49197. { label: 'Brickell' },
  49198. { label: 'Coconut Grove' },
  49199. { label: 'Little Havana' },
  49200. { label: 'Coral Gables' },
  49201. ],
  49202. },
  49203. {
  49204. label: 'Orlando',
  49205. child: [
  49206. { label: 'Downtown' },
  49207. { label: 'Winter Park' },
  49208. { label: 'Lake Nona' },
  49209. { label: 'College Park' },
  49210. { label: 'Baldwin Park' },
  49211. { label: 'Mills 50' },
  49212. ],
  49213. },
  49214. {
  49215. label: 'Tampa',
  49216. child: [{ label: 'Downtown' }, { label: 'Hyde Park' }, { label: 'Ybor City' }, { label: 'Channelside' }],
  49217. },
  49218. ],
  49219. },
  49220. {
  49221. label: 'Illinois',
  49222. child: [
  49223. {
  49224. label: 'Chicago',
  49225. child: [
  49226. { label: 'Loop' },
  49227. { label: 'River North' },
  49228. { label: 'Lincoln Park' },
  49229. { label: 'Wicker Park' },
  49230. { label: 'Gold Coast' },
  49231. { label: 'Lakeview' },
  49232. ],
  49233. },
  49234. {
  49235. label: 'Springfield',
  49236. child: [
  49237. { label: 'Downtown' },
  49238. { label: 'West Side' },
  49239. { label: 'East Side' },
  49240. { label: 'North End' },
  49241. { label: 'South Side' },
  49242. { label: 'Jerome' },
  49243. ],
  49244. },
  49245. {
  49246. label: 'Peoria',
  49247. child: [
  49248. { label: 'Downtown' },
  49249. { label: 'West Bluff' },
  49250. { label: 'East Bluff' },
  49251. { label: 'North Valley' },
  49252. { label: 'South Side' },
  49253. ],
  49254. },
  49255. ],
  49256. },
  49257. {
  49258. label: 'New York',
  49259. child: [
  49260. {
  49261. label: 'New York City',
  49262. child: [
  49263. { label: 'Manhattan' },
  49264. { label: 'Brooklyn' },
  49265. { label: 'Queens' },
  49266. { label: 'The Bronx' },
  49267. { label: 'Staten Island' },
  49268. { label: 'Harlem' },
  49269. ],
  49270. },
  49271. ],
  49272. },
  49273. {
  49274. label: 'Washington',
  49275. child: [
  49276. {
  49277. label: 'Seattle',
  49278. child: [
  49279. { label: 'Downtown' },
  49280. { label: 'Capitol Hill' },
  49281. { label: 'Ballard' },
  49282. { label: 'Fremont' },
  49283. { label: 'Queen Anne' },
  49284. { label: 'South Lake Union' },
  49285. ],
  49286. },
  49287. {
  49288. label: 'Spokane',
  49289. child: [
  49290. { label: 'Downtown' },
  49291. { label: 'South Hill' },
  49292. { label: 'North Side' },
  49293. { label: 'West Central' },
  49294. { label: 'East Central' },
  49295. { label: 'Riverside' },
  49296. ],
  49297. },
  49298. {
  49299. label: 'Tacoma',
  49300. child: [
  49301. { label: 'Downtown' },
  49302. { label: 'North End' },
  49303. { label: 'South End' },
  49304. { label: 'East Side' },
  49305. { label: 'West End' },
  49306. { label: 'Central' },
  49307. ],
  49308. },
  49309. ],
  49310. },
  49311. ];
  49312. export { someProvinceList, weekList, amOrPmList, timeList, cityList, linkageData, linkagDiffLabelKeyData, linkagCustomChildrenKeyData };
  49313. -->
  49314. ================================================
  49315. FILE: packages/stdf/src/routes/picker/en_US/data_en.js
  49316. ================================================
  49317. const someProvinceList = [
  49318. { label: 'California' },
  49319. { label: 'New York' },
  49320. { label: 'Texas' },
  49321. { label: 'Florida' },
  49322. { label: 'Illinois' },
  49323. { label: 'Pennsylvania' },
  49324. { label: 'Ohio' },
  49325. { label: 'Michigan' },
  49326. { label: 'Georgia' },
  49327. { label: 'Virginia' },
  49328. { label: 'Washington' },
  49329. { label: 'Arizona' },
  49330. { label: 'Massachusetts' },
  49331. { label: 'Tennessee' },
  49332. ];
  49333. const weekList = [
  49334. { label: 'Monday' },
  49335. { label: 'Tuesday' },
  49336. { label: 'Wednesday' },
  49337. { label: 'Thursday' },
  49338. { label: 'Friday' },
  49339. { label: 'Saturday' },
  49340. { label: 'Sunday' },
  49341. ];
  49342. const amOrPmList = [{ label: 'AM' }, { label: 'PM' }];
  49343. const timeList = [
  49344. { label: '01:00' },
  49345. { label: '02:00' },
  49346. { label: '03:00' },
  49347. { label: '04:00' },
  49348. { label: '05:00' },
  49349. { label: '06:00' },
  49350. { label: '07:00' },
  49351. { label: '08:00' },
  49352. { label: '09:00' },
  49353. { label: '10:00' },
  49354. { label: '11:00' },
  49355. { label: '12:00' },
  49356. ];
  49357. const cityList = [
  49358. { cityName: 'losangeles' },
  49359. { cityName: 'sandiego' },
  49360. { cityName: 'sanfrancisco' },
  49361. { cityName: 'sacramento' },
  49362. { cityName: 'fresno' },
  49363. { cityName: 'oakland' },
  49364. { cityName: 'sanjose' },
  49365. { cityName: 'bakersfield' },
  49366. { cityName: 'anaheim' },
  49367. { cityName: 'riverside' },
  49368. { cityName: 'stockton' },
  49369. ];
  49370. const linkageData = [
  49371. {
  49372. label: 'California',
  49373. children: [
  49374. {
  49375. label: 'Los Angeles',
  49376. children: [
  49377. { label: 'Downtown' },
  49378. { label: 'Hollywood' },
  49379. { label: 'Beverly Hills' },
  49380. { label: 'Santa Monica' },
  49381. { label: 'Pasadena' },
  49382. ],
  49383. },
  49384. {
  49385. label: 'San Francisco',
  49386. children: [
  49387. { label: 'Downtown' },
  49388. { label: 'Mission District' },
  49389. { label: 'North Beach' },
  49390. { label: 'Chinatown' },
  49391. { label: 'Haight-Ashbury' },
  49392. { label: 'Castro' },
  49393. ],
  49394. },
  49395. {
  49396. label: 'San Diego',
  49397. children: [
  49398. { label: 'Downtown' },
  49399. { label: 'La Jolla' },
  49400. { label: 'Pacific Beach' },
  49401. { label: 'Mission Beach' },
  49402. { label: 'Coronado' },
  49403. ],
  49404. },
  49405. {
  49406. label: 'Sacramento',
  49407. children: [
  49408. { label: 'Downtown' },
  49409. { label: 'Midtown' },
  49410. { label: 'East Sacramento' },
  49411. { label: 'Land Park' },
  49412. { label: 'Natomas' },
  49413. { label: 'Arden-Arcade' },
  49414. ],
  49415. },
  49416. {
  49417. label: 'Oakland',
  49418. children: [{ label: 'Downtown' }, { label: 'Lake Merritt' }, { label: 'Rockridge' }],
  49419. },
  49420. {
  49421. label: 'San Jose',
  49422. children: [
  49423. { label: 'Downtown' },
  49424. { label: 'Willow Glen' },
  49425. { label: 'Almaden Valley' },
  49426. { label: 'Berryessa' },
  49427. { label: 'Evergreen' },
  49428. ],
  49429. },
  49430. {
  49431. label: 'Fresno',
  49432. children: [
  49433. { label: 'Downtown' },
  49434. { label: 'Tower District' },
  49435. { label: 'River Park' },
  49436. { label: 'Fig Garden' },
  49437. { label: 'Woodward Park' },
  49438. ],
  49439. },
  49440. {
  49441. label: 'Long Beach',
  49442. children: [
  49443. { label: 'Downtown' },
  49444. { label: 'Belmont Shore' },
  49445. { label: 'Bixby Knolls' },
  49446. { label: 'Naples' },
  49447. { label: 'Alamitos Beach' },
  49448. { label: 'Rose Park' },
  49449. ],
  49450. },
  49451. {
  49452. label: 'Bakersfield',
  49453. children: [{ label: 'Downtown' }, { label: 'Rosedale' }, { label: 'Oildale' }, { label: 'Seven Oaks' }, { label: 'Stockdale' }],
  49454. },
  49455. {
  49456. label: 'Anaheim',
  49457. children: [
  49458. { label: 'Downtown' },
  49459. { label: 'Anaheim Hills' },
  49460. { label: 'The Colony' },
  49461. { label: 'The Platinum Triangle' },
  49462. { label: 'West Anaheim' },
  49463. { label: 'East Anaheim' },
  49464. { label: 'South Anaheim' },
  49465. { label: 'Resort District' },
  49466. ],
  49467. },
  49468. ],
  49469. },
  49470. {
  49471. label: 'Texas',
  49472. children: [
  49473. {
  49474. label: 'Houston',
  49475. children: [
  49476. { label: 'Downtown' },
  49477. { label: 'Midtown' },
  49478. { label: 'Heights' },
  49479. { label: 'River Oaks' },
  49480. { label: 'Memorial' },
  49481. { label: 'Medical Center' },
  49482. ],
  49483. },
  49484. {
  49485. label: 'Dallas',
  49486. children: [
  49487. { label: 'Downtown' },
  49488. { label: 'Uptown' },
  49489. { label: 'Deep Ellum' },
  49490. { label: 'Oak Lawn' },
  49491. { label: 'Bishop Arts' },
  49492. { label: 'Knox Henderson' },
  49493. ],
  49494. },
  49495. {
  49496. label: 'Austin',
  49497. children: [{ label: 'Downtown' }, { label: 'South Congress' }, { label: 'East Austin' }],
  49498. },
  49499. {
  49500. label: 'San Antonio',
  49501. children: [
  49502. { label: 'Downtown' },
  49503. { label: 'Alamo Heights' },
  49504. { label: 'Pearl District' },
  49505. { label: 'King William' },
  49506. { label: 'Stone Oak' },
  49507. ],
  49508. },
  49509. ],
  49510. },
  49511. {
  49512. label: 'Illinois',
  49513. children: [
  49514. {
  49515. label: 'Chicago',
  49516. children: [
  49517. { label: 'Loop' },
  49518. { label: 'River North' },
  49519. { label: 'Lincoln Park' },
  49520. { label: 'Wicker Park' },
  49521. { label: 'Gold Coast' },
  49522. { label: 'Lakeview' },
  49523. ],
  49524. },
  49525. {
  49526. label: 'Springfield',
  49527. children: [
  49528. { label: 'Downtown' },
  49529. { label: 'West Side' },
  49530. { label: 'East Side' },
  49531. { label: 'North End' },
  49532. { label: 'South Side' },
  49533. { label: 'Jerome' },
  49534. ],
  49535. },
  49536. {
  49537. label: 'Rockford',
  49538. children: [
  49539. { label: 'Downtown' },
  49540. { label: 'East Side' },
  49541. { label: 'North End' },
  49542. { label: 'Rural Oaks' },
  49543. { label: 'Churchill Grove' },
  49544. { label: 'Signal Hill' },
  49545. ],
  49546. },
  49547. {
  49548. label: 'Peoria',
  49549. children: [
  49550. { label: 'Downtown' },
  49551. { label: 'West Bluff' },
  49552. { label: 'East Bluff' },
  49553. { label: 'North Valley' },
  49554. { label: 'South Side' },
  49555. ],
  49556. },
  49557. ],
  49558. },
  49559. {
  49560. label: 'New York',
  49561. children: [
  49562. {
  49563. label: 'New York City',
  49564. children: [
  49565. { label: 'Manhattan' },
  49566. { label: 'Brooklyn' },
  49567. { label: 'Queens' },
  49568. { label: 'The Bronx' },
  49569. { label: 'Staten Island' },
  49570. { label: 'Harlem' },
  49571. ],
  49572. },
  49573. ],
  49574. },
  49575. {
  49576. label: 'Washington',
  49577. children: [
  49578. {
  49579. label: 'Seattle',
  49580. children: [
  49581. { label: 'Downtown' },
  49582. { label: 'Capitol Hill' },
  49583. { label: 'Ballard' },
  49584. { label: 'Fremont' },
  49585. { label: 'Queen Anne' },
  49586. { label: 'South Lake Union' },
  49587. ],
  49588. },
  49589. {
  49590. label: 'Spokane',
  49591. children: [
  49592. { label: 'Downtown' },
  49593. { label: 'South Hill' },
  49594. { label: 'North Side' },
  49595. { label: 'West Central' },
  49596. { label: 'East Central' },
  49597. { label: 'Riverside' },
  49598. ],
  49599. },
  49600. {
  49601. label: 'Tacoma',
  49602. children: [
  49603. { label: 'Downtown' },
  49604. { label: 'North End' },
  49605. { label: 'South End' },
  49606. { label: 'East Side' },
  49607. { label: 'West End' },
  49608. { label: 'Central' },
  49609. ],
  49610. },
  49611. {
  49612. label: 'Vancouver',
  49613. children: [
  49614. { label: 'Downtown' },
  49615. { label: 'Uptown' },
  49616. { label: 'Hazel Dell' },
  49617. { label: 'Salmon Creek' },
  49618. { label: "Fisher's Landing" },
  49619. { label: 'Cascade Park' },
  49620. ],
  49621. },
  49622. {
  49623. label: 'Bellevue',
  49624. children: [
  49625. { label: 'Downtown' },
  49626. { label: 'West Bellevue' },
  49627. { label: 'Crossroads' },
  49628. { label: 'Eastgate' },
  49629. { label: 'Factoria' },
  49630. ],
  49631. },
  49632. ],
  49633. },
  49634. ];
  49635. const linkagDiffLabelKeyData = [
  49636. {
  49637. province: 'California',
  49638. children: [
  49639. {
  49640. city: 'Los Angeles',
  49641. children: [
  49642. { region: 'Downtown' },
  49643. { region: 'Hollywood' },
  49644. { region: 'Beverly Hills' },
  49645. { region: 'Santa Monica' },
  49646. { region: 'Pasadena' },
  49647. { region: 'Venice Beach' },
  49648. { region: 'Westwood' },
  49649. ],
  49650. },
  49651. {
  49652. city: 'San Francisco',
  49653. children: [
  49654. { region: 'Downtown' },
  49655. { region: 'Mission District' },
  49656. { region: 'North Beach' },
  49657. { region: 'Chinatown' },
  49658. { region: 'Haight-Ashbury' },
  49659. { region: 'Castro' },
  49660. ],
  49661. },
  49662. {
  49663. city: 'San Diego',
  49664. children: [
  49665. { region: 'Downtown' },
  49666. { region: 'La Jolla' },
  49667. { region: 'Pacific Beach' },
  49668. { region: 'Mission Beach' },
  49669. { region: 'Coronado' },
  49670. { region: 'North Park' },
  49671. ],
  49672. },
  49673. ],
  49674. },
  49675. {
  49676. province: 'Florida',
  49677. children: [
  49678. {
  49679. city: 'Miami',
  49680. children: [
  49681. { region: 'Downtown' },
  49682. { region: 'South Beach' },
  49683. { region: 'Brickell' },
  49684. { region: 'Coconut Grove' },
  49685. { region: 'Little Havana' },
  49686. { region: 'Coral Gables' },
  49687. ],
  49688. },
  49689. {
  49690. city: 'Orlando',
  49691. children: [
  49692. { region: 'Downtown' },
  49693. { region: 'Winter Park' },
  49694. { region: 'Lake Nona' },
  49695. { region: 'College Park' },
  49696. { region: 'Baldwin Park' },
  49697. { region: 'Mills 50' },
  49698. ],
  49699. },
  49700. {
  49701. city: 'Tampa',
  49702. children: [{ region: 'Downtown' }, { region: 'Hyde Park' }, { region: 'Ybor City' }, { region: 'Channelside' }],
  49703. },
  49704. ],
  49705. },
  49706. {
  49707. province: 'Illinois',
  49708. children: [
  49709. {
  49710. city: 'Chicago',
  49711. children: [
  49712. { region: 'Loop' },
  49713. { region: 'River North' },
  49714. { region: 'Lincoln Park' },
  49715. { region: 'Wicker Park' },
  49716. { region: 'Gold Coast' },
  49717. { region: 'Lakeview' },
  49718. ],
  49719. },
  49720. {
  49721. city: 'Springfield',
  49722. children: [
  49723. { region: 'Downtown' },
  49724. { region: 'West Side' },
  49725. { region: 'East Side' },
  49726. { region: 'North End' },
  49727. { region: 'South Side' },
  49728. { region: 'Jerome' },
  49729. ],
  49730. },
  49731. {
  49732. city: 'Peoria',
  49733. children: [
  49734. { region: 'Downtown' },
  49735. { region: 'West Bluff' },
  49736. { region: 'East Bluff' },
  49737. { region: 'North Valley' },
  49738. { region: 'South Side' },
  49739. ],
  49740. },
  49741. ],
  49742. },
  49743. {
  49744. province: 'New York',
  49745. children: [
  49746. {
  49747. city: 'New York City',
  49748. children: [
  49749. { region: 'Manhattan' },
  49750. { region: 'Brooklyn' },
  49751. { region: 'Queens' },
  49752. { region: 'The Bronx' },
  49753. { region: 'Staten Island' },
  49754. { region: 'Harlem' },
  49755. ],
  49756. },
  49757. ],
  49758. },
  49759. ];
  49760. const linkagCustomChildrenKeyData = [
  49761. {
  49762. label: 'California',
  49763. child: [
  49764. {
  49765. label: 'Los Angeles',
  49766. child: [
  49767. { label: 'Downtown' },
  49768. { label: 'Hollywood' },
  49769. { label: 'Beverly Hills' },
  49770. { label: 'Santa Monica' },
  49771. { label: 'Pasadena' },
  49772. { label: 'Venice Beach' },
  49773. { label: 'Westwood' },
  49774. ],
  49775. },
  49776. {
  49777. label: 'San Francisco',
  49778. child: [
  49779. { label: 'Downtown' },
  49780. { label: 'Mission District' },
  49781. { label: 'North Beach' },
  49782. { label: 'Chinatown' },
  49783. { label: 'Haight-Ashbury' },
  49784. { label: 'Castro' },
  49785. ],
  49786. },
  49787. {
  49788. label: 'San Diego',
  49789. child: [
  49790. { label: 'Downtown' },
  49791. { label: 'La Jolla' },
  49792. { label: 'Pacific Beach' },
  49793. { label: 'Mission Beach' },
  49794. { label: 'Coronado' },
  49795. { label: 'North Park' },
  49796. ],
  49797. },
  49798. ],
  49799. },
  49800. {
  49801. label: 'Florida',
  49802. child: [
  49803. {
  49804. label: 'Miami',
  49805. child: [
  49806. { label: 'Downtown' },
  49807. { label: 'South Beach' },
  49808. { label: 'Brickell' },
  49809. { label: 'Coconut Grove' },
  49810. { label: 'Little Havana' },
  49811. { label: 'Coral Gables' },
  49812. ],
  49813. },
  49814. {
  49815. label: 'Orlando',
  49816. child: [
  49817. { label: 'Downtown' },
  49818. { label: 'Winter Park' },
  49819. { label: 'Lake Nona' },
  49820. { label: 'College Park' },
  49821. { label: 'Baldwin Park' },
  49822. { label: 'Mills 50' },
  49823. ],
  49824. },
  49825. {
  49826. label: 'Tampa',
  49827. child: [{ label: 'Downtown' }, { label: 'Hyde Park' }, { label: 'Ybor City' }, { label: 'Channelside' }],
  49828. },
  49829. ],
  49830. },
  49831. {
  49832. label: 'Illinois',
  49833. child: [
  49834. {
  49835. label: 'Chicago',
  49836. child: [
  49837. { label: 'Loop' },
  49838. { label: 'River North' },
  49839. { label: 'Lincoln Park' },
  49840. { label: 'Wicker Park' },
  49841. { label: 'Gold Coast' },
  49842. { label: 'Lakeview' },
  49843. ],
  49844. },
  49845. {
  49846. label: 'Springfield',
  49847. child: [
  49848. { label: 'Downtown' },
  49849. { label: 'West Side' },
  49850. { label: 'East Side' },
  49851. { label: 'North End' },
  49852. { label: 'South Side' },
  49853. { label: 'Jerome' },
  49854. ],
  49855. },
  49856. {
  49857. label: 'Peoria',
  49858. child: [
  49859. { label: 'Downtown' },
  49860. { label: 'West Bluff' },
  49861. { label: 'East Bluff' },
  49862. { label: 'North Valley' },
  49863. { label: 'South Side' },
  49864. ],
  49865. },
  49866. ],
  49867. },
  49868. {
  49869. label: 'New York',
  49870. child: [
  49871. {
  49872. label: 'New York City',
  49873. child: [
  49874. { label: 'Manhattan' },
  49875. { label: 'Brooklyn' },
  49876. { label: 'Queens' },
  49877. { label: 'The Bronx' },
  49878. { label: 'Staten Island' },
  49879. { label: 'Harlem' },
  49880. ],
  49881. },
  49882. ],
  49883. },
  49884. {
  49885. label: 'Washington',
  49886. child: [
  49887. {
  49888. label: 'Seattle',
  49889. child: [
  49890. { label: 'Downtown' },
  49891. { label: 'Capitol Hill' },
  49892. { label: 'Ballard' },
  49893. { label: 'Fremont' },
  49894. { label: 'Queen Anne' },
  49895. { label: 'South Lake Union' },
  49896. ],
  49897. },
  49898. {
  49899. label: 'Spokane',
  49900. child: [
  49901. { label: 'Downtown' },
  49902. { label: 'South Hill' },
  49903. { label: 'North Side' },
  49904. { label: 'West Central' },
  49905. { label: 'East Central' },
  49906. { label: 'Riverside' },
  49907. ],
  49908. },
  49909. {
  49910. label: 'Tacoma',
  49911. child: [
  49912. { label: 'Downtown' },
  49913. { label: 'North End' },
  49914. { label: 'South End' },
  49915. { label: 'East Side' },
  49916. { label: 'West End' },
  49917. { label: 'Central' },
  49918. ],
  49919. },
  49920. ],
  49921. },
  49922. ];
  49923. export { someProvinceList, weekList, amOrPmList, timeList, cityList, linkageData, linkagDiffLabelKeyData, linkagCustomChildrenKeyData };
  49924. ================================================
  49925. FILE: packages/stdf/src/routes/picker/zh_CN/+page.svelte
  49926. ================================================
  49927. <!-- Picker Demo -->
  49928. <script lang="ts">
  49929. import { Picker, Cell } from '$lib/index.js';
  49930. // 为避免 Demo 页面杂乱,具体参考数据放在 data.js 文件内,可查看此页面底部注释。
  49931. import {
  49932. someProvinceList,
  49933. weekList,
  49934. amOrPmList,
  49935. timeList,
  49936. cityList,
  49937. linkageData,
  49938. linkagDiffLabelKeyData,
  49939. linkagCustomChildrenKeyData
  49940. } from './data.js';
  49941. const datas = [{ data: someProvinceList }];
  49942. const col3Datas = [{ data: weekList }, { data: amOrPmList }, { data: timeList }];
  49943. let visible1 = $state(false);
  49944. let visible2 = $state(false);
  49945. let visible3 = $state(false);
  49946. let visible4 = $state(false);
  49947. let visible5 = $state(false);
  49948. let visible6 = $state(false);
  49949. let visible7 = $state(false);
  49950. let visible8 = $state(false);
  49951. let visible9 = $state(false);
  49952. let visible10 = $state(false);
  49953. let visible11 = $state(false);
  49954. let visible12 = $state(false);
  49955. let visible13 = $state(false);
  49956. let visible14 = $state(false);
  49957. let visible15 = $state(false);
  49958. let visible16 = $state(false);
  49959. let visible17 = $state(false);
  49960. let visible18 = $state(false);
  49961. let visible19 = $state(false);
  49962. let visible20 = $state(false);
  49963. let visible21 = $state(false);
  49964. let visible22 = $state(false);
  49965. let currentDetail = $state('请选择');
  49966. let allItems: { [key: string]: string }[] = $state([]);
  49967. let allIndexs: number[] = $state([]);
  49968. </script>
  49969. <div class="py-4">
  49970. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  49971. <Picker bind:visible={visible1} {datas} />
  49972. <Cell title="自定义标题" onclick={() => (visible2 = true)} />
  49973. <Picker bind:visible={visible2} title="请选择省份" {datas} />
  49974. <Cell title="可见 7 行" onclick={() => (visible3 = true)} />
  49975. <Picker bind:visible={visible3} datas={[{ data: someProvinceList, showRow: 7 }]} />
  49976. <Cell title="关闭自动滚动至上次选定项" onclick={() => (visible4 = true)} />
  49977. <Picker bind:visible={visible4} {datas} autoScrollToLast={false} />
  49978. <Cell title="初始选定始终为第 4 项" onclick={() => (visible5 = true)} subTitle="需要关闭自动选定上次选中项" />
  49979. <Picker bind:visible={visible5} datas={[{ data: someProvinceList, initIndex: 3 }]} autoScrollToLast={false} />
  49980. <Cell title="自动滚动时取消动画" onclick={() => (visible6 = true)} />
  49981. <Picker bind:visible={visible6} datas={[{ data: someProvinceList, useAnimation: false }]} />
  49982. <Cell title="自定义 label 的 key 值" onclick={() => (visible7 = true)} />
  49983. <Picker bind:visible={visible7} datas={[{ data: cityList, labelKey: 'cityName' }]} title="请选择城市" />
  49984. <Cell title="右侧展示选定项" detail={currentDetail} onclick={() => (visible8 = true)} />
  49985. <Picker bind:visible={visible8} {datas} onconfirm={(items) => (currentDetail = items[0].label)} />
  49986. <Cell title="单列左对齐" onclick={() => (visible20 = true)} />
  49987. <Picker bind:visible={visible20} datas={[{ data: someProvinceList, align: 'left' }]} />
  49988. <Cell title="多列选择器" onclick={() => (visible9 = true)} />
  49989. <Picker bind:visible={visible9} datas={col3Datas} />
  49990. <Cell title="不同列可见行数" onclick={() => (visible10 = true)} />
  49991. <Picker bind:visible={visible10} datas={[{ data: weekList }, { data: amOrPmList, showRow: 3 }, { data: timeList, showRow: 7 }]} />
  49992. <Cell title="不同列 flex 比例" onclick={() => (visible11 = true)} />
  49993. <Picker
  49994. bind:visible={visible11}
  49995. datas={[
  49996. { data: weekList, flex: 3 },
  49997. { data: amOrPmList, flex: 1 },
  49998. { data: timeList, flex: 2 }
  49999. ]}
  50000. />
  50001. <Cell title="多列不同对齐方式" onclick={() => (visible21 = true)} />
  50002. <Picker
  50003. bind:visible={visible21}
  50004. datas={[
  50005. { data: weekList, align: 'left' },
  50006. { data: amOrPmList, align: 'center' },
  50007. { data: timeList, align: 'right' }
  50008. ]}
  50009. />
  50010. <Cell title="多级联动" onclick={() => (visible12 = true)} />
  50011. <Picker bind:visible={visible12} datas={linkageData} isLinkage />
  50012. <Cell title="多级联动不同可见行数" onclick={() => (visible13 = true)} />
  50013. <Picker bind:visible={visible13} datas={linkageData} linkageShowRows={[3, 5, 7]} isLinkage />
  50014. <Cell title="多级联动不同 flex 比例" onclick={() => (visible14 = true)} />
  50015. <Picker bind:visible={visible14} datas={linkageData} linkageFlexs={[1, 2, 3]} isLinkage />
  50016. <Cell title="多级联动自定义每级 label 的 key 值" onclick={() => (visible15 = true)} />
  50017. <Picker bind:visible={visible15} datas={linkagDiffLabelKeyData} linkageLabelKeys={['province', 'city', 'region']} isLinkage />
  50018. <Cell title="多级联动自定义上下级 children 的 key 值" onclick={() => (visible16 = true)} />
  50019. <Picker bind:visible={visible16} datas={linkagCustomChildrenKeyData} linkageChildrenKey="child" isLinkage />
  50020. <Cell title="联动不同对齐方式" onclick={() => (visible22 = true)} />
  50021. <Picker bind:visible={visible22} datas={linkageData} linkageAligns={['right', 'center', 'left']} isLinkage />
  50022. <Cell title="多级联动设置每列初始选定项" onclick={() => (visible17 = true)} />
  50023. <Picker bind:visible={visible17} datas={linkageData} linkageInitIndexs={[0, 1, 8]} isLinkage />
  50024. <div class="px-4">
  50025. {#if allItems.length}
  50026. 当前选定了:
  50027. {#each allItems as item}
  50028. <span class="mr-2 text-primary dark:text-dark">{item.label}</span>
  50029. {/each}
  50030. {:else}
  50031. <div>请选定数据</div>
  50032. {/if}
  50033. </div>
  50034. <div class="px-4">
  50035. {#if allIndexs.length}
  50036. 当前选定值位于所在列的索引值分别为:
  50037. {#each allIndexs as index}
  50038. <span class="mr-2 text-primary dark:text-dark">{index}</span>
  50039. {/each}
  50040. {:else}
  50041. <div>请选定数据</div>
  50042. {/if}
  50043. </div>
  50044. <Cell title="获取选定数据" onclick={() => (visible18 = true)} />
  50045. <Picker
  50046. bind:visible={visible18}
  50047. datas={col3Datas}
  50048. onconfirm={(items, indexs) => {
  50049. allItems = items;
  50050. allIndexs = indexs;
  50051. }}
  50052. />
  50053. <Cell title="顶部来点圆角" onclick={() => (visible19 = true)} />
  50054. <Picker bind:visible={visible19} {datas} popup={{ radius: 'xl' }} />
  50055. </div>
  50056. <!-- data.js -->
  50057. <!--
  50058. const someProvinceList = [
  50059. { label: '云南' },
  50060. { label: '北京' },
  50061. { label: '广东' },
  50062. { label: '重庆' },
  50063. { label: '四川' },
  50064. { label: '湖北' },
  50065. { label: '河南' },
  50066. { label: '湖南' },
  50067. { label: '山东' },
  50068. { label: '江苏' },
  50069. { label: '浙江' },
  50070. { label: '江西' },
  50071. { label: '安徽' },
  50072. { label: '福建' },
  50073. ];
  50074. const weekList = [
  50075. { label: '星期一' },
  50076. { label: '星期二' },
  50077. { label: '星期三' },
  50078. { label: '星期四' },
  50079. { label: '星期五' },
  50080. { label: '星期六' },
  50081. { label: '星期日' },
  50082. ];
  50083. const amOrPmList = [{ label: '上午' }, { label: '下午' }];
  50084. const timeList = [
  50085. { label: '01:00' },
  50086. { label: '02:00' },
  50087. { label: '03:00' },
  50088. { label: '04:00' },
  50089. { label: '05:00' },
  50090. { label: '06:00' },
  50091. { label: '07:00' },
  50092. { label: '08:00' },
  50093. { label: '09:00' },
  50094. { label: '10:00' },
  50095. { label: '11:00' },
  50096. { label: '12:00' },
  50097. ];
  50098. const cityList = [
  50099. { cityName: '昆明' },
  50100. { cityName: '曲靖' },
  50101. { cityName: '玉溪' },
  50102. { cityName: '保山' },
  50103. { cityName: '昭通' },
  50104. { cityName: '丽江' },
  50105. { cityName: '普洱' },
  50106. { cityName: '临沧' },
  50107. { cityName: '楚雄' },
  50108. { cityName: '红河' },
  50109. { cityName: '文山' },
  50110. ];
  50111. const linkageData = [
  50112. {
  50113. label: '云南',
  50114. children: [
  50115. {
  50116. label: '昆明',
  50117. children: [
  50118. { label: '盘龙区' },
  50119. { label: '五华区' },
  50120. { label: '官渡区' },
  50121. { label: '西山区' },
  50122. { label: '东川区' },
  50123. { label: '呈贡区' },
  50124. { label: '晋宁区' },
  50125. { label: '富民县' },
  50126. { label: '宜良县' },
  50127. { label: '石林彝族自治县' },
  50128. { label: '嵩明县' },
  50129. { label: '禄劝彝族苗族自治县' },
  50130. { label: '寻甸回族彝族自治县' },
  50131. { label: '安宁市' },
  50132. ],
  50133. },
  50134. {
  50135. label: '曲靖',
  50136. children: [
  50137. { label: '麒麟区' },
  50138. { label: '沾益区' },
  50139. { label: '马龙县' },
  50140. { label: '陆良县' },
  50141. { label: '师宗县' },
  50142. { label: '罗平县' },
  50143. { label: '富源县' },
  50144. { label: '会泽县' },
  50145. { label: '宣威市' },
  50146. ],
  50147. },
  50148. {
  50149. label: '玉溪',
  50150. children: [
  50151. { label: '红塔区' },
  50152. { label: '江川区' },
  50153. { label: '澄江县' },
  50154. { label: '通海县' },
  50155. { label: '华宁县' },
  50156. { label: '易门县' },
  50157. { label: '峨山彝族自治县' },
  50158. { label: '新平彝族傣族自治县' },
  50159. { label: '元江哈尼族彝族傣族自治县' },
  50160. ],
  50161. },
  50162. {
  50163. label: '保山',
  50164. children: [
  50165. { label: '隆阳区' },
  50166. { label: '施甸县' },
  50167. { label: '龙陵县' },
  50168. { label: '昌宁县' },
  50169. { label: '腾冲市' },
  50170. { label: '龙陵县' },
  50171. ],
  50172. },
  50173. {
  50174. label: '丽江',
  50175. children: [
  50176. { label: '古城区' },
  50177. { label: '永胜县' },
  50178. { label: '华坪县' },
  50179. { label: '玉龙纳西族自治县' },
  50180. { label: '宁蒗彝族自治县' },
  50181. ],
  50182. },
  50183. {
  50184. label: '普洱',
  50185. children: [
  50186. { label: '思茅区' },
  50187. { label: '宁洱哈尼族彝族自治县' },
  50188. { label: '墨江哈尼族自治县' },
  50189. { label: '景东彝族自治县' },
  50190. { label: '景谷傣族彝族自治县' },
  50191. { label: '镇沅彝族哈尼族拉祜族自治县' },
  50192. { label: '江城哈尼族彝族自治县' },
  50193. { label: '孟连傣族拉祜族佤族自治县' },
  50194. { label: '澜沧拉祜族自治县' },
  50195. { label: '西盟佤族自治县' },
  50196. ],
  50197. },
  50198. {
  50199. label: '临沧',
  50200. children: [
  50201. { label: '临翔区' },
  50202. { label: '凤庆县' },
  50203. { label: '云县' },
  50204. { label: '永德县' },
  50205. { label: '镇康县' },
  50206. { label: '双江拉祜族佤族布朗族傣族自治县' },
  50207. { label: '耿马傣族佤族自治县' },
  50208. { label: '沧源佤族自治县' },
  50209. ],
  50210. },
  50211. {
  50212. label: '楚雄',
  50213. children: [
  50214. { label: '楚雄市' },
  50215. { label: '双柏县' },
  50216. { label: '牟定县' },
  50217. { label: '南华县' },
  50218. { label: '姚安县' },
  50219. { label: '大姚县' },
  50220. { label: '永仁县' },
  50221. { label: '元谋县' },
  50222. { label: '武定县' },
  50223. { label: '禄丰县' },
  50224. ],
  50225. },
  50226. {
  50227. label: '红河',
  50228. children: [
  50229. { label: '个旧市' },
  50230. { label: '开远市' },
  50231. { label: '蒙自市' },
  50232. { label: '弥勒市' },
  50233. { label: '屏边苗族自治县' },
  50234. { label: '建水县' },
  50235. { label: '石屏县' },
  50236. { label: '泸西县' },
  50237. { label: '元阳县' },
  50238. { label: '红河县' },
  50239. { label: '金平苗族瑶族傣族自治县' },
  50240. { label: '绿春县' },
  50241. { label: '河口瑶族自治县' },
  50242. ],
  50243. },
  50244. {
  50245. label: '文山',
  50246. children: [
  50247. { label: '文山市' },
  50248. { label: '砚山县' },
  50249. { label: '西畴县' },
  50250. { label: '麻栗坡县' },
  50251. { label: '马关县' },
  50252. { label: '丘北县' },
  50253. { label: '广南县' },
  50254. { label: '富宁县' },
  50255. ],
  50256. },
  50257. ],
  50258. },
  50259. {
  50260. label: '广东',
  50261. children: [
  50262. {
  50263. label: '广州',
  50264. children: [
  50265. { label: '天河区' },
  50266. { label: '海珠区' },
  50267. { label: '荔湾区' },
  50268. { label: '越秀区' },
  50269. { label: '白云区' },
  50270. { label: '黄埔区' },
  50271. ],
  50272. },
  50273. {
  50274. label: '深圳',
  50275. children: [
  50276. { label: '罗湖区' },
  50277. { label: '福田区' },
  50278. { label: '南山区' },
  50279. { label: '宝安区' },
  50280. { label: '龙岗区' },
  50281. { label: '盐田区' },
  50282. ],
  50283. },
  50284. {
  50285. label: '珠海',
  50286. children: [{ label: '香洲区' }, { label: '斗门区' }, { label: '金湾区' }],
  50287. },
  50288. {
  50289. label: '汕头',
  50290. children: [
  50291. { label: '龙湖区' },
  50292. { label: '金平区' },
  50293. { label: '濠江区' },
  50294. { label: '潮阳区' },
  50295. { label: '潮南区' },
  50296. { label: '澄海区' },
  50297. ],
  50298. },
  50299. {
  50300. label: '佛山',
  50301. children: [{ label: '禅城区' }, { label: '南海区' }, { label: '顺德区' }, { label: '三水区' }, { label: '高明区' }],
  50302. },
  50303. ],
  50304. },
  50305. {
  50306. label: '四川',
  50307. children: [
  50308. {
  50309. label: '成都',
  50310. children: [
  50311. { label: '锦江区' },
  50312. { label: '青羊区' },
  50313. { label: '金牛区' },
  50314. { label: '武侯区' },
  50315. { label: '成华区' },
  50316. { label: '龙泉驿区' },
  50317. ],
  50318. },
  50319. {
  50320. label: '绵阳',
  50321. children: [
  50322. { label: '涪城区' },
  50323. { label: '游仙区' },
  50324. { label: '安州区' },
  50325. { label: '三台县' },
  50326. { label: '盐亭县' },
  50327. { label: '梓潼县' },
  50328. ],
  50329. },
  50330. {
  50331. label: '自贡',
  50332. children: [
  50333. { label: '自流井区' },
  50334. { label: '贡井区' },
  50335. { label: '大安区' },
  50336. { label: '沿滩区' },
  50337. { label: '荣县' },
  50338. { label: '富顺县' },
  50339. ],
  50340. },
  50341. {
  50342. label: '攀枝花',
  50343. children: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  50344. },
  50345. ],
  50346. },
  50347. {
  50348. label: '北京',
  50349. children: [
  50350. {
  50351. label: '北京市',
  50352. children: [
  50353. { label: '东城区' },
  50354. { label: '西城区' },
  50355. { label: '朝阳区' },
  50356. { label: '丰台区' },
  50357. { label: '石景山区' },
  50358. { label: '海淀区' },
  50359. ],
  50360. },
  50361. ],
  50362. },
  50363. {
  50364. label: '浙江',
  50365. children: [
  50366. {
  50367. label: '杭州',
  50368. children: [
  50369. { label: '上城区' },
  50370. { label: '下城区' },
  50371. { label: '江干区' },
  50372. { label: '拱墅区' },
  50373. { label: '西湖区' },
  50374. { label: '滨江区' },
  50375. ],
  50376. },
  50377. {
  50378. label: '宁波',
  50379. children: [
  50380. { label: '海曙区' },
  50381. { label: '江东区' },
  50382. { label: '江北区' },
  50383. { label: '北仑区' },
  50384. { label: '镇海区' },
  50385. { label: '鄞州区' },
  50386. ],
  50387. },
  50388. {
  50389. label: '温州',
  50390. children: [
  50391. { label: '鹿城区' },
  50392. { label: '龙湾区' },
  50393. { label: '瓯海区' },
  50394. { label: '洞头区' },
  50395. { label: '永嘉县' },
  50396. { label: '平阳县' },
  50397. ],
  50398. },
  50399. {
  50400. label: '嘉兴',
  50401. children: [
  50402. { label: '南湖区' },
  50403. { label: '秀洲区' },
  50404. { label: '嘉善县' },
  50405. { label: '海盐县' },
  50406. { label: '海宁市' },
  50407. { label: '平湖市' },
  50408. ],
  50409. },
  50410. {
  50411. label: '湖州',
  50412. children: [{ label: '吴兴区' }, { label: '南浔区' }, { label: '德清县' }, { label: '长兴县' }, { label: '安吉县' }],
  50413. },
  50414. ],
  50415. },
  50416. ];
  50417. const linkagDiffLabelKeyData = [
  50418. {
  50419. province: '云南',
  50420. children: [
  50421. {
  50422. city: '昆明',
  50423. children: [
  50424. { region: '盘龙区' },
  50425. { region: '五华区' },
  50426. { region: '官渡区' },
  50427. { region: '西山区' },
  50428. { region: '东川区' },
  50429. { region: '呈贡区' },
  50430. { region: '晋宁区' },
  50431. ],
  50432. },
  50433. {
  50434. city: '曲靖',
  50435. children: [
  50436. { region: '麒麟区' },
  50437. { region: '沾益区' },
  50438. { region: '马龙县' },
  50439. { region: '陆良县' },
  50440. { region: '师宗县' },
  50441. { region: '罗平县' },
  50442. ],
  50443. },
  50444. {
  50445. city: '玉溪',
  50446. children: [
  50447. { region: '红塔区' },
  50448. { region: '江川区' },
  50449. { region: '澄江县' },
  50450. { region: '通海县' },
  50451. { region: '华宁县' },
  50452. { region: '易门县' },
  50453. ],
  50454. },
  50455. ],
  50456. },
  50457. {
  50458. province: '贵州',
  50459. children: [
  50460. {
  50461. city: '贵阳',
  50462. children: [
  50463. { region: '南明区' },
  50464. { region: '云岩区' },
  50465. { region: '花溪区' },
  50466. { region: '乌当区' },
  50467. { region: '白云区' },
  50468. { region: '观山湖区' },
  50469. ],
  50470. },
  50471. {
  50472. city: '遵义',
  50473. children: [
  50474. { region: '红花岗区' },
  50475. { region: '汇川区' },
  50476. { region: '播州区' },
  50477. { region: '桐梓县' },
  50478. { region: '绥阳县' },
  50479. { region: '正安县' },
  50480. ],
  50481. },
  50482. {
  50483. city: '六盘水',
  50484. children: [{ region: '钟山区' }, { region: '六枝特区' }, { region: '水城县' }, { region: '盘县' }],
  50485. },
  50486. ],
  50487. },
  50488. {
  50489. province: '四川',
  50490. children: [
  50491. {
  50492. city: '成都',
  50493. children: [
  50494. { region: '锦江区' },
  50495. { region: '青羊区' },
  50496. { region: '金牛区' },
  50497. { region: '武侯区' },
  50498. { region: '成华区' },
  50499. { region: '龙泉驿区' },
  50500. ],
  50501. },
  50502. {
  50503. city: '绵阳',
  50504. children: [
  50505. { region: '涪城区' },
  50506. { region: '游仙区' },
  50507. { region: '安州区' },
  50508. { region: '三台县' },
  50509. { region: '盐亭县' },
  50510. { region: '梓潼县' },
  50511. ],
  50512. },
  50513. {
  50514. city: '攀枝花',
  50515. children: [{ region: '东区' }, { region: '西区' }, { region: '仁和区' }, { region: '米易县' }, { region: '盐边县' }],
  50516. },
  50517. ],
  50518. },
  50519. {
  50520. province: '北京',
  50521. children: [
  50522. {
  50523. city: '北京',
  50524. children: [
  50525. { region: '东城区' },
  50526. { region: '西城区' },
  50527. { region: '朝阳区' },
  50528. { region: '丰台区' },
  50529. { region: '石景山区' },
  50530. { region: '海淀区' },
  50531. ],
  50532. },
  50533. ],
  50534. },
  50535. ];
  50536. const linkagCustomChildrenKeyData = [
  50537. {
  50538. label: '云南',
  50539. child: [
  50540. {
  50541. label: '昆明',
  50542. child: [
  50543. { label: '盘龙区' },
  50544. { label: '五华区' },
  50545. { label: '官渡区' },
  50546. { label: '西山区' },
  50547. { label: '东川区' },
  50548. { label: '呈贡区' },
  50549. { label: '晋宁区' },
  50550. ],
  50551. },
  50552. {
  50553. label: '曲靖',
  50554. child: [
  50555. { label: '麒麟区' },
  50556. { label: '沾益区' },
  50557. { label: '马龙县' },
  50558. { label: '陆良县' },
  50559. { label: '师宗县' },
  50560. { label: '罗平县' },
  50561. ],
  50562. },
  50563. {
  50564. label: '玉溪',
  50565. child: [
  50566. { label: '红塔区' },
  50567. { label: '江川区' },
  50568. { label: '澄江县' },
  50569. { label: '通海县' },
  50570. { label: '华宁县' },
  50571. { label: '易门县' },
  50572. ],
  50573. },
  50574. ],
  50575. },
  50576. {
  50577. label: '贵州',
  50578. child: [
  50579. {
  50580. label: '贵阳',
  50581. child: [
  50582. { label: '南明区' },
  50583. { label: '云岩区' },
  50584. { label: '花溪区' },
  50585. { label: '乌当区' },
  50586. { label: '白云区' },
  50587. { label: '观山湖区' },
  50588. ],
  50589. },
  50590. {
  50591. label: '遵义',
  50592. child: [
  50593. { label: '红花岗区' },
  50594. { label: '汇川区' },
  50595. { label: '播州区' },
  50596. { label: '桐梓县' },
  50597. { label: '绥阳县' },
  50598. { label: '正安县' },
  50599. ],
  50600. },
  50601. {
  50602. label: '六盘水',
  50603. child: [{ label: '钟山区' }, { label: '六枝特区' }, { label: '水城县' }, { label: '盘县' }],
  50604. },
  50605. ],
  50606. },
  50607. {
  50608. label: '四川',
  50609. child: [
  50610. {
  50611. label: '成都',
  50612. child: [
  50613. { label: '锦江区' },
  50614. { label: '青羊区' },
  50615. { label: '金牛区' },
  50616. { label: '武侯区' },
  50617. { label: '成华区' },
  50618. { label: '龙泉驿区' },
  50619. ],
  50620. },
  50621. {
  50622. label: '绵阳',
  50623. child: [
  50624. { label: '涪城区' },
  50625. { label: '游仙区' },
  50626. { label: '安州区' },
  50627. { label: '三台县' },
  50628. { label: '盐亭县' },
  50629. { label: '梓潼县' },
  50630. ],
  50631. },
  50632. {
  50633. label: '攀枝花',
  50634. child: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  50635. },
  50636. ],
  50637. },
  50638. {
  50639. label: '北京',
  50640. child: [
  50641. {
  50642. label: '北京',
  50643. child: [
  50644. { label: '东城区' },
  50645. { label: '西城区' },
  50646. { label: '朝阳区' },
  50647. { label: '丰台区' },
  50648. { label: '石景山区' },
  50649. { label: '海淀区' },
  50650. ],
  50651. },
  50652. ],
  50653. },
  50654. {
  50655. label: '浙江',
  50656. child: [
  50657. {
  50658. label: '杭州',
  50659. child: [
  50660. { label: '西湖区' },
  50661. { label: '上城区' },
  50662. { label: '下城区' },
  50663. { label: '江干区' },
  50664. { label: '拱墅区' },
  50665. { label: '滨江区' },
  50666. ],
  50667. },
  50668. {
  50669. label: '宁波',
  50670. child: [
  50671. { label: '海曙区' },
  50672. { label: '江东区' },
  50673. { label: '江北区' },
  50674. { label: '北仑区' },
  50675. { label: '镇海区' },
  50676. { label: '鄞州区' },
  50677. ],
  50678. },
  50679. {
  50680. label: '温州',
  50681. child: [
  50682. { label: '鹿城区' },
  50683. { label: '龙湾区' },
  50684. { label: '瓯海区' },
  50685. { label: '洞头区' },
  50686. { label: '永嘉县' },
  50687. { label: '平阳县' },
  50688. ],
  50689. },
  50690. ],
  50691. },
  50692. ];
  50693. export { someProvinceList, weekList, amOrPmList, timeList, cityList, linkageData, linkagDiffLabelKeyData, linkagCustomChildrenKeyData };
  50694. -->
  50695. ================================================
  50696. FILE: packages/stdf/src/routes/picker/zh_CN/data.js
  50697. ================================================
  50698. const someProvinceList = [
  50699. { label: '云南' },
  50700. { label: '北京' },
  50701. { label: '广东' },
  50702. { label: '重庆' },
  50703. { label: '四川' },
  50704. { label: '湖北' },
  50705. { label: '河南' },
  50706. { label: '湖南' },
  50707. { label: '山东' },
  50708. { label: '江苏' },
  50709. { label: '浙江' },
  50710. { label: '江西' },
  50711. { label: '安徽' },
  50712. { label: '福建' },
  50713. ];
  50714. const weekList = [
  50715. { label: '星期一' },
  50716. { label: '星期二' },
  50717. { label: '星期三' },
  50718. { label: '星期四' },
  50719. { label: '星期五' },
  50720. { label: '星期六' },
  50721. { label: '星期日' },
  50722. ];
  50723. const amOrPmList = [{ label: '上午' }, { label: '下午' }];
  50724. const timeList = [
  50725. { label: '01:00' },
  50726. { label: '02:00' },
  50727. { label: '03:00' },
  50728. { label: '04:00' },
  50729. { label: '05:00' },
  50730. { label: '06:00' },
  50731. { label: '07:00' },
  50732. { label: '08:00' },
  50733. { label: '09:00' },
  50734. { label: '10:00' },
  50735. { label: '11:00' },
  50736. { label: '12:00' },
  50737. ];
  50738. const cityList = [
  50739. { cityName: '昆明' },
  50740. { cityName: '曲靖' },
  50741. { cityName: '玉溪' },
  50742. { cityName: '保山' },
  50743. { cityName: '昭通' },
  50744. { cityName: '丽江' },
  50745. { cityName: '普洱' },
  50746. { cityName: '临沧' },
  50747. { cityName: '楚雄' },
  50748. { cityName: '红河' },
  50749. { cityName: '文山' },
  50750. ];
  50751. const linkageData = [
  50752. {
  50753. label: '云南',
  50754. children: [
  50755. {
  50756. label: '昆明',
  50757. children: [
  50758. { label: '盘龙区' },
  50759. { label: '五华区' },
  50760. { label: '官渡区' },
  50761. { label: '西山区' },
  50762. { label: '东川区' },
  50763. { label: '呈贡区' },
  50764. { label: '晋宁区' },
  50765. { label: '富民县' },
  50766. { label: '宜良县' },
  50767. { label: '石林彝族自治县' },
  50768. { label: '嵩明县' },
  50769. { label: '禄劝彝族苗族自治县' },
  50770. { label: '寻甸回族彝族自治县' },
  50771. { label: '安宁市' },
  50772. ],
  50773. },
  50774. {
  50775. label: '曲靖',
  50776. children: [
  50777. { label: '麒麟区' },
  50778. { label: '沾益区' },
  50779. { label: '马龙县' },
  50780. { label: '陆良县' },
  50781. { label: '师宗县' },
  50782. { label: '罗平县' },
  50783. { label: '富源县' },
  50784. { label: '会泽县' },
  50785. { label: '宣威市' },
  50786. ],
  50787. },
  50788. {
  50789. label: '玉溪',
  50790. children: [
  50791. { label: '红塔区' },
  50792. { label: '江川区' },
  50793. { label: '澄江县' },
  50794. { label: '通海县' },
  50795. { label: '华宁县' },
  50796. { label: '易门县' },
  50797. { label: '峨山彝族自治县' },
  50798. { label: '新平彝族傣族自治县' },
  50799. { label: '元江哈尼族彝族傣族自治县' },
  50800. ],
  50801. },
  50802. {
  50803. label: '保山',
  50804. children: [
  50805. { label: '隆阳区' },
  50806. { label: '施甸县' },
  50807. { label: '龙陵县' },
  50808. { label: '昌宁县' },
  50809. { label: '腾冲市' },
  50810. { label: '龙陵县' },
  50811. ],
  50812. },
  50813. {
  50814. label: '丽江',
  50815. children: [
  50816. { label: '古城区' },
  50817. { label: '永胜县' },
  50818. { label: '华坪县' },
  50819. { label: '玉龙纳西族自治县' },
  50820. { label: '宁蒗彝族自治县' },
  50821. ],
  50822. },
  50823. {
  50824. label: '普洱',
  50825. children: [
  50826. { label: '思茅区' },
  50827. { label: '宁洱哈尼族彝族自治县' },
  50828. { label: '墨江哈尼族自治县' },
  50829. { label: '景东彝族自治县' },
  50830. { label: '景谷傣族彝族自治县' },
  50831. { label: '镇沅彝族哈尼族拉祜族自治县' },
  50832. { label: '江城哈尼族彝族自治县' },
  50833. { label: '孟连傣族拉祜族佤族自治县' },
  50834. { label: '澜沧拉祜族自治县' },
  50835. { label: '西盟佤族自治县' },
  50836. ],
  50837. },
  50838. {
  50839. label: '临沧',
  50840. children: [
  50841. { label: '临翔区' },
  50842. { label: '凤庆县' },
  50843. { label: '云县' },
  50844. { label: '永德县' },
  50845. { label: '镇康县' },
  50846. { label: '双江拉祜族佤族布朗族傣族自治县' },
  50847. { label: '耿马傣族佤族自治县' },
  50848. { label: '沧源佤族自治县' },
  50849. ],
  50850. },
  50851. {
  50852. label: '楚雄',
  50853. children: [
  50854. { label: '楚雄市' },
  50855. { label: '双柏县' },
  50856. { label: '牟定县' },
  50857. { label: '南华县' },
  50858. { label: '姚安县' },
  50859. { label: '大姚县' },
  50860. { label: '永仁县' },
  50861. { label: '元谋县' },
  50862. { label: '武定县' },
  50863. { label: '禄丰县' },
  50864. ],
  50865. },
  50866. {
  50867. label: '红河',
  50868. children: [
  50869. { label: '个旧市' },
  50870. { label: '开远市' },
  50871. { label: '蒙自市' },
  50872. { label: '弥勒市' },
  50873. { label: '屏边苗族自治县' },
  50874. { label: '建水县' },
  50875. { label: '石屏县' },
  50876. { label: '泸西县' },
  50877. { label: '元阳县' },
  50878. { label: '红河县' },
  50879. { label: '金平苗族瑶族傣族自治县' },
  50880. { label: '绿春县' },
  50881. { label: '河口瑶族自治县' },
  50882. ],
  50883. },
  50884. {
  50885. label: '文山',
  50886. children: [
  50887. { label: '文山市' },
  50888. { label: '砚山县' },
  50889. { label: '西畴县' },
  50890. { label: '麻栗坡县' },
  50891. { label: '马关县' },
  50892. { label: '丘北县' },
  50893. { label: '广南县' },
  50894. { label: '富宁县' },
  50895. ],
  50896. },
  50897. ],
  50898. },
  50899. {
  50900. label: '广东',
  50901. children: [
  50902. {
  50903. label: '广州',
  50904. children: [
  50905. { label: '天河区' },
  50906. { label: '海珠区' },
  50907. { label: '荔湾区' },
  50908. { label: '越秀区' },
  50909. { label: '白云区' },
  50910. { label: '黄埔区' },
  50911. ],
  50912. },
  50913. {
  50914. label: '深圳',
  50915. children: [
  50916. { label: '罗湖区' },
  50917. { label: '福田区' },
  50918. { label: '南山区' },
  50919. { label: '宝安区' },
  50920. { label: '龙岗区' },
  50921. { label: '盐田区' },
  50922. ],
  50923. },
  50924. {
  50925. label: '珠海',
  50926. children: [{ label: '香洲区' }, { label: '斗门区' }, { label: '金湾区' }],
  50927. },
  50928. {
  50929. label: '汕头',
  50930. children: [
  50931. { label: '龙湖区' },
  50932. { label: '金平区' },
  50933. { label: '濠江区' },
  50934. { label: '潮阳区' },
  50935. { label: '潮南区' },
  50936. { label: '澄海区' },
  50937. ],
  50938. },
  50939. {
  50940. label: '佛山',
  50941. children: [{ label: '禅城区' }, { label: '南海区' }, { label: '顺德区' }, { label: '三水区' }, { label: '高明区' }],
  50942. },
  50943. ],
  50944. },
  50945. {
  50946. label: '四川',
  50947. children: [
  50948. {
  50949. label: '成都',
  50950. children: [
  50951. { label: '锦江区' },
  50952. { label: '青羊区' },
  50953. { label: '金牛区' },
  50954. { label: '武侯区' },
  50955. { label: '成华区' },
  50956. { label: '龙泉驿区' },
  50957. ],
  50958. },
  50959. {
  50960. label: '绵阳',
  50961. children: [
  50962. { label: '涪城区' },
  50963. { label: '游仙区' },
  50964. { label: '安州区' },
  50965. { label: '三台县' },
  50966. { label: '盐亭县' },
  50967. { label: '梓潼县' },
  50968. ],
  50969. },
  50970. {
  50971. label: '自贡',
  50972. children: [
  50973. { label: '自流井区' },
  50974. { label: '贡井区' },
  50975. { label: '大安区' },
  50976. { label: '沿滩区' },
  50977. { label: '荣县' },
  50978. { label: '富顺县' },
  50979. ],
  50980. },
  50981. {
  50982. label: '攀枝花',
  50983. children: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  50984. },
  50985. ],
  50986. },
  50987. {
  50988. label: '北京',
  50989. children: [
  50990. {
  50991. label: '北京市',
  50992. children: [
  50993. { label: '东城区' },
  50994. { label: '西城区' },
  50995. { label: '朝阳区' },
  50996. { label: '丰台区' },
  50997. { label: '石景山区' },
  50998. { label: '海淀区' },
  50999. ],
  51000. },
  51001. ],
  51002. },
  51003. {
  51004. label: '浙江',
  51005. children: [
  51006. {
  51007. label: '杭州',
  51008. children: [
  51009. { label: '上城区' },
  51010. { label: '下城区' },
  51011. { label: '江干区' },
  51012. { label: '拱墅区' },
  51013. { label: '西湖区' },
  51014. { label: '滨江区' },
  51015. ],
  51016. },
  51017. {
  51018. label: '宁波',
  51019. children: [
  51020. { label: '海曙区' },
  51021. { label: '江东区' },
  51022. { label: '江北区' },
  51023. { label: '北仑区' },
  51024. { label: '镇海区' },
  51025. { label: '鄞州区' },
  51026. ],
  51027. },
  51028. {
  51029. label: '温州',
  51030. children: [
  51031. { label: '鹿城区' },
  51032. { label: '龙湾区' },
  51033. { label: '瓯海区' },
  51034. { label: '洞头区' },
  51035. { label: '永嘉县' },
  51036. { label: '平阳县' },
  51037. ],
  51038. },
  51039. {
  51040. label: '嘉兴',
  51041. children: [
  51042. { label: '南湖区' },
  51043. { label: '秀洲区' },
  51044. { label: '嘉善县' },
  51045. { label: '海盐县' },
  51046. { label: '海宁市' },
  51047. { label: '平湖市' },
  51048. ],
  51049. },
  51050. {
  51051. label: '湖州',
  51052. children: [{ label: '吴兴区' }, { label: '南浔区' }, { label: '德清县' }, { label: '长兴县' }, { label: '安吉县' }],
  51053. },
  51054. ],
  51055. },
  51056. ];
  51057. const linkagDiffLabelKeyData = [
  51058. {
  51059. province: '云南',
  51060. children: [
  51061. {
  51062. city: '昆明',
  51063. children: [
  51064. { region: '盘龙区' },
  51065. { region: '五华区' },
  51066. { region: '官渡区' },
  51067. { region: '西山区' },
  51068. { region: '东川区' },
  51069. { region: '呈贡区' },
  51070. { region: '晋宁区' },
  51071. ],
  51072. },
  51073. {
  51074. city: '曲靖',
  51075. children: [
  51076. { region: '麒麟区' },
  51077. { region: '沾益区' },
  51078. { region: '马龙县' },
  51079. { region: '陆良县' },
  51080. { region: '师宗县' },
  51081. { region: '罗平县' },
  51082. ],
  51083. },
  51084. {
  51085. city: '玉溪',
  51086. children: [
  51087. { region: '红塔区' },
  51088. { region: '江川区' },
  51089. { region: '澄江县' },
  51090. { region: '通海县' },
  51091. { region: '华宁县' },
  51092. { region: '易门县' },
  51093. ],
  51094. },
  51095. ],
  51096. },
  51097. {
  51098. province: '贵州',
  51099. children: [
  51100. {
  51101. city: '贵阳',
  51102. children: [
  51103. { region: '南明区' },
  51104. { region: '云岩区' },
  51105. { region: '花溪区' },
  51106. { region: '乌当区' },
  51107. { region: '白云区' },
  51108. { region: '观山湖区' },
  51109. ],
  51110. },
  51111. {
  51112. city: '遵义',
  51113. children: [
  51114. { region: '红花岗区' },
  51115. { region: '汇川区' },
  51116. { region: '播州区' },
  51117. { region: '桐梓县' },
  51118. { region: '绥阳县' },
  51119. { region: '正安县' },
  51120. ],
  51121. },
  51122. {
  51123. city: '六盘水',
  51124. children: [{ region: '钟山区' }, { region: '六枝特区' }, { region: '水城县' }, { region: '盘县' }],
  51125. },
  51126. ],
  51127. },
  51128. {
  51129. province: '四川',
  51130. children: [
  51131. {
  51132. city: '成都',
  51133. children: [
  51134. { region: '锦江区' },
  51135. { region: '青羊区' },
  51136. { region: '金牛区' },
  51137. { region: '武侯区' },
  51138. { region: '成华区' },
  51139. { region: '龙泉驿区' },
  51140. ],
  51141. },
  51142. {
  51143. city: '绵阳',
  51144. children: [
  51145. { region: '涪城区' },
  51146. { region: '游仙区' },
  51147. { region: '安州区' },
  51148. { region: '三台县' },
  51149. { region: '盐亭县' },
  51150. { region: '梓潼县' },
  51151. ],
  51152. },
  51153. {
  51154. city: '攀枝花',
  51155. children: [{ region: '东区' }, { region: '西区' }, { region: '仁和区' }, { region: '米易县' }, { region: '盐边县' }],
  51156. },
  51157. ],
  51158. },
  51159. {
  51160. province: '北京',
  51161. children: [
  51162. {
  51163. city: '北京',
  51164. children: [
  51165. { region: '东城区' },
  51166. { region: '西城区' },
  51167. { region: '朝阳区' },
  51168. { region: '丰台区' },
  51169. { region: '石景山区' },
  51170. { region: '海淀区' },
  51171. ],
  51172. },
  51173. ],
  51174. },
  51175. ];
  51176. const linkagCustomChildrenKeyData = [
  51177. {
  51178. label: '云南',
  51179. child: [
  51180. {
  51181. label: '昆明',
  51182. child: [
  51183. { label: '盘龙区' },
  51184. { label: '五华区' },
  51185. { label: '官渡区' },
  51186. { label: '西山区' },
  51187. { label: '东川区' },
  51188. { label: '呈贡区' },
  51189. { label: '晋宁区' },
  51190. ],
  51191. },
  51192. {
  51193. label: '曲靖',
  51194. child: [
  51195. { label: '麒麟区' },
  51196. { label: '沾益区' },
  51197. { label: '马龙县' },
  51198. { label: '陆良县' },
  51199. { label: '师宗县' },
  51200. { label: '罗平县' },
  51201. ],
  51202. },
  51203. {
  51204. label: '玉溪',
  51205. child: [
  51206. { label: '红塔区' },
  51207. { label: '江川区' },
  51208. { label: '澄江县' },
  51209. { label: '通海县' },
  51210. { label: '华宁县' },
  51211. { label: '易门县' },
  51212. ],
  51213. },
  51214. ],
  51215. },
  51216. {
  51217. label: '贵州',
  51218. child: [
  51219. {
  51220. label: '贵阳',
  51221. child: [
  51222. { label: '南明区' },
  51223. { label: '云岩区' },
  51224. { label: '花溪区' },
  51225. { label: '乌当区' },
  51226. { label: '白云区' },
  51227. { label: '观山湖区' },
  51228. ],
  51229. },
  51230. {
  51231. label: '遵义',
  51232. child: [
  51233. { label: '红花岗区' },
  51234. { label: '汇川区' },
  51235. { label: '播州区' },
  51236. { label: '桐梓县' },
  51237. { label: '绥阳县' },
  51238. { label: '正安县' },
  51239. ],
  51240. },
  51241. {
  51242. label: '六盘水',
  51243. child: [{ label: '钟山区' }, { label: '六枝特区' }, { label: '水城县' }, { label: '盘县' }],
  51244. },
  51245. ],
  51246. },
  51247. {
  51248. label: '四川',
  51249. child: [
  51250. {
  51251. label: '成都',
  51252. child: [
  51253. { label: '锦江区' },
  51254. { label: '青羊区' },
  51255. { label: '金牛区' },
  51256. { label: '武侯区' },
  51257. { label: '成华区' },
  51258. { label: '龙泉驿区' },
  51259. ],
  51260. },
  51261. {
  51262. label: '绵阳',
  51263. child: [
  51264. { label: '涪城区' },
  51265. { label: '游仙区' },
  51266. { label: '安州区' },
  51267. { label: '三台县' },
  51268. { label: '盐亭县' },
  51269. { label: '梓潼县' },
  51270. ],
  51271. },
  51272. {
  51273. label: '攀枝花',
  51274. child: [{ label: '东区' }, { label: '西区' }, { label: '仁和区' }, { label: '米易县' }, { label: '盐边县' }],
  51275. },
  51276. ],
  51277. },
  51278. {
  51279. label: '北京',
  51280. child: [
  51281. {
  51282. label: '北京',
  51283. child: [
  51284. { label: '东城区' },
  51285. { label: '西城区' },
  51286. { label: '朝阳区' },
  51287. { label: '丰台区' },
  51288. { label: '石景山区' },
  51289. { label: '海淀区' },
  51290. ],
  51291. },
  51292. ],
  51293. },
  51294. {
  51295. label: '浙江',
  51296. child: [
  51297. {
  51298. label: '杭州',
  51299. child: [
  51300. { label: '西湖区' },
  51301. { label: '上城区' },
  51302. { label: '下城区' },
  51303. { label: '江干区' },
  51304. { label: '拱墅区' },
  51305. { label: '滨江区' },
  51306. ],
  51307. },
  51308. {
  51309. label: '宁波',
  51310. child: [
  51311. { label: '海曙区' },
  51312. { label: '江东区' },
  51313. { label: '江北区' },
  51314. { label: '北仑区' },
  51315. { label: '镇海区' },
  51316. { label: '鄞州区' },
  51317. ],
  51318. },
  51319. {
  51320. label: '温州',
  51321. child: [
  51322. { label: '鹿城区' },
  51323. { label: '龙湾区' },
  51324. { label: '瓯海区' },
  51325. { label: '洞头区' },
  51326. { label: '永嘉县' },
  51327. { label: '平阳县' },
  51328. ],
  51329. },
  51330. ],
  51331. },
  51332. ];
  51333. export { someProvinceList, weekList, amOrPmList, timeList, cityList, linkageData, linkagDiffLabelKeyData, linkagCustomChildrenKeyData };
  51334. ================================================
  51335. FILE: packages/stdf/src/routes/placeholder/en_US/+page.svelte
  51336. ================================================
  51337. <!-- Placeholder Demo -->
  51338. <script lang="ts">
  51339. import { Placeholder, Grids, Grid } from '$lib/index.js';
  51340. </script>
  51341. <div class="m-4 text-lg font-bold">Basic usage</div>
  51342. <Placeholder>Basic usage</Placeholder>
  51343. <div class="m-4 text-lg font-bold">Set height</div>
  51344. <Placeholder height="32">High for 32</Placeholder>
  51345. <div class="m-4 text-lg font-bold">Different fillet</div>
  51346. <div class="flex flex-col space-y-4">
  51347. <Placeholder radius="none">unfillet</Placeholder>
  51348. <Placeholder radius="xl">XL Rounded corner</Placeholder>
  51349. <Placeholder radius="full">Full fillet</Placeholder>
  51350. </div>
  51351. <div class="m-4 text-lg font-bold">shaded</div>
  51352. <Placeholder shadow="md">shadow</Placeholder>
  51353. <div class="m-4 text-lg font-bold">customize injClass</div>
  51354. <Placeholder height="24" injClass="!bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white">Gradient background</Placeholder>
  51355. <div class="m-4 text-lg font-bold">Combined with Grids</div>
  51356. <Grids>
  51357. <Grid row="3" col="2"><Placeholder>3﹡2</Placeholder></Grid>
  51358. <Grid col="3"><Placeholder>1﹡3</Placeholder></Grid>
  51359. <Grid row="3"><Placeholder>3﹡1</Placeholder></Grid>
  51360. <Grid row="2" col="2"><Placeholder>2﹡2</Placeholder></Grid>
  51361. <Grid><Placeholder>1﹡1</Placeholder></Grid>
  51362. <Grid><Placeholder>1﹡1</Placeholder></Grid>
  51363. </Grids>
  51364. <div class="pb-4"></div>
  51365. ================================================
  51366. FILE: packages/stdf/src/routes/placeholder/zh_CN/+page.svelte
  51367. ================================================
  51368. <!-- Placeholder Demo -->
  51369. <script lang="ts">
  51370. import { Placeholder, Grids, Grid } from '$lib/index.js';
  51371. </script>
  51372. <div class="m-4 text-lg font-bold">基础用法</div>
  51373. <Placeholder>基础用法</Placeholder>
  51374. <div class="m-4 text-lg font-bold">设置高度</div>
  51375. <Placeholder height="32">高为 32</Placeholder>
  51376. <div class="m-4 text-lg font-bold">不同圆角</div>
  51377. <div class="flex flex-col space-y-4">
  51378. <Placeholder radius="none">无圆角</Placeholder>
  51379. <Placeholder radius="xl">XL 圆角</Placeholder>
  51380. <Placeholder radius="full">全圆角</Placeholder>
  51381. </div>
  51382. <div class="m-4 text-lg font-bold">有阴影</div>
  51383. <Placeholder shadow="md">阴影</Placeholder>
  51384. <div class="m-4 text-lg font-bold">自定义 injClass</div>
  51385. <Placeholder height="24" injClass="!bg-gradient-to-r from-[#CE9FFC] to-[#7367F0] !text-white">渐变背景</Placeholder>
  51386. <div class="m-4 text-lg font-bold">与 Grids 结合</div>
  51387. <Grids>
  51388. <Grid row="3" col="2"><Placeholder>3﹡2</Placeholder></Grid>
  51389. <Grid col="3"><Placeholder>1﹡3</Placeholder></Grid>
  51390. <Grid row="3"><Placeholder>3﹡1</Placeholder></Grid>
  51391. <Grid row="2" col="2"><Placeholder>2﹡2</Placeholder></Grid>
  51392. <Grid><Placeholder>1﹡1</Placeholder></Grid>
  51393. <Grid><Placeholder>1﹡1</Placeholder></Grid>
  51394. </Grids>
  51395. <div class="pb-4"></div>
  51396. ================================================
  51397. FILE: packages/stdf/src/routes/popup/en_US/+page.svelte
  51398. ================================================
  51399. <!-- Popup Demo -->
  51400. <script lang="ts">
  51401. import { Cell, Popup, Button, Icon } from '$lib/index.js';
  51402. import Aphorism from '../../components/Aphorism.svelte';
  51403. let visible1 = $state(false);
  51404. let visible2 = $state(false);
  51405. let visible3 = $state(false);
  51406. let visible4 = $state(false);
  51407. let visible5 = $state(false);
  51408. let visible6 = $state(false);
  51409. let visible7 = $state(false);
  51410. let visible8 = $state(false);
  51411. let visible9 = $state(false);
  51412. let visible10 = $state(false);
  51413. let visible11 = $state(false);
  51414. let visible12 = $state(false);
  51415. let visible13 = $state(false);
  51416. let visible14 = $state(false);
  51417. let visible15 = $state(false);
  51418. let visible16 = $state(false);
  51419. let visible17 = $state(false);
  51420. let visible18 = $state(false);
  51421. let visible19 = $state(false);
  51422. let visible20 = $state(false);
  51423. let visible21 = $state(false);
  51424. </script>
  51425. <div class="py-4">
  51426. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  51427. <Popup bind:visible={visible1} />
  51428. <Cell title="Top position" onclick={() => (visible2 = true)} />
  51429. <Popup bind:visible={visible2} position="top" />
  51430. <Cell title="Left position" onclick={() => (visible3 = true)} />
  51431. <Popup bind:visible={visible3} position="left" />
  51432. <Cell title="Right side position" onclick={() => (visible4 = true)} />
  51433. <Popup bind:visible={visible4} position="right" />
  51434. <Cell title="Intermediate position" onclick={() => (visible5 = true)} />
  51435. <Popup bind:visible={visible5} position="center" />
  51436. <Cell title="Rounded corners at the top" onclick={() => (visible6 = true)} />
  51437. <Popup bind:visible={visible6} radius="xl" />
  51438. <Cell title="Have rounded corners and spacing" onclick={() => (visible7 = true)} />
  51439. <Popup bind:visible={visible7} radiusPosition="all" radius="3xl" px="4" py="4" />
  51440. <Cell title="The center is spaced and rounded" onclick={() => (visible10 = true)} />
  51441. <Popup bind:visible={visible10} position="center" radiusPosition="all" radius="xl" px="8" />
  51442. <Cell title="Set animation easing to appear" detail="rebound" onclick={() => (visible11 = true)} />
  51443. <Popup bind:visible={visible11} position="center" radiusPosition="all" radius="xl" px="8" easeType="backOut" />
  51444. <Cell title="Let's replace it with a slow animation" detail="bounce" onclick={() => (visible16 = true)} />
  51445. <Popup bind:visible={visible16} easeType="bounceOut" />
  51446. <Cell title="Different size" onclick={() => (visible8 = true)} />
  51447. <Popup bind:visible={visible8} size={80} />
  51448. <Cell title="The left side has different sizes" onclick={() => (visible9 = true)} />
  51449. <Popup bind:visible={visible9} size={80} position="left" />
  51450. <Cell title="The mask is completely transparent and fuzzy" onclick={() => (visible12 = true)} />
  51451. <Popup bind:visible={visible12} position="center" radiusPosition="all" radius="xl" px="8" mask={{ opacity: '0', backdropBlur: 'sm' }} />
  51452. <Cell title="Clicking the mask does not close" onclick={() => (visible13 = true)} />
  51453. <Popup bind:visible={visible13} maskClosable={false}>
  51454. <div class="flex h-full flex-col justify-center">
  51455. <Button onclick={() => (visible13 = false)}>Shut down</Button>
  51456. </div>
  51457. </Popup>
  51458. <Cell title="Size automatic" detail="Depends on internal elements" onclick={() => (visible14 = true)} />
  51459. <Popup bind:visible={visible14} size={0} radiusPosition="all" radius="3xl" px="4" py="4" transitionDistance={353}>
  51460. <div class="w-full text-center">
  51461. <div class="py-6 text-xl font-bold">AirPods Pro connected</div>
  51462. <div class="m-auto w-1/2">
  51463. <img class="w-full object-cover" src="/assets/images/airpods-pro2.png" alt="" />
  51464. </div>
  51465. <div class="text-primary dark:text-dark flex justify-around py-6">
  51466. <div>set</div>
  51467. <div>music</div>
  51468. </div>
  51469. </div>
  51470. </Popup>
  51471. <Cell title="The left position is automatically sized" onclick={() => (visible20 = true)} />
  51472. <Popup bind:visible={visible20} size={0} position="left" py="48" radiusPosition="right" radius="2xl" transitionDistance={80}>
  51473. <div class="text-primary dark:text-dark flex h-full flex-col justify-around">
  51474. <button class="p-6" onclick={() => (visible20 = false)}>Home</button>
  51475. <button class="p-6" onclick={() => (visible20 = false)}>Setting</button>
  51476. <button class="p-6" onclick={() => (visible20 = false)}>About</button>
  51477. </div>
  51478. </Popup>
  51479. <Cell title="Size automatic background transparent" onclick={() => (visible17 = true)} />
  51480. <Popup bind:visible={visible17} position="top" size={0} px="4" py="8" transparent transitionDistance={136}>
  51481. <div class="flex w-full justify-between rounded-full bg-black p-3 text-white">
  51482. <div class="flex">
  51483. <div class="h-12 w-12 overflow-hidden rounded-full">
  51484. <img class="w-full object-cover" src="/assets/images/avatar_1.jpg" alt="" />
  51485. </div>
  51486. <div class="flex flex-col justify-end pl-4">
  51487. <div class="text-xs text-white/40">Mobile phone</div>
  51488. <div>Hu Ge</div>
  51489. </div>
  51490. </div>
  51491. <div class="flex space-x-3">
  51492. <div class="flex h-12 w-12 flex-col items-center justify-center rounded-full bg-[#ff3b30]" style="transform: rotate(135deg);">
  51493. <Icon name="ri-phone-fill" />
  51494. </div>
  51495. <div class="flex h-12 w-12 flex-col items-center justify-center rounded-full bg-[#4cd964]">
  51496. <Icon name="ri-phone-fill" />
  51497. </div>
  51498. </div>
  51499. </div>
  51500. </Popup>
  51501. <Cell title="The center position has a transparent background" onclick={() => (visible18 = true)} />
  51502. <Popup bind:visible={visible18} size={0} position="center" transparent>
  51503. <div class="flex flex-col justify-center">
  51504. <div class="m-auto w-1/2">
  51505. <img class="w-full object-cover" src="/assets/images/airpods-pro2.png" alt="" />
  51506. </div>
  51507. </div>
  51508. </Popup>
  51509. <Cell title="Reverse color mask" onclick={() => (visible15 = true)} />
  51510. <Popup bind:visible={visible15} mask={{ inverse: true }} />
  51511. <Cell title="Overflow roll" onclick={() => (visible19 = true)} />
  51512. <Popup bind:visible={visible19} size={30} position="center">
  51513. <Aphorism num={4} />
  51514. </Popup>
  51515. <Cell title="allow body roll" onclick={() => (visible21 = true)} />
  51516. <Popup bind:visible={visible21} allowBodyScroll />
  51517. </div>
  51518. <!-- Aphorism.svelte -->
  51519. <!--
  51520. <script lang="ts">
  51521. // 引入数据
  51522. // import data
  51523. import aphorisms from '../../data/aphorisms';
  51524. /**
  51525. * @typedef {Object} Props
  51526. * @property {number} [num] - number of items to display
  51527. * @property {boolean} [compact] - whether to use compact mode
  51528. */
  51529. /** @type {Props} */
  51530. let { num = 0, compact = false } = $props();
  51531. // 从 aphorisms 随机取出 num 条数据
  51532. // get num items from aphorisms randomly
  51533. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  51534. </script>
  51535. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  51536. {#each aphorismsList as item}
  51537. <div class:py-6={num > 1}>
  51538. <div class="text-sm text-justify">{item.text}</div>
  51539. <div class="text-right mt-1" class:italic={item.fromItalic}>{item.from}</div>
  51540. </div>
  51541. {/each}
  51542. </div>
  51543. -->
  51544. ================================================
  51545. FILE: packages/stdf/src/routes/popup/zh_CN/+page.svelte
  51546. ================================================
  51547. <!-- Popup Demo -->
  51548. <script lang="ts">
  51549. import { Cell, Popup, Button, Icon } from '$lib/index.js';
  51550. import Aphorism from '../../components/Aphorism.svelte';
  51551. let visible1 = $state(false);
  51552. let visible2 = $state(false);
  51553. let visible3 = $state(false);
  51554. let visible4 = $state(false);
  51555. let visible5 = $state(false);
  51556. let visible6 = $state(false);
  51557. let visible7 = $state(false);
  51558. let visible8 = $state(false);
  51559. let visible9 = $state(false);
  51560. let visible10 = $state(false);
  51561. let visible11 = $state(false);
  51562. let visible12 = $state(false);
  51563. let visible13 = $state(false);
  51564. let visible14 = $state(false);
  51565. let visible15 = $state(false);
  51566. let visible16 = $state(false);
  51567. let visible17 = $state(false);
  51568. let visible18 = $state(false);
  51569. let visible19 = $state(false);
  51570. let visible20 = $state(false);
  51571. let visible21 = $state(false);
  51572. </script>
  51573. <div class="py-4">
  51574. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  51575. <Popup bind:visible={visible1} />
  51576. <Cell title="顶部位置" onclick={() => (visible2 = true)} />
  51577. <Popup bind:visible={visible2} position="top" />
  51578. <Cell title="左侧位置" onclick={() => (visible3 = true)} />
  51579. <Popup bind:visible={visible3} position="left" />
  51580. <Cell title="右侧位置" onclick={() => (visible4 = true)} />
  51581. <Popup bind:visible={visible4} position="right" />
  51582. <Cell title="中间位置" onclick={() => (visible5 = true)} />
  51583. <Popup bind:visible={visible5} position="center" />
  51584. <Cell title="顶部位置有圆角" onclick={() => (visible6 = true)} />
  51585. <Popup bind:visible={visible6} radius="xl" />
  51586. <Cell title="有圆角和间距" onclick={() => (visible7 = true)} />
  51587. <Popup bind:visible={visible7} radiusPosition="all" radius="3xl" px="4" py="4" />
  51588. <Cell title="中间位置有间距和圆角" onclick={() => (visible10 = true)} />
  51589. <Popup bind:visible={visible10} position="center" radiusPosition="all" radius="xl" px="8" />
  51590. <Cell title="设置出现动画缓动" detail="回弹" onclick={() => (visible11 = true)} />
  51591. <Popup bind:visible={visible11} position="center" radiusPosition="all" radius="xl" px="8" easeType="backOut" />
  51592. <Cell title="换一个出现动画缓动" detail="弹跳" onclick={() => (visible16 = true)} />
  51593. <Popup bind:visible={visible16} easeType="bounceOut" />
  51594. <Cell title="不同大小" onclick={() => (visible8 = true)} />
  51595. <Popup bind:visible={visible8} size={80} />
  51596. <Cell title="左侧位置不同大小" onclick={() => (visible9 = true)} />
  51597. <Popup bind:visible={visible9} size={80} position="left" />
  51598. <Cell title="遮罩完全透明且模糊" onclick={() => (visible12 = true)} />
  51599. <Popup bind:visible={visible12} position="center" radiusPosition="all" radius="xl" px="8" mask={{ opacity: '0', backdropBlur: 'sm' }} />
  51600. <Cell title="点击遮罩不会关闭" onclick={() => (visible13 = true)} />
  51601. <Popup bind:visible={visible13} maskClosable={false}>
  51602. <div class="flex h-full flex-col justify-center">
  51603. <Button onclick={() => (visible13 = false)}>关闭</Button>
  51604. </div>
  51605. </Popup>
  51606. <Cell title="大小自动" detail="取决于内部元素" onclick={() => (visible14 = true)} />
  51607. <Popup bind:visible={visible14} size={0} radiusPosition="all" radius="3xl" px="4" py="4" transitionDistance={353}>
  51608. <div class="w-full text-center">
  51609. <div class="py-6 text-xl font-bold">AirPods Pro 已连接</div>
  51610. <div class="m-auto w-1/2">
  51611. <img class="w-full object-cover" src="/assets/images/airpods-pro2.png" alt="" />
  51612. </div>
  51613. <div class="text-primary dark:text-dark flex justify-around py-6">
  51614. <div>设置</div>
  51615. <div>音乐</div>
  51616. </div>
  51617. </div>
  51618. </Popup>
  51619. <Cell title="左侧位置自动大小" onclick={() => (visible20 = true)} />
  51620. <Popup bind:visible={visible20} size={0} position="left" py="48" radiusPosition="right" radius="2xl" transitionDistance={80}>
  51621. <div class="text-primary dark:text-dark flex h-full flex-col justify-around">
  51622. <button class="p-6" onclick={() => (visible20 = false)}>首页</button>
  51623. <button class="p-6" onclick={() => (visible20 = false)}>设置</button>
  51624. <button class="p-6" onclick={() => (visible20 = false)}>关于</button>
  51625. </div>
  51626. </Popup>
  51627. <Cell title="大小自动背景透明" onclick={() => (visible17 = true)} />
  51628. <Popup bind:visible={visible17} position="top" size={0} px="4" py="8" transparent transitionDistance={136}>
  51629. <div class="flex w-full justify-between rounded-full bg-black p-3 text-white">
  51630. <div class="flex">
  51631. <div class="h-12 w-12 overflow-hidden rounded-full">
  51632. <img class="w-full object-cover" src="/assets/images/avatar_1.jpg" alt="" />
  51633. </div>
  51634. <div class="flex flex-col justify-end pl-4">
  51635. <div class="text-xs text-white/40">手机</div>
  51636. <div>胡歌</div>
  51637. </div>
  51638. </div>
  51639. <div class="flex space-x-3">
  51640. <div class="flex h-12 w-12 flex-col items-center justify-center rounded-full bg-[#ff3b30]" style="transform: rotate(135deg);">
  51641. <Icon name="ri-phone-fill" />
  51642. </div>
  51643. <div class="flex h-12 w-12 flex-col items-center justify-center rounded-full bg-[#4cd964]">
  51644. <Icon name="ri-phone-fill" />
  51645. </div>
  51646. </div>
  51647. </div>
  51648. </Popup>
  51649. <Cell title="居中位置背景透明" onclick={() => (visible18 = true)} />
  51650. <Popup bind:visible={visible18} size={0} position="center" transparent>
  51651. <div class="flex flex-col justify-center">
  51652. <div class="m-auto w-1/2">
  51653. <img class="w-full object-cover" src="/assets/images/airpods-pro2.png" alt="" />
  51654. </div>
  51655. </div>
  51656. </Popup>
  51657. <Cell title="反色遮罩" onclick={() => (visible15 = true)} />
  51658. <Popup bind:visible={visible15} mask={{ inverse: true }} />
  51659. <Cell title="溢出滚动" onclick={() => (visible19 = true)} />
  51660. <Popup bind:visible={visible19} size={30} position="center">
  51661. <Aphorism num={4} />
  51662. </Popup>
  51663. <Cell title="允许 body 滚动" onclick={() => (visible21 = true)} />
  51664. <Popup bind:visible={visible21} allowBodyScroll />
  51665. </div>
  51666. <!-- Aphorism.svelte -->
  51667. <!--
  51668. <script lang="ts">
  51669. // 引入数据
  51670. // import data
  51671. import aphorisms from '../../data/aphorisms.js';
  51672. /**
  51673. * @typedef {Object} Props
  51674. * @property {number} [num] - number of items to display
  51675. * @property {boolean} [compact] - whether to use compact mode
  51676. */
  51677. /** @type {Props} */
  51678. let { num = 0, compact = false } = $props();
  51679. // 从 aphorisms 随机取出 num 条数据
  51680. // get num items from aphorisms randomly
  51681. const aphorismsList = aphorisms.sort(() => Math.random() - 0.5).slice(0, num);
  51682. </script>
  51683. <div class="{compact ? '' : 'px-4 py-8 '}divide-y divide-black/5 dark:divide-white/5">
  51684. {#each aphorismsList as item}
  51685. <div class:py-6={num > 1}>
  51686. <div class="text-justify text-sm">{item.text}</div>
  51687. <div class="mt-1 text-right" class:italic={item.fromItalic}>{item.from}</div>
  51688. </div>
  51689. {/each}
  51690. </div>
  51691. -->
  51692. ================================================
  51693. FILE: packages/stdf/src/routes/progress/en_US/+page.svelte
  51694. ================================================
  51695. <!--Progress Demo-->
  51696. <script lang="ts">
  51697. import { Progress, Button } from '$lib/index.js';
  51698. let percent = $state(20);
  51699. const changePercentFun = (type: string) => {
  51700. if (type === '+10') {
  51701. percent = percent >= 100 ? 100 : percent + 10;
  51702. } else {
  51703. percent = percent <= 0 ? 0 : percent - 10;
  51704. }
  51705. };
  51706. </script>
  51707. <div class="px-4 pb-8">
  51708. <div class="m-4 mt-8 text-lg font-bold">Basic usage</div>
  51709. <Progress />
  51710. <div class="m-4 mt-8 text-lg font-bold">Different heights</div>
  51711. <div class="flex flex-col space-y-4">
  51712. <Progress height="1" />
  51713. <Progress height="2" />
  51714. <Progress height="3" />
  51715. <Progress height="4" />
  51716. </div>
  51717. <div class="m-4 mt-8 text-lg font-bold">Percentage different position</div>
  51718. <div class="flex flex-col space-y-4">
  51719. <Progress />
  51720. <Progress percentPosition="inner" />
  51721. <Progress percentPosition="block" />
  51722. <Progress percentPosition={null} />
  51723. </div>
  51724. <div class="m-4 mt-8 text-lg font-bold">Different styles of rounded corners</div>
  51725. <div class="flex flex-col space-y-4">
  51726. <Progress radius="none" />
  51727. <Progress radius="middle" />
  51728. <Progress radius="none" percentPosition="block" />
  51729. <Progress radius="middle" percentPosition="block" />
  51730. <Progress percentPosition="block" />
  51731. </div>
  51732. <div class="m-4 mt-8 text-lg font-bold">Ash setting</div>
  51733. <div class="flex flex-col space-y-4">
  51734. <Progress inactive />
  51735. <Progress inactive percentPosition="block" />
  51736. </div>
  51737. <div class="m-4 mt-8 text-lg font-bold">Transition effect</div>
  51738. <div class="mb-4 flex flex-col space-y-4 px-2">
  51739. <Progress {percent} />
  51740. <Progress {percent} percentPosition="inner" />
  51741. <Progress {percent} percentPosition="block" />
  51742. <Progress {percent} duration="500" />
  51743. <Progress {percent} duration="1000" />
  51744. </div>
  51745. <Button heightIn="0" group size="full">
  51746. <div class="flex w-full">
  51747. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('-10')}>
  51748. -10
  51749. </button>
  51750. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('+10')}>
  51751. +10
  51752. </button>
  51753. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>Reset</button>
  51754. </div>
  51755. </Button>
  51756. <div class="m-4 mt-8 text-lg font-bold">Custom color</div>
  51757. <div class="flex flex-col space-y-4">
  51758. <Progress injClass="bg-success dark:bg-error" />
  51759. <Progress injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  51760. <Progress percentPosition="block" injClass="bg-[#FF9F7D] dark:bg-[#9e4f5e]" />
  51761. <Progress trackInjClass="!bg-primary/20 dark:!bg-dark/20" />
  51762. </div>
  51763. <div class="m-4 mt-8 text-lg font-bold">Custom text</div>
  51764. <div class="flex flex-col space-y-4">
  51765. <Progress>
  51766. <div class="whitespace-nowrap text-xs">completed 2/3</div>
  51767. </Progress>
  51768. <Progress percentPosition="block">
  51769. <div class="whitespace-nowrap text-xs">completed 2/3</div>
  51770. </Progress>
  51771. </div>
  51772. </div>
  51773. ================================================
  51774. FILE: packages/stdf/src/routes/progress/zh_CN/+page.svelte
  51775. ================================================
  51776. <!--Progress Demo-->
  51777. <script lang="ts">
  51778. import { Progress, Button } from '$lib/index.js';
  51779. let percent = $state(20);
  51780. const changePercentFun = (type: string) => {
  51781. if (type === '+10') {
  51782. percent = percent >= 100 ? 100 : percent + 10;
  51783. } else {
  51784. percent = percent <= 0 ? 0 : percent - 10;
  51785. }
  51786. };
  51787. </script>
  51788. <div class="px-4 pb-8">
  51789. <div class="m-4 mt-8 text-lg font-bold">基础用法</div>
  51790. <Progress />
  51791. <div class="m-4 mt-8 text-lg font-bold">不同高度</div>
  51792. <div class="flex flex-col space-y-4">
  51793. <Progress height="1" />
  51794. <Progress height="2" />
  51795. <Progress height="3" />
  51796. <Progress height="4" />
  51797. </div>
  51798. <div class="m-4 mt-8 text-lg font-bold">百分比不同位置</div>
  51799. <div class="flex flex-col space-y-4">
  51800. <Progress />
  51801. <Progress percentPosition="inner" />
  51802. <Progress percentPosition="block" />
  51803. <Progress percentPosition={null} />
  51804. </div>
  51805. <div class="m-4 mt-8 text-lg font-bold">不同圆角风格</div>
  51806. <div class="flex flex-col space-y-4">
  51807. <Progress radius="none" />
  51808. <Progress radius="middle" />
  51809. <Progress radius="none" percentPosition="block" />
  51810. <Progress radius="middle" percentPosition="block" />
  51811. <Progress percentPosition="block" />
  51812. </div>
  51813. <div class="m-4 mt-8 text-lg font-bold">禁用</div>
  51814. <div class="flex flex-col space-y-4">
  51815. <Progress inactive />
  51816. <Progress inactive percentPosition="block" />
  51817. </div>
  51818. <div class="m-4 mt-8 text-lg font-bold">过渡效果</div>
  51819. <div class="mb-4 flex flex-col space-y-4 px-2">
  51820. <Progress {percent} />
  51821. <Progress {percent} percentPosition="inner" />
  51822. <Progress {percent} percentPosition="block" />
  51823. <Progress {percent} duration="500" />
  51824. <Progress {percent} duration="1000" />
  51825. </div>
  51826. <Button heightIn="0" group size="full">
  51827. <div class="flex w-full">
  51828. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('-10')}>
  51829. -10
  51830. </button>
  51831. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('+10')}>
  51832. +10
  51833. </button>
  51834. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>重置</button>
  51835. </div>
  51836. </Button>
  51837. <div class="m-4 mt-8 text-lg font-bold">自定义颜色</div>
  51838. <div class="flex flex-col space-y-4">
  51839. <Progress injClass="bg-success dark:bg-error" />
  51840. <Progress injClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  51841. <Progress percentPosition="block" injClass="bg-[#FF9F7D] dark:bg-[#9e4f5e]" />
  51842. <Progress trackInjClass="!bg-primary/20 dark:!bg-dark/20" />
  51843. </div>
  51844. <div class="m-4 mt-8 text-lg font-bold">自定义文字</div>
  51845. <div class="flex flex-col space-y-4">
  51846. <Progress>
  51847. <div class="whitespace-nowrap text-xs">已完成 2/3</div>
  51848. </Progress>
  51849. <Progress percentPosition="block">
  51850. <div class="whitespace-nowrap text-xs">已完成 2/3</div>
  51851. </Progress>
  51852. </div>
  51853. </div>
  51854. ================================================
  51855. FILE: packages/stdf/src/routes/progressLoop/en_US/+page.svelte
  51856. ================================================
  51857. <!--ProgressLoop Demo-->
  51858. <script lang="ts">
  51859. import { ProgressLoop, Button } from '$lib/index.js';
  51860. let percent = $state(20);
  51861. const changePercentFun = (type: string) => {
  51862. if (type === '+10') {
  51863. percent = percent >= 100 ? 100 : percent + 10;
  51864. } else {
  51865. percent = percent <= 0 ? 0 : percent - 10;
  51866. }
  51867. };
  51868. </script>
  51869. <div class="m-4 mt-8 text-lg font-bold">Basic usage</div>
  51870. <div class="mx-4 w-1/3">
  51871. <ProgressLoop />
  51872. </div>
  51873. <div class="m-4 mt-8 text-lg font-bold">Different width</div>
  51874. <div class="mx-4 flex grow gap-4">
  51875. <div class="flex-1">
  51876. <ProgressLoop strokeWidth={0.5} />
  51877. </div>
  51878. <div class="flex-1">
  51879. <ProgressLoop strokeWidth={1} />
  51880. </div>
  51881. <div class="flex-1">
  51882. <ProgressLoop strokeWidth={6} />
  51883. </div>
  51884. </div>
  51885. <div class="m-4 mt-8 text-lg font-bold">Straight end</div>
  51886. <div class="mx-4 w-1/3">
  51887. <ProgressLoop butt />
  51888. </div>
  51889. <div class="m-4 mt-8 text-lg font-bold">Counterclockwise direction</div>
  51890. <div class="mx-4 w-1/3">
  51891. <ProgressLoop reverse />
  51892. </div>
  51893. <div class="m-4 mt-8 text-lg font-bold">Custom color</div>
  51894. <div class="m-4 flex grow gap-2">
  51895. <div class="flex-1">
  51896. <ProgressLoop injClass="stroke-success dark:stroke-error" />
  51897. </div>
  51898. <div class="flex-1">
  51899. <ProgressLoop gradient={['#CE9FFC', '#7367F0']} />
  51900. </div>
  51901. <div class="flex-1">
  51902. <ProgressLoop gradient={['#CE9FFC', '#7367F0']} reverse />
  51903. </div>
  51904. <div class="flex-1">
  51905. <ProgressLoop trackInjClass="!stroke-primary/20 dark:!stroke-dark/20" />
  51906. </div>
  51907. </div>
  51908. <div class="m-4 mt-8 text-lg font-bold">Custom text</div>
  51909. <div class="m-4 flex grow gap-2">
  51910. <div class="flex-1">
  51911. <ProgressLoop>
  51912. <div class="text-center text-xs">
  51913. <div>Completed</div>
  51914. <div class="text-primary dark:text-dark text-lg">6666</div>
  51915. <div>step</div>
  51916. </div>
  51917. </ProgressLoop>
  51918. </div>
  51919. <div class="flex-1">
  51920. <ProgressLoop>
  51921. <div class="text-center text-xs">
  51922. <div>Residual flow</div>
  51923. <div class="text-primary dark:text-dark text-lg">66</div>
  51924. <div>GB</div>
  51925. </div>
  51926. </ProgressLoop>
  51927. </div>
  51928. <div class="flex-1">
  51929. <ProgressLoop>
  51930. <div class="text-xs">complete 2/3</div>
  51931. </ProgressLoop>
  51932. </div>
  51933. </div>
  51934. <div class="m-4 mb-1 mt-8 text-lg font-bold">Transition effect</div>
  51935. <div class="mx-4 text-xs">Different end points, ring width, direction, transition time, color</div>
  51936. <div class="m-4 flex grow gap-2">
  51937. <div class="flex-1">
  51938. <ProgressLoop {percent} />
  51939. </div>
  51940. <div class="flex-1">
  51941. <ProgressLoop {percent} butt />
  51942. </div>
  51943. <div class="flex-1">
  51944. <ProgressLoop {percent} strokeWidth={4} />
  51945. </div>
  51946. <div class="flex-1">
  51947. <ProgressLoop {percent} reverse />
  51948. </div>
  51949. </div>
  51950. <div class="m-4 flex grow gap-2">
  51951. <div class="flex-1">
  51952. <ProgressLoop {percent} duration="150" />
  51953. </div>
  51954. <div class="flex-1">
  51955. <ProgressLoop {percent} duration="500" />
  51956. </div>
  51957. <div class="flex-1">
  51958. <ProgressLoop {percent} duration="1000" />
  51959. </div>
  51960. <div class="flex-1">
  51961. <ProgressLoop {percent} gradient={['#CE9FFC', '#7367F0']} />
  51962. </div>
  51963. </div>
  51964. <div class="mx-4 pb-8">
  51965. <Button heightIn="0" group size="full">
  51966. <div class="flex w-full">
  51967. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('-10')}>
  51968. -10
  51969. </button>
  51970. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('+10')}>
  51971. +10
  51972. </button>
  51973. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>Reset</button>
  51974. </div>
  51975. </Button>
  51976. </div>
  51977. ================================================
  51978. FILE: packages/stdf/src/routes/progressLoop/zh_CN/+page.svelte
  51979. ================================================
  51980. <!--ProgressLoop Demo-->
  51981. <script lang="ts">
  51982. import { ProgressLoop, Button } from '$lib/index.js';
  51983. let percent = $state(20);
  51984. const changePercentFun = (type: string) => {
  51985. if (type === '+10') {
  51986. percent = percent >= 100 ? 100 : percent + 10;
  51987. } else {
  51988. percent = percent <= 0 ? 0 : percent - 10;
  51989. }
  51990. };
  51991. </script>
  51992. <div class="m-4 mt-8 text-lg font-bold">基础用法</div>
  51993. <div class="mx-4 w-1/3">
  51994. <ProgressLoop />
  51995. </div>
  51996. <div class="m-4 mt-8 text-lg font-bold">不同宽度</div>
  51997. <div class="mx-4 flex grow gap-4">
  51998. <div class="flex-1">
  51999. <ProgressLoop strokeWidth={0.5} />
  52000. </div>
  52001. <div class="flex-1">
  52002. <ProgressLoop strokeWidth={1} />
  52003. </div>
  52004. <div class="flex-1">
  52005. <ProgressLoop strokeWidth={6} />
  52006. </div>
  52007. </div>
  52008. <div class="m-4 mt-8 text-lg font-bold">直边端点</div>
  52009. <div class="mx-4 w-1/3">
  52010. <ProgressLoop butt />
  52011. </div>
  52012. <div class="m-4 mt-8 text-lg font-bold">逆时针方向</div>
  52013. <div class="mx-4 w-1/3">
  52014. <ProgressLoop reverse />
  52015. </div>
  52016. <div class="m-4 mt-8 text-lg font-bold">自定义颜色</div>
  52017. <div class="m-4 flex grow gap-2">
  52018. <div class="flex-1">
  52019. <ProgressLoop injClass="stroke-success dark:stroke-error" />
  52020. </div>
  52021. <div class="flex-1">
  52022. <ProgressLoop gradient={['#CE9FFC', '#7367F0']} />
  52023. </div>
  52024. <div class="flex-1">
  52025. <ProgressLoop gradient={['#CE9FFC', '#7367F0']} reverse />
  52026. </div>
  52027. <div class="flex-1">
  52028. <ProgressLoop trackInjClass="!stroke-primary/20 dark:!stroke-dark/20" />
  52029. </div>
  52030. </div>
  52031. <div class="m-4 mt-8 text-lg font-bold">自定义文字</div>
  52032. <div class="m-4 flex grow gap-2">
  52033. <div class="flex-1">
  52034. <ProgressLoop>
  52035. <div class="text-center text-xs">
  52036. <div>已完成</div>
  52037. <div class="text-primary dark:text-dark text-lg">6666</div>
  52038. <div>步</div>
  52039. </div>
  52040. </ProgressLoop>
  52041. </div>
  52042. <div class="flex-1">
  52043. <ProgressLoop>
  52044. <div class="text-center text-xs">
  52045. <div>剩余流量</div>
  52046. <div class="text-primary dark:text-dark text-lg">66</div>
  52047. <div>GB</div>
  52048. </div>
  52049. </ProgressLoop>
  52050. </div>
  52051. <div class="flex-1">
  52052. <ProgressLoop>
  52053. <div class="text-xs">完成 2/3</div>
  52054. </ProgressLoop>
  52055. </div>
  52056. </div>
  52057. <div class="m-4 mb-1 mt-8 text-lg font-bold">过渡效果</div>
  52058. <div class="mx-4 text-xs">不同端点、圆环宽度、方向、过渡时间、颜色</div>
  52059. <div class="m-4 flex grow gap-2">
  52060. <div class="flex-1">
  52061. <ProgressLoop {percent} />
  52062. </div>
  52063. <div class="flex-1">
  52064. <ProgressLoop {percent} butt />
  52065. </div>
  52066. <div class="flex-1">
  52067. <ProgressLoop {percent} strokeWidth={4} />
  52068. </div>
  52069. <div class="flex-1">
  52070. <ProgressLoop {percent} reverse />
  52071. </div>
  52072. </div>
  52073. <div class="m-4 flex grow gap-2">
  52074. <div class="flex-1">
  52075. <ProgressLoop {percent} duration="150" />
  52076. </div>
  52077. <div class="flex-1">
  52078. <ProgressLoop {percent} duration="500" />
  52079. </div>
  52080. <div class="flex-1">
  52081. <ProgressLoop {percent} duration="1000" />
  52082. </div>
  52083. <div class="flex-1">
  52084. <ProgressLoop {percent} gradient={['#CE9FFC', '#7367F0']} />
  52085. </div>
  52086. </div>
  52087. <div class="mx-4 pb-8">
  52088. <Button heightIn="0" group size="full">
  52089. <div class="flex w-full">
  52090. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('-10')}>
  52091. -10
  52092. </button>
  52093. <button class="flex-1 border-r border-white py-2 active:opacity-80 dark:border-black" onclick={() => changePercentFun('+10')}>
  52094. +10
  52095. </button>
  52096. <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>重置</button>
  52097. </div>
  52098. </Button>
  52099. </div>
  52100. ================================================
  52101. FILE: packages/stdf/src/routes/radio/en_US/+page.svelte
  52102. ================================================
  52103. <!-- Radio Demo -->
  52104. <script lang="ts">
  52105. import { Radio, Divider, Button, Icon } from '$lib/index.js';
  52106. import type { RadioItemProps } from '$lib/types/index.js';
  52107. const dota: RadioItemProps[] = [
  52108. { label: 'Jugg', name: 'Juggernaut' },
  52109. { label: 'SB', name: 'Spirit Breaker' },
  52110. { label: 'KOTL', name: 'Keeper of the Light' },
  52111. { label: 'Mag', name: 'Magnus' }
  52112. ];
  52113. let value = $state(dota[0].name);
  52114. let checkedsCustom = $state('');
  52115. const dotaInlines: RadioItemProps[] = [
  52116. { label: 'Lina', name: 'Lina' },
  52117. { label: 'SB', name: 'Spirit Breaker' },
  52118. { label: 'Morph', name: 'Morphling' },
  52119. { label: 'Sniper', name: 'Sniper' },
  52120. { label: 'Sven', name: 'Sven' },
  52121. { label: 'Invoker', name: 'Invoker' },
  52122. { label: 'Tide', name: 'Tidehunter' },
  52123. { label: 'Bat', name: 'Batrider' },
  52124. { label: 'Mag', name: 'Magnus' }
  52125. ];
  52126. let checkInline = $state('Morphling');
  52127. const dotaImgs: (RadioItemProps & { imgName: string })[] = [
  52128. { label: 'Lina', name: 'Lina', imgName: '火女' },
  52129. { label: 'SB', name: 'Spirit Breaker', imgName: '小牛' },
  52130. { label: 'Morph', name: 'Morphling', imgName: '水人' },
  52131. { label: 'Sniper', name: 'Sniper', imgName: '火枪' },
  52132. { label: 'Sven', name: 'Sven', imgName: '斯温' }
  52133. ];
  52134. let imgChecked = $state('Lina');
  52135. const dotaLong: RadioItemProps[] = [
  52136. { name: 'Jugg', label: 'Juggernaut is a melee agility hero who can quickly engage in combat.' },
  52137. { name: 'SB', label: 'Barathrum, Spirit Breaker is a powerful ganking strength melee hero.' },
  52138. { name: 'KOTL', label: 'Ezalor, Keeper of the Light, is a famous support intelligence hero.' },
  52139. { name: 'Mag', label: 'Magnus? Why not ban Magnus? Why not ban Magnus?' }
  52140. ];
  52141. const dotaVoices: (RadioItemProps & { voices: string[] })[] = [
  52142. { name: 'Invoker', label: 'Invoker', voices: ['"From the first point was begat a line."'] },
  52143. { name: 'Storm', label: 'Storm', voices: ['"Hey, wake up! Get some coffee, our tower is under attack."'] },
  52144. {
  52145. name: 'Batrider',
  52146. label: 'Batrider',
  52147. voices: [
  52148. '"Oh Lina, wanna be my queen?"',
  52149. '"Oh Windrunner, no need to run from me."',
  52150. '"Crystal Maiden, you\'re like a tall glass of water."'
  52151. ]
  52152. },
  52153. { name: 'Tidehunter', label: 'Tidehunter', voices: ['"I could eat a sea cucumber."'] }
  52154. ];
  52155. let voiceChecked = $state('');
  52156. </script>
  52157. <div class="px-4">
  52158. <div class="mb-4 mt-8 text-2xl font-bold">Horizontal Layout</div>
  52159. <div class="mb-4 mt-6 text-lg font-bold">Basic Usage</div>
  52160. <Radio layout="h" data={dota} />
  52161. <Divider />
  52162. <div class="mb-4 mt-6 text-lg font-bold">Get Selected Value</div>
  52163. <Radio layout="h" data={dota} bind:value />
  52164. <div class="mt-4 text-sm">Selected: {value}</div>
  52165. <Divider />
  52166. <div class="mb-4 mt-8 text-lg font-bold">Text Position</div>
  52167. <Radio layout="h" data={dota} textPosition="l" />
  52168. <Divider />
  52169. <Radio layout="h" data={dota} textPosition="b" />
  52170. <Divider />
  52171. <Radio layout="h" data={dota} textPosition="t" />
  52172. <Divider />
  52173. <div class="mb-4 mt-8 text-lg font-bold">Custom Icon</div>
  52174. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-blank-circle-line' }} iconChecked={{ name: 'ri-radio-button-fill' }} />
  52175. <Divider />
  52176. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-circle-line' }} iconChecked={{ name: 'ri-checkbox-circle-fill' }} />
  52177. <Divider />
  52178. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-multiple-line' }} iconChecked={{ name: 'ri-checkbox-multiple-fill' }} />
  52179. <Divider />
  52180. <Radio layout="h" data={dota} icon={{ name: 'ri-check-line' }} iconChecked={{ name: 'ri-check-fill' }} />
  52181. <Divider />
  52182. <Radio layout="h" data={dota} icon={{ name: 'ri-check-double-line' }} iconChecked={{ name: 'ri-check-double-line' }} />
  52183. <Divider />
  52184. <div class="mb-4 mt-8 text-lg font-bold">Snippet as Button Component</div>
  52185. <Radio layout="h" data={dota}>
  52186. {#snippet radioChild({ item })}
  52187. <Button fill={value === item.name ? 'base' : 'lineLight'} injClass="px-2 !py-1" onclick={() => (value = item.name)}>
  52188. {item.label}
  52189. </Button>
  52190. {/snippet}
  52191. </Radio>
  52192. <Divider />
  52193. <div class="mb-4 mt-8 text-lg font-bold">Snippet as Custom Element</div>
  52194. <Radio layout="h" data={dota}>
  52195. {#snippet radioChild({ item })}
  52196. <button
  52197. class="rounded-sm border px-5 py-0.5 text-sm {checkedsCustom === item.name
  52198. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  52199. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  52200. onclick={() => (checkedsCustom = item.name)}
  52201. >
  52202. {item.label}
  52203. </button>
  52204. {/snippet}
  52205. </Radio>
  52206. <Divider />
  52207. <div class="mb-4 mt-8 text-lg font-bold">Image Options</div>
  52208. <Radio layout="h" data={dotaImgs}>
  52209. {#snippet radioChild({ item })}
  52210. <div class="flex flex-col items-center">
  52211. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52212. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52213. <div
  52214. class="mb-1 h-12 w-12 overflow-hidden rounded-sm {imgChecked === item.name ? 'ring-primary dark:ring-dark ring-2' : ''}"
  52215. onclick={() => (imgChecked = item.name)}
  52216. >
  52217. <img class="h-full w-full object-cover" src={`/assets/images/dota_${item.imgName}.png`} alt="" />
  52218. </div>
  52219. <div>
  52220. <Icon
  52221. name={imgChecked === item.name ? 'ri-arrow-up-s-fill' : 'ri-arrow-up-s-line'}
  52222. theme={imgChecked === item.name}
  52223. alpha={imgChecked === item.name ? 1 : 0.2}
  52224. />
  52225. </div>
  52226. </div>
  52227. {/snippet}
  52228. </Radio>
  52229. <div class="text-sm">
  52230. Selected <span class="text-[red]">{imgChecked}</span>
  52231. </div>
  52232. <Divider />
  52233. </div>
  52234. <div class="px-4">
  52235. <div class="mb-4 text-2xl font-bold">Inline Layout</div>
  52236. <div class="mb-4 mt-8 text-lg font-bold">Snippet Inline Layout</div>
  52237. <Radio layout="inline" data={dotaInlines}>
  52238. {#snippet radioChild({ item })}
  52239. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52240. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52241. <div
  52242. class="m-1 rounded-sm border px-2 py-0.5 text-sm {checkInline === item.name
  52243. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  52244. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  52245. onclick={() => (checkInline = item.name)}
  52246. >
  52247. {item.label}
  52248. </div>
  52249. {/snippet}
  52250. </Radio>
  52251. <div class="mt-2 text-xs">Selected: {checkInline}</div>
  52252. </div>
  52253. <Divider />
  52254. <div class="px-4 pb-8">
  52255. <div class="mb-4 text-2xl font-bold">Vertical Layout</div>
  52256. <div class="mb-4 mt-8 text-lg font-bold">Basic Usage</div>
  52257. <Radio data={dota} />
  52258. <Divider />
  52259. <div class="mb-4 mt-8 text-lg font-bold">Long Text Options</div>
  52260. <Radio data={dotaLong} />
  52261. <Divider />
  52262. <div class="mb-4 mt-8 text-lg font-bold">Text Position</div>
  52263. <Radio data={dota} textPosition="l" />
  52264. <div class="mb-4 mt-8 text-lg font-bold">Complex Options && Custom Selected Effect</div>
  52265. <Radio data={dotaVoices}>
  52266. {#snippet radioChild({ item })}
  52267. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52268. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52269. <div class="flex cursor-pointer items-center" onclick={() => (voiceChecked = item.name)}>
  52270. <div>
  52271. <Icon
  52272. name={voiceChecked === item.name ? 'ri-radio-button-line' : 'ri-checkbox-blank-circle-line'}
  52273. theme={voiceChecked === item.name}
  52274. alpha={voiceChecked === item.name ? 1 : 0.2}
  52275. />
  52276. </div>
  52277. <div class="ml-2 grow {voiceChecked === item.name ? 'text-primary dark:text-dark' : ''}">
  52278. {item.label}
  52279. {#each item.voices as string[] as voice}
  52280. <div class="text-xs">{voice}</div>
  52281. {/each}
  52282. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  52283. </div>
  52284. </div>
  52285. {/snippet}
  52286. </Radio>
  52287. </div>
  52288. ================================================
  52289. FILE: packages/stdf/src/routes/radio/zh_CN/+page.svelte
  52290. ================================================
  52291. <!-- Radio Demo -->
  52292. <script lang="ts">
  52293. import { Radio, Divider, Button, Icon } from '$lib/index.js';
  52294. import type { RadioItemProps } from '$lib/types/index.js';
  52295. const dota: RadioItemProps[] = [
  52296. { label: '主宰', name: '奶棒人' },
  52297. { label: '白牛', name: '令狐冲' },
  52298. { label: '光法', name: '光之守卫' },
  52299. { label: '猛犸', name: '马格纳斯' }
  52300. ];
  52301. let value = $state(dota[0].name);
  52302. let checkedsCustom = $state('');
  52303. const dotaInlines: RadioItemProps[] = [
  52304. { label: '火女', name: '火女' },
  52305. { label: '小牛', name: '小牛' },
  52306. { label: '水人', name: '水人' },
  52307. { label: '火枪', name: '火枪' },
  52308. { label: '斯温', name: '斯温' },
  52309. { label: '祈求者', name: '祈求者' },
  52310. { label: '潮汐', name: '潮汐' },
  52311. { label: '蝙蝠', name: '蝙蝠' },
  52312. { label: '猛犸', name: '猛犸' }
  52313. ];
  52314. let checkInline = $state('小牛');
  52315. const dotaImgs: RadioItemProps[] = [
  52316. { label: '火女', name: '火女' },
  52317. { label: '小牛', name: '小牛' },
  52318. { label: '水人', name: '水人' },
  52319. { label: '火枪', name: '火枪' },
  52320. { label: '斯温', name: '斯温' }
  52321. ];
  52322. let imgChecked = $state('火女');
  52323. const dotaLong: RadioItemProps[] = [
  52324. { name: '主宰', label: '主宰是一个近战敏捷英雄,他能够迅速切入战斗。' },
  52325. { name: '白牛', label: '巴拉森,裂魂人是一个强大的 Gank 型的力量型近战英雄。' },
  52326. { name: '光法', label: '伊扎洛,光之守卫,他是一个著名的辅助性智力英雄。' },
  52327. { name: '猛犸', label: '猛犸?为什么不 BAN 猛犸?为什么不 BAN 猛犸?' }
  52328. ];
  52329. type DotaVoices = (RadioItemProps & { voices: string[] })[];
  52330. const dotaVoices: DotaVoices = [
  52331. { name: '祈求者', label: '祈求者', voices: ['"来自于伟大的奥秘。"'] },
  52332. { name: '风暴之灵', label: '风暴之灵', voices: ['"喂~快醒醒,快喝点咖啡,我方上塔正遭受攻击。"'] },
  52333. {
  52334. name: '蝙蝠骑士',
  52335. label: '蝙蝠骑士',
  52336. voices: ['“哦,莉娜,当我的压寨夫人怎么样?”', '“哦,风行者,见着我你不用跑。”', '“水晶室女,你就像一个装满冰水的高脚杯。”']
  52337. },
  52338. { name: '潮汐猎人', label: '潮汐猎人', voices: ['“我还能吃下一根海藻。”'] }
  52339. ];
  52340. let voiceChecked = $state('');
  52341. </script>
  52342. <div class="px-4">
  52343. <div class="mb-4 mt-8 text-2xl font-bold">横向排列</div>
  52344. <div class="mb-4 mt-6 text-lg font-bold">简单用法</div>
  52345. <Radio layout="h" data={dota} />
  52346. <Divider />
  52347. <div class="mb-4 mt-6 text-lg font-bold">获取选中值</div>
  52348. <Radio layout="h" data={dota} bind:value />
  52349. <div class="mt-4 text-sm">已选:{value}</div>
  52350. <Divider />
  52351. <div class="mb-4 mt-8 text-lg font-bold">文字在不同位置</div>
  52352. <Radio layout="h" data={dota} textPosition="l" />
  52353. <Divider />
  52354. <Radio layout="h" data={dota} textPosition="b" />
  52355. <Divider />
  52356. <Radio layout="h" data={dota} textPosition="t" />
  52357. <Divider />
  52358. <div class="mb-4 mt-8 text-lg font-bold">自定义图标</div>
  52359. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-blank-circle-line' }} iconChecked={{ name: 'ri-radio-button-fill' }} />
  52360. <Divider />
  52361. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-circle-line' }} iconChecked={{ name: 'ri-checkbox-circle-fill' }} />
  52362. <Divider />
  52363. <Radio layout="h" data={dota} icon={{ name: 'ri-checkbox-multiple-line' }} iconChecked={{ name: 'ri-checkbox-multiple-fill' }} />
  52364. <Divider />
  52365. <Radio layout="h" data={dota} icon={{ name: 'ri-check-line' }} iconChecked={{ name: 'ri-check-fill' }} />
  52366. <Divider />
  52367. <Radio layout="h" data={dota} icon={{ name: 'ri-check-double-line' }} iconChecked={{ name: 'ri-check-double-line' }} />
  52368. <Divider />
  52369. <div class="mb-4 mt-8 text-lg font-bold">Snippet 为 Button 组件</div>
  52370. <Radio layout="h" data={dota}>
  52371. {#snippet radioChild({ item })}
  52372. <Button fill={value === item.name ? 'base' : 'lineLight'} injClass="px-2 !py-1" onclick={() => (value = item.name)}>
  52373. {item.label}
  52374. </Button>
  52375. {/snippet}
  52376. </Radio>
  52377. <Divider />
  52378. <div class="mb-4 mt-8 text-lg font-bold">Snippet 为自定义元素</div>
  52379. <Radio layout="h" data={dota}>
  52380. {#snippet radioChild({ item })}
  52381. <button
  52382. class="rounded-sm border px-5 py-0.5 text-sm {checkedsCustom === item.name
  52383. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  52384. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  52385. onclick={() => (checkedsCustom = item.name)}
  52386. >
  52387. {item.label}
  52388. </button>
  52389. {/snippet}
  52390. </Radio>
  52391. <Divider />
  52392. <div class="mb-4 mt-8 text-lg font-bold">图片选项</div>
  52393. <Radio layout="h" data={dotaImgs}>
  52394. {#snippet radioChild({ item })}
  52395. <div class="flex flex-col items-center">
  52396. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52397. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52398. <div
  52399. class="mb-1 h-12 w-12 overflow-hidden rounded-sm {imgChecked === item.name ? 'ring-primary dark:ring-dark ring-2' : ''}"
  52400. onclick={() => (imgChecked = item.name)}
  52401. >
  52402. <img class="h-full w-full object-cover" src={`/assets/images/dota_${item.name}.png`} alt="" />
  52403. </div>
  52404. <div>
  52405. <Icon
  52406. name={imgChecked === item.name ? 'ri-arrow-up-s-fill' : 'ri-arrow-up-s-line'}
  52407. theme={imgChecked === item.name}
  52408. alpha={imgChecked === item.name ? 1 : 0.2}
  52409. />
  52410. </div>
  52411. </div>
  52412. {/snippet}
  52413. </Radio>
  52414. <div class="text-sm">
  52415. 已选 <span class="text-[red]">{imgChecked}</span>
  52416. </div>
  52417. <Divider />
  52418. </div>
  52419. <div class="px-4">
  52420. <div class="mb-4 text-2xl font-bold">行内元素排列</div>
  52421. <div class="mb-4 mt-8 text-lg font-bold">Snippet 行内元素排列</div>
  52422. <Radio layout="inline" data={dotaInlines}>
  52423. {#snippet radioChild({ item })}
  52424. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52425. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52426. <div
  52427. class="m-1 rounded-sm border px-2 py-0.5 text-sm {checkInline === item.name
  52428. ? 'bg-primary/10 text-primary dark:bg-dark/10 dark:text-dark'
  52429. : 'border-gray-200 bg-gray-100 dark:border-gray-500 dark:bg-gray-600'}"
  52430. onclick={() => (checkInline = item.name)}
  52431. >
  52432. {item.label}
  52433. </div>
  52434. {/snippet}
  52435. </Radio>
  52436. <div class="mt-2 text-xs">已选:{checkInline}</div>
  52437. </div>
  52438. <Divider />
  52439. <div class="px-4 pb-8">
  52440. <div class="mb-4 text-2xl font-bold">纵向排列</div>
  52441. <div class="mb-4 mt-8 text-lg font-bold">基础用法</div>
  52442. <Radio data={dota} />
  52443. <Divider />
  52444. <div class="mb-4 mt-8 text-lg font-bold">长文字选项</div>
  52445. <Radio data={dotaLong} />
  52446. <Divider />
  52447. <div class="mb-4 mt-8 text-lg font-bold">文字靠左</div>
  52448. <Radio data={dota} textPosition="l" />
  52449. <div class="mb-4 mt-8 text-lg font-bold">复杂选项 && 自定义选中效果</div>
  52450. <Radio data={dotaVoices}>
  52451. {#snippet radioChild({ item })}
  52452. <!-- svelte-ignore a11y_click_events_have_key_events -->
  52453. <!-- svelte-ignore a11y_no_static_element_interactions -->
  52454. <div class="flex cursor-pointer items-center" onclick={() => (voiceChecked = item.name)}>
  52455. <div>
  52456. <Icon
  52457. name={voiceChecked === item.name ? 'ri-radio-button-line' : 'ri-checkbox-blank-circle-line'}
  52458. theme={voiceChecked === item.name}
  52459. alpha={voiceChecked === item.name ? 1 : 0.2}
  52460. />
  52461. </div>
  52462. <div class="ml-2 grow {voiceChecked === item.name ? 'text-primary dark:text-dark' : ''}">
  52463. {item.label}
  52464. {#each item.voices as string[] as voice}
  52465. <div class="text-xs">{voice}</div>
  52466. {/each}
  52467. <div class="mt-1 h-px bg-black/10 dark:bg-white/10"></div>
  52468. </div>
  52469. </div>
  52470. {/snippet}
  52471. </Radio>
  52472. </div>
  52473. ================================================
  52474. FILE: packages/stdf/src/routes/rate/en_US/+page.svelte
  52475. ================================================
  52476. <!-- Rate Demo -->
  52477. <script lang="ts">
  52478. import { Rate, Icon } from '$lib/index.js';
  52479. let value = $state(2.5);
  52480. </script>
  52481. <div class="mx-4 mt-8 text-lg font-bold">Basic Usage</div>
  52482. <div class="p-4">
  52483. <Rate />
  52484. </div>
  52485. <div class="mx-4 mt-8 text-lg font-bold">Set Initial Score</div>
  52486. <div class="p-4">
  52487. <Rate value={1} />
  52488. </div>
  52489. <div class="mx-4 mt-8 text-lg font-bold">Allow Zero Score</div>
  52490. <div class="p-4">
  52491. <Rate zero />
  52492. </div>
  52493. <div class="mx-4 mt-8 text-lg font-bold">Custom Total Score</div>
  52494. <div class="p-4">
  52495. <Rate total={12} />
  52496. </div>
  52497. <div class="mx-4 mt-8 text-lg font-bold">Set Unselected Opacity</div>
  52498. <div class="p-4">
  52499. <Rate opacity="0.8" />
  52500. </div>
  52501. <div class="mx-4 mt-8 text-lg font-bold">Allow Half Selection</div>
  52502. <div class="p-4">
  52503. <Rate half />
  52504. </div>
  52505. <div class="mx-4 mt-8 text-lg font-bold">Vertical Half Selection</div>
  52506. <div class="p-4">
  52507. <Rate half vertical />
  52508. </div>
  52509. <div class="mx-4 mt-8 text-lg font-bold">Half Selection with Zero Score</div>
  52510. <div class="p-4">
  52511. <Rate half zero />
  52512. </div>
  52513. <div class="mx-4 mt-8 text-lg font-bold">Increase Spacing</div>
  52514. <div class="p-4">
  52515. <Rate space="8" />
  52516. </div>
  52517. <div class="mx-4 mt-8 text-lg font-bold">Disabled</div>
  52518. <div class="p-4">
  52519. <Rate disabled />
  52520. </div>
  52521. <div class="mx-4 mt-8 text-lg font-bold">Read Only</div>
  52522. <div class="p-4">
  52523. <Rate readonly />
  52524. </div>
  52525. <div class="mx-4 mt-8 text-lg font-bold">Different Sizes</div>
  52526. <div class="p-4">
  52527. <Rate width={20} height={20} />
  52528. </div>
  52529. <div class="p-4">
  52530. <Rate width={28} height={28} />
  52531. </div>
  52532. <div class="p-4">
  52533. <Rate width={36} height={36} />
  52534. </div>
  52535. <div class="mx-4 mt-8 text-lg font-bold">Custom Icons</div>
  52536. <div class="p-4">
  52537. <Rate opacity="0.6">
  52538. <Icon name="ri-star-fill" injClass="text-[#f5b53f]" />
  52539. </Rate>
  52540. </div>
  52541. <div class="p-4">
  52542. <Rate>
  52543. <Icon name="ri-heart-3-fill" injClass="text-[red]" />
  52544. </Rate>
  52545. </div>
  52546. <div class="p-4">
  52547. <Rate half>
  52548. <Icon name="ri-heart-3-fill" injClass="text-[red]" />
  52549. </Rate>
  52550. </div>
  52551. <div class="p-4">
  52552. <Rate half opacity="0.5" width={30} height={36}>
  52553. <div class="text-3xl">👍</div>
  52554. </Rate>
  52555. </div>
  52556. <div class="p-4">
  52557. <Rate half opacity="0.5" width={30} height={36} vertical>
  52558. <div class="text-3xl">🍺</div>
  52559. </Rate>
  52560. </div>
  52561. <div class="p-4">
  52562. <Rate half opacity="0.5" width={30} height={36}>
  52563. <div class="text-3xl text-primary dark:text-dark">M</div>
  52564. </Rate>
  52565. </div>
  52566. <div class="mx-4 mt-8 text-lg font-bold">Event Listening</div>
  52567. <div class="p-4">
  52568. <Rate half {value} onclick={(v) => (value = v)} />
  52569. <p class="mt-2">Rating: {value} stars</p>
  52570. </div>
  52571. <div class="mx-4 mt-8 text-lg font-bold">Click Animation for All Active Icons</div>
  52572. <div class="p-4">
  52573. <Rate animation="active" />
  52574. </div>
  52575. <div class="mx-4 mt-8 text-lg font-bold">Disable Click Animation</div>
  52576. <div class="p-4">
  52577. <Rate animation={null} />
  52578. </div>
  52579. ================================================
  52580. FILE: packages/stdf/src/routes/rate/zh_CN/+page.svelte
  52581. ================================================
  52582. <!-- Rate Demo -->
  52583. <script lang="ts">
  52584. import { Rate, Icon } from '$lib/index.js';
  52585. let value = $state(2.5);
  52586. </script>
  52587. <div class="mx-4 mt-8 text-lg font-bold">基础用法</div>
  52588. <div class="p-4">
  52589. <Rate />
  52590. </div>
  52591. <div class="mx-4 mt-8 text-lg font-bold">设置初始分数</div>
  52592. <div class="p-4">
  52593. <Rate value={1} />
  52594. </div>
  52595. <div class="mx-4 mt-8 text-lg font-bold">允许零分</div>
  52596. <div class="p-4">
  52597. <Rate zero />
  52598. </div>
  52599. <div class="mx-4 mt-8 text-lg font-bold">自定义总分</div>
  52600. <div class="p-4">
  52601. <Rate total={12} />
  52602. </div>
  52603. <div class="mx-4 mt-8 text-lg font-bold">设置未选中透明度</div>
  52604. <div class="p-4">
  52605. <Rate opacity="0.8" />
  52606. </div>
  52607. <div class="mx-4 mt-8 text-lg font-bold">允许半选</div>
  52608. <div class="p-4">
  52609. <Rate half />
  52610. </div>
  52611. <div class="mx-4 mt-8 text-lg font-bold">竖向半选</div>
  52612. <div class="p-4">
  52613. <Rate half vertical />
  52614. </div>
  52615. <div class="mx-4 mt-8 text-lg font-bold">半选允许零分</div>
  52616. <div class="p-4">
  52617. <Rate half zero />
  52618. </div>
  52619. <div class="mx-4 mt-8 text-lg font-bold">加大间距</div>
  52620. <div class="p-4">
  52621. <Rate space="8" />
  52622. </div>
  52623. <div class="mx-4 mt-8 text-lg font-bold">禁用</div>
  52624. <div class="p-4">
  52625. <Rate disabled />
  52626. </div>
  52627. <div class="mx-4 mt-8 text-lg font-bold">只读</div>
  52628. <div class="p-4">
  52629. <Rate readonly />
  52630. </div>
  52631. <div class="mx-4 mt-8 text-lg font-bold">不同大小</div>
  52632. <div class="p-4">
  52633. <Rate width={20} height={20} />
  52634. </div>
  52635. <div class="p-4">
  52636. <Rate width={28} height={28} />
  52637. </div>
  52638. <div class="p-4">
  52639. <Rate width={36} height={36} />
  52640. </div>
  52641. <div class="mx-4 mt-8 text-lg font-bold">自定义</div>
  52642. <div class="p-4">
  52643. <Rate opacity="0.6">
  52644. <Icon name="ri-star-fill" injClass="text-[#f5b53f]" />
  52645. </Rate>
  52646. </div>
  52647. <div class="p-4">
  52648. <Rate>
  52649. <Icon name="ri-heart-3-fill" injClass="text-[red]" />
  52650. </Rate>
  52651. </div>
  52652. <div class="p-4">
  52653. <Rate half>
  52654. <Icon name="ri-heart-3-fill" injClass="text-[red]" />
  52655. </Rate>
  52656. </div>
  52657. <div class="p-4">
  52658. <Rate half opacity="0.5" width={30} height={36}>
  52659. <div class="text-3xl">👍</div>
  52660. </Rate>
  52661. </div>
  52662. <div class="p-4">
  52663. <Rate half opacity="0.5" width={30} height={36} vertical>
  52664. <div class="text-3xl">🍺</div>
  52665. </Rate>
  52666. </div>
  52667. <div class="p-4">
  52668. <Rate half opacity="0.5" width={30} height={36}>
  52669. <div class="text-3xl text-primary dark:text-dark">富</div>
  52670. </Rate>
  52671. </div>
  52672. <div class="mx-4 mt-8 text-lg font-bold">监听事件</div>
  52673. <div class="p-4">
  52674. <Rate half {value} onclick={(v) => (value = v)} />
  52675. <p class="mt-2">评分:{value} 星</p>
  52676. </div>
  52677. <div class="mx-4 mt-8 text-lg font-bold">所有激活图标都有点击动画</div>
  52678. <div class="p-4">
  52679. <Rate animation="active" />
  52680. </div>
  52681. <div class="mx-4 mt-8 text-lg font-bold">关闭点击动画</div>
  52682. <div class="p-4">
  52683. <Rate animation={null} />
  52684. </div>
  52685. ================================================
  52686. FILE: packages/stdf/src/routes/skeleton/en_US/+page.svelte
  52687. ================================================
  52688. <!-- Skeleton Demo -->
  52689. <script lang="ts">
  52690. import { Skeleton } from '$lib/index.js';
  52691. </script>
  52692. <div class="p-2">
  52693. <div class="m-4 text-lg font-bold">example 1</div>
  52694. <div class="flex">
  52695. <Skeleton width="16" height="16" radius="full" />
  52696. <div class="grow">
  52697. <Skeleton width="32" height="8" />
  52698. <Skeleton type="p" />
  52699. </div>
  52700. </div>
  52701. <div class="m-4 text-lg font-bold">example 2</div>
  52702. <div class="flex justify-between">
  52703. <Skeleton width="16" height="16" />
  52704. <Skeleton width="16" height="16" />
  52705. <Skeleton width="16" height="16" />
  52706. <Skeleton width="16" height="16" />
  52707. </div>
  52708. <Skeleton width="32" height="8" />
  52709. <Skeleton type="p" lines={5} />
  52710. <div class="m-4 text-lg font-bold">example 3</div>
  52711. <div class="flex">
  52712. <Skeleton type="img" width="24" height="24" />
  52713. <div class="grow">
  52714. <Skeleton type="p" />
  52715. </div>
  52716. </div>
  52717. <div class="m-4 text-lg font-bold">example 4</div>
  52718. <div class="flex">
  52719. <div class="grow">
  52720. <Skeleton width="32" height="8" />
  52721. <Skeleton type="p" />
  52722. </div>
  52723. <Skeleton type="video" width="32" height="32" />
  52724. </div>
  52725. <div class="m-4 text-lg font-bold">example 5</div>
  52726. <div class="flex flex-col items-center">
  52727. <Skeleton width="24" height="24" radius="full" />
  52728. <Skeleton width="16" height="6" />
  52729. <Skeleton width="32" height="4" />
  52730. <Skeleton type="qrcode" width="64" height="64" />
  52731. </div>
  52732. <div class="m-4 text-lg font-bold">example 6</div>
  52733. {#each [1, 1, 1] as item}
  52734. <div class="flex items-center justify-between">
  52735. <div class="flex">
  52736. <div class="flex">
  52737. <Skeleton width="12" height="12" radius="full" />
  52738. <div class="flex flex-col justify-between">
  52739. <Skeleton width="16" height="6" />
  52740. <Skeleton width="32" height="4" />
  52741. </div>
  52742. </div>
  52743. </div>
  52744. <Skeleton width="16" height="8" radius="full" />
  52745. </div>
  52746. <Skeleton width="full" height="1" />
  52747. {/each}
  52748. </div>
  52749. ================================================
  52750. FILE: packages/stdf/src/routes/skeleton/zh_CN/+page.svelte
  52751. ================================================
  52752. <!-- Skeleton Demo -->
  52753. <script lang="ts">
  52754. import { Skeleton } from '$lib/index.js';
  52755. </script>
  52756. <div class="p-2">
  52757. <div class="m-4 text-lg font-bold">示例 1</div>
  52758. <div class="flex">
  52759. <Skeleton width="16" height="16" radius="full" />
  52760. <div class="grow">
  52761. <Skeleton width="32" height="8" />
  52762. <Skeleton type="p" />
  52763. </div>
  52764. </div>
  52765. <div class="m-4 text-lg font-bold">示例 2</div>
  52766. <div class="flex justify-between">
  52767. <Skeleton width="16" height="16" />
  52768. <Skeleton width="16" height="16" />
  52769. <Skeleton width="16" height="16" />
  52770. <Skeleton width="16" height="16" />
  52771. </div>
  52772. <Skeleton width="32" height="8" />
  52773. <Skeleton type="p" lines={5} />
  52774. <div class="m-4 text-lg font-bold">示例 3</div>
  52775. <div class="flex">
  52776. <Skeleton type="img" width="24" height="24" />
  52777. <div class="grow">
  52778. <Skeleton type="p" />
  52779. </div>
  52780. </div>
  52781. <div class="m-4 text-lg font-bold">示例 4</div>
  52782. <div class="flex">
  52783. <div class="grow">
  52784. <Skeleton width="32" height="8" />
  52785. <Skeleton type="p" />
  52786. </div>
  52787. <Skeleton type="video" width="32" height="32" />
  52788. </div>
  52789. <div class="m-4 text-lg font-bold">示例 5</div>
  52790. <div class="flex flex-col items-center">
  52791. <Skeleton width="24" height="24" radius="full" />
  52792. <Skeleton width="16" height="6" />
  52793. <Skeleton width="32" height="4" />
  52794. <Skeleton type="qrcode" width="64" height="64" />
  52795. </div>
  52796. <div class="m-4 text-lg font-bold">示例 6</div>
  52797. <!-- eslint-disable-next-line @typescript-eslint/no-unused-vars -->
  52798. {#each [1, 1, 1] as _}
  52799. <div class="flex items-center justify-between">
  52800. <div class="flex">
  52801. <div class="flex">
  52802. <Skeleton width="12" height="12" radius="full" />
  52803. <div class="flex flex-col justify-between">
  52804. <Skeleton width="16" height="6" />
  52805. <Skeleton width="32" height="4" />
  52806. </div>
  52807. </div>
  52808. </div>
  52809. <Skeleton width="16" height="8" radius="full" />
  52810. </div>
  52811. <Skeleton width="full" height="1" />
  52812. {/each}
  52813. </div>
  52814. ================================================
  52815. FILE: packages/stdf/src/routes/slider/en_US/+page.svelte
  52816. ================================================
  52817. <!-- Slider Demo -->
  52818. <script lang="ts">
  52819. import { Slider, Icon } from '$lib/index.js';
  52820. let value = $state(20);
  52821. let valueRange = $state([50, 60]);
  52822. // Generate an array of random numbers within a specified range
  52823. const randomArray = (min: number, max: number, length: number) => {
  52824. let arr = [];
  52825. for (let i = 0; i < length; i++) {
  52826. arr.push(Math.floor(Math.random() * (max - min + 1) + min));
  52827. }
  52828. return arr;
  52829. };
  52830. // Sort the array in ascending or descending order
  52831. const sortArray = (arr: number[], isAsc: boolean) => arr.sort((a, b) => (isAsc ? a - b : b - a));
  52832. const barList1 = sortArray(randomArray(2, 60, 20), true);
  52833. const barList2 = sortArray(randomArray(2, 60, 20), false);
  52834. const barList = [...barList1, ...barList2];
  52835. let valueBar: number = $state(70);
  52836. </script>
  52837. <div class="mx-4 mt-8 text-lg font-bold">Basic Usage</div>
  52838. <div class="px-6 py-4">
  52839. <Slider />
  52840. </div>
  52841. <div class="mx-4 mt-8 text-lg font-bold">Monitor value</div>
  52842. <div class="px-6 py-4">
  52843. <Slider onchange={(v: number) => (value = v)} {value} />
  52844. Current value: {value}
  52845. </div>
  52846. <div class="mx-4 mt-8 text-lg font-bold">Step size of 5</div>
  52847. <div class="px-6 py-4">
  52848. <Slider step={5} />
  52849. </div>
  52850. <div class="mx-4 mt-8 text-lg font-bold">Step size of 0.1</div>
  52851. <div class="px-6 py-4">
  52852. <Slider step={0.1} value={0.2} minRange={0} maxRange={1} />
  52853. </div>
  52854. <div class="mx-4 mt-8 text-lg font-bold">Set selectable range (60-80)</div>
  52855. <div class="px-6 py-4">
  52856. <Slider value={68} minRange={60} maxRange={80} />
  52857. </div>
  52858. <div class="mx-4 mt-8 text-lg font-bold">Range selection</div>
  52859. <div class="px-6 py-4">
  52860. <Slider isRange />
  52861. </div>
  52862. <div class="mx-4 mt-8 text-lg font-bold">Set range for interval (40-80)</div>
  52863. <div class="px-6 py-4">
  52864. <Slider
  52865. isRange
  52866. minRange={40}
  52867. maxRange={80}
  52868. startValue={valueRange[0]}
  52869. endValue={valueRange[1]}
  52870. onchange={(_, valueRange) => (valueRange = valueRange)}
  52871. />
  52872. Current range: {valueRange[0]} - {valueRange[1]}
  52873. </div>
  52874. <div class="mx-4 mt-8 text-lg font-bold">Different border radius</div>
  52875. <div class="px-6 py-4">
  52876. <Slider radius="sm" />
  52877. </div>
  52878. <div class="px-6 py-4">
  52879. <Slider radius="none" />
  52880. </div>
  52881. <div class="px-6 py-4">
  52882. <Slider radius="sm" isRange />
  52883. </div>
  52884. <div class="mx-4 mt-8 text-lg font-bold">Outlined slider</div>
  52885. <div class="px-6 py-4">
  52886. <Slider lineBlock radius="sm" />
  52887. </div>
  52888. <div class="px-6 py-4">
  52889. <Slider lineBlock isRange />
  52890. </div>
  52891. <div class="mx-4 mt-8 text-lg font-bold">Always show Tip</div>
  52892. <div class="px-6 py-4">
  52893. <Slider showTip="always" />
  52894. </div>
  52895. <div class="px-6 py-4">
  52896. <Slider showTip="always" isRange />
  52897. </div>
  52898. <div class="px-6 py-4">
  52899. <Slider showTip="always" radius="none" />
  52900. </div>
  52901. <div class="mx-4 mt-8 text-lg font-bold">Don't show Tip</div>
  52902. <div class="px-6 py-4">
  52903. <Slider showTip="never" />
  52904. </div>
  52905. <div class="mx-4 mt-8 text-lg font-bold">Combined layout</div>
  52906. <div class="flex space-x-3 p-4">
  52907. <Icon name="ri-volume-mute-line" />
  52908. <div class="grow">
  52909. <Slider />
  52910. </div>
  52911. <Icon name="ri-volume-up-line" />
  52912. </div>
  52913. <div class="mx-4 mt-8 text-lg font-bold">Using Snippet</div>
  52914. <div class="px-6 pt-16">
  52915. <Slider lineBlock showTip="never" value={valueBar} onchange={(v: number) => (valueBar = v)}>
  52916. {#snippet children()}
  52917. <div class="relative grow items-end">
  52918. <div class="flex items-end justify-between overflow-hidden" style="transform: translateY(-30px);">
  52919. {#each barList as item, i}
  52920. <div
  52921. class="w-1 rounded-full{i / 40 < valueBar / 100 ? ' bg-primary dark:bg-dark' : ' bg-gray-200 dark:bg-gray-500'}"
  52922. style="height: {item}px"
  52923. ></div>
  52924. {/each}
  52925. </div>
  52926. </div>
  52927. {/snippet}
  52928. </Slider>
  52929. </div>
  52930. <div class="mx-4 mt-8 text-lg font-bold">Disabled</div>
  52931. <div class="px-6 py-4">
  52932. <Slider disabled />
  52933. </div>
  52934. <div class="mx-4 mt-8 text-lg font-bold">Read-only</div>
  52935. <div class="px-6 py-4">
  52936. <Slider readonly />
  52937. </div>
  52938. ================================================
  52939. FILE: packages/stdf/src/routes/slider/zh_CN/+page.svelte
  52940. ================================================
  52941. <!-- Slider Demo -->
  52942. <script lang="ts">
  52943. import { Slider, Icon } from '$lib/index.js';
  52944. let value = $state(20);
  52945. let valueRange: [number, number] = $state([50, 60]);
  52946. //生成指定数字之间的随机数组成的数组
  52947. const randomArray = (min: number, max: number, length: number) => {
  52948. let arr = [];
  52949. for (let i = 0; i < length; i++) {
  52950. arr.push(Math.floor(Math.random() * (max - min + 1) + min));
  52951. }
  52952. return arr;
  52953. };
  52954. //将数组递增或递减排序
  52955. const sortArray = (arr: number[], isAsc: boolean) => arr.sort((a, b) => (isAsc ? a - b : b - a));
  52956. const barList1 = sortArray(randomArray(2, 60, 20), true);
  52957. const barList2 = sortArray(randomArray(2, 60, 20), false);
  52958. const barList = [...barList1, ...barList2];
  52959. let valueBar: number = $state(70);
  52960. </script>
  52961. <div class="mx-4 mt-8 text-lg font-bold">基础用法</div>
  52962. <div class="px-6 py-4">
  52963. <Slider />
  52964. </div>
  52965. <div class="mx-4 mt-8 text-lg font-bold">监听 value</div>
  52966. <div class="px-6 py-4">
  52967. <Slider onchange={(v: number) => (value = v)} {value} />
  52968. 当前值:{value}
  52969. </div>
  52970. <div class="mx-4 mt-8 text-lg font-bold">步长为 5</div>
  52971. <div class="px-6 py-4">
  52972. <Slider step={5} />
  52973. </div>
  52974. <div class="mx-4 mt-8 text-lg font-bold">步长为 0.1</div>
  52975. <div class="px-6 py-4">
  52976. <Slider step={0.1} value={0.2} minRange={0} maxRange={1} />
  52977. </div>
  52978. <div class="mx-4 mt-8 text-lg font-bold">设定可选范围(60-80)</div>
  52979. <div class="px-6 py-4">
  52980. <Slider value={68} minRange={60} maxRange={80} />
  52981. </div>
  52982. <div class="mx-4 mt-8 text-lg font-bold">区间选择</div>
  52983. <div class="px-6 py-4">
  52984. <Slider isRange />
  52985. </div>
  52986. <div class="mx-4 mt-8 text-lg font-bold">区间设定可选范围(40-80)</div>
  52987. <div class="px-6 py-4">
  52988. <Slider
  52989. isRange
  52990. minRange={40}
  52991. maxRange={80}
  52992. startValue={valueRange[0]}
  52993. endValue={valueRange[1]}
  52994. onchange={(_, valueRange) => (valueRange = valueRange)}
  52995. />
  52996. 当前区间:{valueRange[0]} - {valueRange[1]}
  52997. </div>
  52998. <div class="mx-4 mt-8 text-lg font-bold">不同圆角</div>
  52999. <div class="px-6 py-4">
  53000. <Slider radius="sm" />
  53001. </div>
  53002. <div class="px-6 py-4">
  53003. <Slider radius="none" />
  53004. </div>
  53005. <div class="px-6 py-4">
  53006. <Slider radius="sm" isRange />
  53007. </div>
  53008. <div class="mx-4 mt-8 text-lg font-bold">线框滑块</div>
  53009. <div class="px-6 py-4">
  53010. <Slider lineBlock radius="sm" />
  53011. </div>
  53012. <div class="px-6 py-4">
  53013. <Slider lineBlock isRange />
  53014. </div>
  53015. <div class="mx-4 mt-8 text-lg font-bold">一直显示 Tip</div>
  53016. <div class="px-6 py-4">
  53017. <Slider showTip="always" />
  53018. </div>
  53019. <div class="px-6 py-4">
  53020. <Slider showTip="always" isRange />
  53021. </div>
  53022. <div class="px-6 py-4">
  53023. <Slider showTip="always" radius="none" />
  53024. </div>
  53025. <div class="mx-4 mt-8 text-lg font-bold">不显示 Tip</div>
  53026. <div class="px-6 py-4">
  53027. <Slider showTip="never" />
  53028. </div>
  53029. <div class="mx-4 mt-8 text-lg font-bold">组合布局</div>
  53030. <div class="flex space-x-3 p-4">
  53031. <Icon name="ri-volume-mute-line" />
  53032. <div class="grow">
  53033. <Slider />
  53034. </div>
  53035. <Icon name="ri-volume-up-line" />
  53036. </div>
  53037. <div class="mx-4 mt-8 text-lg font-bold">使用 Snippet</div>
  53038. <div class="px-6 pt-16">
  53039. <Slider lineBlock showTip="never" value={valueBar} onchange={(v: number) => (valueBar = v)}>
  53040. {#snippet children()}
  53041. <div class="relative grow items-end">
  53042. <div class="flex items-end justify-between overflow-hidden" style="transform: translateY(-30px);">
  53043. {#each barList as item, i}
  53044. <div
  53045. class="w-1 rounded-full{i / 40 < valueBar / 100 ? ' bg-primary dark:bg-dark' : ' bg-gray-200 dark:bg-gray-500'}"
  53046. style="height: {item}px"
  53047. ></div>
  53048. {/each}
  53049. </div>
  53050. </div>
  53051. {/snippet}
  53052. </Slider>
  53053. </div>
  53054. <div class="mx-4 mt-8 text-lg font-bold">禁用</div>
  53055. <div class="px-6 py-4">
  53056. <Slider disabled />
  53057. </div>
  53058. <div class="mx-4 mt-8 text-lg font-bold">只读</div>
  53059. <div class="px-6 py-4">
  53060. <Slider readonly />
  53061. </div>
  53062. ================================================
  53063. FILE: packages/stdf/src/routes/stepper/en_US/+page.svelte
  53064. ================================================
  53065. <!-- Stepper Demo -->
  53066. <script lang="ts">
  53067. import { Stepper, Toast } from '$lib/index.js';
  53068. let asyncValue1 = $state(1);
  53069. let loading1 = $state(false);
  53070. let asyncValue2 = $state(1);
  53071. let loading2 = $state(false);
  53072. let asyncValue3 = $state(1);
  53073. let loading3 = $state(false);
  53074. const handleChange1 = (type: 'increase' | 'decrease') => {
  53075. loading1 = true;
  53076. setTimeout(() => {
  53077. asyncValue1 += type === 'increase' ? 1 : -1;
  53078. loading1 = false;
  53079. }, 2000);
  53080. };
  53081. const handleChange2 = (type: 'increase' | 'decrease') => {
  53082. loading2 = true;
  53083. setTimeout(() => {
  53084. asyncValue2 += type === 'increase' ? 1 : -1;
  53085. loading2 = false;
  53086. }, 3000);
  53087. };
  53088. const handleChange3 = (type: 'increase' | 'decrease') => {
  53089. loading3 = true;
  53090. setTimeout(() => {
  53091. asyncValue3 += type === 'increase' ? 1 : -1;
  53092. loading3 = false;
  53093. }, 4000);
  53094. };
  53095. </script>
  53096. <div class="mx-4 mt-8 text-lg font-bold">Basic Usage</div>
  53097. <div class="px-4 py-4">
  53098. <Stepper />
  53099. </div>
  53100. <div class="mx-4 mt-8 text-lg font-bold">Set Maximum/Minimum/Initial Value</div>
  53101. <div class="px-4 py-4">
  53102. <Stepper min={2} max={10} value={5} />
  53103. </div>
  53104. <div class="mx-4 mt-8 text-lg font-bold">Set Step</div>
  53105. <div class="px-4 py-4">
  53106. <Stepper step={5} />
  53107. </div>
  53108. <div class="mx-4 mt-8 text-lg font-bold">Highlight Number Area</div>
  53109. <div class="px-4 py-4">
  53110. <Stepper numberHighlight />
  53111. </div>
  53112. <div class="mx-4 mt-8 text-lg font-bold">Highlight Number Area</div>
  53113. <div class="flex gap-2 px-4 py-4">
  53114. <Stepper theme={false} />
  53115. <Stepper theme={false} numberHighlight />
  53116. </div>
  53117. <div class="mx-4 mt-8 text-lg font-bold">Different Radius</div>
  53118. <div class="flex flex-wrap gap-2 px-4 py-4">
  53119. <div><Stepper radius="none" /></div>
  53120. <div><Stepper radius="sm" /></div>
  53121. <div><Stepper radius="xl" /></div>
  53122. <div><Stepper radius="full" /></div>
  53123. <div><Stepper radius="full" numberHighlight /></div>
  53124. <div><Stepper radius="full" theme={false} /></div>
  53125. </div>
  53126. <div class="mx-4 mt-8 text-lg font-bold">Vertical</div>
  53127. <div class="flex justify-around px-2 py-4">
  53128. <Stepper vertical />
  53129. <Stepper vertical numberHighlight />
  53130. <Stepper vertical theme={false} />
  53131. <Stepper vertical radius="none" />
  53132. <Stepper radius="xl" vertical />
  53133. </div>
  53134. <div class="mx-4 mt-8 text-lg font-bold">Format Display Numbers</div>
  53135. <div class="px-4 py-4">
  53136. <div class="mb-2 text-sm">Keep one decimal place</div>
  53137. <Stepper decimal={1} step={0.1} max={1} min={0.1} value={0.5} />
  53138. </div>
  53139. <div class="px-4 py-4">
  53140. <div class="mb-2 text-sm">Keep four decimal places</div>
  53141. <Stepper decimal={4} step={0.0001} max={1} min={0.0001} value={0.5} />
  53142. </div>
  53143. <div class="mx-4 mt-8 text-lg font-bold">Asynchronous Display Numbers</div>
  53144. <div class="px-4 py-4">
  53145. <div class="mb-2 text-sm">Toast shows asynchronous status</div>
  53146. <Stepper async={loading1} value={asyncValue1} onincrease={() => handleChange1('increase')} ondecrease={() => handleChange1('decrease')} />
  53147. </div>
  53148. <Toast bind:visible={loading1} type="loading" message="Saving..." />
  53149. <div class="mb-2 px-4 text-sm">Internal display asynchronous status</div>
  53150. <div class="flex gap-2 px-4 py-4">
  53151. <Stepper
  53152. async={loading2}
  53153. value={asyncValue2}
  53154. asyncLoading
  53155. onincrease={() => handleChange2('increase')}
  53156. ondecrease={() => handleChange2('decrease')}
  53157. />
  53158. <Stepper
  53159. async={loading3}
  53160. value={asyncValue3}
  53161. asyncLoading
  53162. loading={{ type: '1_51' }}
  53163. onincrease={() => handleChange3('increase')}
  53164. ondecrease={() => handleChange3('decrease')}
  53165. />
  53166. </div>
  53167. <div class="mx-4 mt-8 text-lg font-bold">No external padding</div>
  53168. <div class="px-4 py-2">
  53169. <Stepper padding={false} />
  53170. </div>
  53171. <div class="px-4 py-2">
  53172. <Stepper padding={false} numberHighlight />
  53173. </div>
  53174. <div class="px-4 py-2">
  53175. <Stepper padding={false} theme={false} />
  53176. </div>
  53177. <div class="mx-4 mt-8 text-lg font-bold">Inject Class in Different Positions</div>
  53178. <div class="px-4 py-2">
  53179. <Stepper theme={false} injClassOut="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  53180. </div>
  53181. <div class="px-4 py-2">
  53182. <Stepper injClassNum="text-primary dark:text-dark" />
  53183. </div>
  53184. <div class="px-4 py-2">
  53185. <Stepper injClassBtn="rounded-full" />
  53186. </div>
  53187. ================================================
  53188. FILE: packages/stdf/src/routes/stepper/zh_CN/+page.svelte
  53189. ================================================
  53190. <!-- Stepper Demo -->
  53191. <script lang="ts">
  53192. import { Stepper, Toast } from '$lib/index.js';
  53193. let asyncValue1 = $state(1);
  53194. let loading1 = $state(false);
  53195. let asyncValue2 = $state(1);
  53196. let loading2 = $state(false);
  53197. let asyncValue3 = $state(1);
  53198. let loading3 = $state(false);
  53199. const handleChange1 = (type: 'increase' | 'decrease') => {
  53200. loading1 = true;
  53201. setTimeout(() => {
  53202. asyncValue1 += type === 'increase' ? 1 : -1;
  53203. loading1 = false;
  53204. }, 2000);
  53205. };
  53206. const handleChange2 = (type: 'increase' | 'decrease') => {
  53207. loading2 = true;
  53208. setTimeout(() => {
  53209. asyncValue2 += type === 'increase' ? 1 : -1;
  53210. loading2 = false;
  53211. }, 3000);
  53212. };
  53213. const handleChange3 = (type: 'increase' | 'decrease') => {
  53214. loading3 = true;
  53215. setTimeout(() => {
  53216. asyncValue3 += type === 'increase' ? 1 : -1;
  53217. loading3 = false;
  53218. }, 4000);
  53219. };
  53220. </script>
  53221. <div class="mx-4 mt-8 text-lg font-bold">基础用法</div>
  53222. <div class="px-4 py-4">
  53223. <Stepper />
  53224. </div>
  53225. <div class="mx-4 mt-8 text-lg font-bold">设置最大值/最小值/初始值</div>
  53226. <div class="px-4 py-4">
  53227. <Stepper min={2} max={10} value={5} />
  53228. </div>
  53229. <div class="mx-4 mt-8 text-lg font-bold">设置步长</div>
  53230. <div class="px-4 py-4">
  53231. <Stepper step={5} />
  53232. </div>
  53233. <div class="mx-4 mt-8 text-lg font-bold">强调数字区域</div>
  53234. <div class="px-4 py-4">
  53235. <Stepper numberHighlight />
  53236. </div>
  53237. <div class="mx-4 mt-8 text-lg font-bold">强调区域不用主题色</div>
  53238. <div class="flex gap-2 px-4 py-4">
  53239. <Stepper theme={false} />
  53240. <Stepper theme={false} numberHighlight />
  53241. </div>
  53242. <div class="mx-4 mt-8 text-lg font-bold">不同圆角</div>
  53243. <div class="flex flex-wrap gap-2 px-4 py-4">
  53244. <div><Stepper radius="none" /></div>
  53245. <div><Stepper radius="sm" /></div>
  53246. <div><Stepper radius="xl" /></div>
  53247. <div><Stepper radius="full" /></div>
  53248. <div><Stepper radius="full" numberHighlight /></div>
  53249. <div><Stepper radius="full" theme={false} /></div>
  53250. </div>
  53251. <div class="mx-4 mt-8 text-lg font-bold">竖向</div>
  53252. <div class="flex justify-around px-2 py-4">
  53253. <Stepper vertical />
  53254. <Stepper vertical numberHighlight />
  53255. <Stepper vertical theme={false} />
  53256. <Stepper vertical radius="none" />
  53257. <Stepper radius="xl" vertical />
  53258. </div>
  53259. <div class="mx-4 mt-8 text-lg font-bold">格式化显示数字</div>
  53260. <div class="px-4 py-4">
  53261. <div class="mb-2 text-sm">保留一位小数</div>
  53262. <Stepper decimal={1} step={0.1} max={1} min={0.1} value={0.5} />
  53263. </div>
  53264. <div class="px-4 py-4">
  53265. <div class="mb-2 text-sm">保留四位小数</div>
  53266. <Stepper decimal={4} step={0.0001} max={1} min={0.0001} value={0.5} />
  53267. </div>
  53268. <div class="mx-4 mt-8 text-lg font-bold">异步显示数字</div>
  53269. <div class="px-4 py-4">
  53270. <div class="mb-2 text-sm">Toast 显示异步状态</div>
  53271. <Stepper async={loading1} value={asyncValue1} onincrease={() => handleChange1('increase')} ondecrease={() => handleChange1('decrease')} />
  53272. </div>
  53273. <Toast bind:visible={loading1} type="loading" message="保存中..." />
  53274. <div class="mb-2 px-4 text-sm">内部显示异步状态</div>
  53275. <div class="flex gap-2 px-4 py-4">
  53276. <Stepper
  53277. async={loading2}
  53278. value={asyncValue2}
  53279. asyncLoading
  53280. onincrease={() => handleChange2('increase')}
  53281. ondecrease={() => handleChange2('decrease')}
  53282. />
  53283. <Stepper
  53284. async={loading3}
  53285. value={asyncValue3}
  53286. asyncLoading
  53287. loading={{ type: '1_51' }}
  53288. onincrease={() => handleChange3('increase')}
  53289. ondecrease={() => handleChange3('decrease')}
  53290. />
  53291. </div>
  53292. <div class="mx-4 mt-8 text-lg font-bold">外部无 padding</div>
  53293. <div class="px-4 py-2">
  53294. <Stepper padding={false} />
  53295. </div>
  53296. <div class="px-4 py-2">
  53297. <Stepper padding={false} numberHighlight />
  53298. </div>
  53299. <div class="px-4 py-2">
  53300. <Stepper padding={false} theme={false} />
  53301. </div>
  53302. <div class="mx-4 mt-8 text-lg font-bold">不同位置注入 Class</div>
  53303. <div class="px-4 py-2">
  53304. <Stepper theme={false} injClassOut="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  53305. </div>
  53306. <div class="px-4 py-2">
  53307. <Stepper injClassNum="text-primary dark:text-dark" />
  53308. </div>
  53309. <div class="px-4 py-2">
  53310. <Stepper injClassBtn="rounded-full" />
  53311. </div>
  53312. ================================================
  53313. FILE: packages/stdf/src/routes/steps/en_US/+page.svelte
  53314. ================================================
  53315. <!--Steps Demo -->
  53316. <script lang="ts">
  53317. import { Steps, Button, Divider } from '$lib/index.js';
  53318. import type { StepsItemProps } from '$lib/types/index.js';
  53319. import injCom1 from './injCom1_en.svelte';
  53320. import injCom2 from './injCom2_en.svelte';
  53321. const steps: StepsItemProps[] = [
  53322. { step: { title: 'Get up' } },
  53323. { step: { title: 'Eat' } },
  53324. { step: { title: 'Drink' } },
  53325. { step: { title: 'Beat beans' } },
  53326. { step: { title: 'sleep' } }
  53327. ];
  53328. const steps1: StepsItemProps[] = [
  53329. { step: { title: 'Get up', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53330. { step: { title: 'Eat', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53331. { step: { title: 'Drink', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53332. { step: { title: 'Beat beans', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } } },
  53333. { step: { title: 'sleep', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53334. ];
  53335. const steps2: StepsItemProps[] = [
  53336. { step: { title: 'Get up' }, finishStep: { title: 'Have got up' } },
  53337. { step: { title: 'Eat' }, finishStep: { title: 'Have had enough' } },
  53338. { step: { title: 'Drink' }, finishStep: { title: 'Drink up' } },
  53339. { step: { title: 'Beat beans' }, finishStep: { title: 'Have a good time' } },
  53340. { step: { title: 'sleep' }, finishStep: { title: 'Fall asleep' } }
  53341. ];
  53342. const steps3: StepsItemProps[] = [
  53343. {
  53344. step: { title: 'Get up', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } },
  53345. finishStep: { title: 'Have got up', bar: { type: 'icon', content: { name: 'ri-hotel-bed-fill' } } }
  53346. },
  53347. {
  53348. step: { title: 'Eat', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } },
  53349. finishStep: { title: 'Have had enough', bar: { type: 'icon', content: { name: 'ri-restaurant-2-fill' } } }
  53350. },
  53351. {
  53352. step: { title: 'Drink', bar: { type: 'icon', content: { name: 'ri-cup-line' } } },
  53353. finishStep: { title: 'Drink up', bar: { type: 'icon', content: { name: 'ri-cup-fill' } } }
  53354. },
  53355. {
  53356. step: { title: 'Beat beans', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } },
  53357. finishStep: { title: 'Have a good time', bar: { type: 'icon', content: { name: 'ri-emotion-sad-fill' } } }
  53358. },
  53359. {
  53360. step: { title: 'sleep', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } },
  53361. finishStep: { title: 'Fall asleep', bar: { type: 'icon', content: { name: 'ri-zzz-fill' } } }
  53362. }
  53363. ];
  53364. const steps4: StepsItemProps[] = [
  53365. { step: { title: 'Get up', desc: 'Get up and move bricks!' } },
  53366. { step: { title: 'Eat', desc: 'Eat, eat, eat, eat, fat you.' } },
  53367. { step: { title: 'Drink', desc: 'Walk slowly and drink lots of water.' } },
  53368. {
  53369. step: {
  53370. title: 'Beat beans',
  53371. desc: "Eat, sleep, play peas it's cool, it's cool, it's cool, it's cool. By the way to verify the progress bar height adaptive step text height."
  53372. }
  53373. },
  53374. { step: { title: 'sleep', desc: 'Too full to sleep.' } }
  53375. ];
  53376. const steps5: StepsItemProps[] = [
  53377. { step: { title: 'Get up', desc: 'Get up and move bricks!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53378. { step: { title: 'Eat', desc: 'Eat, eat, eat, eat, fat you.', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53379. { step: { title: 'Drink', desc: 'Walk slowly and drink lots of water.', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53380. {
  53381. step: {
  53382. title: 'Beat beans',
  53383. desc: "Eat, sleep, play peas It's cool, it's cool, it's cool, it's cool, it's cool. By the way to verify the progress bar height adaptive step text height.",
  53384. bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } }
  53385. }
  53386. },
  53387. { step: { title: 'sleep', desc: 'Too full to sleep.', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53388. ];
  53389. const steps6: StepsItemProps[] = [
  53390. {
  53391. step: { title: 'Get up', desc: 'Get up and move bricks!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } },
  53392. finishStep: { title: 'Have got up', desc: 'The bricks are gone!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-fill' } } }
  53393. },
  53394. {
  53395. step: { title: 'Eat', desc: 'Eat, eat, eat, eat, fat you.', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } },
  53396. finishStep: {
  53397. title: 'Have had enough',
  53398. desc: 'The meal has been eaten up!',
  53399. bar: { type: 'icon', content: { name: 'ri-restaurant-2-fill' } }
  53400. }
  53401. },
  53402. {
  53403. step: { title: 'Drink', desc: 'Walk slowly and drink lots of water.', bar: { type: 'icon', content: { name: 'ri-cup-line' } } },
  53404. finishStep: {
  53405. title: 'Drink up',
  53406. desc: 'I drink too much water and it spills out of my eyes!',
  53407. bar: { type: 'icon', content: { name: 'ri-cup-fill' } }
  53408. }
  53409. },
  53410. {
  53411. step: { title: 'Beat beans', desc: 'Eat, sleep, play beans.', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } },
  53412. finishStep: {
  53413. title: 'Have a good time',
  53414. desc: 'Doudou has been beaten to the ground.',
  53415. bar: { type: 'icon', content: { name: 'ri-emotion-sad-fill' } }
  53416. }
  53417. },
  53418. {
  53419. step: { title: 'sleep', desc: 'Too full to sleep.', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } },
  53420. finishStep: { title: 'Fall asleep', desc: 'Asleep and dreaming!', bar: { type: 'icon', content: { name: 'ri-zzz-fill' } } }
  53421. }
  53422. ];
  53423. const steps7: StepsItemProps[] = [
  53424. { step: { title: 'Get up', desc: 'Get up and move bricks!', bar: { type: 'string', content: '1' } } },
  53425. { step: { title: 'Eat', desc: 'Eat, eat, eat, eat, fat you.', bar: { type: 'string', content: 'eat' } } },
  53426. { step: { title: 'Drink', desc: 'Walk slowly and drink lots of water.', bar: { type: 'string', content: '3' } } },
  53427. { step: { title: 'Beat beans', desc: 'Eat, sleep, play beans.', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } } },
  53428. { step: { title: 'sleep', desc: 'Too full to sleep.', bar: { type: 'string', content: '😴' } } }
  53429. ];
  53430. const steps8: StepsItemProps[] = [
  53431. { step: { title: 'Get up', bar: { type: 'image', content: '/assets/images/avatar_2.png' } } },
  53432. { step: { title: 'Eat', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53433. { step: { title: 'Drink', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53434. { step: { title: 'Beat beans', bar: { type: 'image', content: '/assets/images/avatar_1.jpg' } } },
  53435. { step: { title: 'sleep', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53436. ];
  53437. const steps9: StepsItemProps[] = [
  53438. { step: { title: 'Get up', desc: 'Get up and move bricks!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53439. {
  53440. step: {
  53441. title: 'Eat',
  53442. desc: 'Eat, eat, eat, eat, fat you.',
  53443. bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } },
  53444. injComponent: injCom1
  53445. }
  53446. },
  53447. { step: { title: 'Drink', desc: 'Walk slowly and drink lots of water.', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53448. {
  53449. step: {
  53450. title: 'Beat beans',
  53451. desc: 'Eat, sleep, play beans.',
  53452. bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } },
  53453. injComponent: injCom2
  53454. }
  53455. },
  53456. { step: { title: 'sleep', desc: 'Too full to sleep.', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53457. ];
  53458. let current = $state(1);
  53459. </script>
  53460. <div class="mb-4 mt-8 px-4 text-2xl font-bold">Horizontal arrangement</div>
  53461. <div class="mb-4 mt-8 px-4 text-lg font-bold">Simple usage</div>
  53462. <Steps {steps} {current} />
  53463. <div class="mb-4 mt-8 px-4 text-lg font-bold">Different fillet</div>
  53464. <Steps {steps} {current} radius="none" />
  53465. <Steps {steps} {current} radius="full" />
  53466. <div class="mb-4 mt-8 px-4 text-lg font-bold">Tape icon</div>
  53467. <Steps steps={steps1} {current} />
  53468. <div class="mb-4 mt-8 px-4 text-lg font-bold">Different icon border</div>
  53469. <Steps steps={steps1} {current} barBorder={false} />
  53470. <Steps steps={steps1} {current} barBorder={false} radius="full" />
  53471. <Steps steps={steps1} {current} radius="none" />
  53472. <Steps steps={steps1} {current} radius="xl" />
  53473. <Steps steps={steps1} {current} radius="full" />
  53474. <div class="mb-4 mt-8 px-4 text-lg font-bold">Tape completion step</div>
  53475. <Steps steps={steps2} {current} />
  53476. <div class="mb-4 mt-8 px-4 text-lg font-bold">Tape icon && Complete steps</div>
  53477. <Steps steps={steps3} {current} />
  53478. <div class="mb-4 mt-8 px-4 text-lg font-bold">The step bar area uses text</div>
  53479. <Steps steps={steps7} {current} />
  53480. <div class="mb-4 mt-8 px-4 text-lg font-bold">Use images for the step bar area</div>
  53481. <Steps steps={steps8} {current} />
  53482. <Steps steps={steps8} radius="full" {current} />
  53483. <Divider />
  53484. <div class="mb-4 mt-4 px-4 text-2xl font-bold">Longitudinal arrangement</div>
  53485. <div class="mb-4 mt-8 px-4 text-lg font-bold">Different fillet</div>
  53486. <div class="flex justify-around">
  53487. <Steps {steps} {current} vertical />
  53488. <Steps {steps} {current} radius="none" vertical />
  53489. <Steps {steps} {current} radius="full" vertical />
  53490. </div>
  53491. <div class="mb-4 mt-8 px-4 text-lg font-bold">Different icon border</div>
  53492. <div class="flex justify-around">
  53493. <Steps steps={steps1} {current} vertical />
  53494. <Steps steps={steps1} {current} vertical radius="full" barBorder={false} />
  53495. </div>
  53496. <Divider px="8" />
  53497. <div class="flex justify-around">
  53498. <Steps steps={steps1} {current} vertical barBorder={false} radius="none" />
  53499. <Steps steps={steps1} {current} vertical radius="none" />
  53500. </div>
  53501. <Divider px="8" />
  53502. <div class="flex justify-around">
  53503. <Steps steps={steps1} {current} vertical radius="xl" />
  53504. <Steps steps={steps1} {current} vertical radius="full" />
  53505. </div>
  53506. <div class="mb-4 mt-8 px-4 text-lg font-bold">Tape description information</div>
  53507. <Steps steps={steps4} {current} vertical />
  53508. <Divider px="8" />
  53509. <Steps steps={steps5} {current} vertical />
  53510. <div class="mb-4 mt-8 px-4 text-lg font-bold">Tape completion step</div>
  53511. <Steps steps={steps6} {current} vertical />
  53512. <div class="mb-4 mt-8 px-4 text-lg font-bold">The step bar area uses text</div>
  53513. <Steps steps={steps7} {current} vertical />
  53514. <div class="mb-4 mt-8 px-4 text-lg font-bold">Use images for the step bar area</div>
  53515. <div class="flex justify-around">
  53516. <Steps steps={steps8} {current} vertical />
  53517. <Steps steps={steps8} {current} radius="full" vertical />
  53518. </div>
  53519. <div class="mb-4 mt-8 px-4 text-lg font-bold">The content area injects elements</div>
  53520. <Steps steps={steps9} {current} vertical />
  53521. <div class="sticky bottom-0 z-10 flex bg-white/50 backdrop-blur-sm dark:bg-black/50">
  53522. <div class="flex-1">
  53523. <Button fill="lineTheme" disabled={current === 1} onclick={() => current > 1 && current--}>Previous step</Button>
  53524. </div>
  53525. <div class="flex-1">
  53526. <Button fill="lineTheme" disabled={current === steps.length} onclick={() => current < steps.length + 1 && current++}>Next step</Button>
  53527. </div>
  53528. </div>
  53529. <!-- injCom1.svelte -->
  53530. <!--
  53531. <div class="text-primary dark:text-dark text-sm">
  53532. <div>Here you inject a picture as a component</div>
  53533. <div class="rounded-full overflow-hidden h-20 w-20">
  53534. <img src="/assets/images/avatar_1.jpg" alt="" />
  53535. </div>
  53536. </div>
  53537. -->
  53538. <!-- injCom2.svelte -->
  53539. <!--
  53540. <script lang="ts">
  53541. import { Button, Icon, Avatar } from '$lib/index.js';
  53542. </script>
  53543. <div class="text-primary dark:text-dark text-sm">Here you inject something in the form of a component</div>
  53544. <div class="flex items-center space-x-4">
  53545. <Button size="full" heightIn="2" injClass="px-4">button</Button>
  53546. <Avatar image="/assets/images/avatar_1.jpg" size="sm" />
  53547. <Icon name="ri-money-cny-circle-line" theme />
  53548. <Icon name="ri-fingerprint-line" theme />
  53549. </div>
  53550. -->
  53551. ================================================
  53552. FILE: packages/stdf/src/routes/steps/en_US/injCom1_en.svelte
  53553. ================================================
  53554. <div class="text-primary dark:text-dark text-sm">
  53555. <div>Here you inject a picture as a component</div>
  53556. <div class="rounded-full overflow-hidden h-20 w-20">
  53557. <img src="/assets/images/avatar_1.jpg" alt="" />
  53558. </div>
  53559. </div>
  53560. ================================================
  53561. FILE: packages/stdf/src/routes/steps/en_US/injCom2_en.svelte
  53562. ================================================
  53563. <script lang="ts">
  53564. import { Button, Icon, Avatar } from '$lib/index.js';
  53565. </script>
  53566. <div class="text-sm text-primary dark:text-dark">Here you inject something in the form of a component</div>
  53567. <div class="flex items-center space-x-4">
  53568. <Button size="full" heightIn="2" injClass="px-4">button</Button>
  53569. <Avatar image="/assets/images/avatar_1.jpg" size="sm" />
  53570. <Icon name="ri-money-cny-circle-line" theme />
  53571. <Icon name="ri-fingerprint-line" theme />
  53572. </div>
  53573. ================================================
  53574. FILE: packages/stdf/src/routes/steps/zh_CN/+page.svelte
  53575. ================================================
  53576. <!--Steps Demo -->
  53577. <script lang="ts">
  53578. import { Steps, Button, Divider } from '$lib/index.js';
  53579. import type { StepsItemProps } from '$lib/types/index.js';
  53580. import injCom1 from './injCom1.svelte';
  53581. import injCom2 from './injCom2.svelte';
  53582. const steps: StepsItemProps[] = [
  53583. { step: { title: '起床' } },
  53584. { step: { title: '吃饭' } },
  53585. { step: { title: '喝水' } },
  53586. { step: { title: '打豆豆' } },
  53587. { step: { title: '睡觉' } }
  53588. ];
  53589. const steps1: StepsItemProps[] = [
  53590. { step: { title: '起床', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53591. { step: { title: '吃饭', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53592. { step: { title: '喝水', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53593. { step: { title: '打豆豆', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } } },
  53594. { step: { title: '睡觉', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53595. ];
  53596. const steps2: StepsItemProps[] = [
  53597. { step: { title: '起床' }, finishStep: { title: '已起床' } },
  53598. { step: { title: '吃饭' }, finishStep: { title: '吃饱了' } },
  53599. { step: { title: '喝水' }, finishStep: { title: '喝足了' } },
  53600. { step: { title: '打豆豆' }, finishStep: { title: '打爽了' } },
  53601. { step: { title: '睡觉' }, finishStep: { title: '睡着了' } }
  53602. ];
  53603. const steps3: StepsItemProps[] = [
  53604. {
  53605. step: { title: '起床', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } },
  53606. finishStep: { title: '已起床', bar: { type: 'icon', content: { name: 'ri-hotel-bed-fill' } } }
  53607. },
  53608. {
  53609. step: { title: '吃饭', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } },
  53610. finishStep: { title: '吃饱了', bar: { type: 'icon', content: { name: 'ri-restaurant-2-fill' } } }
  53611. },
  53612. {
  53613. step: { title: '喝水', bar: { type: 'icon', content: { name: 'ri-cup-line' } } },
  53614. finishStep: { title: '喝足了', bar: { type: 'icon', content: { name: 'ri-cup-fill' } } }
  53615. },
  53616. {
  53617. step: { title: '打豆豆', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } },
  53618. finishStep: { title: '打爽了', bar: { type: 'icon', content: { name: 'ri-emotion-sad-fill' } } }
  53619. },
  53620. {
  53621. step: { title: '睡觉', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } },
  53622. finishStep: { title: '睡着了', bar: { type: 'icon', content: { name: 'ri-zzz-fill' } } }
  53623. }
  53624. ];
  53625. const steps4: StepsItemProps[] = [
  53626. { step: { title: '起床', desc: '起床搬砖了!' } },
  53627. { step: { title: '吃饭', desc: '吃吃吃,肥死你。' } },
  53628. { step: { title: '喝水', desc: '慢慢走路,多多喝水。' } },
  53629. {
  53630. step: {
  53631. title: '打豆豆',
  53632. desc: '吃饭睡觉,打豆豆很爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽。顺便验证进度条高度自适应步骤文字高度。'
  53633. }
  53634. },
  53635. { step: { title: '睡觉', desc: '吃太饱,睡不着。' } }
  53636. ];
  53637. const steps5: StepsItemProps[] = [
  53638. { step: { title: '起床', desc: '起床搬砖了!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53639. { step: { title: '吃饭', desc: '吃吃吃,肥死你。', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53640. { step: { title: '喝水', desc: '慢慢走路,多多喝水。', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53641. {
  53642. step: {
  53643. title: '打豆豆',
  53644. desc: '吃饭睡觉,打豆豆很爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽爽。顺便验证进度条高度自适应步骤文字高度。',
  53645. bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } }
  53646. }
  53647. },
  53648. { step: { title: '睡觉', desc: '吃太饱,睡不着。', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53649. ];
  53650. const steps6: StepsItemProps[] = [
  53651. {
  53652. step: { title: '起床', desc: '起床搬砖了!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } },
  53653. finishStep: { title: '已起床', desc: '砖已经搬完了!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-fill' } } }
  53654. },
  53655. {
  53656. step: { title: '吃饭', desc: '吃吃吃,肥死你。', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } },
  53657. finishStep: { title: '吃饱了', desc: '饭已经全部被吃完了!', bar: { type: 'icon', content: { name: 'ri-restaurant-2-fill' } } }
  53658. },
  53659. {
  53660. step: { title: '喝水', desc: '慢慢走路,多多喝水。', bar: { type: 'icon', content: { name: 'ri-cup-line' } } },
  53661. finishStep: { title: '喝足了', desc: '水喝太多,从眼睛里溢出来了!', bar: { type: 'icon', content: { name: 'ri-cup-fill' } } }
  53662. },
  53663. {
  53664. step: { title: '打豆豆', desc: '吃饭睡觉,打豆豆。', bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } } },
  53665. finishStep: { title: '打爽了', desc: '豆豆已经被打趴下了。', bar: { type: 'icon', content: { name: 'ri-emotion-sad-fill' } } }
  53666. },
  53667. {
  53668. step: { title: '睡觉', desc: '吃太饱,睡不着。', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } },
  53669. finishStep: { title: '睡着了', desc: '睡着了正在做梦呢!', bar: { type: 'icon', content: { name: 'ri-zzz-fill' } } }
  53670. }
  53671. ];
  53672. const steps7: StepsItemProps[] = [
  53673. { step: { title: '起床', desc: '起床搬砖了!', bar: { type: 'string', content: '1' } } },
  53674. { step: { title: '吃饭', desc: '吃吃吃,肥死你。', bar: { type: 'string', content: '吃' } } },
  53675. { step: { title: '喝水', desc: '慢慢走路,多多喝水。', bar: { type: 'string', content: '3' } } },
  53676. { step: { title: '打豆豆', desc: '吃饭睡觉,打豆豆。', bar: { type: 'string', content: '5' } } },
  53677. { step: { title: '睡觉', desc: '吃太饱,睡不着。', bar: { type: 'string', content: '😴' } } }
  53678. ];
  53679. const steps8: StepsItemProps[] = [
  53680. { step: { title: '起床', bar: { type: 'image', content: '/assets/images/avatar_2.png' } } },
  53681. { step: { title: '吃饭', bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } } } },
  53682. { step: { title: '喝水', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53683. { step: { title: '打豆豆', bar: { type: 'image', content: '/assets/images/avatar_1.jpg' } } },
  53684. { step: { title: '睡觉', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53685. ];
  53686. const steps9: StepsItemProps[] = [
  53687. { step: { title: '起床', desc: '起床搬砖了!', bar: { type: 'icon', content: { name: 'ri-hotel-bed-line' } } } },
  53688. {
  53689. step: {
  53690. title: '吃饭',
  53691. desc: '吃吃吃,肥死你。',
  53692. bar: { type: 'icon', content: { name: 'ri-restaurant-2-line' } },
  53693. injComponent: injCom1
  53694. }
  53695. },
  53696. { step: { title: '喝水', desc: '慢慢走路,多多喝水。', bar: { type: 'icon', content: { name: 'ri-cup-line' } } } },
  53697. {
  53698. step: {
  53699. title: '打豆豆',
  53700. desc: '吃饭睡觉,打豆豆。',
  53701. bar: { type: 'icon', content: { name: 'ri-emotion-sad-line' } },
  53702. injComponent: injCom2
  53703. }
  53704. },
  53705. { step: { title: '睡觉', desc: '吃太饱,睡不着。', bar: { type: 'icon', content: { name: 'ri-zzz-line' } } } }
  53706. ];
  53707. let current = $state(1);
  53708. </script>
  53709. <div class="mb-4 mt-8 px-4 text-2xl font-bold">横向排列</div>
  53710. <div class="mb-4 mt-8 px-4 text-lg font-bold">简单用法</div>
  53711. <Steps {steps} {current} />
  53712. <div class="mb-4 mt-8 px-4 text-lg font-bold">不同圆角</div>
  53713. <Steps {steps} {current} radius="none" />
  53714. <Steps {steps} {current} radius="full" />
  53715. <div class="mb-4 mt-8 px-4 text-lg font-bold">带图标</div>
  53716. <Steps steps={steps1} {current} />
  53717. <div class="mb-4 mt-8 px-4 text-lg font-bold">图标不同边框</div>
  53718. <Steps steps={steps1} {current} barBorder={false} />
  53719. <Steps steps={steps1} {current} barBorder={false} radius="full" />
  53720. <Steps steps={steps1} {current} radius="none" />
  53721. <Steps steps={steps1} {current} radius="xl" />
  53722. <Steps steps={steps1} {current} radius="full" />
  53723. <div class="mb-4 mt-8 px-4 text-lg font-bold">带完成步骤</div>
  53724. <Steps steps={steps2} {current} />
  53725. <div class="mb-4 mt-8 px-4 text-lg font-bold">带图标 && 完成步骤</div>
  53726. <Steps steps={steps3} {current} />
  53727. <div class="mb-4 mt-8 px-4 text-lg font-bold">步骤栏区域使用文字</div>
  53728. <Steps steps={steps7} {current} />
  53729. <div class="mb-4 mt-8 px-4 text-lg font-bold">步骤栏区域使用图片</div>
  53730. <Steps steps={steps8} {current} />
  53731. <Steps steps={steps8} radius="full" {current} />
  53732. <Divider />
  53733. <div class="mb-4 mt-4 px-4 text-2xl font-bold">纵向排列</div>
  53734. <div class="mb-4 mt-8 px-4 text-lg font-bold">不同圆角</div>
  53735. <div class="flex justify-around">
  53736. <Steps {steps} {current} vertical />
  53737. <Steps {steps} {current} radius="none" vertical />
  53738. <Steps {steps} {current} radius="full" vertical />
  53739. </div>
  53740. <div class="mb-4 mt-8 px-4 text-lg font-bold">图标不同边框</div>
  53741. <div class="flex justify-around">
  53742. <Steps steps={steps1} {current} vertical />
  53743. <Steps steps={steps1} {current} vertical radius="full" barBorder={false} />
  53744. </div>
  53745. <Divider px="8" />
  53746. <div class="flex justify-around">
  53747. <Steps steps={steps1} {current} vertical barBorder={false} radius="none" />
  53748. <Steps steps={steps1} {current} vertical radius="none" />
  53749. </div>
  53750. <Divider px="8" />
  53751. <div class="flex justify-around">
  53752. <Steps steps={steps1} {current} vertical radius="xl" />
  53753. <Steps steps={steps1} {current} vertical radius="full" />
  53754. </div>
  53755. <div class="mb-4 mt-8 px-4 text-lg font-bold">带描述信息</div>
  53756. <Steps steps={steps4} {current} vertical />
  53757. <Divider px="8" />
  53758. <Steps steps={steps5} {current} vertical />
  53759. <div class="mb-4 mt-8 px-4 text-lg font-bold">带完成步骤</div>
  53760. <Steps steps={steps6} {current} vertical />
  53761. <div class="mb-4 mt-8 px-4 text-lg font-bold">步骤栏区域使用文字</div>
  53762. <Steps steps={steps7} {current} vertical />
  53763. <div class="mb-4 mt-8 px-4 text-lg font-bold">步骤栏区域使用图片</div>
  53764. <div class="flex justify-around">
  53765. <Steps steps={steps8} {current} vertical />
  53766. <Steps steps={steps8} {current} radius="full" vertical />
  53767. </div>
  53768. <div class="mb-4 mt-8 px-4 text-lg font-bold">内容区域注入元素</div>
  53769. <Steps steps={steps9} {current} vertical />
  53770. <div class="sticky bottom-0 z-10 flex bg-white/50 backdrop-blur-sm dark:bg-black/50">
  53771. <div class="flex-1">
  53772. <Button fill="lineTheme" disabled={current === 1} onclick={() => current > 1 && current--}>上一步</Button>
  53773. </div>
  53774. <div class="flex-1">
  53775. <Button fill="lineTheme" disabled={current === steps.length} onclick={() => current < steps.length + 1 && current++}>下一步</Button>
  53776. </div>
  53777. </div>
  53778. <!-- injCom1.svelte -->
  53779. <!-- <div class="text-primary dark:text-dark text-sm">
  53780. <div>此处以组件形式注入一张图片</div>
  53781. <div class="rounded-full overflow-hidden h-20 w-20">
  53782. <img src="/assets/images/avatar_1.jpg" alt="" />
  53783. </div>
  53784. </div> -->
  53785. <!-- injCom2.svelte -->
  53786. <!-- <script lang=""ts>
  53787. import { Button, Icon, Avatar } from '$lib/index.js';
  53788. </script>
  53789. <div class="text-primary dark:text-dark text-sm">此处以组件形式注入一些内容</div>
  53790. <div class="flex items-center space-x-4">
  53791. <Button size="full" heightIn="2" injClass="px-4">按钮</Button>
  53792. <Avatar image="/assets/images/avatar_1.jpg" size="sm" />
  53793. <Icon name="ri-money-cny-circle-line" theme />
  53794. <Icon name="ri-fingerprint-line" theme />
  53795. </div> -->
  53796. ================================================
  53797. FILE: packages/stdf/src/routes/steps/zh_CN/injCom1.svelte
  53798. ================================================
  53799. <div class="text-primary dark:text-dark text-sm">
  53800. <div>此处以组件形式注入一张图片</div>
  53801. <div class="rounded-full overflow-hidden h-20 w-20">
  53802. <img src="/assets/images/avatar_1.jpg" alt="" />
  53803. </div>
  53804. </div>
  53805. ================================================
  53806. FILE: packages/stdf/src/routes/steps/zh_CN/injCom2.svelte
  53807. ================================================
  53808. <script lang="ts">
  53809. import { Button, Icon, Avatar } from '$lib/index.js';
  53810. </script>
  53811. <div class="text-sm text-primary dark:text-dark">此处以组件形式注入一些内容</div>
  53812. <div class="flex items-center space-x-4">
  53813. <Button size="full" heightIn="2" injClass="px-4">按钮</Button>
  53814. <Avatar image="/assets/images/avatar_1.jpg" size="sm" />
  53815. <Icon name="ri-money-cny-circle-line" theme />
  53816. <Icon name="ri-fingerprint-line" theme />
  53817. </div>
  53818. ================================================
  53819. FILE: packages/stdf/src/routes/swiper/en_US/+page.svelte
  53820. ================================================
  53821. <!-- Swiper Demo -->
  53822. <script lang="ts">
  53823. import { Swiper } from '$lib/index.js';
  53824. import type { SwiperImgProps } from '$lib/types/index.js';
  53825. import Item from './Item_en.svelte';
  53826. const data: SwiperImgProps[] = [
  53827. { type: 'img', url: '/assets/images/wall_1.jpg' },
  53828. { type: 'img', url: '/assets/images/wall_2.jpg' },
  53829. { type: 'img', url: '/assets/images/wall_3.jpg' },
  53830. { type: 'img', url: '/assets/images/wall_4.jpg' }
  53831. ];
  53832. let indexClick = $state(-1);
  53833. let indexChange = $state(0);
  53834. </script>
  53835. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Basic Usage</div>
  53836. <Swiper {data} />
  53837. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Initial Index 2</div>
  53838. <Swiper {data} initActive={2} />
  53839. <div class="mx-4 mb-2 mt-10 text-lg font-bold">8s Interval</div>
  53840. <Swiper {data} interval={8} />
  53841. <div class="mx-4 mb-2 mt-10 text-lg font-bold">1500ms Duration</div>
  53842. <Swiper {data} duration={1500} />
  53843. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Disable Autoplay</div>
  53844. <Swiper {data} autoplay={false} />
  53845. <div class="mx-4 mb-2 mt-10 text-lg font-bold">External Indicator</div>
  53846. <Swiper {data} indicatePosition="out" />
  53847. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Hide Indicator</div>
  53848. <Swiper {data} indicatePosition={null} />
  53849. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Right Aligned Indicator</div>
  53850. <Swiper {data} indicateAlign="right" />
  53851. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Dot Indicator</div>
  53852. <Swiper {data} indicateStyle="point" />
  53853. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Line Indicator</div>
  53854. <Swiper {data} indicateStyle="line" />
  53855. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Long Line Indicator</div>
  53856. <Swiper {data} indicateStyle="longLine" interval={8} />
  53857. <div class="mt-10"></div>
  53858. <Swiper {data} indicateStyle="longLine" interval={8} indicatePosition="out" />
  53859. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Square Indicator</div>
  53860. <Swiper {data} indicateRadius={false} />
  53861. <div class="mt-10"></div>
  53862. <Swiper {data} indicateStyle="point" indicateRadius={false} />
  53863. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  53864. Custom Indicator Background
  53865. <p class="mb-2 text-xs font-thin">Inject Class</p>
  53866. </div>
  53867. <Swiper {data} indicateInjClass="from-black/0 to-extend0/50" />
  53868. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  53869. Custom Indicator Color
  53870. <p class="mb-2 text-xs font-thin">Remove Background</p>
  53871. </div>
  53872. <Swiper {data} indicateInjClass="bg-none" indicateColor="bg-extend2" indicateActiveColor="bg-extend1" />
  53873. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Custom Aspect Ratio</div>
  53874. <Swiper {data} aspectRatio={[4, 1]} />
  53875. <div class="mx-4 mt-10 text-lg font-bold">
  53876. Container Padding
  53877. <p class="mb-2 text-xs font-thin">With Custom Colors and Radius</p>
  53878. </div>
  53879. <Swiper
  53880. {data}
  53881. px="6"
  53882. py="6"
  53883. indicateInjClass="bg-none"
  53884. indicateColor="bg-black/5 dark:bg-white/10"
  53885. indicateActiveColor="bg-primary dark:bg-dark"
  53886. radius="xl"
  53887. interval={8}
  53888. indicateStyle="longLine"
  53889. />
  53890. <div class="mt-10"></div>
  53891. <Swiper
  53892. {data}
  53893. px="6"
  53894. py="6"
  53895. indicateInjClass="bg-none"
  53896. indicateColor="bg-primary dark:bg-dark"
  53897. indicateActiveColor="bg-primary dark:bg-dark"
  53898. radius="full"
  53899. aspectRatio={[3, 1]}
  53900. />
  53901. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  53902. Inner Shadow
  53903. <p class="mb-2 text-xs font-normal">Inject Class</p>
  53904. </div>
  53905. <Swiper
  53906. {data}
  53907. px="6"
  53908. py="6"
  53909. indicateInjClass="bg-none"
  53910. indicateColor="bg-primary dark:bg-dark"
  53911. indicateActiveColor="bg-primary dark:bg-dark"
  53912. radius="full"
  53913. aspectRatio={[3, 1]}
  53914. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53915. />
  53916. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Inactive Item X, Z Translation</div>
  53917. <Swiper
  53918. {data}
  53919. px="16"
  53920. py="6"
  53921. indicateInjClass="bg-none"
  53922. indicateColor="bg-primary dark:bg-dark"
  53923. indicateActiveColor="bg-primary dark:bg-dark"
  53924. radius="xl"
  53925. aspectRatio={[3, 1]}
  53926. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53927. translateX={100}
  53928. />
  53929. <div class="mt-10"></div>
  53930. <Swiper
  53931. {data}
  53932. px="4"
  53933. py="8"
  53934. indicateInjClass="bg-none"
  53935. indicateColor="bg-primary dark:bg-dark"
  53936. indicateActiveColor="bg-primary dark:bg-dark"
  53937. radius="xl"
  53938. translateZ={400}
  53939. translateX={-200}
  53940. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53941. />
  53942. <div class="mt-10"></div>
  53943. <Swiper
  53944. {data}
  53945. px="12"
  53946. py="8"
  53947. indicateInjClass="bg-none"
  53948. indicateColor="bg-primary dark:bg-dark"
  53949. indicateActiveColor="bg-primary dark:bg-dark"
  53950. radius="xl"
  53951. translateZ={600}
  53952. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53953. />
  53954. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Inactive Item X, Y, Z Rotation</div>
  53955. <Swiper
  53956. {data}
  53957. px="4"
  53958. py="8"
  53959. indicateInjClass="bg-none"
  53960. indicateColor="bg-primary dark:bg-dark"
  53961. indicateActiveColor="bg-primary dark:bg-dark"
  53962. radius="xl"
  53963. rotateX={90}
  53964. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53965. duration={2000}
  53966. />
  53967. <div class="mt-10"></div>
  53968. <Swiper
  53969. {data}
  53970. px="4"
  53971. py="8"
  53972. indicateInjClass="bg-none"
  53973. indicateColor="bg-primary dark:bg-dark"
  53974. indicateActiveColor="bg-primary dark:bg-dark"
  53975. radius="xl"
  53976. rotateY={90}
  53977. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53978. duration={2000}
  53979. />
  53980. <div class="mt-10"></div>
  53981. <Swiper
  53982. {data}
  53983. px="4"
  53984. py="8"
  53985. indicateInjClass="bg-none"
  53986. indicateColor="bg-primary dark:bg-dark"
  53987. indicateActiveColor="bg-primary dark:bg-dark"
  53988. radius="xl"
  53989. rotateZ={90}
  53990. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  53991. duration={2000}
  53992. />
  53993. <div class="mt-10"></div>
  53994. <Swiper
  53995. {data}
  53996. px="4"
  53997. py="8"
  53998. indicateInjClass="bg-none"
  53999. indicateColor="bg-primary dark:bg-dark"
  54000. indicateActiveColor="bg-primary dark:bg-dark"
  54001. radius="xl"
  54002. rotateX={90}
  54003. rotateY={90}
  54004. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54005. duration={2000}
  54006. />
  54007. <div class="mt-10"></div>
  54008. <Swiper
  54009. {data}
  54010. px="4"
  54011. py="8"
  54012. indicateInjClass="bg-none"
  54013. indicateColor="bg-primary dark:bg-dark"
  54014. indicateActiveColor="bg-primary dark:bg-dark"
  54015. radius="xl"
  54016. rotateX={90}
  54017. rotateZ={90}
  54018. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54019. duration={2000}
  54020. />
  54021. <div class="mt-10"></div>
  54022. <Swiper
  54023. {data}
  54024. px="4"
  54025. py="8"
  54026. indicateInjClass="bg-none"
  54027. indicateColor="bg-primary dark:bg-dark"
  54028. indicateActiveColor="bg-primary dark:bg-dark"
  54029. radius="xl"
  54030. rotateY={90}
  54031. rotateZ={90}
  54032. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54033. duration={2000}
  54034. />
  54035. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Custom Inactive Item Style</div>
  54036. <Swiper
  54037. {data}
  54038. px="24"
  54039. py="6"
  54040. indicateInjClass="bg-none"
  54041. indicateColor="bg-primary dark:bg-dark"
  54042. indicateActiveColor="bg-primary dark:bg-dark"
  54043. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54044. radius="xl"
  54045. aspectRatio={[3, 1]}
  54046. translateX={160}
  54047. duration={2000}
  54048. notActiveInjClass="grayscale"
  54049. />
  54050. <div class="mt-10"></div>
  54051. <Swiper
  54052. {data}
  54053. px="24"
  54054. py="6"
  54055. indicateInjClass="bg-none"
  54056. indicateColor="bg-primary dark:bg-dark"
  54057. indicateActiveColor="bg-primary dark:bg-dark"
  54058. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54059. radius="xl"
  54060. aspectRatio={[3, 1]}
  54061. translateX={160}
  54062. duration={2000}
  54063. notActiveInjClass="blur"
  54064. />
  54065. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Custom Container Width</div>
  54066. <div class="flex justify-center">
  54067. <Swiper {data} containerWidth={(document.body.clientWidth / 4) * 3} />
  54068. </div>
  54069. <div class="mx-4 mb-2 mt-10 text-lg font-bold">Component as Content</div>
  54070. <Swiper
  54071. data={[
  54072. { type: 'component', component: Item },
  54073. { type: 'img', url: '/assets/images/wall_1.jpg' }
  54074. ]}
  54075. />
  54076. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54077. onchange Event
  54078. <p class=" mb-2 text-xs font-normal">Current Index: {indexChange}</p>
  54079. </div>
  54080. <Swiper {data} onchange={(current) => (indexChange = current)} />
  54081. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54082. onclick Event
  54083. <p class="mb-2 text-xs font-normal">Clicked Index: {indexClick === -1 ? 'None' : indexClick}</p>
  54084. </div>
  54085. <Swiper {data} onclick={(current) => (indexClick = current)} />
  54086. <!-- Item_en.svelte -->
  54087. <!--
  54088. <script lang="ts">
  54089. import { Button, Avatar } from 'stdf';
  54090. </script>
  54091. <div class="flex flex-col space-y-4 items-center">
  54092. <div class="text-center">This container uses a single component as its content</div>
  54093. <div><Avatar /></div>
  54094. <div class="w-full"><Button>button</Button></div>
  54095. </div>
  54096. -->
  54097. ================================================
  54098. FILE: packages/stdf/src/routes/swiper/en_US/Item_en.svelte
  54099. ================================================
  54100. <script lang="ts">
  54101. import { Button, Avatar } from '$lib/index.js';
  54102. </script>
  54103. <div class="flex flex-col items-center space-y-4">
  54104. <div class="text-center">This container uses a single component as its content</div>
  54105. <div><Avatar /></div>
  54106. <div class="w-full"><Button>button</Button></div>
  54107. </div>
  54108. ================================================
  54109. FILE: packages/stdf/src/routes/swiper/zh_CN/+page.svelte
  54110. ================================================
  54111. <!-- Swiper Demo -->
  54112. <script lang="ts">
  54113. import { Swiper } from '$lib/index.js';
  54114. import type { SwiperImgProps } from '$lib/types/index.js';
  54115. import Item from './Item.svelte';
  54116. const data: SwiperImgProps[] = [
  54117. { type: 'img', url: '/assets/images/wall_1.jpg' },
  54118. { type: 'img', url: '/assets/images/wall_2.jpg' },
  54119. { type: 'img', url: '/assets/images/wall_3.jpg' },
  54120. { type: 'img', url: '/assets/images/wall_4.jpg' }
  54121. ];
  54122. let indexClick = $state(-1);
  54123. let indexChange = $state(0);
  54124. </script>
  54125. <div class="mx-4 mb-2 mt-10 text-lg font-bold">基础用法</div>
  54126. <Swiper {data} />
  54127. <div class="mx-4 mb-2 mt-10 text-lg font-bold">初始索引为 2</div>
  54128. <Swiper {data} initActive={2} />
  54129. <div class="mx-4 mb-2 mt-10 text-lg font-bold">间隔 8 秒</div>
  54130. <Swiper {data} interval={8} />
  54131. <div class="mx-4 mb-2 mt-10 text-lg font-bold">过渡 1500 毫秒</div>
  54132. <Swiper {data} duration={1500} />
  54133. <div class="mx-4 mb-2 mt-10 text-lg font-bold">关闭自动播放</div>
  54134. <Swiper {data} autoplay={false} />
  54135. <div class="mx-4 mb-2 mt-10 text-lg font-bold">外部指示器</div>
  54136. <Swiper {data} indicatePosition="out" />
  54137. <div class="mx-4 mb-2 mt-10 text-lg font-bold">关闭指示器</div>
  54138. <Swiper {data} indicatePosition={null} />
  54139. <div class="mx-4 mb-2 mt-10 text-lg font-bold">指示器右对齐</div>
  54140. <Swiper {data} indicateAlign="right" />
  54141. <div class="mx-4 mb-2 mt-10 text-lg font-bold">圆点指示器</div>
  54142. <Swiper {data} indicateStyle="point" />
  54143. <div class="mx-4 mb-2 mt-10 text-lg font-bold">线性指示器</div>
  54144. <Swiper {data} indicateStyle="line" />
  54145. <div class="mx-4 mb-2 mt-10 text-lg font-bold">长线指示器</div>
  54146. <Swiper {data} indicateStyle="longLine" interval={8} />
  54147. <div class="mt-10"></div>
  54148. <Swiper {data} indicateStyle="longLine" interval={8} indicatePosition="out" />
  54149. <div class="mx-4 mb-2 mt-10 text-lg font-bold">方形指示器</div>
  54150. <Swiper {data} indicateRadius={false} />
  54151. <div class="mt-10"></div>
  54152. <Swiper {data} indicateStyle="point" indicateRadius={false} />
  54153. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54154. 指定指示器背景色
  54155. <p class="mb-2 text-xs font-thin">注入 Class</p>
  54156. </div>
  54157. <Swiper {data} indicateInjClass="from-black/0 to-extend0/50" />
  54158. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54159. 指定指示器颜色
  54160. <p class="mb-2 text-xs font-thin">同时去除背景色</p>
  54161. </div>
  54162. <Swiper {data} indicateInjClass="bg-none" indicateColor="bg-extend2" indicateActiveColor="bg-extend1" />
  54163. <div class="mx-4 mb-2 mt-10 text-lg font-bold">指定容器宽高比</div>
  54164. <Swiper {data} aspectRatio={[4, 1]} />
  54165. <div class="mx-4 mt-10 text-lg font-bold">
  54166. 配置容器内边距
  54167. <p class="mb-2 text-xs font-thin">同时指定指示器颜色、去除指示器背景色、配置容器内部圆角</p>
  54168. </div>
  54169. <Swiper
  54170. {data}
  54171. px="6"
  54172. py="6"
  54173. indicateInjClass="bg-none"
  54174. indicateColor="bg-black/5 dark:bg-white/10"
  54175. indicateActiveColor="bg-primary dark:bg-dark"
  54176. radius="xl"
  54177. interval={8}
  54178. indicateStyle="longLine"
  54179. />
  54180. <div class="mt-10"></div>
  54181. <Swiper
  54182. {data}
  54183. px="6"
  54184. py="6"
  54185. indicateInjClass="bg-none"
  54186. indicateColor="bg-primary dark:bg-dark"
  54187. indicateActiveColor="bg-primary dark:bg-dark"
  54188. radius="full"
  54189. aspectRatio={[3, 1]}
  54190. />
  54191. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54192. 容器内部增加投影
  54193. <p class="mb-2 text-xs font-normal">注入 Class</p>
  54194. </div>
  54195. <Swiper
  54196. {data}
  54197. px="6"
  54198. py="6"
  54199. indicateInjClass="bg-none"
  54200. indicateColor="bg-primary dark:bg-dark"
  54201. indicateActiveColor="bg-primary dark:bg-dark"
  54202. radius="full"
  54203. aspectRatio={[3, 1]}
  54204. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54205. />
  54206. <div class="mx-4 mb-2 mt-10 text-lg font-bold">未激活容器 X、Z 轴偏移</div>
  54207. <Swiper
  54208. {data}
  54209. px="16"
  54210. py="6"
  54211. indicateInjClass="bg-none"
  54212. indicateColor="bg-primary dark:bg-dark"
  54213. indicateActiveColor="bg-primary dark:bg-dark"
  54214. radius="xl"
  54215. aspectRatio={[3, 1]}
  54216. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54217. translateX={100}
  54218. />
  54219. <div class="mt-10"></div>
  54220. <Swiper
  54221. {data}
  54222. px="4"
  54223. py="8"
  54224. indicateInjClass="bg-none"
  54225. indicateColor="bg-primary dark:bg-dark"
  54226. indicateActiveColor="bg-primary dark:bg-dark"
  54227. radius="xl"
  54228. translateZ={400}
  54229. translateX={-200}
  54230. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54231. />
  54232. <div class="mt-10"></div>
  54233. <Swiper
  54234. {data}
  54235. px="12"
  54236. py="8"
  54237. indicateInjClass="bg-none"
  54238. indicateColor="bg-primary dark:bg-dark"
  54239. indicateActiveColor="bg-primary dark:bg-dark"
  54240. radius="xl"
  54241. translateZ={600}
  54242. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54243. />
  54244. <div class="mx-4 mb-2 mt-10 text-lg font-bold">未激活容器 X、Y、Z 轴旋转</div>
  54245. <Swiper
  54246. {data}
  54247. px="4"
  54248. py="8"
  54249. indicateInjClass="bg-none"
  54250. indicateColor="bg-primary dark:bg-dark"
  54251. indicateActiveColor="bg-primary dark:bg-dark"
  54252. radius="xl"
  54253. rotateX={90}
  54254. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54255. duration={2000}
  54256. />
  54257. <div class="mt-10"></div>
  54258. <Swiper
  54259. {data}
  54260. px="4"
  54261. py="8"
  54262. indicateInjClass="bg-none"
  54263. indicateColor="bg-primary dark:bg-dark"
  54264. indicateActiveColor="bg-primary dark:bg-dark"
  54265. radius="xl"
  54266. rotateY={90}
  54267. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54268. duration={2000}
  54269. />
  54270. <div class="mt-10"></div>
  54271. <Swiper
  54272. {data}
  54273. px="4"
  54274. py="8"
  54275. indicateInjClass="bg-none"
  54276. indicateColor="bg-primary dark:bg-dark"
  54277. indicateActiveColor="bg-primary dark:bg-dark"
  54278. radius="xl"
  54279. rotateZ={90}
  54280. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54281. duration={2000}
  54282. />
  54283. <div class="mt-10"></div>
  54284. <Swiper
  54285. {data}
  54286. px="4"
  54287. py="8"
  54288. indicateInjClass="bg-none"
  54289. indicateColor="bg-primary dark:bg-dark"
  54290. indicateActiveColor="bg-primary dark:bg-dark"
  54291. radius="xl"
  54292. rotateX={90}
  54293. rotateY={90}
  54294. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54295. duration={2000}
  54296. />
  54297. <div class="mt-10"></div>
  54298. <Swiper
  54299. {data}
  54300. px="4"
  54301. py="8"
  54302. indicateInjClass="bg-none"
  54303. indicateColor="bg-primary dark:bg-dark"
  54304. indicateActiveColor="bg-primary dark:bg-dark"
  54305. radius="xl"
  54306. rotateX={90}
  54307. rotateZ={90}
  54308. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54309. duration={2000}
  54310. />
  54311. <div class="mt-10"></div>
  54312. <Swiper
  54313. {data}
  54314. px="4"
  54315. py="8"
  54316. indicateInjClass="bg-none"
  54317. indicateColor="bg-primary dark:bg-dark"
  54318. indicateActiveColor="bg-primary dark:bg-dark"
  54319. radius="xl"
  54320. rotateY={90}
  54321. rotateZ={90}
  54322. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54323. duration={2000}
  54324. />
  54325. <div class="mx-4 mb-2 mt-10 text-lg font-bold">未激活容器注入 Class</div>
  54326. <Swiper
  54327. {data}
  54328. px="24"
  54329. py="6"
  54330. indicateInjClass="bg-none"
  54331. indicateColor="bg-primary dark:bg-dark"
  54332. indicateActiveColor="bg-primary dark:bg-dark"
  54333. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54334. radius="xl"
  54335. aspectRatio={[3, 1]}
  54336. translateX={160}
  54337. duration={2000}
  54338. notActiveInjClass="grayscale"
  54339. />
  54340. <div class="mt-10"></div>
  54341. <Swiper
  54342. {data}
  54343. px="24"
  54344. py="6"
  54345. indicateInjClass="bg-none"
  54346. indicateColor="bg-primary dark:bg-dark"
  54347. indicateActiveColor="bg-primary dark:bg-dark"
  54348. innerInjClass="shadow-md shadow-black/20 dark:shadow-white/20"
  54349. radius="xl"
  54350. aspectRatio={[3, 1]}
  54351. translateX={160}
  54352. duration={2000}
  54353. notActiveInjClass="blur"
  54354. />
  54355. <div class="mx-4 mb-2 mt-10 text-lg font-bold">指定容器宽度</div>
  54356. <div class="flex justify-center">
  54357. <Swiper {data} containerWidth={(document.body.clientWidth / 4) * 3} />
  54358. </div>
  54359. <div class="mx-4 mb-2 mt-10 text-lg font-bold">容器内容使用组件</div>
  54360. <Swiper
  54361. data={[
  54362. { type: 'component', component: Item },
  54363. { type: 'img', url: '/assets/images/wall_1.jpg' }
  54364. ]}
  54365. />
  54366. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54367. 监听 onchange 事件
  54368. <p class=" mb-2 text-xs font-normal">当前激活索引值:{indexChange}</p>
  54369. </div>
  54370. <Swiper {data} onchange={(current) => (indexChange = current)} />
  54371. <div class="mx-4 mb-2 mt-10 text-lg font-bold">
  54372. 监听 onclick 事件
  54373. <p class="mb-2 text-xs font-normal">点击索引值:{indexClick === -1 ? '未点击' : indexClick}</p>
  54374. </div>
  54375. <Swiper {data} onclick={(current) => (indexClick = current)} />
  54376. <!-- Item.svelte -->
  54377. <!--
  54378. <script lang=""ts>
  54379. import { Button, Avatar } from 'stdf';
  54380. </script>
  54381. <div class="flex flex-col space-y-4 items-center">
  54382. <div class="text-center">此容器使用单个组件作为内容</div>
  54383. <div><Avatar /></div>
  54384. <div class="w-full"><Button>按钮</Button></div>
  54385. </div>
  54386. -->
  54387. ================================================
  54388. FILE: packages/stdf/src/routes/swiper/zh_CN/Item.svelte
  54389. ================================================
  54390. <script lang="ts">
  54391. import { Button, Avatar } from '$lib/index.js';
  54392. </script>
  54393. <div class="flex flex-col items-center space-y-4">
  54394. <div class="text-center">此容器使用单个组件作为内容</div>
  54395. <div><Avatar /></div>
  54396. <div class="w-full"><Button>按钮</Button></div>
  54397. </div>
  54398. ================================================
  54399. FILE: packages/stdf/src/routes/switch/en_US/+page.svelte
  54400. ================================================
  54401. <!-- Switch Demo -->
  54402. <script lang="ts">
  54403. import { Switch, Icon, Cell, Dialog } from '$lib/index.js';
  54404. let checkAsync = $state(false);
  54405. const switchClickFun = () => {
  54406. setTimeout(() => {
  54407. checkAsync = !checkAsync;
  54408. }, 2000);
  54409. };
  54410. let cellCheck = $state(false);
  54411. const cellAsyncFun = () => {
  54412. setTimeout(() => {
  54413. cellCheck = !cellCheck;
  54414. }, 2000);
  54415. };
  54416. let loading = $state(false);
  54417. let loadingCheck = $state(false);
  54418. const loadingFun = () => {
  54419. loading = true;
  54420. setTimeout(() => {
  54421. loadingCheck = !loadingCheck;
  54422. loading = false;
  54423. }, 3000);
  54424. };
  54425. let cellLoading = $state(false);
  54426. let cellLoadingCheck = $state(false);
  54427. const cellLoadingFun = () => {
  54428. cellLoading = true;
  54429. setTimeout(() => {
  54430. cellLoadingCheck = !cellLoadingCheck;
  54431. cellLoading = false;
  54432. }, 3000);
  54433. };
  54434. let visible = $state(false);
  54435. let confirmswitchActive = $state(false);
  54436. </script>
  54437. <div class="pb-8">
  54438. <div class="flex flex-col space-y-8 px-4 py-8">
  54439. <div>
  54440. <div class="mb-4 font-bold">Different Radius</div>
  54441. <div class="flex justify-between">
  54442. <Switch />
  54443. <Switch radius="none" />
  54444. <Switch radius="full" />
  54445. </div>
  54446. </div>
  54447. <div>
  54448. <div class="mb-4 font-bold">Different Colors</div>
  54449. <div class="flex justify-between">
  54450. <Switch active injClass="bg-success dark:bg-success" />
  54451. <Switch active injClass="bg-error dark:bg-error" />
  54452. <Switch active injClass="bg-warning dark:bg-warning" />
  54453. <Switch active injClass="bg-[#DC88F5] dark:bg-[#FFCA28]" />
  54454. </div>
  54455. </div>
  54456. <div>
  54457. <div class="mb-4 font-bold">With Text / State / Icon</div>
  54458. <div class="flex justify-between">
  54459. <Switch inside={['OF', 'ON']} />
  54460. <Switch inside={['😭', '😄']} />
  54461. <Switch inside="state" />
  54462. <Switch>
  54463. {#snippet falseChild()}
  54464. <div>
  54465. <Icon name="ri-moon-line" size={16} top={-1} />
  54466. </div>
  54467. {/snippet}
  54468. {#snippet trueChild()}
  54469. <div>
  54470. <Icon name="ri-sun-line" size={16} top={-1} />
  54471. </div>
  54472. {/snippet}
  54473. </Switch>
  54474. </div>
  54475. </div>
  54476. <div>
  54477. <div class="mb-4 font-bold">Disabled</div>
  54478. <div class="flex justify-between">
  54479. <Switch disabled />
  54480. <Switch disabled active />
  54481. </div>
  54482. </div>
  54483. <div>
  54484. <div class="mb-4 font-bold">Async Control</div>
  54485. <div class="flex justify-between">
  54486. <div class="flex flex-col items-center space-y-2">
  54487. <Switch async active={checkAsync} onclick={switchClickFun} />
  54488. <div class="text-sm">Wait 2 seconds</div>
  54489. </div>
  54490. <div class="flex flex-col items-center space-y-2">
  54491. <Switch async active={loadingCheck} loading={{ theme: true }} onclick={loadingFun} inside={loading ? 'loading' : null} />
  54492. <div class="text-sm">Wait 3 seconds</div>
  54493. </div>
  54494. </div>
  54495. </div>
  54496. </div>
  54497. <div class="mb-4 px-4 font-bold">Used in Cell</div>
  54498. <Cell title="Switch" detail="Click anywhere in the row to trigger the switch" right={{ type: 'switch' }} />
  54499. <Cell title="Switch with Text" right={{ type: 'switch', switch: { inside: ['😭', '😄'] } }} switchActive />
  54500. <Cell title="Full Radius Switch" right={{ type: 'switch', switch: { radius: 'full' } }} />
  54501. <Cell
  54502. title="Async Control"
  54503. detail="Switch triggered 2 seconds after click"
  54504. right={{ type: 'switch', switch: { async: true } }}
  54505. switchActive={cellCheck}
  54506. onclick={cellAsyncFun}
  54507. />
  54508. <Cell
  54509. title="Async Loading"
  54510. detail="Switch triggered 3 seconds after click"
  54511. right={{ type: 'switch', switch: { async: true, inside: cellLoading ? 'loading' : null } }}
  54512. switchActive={cellLoadingCheck}
  54513. onclick={cellLoadingFun}
  54514. />
  54515. <Cell title="Disabled Switch" right={{ type: 'switch', switch: { disabled: true } }} switchActive />
  54516. <Cell
  54517. title="Double Confirmation"
  54518. right={{ type: 'switch', switch: { async: true } }}
  54519. bind:switchActive={confirmswitchActive}
  54520. onclick={() => (visible = true)}
  54521. />
  54522. <Dialog
  54523. bind:visible
  54524. content={`Are you sure you want to ${confirmswitchActive ? 'turn off' : 'turn on'}?`}
  54525. onprimary={() => {
  54526. visible = false;
  54527. confirmswitchActive = !confirmswitchActive;
  54528. }}
  54529. />
  54530. </div>
  54531. ================================================
  54532. FILE: packages/stdf/src/routes/switch/zh_CN/+page.svelte
  54533. ================================================
  54534. <!-- Switch Demo -->
  54535. <script lang="ts">
  54536. import { Switch, Icon, Cell, Dialog } from '$lib/index.js';
  54537. let checkAsync = $state(false);
  54538. const switchClickFun = () => {
  54539. setTimeout(() => {
  54540. checkAsync = !checkAsync;
  54541. }, 2000);
  54542. };
  54543. let cellCheck = $state(false);
  54544. const cellAsyncFun = () => {
  54545. setTimeout(() => {
  54546. cellCheck = !cellCheck;
  54547. }, 2000);
  54548. };
  54549. let loading = $state(false);
  54550. let loadingCheck = $state(false);
  54551. const loadingFun = () => {
  54552. loading = true;
  54553. setTimeout(() => {
  54554. loadingCheck = !loadingCheck;
  54555. loading = false;
  54556. }, 3000);
  54557. };
  54558. let cellLoading = $state(false);
  54559. let cellLoadingCheck = $state(false);
  54560. const cellLoadingFun = () => {
  54561. cellLoading = true;
  54562. setTimeout(() => {
  54563. cellLoadingCheck = !cellLoadingCheck;
  54564. cellLoading = false;
  54565. }, 3000);
  54566. };
  54567. let visible = $state(false);
  54568. let confirmswitchActive = $state(false);
  54569. </script>
  54570. <div class="pb-8">
  54571. <div class="flex flex-col space-y-8 px-4 py-8">
  54572. <div>
  54573. <div class="mb-4 font-bold">不同圆角</div>
  54574. <div class="flex justify-between">
  54575. <Switch />
  54576. <Switch radius="none" />
  54577. <Switch radius="full" />
  54578. </div>
  54579. </div>
  54580. <div>
  54581. <div class="mb-4 font-bold">不同颜色</div>
  54582. <div class="flex justify-between">
  54583. <Switch active injClass="bg-success dark:bg-success" />
  54584. <Switch active injClass="bg-error dark:bg-error" />
  54585. <Switch active injClass="bg-warning dark:bg-warning" />
  54586. <Switch active injClass="bg-[#DC88F5] dark:bg-[#FFCA28]" />
  54587. </div>
  54588. </div>
  54589. <div>
  54590. <div class="mb-4 font-bold">带文字 / 状态 / 图标</div>
  54591. <div class="flex justify-between">
  54592. <Switch inside={['关', '开']} />
  54593. <Switch inside={['😭', '😄']} />
  54594. <Switch inside="state" />
  54595. <Switch>
  54596. {#snippet falseChild()}
  54597. <div>
  54598. <Icon name="ri-moon-line" size={16} top={-1} />
  54599. </div>
  54600. {/snippet}
  54601. {#snippet trueChild()}
  54602. <div>
  54603. <Icon name="ri-sun-line" size={16} top={-1} />
  54604. </div>
  54605. {/snippet}
  54606. </Switch>
  54607. </div>
  54608. </div>
  54609. <div>
  54610. <div class="mb-4 font-bold">禁用</div>
  54611. <div class="flex justify-between">
  54612. <Switch disabled />
  54613. <Switch disabled active />
  54614. </div>
  54615. </div>
  54616. <div>
  54617. <div class="mb-4 font-bold">异步控制</div>
  54618. <div class="flex justify-between">
  54619. <div class="flex flex-col items-center space-y-2">
  54620. <Switch async active={checkAsync} onclick={switchClickFun} />
  54621. <div class="text-sm">点击 2 秒后触发</div>
  54622. </div>
  54623. <div class="flex flex-col items-center space-y-2">
  54624. <Switch async active={loadingCheck} loading={{ theme: true }} onclick={loadingFun} inside={loading ? 'loading' : null} />
  54625. <div class="text-sm">点击 3 秒后触发</div>
  54626. </div>
  54627. </div>
  54628. </div>
  54629. </div>
  54630. <div class="mb-4 px-4 font-bold">Cell 中使用</div>
  54631. <Cell title="开关" detail="点击整行皆可触发开关" right={{ type: 'switch' }} />
  54632. <Cell title="开关带文字" right={{ type: 'switch', switch: { inside: ['😭', '😄'] } }} switchActive />
  54633. <Cell title="开关全圆角" right={{ type: 'switch', switch: { radius: 'full' } }} />
  54634. <Cell
  54635. title="异步控制"
  54636. detail="点击 2 秒后触发开关"
  54637. right={{ type: 'switch', switch: { async: true } }}
  54638. switchActive={cellCheck}
  54639. onclick={cellAsyncFun}
  54640. />
  54641. <Cell
  54642. title="异步加载"
  54643. detail="点击 3 秒后触发开关"
  54644. right={{ type: 'switch', switch: { async: true, inside: cellLoading ? 'loading' : null } }}
  54645. switchActive={cellLoadingCheck}
  54646. onclick={cellLoadingFun}
  54647. />
  54648. <Cell title="禁用开关" right={{ type: 'switch', switch: { disabled: true } }} switchActive />
  54649. <Cell
  54650. title="二次确认"
  54651. right={{ type: 'switch', switch: { async: true } }}
  54652. bind:switchActive={confirmswitchActive}
  54653. onclick={() => (visible = true)}
  54654. />
  54655. <Dialog
  54656. bind:visible
  54657. content={`确定${confirmswitchActive ? '关闭' : '开启'}吗?`}
  54658. onprimary={() => {
  54659. visible = false;
  54660. confirmswitchActive = !confirmswitchActive;
  54661. }}
  54662. />
  54663. </div>
  54664. ================================================
  54665. FILE: packages/stdf/src/routes/tabBar/en_US/+page.svelte
  54666. ================================================
  54667. <!-- TabBar Demo -->
  54668. <script lang="ts">
  54669. import { TabBar } from '$lib/index.js';
  54670. import type { TabBarLabelProps } from '$lib/types/index.js';
  54671. const labels: TabBarLabelProps[] = [
  54672. { text: 'Home', icon: { name: 'ri-home-3-line', size: 20 }, activeIcon: { name: 'ri-home-3-fill', size: 20 } },
  54673. { text: 'Discover', icon: { name: 'ri-compass-3-line', size: 20 }, activeIcon: { name: 'ri-compass-3-fill', size: 20 } },
  54674. { text: 'Message', icon: { name: 'ri-discuss-line', size: 20 }, activeIcon: { name: 'ri-discuss-fill', size: 20 } },
  54675. { text: 'Mine', icon: { name: 'ri-account-circle-line', size: 20 }, activeIcon: { name: 'ri-account-circle-fill', size: 20 } }
  54676. ];
  54677. const labels1: TabBarLabelProps[] = [{ text: 'Home' }, { text: 'Discover' }, { text: 'Message' }, { text: 'Mine' }];
  54678. const labels2: TabBarLabelProps[] = [
  54679. { icon: { name: 'ri-home-3-line', size: 26 }, activeIcon: { name: 'ri-home-3-fill', size: 26 } },
  54680. { icon: { name: 'ri-compass-3-line', size: 26 }, activeIcon: { name: 'ri-compass-3-fill', size: 26 } },
  54681. { icon: { name: 'ri-discuss-line', size: 26 }, activeIcon: { name: 'ri-discuss-fill', size: 26 } },
  54682. { icon: { name: 'ri-account-circle-line', size: 26 }, activeIcon: { name: 'ri-account-circle-fill', size: 26 } }
  54683. ];
  54684. const labels3: TabBarLabelProps[] = [
  54685. { text: 'Home', icon: { name: 'ri-home-3-line', size: 20 } },
  54686. { text: 'Discover', icon: { name: 'ri-compass-3-line', size: 20 } },
  54687. { text: 'Message', icon: { name: 'ri-discuss-line', size: 20 } },
  54688. { text: 'Mine', icon: { name: 'ri-account-circle-line', size: 20 } }
  54689. ];
  54690. const labels4: TabBarLabelProps[] = [
  54691. { text: 'Home', icon: { name: 'ri-home-3-line', size: 20 }, activeIcon: { name: 'ri-home-3-fill', size: 20 } },
  54692. { text: 'Message', icon: { name: 'ri-discuss-line', size: 20 }, activeIcon: { name: 'ri-discuss-fill', size: 20 } },
  54693. { text: 'Mine', icon: { name: 'ri-account-circle-line', size: 20 }, activeIcon: { name: 'ri-account-circle-fill', size: 20 } }
  54694. ];
  54695. let active = $state(0);
  54696. </script>
  54697. <div class="mb-20 py-8">
  54698. <div class="my-4 space-y-8">
  54699. <div>
  54700. <div class="mb-2 px-4 font-bold">Basic usage</div>
  54701. <TabBar {labels} />
  54702. </div>
  54703. <div>
  54704. <div class="mb-2 px-4 font-bold">Text only</div>
  54705. <TabBar labels={labels1} />
  54706. </div>
  54707. <div>
  54708. <div class="mb-2 px-4 font-bold">Icon only</div>
  54709. <TabBar labels={labels2} />
  54710. </div>
  54711. <div>
  54712. <div class="mb-2 px-4 font-bold">Belt line</div>
  54713. <TabBar {labels} line lineW={8} />
  54714. <div class="mt-2"></div>
  54715. <TabBar {labels} line />
  54716. <div class="mt-2"></div>
  54717. <TabBar {labels} line lineW={2} />
  54718. <div class="mt-2"></div>
  54719. <TabBar {labels} line lineW={1} />
  54720. </div>
  54721. <div>
  54722. <div class="mb-2 px-4 font-bold">ICONS change colors only</div>
  54723. <TabBar labels={labels3} />
  54724. </div>
  54725. <div>
  54726. <div class="mb-2 px-4 font-bold">Customize the outermost layer</div>
  54727. <TabBar {labels} injClass="mx-2 rounded-full shadow-md dark:shadow-white/10" />
  54728. </div>
  54729. <div>
  54730. <div class="mb-2 px-4 font-bold">customize Tab</div>
  54731. <TabBar {labels} tabInjClass="text-[purple] dark:text-[yellow]" activeTabInjClass="!text-primary dark:!text-dark" />
  54732. </div>
  54733. <div>
  54734. <div class="mb-2 px-4 font-bold">Only customize selected Tab</div>
  54735. <TabBar {labels} activeTabInjClass="text-[purple] dark:text-[yellow]" />
  54736. </div>
  54737. <div>
  54738. <div class="mb-2 px-4 font-bold">Custom line</div>
  54739. <TabBar {labels} line activeInjClass="bg-[purple] dark:bg-[yellow]" />
  54740. </div>
  54741. <div>
  54742. <div class="mb-2 px-4 font-bold">Care edition</div>
  54743. <TabBar {labels} love />
  54744. </div>
  54745. <div>
  54746. <div class="mb-2 px-4 font-bold">monitor onchange event</div>
  54747. <div class="m-4">At present TabBar activated active: {active}</div>
  54748. <TabBar {labels} onchange={(a) => (active = a)} />
  54749. </div>
  54750. </div>
  54751. </div>
  54752. <div class="fixed bottom-0 w-full">
  54753. <TabBar labels={labels4} injClass="bg-white/50 dark:bg-black/50 backdrop-blur-sm" />
  54754. </div>
  54755. ================================================
  54756. FILE: packages/stdf/src/routes/tabBar/zh_CN/+page.svelte
  54757. ================================================
  54758. <!-- TabBar Demo -->
  54759. <script lang="ts">
  54760. import { TabBar } from '$lib/index.js';
  54761. import type { TabBarLabelProps } from '$lib/types/index.js';
  54762. const labels: TabBarLabelProps[] = [
  54763. { text: '首页', icon: { name: 'ri-home-3-line', size: 20 }, activeIcon: { name: 'ri-home-3-fill', size: 20 } },
  54764. { text: '发现', icon: { name: 'ri-compass-3-line', size: 20 }, activeIcon: { name: 'ri-compass-3-fill', size: 20 } },
  54765. { text: '消息', icon: { name: 'ri-discuss-line', size: 20 }, activeIcon: { name: 'ri-discuss-fill', size: 20 } },
  54766. { text: '我的', icon: { name: 'ri-account-circle-line', size: 20 }, activeIcon: { name: 'ri-account-circle-fill', size: 20 } }
  54767. ];
  54768. const labels1: TabBarLabelProps[] = [{ text: '首页' }, { text: '发现' }, { text: '消息' }, { text: '我的' }];
  54769. const labels2: TabBarLabelProps[] = [
  54770. { icon: { name: 'ri-home-3-line', size: 26 }, activeIcon: { name: 'ri-home-3-fill', size: 26 } },
  54771. { icon: { name: 'ri-compass-3-line', size: 26 }, activeIcon: { name: 'ri-compass-3-fill', size: 26 } },
  54772. { icon: { name: 'ri-discuss-line', size: 26 }, activeIcon: { name: 'ri-discuss-fill', size: 26 } },
  54773. { icon: { name: 'ri-account-circle-line', size: 26 }, activeIcon: { name: 'ri-account-circle-fill', size: 26 } }
  54774. ];
  54775. const labels3: TabBarLabelProps[] = [
  54776. { text: '首页', icon: { name: 'ri-home-3-line', size: 20 } },
  54777. { text: '发现', icon: { name: 'ri-compass-3-line', size: 20 } },
  54778. { text: '消息', icon: { name: 'ri-discuss-line', size: 20 } },
  54779. { text: '我的', icon: { name: 'ri-account-circle-line', size: 20 } }
  54780. ];
  54781. const labels4: TabBarLabelProps[] = [
  54782. { text: '首页', icon: { name: 'ri-home-3-line', size: 20 }, activeIcon: { name: 'ri-home-3-fill', size: 20 } },
  54783. { text: '消息', icon: { name: 'ri-discuss-line', size: 20 }, activeIcon: { name: 'ri-discuss-fill', size: 20 } },
  54784. { text: '我的', icon: { name: 'ri-account-circle-line', size: 20 }, activeIcon: { name: 'ri-account-circle-fill', size: 20 } }
  54785. ];
  54786. let active = $state(0);
  54787. </script>
  54788. <div class="mb-20 py-8">
  54789. <div class="my-4 space-y-8">
  54790. <div>
  54791. <div class="mb-2 px-4 font-bold">基础用法</div>
  54792. <TabBar {labels} />
  54793. </div>
  54794. <div>
  54795. <div class="mb-2 px-4 font-bold">仅文字</div>
  54796. <TabBar labels={labels1} />
  54797. </div>
  54798. <div>
  54799. <div class="mb-2 px-4 font-bold">仅图标</div>
  54800. <TabBar labels={labels2} />
  54801. </div>
  54802. <div>
  54803. <div class="mb-2 px-4 font-bold">带线条</div>
  54804. <TabBar {labels} line lineW={8} />
  54805. <div class="mt-2"></div>
  54806. <TabBar {labels} line />
  54807. <div class="mt-2"></div>
  54808. <TabBar {labels} line lineW={2} />
  54809. <div class="mt-2"></div>
  54810. <TabBar {labels} line lineW={1} />
  54811. </div>
  54812. <div>
  54813. <div class="mb-2 px-4 font-bold">图标仅换颜色</div>
  54814. <TabBar labels={labels3} />
  54815. </div>
  54816. <div>
  54817. <div class="mb-2 px-4 font-bold">自定义最外层</div>
  54818. <TabBar {labels} injClass="mx-2 rounded-full shadow-md dark:shadow-white/10" />
  54819. </div>
  54820. <div>
  54821. <div class="mb-2 px-4 font-bold">自定义 Tab</div>
  54822. <TabBar {labels} tabInjClass="text-[purple] dark:text-[yellow]" activeTabInjClass="!text-primary dark:!text-dark" />
  54823. </div>
  54824. <div>
  54825. <div class="mb-2 px-4 font-bold">仅自定义选定 Tab</div>
  54826. <TabBar {labels} activeTabInjClass="text-[purple] dark:text-[yellow]" />
  54827. </div>
  54828. <div>
  54829. <div class="mb-2 px-4 font-bold">自定义线条</div>
  54830. <TabBar {labels} line activeInjClass="bg-[purple] dark:bg-[yellow]" />
  54831. </div>
  54832. <div>
  54833. <div class="mb-2 px-4 font-bold">关爱版</div>
  54834. <TabBar {labels} love />
  54835. </div>
  54836. <div>
  54837. <div class="mb-2 px-4 font-bold">监听 onchange 事件</div>
  54838. <div class="m-4">当前 TabBar 激活的 active:{active}</div>
  54839. <TabBar {labels} onchange={(a) => (active = a)} />
  54840. </div>
  54841. </div>
  54842. </div>
  54843. <div class="fixed bottom-0 w-full">
  54844. <TabBar labels={labels4} injClass="bg-white/50 dark:bg-black/50 backdrop-blur-sm" />
  54845. </div>
  54846. ================================================
  54847. FILE: packages/stdf/src/routes/tabs/en_US/+page.svelte
  54848. ================================================
  54849. <!-- Tabs Demo -->
  54850. <script lang="ts">
  54851. import { Tabs, Tab, TabContent, Divider } from '$lib/index.js';
  54852. import type { TabLabelProps } from '$lib/types/index.js';
  54853. import { fly } from 'svelte/transition';
  54854. const labels: TabLabelProps[] = [{ text: 'aircraft' }, { text: 'steamer' }, { text: 'train' }, { text: 'car' }];
  54855. const labels1: TabLabelProps[] = [
  54856. { icon: { name: 'ri-plane-line', theme: true, size: 20 } },
  54857. { icon: { name: 'ri-ship-2-line', theme: true, size: 20 } },
  54858. { icon: { name: 'ri-train-line', theme: true, size: 20 } },
  54859. { icon: { name: 'ri-car-line', theme: true, size: 20 } }
  54860. ];
  54861. const labels2: TabLabelProps[] = [
  54862. { text: 'aircraft', icon: { name: 'ri-plane-line', theme: true, size: 16, top: -1 } },
  54863. { text: 'steamer', icon: { name: 'ri-ship-2-line', theme: true, size: 16, top: -1 } },
  54864. { text: 'train', icon: { name: 'ri-train-line', theme: true, size: 16, top: -1 } },
  54865. { text: 'car', icon: { name: 'ri-car-line', theme: true, size: 16, top: -1 } }
  54866. ];
  54867. const overflowLabels: TabLabelProps[] = [
  54868. { text: 'aircraft' },
  54869. { text: 'steamer' },
  54870. { text: 'train' },
  54871. { text: 'car' },
  54872. { text: 'motorcycle' },
  54873. { text: 'bicycle' },
  54874. { text: 'hot air balloon' },
  54875. { text: 'rocket' },
  54876. { text: 'tractor' },
  54877. { text: 'subway' },
  54878. { text: 'bus' },
  54879. { text: 'skateboard' },
  54880. { text: 'flying saucer' }
  54881. ];
  54882. let width = $state(0);
  54883. let changeActive = $state(0);
  54884. let active = $state(2);
  54885. const clicktabFun = (a: number) => {
  54886. active = a;
  54887. };
  54888. const tabsChangeFun = (a: number) => {
  54889. changeActive = a;
  54890. };
  54891. </script>
  54892. <div class="py-8">
  54893. <div class="px-4 text-xl font-bold">use Tabs</div>
  54894. <div class="my-4 space-y-4">
  54895. <div class="px-4 font-bold">Basic usage</div>
  54896. <Tabs tab={{ labels }}>
  54897. <TabContent>I am a plane</TabContent>
  54898. <TabContent>I am a ship</TabContent>
  54899. <TabContent>I am a train</TabContent>
  54900. <TabContent>I am a car</TabContent>
  54901. </Tabs>
  54902. <Divider />
  54903. <div class="px-4 font-bold">Accelerate the transition</div>
  54904. <Tabs duration="fast" tab={{ labels }}>
  54905. <TabContent>I am a plane</TabContent>
  54906. <TabContent>I am a ship</TabContent>
  54907. <TabContent>I am a train</TabContent>
  54908. <TabContent>I am a car</TabContent>
  54909. </Tabs>
  54910. <Divider />
  54911. <div class="px-4 font-bold">Transition mitigation</div>
  54912. <Tabs duration="slower" tab={{ labels }}>
  54913. <TabContent>I am a plane</TabContent>
  54914. <TabContent>I am a ship</TabContent>
  54915. <TabContent>I am a train</TabContent>
  54916. <TabContent>I am a car</TabContent>
  54917. </Tabs>
  54918. <Divider />
  54919. <div class="px-4 font-bold">Use linear style</div>
  54920. <Tabs tab={{ labels, lineType: true }}>
  54921. <TabContent>I am a plane</TabContent>
  54922. <TabContent>I am a ship</TabContent>
  54923. <TabContent>I am a train</TabContent>
  54924. <TabContent>I am a car</TabContent>
  54925. </Tabs>
  54926. <Divider />
  54927. <div class="px-4 font-bold">The TAB is located at the bottom</div>
  54928. <Tabs tab={{ labels }} position="b">
  54929. <TabContent>I am a plane</TabContent>
  54930. <TabContent>I am a ship</TabContent>
  54931. <TabContent>I am a train</TabContent>
  54932. <TabContent>I am a car</TabContent>
  54933. </Tabs>
  54934. <Divider />
  54935. <div class="px-4 font-bold">The TAB is located on the left</div>
  54936. <Tabs tab={{ labels }} position="l">
  54937. {#snippet children({ active })}
  54938. <TabContent show={active === 0}>I am a plane</TabContent>
  54939. <TabContent show={active === 1}>I am a ship</TabContent>
  54940. <TabContent show={active === 2}>I am a train</TabContent>
  54941. <TabContent show={active === 3}>I am a car</TabContent>
  54942. {/snippet}
  54943. </Tabs>
  54944. <Divider />
  54945. <div class="px-4 font-bold">The TAB is located on the right</div>
  54946. <Tabs tab={{ labels }} position="r">
  54947. {#snippet children({ active })}
  54948. <TabContent show={active === 0}>I am a plane</TabContent>
  54949. <TabContent show={active === 1}>I am a ship</TabContent>
  54950. <TabContent show={active === 2}>I am a train</TabContent>
  54951. <TabContent show={active === 3}>I am a car</TabContent>
  54952. {/snippet}
  54953. </Tabs>
  54954. <Divider />
  54955. <div class="px-4 font-bold" bind:clientWidth={width}>Custom transition</div>
  54956. <Tabs tab={{ labels }} transition={false}>
  54957. {#snippet children({ active })}
  54958. <div class="relative py-8">
  54959. {#each labels as item, i}
  54960. {#if active === i}
  54961. <div class="absolute" in:fly={{ y: -80, x: (width / 4) * i, duration: 1000 }}>I am {item.text}</div>
  54962. {/if}
  54963. {/each}
  54964. </div>
  54965. {/snippet}
  54966. </Tabs>
  54967. <Divider />
  54968. <div class="px-4 font-bold">monitor change event</div>
  54969. <Tabs tab={{ labels }} onchange={tabsChangeFun}>
  54970. <TabContent>I am a plane</TabContent>
  54971. <TabContent>I am a ship</TabContent>
  54972. <TabContent>I am a train</TabContent>
  54973. <TabContent>I am a car</TabContent>
  54974. </Tabs>
  54975. <div class="mt-4">At present Tabs activated active: {changeActive}</div>
  54976. <Divider />
  54977. <div class="px-4 font-bold">Overflow mode</div>
  54978. <Tabs tab={{ labels: overflowLabels, overflow: true }}>
  54979. {#each overflowLabels as item}
  54980. <TabContent>I am {item.text}</TabContent>
  54981. {/each}
  54982. </Tabs>
  54983. <Tabs tab={{ labels: overflowLabels, overflow: true, lineType: true }}>
  54984. {#each overflowLabels as item}
  54985. <TabContent>I am {item.text}</TabContent>
  54986. {/each}
  54987. </Tabs>
  54988. <Divider />
  54989. <div class="px-4 font-bold">Overflow mode closes automatic scrolling</div>
  54990. <Tabs tab={{ labels: overflowLabels, overflow: true, autoScroll: false }}>
  54991. {#each overflowLabels as item}
  54992. <TabContent>I am {item.text}</TabContent>
  54993. {/each}
  54994. </Tabs>
  54995. <Divider />
  54996. <div class="px-4 font-bold">Overflow mode shows 2 items</div>
  54997. <Tabs tab={{ labels: overflowLabels, overflow: true, showNum: 2 }}>
  54998. {#each overflowLabels as item}
  54999. <TabContent>I am {item.text}</TabContent>
  55000. {/each}
  55001. </Tabs>
  55002. </div>
  55003. <Divider />
  55004. <div class="mt-8 px-4 text-xl font-bold">different Tab style</div>
  55005. <div class="mt-4 flex flex-col space-y-2">
  55006. <div class="px-4 font-bold">Different fillet</div>
  55007. <Tab {labels} radius="none" />
  55008. <Tab {labels} />
  55009. <Tab {labels} radius="xl" />
  55010. <Tab {labels} radius="full" />
  55011. <div class="px-4 font-bold">Match text with ICONS</div>
  55012. <Tab {labels} />
  55013. <Tab labels={labels1} />
  55014. <Tab labels={labels2} />
  55015. <div class="px-4 font-bold">Care edition</div>
  55016. <Tab {labels} love />
  55017. <div class="px-4 font-bold">Linear style</div>
  55018. <Tab {labels} lineType />
  55019. <Tab labels={labels2} lineType />
  55020. <div class="px-4 font-bold">customize Tab Outer style</div>
  55021. <Tab {labels} injClass="bg-gradient-to-b from-[#e3c6ff] to-[#b6aeff]" />
  55022. <div class="px-4 font-bold">customize Tab style</div>
  55023. <Tab {labels} tabInjClass="underline text-primary decoration-primary dark:text-dark dark:decoration-dark" />
  55024. <div class="px-4 font-bold">Custom selection Tab style</div>
  55025. <Tab {labels} activeTabInjClass="text-primary dark:text-dark !text-base transition-all" />
  55026. <div class="px-4 font-bold">Customize the indicator style</div>
  55027. <Tab {labels} activeInjClass="bg-gradient-to-b from-[#CE9FFC] to-[#7367F0]" activeTabInjClass="text-white" />
  55028. <Tab {labels} lineType activeInjClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  55029. <div class="px-4 font-bold">Different mx</div>
  55030. <div class="mt-4 flex flex-col space-y-2">
  55031. <Tab {labels} mx="12" />
  55032. <Tab {labels} lineType mx="12" />
  55033. <Tab {labels} mx="0" />
  55034. <Tab {labels} lineType mx="0" />
  55035. </div>
  55036. </div>
  55037. <Divider />
  55038. <div class="my-8 px-4 text-xl font-bold">Use alone Tab</div>
  55039. <div class="my-4">
  55040. <Tab {labels} {active} onclickTab={clicktabFun} />
  55041. <div class="mt-4">At present Tab clickable active:{active}</div>
  55042. </div>
  55043. <Divider />
  55044. </div>
  55045. ================================================
  55046. FILE: packages/stdf/src/routes/tabs/zh_CN/+page.svelte
  55047. ================================================
  55048. <!-- Tabs Demo -->
  55049. <script lang="ts">
  55050. import { Tabs, Tab, TabContent, Divider } from '$lib/index.js';
  55051. import type { TabLabelProps } from '$lib/types/index.js';
  55052. import { fly } from 'svelte/transition';
  55053. const labels: TabLabelProps[] = [{ text: '飞机' }, { text: '轮船' }, { text: '火车' }, { text: '汽车' }];
  55054. const labels1: TabLabelProps[] = [
  55055. { icon: { name: 'ri-plane-line', theme: true, size: 20 } },
  55056. { icon: { name: 'ri-ship-2-line', theme: true, size: 20 } },
  55057. { icon: { name: 'ri-train-line', theme: true, size: 20 } },
  55058. { icon: { name: 'ri-car-line', theme: true, size: 20 } }
  55059. ];
  55060. const labels2: TabLabelProps[] = [
  55061. { text: '飞机', icon: { name: 'ri-plane-line', theme: true, size: 16, top: -1 } },
  55062. { text: '轮船', icon: { name: 'ri-ship-2-line', theme: true, size: 16, top: -1 } },
  55063. { text: '火车', icon: { name: 'ri-train-line', theme: true, size: 16, top: -1 } },
  55064. { text: '汽车', icon: { name: 'ri-car-line', theme: true, size: 16, top: -1 } }
  55065. ];
  55066. const overflowLabels: TabLabelProps[] = [
  55067. { text: '飞机' },
  55068. { text: '轮船' },
  55069. { text: '火车' },
  55070. { text: '汽车' },
  55071. { text: '摩托车' },
  55072. { text: '自行车' },
  55073. { text: '热气球' },
  55074. { text: '火箭' },
  55075. { text: '拖拉机' },
  55076. { text: '地铁' },
  55077. { text: '公交车' },
  55078. { text: '滑板' },
  55079. { text: '飞碟' }
  55080. ];
  55081. let width = $state(0);
  55082. let changeActive = $state(0);
  55083. let active = $state(2);
  55084. const clicktabFun = (a: number) => {
  55085. active = a;
  55086. };
  55087. const tabsChangeFun = (a: number) => {
  55088. changeActive = a;
  55089. };
  55090. </script>
  55091. <div class="py-8">
  55092. <div class="px-4 text-xl font-bold">使用 Tabs</div>
  55093. <div class="my-4 space-y-4">
  55094. <div class="px-4 font-bold">基础用法</div>
  55095. <Tabs tab={{ labels }}>
  55096. <TabContent>我是飞机</TabContent>
  55097. <TabContent>我是轮船</TabContent>
  55098. <TabContent>我是火车</TabContent>
  55099. <TabContent>我是汽车</TabContent>
  55100. </Tabs>
  55101. <Divider />
  55102. <div class="px-4 font-bold">加快过渡</div>
  55103. <Tabs duration="fast" tab={{ labels }}>
  55104. <TabContent>我是飞机</TabContent>
  55105. <TabContent>我是轮船</TabContent>
  55106. <TabContent>我是火车</TabContent>
  55107. <TabContent>我是汽车</TabContent>
  55108. </Tabs>
  55109. <Divider />
  55110. <div class="px-4 font-bold">减缓过渡</div>
  55111. <Tabs duration="slower" tab={{ labels }}>
  55112. <TabContent>我是飞机</TabContent>
  55113. <TabContent>我是轮船</TabContent>
  55114. <TabContent>我是火车</TabContent>
  55115. <TabContent>我是汽车</TabContent>
  55116. </Tabs>
  55117. <Divider />
  55118. <div class="px-4 font-bold">使用线性风格</div>
  55119. <Tabs tab={{ labels, lineType: true }}>
  55120. <TabContent>我是飞机</TabContent>
  55121. <TabContent>我是轮船</TabContent>
  55122. <TabContent>我是火车</TabContent>
  55123. <TabContent>我是汽车</TabContent>
  55124. </Tabs>
  55125. <Divider />
  55126. <div class="px-4 font-bold">选项卡位于底部</div>
  55127. <Tabs tab={{ labels }} position="b">
  55128. <TabContent>我是飞机</TabContent>
  55129. <TabContent>我是轮船</TabContent>
  55130. <TabContent>我是火车</TabContent>
  55131. <TabContent>我是汽车</TabContent>
  55132. </Tabs>
  55133. <Divider />
  55134. <div class="px-4 font-bold">选项卡位于左侧</div>
  55135. <Tabs tab={{ labels }} position="l">
  55136. {#snippet children({ active })}
  55137. <TabContent show={active === 0}>我是飞机</TabContent>
  55138. <TabContent show={active === 1}>我是轮船</TabContent>
  55139. <TabContent show={active === 2}>我是火车</TabContent>
  55140. <TabContent show={active === 3}>我是汽车</TabContent>
  55141. {/snippet}
  55142. </Tabs>
  55143. <Divider />
  55144. <div class="px-4 font-bold">选项卡位于右侧</div>
  55145. <Tabs tab={{ labels }} position="r">
  55146. {#snippet children({ active })}
  55147. <TabContent show={active === 0}>我是飞机</TabContent>
  55148. <TabContent show={active === 1}>我是轮船</TabContent>
  55149. <TabContent show={active === 2}>我是火车</TabContent>
  55150. <TabContent show={active === 3}>我是汽车</TabContent>
  55151. {/snippet}
  55152. </Tabs>
  55153. <Divider />
  55154. <div class="px-4 font-bold" bind:clientWidth={width}>自定义过渡</div>
  55155. <Tabs tab={{ labels }} transition={false}>
  55156. {#snippet children({ active })}
  55157. <div class="relative py-8">
  55158. {#each labels as item, i}
  55159. {#if active === i}
  55160. <div class="absolute" in:fly={{ y: -80, x: (width / 4) * i, duration: 1000 }}>我是{item.text}</div>
  55161. {/if}
  55162. {/each}
  55163. </div>
  55164. {/snippet}
  55165. </Tabs>
  55166. <Divider />
  55167. <div class="px-4 font-bold">监听 change 事件</div>
  55168. <Tabs tab={{ labels }} onchange={tabsChangeFun}>
  55169. <TabContent>我是飞机</TabContent>
  55170. <TabContent>我是轮船</TabContent>
  55171. <TabContent>我是火车</TabContent>
  55172. <TabContent>我是汽车</TabContent>
  55173. </Tabs>
  55174. <div class="mt-4">当前 Tabs 激活的 active:{changeActive}</div>
  55175. <Divider />
  55176. <div class="px-4 font-bold">溢出模式</div>
  55177. <Tabs tab={{ labels: overflowLabels, overflow: true }}>
  55178. {#each overflowLabels as item}
  55179. <TabContent>我是{item.text}</TabContent>
  55180. {/each}
  55181. </Tabs>
  55182. <Tabs tab={{ labels: overflowLabels, overflow: true, lineType: true }}>
  55183. {#each overflowLabels as item}
  55184. <TabContent>我是{item.text}</TabContent>
  55185. {/each}
  55186. </Tabs>
  55187. <Divider />
  55188. <div class="px-4 font-bold">溢出模式关闭自动滚动</div>
  55189. <Tabs tab={{ labels: overflowLabels, overflow: true, autoScroll: false }}>
  55190. {#each overflowLabels as item}
  55191. <TabContent>我是{item.text}</TabContent>
  55192. {/each}
  55193. </Tabs>
  55194. <Divider />
  55195. <div class="px-4 font-bold">溢出模式完整显示 2 项</div>
  55196. <Tabs tab={{ labels: overflowLabels, overflow: true, showNum: 2 }}>
  55197. {#each overflowLabels as item}
  55198. <TabContent>我是{item.text}</TabContent>
  55199. {/each}
  55200. </Tabs>
  55201. </div>
  55202. <Divider />
  55203. <div class="mt-8 px-4 text-xl font-bold">不同的 Tab 风格</div>
  55204. <div class="mt-4 flex flex-col space-y-2">
  55205. <div class="px-4 font-bold">不同圆角</div>
  55206. <Tab {labels} radius="none" />
  55207. <Tab {labels} />
  55208. <Tab {labels} radius="xl" />
  55209. <Tab {labels} radius="full" />
  55210. <div class="px-4 font-bold">文字与图标搭配</div>
  55211. <Tab {labels} />
  55212. <Tab labels={labels1} />
  55213. <Tab labels={labels2} />
  55214. <div class="px-4 font-bold">关爱版</div>
  55215. <Tab {labels} love />
  55216. <div class="px-4 font-bold">线性风格</div>
  55217. <Tab {labels} lineType />
  55218. <Tab labels={labels2} lineType />
  55219. <div class="px-4 font-bold">自定义 Tab 外层风格</div>
  55220. <Tab {labels} injClass="bg-gradient-to-b from-[#e3c6ff] to-[#b6aeff]" />
  55221. <div class="px-4 font-bold">自定义 Tab 风格</div>
  55222. <Tab {labels} tabInjClass="underline text-primary decoration-primary dark:text-dark dark:decoration-dark" />
  55223. <div class="px-4 font-bold">自定义选定 Tab 风格</div>
  55224. <Tab {labels} activeTabInjClass="text-primary dark:text-dark !text-base transition-all" />
  55225. <div class="px-4 font-bold">自定义指示器风格</div>
  55226. <Tab {labels} activeInjClass="bg-gradient-to-b from-[#CE9FFC] to-[#7367F0]" activeTabInjClass="text-white" />
  55227. <Tab {labels} lineType activeInjClass="bg-gradient-to-r from-[#CE9FFC] to-[#7367F0]" />
  55228. <div class="px-4 font-bold">不同的左右间距</div>
  55229. <div class="mt-4 flex flex-col space-y-2">
  55230. <Tab {labels} mx="12" />
  55231. <Tab {labels} lineType mx="12" />
  55232. <Tab {labels} mx="0" />
  55233. <Tab {labels} lineType mx="0" />
  55234. </div>
  55235. </div>
  55236. <Divider />
  55237. <div class="my-8 px-4 text-xl font-bold">单独使用 Tab</div>
  55238. <div class="my-4">
  55239. <Tab {labels} {active} onclickTab={clicktabFun} />
  55240. <div class="mt-4">当前 Tab 点击的 active:{active}</div>
  55241. </div>
  55242. <Divider />
  55243. </div>
  55244. ================================================
  55245. FILE: packages/stdf/src/routes/timePicker/en_US/+page.svelte
  55246. ================================================
  55247. <!-- TimePickerDemo Demo -->
  55248. <script lang="ts">
  55249. import { Cell, TimePicker } from '$lib/index.js';
  55250. let visible1 = $state(false);
  55251. let visible2 = $state(false);
  55252. let visible3 = $state(false);
  55253. let visible4 = $state(false);
  55254. let visible5 = $state(false);
  55255. let visible6 = $state(false);
  55256. let visible8 = $state(false);
  55257. let visible9 = $state(false);
  55258. let visible10 = $state(false);
  55259. let visible11 = $state(false);
  55260. let visible12 = $state(false);
  55261. let visible13 = $state(false);
  55262. let visible14 = $state(false);
  55263. let visible15 = $state(false);
  55264. let visible16 = $state(false);
  55265. let visible17 = $state(false);
  55266. let visible18 = $state(false);
  55267. let visible19 = $state(false);
  55268. let visible20 = $state(false);
  55269. let visible21 = $state(false);
  55270. let visible22 = $state(false);
  55271. let defaultTimeStr = $state('');
  55272. let customFormatStr = $state('');
  55273. let monthFirstStr = $state('');
  55274. let timeObj = $state({});
  55275. let timeObjStr = $derived(JSON.stringify(timeObj));
  55276. </script>
  55277. <div class="py-4">
  55278. <div class="px-4">
  55279. {#if defaultTimeStr !== ''}
  55280. Currently selected:
  55281. <span class="mr-2 text-primary dark:text-dark">{defaultTimeStr}</span>
  55282. {:else}
  55283. <div>Please select a time</div>
  55284. {/if}
  55285. </div>
  55286. <Cell title="Basic Usage" subTitle="Default to current time, can select 10 years before and after" onclick={() => (visible1 = true)} />
  55287. <TimePicker bind:visible={visible1} onconfirm={(time) => (defaultTimeStr = time)} />
  55288. <Cell title="Year Month Day only" onclick={() => (visible2 = true)} />
  55289. <TimePicker bind:visible={visible2} type="YYYYMMDD" />
  55290. <Cell title="Hour Minute Second only" onclick={() => (visible3 = true)} />
  55291. <TimePicker bind:visible={visible3} type="hhmmss" />
  55292. <Cell title="Year Month Day Hour only" onclick={() => (visible4 = true)} />
  55293. <TimePicker bind:visible={visible4} type="YYYYMMDDhh" />
  55294. <Cell title="Hide Tips" onclick={() => (visible5 = true)} />
  55295. <TimePicker bind:visible={visible5} showTips={false} />
  55296. <Cell title="Different visible rows for each column" onclick={() => (visible6 = true)} />
  55297. <TimePicker
  55298. bind:visible={visible6}
  55299. yearProps={{ showRow: 3 }}
  55300. hourProps={{ showRow: 7 }}
  55301. minuteProps={{ showRow: 7 }}
  55302. secondProps={{ showRow: 7 }}
  55303. />
  55304. <Cell title="Different widths for each column" onclick={() => (visible8 = true)} />
  55305. <TimePicker bind:visible={visible8} yearProps={{ flex: 3 }} dayProps={{ flex: 2 }} />
  55306. <Cell title="Year data right-aligned, day data left-aligned" onclick={() => (visible22 = true)} />
  55307. <TimePicker bind:visible={visible22} type="YYYYMMDD" yearProps={{ align: 'right' }} dayProps={{ align: 'left' }} />
  55308. <Cell title="Limit year range" onclick={() => (visible9 = true)} />
  55309. <TimePicker bind:visible={visible9} yearRange={[2022, 2025]} />
  55310. <Cell title="Limit month range" onclick={() => (visible10 = true)} />
  55311. <TimePicker bind:visible={visible10} monthRange={[2, 5]} />
  55312. <Cell title="Limit hour, minute, second range" onclick={() => (visible11 = true)} />
  55313. <TimePicker bind:visible={visible11} hourRange={[2, 5]} minuteRange={[25, 45]} secondRange={[5, 10]} />
  55314. <Cell title="Minute step of 5" onclick={() => (visible12 = true)} />
  55315. <TimePicker bind:visible={visible12} minuteStep={5} />
  55316. <Cell title="Second step of 10" onclick={() => (visible13 = true)} />
  55317. <TimePicker bind:visible={visible13} secondStep={10} />
  55318. <div class="px-4">
  55319. {#if customFormatStr !== ''}
  55320. Currently selected:
  55321. <span class="mr-2 text-primary dark:text-dark">{customFormatStr}</span>
  55322. {:else}
  55323. <div>Please select a time</div>
  55324. {/if}
  55325. </div>
  55326. <Cell
  55327. title="Custom return time format"
  55328. subTitle="Output format: X year X month X day X hour X minute X second"
  55329. onclick={() => (visible15 = true)}
  55330. />
  55331. <TimePicker
  55332. bind:visible={visible15}
  55333. outFormat="YYYY year MM month DD day hh hour mm minute ss second"
  55334. onconfirm={(timeStr) => (customFormatStr = timeStr)}
  55335. />
  55336. <div class="px-4">
  55337. {#if monthFirstStr !== ''}
  55338. Currently selected:
  55339. <span class="mr-2 text-primary dark:text-dark">{monthFirstStr}</span>
  55340. {:else}
  55341. <div>Please select a time</div>
  55342. {/if}
  55343. </div>
  55344. <Cell title="Return time with month first" onclick={() => (visible16 = true)} />
  55345. <TimePicker bind:visible={visible16} type="YYYYMMDD" outFormat="MM/DD/YYYY" onconfirm={(timeStr) => (monthFirstStr = timeStr)} />
  55346. <div class="px-4 text-xs">
  55347. Currently selected:<br />
  55348. <span class="mr-2 break-words text-primary dark:text-dark">{timeObjStr}</span>
  55349. </div>
  55350. <Cell title="Return time object" onclick={() => (visible17 = true)} />
  55351. <TimePicker bind:visible={visible17} onconfirm={(_, obj) => (timeObj = obj)} />
  55352. <Cell title="Rounded corners at the top" onclick={() => (visible14 = true)} />
  55353. <TimePicker bind:visible={visible14} popup={{ radius: 'xl' }} />
  55354. <Cell title="Custom title" onclick={() => (visible18 = true)} />
  55355. <TimePicker bind:visible={visible18} title="Please select a time" />
  55356. <Cell title="Specify initial selected year" onclick={() => (visible19 = true)} />
  55357. <TimePicker bind:visible={visible19} initYear="2020" />
  55358. <Cell title="Specify initial selected month" onclick={() => (visible20 = true)} />
  55359. <TimePicker bind:visible={visible20} initMonth="05" />
  55360. <Cell title="Specify initial selected hour, minute, second" onclick={() => (visible21 = true)} />
  55361. <TimePicker bind:visible={visible21} initHour="05" initMinute="05" initSecond="05" />
  55362. </div>
  55363. ================================================
  55364. FILE: packages/stdf/src/routes/timePicker/zh_CN/+page.svelte
  55365. ================================================
  55366. <!-- TimePickerDemo Demo -->
  55367. <script lang="ts">
  55368. import { Cell, TimePicker } from '$lib/index.js';
  55369. let visible1 = $state(false);
  55370. let visible2 = $state(false);
  55371. let visible3 = $state(false);
  55372. let visible4 = $state(false);
  55373. let visible5 = $state(false);
  55374. let visible6 = $state(false);
  55375. let visible8 = $state(false);
  55376. let visible9 = $state(false);
  55377. let visible10 = $state(false);
  55378. let visible11 = $state(false);
  55379. let visible12 = $state(false);
  55380. let visible13 = $state(false);
  55381. let visible14 = $state(false);
  55382. let visible15 = $state(false);
  55383. let visible16 = $state(false);
  55384. let visible17 = $state(false);
  55385. let visible18 = $state(false);
  55386. let visible19 = $state(false);
  55387. let visible20 = $state(false);
  55388. let visible21 = $state(false);
  55389. let visible22 = $state(false);
  55390. let defaultTimeStr = $state('');
  55391. let customFormatStr = $state('');
  55392. let monthFirstStr = $state('');
  55393. let timeObj = $state({});
  55394. let timeObjStr = $derived(JSON.stringify(timeObj));
  55395. </script>
  55396. <div class="py-4">
  55397. <div class="px-4">
  55398. {#if defaultTimeStr !== ''}
  55399. 当前选定了:
  55400. <span class="mr-2 text-primary dark:text-dark">{defaultTimeStr}</span>
  55401. {:else}
  55402. <div>请选定时间</div>
  55403. {/if}
  55404. </div>
  55405. <Cell title="基础用法" subTitle="默认选定当前时间,可选前后十年" onclick={() => (visible1 = true)} />
  55406. <TimePicker bind:visible={visible1} onconfirm={(time) => (defaultTimeStr = time)} />
  55407. <Cell title="只用年月日" onclick={() => (visible2 = true)} />
  55408. <TimePicker bind:visible={visible2} type="YYYYMMDD" />
  55409. <Cell title="只用时分秒" onclick={() => (visible3 = true)} />
  55410. <TimePicker bind:visible={visible3} type="hhmmss" />
  55411. <Cell title="只用年月日时" onclick={() => (visible4 = true)} />
  55412. <TimePicker bind:visible={visible4} type="YYYYMMDDhh" />
  55413. <Cell title="不显示提示" onclick={() => (visible5 = true)} />
  55414. <TimePicker bind:visible={visible5} showTips={false} />
  55415. <Cell title="不同列不同可见行" onclick={() => (visible6 = true)} />
  55416. <TimePicker
  55417. bind:visible={visible6}
  55418. yearProps={{ showRow: 3 }}
  55419. hourProps={{ showRow: 7 }}
  55420. minuteProps={{ showRow: 7 }}
  55421. secondProps={{ showRow: 7 }}
  55422. />
  55423. <Cell title="不同列不同宽度" onclick={() => (visible8 = true)} />
  55424. <TimePicker bind:visible={visible8} yearProps={{ flex: 3 }} dayProps={{ flex: 2 }} />
  55425. <Cell title="年数据右对齐,日数据左对齐" onclick={() => (visible22 = true)} />
  55426. <TimePicker bind:visible={visible22} type="YYYYMMDD" yearProps={{ align: 'right' }} dayProps={{ align: 'left' }} />
  55427. <Cell title="限定年份区间" onclick={() => (visible9 = true)} />
  55428. <TimePicker bind:visible={visible9} yearRange={[2022, 2025]} />
  55429. <Cell title="限定月份区间" onclick={() => (visible10 = true)} />
  55430. <TimePicker bind:visible={visible10} monthRange={[2, 5]} />
  55431. <Cell title="限定时分秒区间" onclick={() => (visible11 = true)} />
  55432. <TimePicker bind:visible={visible11} hourRange={[2, 5]} minuteRange={[25, 45]} secondRange={[5, 10]} />
  55433. <Cell title="分钟步长为 5" onclick={() => (visible12 = true)} />
  55434. <TimePicker bind:visible={visible12} minuteStep={5} />
  55435. <Cell title="秒步长为 10" onclick={() => (visible13 = true)} />
  55436. <TimePicker bind:visible={visible13} secondStep={10} />
  55437. <div class="px-4">
  55438. {#if customFormatStr !== ''}
  55439. 当前选定了:
  55440. <span class="mr-2 text-primary dark:text-dark">{customFormatStr}</span>
  55441. {:else}
  55442. <div>请选定时间</div>
  55443. {/if}
  55444. </div>
  55445. <Cell title="自定义返回时间格式" subTitle="输出格式为 X 年 X 月 X 日 X 时 X 分 X 秒" onclick={() => (visible15 = true)} />
  55446. <TimePicker
  55447. bind:visible={visible15}
  55448. outFormat="YYYY 年 MM 月 DD 日 hh 时 mm 分 ss 秒"
  55449. onconfirm={(timeStr) => (customFormatStr = timeStr)}
  55450. />
  55451. <div class="px-4">
  55452. {#if monthFirstStr !== ''}
  55453. 当前选定了:
  55454. <span class="mr-2 text-primary dark:text-dark">{monthFirstStr}</span>
  55455. {:else}
  55456. <div>请选定时间</div>
  55457. {/if}
  55458. </div>
  55459. <Cell title="返回时间月份在前" onclick={() => (visible16 = true)} />
  55460. <TimePicker bind:visible={visible16} type="YYYYMMDD" outFormat="MM/DD/YYYY" onconfirm={(timeStr) => (monthFirstStr = timeStr)} />
  55461. <div class="px-4 text-xs">
  55462. 当前选定了:<br />
  55463. <span class="mr-2 break-words text-primary dark:text-dark">{timeObjStr}</span>
  55464. </div>
  55465. <Cell title="返回时间对象" onclick={() => (visible17 = true)} />
  55466. <TimePicker bind:visible={visible17} onconfirm={(_, obj) => (timeObj = obj)} />
  55467. <Cell title="顶部来点圆角" onclick={() => (visible14 = true)} />
  55468. <TimePicker bind:visible={visible14} popup={{ radius: 'xl' }} />
  55469. <Cell title="自定义标题" onclick={() => (visible18 = true)} />
  55470. <TimePicker bind:visible={visible18} title="请选择时间" />
  55471. <Cell title="指定初始选定年份" onclick={() => (visible19 = true)} />
  55472. <TimePicker bind:visible={visible19} initYear="2020" />
  55473. <Cell title="指定初始选定月份" onclick={() => (visible20 = true)} />
  55474. <TimePicker bind:visible={visible20} initMonth="05" />
  55475. <Cell title="指定初始选定时分秒" onclick={() => (visible21 = true)} />
  55476. <TimePicker bind:visible={visible21} initHour="05" initMinute="05" initSecond="05" />
  55477. </div>
  55478. ================================================
  55479. FILE: packages/stdf/src/routes/toast/en_US/+page.svelte
  55480. ================================================
  55481. <!-- Toast Demo -->
  55482. <script lang="ts">
  55483. import { Toast, Cell, Button, Loading } from '$lib/index.js';
  55484. let visible1 = $state(false);
  55485. let visible2 = $state(false);
  55486. let visible3 = $state(false);
  55487. let visible4 = $state(false);
  55488. let visible5 = $state(false);
  55489. let visible6 = $state(false);
  55490. let visible7 = $state(false);
  55491. let visible8 = $state(false);
  55492. let visible9 = $state(false);
  55493. let visible10 = $state(false);
  55494. let visible11 = $state(false);
  55495. let visible12 = $state(false);
  55496. let visible13 = $state(false);
  55497. let visible14 = $state(false);
  55498. let visible15 = $state(false);
  55499. let visible16 = $state(false);
  55500. let visible17 = $state(false);
  55501. let visible18 = $state(false);
  55502. let visible19 = $state(false);
  55503. let visible20 = $state(false);
  55504. let visible21 = $state(false);
  55505. let visible22 = $state(false);
  55506. let visible23 = $state(false);
  55507. let visible24 = $state(false);
  55508. let visible25 = $state(false);
  55509. let visible26 = $state(false);
  55510. let visible27 = $state(false);
  55511. let visible28 = $state(false);
  55512. let visible29 = $state(false);
  55513. let visible30 = $state(false);
  55514. let visible31 = $state(false);
  55515. let visible32 = $state(false);
  55516. let time = $state(4);
  55517. let timer: ReturnType<typeof setInterval>;
  55518. const useSnippetFun = () => {
  55519. visible25 = true;
  55520. timer = setInterval(() => {
  55521. time--;
  55522. if (time <= 0) {
  55523. clearInterval(timer!);
  55524. visible25 = false;
  55525. time = 3;
  55526. }
  55527. }, 1000);
  55528. };
  55529. </script>
  55530. <div class="py-4">
  55531. <Cell title="Basic usage" onclick={() => (visible1 = true)} />
  55532. <Toast bind:visible={visible1} message="Light hint" />
  55533. <Cell title="Long text prompt" onclick={() => (visible2 = true)} />
  55534. <Toast
  55535. bind:visible={visible2}
  55536. message="When the character count is too long, it is generally not recommended to display too much content here!"
  55537. />
  55538. <Cell title="Do not block clicks" onclick={() => (visible3 = true)} />
  55539. <Toast bind:visible={visible3} clickable message="The content below the mask can also be clicked" />
  55540. <Cell title="Fixed display time" onclick={() => (visible4 = true)} />
  55541. <Toast bind:visible={visible4} duration={6000} message="It turns off automatically after 6 seconds" />
  55542. <Cell title="Non-automatic closing" onclick={() => (visible5 = true)} />
  55543. <Toast
  55544. bind:visible={visible5}
  55545. duration={0}
  55546. clickable
  55547. message="This prompt will not automatically close, please click the button to close"
  55548. />
  55549. <Cell title="Success message" onclick={() => (visible6 = true)} />
  55550. <Toast bind:visible={visible6} type="success" message="Success message" />
  55551. <Cell title="Failure prompt" onclick={() => (visible7 = true)} />
  55552. <Toast bind:visible={visible7} type="error" message="Failure prompt" />
  55553. <Cell title="Warning prompt" onclick={() => (visible8 = true)} />
  55554. <Toast bind:visible={visible8} type="warning" message="Warning prompt" />
  55555. <Cell title="Information prompt" onclick={() => (visible9 = true)} />
  55556. <Toast bind:visible={visible9} type="info" message="Information prompt" />
  55557. <Cell title="Load prompt" onclick={() => (visible30 = true)} />
  55558. <Toast bind:visible={visible30} type="loading" message="Under load..." />
  55559. <Cell title="Theme color loading prompt" onclick={() => (visible31 = true)} />
  55560. <Toast bind:visible={visible31} type="loading" loading={{ theme: true }} message="Under load..." />
  55561. <Cell title="Loading prompt for # 1_3" onclick={() => (visible32 = true)} />
  55562. <Toast bind:visible={visible32} type="loading" loading={{ type: '1_3' }} message="Under load..." />
  55563. <Cell title="Custom type" onclick={() => (visible27 = true)} />
  55564. <Toast bind:visible={visible27} type="icon" icon={{ name: 'ri-thumb-up-fill' }} message="You are so good!" />
  55565. <Cell title="The mask is opaque" onclick={() => (visible10 = true)} />
  55566. <Toast bind:visible={visible10} mask={{ opacity: '0.3' }} message="Mask transparency is 0.3" />
  55567. <Cell title="Reverse color mask" onclick={() => (visible11 = true)} />
  55568. <Toast bind:visible={visible11} mask={{ inverse: true, opacity: '0.5' }} message="Reverse color mask" />
  55569. <Cell title="Mask blur" onclick={() => (visible12 = true)} />
  55570. <Toast bind:visible={visible12} mask={{ opacity: '0', backdropBlur: 'sm' }} message="The content below the mask is blurry" />
  55571. <Cell title="Faster transition" onclick={() => (visible13 = true)} />
  55572. <Toast bind:visible={visible13} transitionParams={{ duration: 150 }} message="The transition time is 150ms" />
  55573. <Cell title="Slow transition" onclick={() => (visible14 = true)} />
  55574. <Toast bind:visible={visible14} transitionParams={{ duration: 1000 }} message="The transition time is 1s" />
  55575. <Cell title="Fade in" onclick={() => (visible15 = true)} />
  55576. <Toast bind:visible={visible15} transitionType="fade" message="Fade in presentation" />
  55577. <Cell title="Move down" onclick={() => (visible16 = true)} />
  55578. <Toast bind:visible={visible16} transitionType="fly" transitionParams={{ y: -150 }} message="Move down into presentation" />
  55579. <Cell title="Move in to the right" onclick={() => (visible17 = true)} />
  55580. <Toast bind:visible={visible17} transitionType="fly" transitionParams={{ x: -150 }} message="Move right into presentation" />
  55581. <Cell title="expansion" onclick={() => (visible18 = true)} />
  55582. <Toast bind:visible={visible18} transitionType="slide" message="Unfold and present" />
  55583. <Cell title="blur" onclick={() => (visible19 = true)} />
  55584. <Toast bind:visible={visible19} transitionType="blur" transitionParams={{ duration: 1000 }} message="Fuzzy rendering" />
  55585. <Cell title="No transition" onclick={() => (visible20 = true)} />
  55586. <Toast bind:visible={visible20} transitionType={null} message="Direct presentation without transition" />
  55587. <Cell title="Exit zoom animation" onclick={() => (visible28 = true)} />
  55588. <Toast bind:visible={visible28} outDuration={300} message="The zoom animation time on exit is 300ms" />
  55589. <Cell title="Exit Move out animation" onclick={() => (visible29 = true)} />
  55590. <Toast
  55591. bind:visible={visible29}
  55592. outDuration={300}
  55593. transitionType="fly"
  55594. transitionParams={{ y: -150 }}
  55595. message="When exiting, move out animation time is 300ms"
  55596. />
  55597. <Cell title="Delayed occurrence" onclick={() => (visible21 = true)} />
  55598. <Toast bind:visible={visible21} transitionParams={{ delay: 1000 }} message="Click for 1 second and then display" />
  55599. <Cell title="top" onclick={() => (visible22 = true)} />
  55600. <Toast bind:visible={visible22} position="top" message="Tips at the top" />
  55601. <Cell title="bottom" onclick={() => (visible23 = true)} />
  55602. <Toast bind:visible={visible23} position="bottom" message="Tips at the bottom" />
  55603. <Cell title="Top increase distance" onclick={() => (visible24 = true)} />
  55604. <Toast bind:visible={visible24} position="top" py="40" message="The tip is at the top and the distance is increased" />
  55605. <Cell title="use Snippet" onclick={useSnippetFun} />
  55606. <Toast bind:visible={visible25} duration={0}>
  55607. <div class="flex flex-col space-y-4">
  55608. <div>Customize the prompt content</div>
  55609. <Loading inverse />
  55610. <div>Close in {time} seconds</div>
  55611. </div>
  55612. </Toast>
  55613. <Cell title="Different styles of rounded corners" onclick={() => (visible26 = true)} />
  55614. <Toast bind:visible={visible26} radius="xl" message="Rounded corners were added" />
  55615. </div>
  55616. <div class="sticky bottom-0 z-10 flex bg-white/50 backdrop-blur-sm dark:bg-black/50">
  55617. <div class="flex-1">
  55618. <Button fill="lineTheme" onclick={() => (visible5 = false)}>Manual shutdown</Button>
  55619. </div>
  55620. </div>
  55621. ================================================
  55622. FILE: packages/stdf/src/routes/toast/zh_CN/+page.svelte
  55623. ================================================
  55624. <!-- Toast Demo -->
  55625. <script lang="ts">
  55626. import { Toast, Cell, Button, Loading } from '$lib/index.js';
  55627. let visible1 = $state(false);
  55628. let visible2 = $state(false);
  55629. let visible3 = $state(false);
  55630. let visible4 = $state(false);
  55631. let visible5 = $state(false);
  55632. let visible6 = $state(false);
  55633. let visible7 = $state(false);
  55634. let visible8 = $state(false);
  55635. let visible9 = $state(false);
  55636. let visible10 = $state(false);
  55637. let visible11 = $state(false);
  55638. let visible12 = $state(false);
  55639. let visible13 = $state(false);
  55640. let visible14 = $state(false);
  55641. let visible15 = $state(false);
  55642. let visible16 = $state(false);
  55643. let visible17 = $state(false);
  55644. let visible18 = $state(false);
  55645. let visible19 = $state(false);
  55646. let visible20 = $state(false);
  55647. let visible21 = $state(false);
  55648. let visible22 = $state(false);
  55649. let visible23 = $state(false);
  55650. let visible24 = $state(false);
  55651. let visible25 = $state(false);
  55652. let visible26 = $state(false);
  55653. let visible27 = $state(false);
  55654. let visible28 = $state(false);
  55655. let visible29 = $state(false);
  55656. let visible30 = $state(false);
  55657. let visible31 = $state(false);
  55658. let visible32 = $state(false);
  55659. let time = $state(4);
  55660. let timer: ReturnType<typeof setInterval>;
  55661. const useSnippetFun = () => {
  55662. visible25 = true;
  55663. timer = setInterval(() => {
  55664. time--;
  55665. if (time <= 0) {
  55666. clearInterval(timer!);
  55667. visible25 = false;
  55668. time = 3;
  55669. }
  55670. }, 1000);
  55671. };
  55672. </script>
  55673. <div class="py-4">
  55674. <Cell title="基础用法" onclick={() => (visible1 = true)} />
  55675. <Toast bind:visible={visible1} message="轻提示" />
  55676. <Cell title="长文本提示" onclick={() => (visible2 = true)} />
  55677. <Toast bind:visible={visible2} message="当字符数过长时换行,一般不建议在这里显示太多的内容!" />
  55678. <Cell title="不阻止点击" onclick={() => (visible3 = true)} />
  55679. <Toast bind:visible={visible3} clickable message="遮罩下层内容还可以点击" />
  55680. <Cell title="固定显示时间" onclick={() => (visible4 = true)} />
  55681. <Toast bind:visible={visible4} duration={6000} message="6 秒后自动关闭" />
  55682. <Cell title="不自动关闭" onclick={() => (visible5 = true)} />
  55683. <Toast bind:visible={visible5} duration={0} clickable message="此提示不会自动关闭,请点击按钮关闭" />
  55684. <Cell title="成功提示" onclick={() => (visible6 = true)} />
  55685. <Toast bind:visible={visible6} type="success" message="成功提示" />
  55686. <Cell title="失败提示" onclick={() => (visible7 = true)} />
  55687. <Toast bind:visible={visible7} type="error" message="失败提示" />
  55688. <Cell title="警告提示" onclick={() => (visible8 = true)} />
  55689. <Toast bind:visible={visible8} type="warning" message="警告提示" />
  55690. <Cell title="信息提示" onclick={() => (visible9 = true)} />
  55691. <Toast bind:visible={visible9} type="info" message="信息提示" />
  55692. <Cell title="加载提示" onclick={() => (visible30 = true)} />
  55693. <Toast bind:visible={visible30} type="loading" message="加载中..." />
  55694. <Cell title="主题色加载提示" onclick={() => (visible31 = true)} />
  55695. <Toast bind:visible={visible31} type="loading" loading={{ theme: true }} message="加载中..." />
  55696. <Cell title="1_3 号加载提示" onclick={() => (visible32 = true)} />
  55697. <Toast bind:visible={visible32} type="loading" loading={{ type: '1_3' }} message="加载中..." />
  55698. <Cell title="自定义类型" onclick={() => (visible27 = true)} />
  55699. <Toast bind:visible={visible27} type="icon" icon={{ name: 'ri-thumb-up-fill' }} message="你真棒!" />
  55700. <Cell title="遮罩不透明" onclick={() => (visible10 = true)} />
  55701. <Toast bind:visible={visible10} mask={{ opacity: '0.3' }} message="遮罩透明度为 0.3" />
  55702. <Cell title="反色遮罩" onclick={() => (visible11 = true)} />
  55703. <Toast bind:visible={visible11} mask={{ inverse: true, opacity: '0.5' }} message="反色遮罩" />
  55704. <Cell title="遮罩模糊" onclick={() => (visible12 = true)} />
  55705. <Toast bind:visible={visible12} mask={{ opacity: '0', backdropBlur: 'sm' }} message="遮罩下层内容模糊" />
  55706. <Cell title="过渡较快" onclick={() => (visible13 = true)} />
  55707. <Toast bind:visible={visible13} transitionParams={{ duration: 150 }} message="过渡时间为 150ms" />
  55708. <Cell title="过渡较慢" onclick={() => (visible14 = true)} />
  55709. <Toast bind:visible={visible14} transitionParams={{ duration: 1000 }} message="过渡时间为 1s" />
  55710. <Cell title="淡入" onclick={() => (visible15 = true)} />
  55711. <Toast bind:visible={visible15} transitionType="fade" message="淡入呈现" />
  55712. <Cell title="向下移入" onclick={() => (visible16 = true)} />
  55713. <Toast bind:visible={visible16} transitionType="fly" transitionParams={{ y: -150 }} message="向下移入呈现" />
  55714. <Cell title="向右移入" onclick={() => (visible17 = true)} />
  55715. <Toast bind:visible={visible17} transitionType="fly" transitionParams={{ x: -150 }} message="向右移入呈现" />
  55716. <Cell title="展开" onclick={() => (visible18 = true)} />
  55717. <Toast bind:visible={visible18} transitionType="slide" message="展开呈现" />
  55718. <Cell title="模糊" onclick={() => (visible19 = true)} />
  55719. <Toast bind:visible={visible19} transitionType="blur" transitionParams={{ duration: 1000 }} message="模糊呈现" />
  55720. <Cell title="无过渡" onclick={() => (visible20 = true)} />
  55721. <Toast bind:visible={visible20} transitionType={null} message="无过渡直接呈现" />
  55722. <Cell title="退出缩放动画" onclick={() => (visible28 = true)} />
  55723. <Toast bind:visible={visible28} outDuration={300} message="退出时缩放动画时间为 300ms" />
  55724. <Cell title="退出移出动画" onclick={() => (visible29 = true)} />
  55725. <Toast
  55726. bind:visible={visible29}
  55727. outDuration={300}
  55728. transitionType="fly"
  55729. transitionParams={{ y: -150 }}
  55730. message="退出时移出动画时间为 300ms"
  55731. />
  55732. <Cell title="延时出现" onclick={() => (visible21 = true)} />
  55733. <Toast bind:visible={visible21} transitionParams={{ delay: 1000 }} message="点击 1s 之后呈现" />
  55734. <Cell title="顶部" onclick={() => (visible22 = true)} />
  55735. <Toast bind:visible={visible22} position="top" message="提示位于顶部" />
  55736. <Cell title="底部" onclick={() => (visible23 = true)} />
  55737. <Toast bind:visible={visible23} position="bottom" message="提示位于底部" />
  55738. <Cell title="顶部增加距离" onclick={() => (visible24 = true)} />
  55739. <Toast bind:visible={visible24} position="top" py="40" message="提示位于顶部且增加了距离" />
  55740. <Cell title="使用 Snippet" onclick={useSnippetFun} />
  55741. <Toast bind:visible={visible25} duration={0}>
  55742. <div class="flex flex-col space-y-4">
  55743. <div>自定义提示内容</div>
  55744. <Loading inverse />
  55745. <div>{time} 秒后关闭</div>
  55746. </div>
  55747. </Toast>
  55748. <Cell title="不同圆角风格" onclick={() => (visible26 = true)} />
  55749. <Toast bind:visible={visible26} radius="xl" message="加大了圆角" />
  55750. </div>
  55751. <div class="sticky bottom-0 z-10 flex bg-white/50 backdrop-blur-sm dark:bg-black/50">
  55752. <div class="flex-1">
  55753. <Button fill="lineTheme" onclick={() => (visible5 = false)}>手动关闭</Button>
  55754. </div>
  55755. </div>
  55756. ================================================
  55757. FILE: packages/stdf/static/404.html
  55758. ================================================
  55759. <!doctype html>
  55760. <html>
  55761. <head>
  55762. <meta charset="utf-8" />
  55763. <title>Single Page Apps for GitHub Pages</title>
  55764. <script type="text/javascript">
  55765. // Single Page Apps for GitHub Pages
  55766. // MIT License
  55767. // https://github.com/rafgraph/spa-github-pages
  55768. // This script takes the current url and converts the path and query
  55769. // string into just a query string, and then redirects the browser
  55770. // to the new url with only a query string and hash fragment,
  55771. // e.g. https://www.foo.tld/one/two?a=b&c=d#qwe, becomes
  55772. // https://www.foo.tld/?/one/two&a=b~and~c=d#qwe
  55773. // Note: this 404.html file must be at least 512 bytes for it to work
  55774. // with Internet Explorer (it is currently > 512 bytes)
  55775. // If you're creating a Project Pages site and NOT using a custom domain,
  55776. // then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1).
  55777. // This way the code will only replace the route part of the path, and not
  55778. // the real directory in which the app resides, for example:
  55779. // https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
  55780. // https://username.github.io/repo-name/?/one/two&a=b~and~c=d#qwe
  55781. // Otherwise, leave pathSegmentsToKeep as 0.
  55782. var pathSegmentsToKeep = 0;
  55783. var l = window.location;
  55784. l.replace(
  55785. l.protocol +
  55786. '//' +
  55787. l.hostname +
  55788. (l.port ? ':' + l.port : '') +
  55789. l.pathname
  55790. .split('/')
  55791. .slice(0, 1 + pathSegmentsToKeep)
  55792. .join('/') +
  55793. '/?/' +
  55794. l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
  55795. (l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
  55796. l.hash,
  55797. );
  55798. </script>
  55799. </head>
  55800. <body></body>
  55801. </html>
  55802. ================================================
  55803. FILE: packages/stdf/static/.nojekyll
  55804. ================================================
  55805. ================================================
  55806. FILE: packages/stdf/static/fonts/Trueno.otf
  55807. ================================================
  55808. [Non-text file]
  55809. ================================================
  55810. FILE: packages/stdf/.github/workflows/releases-demo.yml
  55811. ================================================
  55812. # 将 Demo 静态内容部署到 GitHub Pages 的简易工作流程
  55813. name: RELEASES DEMO
  55814. on:
  55815. push:
  55816. branches: 'main'
  55817. jobs:
  55818. build_site:
  55819. runs-on: ubuntu-latest
  55820. steps:
  55821. - name: Checkout
  55822. uses: actions/checkout@v4
  55823. - name: Setup Bun
  55824. uses: oven-sh/setup-bun@v2
  55825. with:
  55826. bun-version: 'latest'
  55827. - name: Install dependencies
  55828. run: bun i
  55829. - name: build
  55830. env:
  55831. BASE_PATH: '/demo-stdf'
  55832. run: |
  55833. bun run build
  55834. - name: Upload Artifacts
  55835. uses: actions/upload-pages-artifact@v3
  55836. with:
  55837. path: 'build/'
  55838. deploy:
  55839. needs: build_site
  55840. runs-on: ubuntu-latest
  55841. permissions:
  55842. pages: write
  55843. id-token: write
  55844. environment:
  55845. name: github-pages
  55846. url: ${{ steps.deployment.outputs.page_url }}
  55847. steps:
  55848. - name: Deploy
  55849. id: deployment
  55850. uses: actions/deploy-pages@v4
  55851. ================================================
  55852. FILE: packages/vscode-extension/README.md
  55853. ================================================
  55854. [简体中文](https://github.com/any-tdf/stdf/blob/main/packages/vscode-extension/README_CN.md)
  55855. # Introduction
  55856. A VS Code extension that provides convenience when developing with [STDF](https://stdf.design).
  55857. # Installation
  55858. Search for `STDF for VS Code` in the VS Code extensions marketplace and click install, or install [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension) from the marketplace.
  55859. # Features
  55860. When hovering over the name of an STDF component, the following information will be displayed:
  55861. - The API of this component.
  55862. - The example/API/guide of this component on the STDF official website.
  55863. - The source code of this component on GitHub/Gitee.
  55864. ![TIP](https://stdf.design/assets/vscode/tip.png)
  55865. or
  55866. ![TIP](https://stdf.design/assets/vscode/tip2.png)
  55867. # Configuration
  55868. The default API display is in Simplified Chinese. You can enable English API in the VS Code settings.
  55869. ![SETTING](https://stdf.design/assets/vscode/setting.png)
  55870. # License
  55871. This project is licensed under the [MIT License](https://github.com/any-tdf/stdf/blob/main/LICENSE).
  55872. ================================================
  55873. FILE: packages/vscode-extension/CHANGELOG.md
  55874. ================================================
  55875. > No change log version, it means that it is just updated with the STDF version and the plug-in itself is not updated.
  55876. ## 0.0.30
  55877. - Support STDF v1.x.
  55878. ## 0.0.28
  55879. - Support STDF next.
  55880. ## 0.0.24
  55881. - Update icon.
  55882. ## 0.0.18
  55883. - Fixed the problem that STDF cannot be queried for the latest version, such as offline use.
  55884. ## 0.0.17
  55885. - Fixed the latest version detection problem.
  55886. ## 0.0.9
  55887. - Format source code.
  55888. - Display the current version and the latest version of STDF.
  55889. ## 0.0.8
  55890. - Optimized GitHub Actions configuration.
  55891. ## 0.0.7
  55892. - Added direct link to the corresponding component content on the STDF official website at the bottom of the tooltip.
  55893. - Added direct link to the source code of the corresponding component on GitHub/Gitee at the bottom of the tooltip.
  55894. ## 0.0.6
  55895. - Add README.
  55896. ## 0.0.1
  55897. - Init version.
  55898. ================================================
  55899. FILE: packages/vscode-extension/CHANGELOG_CN.md
  55900. ================================================
  55901. > 没有写更新日志的版本,表示只是跟随 STDF 版本更新,未对插件本身进行更新。
  55902. ## 0.0.30
  55903. - 支持 STDF v1.x。
  55904. ## 0.0.28
  55905. - 支持 STDF next。
  55906. ## 0.0.24
  55907. - 更新图标。
  55908. ## 0.0.18
  55909. - 修复无法查询 STDF 最新版本问题,如离线使用。
  55910. ## 0.0.17
  55911. - 修复最新版本检测问题。
  55912. ## 0.0.9
  55913. - 格式化源码。
  55914. - 显示 STDF 当前版本与最新版本。
  55915. ## 0.0.8
  55916. - 优化 GitHub Actions 配置。
  55917. ## 0.0.7
  55918. - 悬浮窗底部增加直接跳转 STDF 官网对应组件内容。
  55919. - 悬浮窗底部增加直接跳转 STDF 对应组件源码(GitHub/Gitee)。
  55920. ## 0.0.6
  55921. - 增加 README。
  55922. ## 0.0.1
  55923. - 初始版本。
  55924. ================================================
  55925. FILE: packages/vscode-extension/package.json
  55926. ================================================
  55927. {
  55928. "name": "stdf-vscode-extension",
  55929. "displayName": "STDF for VS Code",
  55930. "description": "A VS Code extension to facilitate STDF development",
  55931. "version": "0.0.34",
  55932. "publisher": "STDF",
  55933. "icon": "./src/assets/stdf-vscode-extension.png",
  55934. "main": "./src/extension.js",
  55935. "type": "module",
  55936. "engines": {
  55937. "vscode": "^1.27.0"
  55938. },
  55939. "scripts": {
  55940. "files": "node scripts/files.js",
  55941. "package": "vsce package",
  55942. "publish": "vsce publish"
  55943. },
  55944. "categories": [
  55945. "Programming Languages"
  55946. ],
  55947. "activationEvents": [
  55948. "onLanguage:svelte"
  55949. ],
  55950. "sponsor": {
  55951. "url": "https://stdf.design?fund"
  55952. },
  55953. "keywords": [
  55954. "svelte",
  55955. "stdf",
  55956. "component",
  55957. "api",
  55958. "javascript"
  55959. ],
  55960. "contributes": {
  55961. "commands": [],
  55962. "configuration": {
  55963. "type": "object",
  55964. "title": "STDF",
  55965. "properties": {
  55966. "STDF.English": {
  55967. "type": "boolean",
  55968. "default": false,
  55969. "description": "Whether to enable English or not in stdf-vscode-extension"
  55970. }
  55971. }
  55972. }
  55973. },
  55974. "devDependencies": {
  55975. "vscode": "^1.1.37"
  55976. },
  55977. "repository": {
  55978. "type": "git",
  55979. "url": "https://github.com/any-tdf/stdf/tree/main/packages/vscode-extension"
  55980. },
  55981. "bugs": {
  55982. "url": "https://github.com/any-tdf/stdf/issues?q=is:issue+is:open+vscode"
  55983. },
  55984. "homepage": "https://github.com/any-tdf/stdf/tree/main/packages/vscode-extension/README.md",
  55985. "LICENSE": "https://github.com/any-tdf/stdf/blob/main/LICENSE"
  55986. }
  55987. ================================================
  55988. FILE: packages/vscode-extension/README_CN.md
  55989. ================================================
  55990. [English](https://github.com/any-tdf/stdf/blob/main/packages/vscode-extension/README.md)
  55991. # 介绍
  55992. 一个 VS Code 插件,用于在使用 [STDF](https://stdf.design) 开发时提供一些便利。
  55993. # 安装
  55994. 在 VS Code 插件中搜索 `STDF for VS Code` 点击安装,或到 VS Code 插件市场安装 [STDF for VS Code](https://marketplace.visualstudio.com/items?itemName=STDF.stdf-vscode-extension)。
  55995. # 功能
  55996. 光标悬浮于 STDF 组件名称上时悬浮显示。
  55997. - 此组件 API。
  55998. - 直接打开 STDF 官网此组件的示例/API/指南。
  55999. - 直接打开 STDF 此组件源码(GitHub/Gitee)。
  56000. ![TIP](https://stdf.design/assets/vscode/tip.png)
  56001. 或者
  56002. ![TIP](https://stdf.design/assets/vscode/tip2.png)
  56003. # 配置
  56004. 默认显示的 API 为简体中文,可到 VS Code 的设置页开启英文 API。
  56005. ![SETTING](https://stdf.design/assets/vscode/setting.png)
  56006. # 许可证
  56007. 本项目基于 [MIT 许可证](https://github.com/any-tdf/stdf/blob/main/LICENSE)。
  56008. ================================================
  56009. FILE: packages/vscode-extension/scripts/files.js
  56010. ================================================
  56011. import fs from 'node:fs';
  56012. // 创建 src/docs/components 目录
  56013. // Create src/docs/components directory
  56014. const createDoc = () => {
  56015. fs.mkdirSync('src/docs');
  56016. fs.mkdirSync('src/docs/components');
  56017. console.log('🎉 src/docs/components create success!');
  56018. };
  56019. // 将 ../../docs/mds/components/**/api.md 和 ../../docs/mds/components/**/api_en.md 文件复制到 src/docs/components/**/ 目录下
  56020. // Copy ../../docs/mds/components/**/api.md and ../../docs/mds/components/**/api_en.md files to src/docs/components/**/ directory
  56021. const copyDoc = () => {
  56022. const components = fs.readdirSync('../../docs/mds/components');
  56023. // 如果 components 有 .DS_Store 文件,删除
  56024. // If components has .DS_Store file, delete
  56025. if (components.includes('.DS_Store')) {
  56026. components.splice(components.indexOf('.DS_Store'), 1);
  56027. }
  56028. for (const component of components) {
  56029. const files = fs.readdirSync(`../../docs/mds/components/${component}`);
  56030. fs.mkdirSync(`src/docs/components/${component}`);
  56031. for (const file of files) {
  56032. if (file === 'api.md' || file === 'api_en.md') {
  56033. fs.copyFileSync(`../../docs/mds/components/${component}/${file}`, `src/docs/components/${component}/${file}`);
  56034. }
  56035. }
  56036. }
  56037. console.log(`🎉 Total copy ${components.length}*2 files!`);
  56038. };
  56039. // 复制 ../../docs/site/src/data/menuList.ts 文件到 src 目录下
  56040. // Copy ../../docs/site/src/data/menuList.ts file to src directory
  56041. const copyMenuList = () => {
  56042. // 读取 ../../docs/site/src/data/menuList.ts 文件
  56043. const menuList = fs.readFileSync('../../docs/site/src/data/menuList.ts', 'utf-8');
  56044. console.log(menuList);
  56045. // 将其中的部分内容替换为另一个文件中的内容
  56046. // Replace the content of the file with the content of another file
  56047. const newMenuList = menuList.replace(
  56048. `export type MenuListChild = {
  56049. title: string;
  56050. title_zh: string;
  56051. title_en: string;
  56052. nav: string;
  56053. tip: string;
  56054. tip_en: string;
  56055. alias: string;
  56056. };
  56057. export type MenuList = { class: string; class_en: string; childs: MenuListChild[] };
  56058. export const menuList: MenuList[] = [`,
  56059. 'export default ['
  56060. );
  56061. fs.writeFileSync('./src/menuList.js', newMenuList);
  56062. console.log('🎉 menuList copy success!');
  56063. };
  56064. // 复制 ../../LICENSE 文件到 ./ 目录下
  56065. // Copy ../../LICENSE file to ./ directory
  56066. const copyLicense = () => {
  56067. fs.copyFileSync('../../LICENSE', './LICENSE');
  56068. console.log('🎉 LICENSE copy success!');
  56069. };
  56070. createDoc();
  56071. copyDoc();
  56072. copyMenuList();
  56073. copyLicense();
  56074. ================================================
  56075. FILE: packages/vscode-extension/src/extension.js
  56076. ================================================
  56077. import vscode from 'vscode';
  56078. import path from 'node:path';
  56079. import { exec } from 'node:child_process';
  56080. // 组件列表
  56081. // components list
  56082. import menuList from './menuList';
  56083. const componentList = ArrChildFun(menuList);
  56084. async function activate() {
  56085. // 如果没有设置,返回 undefined
  56086. // If not set, return undefined
  56087. const result = vscode.workspace.getConfiguration().get('STDF');
  56088. // 获取插件语言
  56089. // Get plugin language
  56090. const isZh = !result.English;
  56091. // 读取当前工程的 package.json 文件
  56092. // Read the package.json file of the current project
  56093. const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
  56094. const packageJson = workspaceFolder
  56095. ? await import(path.join(workspaceFolder.uri.fsPath, 'package.json'), { assert: { type: 'json' } })
  56096. : null;
  56097. // 判断当前工程是否引入了 stdf 组件库
  56098. // Determine whether the current project has introduced the stdf component library
  56099. const isImportStdf = !!(packageJson?.dependencies?.stdf || packageJson?.devDependencies?.stdf);
  56100. // 如果 isImportStdf 为 true 时,读取 stdf 组件库的版本号做为当前版本号
  56101. // If isImportStdf is true, read the version number of the stdf component library as the current version number
  56102. let currentVersion = isImportStdf ? packageJson.dependencies?.stdf || packageJson.devDependencies?.stdf : '';
  56103. // 如果 currentVersion 开头为 ^,则去掉 ^
  56104. // If currentVersion starts with ^, remove ^
  56105. if (currentVersion.startsWith('^')) {
  56106. currentVersion = currentVersion.slice(1);
  56107. }
  56108. // stdf 组件库的最新版本号
  56109. // The latest version number of the stdf component library
  56110. const latestVersion = (await getLatestVersion('stdf')) || (isZh ? '获取失败' : 'Failed to get');
  56111. // 当前文件是 .svelte 文件时且 isImportStdf 为 true 时,才注册悬浮提示
  56112. // When the current file is a .svelte file and isImportStdf is true, register the hover prompt
  56113. if (vscode.window.activeTextEditor.document.languageId === 'svelte' && isImportStdf) {
  56114. vscode.languages.registerHoverProvider('svelte', {
  56115. provideHover: async (document, position) => {
  56116. // 获取当前悬浮的单词
  56117. // Get the word currently hovering
  56118. const word = document.getText(document.getWordRangeAtPosition(position));
  56119. // 将单词首字母小写
  56120. // Lowercase the first letter of the word
  56121. const wordLower = word.charAt(0).toLowerCase() + word.slice(1);
  56122. // 如果单词为 components 数组中的一项,则显示提示信息,内容为 ./doc/components/${wordLower}/api.md 文件的内容
  56123. // If the word is an item in the components array, display the prompt information, and the content is the content of the ./doc/components/${wordLower}/api.md file
  56124. if (componentList.includes(word)) {
  56125. // 组合当前 STDF 版本和最新版本
  56126. // Combine the current STDF version and the latest version
  56127. const versionContent = `STDF ${isZh ? '当前' : 'Current'}:${currentVersion} &nbsp; ${
  56128. isZh ? '最新' : 'Latest'
  56129. }:${latestVersion} &nbsp; [${isZh ? '查看更新日志' : 'See changelog'}](https://stdf.design/guide/changelog)`;
  56130. // 获取对应组件的 api.md 文件的路径
  56131. // Get the path of the api.md file of the corresponding component
  56132. const apiPath = path.join(__dirname, `./docs/components/${wordLower}/api${isZh ? '' : '_en'}.md`);
  56133. // 读取 api.md 文件的内容
  56134. // Read the contents of the api.md file
  56135. const fs = await import('node:fs/promises');
  56136. const apiContent = await fs.readFile(apiPath, 'utf-8');
  56137. // 在 apiContent 后面添加示例、API、指南、组件源码的链接
  56138. // Add links to examples, API, guides, and component source code after apiContent
  56139. const baseUrl = 'https://stdf.design/components?nav=';
  56140. const baseUrlCode = 'https://github.com/any-tdf/stdf/blob/main/packages/stdf/components/';
  56141. const baseUrlCodeGitee = 'https://gitee.com/dufu1991/stdf/blob/main/packages/stdf/components/';
  56142. const addContent = `**[${isZh ? '示例' : 'Demo'}](${baseUrl}${wordLower}&tab=0&lang=${
  56143. isZh ? 'zh_CN' : 'en_US'
  56144. }) &nbsp; [API](${baseUrl}${wordLower}&tab=1&lang=${isZh ? 'zh_CN' : 'en_US'}) &nbsp; [${
  56145. isZh ? '指南' : 'Guide'
  56146. }](${baseUrl}${wordLower}&tab=2&lang=${isZh ? 'zh_CN' : 'en_US'}) &nbsp; [${
  56147. isZh ? '更新日志' : 'Changelog'
  56148. }](${baseUrl}${wordLower}&tab=4&lang=${isZh ? 'zh_CN' : 'en_US'}) &nbsp; [${
  56149. isZh ? '源码 (GitHub)' : 'Source code(GitHub)'
  56150. }](${baseUrlCode}${wordLower}/${word}.svelte) &nbsp; [${
  56151. isZh ? '源码 (Gitee)' : 'Source code(Gitee)'
  56152. }](${baseUrlCodeGitee}${wordLower}/${word}.svelte)**`;
  56153. const allContent = `${versionContent}
  56154. ---
  56155. ${apiContent}
  56156. ---
  56157. ${addContent}
  56158. ---`;
  56159. // 返回提示信息
  56160. // Return prompt information
  56161. return new vscode.Hover(allContent);
  56162. }
  56163. },
  56164. });
  56165. }
  56166. }
  56167. //数组处理
  56168. //Array processing
  56169. function ArrChildFun(arr) {
  56170. const newArr = [];
  56171. for (let e = 0; e < arr.length; e++) {
  56172. newArr.push(...arr[e].childs);
  56173. }
  56174. //再将 newArr 内的 title_en 组成一维数组
  56175. //Then the title_en in newArr is composed of one-dimensional array
  56176. const newArr2 = [];
  56177. for (let e = 0; e < newArr.length; e++) {
  56178. newArr2.push(newArr[e].title_en);
  56179. }
  56180. return newArr2;
  56181. }
  56182. // 获取指定 npm 包的最新版本号
  56183. // Get the latest version number of the specified npm package
  56184. async function getLatestVersion(packageName) {
  56185. return new Promise(resolve => {
  56186. exec(`npm show ${packageName} version`, (error, stdout, stderr) => {
  56187. if (error || stderr) {
  56188. resolve(null);
  56189. } else {
  56190. resolve(stdout.trim());
  56191. }
  56192. });
  56193. });
  56194. }
  56195. function deactivate() {}
  56196. module.exports = {
  56197. activate,
  56198. deactivate,
  56199. };
  56200. ================================================
  56201. FILE: .github/CONTRIBUTING.md
  56202. ================================================
  56203. [简体中文](https://stdf.design/guide/contribution?lang=zh_CN)
  56204. ## Introduction
  56205. Thank you for using STDF.
  56206. Below are guidelines for submitting feedback or code to STDF. Before submitting an issue or PR to STDF, please take a few minutes to read the following.
  56207. ## Issue Guidelines
  56208. - When encountering an issue, please first confirm whether the issue has already been recorded in the issue or has been fixed.
  56209. - When submitting an issue, please describe the issue briefly in language and add the environment and replication steps when the issue occurs.
  56210. ## Local Development
  56211. Before local development, please make sure that [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en) or [Bun](https://bun.sh) are installed in your development environment.
  56212. Debugging STDF requires an engineering environment. For this purpose, a simple Demo project is provided. STDF itself is not limited by the Node version, and the Demo uses Vite for development, so please ensure that your Node.js version >= 14.18+, refer to the [Vite official website](https://cn.vitejs.dev/guide/#scaffolding-your-first-vite-project).
  56213. Before submitting a PR after you have made code modifications, please ensure that you have formatted the code and passed the code formatting check. You can install relevant editor plugins or use the command line for code formatting.
  56214. Recommended installations:
  56215. - [pnpm](https://pnpm.io): Package management tool, no need to install when using Bun.
  56216. - [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) or [Svelte](https://plugins.jetbrains.com/plugin/12375-svelte): Svelte development plugin.
  56217. - [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/tailwind-css.html): Tailwind CSS development plugin.
  56218. - [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/eslint.html): Code formatting check plugin.
  56219. - [Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) or [WebStorm integration](https://www.jetbrains.com/help/webstorm/prettier.html): Code formatting plugin.
  56220. > Because the rollup-plugin-stdf-icon packages that the demo depends on are locally built, please build this packages first.
  56221. <!-- :::code-groups -->
  56222. <!-- pnpm -->
  56223. ```sh
  56224. ## 1. Clone the STDF repository and enter
  56225. git clone git@github.com:any-tdf/stdf.git
  56226. cd stdf
  56227. ## 2. Build the rollup-plugin-stdf-icon package
  56228. cd packages/rollup-plugin-stdf-icon
  56229. ## Install dependencies
  56230. pnpm i
  56231. ## Build package
  56232. pnpm build
  56233. ## 3. Use the Demo project to debug STDF
  56234. cd demo
  56235. ## Install dependencies
  56236. pnpm i
  56237. ## Start Demo
  56238. pnpm dev
  56239. ```
  56240. <!-- :: -->
  56241. <!-- npm -->
  56242. ```sh
  56243. ## 1. Clone the STDF repository and enter
  56244. git clone git@github.com:any-tdf/stdf.git
  56245. cd stdf
  56246. ## 2. Build the rollup-plugin-stdf-icon package
  56247. cd packages/rollup-plugin-stdf-icon
  56248. ## Install dependencies
  56249. npm i
  56250. ## Build package
  56251. npm run build
  56252. ## 3. Use the Demo project to debug STDF
  56253. cd demo
  56254. ## Install dependencies
  56255. npm i
  56256. ## Start Demo
  56257. npm run dev
  56258. ```
  56259. <!-- :: -->
  56260. <!-- bun -->
  56261. ```sh
  56262. ## 1. Clone the STDF repository and enter
  56263. git clone git@github.com:any-tdf/stdf.git
  56264. cd stdf
  56265. ## 2. Build the rollup-plugin-stdf-icon package
  56266. cd packages/rollup-plugin-stdf-icon
  56267. ## Install dependencies
  56268. bun i
  56269. ## Build package
  56270. bun build
  56271. ## 3. Use the Demo project to debug STDF
  56272. cd demo
  56273. ## Install dependencies
  56274. bun i
  56275. ## Start Demo
  56276. bun dev
  56277. ```
  56278. <!-- :: -->
  56279. <!-- yarn -->
  56280. ```sh
  56281. ## 1. Clone the STDF repository and enter
  56282. git clone git@github.com:any-tdf/stdf.git
  56283. cd stdf
  56284. ## 2. Build the rollup-plugin-stdf-icon package
  56285. cd packages/rollup-plugin-stdf-icon
  56286. ## Install dependencies
  56287. yarn
  56288. ## Build package
  56289. yarn build
  56290. ## 3. Use the Demo project to debug STDF
  56291. cd demo
  56292. ## Install dependencies
  56293. yarn
  56294. ## Start Demo
  56295. yarn dev
  56296. ```
  56297. <!-- ::: -->
  56298. After the startup is successful, you can open `http://localhost:8888` in the browser to view the effect. Please switch the developer tools of the browser to the mobile mode.
  56299. You can modify the component source code under the `packages/stdf/components` directory and view the modification effect in real-time. Note that both VS Code and WebStorm support directly jumping to the component source code when calling the component.
  56300. If you don't want to develop locally, you can choose to use StackBlitz to debug online. Just open [STDF Demo](https://stackblitz.com/github/any-tdf/demo-stdf?startScript=dev_en) to start online debugging.
  56301. ## Submitting PR
  56302. If you are submitting a Pull Request on GitHub for the first time, you can read the following two articles to learn:
  56303. - [First Contributions](https://github.com/firstcontributions/first-contributions/blob/main/translations/README.zh-cn.md)
  56304. - [How to contribute code elegantly on GitHub](https://segmentfault.com/a/1190000000736629)
  56305. ### Process
  56306. - Please fork a copy of [STDF](https://github.com/any-tdf/stdf) to your own repository. If you have already forked, please synchronize the latest code from the main repository.
  56307. - Clone your repository to your local machine.
  56308. - Modify the component source code and verify it in the Demo.
  56309. - 「Optional」Supplement the Chinese and English documentation for this modification, which is located in the `doc/components` directory. Depending on the specific modification content, you may need to modify the api, FAQ, guide, version, and other documents. For modifications to version, please add tags. Please refer to the [STDF Version tag](https://github.com/any-tdf/stdf/blob/main/doc/components/button/version.md?plain=1) for specific details.
  56310. - Go to the root directory of the repository and execute `pnpm i` or `npm i` or `bun i` to install dependencies.
  56311. - Use your editor to format the modified code or execute `pnpm run format` or `npm run format` in the command line to format the code.
  56312. - Execute `pnpm run lint` or `npm run lint` to check the code formatting.
  56313. - Commit the modified content to your repository and then submit a Pull Request to the main repository.
  56314. - The Pull Request will be merged into the main repository after it passes the review and a new version will be released subsequently.
  56315. ### Notes
  56316. When submitting a Pull Request, please note:
  56317. - Keep your PR small enough, generally one PR only solves a single component file, solves a single problem, or adds a single function, to facilitate review.
  56318. - When adding or modifying existing components, remember to verify it in the Demo to ensure the stability of the code.
  56319. - Please add a suitable description in the PR. If there is a related issue, please indicate it.
  56320. ================================================
  56321. FILE: .github/FUNDING.yml
  56322. ================================================
  56323. # These are supported funding model platforms
  56324. github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
  56325. patreon: # Replace with a single Patreon username
  56326. open_collective: # Replace with a single Open Collective username
  56327. ko_fi: # Replace with a single Ko-fi username
  56328. tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
  56329. community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
  56330. liberapay: # Replace with a single Liberapay username
  56331. issuehunt: # Replace with a single IssueHunt username
  56332. otechie: # Replace with a single Otechie username
  56333. custom: ['https://stdf.design?fund']
  56334. ================================================
  56335. FILE: .github/PULL_REQUEST_TEMPLATE.md
  56336. ================================================
  56337. Before submitting a pull request, please read the [contributing guide](https://stdf.design/guide/contribution).
  56338. 在提交 pull request 之前,请阅读 [贡献指南](https://stdf.design/guide/contribution)。
  56339. ================================================
  56340. FILE: .github/ISSUE_TEMPLATE/bug_report.yml
  56341. ================================================
  56342. name: 🐞 Bug Report
  56343. description: Report an issue with STDF
  56344. title: '[Bug]: '
  56345. labels: ['bug']
  56346. body:
  56347. - type: markdown
  56348. attributes:
  56349. value: |
  56350. Thank you for taking the time to fill out this bug report! If you have a usage question or are unsure if it's really a bug, please make sure:
  56351. - You are using the latest version of the code.
  56352. - You have checked the open and closed issues to see if your issue has already been reported.
  56353. - If there is a similar issue in the issues list, please provide additional information in the corresponding issue.
  56354. - Your description of the problem is concise and clear, not just from your own perspective.
  56355. - type: dropdown
  56356. id: module
  56357. attributes:
  56358. label: Module
  56359. description: Which module does this bug belong to?
  56360. options:
  56361. - stdf (STDF component)
  56362. - create (create-stdf scaffolding)
  56363. - vscode (STDF VS Code plugin)
  56364. - icon (rollup-plugin-stdf-icon plugin)
  56365. - md (rollup-plugin-md-ts plugin)
  56366. - demo (STDF demo)
  56367. - doc (STDF site and documentation)
  56368. - other (other)
  56369. validations:
  56370. required: true
  56371. - type: input
  56372. id: version
  56373. attributes:
  56374. label: Version
  56375. description: If it is stdf/create/icon/vscode/md, please indicate the version in which this bug occurred.
  56376. validations:
  56377. required: false
  56378. - type: textarea
  56379. id: bug-description
  56380. attributes:
  56381. label: Bug Description
  56382. description: Please describe the bug clearly and concisely.
  56383. placeholder: When...
  56384. validations:
  56385. required: true
  56386. - type: textarea
  56387. id: reproduction
  56388. attributes:
  56389. label: Reproduction
  56390. description: You can use text/images/short videos to explain how to reproduce the issue, but please provide a series of information about the environment where the problem occurs, such as device model and version, operating system and version, browser, etc. You can also use [StackBlitz](https://stackblitz.com) or [CodePen](https://codepen.io) or other online IDEs to quickly create a project to demonstrate the bug. In short, make it easy for others to understand how to reproduce the bug.
  56391. placeholder: On iPhone 13 Pro with iOS 16...
  56392. validations:
  56393. required: true
  56394. - type: textarea
  56395. id: idea
  56396. attributes:
  56397. label: Your Idea
  56398. description: If you have a solution or idea for this bug, you can describe it here.
  56399. placeholder: I think...
  56400. validations:
  56401. required: false
  56402. ================================================
  56403. FILE: .github/ISSUE_TEMPLATE/bug_report_CN.yml
  56404. ================================================
  56405. name: 🐞 缺陷报告
  56406. description: 报告 STDF 问题
  56407. title: '[Bug]: '
  56408. labels: ['bug']
  56409. body:
  56410. - type: markdown
  56411. attributes:
  56412. value: |
  56413. 感谢您抽出时间填写这份错误报告!如果您有使用问题,或者不确定是否真的是一个错误,请确保:
  56414. - 你使用的是最新版代码。
  56415. - 你已经查看过开启与关闭状态的 issues ,其中并没有你发现的此问题。
  56416. - 如果 issues 中已有相同问题,你需要补充,请尽量在对应的 issue 中补充讨论。
  56417. - 你对问题的表述简洁清晰,不只在你的情景角度能理解。
  56418. - type: dropdown
  56419. id: module
  56420. attributes:
  56421. label: 模块
  56422. description: 此缺陷属于哪个模块?
  56423. options:
  56424. - stdf (STDF 组件)
  56425. - create (create-stdf 脚手架)
  56426. - vscode (STDF VS Code 插件)
  56427. - icon (rollup-plugin-stdf-icon 插件)
  56428. - md (rollup-plugin-md-ts 插件)
  56429. - demo (STDF demo)
  56430. - doc (STDF 站点与文档)
  56431. - other (其他)
  56432. validations:
  56433. required: true
  56434. - type: input
  56435. id: version
  56436. attributes:
  56437. label: 版本
  56438. description: 如果是选择的是 stdf、create、icon、vscode、md,请注明此缺陷出现的版本。
  56439. validations:
  56440. required: false
  56441. - type: textarea
  56442. id: bug-description
  56443. attributes:
  56444. label: 描述缺陷
  56445. description: 请清晰简明地描述清楚该缺陷内容。
  56446. placeholder: 当...
  56447. validations:
  56448. required: true
  56449. - type: textarea
  56450. id: reproduction
  56451. attributes:
  56452. label: 复现
  56453. description: 你可以使用文字/图片/简短视频说清楚如何复现此问题,但请尽量说清设备型号与版本、操作系统与版本、浏览器等一系列出现问题的环境。也可以使用 [StackBlitz](https://stackblitz.com) 或者 [CodePen](https://codepen.io) 或其他在线 IDE 快速创建一个工程展示此缺陷。总之让别人能快速明白此缺陷的复现情况。
  56454. placeholder: 在 iPhone 13 Pro 的 iOS 16...
  56455. validations:
  56456. required: true
  56457. - type: textarea
  56458. id: idea
  56459. attributes:
  56460. label: 你的想法
  56461. description: 如果你对该缺陷有解决方案或思路,可以在这里描述。
  56462. placeholder: 我认为...
  56463. validations:
  56464. required: false
  56465. ================================================
  56466. FILE: .github/ISSUE_TEMPLATE/feature_request.yml
  56467. ================================================
  56468. name: 👏 Feature Request
  56469. description: Submit a request for a new feature
  56470. title: '[Feature]: '
  56471. labels: ['enhancement']
  56472. body:
  56473. - type: markdown
  56474. attributes:
  56475. value: |
  56476. Thank you for taking the time to fill out this feature request! If you have a new idea or are unsure if it can be implemented, please make sure:
  56477. - You have checked the latest version of the code and confirmed that the feature does not exist.
  56478. - You have checked the open and closed issues to see if the feature you want to add has been described.
  56479. - If there is a similar feature request in the issues list, please provide additional information in the corresponding issue.
  56480. - Your description of the new feature is concise and clear, not just from your own perspective.
  56481. - type: dropdown
  56482. id: module
  56483. attributes:
  56484. label: Module
  56485. description: Which module does this new feature belong to?
  56486. options:
  56487. - stdf (STDF component)
  56488. - create (create-stdf scaffolding)
  56489. - vscode (STDF VS Code plugin)
  56490. - icon (rollup-plugin-stdf-icon plugin)
  56491. - md (rollup-plugin-md-ts plugin)
  56492. - demo (STDF demo)
  56493. - doc (STDF site and documentation)
  56494. - other (other)
  56495. validations:
  56496. required: true
  56497. - type: textarea
  56498. id: description
  56499. attributes:
  56500. label: Feature Description
  56501. description: Please describe the new feature clearly and concisely.
  56502. placeholder: When...
  56503. validations:
  56504. required: true
  56505. - type: textarea
  56506. id: example
  56507. attributes:
  56508. label: Example
  56509. description: You can provide some similar implementations in other projects to help others understand your idea.
  56510. placeholder: In...
  56511. validations:
  56512. required: false
  56513. - type: textarea
  56514. id: idea
  56515. attributes:
  56516. label: Your Idea
  56517. description: If you have any implementation ideas or thoughts about the new feature, you can describe them here.
  56518. placeholder: I think...
  56519. validations:
  56520. required: false
  56521. ================================================
  56522. FILE: .github/ISSUE_TEMPLATE/feature_request_CN.yml
  56523. ================================================
  56524. name: 👏 功能新增
  56525. description: 提交一个新功能的需求
  56526. title: '[Feature]: '
  56527. labels: ['enhancement']
  56528. body:
  56529. - type: markdown
  56530. attributes:
  56531. value: |
  56532. 感谢您抽出时间填写这份新功能请求报告!如果您有新的想法,或者不确定是否能实现,请确保:
  56533. - 你已经查看最新版代码无此功能。
  56534. - 你已经查看过开启与关闭状态的 issues ,其中并没有你想增加的功能描述。
  56535. - 如果 issues 中已有相同新功能,你需要补充,请尽量在对应的 issue 中补充讨论。
  56536. - 你对新功能的表述简洁清晰,不只在你的情景角度能理解。
  56537. - type: dropdown
  56538. id: module
  56539. attributes:
  56540. label: 模块
  56541. description: 此新功能属于哪个模块?
  56542. options:
  56543. - stdf (STDF 组件)
  56544. - create (create-stdf 脚手架)
  56545. - vscode (STDF VS Code 插件)
  56546. - icon (rollup-plugin-stdf-icon 插件)
  56547. - md (rollup-plugin-md-ts 插件)
  56548. - demo (STDF demo)
  56549. - doc (STDF 站点与文档)
  56550. - other (其他)
  56551. validations:
  56552. required: true
  56553. - type: textarea
  56554. id: description
  56555. attributes:
  56556. label: 新功能描述
  56557. description: 请清晰简明地描述清楚该新功能内容。
  56558. placeholder: 当...
  56559. validations:
  56560. required: true
  56561. - type: textarea
  56562. id: example
  56563. attributes:
  56564. label: 示例
  56565. description: 你可以给出一些在其他项目中类似的实现,方便大家理解你的想法。
  56566. placeholder: 在...
  56567. validations:
  56568. required: false
  56569. - type: textarea
  56570. id: idea
  56571. attributes:
  56572. label: 你的想法
  56573. description: 如果你对新功能有实现思路或任何想法,可以在这里描述。
  56574. placeholder: 我认为...
  56575. validations:
  56576. required: false
  56577. ================================================
  56578. FILE: .github/workflows/publish-create.yml
  56579. ================================================
  56580. # 当分支 main 有 push 事件并且此次 push 包含了 packages/create-stdf/package.json 文件时,执行以下任务
  56581. name: PUBLISH CREATE
  56582. on:
  56583. push:
  56584. branches:
  56585. - main
  56586. paths:
  56587. - 'packages/create-stdf/package.json'
  56588. jobs:
  56589. publish:
  56590. runs-on: ubuntu-latest
  56591. permissions:
  56592. id-token: write
  56593. contents: write
  56594. steps:
  56595. - name: Checkout
  56596. uses: actions/checkout@v4
  56597. - name: Setup Node.js environment
  56598. uses: actions/setup-node@v3
  56599. with:
  56600. node-version: 20.x
  56601. # 将 LICENSE 复制到 packages/create-stdf 目录下
  56602. # cd packages/create-stdf 目录下
  56603. # 安装依赖 npm install
  56604. # 打包 npm run build
  56605. # 执行 npm run update
  56606. # 发布 create-stdf 到 npm
  56607. - name: Publish
  56608. run: |
  56609. cp LICENSE packages/create-stdf/LICENSE
  56610. cd packages/create-stdf
  56611. npm install
  56612. npm run build
  56613. npm run update
  56614. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56615. npm publish --provenance
  56616. env:
  56617. CI: true
  56618. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56619. ================================================
  56620. FILE: .github/workflows/publish-icon-0.x.yml
  56621. ================================================
  56622. # 当分支 0.x 有 push 事件并且此次 push 包含了 packages/rollup-plugin-stdf-icon/package.json 文件时,执行以下任务
  56623. name: PUBLISH ICON 0.x
  56624. on:
  56625. push:
  56626. branches:
  56627. - 0.x
  56628. paths:
  56629. - 'packages/rollup-plugin-stdf-icon/package.json'
  56630. jobs:
  56631. publish:
  56632. runs-on: ubuntu-latest
  56633. permissions:
  56634. id-token: write
  56635. contents: write
  56636. steps:
  56637. - name: Checkout
  56638. uses: actions/checkout@v4
  56639. - name: Setup Node.js environment
  56640. uses: actions/setup-node@v3
  56641. with:
  56642. node-version: 20.x
  56643. # 将 LICENSE 复制到 packages/rollup-plugin-stdf-icon 目录下
  56644. # cd packages/rollup-plugin-stdf-icon 目录下
  56645. # 安装依赖 npm install
  56646. # 打包 npm run build
  56647. # 发布 rollup-plugin-stdf-icon 到 npm
  56648. - name: Publish
  56649. run: |
  56650. cp LICENSE packages/rollup-plugin-stdf-icon/LICENSE
  56651. cd packages/rollup-plugin-stdf-icon
  56652. npm install
  56653. npm run build
  56654. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56655. npm publish --provenance
  56656. env:
  56657. CI: true
  56658. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56659. ================================================
  56660. FILE: .github/workflows/publish-icon.yml
  56661. ================================================
  56662. # 当分支 main 有 push 事件并且此次 push 包含了 packages/rollup-plugin-stdf-icon/package.json 文件时,执行以下任务
  56663. name: PUBLISH ICON
  56664. on:
  56665. push:
  56666. branches:
  56667. - main
  56668. paths:
  56669. - 'packages/rollup-plugin-stdf-icon/package.json'
  56670. jobs:
  56671. publish:
  56672. runs-on: ubuntu-latest
  56673. permissions:
  56674. id-token: write
  56675. contents: write
  56676. steps:
  56677. - name: Checkout
  56678. uses: actions/checkout@v4
  56679. - name: Setup Node.js environment
  56680. uses: actions/setup-node@v3
  56681. with:
  56682. node-version: 20.x
  56683. # 将 LICENSE 复制到 packages/rollup-plugin-stdf-icon 目录下
  56684. # cd packages/rollup-plugin-stdf-icon 目录下
  56685. # 安装依赖 npm install
  56686. # 打包 npm run build
  56687. # 发布 rollup-plugin-stdf-icon 到 npm
  56688. - name: Publish
  56689. run: |
  56690. cp LICENSE packages/rollup-plugin-stdf-icon/LICENSE
  56691. cd packages/rollup-plugin-stdf-icon
  56692. npm install
  56693. npm run build
  56694. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56695. npm publish --provenance
  56696. env:
  56697. CI: true
  56698. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56699. ================================================
  56700. FILE: .github/workflows/publish-md-0.x.yml
  56701. ================================================
  56702. # 当分支 0.x 有 push 事件并且此次 push 包含了 packages/rollup-plugin-md-ts/package.json 文件时,执行以下任务
  56703. name: PUBLISH MD 0.x
  56704. on:
  56705. push:
  56706. branches:
  56707. - 0.x
  56708. paths:
  56709. - 'packages/rollup-plugin-md-ts/package.json'
  56710. jobs:
  56711. publish:
  56712. runs-on: ubuntu-latest
  56713. permissions:
  56714. id-token: write
  56715. contents: write
  56716. steps:
  56717. - name: Checkout
  56718. uses: actions/checkout@v4
  56719. - name: Setup Node.js environment
  56720. uses: actions/setup-node@v3
  56721. with:
  56722. node-version: 20.x
  56723. # 将 LICENSE 复制到 packages/rollup-plugin-md-ts 目录下
  56724. # cd packages/rollup-plugin-md-ts 目录下
  56725. # 安装依赖 npm install
  56726. # 打包 npm run build
  56727. # 发布 rollup-plugin-md-ts 到 npm
  56728. - name: Publish
  56729. run: |
  56730. cp LICENSE packages/rollup-plugin-md-ts/LICENSE
  56731. cd packages/rollup-plugin-md-ts
  56732. npm install
  56733. npm run build
  56734. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56735. npm publish --tag=0.x --provenance
  56736. env:
  56737. CI: true
  56738. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56739. ================================================
  56740. FILE: .github/workflows/publish-md.yml
  56741. ================================================
  56742. # 当分支 main 有 push 事件并且此次 push 包含了 packages/rollup-plugin-md-ts/package.json 文件时,执行以下任务
  56743. name: PUBLISH MD
  56744. on:
  56745. push:
  56746. branches:
  56747. - main
  56748. paths:
  56749. - 'packages/rollup-plugin-md-ts/package.json'
  56750. jobs:
  56751. publish:
  56752. runs-on: ubuntu-latest
  56753. permissions:
  56754. id-token: write
  56755. contents: write
  56756. steps:
  56757. - name: Checkout
  56758. uses: actions/checkout@v4
  56759. - name: Setup Node.js environment
  56760. uses: actions/setup-node@v3
  56761. with:
  56762. node-version: 20.x
  56763. # 将 LICENSE 复制到 packages/rollup-plugin-md-ts 目录下
  56764. # cd packages/rollup-plugin-md-ts 目录下
  56765. # 安装依赖 npm install
  56766. # 打包 npm run build
  56767. # 发布 rollup-plugin-md-ts 到 npm
  56768. - name: Publish
  56769. run: |
  56770. cp LICENSE packages/rollup-plugin-md-ts/LICENSE
  56771. cd packages/rollup-plugin-md-ts
  56772. npm install
  56773. npm run build
  56774. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56775. npm publish --provenance
  56776. env:
  56777. CI: true
  56778. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56779. ================================================
  56780. FILE: .github/workflows/publish-stdf-0.x.yml
  56781. ================================================
  56782. # 当分支 0.x 有 push 事件并且此次 push 包含了 packages/stdf/package.json 文件时,执行以下任务
  56783. name: PUBLISH STDF 0.x
  56784. on:
  56785. push:
  56786. branches:
  56787. - 0.x
  56788. paths:
  56789. - 'packages/stdf/package.json'
  56790. jobs:
  56791. publish:
  56792. runs-on: ubuntu-latest
  56793. permissions:
  56794. id-token: write
  56795. contents: write
  56796. steps:
  56797. - name: Checkout
  56798. uses: actions/checkout@v4
  56799. - name: Setup Node.js environment
  56800. uses: actions/setup-node@v3
  56801. with:
  56802. node-version: 20.x
  56803. # 将 README.md 和 LICENSE 复制到 packages/stdf 目录下
  56804. - name: Copy Files
  56805. run: |
  56806. cp README.md packages/stdf/README.md
  56807. cp LICENSE packages/stdf/LICENSE
  56808. # cd packages/stdf 目录下
  56809. # 发布 stdf 到 npm
  56810. - name: Publish
  56811. run: |
  56812. cd packages/stdf
  56813. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56814. npm publish --tag=0.x --provenance
  56815. env:
  56816. CI: true
  56817. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56818. ================================================
  56819. FILE: .github/workflows/publish-stdf.yml
  56820. ================================================
  56821. # 当分支 main 有 push 事件并且此次 push 包含了 packages/stdf/package.json 文件时,执行以下任务
  56822. name: PUBLISH STDF
  56823. on:
  56824. push:
  56825. branches:
  56826. - main
  56827. paths:
  56828. - 'packages/stdf/package.json'
  56829. jobs:
  56830. publish:
  56831. runs-on: ubuntu-latest
  56832. permissions:
  56833. id-token: write
  56834. contents: write
  56835. steps:
  56836. - name: Checkout
  56837. uses: actions/checkout@v4
  56838. - name: Setup Node.js environment
  56839. uses: actions/setup-node@v3
  56840. with:
  56841. node-version: 20.x
  56842. # 将 README.md 和 LICENSE 复制到 packages/stdf 目录下
  56843. - name: Copy Files
  56844. run: |
  56845. cp README.md packages/stdf/README.md
  56846. cp LICENSE packages/stdf/LICENSE
  56847. # 打包 packages/rollup-plugin-stdf-icon 并构建
  56848. - name: Build rollup-plugin-stdf-icon
  56849. run: |
  56850. cd packages/rollup-plugin-stdf-icon
  56851. npm install
  56852. npm run build
  56853. cd ../../
  56854. # cd packages/stdf 目录下
  56855. # 发布 stdf 到 npm
  56856. - name: Publish
  56857. run: |
  56858. cd packages/stdf
  56859. npm install
  56860. npm run package
  56861. npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
  56862. npm publish --provenance
  56863. env:
  56864. CI: true
  56865. NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
  56866. ================================================
  56867. FILE: .github/workflows/publish-vscode-0.x.yml
  56868. ================================================
  56869. # 当分支 0.x 有 push 事件并且此次 push 包含了 packages/vscode-extension/package.json 文件时,执行以下任务
  56870. name: PUBLISH VSCODE 0.x
  56871. on:
  56872. push:
  56873. branches:
  56874. - 0.x
  56875. paths:
  56876. - 'packages/vscode-extension/package.json'
  56877. jobs:
  56878. publish:
  56879. runs-on: ubuntu-latest
  56880. steps:
  56881. - name: Checkout
  56882. uses: actions/checkout@v4
  56883. - name: Setup Node.js environment
  56884. uses: actions/setup-node@v3
  56885. with:
  56886. node-version: 20.x
  56887. # cd 到 packages/vscode-extension 目录
  56888. # 执行 files
  56889. # 安装依赖
  56890. - name: Publish
  56891. run: |
  56892. cd packages/vscode-extension
  56893. npm run files
  56894. npm install
  56895. npm install -g @vscode/vsce
  56896. vsce publish -p ${{ secrets.VSCE_TOKEN }}
  56897. ================================================
  56898. FILE: .github/workflows/publish-vscode.yml
  56899. ================================================
  56900. # 当分支 main 有 push 事件并且此次 push 包含了 packages/vscode-extension/package.json 文件时,执行以下任务
  56901. name: PUBLISH VSCODE
  56902. on:
  56903. push:
  56904. branches:
  56905. - main
  56906. paths:
  56907. - 'packages/vscode-extension/package.json'
  56908. jobs:
  56909. publish:
  56910. runs-on: ubuntu-latest
  56911. steps:
  56912. - name: Checkout
  56913. uses: actions/checkout@v4
  56914. - name: Setup Node.js environment
  56915. uses: actions/setup-node@v3
  56916. with:
  56917. node-version: 20.x
  56918. # cd 到 packages/vscode-extension 目录
  56919. # 执行 files
  56920. # 安装依赖
  56921. - name: Publish
  56922. run: |
  56923. cd packages/vscode-extension
  56924. npm run files
  56925. npm install
  56926. npm install -g @vscode/vsce
  56927. vsce publish -p ${{ secrets.VSCE_TOKEN }}
  56928. ================================================
  56929. FILE: .github/workflows/releases-0.x.yml
  56930. ================================================
  56931. # 当分支 0.x 有 push 事件,并且此次 push 包含了 packages/stdf/package.json 文件时,执行以下任务
  56932. name: RELEASES 0.x
  56933. on:
  56934. push:
  56935. branches:
  56936. - 0.x
  56937. paths:
  56938. - 'packages/stdf/package.json'
  56939. jobs:
  56940. releases:
  56941. runs-on: ubuntu-latest
  56942. steps:
  56943. - name: Checkout
  56944. uses: actions/checkout@v4
  56945. # 1. 读取 packages/stdf/package.json 中的 version 字段,作为 Releases tag 和 Releases title
  56946. - name: Get version
  56947. id: version
  56948. run: |
  56949. echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  56950. # 2. 读取 doc/guide/changelog.md 的第一行内容中 ‘##’ 与 ‘<font’ 之间的内容,再去除空格
  56951. - name: Get md_version
  56952. id: md_version
  56953. run: |
  56954. echo md_version=$(cat doc/guide/changelog.md | head -1 | sed 's/## //g' | sed 's/<font.*>//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  56955. # 3. 读取 doc/guide/changelog_en.md 的第一行内容中 ‘##’ 与 ‘<font’ 之间的内容,再去除空格
  56956. - name: Get md_version_en
  56957. id: md_version_en
  56958. run: |
  56959. echo md_version_en=$(cat doc/guide/changelog_en.md | head -1 | sed 's/## //g' | sed 's/<font.*>//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  56960. # 4. 比较 Get version 与 Get md_version 和 Get md_version_en 三者的输出内容,如果不相同则此次不需要发布 Release,退出
  56961. - name: Check version
  56962. run: |
  56963. if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version.outputs.md_version }} ]]; then
  56964. echo "This is not a tag push. Skipping."
  56965. exit 78
  56966. fi
  56967. if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version_en.outputs.md_version_en }} ]]; then
  56968. echo "This is not a tag push. Skipping."
  56969. exit 78
  56970. fi
  56971. # 5. 读取 doc/guide/changelog.md 中前两个二级标题之间的内容,包含换行和空格
  56972. - name: Get changelog
  56973. id: changelog
  56974. run: |
  56975. echo 'changelog<<EOF' >> $GITHUB_OUTPUT
  56976. sed -n '1,/##/{/##/!p;}' doc/guide/changelog.md | sed '/^$/d' >> $GITHUB_OUTPUT
  56977. echo 'EOF' >> $GITHUB_OUTPUT
  56978. # 6. 读取 doc/guide/changelog_en.md 中第一个二级标题与第二个二级标题之间的内容,包含换行和空格
  56979. - name: Get changelog_en
  56980. id: changelog_en
  56981. run: |
  56982. echo 'changelog_en<<EOF' >> $GITHUB_OUTPUT
  56983. sed -n '1,/##/{/##/!p;}' doc/guide/changelog_en.md | sed '/^$/d' >> $GITHUB_OUTPUT
  56984. echo 'EOF' >> $GITHUB_OUTPUT
  56985. # 7. 作为 latest release 发布本次 Release,body 为 changelog 和 changelog_en 的合并内容,中间使用 --- 分隔
  56986. - name: Release
  56987. uses: actions/create-release@v1
  56988. env:
  56989. GITHUB_TOKEN: ${{ secrets.STDF_GITHUB_TOKEN }}
  56990. with:
  56991. tag_name: v${{ steps.version.outputs.version }}
  56992. release_name: v${{ steps.version.outputs.version }}
  56993. body: |
  56994. ${{ steps.changelog.outputs.changelog }}
  56995. ---
  56996. ${{ steps.changelog_en.outputs.changelog_en }}
  56997. draft: false
  56998. prerelease: false
  56999. ================================================
  57000. FILE: .github/workflows/releases-site.yml
  57001. ================================================
  57002. # 将静态内容部署到 GitHub Pages 的简易工作流程
  57003. name: RELEASES SITE
  57004. on:
  57005. # 仅在推送到默认分支且 docs 文件夹有变动时触发工作流
  57006. push:
  57007. branches:
  57008. - main
  57009. paths:
  57010. - 'docs/**'
  57011. # 这个选项可以使你手动在 Action tab 页面触发工作流
  57012. workflow_dispatch:
  57013. # 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages。
  57014. permissions:
  57015. contents: read
  57016. pages: write
  57017. id-token: write
  57018. # 允许一个并发的部署
  57019. concurrency:
  57020. group: 'pages'
  57021. cancel-in-progress: true
  57022. jobs:
  57023. # 单次部署的工作描述
  57024. deploy:
  57025. environment:
  57026. name: github-pages
  57027. url: ${{ steps.deployment.outputs.page_url }}
  57028. runs-on: ubuntu-latest
  57029. steps:
  57030. - name: Checkout
  57031. uses: actions/checkout@v4
  57032. - name: Set up Bun
  57033. uses: oven-sh/setup-bun@v2
  57034. with:
  57035. bun-version: 'latest'
  57036. - name: Build rollup-plugin-stdf-icon & stdf & rollup-plugin-md-ts
  57037. run: |
  57038. cd packages/rollup-plugin-stdf-icon
  57039. bun i
  57040. bun run build
  57041. cd ../stdf
  57042. bun i
  57043. bun run package
  57044. cd ../rollup-plugin-md-ts
  57045. bun i
  57046. bun run build
  57047. cd ../../
  57048. - name: Install dependencies and build
  57049. run: |
  57050. cd docs/site
  57051. bun i
  57052. bun run build
  57053. - name: Setup Pages
  57054. uses: actions/configure-pages@v4
  57055. - name: Upload artifact
  57056. uses: actions/upload-pages-artifact@v3
  57057. with:
  57058. path: './docs/site/build'
  57059. - name: Deploy to GitHub Pages
  57060. id: deployment
  57061. uses: actions/deploy-pages@v4
  57062. ================================================
  57063. FILE: .github/workflows/releases-stdf.yml
  57064. ================================================
  57065. # 当分支 main 有 push 事件,并且此次 push 包含了 packages/stdf/package.json 文件时,执行以下任务
  57066. name: RELEASES STDF
  57067. on:
  57068. workflow_dispatch:
  57069. push:
  57070. branches:
  57071. - main
  57072. paths:
  57073. - 'packages/stdf/package.json'
  57074. jobs:
  57075. releases:
  57076. runs-on: ubuntu-latest
  57077. steps:
  57078. - name: Checkout
  57079. uses: actions/checkout@v4
  57080. # 1. 读取 packages/stdf/package.json 中的 version 字段,作为 Releases tag 和 Releases title
  57081. - name: Get version
  57082. id: version
  57083. run: |
  57084. echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  57085. # 2. 读取 docs/mds/guide/changelog.md 的第一行内容中‘##’与‘<font’之间的内容,再去除空格
  57086. - name: Get md_version
  57087. id: md_version
  57088. run: |
  57089. echo md_version=$(cat docs/mds/guide/changelog.md | head -1 | sed 's/## //g' | sed 's/<font.*>//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  57090. # 3. 读取 docs/mds/guide/changelog_en.md 的第一行内容中‘##’与‘<font’之间的内容,再去除空格
  57091. - name: Get md_version_en
  57092. id: md_version_en
  57093. run: |
  57094. echo md_version_en=$(cat docs/mds/guide/changelog_en.md | head -1 | sed 's/## //g' | sed 's/<font.*>//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  57095. # 4. 比较 Get version 与 Get md_version 和 Get md_version_en 三者的输出内容,如果不相同则此次不需要发布 Release,退出
  57096. - name: Check version
  57097. run: |
  57098. if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version.outputs.md_version }} ]]; then
  57099. echo "This is not a tag push. Skipping."
  57100. exit 78
  57101. fi
  57102. if [[ ${{ steps.version.outputs.version }} != ${{ steps.md_version_en.outputs.md_version_en }} ]]; then
  57103. echo "This is not a tag push. Skipping."
  57104. exit 78
  57105. fi
  57106. # 5. 读取 docs/mds/guide/changelog.md 中前两个二级标题之间的内容,包含换行和空格
  57107. - name: Get changelog
  57108. id: changelog
  57109. run: |
  57110. echo 'changelog<<EOF' >> $GITHUB_OUTPUT
  57111. sed -n '1,/##/{/##/!p;}' docs/mds/guide/changelog.md | sed '/^$/d' >> $GITHUB_OUTPUT
  57112. echo 'EOF' >> $GITHUB_OUTPUT
  57113. # 6. 读取 docs/mds/guide/changelog_en.md 中第一个二级标题与第二个二级标题之间的内容,包含换行和空格
  57114. - name: Get changelog_en
  57115. id: changelog_en
  57116. run: |
  57117. echo 'changelog_en<<EOF' >> $GITHUB_OUTPUT
  57118. sed -n '1,/##/{/##/!p;}' docs/mds/guide/changelog_en.md | sed '/^$/d' >> $GITHUB_OUTPUT
  57119. echo 'EOF' >> $GITHUB_OUTPUT
  57120. # 7. 作为 latest release 发布本次 Release,body 为 changelog 和 changelog_en 的合并内容,中间使用 --- 分隔
  57121. - name: Release
  57122. uses: actions/create-release@v1
  57123. env:
  57124. GITHUB_TOKEN: ${{ secrets.STDF_GITHUB_TOKEN }}
  57125. with:
  57126. tag_name: v${{ steps.version.outputs.version }}
  57127. release_name: v${{ steps.version.outputs.version }}
  57128. body: |
  57129. ${{ steps.changelog.outputs.changelog }}
  57130. ---
  57131. ${{ steps.changelog_en.outputs.changelog_en }}
  57132. draft: false
  57133. prerelease: false
  57134. ================================================
  57135. FILE: .github/workflows/sync-demo-0.x.yml
  57136. ================================================
  57137. # 当分支 0.x 有 push 事件,并且此次 push 包含了 demo 目录下的文件时触发,使用 GitHub Actions 执行
  57138. name: SYNC DEMO 0.x
  57139. on:
  57140. workflow_dispatch:
  57141. push:
  57142. branches:
  57143. - 0.x
  57144. paths:
  57145. - 'demo/**'
  57146. jobs:
  57147. sync:
  57148. runs-on: ubuntu-latest
  57149. steps:
  57150. - name: Checkout
  57151. uses: actions/checkout@v4
  57152. # clone 仓库 github.com/any-tdf/stdf
  57153. - name: Clone stdf
  57154. uses: actions/checkout@v4
  57155. with:
  57156. repository: any-tdf/stdf
  57157. token: ${{ secrets.STDF_GITHUB_TOKEN }}
  57158. path: stdf
  57159. # 切换到 0.x 分支
  57160. - name: Checkout 0.x
  57161. run: |
  57162. git checkout 0.x
  57163. # 读取 packages/stdf/package.json 中的 version 字段,作为 stdf 的最新版本
  57164. - name: Get version
  57165. id: version
  57166. run: |
  57167. echo version=$(cat packages/stdf/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  57168. # 读取 packages/rollup-plugin-stdf-icon/package.json 中的 version 字段,作为 rollup-plugin-stdf-icon 的最新版本
  57169. - name: Get rollup-plugin-stdf-icon version
  57170. id: rollup-plugin-stdf-icon-version
  57171. run: |
  57172. echo rollup-plugin-stdf-icon-version=$(cat packages/rollup-plugin-stdf-icon/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') >> $GITHUB_OUTPUT
  57173. # 将 stdf/LICENSE 复制到 stdf/demo 目录下
  57174. # cd 到 stdf/demo 文件内,初始化本地仓库
  57175. # 将 demo/package.json 内的 "svelte" 前面增加一行 "stdf": "^${{ steps.version.outputs.version }}",
  57176. # 将 demo/package.json 内的 file:../packages/rollup-plugin-stdf-icon 替换为 ^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}
  57177. # 将 demo/src/routes/+layout.svelte 内的 "'../../../packages/stdf/components'" 替换为 "'stdf'"
  57178. # 将 demo/src/routes/+layout.svelte 内的 "'../../../packages/stdf/lang/zh_CN'" 替换为 "'stdf/lang/zh_CN'"
  57179. # 将 demo/src/routes/+layout.svelte 内的 "'../../../packages/stdf/lang/en_US'" 替换为 "'stdf/lang/en_US'"
  57180. # 将 demo/src/routes/+page.svelte 内的 "'../../../packages/stdf/components'" 替换为 "'stdf/lang/en_US'"
  57181. # 将 demo/src/routes/en_US/**/*.svelte 内的 "'../../../../../packages/stdf/components'" 替换为 "'stdf'"
  57182. # 将 demo/src/routes/zh_CN/**/*.svelte 内的 "'../../../../../packages/stdf/components'" 替换为 "'stdf'"
  57183. # 将 demo/src/routes/components/ThemeSwitch.svelte 内的 "'../../../../packages/stdf/theme'" 替换为 "'stdf/theme'"
  57184. # 讲 demo/src/data/themes/index.js 内的 "'../../../../packages/stdf/theme'" 替换为 "'stdf/theme'"
  57185. # 将 demo/tailwind.config.js 内的 "'../packages/stdf/**/*.svelte'" 替换为 "./node_modules/stdf/**/*.svelte'",注意其中特殊符号的转义
  57186. # 将 demo 目录下的所有文件提交到本地仓库,提交信息为 Github Actions auto commit: update demo from stdf.
  57187. - name: Init stdf demo
  57188. run: |
  57189. cp stdf/LICENSE stdf/demo/LICENSE
  57190. cd stdf/demo
  57191. git init
  57192. git config --global user.name 'GitHub Actions'
  57193. git config --global user.email 'GitHub Actions'
  57194. sed -i 's/"svelte"/"stdf": "^${{ steps.version.outputs.version }}",\n"svelte"/' package.json
  57195. sed -i 's/"svelte"/\t\t"svelte"/' package.json
  57196. sed -i 's#file:../packages/rollup-plugin-stdf-icon#^${{ steps.rollup-plugin-stdf-icon-version.outputs.rollup-plugin-stdf-icon-version }}#' package.json
  57197. sed -i 's#../../../packages/stdf/components#stdf#' src/routes/+layout.svelte
  57198. sed -i 's#../../../packages/stdf/lang/zh_CN#stdf/lang/zh_CN#' src/routes/+layout.svelte
  57199. sed -i 's#../../../packages/stdf/lang/en_US#stdf/lang/en_US#' src/routes/+layout.svelte
  57200. sed -i 's#../../../packages/stdf/components#stdf#' src/routes/+page.svelte
  57201. sed -i 's#../../../../../packages/stdf/components#stdf#' src/routes/en_US/**/*.svelte
  57202. sed -i 's#../../../../../packages/stdf/components#stdf#' src/routes/zh_CN/**/*.svelte
  57203. sed -i 's#../../../../packages/stdf/theme#stdf/theme#' src/routes/components/ThemeSwitch.svelte
  57204. sed -i 's#../../../../packages/stdf/theme#stdf/theme#' src/data/themes/index.js
  57205. sed -i 's|'\''../packages/stdf/\*\*/\*.svelte'\''|'\''.\/node_modules\/stdf\/\*\*\/\*.svelte'\''|g' tailwind.config.js
  57206. git add .
  57207. git commit -m "Github Actions auto commit: update demo from stdf."
  57208. # 将修改内容推送到 git@github.com:any-tdf/0.x-demo-stdf.git 的 0.x 分支
  57209. - name: Push to 0.x-demo-stdf
  57210. uses: ad-m/github-push-action@master
  57211. with:
  57212. github_token: ${{ secrets.STDF_GITHUB_TOKEN }}
  57213. branch: 0.x
  57214. force: true
  57215. directory: stdf/demo
  57216. repository: any-tdf/0.x-demo-stdf
  57217. ================================================
  57218. FILE: .github/workflows/sync-demo.yml
  57219. ================================================
  57220. # 当分支 main 分支有 push 事件,并且此次 push 包含了 packages/stdf 目录下的文件时触发,使用 GitHub Actions 执行
  57221. name: SYNC DEMO
  57222. on:
  57223. push:
  57224. branches:
  57225. - main
  57226. paths:
  57227. - 'packages/stdf/**'
  57228. jobs:
  57229. sync:
  57230. runs-on: ubuntu-latest
  57231. steps:
  57232. - name: Checkout
  57233. uses: actions/checkout@v4
  57234. # clone 仓库 github.com/any-tdf/stdf
  57235. - name: Clone stdf
  57236. uses: actions/checkout@v4
  57237. with:
  57238. repository: any-tdf/stdf
  57239. token: ${{ secrets.STDF_GITHUB_TOKEN }}
  57240. path: stdf
  57241. # 读取 packages/rollup-plugin-stdf-icon 中的 package.json 文件,获取 version 的值并存储到 version 变量中
  57242. - name: Read Icon version
  57243. run: |
  57244. version=$(cat packages/rollup-plugin-stdf-icon/package.json | grep -E '"version":' | awk -F'"' '{print $4}')
  57245. echo "version: $version"
  57246. echo "version=${version}" >> $GITHUB_ENV
  57247. # 初始化 stdf demo 仓库
  57248. # 将 stdf/LICENSE 复制到 stdf/packages/stdf/LICENSE
  57249. # 将 stdf/README.md 复制到 stdf/packages/stdf/README.md
  57250. # 将上一步获取的 version 字段前面增加 ^ 号,将 packages/stdf/package.json 中的 file:../rollup-plugin-stdf-icon 替换为 ^version
  57251. - name: Init stdf demo
  57252. run: |
  57253. cp stdf/LICENSE stdf/packages/stdf/LICENSE
  57254. cp stdf/README.md stdf/packages/stdf/README.md
  57255. sed -i "s|file:../rollup-plugin-stdf-icon|^${version}|g" stdf/packages/stdf/package.json
  57256. cd stdf/packages/stdf
  57257. git init
  57258. git config --global user.name 'GitHub Actions'
  57259. git config --global user.email 'GitHub Actions'
  57260. git add .
  57261. git commit -m "Github Actions auto commit: update demo from stdf."
  57262. # 将修改内容推送到 git@github.com:any-tdf/demo-stdf.git 的 main 分支
  57263. - name: Push to demo-stdf
  57264. uses: ad-m/github-push-action@master
  57265. with:
  57266. github_token: ${{ secrets.STDF_GITHUB_TOKEN }}
  57267. branch: main
  57268. force: true
  57269. directory: stdf/packages/stdf
  57270. repository: any-tdf/demo-stdf
  57271. ================================================
  57272. FILE: .github/workflows/sync-gitee.yml
  57273. ================================================
  57274. # 每天 3 点自动将 GitHub 仓库同步到 Gitee
  57275. name: SYNC GITEE
  57276. on:
  57277. schedule:
  57278. - cron: '0 3 * * *'
  57279. jobs:
  57280. sync:
  57281. runs-on: ubuntu-latest
  57282. steps:
  57283. - name: Black list
  57284. uses: Yikun/hub-mirror-action@master
  57285. with:
  57286. src: github/any-tdf
  57287. dst: gitee/dufu1991
  57288. dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
  57289. dst_token: ${{ secrets.GITEE_TOKEN }}
  57290. static_list: 'stdf'