1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585 |
- /*
- This file is part of Ext JS 7.0.0.168
- Copyright (c) 2011-2020 Sencha Inc
- Contact: http://www.sencha.com/contact
- GNU General Public License Usage
- This file may be used under the terms of the GNU General Public License version 3.0 as
- published by the Free Software Foundation and appearing in the file LICENSE included in the
- packaging of this file.
- Please review the following information to ensure the GNU General Public License version 3.0
- requirements will be met: http://www.gnu.org/copyleft/gpl.html.
- If you are unsure which license is appropriate for your use, please contact the sales department
- at http://www.sencha.com/contact.
- Version: 7.0.0.168 Build date: 2020-01-14 07:07:49 (513838d69a96c96beec9d0851e67aa660b7f288d)
- */
- var Ext = Ext || {};
- (function(manifest){
- if(!Ext.manifest) {
- Ext.manifest = manifest;
- } else {
- for(var name in manifest) {
- Ext.manifest[name] = manifest[name];
- }
- }
- })({
- "paths": {
- "Ext": "../classic/classic/src",
- "Ext.AbstractManager": "../packages/core/src/AbstractManager.js",
- "Ext.Ajax": "../packages/core/src/Ajax.js",
- "Ext.AnimationQueue": "../packages/core/src/AnimationQueue.js",
- "Ext.ComponentManager": "../packages/core/src/ComponentManager.js",
- "Ext.ComponentQuery": "../packages/core/src/ComponentQuery.js",
- "Ext.Deferred": "../packages/core/src/Deferred.js",
- "Ext.Evented": "../packages/core/src/Evented.js",
- "Ext.Factory": "../packages/core/src/mixin/Factoryable.js",
- "Ext.GlobalEvents": "../packages/core/src/GlobalEvents.js",
- "Ext.Glyph": "../packages/core/src/Glyph.js",
- "Ext.JSON": "../packages/core/src/JSON.js",
- "Ext.Mixin": "../packages/core/src/class/Mixin.js",
- "Ext.Msg": "../classic/classic/src/window/MessageBox.js",
- "Ext.Progress": "../packages/core/src/Progress.js",
- "Ext.ProgressBase": "../packages/core/src/ProgressBase.js",
- "Ext.Promise": "../packages/core/src/Promise.js",
- "Ext.String.format": "../packages/core/src/Template.js",
- "Ext.TaskQueue": "../packages/core/src/TaskQueue.js",
- "Ext.Template": "../packages/core/src/Template.js",
- "Ext.Widget": "../packages/core/src/Widget.js",
- "Ext.XTemplate": "../packages/core/src/XTemplate.js",
- "Ext.app": "../packages/core/src/app",
- "Ext.data": "../packages/core/src/data",
- "Ext.direct": "../packages/core/src/direct",
- "Ext.dom": "../packages/core/src/dom",
- "Ext.dom.ButtonElement": "../classic/classic/src/dom/ButtonElement.js",
- "Ext.dom.Layer": "../classic/classic/src/dom/Layer.js",
- "Ext.drag": "../packages/core/src/drag",
- "Ext.event": "../packages/core/src/event",
- "Ext.event.publisher.MouseEnterLeave": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
- "Ext.field": "../packages/core/src/field",
- "Ext.fx.Animation": "../packages/core/src/fx/Animation.js",
- "Ext.fx.Runner": "../packages/core/src/fx/Runner.js",
- "Ext.fx.State": "../packages/core/src/fx/State.js",
- "Ext.fx.animation": "../packages/core/src/fx/animation",
- "Ext.fx.easing": "../packages/core/src/fx/easing",
- "Ext.fx.runner": "../packages/core/src/fx/runner",
- "Ext.list": "../packages/core/src/list",
- "Ext.mixin": "../packages/core/src/mixin",
- "Ext.parse": "../packages/core/src/parse",
- "Ext.perf": "../packages/core/src/perf",
- "Ext.plugin.Abstract": "../packages/core/src/plugin/Abstract.js",
- "Ext.plugin.AbstractClipboard": "../packages/core/src/plugin/AbstractClipboard.js",
- "Ext.plugin.MouseEnter": "../packages/core/src/plugin/MouseEnter.js",
- "Ext.promise": "../packages/core/src/promise",
- "Ext.route": "../packages/core/src/route",
- "Ext.sparkline": "../packages/core/src/sparkline",
- "Ext.util": "../packages/core/src/util",
- "Ext.util.Animate": "../classic/classic/src/util/Animate.js",
- "Ext.util.ComponentDragger": "../classic/classic/src/util/ComponentDragger.js",
- "Ext.util.ElementContainer": "../classic/classic/src/util/ElementContainer.js",
- "Ext.util.Floating": "../classic/classic/src/util/Floating.js",
- "Ext.util.Format.format": "../packages/core/src/Template.js",
- "Ext.util.Memento": "../classic/classic/src/util/Memento.js",
- "Ext.util.ProtoElement": "../classic/classic/src/util/ProtoElement.js",
- "Ext.util.Queue": "../classic/classic/src/util/Queue.js",
- "Ext.util.Renderable": "../classic/classic/src/util/Renderable.js",
- "Ext.util.StoreHolder": "../classic/classic/src/util/StoreHolder.js",
- "Ext.util.TsvDecoder": "../packages/core/src/util/TSV.js"
- },
- "loadOrder": [
- {
- "path": "../packages/core/src/class/Mixin.js",
- "requires": [],
- "uses": [],
- "idx": 0
- },
- {
- "path": "../packages/core/src/util/DelayedTask.js",
- "requires": [],
- "uses": [
- 77
- ],
- "idx": 1
- },
- {
- "path": "../packages/core/src/util/Event.js",
- "requires": [
- 1
- ],
- "uses": [
- 24
- ],
- "idx": 2
- },
- {
- "path": "../packages/core/src/mixin/Identifiable.js",
- "requires": [],
- "uses": [],
- "idx": 3
- },
- {
- "path": "../packages/core/src/mixin/Observable.js",
- "requires": [
- 0,
- 2,
- 3
- ],
- "uses": [
- 52
- ],
- "idx": 4
- },
- {
- "path": "../packages/core/src/util/HashMap.js",
- "requires": [
- 4
- ],
- "uses": [],
- "idx": 5
- },
- {
- "path": "../packages/core/src/AbstractManager.js",
- "requires": [
- 5
- ],
- "uses": [],
- "idx": 6
- },
- {
- "path": "../packages/core/src/promise/Consequence.js",
- "requires": [],
- "uses": [
- 8
- ],
- "idx": 7
- },
- {
- "path": "../packages/core/src/promise/Deferred.js",
- "requires": [
- 7
- ],
- "uses": [
- 9
- ],
- "idx": 8
- },
- {
- "path": "../packages/core/src/promise/Promise.js",
- "requires": [
- 8
- ],
- "uses": [],
- "idx": 9
- },
- {
- "path": "../packages/core/src/Promise.js",
- "requires": [
- 9
- ],
- "uses": [
- 8
- ],
- "idx": 10
- },
- {
- "path": "../packages/core/src/Deferred.js",
- "requires": [
- 8,
- 10
- ],
- "uses": [
- 9
- ],
- "idx": 11
- },
- {
- "path": "../packages/core/src/mixin/Factoryable.js",
- "requires": [],
- "uses": [],
- "idx": 12
- },
- {
- "path": "../packages/core/src/data/request/Base.js",
- "requires": [
- 11,
- 12
- ],
- "uses": [
- 17
- ],
- "idx": 13
- },
- {
- "path": "../packages/core/src/data/flash/BinaryXhr.js",
- "requires": [],
- "uses": [
- 77
- ],
- "idx": 14
- },
- {
- "path": "../packages/core/src/data/request/Ajax.js",
- "requires": [
- 13,
- 14
- ],
- "uses": [],
- "idx": 15
- },
- {
- "path": "../packages/core/src/data/request/Form.js",
- "requires": [
- 13
- ],
- "uses": [],
- "idx": 16
- },
- {
- "path": "../packages/core/src/data/Connection.js",
- "requires": [
- 4,
- 11,
- 14,
- 15,
- 16
- ],
- "uses": [
- 12,
- 49
- ],
- "idx": 17
- },
- {
- "path": "../packages/core/src/Ajax.js",
- "requires": [
- 17
- ],
- "uses": [],
- "idx": 18
- },
- {
- "path": "../packages/core/src/AnimationQueue.js",
- "requires": [],
- "uses": [],
- "idx": 19
- },
- {
- "path": "../packages/core/src/mixin/Bufferable.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 20
- },
- {
- "path": "../packages/core/src/ComponentManager.js",
- "requires": [
- 20
- ],
- "uses": [
- 24,
- 36,
- 49,
- 89
- ],
- "idx": 21
- },
- {
- "path": "../packages/core/src/util/Operators.js",
- "requires": [],
- "uses": [],
- "idx": 22
- },
- {
- "path": "../packages/core/src/util/LruCache.js",
- "requires": [
- 5
- ],
- "uses": [],
- "idx": 23
- },
- {
- "path": "../packages/core/src/ComponentQuery.js",
- "requires": [
- 21,
- 22,
- 23
- ],
- "uses": [
- 95
- ],
- "idx": 24
- },
- {
- "path": "../packages/core/src/Evented.js",
- "requires": [
- 4
- ],
- "uses": [],
- "idx": 25
- },
- {
- "path": "../packages/core/src/util/Positionable.js",
- "requires": [],
- "uses": [
- 34,
- 49
- ],
- "idx": 26
- },
- {
- "path": "../packages/core/src/dom/UnderlayPool.js",
- "requires": [],
- "uses": [
- 49
- ],
- "idx": 27
- },
- {
- "path": "../packages/core/src/dom/Underlay.js",
- "requires": [
- 27
- ],
- "uses": [],
- "idx": 28
- },
- {
- "path": "../packages/core/src/dom/Shadow.js",
- "requires": [
- 28
- ],
- "uses": [],
- "idx": 29
- },
- {
- "path": "../packages/core/src/dom/Shim.js",
- "requires": [
- 28
- ],
- "uses": [],
- "idx": 30
- },
- {
- "path": "../packages/core/src/dom/ElementEvent.js",
- "requires": [
- 2
- ],
- "uses": [
- 37
- ],
- "idx": 31
- },
- {
- "path": "../packages/core/src/event/publisher/Publisher.js",
- "requires": [],
- "uses": [],
- "idx": 32
- },
- {
- "path": "../packages/core/src/util/Offset.js",
- "requires": [],
- "uses": [],
- "idx": 33
- },
- {
- "path": "../packages/core/src/util/Region.js",
- "requires": [
- 33
- ],
- "uses": [
- 49
- ],
- "idx": 34
- },
- {
- "path": "../packages/core/src/util/Point.js",
- "requires": [
- 34
- ],
- "uses": [],
- "idx": 35
- },
- {
- "path": "../packages/core/src/event/Event.js",
- "requires": [
- 35
- ],
- "uses": [
- 37,
- 77
- ],
- "idx": 36
- },
- {
- "path": "../packages/core/src/event/publisher/Dom.js",
- "requires": [
- 32,
- 36
- ],
- "uses": [
- 77
- ],
- "idx": 37
- },
- {
- "path": "../packages/core/src/event/publisher/Gesture.js",
- "requires": [
- 19,
- 35,
- 37
- ],
- "uses": [
- 36,
- 49,
- 307,
- 318,
- 319,
- 320,
- 321,
- 322,
- 323,
- 324,
- 325,
- 326,
- 327,
- 328
- ],
- "idx": 38
- },
- {
- "path": "../packages/core/src/mixin/Templatable.js",
- "requires": [
- 0
- ],
- "uses": [
- 49
- ],
- "idx": 39
- },
- {
- "path": "../packages/core/src/TaskQueue.js",
- "requires": [
- 19
- ],
- "uses": [],
- "idx": 40
- },
- {
- "path": "../packages/core/src/util/sizemonitor/Abstract.js",
- "requires": [
- 39,
- 40
- ],
- "uses": [],
- "idx": 41
- },
- {
- "path": "../packages/core/src/util/sizemonitor/Scroll.js",
- "requires": [
- 41
- ],
- "uses": [
- 40
- ],
- "idx": 42
- },
- {
- "path": "../packages/core/src/util/SizeMonitor.js",
- "requires": [
- 42
- ],
- "uses": [],
- "idx": 43
- },
- {
- "path": "../packages/core/src/event/publisher/ElementSize.js",
- "requires": [
- 32,
- 43
- ],
- "uses": [
- 40
- ],
- "idx": 44
- },
- {
- "path": "../packages/core/src/util/paintmonitor/Abstract.js",
- "requires": [],
- "uses": [
- 49
- ],
- "idx": 45
- },
- {
- "path": "../packages/core/src/util/paintmonitor/CssAnimation.js",
- "requires": [
- 45
- ],
- "uses": [],
- "idx": 46
- },
- {
- "path": "../packages/core/src/util/PaintMonitor.js",
- "requires": [
- 46
- ],
- "uses": [],
- "idx": 47
- },
- {
- "path": "../packages/core/src/event/publisher/ElementPaint.js",
- "requires": [
- 32,
- 40,
- 47
- ],
- "uses": [],
- "idx": 48
- },
- {
- "path": "../packages/core/src/dom/Element.js",
- "requires": [
- 4,
- 26,
- 29,
- 30,
- 31,
- 37,
- 38,
- 44,
- 48
- ],
- "uses": [
- 32,
- 34,
- 36,
- 75,
- 76,
- 95,
- 102,
- 250,
- 308,
- 329,
- 340,
- 342
- ],
- "idx": 49
- },
- {
- "path": "../packages/core/src/util/BasicFilter.js",
- "requires": [],
- "uses": [],
- "idx": 50
- },
- {
- "path": "../packages/core/src/util/Filter.js",
- "requires": [
- 50
- ],
- "uses": [],
- "idx": 51
- },
- {
- "path": "../packages/core/src/util/Observable.js",
- "requires": [
- 4
- ],
- "uses": [],
- "idx": 52
- },
- {
- "path": "../packages/core/src/util/AbstractMixedCollection.js",
- "requires": [
- 51,
- 52
- ],
- "uses": [],
- "idx": 53
- },
- {
- "path": "../packages/core/src/util/Sorter.js",
- "requires": [],
- "uses": [],
- "idx": 54
- },
- {
- "path": "../packages/core/src/util/Sortable.js",
- "requires": [
- 54
- ],
- "uses": [
- 56
- ],
- "idx": 55
- },
- {
- "path": "../packages/core/src/util/MixedCollection.js",
- "requires": [
- 53,
- 55
- ],
- "uses": [],
- "idx": 56
- },
- {
- "path": "../packages/core/src/util/TaskRunner.js",
- "requires": [],
- "uses": [],
- "idx": 57
- },
- {
- "path": "../classic/classic/src/fx/target/Target.js",
- "requires": [],
- "uses": [],
- "idx": 58
- },
- {
- "path": "../classic/classic/src/fx/target/Element.js",
- "requires": [
- 58
- ],
- "uses": [],
- "idx": 59
- },
- {
- "path": "../classic/classic/src/fx/target/ElementCSS.js",
- "requires": [
- 59
- ],
- "uses": [],
- "idx": 60
- },
- {
- "path": "../classic/classic/src/fx/target/CompositeElement.js",
- "requires": [
- 59
- ],
- "uses": [],
- "idx": 61
- },
- {
- "path": "../classic/classic/src/fx/target/CompositeElementCSS.js",
- "requires": [
- 60,
- 61
- ],
- "uses": [],
- "idx": 62
- },
- {
- "path": "../classic/classic/src/fx/target/Sprite.js",
- "requires": [
- 58
- ],
- "uses": [],
- "idx": 63
- },
- {
- "path": "../classic/classic/src/fx/target/CompositeSprite.js",
- "requires": [
- 63
- ],
- "uses": [],
- "idx": 64
- },
- {
- "path": "../classic/classic/src/fx/target/Component.js",
- "requires": [
- 58
- ],
- "uses": [
- 77
- ],
- "idx": 65
- },
- {
- "path": "../classic/classic/src/fx/Queue.js",
- "requires": [
- 5
- ],
- "uses": [],
- "idx": 66
- },
- {
- "path": "../classic/classic/src/fx/Manager.js",
- "requires": [
- 56,
- 57,
- 59,
- 60,
- 61,
- 62,
- 63,
- 64,
- 65,
- 66
- ],
- "uses": [],
- "idx": 67
- },
- {
- "path": "../classic/classic/src/fx/Animator.js",
- "requires": [
- 52,
- 67
- ],
- "uses": [
- 73
- ],
- "idx": 68
- },
- {
- "path": "../classic/classic/src/fx/CubicBezier.js",
- "requires": [],
- "uses": [],
- "idx": 69
- },
- {
- "path": "../classic/classic/src/fx/Easing.js",
- "requires": [
- 69
- ],
- "uses": [],
- "idx": 70
- },
- {
- "path": "../classic/classic/src/fx/DrawPath.js",
- "requires": [],
- "uses": [],
- "idx": 71
- },
- {
- "path": "../classic/classic/src/fx/PropertyHandler.js",
- "requires": [
- 71
- ],
- "uses": [],
- "idx": 72
- },
- {
- "path": "../classic/classic/src/fx/Anim.js",
- "requires": [
- 52,
- 67,
- 68,
- 69,
- 70,
- 72
- ],
- "uses": [],
- "idx": 73
- },
- {
- "path": "../classic/classic/src/util/Animate.js",
- "requires": [
- 67,
- 73
- ],
- "uses": [],
- "idx": 74
- },
- {
- "path": "../packages/core/src/dom/Fly.js",
- "requires": [
- 49
- ],
- "uses": [],
- "idx": 75
- },
- {
- "path": "../packages/core/src/dom/CompositeElementLite.js",
- "requires": [
- 75
- ],
- "uses": [
- 49
- ],
- "idx": 76
- },
- {
- "path": "../packages/core/src/GlobalEvents.js",
- "requires": [
- 4,
- 49
- ],
- "uses": [
- 21
- ],
- "idx": 77
- },
- {
- "path": "../packages/core/src/Glyph.js",
- "requires": [],
- "uses": [],
- "idx": 78
- },
- {
- "path": "../packages/core/src/JSON.js",
- "requires": [],
- "uses": [],
- "idx": 79
- },
- {
- "path": "../packages/core/src/Manifest.js",
- "requires": [],
- "uses": [],
- "idx": 80
- },
- {
- "path": "../packages/core/src/mixin/Inheritable.js",
- "requires": [
- 0
- ],
- "uses": [
- 21
- ],
- "idx": 81
- },
- {
- "path": "../packages/core/src/mixin/Bindable.js",
- "requires": [],
- "uses": [
- 12
- ],
- "idx": 82
- },
- {
- "path": "../packages/core/src/mixin/ComponentDelegation.js",
- "requires": [
- 0,
- 4
- ],
- "uses": [
- 2
- ],
- "idx": 83
- },
- {
- "path": "../packages/core/src/plugin/Abstract.js",
- "requires": [
- 3
- ],
- "uses": [],
- "idx": 84
- },
- {
- "path": "../packages/core/src/mixin/Pluggable.js",
- "requires": [
- 84
- ],
- "uses": [],
- "idx": 85
- },
- {
- "path": "../packages/core/src/mixin/Keyboard.js",
- "requires": [
- 0
- ],
- "uses": [
- 36
- ],
- "idx": 86
- },
- {
- "path": "../packages/core/src/mixin/Focusable.js",
- "requires": [],
- "uses": [
- 21,
- 24,
- 36,
- 49
- ],
- "idx": 87
- },
- {
- "path": "../packages/core/src/mixin/Accessible.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 88
- },
- {
- "path": "../packages/core/src/Widget.js",
- "requires": [
- 12,
- 25,
- 49,
- 81,
- 82,
- 83,
- 85,
- 86,
- 87,
- 88
- ],
- "uses": [
- 21,
- 24,
- 98
- ],
- "idx": 89
- },
- {
- "path": "../packages/core/src/mixin/Responsive.js",
- "requires": [
- 0
- ],
- "uses": [
- 49
- ],
- "idx": 90
- },
- {
- "path": "../classic/classic/src/ResponsiveWidget.js",
- "requires": [
- 90
- ],
- "uses": [],
- "idx": 91
- },
- {
- "path": "../packages/core/src/ProgressBase.js",
- "requires": [],
- "uses": [
- 98
- ],
- "idx": 92
- },
- {
- "path": "../packages/core/src/Progress.js",
- "requires": [
- 89,
- 92
- ],
- "uses": [],
- "idx": 93
- },
- {
- "path": "../packages/core/src/util/Format.js",
- "requires": [],
- "uses": [
- 95,
- 250
- ],
- "idx": 94
- },
- {
- "path": "../packages/core/src/Template.js",
- "requires": [
- 94
- ],
- "uses": [
- 250
- ],
- "idx": 95
- },
- {
- "path": "../packages/core/src/util/XTemplateParser.js",
- "requires": [],
- "uses": [],
- "idx": 96
- },
- {
- "path": "../packages/core/src/util/XTemplateCompiler.js",
- "requires": [
- 96
- ],
- "uses": [],
- "idx": 97
- },
- {
- "path": "../packages/core/src/XTemplate.js",
- "requires": [
- 95,
- 97
- ],
- "uses": [],
- "idx": 98
- },
- {
- "path": "../packages/core/src/app/EventDomain.js",
- "requires": [
- 2
- ],
- "uses": [],
- "idx": 99
- },
- {
- "path": "../packages/core/src/app/domain/Component.js",
- "requires": [
- 89,
- 99
- ],
- "uses": [],
- "idx": 100
- },
- {
- "path": "../classic/classic/src/util/ProtoElement.js",
- "requires": [],
- "uses": [
- 49,
- 250
- ],
- "idx": 101
- },
- {
- "path": "../packages/core/src/dom/CompositeElement.js",
- "requires": [
- 76
- ],
- "uses": [],
- "idx": 102
- },
- {
- "path": "../classic/classic/src/plugin/Manager.js",
- "requires": [],
- "uses": [],
- "idx": 103
- },
- {
- "path": "../packages/core/src/util/CSS.js",
- "requires": [],
- "uses": [
- 49
- ],
- "idx": 104
- },
- {
- "path": "../packages/core/src/fx/easing/Abstract.js",
- "requires": [],
- "uses": [],
- "idx": 105
- },
- {
- "path": "../packages/core/src/fx/easing/Linear.js",
- "requires": [
- 105
- ],
- "uses": [],
- "idx": 106
- },
- {
- "path": "../packages/core/src/util/translatable/Abstract.js",
- "requires": [
- 12,
- 25,
- 106
- ],
- "uses": [
- 19
- ],
- "idx": 107
- },
- {
- "path": "../packages/core/src/util/translatable/Dom.js",
- "requires": [
- 107
- ],
- "uses": [],
- "idx": 108
- },
- {
- "path": "../packages/core/src/util/translatable/ScrollPosition.js",
- "requires": [
- 108
- ],
- "uses": [],
- "idx": 109
- },
- {
- "path": "../classic/classic/src/scroll/Scroller.js",
- "requires": [
- 11,
- 12,
- 20,
- 25,
- 104,
- 109
- ],
- "uses": [
- 77,
- 461
- ],
- "idx": 110
- },
- {
- "path": "../classic/classic/src/util/Floating.js",
- "requires": [],
- "uses": [
- 21,
- 49,
- 75,
- 413
- ],
- "idx": 111
- },
- {
- "path": "../classic/classic/src/util/ElementContainer.js",
- "requires": [],
- "uses": [],
- "idx": 112
- },
- {
- "path": "../classic/classic/src/util/Renderable.js",
- "requires": [
- 49
- ],
- "uses": [
- 98,
- 117,
- 250
- ],
- "idx": 113
- },
- {
- "path": "../classic/classic/src/state/Provider.js",
- "requires": [
- 52
- ],
- "uses": [],
- "idx": 114
- },
- {
- "path": "../classic/classic/src/state/Manager.js",
- "requires": [
- 114
- ],
- "uses": [],
- "idx": 115
- },
- {
- "path": "../classic/classic/src/state/Stateful.js",
- "requires": [
- 57,
- 115
- ],
- "uses": [],
- "idx": 116
- },
- {
- "path": "../classic/classic/src/Component.js",
- "requires": [
- 21,
- 24,
- 26,
- 52,
- 74,
- 77,
- 81,
- 82,
- 83,
- 84,
- 86,
- 87,
- 88,
- 101,
- 102,
- 103,
- 110,
- 111,
- 112,
- 113,
- 116
- ],
- "uses": [
- 1,
- 49,
- 67,
- 98,
- 250,
- 408,
- 409,
- 410,
- 413,
- 421,
- 423,
- 488,
- 635,
- 655
- ],
- "idx": 117
- },
- {
- "path": "../classic/classic/src/Responsive.js",
- "requires": [
- 90,
- 91
- ],
- "uses": [],
- "idx": 118
- },
- {
- "path": "../classic/classic/src/layout/container/border/Region.js",
- "requires": [],
- "uses": [],
- "idx": 119
- },
- {
- "path": "../packages/core/src/app/EventBus.js",
- "requires": [
- 100
- ],
- "uses": [
- 99
- ],
- "idx": 120
- },
- {
- "path": "../packages/core/src/app/domain/Global.js",
- "requires": [
- 77,
- 99
- ],
- "uses": [],
- "idx": 121
- },
- {
- "path": "../packages/core/src/route/Handler.js",
- "requires": [],
- "uses": [],
- "idx": 122
- },
- {
- "path": "../packages/core/src/route/Action.js",
- "requires": [],
- "uses": [
- 11
- ],
- "idx": 123
- },
- {
- "path": "../packages/core/src/route/Route.js",
- "requires": [
- 122,
- 123
- ],
- "uses": [
- 10,
- 126
- ],
- "idx": 124
- },
- {
- "path": "../packages/core/src/util/History.js",
- "requires": [
- 52
- ],
- "uses": [],
- "idx": 125
- },
- {
- "path": "../packages/core/src/route/Router.js",
- "requires": [
- 123,
- 124,
- 125
- ],
- "uses": [
- 122
- ],
- "idx": 126
- },
- {
- "path": "../packages/core/src/route/Mixin.js",
- "requires": [
- 0,
- 122,
- 126
- ],
- "uses": [
- 125
- ],
- "idx": 127
- },
- {
- "path": "../packages/core/src/app/BaseController.js",
- "requires": [
- 4,
- 120,
- 121,
- 127
- ],
- "uses": [
- 223
- ],
- "idx": 128
- },
- {
- "path": "../packages/core/src/app/Util.js",
- "requires": [],
- "uses": [],
- "idx": 129
- },
- {
- "path": "../packages/core/src/util/CollectionKey.js",
- "requires": [
- 3
- ],
- "uses": [],
- "idx": 130
- },
- {
- "path": "../packages/core/src/util/Grouper.js",
- "requires": [
- 54
- ],
- "uses": [],
- "idx": 131
- },
- {
- "path": "../packages/core/src/util/Collection.js",
- "requires": [
- 4,
- 51,
- 54,
- 130,
- 131
- ],
- "uses": [
- 176,
- 177,
- 178
- ],
- "idx": 132
- },
- {
- "path": "../packages/core/src/data/Range.js",
- "requires": [
- 1
- ],
- "uses": [],
- "idx": 133
- },
- {
- "path": "../packages/core/src/util/ObjectTemplate.js",
- "requires": [
- 98
- ],
- "uses": [],
- "idx": 134
- },
- {
- "path": "../packages/core/src/data/schema/Role.js",
- "requires": [],
- "uses": [
- 12
- ],
- "idx": 135
- },
- {
- "path": "../packages/core/src/data/schema/Association.js",
- "requires": [
- 135
- ],
- "uses": [],
- "idx": 136
- },
- {
- "path": "../packages/core/src/data/schema/OneToOne.js",
- "requires": [
- 136
- ],
- "uses": [],
- "idx": 137
- },
- {
- "path": "../packages/core/src/data/schema/ManyToOne.js",
- "requires": [
- 136
- ],
- "uses": [],
- "idx": 138
- },
- {
- "path": "../packages/core/src/data/schema/ManyToMany.js",
- "requires": [
- 136
- ],
- "uses": [],
- "idx": 139
- },
- {
- "path": "../packages/core/src/util/Inflector.js",
- "requires": [],
- "uses": [],
- "idx": 140
- },
- {
- "path": "../packages/core/src/data/schema/Namer.js",
- "requires": [
- 12,
- 140
- ],
- "uses": [],
- "idx": 141
- },
- {
- "path": "../packages/core/src/data/schema/Schema.js",
- "requires": [
- 12,
- 134,
- 137,
- 138,
- 139,
- 141
- ],
- "uses": [],
- "idx": 142
- },
- {
- "path": "../packages/core/src/data/AbstractStore.js",
- "requires": [
- 4,
- 12,
- 51,
- 132,
- 133,
- 142
- ],
- "uses": [
- 182
- ],
- "idx": 143
- },
- {
- "path": "../packages/core/src/data/Error.js",
- "requires": [],
- "uses": [],
- "idx": 144
- },
- {
- "path": "../packages/core/src/data/ErrorCollection.js",
- "requires": [
- 56,
- 144
- ],
- "uses": [
- 153
- ],
- "idx": 145
- },
- {
- "path": "../packages/core/src/data/operation/Operation.js",
- "requires": [],
- "uses": [],
- "idx": 146
- },
- {
- "path": "../packages/core/src/data/operation/Create.js",
- "requires": [
- 146
- ],
- "uses": [],
- "idx": 147
- },
- {
- "path": "../packages/core/src/data/operation/Destroy.js",
- "requires": [
- 146
- ],
- "uses": [],
- "idx": 148
- },
- {
- "path": "../packages/core/src/data/operation/Read.js",
- "requires": [
- 146
- ],
- "uses": [],
- "idx": 149
- },
- {
- "path": "../packages/core/src/data/operation/Update.js",
- "requires": [
- 146
- ],
- "uses": [],
- "idx": 150
- },
- {
- "path": "../packages/core/src/data/SortTypes.js",
- "requires": [],
- "uses": [],
- "idx": 151
- },
- {
- "path": "../packages/core/src/data/validator/Validator.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 152
- },
- {
- "path": "../packages/core/src/data/field/Field.js",
- "requires": [
- 12,
- 151,
- 152
- ],
- "uses": [],
- "idx": 153
- },
- {
- "path": "../packages/core/src/data/field/Boolean.js",
- "requires": [
- 153
- ],
- "uses": [],
- "idx": 154
- },
- {
- "path": "../packages/core/src/data/field/Date.js",
- "requires": [
- 153
- ],
- "uses": [],
- "idx": 155
- },
- {
- "path": "../packages/core/src/data/field/Integer.js",
- "requires": [
- 153
- ],
- "uses": [],
- "idx": 156
- },
- {
- "path": "../packages/core/src/data/field/Number.js",
- "requires": [
- 156
- ],
- "uses": [],
- "idx": 157
- },
- {
- "path": "../packages/core/src/data/field/String.js",
- "requires": [
- 153
- ],
- "uses": [],
- "idx": 158
- },
- {
- "path": "../packages/core/src/data/identifier/Generator.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 159
- },
- {
- "path": "../packages/core/src/data/identifier/Sequential.js",
- "requires": [
- 159
- ],
- "uses": [],
- "idx": 160
- },
- {
- "path": "../packages/core/src/data/Model.js",
- "requires": [
- 142,
- 145,
- 146,
- 147,
- 148,
- 149,
- 150,
- 152,
- 153,
- 154,
- 155,
- 156,
- 157,
- 158,
- 159,
- 160
- ],
- "uses": [
- 12,
- 163,
- 249
- ],
- "idx": 161
- },
- {
- "path": "../packages/core/src/data/ResultSet.js",
- "requires": [],
- "uses": [],
- "idx": 162
- },
- {
- "path": "../packages/core/src/data/reader/Reader.js",
- "requires": [
- 4,
- 12,
- 23,
- 98,
- 162
- ],
- "uses": [
- 142
- ],
- "idx": 163
- },
- {
- "path": "../packages/core/src/data/writer/Writer.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 164
- },
- {
- "path": "../packages/core/src/data/proxy/Proxy.js",
- "requires": [
- 4,
- 12,
- 142,
- 163,
- 164
- ],
- "uses": [
- 146,
- 147,
- 148,
- 149,
- 150,
- 161,
- 191
- ],
- "idx": 165
- },
- {
- "path": "../packages/core/src/data/proxy/Client.js",
- "requires": [
- 165
- ],
- "uses": [],
- "idx": 166
- },
- {
- "path": "../packages/core/src/data/proxy/Memory.js",
- "requires": [
- 166
- ],
- "uses": [
- 51,
- 55
- ],
- "idx": 167
- },
- {
- "path": "../packages/core/src/data/ProxyStore.js",
- "requires": [
- 143,
- 146,
- 147,
- 148,
- 149,
- 150,
- 161,
- 165,
- 167
- ],
- "uses": [
- 142
- ],
- "idx": 168
- },
- {
- "path": "../packages/core/src/util/Group.js",
- "requires": [
- 132
- ],
- "uses": [],
- "idx": 169
- },
- {
- "path": "../packages/core/src/data/Group.js",
- "requires": [
- 169
- ],
- "uses": [],
- "idx": 170
- },
- {
- "path": "../packages/core/src/data/LocalStore.js",
- "requires": [
- 0,
- 170
- ],
- "uses": [
- 132
- ],
- "idx": 171
- },
- {
- "path": "../packages/core/src/data/proxy/Server.js",
- "requires": [
- 165
- ],
- "uses": [
- 95,
- 246
- ],
- "idx": 172
- },
- {
- "path": "../packages/core/src/data/proxy/Ajax.js",
- "requires": [
- 18,
- 172
- ],
- "uses": [],
- "idx": 173
- },
- {
- "path": "../packages/core/src/data/reader/Json.js",
- "requires": [
- 79,
- 163
- ],
- "uses": [],
- "idx": 174
- },
- {
- "path": "../packages/core/src/data/writer/Json.js",
- "requires": [
- 164
- ],
- "uses": [],
- "idx": 175
- },
- {
- "path": "../packages/core/src/util/SorterCollection.js",
- "requires": [
- 54,
- 132
- ],
- "uses": [],
- "idx": 176
- },
- {
- "path": "../packages/core/src/util/FilterCollection.js",
- "requires": [
- 51,
- 132
- ],
- "uses": [],
- "idx": 177
- },
- {
- "path": "../packages/core/src/util/GroupCollection.js",
- "requires": [
- 132,
- 169,
- 176,
- 177
- ],
- "uses": [],
- "idx": 178
- },
- {
- "path": "../packages/core/src/data/Store.js",
- "requires": [
- 1,
- 161,
- 168,
- 171,
- 173,
- 174,
- 175,
- 178
- ],
- "uses": [
- 131,
- 182
- ],
- "idx": 179
- },
- {
- "path": "../packages/core/src/data/reader/Array.js",
- "requires": [
- 174
- ],
- "uses": [],
- "idx": 180
- },
- {
- "path": "../packages/core/src/data/ArrayStore.js",
- "requires": [
- 167,
- 179,
- 180
- ],
- "uses": [],
- "idx": 181
- },
- {
- "path": "../packages/core/src/data/StoreManager.js",
- "requires": [
- 56,
- 181
- ],
- "uses": [
- 12,
- 167,
- 175,
- 179,
- 180
- ],
- "idx": 182
- },
- {
- "path": "../packages/core/src/app/domain/Store.js",
- "requires": [
- 99,
- 143
- ],
- "uses": [],
- "idx": 183
- },
- {
- "path": "../packages/core/src/app/Controller.js",
- "requires": [
- 21,
- 100,
- 128,
- 129,
- 182,
- 183
- ],
- "uses": [
- 24,
- 142
- ],
- "idx": 184
- },
- {
- "path": "../packages/core/src/app/Application.js",
- "requires": [
- 56,
- 125,
- 184
- ],
- "uses": [
- 126
- ],
- "idx": 185
- },
- {
- "path": "../packages/core/src/app/Profile.js",
- "requires": [
- 4,
- 184
- ],
- "uses": [],
- "idx": 186
- },
- {
- "path": "../packages/core/src/app/domain/View.js",
- "requires": [
- 89,
- 99
- ],
- "uses": [],
- "idx": 187
- },
- {
- "path": "../packages/core/src/app/ViewController.js",
- "requires": [
- 12,
- 128,
- 187
- ],
- "uses": [],
- "idx": 188
- },
- {
- "path": "../packages/core/src/util/Bag.js",
- "requires": [],
- "uses": [],
- "idx": 189
- },
- {
- "path": "../packages/core/src/util/Scheduler.js",
- "requires": [
- 4,
- 189
- ],
- "uses": [
- 77
- ],
- "idx": 190
- },
- {
- "path": "../packages/core/src/data/Batch.js",
- "requires": [
- 4
- ],
- "uses": [],
- "idx": 191
- },
- {
- "path": "../packages/core/src/data/matrix/Slice.js",
- "requires": [],
- "uses": [],
- "idx": 192
- },
- {
- "path": "../packages/core/src/data/matrix/Side.js",
- "requires": [
- 192
- ],
- "uses": [],
- "idx": 193
- },
- {
- "path": "../packages/core/src/data/matrix/Matrix.js",
- "requires": [
- 193
- ],
- "uses": [],
- "idx": 194
- },
- {
- "path": "../packages/core/src/data/session/ChangesVisitor.js",
- "requires": [],
- "uses": [],
- "idx": 195
- },
- {
- "path": "../packages/core/src/data/session/ChildChangesVisitor.js",
- "requires": [
- 195
- ],
- "uses": [],
- "idx": 196
- },
- {
- "path": "../packages/core/src/data/session/BatchVisitor.js",
- "requires": [],
- "uses": [
- 191
- ],
- "idx": 197
- },
- {
- "path": "../packages/core/src/mixin/Dirty.js",
- "requires": [],
- "uses": [],
- "idx": 198
- },
- {
- "path": "../packages/core/src/data/Session.js",
- "requires": [
- 4,
- 142,
- 191,
- 194,
- 195,
- 196,
- 197,
- 198
- ],
- "uses": [],
- "idx": 199
- },
- {
- "path": "../packages/core/src/util/Schedulable.js",
- "requires": [],
- "uses": [],
- "idx": 200
- },
- {
- "path": "../packages/core/src/app/bind/BaseBinding.js",
- "requires": [
- 200
- ],
- "uses": [],
- "idx": 201
- },
- {
- "path": "../packages/core/src/app/bind/Binding.js",
- "requires": [
- 201
- ],
- "uses": [],
- "idx": 202
- },
- {
- "path": "../packages/core/src/app/bind/AbstractStub.js",
- "requires": [
- 200,
- 202
- ],
- "uses": [],
- "idx": 203
- },
- {
- "path": "../packages/core/src/app/bind/Stub.js",
- "requires": [
- 202,
- 203
- ],
- "uses": [
- 208
- ],
- "idx": 204
- },
- {
- "path": "../packages/core/src/app/bind/LinkStub.js",
- "requires": [
- 204
- ],
- "uses": [],
- "idx": 205
- },
- {
- "path": "../packages/core/src/app/bind/RootStub.js",
- "requires": [
- 203,
- 204,
- 205
- ],
- "uses": [],
- "idx": 206
- },
- {
- "path": "../packages/core/src/app/bind/Multi.js",
- "requires": [
- 201
- ],
- "uses": [],
- "idx": 207
- },
- {
- "path": "../packages/core/src/app/bind/Formula.js",
- "requires": [
- 23,
- 200
- ],
- "uses": [],
- "idx": 208
- },
- {
- "path": "../packages/core/src/util/Fly.js",
- "requires": [],
- "uses": [],
- "idx": 209
- },
- {
- "path": "../packages/core/src/parse/Tokenizer.js",
- "requires": [
- 209
- ],
- "uses": [],
- "idx": 210
- },
- {
- "path": "../packages/core/src/parse/Symbol.js",
- "requires": [],
- "uses": [],
- "idx": 211
- },
- {
- "path": "../packages/core/src/parse/symbol/Constant.js",
- "requires": [
- 211
- ],
- "uses": [],
- "idx": 212
- },
- {
- "path": "../packages/core/src/parse/symbol/Infix.js",
- "requires": [
- 211
- ],
- "uses": [],
- "idx": 213
- },
- {
- "path": "../packages/core/src/parse/symbol/InfixRight.js",
- "requires": [
- 213
- ],
- "uses": [],
- "idx": 214
- },
- {
- "path": "../packages/core/src/parse/symbol/Paren.js",
- "requires": [
- 211
- ],
- "uses": [],
- "idx": 215
- },
- {
- "path": "../packages/core/src/parse/symbol/Prefix.js",
- "requires": [
- 211
- ],
- "uses": [],
- "idx": 216
- },
- {
- "path": "../packages/core/src/parse/Parser.js",
- "requires": [
- 209,
- 210,
- 212,
- 214,
- 215,
- 216
- ],
- "uses": [
- 211,
- 213
- ],
- "idx": 217
- },
- {
- "path": "../packages/core/src/app/bind/Parser.js",
- "requires": [
- 94,
- 217
- ],
- "uses": [],
- "idx": 218
- },
- {
- "path": "../packages/core/src/app/bind/Template.js",
- "requires": [
- 94,
- 218
- ],
- "uses": [],
- "idx": 219
- },
- {
- "path": "../packages/core/src/app/bind/TemplateBinding.js",
- "requires": [
- 201,
- 207,
- 219
- ],
- "uses": [],
- "idx": 220
- },
- {
- "path": "../packages/core/src/data/ChainedStore.js",
- "requires": [
- 143,
- 171
- ],
- "uses": [
- 95,
- 182
- ],
- "idx": 221
- },
- {
- "path": "../packages/core/src/app/ViewModel.js",
- "requires": [
- 3,
- 12,
- 190,
- 199,
- 205,
- 206,
- 207,
- 208,
- 220,
- 221
- ],
- "uses": [
- 1,
- 142
- ],
- "idx": 222
- },
- {
- "path": "../packages/core/src/app/domain/Controller.js",
- "requires": [
- 99,
- 184
- ],
- "uses": [
- 128
- ],
- "idx": 223
- },
- {
- "path": "../packages/core/src/direct/Manager.js",
- "requires": [
- 4,
- 56
- ],
- "uses": [
- 95
- ],
- "idx": 224
- },
- {
- "path": "../packages/core/src/direct/Provider.js",
- "requires": [
- 4,
- 224
- ],
- "uses": [
- 18
- ],
- "idx": 225
- },
- {
- "path": "../packages/core/src/app/domain/Direct.js",
- "requires": [
- 99,
- 225
- ],
- "uses": [],
- "idx": 226
- },
- {
- "path": "../packages/core/src/data/PageMap.js",
- "requires": [
- 23
- ],
- "uses": [],
- "idx": 227
- },
- {
- "path": "../packages/core/src/data/BufferedStore.js",
- "requires": [
- 51,
- 54,
- 131,
- 168,
- 227
- ],
- "uses": [
- 176,
- 177,
- 178
- ],
- "idx": 228
- },
- {
- "path": "../packages/core/src/data/ClientStore.js",
- "requires": [
- 167,
- 179
- ],
- "uses": [],
- "idx": 229
- },
- {
- "path": "../packages/core/src/data/proxy/Direct.js",
- "requires": [
- 172,
- 224
- ],
- "uses": [],
- "idx": 230
- },
- {
- "path": "../packages/core/src/data/DirectStore.js",
- "requires": [
- 179,
- 230
- ],
- "uses": [],
- "idx": 231
- },
- {
- "path": "../packages/core/src/data/JsonP.js",
- "requires": [],
- "uses": [],
- "idx": 232
- },
- {
- "path": "../packages/core/src/data/proxy/JsonP.js",
- "requires": [
- 172,
- 232
- ],
- "uses": [],
- "idx": 233
- },
- {
- "path": "../packages/core/src/data/JsonPStore.js",
- "requires": [
- 174,
- 179,
- 233
- ],
- "uses": [],
- "idx": 234
- },
- {
- "path": "../packages/core/src/data/JsonStore.js",
- "requires": [
- 173,
- 174,
- 175,
- 179
- ],
- "uses": [],
- "idx": 235
- },
- {
- "path": "../packages/core/src/data/ModelManager.js",
- "requires": [
- 142
- ],
- "uses": [
- 161
- ],
- "idx": 236
- },
- {
- "path": "../packages/core/src/data/NodeInterface.js",
- "requires": [
- 4,
- 154,
- 156,
- 158,
- 175
- ],
- "uses": [
- 142
- ],
- "idx": 237
- },
- {
- "path": "../packages/core/src/mixin/Queryable.js",
- "requires": [],
- "uses": [
- 24
- ],
- "idx": 238
- },
- {
- "path": "../packages/core/src/data/TreeModel.js",
- "requires": [
- 161,
- 237,
- 238
- ],
- "uses": [],
- "idx": 239
- },
- {
- "path": "../packages/core/src/data/NodeStore.js",
- "requires": [
- 179,
- 237,
- 239
- ],
- "uses": [
- 161
- ],
- "idx": 240
- },
- {
- "path": "../packages/core/src/data/query/Compiler.js",
- "requires": [],
- "uses": [
- 79
- ],
- "idx": 241
- },
- {
- "path": "../packages/core/src/data/query/Converter.js",
- "requires": [],
- "uses": [],
- "idx": 242
- },
- {
- "path": "../packages/core/src/data/query/Stringifier.js",
- "requires": [],
- "uses": [
- 79
- ],
- "idx": 243
- },
- {
- "path": "../packages/core/src/data/query/Parser.js",
- "requires": [
- 217
- ],
- "uses": [],
- "idx": 244
- },
- {
- "path": "../packages/core/src/data/Query.js",
- "requires": [
- 12,
- 50,
- 241,
- 242,
- 243,
- 244
- ],
- "uses": [],
- "idx": 245
- },
- {
- "path": "../packages/core/src/data/Request.js",
- "requires": [],
- "uses": [],
- "idx": 246
- },
- {
- "path": "../packages/core/src/data/TreeStore.js",
- "requires": [
- 54,
- 179,
- 237,
- 239
- ],
- "uses": [
- 161
- ],
- "idx": 247
- },
- {
- "path": "../packages/core/src/data/Types.js",
- "requires": [
- 151
- ],
- "uses": [],
- "idx": 248
- },
- {
- "path": "../packages/core/src/data/Validation.js",
- "requires": [
- 161
- ],
- "uses": [],
- "idx": 249
- },
- {
- "path": "../packages/core/src/dom/Helper.js",
- "requires": [],
- "uses": [
- 95
- ],
- "idx": 250
- },
- {
- "path": "../packages/core/src/dom/Query.js",
- "requires": [
- 22,
- 250
- ],
- "uses": [
- 23
- ],
- "idx": 251
- },
- {
- "path": "../packages/core/src/data/reader/Xml.js",
- "requires": [
- 163,
- 251
- ],
- "uses": [],
- "idx": 252
- },
- {
- "path": "../packages/core/src/data/writer/Xml.js",
- "requires": [
- 164
- ],
- "uses": [],
- "idx": 253
- },
- {
- "path": "../packages/core/src/data/XmlStore.js",
- "requires": [
- 173,
- 179,
- 252,
- 253
- ],
- "uses": [],
- "idx": 254
- },
- {
- "path": "../packages/core/src/data/identifier/Negative.js",
- "requires": [
- 160
- ],
- "uses": [],
- "idx": 255
- },
- {
- "path": "../packages/core/src/data/identifier/Uuid.js",
- "requires": [
- 159
- ],
- "uses": [],
- "idx": 256
- },
- {
- "path": "../packages/core/src/data/proxy/WebStorage.js",
- "requires": [
- 160,
- 166
- ],
- "uses": [
- 54,
- 95,
- 162
- ],
- "idx": 257
- },
- {
- "path": "../packages/core/src/data/proxy/LocalStorage.js",
- "requires": [
- 257
- ],
- "uses": [],
- "idx": 258
- },
- {
- "path": "../packages/core/src/data/proxy/Rest.js",
- "requires": [
- 173
- ],
- "uses": [],
- "idx": 259
- },
- {
- "path": "../packages/core/src/data/proxy/SessionStorage.js",
- "requires": [
- 257
- ],
- "uses": [],
- "idx": 260
- },
- {
- "path": "../packages/core/src/data/schema/BelongsTo.js",
- "requires": [],
- "uses": [],
- "idx": 261
- },
- {
- "path": "../packages/core/src/data/schema/HasMany.js",
- "requires": [],
- "uses": [],
- "idx": 262
- },
- {
- "path": "../packages/core/src/data/schema/HasOne.js",
- "requires": [],
- "uses": [],
- "idx": 263
- },
- {
- "path": "../packages/core/src/data/schema/Reference.js",
- "requires": [],
- "uses": [],
- "idx": 264
- },
- {
- "path": "../packages/core/src/data/summary/Base.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 265
- },
- {
- "path": "../packages/core/src/data/summary/Sum.js",
- "requires": [
- 265
- ],
- "uses": [],
- "idx": 266
- },
- {
- "path": "../packages/core/src/data/summary/Average.js",
- "requires": [
- 266
- ],
- "uses": [],
- "idx": 267
- },
- {
- "path": "../packages/core/src/data/summary/Count.js",
- "requires": [
- 265
- ],
- "uses": [],
- "idx": 268
- },
- {
- "path": "../packages/core/src/data/summary/Max.js",
- "requires": [
- 265
- ],
- "uses": [],
- "idx": 269
- },
- {
- "path": "../packages/core/src/data/summary/Min.js",
- "requires": [
- 265
- ],
- "uses": [],
- "idx": 270
- },
- {
- "path": "../packages/core/src/data/summary/None.js",
- "requires": [
- 265
- ],
- "uses": [],
- "idx": 271
- },
- {
- "path": "../packages/core/src/data/validator/AbstractDate.js",
- "requires": [
- 152
- ],
- "uses": [],
- "idx": 272
- },
- {
- "path": "../packages/core/src/data/validator/Bound.js",
- "requires": [
- 152
- ],
- "uses": [
- 95
- ],
- "idx": 273
- },
- {
- "path": "../packages/core/src/data/validator/Format.js",
- "requires": [
- 152
- ],
- "uses": [],
- "idx": 274
- },
- {
- "path": "../packages/core/src/data/validator/CIDRv4.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 275
- },
- {
- "path": "../packages/core/src/data/validator/CIDRv6.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 276
- },
- {
- "path": "../packages/core/src/data/validator/Number.js",
- "requires": [
- 152
- ],
- "uses": [
- 94
- ],
- "idx": 277
- },
- {
- "path": "../packages/core/src/data/validator/Currency.js",
- "requires": [
- 277
- ],
- "uses": [
- 94
- ],
- "idx": 278
- },
- {
- "path": "../packages/core/src/data/validator/CurrencyUS.js",
- "requires": [
- 278
- ],
- "uses": [],
- "idx": 279
- },
- {
- "path": "../packages/core/src/data/validator/Date.js",
- "requires": [
- 272
- ],
- "uses": [],
- "idx": 280
- },
- {
- "path": "../packages/core/src/data/validator/DateTime.js",
- "requires": [
- 272
- ],
- "uses": [],
- "idx": 281
- },
- {
- "path": "../packages/core/src/data/validator/Email.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 282
- },
- {
- "path": "../packages/core/src/data/validator/List.js",
- "requires": [
- 152
- ],
- "uses": [],
- "idx": 283
- },
- {
- "path": "../packages/core/src/data/validator/Exclusion.js",
- "requires": [
- 283
- ],
- "uses": [],
- "idx": 284
- },
- {
- "path": "../packages/core/src/data/validator/IPAddress.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 285
- },
- {
- "path": "../packages/core/src/data/validator/Inclusion.js",
- "requires": [
- 283
- ],
- "uses": [],
- "idx": 286
- },
- {
- "path": "../packages/core/src/data/validator/Length.js",
- "requires": [
- 273
- ],
- "uses": [],
- "idx": 287
- },
- {
- "path": "../packages/core/src/data/validator/Presence.js",
- "requires": [
- 152
- ],
- "uses": [],
- "idx": 288
- },
- {
- "path": "../packages/core/src/data/validator/NotNull.js",
- "requires": [
- 288
- ],
- "uses": [],
- "idx": 289
- },
- {
- "path": "../packages/core/src/data/validator/Phone.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 290
- },
- {
- "path": "../packages/core/src/data/validator/Range.js",
- "requires": [
- 273
- ],
- "uses": [],
- "idx": 291
- },
- {
- "path": "../packages/core/src/data/validator/Time.js",
- "requires": [
- 272
- ],
- "uses": [],
- "idx": 292
- },
- {
- "path": "../packages/core/src/data/validator/Url.js",
- "requires": [
- 274
- ],
- "uses": [],
- "idx": 293
- },
- {
- "path": "../packages/core/src/data/virtual/Group.js",
- "requires": [],
- "uses": [],
- "idx": 294
- },
- {
- "path": "../packages/core/src/data/virtual/Page.js",
- "requires": [],
- "uses": [],
- "idx": 295
- },
- {
- "path": "../packages/core/src/data/virtual/PageMap.js",
- "requires": [
- 295
- ],
- "uses": [],
- "idx": 296
- },
- {
- "path": "../packages/core/src/data/virtual/Range.js",
- "requires": [
- 133
- ],
- "uses": [],
- "idx": 297
- },
- {
- "path": "../packages/core/src/data/virtual/Store.js",
- "requires": [
- 168,
- 176,
- 177,
- 296,
- 297
- ],
- "uses": [
- 131,
- 132,
- 161,
- 294
- ],
- "idx": 298
- },
- {
- "path": "../packages/core/src/direct/Event.js",
- "requires": [],
- "uses": [],
- "idx": 299
- },
- {
- "path": "../packages/core/src/direct/RemotingEvent.js",
- "requires": [
- 299
- ],
- "uses": [
- 224
- ],
- "idx": 300
- },
- {
- "path": "../packages/core/src/direct/ExceptionEvent.js",
- "requires": [
- 300
- ],
- "uses": [],
- "idx": 301
- },
- {
- "path": "../packages/core/src/direct/JsonProvider.js",
- "requires": [
- 225
- ],
- "uses": [
- 224,
- 301
- ],
- "idx": 302
- },
- {
- "path": "../packages/core/src/direct/PollingProvider.js",
- "requires": [
- 18,
- 57,
- 301,
- 302
- ],
- "uses": [
- 224,
- 399
- ],
- "idx": 303
- },
- {
- "path": "../packages/core/src/direct/RemotingMethod.js",
- "requires": [],
- "uses": [],
- "idx": 304
- },
- {
- "path": "../packages/core/src/direct/Transaction.js",
- "requires": [],
- "uses": [],
- "idx": 305
- },
- {
- "path": "../packages/core/src/direct/RemotingProvider.js",
- "requires": [
- 1,
- 56,
- 224,
- 302,
- 304,
- 305
- ],
- "uses": [
- 79,
- 301
- ],
- "idx": 306
- },
- {
- "path": "../packages/core/src/dom/GarbageCollector.js",
- "requires": [],
- "uses": [
- 49
- ],
- "idx": 307
- },
- {
- "path": "../packages/core/src/dom/TouchAction.js",
- "requires": [
- 35,
- 49
- ],
- "uses": [],
- "idx": 308
- },
- {
- "path": "../packages/core/src/drag/Constraint.js",
- "requires": [
- 12
- ],
- "uses": [
- 34
- ],
- "idx": 309
- },
- {
- "path": "../packages/core/src/drag/Info.js",
- "requires": [
- 10
- ],
- "uses": [],
- "idx": 310
- },
- {
- "path": "../packages/core/src/drag/Item.js",
- "requires": [
- 3,
- 4
- ],
- "uses": [],
- "idx": 311
- },
- {
- "path": "../packages/core/src/drag/Manager.js",
- "requires": [],
- "uses": [
- 49,
- 81,
- 310
- ],
- "idx": 312
- },
- {
- "path": "../packages/core/src/drag/Source.js",
- "requires": [
- 77,
- 309,
- 311
- ],
- "uses": [
- 12,
- 310
- ],
- "idx": 313
- },
- {
- "path": "../packages/core/src/drag/Target.js",
- "requires": [
- 311,
- 312
- ],
- "uses": [],
- "idx": 314
- },
- {
- "path": "../packages/core/src/drag/proxy/None.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 315
- },
- {
- "path": "../packages/core/src/drag/proxy/Original.js",
- "requires": [
- 315
- ],
- "uses": [],
- "idx": 316
- },
- {
- "path": "../packages/core/src/drag/proxy/Placeholder.js",
- "requires": [
- 315
- ],
- "uses": [],
- "idx": 317
- },
- {
- "path": "../packages/core/src/event/gesture/Recognizer.js",
- "requires": [
- 3,
- 38
- ],
- "uses": [],
- "idx": 318
- },
- {
- "path": "../packages/core/src/event/gesture/SingleTouch.js",
- "requires": [
- 318
- ],
- "uses": [],
- "idx": 319
- },
- {
- "path": "../packages/core/src/event/gesture/DoubleTap.js",
- "requires": [
- 319
- ],
- "uses": [
- 49
- ],
- "idx": 320
- },
- {
- "path": "../packages/core/src/event/gesture/Drag.js",
- "requires": [
- 319
- ],
- "uses": [
- 49
- ],
- "idx": 321
- },
- {
- "path": "../packages/core/src/event/gesture/Swipe.js",
- "requires": [
- 319
- ],
- "uses": [],
- "idx": 322
- },
- {
- "path": "../packages/core/src/event/gesture/EdgeSwipe.js",
- "requires": [
- 322
- ],
- "uses": [
- 49
- ],
- "idx": 323
- },
- {
- "path": "../packages/core/src/event/gesture/LongPress.js",
- "requires": [
- 319
- ],
- "uses": [
- 38,
- 49,
- 321
- ],
- "idx": 324
- },
- {
- "path": "../packages/core/src/event/gesture/MultiTouch.js",
- "requires": [
- 318
- ],
- "uses": [],
- "idx": 325
- },
- {
- "path": "../packages/core/src/event/gesture/Pinch.js",
- "requires": [
- 325
- ],
- "uses": [],
- "idx": 326
- },
- {
- "path": "../packages/core/src/event/gesture/Rotate.js",
- "requires": [
- 325
- ],
- "uses": [],
- "idx": 327
- },
- {
- "path": "../packages/core/src/event/gesture/Tap.js",
- "requires": [
- 319
- ],
- "uses": [
- 49
- ],
- "idx": 328
- },
- {
- "path": "../packages/core/src/event/publisher/Focus.js",
- "requires": [
- 37,
- 49,
- 75,
- 77
- ],
- "uses": [
- 36
- ],
- "idx": 329
- },
- {
- "path": "../packages/core/src/field/InputMask.js",
- "requires": [],
- "uses": [],
- "idx": 330
- },
- {
- "path": "../packages/core/src/fx/State.js",
- "requires": [],
- "uses": [],
- "idx": 331
- },
- {
- "path": "../packages/core/src/fx/animation/Abstract.js",
- "requires": [
- 12,
- 25,
- 331
- ],
- "uses": [],
- "idx": 332
- },
- {
- "path": "../packages/core/src/fx/animation/Slide.js",
- "requires": [
- 332
- ],
- "uses": [],
- "idx": 333
- },
- {
- "path": "../packages/core/src/fx/animation/SlideOut.js",
- "requires": [
- 333
- ],
- "uses": [],
- "idx": 334
- },
- {
- "path": "../packages/core/src/fx/animation/Fade.js",
- "requires": [
- 332
- ],
- "uses": [],
- "idx": 335
- },
- {
- "path": "../packages/core/src/fx/animation/FadeOut.js",
- "requires": [
- 335
- ],
- "uses": [],
- "idx": 336
- },
- {
- "path": "../packages/core/src/fx/animation/Flip.js",
- "requires": [
- 332
- ],
- "uses": [],
- "idx": 337
- },
- {
- "path": "../packages/core/src/fx/animation/Pop.js",
- "requires": [
- 332
- ],
- "uses": [],
- "idx": 338
- },
- {
- "path": "../packages/core/src/fx/animation/PopOut.js",
- "requires": [
- 338
- ],
- "uses": [],
- "idx": 339
- },
- {
- "path": "../packages/core/src/fx/Animation.js",
- "requires": [
- 333,
- 334,
- 335,
- 336,
- 337,
- 338,
- 339
- ],
- "uses": [
- 332
- ],
- "idx": 340
- },
- {
- "path": "../packages/core/src/fx/runner/Css.js",
- "requires": [
- 25,
- 340
- ],
- "uses": [
- 49
- ],
- "idx": 341
- },
- {
- "path": "../packages/core/src/fx/runner/CssTransition.js",
- "requires": [
- 19,
- 341
- ],
- "uses": [
- 340
- ],
- "idx": 342
- },
- {
- "path": "../packages/core/src/fx/Runner.js",
- "requires": [
- 342
- ],
- "uses": [],
- "idx": 343
- },
- {
- "path": "../packages/core/src/fx/animation/Cube.js",
- "requires": [
- 332
- ],
- "uses": [],
- "idx": 344
- },
- {
- "path": "../packages/core/src/fx/animation/Wipe.js",
- "requires": [
- 340
- ],
- "uses": [],
- "idx": 345
- },
- {
- "path": "../packages/core/src/fx/animation/WipeOut.js",
- "requires": [
- 345
- ],
- "uses": [],
- "idx": 346
- },
- {
- "path": "../packages/core/src/fx/easing/Bounce.js",
- "requires": [
- 105
- ],
- "uses": [],
- "idx": 347
- },
- {
- "path": "../packages/core/src/fx/easing/Momentum.js",
- "requires": [
- 105
- ],
- "uses": [],
- "idx": 348
- },
- {
- "path": "../packages/core/src/fx/easing/BoundMomentum.js",
- "requires": [
- 105,
- 347,
- 348
- ],
- "uses": [],
- "idx": 349
- },
- {
- "path": "../packages/core/src/fx/easing/EaseIn.js",
- "requires": [
- 106
- ],
- "uses": [],
- "idx": 350
- },
- {
- "path": "../packages/core/src/fx/easing/EaseOut.js",
- "requires": [
- 106
- ],
- "uses": [],
- "idx": 351
- },
- {
- "path": "../packages/core/src/fx/easing/Easing.js",
- "requires": [
- 106
- ],
- "uses": [],
- "idx": 352
- },
- {
- "path": "../packages/core/src/fx/runner/CssAnimation.js",
- "requires": [
- 341
- ],
- "uses": [
- 340
- ],
- "idx": 353
- },
- {
- "path": "../packages/core/src/list/AbstractTreeItem.js",
- "requires": [
- 89
- ],
- "uses": [],
- "idx": 354
- },
- {
- "path": "../packages/core/src/list/RootTreeItem.js",
- "requires": [
- 354
- ],
- "uses": [],
- "idx": 355
- },
- {
- "path": "../packages/core/src/mixin/ItemRippler.js",
- "requires": [],
- "uses": [],
- "idx": 356
- },
- {
- "path": "../packages/core/src/list/TreeItem.js",
- "requires": [
- 89,
- 354
- ],
- "uses": [],
- "idx": 357
- },
- {
- "path": "../packages/core/src/list/Tree.js",
- "requires": [
- 89,
- 355,
- 356,
- 357
- ],
- "uses": [
- 161,
- 182
- ],
- "idx": 358
- },
- {
- "path": "../packages/core/src/mixin/ConfigProxy.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 359
- },
- {
- "path": "../packages/core/src/mixin/ConfigState.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 360
- },
- {
- "path": "../packages/core/src/mixin/Container.js",
- "requires": [
- 0
- ],
- "uses": [
- 21
- ],
- "idx": 361
- },
- {
- "path": "../packages/core/src/util/KeyMap.js",
- "requires": [],
- "uses": [],
- "idx": 362
- },
- {
- "path": "../packages/core/src/util/KeyNav.js",
- "requires": [
- 362
- ],
- "uses": [
- 36
- ],
- "idx": 363
- },
- {
- "path": "../packages/core/src/mixin/FocusableContainer.js",
- "requires": [
- 0,
- 363
- ],
- "uses": [
- 21
- ],
- "idx": 364
- },
- {
- "path": "../packages/core/src/mixin/Hookable.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 365
- },
- {
- "path": "../packages/core/src/mixin/Mashup.js",
- "requires": [
- 0
- ],
- "uses": [
- 95
- ],
- "idx": 366
- },
- {
- "path": "../packages/core/src/mixin/Selectable.js",
- "requires": [
- 0
- ],
- "uses": [
- 132
- ],
- "idx": 367
- },
- {
- "path": "../packages/core/src/mixin/StoreWatcher.js",
- "requires": [],
- "uses": [],
- "idx": 368
- },
- {
- "path": "../packages/core/src/mixin/StyleCacher.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 369
- },
- {
- "path": "../packages/core/src/mixin/Traversable.js",
- "requires": [
- 0
- ],
- "uses": [],
- "idx": 370
- },
- {
- "path": "../packages/core/src/perf/Accumulator.js",
- "requires": [
- 98
- ],
- "uses": [],
- "idx": 371
- },
- {
- "path": "../packages/core/src/perf/Monitor.js",
- "requires": [
- 371
- ],
- "uses": [],
- "idx": 372
- },
- {
- "path": "../packages/core/src/plugin/AbstractClipboard.js",
- "requires": [
- 84,
- 362
- ],
- "uses": [
- 49
- ],
- "idx": 373
- },
- {
- "path": "../packages/core/src/plugin/MouseEnter.js",
- "requires": [
- 84
- ],
- "uses": [],
- "idx": 374
- },
- {
- "path": "../packages/core/src/sparkline/Shape.js",
- "requires": [],
- "uses": [],
- "idx": 375
- },
- {
- "path": "../packages/core/src/sparkline/CanvasBase.js",
- "requires": [
- 375
- ],
- "uses": [],
- "idx": 376
- },
- {
- "path": "../packages/core/src/sparkline/CanvasCanvas.js",
- "requires": [
- 376
- ],
- "uses": [],
- "idx": 377
- },
- {
- "path": "../packages/core/src/sparkline/VmlCanvas.js",
- "requires": [
- 376
- ],
- "uses": [],
- "idx": 378
- },
- {
- "path": "../packages/core/src/util/Color.js",
- "requires": [],
- "uses": [],
- "idx": 379
- },
- {
- "path": "../packages/core/src/sparkline/Base.js",
- "requires": [
- 89,
- 98,
- 377,
- 378,
- 379
- ],
- "uses": [],
- "idx": 380
- },
- {
- "path": "../packages/core/src/sparkline/BarBase.js",
- "requires": [
- 380
- ],
- "uses": [],
- "idx": 381
- },
- {
- "path": "../packages/core/src/sparkline/RangeMap.js",
- "requires": [],
- "uses": [],
- "idx": 382
- },
- {
- "path": "../packages/core/src/sparkline/Bar.js",
- "requires": [
- 381,
- 382
- ],
- "uses": [],
- "idx": 383
- },
- {
- "path": "../packages/core/src/sparkline/Box.js",
- "requires": [
- 380
- ],
- "uses": [],
- "idx": 384
- },
- {
- "path": "../packages/core/src/sparkline/Bullet.js",
- "requires": [
- 380
- ],
- "uses": [],
- "idx": 385
- },
- {
- "path": "../packages/core/src/sparkline/Discrete.js",
- "requires": [
- 381
- ],
- "uses": [],
- "idx": 386
- },
- {
- "path": "../packages/core/src/sparkline/Line.js",
- "requires": [
- 380,
- 382
- ],
- "uses": [],
- "idx": 387
- },
- {
- "path": "../packages/core/src/sparkline/Pie.js",
- "requires": [
- 380
- ],
- "uses": [],
- "idx": 388
- },
- {
- "path": "../packages/core/src/sparkline/TriState.js",
- "requires": [
- 381,
- 382
- ],
- "uses": [],
- "idx": 389
- },
- {
- "path": "../packages/core/src/util/Base64.js",
- "requires": [],
- "uses": [],
- "idx": 390
- },
- {
- "path": "../packages/core/src/util/DelimitedValue.js",
- "requires": [],
- "uses": [],
- "idx": 391
- },
- {
- "path": "../packages/core/src/util/CSV.js",
- "requires": [
- 391
- ],
- "uses": [],
- "idx": 392
- },
- {
- "path": "../packages/core/src/util/ClickRepeater.js",
- "requires": [
- 4
- ],
- "uses": [],
- "idx": 393
- },
- {
- "path": "../packages/core/src/util/Cookies.js",
- "requires": [],
- "uses": [],
- "idx": 394
- },
- {
- "path": "../packages/core/src/util/ItemCollection.js",
- "requires": [
- 56
- ],
- "uses": [],
- "idx": 395
- },
- {
- "path": "../packages/core/src/util/LocalStorage.js",
- "requires": [],
- "uses": [],
- "idx": 396
- },
- {
- "path": "../packages/core/src/util/Spans.js",
- "requires": [],
- "uses": [],
- "idx": 397
- },
- {
- "path": "../packages/core/src/util/TSV.js",
- "requires": [
- 391
- ],
- "uses": [],
- "idx": 398
- },
- {
- "path": "../packages/core/src/util/TaskManager.js",
- "requires": [
- 57
- ],
- "uses": [],
- "idx": 399
- },
- {
- "path": "../packages/core/src/util/TextMetrics.js",
- "requires": [
- 49
- ],
- "uses": [
- 75
- ],
- "idx": 400
- },
- {
- "path": "../packages/core/src/util/paintmonitor/OverflowChange.js",
- "requires": [
- 45
- ],
- "uses": [],
- "idx": 401
- },
- {
- "path": "../packages/core/src/util/sizemonitor/OverflowChange.js",
- "requires": [
- 41
- ],
- "uses": [
- 40
- ],
- "idx": 402
- },
- {
- "path": "../packages/core/src/util/translatable/CssPosition.js",
- "requires": [
- 108
- ],
- "uses": [],
- "idx": 403
- },
- {
- "path": "../packages/core/src/util/translatable/CssTransform.js",
- "requires": [
- 108
- ],
- "uses": [],
- "idx": 404
- },
- {
- "path": "../packages/core/src/util/translatable/ScrollParent.js",
- "requires": [
- 108
- ],
- "uses": [],
- "idx": 405
- },
- {
- "path": "../classic/classic/src/Action.js",
- "requires": [],
- "uses": [],
- "idx": 406
- },
- {
- "path": "../classic/classic/src/ElementLoader.js",
- "requires": [
- 52
- ],
- "uses": [
- 17,
- 18
- ],
- "idx": 407
- },
- {
- "path": "../classic/classic/src/ComponentLoader.js",
- "requires": [
- 407
- ],
- "uses": [],
- "idx": 408
- },
- {
- "path": "../classic/classic/src/layout/SizeModel.js",
- "requires": [],
- "uses": [],
- "idx": 409
- },
- {
- "path": "../classic/classic/src/layout/Layout.js",
- "requires": [
- 12,
- 98,
- 409
- ],
- "uses": [
- 635
- ],
- "idx": 410
- },
- {
- "path": "../classic/classic/src/layout/container/Container.js",
- "requires": [
- 98,
- 112,
- 410
- ],
- "uses": [
- 250
- ],
- "idx": 411
- },
- {
- "path": "../classic/classic/src/layout/container/Auto.js",
- "requires": [
- 411
- ],
- "uses": [
- 98
- ],
- "idx": 412
- },
- {
- "path": "../classic/classic/src/ZIndexManager.js",
- "requires": [
- 77,
- 176,
- 177
- ],
- "uses": [
- 49,
- 132
- ],
- "idx": 413
- },
- {
- "path": "../classic/classic/src/container/Container.js",
- "requires": [
- 56,
- 117,
- 238,
- 361,
- 364,
- 395,
- 406,
- 412,
- 413
- ],
- "uses": [
- 12,
- 21,
- 24,
- 49
- ],
- "idx": 414
- },
- {
- "path": "../classic/classic/src/layout/container/Editor.js",
- "requires": [
- 411
- ],
- "uses": [],
- "idx": 415
- },
- {
- "path": "../classic/classic/src/Editor.js",
- "requires": [
- 414,
- 415
- ],
- "uses": [
- 1,
- 21
- ],
- "idx": 416
- },
- {
- "path": "../classic/classic/src/EventManager.js",
- "requires": [],
- "uses": [
- 77
- ],
- "idx": 417
- },
- {
- "path": "../classic/classic/src/Gadget.js",
- "requires": [],
- "uses": [],
- "idx": 418
- },
- {
- "path": "../classic/classic/src/Img.js",
- "requires": [
- 78,
- 117
- ],
- "uses": [],
- "idx": 419
- },
- {
- "path": "../classic/classic/src/util/StoreHolder.js",
- "requires": [
- 182
- ],
- "uses": [],
- "idx": 420
- },
- {
- "path": "../classic/classic/src/LoadMask.js",
- "requires": [
- 117,
- 420
- ],
- "uses": [
- 49,
- 77,
- 182
- ],
- "idx": 421
- },
- {
- "path": "../classic/classic/src/layout/component/Component.js",
- "requires": [
- 410
- ],
- "uses": [],
- "idx": 422
- },
- {
- "path": "../classic/classic/src/layout/component/Auto.js",
- "requires": [
- 422
- ],
- "uses": [],
- "idx": 423
- },
- {
- "path": "../classic/classic/src/layout/component/ProgressBar.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 424
- },
- {
- "path": "../classic/classic/src/ProgressBar.js",
- "requires": [
- 92,
- 95,
- 102,
- 117,
- 399,
- 424
- ],
- "uses": [
- 73
- ],
- "idx": 425
- },
- {
- "path": "../classic/classic/src/dom/ButtonElement.js",
- "requires": [
- 49
- ],
- "uses": [],
- "idx": 426
- },
- {
- "path": "../classic/classic/src/button/Manager.js",
- "requires": [],
- "uses": [],
- "idx": 427
- },
- {
- "path": "../classic/classic/src/menu/Manager.js",
- "requires": [],
- "uses": [
- 21,
- 110,
- 117,
- 599
- ],
- "idx": 428
- },
- {
- "path": "../classic/classic/src/button/Button.js",
- "requires": [
- 78,
- 117,
- 238,
- 393,
- 400,
- 426,
- 427,
- 428
- ],
- "uses": [
- 49,
- 543
- ],
- "idx": 429
- },
- {
- "path": "../classic/classic/src/button/Split.js",
- "requires": [
- 429
- ],
- "uses": [
- 49,
- 427
- ],
- "idx": 430
- },
- {
- "path": "../classic/classic/src/button/Cycle.js",
- "requires": [
- 430
- ],
- "uses": [],
- "idx": 431
- },
- {
- "path": "../classic/classic/src/layout/container/SegmentedButton.js",
- "requires": [
- 411
- ],
- "uses": [],
- "idx": 432
- },
- {
- "path": "../classic/classic/src/button/Segmented.js",
- "requires": [
- 414,
- 429,
- 432
- ],
- "uses": [],
- "idx": 433
- },
- {
- "path": "../classic/classic/src/panel/Bar.js",
- "requires": [
- 414
- ],
- "uses": [],
- "idx": 434
- },
- {
- "path": "../classic/classic/src/panel/Title.js",
- "requires": [
- 78,
- 117
- ],
- "uses": [],
- "idx": 435
- },
- {
- "path": "../classic/classic/src/panel/Tool.js",
- "requires": [
- 78,
- 117
- ],
- "uses": [
- 543
- ],
- "idx": 436
- },
- {
- "path": "../classic/classic/src/panel/Header.js",
- "requires": [
- 423,
- 434,
- 435,
- 436
- ],
- "uses": [
- 21
- ],
- "idx": 437
- },
- {
- "path": "../classic/classic/src/layout/container/boxOverflow/None.js",
- "requires": [
- 12
- ],
- "uses": [],
- "idx": 438
- },
- {
- "path": "../classic/classic/src/layout/container/boxOverflow/Scroller.js",
- "requires": [
- 4,
- 49,
- 393,
- 438
- ],
- "uses": [
- 117
- ],
- "idx": 439
- },
- {
- "path": "../classic/classic/src/dd/DragDropManager.js",
- "requires": [
- 34,
- 35
- ],
- "uses": [
- 49,
- 471,
- 543
- ],
- "idx": 440
- },
- {
- "path": "../classic/classic/src/resizer/Splitter.js",
- "requires": [
- 98,
- 117
- ],
- "uses": [
- 467
- ],
- "idx": 441
- },
- {
- "path": "../classic/classic/src/layout/container/Box.js",
- "requires": [
- 94,
- 411,
- 438,
- 439,
- 440,
- 441
- ],
- "uses": [
- 12,
- 409,
- 423
- ],
- "idx": 442
- },
- {
- "path": "../classic/classic/src/layout/container/HBox.js",
- "requires": [
- 442
- ],
- "uses": [],
- "idx": 443
- },
- {
- "path": "../classic/classic/src/layout/container/VBox.js",
- "requires": [
- 442
- ],
- "uses": [],
- "idx": 444
- },
- {
- "path": "../classic/classic/src/toolbar/Toolbar.js",
- "requires": [
- 414,
- 423,
- 443,
- 444
- ],
- "uses": [
- 117,
- 374,
- 525,
- 546,
- 671,
- 672
- ],
- "idx": 445
- },
- {
- "path": "../classic/classic/src/dd/DragDrop.js",
- "requires": [
- 440
- ],
- "uses": [
- 49
- ],
- "idx": 446
- },
- {
- "path": "../classic/classic/src/dd/DD.js",
- "requires": [
- 440,
- 446
- ],
- "uses": [
- 49
- ],
- "idx": 447
- },
- {
- "path": "../classic/classic/src/dd/DDProxy.js",
- "requires": [
- 447
- ],
- "uses": [
- 440
- ],
- "idx": 448
- },
- {
- "path": "../classic/classic/src/dd/StatusProxy.js",
- "requires": [
- 117
- ],
- "uses": [],
- "idx": 449
- },
- {
- "path": "../classic/classic/src/dd/DragSource.js",
- "requires": [
- 440,
- 448,
- 449
- ],
- "uses": [
- 423
- ],
- "idx": 450
- },
- {
- "path": "../classic/classic/src/panel/Proxy.js",
- "requires": [],
- "uses": [
- 49
- ],
- "idx": 451
- },
- {
- "path": "../classic/classic/src/panel/DD.js",
- "requires": [
- 450,
- 451
- ],
- "uses": [],
- "idx": 452
- },
- {
- "path": "../classic/classic/src/layout/component/Dock.js",
- "requires": [
- 422
- ],
- "uses": [
- 24,
- 49,
- 409
- ],
- "idx": 453
- },
- {
- "path": "../classic/classic/src/util/Memento.js",
- "requires": [],
- "uses": [],
- "idx": 454
- },
- {
- "path": "../classic/classic/src/container/DockingContainer.js",
- "requires": [
- 49,
- 56
- ],
- "uses": [
- 24,
- 250,
- 395
- ],
- "idx": 455
- },
- {
- "path": "../classic/classic/src/panel/Panel.js",
- "requires": [
- 49,
- 56,
- 73,
- 98,
- 414,
- 437,
- 445,
- 452,
- 453,
- 454,
- 455
- ],
- "uses": [
- 1,
- 21,
- 34,
- 94,
- 101,
- 102,
- 117,
- 250,
- 363,
- 412,
- 423,
- 436,
- 488
- ],
- "idx": 456
- },
- {
- "path": "../classic/classic/src/layout/container/Table.js",
- "requires": [
- 411
- ],
- "uses": [],
- "idx": 457
- },
- {
- "path": "../classic/classic/src/container/ButtonGroup.js",
- "requires": [
- 456,
- 457
- ],
- "uses": [],
- "idx": 458
- },
- {
- "path": "../classic/classic/src/container/Monitor.js",
- "requires": [],
- "uses": [
- 24,
- 56
- ],
- "idx": 459
- },
- {
- "path": "../classic/classic/src/plugin/Viewport.js",
- "requires": [
- 84,
- 118
- ],
- "uses": [
- 49,
- 90,
- 409
- ],
- "idx": 460
- },
- {
- "path": "../classic/classic/src/container/Viewport.js",
- "requires": [
- 118,
- 414,
- 460
- ],
- "uses": [],
- "idx": 461
- },
- {
- "path": "../classic/classic/src/layout/container/Anchor.js",
- "requires": [
- 412
- ],
- "uses": [],
- "idx": 462
- },
- {
- "path": "../classic/classic/src/dashboard/Panel.js",
- "requires": [
- 456
- ],
- "uses": [
- 21
- ],
- "idx": 463
- },
- {
- "path": "../classic/classic/src/dashboard/Column.js",
- "requires": [
- 414,
- 462,
- 463
- ],
- "uses": [],
- "idx": 464
- },
- {
- "path": "../classic/classic/src/layout/container/Column.js",
- "requires": [
- 412
- ],
- "uses": [],
- "idx": 465
- },
- {
- "path": "../classic/classic/src/dd/DragTracker.js",
- "requires": [
- 52
- ],
- "uses": [
- 34,
- 117,
- 363
- ],
- "idx": 466
- },
- {
- "path": "../classic/classic/src/resizer/SplitterTracker.js",
- "requires": [
- 34,
- 466
- ],
- "uses": [
- 49,
- 106
- ],
- "idx": 467
- },
- {
- "path": "../classic/classic/src/layout/container/ColumnSplitterTracker.js",
- "requires": [
- 467
- ],
- "uses": [],
- "idx": 468
- },
- {
- "path": "../classic/classic/src/layout/container/ColumnSplitter.js",
- "requires": [
- 441,
- 468
- ],
- "uses": [],
- "idx": 469
- },
- {
- "path": "../classic/classic/src/layout/container/Dashboard.js",
- "requires": [
- 465,
- 469
- ],
- "uses": [
- 423
- ],
- "idx": 470
- },
- {
- "path": "../classic/classic/src/dd/DDTarget.js",
- "requires": [
- 446
- ],
- "uses": [],
- "idx": 471
- },
- {
- "path": "../classic/classic/src/dd/ScrollManager.js",
- "requires": [
- 440
- ],
- "uses": [],
- "idx": 472
- },
- {
- "path": "../classic/classic/src/dd/DropTarget.js",
- "requires": [
- 471,
- 472
- ],
- "uses": [],
- "idx": 473
- },
- {
- "path": "../classic/classic/src/dashboard/DropZone.js",
- "requires": [
- 473
- ],
- "uses": [],
- "idx": 474
- },
- {
- "path": "../classic/classic/src/dashboard/Part.js",
- "requires": [
- 3,
- 12,
- 134
- ],
- "uses": [],
- "idx": 475
- },
- {
- "path": "../classic/classic/src/dashboard/Dashboard.js",
- "requires": [
- 456,
- 464,
- 470,
- 474,
- 475
- ],
- "uses": [
- 12,
- 115,
- 132
- ],
- "idx": 476
- },
- {
- "path": "../classic/classic/src/dd/DragZone.js",
- "requires": [
- 450
- ],
- "uses": [
- 472,
- 478
- ],
- "idx": 477
- },
- {
- "path": "../classic/classic/src/dd/Registry.js",
- "requires": [],
- "uses": [],
- "idx": 478
- },
- {
- "path": "../classic/classic/src/dd/DropZone.js",
- "requires": [
- 473,
- 478
- ],
- "uses": [
- 440
- ],
- "idx": 479
- },
- {
- "path": "../classic/classic/src/dom/Layer.js",
- "requires": [
- 49
- ],
- "uses": [
- 250
- ],
- "idx": 480
- },
- {
- "path": "../classic/classic/src/enums.js",
- "requires": [],
- "uses": [],
- "idx": 481
- },
- {
- "path": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
- "requires": [
- 37
- ],
- "uses": [],
- "idx": 482
- },
- {
- "path": "../classic/classic/src/flash/Component.js",
- "requires": [
- 117
- ],
- "uses": [],
- "idx": 483
- },
- {
- "path": "../classic/classic/src/form/action/Action.js",
- "requires": [],
- "uses": [],
- "idx": 484
- },
- {
- "path": "../classic/classic/src/form/action/Load.js",
- "requires": [
- 17,
- 484
- ],
- "uses": [
- 18
- ],
- "idx": 485
- },
- {
- "path": "../classic/classic/src/form/action/Submit.js",
- "requires": [
- 484
- ],
- "uses": [
- 18,
- 250
- ],
- "idx": 486
- },
- {
- "path": "../classic/classic/src/form/action/StandardSubmit.js",
- "requires": [
- 486
- ],
- "uses": [],
- "idx": 487
- },
- {
- "path": "../classic/classic/src/util/ComponentDragger.js",
- "requires": [
- 466
- ],
- "uses": [
- 34,
- 49
- ],
- "idx": 488
- },
- {
- "path": "../classic/classic/src/window/Window.js",
- "requires": [
- 34,
- 456,
- 488
- ],
- "uses": [],
- "idx": 489
- },
- {
- "path": "../classic/classic/src/form/Labelable.js",
- "requires": [
- 0,
- 98
- ],
- "uses": [
- 49,
- 542
- ],
- "idx": 490
- },
- {
- "path": "../classic/classic/src/form/field/Field.js",
- "requires": [],
- "uses": [],
- "idx": 491
- },
- {
- "path": "../classic/classic/src/form/field/Base.js",
- "requires": [
- 1,
- 98,
- 117,
- 490,
- 491
- ],
- "uses": [
- 95,
- 250
- ],
- "idx": 492
- },
- {
- "path": "../classic/classic/src/layout/component/field/Text.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 493
- },
- {
- "path": "../classic/classic/src/form/field/VTypes.js",
- "requires": [],
- "uses": [],
- "idx": 494
- },
- {
- "path": "../classic/classic/src/form/trigger/Trigger.js",
- "requires": [
- 12,
- 393
- ],
- "uses": [
- 49,
- 98
- ],
- "idx": 495
- },
- {
- "path": "../classic/classic/src/form/field/Text.js",
- "requires": [
- 400,
- 409,
- 492,
- 493,
- 494,
- 495
- ],
- "uses": [
- 94,
- 95,
- 102
- ],
- "idx": 496
- },
- {
- "path": "../classic/classic/src/form/field/TextArea.js",
- "requires": [
- 1,
- 98,
- 496
- ],
- "uses": [
- 94,
- 400
- ],
- "idx": 497
- },
- {
- "path": "../classic/classic/src/window/MessageBox.js",
- "requires": [
- 425,
- 429,
- 443,
- 445,
- 462,
- 489,
- 496,
- 497
- ],
- "uses": [
- 117,
- 414,
- 423,
- 424
- ],
- "idx": 498
- },
- {
- "path": "../classic/classic/src/form/Basic.js",
- "requires": [
- 1,
- 52,
- 56,
- 145,
- 485,
- 486,
- 487,
- 498
- ],
- "uses": [
- 459
- ],
- "idx": 499
- },
- {
- "path": "../classic/classic/src/layout/component/field/FieldContainer.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 500
- },
- {
- "path": "../classic/classic/src/form/FieldAncestor.js",
- "requires": [
- 0,
- 459
- ],
- "uses": [],
- "idx": 501
- },
- {
- "path": "../classic/classic/src/form/FieldContainer.js",
- "requires": [
- 414,
- 490,
- 500,
- 501
- ],
- "uses": [],
- "idx": 502
- },
- {
- "path": "../classic/classic/src/layout/container/CheckboxGroup.js",
- "requires": [
- 411
- ],
- "uses": [
- 250
- ],
- "idx": 503
- },
- {
- "path": "../classic/classic/src/form/CheckboxManager.js",
- "requires": [
- 56
- ],
- "uses": [],
- "idx": 504
- },
- {
- "path": "../classic/classic/src/form/field/Checkbox.js",
- "requires": [
- 98,
- 492,
- 504
- ],
- "uses": [],
- "idx": 505
- },
- {
- "path": "../classic/classic/src/form/CheckboxGroup.js",
- "requires": [
- 491,
- 492,
- 502,
- 503,
- 505
- ],
- "uses": [],
- "idx": 506
- },
- {
- "path": "../classic/classic/src/form/FieldSet.js",
- "requires": [
- 414,
- 501
- ],
- "uses": [
- 49,
- 101,
- 117,
- 250,
- 423,
- 436,
- 462,
- 505,
- 638
- ],
- "idx": 507
- },
- {
- "path": "../classic/classic/src/form/Label.js",
- "requires": [
- 94,
- 117
- ],
- "uses": [],
- "idx": 508
- },
- {
- "path": "../classic/classic/src/form/Panel.js",
- "requires": [
- 57,
- 456,
- 499,
- 501
- ],
- "uses": [
- 399
- ],
- "idx": 509
- },
- {
- "path": "../classic/classic/src/form/RadioManager.js",
- "requires": [
- 56
- ],
- "uses": [],
- "idx": 510
- },
- {
- "path": "../classic/classic/src/form/field/Radio.js",
- "requires": [
- 505,
- 510
- ],
- "uses": [],
- "idx": 511
- },
- {
- "path": "../classic/classic/src/form/RadioGroup.js",
- "requires": [
- 506,
- 511
- ],
- "uses": [
- 510
- ],
- "idx": 512
- },
- {
- "path": "../classic/classic/src/form/action/DirectAction.js",
- "requires": [
- 0
- ],
- "uses": [
- 224
- ],
- "idx": 513
- },
- {
- "path": "../classic/classic/src/form/action/DirectLoad.js",
- "requires": [
- 224,
- 485,
- 513
- ],
- "uses": [],
- "idx": 514
- },
- {
- "path": "../classic/classic/src/form/action/DirectSubmit.js",
- "requires": [
- 224,
- 486,
- 513
- ],
- "uses": [],
- "idx": 515
- },
- {
- "path": "../classic/classic/src/form/field/Picker.js",
- "requires": [
- 363,
- 496
- ],
- "uses": [],
- "idx": 516
- },
- {
- "path": "../classic/classic/src/selection/Model.js",
- "requires": [
- 4,
- 12,
- 189,
- 420
- ],
- "uses": [],
- "idx": 517
- },
- {
- "path": "../classic/classic/src/selection/DataViewModel.js",
- "requires": [
- 363,
- 517
- ],
- "uses": [],
- "idx": 518
- },
- {
- "path": "../classic/classic/src/view/NavigationModel.js",
- "requires": [
- 12,
- 52,
- 420
- ],
- "uses": [
- 363
- ],
- "idx": 519
- },
- {
- "path": "../classic/classic/src/view/AbstractView.js",
- "requires": [
- 75,
- 76,
- 104,
- 117,
- 420,
- 421,
- 518,
- 519
- ],
- "uses": [
- 1,
- 12,
- 49,
- 95,
- 98,
- 182,
- 250
- ],
- "idx": 520
- },
- {
- "path": "../classic/classic/src/view/View.js",
- "requires": [
- 520
- ],
- "uses": [],
- "idx": 521
- },
- {
- "path": "../classic/classic/src/view/BoundListKeyNav.js",
- "requires": [
- 519
- ],
- "uses": [
- 36,
- 363
- ],
- "idx": 522
- },
- {
- "path": "../classic/classic/src/layout/component/BoundList.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 523
- },
- {
- "path": "../classic/classic/src/toolbar/Item.js",
- "requires": [
- 117,
- 445
- ],
- "uses": [],
- "idx": 524
- },
- {
- "path": "../classic/classic/src/toolbar/TextItem.js",
- "requires": [
- 98,
- 445,
- 524
- ],
- "uses": [],
- "idx": 525
- },
- {
- "path": "../classic/classic/src/form/trigger/Spinner.js",
- "requires": [
- 495
- ],
- "uses": [],
- "idx": 526
- },
- {
- "path": "../classic/classic/src/form/field/Spinner.js",
- "requires": [
- 363,
- 496,
- 526
- ],
- "uses": [],
- "idx": 527
- },
- {
- "path": "../classic/classic/src/form/field/Number.js",
- "requires": [
- 527
- ],
- "uses": [
- 94,
- 95
- ],
- "idx": 528
- },
- {
- "path": "../classic/classic/src/toolbar/Paging.js",
- "requires": [
- 420,
- 445,
- 525,
- 528
- ],
- "uses": [
- 95,
- 423,
- 493,
- 526
- ],
- "idx": 529
- },
- {
- "path": "../classic/classic/src/view/BoundList.js",
- "requires": [
- 49,
- 238,
- 521,
- 522,
- 523,
- 529
- ],
- "uses": [
- 98,
- 423
- ],
- "idx": 530
- },
- {
- "path": "../classic/classic/src/form/field/ComboBox.js",
- "requires": [
- 1,
- 182,
- 420,
- 516,
- 530
- ],
- "uses": [
- 49,
- 51,
- 98,
- 132,
- 161,
- 177,
- 250,
- 363,
- 518,
- 522,
- 523
- ],
- "idx": 531
- },
- {
- "path": "../classic/classic/src/picker/Month.js",
- "requires": [
- 98,
- 117,
- 393,
- 429
- ],
- "uses": [
- 423
- ],
- "idx": 532
- },
- {
- "path": "../classic/classic/src/picker/Date.js",
- "requires": [
- 67,
- 98,
- 117,
- 363,
- 393,
- 429,
- 430,
- 532
- ],
- "uses": [
- 95,
- 250,
- 423
- ],
- "idx": 533
- },
- {
- "path": "../classic/classic/src/form/field/Date.js",
- "requires": [
- 516,
- 533
- ],
- "uses": [
- 95,
- 423
- ],
- "idx": 534
- },
- {
- "path": "../classic/classic/src/form/field/Display.js",
- "requires": [
- 94,
- 98,
- 492
- ],
- "uses": [],
- "idx": 535
- },
- {
- "path": "../classic/classic/src/form/field/FileButton.js",
- "requires": [
- 429
- ],
- "uses": [],
- "idx": 536
- },
- {
- "path": "../classic/classic/src/form/trigger/Component.js",
- "requires": [
- 495
- ],
- "uses": [],
- "idx": 537
- },
- {
- "path": "../classic/classic/src/form/field/File.js",
- "requires": [
- 496,
- 536,
- 537
- ],
- "uses": [
- 423
- ],
- "idx": 538
- },
- {
- "path": "../classic/classic/src/form/field/Hidden.js",
- "requires": [
- 492
- ],
- "uses": [],
- "idx": 539
- },
- {
- "path": "../classic/classic/src/tip/Tip.js",
- "requires": [
- 456
- ],
- "uses": [
- 35,
- 117
- ],
- "idx": 540
- },
- {
- "path": "../classic/classic/src/tip/ToolTip.js",
- "requires": [
- 33,
- 540
- ],
- "uses": [
- 35,
- 75
- ],
- "idx": 541
- },
- {
- "path": "../classic/classic/src/tip/QuickTip.js",
- "requires": [
- 541
- ],
- "uses": [],
- "idx": 542
- },
- {
- "path": "../classic/classic/src/tip/QuickTipManager.js",
- "requires": [
- 542
- ],
- "uses": [],
- "idx": 543
- },
- {
- "path": "../classic/classic/src/picker/Color.js",
- "requires": [
- 98,
- 117
- ],
- "uses": [],
- "idx": 544
- },
- {
- "path": "../classic/classic/src/layout/component/field/HtmlEditor.js",
- "requires": [
- 500
- ],
- "uses": [],
- "idx": 545
- },
- {
- "path": "../classic/classic/src/toolbar/Separator.js",
- "requires": [
- 445,
- 524
- ],
- "uses": [],
- "idx": 546
- },
- {
- "path": "../classic/classic/src/layout/container/boxOverflow/Menu.js",
- "requires": [
- 429,
- 438,
- 546
- ],
- "uses": [
- 423,
- 439,
- 444,
- 453,
- 505,
- 597,
- 599,
- 671
- ],
- "idx": 547
- },
- {
- "path": "../classic/classic/src/form/field/HtmlEditor.js",
- "requires": [
- 94,
- 399,
- 444,
- 445,
- 491,
- 502,
- 524,
- 543,
- 544,
- 545,
- 547
- ],
- "uses": [
- 1,
- 95,
- 117,
- 250,
- 423,
- 439,
- 453,
- 599
- ],
- "idx": 548
- },
- {
- "path": "../classic/classic/src/view/TagKeyNav.js",
- "requires": [
- 522
- ],
- "uses": [],
- "idx": 549
- },
- {
- "path": "../classic/classic/src/form/field/Tag.js",
- "requires": [
- 179,
- 221,
- 517,
- 531,
- 549
- ],
- "uses": [
- 51,
- 95,
- 98,
- 167,
- 174,
- 175
- ],
- "idx": 550
- },
- {
- "path": "../classic/classic/src/picker/Time.js",
- "requires": [
- 179,
- 530
- ],
- "uses": [
- 51
- ],
- "idx": 551
- },
- {
- "path": "../classic/classic/src/form/field/Time.js",
- "requires": [
- 522,
- 531,
- 534,
- 551
- ],
- "uses": [
- 95,
- 98,
- 518,
- 523
- ],
- "idx": 552
- },
- {
- "path": "../classic/classic/src/form/field/Trigger.js",
- "requires": [
- 250,
- 393,
- 496
- ],
- "uses": [],
- "idx": 553
- },
- {
- "path": "../classic/classic/src/grid/CellContext.js",
- "requires": [],
- "uses": [],
- "idx": 554
- },
- {
- "path": "../classic/classic/src/grid/CellEditor.js",
- "requires": [
- 416
- ],
- "uses": [
- 49,
- 414
- ],
- "idx": 555
- },
- {
- "path": "../classic/classic/src/grid/ColumnComponentLayout.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 556
- },
- {
- "path": "../classic/classic/src/layout/container/Fit.js",
- "requires": [
- 411
- ],
- "uses": [],
- "idx": 557
- },
- {
- "path": "../classic/classic/src/panel/Table.js",
- "requires": [
- 456,
- 557
- ],
- "uses": [
- 1,
- 77,
- 115,
- 182,
- 222,
- 250,
- 554,
- 561,
- 568,
- 578,
- 612,
- 613,
- 656,
- 657,
- 658
- ],
- "idx": 558
- },
- {
- "path": "../classic/classic/src/grid/ColumnLayout.js",
- "requires": [
- 443,
- 558
- ],
- "uses": [],
- "idx": 559
- },
- {
- "path": "../classic/classic/src/grid/ColumnManager.js",
- "requires": [],
- "uses": [],
- "idx": 560
- },
- {
- "path": "../classic/classic/src/grid/NavigationModel.js",
- "requires": [
- 519
- ],
- "uses": [
- 21,
- 36,
- 49,
- 75,
- 117,
- 363,
- 554
- ],
- "idx": 561
- },
- {
- "path": "../classic/classic/src/view/TableLayout.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 562
- },
- {
- "path": "../classic/classic/src/grid/locking/RowSynchronizer.js",
- "requires": [],
- "uses": [],
- "idx": 563
- },
- {
- "path": "../classic/classic/src/view/NodeCache.js",
- "requires": [
- 76
- ],
- "uses": [
- 49,
- 75
- ],
- "idx": 564
- },
- {
- "path": "../classic/classic/src/scroll/TableScroller.js",
- "requires": [
- 110
- ],
- "uses": [
- 10
- ],
- "idx": 565
- },
- {
- "path": "../classic/classic/src/view/Table.js",
- "requires": [
- 1,
- 56,
- 75,
- 238,
- 521,
- 554,
- 562,
- 563,
- 564,
- 565
- ],
- "uses": [
- 12,
- 49,
- 98,
- 117,
- 161,
- 578
- ],
- "idx": 566
- },
- {
- "path": "../classic/classic/src/grid/Panel.js",
- "requires": [
- 558,
- 566
- ],
- "uses": [],
- "idx": 567
- },
- {
- "path": "../classic/classic/src/grid/RowContext.js",
- "requires": [],
- "uses": [
- 12
- ],
- "idx": 568
- },
- {
- "path": "../classic/classic/src/grid/RowEditorButtons.js",
- "requires": [
- 414
- ],
- "uses": [
- 423,
- 429,
- 456
- ],
- "idx": 569
- },
- {
- "path": "../classic/classic/src/grid/RowEditor.js",
- "requires": [
- 363,
- 509,
- 541,
- 569
- ],
- "uses": [
- 49,
- 67,
- 77,
- 412,
- 414,
- 423,
- 453,
- 535,
- 554
- ],
- "idx": 570
- },
- {
- "path": "../classic/classic/src/grid/Scroller.js",
- "requires": [],
- "uses": [],
- "idx": 571
- },
- {
- "path": "../classic/classic/src/view/DropZone.js",
- "requires": [
- 479
- ],
- "uses": [
- 117,
- 423
- ],
- "idx": 572
- },
- {
- "path": "../classic/classic/src/grid/ViewDropZone.js",
- "requires": [
- 572
- ],
- "uses": [],
- "idx": 573
- },
- {
- "path": "../classic/classic/src/grid/plugin/HeaderResizer.js",
- "requires": [
- 34,
- 84,
- 466
- ],
- "uses": [
- 579
- ],
- "idx": 574
- },
- {
- "path": "../classic/classic/src/grid/header/DragZone.js",
- "requires": [
- 477
- ],
- "uses": [],
- "idx": 575
- },
- {
- "path": "../classic/classic/src/grid/header/DropZone.js",
- "requires": [
- 479
- ],
- "uses": [
- 440
- ],
- "idx": 576
- },
- {
- "path": "../classic/classic/src/grid/plugin/HeaderReorderer.js",
- "requires": [
- 84,
- 575,
- 576
- ],
- "uses": [],
- "idx": 577
- },
- {
- "path": "../classic/classic/src/grid/header/Container.js",
- "requires": [
- 363,
- 414,
- 559,
- 574,
- 577
- ],
- "uses": [
- 1,
- 117,
- 423,
- 439,
- 444,
- 453,
- 560,
- 579,
- 597,
- 598,
- 599
- ],
- "idx": 578
- },
- {
- "path": "../classic/classic/src/grid/column/Column.js",
- "requires": [
- 218,
- 556,
- 559,
- 578
- ],
- "uses": [
- 54,
- 94,
- 574
- ],
- "idx": 579
- },
- {
- "path": "../classic/classic/src/grid/column/ActionProxy.js",
- "requires": [],
- "uses": [],
- "idx": 580
- },
- {
- "path": "../classic/classic/src/grid/column/Action.js",
- "requires": [
- 78,
- 94,
- 579,
- 580
- ],
- "uses": [
- 49
- ],
- "idx": 581
- },
- {
- "path": "../classic/classic/src/grid/column/Boolean.js",
- "requires": [
- 579
- ],
- "uses": [],
- "idx": 582
- },
- {
- "path": "../classic/classic/src/grid/column/Check.js",
- "requires": [
- 579
- ],
- "uses": [
- 554
- ],
- "idx": 583
- },
- {
- "path": "../classic/classic/src/grid/column/Date.js",
- "requires": [
- 579
- ],
- "uses": [
- 94
- ],
- "idx": 584
- },
- {
- "path": "../classic/classic/src/grid/column/Number.js",
- "requires": [
- 94,
- 579
- ],
- "uses": [],
- "idx": 585
- },
- {
- "path": "../classic/classic/src/grid/column/RowNumberer.js",
- "requires": [
- 579
- ],
- "uses": [
- 554
- ],
- "idx": 586
- },
- {
- "path": "../classic/classic/src/grid/column/Template.js",
- "requires": [
- 98,
- 579
- ],
- "uses": [
- 583
- ],
- "idx": 587
- },
- {
- "path": "../classic/classic/src/grid/column/Widget.js",
- "requires": [
- 369,
- 579
- ],
- "uses": [],
- "idx": 588
- },
- {
- "path": "../classic/classic/src/grid/feature/Feature.js",
- "requires": [
- 52
- ],
- "uses": [],
- "idx": 589
- },
- {
- "path": "../classic/classic/src/grid/feature/AbstractSummary.js",
- "requires": [
- 589
- ],
- "uses": [],
- "idx": 590
- },
- {
- "path": "../classic/classic/src/grid/feature/GroupStore.js",
- "requires": [
- 52
- ],
- "uses": [
- 132
- ],
- "idx": 591
- },
- {
- "path": "../classic/classic/src/grid/feature/Grouping.js",
- "requires": [
- 589,
- 590,
- 591
- ],
- "uses": [
- 98,
- 161
- ],
- "idx": 592
- },
- {
- "path": "../classic/classic/src/grid/feature/GroupingSummary.js",
- "requires": [
- 592
- ],
- "uses": [],
- "idx": 593
- },
- {
- "path": "../classic/classic/src/grid/feature/RowBody.js",
- "requires": [
- 589
- ],
- "uses": [
- 98
- ],
- "idx": 594
- },
- {
- "path": "../classic/classic/src/grid/feature/Summary.js",
- "requires": [
- 590
- ],
- "uses": [
- 117,
- 161,
- 423
- ],
- "idx": 595
- },
- {
- "path": "../classic/classic/src/menu/Item.js",
- "requires": [
- 78,
- 117,
- 238
- ],
- "uses": [
- 428,
- 543
- ],
- "idx": 596
- },
- {
- "path": "../classic/classic/src/menu/CheckItem.js",
- "requires": [
- 596
- ],
- "uses": [
- 428
- ],
- "idx": 597
- },
- {
- "path": "../classic/classic/src/menu/Separator.js",
- "requires": [
- 596
- ],
- "uses": [],
- "idx": 598
- },
- {
- "path": "../classic/classic/src/menu/Menu.js",
- "requires": [
- 428,
- 444,
- 456,
- 596,
- 597,
- 598
- ],
- "uses": [
- 1,
- 21,
- 36,
- 49,
- 363,
- 423
- ],
- "idx": 599
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/Base.js",
- "requires": [
- 12,
- 439,
- 444,
- 453,
- 599
- ],
- "uses": [
- 1,
- 51
- ],
- "idx": 600
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/SingleFilter.js",
- "requires": [
- 600
- ],
- "uses": [],
- "idx": 601
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/Boolean.js",
- "requires": [
- 601
- ],
- "uses": [],
- "idx": 602
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/TriFilter.js",
- "requires": [
- 600
- ],
- "uses": [],
- "idx": 603
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/Date.js",
- "requires": [
- 423,
- 597,
- 603
- ],
- "uses": [
- 439,
- 444,
- 453,
- 533,
- 648
- ],
- "idx": 604
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/List.js",
- "requires": [
- 601
- ],
- "uses": [
- 179,
- 182
- ],
- "idx": 605
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/Number.js",
- "requires": [
- 493,
- 526,
- 603
- ],
- "uses": [
- 528
- ],
- "idx": 606
- },
- {
- "path": "../classic/classic/src/grid/filters/filter/String.js",
- "requires": [
- 493,
- 496,
- 601
- ],
- "uses": [
- 51
- ],
- "idx": 607
- },
- {
- "path": "../classic/classic/src/grid/filters/Filters.js",
- "requires": [
- 84,
- 420,
- 600,
- 601,
- 602,
- 603,
- 604,
- 605,
- 606,
- 607
- ],
- "uses": [
- 12
- ],
- "idx": 608
- },
- {
- "path": "../classic/classic/src/grid/locking/HeaderContainer.js",
- "requires": [
- 560,
- 578
- ],
- "uses": [],
- "idx": 609
- },
- {
- "path": "../classic/classic/src/grid/locking/View.js",
- "requires": [
- 52,
- 87,
- 117,
- 420,
- 520,
- 566
- ],
- "uses": [
- 110,
- 421,
- 554
- ],
- "idx": 610
- },
- {
- "path": "../classic/classic/src/scroll/LockingScroller.js",
- "requires": [
- 110
- ],
- "uses": [
- 10
- ],
- "idx": 611
- },
- {
- "path": "../classic/classic/src/grid/locking/Lockable.js",
- "requires": [
- 117,
- 566,
- 578,
- 609,
- 610,
- 611
- ],
- "uses": [
- 1,
- 34,
- 110,
- 182,
- 412,
- 423,
- 441,
- 442,
- 456,
- 558
- ],
- "idx": 612
- },
- {
- "path": "../classic/classic/src/grid/plugin/BufferedRenderer.js",
- "requires": [
- 84,
- 563
- ],
- "uses": [
- 1,
- 49,
- 117
- ],
- "idx": 613
- },
- {
- "path": "../classic/classic/src/grid/plugin/Editing.js",
- "requires": [
- 4,
- 84,
- 363,
- 492,
- 566,
- 579
- ],
- "uses": [
- 21,
- 117,
- 423,
- 554
- ],
- "idx": 614
- },
- {
- "path": "../classic/classic/src/grid/plugin/CellEditing.js",
- "requires": [
- 1,
- 555,
- 614
- ],
- "uses": [
- 56,
- 415,
- 423,
- 554
- ],
- "idx": 615
- },
- {
- "path": "../classic/classic/src/grid/plugin/Clipboard.js",
- "requires": [
- 94,
- 373,
- 398
- ],
- "uses": [
- 554
- ],
- "idx": 616
- },
- {
- "path": "../classic/classic/src/grid/plugin/DragDrop.js",
- "requires": [
- 84
- ],
- "uses": [
- 573,
- 677
- ],
- "idx": 617
- },
- {
- "path": "../classic/classic/src/grid/plugin/RowEditing.js",
- "requires": [
- 570,
- 614
- ],
- "uses": [],
- "idx": 618
- },
- {
- "path": "../classic/classic/src/grid/plugin/RowExpander.js",
- "requires": [
- 84,
- 594
- ],
- "uses": [
- 98,
- 579
- ],
- "idx": 619
- },
- {
- "path": "../classic/classic/src/grid/plugin/RowWidget.js",
- "requires": [
- 3,
- 369,
- 619
- ],
- "uses": [
- 84,
- 594
- ],
- "idx": 620
- },
- {
- "path": "../classic/classic/src/grid/property/Grid.js",
- "requires": [
- 567
- ],
- "uses": [
- 21,
- 98,
- 161,
- 415,
- 423,
- 492,
- 493,
- 496,
- 526,
- 528,
- 531,
- 534,
- 554,
- 555,
- 566,
- 615,
- 622,
- 625
- ],
- "idx": 621
- },
- {
- "path": "../classic/classic/src/grid/property/HeaderContainer.js",
- "requires": [
- 94,
- 578
- ],
- "uses": [],
- "idx": 622
- },
- {
- "path": "../classic/classic/src/grid/property/Property.js",
- "requires": [
- 161
- ],
- "uses": [],
- "idx": 623
- },
- {
- "path": "../classic/classic/src/grid/property/Reader.js",
- "requires": [
- 163
- ],
- "uses": [
- 162
- ],
- "idx": 624
- },
- {
- "path": "../classic/classic/src/grid/property/Store.js",
- "requires": [
- 167,
- 179,
- 623,
- 624
- ],
- "uses": [
- 175
- ],
- "idx": 625
- },
- {
- "path": "../classic/classic/src/grid/selection/Selection.js",
- "requires": [],
- "uses": [],
- "idx": 626
- },
- {
- "path": "../classic/classic/src/grid/selection/Cells.js",
- "requires": [
- 626
- ],
- "uses": [
- 554
- ],
- "idx": 627
- },
- {
- "path": "../classic/classic/src/grid/selection/Columns.js",
- "requires": [
- 626
- ],
- "uses": [
- 554
- ],
- "idx": 628
- },
- {
- "path": "../classic/classic/src/grid/selection/Replicator.js",
- "requires": [
- 84
- ],
- "uses": [],
- "idx": 629
- },
- {
- "path": "../classic/classic/src/grid/selection/Rows.js",
- "requires": [
- 132,
- 626
- ],
- "uses": [
- 554
- ],
- "idx": 630
- },
- {
- "path": "../classic/classic/src/grid/selection/SelectionExtender.js",
- "requires": [
- 466
- ],
- "uses": [
- 49,
- 399
- ],
- "idx": 631
- },
- {
- "path": "../classic/classic/src/grid/selection/SpreadsheetModel.js",
- "requires": [
- 517,
- 586,
- 626,
- 627,
- 628,
- 630,
- 631
- ],
- "uses": [
- 399,
- 412,
- 472,
- 554,
- 556,
- 583
- ],
- "idx": 632
- },
- {
- "path": "../classic/classic/src/util/Queue.js",
- "requires": [],
- "uses": [],
- "idx": 633
- },
- {
- "path": "../classic/classic/src/layout/ContextItem.js",
- "requires": [],
- "uses": [
- 56,
- 67,
- 73,
- 409
- ],
- "idx": 634
- },
- {
- "path": "../classic/classic/src/layout/Context.js",
- "requires": [
- 67,
- 73,
- 372,
- 410,
- 633,
- 634
- ],
- "uses": [],
- "idx": 635
- },
- {
- "path": "../classic/classic/src/layout/SizePolicy.js",
- "requires": [],
- "uses": [],
- "idx": 636
- },
- {
- "path": "../classic/classic/src/layout/component/Body.js",
- "requires": [
- 423
- ],
- "uses": [],
- "idx": 637
- },
- {
- "path": "../classic/classic/src/layout/component/FieldSet.js",
- "requires": [
- 637
- ],
- "uses": [],
- "idx": 638
- },
- {
- "path": "../classic/classic/src/layout/container/Absolute.js",
- "requires": [
- 462
- ],
- "uses": [],
- "idx": 639
- },
- {
- "path": "../classic/classic/src/layout/container/Accordion.js",
- "requires": [
- 444
- ],
- "uses": [],
- "idx": 640
- },
- {
- "path": "../classic/classic/src/resizer/BorderSplitter.js",
- "requires": [
- 441
- ],
- "uses": [
- 652
- ],
- "idx": 641
- },
- {
- "path": "../classic/classic/src/layout/container/Border.js",
- "requires": [
- 73,
- 119,
- 411,
- 641
- ],
- "uses": [
- 94,
- 423
- ],
- "idx": 642
- },
- {
- "path": "../classic/classic/src/layout/container/Card.js",
- "requires": [
- 557
- ],
- "uses": [
- 49
- ],
- "idx": 643
- },
- {
- "path": "../classic/classic/src/layout/container/Center.js",
- "requires": [
- 557
- ],
- "uses": [],
- "idx": 644
- },
- {
- "path": "../classic/classic/src/layout/container/Form.js",
- "requires": [
- 412
- ],
- "uses": [],
- "idx": 645
- },
- {
- "path": "../classic/classic/src/menu/Bar.js",
- "requires": [
- 599
- ],
- "uses": [],
- "idx": 646
- },
- {
- "path": "../classic/classic/src/menu/ColorPicker.js",
- "requires": [
- 544,
- 599
- ],
- "uses": [
- 423,
- 428
- ],
- "idx": 647
- },
- {
- "path": "../classic/classic/src/menu/DatePicker.js",
- "requires": [
- 533,
- 599
- ],
- "uses": [
- 423,
- 428
- ],
- "idx": 648
- },
- {
- "path": "../classic/classic/src/panel/Pinnable.js",
- "requires": [
- 0
- ],
- "uses": [
- 423,
- 436
- ],
- "idx": 649
- },
- {
- "path": "../classic/classic/src/plugin/LazyItems.js",
- "requires": [
- 84
- ],
- "uses": [],
- "idx": 650
- },
- {
- "path": "../classic/classic/src/plugin/Responsive.js",
- "requires": [
- 84,
- 118
- ],
- "uses": [],
- "idx": 651
- },
- {
- "path": "../classic/classic/src/resizer/BorderSplitterTracker.js",
- "requires": [
- 34,
- 467
- ],
- "uses": [],
- "idx": 652
- },
- {
- "path": "../classic/classic/src/resizer/Handle.js",
- "requires": [
- 117
- ],
- "uses": [],
- "idx": 653
- },
- {
- "path": "../classic/classic/src/resizer/ResizeTracker.js",
- "requires": [
- 466
- ],
- "uses": [
- 49
- ],
- "idx": 654
- },
- {
- "path": "../classic/classic/src/resizer/Resizer.js",
- "requires": [
- 52
- ],
- "uses": [
- 49,
- 95,
- 117,
- 654
- ],
- "idx": 655
- },
- {
- "path": "../classic/classic/src/selection/CellModel.js",
- "requires": [
- 518,
- 554
- ],
- "uses": [],
- "idx": 656
- },
- {
- "path": "../classic/classic/src/selection/RowModel.js",
- "requires": [
- 518,
- 554
- ],
- "uses": [],
- "idx": 657
- },
- {
- "path": "../classic/classic/src/selection/CheckboxModel.js",
- "requires": [
- 583,
- 657
- ],
- "uses": [
- 412,
- 554,
- 556
- ],
- "idx": 658
- },
- {
- "path": "../classic/classic/src/selection/TreeModel.js",
- "requires": [
- 657
- ],
- "uses": [],
- "idx": 659
- },
- {
- "path": "../classic/classic/src/slider/Thumb.js",
- "requires": [
- 94,
- 466
- ],
- "uses": [
- 73
- ],
- "idx": 660
- },
- {
- "path": "../classic/classic/src/slider/Tip.js",
- "requires": [
- 540
- ],
- "uses": [],
- "idx": 661
- },
- {
- "path": "../classic/classic/src/slider/Multi.js",
- "requires": [
- 94,
- 95,
- 492,
- 660,
- 661
- ],
- "uses": [
- 250
- ],
- "idx": 662
- },
- {
- "path": "../classic/classic/src/slider/Single.js",
- "requires": [
- 662
- ],
- "uses": [],
- "idx": 663
- },
- {
- "path": "../classic/classic/src/slider/Widget.js",
- "requires": [
- 89,
- 662
- ],
- "uses": [
- 73,
- 94
- ],
- "idx": 664
- },
- {
- "path": "../classic/classic/src/state/CookieProvider.js",
- "requires": [
- 114
- ],
- "uses": [],
- "idx": 665
- },
- {
- "path": "../classic/classic/src/state/LocalStorageProvider.js",
- "requires": [
- 114,
- 396
- ],
- "uses": [],
- "idx": 666
- },
- {
- "path": "../classic/classic/src/tab/Tab.js",
- "requires": [
- 429
- ],
- "uses": [],
- "idx": 667
- },
- {
- "path": "../classic/classic/src/tab/Bar.js",
- "requires": [
- 35,
- 434,
- 637,
- 667
- ],
- "uses": [
- 34
- ],
- "idx": 668
- },
- {
- "path": "../classic/classic/src/tab/Panel.js",
- "requires": [
- 456,
- 643,
- 668
- ],
- "uses": [
- 423,
- 667
- ],
- "idx": 669
- },
- {
- "path": "../classic/classic/src/toolbar/Breadcrumb.js",
- "requires": [
- 247,
- 414,
- 430
- ],
- "uses": [
- 24,
- 182
- ],
- "idx": 670
- },
- {
- "path": "../classic/classic/src/toolbar/Fill.js",
- "requires": [
- 117,
- 445
- ],
- "uses": [],
- "idx": 671
- },
- {
- "path": "../classic/classic/src/toolbar/Spacer.js",
- "requires": [
- 117,
- 445
- ],
- "uses": [],
- "idx": 672
- },
- {
- "path": "../classic/classic/src/tree/Column.js",
- "requires": [
- 579
- ],
- "uses": [
- 78
- ],
- "idx": 673
- },
- {
- "path": "../classic/classic/src/tree/NavigationModel.js",
- "requires": [
- 561
- ],
- "uses": [
- 36
- ],
- "idx": 674
- },
- {
- "path": "../classic/classic/src/tree/View.js",
- "requires": [
- 566
- ],
- "uses": [
- 49
- ],
- "idx": 675
- },
- {
- "path": "../classic/classic/src/tree/Panel.js",
- "requires": [
- 247,
- 558,
- 659,
- 673,
- 674,
- 675
- ],
- "uses": [
- 182,
- 412,
- 556
- ],
- "idx": 676
- },
- {
- "path": "../classic/classic/src/view/DragZone.js",
- "requires": [
- 477
- ],
- "uses": [
- 49,
- 95
- ],
- "idx": 677
- },
- {
- "path": "../classic/classic/src/tree/ViewDragZone.js",
- "requires": [
- 677
- ],
- "uses": [
- 95
- ],
- "idx": 678
- },
- {
- "path": "../classic/classic/src/tree/ViewDropZone.js",
- "requires": [
- 572
- ],
- "uses": [],
- "idx": 679
- },
- {
- "path": "../classic/classic/src/tree/plugin/TreeViewDragDrop.js",
- "requires": [
- 84
- ],
- "uses": [
- 678,
- 679
- ],
- "idx": 680
- },
- {
- "path": "../classic/classic/src/view/MultiSelectorSearch.js",
- "requires": [
- 456
- ],
- "uses": [
- 51,
- 182,
- 453,
- 493,
- 496,
- 557,
- 567
- ],
- "idx": 681
- },
- {
- "path": "../classic/classic/src/view/MultiSelector.js",
- "requires": [
- 453,
- 557,
- 567,
- 681
- ],
- "uses": [],
- "idx": 682
- },
- {
- "path": "../classic/classic/src/window/Toast.js",
- "requires": [
- 489
- ],
- "uses": [
- 1
- ],
- "idx": 683
- }
- ],
- "classes": {
- "Ext.AbstractManager": {
- "idx": 6,
- "alias": [],
- "alternates": []
- },
- "Ext.Action": {
- "idx": 406,
- "alias": [],
- "alternates": []
- },
- "Ext.Ajax": {
- "idx": 18,
- "alias": [],
- "alternates": []
- },
- "Ext.AnimationQueue": {
- "idx": 19,
- "alias": [],
- "alternates": []
- },
- "Ext.Component": {
- "idx": 117,
- "alias": [
- "widget.box",
- "widget.component"
- ],
- "alternates": [
- "Ext.AbstractComponent"
- ]
- },
- "Ext.ComponentLoader": {
- "idx": 408,
- "alias": [],
- "alternates": []
- },
- "Ext.ComponentManager": {
- "idx": 21,
- "alias": [],
- "alternates": [
- "Ext.ComponentMgr"
- ]
- },
- "Ext.ComponentQuery": {
- "idx": 24,
- "alias": [],
- "alternates": []
- },
- "Ext.Deferred": {
- "idx": 11,
- "alias": [],
- "alternates": []
- },
- "Ext.Editor": {
- "idx": 416,
- "alias": [
- "widget.editor"
- ],
- "alternates": []
- },
- "Ext.ElementLoader": {
- "idx": 407,
- "alias": [],
- "alternates": []
- },
- "Ext.EventManager": {
- "idx": 417,
- "alias": [],
- "alternates": []
- },
- "Ext.Evented": {
- "idx": 25,
- "alias": [],
- "alternates": [
- "Ext.EventedBase"
- ]
- },
- "Ext.GlobalEvents": {
- "idx": 77,
- "alias": [],
- "alternates": [
- "Ext.globalEvents"
- ]
- },
- "Ext.Glyph": {
- "idx": 78,
- "alias": [],
- "alternates": []
- },
- "Ext.Img": {
- "idx": 419,
- "alias": [
- "widget.image",
- "widget.imagecomponent"
- ],
- "alternates": []
- },
- "Ext.LoadMask": {
- "idx": 421,
- "alias": [
- "widget.loadmask"
- ],
- "alternates": []
- },
- "Ext.Mixin": {
- "idx": 0,
- "alias": [],
- "alternates": []
- },
- "Ext.Progress": {
- "idx": 93,
- "alias": [
- "widget.progress",
- "widget.progressbarwidget"
- ],
- "alternates": [
- "Ext.ProgressBarWidget"
- ]
- },
- "Ext.ProgressBar": {
- "idx": 425,
- "alias": [
- "widget.progressbar"
- ],
- "alternates": []
- },
- "Ext.ProgressBase": {
- "idx": 92,
- "alias": [],
- "alternates": []
- },
- "Ext.Promise": {
- "idx": 10,
- "alias": [],
- "alternates": []
- },
- "Ext.Responsive": {
- "idx": 118,
- "alias": [],
- "alternates": []
- },
- "Ext.ResponsiveWidget": {
- "idx": 91,
- "alias": [],
- "alternates": []
- },
- "Ext.TaskQueue": {
- "idx": 40,
- "alias": [],
- "alternates": []
- },
- "Ext.Template": {
- "idx": 95,
- "alias": [],
- "alternates": []
- },
- "Ext.Widget": {
- "idx": 89,
- "alias": [
- "widget.widget"
- ],
- "alternates": [
- "Ext.Gadget"
- ]
- },
- "Ext.XTemplate": {
- "idx": 98,
- "alias": [],
- "alternates": []
- },
- "Ext.ZIndexManager": {
- "idx": 413,
- "alias": [],
- "alternates": [
- "Ext.WindowGroup"
- ]
- },
- "Ext.app.Application": {
- "idx": 185,
- "alias": [],
- "alternates": []
- },
- "Ext.app.BaseController": {
- "idx": 128,
- "alias": [],
- "alternates": []
- },
- "Ext.app.Controller": {
- "idx": 184,
- "alias": [],
- "alternates": []
- },
- "Ext.app.EventBus": {
- "idx": 120,
- "alias": [],
- "alternates": []
- },
- "Ext.app.EventDomain": {
- "idx": 99,
- "alias": [],
- "alternates": []
- },
- "Ext.app.Profile": {
- "idx": 186,
- "alias": [],
- "alternates": []
- },
- "Ext.app.Util": {
- "idx": 129,
- "alias": [],
- "alternates": []
- },
- "Ext.app.ViewController": {
- "idx": 188,
- "alias": [
- "controller.controller"
- ],
- "alternates": []
- },
- "Ext.app.ViewModel": {
- "idx": 222,
- "alias": [
- "viewmodel.default"
- ],
- "alternates": []
- },
- "Ext.app.bind.AbstractStub": {
- "idx": 203,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.BaseBinding": {
- "idx": 201,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Binding": {
- "idx": 202,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Formula": {
- "idx": 208,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.LinkStub": {
- "idx": 205,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Multi": {
- "idx": 207,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Parser": {
- "idx": 218,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.RootStub": {
- "idx": 206,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Stub": {
- "idx": 204,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.Template": {
- "idx": 219,
- "alias": [],
- "alternates": []
- },
- "Ext.app.bind.TemplateBinding": {
- "idx": 220,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.Component": {
- "idx": 100,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.Controller": {
- "idx": 223,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.Direct": {
- "idx": 226,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.Global": {
- "idx": 121,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.Store": {
- "idx": 183,
- "alias": [],
- "alternates": []
- },
- "Ext.app.domain.View": {
- "idx": 187,
- "alias": [],
- "alternates": []
- },
- "Ext.button.Button": {
- "idx": 429,
- "alias": [
- "widget.button"
- ],
- "alternates": [
- "Ext.Button"
- ]
- },
- "Ext.button.Cycle": {
- "idx": 431,
- "alias": [
- "widget.cycle"
- ],
- "alternates": [
- "Ext.CycleButton"
- ]
- },
- "Ext.button.Manager": {
- "idx": 427,
- "alias": [],
- "alternates": [
- "Ext.ButtonToggleManager"
- ]
- },
- "Ext.button.Segmented": {
- "idx": 433,
- "alias": [
- "widget.segmentedbutton"
- ],
- "alternates": []
- },
- "Ext.button.Split": {
- "idx": 430,
- "alias": [
- "widget.splitbutton"
- ],
- "alternates": [
- "Ext.SplitButton"
- ]
- },
- "Ext.container.ButtonGroup": {
- "idx": 458,
- "alias": [
- "widget.buttongroup"
- ],
- "alternates": [
- "Ext.ButtonGroup"
- ]
- },
- "Ext.container.Container": {
- "idx": 414,
- "alias": [
- "widget.container"
- ],
- "alternates": [
- "Ext.Container",
- "Ext.AbstractContainer"
- ]
- },
- "Ext.container.DockingContainer": {
- "idx": 455,
- "alias": [],
- "alternates": []
- },
- "Ext.container.Monitor": {
- "idx": 459,
- "alias": [],
- "alternates": []
- },
- "Ext.container.Viewport": {
- "idx": 461,
- "alias": [
- "widget.viewport"
- ],
- "alternates": [
- "Ext.Viewport"
- ]
- },
- "Ext.dashboard.Column": {
- "idx": 464,
- "alias": [
- "widget.dashboard-column"
- ],
- "alternates": []
- },
- "Ext.dashboard.Dashboard": {
- "idx": 476,
- "alias": [
- "widget.dashboard"
- ],
- "alternates": []
- },
- "Ext.dashboard.DropZone": {
- "idx": 474,
- "alias": [],
- "alternates": []
- },
- "Ext.dashboard.Panel": {
- "idx": 463,
- "alias": [
- "widget.dashboard-panel"
- ],
- "alternates": []
- },
- "Ext.dashboard.Part": {
- "idx": 475,
- "alias": [
- "part.part"
- ],
- "alternates": []
- },
- "Ext.data.AbstractStore": {
- "idx": 143,
- "alias": [],
- "alternates": []
- },
- "Ext.data.ArrayStore": {
- "idx": 181,
- "alias": [
- "store.array"
- ],
- "alternates": [
- "Ext.data.SimpleStore"
- ]
- },
- "Ext.data.Batch": {
- "idx": 191,
- "alias": [],
- "alternates": []
- },
- "Ext.data.BufferedStore": {
- "idx": 228,
- "alias": [
- "store.buffered"
- ],
- "alternates": []
- },
- "Ext.data.ChainedStore": {
- "idx": 221,
- "alias": [
- "store.chained"
- ],
- "alternates": []
- },
- "Ext.data.ClientStore": {
- "idx": 229,
- "alias": [
- "store.clientstorage"
- ],
- "alternates": []
- },
- "Ext.data.Connection": {
- "idx": 17,
- "alias": [],
- "alternates": []
- },
- "Ext.data.DirectStore": {
- "idx": 231,
- "alias": [
- "store.direct"
- ],
- "alternates": []
- },
- "Ext.data.Error": {
- "idx": 144,
- "alias": [],
- "alternates": []
- },
- "Ext.data.ErrorCollection": {
- "idx": 145,
- "alias": [],
- "alternates": [
- "Ext.data.Errors"
- ]
- },
- "Ext.data.Group": {
- "idx": 170,
- "alias": [],
- "alternates": []
- },
- "Ext.data.JsonP": {
- "idx": 232,
- "alias": [],
- "alternates": []
- },
- "Ext.data.JsonPStore": {
- "idx": 234,
- "alias": [
- "store.jsonp"
- ],
- "alternates": []
- },
- "Ext.data.JsonStore": {
- "idx": 235,
- "alias": [
- "store.json"
- ],
- "alternates": []
- },
- "Ext.data.LocalStore": {
- "idx": 171,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Model": {
- "idx": 161,
- "alias": [],
- "alternates": [
- "Ext.data.Record"
- ]
- },
- "Ext.data.ModelManager": {
- "idx": 236,
- "alias": [],
- "alternates": [
- "Ext.ModelMgr"
- ]
- },
- "Ext.data.NodeInterface": {
- "idx": 237,
- "alias": [],
- "alternates": []
- },
- "Ext.data.NodeStore": {
- "idx": 240,
- "alias": [
- "store.node"
- ],
- "alternates": []
- },
- "Ext.data.PageMap": {
- "idx": 227,
- "alias": [],
- "alternates": []
- },
- "Ext.data.ProxyStore": {
- "idx": 168,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Query": {
- "idx": 245,
- "alias": [
- "query.default"
- ],
- "alternates": []
- },
- "Ext.data.Range": {
- "idx": 133,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Request": {
- "idx": 246,
- "alias": [],
- "alternates": []
- },
- "Ext.data.ResultSet": {
- "idx": 162,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Session": {
- "idx": 199,
- "alias": [],
- "alternates": []
- },
- "Ext.data.SortTypes": {
- "idx": 151,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Store": {
- "idx": 179,
- "alias": [
- "store.store"
- ],
- "alternates": []
- },
- "Ext.data.StoreManager": {
- "idx": 182,
- "alias": [],
- "alternates": [
- "Ext.StoreMgr",
- "Ext.data.StoreMgr",
- "Ext.StoreManager"
- ]
- },
- "Ext.data.TreeModel": {
- "idx": 239,
- "alias": [],
- "alternates": []
- },
- "Ext.data.TreeStore": {
- "idx": 247,
- "alias": [
- "store.tree"
- ],
- "alternates": []
- },
- "Ext.data.Types": {
- "idx": 248,
- "alias": [],
- "alternates": []
- },
- "Ext.data.Validation": {
- "idx": 249,
- "alias": [],
- "alternates": []
- },
- "Ext.data.XmlStore": {
- "idx": 254,
- "alias": [
- "store.xml"
- ],
- "alternates": []
- },
- "Ext.data.field.Boolean": {
- "idx": 154,
- "alias": [
- "data.field.bool",
- "data.field.boolean"
- ],
- "alternates": []
- },
- "Ext.data.field.Date": {
- "idx": 155,
- "alias": [
- "data.field.date"
- ],
- "alternates": []
- },
- "Ext.data.field.Field": {
- "idx": 153,
- "alias": [
- "data.field.auto"
- ],
- "alternates": [
- "Ext.data.Field"
- ]
- },
- "Ext.data.field.Integer": {
- "idx": 156,
- "alias": [
- "data.field.int",
- "data.field.integer"
- ],
- "alternates": []
- },
- "Ext.data.field.Number": {
- "idx": 157,
- "alias": [
- "data.field.float",
- "data.field.number"
- ],
- "alternates": []
- },
- "Ext.data.field.String": {
- "idx": 158,
- "alias": [
- "data.field.string"
- ],
- "alternates": []
- },
- "Ext.data.flash.BinaryXhr": {
- "idx": 14,
- "alias": [],
- "alternates": []
- },
- "Ext.data.identifier.Generator": {
- "idx": 159,
- "alias": [
- "data.identifier.default"
- ],
- "alternates": []
- },
- "Ext.data.identifier.Negative": {
- "idx": 255,
- "alias": [
- "data.identifier.negative"
- ],
- "alternates": []
- },
- "Ext.data.identifier.Sequential": {
- "idx": 160,
- "alias": [
- "data.identifier.sequential"
- ],
- "alternates": []
- },
- "Ext.data.identifier.Uuid": {
- "idx": 256,
- "alias": [
- "data.identifier.uuid"
- ],
- "alternates": []
- },
- "Ext.data.matrix.Matrix": {
- "idx": 194,
- "alias": [],
- "alternates": []
- },
- "Ext.data.matrix.Side": {
- "idx": 193,
- "alias": [],
- "alternates": []
- },
- "Ext.data.matrix.Slice": {
- "idx": 192,
- "alias": [],
- "alternates": []
- },
- "Ext.data.operation.Create": {
- "idx": 147,
- "alias": [
- "data.operation.create"
- ],
- "alternates": []
- },
- "Ext.data.operation.Destroy": {
- "idx": 148,
- "alias": [
- "data.operation.destroy"
- ],
- "alternates": []
- },
- "Ext.data.operation.Operation": {
- "idx": 146,
- "alias": [],
- "alternates": [
- "Ext.data.Operation"
- ]
- },
- "Ext.data.operation.Read": {
- "idx": 149,
- "alias": [
- "data.operation.read"
- ],
- "alternates": []
- },
- "Ext.data.operation.Update": {
- "idx": 150,
- "alias": [
- "data.operation.update"
- ],
- "alternates": []
- },
- "Ext.data.proxy.Ajax": {
- "idx": 173,
- "alias": [
- "proxy.ajax"
- ],
- "alternates": [
- "Ext.data.HttpProxy",
- "Ext.data.AjaxProxy"
- ]
- },
- "Ext.data.proxy.Client": {
- "idx": 166,
- "alias": [],
- "alternates": [
- "Ext.data.ClientProxy"
- ]
- },
- "Ext.data.proxy.Direct": {
- "idx": 230,
- "alias": [
- "proxy.direct"
- ],
- "alternates": [
- "Ext.data.DirectProxy"
- ]
- },
- "Ext.data.proxy.JsonP": {
- "idx": 233,
- "alias": [
- "proxy.jsonp",
- "proxy.scripttag"
- ],
- "alternates": [
- "Ext.data.ScriptTagProxy"
- ]
- },
- "Ext.data.proxy.LocalStorage": {
- "idx": 258,
- "alias": [
- "proxy.localstorage"
- ],
- "alternates": [
- "Ext.data.LocalStorageProxy"
- ]
- },
- "Ext.data.proxy.Memory": {
- "idx": 167,
- "alias": [
- "proxy.memory"
- ],
- "alternates": [
- "Ext.data.MemoryProxy"
- ]
- },
- "Ext.data.proxy.Proxy": {
- "idx": 165,
- "alias": [
- "proxy.proxy"
- ],
- "alternates": [
- "Ext.data.DataProxy",
- "Ext.data.Proxy"
- ]
- },
- "Ext.data.proxy.Rest": {
- "idx": 259,
- "alias": [
- "proxy.rest"
- ],
- "alternates": [
- "Ext.data.RestProxy"
- ]
- },
- "Ext.data.proxy.Server": {
- "idx": 172,
- "alias": [
- "proxy.server"
- ],
- "alternates": [
- "Ext.data.ServerProxy"
- ]
- },
- "Ext.data.proxy.SessionStorage": {
- "idx": 260,
- "alias": [
- "proxy.sessionstorage"
- ],
- "alternates": [
- "Ext.data.SessionStorageProxy"
- ]
- },
- "Ext.data.proxy.WebStorage": {
- "idx": 257,
- "alias": [],
- "alternates": [
- "Ext.data.WebStorageProxy"
- ]
- },
- "Ext.data.query.Compiler": {
- "idx": 241,
- "alias": [],
- "alternates": []
- },
- "Ext.data.query.Converter": {
- "idx": 242,
- "alias": [],
- "alternates": []
- },
- "Ext.data.query.Parser": {
- "idx": 244,
- "alias": [],
- "alternates": []
- },
- "Ext.data.query.Stringifier": {
- "idx": 243,
- "alias": [],
- "alternates": []
- },
- "Ext.data.reader.Array": {
- "idx": 180,
- "alias": [
- "reader.array"
- ],
- "alternates": [
- "Ext.data.ArrayReader"
- ]
- },
- "Ext.data.reader.Json": {
- "idx": 174,
- "alias": [
- "reader.json"
- ],
- "alternates": [
- "Ext.data.JsonReader"
- ]
- },
- "Ext.data.reader.Reader": {
- "idx": 163,
- "alias": [
- "reader.base"
- ],
- "alternates": [
- "Ext.data.Reader",
- "Ext.data.DataReader"
- ]
- },
- "Ext.data.reader.Xml": {
- "idx": 252,
- "alias": [
- "reader.xml"
- ],
- "alternates": [
- "Ext.data.XmlReader"
- ]
- },
- "Ext.data.request.Ajax": {
- "idx": 15,
- "alias": [
- "request.ajax"
- ],
- "alternates": []
- },
- "Ext.data.request.Base": {
- "idx": 13,
- "alias": [],
- "alternates": []
- },
- "Ext.data.request.Form": {
- "idx": 16,
- "alias": [
- "request.form"
- ],
- "alternates": []
- },
- "Ext.data.schema.Association": {
- "idx": 136,
- "alias": [],
- "alternates": []
- },
- "Ext.data.schema.ManyToMany": {
- "idx": 139,
- "alias": [],
- "alternates": []
- },
- "Ext.data.schema.ManyToOne": {
- "idx": 138,
- "alias": [],
- "alternates": []
- },
- "Ext.data.schema.Namer": {
- "idx": 141,
- "alias": [
- "namer.default"
- ],
- "alternates": []
- },
- "Ext.data.schema.OneToOne": {
- "idx": 137,
- "alias": [],
- "alternates": []
- },
- "Ext.data.schema.Role": {
- "idx": 135,
- "alias": [],
- "alternates": []
- },
- "Ext.data.schema.Schema": {
- "idx": 142,
- "alias": [
- "schema.default"
- ],
- "alternates": []
- },
- "Ext.data.session.BatchVisitor": {
- "idx": 197,
- "alias": [],
- "alternates": []
- },
- "Ext.data.session.ChangesVisitor": {
- "idx": 195,
- "alias": [],
- "alternates": []
- },
- "Ext.data.session.ChildChangesVisitor": {
- "idx": 196,
- "alias": [],
- "alternates": []
- },
- "Ext.data.summary.Average": {
- "idx": 267,
- "alias": [
- "data.summary.average"
- ],
- "alternates": []
- },
- "Ext.data.summary.Base": {
- "idx": 265,
- "alias": [
- "data.summary.base"
- ],
- "alternates": []
- },
- "Ext.data.summary.Count": {
- "idx": 268,
- "alias": [
- "data.summary.count"
- ],
- "alternates": []
- },
- "Ext.data.summary.Max": {
- "idx": 269,
- "alias": [
- "data.summary.max"
- ],
- "alternates": []
- },
- "Ext.data.summary.Min": {
- "idx": 270,
- "alias": [
- "data.summary.min"
- ],
- "alternates": []
- },
- "Ext.data.summary.None": {
- "idx": 271,
- "alias": [
- "data.summary.none"
- ],
- "alternates": []
- },
- "Ext.data.summary.Sum": {
- "idx": 266,
- "alias": [
- "data.summary.sum"
- ],
- "alternates": []
- },
- "Ext.data.validator.AbstractDate": {
- "idx": 272,
- "alias": [],
- "alternates": []
- },
- "Ext.data.validator.Bound": {
- "idx": 273,
- "alias": [
- "data.validator.bound"
- ],
- "alternates": []
- },
- "Ext.data.validator.CIDRv4": {
- "idx": 275,
- "alias": [
- "data.validator.cidrv4"
- ],
- "alternates": []
- },
- "Ext.data.validator.CIDRv6": {
- "idx": 276,
- "alias": [
- "data.validator.cidrv6"
- ],
- "alternates": []
- },
- "Ext.data.validator.Currency": {
- "idx": 278,
- "alias": [
- "data.validator.currency"
- ],
- "alternates": []
- },
- "Ext.data.validator.CurrencyUS": {
- "idx": 279,
- "alias": [
- "data.validator.currency-us"
- ],
- "alternates": []
- },
- "Ext.data.validator.Date": {
- "idx": 280,
- "alias": [
- "data.validator.date"
- ],
- "alternates": []
- },
- "Ext.data.validator.DateTime": {
- "idx": 281,
- "alias": [
- "data.validator.datetime"
- ],
- "alternates": []
- },
- "Ext.data.validator.Email": {
- "idx": 282,
- "alias": [
- "data.validator.email"
- ],
- "alternates": []
- },
- "Ext.data.validator.Exclusion": {
- "idx": 284,
- "alias": [
- "data.validator.exclusion"
- ],
- "alternates": []
- },
- "Ext.data.validator.Format": {
- "idx": 274,
- "alias": [
- "data.validator.format"
- ],
- "alternates": []
- },
- "Ext.data.validator.IPAddress": {
- "idx": 285,
- "alias": [
- "data.validator.ipaddress"
- ],
- "alternates": []
- },
- "Ext.data.validator.Inclusion": {
- "idx": 286,
- "alias": [
- "data.validator.inclusion"
- ],
- "alternates": []
- },
- "Ext.data.validator.Length": {
- "idx": 287,
- "alias": [
- "data.validator.length"
- ],
- "alternates": []
- },
- "Ext.data.validator.List": {
- "idx": 283,
- "alias": [
- "data.validator.list"
- ],
- "alternates": []
- },
- "Ext.data.validator.NotNull": {
- "idx": 289,
- "alias": [
- "data.validator.notnull"
- ],
- "alternates": []
- },
- "Ext.data.validator.Number": {
- "idx": 277,
- "alias": [
- "data.validator.number"
- ],
- "alternates": []
- },
- "Ext.data.validator.Phone": {
- "idx": 290,
- "alias": [
- "data.validator.phone"
- ],
- "alternates": []
- },
- "Ext.data.validator.Presence": {
- "idx": 288,
- "alias": [
- "data.validator.presence"
- ],
- "alternates": []
- },
- "Ext.data.validator.Range": {
- "idx": 291,
- "alias": [
- "data.validator.range"
- ],
- "alternates": []
- },
- "Ext.data.validator.Time": {
- "idx": 292,
- "alias": [
- "data.validator.time"
- ],
- "alternates": []
- },
- "Ext.data.validator.Url": {
- "idx": 293,
- "alias": [
- "data.validator.url"
- ],
- "alternates": []
- },
- "Ext.data.validator.Validator": {
- "idx": 152,
- "alias": [
- "data.validator.base"
- ],
- "alternates": []
- },
- "Ext.data.virtual.Group": {
- "idx": 294,
- "alias": [],
- "alternates": []
- },
- "Ext.data.virtual.Page": {
- "idx": 295,
- "alias": [],
- "alternates": []
- },
- "Ext.data.virtual.PageMap": {
- "idx": 296,
- "alias": [],
- "alternates": []
- },
- "Ext.data.virtual.Range": {
- "idx": 297,
- "alias": [],
- "alternates": []
- },
- "Ext.data.virtual.Store": {
- "idx": 298,
- "alias": [
- "store.virtual"
- ],
- "alternates": []
- },
- "Ext.data.writer.Json": {
- "idx": 175,
- "alias": [
- "writer.json"
- ],
- "alternates": [
- "Ext.data.JsonWriter"
- ]
- },
- "Ext.data.writer.Writer": {
- "idx": 164,
- "alias": [
- "writer.base"
- ],
- "alternates": [
- "Ext.data.DataWriter",
- "Ext.data.Writer"
- ]
- },
- "Ext.data.writer.Xml": {
- "idx": 253,
- "alias": [
- "writer.xml"
- ],
- "alternates": [
- "Ext.data.XmlWriter"
- ]
- },
- "Ext.dd.DD": {
- "idx": 447,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DDProxy": {
- "idx": 448,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DDTarget": {
- "idx": 471,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DragDrop": {
- "idx": 446,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DragDropManager": {
- "idx": 440,
- "alias": [],
- "alternates": [
- "Ext.dd.DragDropMgr",
- "Ext.dd.DDM"
- ]
- },
- "Ext.dd.DragSource": {
- "idx": 450,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DragTracker": {
- "idx": 466,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DragZone": {
- "idx": 477,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DropTarget": {
- "idx": 473,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.DropZone": {
- "idx": 479,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.Registry": {
- "idx": 478,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.ScrollManager": {
- "idx": 472,
- "alias": [],
- "alternates": []
- },
- "Ext.dd.StatusProxy": {
- "idx": 449,
- "alias": [],
- "alternates": []
- },
- "Ext.direct.Event": {
- "idx": 299,
- "alias": [
- "direct.event"
- ],
- "alternates": []
- },
- "Ext.direct.ExceptionEvent": {
- "idx": 301,
- "alias": [
- "direct.exception"
- ],
- "alternates": []
- },
- "Ext.direct.JsonProvider": {
- "idx": 302,
- "alias": [
- "direct.jsonprovider"
- ],
- "alternates": []
- },
- "Ext.direct.Manager": {
- "idx": 224,
- "alias": [],
- "alternates": []
- },
- "Ext.direct.PollingProvider": {
- "idx": 303,
- "alias": [
- "direct.pollingprovider"
- ],
- "alternates": []
- },
- "Ext.direct.Provider": {
- "idx": 225,
- "alias": [
- "direct.provider"
- ],
- "alternates": []
- },
- "Ext.direct.RemotingEvent": {
- "idx": 300,
- "alias": [
- "direct.rpc"
- ],
- "alternates": []
- },
- "Ext.direct.RemotingMethod": {
- "idx": 304,
- "alias": [],
- "alternates": []
- },
- "Ext.direct.RemotingProvider": {
- "idx": 306,
- "alias": [
- "direct.remotingprovider"
- ],
- "alternates": []
- },
- "Ext.direct.Transaction": {
- "idx": 305,
- "alias": [
- "direct.transaction"
- ],
- "alternates": []
- },
- "Ext.dom.ButtonElement": {
- "idx": 426,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.CompositeElement": {
- "idx": 102,
- "alias": [],
- "alternates": [
- "Ext.CompositeElement"
- ]
- },
- "Ext.dom.CompositeElementLite": {
- "idx": 76,
- "alias": [],
- "alternates": [
- "Ext.CompositeElementLite"
- ]
- },
- "Ext.dom.Element": {
- "idx": 49,
- "alias": [],
- "alternates": [
- "Ext.Element"
- ]
- },
- "Ext.dom.ElementEvent": {
- "idx": 31,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.Fly": {
- "idx": 75,
- "alias": [],
- "alternates": [
- "Ext.dom.Element.Fly"
- ]
- },
- "Ext.dom.GarbageCollector": {
- "idx": 307,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.Helper": {
- "idx": 250,
- "alias": [],
- "alternates": [
- "Ext.DomHelper",
- "Ext.core.DomHelper"
- ]
- },
- "Ext.dom.Layer": {
- "idx": 480,
- "alias": [],
- "alternates": [
- "Ext.Layer"
- ]
- },
- "Ext.dom.Query": {
- "idx": 251,
- "alias": [],
- "alternates": [
- "Ext.core.DomQuery",
- "Ext.DomQuery"
- ]
- },
- "Ext.dom.Shadow": {
- "idx": 29,
- "alias": [],
- "alternates": [
- "Ext.Shadow"
- ]
- },
- "Ext.dom.Shim": {
- "idx": 30,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.TouchAction": {
- "idx": 308,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.Underlay": {
- "idx": 28,
- "alias": [],
- "alternates": []
- },
- "Ext.dom.UnderlayPool": {
- "idx": 27,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.Constraint": {
- "idx": 309,
- "alias": [
- "drag.constraint.base"
- ],
- "alternates": []
- },
- "Ext.drag.Info": {
- "idx": 310,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.Item": {
- "idx": 311,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.Manager": {
- "idx": 312,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.Source": {
- "idx": 313,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.Target": {
- "idx": 314,
- "alias": [],
- "alternates": []
- },
- "Ext.drag.proxy.None": {
- "idx": 315,
- "alias": [
- "drag.proxy.none"
- ],
- "alternates": []
- },
- "Ext.drag.proxy.Original": {
- "idx": 316,
- "alias": [
- "drag.proxy.original"
- ],
- "alternates": []
- },
- "Ext.drag.proxy.Placeholder": {
- "idx": 317,
- "alias": [
- "drag.proxy.placeholder"
- ],
- "alternates": []
- },
- "Ext.event.Event": {
- "idx": 36,
- "alias": [],
- "alternates": [
- "Ext.EventObjectImpl"
- ]
- },
- "Ext.event.gesture.DoubleTap": {
- "idx": 320,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Drag": {
- "idx": 321,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.EdgeSwipe": {
- "idx": 323,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.LongPress": {
- "idx": 324,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.MultiTouch": {
- "idx": 325,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Pinch": {
- "idx": 326,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Recognizer": {
- "idx": 318,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Rotate": {
- "idx": 327,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.SingleTouch": {
- "idx": 319,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Swipe": {
- "idx": 322,
- "alias": [],
- "alternates": []
- },
- "Ext.event.gesture.Tap": {
- "idx": 328,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.Dom": {
- "idx": 37,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.ElementPaint": {
- "idx": 48,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.ElementSize": {
- "idx": 44,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.Focus": {
- "idx": 329,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.Gesture": {
- "idx": 38,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.MouseEnterLeave": {
- "idx": 482,
- "alias": [],
- "alternates": []
- },
- "Ext.event.publisher.Publisher": {
- "idx": 32,
- "alias": [],
- "alternates": []
- },
- "Ext.field.InputMask": {
- "idx": 330,
- "alias": [],
- "alternates": []
- },
- "Ext.flash.Component": {
- "idx": 483,
- "alias": [
- "widget.flash"
- ],
- "alternates": [
- "Ext.FlashComponent"
- ]
- },
- "Ext.form.Basic": {
- "idx": 499,
- "alias": [],
- "alternates": [
- "Ext.form.BasicForm"
- ]
- },
- "Ext.form.CheckboxGroup": {
- "idx": 506,
- "alias": [
- "widget.checkboxgroup"
- ],
- "alternates": []
- },
- "Ext.form.CheckboxManager": {
- "idx": 504,
- "alias": [],
- "alternates": []
- },
- "Ext.form.FieldAncestor": {
- "idx": 501,
- "alias": [],
- "alternates": []
- },
- "Ext.form.FieldContainer": {
- "idx": 502,
- "alias": [
- "widget.fieldcontainer"
- ],
- "alternates": []
- },
- "Ext.form.FieldSet": {
- "idx": 507,
- "alias": [
- "widget.fieldset"
- ],
- "alternates": []
- },
- "Ext.form.Label": {
- "idx": 508,
- "alias": [
- "widget.label"
- ],
- "alternates": []
- },
- "Ext.form.Labelable": {
- "idx": 490,
- "alias": [],
- "alternates": []
- },
- "Ext.form.Panel": {
- "idx": 509,
- "alias": [
- "widget.form"
- ],
- "alternates": [
- "Ext.FormPanel",
- "Ext.form.FormPanel"
- ]
- },
- "Ext.form.RadioGroup": {
- "idx": 512,
- "alias": [
- "widget.radiogroup"
- ],
- "alternates": []
- },
- "Ext.form.RadioManager": {
- "idx": 510,
- "alias": [],
- "alternates": []
- },
- "Ext.form.action.Action": {
- "idx": 484,
- "alias": [],
- "alternates": [
- "Ext.form.Action"
- ]
- },
- "Ext.form.action.DirectAction": {
- "idx": 513,
- "alias": [],
- "alternates": []
- },
- "Ext.form.action.DirectLoad": {
- "idx": 514,
- "alias": [
- "formaction.directload"
- ],
- "alternates": [
- "Ext.form.Action.DirectLoad"
- ]
- },
- "Ext.form.action.DirectSubmit": {
- "idx": 515,
- "alias": [
- "formaction.directsubmit"
- ],
- "alternates": [
- "Ext.form.Action.DirectSubmit"
- ]
- },
- "Ext.form.action.Load": {
- "idx": 485,
- "alias": [
- "formaction.load"
- ],
- "alternates": [
- "Ext.form.Action.Load"
- ]
- },
- "Ext.form.action.StandardSubmit": {
- "idx": 487,
- "alias": [
- "formaction.standardsubmit"
- ],
- "alternates": []
- },
- "Ext.form.action.Submit": {
- "idx": 486,
- "alias": [
- "formaction.submit"
- ],
- "alternates": [
- "Ext.form.Action.Submit"
- ]
- },
- "Ext.form.field.Base": {
- "idx": 492,
- "alias": [
- "widget.field"
- ],
- "alternates": [
- "Ext.form.Field",
- "Ext.form.BaseField"
- ]
- },
- "Ext.form.field.Checkbox": {
- "idx": 505,
- "alias": [
- "widget.checkbox",
- "widget.checkboxfield"
- ],
- "alternates": [
- "Ext.form.Checkbox"
- ]
- },
- "Ext.form.field.ComboBox": {
- "idx": 531,
- "alias": [
- "widget.combo",
- "widget.combobox"
- ],
- "alternates": [
- "Ext.form.ComboBox"
- ]
- },
- "Ext.form.field.Date": {
- "idx": 534,
- "alias": [
- "widget.datefield"
- ],
- "alternates": [
- "Ext.form.DateField",
- "Ext.form.Date"
- ]
- },
- "Ext.form.field.Display": {
- "idx": 535,
- "alias": [
- "widget.displayfield"
- ],
- "alternates": [
- "Ext.form.DisplayField",
- "Ext.form.Display"
- ]
- },
- "Ext.form.field.Field": {
- "idx": 491,
- "alias": [],
- "alternates": []
- },
- "Ext.form.field.File": {
- "idx": 538,
- "alias": [
- "widget.filefield",
- "widget.fileuploadfield"
- ],
- "alternates": [
- "Ext.form.FileUploadField",
- "Ext.ux.form.FileUploadField",
- "Ext.form.File"
- ]
- },
- "Ext.form.field.FileButton": {
- "idx": 536,
- "alias": [
- "widget.filebutton"
- ],
- "alternates": []
- },
- "Ext.form.field.Hidden": {
- "idx": 539,
- "alias": [
- "widget.hidden",
- "widget.hiddenfield"
- ],
- "alternates": [
- "Ext.form.Hidden"
- ]
- },
- "Ext.form.field.HtmlEditor": {
- "idx": 548,
- "alias": [
- "widget.htmleditor"
- ],
- "alternates": [
- "Ext.form.HtmlEditor"
- ]
- },
- "Ext.form.field.Number": {
- "idx": 528,
- "alias": [
- "widget.numberfield"
- ],
- "alternates": [
- "Ext.form.NumberField",
- "Ext.form.Number"
- ]
- },
- "Ext.form.field.Picker": {
- "idx": 516,
- "alias": [
- "widget.pickerfield"
- ],
- "alternates": [
- "Ext.form.Picker"
- ]
- },
- "Ext.form.field.Radio": {
- "idx": 511,
- "alias": [
- "widget.radio",
- "widget.radiofield"
- ],
- "alternates": [
- "Ext.form.Radio"
- ]
- },
- "Ext.form.field.Spinner": {
- "idx": 527,
- "alias": [
- "widget.spinnerfield"
- ],
- "alternates": [
- "Ext.form.Spinner"
- ]
- },
- "Ext.form.field.Tag": {
- "idx": 550,
- "alias": [
- "widget.tagfield"
- ],
- "alternates": []
- },
- "Ext.form.field.Text": {
- "idx": 496,
- "alias": [
- "widget.textfield"
- ],
- "alternates": [
- "Ext.form.TextField",
- "Ext.form.Text"
- ]
- },
- "Ext.form.field.TextArea": {
- "idx": 497,
- "alias": [
- "widget.textarea",
- "widget.textareafield"
- ],
- "alternates": [
- "Ext.form.TextArea"
- ]
- },
- "Ext.form.field.Time": {
- "idx": 552,
- "alias": [
- "widget.timefield"
- ],
- "alternates": [
- "Ext.form.TimeField",
- "Ext.form.Time"
- ]
- },
- "Ext.form.field.Trigger": {
- "idx": 553,
- "alias": [
- "widget.trigger",
- "widget.triggerfield"
- ],
- "alternates": [
- "Ext.form.TriggerField",
- "Ext.form.TwinTriggerField",
- "Ext.form.Trigger"
- ]
- },
- "Ext.form.field.VTypes": {
- "idx": 494,
- "alias": [],
- "alternates": [
- "Ext.form.VTypes"
- ]
- },
- "Ext.form.trigger.Component": {
- "idx": 537,
- "alias": [
- "trigger.component"
- ],
- "alternates": []
- },
- "Ext.form.trigger.Spinner": {
- "idx": 526,
- "alias": [
- "trigger.spinner"
- ],
- "alternates": []
- },
- "Ext.form.trigger.Trigger": {
- "idx": 495,
- "alias": [
- "trigger.trigger"
- ],
- "alternates": []
- },
- "Ext.fx.Anim": {
- "idx": 73,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Animation": {
- "idx": 340,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Animator": {
- "idx": 68,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.CubicBezier": {
- "idx": 69,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.DrawPath": {
- "idx": 71,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Easing": {
- "idx": 70,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Manager": {
- "idx": 67,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.PropertyHandler": {
- "idx": 72,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Queue": {
- "idx": 66,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.Runner": {
- "idx": 343,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.State": {
- "idx": 331,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.animation.Abstract": {
- "idx": 332,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.animation.Cube": {
- "idx": 344,
- "alias": [
- "animation.cube"
- ],
- "alternates": []
- },
- "Ext.fx.animation.Fade": {
- "idx": 335,
- "alias": [
- "animation.fade",
- "animation.fadeIn"
- ],
- "alternates": [
- "Ext.fx.animation.FadeIn"
- ]
- },
- "Ext.fx.animation.FadeOut": {
- "idx": 336,
- "alias": [
- "animation.fadeOut"
- ],
- "alternates": []
- },
- "Ext.fx.animation.Flip": {
- "idx": 337,
- "alias": [
- "animation.flip"
- ],
- "alternates": []
- },
- "Ext.fx.animation.Pop": {
- "idx": 338,
- "alias": [
- "animation.pop",
- "animation.popIn"
- ],
- "alternates": [
- "Ext.fx.animation.PopIn"
- ]
- },
- "Ext.fx.animation.PopOut": {
- "idx": 339,
- "alias": [
- "animation.popOut"
- ],
- "alternates": []
- },
- "Ext.fx.animation.Slide": {
- "idx": 333,
- "alias": [
- "animation.slide",
- "animation.slideIn"
- ],
- "alternates": [
- "Ext.fx.animation.SlideIn"
- ]
- },
- "Ext.fx.animation.SlideOut": {
- "idx": 334,
- "alias": [
- "animation.slideOut"
- ],
- "alternates": []
- },
- "Ext.fx.animation.Wipe": {
- "idx": 345,
- "alias": [],
- "alternates": [
- "Ext.fx.animation.WipeIn"
- ]
- },
- "Ext.fx.animation.WipeOut": {
- "idx": 346,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.easing.Abstract": {
- "idx": 105,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.easing.Bounce": {
- "idx": 347,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.easing.BoundMomentum": {
- "idx": 349,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.easing.EaseIn": {
- "idx": 350,
- "alias": [
- "easing.ease-in"
- ],
- "alternates": []
- },
- "Ext.fx.easing.EaseOut": {
- "idx": 351,
- "alias": [
- "easing.ease-out"
- ],
- "alternates": []
- },
- "Ext.fx.easing.Easing": {
- "idx": 352,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.easing.Linear": {
- "idx": 106,
- "alias": [
- "easing.linear"
- ],
- "alternates": []
- },
- "Ext.fx.easing.Momentum": {
- "idx": 348,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.runner.Css": {
- "idx": 341,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.runner.CssAnimation": {
- "idx": 353,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.runner.CssTransition": {
- "idx": 342,
- "alias": [],
- "alternates": [
- "Ext.Animator"
- ]
- },
- "Ext.fx.target.Component": {
- "idx": 65,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.CompositeElement": {
- "idx": 61,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.CompositeElementCSS": {
- "idx": 62,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.CompositeSprite": {
- "idx": 64,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.Element": {
- "idx": 59,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.ElementCSS": {
- "idx": 60,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.Sprite": {
- "idx": 63,
- "alias": [],
- "alternates": []
- },
- "Ext.fx.target.Target": {
- "idx": 58,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.CellContext": {
- "idx": 554,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.CellEditor": {
- "idx": 555,
- "alias": [
- "widget.celleditor"
- ],
- "alternates": []
- },
- "Ext.grid.ColumnComponentLayout": {
- "idx": 556,
- "alias": [
- "layout.columncomponent"
- ],
- "alternates": []
- },
- "Ext.grid.ColumnLayout": {
- "idx": 559,
- "alias": [
- "layout.gridcolumn"
- ],
- "alternates": []
- },
- "Ext.grid.ColumnManager": {
- "idx": 560,
- "alias": [],
- "alternates": [
- "Ext.grid.ColumnModel"
- ]
- },
- "Ext.grid.NavigationModel": {
- "idx": 561,
- "alias": [
- "view.navigation.grid"
- ],
- "alternates": []
- },
- "Ext.grid.Panel": {
- "idx": 567,
- "alias": [
- "widget.grid",
- "widget.gridpanel"
- ],
- "alternates": [
- "Ext.list.ListView",
- "Ext.ListView",
- "Ext.grid.GridPanel"
- ]
- },
- "Ext.grid.RowContext": {
- "idx": 568,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.RowEditor": {
- "idx": 570,
- "alias": [
- "widget.roweditor"
- ],
- "alternates": []
- },
- "Ext.grid.RowEditorButtons": {
- "idx": 569,
- "alias": [
- "widget.roweditorbuttons"
- ],
- "alternates": []
- },
- "Ext.grid.Scroller": {
- "idx": 571,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.ViewDropZone": {
- "idx": 573,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.column.Action": {
- "idx": 581,
- "alias": [
- "widget.actioncolumn"
- ],
- "alternates": [
- "Ext.grid.ActionColumn"
- ]
- },
- "Ext.grid.column.ActionProxy": {
- "idx": 580,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.column.Boolean": {
- "idx": 582,
- "alias": [
- "widget.booleancolumn"
- ],
- "alternates": [
- "Ext.grid.BooleanColumn"
- ]
- },
- "Ext.grid.column.Check": {
- "idx": 583,
- "alias": [
- "widget.checkcolumn"
- ],
- "alternates": [
- "Ext.ux.CheckColumn",
- "Ext.grid.column.CheckColumn"
- ]
- },
- "Ext.grid.column.Column": {
- "idx": 579,
- "alias": [
- "widget.gridcolumn"
- ],
- "alternates": [
- "Ext.grid.Column"
- ]
- },
- "Ext.grid.column.Date": {
- "idx": 584,
- "alias": [
- "widget.datecolumn"
- ],
- "alternates": [
- "Ext.grid.DateColumn"
- ]
- },
- "Ext.grid.column.Number": {
- "idx": 585,
- "alias": [
- "widget.numbercolumn"
- ],
- "alternates": [
- "Ext.grid.NumberColumn"
- ]
- },
- "Ext.grid.column.RowNumberer": {
- "idx": 586,
- "alias": [
- "widget.rownumberer"
- ],
- "alternates": [
- "Ext.grid.RowNumberer"
- ]
- },
- "Ext.grid.column.Template": {
- "idx": 587,
- "alias": [
- "widget.templatecolumn"
- ],
- "alternates": [
- "Ext.grid.TemplateColumn"
- ]
- },
- "Ext.grid.column.Widget": {
- "idx": 588,
- "alias": [
- "widget.widgetcolumn"
- ],
- "alternates": []
- },
- "Ext.grid.feature.AbstractSummary": {
- "idx": 590,
- "alias": [
- "feature.abstractsummary"
- ],
- "alternates": []
- },
- "Ext.grid.feature.Feature": {
- "idx": 589,
- "alias": [
- "feature.feature"
- ],
- "alternates": []
- },
- "Ext.grid.feature.GroupStore": {
- "idx": 591,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.feature.Grouping": {
- "idx": 592,
- "alias": [
- "feature.grouping"
- ],
- "alternates": []
- },
- "Ext.grid.feature.GroupingSummary": {
- "idx": 593,
- "alias": [
- "feature.groupingsummary"
- ],
- "alternates": []
- },
- "Ext.grid.feature.RowBody": {
- "idx": 594,
- "alias": [
- "feature.rowbody"
- ],
- "alternates": []
- },
- "Ext.grid.feature.Summary": {
- "idx": 595,
- "alias": [
- "feature.summary"
- ],
- "alternates": []
- },
- "Ext.grid.filters.Filters": {
- "idx": 608,
- "alias": [
- "plugin.gridfilters"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.Base": {
- "idx": 600,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.filters.filter.Boolean": {
- "idx": 602,
- "alias": [
- "grid.filter.boolean"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.Date": {
- "idx": 604,
- "alias": [
- "grid.filter.date"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.List": {
- "idx": 605,
- "alias": [
- "grid.filter.list"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.Number": {
- "idx": 606,
- "alias": [
- "grid.filter.number",
- "grid.filter.numeric"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.SingleFilter": {
- "idx": 601,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.filters.filter.String": {
- "idx": 607,
- "alias": [
- "grid.filter.string"
- ],
- "alternates": []
- },
- "Ext.grid.filters.filter.TriFilter": {
- "idx": 603,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.header.Container": {
- "idx": 578,
- "alias": [
- "widget.headercontainer"
- ],
- "alternates": []
- },
- "Ext.grid.header.DragZone": {
- "idx": 575,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.header.DropZone": {
- "idx": 576,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.locking.HeaderContainer": {
- "idx": 609,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.locking.Lockable": {
- "idx": 612,
- "alias": [],
- "alternates": [
- "Ext.grid.Lockable"
- ]
- },
- "Ext.grid.locking.RowSynchronizer": {
- "idx": 563,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.locking.View": {
- "idx": 610,
- "alias": [],
- "alternates": [
- "Ext.grid.LockingView"
- ]
- },
- "Ext.grid.plugin.BufferedRenderer": {
- "idx": 613,
- "alias": [
- "plugin.bufferedrenderer"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.CellEditing": {
- "idx": 615,
- "alias": [
- "plugin.cellediting"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.Clipboard": {
- "idx": 616,
- "alias": [
- "plugin.clipboard"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.DragDrop": {
- "idx": 617,
- "alias": [
- "plugin.gridviewdragdrop"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.Editing": {
- "idx": 614,
- "alias": [
- "editing.editing"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.HeaderReorderer": {
- "idx": 577,
- "alias": [
- "plugin.gridheaderreorderer"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.HeaderResizer": {
- "idx": 574,
- "alias": [
- "plugin.gridheaderresizer"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.RowEditing": {
- "idx": 618,
- "alias": [
- "plugin.rowediting"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.RowExpander": {
- "idx": 619,
- "alias": [
- "plugin.rowexpander"
- ],
- "alternates": []
- },
- "Ext.grid.plugin.RowWidget": {
- "idx": 620,
- "alias": [
- "plugin.rowwidget"
- ],
- "alternates": []
- },
- "Ext.grid.property.Grid": {
- "idx": 621,
- "alias": [
- "widget.propertygrid"
- ],
- "alternates": [
- "Ext.grid.PropertyGrid"
- ]
- },
- "Ext.grid.property.HeaderContainer": {
- "idx": 622,
- "alias": [],
- "alternates": [
- "Ext.grid.PropertyColumnModel"
- ]
- },
- "Ext.grid.property.Property": {
- "idx": 623,
- "alias": [],
- "alternates": [
- "Ext.PropGridProperty"
- ]
- },
- "Ext.grid.property.Reader": {
- "idx": 624,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.property.Store": {
- "idx": 625,
- "alias": [],
- "alternates": [
- "Ext.grid.PropertyStore"
- ]
- },
- "Ext.grid.selection.Cells": {
- "idx": 627,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.selection.Columns": {
- "idx": 628,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.selection.Replicator": {
- "idx": 629,
- "alias": [
- "plugin.selectionreplicator"
- ],
- "alternates": []
- },
- "Ext.grid.selection.Rows": {
- "idx": 630,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.selection.Selection": {
- "idx": 626,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.selection.SelectionExtender": {
- "idx": 631,
- "alias": [],
- "alternates": []
- },
- "Ext.grid.selection.SpreadsheetModel": {
- "idx": 632,
- "alias": [
- "selection.spreadsheet"
- ],
- "alternates": []
- },
- "Ext.layout.Context": {
- "idx": 635,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.ContextItem": {
- "idx": 634,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.Layout": {
- "idx": 410,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.SizeModel": {
- "idx": 409,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.component.Auto": {
- "idx": 423,
- "alias": [
- "layout.autocomponent"
- ],
- "alternates": []
- },
- "Ext.layout.component.Body": {
- "idx": 637,
- "alias": [
- "layout.body"
- ],
- "alternates": []
- },
- "Ext.layout.component.BoundList": {
- "idx": 523,
- "alias": [
- "layout.boundlist"
- ],
- "alternates": []
- },
- "Ext.layout.component.Component": {
- "idx": 422,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.component.Dock": {
- "idx": 453,
- "alias": [
- "layout.dock"
- ],
- "alternates": [
- "Ext.layout.component.AbstractDock"
- ]
- },
- "Ext.layout.component.FieldSet": {
- "idx": 638,
- "alias": [
- "layout.fieldset"
- ],
- "alternates": []
- },
- "Ext.layout.component.ProgressBar": {
- "idx": 424,
- "alias": [
- "layout.progressbar"
- ],
- "alternates": []
- },
- "Ext.layout.component.field.FieldContainer": {
- "idx": 500,
- "alias": [
- "layout.fieldcontainer"
- ],
- "alternates": []
- },
- "Ext.layout.component.field.HtmlEditor": {
- "idx": 545,
- "alias": [
- "layout.htmleditor"
- ],
- "alternates": []
- },
- "Ext.layout.component.field.Text": {
- "idx": 493,
- "alias": [
- "layout.textfield"
- ],
- "alternates": []
- },
- "Ext.layout.container.Absolute": {
- "idx": 639,
- "alias": [
- "layout.absolute"
- ],
- "alternates": [
- "Ext.layout.AbsoluteLayout"
- ]
- },
- "Ext.layout.container.Accordion": {
- "idx": 640,
- "alias": [
- "layout.accordion"
- ],
- "alternates": [
- "Ext.layout.AccordionLayout"
- ]
- },
- "Ext.layout.container.Anchor": {
- "idx": 462,
- "alias": [
- "layout.anchor"
- ],
- "alternates": [
- "Ext.layout.AnchorLayout"
- ]
- },
- "Ext.layout.container.Auto": {
- "idx": 412,
- "alias": [
- "layout.auto",
- "layout.autocontainer"
- ],
- "alternates": []
- },
- "Ext.layout.container.Border": {
- "idx": 642,
- "alias": [
- "layout.border"
- ],
- "alternates": [
- "Ext.layout.BorderLayout"
- ]
- },
- "Ext.layout.container.Box": {
- "idx": 442,
- "alias": [
- "layout.box"
- ],
- "alternates": [
- "Ext.layout.BoxLayout"
- ]
- },
- "Ext.layout.container.Card": {
- "idx": 643,
- "alias": [
- "layout.card"
- ],
- "alternates": [
- "Ext.layout.CardLayout"
- ]
- },
- "Ext.layout.container.Center": {
- "idx": 644,
- "alias": [
- "layout.center",
- "layout.ux.center"
- ],
- "alternates": [
- "Ext.ux.layout.Center"
- ]
- },
- "Ext.layout.container.CheckboxGroup": {
- "idx": 503,
- "alias": [
- "layout.checkboxgroup"
- ],
- "alternates": []
- },
- "Ext.layout.container.Column": {
- "idx": 465,
- "alias": [
- "layout.column"
- ],
- "alternates": [
- "Ext.layout.ColumnLayout"
- ]
- },
- "Ext.layout.container.ColumnSplitter": {
- "idx": 469,
- "alias": [
- "widget.columnsplitter"
- ],
- "alternates": []
- },
- "Ext.layout.container.ColumnSplitterTracker": {
- "idx": 468,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.container.Container": {
- "idx": 411,
- "alias": [
- "layout.container"
- ],
- "alternates": [
- "Ext.layout.ContainerLayout"
- ]
- },
- "Ext.layout.container.Dashboard": {
- "idx": 470,
- "alias": [
- "layout.dashboard"
- ],
- "alternates": []
- },
- "Ext.layout.container.Editor": {
- "idx": 415,
- "alias": [
- "layout.editor"
- ],
- "alternates": []
- },
- "Ext.layout.container.Fit": {
- "idx": 557,
- "alias": [
- "layout.fit"
- ],
- "alternates": [
- "Ext.layout.FitLayout",
- "Ext.layout.Fit"
- ]
- },
- "Ext.layout.container.Form": {
- "idx": 645,
- "alias": [
- "layout.form"
- ],
- "alternates": [
- "Ext.layout.FormLayout"
- ]
- },
- "Ext.layout.container.HBox": {
- "idx": 443,
- "alias": [
- "layout.hbox"
- ],
- "alternates": [
- "Ext.layout.HBoxLayout"
- ]
- },
- "Ext.layout.container.SegmentedButton": {
- "idx": 432,
- "alias": [
- "layout.segmentedbutton"
- ],
- "alternates": []
- },
- "Ext.layout.container.Table": {
- "idx": 457,
- "alias": [
- "layout.table"
- ],
- "alternates": [
- "Ext.layout.TableLayout"
- ]
- },
- "Ext.layout.container.VBox": {
- "idx": 444,
- "alias": [
- "layout.vbox"
- ],
- "alternates": [
- "Ext.layout.VBoxLayout"
- ]
- },
- "Ext.layout.container.border.Region": {
- "idx": 119,
- "alias": [],
- "alternates": []
- },
- "Ext.layout.container.boxOverflow.Menu": {
- "idx": 547,
- "alias": [
- "box.overflow.Menu",
- "box.overflow.menu"
- ],
- "alternates": [
- "Ext.layout.boxOverflow.Menu"
- ]
- },
- "Ext.layout.container.boxOverflow.None": {
- "idx": 438,
- "alias": [
- "box.overflow.None",
- "box.overflow.none"
- ],
- "alternates": [
- "Ext.layout.boxOverflow.None"
- ]
- },
- "Ext.layout.container.boxOverflow.Scroller": {
- "idx": 439,
- "alias": [
- "box.overflow.Scroller",
- "box.overflow.scroller"
- ],
- "alternates": [
- "Ext.layout.boxOverflow.Scroller"
- ]
- },
- "Ext.list.AbstractTreeItem": {
- "idx": 354,
- "alias": [],
- "alternates": []
- },
- "Ext.list.RootTreeItem": {
- "idx": 355,
- "alias": [],
- "alternates": []
- },
- "Ext.list.Tree": {
- "idx": 358,
- "alias": [
- "widget.treelist"
- ],
- "alternates": []
- },
- "Ext.list.TreeItem": {
- "idx": 357,
- "alias": [
- "widget.treelistitem"
- ],
- "alternates": []
- },
- "Ext.menu.Bar": {
- "idx": 646,
- "alias": [
- "widget.menubar"
- ],
- "alternates": []
- },
- "Ext.menu.CheckItem": {
- "idx": 597,
- "alias": [
- "widget.menucheckitem"
- ],
- "alternates": []
- },
- "Ext.menu.ColorPicker": {
- "idx": 647,
- "alias": [
- "widget.colormenu"
- ],
- "alternates": []
- },
- "Ext.menu.DatePicker": {
- "idx": 648,
- "alias": [
- "widget.datemenu"
- ],
- "alternates": []
- },
- "Ext.menu.Item": {
- "idx": 596,
- "alias": [
- "widget.menuitem"
- ],
- "alternates": [
- "Ext.menu.TextItem"
- ]
- },
- "Ext.menu.Manager": {
- "idx": 428,
- "alias": [],
- "alternates": [
- "Ext.menu.MenuMgr"
- ]
- },
- "Ext.menu.Menu": {
- "idx": 599,
- "alias": [
- "widget.menu"
- ],
- "alternates": []
- },
- "Ext.menu.Separator": {
- "idx": 598,
- "alias": [
- "widget.menuseparator"
- ],
- "alternates": []
- },
- "Ext.mixin.Accessible": {
- "idx": 88,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Bindable": {
- "idx": 82,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Bufferable": {
- "idx": 20,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.ComponentDelegation": {
- "idx": 83,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.ConfigProxy": {
- "idx": 359,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.ConfigState": {
- "idx": 360,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Container": {
- "idx": 361,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Dirty": {
- "idx": 198,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Factoryable": {
- "idx": 12,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Focusable": {
- "idx": 87,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.FocusableContainer": {
- "idx": 364,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Hookable": {
- "idx": 365,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Identifiable": {
- "idx": 3,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Inheritable": {
- "idx": 81,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.ItemRippler": {
- "idx": 356,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Keyboard": {
- "idx": 86,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Mashup": {
- "idx": 366,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Observable": {
- "idx": 4,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Pluggable": {
- "idx": 85,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Queryable": {
- "idx": 238,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Responsive": {
- "idx": 90,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Selectable": {
- "idx": 367,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.StoreWatcher": {
- "idx": 368,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.StyleCacher": {
- "idx": 369,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Templatable": {
- "idx": 39,
- "alias": [],
- "alternates": []
- },
- "Ext.mixin.Traversable": {
- "idx": 370,
- "alias": [],
- "alternates": []
- },
- "Ext.panel.Bar": {
- "idx": 434,
- "alias": [],
- "alternates": []
- },
- "Ext.panel.DD": {
- "idx": 452,
- "alias": [],
- "alternates": []
- },
- "Ext.panel.Header": {
- "idx": 437,
- "alias": [
- "widget.header"
- ],
- "alternates": []
- },
- "Ext.panel.Panel": {
- "idx": 456,
- "alias": [
- "widget.panel"
- ],
- "alternates": [
- "Ext.Panel"
- ]
- },
- "Ext.panel.Pinnable": {
- "idx": 649,
- "alias": [],
- "alternates": []
- },
- "Ext.panel.Proxy": {
- "idx": 451,
- "alias": [],
- "alternates": [
- "Ext.dd.PanelProxy"
- ]
- },
- "Ext.panel.Table": {
- "idx": 558,
- "alias": [
- "widget.tablepanel"
- ],
- "alternates": []
- },
- "Ext.panel.Title": {
- "idx": 435,
- "alias": [
- "widget.title"
- ],
- "alternates": []
- },
- "Ext.panel.Tool": {
- "idx": 436,
- "alias": [
- "widget.tool"
- ],
- "alternates": []
- },
- "Ext.parse.Parser": {
- "idx": 217,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.Symbol": {
- "idx": 211,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.Tokenizer": {
- "idx": 210,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.symbol.Constant": {
- "idx": 212,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.symbol.Infix": {
- "idx": 213,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.symbol.InfixRight": {
- "idx": 214,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.symbol.Paren": {
- "idx": 215,
- "alias": [],
- "alternates": []
- },
- "Ext.parse.symbol.Prefix": {
- "idx": 216,
- "alias": [],
- "alternates": []
- },
- "Ext.perf.Accumulator": {
- "idx": 371,
- "alias": [],
- "alternates": []
- },
- "Ext.perf.Monitor": {
- "idx": 372,
- "alias": [],
- "alternates": [
- "Ext.Perf"
- ]
- },
- "Ext.picker.Color": {
- "idx": 544,
- "alias": [
- "widget.colorpicker"
- ],
- "alternates": [
- "Ext.ColorPalette"
- ]
- },
- "Ext.picker.Date": {
- "idx": 533,
- "alias": [
- "widget.datepicker"
- ],
- "alternates": [
- "Ext.DatePicker"
- ]
- },
- "Ext.picker.Month": {
- "idx": 532,
- "alias": [
- "widget.monthpicker"
- ],
- "alternates": [
- "Ext.MonthPicker"
- ]
- },
- "Ext.picker.Time": {
- "idx": 551,
- "alias": [
- "widget.timepicker"
- ],
- "alternates": []
- },
- "Ext.plugin.Abstract": {
- "idx": 84,
- "alias": [],
- "alternates": [
- "Ext.AbstractPlugin"
- ]
- },
- "Ext.plugin.AbstractClipboard": {
- "idx": 373,
- "alias": [],
- "alternates": []
- },
- "Ext.plugin.LazyItems": {
- "idx": 650,
- "alias": [
- "plugin.lazyitems"
- ],
- "alternates": []
- },
- "Ext.plugin.Manager": {
- "idx": 103,
- "alias": [],
- "alternates": [
- "Ext.PluginManager",
- "Ext.PluginMgr"
- ]
- },
- "Ext.plugin.MouseEnter": {
- "idx": 374,
- "alias": [
- "plugin.mouseenter"
- ],
- "alternates": []
- },
- "Ext.plugin.Responsive": {
- "idx": 651,
- "alias": [
- "plugin.responsive"
- ],
- "alternates": []
- },
- "Ext.plugin.Viewport": {
- "idx": 460,
- "alias": [
- "plugin.viewport"
- ],
- "alternates": []
- },
- "Ext.promise.Consequence": {
- "idx": 7,
- "alias": [],
- "alternates": []
- },
- "Ext.promise.Deferred": {
- "idx": 8,
- "alias": [],
- "alternates": []
- },
- "Ext.promise.Promise": {
- "idx": 9,
- "alias": [],
- "alternates": []
- },
- "Ext.resizer.BorderSplitter": {
- "idx": 641,
- "alias": [
- "widget.bordersplitter"
- ],
- "alternates": []
- },
- "Ext.resizer.BorderSplitterTracker": {
- "idx": 652,
- "alias": [],
- "alternates": []
- },
- "Ext.resizer.Handle": {
- "idx": 653,
- "alias": [],
- "alternates": []
- },
- "Ext.resizer.ResizeTracker": {
- "idx": 654,
- "alias": [],
- "alternates": []
- },
- "Ext.resizer.Resizer": {
- "idx": 655,
- "alias": [],
- "alternates": [
- "Ext.Resizable"
- ]
- },
- "Ext.resizer.Splitter": {
- "idx": 441,
- "alias": [
- "widget.splitter"
- ],
- "alternates": []
- },
- "Ext.resizer.SplitterTracker": {
- "idx": 467,
- "alias": [],
- "alternates": []
- },
- "Ext.route.Action": {
- "idx": 123,
- "alias": [],
- "alternates": []
- },
- "Ext.route.Handler": {
- "idx": 122,
- "alias": [],
- "alternates": []
- },
- "Ext.route.Mixin": {
- "idx": 127,
- "alias": [],
- "alternates": []
- },
- "Ext.route.Route": {
- "idx": 124,
- "alias": [],
- "alternates": []
- },
- "Ext.route.Router": {
- "idx": 126,
- "alias": [],
- "alternates": []
- },
- "Ext.scroll.LockingScroller": {
- "idx": 611,
- "alias": [
- "scroller.locking"
- ],
- "alternates": []
- },
- "Ext.scroll.Scroller": {
- "idx": 110,
- "alias": [
- "scroller.scroller"
- ],
- "alternates": [
- "Ext.scroll.NativeScroller"
- ]
- },
- "Ext.scroll.TableScroller": {
- "idx": 565,
- "alias": [
- "scroller.table"
- ],
- "alternates": []
- },
- "Ext.selection.CellModel": {
- "idx": 656,
- "alias": [
- "selection.cellmodel"
- ],
- "alternates": []
- },
- "Ext.selection.CheckboxModel": {
- "idx": 658,
- "alias": [
- "selection.checkboxmodel"
- ],
- "alternates": []
- },
- "Ext.selection.DataViewModel": {
- "idx": 518,
- "alias": [
- "selection.dataviewmodel"
- ],
- "alternates": []
- },
- "Ext.selection.Model": {
- "idx": 517,
- "alias": [
- "selection.abstract"
- ],
- "alternates": [
- "Ext.AbstractSelectionModel"
- ]
- },
- "Ext.selection.RowModel": {
- "idx": 657,
- "alias": [
- "selection.rowmodel"
- ],
- "alternates": []
- },
- "Ext.selection.TreeModel": {
- "idx": 659,
- "alias": [
- "selection.treemodel"
- ],
- "alternates": []
- },
- "Ext.slider.Multi": {
- "idx": 662,
- "alias": [
- "widget.multislider"
- ],
- "alternates": [
- "Ext.slider.MultiSlider"
- ]
- },
- "Ext.slider.Single": {
- "idx": 663,
- "alias": [
- "widget.slider",
- "widget.sliderfield"
- ],
- "alternates": [
- "Ext.Slider",
- "Ext.form.SliderField",
- "Ext.slider.SingleSlider",
- "Ext.slider.Slider"
- ]
- },
- "Ext.slider.Thumb": {
- "idx": 660,
- "alias": [],
- "alternates": []
- },
- "Ext.slider.Tip": {
- "idx": 661,
- "alias": [
- "widget.slidertip"
- ],
- "alternates": []
- },
- "Ext.slider.Widget": {
- "idx": 664,
- "alias": [
- "widget.sliderwidget"
- ],
- "alternates": []
- },
- "Ext.sparkline.Bar": {
- "idx": 383,
- "alias": [
- "widget.sparklinebar"
- ],
- "alternates": []
- },
- "Ext.sparkline.BarBase": {
- "idx": 381,
- "alias": [],
- "alternates": []
- },
- "Ext.sparkline.Base": {
- "idx": 380,
- "alias": [
- "widget.sparkline"
- ],
- "alternates": []
- },
- "Ext.sparkline.Box": {
- "idx": 384,
- "alias": [
- "widget.sparklinebox"
- ],
- "alternates": []
- },
- "Ext.sparkline.Bullet": {
- "idx": 385,
- "alias": [
- "widget.sparklinebullet"
- ],
- "alternates": []
- },
- "Ext.sparkline.CanvasBase": {
- "idx": 376,
- "alias": [],
- "alternates": []
- },
- "Ext.sparkline.CanvasCanvas": {
- "idx": 377,
- "alias": [],
- "alternates": []
- },
- "Ext.sparkline.Discrete": {
- "idx": 386,
- "alias": [
- "widget.sparklinediscrete"
- ],
- "alternates": []
- },
- "Ext.sparkline.Line": {
- "idx": 387,
- "alias": [
- "widget.sparklineline"
- ],
- "alternates": []
- },
- "Ext.sparkline.Pie": {
- "idx": 388,
- "alias": [
- "widget.sparklinepie"
- ],
- "alternates": []
- },
- "Ext.sparkline.RangeMap": {
- "idx": 382,
- "alias": [],
- "alternates": []
- },
- "Ext.sparkline.Shape": {
- "idx": 375,
- "alias": [],
- "alternates": []
- },
- "Ext.sparkline.TriState": {
- "idx": 389,
- "alias": [
- "widget.sparklinetristate"
- ],
- "alternates": []
- },
- "Ext.sparkline.VmlCanvas": {
- "idx": 378,
- "alias": [],
- "alternates": []
- },
- "Ext.state.CookieProvider": {
- "idx": 665,
- "alias": [],
- "alternates": []
- },
- "Ext.state.LocalStorageProvider": {
- "idx": 666,
- "alias": [
- "state.localstorage"
- ],
- "alternates": []
- },
- "Ext.state.Manager": {
- "idx": 115,
- "alias": [],
- "alternates": []
- },
- "Ext.state.Provider": {
- "idx": 114,
- "alias": [],
- "alternates": []
- },
- "Ext.state.Stateful": {
- "idx": 116,
- "alias": [],
- "alternates": []
- },
- "Ext.tab.Bar": {
- "idx": 668,
- "alias": [
- "widget.tabbar"
- ],
- "alternates": []
- },
- "Ext.tab.Panel": {
- "idx": 669,
- "alias": [
- "widget.tabpanel"
- ],
- "alternates": [
- "Ext.TabPanel"
- ]
- },
- "Ext.tab.Tab": {
- "idx": 667,
- "alias": [
- "widget.tab"
- ],
- "alternates": []
- },
- "Ext.tip.QuickTip": {
- "idx": 542,
- "alias": [
- "widget.quicktip"
- ],
- "alternates": [
- "Ext.QuickTip"
- ]
- },
- "Ext.tip.QuickTipManager": {
- "idx": 543,
- "alias": [],
- "alternates": [
- "Ext.QuickTips"
- ]
- },
- "Ext.tip.Tip": {
- "idx": 540,
- "alias": [
- "widget.tip"
- ],
- "alternates": [
- "Ext.Tip"
- ]
- },
- "Ext.tip.ToolTip": {
- "idx": 541,
- "alias": [
- "widget.tooltip"
- ],
- "alternates": [
- "Ext.ToolTip"
- ]
- },
- "Ext.toolbar.Breadcrumb": {
- "idx": 670,
- "alias": [
- "widget.breadcrumb"
- ],
- "alternates": []
- },
- "Ext.toolbar.Fill": {
- "idx": 671,
- "alias": [
- "widget.tbfill"
- ],
- "alternates": [
- "Ext.Toolbar.Fill"
- ]
- },
- "Ext.toolbar.Item": {
- "idx": 524,
- "alias": [
- "widget.tbitem"
- ],
- "alternates": [
- "Ext.Toolbar.Item"
- ]
- },
- "Ext.toolbar.Paging": {
- "idx": 529,
- "alias": [
- "widget.pagingtoolbar"
- ],
- "alternates": [
- "Ext.PagingToolbar"
- ]
- },
- "Ext.toolbar.Separator": {
- "idx": 546,
- "alias": [
- "widget.tbseparator"
- ],
- "alternates": [
- "Ext.Toolbar.Separator"
- ]
- },
- "Ext.toolbar.Spacer": {
- "idx": 672,
- "alias": [
- "widget.tbspacer"
- ],
- "alternates": [
- "Ext.Toolbar.Spacer"
- ]
- },
- "Ext.toolbar.TextItem": {
- "idx": 525,
- "alias": [
- "widget.tbtext"
- ],
- "alternates": [
- "Ext.Toolbar.TextItem"
- ]
- },
- "Ext.toolbar.Toolbar": {
- "idx": 445,
- "alias": [
- "widget.toolbar"
- ],
- "alternates": [
- "Ext.Toolbar"
- ]
- },
- "Ext.tree.Column": {
- "idx": 673,
- "alias": [
- "widget.treecolumn"
- ],
- "alternates": []
- },
- "Ext.tree.NavigationModel": {
- "idx": 674,
- "alias": [
- "view.navigation.tree"
- ],
- "alternates": []
- },
- "Ext.tree.Panel": {
- "idx": 676,
- "alias": [
- "widget.treepanel"
- ],
- "alternates": [
- "Ext.tree.TreePanel",
- "Ext.TreePanel"
- ]
- },
- "Ext.tree.View": {
- "idx": 675,
- "alias": [
- "widget.treeview"
- ],
- "alternates": []
- },
- "Ext.tree.ViewDragZone": {
- "idx": 678,
- "alias": [],
- "alternates": []
- },
- "Ext.tree.ViewDropZone": {
- "idx": 679,
- "alias": [],
- "alternates": []
- },
- "Ext.tree.plugin.TreeViewDragDrop": {
- "idx": 680,
- "alias": [
- "plugin.treeviewdragdrop"
- ],
- "alternates": []
- },
- "Ext.util.AbstractMixedCollection": {
- "idx": 53,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Animate": {
- "idx": 74,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Bag": {
- "idx": 189,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Base64": {
- "idx": 390,
- "alias": [],
- "alternates": []
- },
- "Ext.util.BasicFilter": {
- "idx": 50,
- "alias": [],
- "alternates": []
- },
- "Ext.util.CSS": {
- "idx": 104,
- "alias": [],
- "alternates": []
- },
- "Ext.util.CSV": {
- "idx": 392,
- "alias": [],
- "alternates": []
- },
- "Ext.util.ClickRepeater": {
- "idx": 393,
- "alias": [],
- "alternates": [
- "Ext.util.TapRepeater"
- ]
- },
- "Ext.util.Collection": {
- "idx": 132,
- "alias": [],
- "alternates": []
- },
- "Ext.util.CollectionKey": {
- "idx": 130,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Color": {
- "idx": 379,
- "alias": [],
- "alternates": [
- "Ext.draw.Color"
- ]
- },
- "Ext.util.ComponentDragger": {
- "idx": 488,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Cookies": {
- "idx": 394,
- "alias": [],
- "alternates": []
- },
- "Ext.util.DelimitedValue": {
- "idx": 391,
- "alias": [],
- "alternates": []
- },
- "Ext.util.ElementContainer": {
- "idx": 112,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Event": {
- "idx": 2,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Filter": {
- "idx": 51,
- "alias": [],
- "alternates": []
- },
- "Ext.util.FilterCollection": {
- "idx": 177,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Floating": {
- "idx": 111,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Fly": {
- "idx": 209,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Format": {
- "idx": 94,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Group": {
- "idx": 169,
- "alias": [],
- "alternates": []
- },
- "Ext.util.GroupCollection": {
- "idx": 178,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Grouper": {
- "idx": 131,
- "alias": [],
- "alternates": []
- },
- "Ext.util.HashMap": {
- "idx": 5,
- "alias": [],
- "alternates": []
- },
- "Ext.util.History": {
- "idx": 125,
- "alias": [],
- "alternates": [
- "Ext.History"
- ]
- },
- "Ext.util.Inflector": {
- "idx": 140,
- "alias": [],
- "alternates": []
- },
- "Ext.util.ItemCollection": {
- "idx": 395,
- "alias": [],
- "alternates": [
- "Ext.ItemCollection"
- ]
- },
- "Ext.util.KeyMap": {
- "idx": 362,
- "alias": [],
- "alternates": [
- "Ext.KeyMap"
- ]
- },
- "Ext.util.KeyNav": {
- "idx": 363,
- "alias": [],
- "alternates": [
- "Ext.KeyNav"
- ]
- },
- "Ext.util.LocalStorage": {
- "idx": 396,
- "alias": [],
- "alternates": []
- },
- "Ext.util.LruCache": {
- "idx": 23,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Memento": {
- "idx": 454,
- "alias": [],
- "alternates": []
- },
- "Ext.util.MixedCollection": {
- "idx": 56,
- "alias": [],
- "alternates": []
- },
- "Ext.util.ObjectTemplate": {
- "idx": 134,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Observable": {
- "idx": 52,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Offset": {
- "idx": 33,
- "alias": [],
- "alternates": []
- },
- "Ext.util.PaintMonitor": {
- "idx": 47,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Point": {
- "idx": 35,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Positionable": {
- "idx": 26,
- "alias": [],
- "alternates": []
- },
- "Ext.util.ProtoElement": {
- "idx": 101,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Queue": {
- "idx": 633,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Region": {
- "idx": 34,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Renderable": {
- "idx": 113,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Schedulable": {
- "idx": 200,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Scheduler": {
- "idx": 190,
- "alias": [],
- "alternates": []
- },
- "Ext.util.SizeMonitor": {
- "idx": 43,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Sortable": {
- "idx": 55,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Sorter": {
- "idx": 54,
- "alias": [],
- "alternates": []
- },
- "Ext.util.SorterCollection": {
- "idx": 176,
- "alias": [],
- "alternates": []
- },
- "Ext.util.Spans": {
- "idx": 397,
- "alias": [],
- "alternates": []
- },
- "Ext.util.StoreHolder": {
- "idx": 420,
- "alias": [],
- "alternates": []
- },
- "Ext.util.TaskManager": {
- "idx": 399,
- "alias": [],
- "alternates": [
- "Ext.TaskManager"
- ]
- },
- "Ext.util.TaskRunner": {
- "idx": 57,
- "alias": [],
- "alternates": []
- },
- "Ext.util.TextMetrics": {
- "idx": 400,
- "alias": [],
- "alternates": []
- },
- "Ext.util.TsvDecoder": {
- "idx": 398,
- "alias": [],
- "alternates": [
- "Ext.util.TSV"
- ]
- },
- "Ext.util.XTemplateCompiler": {
- "idx": 97,
- "alias": [],
- "alternates": []
- },
- "Ext.util.XTemplateParser": {
- "idx": 96,
- "alias": [],
- "alternates": []
- },
- "Ext.util.paintmonitor.Abstract": {
- "idx": 45,
- "alias": [],
- "alternates": []
- },
- "Ext.util.paintmonitor.CssAnimation": {
- "idx": 46,
- "alias": [],
- "alternates": []
- },
- "Ext.util.paintmonitor.OverflowChange": {
- "idx": 401,
- "alias": [],
- "alternates": []
- },
- "Ext.util.sizemonitor.Abstract": {
- "idx": 41,
- "alias": [],
- "alternates": []
- },
- "Ext.util.sizemonitor.OverflowChange": {
- "idx": 402,
- "alias": [],
- "alternates": []
- },
- "Ext.util.sizemonitor.Scroll": {
- "idx": 42,
- "alias": [],
- "alternates": []
- },
- "Ext.util.translatable.Abstract": {
- "idx": 107,
- "alias": [],
- "alternates": []
- },
- "Ext.util.translatable.CssPosition": {
- "idx": 403,
- "alias": [
- "translatable.cssposition"
- ],
- "alternates": []
- },
- "Ext.util.translatable.CssTransform": {
- "idx": 404,
- "alias": [
- "translatable.csstransform"
- ],
- "alternates": []
- },
- "Ext.util.translatable.Dom": {
- "idx": 108,
- "alias": [
- "translatable.dom"
- ],
- "alternates": []
- },
- "Ext.util.translatable.ScrollParent": {
- "idx": 405,
- "alias": [
- "translatable.scrollparent"
- ],
- "alternates": []
- },
- "Ext.util.translatable.ScrollPosition": {
- "idx": 109,
- "alias": [
- "translatable.scrollposition"
- ],
- "alternates": []
- },
- "Ext.view.AbstractView": {
- "idx": 520,
- "alias": [],
- "alternates": []
- },
- "Ext.view.BoundList": {
- "idx": 530,
- "alias": [
- "widget.boundlist"
- ],
- "alternates": [
- "Ext.BoundList"
- ]
- },
- "Ext.view.BoundListKeyNav": {
- "idx": 522,
- "alias": [
- "view.navigation.boundlist"
- ],
- "alternates": []
- },
- "Ext.view.DragZone": {
- "idx": 677,
- "alias": [],
- "alternates": []
- },
- "Ext.view.DropZone": {
- "idx": 572,
- "alias": [],
- "alternates": []
- },
- "Ext.view.MultiSelector": {
- "idx": 682,
- "alias": [
- "widget.multiselector"
- ],
- "alternates": []
- },
- "Ext.view.MultiSelectorSearch": {
- "idx": 681,
- "alias": [
- "widget.multiselector-search"
- ],
- "alternates": []
- },
- "Ext.view.NavigationModel": {
- "idx": 519,
- "alias": [
- "view.navigation.default"
- ],
- "alternates": []
- },
- "Ext.view.NodeCache": {
- "idx": 564,
- "alias": [],
- "alternates": []
- },
- "Ext.view.Table": {
- "idx": 566,
- "alias": [
- "widget.gridview",
- "widget.tableview"
- ],
- "alternates": [
- "Ext.grid.View"
- ]
- },
- "Ext.view.TableLayout": {
- "idx": 562,
- "alias": [
- "layout.tableview"
- ],
- "alternates": []
- },
- "Ext.view.TagKeyNav": {
- "idx": 549,
- "alias": [
- "view.navigation.tagfield"
- ],
- "alternates": []
- },
- "Ext.view.View": {
- "idx": 521,
- "alias": [
- "widget.dataview"
- ],
- "alternates": [
- "Ext.DataView"
- ]
- },
- "Ext.window.MessageBox": {
- "idx": 498,
- "alias": [
- "widget.messagebox"
- ],
- "alternates": []
- },
- "Ext.window.Toast": {
- "idx": 683,
- "alias": [
- "widget.toast"
- ],
- "alternates": []
- },
- "Ext.window.Window": {
- "idx": 489,
- "alias": [
- "widget.window"
- ],
- "alternates": [
- "Ext.Window"
- ]
- }
- },
- "packages": {
- "classic": {
- "css": true,
- "included": true,
- "language": {
- "js": {
- "input": {
- "version": "ES5"
- }
- }
- },
- "namespace": "Ext",
- "properties": {
- "skip.sass": 1,
- "skip.pkg": 1,
- "skip.slice": 1
- },
- "required": true,
- "requires": [
- "ext",
- "core",
- "classic"
- ],
- "version": "7.0.0"
- },
- "cmd": {
- "version": "7.0.0.40"
- },
- "core": {
- "css": true,
- "included": true,
- "properties": {
- "skip.slice": 1,
- "skip.style": 1,
- "skip.pkg": 1,
- "package.tags.classdefs": "class"
- },
- "required": true,
- "requires": [
- "ext"
- ],
- "version": "7.0.0"
- },
- "ext": {
- "css": true,
- "included": true,
- "language": {
- "js": {
- "input": {
- "version": "ES5"
- }
- }
- },
- "license": "dev",
- "namespace": "Ext",
- "properties": {
- "skip.sass": 1,
- "skip.slice": 1
- },
- "required": true,
- "requires": [],
- "version": "7.0.0.168"
- }
- },
- "bootRelative": true
- });
- // @tag core
- // @define Ext.Boot
- var Ext = Ext || {};
- //<editor-fold desc="Boot">
- /**
- * @class Ext.Boot
- * @singleton
- * @private
- */
- Ext.Boot = Ext.Boot || (function(emptyFn) {
- var doc = document,
- _emptyArray = [],
- _config = {
- /**
- * @cfg {Boolean} [disableCaching=true]
- * If `true` current timestamp is added to script URL's to prevent caching.
- * In debug builds, adding a "cache" or "disableCacheBuster" query parameter
- * to the page's URL will set this to `false`.
- */
- disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || !(/http[s]?\:/i.test(location.href)) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true,
- /**
- * @cfg {String} [disableCachingParam="_dc"]
- * The query parameter name for the cache buster's timestamp.
- */
- disableCachingParam: '_dc',
- /**
- * @cfg {Boolean} loadDelay
- * Millisecond delay between asynchronous script injection (prevents stack
- * overflow on some user agents) 'false' disables delay but potentially
- * increases stack load.
- */
- loadDelay: false,
- /**
- * @cfg {Boolean} preserveScripts
- * `false` to remove asynchronously loaded scripts, `true` to retain script
- * element for browser debugger compatibility and improved load performance.
- */
- preserveScripts: true,
- /**
- * @cfg {String} [charset=UTF-8]
- * Optional charset to specify encoding of dynamic content.
- */
- charset: 'UTF-8'
- },
- _assetConfig = {},
- cssRe = /\.css(?:\?|$)/i,
- resolverEl = doc.createElement('a'),
- isBrowser = typeof window !== 'undefined',
- _environment = {
- browser: isBrowser,
- node: !isBrowser && (typeof require === 'function'),
- phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
- },
- _tags = (Ext.platformTags = {}),
- // All calls to _debug are commented out to speed up old browsers a bit;
- // yes that makes a difference because the cost of concatenating strings
- // and passing them into _debug() adds up pretty quickly.
- _debug = function(message) {},
- //console.log(message);
- _apply = function(object, config, defaults) {
- if (defaults) {
- _apply(object, defaults);
- }
- if (object && config && typeof config === 'object') {
- for (var i in config) {
- object[i] = config[i];
- }
- }
- return object;
- },
- _merge = function() {
- var lowerCase = false,
- obj = Array.prototype.shift.call(arguments),
- index, i, len, value;
- if (typeof arguments[arguments.length - 1] === 'boolean') {
- lowerCase = Array.prototype.pop.call(arguments);
- }
- len = arguments.length;
- for (index = 0; index < len; index++) {
- value = arguments[index];
- if (typeof value === 'object') {
- for (i in value) {
- obj[lowerCase ? i.toLowerCase() : i] = value[i];
- }
- }
- }
- return obj;
- },
- _getKeys = (typeof Object.keys == 'function') ? function(object) {
- if (!object) {
- return [];
- }
- return Object.keys(object);
- } : function(object) {
- var keys = [],
- property;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- keys.push(property);
- }
- }
- return keys;
- },
- /*
- * The Boot loader class manages Request objects that contain one or
- * more individual urls that need to be loaded. Requests can be performed
- * synchronously or asynchronously, but will always evaluate urls in the
- * order specified on the request object.
- */
- Boot = {
- loading: 0,
- loaded: 0,
- apply: _apply,
- env: _environment,
- config: _config,
- /**
- * @cfg {Object} assetConfig
- * A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
- */
- assetConfig: _assetConfig,
- // Keyed by absolute URL this object holds "true" if that URL is already loaded
- // or an array of callbacks to call once it loads.
- scripts: {},
- /*
- Entry objects
- 'http://foo.com/bar/baz/Thing.js': {
- done: true,
- el: scriptEl || linkEl,
- preserve: true,
- requests: [ request1, ... ]
- }
- */
- /**
- * contains the current script name being loaded
- * (loadSync or sequential load only)
- */
- currentFile: null,
- suspendedQueue: [],
- currentRequest: null,
- // when loadSync is called, need to cause subsequent load requests to also be loadSync,
- // eg, when Ext.require(...) is called
- syncMode: false,
- /*
- * simple helper method for debugging
- */
- debug: _debug,
- /**
- * enables / disables loading scripts via script / link elements rather
- * than using ajax / eval
- */
- useElements: true,
- listeners: [],
- Request: Request,
- Entry: Entry,
- allowMultipleBrowsers: false,
- browserNames: {
- ie: 'IE',
- firefox: 'Firefox',
- safari: 'Safari',
- chrome: 'Chrome',
- opera: 'Opera',
- dolfin: 'Dolfin',
- edge: 'Edge',
- webosbrowser: 'webOSBrowser',
- chromeMobile: 'ChromeMobile',
- chromeiOS: 'ChromeiOS',
- silk: 'Silk',
- other: 'Other'
- },
- osNames: {
- ios: 'iOS',
- android: 'Android',
- windowsPhone: 'WindowsPhone',
- webos: 'webOS',
- blackberry: 'BlackBerry',
- rimTablet: 'RIMTablet',
- mac: 'MacOS',
- win: 'Windows',
- tizen: 'Tizen',
- linux: 'Linux',
- bada: 'Bada',
- chromeOS: 'ChromeOS',
- other: 'Other'
- },
- browserPrefixes: {
- ie: 'MSIE ',
- edge: 'Edge/',
- firefox: 'Firefox/',
- chrome: 'Chrome/',
- safari: 'Version/',
- opera: 'OPR/',
- dolfin: 'Dolfin/',
- webosbrowser: 'wOSBrowser/',
- chromeMobile: 'CrMo/',
- chromeiOS: 'CriOS/',
- silk: 'Silk/'
- },
- // When a UA reports multiple browsers this list is used to prioritize the 'real' browser
- // lower index number will win
- browserPriority: [
- 'edge',
- 'opera',
- 'dolfin',
- 'webosbrowser',
- 'silk',
- 'chromeiOS',
- 'chromeMobile',
- 'ie',
- 'firefox',
- 'safari',
- 'chrome'
- ],
- osPrefixes: {
- tizen: '(Tizen )',
- ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
- android: '(Android |HTC_|Silk/)',
- // Some HTC devices ship with an OSX userAgent by default,
- // so we need to add a direct check for HTC_
- windowsPhone: 'Windows Phone ',
- blackberry: '(?:BlackBerry|BB)(?:.*)Version/',
- rimTablet: 'RIM Tablet OS ',
- webos: '(?:webOS|hpwOS)/',
- bada: 'Bada/',
- chromeOS: 'CrOS '
- },
- fallbackOSPrefixes: {
- windows: 'win',
- mac: 'mac',
- linux: 'linux'
- },
- devicePrefixes: {
- iPhone: 'iPhone',
- iPod: 'iPod',
- iPad: 'iPad'
- },
- maxIEVersion: 12,
- /**
- * The default function that detects various platforms and sets tags
- * in the platform map accordingly. Examples are iOS, android, tablet, etc.
- * @param tags the set of tags to populate
- */
- detectPlatformTags: function() {
- var me = this,
- ua = navigator.userAgent,
- isMobile = /Mobile(\/|\s)/.test(ua),
- element = document.createElement('div'),
- isEventSupported = function(name, tag) {
- if (tag === undefined) {
- tag = window;
- }
- var eventName = 'on' + name.toLowerCase(),
- isSupported = (eventName in element);
- if (!isSupported) {
- if (element.setAttribute && element.removeAttribute) {
- element.setAttribute(eventName, '');
- isSupported = typeof element[eventName] === 'function';
- if (typeof element[eventName] !== 'undefined') {
- element[eventName] = undefined;
- }
- element.removeAttribute(eventName);
- }
- }
- return isSupported;
- },
- // Browser Detection
- getBrowsers = function() {
- var browsers = {},
- maxIEVersion, prefix, value, key, index, len, match, version, matched;
- // MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
- // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
- // we use this to prioritize the actual browser in this situation
- len = me.browserPriority.length;
- for (index = 0; index < len; index++) {
- key = me.browserPriority[index];
- if (!matched) {
- value = me.browserPrefixes[key];
- match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
- version = match && match.length > 1 ? parseInt(match[2]) : 0;
- if (version) {
- matched = true;
- }
- } else {
- version = 0;
- }
- browsers[key] = version;
- }
- //Deal with IE document mode
- if (browsers.ie) {
- var mode = document.documentMode;
- if (mode >= 8) {
- browsers.ie = mode;
- }
- }
- // Fancy IE greater than and less then quick tags
- version = browsers.ie || false;
- maxIEVersion = Math.max(version, me.maxIEVersion);
- for (index = 8; index <= maxIEVersion; ++index) {
- prefix = 'ie' + index;
- browsers[prefix + 'm'] = version ? version <= index : 0;
- browsers[prefix] = version ? version === index : 0;
- browsers[prefix + 'p'] = version ? version >= index : 0;
- }
- return browsers;
- },
- //OS Detection
- getOperatingSystems = function() {
- var systems = {},
- value, key, keys, index, len, match, matched, version, activeCount;
- keys = _getKeys(me.osPrefixes);
- len = keys.length;
- for (index = 0 , activeCount = 0; index < len; index++) {
- key = keys[index];
- value = me.osPrefixes[key];
- match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
- matched = match ? match[1] : null;
- // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
- // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
- if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
- version = 2.3;
- } else {
- version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
- }
- if (version) {
- activeCount++;
- }
- systems[key] = version;
- }
- keys = _getKeys(me.fallbackOSPrefixes);
- // If no OS could be found we resort to the fallbacks, otherwise we just
- // falsify the fallbacks
- len = keys.length;
- for (index = 0; index < len; index++) {
- key = keys[index];
- // No OS was detected from osPrefixes
- if (activeCount === 0) {
- value = me.fallbackOSPrefixes[key];
- match = ua.toLowerCase().match(new RegExp(value));
- systems[key] = match ? true : 0;
- } else {
- systems[key] = 0;
- }
- }
- return systems;
- },
- // Device Detection
- getDevices = function() {
- var devices = {},
- value, key, keys, index, len, match;
- keys = _getKeys(me.devicePrefixes);
- len = keys.length;
- for (index = 0; index < len; index++) {
- key = keys[index];
- value = me.devicePrefixes[key];
- match = ua.match(new RegExp(value));
- devices[key] = match ? true : 0;
- }
- return devices;
- },
- browsers = getBrowsers(),
- systems = getOperatingSystems(),
- devices = getDevices(),
- platformParams = Boot.loadPlatformsParam();
- // We apply platformParams from the query here first to allow for forced user valued
- // to be used in calculation of generated tags
- _merge(_tags, browsers, systems, devices, platformParams, true);
- _tags.phone = !!((_tags.iphone || _tags.ipod) || (!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) || (_tags.blackberry && isMobile) || (_tags.windowsphone));
- _tags.tablet = !!(!_tags.phone && (_tags.ipad || _tags.android || _tags.silk || _tags.rimtablet || (_tags.ie10 && /; Touch/.test(ua))));
- _tags.touch = // if the browser has touch events we can be reasonably sure the device has
- // a touch screen
- isEventSupported('touchend') || // browsers that use pointer event have maxTouchPoints > 0 if the
- // device supports touch input
- // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
- navigator.maxTouchPoints || // IE10 uses a vendor-prefixed maxTouchPoints property
- navigator.msMaxTouchPoints;
- _tags.desktop = !_tags.phone && !_tags.tablet;
- _tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
- _tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
- _tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
- // Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
- _merge(_tags, platformParams, true);
- },
- /**
- * Extracts user supplied platform tags from the "platformTags" query parameter
- * of the form:
- *
- * ?platformTags=name:state,name:state,...
- *
- * (each tag defaults to true when state is unspecified)
- *
- * Example:
- *
- * ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
- *
- * @returns {Object} the platform tags supplied by the query string
- */
- loadPlatformsParam: function() {
- // Check if the ?platform parameter is set in the URL
- var paramsString = window.location.search.substr(1),
- paramsArray = paramsString.split("&"),
- params = {},
- i,
- platforms = {},
- tmpArray, tmplen, platform, name, enabled;
- for (i = 0; i < paramsArray.length; i++) {
- tmpArray = paramsArray[i].split("=");
- params[tmpArray[0]] = tmpArray[1];
- }
- if (params.platformTags) {
- tmpArray = params.platformTags.split(",");
- for (tmplen = tmpArray.length , i = 0; i < tmplen; i++) {
- platform = tmpArray[i].split(":");
- name = platform[0];
- enabled = true;
- if (platform.length > 1) {
- enabled = platform[1];
- if (enabled === 'false' || enabled === '0') {
- enabled = false;
- }
- }
- platforms[name] = enabled;
- }
- }
- return platforms;
- },
- filterPlatform: function(platform, excludes) {
- platform = _emptyArray.concat(platform || _emptyArray);
- excludes = _emptyArray.concat(excludes || _emptyArray);
- var plen = platform.length,
- elen = excludes.length,
- include = (!plen && elen),
- // default true if only excludes specified
- i, tag;
- for (i = 0; i < plen && !include; i++) {
- tag = platform[i];
- include = !!_tags[tag];
- }
- for (i = 0; i < elen && include; i++) {
- tag = excludes[i];
- include = !_tags[tag];
- }
- return include;
- },
- init: function() {
- var scriptEls = doc.getElementsByTagName('script'),
- script = scriptEls[0],
- len = scriptEls.length,
- re = /\/ext(\-[a-z\-]+)?\.js$/,
- entry, src, state, baseUrl, key, n, origin;
- // No check for script definedness because there always should be at least one
- Boot.hasReadyState = ("readyState" in script);
- Boot.hasAsync = ("async" in script);
- Boot.hasDefer = ("defer" in script);
- Boot.hasOnLoad = ("onload" in script);
- // Feature detecting IE
- Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
- Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
- Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
- if (Boot.isIE8) {
- Boot.isIE10 = false;
- Boot.isIE10m = true;
- } else {
- Boot.isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
- Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
- }
- // IE11 does not support conditional compilation so we detect it by exclusion
- Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
- // Since we are loading after other scripts, and we needed to gather them
- // anyway, we track them in _scripts so we don't have to ask for them all
- // repeatedly.
- for (n = 0; n < len; n++) {
- src = (script = scriptEls[n]).src;
- if (!src) {
-
- continue;
- }
- state = script.readyState || null;
- // If we find a script file called "ext-*.js", then the base path is that file's base path.
- if (!baseUrl && re.test(src)) {
- baseUrl = src;
- }
- if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
- // _debug("creating entry " + key + " in Boot.init");
- entry = new Entry({
- key: key,
- url: src,
- done: state === null || // non-IE
- state === 'loaded' || state === 'complete',
- // IE only
- el: script,
- prop: 'src'
- });
- }
- }
- if (!baseUrl) {
- script = scriptEls[scriptEls.length - 1];
- baseUrl = script.src;
- }
- Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
- origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
- Boot.origin = origin;
- Boot.detectPlatformTags();
- Ext.filterPlatform = Boot.filterPlatform;
- },
- /**
- * This method returns a canonical URL for the given URL.
- *
- * For example, the following all produce the same canonical URL (which is the
- * last one):
- *
- * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
- * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
- * http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
- * http://foo.com/bar/baz/zoo/../goo/Thing.js
- * http://foo.com/bar/baz/goo/Thing.js
- *
- * @private
- */
- canonicalUrl: function(url) {
- // *WARNING WARNING WARNING*
- // This method yields the most correct result we can get but it is EXPENSIVE!
- // In ALL browsers! When called multiple times in a sequence, as if when
- // we resolve dependencies for entries, it will cause garbage collection events
- // and overall painful slowness. This is why we try to avoid it as much as we can.
- //
- // @TODO - see if we need this fallback logic
- // http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
- resolverEl.href = url;
- var ret = resolverEl.href,
- dc = _config.disableCachingParam,
- pos = dc ? ret.indexOf(dc + '=') : -1,
- c, end;
- // If we have a _dc query parameter we need to remove it from the canonical
- // URL.
- if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
- end = ret.indexOf('&', pos);
- end = (end < 0) ? '' : ret.substring(end);
- if (end && c === '?') {
- ++pos;
- // keep the '?'
- end = end.substring(1);
- }
- // remove the '&'
- ret = ret.substring(0, pos - 1) + end;
- }
- return ret;
- },
- /**
- * Get the config value corresponding to the specified name. If no name is given, will return the config object
- * @param {String} name The config property name
- * @return {Object}
- */
- getConfig: function(name) {
- return name ? Boot.config[name] : Boot.config;
- },
- /**
- * Set the configuration.
- * @param {Object} config The config object to override the default values.
- * @return {Ext.Boot} this
- */
- setConfig: function(name, value) {
- if (typeof name === 'string') {
- Boot.config[name] = value;
- } else {
- for (var s in name) {
- Boot.setConfig(s, name[s]);
- }
- }
- return Boot;
- },
- getHead: function() {
- return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]);
- },
- create: function(url, key, cfg) {
- var config = cfg || {};
- config.url = url;
- config.key = key;
- return Boot.scripts[key] = new Entry(config);
- },
- getEntry: function(url, cfg, canonicalPath) {
- var key, entry;
- // Canonicalizing URLs via anchor element href yields the most correct result
- // but is *extremely* resource heavy so we need to avoid it whenever possible
- key = canonicalPath ? url : Boot.canonicalUrl(url);
- entry = Boot.scripts[key];
- if (!entry) {
- entry = Boot.create(url, key, cfg);
- if (canonicalPath) {
- entry.canonicalPath = true;
- }
- }
- return entry;
- },
- registerContent: function(url, type, content) {
- var cfg = {
- content: content,
- loaded: true,
- css: type === 'css'
- };
- return Boot.getEntry(url, cfg);
- },
- processRequest: function(request, sync) {
- request.loadEntries(sync);
- },
- load: function(request) {
- // _debug("Boot.load called");
- var request = new Request(request);
- if (request.sync || Boot.syncMode) {
- return Boot.loadSync(request);
- }
- // If there is a request in progress, we must
- // queue this new request to be fired when the current request completes.
- if (Boot.currentRequest) {
- // _debug("current active request, suspending this request");
- // trigger assignment of entries now to ensure that overlapping
- // entries with currently running requests will synchronize state
- // with this pending one as they complete
- request.getEntries();
- Boot.suspendedQueue.push(request);
- } else {
- Boot.currentRequest = request;
- Boot.processRequest(request, false);
- }
- return Boot;
- },
- loadSync: function(request) {
- // _debug("Boot.loadSync called");
- var request = new Request(request);
- Boot.syncMode++;
- Boot.processRequest(request, true);
- Boot.syncMode--;
- return Boot;
- },
- loadBasePrefix: function(request) {
- request = new Request(request);
- request.prependBaseUrl = true;
- return Boot.load(request);
- },
- loadSyncBasePrefix: function(request) {
- request = new Request(request);
- request.prependBaseUrl = true;
- return Boot.loadSync(request);
- },
- requestComplete: function(request) {
- var next;
- if (Boot.currentRequest === request) {
- Boot.currentRequest = null;
- while (Boot.suspendedQueue.length > 0) {
- next = Boot.suspendedQueue.shift();
- if (!next.done) {
- // _debug("resuming suspended request");
- Boot.load(next);
- break;
- }
- }
- }
- if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
- Boot.fireListeners();
- }
- },
- isLoading: function() {
- return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
- },
- fireListeners: function() {
- var listener;
- while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
- listener();
- }
- },
- onBootReady: function(listener) {
- if (!Boot.isLoading()) {
- listener();
- } else {
- Boot.listeners.push(listener);
- }
- },
- /**
- * this is a helper function used by Ext.Loader to flush out
- * 'uses' arrays for classes in some Ext versions
- */
- getPathsFromIndexes: function(indexMap, loadOrder) {
- // In older versions indexMap was an object instead of a sparse array
- if (!('length' in indexMap)) {
- var indexArray = [],
- index;
- for (index in indexMap) {
- if (!isNaN(+index)) {
- indexArray[+index] = indexMap[index];
- }
- }
- indexMap = indexArray;
- }
- return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
- },
- createLoadOrderMap: function(loadOrder) {
- return Request.prototype.createLoadOrderMap(loadOrder);
- },
- fetch: function(url, complete, scope, async) {
- async = (async === undefined) ? !!complete : async;
- var xhr = new XMLHttpRequest(),
- result, status, content,
- exception = false,
- readyStateChange = function() {
- if (xhr && xhr.readyState == 4) {
- status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
- content = xhr.responseText;
- result = {
- content: content,
- status: status,
- exception: exception
- };
- if (complete) {
- complete.call(scope, result);
- }
- xhr.onreadystatechange = emptyFn;
- xhr = null;
- }
- };
- if (async) {
- xhr.onreadystatechange = readyStateChange;
- }
- try {
- // _debug("fetching " + url + " " + (async ? "async" : "sync"));
- xhr.open('GET', url, async);
- xhr.send(null);
- } catch (err) {
- exception = err;
- readyStateChange();
- return result;
- }
- if (!async) {
- readyStateChange();
- }
- return result;
- },
- notifyAll: function(entry) {
- entry.notifyRequests();
- }
- };
- function Request(cfg) {
- //The request class encapsulates a series of Entry objects
- //and provides notification around the completion of all Entries
- //in this request.
- if (cfg.$isRequest) {
- return cfg;
- }
- var cfg = cfg.url ? cfg : {
- url: cfg
- },
- url = cfg.url,
- urls = url.charAt ? [
- url
- ] : url,
- charset = cfg.charset || Boot.config.charset;
- _apply(this, cfg);
- delete this.url;
- this.urls = urls;
- this.charset = charset;
- }
-
- Request.prototype = {
- $isRequest: true,
- createLoadOrderMap: function(loadOrder) {
- var len = loadOrder.length,
- loadOrderMap = {},
- i, element;
- for (i = 0; i < len; i++) {
- element = loadOrder[i];
- loadOrderMap[element.path] = element;
- }
- return loadOrderMap;
- },
- getLoadIndexes: function(item, indexMap, loadOrder, includeUses, skipLoaded) {
- var resolved = [],
- queue = [
- item
- ],
- itemIndex = item.idx,
- queue, entry, dependencies, depIndex, i, len;
- if (indexMap[itemIndex]) {
- // prevent cycles
- return resolved;
- }
- // Both indexMap and resolved are sparse arrays keyed by indexes.
- // This gives us a naturally sorted sequence of indexes later on
- // when we need to convert them to paths.
- // indexMap is the map of all indexes we have visited at least once
- // per the current expandUrls() invocation, and resolved is the map
- // of all dependencies for the current item that are not included
- // in indexMap.
- indexMap[itemIndex] = resolved[itemIndex] = true;
- while (item = queue.shift()) {
- // Canonicalizing URLs is expensive, we try to avoid it
- if (item.canonicalPath) {
- entry = Boot.getEntry(item.path, null, true);
- } else {
- entry = Boot.getEntry(this.prepareUrl(item.path));
- }
- if (!(skipLoaded && entry.done)) {
- if (includeUses && item.uses && item.uses.length) {
- dependencies = item.requires.concat(item.uses);
- } else {
- dependencies = item.requires;
- }
- for (i = 0 , len = dependencies.length; i < len; i++) {
- depIndex = dependencies[i];
- if (!indexMap[depIndex]) {
- indexMap[depIndex] = resolved[depIndex] = true;
- queue.push(loadOrder[depIndex]);
- }
- }
- }
- }
- return resolved;
- },
- getPathsFromIndexes: function(indexes, loadOrder) {
- var paths = [],
- index, len;
- // indexes is a sparse array with values being true for defined indexes
- for (index = 0 , len = indexes.length; index < len; index++) {
- if (indexes[index]) {
- paths.push(loadOrder[index].path);
- }
- }
- return paths;
- },
- expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
- var item, resolved;
- if (loadOrder) {
- item = loadOrderMap[url];
- if (item) {
- resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
- if (resolved.length) {
- return this.getPathsFromIndexes(resolved, loadOrder);
- }
- }
- }
- return [
- url
- ];
- },
- expandUrls: function(urls, includeUses) {
- var me = this,
- loadOrder = me.loadOrder,
- expanded = [],
- expandMap = {},
- indexMap = [],
- loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
- if (typeof urls === "string") {
- urls = [
- urls
- ];
- }
- if (loadOrder) {
- loadOrderMap = me.loadOrderMap;
- if (!loadOrderMap) {
- loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
- }
- }
- for (i = 0 , len = urls.length; i < len; i++) {
- // We don't want to skip loaded entries (last argument === false).
- // There are some overrides that get loaded before their respective classes,
- // and when the class dependencies are processed we don't want to skip over
- // the overrides' dependencies just because they were loaded first.
- tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
- for (t = 0 , tlen = tmpExpanded.length; t < tlen; t++) {
- tUrl = tmpExpanded[t];
- if (!expandMap[tUrl]) {
- expandMap[tUrl] = true;
- expanded.push(tUrl);
- }
- }
- }
- if (expanded.length === 0) {
- expanded = urls;
- }
- return expanded;
- },
- expandLoadOrder: function() {
- var me = this,
- urls = me.urls,
- expanded;
- if (!me.expanded) {
- expanded = this.expandUrls(urls, true);
- me.expanded = true;
- } else {
- expanded = urls;
- }
- me.urls = expanded;
- // if we added some urls to the request to honor the indicated
- // load order, the request needs to be sequential
- if (urls.length != expanded.length) {
- me.sequential = true;
- }
- return me;
- },
- getUrls: function() {
- this.expandLoadOrder();
- return this.urls;
- },
- prepareUrl: function(url) {
- if (this.prependBaseUrl) {
- return Boot.baseUrl + url;
- }
- return url;
- },
- getEntries: function() {
- var me = this,
- entries = me.entries,
- loadOrderMap, item, i, entry, urls, url;
- if (!entries) {
- entries = [];
- urls = me.getUrls();
- // If we have loadOrder array then the map will be expanded by now
- if (me.loadOrder) {
- loadOrderMap = me.loadOrderMap;
- }
- for (i = 0; i < urls.length; i++) {
- url = me.prepareUrl(urls[i]);
- if (loadOrderMap) {
- item = loadOrderMap[url];
- }
- entry = Boot.getEntry(url, {
- buster: me.buster,
- charset: me.charset
- }, item && item.canonicalPath);
- entry.requests.push(me);
- entries.push(entry);
- }
- me.entries = entries;
- }
- return entries;
- },
- loadEntries: function(sync) {
- var me = this,
- entries = me.getEntries(),
- len = entries.length,
- start = me.loadStart || 0,
- continueLoad, entries, entry, i;
- if (sync !== undefined) {
- me.sync = sync;
- }
- me.loaded = me.loaded || 0;
- me.loading = me.loading || len;
- for (i = start; i < len; i++) {
- entry = entries[i];
- if (!entry.loaded) {
- continueLoad = entries[i].load(me.sync);
- } else {
- continueLoad = true;
- }
- if (!continueLoad) {
- me.loadStart = i;
- entry.onDone(function() {
- me.loadEntries(sync);
- });
- break;
- }
- }
- me.processLoadedEntries();
- },
- processLoadedEntries: function() {
- var me = this,
- entries = me.getEntries(),
- len = entries.length,
- start = me.startIndex || 0,
- i, entry;
- if (!me.done) {
- for (i = start; i < len; i++) {
- entry = entries[i];
- if (!entry.loaded) {
- me.startIndex = i;
- return;
- }
- if (!entry.evaluated) {
- entry.evaluate();
- }
- if (entry.error) {
- me.error = true;
- }
- }
- me.notify();
- }
- },
- notify: function() {
- var me = this;
- if (!me.done) {
- var error = me.error,
- fn = me[error ? 'failure' : 'success'],
- delay = ('delay' in me) ? me.delay : (error ? 1 : Boot.config.chainDelay),
- scope = me.scope || me;
- me.done = true;
- if (fn) {
- if (delay === 0 || delay > 0) {
- // Free the stack (and defer the next script)
- setTimeout(function() {
- fn.call(scope, me);
- }, delay);
- } else {
- fn.call(scope, me);
- }
- }
- me.fireListeners();
- Boot.requestComplete(me);
- }
- },
- onDone: function(listener) {
- var me = this,
- listeners = me.listeners || (me.listeners = []);
- if (me.done) {
- listener(me);
- } else {
- listeners.push(listener);
- }
- },
- fireListeners: function() {
- var listeners = this.listeners,
- listener;
- if (listeners) {
- // _debug("firing request listeners");
- while ((listener = listeners.shift())) {
- listener(this);
- }
- }
- }
- };
- function Entry(cfg) {
- //The Entry class is a token to manage the load and evaluation
- //state of a particular url. It is used to notify all Requests
- //interested in this url that the content is available.
- if (cfg.$isEntry) {
- return cfg;
- }
- // _debug("creating entry for " + cfg.url);
- var charset = cfg.charset || Boot.config.charset,
- manifest = Ext.manifest,
- loader = manifest && manifest.loader,
- cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
- buster, busterParam;
- if (Boot.config.disableCaching) {
- if (cache === undefined) {
- cache = !Boot.config.disableCaching;
- }
- if (cache === false) {
- buster = +new Date();
- } else if (cache !== true) {
- buster = cache;
- }
- if (buster) {
- busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
- buster = busterParam + "=" + buster;
- }
- }
- _apply(this, cfg);
- this.charset = charset;
- this.buster = buster;
- this.requests = [];
- }
-
- Entry.prototype = {
- $isEntry: true,
- done: false,
- evaluated: false,
- loaded: false,
- isCrossDomain: function() {
- var me = this;
- if (me.crossDomain === undefined) {
- // _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
- me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
- }
- return me.crossDomain;
- },
- isCss: function() {
- var me = this;
- if (me.css === undefined) {
- if (me.url) {
- var assetConfig = Boot.assetConfig[me.url];
- me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
- } else {
- me.css = false;
- }
- }
- return this.css;
- },
- getElement: function(tag) {
- var me = this,
- el = me.el;
- if (!el) {
- // _debug("creating element for " + me.url);
- if (me.isCss()) {
- tag = tag || "link";
- el = doc.createElement(tag);
- if (tag == "link") {
- el.rel = 'stylesheet';
- me.prop = 'href';
- } else {
- me.prop = "textContent";
- }
- el.type = "text/css";
- } else {
- tag = tag || "script";
- el = doc.createElement(tag);
- el.type = 'text/javascript';
- me.prop = 'src';
- if (me.charset) {
- el.charset = me.charset;
- }
- if (Boot.hasAsync) {
- el.async = false;
- }
- }
- me.el = el;
- }
- return el;
- },
- getLoadUrl: function() {
- var me = this,
- url;
- url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
- if (!me.loadUrl) {
- me.loadUrl = !!me.buster ? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster) : url;
- }
- return me.loadUrl;
- },
- fetch: function(req) {
- var url = this.getLoadUrl(),
- async = !!req.async,
- complete = req.complete;
- Boot.fetch(url, complete, this, async);
- },
- onContentLoaded: function(response) {
- var me = this,
- status = response.status,
- content = response.content,
- exception = response.exception,
- url = this.getLoadUrl();
- me.loaded = true;
- if ((exception || status === 0) && !_environment.phantom) {
- me.error = ("Failed loading synchronously via XHR: '" + url + "'. It's likely that the file is either being loaded from a " + "different domain or from the local file system where cross " + "origin requests are not allowed for security reasons. Try " + "asynchronous loading instead.") || true;
- me.evaluated = true;
- } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0)) {
- me.content = content;
- } else {
- me.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true;
- me.evaluated = true;
- }
- },
- createLoadElement: function(callback) {
- var me = this,
- el = me.getElement();
- me.preserve = true;
- el.onerror = function() {
- me.error = true;
- if (callback) {
- callback();
- callback = null;
- }
- };
- if (Boot.isIE10m) {
- el.onreadystatechange = function() {
- if (this.readyState === 'loaded' || this.readyState === 'complete') {
- if (callback) {
- callback();
- callback = this.onreadystatechange = this.onerror = null;
- }
- }
- };
- } else {
- el.onload = function() {
- callback();
- callback = this.onload = this.onerror = null;
- };
- }
- // IE starts loading here
- el[me.prop] = me.getLoadUrl();
- },
- onLoadElementReady: function() {
- Boot.getHead().appendChild(this.getElement());
- this.evaluated = true;
- },
- inject: function(content, asset) {
- // _debug("injecting content for " + this.url);
- var me = this,
- head = Boot.getHead(),
- url = me.url,
- key = me.key,
- base, el, ieMode, basePath;
- if (me.isCss()) {
- me.preserve = true;
- basePath = key.substring(0, key.lastIndexOf("/") + 1);
- base = doc.createElement('base');
- base.href = basePath;
- if (head.firstChild) {
- head.insertBefore(base, head.firstChild);
- } else {
- head.appendChild(base);
- }
- // reset the href attribute to cuase IE to pick up the change
- base.href = base.href;
- if (url) {
- content += "\n/*# sourceURL=" + key + " */";
- }
- // create element after setting base
- el = me.getElement("style");
- ieMode = ('styleSheet' in el);
- head.appendChild(base);
- if (ieMode) {
- head.appendChild(el);
- el.styleSheet.cssText = content;
- } else {
- el.textContent = content;
- head.appendChild(el);
- }
- head.removeChild(base);
- } else {
- // Debugger friendly, file names are still shown even though they're
- // eval'ed code. Breakpoints work on both Firebug and Chrome's Web
- // Inspector.
- if (url) {
- content += "\n//# sourceURL=" + key;
- }
- Ext.globalEval(content);
- }
- return me;
- },
- loadCrossDomain: function() {
- var me = this,
- complete = function() {
- me.el.onerror = me.el.onload = emptyFn;
- me.el = null;
- me.loaded = me.evaluated = me.done = true;
- me.notifyRequests();
- };
- me.createLoadElement(function() {
- complete();
- });
- me.evaluateLoadElement();
- // at this point, we need sequential evaluation,
- // which means we can't advance the load until
- // this entry has fully completed
- return false;
- },
- loadElement: function() {
- var me = this,
- complete = function() {
- me.el.onerror = me.el.onload = emptyFn;
- me.el = null;
- me.loaded = me.evaluated = me.done = true;
- me.notifyRequests();
- };
- me.createLoadElement(function() {
- complete();
- });
- me.evaluateLoadElement();
- return true;
- },
- loadSync: function() {
- var me = this;
- me.fetch({
- async: false,
- complete: function(response) {
- me.onContentLoaded(response);
- }
- });
- me.evaluate();
- me.notifyRequests();
- },
- load: function(sync) {
- var me = this;
- if (!me.loaded) {
- if (me.loading) {
- // if we're calling back through load and we're loading but haven't
- // yet loaded, then we should be in a sequential, cross domain
- // load scenario which means we can't continue the load on the
- // request until this entry has fully evaluated, which will mean
- // loaded = evaluated = done = true in one step. For css files, this
- // will happen immediately upon <link> element creation / insertion,
- // but <script> elements will set this upon load notification
- return false;
- }
- me.loading = true;
- // for async modes, we have some options
- if (!sync) {
- // if cross domain, just inject the script tag and let the onload
- // events drive the progression.
- // IE10 also needs sequential loading because of a bug that makes it
- // fire readystate event prematurely:
- // https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
- if (Boot.isIE10 || me.isCrossDomain()) {
- return me.loadCrossDomain();
- }
- // for IE, use the readyStateChange allows us to load scripts in parallel
- // but serialize the evaluation by appending the script node to the
- // document
- else if (!me.isCss() && Boot.hasReadyState) {
- me.createLoadElement(function() {
- me.loaded = true;
- me.notifyRequests();
- });
- } else if (Boot.useElements && // older webkit, phantomjs included, won't fire load for link elements
- !(me.isCss() && _environment.phantom)) {
- return me.loadElement();
- } else // for other browsers, just ajax the content down in parallel, and use
- // globalEval to serialize evaluation
- {
- me.fetch({
- async: !sync,
- complete: function(response) {
- me.onContentLoaded(response);
- me.notifyRequests();
- }
- });
- }
- } else // for sync mode in js, global eval FTW. IE won't honor the comment
- // paths in the debugger, so eventually we need a sync mode for IE that
- // uses the readyStateChange mechanism
- {
- me.loadSync();
- }
- }
- // signal that the load process can continue
- return true;
- },
- evaluateContent: function() {
- this.inject(this.content);
- this.content = null;
- },
- evaluateLoadElement: function() {
- Boot.getHead().appendChild(this.getElement());
- },
- evaluate: function() {
- var me = this;
- if (!me.evaluated) {
- if (me.evaluating) {
- return;
- }
- me.evaluating = true;
- if (me.content !== undefined) {
- me.evaluateContent();
- } else if (!me.error) {
- me.evaluateLoadElement();
- }
- me.evaluated = me.done = true;
- me.cleanup();
- }
- },
- cleanup: function() {
- var me = this,
- el = me.el,
- prop;
- if (!el) {
- return;
- }
- if (!me.preserve) {
- me.el = null;
- el.parentNode.removeChild(el);
- // Remove, since its useless now
- for (prop in el) {
- try {
- if (prop !== me.prop) {
- // If we set the src property to null IE
- // will try and request a script at './null'
- el[prop] = null;
- }
- delete el[prop];
- } // and prepare for GC
- catch (cleanEx) {}
- }
- }
- //ignore
- // Setting to null can cause exceptions if IE ever needs to call these
- // again (like onreadystatechange). This emptyFn has nothing locked in
- // closure scope so it is about as safe as null for memory leaks.
- el.onload = el.onerror = el.onreadystatechange = emptyFn;
- },
- notifyRequests: function() {
- var requests = this.requests,
- len = requests.length,
- i, request;
- for (i = 0; i < len; i++) {
- request = requests[i];
- request.processLoadedEntries();
- }
- if (this.done) {
- this.fireListeners();
- }
- },
- onDone: function(listener) {
- var me = this,
- listeners = me.listeners || (me.listeners = []);
- if (me.done) {
- listener(me);
- } else {
- listeners.push(listener);
- }
- },
- fireListeners: function() {
- var listeners = this.listeners,
- listener;
- if (listeners && listeners.length > 0) {
- // _debug("firing event listeners for url " + this.url);
- while ((listener = listeners.shift())) {
- listener(this);
- }
- }
- }
- };
- /**
- * Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
- * dynamically loaded scripts have an extra query parameter appended to avoid stale
- * cached scripts. This method can be used to disable this mechanism, and is primarily
- * useful for testing. This is done using a cookie.
- * @param {Boolean} disable True to disable the cache buster.
- * @param {String} [path="/"] An optional path to scope the cookie.
- */
- Ext.disableCacheBuster = function(disable, path) {
- var date = new Date();
- date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
- date = date.toGMTString();
- doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
- };
- Boot.init();
- return Boot;
- }(// NOTE: We run the eval at global scope to protect the body of the function and allow
- // compressors to still process it.
- function() {}));
- //(eval("/*@cc_on!@*/!1"));
- /**
- * This method evaluates the given code free of any local variable. This
- * will be at global scope, in others it will be in a function.
- * @param {String} code The code to evaluate.
- * @private
- * @method
- * @member Ext
- */
- Ext.globalEval = Ext.globalEval || (this.execScript ? function(code) {
- execScript(code);
- } : function($$code) {
- eval.call(window, $$code);
- });
- /*
- * Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
- */
- if (!Function.prototype.bind) {
- (function() {
- var slice = Array.prototype.slice,
- // To reduce overhead on call of the bound fn we have two flavors based on
- // whether we have args to prepend or not:
- bind = function(me) {
- var args = slice.call(arguments, 1),
- method = this;
- if (args.length) {
- return function() {
- var t = arguments;
- // avoid the slice/concat if the caller does not supply args
- return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
- };
- }
- // this is the majority use case - just fn.bind(this) and no args
- args = null;
- return function() {
- return method.apply(me, arguments);
- };
- };
- Function.prototype.bind = bind;
- bind.$extjs = true;
- }());
- }
- // to detect this polyfill if one want to improve it
- //</editor-fold>
- Ext.setResourcePath = function(poolName, path) {
- var manifest = Ext.manifest || (Ext.manifest = {}),
- paths = manifest.resources || (manifest.resources = {});
- if (manifest) {
- if (typeof poolName !== 'string') {
- Ext.apply(paths, poolName);
- } else {
- paths[poolName] = path;
- }
- manifest.resources = paths;
- }
- };
- Ext.getResourcePath = function(path, poolName, packageName) {
- if (typeof path !== 'string') {
- poolName = path.pool;
- packageName = path.packageName;
- path = path.path;
- }
- var manifest = Ext.manifest,
- paths = manifest && manifest.resources,
- poolPath = paths[poolName],
- output = [];
- if (poolPath == null) {
- poolPath = paths.path;
- if (poolPath == null) {
- poolPath = 'resources';
- }
- }
- if (poolPath) {
- output.push(poolPath);
- }
- if (packageName) {
- output.push(packageName);
- }
- output.push(path);
- return output.join('/');
- };
- // @tag core
- /**
- * @class Ext
- *
- * The Ext namespace (global object) encapsulates all classes, singletons, and
- * utility methods provided by Sencha's libraries.
- *
- * Most user interface Components are at a lower level of nesting in the namespace,
- * but many common utility functions are provided as direct properties of the Ext namespace.
- *
- * Also many frequently used methods from other classes are provided as shortcuts
- * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
- * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
- *
- * Many applications are initiated with {@link Ext#application Ext.application} which is
- * called once the DOM is ready. This ensures all scripts have been loaded, preventing
- * dependency issues. For example:
- *
- * Ext.application({
- * name: 'MyApp',
- *
- * launch: function () {
- * Ext.Msg.alert(this.getName(), 'Ready to go!');
- * }
- * });
- *
- * <b><a href="http://www.sencha.com/products/sencha-cmd/">Sencha Cmd</a></b> is a free tool
- * for helping you generate and build Ext JS (and Sencha Touch) applications. See
- * `{@link Ext.app.Application Application}` for more information about creating an app.
- *
- * A lower-level technique that does not use the `Ext.app.Application` architecture is
- * {@link Ext#onReady Ext.onReady}.
- *
- * You can also discuss concepts and issues with others on the
- * <a href="http://www.sencha.com/forum/">Sencha Forums</a>.
- *
- * @singleton
- */
- var Ext = Ext || {};
- // @define Ext
- /* eslint indent: "off" */
- (function() {
- var global = this,
- objectPrototype = Object.prototype,
- toString = objectPrototype.toString,
- enumerables = [
- // 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
- 'valueOf',
- 'toLocaleString',
- 'toString',
- 'constructor'
- ],
- emptyFn = Ext.fireIdle = function() {},
- // see GlobalEvents for true fireIdle
- privateFn = function() {},
- identityFn = function(o) {
- return o;
- },
- // eslint-disable-line
- // This is the "$previous" method of a hook function on an instance. When called, it
- // calls through the class prototype by the name of the called method.
- callOverrideParent = function() {
- var method = callOverrideParent.caller.caller;
- // skip callParent (our caller)
- return method.$owner.prototype[method.$name].apply(this, arguments);
- },
- manifest = Ext.manifest || {},
- iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/,
- MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/,
- /* eslint-disable-next-line no-unused-vars */
- elevateArgs, elevateFn, elevateRet, elevateScope, i;
- Ext.global = global;
- Ext.$nextIid = 0;
- /**
- * Returns the current timestamp.
- * @return {Number} Milliseconds since UNIX epoch.
- * @method now
- * @member Ext
- */
- Ext.now = Date.now || (Date.now = function() {
- return +new Date();
- });
- /**
- * Returns the current high-resolution timestamp.
- * @return {Number} Milliseconds ellapsed since arbitrary epoch.
- * @method ticks
- * @member Ext
- * @since 6.0.1
- */
- Ext.ticks = (global.performance && global.performance.now) ? function() {
- return performance.now();
- } : Ext.now;
- Ext._startTime = Ext.ticks();
- // Mark these special fn's for easy identification:
- emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true;
- privateFn.$privacy = 'framework';
- // We also want to prevent these functions from being cleaned up on destroy
- emptyFn.$noClearOnDestroy = identityFn.$noClearOnDestroy = true;
- privateFn.$noClearOnDestroy = true;
- // These are emptyFn's in core and are redefined only in Ext JS (we use this syntax
- // so Cmd does not detect them):
- /* eslint-disable-next-line dot-notation */
- Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn;
- for (i in {
- toString: 1
- }) {
- enumerables = null;
- }
- /**
- * An array containing extra enumerables for old browsers
- * @property {String[]}
- */
- Ext.enumerables = enumerables;
- /**
- * Copies all the properties of `config` to the specified `object`. There are two levels
- * of defaulting supported:
- *
- * Ext.apply(obj, { a: 1 }, { a: 2 });
- * //obj.a === 1
- *
- * Ext.apply(obj, { }, { a: 2 });
- * //obj.a === 2
- *
- * Note that if recursive merging and cloning without referencing the original objects
- * or arrays is needed, use {@link Ext.Object#merge} instead.
- *
- * @param {Object} object The receiver of the properties.
- * @param {Object} config The primary source of the properties.
- * @param {Object} [defaults] An object that will also be applied for default values.
- * @return {Object} returns `object`.
- */
- Ext.apply = function(object, config, defaults) {
- var i, j, k;
- if (object) {
- if (defaults) {
- Ext.apply(object, defaults);
- }
- if (config && typeof config === 'object') {
- for (i in config) {
- object[i] = config[i];
- }
- if (enumerables) {
- for (j = enumerables.length; j--; ) {
- k = enumerables[j];
- if (config.hasOwnProperty(k)) {
- object[k] = config[k];
- }
- }
- }
- }
- }
- return object;
- };
- // Used by Ext.override
- function addInstanceOverrides(target, owner, overrides) {
- var name, value;
- for (name in overrides) {
- if (overrides.hasOwnProperty(name)) {
- value = overrides[name];
- if (typeof value === 'function') {
- if (owner.$className) {
- value.name = owner.$className + '#' + name;
- }
- value.$name = name;
- value.$owner = owner;
- value.$previous = target.hasOwnProperty(name) ? target[name] : // already hooked, so call previous hook
- callOverrideParent;
- }
- // calls by name on prototype
- target[name] = value;
- }
- }
- }
- Ext.buildSettings = Ext.apply({
- baseCSSPrefix: 'x-'
- }, Ext.buildSettings || {});
- Ext.apply(Ext, {
- /**
- * @private
- */
- idSeed: 0,
- /**
- * @private
- */
- idPrefix: 'ext-',
- /**
- * @private
- */
- isRobot: false,
- /**
- * @property {Boolean} isSecure
- * True if the page is running over SSL
- * @readonly
- */
- isSecure: /^https/i.test(window.location.protocol),
- /**
- * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
- * `false`, the application will be required to clean up orphaned Ext.Elements and
- * it's listeners as to not cause memory leakage.
- */
- enableGarbageCollector: false,
- /**
- * True to automatically purge event listeners during garbageCollection.
- */
- enableListenerCollection: true,
- /**
- * @property {String} [name='Ext']
- * The name of the property in the global namespace (The `window` in browser
- * environments) which refers to the current instance of Ext.
- * This is usually `"Ext"`, but if a sandboxed build of ExtJS is being used, this will be
- * an alternative name.
- * If code is being generated for use by `eval` or to create a `new Function`, and the
- * global instance of Ext must be referenced, this is the name that should be built
- * into the code.
- */
- name: Ext.sandboxName || 'Ext',
- /**
- * @property {Function}
- * A reusable empty function for use as `privates` members.
- *
- * Ext.define('MyClass', {
- * nothing: Ext.emptyFn,
- *
- * privates: {
- * privateNothing: Ext.privateFn
- * }
- * });
- *
- */
- privateFn: privateFn,
- /**
- * @property {Function}
- * A reusable empty function.
- */
- emptyFn: emptyFn,
- /**
- * @property {Function}
- * A reusable identity function that simply returns its first argument.
- */
- identityFn: identityFn,
- /**
- * This indicate the start timestamp of current cycle.
- * It is only reliable during dom-event-initiated cycles and
- * {@link Ext.draw.Animator} initiated cycles.
- */
- frameStartTime: Ext.now(),
- /**
- * This object is initialized prior to loading the framework
- * and contains settings and other information describing the application.
- *
- * For applications built using Sencha Cmd, this is produced from the `"app.json"`
- * file with information extracted from all of the required packages' `"package.json"`
- * files. This can be set to a string when your application is using the
- * (microloader)[#/guide/microloader]. In this case, the string of "foo" will be
- * requested as `"foo.json"` and the object in that JSON file will parsed and set
- * as this object.
- *
- * @cfg {String/Ext.Manifest} manifest
- * @since 5.0.0
- */
- manifest: manifest,
- /**
- * @cfg {Object} [debugConfig]
- * This object is used to enable or disable debugging for classes or namespaces. The
- * default instance looks like this:
- *
- * Ext.debugConfig = {
- * hooks: {
- * '*': true
- * }
- * };
- *
- * Typically applications will set this in their `"app.json"` like so:
- *
- * {
- * "debug": {
- * "hooks": {
- * // Default for all namespaces:
- * '*': true,
- *
- * // Except for Ext namespace which is disabled
- * 'Ext': false,
- *
- * // Except for Ext.layout namespace which is enabled
- * 'Ext.layout': true
- * }
- * }
- * }
- *
- * Alternatively, because this property is consumed very early in the load process of
- * the framework, this can be set in a `script` tag that is defined prior to loading
- * the framework itself.
- *
- * For example, to enable debugging for the `Ext.layout` namespace only:
- *
- * var Ext = Ext || {};
- * Ext.debugConfig = {
- * hooks: {
- * //...
- * }
- * };
- *
- * For any class declared, the longest matching namespace specified determines if its
- * `debugHooks` will be enabled. The default setting is specified by the '*' property.
- *
- * **NOTE:** This option only applies to debug builds. All debugging is disabled in
- * production builds.
- */
- debugConfig: Ext.debugConfig || manifest.debug || {
- hooks: {
- '*': true
- }
- },
- /**
- * @property {Boolean} [enableAria=true] This property is provided for backward
- * compatibility with previous versions of Ext JS. Accessibility is always enabled
- * in Ext JS 6.0+.
- *
- * This property is deprecated. To disable WAI-ARIA compatibility warnings,
- * override `Ext.ariaWarn` function in your application startup code:
- *
- * Ext.application({
- * launch: function() {
- * Ext.ariaWarn = Ext.emptyFn;
- * }
- * });
- *
- * For stricter compatibility with WAI-ARIA requirements, replace `Ext.ariaWarn`
- * with a function that will raise an error instead:
- *
- * Ext.application({
- * launch: function() {
- * Ext.ariaWarn = function(target, msg) {
- * Ext.raise({
- * msg: msg,
- * component: target
- * });
- * };
- * }
- * });
- *
- * @since 6.0.0
- * @deprecated 6.0.2 This property is no longer necessary, so no replacement is required.
- */
- enableAria: true,
- startsWithHashRe: /^#/,
- /**
- * @property {RegExp}
- * @private
- * Regular expression used for validating identifiers.
- */
- validIdRe: /^[a-z_][a-z0-9\-_]*$/i,
- /**
- * @property {String} BLANK_IMAGE_URL
- * URL to a 1x1 transparent gif image used by Ext to create inline icons with
- * CSS background images.
- */
- /* eslint-disable-next-line max-len */
- BLANK_IMAGE_URL: 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
- /**
- * Converts an id (`'foo'`) into an id selector (`'#foo'`). This method is used
- * internally by the framework whenever an id needs to be converted into a selector
- * and is provided as a hook for those that need to escape IDs selectors since,
- * as of Ext 5.0, the framework no longer escapes IDs by default.
- * @private
- * @param {String} id
- * @return {String}
- */
- makeIdSelector: function(id) {
- if (!Ext.validIdRe.test(id)) {
- Ext.raise('Invalid id selector: "' + id + '"');
- }
- return '#' + id;
- },
- /**
- * Generates unique ids. If the object/element is passes and it already has an `id`, it is
- * unchanged.
- * @param {Object} [o] The object to generate an id for.
- * @param {String} [prefix=ext-gen] (optional) The `id` prefix.
- * @return {String} The generated `id`.
- */
- id: function(o, prefix) {
- if (o && o.id) {
- return o.id;
- }
- /* eslint-disable-next-line vars-on-top */
- var id = (prefix || Ext.idPrefix) + (++Ext.idSeed);
- if (o) {
- o.id = id;
- }
- return id;
- },
- /**
- * A reusable function which returns the value of `getId()` called upon a single passed
- * parameter. Useful when creating a {@link Ext.util.MixedCollection} of objects keyed
- * by an identifier returned from a `getId` method.
- */
- returnId: function(o) {
- return o.getId();
- },
- /**
- * A reusable function which returns `true`.
- */
- returnTrue: function() {
- return true;
- },
- /**
- * A zero length string which will pass a truth test. Useful for passing to methods
- * which use a truth test to reject <i>falsy</i> values where a string value must be
- * cleared.
- */
- emptyString: new String(),
- /**
- * An immutable empty array if Object.freeze is supported by the browser
- * @since 6.5.0
- * @private
- */
- emptyArray: Object.freeze ? Object.freeze([]) : [],
- /**
- * @property {String} [baseCSSPrefix='x-']
- * The base prefix to use for all `Ext` components. To configure this property, you should
- * use the Ext.buildSettings object before the framework is loaded:
- *
- * Ext.buildSettings = {
- * baseCSSPrefix : 'abc-'
- * };
- *
- * or you can change it before any components are rendered:
- *
- * Ext.baseCSSPrefix = Ext.buildSettings.baseCSSPrefix = 'abc-';
- *
- * This will change what CSS classes components will use and you should
- * then recompile the SASS changing the `$prefix` SASS variable to match.
- */
- baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
- /**
- * @property {Object} $eventNameMap
- * A map of event names which contained the lower-cased versions of any mixed
- * case event names.
- * @private
- */
- $eventNameMap: {},
- // Vendor-specific events do not work if lower-cased. This regex specifies event
- // prefixes for names that should NOT be lower-cased by Ext.canonicalEventName()
- $vendorEventRe: /^(DOMMouse|Moz.+|MS.+|webkit.+)/,
- // TODO: inlinable function - SDKTOOLS-686
- /**
- * @private
- */
- canonicalEventName: function(name) {
- return Ext.$eventNameMap[name] || (Ext.$eventNameMap[name] = (Ext.$vendorEventRe.test(name) ? name : name.toLowerCase()));
- },
- /**
- * Copies all the properties of config to object if they don't already exist.
- * @param {Object} object The receiver of the properties
- * @param {Object} config The source of the properties
- * @return {Object} returns obj
- */
- applyIf: function(object, config) {
- var property;
- if (object && config && typeof config === 'object') {
- for (property in config) {
- if (object[property] === undefined) {
- object[property] = config[property];
- }
- }
- }
- return object;
- },
- /**
- * Destroys all of the given objects. If arrays are passed, the elements of these
- * are destroyed recursively.
- *
- * What it means to "destroy" an object depends on the type of object.
- *
- * * `Array`: Each element of the array is destroyed recursively.
- * * `Object`: Any object with a `destroy` method will have that method called.
- *
- * @param {Mixed...} args Any number of objects or arrays.
- */
- destroy: function() {
- var ln = arguments.length,
- i, arg;
- for (i = 0; i < ln; i++) {
- arg = arguments[i];
- if (arg) {
- if (Ext.isArray(arg)) {
- this.destroy.apply(this, arg);
- } else if (Ext.isFunction(arg.destroy) && !arg.destroyed) {
- arg.destroy();
- }
- }
- }
- return null;
- },
- /**
- * Destroys the specified named members of the given object using `Ext.destroy`. These
- * properties will be set to `null`.
- * @param {Object} object The object who's properties you wish to destroy.
- * @param {String...} args One or more names of the properties to destroy and remove from
- * the object.
- */
- destroyMembers: function(object) {
- /* eslint-disable-next-line vars-on-top */
- for (var ref, name,
- i = 1,
- a = arguments,
- len = a.length; i < len; i++) {
- ref = object[name = a[i]];
- // Avoid adding the property if it does not already exist
- if (ref != null) {
- object[name] = Ext.destroy(ref);
- }
- }
- },
- /**
- * Overrides members of the specified `target` with the given values.
- *
- * If the `target` is a class declared using {@link Ext#define Ext.define}, the
- * `override` method of that class is called (see {@link Ext.Base#override}) given
- * the `overrides`.
- *
- * If the `target` is a function, it is assumed to be a constructor and the contents
- * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
- *
- * If the `target` is an instance of a class declared using {@link Ext#define Ext.define},
- * the `overrides` are applied to only that instance. In this case, methods are
- * specially processed to allow them to use {@link Ext.Base#method!callParent}.
- *
- * var panel = new Ext.Panel({ ... });
- *
- * Ext.override(panel, {
- * initComponent: function () {
- * // extra processing...
- *
- * this.callParent();
- * }
- * });
- *
- * If the `target` is none of these, the `overrides` are applied to the `target`
- * using {@link Ext#apply Ext.apply}.
- *
- * Please refer to {@link Ext#define Ext.define} and {@link Ext.Base#override} for
- * further details.
- *
- * @param {Object} target The target to override.
- * @param {Object} overrides The properties to add or replace on `target`.
- * @method override
- */
- override: function(target, overrides) {
- if (target.$isClass) {
- target.override(overrides);
- } else if (typeof target === 'function') {
- Ext.apply(target.prototype, overrides);
- } else {
- /* eslint-disable-next-line vars-on-top */
- var owner = target.self,
- privates;
- if (owner && owner.$isClass) {
- // if (instance of Ext.define'd class)
- privates = overrides.privates;
- if (privates) {
- overrides = Ext.apply({}, overrides);
- delete overrides.privates;
- addInstanceOverrides(target, owner, privates);
- }
- addInstanceOverrides(target, owner, overrides);
- } else {
- Ext.apply(target, overrides);
- }
- }
- return target;
- },
- /**
- * Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty};
- * returns the default value (second argument) otherwise.
- *
- * @param {Object} value The value to test.
- * @param {Object} defaultValue The value to return if the original value is empty.
- * @param {Boolean} [allowBlank=false] `true` to allow zero length strings to qualify
- * as non-empty.
- * @return {Object} value, if non-empty, else defaultValue.
- */
- valueFrom: function(value, defaultValue, allowBlank) {
- return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
- },
- /**
- * Returns true if the passed value is empty, false otherwise. The value is deemed to be
- * empty if it is either:
- *
- * - `null`
- * - `undefined`
- * - a zero-length array
- * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`)
- *
- * @param {Object} value The value to test.
- * @param {Boolean} [allowEmptyString=false] `true` to allow empty strings.
- * @return {Boolean}
- */
- isEmpty: function(value, allowEmptyString) {
- return (value == null) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
- },
- /**
- * Returns `true` if the passed value is a JavaScript Array, `false` otherwise.
- *
- * @param {Object} target The target to test.
- * @return {Boolean}
- * @method
- */
- isArray: ('isArray' in Array) ? Array.isArray : function(value) {
- return toString.call(value) === '[object Array]';
- },
- /**
- * Returns `true` if the passed value is a JavaScript Date object, `false` otherwise.
- * @param {Object} obj The object to test.
- * @return {Boolean}
- */
- isDate: function(obj) {
- return toString.call(obj) === '[object Date]';
- },
- /**
- * Returns 'true' if the passed value is a String that matches the MS Date JSON
- * encoding format.
- * @param {String} value The string to test.
- * @return {Boolean}
- */
- isMSDate: function(value) {
- if (!Ext.isString(value)) {
- return false;
- }
- return MSDateRe.test(value);
- },
- /**
- * Returns `true` if the passed value is a JavaScript Object, `false` otherwise.
- * @param {Object} value The value to test.
- * @return {Boolean}
- * @method
- */
- isObject: (toString.call(null) === '[object Object]') ? function(value) {
- // check ownerDocument here as well to exclude DOM nodes
- return value != null && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
- } : function(value) {
- return toString.call(value) === '[object Object]';
- },
- /**
- * @private
- */
- isSimpleObject: function(value) {
- return value instanceof Object && value.constructor === Object;
- },
- /**
- * Returns `true` if the passed value is a JavaScript 'primitive', a string, number
- * or boolean.
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isPrimitive: function(value) {
- var type = typeof value;
- return type === 'string' || type === 'number' || type === 'boolean';
- },
- /**
- * Returns `true` if the passed value is a JavaScript Function, `false` otherwise.
- * @param {Object} value The value to test.
- * @return {Boolean}
- * @method
- */
- isFunction: // Safari 3.x and 4.x returns 'function' for typeof <NodeList>, hence we need to fall back
- // to using Object.prototype.toString (slower)
- (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
- return !!value && toString.call(value) === '[object Function]';
- } : function(value) {
- return !!value && typeof value === 'function';
- },
- /**
- * Returns `true` if the passed value is a number. Returns `false` for non-finite numbers.
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isNumber: function(value) {
- return typeof value === 'number' && isFinite(value);
- },
- /**
- * Validates that a value is numeric.
- * @param {Object} value Examples: 1, '1', '2.34'
- * @return {Boolean} True if numeric, false otherwise
- */
- isNumeric: function(value) {
- return !isNaN(parseFloat(value)) && isFinite(value);
- },
- /**
- * Returns `true `if the passed value is a string.
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isString: function(value) {
- return typeof value === 'string';
- },
- /**
- * Returns `true` if the passed value is a boolean.
- *
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isBoolean: function(value) {
- return typeof value === 'boolean';
- },
- /**
- * Returns `true` if the passed value is an HTMLElement
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isElement: function(value) {
- return value ? value.nodeType === 1 : false;
- },
- /**
- * Returns `true` if the passed value is a TextNode
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isTextNode: function(value) {
- return value ? value.nodeName === "#text" : false;
- },
- /**
- * Returns `true` if the passed value is defined.
- * @param {Object} value The value to test.
- * @return {Boolean}
- */
- isDefined: function(value) {
- return typeof value !== 'undefined';
- },
- /**
- * Returns `true` if the passed value is iterable, that is, if elements of it are
- * addressable using array notation with numeric indices, `false` otherwise.
- *
- * Arrays and function `arguments` objects are iterable. Also HTML collections such as
- * `NodeList` and `HTMLCollection' are iterable.
- *
- * @param {Object} value The value to test
- * @return {Boolean}
- */
- isIterable: function(value) {
- // To be iterable, the object must have a numeric length property and must not be
- // a string or function.
- if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) {
- return false;
- }
- // Certain "standard" collections in IE (such as document.images) do not offer
- // the correct Javascript Object interface; specifically, they lack the
- // propertyIsEnumerable method.
- // And the item property while it does exist is not typeof "function"
- if (!value.propertyIsEnumerable) {
- return !!value.item;
- }
- // If it is a regular, interrogatable JS object (not an IE ActiveX object), then...
- // If it has its own property called "length", but not enumerable, it's iterable
- if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) {
- return true;
- }
- // Test against whitelist which includes known iterable collection types
- return iterableRe.test(toString.call(value));
- },
- /**
- * This method returns `true` if debug is enabled for the specified class. This is
- * done by checking the `Ext.debugConfig.hooks` config for the closest match to the
- * given `className`.
- * @param {String} className The name of the class.
- * @return {Boolean} `true` if debug is enabled for the specified class.
- * @method
- */
- isDebugEnabled: function(className, defaultEnabled) {
- var debugConfig = Ext.debugConfig.hooks;
- if (debugConfig.hasOwnProperty(className)) {
- return debugConfig[className];
- }
- /* eslint-disable-next-line vars-on-top */
- var enabled = debugConfig['*'],
- prefixLength = 0;
- if (defaultEnabled !== undefined) {
- enabled = defaultEnabled;
- }
- if (!className) {
- return enabled;
- }
- /* eslint-disable-next-line vars-on-top */
- for (var prefix in debugConfig) {
- var value = debugConfig[prefix];
- // eslint-disable-line vars-on-top
- // if prefix=='Ext' match 'Ext.foo.Bar' but not 'Ext4.foo.Bar'
- if (className.charAt(prefix.length) === '.') {
- if (className.substring(0, prefix.length) === prefix) {
- if (prefixLength < prefix.length) {
- prefixLength = prefix.length;
- enabled = value;
- }
- }
- }
- }
- return enabled;
- } || emptyFn,
- /**
- * Clone simple variables including array, {}-like objects, DOM nodes and Date without
- * keeping the old reference. A reference for the object itself is returned if it's not
- * a direct descendant of Object. For model cloning, see
- * {@link Ext.data.Model#copy Model.copy}.
- *
- * @param {Object} item The variable to clone
- * @param {Boolean} [cloneDom=true] `true` to clone DOM nodes.
- * @return {Object} clone
- */
- clone: function(item, cloneDom) {
- if (item == null) {
- return item;
- }
- // DOM nodes
- // TODO proxy this to Ext.Element.clone to handle automatic id attribute changing
- // recursively
- if (cloneDom !== false && item.nodeType && item.cloneNode) {
- return item.cloneNode(true);
- }
- /* eslint-disable-next-line vars-on-top */
- var type = toString.call(item),
- i, j, k, clone, key;
- // Date
- if (type === '[object Date]') {
- return new Date(item.getTime());
- }
- // Array
- if (type === '[object Array]') {
- i = item.length;
- clone = [];
- while (i--) {
- clone[i] = Ext.clone(item[i], cloneDom);
- }
- }
- // Object
- else if (type === '[object Object]' && item.constructor === Object) {
- clone = {};
- for (key in item) {
- clone[key] = Ext.clone(item[key], cloneDom);
- }
- if (enumerables) {
- for (j = enumerables.length; j--; ) {
- k = enumerables[j];
- if (item.hasOwnProperty(k)) {
- clone[k] = item[k];
- }
- }
- }
- }
- return clone || item;
- },
- /**
- * @private
- * Generate a unique reference of Ext in the global scope, useful for sandboxing
- */
- getUniqueGlobalNamespace: function() {
- var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
- i;
- if (uniqueGlobalNamespace === undefined) {
- i = 0;
- do {
- uniqueGlobalNamespace = 'ExtBox' + (++i);
- } while (global[uniqueGlobalNamespace] !== undefined);
- global[uniqueGlobalNamespace] = Ext;
- this.uniqueGlobalNamespace = uniqueGlobalNamespace;
- }
- return uniqueGlobalNamespace;
- },
- /**
- * @private
- */
- functionFactoryCache: {},
- cacheableFunctionFactory: function() {
- var me = this,
- args = Array.prototype.slice.call(arguments),
- cache = me.functionFactoryCache,
- idx, fn, ln;
- if (Ext.isSandboxed) {
- ln = args.length;
- if (ln > 0) {
- ln--;
- args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
- }
- }
- idx = args.join('');
- fn = cache[idx];
- if (!fn) {
- fn = Function.prototype.constructor.apply(Function.prototype, args);
- cache[idx] = fn;
- }
- return fn;
- },
- functionFactory: function() {
- var args = Array.prototype.slice.call(arguments),
- ln;
- if (Ext.isSandboxed) {
- ln = args.length;
- if (ln > 0) {
- ln--;
- args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
- }
- }
- return Function.prototype.constructor.apply(Function.prototype, args);
- },
- /**
- * @private
- */
- Logger: {
- log: function(message, priority) {
- if (message && global.console) {
- if (!priority || !(priority in global.console)) {
- priority = 'log';
- }
- message = '[' + priority.toUpperCase() + '] ' + message;
- global.console[priority](message);
- }
- },
- verbose: function(message) {
- this.log(message, 'verbose');
- },
- info: function(message) {
- this.log(message, 'info');
- },
- warn: function(message) {
- this.log(message, 'warn');
- },
- error: function(message) {
- throw new Error(message);
- },
- deprecate: function(message) {
- this.log(message, 'warn');
- }
- } || {
- verbose: emptyFn,
- log: emptyFn,
- info: emptyFn,
- warn: emptyFn,
- error: function(message) {
- throw new Error(message);
- },
- deprecate: emptyFn
- },
- ariaWarn: function(target, msg) {
- // The checks still can be disabled by setting Ext.enableAria to false;
- // this is for backwards compatibility. Also make sure we're not running
- // under the slicer, warnings are pointless in that case.
- if (Ext.enableAria && !Ext.slicer) {
- if (!Ext.ariaWarn.first) {
- Ext.ariaWarn.first = true;
- Ext.log.warn("WAI-ARIA compatibility warnings can be suppressed " + "by adding the following to application startup code:");
- Ext.log.warn(" Ext.ariaWarn = Ext.emptyFn;");
- }
- Ext.log.warn({
- msg: msg,
- dump: target
- });
- }
- },
- /**
- * @private
- */
- getElementById: function(id) {
- return document.getElementById(id);
- },
- /**
- * @member Ext
- * @private
- */
- splitAndUnescape: (function() {
- var cache = {};
- return function(origin, delimiter) {
- if (!origin) {
- return [];
- } else if (!delimiter) {
- return [
- origin
- ];
- }
- /* eslint-disable-next-line vars-on-top, max-len */
- var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')),
- result = [],
- parts, part;
- parts = origin.split(delimiter);
- while ((part = parts.shift()) !== undefined) {
- // If any of the parts ends with the delimiter that means
- // the delimiter was escaped and the split was invalid. Roll back.
- while (part.charAt(part.length - 1) === '\\' && parts.length > 0) {
- part = part + delimiter + parts.shift();
- }
- // Now that we have split the parts, unescape the delimiter char
- part = part.replace(replaceRe, delimiter);
- result.push(part);
- }
- return result;
- };
- })(),
- /**
- * This is the target of the user-supplied `Ext.elevateFunction`. It wraps the
- * call to a function and concludes by calling {@link Ext#fireIdle}.
- * @since 6.5.1
- * @private
- */
- doElevate: function() {
- var fn = elevateFn,
- args = elevateArgs,
- scope = elevateScope;
- // We really should never re-enter here, but we'll latch these vars just
- // in case.
- elevateFn = elevateArgs = elevateScope = null;
- elevateRet = args ? fn.apply(scope, args) : fn.call(scope);
- // Be sure to fire the idle event while elevated or its handlers will
- // be running in an unprivileged context.
- Ext.fireIdle();
- },
- /**
- * Runs the given `fn` directly or using the user-provided `Ext.elevateFunction`
- * (if present). After calling the `fn` the global `idle` event is fired using
- * the {@link Ext#fireIdle} method.
- *
- * @param {Function} fn
- * @param {Object} [scope]
- * @param {Array} [args]
- * @param {Object} [timer]
- * @return {Mixed}
- * @since 6.5.1
- * @private
- */
- elevate: function(fn, scope, args, timer) // eslint-disable-line comma-style
- {
- var ret;
- if (args && !args.length) {
- args = null;
- }
- Ext._suppressIdle = false;
- if (timer) {
- timer.tick();
- }
- if (Ext.elevateFunction) {
- elevateFn = fn;
- elevateScope = scope;
- elevateArgs = args;
- // We reuse the same fn here to avoid GC pressure.
- Ext.elevateFunction(Ext.doElevate);
- ret = elevateRet;
- elevateRet = null;
- } else {
- ret = args ? fn.apply(scope, args) : fn.call(scope);
- Ext.fireIdle();
- }
- if (timer) {
- timer.tock();
- }
- return ret;
- },
- Timer: {
- all: {},
- track: false,
- captureStack: true,
- created: function(kind, id, info) {
- if (!Ext.Timer.track) {
- return null;
- }
- /* eslint-disable-next-line vars-on-top */
- var timer = Ext.apply({
- kind: kind,
- id: id,
- done: false,
- firing: false,
- creator: Ext.Timer.captureStack ? new Error().stack : null,
- tick: Ext.Timer.tick,
- tock: Ext.Timer.tock
- }, info);
- /* eslint-disable-next-line vars-on-top, one-var */
- var timers = Ext.Timer.all[kind] || (Ext.Timer.all[kind] = {});
- timers[timer.id] = timer;
- if (Ext.Timer.hook) {
- Ext.Timer.hook(timer);
- }
- return timer;
- },
- get: function(id, kind) {
- kind = kind || 'timeout';
- /* eslint-disable-next-line vars-on-top */
- var timers = Ext.Timer.all[kind];
- return timers && timers[id] || null;
- },
- cancel: function(kind, id) {
- var timers = Ext.Timer.all[kind],
- timer = timers && timers[id];
- if (timer) {
- timer.cancelled = true;
- timers[id] = null;
- delete timers[id];
- }
- },
- tick: function() {
- if (Ext.Timer.firing) {
- // One reason for Ext.Timer.firing to get stuck is exception thrown
- // in timer handler. In that case the timer is never tock()ed
- // and will be left hanging. Just clean it up.
- Ext.log.error('Previous timer state not cleaned up properly: ' + Ext.Timer.firing.creator);
- }
- if (this.kind !== 'interval') {
- this.done = true;
- Ext.Timer.all[this.kind][this.id] = null;
- delete Ext.Timer.all[this.kind][this.id];
- }
- this.firing = true;
- Ext.Timer.firing = this;
- },
- tock: function() {
- this.firing = false;
- if (Ext.Timer.firing === this) {
- Ext.Timer.firing = null;
- }
- }
- },
- /**
- * @private
- */
- getExpando: function(target, id) {
- var expandos = target.$expandos;
- return expandos && expandos[id] || null;
- },
- /**
- * @private
- */
- setExpando: function(target, id, value) {
- var expandos = target.$expandos;
- if (value !== undefined) {
- (expandos || (target.$expandos = {}))[id] = value;
- } else if (expandos) {
- delete expandos[id];
- }
- return value;
- }
- });
- Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true;
- }());
- // @override Ext
- // This file is order extremely early (typically right after Ext.js) due to the
- // above Cmd directive. This ensures that the "modern" and "classic" platform tags
- // are properly set up as soon as possible.
- Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
- /* eslint-disable max-len */
- /**
- * A helper class for the native JavaScript Error object that adds a few useful capabilities for handling
- * errors in an application. When you use Ext.Error to {@link #raise} an error from within any class that
- * uses the Class System, the Error class can automatically add the source class and method from which
- * the error was raised. It also includes logic to automatically log the error to the console, if available,
- * with additional metadata about the error. In all cases, the error will always be thrown at the end so that
- * execution will halt.
- *
- * Ext.Error also offers a global error {@link #handle handling} method that can be overridden in order to
- * handle application-wide errors in a single spot. You can optionally {@link #ignore} errors altogether,
- * although in a real application it's usually a better idea to override the handling function and perform
- * logging or some other method of reporting the errors in a way that is meaningful to the application.
- *
- * At its simplest you can simply raise an error as a simple string from within any code:
- *
- * Example usage:
- *
- * Ext.raise('Something bad happened!');
- *
- * If raised from plain JavaScript code, the error will be logged to the console (if available) and the message
- * displayed. In most cases however you'll be raising errors from within a class, and it may often be useful to add
- * additional metadata about the error being raised. The {@link #raise} method can also take a config object.
- * In this form the `msg` attribute becomes the error description, and any other data added to the config gets
- * added to the error object and, if the console is available, logged to the console for inspection.
- *
- * Example usage:
- *
- * Ext.define('Ext.Foo', {
- * doSomething: function(option){
- * if (someCondition === false) {
- * Ext.raise({
- * msg: 'You cannot do that!',
- * option: option, // whatever was passed into the method
- * 'error code': 100 // other arbitrary info
- * });
- * }
- * }
- * });
- *
- * If a console is available (that supports the `console.dir` function) you'll see console output like:
- *
- * An error was raised with the following data:
- * option: Object { foo: "bar"}
- * foo: "bar"
- * error code: 100
- * msg: "You cannot do that!"
- * sourceClass: "Ext.Foo"
- * sourceMethod: "doSomething"
- *
- * uncaught exception: You cannot do that!
- *
- * As you can see, the error will report exactly where it was raised and will include as much information as the
- * raising code can usefully provide.
- *
- * If you want to handle all application errors globally you can simply override the static {@link #handle} method
- * and provide whatever handling logic you need. If the method returns true then the error is considered handled
- * and will not be thrown to the browser. If anything but true is returned then the error will be thrown normally.
- *
- * Example usage:
- *
- * Ext.Error.handle = function(err) {
- * if (err.someProperty == 'NotReallyAnError') {
- * // maybe log something to the application here if applicable
- * return true;
- * }
- * // any non-true return value (including none) will cause the error to be thrown
- * }
- *
- * @class Ext.Error
- */
- /* eslint-enable max-len */
- /* eslint-disable indent */
- (function() {
- // @define Ext.lang.Error
- // @define Ext.Error
- // @require Ext
- function toString() {
- var me = this,
- cls = me.sourceClass,
- method = me.sourceMethod,
- msg = me.msg;
- if (method) {
- if (msg) {
- method += '(): ';
- method += msg;
- } else {
- method += '()';
- }
- }
- if (cls) {
- method = method ? (cls + '.' + method) : cls;
- }
- return method || msg || '';
- }
- Ext.Error = function(config) {
- var error = new Error();
- if (Ext.isString(config)) {
- config = {
- msg: config
- };
- }
- Ext.apply(error, config);
- error.message = error.message || error.msg;
- // 'message' is standard ('msg' is non-standard)
- // note: the above does not work in old WebKit (me.message is readonly) (Safari 4)
- error.toString = toString;
- return error;
- };
- Ext.apply(Ext.Error, {
- /**
- * @property {Boolean} ignore
- * Static flag that can be used to globally disable error reporting to the browser if set
- * to true (defaults to false). Note that if you ignore Ext errors it's likely that some
- * other code may fail and throw a native JavaScript error thereafter, so use with caution.
- * In most cases it will probably be preferable to supply a custom error
- * {@link #handle handling} function instead.
- *
- * Example usage:
- *
- * Ext.Error.ignore = true;
- *
- * @static
- */
- ignore: false,
- /**
- * This method is called internally by {@link Ext#raise}. Application code should
- * call {@link Ext#raise} instead of calling this method directly.
- *
- * @static
- * @deprecated 6.0.0 Use {@link Ext#raise} instead.
- */
- raise: function(err) {
- var me = this,
- method = me.raise.caller,
- msg, name;
- err = err || {};
- if (Ext.isString(err)) {
- err = {
- msg: err
- };
- }
- if (method === Ext.raise) {
- method = method.caller;
- }
- if (method) {
- if (!err.sourceMethod && (name = method.$name)) {
- err.sourceMethod = name;
- }
- if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) {
- err.sourceClass = name;
- }
- }
- if (me.handle(err) !== true) {
- msg = toString.call(err);
- Ext.log({
- msg: msg,
- level: 'error',
- dump: err,
- stack: true
- });
- throw new Ext.Error(err);
- }
- },
- /**
- * Globally handle any Ext errors that may be raised, optionally providing custom logic
- * to handle different errors individually. Return true from the function to bypass
- * throwing the error to the browser, otherwise the error will be thrown and execution
- * will halt.
- *
- * Example usage:
- *
- * Ext.Error.handle = function(err) {
- * if (err.someProperty == 'NotReallyAnError') {
- * // maybe log something to the application here if applicable
- * return true;
- * }
- * // any non-true return value (including none) will cause the error to be thrown
- * }
- *
- * @param {Object} err The error being raised. It will contain any attributes that were
- * originally raised with it, plus properties about the method and class from which
- * the error originated (if raised from a class that uses the Class System).
- * @static
- */
- handle: function() {
- return this.ignore;
- }
- });
- })();
- /**
- * Create a function that will throw an error if called (in debug mode) with a message that
- * indicates the method has been removed.
- * @param {String} suggestion Optional text to include in the message (a workaround perhaps).
- * @return {Function} The generated function.
- * @private
- */
- Ext.deprecated = function(suggestion) {
- if (!suggestion) {
- suggestion = '';
- }
- function fail() {
- Ext.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion);
- }
- return fail;
- return Ext.emptyFn;
- };
- // eslint-disable-line no-unreachable
- /**
- * Raise an error that can include additional data and supports automatic console logging
- * if available. You can pass a string error message or an object with the `msg` attribute
- * which will be used as the error message. The object can contain any other name-value
- * attributes (or objects) to be logged along with the error.
- *
- * Note that after displaying the error message a JavaScript error will ultimately be
- * thrown so that execution will halt.
- *
- * Example usage:
- *
- * Ext.raise('A simple string error message');
- *
- * // or...
- *
- * Ext.define('Ext.Foo', {
- * doSomething: function(option){
- * if (someCondition === false) {
- * Ext.raise({
- * msg: 'You cannot do that!',
- * option: option, // whatever was passed into the method
- * code: 100 // other arbitrary info
- * });
- * }
- * }
- * });
- *
- * @param {String/Object} err The error message string, or an object containing the
- * attribute "msg" that will be used as the error message. Any other data included in the
- * object will also be logged to the browser console, if available.
- * @method raise
- * @member Ext
- */
- Ext.raise = function() {
- Ext.Error.raise.apply(Ext.Error, arguments);
- };
- /*
- * This mechanism is used to notify the user of the first error encountered on the page. In
- * most cases errors go unobserved especially on IE. This mechanism pushes this information
- * to the status bar so that users don't miss it.
- */
- (function(skipNotify) {
- if (skipNotify || typeof window === 'undefined') {
- return;
- }
- // build system or some such environment...
- // eslint-disable-next-line vars-on-top
- var last = 0,
- // This method is called to notify the user of the current error status.
- notify = function() {
- var cnt = Ext.log && Ext.log.counters,
- n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log),
- msg;
- // Put log counters to the status bar (for most browsers):
- if (n && last !== n) {
- msg = [];
- if (cnt.error) {
- msg.push('Errors: ' + cnt.error);
- }
- if (cnt.warn) {
- msg.push('Warnings: ' + cnt.warn);
- }
- if (cnt.info) {
- msg.push('Info: ' + cnt.info);
- }
- if (cnt.log) {
- msg.push('Log: ' + cnt.log);
- }
- window.status = '*** ' + msg.join(' -- ');
- last = n;
- }
- };
- // Allow unit tests to skip this when checking for dangling timers
- notify.$skipTimerCheck = true;
- // window.onerror sounds ideal but it prevents the built-in error dialog from doing
- // its (better) thing. We deliberately use setInterval() here instead of going with
- // Ext.interval() to keep it basic and simple.
- setInterval(notify, 1000);
- }(!!window.__UNIT_TESTING__));
- /**
- * @class Ext.Array
- * @singleton
- *
- * A set of useful static methods to deal with arrays; provide missing methods for
- * older browsers.
- */
- Ext.Array = (function() {
- /* eslint-disable indent */
- // @define Ext.lang.Array
- // @define Ext.Array
- // @require Ext
- // @require Ext.lang.Error
- var arrayPrototype = Array.prototype,
- slice = arrayPrototype.slice,
- supportsSplice = (function() {
- var array = [],
- lengthBefore,
- j = 20;
- if (!array.splice) {
- return false;
- }
- // This detects a bug in IE8 splice method:
- // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/
- // 6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
- while (j--) {
- array.push("A");
- }
- array.splice(15, 0, "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F");
- lengthBefore = array.length;
- // 41
- array.splice(13, 0, "XXX");
- // add one element
- if (lengthBefore + 1 !== array.length) {
- return false;
- }
- // end IE8 bug
- return true;
- }()),
- supportsIndexOf = 'indexOf' in arrayPrototype,
- supportsSliceOnNodeList = true;
- // Sort an array using the comparator, but if the comparator returns zero, use the objects'
- // original indices to tiebreak This results in a stable sort.
- function stableSort(array, userComparator) {
- var len = array.length,
- indices = new Array(len),
- i;
- // generate 0-n index map from original array
- for (i = 0; i < len; i++) {
- indices[i] = i;
- }
- // Sort indices array using a comparator which compares the original values at the two
- // indices, and uses those indices as a tiebreaker
- indices.sort(function(index1, index2) {
- return userComparator(array[index1], array[index2]) || (index1 - index2);
- });
- // Reconsitute a sorted array using the array that the indices have been sorted into
- for (i = 0; i < len; i++) {
- indices[i] = array[indices[i]];
- }
- // Rebuild the original array
- for (i = 0; i < len; i++) {
- array[i] = indices[i];
- }
- return array;
- }
- try {
- // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
- if (typeof document !== 'undefined') {
- slice.call(document.getElementsByTagName('body'));
- }
- } catch (e) {
- supportsSliceOnNodeList = false;
- }
- /* eslint-disable-next-line vars-on-top */
- var fixArrayIndex = function(array, index) {
- return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index);
- },
- /*
- Does the same work as splice, but with a slightly more convenient signature. The splice
- method has bugs in IE8, so this is the implementation we use on that platform.
- The rippling of items in the array can be tricky. Consider two use cases:
- index=2
- removeCount=2
- /=====\
- +---+---+---+---+---+---+---+---+
- | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
- +---+---+---+---+---+---+---+---+
- / \/ \/ \/ \
- / /\ /\ /\ \
- / / \/ \/ \ +--------------------------+
- / / /\ /\ +--------------------------+ \
- / / / \/ +--------------------------+ \ \
- / / / /+--------------------------+ \ \ \
- / / / / \ \ \ \
- v v v v v v v v
- +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
- | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
- +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
- A B \=========/
- insert=[a,b,c]
- In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
- that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
- must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
- */
- replaceSim = function(array, index, removeCount, insert) {
- var add = insert ? insert.length : 0,
- length = array.length,
- pos = fixArrayIndex(array, index);
- // we try to use Array.push when we can for efficiency...
- if (pos === length) {
- if (add) {
- array.push.apply(array, insert);
- }
- } else {
- /* eslint-disable-next-line vars-on-top */
- var remove = Math.min(removeCount, length - pos),
- tailOldPos = pos + remove,
- tailNewPos = tailOldPos + add - remove,
- tailCount = length - tailOldPos,
- lengthAfterRemove = length - remove,
- i;
- if (tailNewPos < tailOldPos) {
- // case A
- for (i = 0; i < tailCount; ++i) {
- array[tailNewPos + i] = array[tailOldPos + i];
- }
- } else if (tailNewPos > tailOldPos) {
- // case B
- for (i = tailCount; i--; ) {
- array[tailNewPos + i] = array[tailOldPos + i];
- }
- }
- // else, add == remove (nothing to do)
- if (add && pos === lengthAfterRemove) {
- array.length = lengthAfterRemove;
- // truncate array
- array.push.apply(array, insert);
- } else {
- array.length = lengthAfterRemove + add;
- // reserves space
- for (i = 0; i < add; ++i) {
- array[pos + i] = insert[i];
- }
- }
- }
- return array;
- },
- replaceNative = function(array, index, removeCount, insert) {
- if (insert && insert.length) {
- // Inserting at index zero with no removing: use unshift
- if (index === 0 && !removeCount) {
- array.unshift.apply(array, insert);
- }
- // Inserting/replacing in middle of array
- else if (index < array.length) {
- array.splice.apply(array, [
- index,
- removeCount
- ].concat(insert));
- } else // Appending to array
- {
- array.push.apply(array, insert);
- }
- } else {
- array.splice(index, removeCount);
- }
- return array;
- },
- eraseSim = function(array, index, removeCount) {
- return replaceSim(array, index, removeCount);
- },
- eraseNative = function(array, index, removeCount) {
- array.splice(index, removeCount);
- return array;
- },
- spliceSim = function(array, index, removeCount) {
- var len = arguments.length,
- pos = fixArrayIndex(array, index),
- removed;
- if (len < 3) {
- removeCount = array.length - pos;
- }
- removed = array.slice(index, fixArrayIndex(array, pos + removeCount));
- if (len < 4) {
- replaceSim(array, pos, removeCount);
- } else {
- replaceSim(array, pos, removeCount, slice.call(arguments, 3));
- }
- return removed;
- },
- spliceNative = function(array) {
- return array.splice.apply(array, slice.call(arguments, 1));
- },
- erase = supportsSplice ? eraseNative : eraseSim,
- replace = supportsSplice ? replaceNative : replaceSim,
- splice = supportsSplice ? spliceNative : spliceSim,
- // NOTE: from here on, use erase, replace or splice (not native methods)...
- ExtArray = {
- /**
- * This method returns the index that a given item would be inserted into the
- * given (sorted) `array`. Note that the given `item` may or may not be in the
- * array. This method will return the index of where the item *should* be.
- *
- * For example:
- *
- * var array = [ 'A', 'D', 'G', 'K', 'O', 'R', 'X' ];
- * var index = Ext.Array.binarySearch(array, 'E');
- *
- * console.log('index: ' + index);
- * // logs "index: 2"
- *
- * array.splice(index, 0, 'E');
- *
- * console.log('array : ' + array.join(''));
- * // logs "array: ADEGKORX"
- *
- * @param {Object[]} array The array to search.
- * @param {Object} item The item that you want to insert into the `array`.
- * @param {Number} [begin=0] The first index in the `array` to consider.
- * @param {Number} [end=array.length] The index that marks the end of the range
- * to consider. The item at this index is *not* considered.
- * @param {Function} [compareFn] The comparison function that matches the sort
- * order of the `array`. The default `compareFn` compares items using less-than
- * and greater-than operators.
- * @return {Number} The index for the given item in the given array based on
- * the current sorters.
- */
- binarySearch: function(array, item, begin, end, compareFn) {
- var length = array.length,
- middle, comparison;
- if (begin instanceof Function) {
- compareFn = begin;
- begin = 0;
- end = length;
- } else if (end instanceof Function) {
- compareFn = end;
- end = length;
- } else {
- if (begin === undefined) {
- begin = 0;
- }
- if (end === undefined) {
- end = length;
- }
- compareFn = compareFn || ExtArray.lexicalCompare;
- }
- --end;
- while (begin <= end) {
- middle = (begin + end) >> 1;
- comparison = compareFn(item, array[middle]);
- if (comparison >= 0) {
- begin = middle + 1;
- } else if (comparison < 0) {
- end = middle - 1;
- }
- }
- return begin;
- },
- defaultCompare: function(lhs, rhs) {
- return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
- },
- // Default comparator to use when no comparator is specified for the sort method.
- // Javascript sort does LEXICAL comparison.
- lexicalCompare: function(lhs, rhs) {
- lhs = String(lhs);
- rhs = String(rhs);
- return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
- },
- /**
- * Iterates an array or an iterable value and invoke the given callback function for each
- * item.
- *
- * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
- *
- * Ext.Array.each(countries, function(name, index, countriesItSelf) {
- * console.log(name);
- * });
- *
- * var sum = function() {
- * var sum = 0;
- *
- * Ext.Array.each(arguments, function(value) {
- * sum += value;
- * });
- *
- * return sum;
- * };
- *
- * sum(1, 2, 3); // returns 6
- *
- * The iteration can be stopped by returning `false` from the callback function.
- * Returning `undefined` (i.e `return;`) will only exit the callback function and
- * proceed with the next iteration of the loop.
- *
- * Ext.Array.each(countries, function(name, index, countriesItSelf) {
- * if (name === 'Singapore') {
- * return false; // break here
- * }
- * });
- *
- * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
- *
- * @param {Array/NodeList/Object} array The value to be iterated. If this
- * argument is not iterable, the callback function is called once.
- * @param {Function} fn The callback function. If it returns `false`, the iteration
- * stops and this method returns the current `index`. Returning `undefined` (i.e
- * `return;`) will only exit the callback function and proceed with the next iteration
- * in the loop.
- * @param {Object} fn.item The item at the current `index` in the passed `array`
- * @param {Number} fn.index The current `index` within the `array`
- * @param {Array} fn.allItems The `array` itself which was passed as the first argument
- * @param {Boolean} fn.return Return `false` to stop iteration.
- * @param {Object} [scope] The scope (`this` reference) in which the specified function is
- * executed.
- * @param {Boolean} [reverse=false] Reverse the iteration order (loop from the end to the
- * beginning).
- * @return {Boolean/Number} If all array entries were iterated, this will be `true. If
- * iteration was halted early because the passed fuction returned `false`, this will
- * be the index at which iteration was halted.
- */
- each: function(array, fn, scope, reverse) {
- var i, ln;
- array = ExtArray.from(array);
- ln = array.length;
- if (reverse !== true) {
- for (i = 0; i < ln; i++) {
- if (fn.call(scope || array[i], array[i], i, array) === false) {
- return i;
- }
- }
- } else {
- for (i = ln - 1; i > -1; i--) {
- if (fn.call(scope || array[i], array[i], i, array) === false) {
- return i;
- }
- }
- }
- return true;
- },
- /*
- * Calculates the the insertion index of a passed object into the passed Array according
- * to the passed comparator function. Note that the passed Array *MUST* already be ordered.
- * @param {Object} item The item to calculate the insertion index for.
- * @param {Array} The array into which the item is to be inserted.
- * @param {Function} comparatorFn The comparison function. Must return -1 or 0 or 1.
- * @param {Object} comparatorFn.lhs The left object to compare.
- * @param {Object} comparatorFn.rhs The right object to compare.
- * @param {Number} index The possible correct index to try first before a binary
- * search is instigated.
- */
- findInsertionIndex: function(item, items, comparatorFn, index) {
- var len = items.length,
- beforeCheck, afterCheck;
- comparatorFn = comparatorFn || ExtArray.lexicalCompare;
- if (0 <= index && index < len) {
- beforeCheck = index > 0 ? comparatorFn(item, items[index - 1]) : 0;
- afterCheck = (index < len) ? comparatorFn(item, items[index]) : 0;
- if (0 <= beforeCheck && afterCheck < 1) {
- return index;
- }
- }
- return ExtArray.binarySearch(items, item, comparatorFn);
- },
- /**
- * @method
- * Iterates an array and invoke the given callback function for each item. Note that this
- * will simply delegate to the native `Array.prototype.forEach` method if supported. It
- * doesn't support stopping the iteration by returning `false` in the callback function
- * like {@link Ext.Array#each}. However, performance could be much better in modern
- * browsers comparing with {@link Ext.Array#each}
- *
- * @param {Array} array The array to iterate.
- * @param {Function} fn The callback function.
- * @param {Object} fn.item The item at the current `index` in the passed `array`.
- * @param {Number} fn.index The current `index` within the `array`.
- * @param {Array} fn.allItems The `array` itself which was passed as the first argument.
- * @param {Object} scope (Optional) The execution scope (`this`) in which the
- * specified function is executed.
- */
- forEach: ('forEach' in arrayPrototype) ? function(array, fn, scope) {
- array.forEach(fn, scope);
- } : function(array, fn, scope) {
- var i, ln;
- for (i = 0 , ln = array.length; i < ln; i++) {
- fn.call(scope, array[i], i, array);
- }
- },
- /**
- * @method
- * Get the index of the provided `item` in the given `array`, a supplement for the
- * missing arrayPrototype.indexOf in Internet Explorer.
- *
- * @param {Array} array The array to check.
- * @param {Object} item The item to find.
- * @param {Number} from (Optional) The index at which to begin the search.
- * @return {Number} The index of item in the array (or -1 if it is not found).
- */
- indexOf: supportsIndexOf ? function(array, item, from) {
- // May be called with no array which causes an error.
- return array ? arrayPrototype.indexOf.call(array, item, from) : -1;
- } : function(array, item, from) {
- var i,
- length = array ? array.length : 0;
- for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
- if (array[i] === item) {
- return i;
- }
- }
- return -1;
- },
- /**
- * @method
- * Checks whether or not the given `array` contains the specified `item`.
- *
- * @param {Array} array The array to check.
- * @param {Object} item The item to find.
- * @return {Boolean} `true` if the array contains the item, `false` otherwise.
- */
- contains: supportsIndexOf ? function(array, item) {
- return arrayPrototype.indexOf.call(array, item) !== -1;
- } : function(array, item) {
- var i, ln;
- for (i = 0 , ln = array.length; i < ln; i++) {
- if (array[i] === item) {
- return true;
- }
- }
- return false;
- },
- /**
- * Converts any iterable (numeric indices and a length property) into a true array.
- *
- * function test() {
- * var args = Ext.Array.toArray(arguments),
- * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
- *
- * alert(args.join(' '));
- * alert(fromSecondToLastArgs.join(' '));
- * }
- *
- * test('just', 'testing', 'here'); // alerts 'just testing here';
- * // alerts 'testing here';
- *
- * // will convert the NodeList into an array
- * Ext.Array.toArray(document.getElementsByTagName('div'));
- * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
- * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
- *
- * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
- *
- * @param {Object} iterable the iterable object to be turned into a true Array.
- * @param {Number} [start=0] a zero-based index that specifies the start of extraction.
- * @param {Number} [end=-1] a 1-based index that specifies the end of extraction.
- * @return {Array}
- */
- toArray: function(iterable, start, end) {
- var array = [],
- i;
- if (!iterable || !iterable.length) {
- return array;
- }
- if (typeof iterable === 'string') {
- iterable = iterable.split('');
- }
- if (supportsSliceOnNodeList) {
- return slice.call(iterable, start || 0, end || iterable.length);
- }
- start = start || 0;
- end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
- for (i = start; i < end; i++) {
- array.push(iterable[i]);
- }
- return array;
- },
- /**
- * Plucks the value of a property from each item in the Array. Example:
- *
- * // [el1.className, el2.className, ..., elN.className]
- * Ext.Array.pluck(Ext.query("p"), "className");
- *
- * @param {Array/NodeList} array The Array of items to pluck the value from.
- * @param {String} propertyName The property name to pluck from each element.
- * @return {Array} The value from each item in the Array.
- */
- pluck: function(array, propertyName) {
- var ret = [],
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- ret.push(item[propertyName]);
- }
- return ret;
- },
- /**
- * @method
- * Creates a new array with the results of calling a provided function on every element
- * in this array.
- *
- * @param {Array} array
- * @param {Function} fn Callback function for each item.
- * @param {Mixed} fn.item Current item.
- * @param {Number} fn.index Index of the item.
- * @param {Array} fn.array The whole array that's being iterated.
- * @param {Object} [scope] Callback function scope
- * @return {Array} results
- */
- map: ('map' in arrayPrototype) ? function(array, fn, scope) {
- Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
- return array.map(fn, scope);
- } : function(array, fn, scope) {
- Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
- /* eslint-disable-next-line vars-on-top */
- var len = array.length,
- results = new Array(len),
- i;
- for (i = 0; i < len; i++) {
- results[i] = fn.call(scope, array[i], i, array);
- }
- return results;
- },
- /**
- * @method
- * Executes the specified function for each array element until the function returns
- * a falsy value. If such an item is found, the function will return `false` immediately.
- * Otherwise, it will return `true`.
- *
- * @param {Array} array
- * @param {Function} fn Callback function for each item.
- * @param {Mixed} fn.item Current item.
- * @param {Number} fn.index Index of the item.
- * @param {Array} fn.array The whole array that's being iterated.
- * @param {Object} scope Callback function scope.
- * @return {Boolean} `true` if no false value is returned by the callback function.
- */
- every: ('every' in arrayPrototype) ? function(array, fn, scope) {
- Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
- return array.every(fn, scope);
- } : function(array, fn, scope) {
- var i, ln;
- Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
- for (i = 0 , ln = array.length; i < ln; ++i) {
- if (!fn.call(scope, array[i], i, array)) {
- return false;
- }
- }
- return true;
- },
- /**
- * @method
- * Executes the specified function for each array element until the function returns
- * a truthy value. If such an item is found, the function will return `true` immediately.
- * Otherwise, it will return `false`.
- *
- * @param {Array} array
- * @param {Function} fn Callback function for each item.
- * @param {Mixed} fn.item Current item.
- * @param {Number} fn.index Index of the item.
- * @param {Array} fn.array The whole array that's being iterated.
- * @param {Object} scope Callback function scope.
- * @return {Boolean} `true` if the callback function returns a truthy value.
- */
- some: ('some' in arrayPrototype) ? function(array, fn, scope) {
- Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
- return array.some(fn, scope);
- } : function(array, fn, scope) {
- var i, ln;
- Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
- for (i = 0 , ln = array.length; i < ln; ++i) {
- if (fn.call(scope, array[i], i, array)) {
- return true;
- }
- }
- return false;
- },
- /**
- * Shallow compares the contents of 2 arrays using strict equality.
- * @param {Array} array1
- * @param {Array} array2
- * @return {Boolean} `true` if the arrays are equal.
- */
- equals: function(array1, array2) {
- var len1 = array1.length,
- len2 = array2.length,
- i;
- // Short circuit if the same array is passed twice
- if (array1 === array2) {
- return true;
- }
- if (len1 !== len2) {
- return false;
- }
- for (i = 0; i < len1; ++i) {
- if (array1[i] !== array2[i]) {
- return false;
- }
- }
- return true;
- },
- /**
- * Filter through an array and remove empty item as defined in
- * {@link Ext#isEmpty Ext.isEmpty}.
- *
- * See {@link Ext.Array#filter}
- *
- * @param {Array} array
- * @return {Array} results
- */
- clean: function(array) {
- var results = [],
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- if (!Ext.isEmpty(item)) {
- results.push(item);
- }
- }
- return results;
- },
- /**
- * Returns a new array with unique items.
- *
- * @param {Array} array
- * @return {Array} results
- */
- unique: function(array) {
- var clone = [],
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- if (ExtArray.indexOf(clone, item) === -1) {
- clone.push(item);
- }
- }
- return clone;
- },
- /**
- * @method
- * Creates a new array with all of the elements of this array for which
- * the provided filtering function returns a truthy value.
- *
- * @param {Array} array
- * @param {Function} fn Callback function for each item.
- * @param {Mixed} fn.item Current item.
- * @param {Number} fn.index Index of the item.
- * @param {Array} fn.array The whole array that's being iterated.
- * @param {Object} scope Callback function scope.
- * @return {Array} results
- */
- filter: ('filter' in arrayPrototype) ? function(array, fn, scope) {
- Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
- return array.filter(fn, scope);
- } : function(array, fn, scope) {
- var results = [],
- i, ln;
- Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
- for (i = 0 , ln = array.length; i < ln; i++) {
- if (fn.call(scope, array[i], i, array)) {
- results.push(array[i]);
- }
- }
- return results;
- },
- /**
- * Returns the first item in the array which elicits a truthy return value from the
- * passed selection function.
- * @param {Array} array The array to search
- * @param {Function} fn The selection function to execute for each item.
- * @param {Mixed} fn.item The array item.
- * @param {Number} fn.index The index of the array item.
- * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
- * function is executed. Defaults to the array
- * @return {Object} The first item in the array which returned true from the selection
- * function, or null if none was found.
- */
- findBy: function(array, fn, scope) {
- var i, len;
- for (i = 0 , len = array.length; i < len; i++) {
- if (fn.call(scope || array, array[i], i)) {
- return array[i];
- }
- }
- return null;
- },
- /**
- * Converts a value to an array if it's not already an array; returns:
- *
- * - An empty array if given value is `undefined` or `null`
- * - Itself if given value is already an array
- * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList
- * and alike)
- * - An array with one item which is the given value, otherwise
- *
- * @param {Object} value The value to convert to an array if it's not already is an array.
- * @param {Boolean} [newReference] `true` to clone the given array and return a new
- * reference if necessary.
- * @return {Array} array
- */
- from: function(value, newReference) {
- var type;
- if (value === undefined || value === null) {
- return [];
- }
- if (Ext.isArray(value)) {
- return (newReference) ? slice.call(value) : value;
- }
- type = typeof value;
- // Both strings and functions will have a length property. In phantomJS, NodeList
- // instances report typeof=='function' but don't have an apply method...
- if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
- return ExtArray.toArray(value);
- }
- return [
- value
- ];
- },
- /**
- * Removes the specified item from the array if it exists.
- *
- * @param {Array} array The array.
- * @param {Object} item The item to remove.
- * @return {Array} The passed array.
- */
- remove: function(array, item) {
- var index = ExtArray.indexOf(array, item);
- if (index !== -1) {
- erase(array, index, 1);
- }
- return array;
- },
- /**
- * Removes item/s at the specified index.
- *
- * @param {Array} array The array.
- * @param {Number} index The index of the item to be removed.
- * @param {Number} [count=1] The number of items to be removed.
- * @return {Array} The passed array.
- */
- removeAt: function(array, index, count) {
- var len = array.length;
- if (index >= 0 && index < len) {
- count = count || 1;
- count = Math.min(count, len - index);
- erase(array, index, count);
- }
- return array;
- },
- /**
- * Push an item into the array only if the array doesn't contain it yet.
- *
- * @param {Array} array The array.
- * @param {Object} item The item to include.
- */
- include: function(array, item) {
- if (!ExtArray.contains(array, item)) {
- array.push(item);
- }
- },
- /**
- * Clone a flat array without referencing the previous one. Note that this is different
- * from `Ext.clone` since it doesn't handle recursive cloning. It's simply a convenient,
- * easy-to-remember method for `Array.prototype.slice.call(array)`.
- *
- * @param {Array} array The array.
- * @return {Array} The clone array.
- */
- clone: function(array) {
- return slice.call(array);
- },
- /**
- * Merge multiple arrays into one with unique items.
- *
- * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
- *
- * @param {Array} array1
- * @param {Array} array2
- * @param {Array} etc
- * @return {Array} merged
- */
- merge: function() {
- var args = slice.call(arguments),
- array = [],
- i, ln;
- for (i = 0 , ln = args.length; i < ln; i++) {
- array = array.concat(args[i]);
- }
- return ExtArray.unique(array);
- },
- /**
- * Merge multiple arrays into one with unique items that exist in all of the arrays.
- *
- * @param {Array} array1
- * @param {Array} array2
- * @param {Array} etc
- * @return {Array} intersect
- */
- intersect: function() {
- var intersection = [],
- arrays = slice.call(arguments),
- arraysLength, array, arrayLength, minArray, minArrayIndex, minArrayCandidate, minArrayLength, element, elementCandidate, elementCount, i, j, k;
- if (!arrays.length) {
- return intersection;
- }
- // Find the smallest array
- arraysLength = arrays.length;
- for (i = minArrayIndex = 0; i < arraysLength; i++) {
- minArrayCandidate = arrays[i];
- if (!minArray || minArrayCandidate.length < minArray.length) {
- minArray = minArrayCandidate;
- minArrayIndex = i;
- }
- }
- minArray = ExtArray.unique(minArray);
- erase(arrays, minArrayIndex, 1);
- // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
- // an item in the small array, we're likely to find it before reaching the end
- // of the inner loop and can terminate the search early.
- minArrayLength = minArray.length;
- arraysLength = arrays.length;
- for (i = 0; i < minArrayLength; i++) {
- element = minArray[i];
- elementCount = 0;
- for (j = 0; j < arraysLength; j++) {
- array = arrays[j];
- arrayLength = array.length;
- for (k = 0; k < arrayLength; k++) {
- elementCandidate = array[k];
- if (element === elementCandidate) {
- elementCount++;
- break;
- }
- }
- }
- if (elementCount === arraysLength) {
- intersection.push(element);
- }
- }
- return intersection;
- },
- /**
- * Perform a set difference A-B by subtracting all items in array B from array A.
- *
- * @param {Array} arrayA
- * @param {Array} arrayB
- * @return {Array} difference
- */
- difference: function(arrayA, arrayB) {
- var clone = slice.call(arrayA),
- ln = clone.length,
- i, j, lnB;
- for (i = 0 , lnB = arrayB.length; i < lnB; i++) {
- for (j = 0; j < ln; j++) {
- if (clone[j] === arrayB[i]) {
- erase(clone, j, 1);
- j--;
- ln--;
- }
- }
- }
- return clone;
- },
- /**
- * This method applies the `reduceFn` function against an accumulator and each
- * value of the `array` (from left-to-right) to reduce it to a single value.
- *
- * If no `initialValue` is specified, the first element of the array is used as
- * the initial value. For example:
- *
- * function reducer (previous, value, index) {
- * console.log('[' + index + ']: (' + previous + ',' + value + '}');
- * return previous * 10 + value;
- * }
- *
- * v = Ext.Array.reduce([2, 3, 4], reducer);
- * console.log('v = ' + v);
- *
- * > [1]: (2, 3)
- * > [2]: (23, 4)
- * > v = 234
- *
- * v = Ext.Array.reduce([2, 3, 4], reducer, 1);
- * console.log('v = ' + v);
- *
- * > [0]: (1, 2)
- * > [1]: (12, 3)
- * > [2]: (123, 4)
- * > v = 1234
- *
- * @param {Array} array The array to process.
- * @param {Function} reduceFn The reducing callback function.
- * @param {Mixed} reduceFn.previous The previous value.
- * @param {Mixed} reduceFn.value The current value.
- * @param {Number} reduceFn.index The index in the array of the current `value`.
- * @param {Array} reduceFn.array The array to being processed.
- * @param {Mixed} [initialValue] The starting value.
- * @return {Mixed} The reduced value.
- * @method reduce
- * @since 6.0.0
- */
- reduce: Array.prototype.reduce ? function(array, reduceFn, initialValue) {
- if (arguments.length === 3) {
- return Array.prototype.reduce.call(array, reduceFn, initialValue);
- }
- return Array.prototype.reduce.call(array, reduceFn);
- } : function(array, reduceFn, initialValue) {
- array = Object(array);
- if (!Ext.isFunction(reduceFn)) {
- Ext.raise('Invalid parameter: expected a function.');
- }
- /* eslint-disable-next-line vars-on-top */
- var index = 0,
- length = array.length >>> 0,
- reduced = initialValue;
- if (arguments.length < 3) {
- while (true) {
- // eslint-disable-line no-constant-condition
- if (index in array) {
- reduced = array[index++];
- break;
- }
- if (++index >= length) {
- throw new TypeError('Reduce of empty array with no initial value');
- }
- }
- }
- for (; index < length; ++index) {
- if (index in array) {
- reduced = reduceFn(reduced, array[index], index, array);
- }
- }
- return reduced;
- },
- /**
- * Returns a shallow copy of a part of an array. This is equivalent to the native
- * call `Array.prototype.slice.call(array, begin, end)`. This is often used when "array"
- * is "arguments" since the arguments object does not supply a slice method but can
- * be the context object to `Array.prototype.slice`.
- *
- * @param {Array} array The array (or arguments object).
- * @param {Number} begin The index at which to begin. Negative values are offsets from
- * the end of the array.
- * @param {Number} end The index at which to end. The copied items do not include
- * end. Negative values are offsets from the end of the array. If end is omitted,
- * all items up to the end of the array are copied.
- * @return {Array} The copied piece of the array.
- * @method slice
- */
- // Note: IE8 will return [] on slice.call(x, undefined).
- slice: ([
- 1,
- 2
- ].slice(1, undefined).length ? function(array, begin, end) {
- return slice.call(array, begin, end);
- } : function(array, begin, end) {
- // see http://jsperf.com/slice-fix
- if (typeof begin === 'undefined') {
- return slice.call(array);
- }
- if (typeof end === 'undefined') {
- return slice.call(array, begin);
- }
- return slice.call(array, begin, end);
- }),
- /**
- * Sorts the elements of an Array in a stable manner (equivalently keyed values do not move
- * relative to each other). By default, this method sorts the elements alphabetically and
- * ascending.
- * **Note:** This method modifies the passed array, in the same manner as the
- * native javascript Array.sort.
- *
- * @param {Array} array The array to sort.
- * @param {Function} [sortFn] The comparison function.
- * @param {Mixed} sortFn.a The first item to compare.
- * @param {Mixed} sortFn.b The second item to compare.
- * @param {Number} sortFn.return `-1` if a < b, `1` if a > b, otherwise `0`.
- * @return {Array} The sorted array.
- */
- sort: function(array, sortFn) {
- return stableSort(array, sortFn || ExtArray.lexicalCompare);
- },
- /**
- * Recursively flattens into 1-d Array. Injects Arrays inline.
- *
- * @param {Array} array The array to flatten
- * @return {Array} The 1-d array.
- */
- flatten: function(array) {
- var worker = [];
- function rFlatten(a) {
- var i, ln, v;
- for (i = 0 , ln = a.length; i < ln; i++) {
- v = a[i];
- if (Ext.isArray(v)) {
- rFlatten(v);
- } else {
- worker.push(v);
- }
- }
- return worker;
- }
- return rFlatten(array);
- },
- /**
- * Returns the minimum value in the Array.
- *
- * @param {Array/NodeList} array The Array from which to select the minimum value.
- * @param {Function} comparisonFn (optional) a function to perform the comparison which
- * determines minimization.
- * If omitted the "<" operator will be used.
- * __Note:__ gt = 1; eq = 0; lt = -1
- * @param {Mixed} comparisonFn.min Current minimum value.
- * @param {Mixed} comparisonFn.item The value to compare with the current minimum.
- * @return {Object} minValue The minimum value.
- */
- min: function(array, comparisonFn) {
- var min = array[0],
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- if (comparisonFn) {
- if (comparisonFn(min, item) === 1) {
- min = item;
- }
- } else {
- if (item < min) {
- min = item;
- }
- }
- }
- return min;
- },
- /**
- * Returns the maximum value in the Array.
- *
- * @param {Array/NodeList} array The Array from which to select the maximum value.
- * @param {Function} comparisonFn (optional) a function to perform the comparison which
- * determines maximization.
- * If omitted the ">" operator will be used.
- * __Note:__ gt = 1; eq = 0; lt = -1
- * @param {Mixed} comparisonFn.max Current maximum value.
- * @param {Mixed} comparisonFn.item The value to compare with the current maximum.
- * @return {Object} maxValue The maximum value.
- */
- max: function(array, comparisonFn) {
- var max = array[0],
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- if (comparisonFn) {
- if (comparisonFn(max, item) === -1) {
- max = item;
- }
- } else {
- if (item > max) {
- max = item;
- }
- }
- }
- return max;
- },
- /**
- * Calculates the mean of all items in the array.
- *
- * @param {Array} array The Array to calculate the mean value of.
- * @return {Number} The mean.
- */
- mean: function(array) {
- return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
- },
- /**
- * Calculates the sum of all items in the given array.
- *
- * @param {Array} array The Array to calculate the sum value of.
- * @return {Number} The sum.
- */
- sum: function(array) {
- var sum = 0,
- i, ln, item;
- for (i = 0 , ln = array.length; i < ln; i++) {
- item = array[i];
- sum += item;
- }
- return sum;
- },
- /**
- * Creates a map (object) keyed by the elements of the given array. The values in
- * the map are the index+1 of the array element. For example:
- *
- * var map = Ext.Array.toMap(['a','b','c']);
- *
- * // map = { a: 1, b: 2, c: 3 };
- *
- * Or a key property can be specified:
- *
- * var map = Ext.Array.toMap([
- * { name: 'a' },
- * { name: 'b' },
- * { name: 'c' }
- * ], 'name');
- *
- * // map = { a: 1, b: 2, c: 3 };
- *
- * Lastly, a key extractor can be provided:
- *
- * var map = Ext.Array.toMap([
- * { name: 'a' },
- * { name: 'b' },
- * { name: 'c' }
- * ], function(obj) { return obj.name.toUpperCase(); });
- *
- * // map = { A: 1, B: 2, C: 3 };
- *
- * @param {String/String[]} strings The strings from which to create the map.
- * @param {String/Function} [getKey] Name of the object property to use
- * as a key or a function to extract the key.
- * @param {Object} [scope] Value of `this` inside callback specified for `getKey`.
- * @return {Object} The resulting map.
- */
- toMap: function(strings, getKey, scope) {
- var map, i;
- if (!strings) {
- return null;
- }
- map = {};
- i = strings.length;
- if (typeof strings === 'string') {
- map[strings] = 1;
- } else if (!getKey) {
- while (i--) {
- map[strings[i]] = i + 1;
- }
- } else if (typeof getKey === 'string') {
- while (i--) {
- map[strings[i][getKey]] = i + 1;
- }
- } else {
- while (i--) {
- map[getKey.call(scope, strings[i])] = i + 1;
- }
- }
- return map;
- },
- /**
- * Creates a map (object) keyed by a property of elements of the given array. The values in
- * the map are the array element. For example:
- *
- * var map = Ext.Array.toValueMap(['a','b','c']);
- *
- * // map = { a: 'a', b: 'b', c: 'c' };
- *
- * Or a key property can be specified:
- *
- * var map = Ext.Array.toValueMap([
- * { name: 'a' },
- * { name: 'b' },
- * { name: 'c' }
- * ], 'name');
- *
- * // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
- *
- * Lastly, a key extractor can be provided:
- *
- * var map = Ext.Array.toValueMap([
- * { name: 'a' },
- * { name: 'b' },
- * { name: 'c' }
- * ], function(obj) { return obj.name.toUpperCase(); });
- *
- * // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
- *
- * @param {Array} array The Array to create the map from.
- * @param {String/Function} [getKey] Name of the object property to use
- * as a key or a function to extract the key.
- * @param {Object} [scope] Value of this inside callback. This parameter is only
- * passed when `getKey` is a function. If `getKey` is not a function, the 3rd
- * argument is `arrayify`.
- * @param {Number} [arrayify] Pass `1` to create arrays for all map entries
- * or `2` to create arrays for map entries that have 2 or more items with the
- * same key. This only applies when `getKey` is specified. By default the map will
- * hold the last entry with a given key.
- * @return {Object} The resulting map.
- */
- toValueMap: function(array, getKey, scope, arrayify) {
- var map = {},
- i = array.length,
- autoArray, alwaysArray, entry, fn, key, value;
- if (!getKey) {
- while (i--) {
- value = array[i];
- map[value] = value;
- }
- } else {
- if (!(fn = (typeof getKey !== 'string'))) {
- arrayify = scope;
- }
- alwaysArray = arrayify === 1;
- autoArray = arrayify === 2;
- while (i--) {
- value = array[i];
- key = fn ? getKey.call(scope, value) : value[getKey];
- if (alwaysArray) {
- if (key in map) {
- map[key].push(value);
- } else {
- map[key] = [
- value
- ];
- }
- } else if (autoArray && (key in map)) {
- if ((entry = map[key]) instanceof Array) {
- entry.push(value);
- } else {
- map[key] = [
- entry,
- value
- ];
- }
- } else {
- map[key] = value;
- }
- }
- }
- return map;
- },
- _replaceSim: replaceSim,
- // for unit testing
- _spliceSim: spliceSim,
- /**
- * Removes items from an array. This is functionally equivalent to the splice method
- * of Array, but works around bugs in IE8's splice method and does not copy the
- * removed elements in order to return them (because very often they are ignored).
- *
- * @param {Array} array The Array on which to replace.
- * @param {Number} index The index in the array at which to operate.
- * @param {Number} removeCount The number of items to remove at index.
- * @return {Array} The array passed.
- * @method
- */
- erase: erase,
- /**
- * Inserts items in to an array.
- *
- * @param {Array} array The Array in which to insert.
- * @param {Number} index The index in the array at which to operate.
- * @param {Array} items The array of items to insert at index.
- * @return {Array} The array passed.
- */
- insert: function(array, index, items) {
- return replace(array, index, 0, items);
- },
- move: function(array, fromIdx, toIdx) {
- if (toIdx === fromIdx) {
- return;
- }
- /* eslint-disable-next-line vars-on-top */
- var item = array[fromIdx],
- incr = toIdx > fromIdx ? 1 : -1,
- i;
- for (i = fromIdx; i !== toIdx; i += incr) {
- array[i] = array[i + incr];
- }
- array[toIdx] = item;
- },
- /**
- * Replaces items in an array. This is functionally equivalent to the splice method
- * of Array, but works around bugs in IE8's splice method and is often more convenient
- * to call because it accepts an array of items to insert rather than use a variadic
- * argument list.
- *
- * @param {Array} array The Array on which to replace.
- * @param {Number} index The index in the array at which to operate.
- * @param {Number} removeCount The number of items to remove at index (can be 0).
- * @param {Array} insert (optional) An array of items to insert at index.
- * @return {Array} The array passed.
- * @method
- */
- replace: replace,
- /**
- * Replaces items in an array. This is equivalent to the splice method of Array, but
- * works around bugs in IE8's splice method. The signature is exactly the same as the
- * splice method except that the array is the first argument. All arguments following
- * removeCount are inserted in the array at index.
- *
- * @param {Array} array The Array on which to replace.
- * @param {Number} index The index in the array at which to operate.
- * @param {Number} removeCount The number of items to remove at index (can be 0).
- * @param {Object...} elements The elements to add to the array. If you don't specify
- * any elements, splice simply removes elements from the array.
- * @return {Array} An array containing the removed items.
- * @method
- */
- splice: splice,
- /**
- * Pushes new items onto the end of an Array.
- *
- * Passed parameters may be single items, or arrays of items. If an Array is found in the
- * argument list, all its elements are pushed into the end of the target Array.
- *
- * @param {Array} target The Array onto which to push new items
- * @param {Object...} elements The elements to add to the array. Each parameter may
- * be an Array, in which case all the elements of that Array will be pushed into the end
- * of the destination Array.
- * @return {Array} An array containing all the new items push onto the end.
- */
- push: function(target) {
- var args = arguments,
- len = args.length,
- i, newItem;
- if (target === undefined) {
- target = [];
- } else if (!Ext.isArray(target)) {
- target = [
- target
- ];
- }
- for (i = 1; i < len; i++) {
- newItem = args[i];
- Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](target, newItem);
- }
- return target;
- },
- /**
- * A function used to sort an array by numeric value. By default, javascript array values
- * are coerced to strings when sorting, which can be problematic when using numeric values.
- * To ensure that the values are sorted numerically, this method can be passed to the sort
- * method:
- *
- * Ext.Array.sort(myArray, Ext.Array.numericSortFn);
- */
- numericSortFn: function(a, b) {
- return a - b;
- }
- };
- /**
- * @method each
- * @member Ext
- * @inheritdoc Ext.Array#each
- */
- Ext.each = ExtArray.each;
- /**
- * @method union
- * @member Ext.Array
- * @inheritdoc Ext.Array#merge
- */
- ExtArray.union = ExtArray.merge;
- /**
- * Old alias to {@link Ext.Array#min}
- * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
- * @method min
- * @member Ext
- * @inheritdoc Ext.Array#min
- */
- Ext.min = ExtArray.min;
- /**
- * Old alias to {@link Ext.Array#max}
- * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
- * @method max
- * @member Ext
- * @inheritdoc Ext.Array#max
- */
- Ext.max = ExtArray.max;
- /**
- * Old alias to {@link Ext.Array#sum}
- * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
- * @method sum
- * @member Ext
- * @inheritdoc Ext.Array#sum
- */
- Ext.sum = ExtArray.sum;
- /**
- * Old alias to {@link Ext.Array#mean}
- * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
- * @method mean
- * @member Ext
- * @inheritdoc Ext.Array#mean
- */
- Ext.mean = ExtArray.mean;
- /**
- * Old alias to {@link Ext.Array#flatten}
- * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
- * @method flatten
- * @member Ext
- * @inheritdoc Ext.Array#flatten
- */
- Ext.flatten = ExtArray.flatten;
- /**
- * Old alias to {@link Ext.Array#clean}
- * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
- * @method clean
- * @member Ext
- * @inheritdoc Ext.Array#clean
- */
- Ext.clean = ExtArray.clean;
- /**
- * Old alias to {@link Ext.Array#unique}
- * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
- * @method unique
- * @member Ext
- * @inheritdoc Ext.Array#unique
- */
- Ext.unique = ExtArray.unique;
- /**
- * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
- * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
- * @method pluck
- * @member Ext
- * @inheritdoc Ext.Array#pluck
- */
- Ext.pluck = ExtArray.pluck;
- /**
- * @method toArray
- * @member Ext
- * @inheritdoc Ext.Array#toArray
- */
- Ext.toArray = function() {
- return ExtArray.toArray.apply(ExtArray, arguments);
- };
- return ExtArray;
- }());
- // @define Ext.lang.Assert
- // @define Ext.Assert
- // @require Ext.lang.Error
- /**
- * @class Ext.Assert
- * This class provides help value testing methods useful for diagnostics. These are often
- * used in `debugHooks`:
- *
- * Ext.define('Foo.bar.Class', {
- *
- * debugHooks: {
- * method: function (a) {
- * Ext.Assert.truthy(a, 'Expected "a" to be truthy');
- * },
- *
- * foo: function (object) {
- * Ext.Assert.isFunctionProp(object, 'doSomething');
- * }
- * }
- * });
- *
- * **NOTE:** This class is entirely removed in production builds so all uses of it should
- * be either in `debug` conditional comments or `debugHooks`.
- *
- * The following type detection methods from the `Ext` object are wrapped as assertions
- * by this class:
- *
- * * `isEmpty`
- * * `isArray`
- * * `isDate`
- * * `isObject`
- * * `isSimpleObject`
- * * `isPrimitive`
- * * `isFunction`
- * * `isNumber`
- * * `isNumeric`
- * * `isString`
- * * `isBoolean`
- * * `isElement`
- * * `isTextNode`
- * * `isDefined`
- * * `isIterable`
- *
- * These appear both their exact name and with a "Prop" suffix for checking a property on
- * an object. For example, these are almost identical:
- *
- * Ext.Assert.isFunction(object.foo);
- *
- * Ext.Assert.isFunctionProp(object, 'foo');
- *
- * The difference is the default error message generated is better in the second use case
- * than the first.
- *
- * The above list are also expanded for "Not" flavors (and "Not...Prop"):
- *
- * * `isNotEmpty`
- * * `isNotArray`
- * * `isNotDate`
- * * `isNotObject`
- * * `isNotSimpleObject`
- * * `isNotPrimitive`
- * * `isNotFunction`
- * * `isNotNumber`
- * * `isNotNumeric`
- * * `isNotString`
- * * `isNotBoolean`
- * * `isNotElement`
- * * `isNotTextNode`
- * * `isNotDefined`
- * * `isNotIterable`
- */
- Ext.Assert = {
- /**
- * Checks that the first argument is falsey and throws an `Error` if it is not.
- */
- falsey: function(b, msg) {
- if (b) {
- Ext.raise(msg || ('Expected a falsey value but was ' + b));
- }
- },
- /**
- * Checks that the first argument is falsey and throws an `Error` if it is not.
- */
- falseyProp: function(object, property) {
- var b;
- Ext.Assert.truthy(object);
- b = object[property];
- if (b) {
- if (object.$className) {
- property = object.$className + '#' + property;
- }
- Ext.raise('Expected a falsey value for ' + property + ' but was ' + b);
- }
- },
- /**
- * Checks that the first argument is truthy and throws an `Error` if it is not.
- */
- truthy: function(b, msg) {
- if (!b) {
- Ext.raise(msg || ('Expected a truthy value but was ' + typeof b));
- }
- },
- /**
- * Checks that the first argument is truthy and throws an `Error` if it is not.
- */
- truthyProp: function(object, property) {
- var b;
- Ext.Assert.truthy(object);
- b = object[property];
- if (!b) {
- if (object.$className) {
- property = object.$className + '#' + property;
- }
- Ext.raise('Expected a truthy value for ' + property + ' but was ' + typeof b);
- }
- }
- };
- /* eslint-disable indent */
- (function() {
- var name, kind;
- function makeAssert(name, kind) {
- var testFn = Ext[name],
- def;
- return function(value, msg) {
- if (!testFn(value)) {
- Ext.raise(msg || def || (def = 'Expected value to be ' + kind));
- }
- };
- }
- function makeAssertProp(name, kind) {
- var testFn = Ext[name],
- def;
- return function(object, prop) {
- Ext.Assert.truthy(object);
- if (!testFn(object[prop])) {
- Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to be ' + kind));
- }
- };
- }
- function makeNotAssert(name, kind) {
- var testFn = Ext[name],
- def;
- return function(value, msg) {
- if (testFn(value)) {
- Ext.raise(msg || def || (def = 'Expected value to NOT be ' + kind));
- }
- };
- }
- function makeNotAssertProp(name, kind) {
- var testFn = Ext[name],
- def;
- return function(object, prop) {
- Ext.Assert.truthy(object);
- if (testFn(object[prop])) {
- Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to NOT be ' + kind));
- }
- };
- }
- for (name in Ext) {
- if (name.substring(0, 2) === "is" && Ext.isFunction(Ext[name])) {
- kind = name.substring(2);
- Ext.Assert[name] = makeAssert(name, kind);
- Ext.Assert[name + 'Prop'] = makeAssertProp(name, kind);
- Ext.Assert['isNot' + kind] = makeNotAssert(name, kind);
- Ext.Assert['isNot' + kind + 'Prop'] = makeNotAssertProp(name, kind);
- }
- }
- }());
- /**
- * @class Ext.String
- *
- * A collection of useful static methods to deal with strings.
- * @singleton
- */
- /* eslint-disable indent */
- Ext.String = (function() {
- // @define Ext.lang.String
- // @define Ext.String
- // @require Ext
- // @require Ext.lang.Array
- // eslint-disable-next-line no-control-regex
- var trimRegex = /^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g,
- escapeRe = /('|\\)/g,
- // eslint-disable-next-line no-useless-escape
- escapeRegexRe = /([-.*+?\^${}()|\[\]\/\\])/g,
- basicTrimRe = /^\s+|\s+$/g,
- whitespaceRe = /\s+/,
- varReplace = /(^[^a-z]*|[^\w])/gi,
- charToEntity, entityToChar, charToEntityRegex, entityToCharRegex,
- htmlEncodeReplaceFn = function(match, capture) {
- return charToEntity[capture];
- },
- htmlDecodeReplaceFn = function(match, capture) {
- return (capture in entityToChar) ? entityToChar[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
- },
- boundsCheck = function(s, other) {
- if (s === null || s === undefined || other === null || other === undefined) {
- return false;
- }
- return other.length <= s.length;
- },
- fromCharCode = String.fromCharCode,
- ExtString;
- return ExtString = {
- /**
- * @method
- * Creates a string created by using the specified sequence of code points.
- * @param {Number...} codePoint Codepoints from which to build the string.
- * @return {String} A string built from the sequence of code points passed.
- */
- fromCodePoint: String.fromCodePoint || function() {
- var codePoint,
- result = '',
- codeUnits = [],
- index = -1,
- length = arguments.length;
- while (++index < length) {
- codePoint = Number(arguments[index]);
- if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
- codePoint < 0 || // not a valid Unicode code point
- codePoint > 1114111 || // not a valid Unicode code point
- Math.floor(codePoint) !== codePoint) // not an integer
- {
- Ext.raise('Invalid code point: ' + codePoint);
- }
- if (codePoint <= 65535) {
- // BMP code point
- codeUnits.push(codePoint);
- } else {
- // Astral code point; split in surrogate halves
- // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
- codePoint -= 65536;
- codeUnits.push((codePoint >> 10) + 55296, (codePoint % 1024) + 56320);
- }
- if (index + 1 === length) {
- result += fromCharCode(codeUnits);
- codeUnits.length = 0;
- }
- }
- return result;
- },
- /**
- * Inserts a substring into a string.
- * @param {String} s The original string.
- * @param {String} value The substring to insert.
- * @param {Number} index The index to insert the substring. Negative indexes will insert
- * from the end of the string. Example:
- *
- * Ext.String.insert("abcdefg", "h", -1); // abcdefhg
- *
- * @return {String} The value with the inserted substring
- */
- insert: function(s, value, index) {
- var len;
- if (!s) {
- return value;
- }
- if (!value) {
- return s;
- }
- len = s.length;
- if (!index && index !== 0) {
- index = len;
- }
- if (index < 0) {
- index *= -1;
- if (index >= len) {
- // negative overflow, insert at start
- index = 0;
- } else {
- index = len - index;
- }
- }
- if (index === 0) {
- s = value + s;
- } else if (index >= s.length) {
- s += value;
- } else {
- s = s.substr(0, index) + value + s.substr(index);
- }
- return s;
- },
- /**
- * Checks if a string starts with a substring
- * @param {String} s The original string
- * @param {String} start The substring to check
- * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
- */
- startsWith: function(s, start, ignoreCase) {
- var result = boundsCheck(s, start);
- if (result) {
- if (ignoreCase) {
- s = s.toLowerCase();
- start = start.toLowerCase();
- }
- result = s.lastIndexOf(start, 0) === 0;
- }
- return result;
- },
- /**
- * Checks if a string ends with a substring
- * @param {String} s The original string
- * @param {String} end The substring to check
- * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
- */
- endsWith: function(s, end, ignoreCase) {
- var result = boundsCheck(s, end);
- if (result) {
- if (ignoreCase) {
- s = s.toLowerCase();
- end = end.toLowerCase();
- }
- result = s.indexOf(end, s.length - end.length) !== -1;
- }
- return result;
- },
- /**
- * Converts a string of characters into a legal, parse-able JavaScript `var` name
- * as long as the passed string contains at least one alphabetic character.
- * Non alphanumeric characters, and *leading* non alphabetic characters will be removed.
- * @param {String} s A string to be converted into a `var` name.
- * @return {String} A legal JavaScript `var` name.
- */
- createVarName: function(s) {
- return s.replace(varReplace, '');
- },
- /**
- * Convert certain characters (&, <, >, ', and ") to their HTML character equivalents
- * for literal display in web pages.
- * @param {String} value The string to encode.
- * @return {String} The encoded text.
- * @method
- */
- htmlEncode: function(value) {
- return (!value) ? value : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
- },
- /**
- * Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.
- * @param {String} value The string to decode.
- * @return {String} The decoded text.
- * @method
- */
- htmlDecode: function(value) {
- return (!value) ? value : String(value).replace(entityToCharRegex, htmlDecodeReplaceFn);
- },
- /**
- * Checks if a string has values needing to be html encoded.
- * @private
- * @param {String} s The string to test
- * @return {Boolean} `true` if the string contains HTML characters
- */
- hasHtmlCharacters: function(s) {
- return charToEntityRegex.test(s);
- },
- /**
- * Adds a set of character entity definitions to the set used by
- * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode}.
- *
- * This object should be keyed by the entity name sequence,
- * with the value being the textual representation of the entity.
- *
- * Ext.String.addCharacterEntities({
- * '&Uuml;':'Ü',
- * '&ccedil;':'ç',
- * '&ntilde;':'ñ',
- * '&egrave;':'è'
- * });
- * var s = Ext.String.htmlEncode("A string with entities: èÜçñ");
- *
- * __Note:__ the values of the character entities defined on this object are expected
- * to be single character values. As such, the actual values represented by the
- * characters are sensitive to the character encoding of the JavaScript source
- * file when defined in string literal form. Script tags referencing server
- * resources with character entities must ensure that the 'charset' attribute
- * of the script node is consistent with the actual character encoding of the
- * server resource.
- *
- * The set of character entities may be reset back to the default state by using
- * the {@link Ext.String#resetCharacterEntities} method
- *
- * @param {Object} newEntities The set of character entities to add to the current
- * definitions.
- */
- addCharacterEntities: function(newEntities) {
- var charKeys = [],
- entityKeys = [],
- key, echar;
- for (key in newEntities) {
- echar = newEntities[key];
- entityToChar[key] = echar;
- charToEntity[echar] = key;
- charKeys.push(echar);
- entityKeys.push(key);
- }
- charToEntityRegex = new RegExp('(' + charKeys.join('|') + ')', 'g');
- entityToCharRegex = new RegExp('(' + entityKeys.join('|') + '|&#[0-9]{1,5};' + ')', 'g');
- },
- /**
- * Resets the set of character entity definitions used by
- * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode} back to the
- * default state.
- */
- resetCharacterEntities: function() {
- charToEntity = {};
- entityToChar = {};
- // add the default set
- this.addCharacterEntities({
- '&': '&',
- '>': '>',
- '<': '<',
- '"': '"',
- ''': "'"
- });
- },
- /**
- * Appends content to the query string of a URL, handling logic for whether to place
- * a question mark or ampersand.
- * @param {String} url The URL to append to.
- * @param {String} string The content to append to the URL.
- * @return {String} The resulting URL
- */
- urlAppend: function(url, string) {
- if (!Ext.isEmpty(string)) {
- return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
- }
- return url;
- },
- /**
- * Trims whitespace from either end of a string, leaving spaces within the string intact.
- * Example:
- *
- * var s = ' foo bar ';
- * alert('-' + s + '-'); //alerts "- foo bar -"
- * alert('-' + Ext.String.trim(s) + '-'); //alerts "-foo bar-"
- *
- * @param {String} string The string to trim.
- * @return {String} The trimmed string.
- */
- trim: function(string) {
- if (string) {
- string = string.replace(trimRegex, "");
- }
- return string || '';
- },
- /**
- * Capitalize the first letter of the given string.
- * @param {String} string
- * @return {String}
- */
- capitalize: function(string) {
- if (string) {
- string = string.charAt(0).toUpperCase() + string.substr(1);
- }
- return string || '';
- },
- /**
- * Uncapitalize the first letter of a given string.
- * @param {String} string
- * @return {String}
- */
- uncapitalize: function(string) {
- if (string) {
- string = string.charAt(0).toLowerCase() + string.substr(1);
- }
- return string || '';
- },
- /**
- * Truncate a string and add an ellipsis ('...') to the end if it exceeds
- * the specified length.
- * @param {String} value The string to truncate.
- * @param {Number} length The maximum length to allow before truncating.
- * @param {Boolean} [word=false] `true` to try to find a common word break.
- * @return {String} The converted text.
- */
- ellipsis: function(value, length, word) {
- var vs, index;
- if (value && value.length > length) {
- if (word) {
- vs = value.substr(0, length - 2);
- index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
- if (index !== -1 && index >= (length - 15)) {
- return vs.substr(0, index) + "...";
- }
- }
- return value.substr(0, length - 3) + "...";
- }
- return value;
- },
- /**
- * Escapes the passed string for use in a regular expression.
- * @param {String} string The string to escape.
- * @return {String} The escaped string.
- */
- escapeRegex: function(string) {
- return string.replace(escapeRegexRe, "\\$1");
- },
- /**
- * Creates a `RegExp` given a string `value` and optional flags. For example, the
- * following two regular expressions are equivalent.
- *
- * var regex1 = Ext.String.createRegex('hello');
- *
- * var regex2 = /^hello$/i;
- *
- * The following two regular expressions are also equivalent:
- *
- * var regex1 = Ext.String.createRegex('world', false, false, false);
- *
- * var regex2 = /world/;
- *
- * @param {String/RegExp} value The String to convert to a `RegExp`.
- * @param {Boolean} [startsWith=true] Pass `false` to allow a match to start
- * anywhere in the string. By default the `value` will match only at the start
- * of the string.
- * @param {Boolean} [endsWith=true] Pass `false` to allow the match to end before
- * the end of the string. By default the `value` will match only at the end of the
- * string.
- * @param {Boolean} [ignoreCase=true] Pass `false` to make the `RegExp` case
- * sensitive (removes the 'i' flag).
- * @since 5.0.0
- * @return {RegExp}
- */
- createRegex: function(value, startsWith, endsWith, ignoreCase) {
- var ret = value;
- if (value != null && !value.exec) {
- // not a regex
- ret = ExtString.escapeRegex(String(value));
- if (startsWith !== false) {
- ret = '^' + ret;
- }
- if (endsWith !== false) {
- ret += '$';
- }
- ret = new RegExp(ret, (ignoreCase !== false) ? 'i' : '');
- }
- return ret;
- },
- /**
- * Escapes the passed string for ' and \.
- * @param {String} string The string to escape.
- * @return {String} The escaped string.
- */
- escape: function(string) {
- return string.replace(escapeRe, "\\$1");
- },
- /**
- * Utility function that allows you to easily switch a string between two alternating
- * values. The passed value is compared to the current string, and if they are equal,
- * the other value that was passed in is returned. If they are already different,
- * the first value passed in is returned. Note that this method returns the new value
- * but does not change the current string.
- *
- * // alternate sort directions
- * sort = Ext.String.toggle(sort, 'ASC', 'DESC');
- *
- * // instead of conditional logic:
- * sort = (sort === 'ASC' ? 'DESC' : 'ASC');
- *
- * @param {String} string The current string.
- * @param {String} value The value to compare to the current string.
- * @param {String} other The new value to use if the string already equals the first value
- * passed in.
- * @return {String} The new value.
- */
- toggle: function(string, value, other) {
- return string === value ? other : value;
- },
- /**
- * Pads the left side of a string with a specified character. This is especially useful
- * for normalizing number and date strings. Example usage:
- *
- * var s = Ext.String.leftPad('123', 5, '0');
- * // s now contains the string: '00123'
- *
- * @param {String} string The original string.
- * @param {Number} size The total length of the output string.
- * @param {String} [character=' '] (optional) The character with which to pad the original
- * string.
- * @return {String} The padded string.
- */
- leftPad: function(string, size, character) {
- var result = String(string);
- character = character || " ";
- while (result.length < size) {
- result = character + result;
- }
- return result;
- },
- /**
- * Returns a string with a specified number of repetitions a given string pattern.
- * The pattern be separated by a different string.
- *
- * var s = Ext.String.repeat('---', 4); // = '------------'
- * var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'
- *
- * @param {String} pattern The pattern to repeat.
- * @param {Number} count The number of times to repeat the pattern (may be 0).
- * @param {String} sep An option string to separate each pattern.
- */
- repeat: function(pattern, count, sep) {
- var buf = [],
- i;
- if (count < 1) {
- count = 0;
- }
- for (i = count; i--; ) {
- buf.push(pattern);
- }
- return buf.join(sep || '');
- },
- /**
- * Splits a string of space separated words into an array, trimming as needed. If the
- * words are already an array, it is returned.
- *
- * @param {String/Array} words
- */
- splitWords: function(words) {
- if (words && typeof words === 'string') {
- return words.replace(basicTrimRe, '').split(whitespaceRe);
- }
- return words || [];
- }
- };
- }());
- // initialize the default encode / decode entities
- Ext.String.resetCharacterEntities();
- /**
- * @method htmlEncode
- * @member Ext
- * @inheritdoc Ext.String#htmlEncode
- */
- Ext.htmlEncode = Ext.String.htmlEncode;
- /**
- * @method htmlDecode
- * @member Ext
- * @inheritdoc Ext.String#htmlDecode
- */
- Ext.htmlDecode = Ext.String.htmlDecode;
- /**
- * @method urlAppend
- * @member Ext
- * @inheritdoc Ext.String#urlAppend
- */
- Ext.urlAppend = Ext.String.urlAppend;
- /* eslint-disable max-len */
- /**
- * @class Ext.Date
- * This class defines some basic methods for handling dates.
- *
- * The date parsing and formatting syntax contains a subset of
- * [PHP's `date()` function](http://www.php.net/date), and the formats that are
- * supported will provide results equivalent to their PHP versions.
- *
- * The following is a list of all currently supported formats:
- *
- * Format Description Example returned values
- * ------ ----------------------------------------------------------------------- -----------------------
- * d Day of the month, 2 digits with leading zeros 01 to 31
- * D A short textual representation of the day of the week Mon to Sun
- * j Day of the month without leading zeros 1 to 31
- * l A full textual representation of the day of the week Sunday to Saturday
- * N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
- * S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
- * w Numeric representation of the day of the week 0 (for Sunday) to 6 (for Saturday)
- * z The day of the year (starting from 0) 0 to 364 (365 in leap years)
- * W ISO-8601 week number of year, weeks starting on Monday 01 to 53
- * F A full textual representation of a month, such as January or March January to December
- * m Numeric representation of a month, with leading zeros 01 to 12
- * M A short textual representation of a month Jan to Dec
- * n Numeric representation of a month, without leading zeros 1 to 12
- * t Number of days in the given month 28 to 31
- * L Whether it's a leap year 1 if it is a leap year, 0 otherwise.
- * o ISO-8601 year number (identical to (Y), but if the ISO week number (W) Examples: 1998 or 2004
- * belongs to the previous or next year, that year is used instead)
- * Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
- * y A two digit representation of a year Examples: 99 or 03
- * a Lowercase Ante meridiem and Post meridiem am or pm
- * A Uppercase Ante meridiem and Post meridiem AM or PM
- * g 12-hour format of an hour without leading zeros 1 to 12
- * G 24-hour format of an hour without leading zeros 0 to 23
- * h 12-hour format of an hour with leading zeros 01 to 12
- * H 24-hour format of an hour with leading zeros 00 to 23
- * i Minutes, with leading zeros 00 to 59
- * s Seconds, with leading zeros 00 to 59
- * u Decimal fraction of a second Examples:
- * (minimum 1 digit, arbitrary number of digits allowed) 001 (i.e. 0.001s) or
- * 100 (i.e. 0.100s) or
- * 999 (i.e. 0.999s) or
- * 999876543210 (i.e. 0.999876543210s)
- * O Difference to Greenwich time (GMT) in hours and minutes Example: +1030
- * P Difference to Greenwich time (GMT) with colon between hours and minutes Example: -08:00
- * T Timezone abbreviation of the machine running the code Examples: EST, MDT, PDT ...
- * Z Timezone offset in seconds (negative if west of UTC, positive if east) -43200 to 50400
- * c ISO 8601 date represented as the local time with an offset to UTC appended.
- * Notes: Examples:
- * 1) If unspecified, the month / day defaults to the current month / day, 1991 or
- * the time defaults to midnight, while the timezone defaults to the 1992-10 or
- * browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
- * and minutes. The "T" delimiter, seconds, milliseconds and timezone 1994-08-19T16:20+01:00 or
- * are optional. 1995-07-18T17:21:28-02:00 or
- * 2) The decimal fraction of a second, if specified, must contain at 1996-06-17T18:22:29.98765+03:00 or
- * least 1 digit (there is no limit to the maximum number 1997-05-16T19:23:30,12345-0400 or
- * of digits allowed), and may be delimited by either a '.' or a ',' 1998-04-15T20:24:31.2468Z or
- * Refer to the examples on the right for the various levels of 1999-03-14T20:24:32Z or
- * date-time granularity which are supported, or see 2000-02-13T21:25:33
- * http://www.w3.org/TR/NOTE-datetime for more info. 2001-01-12 22:26:34
- * C An ISO date string as implemented by the native Date object's 1962-06-17T09:21:34.125Z
- * [Date.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
- * method. This outputs the numeric part with *UTC* hour and minute
- * values, and indicates this by appending the `'Z'` timezone
- * identifier.
- * U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1193432466 or -2138434463
- * MS Microsoft AJAX serialized dates \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
- * \/Date(1238606590509+0800)\/
- * time A javascript millisecond timestamp 1350024476440
- * timestamp A UNIX timestamp (same as U) 1350024866
- *
- * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
- *
- * // Sample date:
- * // 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
- *
- * var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
- * console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
- * console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
- * console.log(Ext.Date.format(dt, 'l, \\t\\he jS \\of F Y h:i:s A')); // Wednesday, the 10th of January 2007 03:05:01 PM
- *
- * Here are some standard date/time patterns that you might find helpful. They
- * are not part of the source of Ext.Date, but to use them you can simply copy this
- * block of code into any script that is included after Ext.Date and they will also become
- * globally available on the Date object. Feel free to add or remove patterns as needed in your code.
- *
- * Ext.Date.patterns = {
- * ISO8601Long:"Y-m-d H:i:s",
- * ISO8601Short:"Y-m-d",
- * ShortDate: "n/j/Y",
- * LongDate: "l, F d, Y",
- * FullDateTime: "l, F d, Y g:i:s A",
- * MonthDay: "F d",
- * ShortTime: "g:i A",
- * LongTime: "g:i:s A",
- * SortableDateTime: "Y-m-d\\TH:i:s",
- * UniversalSortableDateTime: "Y-m-d H:i:sO",
- * YearMonth: "F, Y"
- * };
- *
- * Example usage:
- *
- * var dt = new Date();
- * console.log(Ext.Date.format(dt, Ext.Date.patterns.ShortDate));
- *
- * Developer-written, custom formats may be used by supplying both a formatting and a parsing function
- * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.
- * @singleton
- */
- Ext.Date = (function() {
- /* eslint-disable indent */
- // @define Ext.lang.Date
- // @define Ext.Date
- // @require Ext
- // @require Ext.lang.String
- var utilDate,
- nativeDate = Date,
- stripEscapeRe = /(\\.)/g,
- hourInfoRe = /([gGhHisucUOPZ]|MS)/,
- dateInfoRe = /([djzmnYycU]|MS)/,
- slashRe = /\\/gi,
- numberTokenRe = /\{(\d+)\}/g,
- MSFormatRe = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'),
- datePartsRe = /^(?:(\d{1,4})|(\w{3,}))[/\-.\\\s](?:(\d{1,2})|(\w{3,}))[/\-.\\\s](\d{1,4})$/,
- pad = Ext.String.leftPad,
- dayInfo = {
- d: true,
- j: true
- },
- monthInfo = {
- F: true,
- m: true,
- M: true,
- n: true
- },
- yearInfo = {
- o: true,
- Y: true,
- y: true
- },
- // Most of the date-formatting functions below are the excellent work of Baron Schwartz.
- // (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
- // They generate precompiled functions from format patterns instead of parsing and
- // processing each pattern every time a date is formatted.
- code = [
- // date calculations (note: the code below creates a dependency on Ext.Number.from())
- "var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,",
- "def = me.defaults,",
- "from = Ext.Number.from,",
- "results = String(input).match(me.parseRegexes[{0}]);",
- // either null, or an array of matched strings
- "if(results){",
- "{1}",
- "if(u != null){",
- // i.e. unix time is defined
- "v = new Date(u * 1000);",
- // give top priority to UNIX time
- "}else{",
- // create Date object representing midnight of the current day;
- // this will provide us with our date defaults
- // (note: clearTime() handles Daylight Saving Time automatically)
- "dt = me.clearTime(new Date);",
- "y = from(y, from(def.y, dt.getFullYear()));",
- "m = from(m, from(def.m - 1, dt.getMonth()));",
- "dayMatched = d !== undefined;",
- "d = from(d, from(def.d, dt.getDate()));",
- // Attempt to validate the day. Since it defaults to today, it may go out
- // of range, for example parsing m/Y where the value is 02/2000 on the 31st of May.
- // It will attempt to parse 2000/02/31, which will overflow to March and end up
- // returning 03/2000. We only do this when we default the day. If an invalid day value
- // was set to be parsed by the user, continue on and either let it overflow or return null
- // depending on the strict value. This will be in line with the normal Date behaviour.
- "if (!dayMatched) {",
- "dt.setDate(1);",
- "dt.setMonth(m);",
- "dt.setFullYear(y);",
- "daysInMonth = me.getDaysInMonth(dt);",
- "if (d > daysInMonth) {",
- "d = daysInMonth;",
- "}",
- "}",
- "h = from(h, from(def.h, dt.getHours()));",
- "i = from(i, from(def.i, dt.getMinutes()));",
- "s = from(s, from(def.s, dt.getSeconds()));",
- "ms = from(ms, from(def.ms, dt.getMilliseconds()));",
- "if(z >= 0 && y >= 0){",
- // both the year and zero-based day of year are defined and >= 0.
- // these 2 values alone provide sufficient info to create a full date object
- // create Date object representing January 1st for the given year
- // handle years < 100 appropriately
- "v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
- // then add day of year, checking for Date "rollover" if necessary
- "v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);",
- "}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){",
- // check for Date "rollover"
- "v = null;",
- // invalid date, so return null
- "}else{",
- "if (W) {",
- // support ISO-8601
- // http://en.wikipedia.org/wiki/ISO_week_date
- //
- // Mutually equivalent definitions for week 01 are:
- // a. the week starting with the Monday which is nearest in time to 1 January
- // b. the week with 4 January in it
- // ... there are many others ...
- //
- // We'll use letter b above to determine the first week of the year.
- //
- // So, first get a Date object for January 4th of whatever calendar year is desired.
- //
- // Then, the first Monday of the year can easily be determined by (operating on this Date):
- // 1. Getting the day of the week.
- // 2. Subtracting that by one.
- // 3. Multiplying that by 86400000 (one day in ms).
- // 4. Subtracting this number of days (in ms) from the January 4 date (represented in ms).
- //
- // Example #1 ...
- //
- // January 2012
- // Su Mo Tu We Th Fr Sa
- // 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
- //
- // 1. January 4th is a Wednesday.
- // 2. Its day number is 3.
- // 3. Simply substract 2 days from Wednesday.
- // 4. The first week of the year begins on Monday, January 2. Simple!
- //
- // Example #2 ...
- // January 1992
- // Su Mo Tu We Th Fr Sa
- // 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
- //
- // 1. January 4th is a Saturday.
- // 2. Its day number is 6.
- // 3. Simply subtract 5 days from Saturday.
- // 4. The first week of the year begins on Monday, December 30. Simple!
- //
- // v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));
- // (This is essentially doing the same thing as above but for the week rather than the day)
- "year = y || (new Date()).getFullYear();",
- "jan4 = new Date(year, 0, 4, 0, 0, 0);",
- "d = jan4.getDay();",
- // If the 1st is a Thursday, then the 4th will be a Sunday, so we need the appropriate
- // day number here, which is why we use the day === checks.
- "week1monday = new Date(jan4.getTime() - ((d === 0 ? 6 : d - 1) * 86400000));",
- // The reason for adding 43200000 (12 hours) is to avoid any complication with daylight saving
- // switch overs. For example, if the clock is rolled back, an hour will repeat, so adding 7 days
- // will leave us 1 hour short (Sun <date> 23:00:00). By setting is to 12:00, subtraction
- // or addition of an hour won't make any difference.
- "v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));",
- "} else {",
- // plain old Date object
- // handle years < 100 properly
- "v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
- "}",
- "}",
- "}",
- "}",
- "if(v){",
- // favor UTC offset over GMT offset
- "if(zz != null){",
- // reset to UTC, then add offset
- "v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);",
- "}else if(o){",
- // reset to GMT, then add offset
- "v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
- "}",
- "}",
- "return (v != null) ? v : null;"
- ].join('\n');
- // Polyfill Date's toISOString instance method where not implemented.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
- // TODO: Remove this when IE8 retires.
- if (!Date.prototype.toISOString) {
- Date.prototype.toISOString = function() {
- var me = this;
- return pad(me.getUTCFullYear(), 4, '0') + '-' + pad(me.getUTCMonth() + 1, 2, '0') + '-' + pad(me.getUTCDate(), 2, '0') + 'T' + pad(me.getUTCHours(), 2, '0') + ':' + pad(me.getUTCMinutes(), 2, '0') + ':' + pad(me.getUTCSeconds(), 2, '0') + '.' + pad(me.getUTCMilliseconds(), 3, '0') + 'Z';
- };
- }
- /**
- * @method xf
- * @private
- * @param format
- * Create private copy of Ext JS's `Ext.util.Format.format()` method
- * + to remove unnecessary dependency
- * + to resolve namespace conflict with MS-Ajax's implementation
- */
- function xf(format) {
- var args = Array.prototype.slice.call(arguments, 1);
- return format.replace(numberTokenRe, function(m, i) {
- return args[i];
- });
- }
- /* eslint-enable indent, max-len */
- utilDate = {
- /** @ignore */
- now: nativeDate.now,
- // always available due to polyfill in Ext.js
- /**
- * @private
- */
- toString: function(date) {
- if (!date) {
- date = new nativeDate();
- }
- return date.getFullYear() + "-" + pad(date.getMonth() + 1, 2, '0') + "-" + pad(date.getDate(), 2, '0') + "T" + pad(date.getHours(), 2, '0') + ":" + pad(date.getMinutes(), 2, '0') + ":" + pad(date.getSeconds(), 2, '0');
- },
- /**
- * Returns the number of milliseconds between two dates.
- * @param {Date} dateA The first date.
- * @param {Date} [dateB=new Date()] (optional) The second date.
- * @return {Number} The difference in milliseconds
- */
- getElapsed: function(dateA, dateB) {
- return Math.abs(dateA - (dateB || utilDate.now()));
- },
- /**
- * Global flag which determines if strict date parsing should be used.
- * Strict date parsing will not roll-over invalid dates, which is the
- * default behavior of JavaScript Date objects.
- * (see {@link #parse} for more information)
- * @type Boolean
- */
- useStrict: false,
- /**
- * @private
- */
- formatCodeToRegex: function(character, currentGroup) {
- // Note: currentGroup - position in regex result array (see notes for
- // Ext.Date.parseCodes below)
- var p = utilDate.parseCodes[character];
- if (p) {
- p = typeof p === 'function' ? p() : p;
- // reassign function result to prevent repeated execution
- utilDate.parseCodes[character] = p;
- }
- return p ? Ext.applyIf({
- c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
- }, p) : {
- g: 0,
- c: null,
- s: Ext.String.escapeRegex(character)
- };
- },
- // treat unrecognized characters as literals
- /**
- * An object hash in which each property is a date parsing function. The property name is the
- * format string which that function parses.
- *
- * This object is automatically populated with date parsing functions as
- * date formats are requested for Ext standard formatting strings.
- *
- * Custom parsing functions may be inserted into this object, keyed by a name which from then on
- * may be used as a format string to {@link #parse}.
- *
- * Example:
- *
- * Ext.Date.parseFunctions['x-date-format'] = myDateParser;
- *
- * A parsing function should return a Date object, and is passed the following parameters:
- *
- * - `date`: {@link String} - The date string to parse.
- * - `strict`: {@link Boolean} - `true` to validate date strings while parsing
- * (i.e. prevent JavaScript Date "rollover"). __The default must be `false`.__
- * Invalid date strings should return `null` when parsed.
- *
- * To enable Dates to also be _formatted_ according to that format, a corresponding
- * formatting function must be placed into the {@link #formatFunctions} property.
- * @property parseFunctions
- * @type Object
- */
- parseFunctions: {
- "MS": function(input, strict) {
- // note: the timezone offset is ignored since the MS Ajax server sends
- // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
- var r = (input || '').match(MSFormatRe);
- return r ? new nativeDate(((r[1] || '') + r[2]) * 1) : null;
- },
- "time": function(input, strict) {
- var num = parseInt(input, 10);
- if (num || num === 0) {
- return new nativeDate(num);
- }
- return null;
- },
- "timestamp": function(input, strict) {
- var num = parseInt(input, 10);
- if (num || num === 0) {
- return new nativeDate(num * 1000);
- }
- return null;
- }
- },
- parseRegexes: [],
- /**
- * An object hash in which each property is a date formatting function. The property name is the
- * format string which corresponds to the produced formatted date string.
- *
- * This object is automatically populated with date formatting functions as
- * date formats are requested for Ext standard formatting strings.
- *
- * Custom formatting functions may be inserted into this object, keyed by a name which
- * from then on may be used as a format string to {@link #format}.
- *
- * Example:
- *
- * Ext.Date.formatFunctions['x-date-format'] = myDateFormatter;
- *
- * A formatting function should return a string representation of the Date object which
- * is the scope (this) of the function.
- *
- * To enable date strings to also be _parsed_ according to that format, a corresponding
- * parsing function must be placed into the {@link #parseFunctions} property.
- * @property formatFunctions
- * @type Object
- */
- formatFunctions: {
- "MS": function() {
- // UTC milliseconds since Unix epoch (MS-AJAX serialized date format (MRSF))
- return '\\/Date(' + this.getTime() + ')\\/';
- },
- "time": function() {
- return this.getTime().toString();
- },
- "timestamp": function() {
- return utilDate.format(this, 'U');
- }
- },
- y2kYear: 50,
- /**
- * Date interval constant.
- * @type String
- */
- MILLI: "ms",
- /**
- * Date interval constant.
- * @type String
- */
- SECOND: "s",
- /**
- * Date interval constant.
- * @type String
- */
- MINUTE: "mi",
- /**
- * Date interval constant.
- * @type String
- */
- HOUR: "h",
- /**
- * Date interval constant.
- * @type String
- */
- DAY: "d",
- /**
- * Date interval constant.
- * @type String
- */
- MONTH: "mo",
- /**
- * Date interval constant.
- * @type String
- */
- YEAR: "y",
- /**
- * The number of days in a week.
- * @type Number
- */
- DAYS_IN_WEEK: 7,
- /**
- * The number of months in a year.
- * @type Number
- */
- MONTHS_IN_YEAR: 12,
- /**
- * The maximum number of days in a month.
- * @type {Number}
- */
- MAX_DAYS_IN_MONTH: 31,
- SUNDAY: 0,
- MONDAY: 1,
- TUESDAY: 2,
- WEDNESDAY: 3,
- THURSDAY: 4,
- FRIDAY: 5,
- SATURDAY: 6,
- /**
- * An object hash containing default date values used during date parsing.
- *
- * The following properties are available:
- *
- * - `y`: {@link Number} - The default year value. Defaults to `undefined`.
- * - `m`: {@link Number} - The default 1-based month value. Defaults to `undefined`.
- * - `d`: {@link Number} - The default day value. Defaults to `undefined`.
- * - `h`: {@link Number} - The default hour value. Defaults to `undefined`.
- * - `i`: {@link Number} - The default minute value. Defaults to `undefined`.
- * - `s`: {@link Number} - The default second value. Defaults to `undefined`.
- * - `ms`: {@link Number} - The default millisecond value. Defaults to `undefined`.
- *
- * Override these properties to customize the default date values used by the {@link #parse}
- * method.
- *
- * __Note:__ In countries which experience Daylight Saving Time (i.e. DST), the `h`, `i`, `s`
- * and `ms` properties may coincide with the exact time in which DST takes effect.
- * It is the responsibility of the developer to account for this.
- *
- * Example Usage:
- *
- * // set default day value to the first day of the month
- * Ext.Date.defaults.d = 1;
- *
- * // parse a February date string containing only year and month values.
- * // setting the default day value to 1 prevents weird date rollover issues
- * // when attempting to parse the following date string on, for example, March 31st 2009
- * Ext.Date.parse('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
- *
- * @property defaults
- * @type Object
- */
- defaults: {},
- /**
- * @property {String[]} dayNames
- * An array of textual day names.
- * Override these values for international dates.
- *
- * Example:
- *
- * Ext.Date.dayNames = [
- * 'SundayInYourLang',
- * 'MondayInYourLang'
- * // ...
- * ];
- * @locale
- */
- dayNames: [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday"
- ],
- /**
- * @property {String[]} monthNames
- * An array of textual month names.
- * Override these values for international dates.
- *
- * Example:
- *
- * Ext.Date.monthNames = [
- * 'JanInYourLang',
- * 'FebInYourLang'
- * // ...
- * ];
- * @locale
- */
- monthNames: [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- ],
- /**
- * @property {Object} monthNumbers
- * An object hash of zero-based JavaScript month numbers (with short month names as keys).
- *
- * __Note:__ keys are case-sensitive.
- *
- * Override these values for international dates.
- *
- * Example:
- *
- * Ext.Date.monthNumbers = {
- * 'LongJanNameInYourLang': 0,
- * 'ShortJanNameInYourLang':0,
- * 'LongFebNameInYourLang':1,
- * 'ShortFebNameInYourLang':1
- * // ...
- * };
- * @locale
- */
- monthNumbers: {
- January: 0,
- Jan: 0,
- February: 1,
- Feb: 1,
- March: 2,
- Mar: 2,
- April: 3,
- Apr: 3,
- May: 4,
- June: 5,
- Jun: 5,
- July: 6,
- Jul: 6,
- August: 7,
- Aug: 7,
- September: 8,
- Sep: 8,
- October: 9,
- Oct: 9,
- November: 10,
- Nov: 10,
- December: 11,
- Dec: 11
- },
- /**
- * @property {String} defaultFormat
- * The date format string that the {@link Ext.util.Format#dateRenderer}
- * and {@link Ext.util.Format#date} functions use. See {@link Ext.Date} for details.
- *
- * This is the format that {@link #method!flexParse} uses to disambiguate all-numeric
- * input dates.
- *
- * This may be overridden in a locale file.
- * @locale
- */
- defaultFormat: 'm/d/Y',
- /**
- * @property {String} defaultTimeFormat
- * The default time format.
- *
- * This may be overridden in a locale file.
- * @locale
- */
- defaultTimeFormat: 'h:i A',
- /**
- * @property {Number} firstDayOfWeek
- * The day on which the week starts. `0` being Sunday, through `6` being Saturday.
- *
- * This may be overridden in a locale file.
- * @locale
- */
- firstDayOfWeek: 0,
- /**
- * @property {Number[]} weekendDays
- * The days on which weekend falls. `0` being Sunday, through `6` being Saturday.
- *
- * This may be overridden in a locale file.
- * @locale
- */
- weekendDays: [
- 0,
- 6
- ],
- /**
- * Get the short month name for the given month number.
- * Override this function for international dates.
- * @param {Number} month A zero-based JavaScript month number.
- * @return {String} The short month name.
- * @locale
- */
- getShortMonthName: function(month) {
- return utilDate.monthNames[month].substring(0, 3);
- },
- /**
- * Get the short day name for the given day number.
- * Override this function for international dates.
- * @param {Number} day A zero-based JavaScript day number.
- * @return {String} The short day name.
- * @locale
- */
- getShortDayName: function(day) {
- return utilDate.dayNames[day].substring(0, 3);
- },
- /**
- * Get the zero-based JavaScript month number for the given short/full month name.
- * Override this function for international dates.
- * @param {String} name The short/full month name.
- * @return {Number} The zero-based JavaScript month number.
- * @locale
- */
- getMonthNumber: function(name) {
- // handle camel casing for English month names (since the keys for
- // the Ext.Date.monthNumbers hash are case sensitive)
- return utilDate.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
- },
- /**
- * Checks if the specified format contains hour information
- * @param {String} format The format to check
- * @return {Boolean} True if the format contains hour information
- * @method
- */
- formatContainsHourInfo: function(format) {
- return hourInfoRe.test(format.replace(stripEscapeRe, ''));
- },
- /**
- * Checks if the specified format contains information about
- * anything other than the time.
- * @param {String} format The format to check
- * @return {Boolean} True if the format contains information about
- * date/day information.
- * @method
- */
- formatContainsDateInfo: function(format) {
- return dateInfoRe.test(format.replace(stripEscapeRe, ''));
- },
- /**
- * @private
- * Checks if the specified format contains only month information.
- *
- * @param {String} format Format to check
- *
- * @return {Boolean}
- */
- isMonthFormat: function(format) {
- return !!monthInfo[format];
- },
- /**
- * @private
- * Checks if the specified format contains only year information.
- *
- * @param {String} format Format to check.
- *
- * @return {Boolean}
- */
- isYearFormat: function(format) {
- return !!yearInfo[format];
- },
- /**
- * Removes all escaping for a date format string. In date formats,
- * using a '\' can be used to escape special characters.
- * @param {String} format The format to unescape
- * @return {String} The unescaped format
- * @method
- */
- unescapeFormat: function(format) {
- // Escape the format, since \ can be used to escape special
- // characters in a date format. For example, in a Spanish
- // locale the format may be: 'd \\de F \\de Y'
- return format.replace(slashRe, '');
- },
- /**
- * The base format-code to formatting-function hashmap used by the {@link #format} method.
- * Formatting functions are strings (or functions which return strings) which
- * will return the appropriate value when evaluated in the context of the Date object
- * from which the {@link #format} method is called.
- * Add to / override these mappings for custom date formatting.
- *
- * __Note:__ `Ext.Date.format()` treats characters as literals if an appropriate mapping
- * cannot be found.
- *
- * Example:
- *
- * Ext.Date.formatCodes.x = "Ext.util.Format.leftPad(this.getDate(), 2, '0')";
- * console.log(Ext.Date.format(new Date(), 'X'); // returns the current day of the month
- * @type Object
- */
- formatCodes: {
- /* eslint-disable max-len */
- d: "Ext.String.leftPad(m.getDate(), 2, '0')",
- D: "Ext.Date.getShortDayName(m.getDay())",
- // get localized short day name
- j: "m.getDate()",
- l: "Ext.Date.dayNames[m.getDay()]",
- N: "(m.getDay() ? m.getDay() : 7)",
- S: "Ext.Date.getSuffix(m)",
- w: "m.getDay()",
- z: "Ext.Date.getDayOfYear(m)",
- W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(m), 2, '0')",
- F: "Ext.Date.monthNames[m.getMonth()]",
- m: "Ext.String.leftPad(m.getMonth() + 1, 2, '0')",
- M: "Ext.Date.getShortMonthName(m.getMonth())",
- // get localized short month name
- n: "(m.getMonth() + 1)",
- t: "Ext.Date.getDaysInMonth(m)",
- L: "(Ext.Date.isLeapYear(m) ? 1 : 0)",
- o: "(m.getFullYear() + (Ext.Date.getWeekOfYear(m) == 1 && m.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(m) >= 52 && m.getMonth() < 11 ? -1 : 0)))",
- Y: "Ext.String.leftPad(m.getFullYear(), 4, '0')",
- y: "('' + m.getFullYear()).substring(2, 4)",
- a: "(m.getHours() < 12 ? 'am' : 'pm')",
- A: "(m.getHours() < 12 ? 'AM' : 'PM')",
- g: "((m.getHours() % 12) ? m.getHours() % 12 : 12)",
- G: "m.getHours()",
- h: "Ext.String.leftPad((m.getHours() % 12) ? m.getHours() % 12 : 12, 2, '0')",
- H: "Ext.String.leftPad(m.getHours(), 2, '0')",
- i: "Ext.String.leftPad(m.getMinutes(), 2, '0')",
- s: "Ext.String.leftPad(m.getSeconds(), 2, '0')",
- u: "Ext.String.leftPad(m.getMilliseconds(), 3, '0')",
- O: "Ext.Date.getGMTOffset(m)",
- P: "Ext.Date.getGMTOffset(m, true)",
- T: "Ext.Date.getTimezone(m)",
- Z: "(m.getTimezoneOffset() * -60)",
- /* eslint-enable max-len */
- c: function() {
- // ISO-8601 -- GMT format
- var c = "Y-m-dTH:i:sP",
- code = [],
- l = c.length,
- i, e;
- for (i = 0; i < l; ++i) {
- e = c.charAt(i);
- // treat T as a character literal
- code.push(e === "T" ? "'T'" : utilDate.getFormatCode(e));
- }
- return code.join(" + ");
- },
- C: function() {
- // ISO-1601 -- browser format. UTC numerics with the 'Z' TZ id.
- return 'm.toISOString()';
- },
- U: "Math.round(m.getTime() / 1000)"
- },
- /**
- * Checks if the passed Date parameters will cause a JavaScript Date "rollover".
- * @param {Number} year 4-digit year.
- * @param {Number} month 1-based month-of-year.
- * @param {Number} day Day of month.
- * @param {Number} hour (optional) Hour.
- * @param {Number} minute (optional) Minute.
- * @param {Number} second (optional) Second.
- * @param {Number} millisecond (optional) Millisecond.
- * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover",
- * `false` otherwise.
- */
- isValid: function(year, month, day, hour, minute, second, millisecond) {
- var dt;
- // setup defaults
- hour = hour || 0;
- minute = minute || 0;
- second = second || 0;
- millisecond = millisecond || 0;
- // Special handling for year < 100
- /* eslint-disable-next-line max-len */
- dt = utilDate.add(new nativeDate(year < 100 ? 100 : year, month - 1, day, hour, minute, second, millisecond), utilDate.YEAR, year < 100 ? year - 100 : 0);
- return year === dt.getFullYear() && month === dt.getMonth() + 1 && day === dt.getDate() && hour === dt.getHours() && minute === dt.getMinutes() && second === dt.getSeconds() && millisecond === dt.getMilliseconds();
- },
- /**
- * Parses the passed string using the specified date format.
- * Note that this function expects normal calendar dates, meaning that months are 1-based
- * (i.e. 1 = January). The {@link #defaults} hash will be used for any date value (i.e. year,
- * month, day, hour, minute, second or millisecond) which cannot be found in the passed string.
- * If a corresponding default date value has not been specified in the {@link #defaults} hash,
- * the current date's year, month, day or DST-adjusted zero-hour time value will be used
- * instead. Keep in mind that the input date string must precisely match the specified format
- * string in order for the parse operation to be successful (failed parse operations return a
- * `null` value).
- *
- * Example:
- *
- * //dt = Fri May 25 2007 (current date)
- * var dt = new Date();
- *
- * //dt = Thu May 25 2006 (today's month/day in 2006)
- * dt = Ext.Date.parse("2006", "Y");
- *
- * //dt = Sun Jan 15 2006 (all date parts specified)
- * dt = Ext.Date.parse("2006-01-15", "Y-m-d");
- *
- * //dt = Sun Jan 15 2006 15:20:01
- * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
- *
- * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
- * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
- *
- * ## Heuristic Parsing
- * When no `format` is specified, this method parses the date in a flexible way allowing
- * for different delimiters and textual month names to infer the position of the other
- * parts.
- *
- * Supported inferred date orders when alphabetic month names are used are:
- *
- * - `D,M,Y`
- * - `M,D,Y`
- * - `Y,M,D`
- *
- * If the passed in date consists of all numeric tokens then the relative magnitude of
- * the first two tokens is used to make an inference about the user's intention.
- * If one token is less than 13 and the other is greater than 12, then the user's
- * intention is known.
- *
- * Failing this, the {@link #defaultFormat} is used to determine the input order for
- * the current locale.
- *
- * Part delimiters may be any of these:
- *
- * - `'/'`
- * - `'-'`
- * - `'.'`
- * - `'\'`
- * - `' '` (space)
- *
- * For example, the inputs `"Jun 1 62"` and `"1 Jun 62"` would be understood as the
- * first of June, 1962 in all English locales regardless of the locale's default date
- * ordering.
- *
- * If `"25/1/62"` was passed in, it's obvious that the user means the twenty fifth
- * of January.
- *
- * If, however, `"1/6/62"` was passed in, the {@link #defaultFormat} would be consulted
- * to disambiguate the meaning of those first two tokens.
- *
- * @param {String} input The date string to parse.
- * @param {String} [format] The expected date string format. If not passed, the date
- * string will be parsed heuristically as described above.
- * @param {Boolean} [strict=false] Pass `true` to validate date strings while parsing
- * (i.e. prevents JavaScript Date "rollover"). Invalid date strings will return `null`
- * when parsed.
- * @return {Date} The parsed Date, or `null` if an invalid date string.
- */
- parse: function(input, format, strict) {
- var p;
- if (!format) {
- return utilDate.flexParse(input);
- }
- p = utilDate.parseFunctions;
- if (p[format] == null) {
- utilDate.createParser(format);
- }
- return p[format].call(utilDate, input, Ext.isDefined(strict) ? strict : utilDate.useStrict);
- },
- // Backwards compat
- parseDate: function(input, format, strict) {
- return utilDate.parse(input, format, strict);
- },
- /**
- * @private
- */
- getFormatCode: function(character) {
- var f = utilDate.formatCodes[character];
- if (f) {
- f = typeof f === 'function' ? f() : f;
- // reassign function result to prevent repeated execution
- utilDate.formatCodes[character] = f;
- }
- // note: unknown characters are treated as literals
- return f || ("'" + Ext.String.escape(character) + "'");
- },
- /**
- * @private
- */
- createFormat: function(format) {
- var code = [],
- special = false,
- ch = '',
- i;
- for (i = 0; i < format.length; ++i) {
- ch = format.charAt(i);
- if (!special && ch === "\\") {
- special = true;
- } else if (special) {
- special = false;
- code.push("'" + Ext.String.escape(ch) + "'");
- } else {
- if (ch === '\n') {
- code.push("'\\n'");
- } else {
- code.push(utilDate.getFormatCode(ch));
- }
- }
- }
- utilDate.formatFunctions[format] = Ext.functionFactory("var m = this; return " + code.join('+'));
- },
- /**
- * @private
- */
- createParser: function(format) {
- var regexNum = utilDate.parseRegexes.length,
- currentGroup = 1,
- calc = [],
- regex = [],
- special = false,
- ch = "",
- i = 0,
- len = format.length,
- atEnd = [],
- obj;
- for (; i < len; ++i) {
- ch = format.charAt(i);
- if (!special && ch === "\\") {
- special = true;
- } else if (special) {
- special = false;
- regex.push(Ext.String.escape(ch));
- } else {
- obj = utilDate.formatCodeToRegex(ch, currentGroup);
- currentGroup += obj.g;
- regex.push(obj.s);
- if (obj.g && obj.c) {
- if (obj.calcAtEnd) {
- atEnd.push(obj.c);
- } else {
- calc.push(obj.c);
- }
- }
- }
- }
- calc = calc.concat(atEnd);
- utilDate.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
- utilDate.parseFunctions[format] = Ext.functionFactory("input", "strict", xf(code, regexNum, calc.join('')));
- },
- /**
- * @private
- */
- parseCodes: {
- // Notes:
- // g = {Number} calculation group (0 or 1. only group 1 contributes to
- // date calculations.)
- // c = {String} calculation method (required for group 1. null for group 0.
- // {0} = currentGroup - position in regex result array)
- // s = {String} regex pattern. all matches are stored in results[], and are
- // accessible by the calculation mapped to 'c'
- d: {
- g: 1,
- c: "d = parseInt(results[{0}], 10);\n",
- s: "(3[0-1]|[1-2][0-9]|0[1-9])"
- },
- // day of month with leading zeroes (01 - 31)
- j: {
- g: 1,
- c: "d = parseInt(results[{0}], 10);\n",
- s: "(3[0-1]|[1-2][0-9]|[1-9])"
- },
- // day of month without leading zeroes (1 - 31)
- D: function() {
- var a = [],
- i;
- // get localised short day names
- for (i = 0; i < 7; i++) {
- a.push(utilDate.getShortDayName(i));
- }
- return {
- g: 0,
- c: null,
- s: "(?:" + a.join("|") + ")"
- };
- },
- l: function() {
- return {
- g: 0,
- c: null,
- s: "(?:" + utilDate.dayNames.join("|") + ")"
- };
- },
- N: {
- g: 0,
- c: null,
- s: "[1-7]"
- },
- // ISO-8601 day number (1 (monday) - 7 (sunday))
- //<locale type="object" property="parseCodes">
- S: {
- g: 0,
- c: null,
- s: "(?:st|nd|rd|th)"
- },
- //</locale>
- w: {
- g: 0,
- c: null,
- s: "[0-6]"
- },
- // JavaScript day number (0 (sunday) - 6 (saturday))
- z: {
- g: 1,
- c: "z = parseInt(results[{0}], 10);\n",
- s: "(\\d{1,3})"
- },
- // day of the year (0 - 364 (365 in leap years))
- W: {
- g: 1,
- c: "W = parseInt(results[{0}], 10);\n",
- s: "(\\d{2})"
- },
- // ISO-8601 week number (with leading zero)
- F: function() {
- return {
- g: 1,
- c: "m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",
- s: "(" + utilDate.monthNames.join("|") + ")"
- };
- },
- M: function() {
- var a = [],
- i;
- // get localised short month names
- for (i = 0; i < 12; i++) {
- a.push(utilDate.getShortMonthName(i));
- }
- return Ext.applyIf({
- s: "(" + a.join("|") + ")"
- }, utilDate.formatCodeToRegex("F"));
- },
- m: {
- g: 1,
- c: "m = parseInt(results[{0}], 10) - 1;\n",
- s: "(1[0-2]|0[1-9])"
- },
- // month number with leading zeros (01 - 12)
- n: {
- g: 1,
- c: "m = parseInt(results[{0}], 10) - 1;\n",
- s: "(1[0-2]|[1-9])"
- },
- // month number without leading zeros (1 - 12)
- t: {
- g: 0,
- c: null,
- s: "(?:\\d{2})"
- },
- // no. of days in the month (28 - 31)
- L: {
- g: 0,
- c: null,
- s: "(?:1|0)"
- },
- o: {
- g: 1,
- c: "y = parseInt(results[{0}], 10);\n",
- s: "(\\d{4})"
- },
- // ISO-8601 year number (with leading zero)
- Y: {
- g: 1,
- c: "y = parseInt(results[{0}], 10);\n",
- s: "(\\d{4})"
- },
- // 4-digit year
- y: {
- g: 1,
- c: "var ty = parseInt(results[{0}], 10);\n" + "y = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",
- // 2-digit year
- s: "(\\d{2})"
- },
- // In the am/pm parsing routines, we allow both upper and lower case
- // even though it doesn't exactly match the spec. It gives much more flexibility
- // in being able to specify case insensitive regexes.
- /* eslint-disable indent */
- //<locale type="object" property="parseCodes">
- a: {
- g: 1,
- c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
- s: "(am|pm|AM|PM)",
- calcAtEnd: true
- },
- //</locale>
- //<locale type="object" property="parseCodes">
- A: {
- g: 1,
- c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
- s: "(AM|PM|am|pm)",
- calcAtEnd: true
- },
- //</locale>
- g: {
- g: 1,
- c: "h = parseInt(results[{0}], 10);\n",
- s: "(1[0-2]|[1-9])"
- },
- // 12-hr format of an hour without leading zeroes (1 - 12)
- G: {
- g: 1,
- c: "h = parseInt(results[{0}], 10);\n",
- s: "(2[0-3]|1[0-9]|[0-9])"
- },
- // 24-hr format of an hour without leading zeroes (0 - 23)
- h: {
- g: 1,
- c: "h = parseInt(results[{0}], 10);\n",
- s: "(1[0-2]|0[1-9])"
- },
- // 12-hr format of an hour with leading zeroes (01 - 12)
- H: {
- g: 1,
- c: "h = parseInt(results[{0}], 10);\n",
- s: "(2[0-3]|[0-1][0-9])"
- },
- // 24-hr format of an hour with leading zeroes (00 - 23)
- i: {
- g: 1,
- c: "i = parseInt(results[{0}], 10);\n",
- s: "([0-5][0-9])"
- },
- // minutes with leading zeros (00 - 59)
- s: {
- g: 1,
- c: "s = parseInt(results[{0}], 10);\n",
- s: "([0-5][0-9])"
- },
- // seconds with leading zeros (00 - 59)
- u: {
- g: 1,
- c: "ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
- s: "(\\d+)"
- },
- // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
- /* eslint-disable max-len */
- O: {
- g: 1,
- c: [
- "o = results[{0}];",
- "var sn = o.substring(0,1),",
- // get + / - sign
- "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
- // get hours (performs minutes-to-hour conversion also, just in case)
- "mn = o.substring(3,5) % 60;",
- // get minutes
- "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
- ].// -12hrs <= GMT offset <= 14hrs
- join("\n"),
- s: "([+-]\\d{4})"
- },
- // GMT offset in hrs and mins
- P: {
- g: 1,
- c: [
- "o = results[{0}];",
- "var sn = o.substring(0,1),",
- // get + / - sign
- "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
- // get hours (performs minutes-to-hour conversion also, just in case)
- "mn = o.substring(4,6) % 60;",
- // get minutes
- "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + Ext.String.leftPad(hr, 2, '0') + Ext.String.leftPad(mn, 2, '0')) : null;\n"
- ].// -12hrs <= GMT offset <= 14hrs
- join("\n"),
- s: "([+-]\\d{2}:\\d{2})"
- },
- // GMT offset in hrs and mins (with colon separator)
- T: {
- g: 0,
- c: null,
- s: "[A-Z]{1,5}"
- },
- // timezone abbrev. may be between 1 - 5 chars
- Z: {
- g: 1,
- c: "zz = results[{0}] * 1;\n" + // -43200 <= UTC offset <= 50400
- "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
- s: "([+-]?\\d{1,5})"
- },
- // leading '+' sign is optional for UTC offset
- c: function() {
- var calc = [],
- arr = [
- utilDate.formatCodeToRegex("Y", 1),
- // year
- utilDate.formatCodeToRegex("m", 2),
- // month
- utilDate.formatCodeToRegex("d", 3),
- // day
- utilDate.formatCodeToRegex("H", 4),
- // hour
- utilDate.formatCodeToRegex("i", 5),
- // minute
- utilDate.formatCodeToRegex("s", 6),
- // second
- {
- c: "ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"
- },
- // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
- {
- c: [
- // allow either "Z" (i.e. UTC) or "-0530" or "+08:00" (i.e. UTC offset) timezone delimiters. assumes local timezone if no timezone is specified
- "if (results[8]) {",
- // timezone specified
- "if (results[8] == 'Z') {",
- "zz = 0;",
- // UTC
- "}",
- "else if (results[8].indexOf(':') > -1) {",
- utilDate.formatCodeToRegex("P", 8).c,
- // timezone offset with colon separator
- "}",
- "else {",
- utilDate.formatCodeToRegex("O", 8).c,
- // timezone offset without colon separator
- "}",
- "}"
- ].join('\n')
- }
- ],
- i, l;
- for (i = 0 , l = arr.length; i < l; ++i) {
- calc.push(arr[i].c);
- }
- return {
- g: 1,
- c: calc.join(""),
- s: [
- arr[0].s,
- // year (required)
- "(?:",
- "-",
- arr[1].s,
- // month (optional)
- "(?:",
- "-",
- arr[2].s,
- // day (optional)
- "(?:",
- "(?:T| )?",
- // time delimiter -- either a "T" or a single blank space
- arr[3].s,
- ":",
- arr[4].s,
- // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
- "(?::",
- arr[5].s,
- ")?",
- // seconds (optional)
- "(?:(?:\\.|,)(\\d+))?",
- // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
- "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
- // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
- ")?",
- ")?",
- ")?"
- ].join("")
- };
- },
- U: {
- g: 1,
- c: "u = parseInt(results[{0}], 10);\n",
- s: "(-?\\d+)"
- }
- },
- // leading minus sign indicates seconds before UNIX epoch
- /* eslint-enable indent, max-len */
- compare: function(d1, d2, includeTime) {
- var s1, s2;
- if (typeof d1 === 'string') {
- d1 = Ext.Date.parse(d1);
- }
- if (typeof d2 === 'string') {
- d2 = Ext.Date.parse(d2);
- }
- s1 = Ext.Date.format(d1, 'C');
- s2 = Ext.Date.format(d2, 'C');
- if (!includeTime) {
- s1 = s1.substr(0, 10);
- // "YYYY-MM-DD".length === 10
- s2 = s2.substr(0, 10);
- }
- return (s1 < s2) ? -1 : ((s2 < s1) ? 1 : 0);
- },
- // Old Ext.Date prototype methods.
- /**
- * @private
- */
- dateFormat: function(date, format) {
- return utilDate.format(date, format);
- },
- /**
- * Compares if two dates are equal by comparing their values.
- * @param {Date} date1
- * @param {Date} date2
- * @return {Boolean} `true` if the date values are equal
- */
- isEqual: function(date1, date2) {
- // check we have 2 date objects
- if (date1 && date2) {
- return +date1 === +date2;
- }
- // one or both isn't a date, only equal if both are falsy
- return !(date1 || date2);
- },
- /**
- * Formats a date given the supplied format string.
- * @param {Date} date The date to format
- * @param {String} format The format string
- * @return {String} The formatted date or an empty string if date parameter is not
- * a JavaScript Date object
- */
- format: function(date, format) {
- var formatFunctions = utilDate.formatFunctions;
- if (!Ext.isDate(date)) {
- return '';
- }
- if (formatFunctions[format] == null) {
- utilDate.createFormat(format);
- }
- return formatFunctions[format].call(date) + '';
- },
- /**
- * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
- *
- * __Note:__ The date string returned by the JavaScript Date object's `toString()` method varies
- * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in
- * America). For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula
- * Standard Time)", `getTimezone()` first tries to get the timezone abbreviation from between
- * a pair of parentheses (which may or may not be present), failing which it proceeds to get
- * the timezone abbreviation from the GMT offset portion of the date string.
- *
- * var dt = new Date('9/17/2011');
- * console.log(Ext.Date.getTimezone(dt));
- *
- * @param {Date} date The date
- * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
- */
- getTimezone: function(date) {
- /* eslint-disable max-len, no-useless-escape, newline-per-chained-call */
- // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
- //
- // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
- // Safari : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone (same as FF)
- // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
- // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
- // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
- //
- // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
- // step 1: (?:\((.*)\) -- find timezone in parentheses
- // step 2: ([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?) -- if nothing was found in step 1, find timezone from timezone offset portion of date string
- // step 3: remove all non uppercase characters found in step 1 and 2
- return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
- },
- /* eslint-enable max-len, no-useless-escape, newline-per-chained-call */
- /**
- * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
- *
- * var dt = new Date('9/17/2011');
- * console.log(Ext.Date.getGMTOffset(dt));
- *
- * @param {Date} date The date
- * @param {Boolean} [colon=false] `true` to separate the hours and minutes with a colon.
- * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
- */
- getGMTOffset: function(date, colon) {
- var offset = date.getTimezoneOffset();
- return (offset > 0 ? "-" : "+") + Ext.String.leftPad(Math.floor(Math.abs(offset) / 60), 2, "0") + (colon ? ":" : "") + Ext.String.leftPad(Math.abs(offset % 60), 2, "0");
- },
- /**
- * Get the numeric day number of the year, adjusted for leap year.
- *
- * var dt = new Date('9/17/2011');
- * console.log(Ext.Date.getDayOfYear(dt)); // 259
- *
- * @param {Date} date The date
- * @return {Number} 0 to 364 (365 in leap years).
- */
- getDayOfYear: function(date) {
- var num = 0,
- d = utilDate.clone(date),
- m = date.getMonth(),
- i;
- for (i = 0 , d.setDate(1) , d.setMonth(0); i < m; d.setMonth(++i)) {
- num += utilDate.getDaysInMonth(d);
- }
- return num + date.getDate() - 1;
- },
- /**
- * Get the numeric ISO-8601 week number of the year.
- * (equivalent to the format specifier 'W', but without a leading zero).
- *
- * var dt = new Date('9/17/2011');
- * console.log(Ext.Date.getWeekOfYear(dt)); // 37
- *
- * @param {Date} date The date.
- * @return {Number} 1 to 53.
- * @method
- */
- getWeekOfYear: (function() {
- // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
- var ms1d = 86400000,
- // milliseconds in a day
- ms7d = 7 * ms1d;
- // milliseconds in a week
- return function(date) {
- // return a closure so constants get calculated only once
- /* eslint-disable-next-line max-len */
- var DC3 = nativeDate.UTC(date.getFullYear(), date.getMonth(), date.getDate() + 3) / ms1d,
- // an Absolute Day Number
- AWN = Math.floor(DC3 / 7),
- // an Absolute Week Number
- Wyr = new nativeDate(AWN * ms7d).getUTCFullYear();
- return AWN - Math.floor(nativeDate.UTC(Wyr, 0, 7) / ms7d) + 1;
- };
- }()),
- /**
- * Checks if the current date falls within a leap year.
- *
- * var dt = new Date('1/10/2011');
- * console.log(Ext.Date.isLeapYear(dt)); // false
- *
- * @param {Date} date The date
- * @return {Boolean} `true` if the current date falls within a leap year, `false` otherwise.
- */
- isLeapYear: function(date) {
- var year = date.getFullYear();
- return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)));
- },
- /**
- * Get the first day of the current month, adjusted for leap year. The returned value
- * is the numeric day index within the week (0-6) which can be used in conjunction with
- * the {@link #monthNames} array to retrieve the textual day name.
- *
- * var dt = new Date('1/10/2007'),
- * firstDay = Ext.Date.getFirstDayOfMonth(dt);
- *
- * console.log(Ext.Date.dayNames[firstDay]); // output: 'Monday'
- *
- * @param {Date} date The date
- * @return {Number} The day number (0-6).
- */
- getFirstDayOfMonth: function(date) {
- var day = (date.getDay() - (date.getDate() - 1)) % 7;
- return (day < 0) ? (day + 7) : day;
- },
- /**
- * Get the last day of the current month, adjusted for leap year. The returned value
- * is the numeric day index within the week (0-6) which can be used in conjunction with
- * the {@link #monthNames} array to retrieve the textual day name.
- *
- * var dt = new Date('1/10/2007'),
- * lastDay = Ext.Date.getLastDayOfMonth(dt);
- *
- * console.log(Ext.Date.dayNames[lastDay]); // output: 'Wednesday'
- *
- * @param {Date} date The date
- * @return {Number} The day number (0-6).
- */
- getLastDayOfMonth: function(date) {
- return utilDate.getLastDateOfMonth(date).getDay();
- },
- /**
- * Get the date of the first day of the month in which this date resides.
- * @param {Date} date The date
- * @return {Date}
- */
- getFirstDateOfMonth: function(date) {
- return new nativeDate(date.getFullYear(), date.getMonth(), 1);
- },
- /**
- * Get the date of the last day of the month in which this date resides.
- * @param {Date} date The date
- * @return {Date}
- */
- getLastDateOfMonth: function(date) {
- return new nativeDate(date.getFullYear(), date.getMonth(), utilDate.getDaysInMonth(date));
- },
- /**
- * Get the number of days in the current month, adjusted for leap year.
- * @param {Date} date The date
- * @return {Number} The number of days in the month.
- * @method
- */
- getDaysInMonth: (function() {
- var daysInMonth = [
- 31,
- 28,
- 31,
- 30,
- 31,
- 30,
- 31,
- 31,
- 30,
- 31,
- 30,
- 31
- ];
- return function(date) {
- // return a closure for efficiency
- var m = date.getMonth();
- return m === 1 && utilDate.isLeapYear(date) ? 29 : daysInMonth[m];
- };
- }()),
- /**
- * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
- * @param {Date} date The date
- * @return {String} 'st, 'nd', 'rd' or 'th'.
- * @locale
- */
- getSuffix: function(date) {
- switch (date.getDate()) {
- case 1:
- case 21:
- case 31:
- return "st";
- case 2:
- case 22:
- return "nd";
- case 3:
- case 23:
- return "rd";
- default:
- return "th";
- }
- },
- /**
- * Creates and returns a new Date instance with the exact same date value as the called
- * instance. Dates are copied and passed by reference, so if a copied date variable is modified
- * later, the original variable will also be changed. When the intention is to create a new
- * variable that will not modify the original instance, you should create a clone.
- *
- * Example of correctly cloning a date:
- *
- * //wrong way:
- * var orig = new Date('10/1/2006');
- * var copy = orig;
- * copy.setDate(5);
- * console.log(orig); // returns 'Thu Oct 05 2006'!
- *
- * //correct way:
- * var orig = new Date('10/1/2006'),
- * copy = Ext.Date.clone(orig);
- * copy.setDate(5);
- * console.log(orig); // returns 'Thu Oct 01 2006'
- *
- * @param {Date} date The date.
- * @return {Date} The new Date instance.
- */
- clone: function(date) {
- return new nativeDate(date.getTime());
- },
- /**
- * Checks if the current date is affected by Daylight Saving Time (DST).
- * @param {Date} date The date
- * @return {Boolean} `true` if the current date is affected by DST.
- */
- isDST: function(date) {
- // adapted from http://sencha.com/forum/showthread.php?p=247172#post247172
- // courtesy of @geoffrey.mcgill
- /* eslint-disable-next-line max-len */
- return new nativeDate(date.getFullYear(), 0, 1).getTimezoneOffset() !== date.getTimezoneOffset();
- },
- /**
- * Attempts to clear all time information from this Date by setting the time to midnight
- * of the same day, automatically adjusting for Daylight Saving Time (DST) where applicable.
- *
- * __Note:__ DST timezone information for the browser's host operating system is assumed to be
- * up-to-date.
- * @param {Date} date The date
- * @param {Boolean} [clone=false] `true` to create a clone of this date, clear the time and
- * return it.
- * @return {Date} this or the clone.
- */
- clearTime: function(date, clone) {
- var d, hr, c;
- // handles invalid dates preventing the browser from crashing.
- if (isNaN(date.getTime())) {
- return date;
- }
- if (clone) {
- return utilDate.clearTime(utilDate.clone(date));
- }
- // get current date before clearing time
- d = date.getDate();
- // clear time
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- // account for DST (i.e. day of month changed when setting hour = 0)
- if (date.getDate() !== d) {
- // note: DST adjustments are assumed to occur in multiples of 1 hour
- // (this is almost always the case)
- // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions
- // to this rule
- // increment hour until cloned date == current date
- /* eslint-disable-next-line max-len, curly, nonblock-statement-body-position */
- for (hr = 1 , c = utilDate.add(date, utilDate.HOUR, hr); c.getDate() !== d; hr++ , c = utilDate.add(date, utilDate.HOUR, hr)){}
- date.setDate(d);
- date.setHours(c.getHours());
- }
- return date;
- },
- /**
- * Provides a convenient method for performing basic date arithmetic. This method
- * does not modify the Date instance being called - it creates and returns
- * a new Date instance containing the resulting date value.
- *
- * Examples:
- *
- * // Basic usage:
- * var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);
- * console.log(dt); // returns 'Fri Nov 03 2006 00:00:00'
- *
- * // Negative values will be subtracted:
- * var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);
- * console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00'
- *
- * // Decimal values can be used:
- * var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
- * console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'
- *
- * @param {Date} date The date to modify
- * @param {String} interval A valid date interval enum value.
- * @param {Number} value The amount to add to the current date.
- * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
- * daylight savings boundaries.
- * @return {Date} The new Date instance.
- */
- add: function(date, interval, value, preventDstAdjust) {
- var d = utilDate.clone(date),
- base = 0,
- day, decimalValue;
- if (!interval || value === 0) {
- return d;
- }
- decimalValue = value - parseInt(value, 10);
- value = parseInt(value, 10);
- if (value) {
- switch (interval.toLowerCase()) {
- // See EXTJSIV-7418. We use setTime() here to deal with issues related to
- // the switchover that occurs when changing to daylight savings and vice
- // versa. setTime() handles this correctly where setHour/Minute/Second/Millisecond
- // do not. Let's assume the DST change occurs at 2am and we're incrementing using
- // add for 15 minutes at time. When entering DST, we should see:
- // 01:30am
- // 01:45am
- // 03:00am // skip 2am because the hour does not exist
- // ...
- // Similarly, leaving DST, we should see:
- // 01:30am
- // 01:45am
- // 01:00am // repeat 1am because that's the change over
- // 01:30am
- // 01:45am
- // 02:00am
- // ....
- //
- case utilDate.MILLI:
- if (preventDstAdjust) {
- d.setMilliseconds(d.getMilliseconds() + value);
- } else {
- d.setTime(d.getTime() + value);
- };
- break;
- case utilDate.SECOND:
- if (preventDstAdjust) {
- d.setSeconds(d.getSeconds() + value);
- } else {
- d.setTime(d.getTime() + value * 1000);
- };
- break;
- case utilDate.MINUTE:
- if (preventDstAdjust) {
- d.setMinutes(d.getMinutes() + value);
- } else {
- d.setTime(d.getTime() + value * 60 * 1000);
- };
- break;
- case utilDate.HOUR:
- if (preventDstAdjust) {
- d.setHours(d.getHours() + value);
- } else {
- d.setTime(d.getTime() + value * 60 * 60 * 1000);
- };
- break;
- case utilDate.DAY:
- if (preventDstAdjust === false) {
- d.setTime(d.getTime() + value * 24 * 60 * 60 * 1000);
- } else {
- d.setDate(d.getDate() + value);
- };
- break;
- case utilDate.MONTH:
- day = date.getDate();
- if (day > 28) {
- /* eslint-disable-next-line max-len */
- day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.MONTH, value)).getDate());
- };
- d.setDate(day);
- d.setMonth(date.getMonth() + value);
- break;
- case utilDate.YEAR:
- day = date.getDate();
- if (day > 28) {
- /* eslint-disable-next-line max-len */
- day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.YEAR, value)).getDate());
- };
- d.setDate(day);
- d.setFullYear(date.getFullYear() + value);
- break;
- }
- }
- if (decimalValue) {
- switch (interval.toLowerCase()) {
- /* eslint-disable no-multi-spaces */
- case utilDate.MILLI:
- base = 1;
- break;
- case utilDate.SECOND:
- base = 1000;
- break;
- case utilDate.MINUTE:
- base = 1000 * 60;
- break;
- case utilDate.HOUR:
- base = 1000 * 60 * 60;
- break;
- case utilDate.DAY:
- base = 1000 * 60 * 60 * 24;
- break;
- /* eslint-enable no-multi-spaces */
- case utilDate.MONTH:
- day = utilDate.getDaysInMonth(d);
- base = 1000 * 60 * 60 * 24 * day;
- break;
- case utilDate.YEAR:
- day = (utilDate.isLeapYear(d) ? 366 : 365);
- base = 1000 * 60 * 60 * 24 * day;
- break;
- }
- if (base) {
- d.setTime(d.getTime() + base * decimalValue);
- }
- }
- return d;
- },
- /**
- * Provides a convenient method for performing basic date arithmetic. This method
- * does not modify the Date instance being called - it creates and returns
- * a new Date instance containing the resulting date value.
- *
- * Examples:
- *
- * // Basic usage:
- * var dt = Ext.Date.subtract(new Date('10/29/2006'), Ext.Date.DAY, 5);
- * console.log(dt); // returns 'Tue Oct 24 2006 00:00:00'
- *
- * // Negative values will be added:
- * var dt2 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, -5);
- * console.log(dt2); // returns 'Fri Oct 6 2006 00:00:00'
- *
- * // Decimal values can be used:
- * var dt3 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
- * console.log(dt3); // returns 'Fri Sep 29 2006 06:00:00'
- *
- * @param {Date} date The date to modify
- * @param {String} interval A valid date interval enum value.
- * @param {Number} value The amount to subtract from the current date.
- * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
- * daylight savings boundaries.
- * @return {Date} The new Date instance.
- */
- subtract: function(date, interval, value, preventDstAdjust) {
- return utilDate.add(date, interval, -value, preventDstAdjust);
- },
- /**
- * Checks if a date falls on or between the given start and end dates.
- * @param {Date} date The date to check
- * @param {Date} start Start date
- * @param {Date} end End date
- * @return {Boolean} `true` if this date falls on or between the given start and end dates.
- */
- between: function(date, start, end) {
- var t = date.getTime();
- return start.getTime() <= t && t <= end.getTime();
- },
- /**
- * Checks if the date is a weekend day. Uses {@link #weekendDays}.
- * @param {Date} date The date.
- * @return {Boolean} `true` if the day falls on a weekend.
- *
- * @since 6.2.0
- */
- isWeekend: function(date) {
- return Ext.Array.indexOf(this.weekendDays, date.getDay()) > -1;
- },
- /**
- * Converts the passed UTC date into a local date.
- * For example, if the passed date is:
- * `Wed Jun 01 2016 00:10:00 GMT+1000 (AUS Eastern Standard Time)`, then
- * the returned date will be `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`.
- * @param {Date} d The date to convert.
- * @return {Date} The date as a local. Does not modify the passed date.
- *
- * @since 6.2.0
- */
- utcToLocal: function(d) {
- return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
- },
- /**
- * Converts the passed local date into a UTC date.
- * For example, if the passed date is:
- * `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`, then
- * the returned date will be `Wed Jun 01 2016 10:00:00 GMT+1000 (AUS Eastern Standard Time)`.
- * @param {Date} d The date to convert.
- * @return {Date} The date as UTC. Does not modify the passed date.
- *
- * @since 6.2.0
- */
- localToUtc: function(d) {
- return utilDate.utc(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
- },
- /**
- * Create a UTC date.
- * @param {Number} year The year.
- * @param {Number} month The month.
- * @param {Number} day The day.
- * @param {Number} [hour=0] The hour.
- * @param {Number} [min=0] The minutes.
- * @param {Number} [s=0] The seconds.
- * @param {Number} [ms=0] The milliseconds.
- * @return {Date} The UTC date.
- *
- * @since 6.2.0
- */
- utc: function(year, month, day, hour, min, s, ms) {
- return new Date(Date.UTC(year, month, day, hour || 0, min || 0, s || 0, ms || 0));
- },
- // Maintains compatibility with old static and prototype window.Date methods.
- compat: function() {
- var p,
- /* eslint-disable max-len */
- statics = [
- 'useStrict',
- 'formatCodeToRegex',
- 'parseFunctions',
- 'parseRegexes',
- 'formatFunctions',
- 'y2kYear',
- 'MILLI',
- 'SECOND',
- 'MINUTE',
- 'HOUR',
- 'DAY',
- 'MONTH',
- 'YEAR',
- 'defaults',
- 'dayNames',
- 'monthNames',
- 'monthNumbers',
- 'getShortMonthName',
- 'getShortDayName',
- 'getMonthNumber',
- 'formatCodes',
- 'isValid',
- 'parseDate',
- 'getFormatCode',
- 'createFormat',
- 'createParser',
- 'parseCodes'
- ],
- proto = [
- 'dateFormat',
- 'format',
- 'getTimezone',
- 'getGMTOffset',
- 'getDayOfYear',
- 'getWeekOfYear',
- 'isLeapYear',
- 'getFirstDayOfMonth',
- 'getLastDayOfMonth',
- 'getDaysInMonth',
- 'getSuffix',
- 'clone',
- 'isDST',
- 'clearTime',
- 'add',
- 'between'
- ],
- /* eslint-enable max-len */
- sLen = statics.length,
- pLen = proto.length,
- stat, prot, s;
- // Append statics
- for (s = 0; s < sLen; s++) {
- stat = statics[s];
- nativeDate[stat] = utilDate[stat];
- }
- // Append to prototype
- for (p = 0; p < pLen; p++) {
- prot = proto[p];
- nativeDate.prototype[prot] = function() {
- var args = Array.prototype.slice.call(arguments);
- args.unshift(this);
- return utilDate[prot].apply(utilDate, args);
- };
- }
- },
- /**
- * Calculate how many units are there between two time.
- * @param {Date} min The first time.
- * @param {Date} max The second time.
- * @param {String} unit The unit. This unit is compatible with the date interval constants.
- * @return {Number} The maximum number n of units that min + n * unit <= max.
- */
- diff: function(min, max, unit) {
- var diff = +max - min,
- est;
- switch (unit) {
- case utilDate.MILLI:
- return diff;
- case utilDate.SECOND:
- return Math.floor(diff / 1000);
- case utilDate.MINUTE:
- return Math.floor(diff / 60000);
- case utilDate.HOUR:
- return Math.floor(diff / 3600000);
- case utilDate.DAY:
- return Math.floor(diff / 86400000);
- case 'w':
- return Math.floor(diff / 604800000);
- case utilDate.MONTH:
- est = (max.getFullYear() * 12 + max.getMonth()) - (min.getFullYear() * 12 + min.getMonth());
- if (utilDate.add(min, unit, est) > max) {
- return est - 1;
- };
- return est;
- case utilDate.YEAR:
- est = max.getFullYear() - min.getFullYear();
- if (utilDate.add(min, unit, est) > max) {
- return est - 1;
- } else {
- return est;
- };
- }
- },
- /**
- * Align the date to `unit`.
- * @param {Date} date The date to be aligned.
- * @param {String} unit The unit. This unit is compatible with the date interval constants.
- * @param {Number} step
- * @return {Date} The aligned date.
- */
- align: function(date, unit, step) {
- var num = new nativeDate(+date);
- switch (unit.toLowerCase()) {
- case utilDate.MILLI:
- return num;
- case utilDate.SECOND:
- num.setUTCSeconds(num.getUTCSeconds() - num.getUTCSeconds() % step);
- num.setUTCMilliseconds(0);
- return num;
- case utilDate.MINUTE:
- num.setUTCMinutes(num.getUTCMinutes() - num.getUTCMinutes() % step);
- num.setUTCSeconds(0);
- num.setUTCMilliseconds(0);
- return num;
- case utilDate.HOUR:
- num.setUTCHours(num.getUTCHours() - num.getUTCHours() % step);
- num.setUTCMinutes(0);
- num.setUTCSeconds(0);
- num.setUTCMilliseconds(0);
- return num;
- case utilDate.DAY:
- if (step === 7 || step === 14) {
- num.setUTCDate(num.getUTCDate() - num.getUTCDay() + 1);
- };
- num.setUTCHours(0);
- num.setUTCMinutes(0);
- num.setUTCSeconds(0);
- num.setUTCMilliseconds(0);
- return num;
- case utilDate.MONTH:
- num.setUTCMonth(num.getUTCMonth() - (num.getUTCMonth() - 1) % step, 1);
- num.setUTCHours(0);
- num.setUTCMinutes(0);
- num.setUTCSeconds(0);
- num.setUTCMilliseconds(0);
- return num;
- case utilDate.YEAR:
- num.setUTCFullYear(num.getUTCFullYear() - num.getUTCFullYear() % step, 1, 1);
- num.setUTCHours(0);
- num.setUTCMinutes(0);
- num.setUTCSeconds(0);
- num.setUTCMilliseconds(0);
- return date;
- }
- },
- flexParse: function(inDate, defaultFormat) {
- var parts = datePartsRe.exec(inDate),
- firstFormatToken, day, month, year, result;
- // Regex couldn't parse; invalid date.
- if (!parts) {
- return Ext.Date.parse(inDate, 'C');
- }
- // handle "YYYY-MM-DDThh:mm:ssZ"
- // Use this format string to work out what is the desired date order, d/m/y|m/d/y|y/m/d
- if (!defaultFormat) {
- defaultFormat = Ext.Date.defaultFormat;
- }
- // Now the parts array will be:
- // [0] - the full string
- // [1] - The first token if numeric
- // [2] - The first token if alphabetic
- // [3] - The second token if numeric
- // [4] - The second token if alphabetic
- // [5] - The third token.
- // If they've used all numeric parts, we have to use locale order
- // to decide what the parts are. We have three valid choices:
- // d/m/y
- // m/d/y
- // y/m/d
- if (!(parts[2] || parts[4])) {
- firstFormatToken = defaultFormat[0];
- // Not in a y/m/d locale and (first character is a day token, or first
- // token is definitely a day) - it's d/m/y
- // eslint-disable-next-line no-undef
- if (!yearInfo[firstFormatToken] && (dayInfo[firstFormatToken] || (parts[1] > 12 && parts[3] < 13))) {
- day = parseInt(parts[1]);
- month = parseInt(parts[3]) - 1;
- year = parseInt(parts[5]);
- } else if (!yearInfo[firstFormatToken] && (monthInfo[firstFormatToken] || (parts[3] > 12 && parts[1] < 13))) {
- // Not in a y/m/d locale and (first charecter is a month token, or
- // first token is definitely a month) - it's m/d/y
- month = parseInt(parts[1]) - 1;
- day = parseInt(parts[3]);
- year = parseInt(parts[5]);
- } else {
- // y/m/d is the only other valid format
- year = parseInt(parts[1]);
- month = parseInt(parts[3]) - 1;
- day = parseInt(parts[5]);
- }
- } else {
- // They've used an alphabetic month
- // Two alphabetic tokens - not valid.
- if (parts[2] && parts[4]) {
- return null;
- }
- // m/d/y
- if (parts[2]) {
- month = utilDate.monthNumbers[Ext.String.capitalize(parts[2].substr(0, 3))];
- day = parseInt(parts[3]);
- year = parseInt(parts[5]);
- } else {
- // d/m/y
- day = parseInt(parts[1]);
- month = utilDate.monthNumbers[Ext.String.capitalize(parts[4].substr(0, 3))];
- year = parseInt(parts[5]);
- }
- }
- // Alphabetic month couldn't be found, or numeric one out of range.
- if (isNaN(month) || (month < 0 || month > 11)) {
- return null;
- }
- // Short years must be upgraded according to the y2kYear setting
- if (year < utilDate.y2kYear) {
- year += 2000;
- }
- // Create the first of the month so that we can check the validity of the day
- result = new Date(year, month, 1, 0, 0, 0);
- // Validate the day of month.
- if (day < 1 || day > Ext.Date.getDaysInMonth(result)) {
- return null;
- }
- result.setDate(day);
- return result;
- }
- };
- utilDate.parseCodes.C = utilDate.parseCodes.c;
- return utilDate;
- }());
- /**
- * @class Ext.Function
- *
- * A collection of useful static methods to deal with function callbacks.
- * @singleton
- */
- /* eslint-disable indent */
- Ext.Function = (function() {
- // @define Ext.lang.Function
- // @define Ext.Function
- // @require Ext
- // @require Ext.lang.Array
- var lastTime = 0,
- animFrameId,
- animFrameHandlers = [],
- animFrameNoArgs = [],
- idSource = 0,
- animFrameMap = {},
- slice = Array.prototype.slice,
- win = window,
- global = Ext.global,
- // We disable setImmediate in unit tests because it derails internal Jasmine queue
- hasImmediate = !Ext.disableImmediate && !!(global.setImmediate && global.clearImmediate),
- requestAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || function(callback) {
- var currTime = Ext.now(),
- timeToCall = Math.max(0, 16 - (currTime - lastTime)),
- timerFn = function() {
- callback(currTime + timeToCall);
- },
- id;
- timerFn.$origFn = callback.$origFn || callback;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- id = win.setTimeout(timerFn, timeToCall);
- lastTime = currTime + timeToCall;
- return id;
- },
- fireHandlers = function() {
- var len = animFrameHandlers.length,
- id, i, handler;
- animFrameId = null;
- var timer;
- // eslint-disable-line vars-on-top
- // Fire all animation frame handlers in one go
- for (i = 0; i < len; i++) {
- handler = animFrameHandlers[i];
- id = handler[3];
- // Check if this timer has been canceled; its map entry is going to be removed
- if (animFrameMap[id]) {
- delete animFrameMap[id];
- timer = Ext.Timer.get(id, 'raf');
- if (timer) {
- timer.tick();
- }
- handler[0].apply(handler[1] || global, handler[2] || animFrameNoArgs);
- if (timer) {
- timer.tock();
- }
- }
- }
- // Clear all fired animation frame handlers, don't forget that new handlers
- // could have been created in user handler functions called in the loop above
- animFrameHandlers = animFrameHandlers.slice(len);
- },
- fireElevatedHandlers = function() {
- Ext.elevate(fireHandlers);
- },
- ExtFunction = {
- /**
- * A very commonly used method throughout the framework. It acts as a wrapper around
- * another method which originally accepts 2 arguments for `name` and `value`.
- * The wrapped function then allows "flexible" value setting of either:
- *
- * - `name` and `value` as 2 arguments
- * - one single object argument with multiple key - value pairs
- *
- * For example:
- *
- * var setValue = Ext.Function.flexSetter(function(name, value) {
- * this[name] = value;
- * });
- *
- * // Afterwards
- * // Setting a single name - value
- * setValue('name1', 'value1');
- *
- * // Settings multiple name - value pairs
- * setValue({
- * name1: 'value1',
- * name2: 'value2',
- * name3: 'value3'
- * });
- *
- * @param {Function} setter The single value setter method.
- * @param {String} setter.name The name of the value being set.
- * @param {Object} setter.value The value being set.
- * @return {Function}
- */
- flexSetter: function(setter) {
- return function(name, value) {
- var k, i;
- if (name !== null) {
- if (typeof name !== 'string') {
- for (k in name) {
- if (name.hasOwnProperty(k)) {
- setter.call(this, k, name[k]);
- }
- }
- if (Ext.enumerables) {
- for (i = Ext.enumerables.length; i--; ) {
- k = Ext.enumerables[i];
- if (name.hasOwnProperty(k)) {
- setter.call(this, k, name[k]);
- }
- }
- }
- } else {
- setter.call(this, name, value);
- }
- }
- return this;
- };
- },
- /**
- * Create a new function from the provided `fn`, change `this` to the provided scope,
- * optionally overrides arguments for the call. Defaults to the arguments passed by
- * the caller.
- *
- * {@link Ext#bind Ext.bind} is alias for {@link Ext.Function#bind Ext.Function.bind}
- *
- * **NOTE:** This method is similar to the native `bind()` method. The major difference
- * is in the way the parameters are passed. This method expects an array of parameters,
- * and if supplied, it does not automatically pass forward parameters from the bound
- * function:
- *
- * function foo (a, b, c) {
- * console.log(a, b, c);
- * }
- *
- * var nativeFn = foo.bind(this, 1, 2);
- * var extFn = Ext.Function.bind(foo, this, [1, 2]);
- *
- * nativeFn(3); // 1, 2, 3
- * extFn(3); // 1, 2, undefined
- *
- * This method is unavailable natively on IE8 and IE/Quirks but Ext JS provides a
- * "polyfill" to emulate the important features of the standard `bind` method. In
- * particular, the polyfill only provides binding of "this" and optional arguments.
- *
- * @param {Function} fn The function to delegate.
- * @param {Object} [scope] The scope (`this` reference) in which the function
- * is executed.
- * **If omitted, defaults to the global environment object (usually the browser `window`).**
- * @param {Array} [args] Overrides arguments for the call. (Defaults to
- * the arguments passed by the caller).
- * @param {Boolean/Number} [appendArgs] if `true` the `args` are appended to the
- * arguments passed to the returned wrapper (by default these arguments are ignored).
- * If a number then the `args` are inserted at the specified position.
- * @return {Function} The bound wrapper function.
- */
- bind: function(fn, scope, args, appendArgs) {
- // Function.prototype.bind is polyfilled in IE8, otherwise native
- if (arguments.length <= 2) {
- return fn.bind(scope);
- }
- var method = fn;
- // eslint-disable-line vars-on-top
- return function() {
- var callArgs = args || arguments;
- if (appendArgs === true) {
- callArgs = slice.call(arguments, 0);
- callArgs = callArgs.concat(args);
- } else if (typeof appendArgs === 'number') {
- callArgs = slice.call(arguments, 0);
- // copy arguments first
- Ext.Array.insert(callArgs, appendArgs, args);
- }
- return method.apply(scope || global, callArgs);
- };
- },
- /**
- * Captures the given parameters for a later call to `Ext.callback`. This binding is
- * most useful for resolving scopes for example to an `Ext.app.ViewController`.
- *
- * The arguments match that of `Ext.callback` except for the `args` which, if provided
- * to this method, are prepended to any arguments supplied by the eventual caller of
- * the returned function.
- *
- * @return {Function} A function that, when called, uses `Ext.callback` to call the
- * captured `callback`.
- * @since 5.0.0
- */
- bindCallback: function(callback, scope, args, delay, caller) {
- return function() {
- var a = slice.call(arguments);
- return Ext.callback(callback, scope, args ? args.concat(a) : a, delay, caller);
- };
- },
- /**
- * Create a new function from the provided `fn`, the arguments of which are pre-set
- * to `args`. New arguments passed to the newly created callback when it's invoked
- * are appended after the pre-set ones.
- * This is especially useful when creating callbacks.
- *
- * For example:
- *
- * var originalFunction = function(){
- * alert(Ext.Array.from(arguments).join(' '));
- * };
- *
- * var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
- *
- * callback(); // alerts 'Hello World'
- * callback('by Me'); // alerts 'Hello World by Me'
- *
- * {@link Ext#pass Ext.pass} is alias for {@link Ext.Function#pass Ext.Function.pass}
- *
- * @param {Function} fn The original function.
- * @param {Array} args The arguments to pass to new callback.
- * @param {Object} scope (optional) The scope (`this` reference) in which the function
- * is executed.
- * @return {Function} The new callback function.
- */
- pass: function(fn, args, scope) {
- if (!Ext.isArray(args)) {
- if (Ext.isIterable(args)) {
- args = Ext.Array.clone(args);
- } else {
- args = args !== undefined ? [
- args
- ] : [];
- }
- }
- return function() {
- var fnArgs = args.slice();
- fnArgs.push.apply(fnArgs, arguments);
- return fn.apply(scope || this, fnArgs);
- };
- },
- /**
- * Create an alias to the provided method property with name `methodName` of `object`.
- * Note that the execution scope will still be bound to the provided `object` itself.
- *
- * @param {Object/Function} object
- * @param {String} methodName
- * @return {Function} aliasFn
- */
- alias: function(object, methodName) {
- return function() {
- return object[methodName].apply(object, arguments);
- };
- },
- /**
- * Create a "clone" of the provided method. The returned method will call the given
- * method passing along all arguments and the "this" pointer and return its result.
- *
- * @param {Function} method
- * @return {Function} cloneFn
- */
- clone: function(method) {
- var newMethod, prop;
- newMethod = function() {
- return method.apply(this, arguments);
- };
- for (prop in method) {
- if (method.hasOwnProperty(prop)) {
- newMethod[prop] = method[prop];
- }
- }
- return newMethod;
- },
- /**
- * Creates an interceptor function. The passed function is called before the original one.
- * If it returns false, the original one is not called. The resulting function returns
- * the results of the original function. The passed function is called with the parameters
- * of the original function. Example usage:
- *
- * var sayHi = function(name){
- * alert('Hi, ' + name);
- * };
- *
- * sayHi('Fred'); // alerts "Hi, Fred"
- *
- * // create a new function that validates input without
- * // directly modifying the original function:
- * var sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){
- * return name === 'Brian';
- * });
- *
- * sayHiToFriend('Fred'); // no alert
- * sayHiToFriend('Brian'); // alerts "Hi, Brian"
- *
- * @param {Function} origFn The original function.
- * @param {Function} newFn The function to call before the original.
- * @param {Object} [scope] The scope (`this` reference) in which the passed function
- * is executed. **If omitted, defaults to the scope in which the original function
- * is called or the browser window.**
- * @param {Object} [returnValue=null] The value to return if the passed function return
- * `false`.
- * @return {Function} The new function.
- */
- createInterceptor: function(origFn, newFn, scope, returnValue) {
- if (!Ext.isFunction(newFn)) {
- return origFn;
- } else {
- returnValue = Ext.isDefined(returnValue) ? returnValue : null;
- return function() {
- var me = this,
- args = arguments;
- return (newFn.apply(scope || me || global, args) !== false) ? origFn.apply(me || global, args) : returnValue;
- };
- }
- },
- /**
- * Creates a delegate (callback) which, when called, executes after a specific delay.
- *
- * @param {Function} fn The function which will be called on a delay when the returned
- * function is called. Optionally, a replacement (or additional) argument list
- * may be specified.
- * @param {Number} delay The number of milliseconds to defer execution by whenever called.
- * @param {Object} scope (optional) The scope (`this` reference) used by the function
- * at execution time.
- * @param {Array} args (optional) Override arguments for the call.
- * (Defaults to the arguments passed by the caller)
- * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args
- * instead of overriding, if a number the args are inserted at the specified position.
- * @return {Function} A function which, when called, executes the original function
- * after the specified delay.
- */
- createDelayed: function(fn, delay, scope, args, appendArgs) {
- var boundFn = fn;
- if (scope || args) {
- boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
- }
- return function() {
- var me = this,
- args = slice.call(arguments),
- timerFn, timerId;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- timerFn = function() {
- Ext.elevate(boundFn, me, args, timer);
- };
- // eslint-disable-line comma-style
- timerId = setTimeout(timerFn, delay);
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('timeout', timerId, {
- type: 'createDelayed',
- fn: fn,
- timerFn: timerFn
- });
- };
- },
- /**
- * Calls function `fn` after the number of milliseconds specified, optionally with
- * a specific `scope` (`this` pointer).
- *
- * Example usage:
- *
- * var sayHi = function(name) {
- * alert('Hi, ' + name);
- * }
- *
- * // executes immediately:
- * sayHi('Fred');
- *
- * // executes after 2 seconds:
- * Ext.defer(sayHi, 2000, this, ['Fred']);
- *
- * The following syntax is useful for scheduling anonymous functions:
- *
- * Ext.defer(function() {
- * alert('Anonymous');
- * }, 100);
- *
- * NOTE: The `Ext.Function.defer()` method is an alias for `Ext.defer()`.
- *
- * @param {Function} fn The function to defer.
- * @param {Number} millis The number of milliseconds for the `setTimeout` call
- * (if less than or equal to 0 the function is executed immediately).
- * @param {Object} scope (optional) The scope (`this` reference) in which the function
- * is executed. **If omitted, defaults to the browser window.**
- * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed
- * by the caller.
- * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
- * instead of overriding, or, if a number, then the args are inserted at the specified
- * position.
- * @return {Number} The timeout id that can be used with `Ext.undefer`.
- */
- defer: function(fn, millis, scope, args, appendArgs) {
- var timerId = 0,
- timerFn, boundFn;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- if (!scope && !args && !appendArgs) {
- boundFn = fn;
- } else {
- boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
- }
- if (millis > 0) {
- timerFn = function() {
- Ext.elevate(boundFn, null, null, timer);
- };
- // eslint-disable-line comma-style
- timerId = setTimeout(timerFn, millis);
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('timeout', timerId, {
- type: 'defer',
- fn: fn,
- timerFn: timerFn
- });
- } else {
- boundFn();
- }
- return timerId;
- },
- /**
- * Calls the function `fn` repeatedly at a given interval, optionally with a
- * specific `scope` (`this` pointer).
- *
- * var sayHi = function(name) {
- * console.log('Hi, ' + name);
- * }
- *
- * // executes every 2 seconds:
- * var timerId = Ext.interval(sayHi, 2000, this, ['Fred']);
- *
- * The timer is stopped by:
- *
- * Ext.uninterval(timerId);
- *
- * NOTE: The `Ext.Function.interval()` method is an alias for `Ext.interval()`.
- *
- * @param {Function} fn The function to defer.
- * @param {Number} millis The number of milliseconds for the `setInterval` call
- * @param {Object} scope (optional) The scope (`this` reference) in which the function
- * is executed. **If omitted, defaults to the browser window.**
- * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments
- * passed by the caller.
- * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
- * instead of overriding, or, if a number, then the args are inserted at the specified
- * position.
- * @return {Number} The interval id that can be used with `Ext.uninterval`.
- */
- interval: function(fn, millis, scope, args, appendArgs) {
- var timerFn, timerId, boundFn;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
- timerFn = function() {
- Ext.elevate(boundFn, null, null, timer);
- };
- // eslint-disable-line comma-style
- timerId = setInterval(timerFn, millis);
- timerFn.$origFn = boundFn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('interval', timerId, {
- type: 'interval',
- fn: fn,
- timerFn: timerFn
- });
- return timerId;
- },
- /**
- * Create a combined function call sequence of the original function + the passed function.
- * The resulting function returns the results of the original function.
- * The passed function is called with the parameters of the original function.
- * Example usage:
- *
- * var sayHi = function(name){
- * alert('Hi, ' + name);
- * };
- *
- * sayHi('Fred'); // alerts "Hi, Fred"
- *
- * var sayGoodbye = Ext.Function.createSequence(sayHi, function(name){
- * alert('Bye, ' + name);
- * });
- *
- * sayGoodbye('Fred'); // both alerts show
- *
- * @param {Function} originalFn The original function.
- * @param {Function} newFn The function to sequence.
- * @param {Object} [scope] The scope (`this` reference) in which the passed function
- * is executed. If omitted, defaults to the scope in which the original function is called
- * or the default global environment object (usually the browser window).
- * @return {Function} The new function.
- */
- createSequence: function(originalFn, newFn, scope) {
- if (!newFn) {
- return originalFn;
- } else {
- return function() {
- var result = originalFn.apply(this, arguments);
- newFn.apply(scope || this, arguments);
- return result;
- };
- }
- },
- /**
- * Creates a delegate function, optionally with a bound scope which, when called, buffers
- * the execution of the passed function for the configured number of milliseconds.
- * If called again within that period, the impending invocation will be canceled, and the
- * timeout period will begin again.
- *
- * @param {Function} fn The function to invoke on a buffered timer.
- * @param {Number} buffer The number of milliseconds by which to buffer the invocation
- * of the function.
- * @param {Object} [scope] The scope (`this` reference) in which.
- * the passed function is executed. If omitted, defaults to the scope specified
- * by the caller.
- * @param {Array} [args] Override arguments for the call. Defaults to the arguments
- * passed by the caller.
- * @return {Function} A function which invokes the passed function after buffering
- * for the specified time.
- */
- createBuffered: function(fn, buffer, scope, args) {
- var timerId,
- result = function() {
- var callArgs = args || slice.call(arguments, 0),
- me = scope || this,
- timerFn;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- if (timerId) {
- Ext.undefer(timerId);
- }
- timerFn = function() {
- Ext.elevate(fn, me, callArgs, timer);
- };
- // eslint-disable-line comma-style
- result.timer = timerId = setTimeout(timerFn, buffer);
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('timeout', timerId, {
- type: 'createBuffered',
- fn: fn,
- timerFn: timerFn
- });
- };
- return result;
- },
- /**
- * Creates a wrapped function that, when invoked, defers execution until the next
- * animation frame
- * @private
- * @param {Function} fn The function to call.
- * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
- * Defaults to the window object.
- * @param {Array} [args] The argument list to pass to the function.
- * @param {Number} [queueStrategy=3] A bit flag that indicates how multiple calls to
- * the returned function within the same animation frame should be handled.
- *
- * - 1: All calls will be queued - FIFO order
- * - 2: Only the first call will be queued
- * - 3: The last call will replace all previous calls
- *
- * @return {Function}
- */
- createAnimationFrame: function(fn, scope, args, queueStrategy) {
- var boundFn, timerId;
- queueStrategy = queueStrategy || 3;
- boundFn = function() {
- var timerFn,
- callArgs = args || slice.call(arguments, 0);
- scope = scope || this;
- if (queueStrategy === 3 && timerId) {
- ExtFunction.cancelAnimationFrame(timerId);
- }
- if ((queueStrategy & 1) || !timerId) {
- timerFn = function() {
- timerId = boundFn.timerId = null;
- fn.apply(scope, callArgs);
- };
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timerId = boundFn.timerId = ExtFunction.requestAnimationFrame(timerFn);
- }
- };
- return boundFn;
- },
- /**
- * @private
- * Schedules the passed function to be called on the next animation frame.
- * @param {Function} fn The function to call.
- * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
- * Defaults to the window object.
- * @param {Mixed[]} [args] The argument list to pass to the function.
- *
- * @return {Number} Timer id for the new animation frame to use when canceling it.
- */
- requestAnimationFrame: function(fn, scope, args) {
- var id = ++idSource,
- // Ids start at 1
- handler = slice.call(arguments, 0);
- handler[3] = id;
- animFrameMap[id] = 1;
- // A flag to indicate that the timer exists
- Ext.Timer.created('raf', id, {
- type: 'raf',
- fn: fn
- });
- // We might be in fireHandlers at this moment but this new entry will not
- // be executed until the next frame
- animFrameHandlers.push(handler);
- if (!animFrameId) {
- animFrameId = requestAnimFrame(fireElevatedHandlers);
- }
- return id;
- },
- cancelAnimationFrame: function(id) {
- // Don't remove any handlers from animFrameHandlers array, because
- // the might be in use at the moment (when cancelAnimationFrame is called).
- // Just remove the handler id from the map so it will not be executed
- delete animFrameMap[id];
- Ext.Timer.cancel('raf', id);
- },
- /**
- * Creates a throttled version of the passed function which, when called repeatedly and
- * rapidly, invokes the passed function only after a certain interval has elapsed since the
- * previous invocation.
- *
- * This is useful for wrapping functions which may be called repeatedly, such as
- * a handler of a mouse move event when the processing is expensive.
- *
- * @param {Function} fn The function to execute at a regular time interval.
- * @param {Number} interval The interval in milliseconds on which the passed function
- * is executed.
- * @param {Object} [scope] The scope (`this` reference) in which
- * the passed function is executed. If omitted, defaults to the scope specified
- * by the caller.
- * @return {Function} A function which invokes the passed function at the specified
- * interval.
- */
- createThrottled: function(fn, interval, scope) {
- var lastCallTime = 0,
- elapsed, lastArgs, timerId,
- execute = function() {
- fn.apply(scope, lastArgs);
- lastCallTime = Ext.now();
- lastArgs = timerId = null;
- };
- execute.$origFn = fn.$origFn || fn;
- execute.$skipTimerCheck = execute.$origFn.$skipTimerCheck;
- return function() {
- // Use scope of last call unless the creator specified a scope
- if (!scope) {
- scope = this;
- }
- elapsed = Ext.now() - lastCallTime;
- lastArgs = Ext.Array.slice(arguments);
- // If this is the first invocation, or the throttle interval has been reached,
- // clear any pending invocation, and call the target function now.
- if (elapsed >= interval) {
- Ext.undefer(timerId);
- execute();
- }
- // Throttle interval has not yet been reached. Only set the timer to fire
- // if not already set.
- else if (!timerId) {
- timerId = Ext.defer(execute, interval - elapsed);
- }
- };
- },
- /**
- * Wraps the passed function in a barrier function which will call the passed function
- * after the passed number of invocations.
- * @param {Number} count The number of invocations which will result in the calling
- * of the passed function.
- * @param {Function} fn The function to call after the required number of invocations.
- * @param {Object} scope The scope (`this` reference) in which the function will be called.
- */
- createBarrier: function(count, fn, scope) {
- var barrierFn = function() {
- if (!--count) {
- fn.apply(scope, arguments);
- }
- };
- barrierFn.$origFn = fn.$origFn || fn;
- barrierFn.$skipTimerCheck = barrierFn.$origFn.$skipTimerCheck;
- return barrierFn;
- },
- /**
- * Adds behavior to an existing method that is executed before the
- * original behavior of the function. For example:
- *
- * var soup = {
- * contents: [],
- * add: function(ingredient) {
- * this.contents.push(ingredient);
- * }
- * };
- * Ext.Function.interceptBefore(soup, "add", function(ingredient){
- * if (!this.contents.length && ingredient !== "water") {
- * // Always add water to start with
- * this.contents.push("water");
- * }
- * });
- * soup.add("onions");
- * soup.add("salt");
- * soup.contents; // will contain: water, onions, salt
- *
- * @param {Object} object The target object
- * @param {String} methodName Name of the method to override
- * @param {Function} fn Function with the new behavior. It will
- * be called with the same arguments as the original method. The
- * return value of this function will be the return value of the
- * new method.
- * @param {Object} [scope] The scope to execute the interceptor function.
- * Defaults to the object.
- * @return {Function} The new function just created.
- */
- interceptBefore: function(object, methodName, fn, scope) {
- var method = object[methodName] || Ext.emptyFn;
- return (object[methodName] = function() {
- var ret = fn.apply(scope || this, arguments);
- method.apply(this, arguments);
- return ret;
- });
- },
- /**
- * Adds behavior to an existing method that is executed after the
- * original behavior of the function. For example:
- *
- * var soup = {
- * contents: [],
- * add: function(ingredient) {
- * this.contents.push(ingredient);
- * }
- * };
- * Ext.Function.interceptAfter(soup, "add", function(ingredient){
- * // Always add a bit of extra salt
- * this.contents.push("salt");
- * });
- * soup.add("water");
- * soup.add("onions");
- * soup.contents; // will contain: water, salt, onions, salt
- *
- * @param {Object} object The target object
- * @param {String} methodName Name of the method to override
- * @param {Function} fn Function with the new behavior. It will
- * be called with the same arguments as the original method. The
- * return value of this function will be the return value of the
- * new method.
- * @param {Object} [scope] The scope to execute the interceptor function.
- * Defaults to the object.
- * @return {Function} The new function just created.
- */
- interceptAfter: function(object, methodName, fn, scope) {
- var method = object[methodName] || Ext.emptyFn;
- return (object[methodName] = function() {
- method.apply(this, arguments);
- return fn.apply(scope || this, arguments);
- });
- },
- interceptAfterOnce: function(object, methodName, fn, scope) {
- var origMethod = object[methodName],
- newMethod;
- newMethod = function() {
- var ret;
- if (origMethod) {
- origMethod.apply(this, arguments);
- }
- ret = fn.apply(scope || this, arguments);
- object[methodName] = origMethod;
- object = methodName = fn = scope = origMethod = newMethod = null;
- return ret;
- };
- object[methodName] = newMethod;
- return newMethod;
- },
- makeCallback: function(callback, scope) {
- if (!scope[callback]) {
- if (scope.$className) {
- Ext.raise('No method "' + callback + '" on ' + scope.$className);
- }
- Ext.raise('No method "' + callback + '"');
- }
- return function() {
- return scope[callback].apply(scope, arguments);
- };
- },
- /**
- * Returns a wrapper function that caches the return value for previously
- * processed function argument(s).
- *
- * For example:
- *
- * function factorial (value) {
- * var ret = value;
- *
- * while (--value > 1) {
- * ret *= value;
- * }
- *
- * return ret;
- * }
- *
- * Each call to `factorial` will loop and multiply to produce the answer. Using
- * this function we can wrap the above and cache its answers:
- *
- * factorial = Ext.Function.memoize(factorial);
- *
- * The returned function operates in the same manner as before, but results are
- * stored in a cache to avoid calling the wrapped function when given the same
- * arguments.
- *
- * var x = factorial(20); // first time; call real factorial()
- * var y = factorial(20); // second time; return value from first call
- *
- * To support multi-argument methods, you will need to provide a `hashFn`.
- *
- * function permutation (n, k) {
- * return factorial(n) / factorial(n - k);
- * }
- *
- * permutation = Ext.Function.memoize(permutation, null, function(n, k) {
- * n + '-' + k;
- * });
- *
- * In this case, the `memoize` of `factorial` is sufficient optimization, but the
- * example is simply to illustrate how to generate a unique key for an expensive,
- * multi-argument method.
- *
- * **IMPORTANT**: This cache is unbounded so be cautious of memory leaks if the
- * `memoize`d function is kept indefinitely or is given an unbounded set of
- * possible arguments.
- *
- * @param {Function} fn Function to wrap.
- * @param {Object} scope Optional scope in which to execute the wrapped function.
- * @param {Function} hashFn Optional function used to compute a hash key for
- * storing the result, based on the arguments to the original function.
- * @return {Function} The caching wrapper function.
- * @since 6.0.0
- */
- memoize: function(fn, scope, hashFn) {
- var memo = {},
- isFunc = hashFn && Ext.isFunction(hashFn);
- return function(value) {
- var key = isFunc ? hashFn.apply(scope, arguments) : value;
- if (!(key in memo)) {
- memo[key] = fn.apply(scope, arguments);
- }
- return memo[key];
- };
- },
- _stripCommentRe: /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g,
- toCode: function(fn) {
- var s = fn ? fn.toString() : '';
- s = s.replace(ExtFunction._stripCommentRe, '');
- return s;
- },
- // This is useful for unit testing so we can force handlers which have been deferred
- // to the next animation frame to run immediately
- fireElevatedHandlers: function() {
- // eslint-disable-line comma-style
- fireElevatedHandlers();
- }
- };
- // ExtFunction
- /**
- * @member Ext
- * @method asap
- * Schedules the specified callback function to be executed on the next turn of the
- * event loop. Where available, this method uses the browser's `setImmediate` API. If
- * not available, this method substitutes `setTimeout(0)`. Though not a perfect
- * replacement for `setImmediate` it is sufficient for many use cases.
- *
- * For more details see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate).
- *
- * @param {Function} fn Callback function.
- * @param {Object} [scope] The scope for the callback (`this` pointer).
- * @param {Mixed[]} [parameters] Additional parameters to pass to `fn`.
- * @return {Number} A cancellation id for `{@link Ext#unasap}`.
- */
- Ext.asap = hasImmediate ? function(fn, scope, parameters) {
- var boundFn = fn,
- timerFn, timerId;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- if (scope != null || parameters != null) {
- boundFn = ExtFunction.bind(fn, scope, parameters);
- }
- timerFn = function() {
- Ext.elevate(boundFn, null, null, timer);
- };
- // eslint-disable-line comma-style
- timerId = setImmediate(timerFn);
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('asap', timerId, {
- type: 'asap',
- fn: fn,
- timerFn: timerFn
- });
- return timerId;
- } : function(fn, scope, parameters) {
- var boundFn = fn,
- timerFn, timerId;
- var timer;
- // eslint-disable-line vars-on-top, one-var
- if (scope != null || parameters != null) {
- boundFn = ExtFunction.bind(fn, scope, parameters);
- }
- timerFn = function() {
- Ext.elevate(boundFn, null, null, timer);
- };
- // eslint-disable-line comma-style
- timerId = setTimeout(timerFn, 0, true);
- timerFn.$origFn = fn.$origFn || fn;
- timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
- timer = Ext.Timer.created('timeout', timerId, {
- type: 'asap',
- fn: fn,
- timerFn: timerFn
- });
- return timerId;
- };
- /**
- * @member Ext
- * @method unasap
- * Cancels a previously scheduled call to `{@link Ext#asap}`.
- *
- * var timerId = Ext.asap(me.method, me);
- * ...
- *
- * if (nevermind) {
- * Ext.unasap(timerId);
- * }
- *
- * This method always returns `null` to enable simple cleanup:
- *
- * timerId = Ext.unasap(timerId); // safe even if !timerId
- *
- * @param {Number} id The id returned by `{@link Ext#asap}`.
- * @return {Object} Always returns `null`.
- */
- Ext.unasap = hasImmediate ? function(id) {
- if (id) {
- clearImmediate(id);
- Ext.Timer.cancel('asap', id);
- }
- return null;
- } : function(id) {
- return Ext.undefer(id);
- };
- /**
- * @member Ext
- * @method asapCancel
- * Cancels a previously scheduled call to `{@link Ext#asap}`.
- * @param {Number} id The id returned by `{@link Ext#asap}`.
- * @deprecated 6.5.1 Use `Ext.unasap` instead.
- */
- Ext.asapCancel = function(id) {
- return Ext.unasap(id);
- };
- /**
- * @method defer
- * @member Ext
- * @inheritdoc Ext.Function#defer
- */
- Ext.defer = ExtFunction.defer;
- /**
- * @member Ext
- * @method undefer
- * Cancels a previously scheduled call to `{@link Ext#defer}`.
- *
- * var timerId = Ext.defer(me.method, me);
- * ...
- *
- * if (nevermind) {
- * Ext.undefer(timerId);
- * }
- *
- * This method always returns `null` to enable simple cleanup:
- *
- * timerId = Ext.undefer(timerId); // safe even if !timerId
- *
- * @param {Number} id The id returned by `{@link Ext#defer}`.
- */
- Ext.undefer = function(id) {
- if (id) {
- clearTimeout(id);
- Ext.Timer.cancel('timeout', id);
- }
- return null;
- };
- /**
- * @method interval
- * @member Ext
- * @inheritdoc Ext.Function#interval
- */
- Ext.interval = ExtFunction.interval;
- /**
- * @member Ext
- * @method uninterval
- * Cancels a previously scheduled call to `{@link Ext#interval}`.
- *
- * var timerId = Ext.interval(me.method, me);
- * ...
- *
- * if (nevermind) {
- * Ext.uninterval(timerId);
- * }
- *
- * This method always returns `null` to enable simple cleanup:
- *
- * timerId = Ext.uninterval(timerId); // safe even if !timerId
- *
- * @param {Number} id The id returned by `{@link Ext#interval}`.
- */
- Ext.uninterval = function(id) {
- if (id) {
- clearInterval(id);
- Ext.Timer.cancel('interval', id);
- }
- return null;
- };
- /**
- * @method pass
- * @member Ext
- * @inheritdoc Ext.Function#pass
- */
- Ext.pass = ExtFunction.pass;
- /**
- * @method bind
- * @member Ext
- * @inheritdoc Ext.Function#bind
- */
- Ext.bind = ExtFunction.bind;
- Ext.raf = function() {
- return ExtFunction.requestAnimationFrame.apply(ExtFunction, arguments);
- };
- Ext.unraf = function(id) {
- ExtFunction.cancelAnimationFrame(id);
- };
- return ExtFunction;
- })();
- /**
- * @class Ext.Number
- *
- * A collection of useful static methods to deal with numbers
- * @singleton
- */
- Ext.Number = (new function() {
- // jshint ignore:line
- // @define Ext.lang.Number
- // @define Ext.Number
- // @require Ext
- var ExtNumber = this,
- isToFixedBroken = (0.9).toFixed() !== '1',
- math = Math,
- ClipDefault = {
- count: false,
- inclusive: false,
- wrap: true
- };
- // polyfill
- Number.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(math.pow(2, 53) - 1);
- Number.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || math.pow(2, 53) - 1;
- Ext.apply(ExtNumber, {
- MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,
- MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,
- // No good way to allow "9." w/o allowing "." alone but we use isNaN to reject that
- floatRe: /^[-+]?(?:\d+|\d*\.\d*)(?:[Ee][+-]?\d+)?$/,
- intRe: /^[-+]?\d+(?:[Ee]\+?\d+)?$/,
- Clip: {
- DEFAULT: ClipDefault,
- COUNT: Ext.applyIf({
- count: true
- }, ClipDefault),
- INCLUSIVE: Ext.applyIf({
- inclusive: true
- }, ClipDefault),
- NOWRAP: Ext.applyIf({
- wrap: false
- }, ClipDefault)
- },
- /**
- * Strictly parses the given value and returns the value as a number or `null` if
- * the value is not a number or contains non-numeric pieces.
- * @param {String} value
- * @return {Number}
- * @since 6.5.1
- */
- parseFloat: function(value) {
- if (value === undefined) {
- value = null;
- }
- if (value !== null && typeof value !== 'number') {
- value = String(value);
- value = ExtNumber.floatRe.test(value) ? +value : null;
- if (isNaN(value)) {
- value = null;
- }
- }
- return value;
- },
- /**
- * Strictly parses the given value and returns the value as a number or `null` if
- * the value is not an integer number or contains non-integer pieces.
- * @param {String} value
- * @return {Number}
- * @since 6.5.1
- */
- parseInt: function(value) {
- if (value === undefined) {
- value = null;
- }
- if (typeof value === 'number') {
- value = Math.floor(value);
- } else if (value !== null) {
- value = String(value);
- value = ExtNumber.intRe.test(value) ? +value : null;
- }
- return value;
- },
- binarySearch: function(array, value, begin, end) {
- var middle, midVal;
- if (begin === undefined) {
- begin = 0;
- }
- if (end === undefined) {
- end = array.length;
- }
- --end;
- while (begin <= end) {
- middle = (begin + end) >>> 1;
- // unsigned right shift = Math.floor(x/2)
- midVal = array[middle];
- if (value === midVal) {
- return middle;
- }
- if (midVal < value) {
- begin = middle + 1;
- } else {
- end = middle - 1;
- }
- }
- return begin;
- },
- bisectTuples: function(array, value, index, begin, end) {
- var middle, midVal;
- if (begin === undefined) {
- begin = 0;
- }
- if (end === undefined) {
- end = array.length;
- }
- --end;
- while (begin <= end) {
- middle = (begin + end) >>> 1;
- // unsigned right shift = Math.floor(x/2)
- midVal = array[middle][index];
- if (value === midVal) {
- return middle;
- }
- if (midVal < value) {
- begin = middle + 1;
- } else {
- end = middle - 1;
- }
- }
- return begin;
- },
- /**
- * Coerces a given index into a valid index given a `length`.
- *
- * Negative indexes are interpreted starting at the end of the collection. That is,
- * a value of -1 indicates the last item, or equivalent to `length - 1`.
- *
- * When handling methods that take "begin" and "end" arguments like most array or
- * string methods, this method can be used like so:
- *
- * function foo (array, begin, end) {
- * var range = Ext.Number.clipIndices(array.length, [begin, end]);
- *
- * begin = range[0];
- * end = range[1];
- *
- * // 0 <= begin <= end <= array.length
- *
- * var length = end - begin;
- * }
- *
- * For example:
- *
- * +---+---+---+---+---+---+---+---+
- * | | | | | | | | | length = 8
- * +---+---+---+---+---+---+---+---+
- * 0 1 2 3 4 5 6 7
- * -8 -7 -6 -5 -4 -3 -2 -1
- *
- * console.log(Ext.Number.clipIndices(8, [3, 10]); // logs "[3, 8]"
- * console.log(Ext.Number.clipIndices(8, [-5]); // logs "[3, 8]"
- * console.log(Ext.Number.clipIndices(8, []);
- * console.log(Ext.Number.clipIndices(8, []);
- *
- * @param {Number} length
- * @param {Number[]} indices
- * @param {Object} [options] An object with different option flags.
- * @param {Boolean} [options.count=false] The second number in `indices` is the
- * count not and an index.
- * @param {Boolean} [options.inclusive=false] The second number in `indices` is
- * "inclusive" meaning that the item should be considered in the range. Normally,
- * the second number is considered the first item outside the range or as an
- * "exclusive" bound.
- * @param {Boolean} [options.wrap=true] Wraps negative numbers backwards from the
- * end of the array. Passing `false` simply clips negative index values at 0.
- * @return {Number[]} The normalized `[begin, end]` array where `end` is now
- * exclusive such that `length = end - begin`. Both values are between 0 and the
- * given `length` and `end` will not be less-than `begin`.
- */
- clipIndices: function(length, indices, options) {
- var defaultValue = 0,
- // default value for "begin"
- wrap, begin, end, i;
- options = options || ClipDefault;
- wrap = options.wrap;
- indices = indices || [];
- for (i = 0; i < 2; ++i) {
- // names are off on first pass but used this way so things make sense
- // following the loop..
- begin = end;
- // pick up and keep the result from the first loop
- end = indices[i];
- if (end == null) {
- end = defaultValue;
- } else if (i && options.count) {
- end += begin;
- // this is the length not "end" so convert to "end"
- end = (end > length) ? length : end;
- } else {
- if (wrap) {
- end = (end < 0) ? (length + end) : end;
- }
- if (i && options.inclusive) {
- ++end;
- }
- end = (end < 0) ? 0 : ((end > length) ? length : end);
- }
- defaultValue = length;
- }
- // default value for "end"
- // after loop:
- // 0 <= begin <= length (calculated from indices[0])
- // 0 <= end <= length (calculated from indices[1])
- indices[0] = begin;
- indices[1] = (end < begin) ? begin : end;
- return indices;
- },
- /**
- * Checks whether or not the passed number is within a desired range. If the number is
- * already within the range it is returned, otherwise the min or max value is returned
- * depending on which side of the range is exceeded. Note that this method returns the
- * constrained value but does not change the current number.
- * @param {Number} number The number to check
- * @param {Number} min The minimum number in the range
- * @param {Number} max The maximum number in the range
- * @return {Number} The constrained value if outside the range, otherwise the current value
- */
- constrain: function(number, min, max) {
- var x = parseFloat(number);
- // (x < Nan) || (x < undefined) == false
- // same for (x > NaN) || (x > undefined)
- // sadly this is not true of null - (1 > null)
- if (min === null) {
- min = number;
- }
- if (max === null) {
- max = number;
- }
- // Watch out for NaN in Chrome 18
- // V8bug: http://code.google.com/p/v8/issues/detail?id=2056
- // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain
- return (x < min) ? min : ((x > max) ? max : x);
- },
- /**
- * Snaps the passed number between stopping points based upon a passed increment value.
- *
- * The difference between this and {@link #snapInRange} is that {@link #snapInRange} uses
- * the minValue when calculating snap points:
- *
- * // Returns 56 - snap points are zero based
- * r = Ext.Number.snap(56, 2, 55, 65);
- *
- * // Returns 57 - snap points are based from minValue
- * r = Ext.Number.snapInRange(56, 2, 55, 65);
- *
- * @param {Number} value The unsnapped value.
- * @param {Number} increment The increment by which the value must move.
- * @param {Number} minValue The minimum value to which the returned value must be
- * constrained. Overrides the increment.
- * @param {Number} maxValue The maximum value to which the returned value must be
- * constrained. Overrides the increment.
- * @return {Number} The value of the nearest snap target.
- */
- snap: function(value, increment, minValue, maxValue) {
- var m;
- // If no value passed, or minValue was passed and value is less than minValue
- // (anything < undefined is false)
- // Then use the minValue (or zero if the value was undefined)
- if (value === undefined || value < minValue) {
- return minValue || 0;
- }
- if (increment) {
- m = value % increment;
- if (m !== 0) {
- value -= m;
- if (m * 2 >= increment) {
- value += increment;
- } else if (m * 2 < -increment) {
- value -= increment;
- }
- }
- }
- return ExtNumber.constrain(value, minValue, maxValue);
- },
- /**
- * Snaps the passed number between stopping points based upon a passed increment value.
- *
- * The difference between this and {@link #snap} is that {@link #snap} does not use
- * the minValue when calculating snap points:
- *
- * // Returns 56 - snap points are zero based
- * r = Ext.Number.snap(56, 2, 55, 65);
- *
- * // Returns 57 - snap points are based from minValue
- * r = Ext.Number.snapInRange(56, 2, 55, 65);
- *
- * @param {Number} value The unsnapped value.
- * @param {Number} increment The increment by which the value must move.
- * @param {Number} [minValue=0] The minimum value to which the returned value must be
- * constrained.
- * @param {Number} [maxValue=Infinity] The maximum value to which the returned value
- * must be constrained.
- * @return {Number} The value of the nearest snap target.
- */
- snapInRange: function(value, increment, minValue, maxValue) {
- var tween;
- // default minValue to zero
- minValue = (minValue || 0);
- // If value is undefined, or less than minValue, use minValue
- if (value === undefined || value < minValue) {
- return minValue;
- }
- // Calculate how many snap points from the minValue the passed value is.
- if (increment && (tween = ((value - minValue) % increment))) {
- value -= tween;
- tween *= 2;
- if (tween >= increment) {
- value += increment;
- }
- }
- // If constraining within a maximum, ensure the maximum is on a snap point
- if (maxValue !== undefined) {
- if (value > (maxValue = ExtNumber.snapInRange(maxValue, increment, minValue))) {
- value = maxValue;
- }
- }
- return value;
- },
- /**
- * Round a number to the nearest interval.
- * @param {Number} value The value to round.
- * @param {Number} interval The interval to round to.
- * @return {Number} The rounded value.
- *
- * @since 6.2.0
- */
- roundToNearest: function(value, interval) {
- interval = interval || 1;
- return interval * math.round(value / interval);
- },
- /**
- * Rounds a number to the specified precision.
- * @param value
- * @param precision
- * @return {number}
- */
- roundToPrecision: function(value, precision) {
- var factor = math.pow(10, precision || 1);
- return math.round(value * factor) / factor;
- },
- /**
- * Truncates a number to the specified precision,
- * without rounding.
- * @param value
- * @param precision
- * @return {number}
- * @since 6.5.1
- */
- truncateToPrecision: function(value, precision) {
- var factor = math.pow(10, precision || 1);
- return parseInt(value * factor, 10) / factor;
- },
- /**
- * Returns the sign of the given number. See also MDN for Math.sign documentation
- * for the standard method this method emulates.
- * @param {Number} x The number.
- * @return {Number} The sign of the number `x`, indicating whether the number is
- * positive (1), negative (-1) or zero (0).
- * @method sign
- */
- sign: math.sign || function(x) {
- x = +x;
- // force to a Number
- if (x === 0 || isNaN(x)) {
- return x;
- }
- return (x > 0) ? 1 : -1;
- },
- /**
- * Returns the base 10 logarithm of a number.
- * This will use Math.log10, if available (ES6).
- * @param {Number} x The number.
- * @return {Number} Base 10 logarithm of the number 'x'.
- * @method log10
- */
- log10: math.log10 || function(x) {
- return math.log(x) * math.LOG10E;
- },
- /**
- * Determines if two numbers `n1` and `n2` are equal within a given
- * margin of precision `epsilon`.
- * @param {Number} n1 First number.
- * @param {Number} n2 Second number.
- * @param {Number} epsilon Margin of precision.
- * @return {Boolean} `true`, if numbers are equal. `false` otherwise.
- */
- isEqual: function(n1, n2, epsilon) {
- /* eslint-disable-next-line max-len */
- if (!(typeof n1 === 'number' && typeof n2 === 'number' && typeof epsilon === 'number')) {
- Ext.raise("All parameters should be valid numbers.");
- }
- return math.abs(n1 - n2) < epsilon;
- },
- /**
- * Determines if the value passed is a number and also finite.
- * This a Polyfill version of Number.isFinite(),differently than
- * the isFinite() function, this method doesn't convert the parameter to a number.
- * @param {Number} value Number to be tested.
- * @return {Boolean} `true`, if the parameter is a number and finite, `false` otherwise.
- * @since 6.2
- */
- isFinite: Number.isFinite || function(value) {
- return typeof value === 'number' && isFinite(value);
- },
- isInteger: Number.isInteger || function(value) {
- // Add zero get a valid result in a special case where the value is a number string.
- // E.g. '10' + 0 is '100'.
- return ~~(value + 0) === value;
- },
- /**
- * @method
- * Formats a number using fixed-point notation
- * @param {Number} value The number to format
- * @param {Number} precision The number of digits to show after the decimal point
- */
- toFixed: isToFixedBroken ? function(value, precision) {
- var pow;
- precision = precision || 0;
- pow = math.pow(10, precision);
- return (math.round(value * pow) / pow).toFixed(precision);
- } : function(value, precision) {
- return value.toFixed(precision);
- },
- /**
- * Validate that a value is numeric and convert it to a number if necessary.
- * Returns the specified default value if it is not.
- *
- * Ext.Number.from('1.23', 1); // returns 1.23
- * Ext.Number.from('abc', 1); // returns 1
- *
- * @param {Object} value
- * @param {Number} defaultValue The value to return if the original value is non-numeric
- * @return {Number} value, if numeric, defaultValue otherwise
- */
- from: function(value, defaultValue) {
- if (isFinite(value)) {
- value = parseFloat(value);
- }
- return !isNaN(value) ? value : defaultValue;
- },
- /**
- * Returns a random integer between the specified range (inclusive)
- * @param {Number} from Lowest value to return.
- * @param {Number} to Highest value to return.
- * @return {Number} A random integer within the specified range.
- */
- randomInt: function(from, to) {
- return math.floor(math.random() * (to - from + 1) + from);
- },
- /**
- * Corrects floating point numbers that overflow to a non-precise
- * value because of their floating nature, for example `0.1 + 0.2`
- * @param {Number} n The number
- * @return {Number} The correctly rounded number
- */
- correctFloat: function(n) {
- // This is to correct the type of errors where 2 floats end with
- // a long string of decimals, eg 0.1 + 0.2. When they overflow in this
- // manner, they usually go to 15-16 decimals, so we cut it off at 14.
- return parseFloat(n.toPrecision(14));
- }
- });
- /**
- * @deprecated 4.0.0 Please use {@link Ext.Number#from} instead.
- * @member Ext
- * @method num
- * @inheritdoc Ext.Number#from
- */
- Ext.num = function() {
- return ExtNumber.from.apply(this, arguments);
- };
- }());
- /**
- * @class Ext.Object
- *
- * A collection of useful static methods to deal with objects.
- *
- * @singleton
- */
- (function() {
- // The "constructor" for chain:
- var TemplateClass = function() {},
- queryRe = /^\?/,
- keyRe = /(\[):?([^\]]*)\]/g,
- nameRe = /^([^\[]+)/,
- // eslint-disable-line no-useless-escape
- plusRe = /\+/g,
- ExtObject;
- // @define Ext.lang.Object
- // @define Ext.Object
- // @require Ext
- // @require Ext.lang.Date
- ExtObject = Ext.Object = {
- /**
- * @method
- * Returns a new object with the given object as the prototype chain. This method is
- * designed to mimic the ECMA standard `Object.create` method and is assigned to that
- * function when it is available.
- *
- * **NOTE** This method does not support the property definitions capability of the
- * `Object.create` method. Only the first argument is supported.
- *
- * @param {Object} object The prototype chain for the new object.
- */
- chain: Object.create || function(object) {
- var result;
- TemplateClass.prototype = object;
- result = new TemplateClass();
- TemplateClass.prototype = null;
- return result;
- },
- /**
- * This method removes all keys from the given object.
- * @param {Object} object The object from which to remove all keys.
- * @return {Object} The given object.
- */
- clear: function(object) {
- var key;
- // Safe to delete during iteration
- for (key in object) {
- delete object[key];
- }
- return object;
- },
- /**
- * Freezes the given object making it immutable. This operation is by default shallow
- * and does not effect objects referenced by the given object.
- *
- * @method
- * @param {Object} obj The object to freeze.
- * @param {Boolean} [deep=false] Pass `true` to freeze sub-objects recursively.
- * @return {Object} The given object `obj`.
- */
- freeze: Object.freeze ? function(obj, deep) {
- var name;
- if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
- Object.freeze(obj);
- if (deep) {
- for (name in obj) {
- ExtObject.freeze(obj[name], deep);
- }
- }
- }
- return obj;
- } : Ext.identityFn,
- /**
- * Converts a `name` - `value` pair to an array of objects with support for nested structures.
- * Useful to construct query strings. For example:
- *
- * var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
- *
- * // objects then equals:
- * [
- * { name: 'hobbies', value: 'reading' },
- * { name: 'hobbies', value: 'cooking' },
- * { name: 'hobbies', value: 'swimming' },
- * ];
- *
- * var objects = Ext.Object.toQueryObjects('dateOfBirth', {
- * day: 3,
- * month: 8,
- * year: 1987,
- * extra: {
- * hour: 4
- * minute: 30
- * }
- * }, true); // Recursive
- *
- * // objects then equals:
- * [
- * { name: 'dateOfBirth[day]', value: 3 },
- * { name: 'dateOfBirth[month]', value: 8 },
- * { name: 'dateOfBirth[year]', value: 1987 },
- * { name: 'dateOfBirth[extra][hour]', value: 4 },
- * { name: 'dateOfBirth[extra][minute]', value: 30 },
- * ];
- *
- * @param {String} name
- * @param {Object/Array} value
- * @param {Boolean} [recursive=false] True to traverse object recursively
- * @return {Object[]}
- */
- toQueryObjects: function(name, value, recursive) {
- var self = ExtObject.toQueryObjects,
- objects = [],
- i, ln;
- if (Ext.isArray(value)) {
- for (i = 0 , ln = value.length; i < ln; i++) {
- if (recursive) {
- objects = objects.concat(self(name + '[' + i + ']', value[i], true));
- } else {
- objects.push({
- name: name,
- value: value[i]
- });
- }
- }
- } else if (Ext.isObject(value)) {
- for (i in value) {
- if (value.hasOwnProperty(i)) {
- if (recursive) {
- objects = objects.concat(self(name + '[' + i + ']', value[i], true));
- } else {
- objects.push({
- name: name,
- value: value[i]
- });
- }
- }
- }
- } else {
- objects.push({
- name: name,
- value: value
- });
- }
- return objects;
- },
- /* eslint-disable max-len */
- /**
- * Takes an object and converts it to an encoded query string.
- *
- * Non-recursive:
- *
- * Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
- * Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
- * Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
- * Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
- * Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
- *
- * Recursive:
- *
- * Ext.Object.toQueryString({
- * username: 'Jacky',
- * dateOfBirth: {
- * day: 1,
- * month: 2,
- * year: 1911
- * },
- * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
- * }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
- * // username=Jacky
- * // &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
- * // &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
- *
- * @param {Object} object The object to encode
- * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
- * (PHP / Ruby on Rails servers and similar).
- * @return {String} queryString
- */
- toQueryString: function(object, recursive) {
- var paramObjects = [],
- params = [],
- i, j, ln, paramObject, value;
- for (i in object) {
- if (object.hasOwnProperty(i)) {
- paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
- }
- }
- for (j = 0 , ln = paramObjects.length; j < ln; j++) {
- paramObject = paramObjects[j];
- value = paramObject.value;
- if (Ext.isEmpty(value)) {
- value = '';
- } else if (Ext.isDate(value)) {
- value = Ext.Date.toString(value);
- }
- params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
- }
- return params.join('&');
- },
- /**
- * Converts a query string back into an object.
- *
- * Non-recursive:
- *
- * Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: '1', bar: '2'}
- * Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: '', bar: '2'}
- * Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
- * Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
- *
- * Recursive:
- *
- * Ext.Object.fromQueryString(
- * "username=Jacky&"+
- * "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
- * "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
- * "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
- *
- * // returns
- * {
- * username: 'Jacky',
- * dateOfBirth: {
- * day: '1',
- * month: '2',
- * year: '1911'
- * },
- * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
- * }
- *
- * @param {String} queryString The query string to decode
- * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
- * PHP / Ruby on Rails servers and similar.
- * @return {Object}
- */
- fromQueryString: function(queryString, recursive) {
- var parts = queryString.replace(queryRe, '').split('&'),
- object = {},
- temp, components, name, value, i, ln, part, j, subLn, matchedKeys, matchedName, keys, key, nextKey;
- for (i = 0 , ln = parts.length; i < ln; i++) {
- part = parts[i];
- if (part.length > 0) {
- components = part.split('=');
- name = components[0];
- name = name.replace(plusRe, '%20');
- name = decodeURIComponent(name);
- value = components[1];
- if (value !== undefined) {
- value = value.replace(plusRe, '%20');
- value = decodeURIComponent(value);
- } else {
- value = '';
- }
- if (!recursive) {
- if (object.hasOwnProperty(name)) {
- if (!Ext.isArray(object[name])) {
- object[name] = [
- object[name]
- ];
- }
- object[name].push(value);
- } else {
- object[name] = value;
- }
- } else {
- matchedKeys = name.match(keyRe);
- matchedName = name.match(nameRe);
- if (!matchedName) {
- throw new Error('[Ext.Object.fromQueryString] Malformed query string given, failed parsing name from "' + part + '"');
- }
- name = matchedName[0];
- keys = [];
- if (matchedKeys === null) {
- object[name] = value;
-
- continue;
- }
- for (j = 0 , subLn = matchedKeys.length; j < subLn; j++) {
- key = matchedKeys[j];
- key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
- keys.push(key);
- }
- keys.unshift(name);
- temp = object;
- for (j = 0 , subLn = keys.length; j < subLn; j++) {
- key = keys[j];
- if (j === subLn - 1) {
- if (Ext.isArray(temp) && key === '') {
- temp.push(value);
- } else {
- temp[key] = value;
- }
- } else {
- if (temp[key] === undefined || typeof temp[key] === 'string') {
- nextKey = keys[j + 1];
- temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
- }
- temp = temp[key];
- }
- }
- }
- }
- }
- return object;
- },
- /* eslint-enable max-len */
- /**
- * Iterates through an object and invokes the given callback function for each iteration.
- * The iteration can be stopped by returning `false` in the callback function. For example:
- *
- * var person = {
- * name: 'Jacky'
- * hairColor: 'black'
- * loves: ['food', 'sleeping', 'wife']
- * };
- *
- * Ext.Object.each(person, function(key, value, myself) {
- * console.log(key + ":" + value);
- *
- * if (key === 'hairColor') {
- * return false; // stop the iteration
- * }
- * });
- *
- * @param {Object} object The object to iterate
- * @param {Function} fn The callback function.
- * @param {String} fn.key
- * @param {Object} fn.value
- * @param {Object} fn.object The object itself
- * @param {Object} [scope] The execution scope (`this`) of the callback function
- */
- each: function(object, fn, scope) {
- var enumerables = Ext.enumerables,
- i, property;
- if (object) {
- scope = scope || object;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- if (fn.call(scope, property, object[property], object) === false) {
- return;
- }
- }
- }
- if (enumerables) {
- for (i = enumerables.length; i--; ) {
- if (object.hasOwnProperty(property = enumerables[i])) {
- if (fn.call(scope, property, object[property], object) === false) {
- return;
- }
- }
- }
- }
- }
- },
- /**
- * Iterates through an object and invokes the given callback function for each iteration.
- * The iteration can be stopped by returning `false` in the callback function. For example:
- *
- * var items = {
- * 1: 'Hello',
- * 2: 'World'
- * };
- *
- * Ext.Object.eachValue(items, function(value) {
- * console.log("Value: " + value);
- * });
- *
- * This will log 'Hello' and 'World' in no particular order. This method is useful
- * in cases where the keys are not important to the processing, just the values.
- *
- * @param {Object} object The object to iterate
- * @param {Function} fn The callback function.
- * @param {Object} fn.value The value of
- * @param {Object} [scope] The execution scope (`this`) of the callback function
- */
- eachValue: function(object, fn, scope) {
- var enumerables = Ext.enumerables,
- i, property;
- scope = scope || object;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- if (fn.call(scope, object[property]) === false) {
- return;
- }
- }
- }
- if (enumerables) {
- for (i = enumerables.length; i--; ) {
- if (object.hasOwnProperty(property = enumerables[i])) {
- if (fn.call(scope, object[property]) === false) {
- return;
- }
- }
- }
- }
- },
- /**
- * Merges any number of objects recursively without referencing them or their children.
- * Note: It will reference arrays if they are only present in one of the objects being merged.
- *
- * var extjs = {
- * companyName: 'Ext JS',
- * products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
- * isSuperCool: true,
- * office: {
- * size: 2000,
- * location: 'Palo Alto',
- * isFun: true
- * }
- * };
- *
- * var newStuff = {
- * companyName: 'Sencha Inc.',
- * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
- * office: {
- * size: 40000,
- * location: 'Redwood City'
- * }
- * };
- *
- * var sencha = Ext.Object.merge(extjs, newStuff);
- *
- * // extjs and sencha then equals to
- * {
- * companyName: 'Sencha Inc.',
- * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
- * isSuperCool: true,
- * office: {
- * size: 40000,
- * location: 'Redwood City',
- * isFun: true
- * }
- * }
- *
- * @param {Object} destination The object into which all subsequent objects are merged.
- * @param {Object...} object Any number of objects to merge into the destination.
- * @return {Object} merged The destination object with all passed objects merged in.
- */
- merge: function(destination) {
- var i = 1,
- args = arguments,
- ln = args.length,
- mergeFn = ExtObject.merge,
- cloneFn = Ext.clone,
- object, key, value, sourceKey;
- for (; i < ln; i++) {
- object = args[i];
- for (key in object) {
- value = object[key];
- if (value && value.constructor === Object) {
- sourceKey = destination[key];
- if (sourceKey && sourceKey.constructor === Object) {
- mergeFn(sourceKey, value);
- } else {
- destination[key] = cloneFn(value);
- }
- } else {
- destination[key] = value;
- }
- }
- }
- return destination;
- },
- /**
- * @private
- * @param destination
- */
- mergeIf: function(destination) {
- var i = 1,
- ln = arguments.length,
- cloneFn = Ext.clone,
- object, key, value;
- for (; i < ln; i++) {
- object = arguments[i];
- for (key in object) {
- if (!(key in destination)) {
- value = object[key];
- if (value && value.constructor === Object) {
- destination[key] = cloneFn(value);
- } else {
- destination[key] = value;
- }
- }
- }
- }
- return destination;
- },
- /**
- * Returns all keys of the given object as an array.
- *
- * @param {Object} object
- * @return {String[]} An array of keys from the object or any of its prototypes.
- * @method
- */
- getAllKeys: function(object) {
- var keys = [],
- property;
- for (property in object) {
- keys.push(property);
- }
- return keys;
- },
- /**
- * Returns the first matching key corresponding to the given value.
- * If no matching value is found, null is returned.
- *
- * var person = {
- * name: 'Jacky',
- * loves: 'food'
- * };
- *
- * alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
- *
- * @param {Object} object
- * @param {Object} value The value to find
- */
- getKey: function(object, value) {
- var property;
- for (property in object) {
- if (object.hasOwnProperty(property) && object[property] === value) {
- return property;
- }
- }
- return null;
- },
- /**
- * Gets all values of the given object as an array.
- *
- * var values = Ext.Object.getValues({
- * name: 'Jacky',
- * loves: 'food'
- * }); // ['Jacky', 'food']
- *
- * @param {Object} object
- * @return {Array} An array of values from the object
- */
- getValues: function(object) {
- var values = [],
- property;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- values.push(object[property]);
- }
- }
- return values;
- },
- /**
- * Returns the `hasOwnProperty` keys of the given object as an array.
- *
- * var values = Ext.Object.getKeys({
- * name: 'Jacky',
- * loves: 'food'
- * }); // ['name', 'loves']
- *
- * @param {Object} object
- * @return {String[]} An array of keys from the object
- * @method
- */
- getKeys: (typeof Object.keys === 'function') ? function(object) {
- if (!object) {
- return [];
- }
- return Object.keys(object);
- } : function(object) {
- var keys = [],
- property;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- keys.push(property);
- }
- }
- return keys;
- },
- /**
- * Gets the total number of this object's own properties
- *
- * var size = Ext.Object.getSize({
- * name: 'Jacky',
- * loves: 'food'
- * }); // size equals 2
- *
- * @param {Object} object
- * @return {Number} size
- */
- getSize: function(object) {
- var size = 0,
- property;
- for (property in object) {
- if (object.hasOwnProperty(property)) {
- size++;
- }
- }
- return size;
- },
- /**
- * Checks if there are any properties on this object.
- * @param {Object} object
- * @return {Boolean} `true` if there no properties on the object.
- */
- isEmpty: function(object) {
- var key;
- for (key in object) {
- if (object.hasOwnProperty(key)) {
- return false;
- }
- }
- return true;
- },
- /**
- * @method
- * Shallow compares the contents of 2 objects using strict equality. Objects are
- * considered equal if they both have the same set of properties and the
- * value for those properties equals the other in the corresponding object.
- *
- * // Returns true
- * Ext.Object.equals({
- * foo: 1,
- * bar: 2
- * }, {
- * foo: 1,
- * bar: 2
- * });
- *
- * @param {Object} object1
- * @param {Object} object2
- * @return {Boolean} `true` if the objects are equal.
- */
- equals: (function() {
- var check = function(o1, o2) {
- var key;
- for (key in o1) {
- if (o1.hasOwnProperty(key)) {
- if (o1[key] !== o2[key]) {
- return false;
- }
- }
- }
- return true;
- };
- return function(object1, object2) {
- // Short circuit if the same object is passed twice
- if (object1 === object2) {
- return true;
- }
- if (object1 && object2) {
- // Do the second check because we could have extra keys in
- // object2 that don't exist in object1.
- return check(object1, object2) && check(object2, object1);
- } else if (!object1 && !object2) {
- return object1 === object2;
- } else {
- return false;
- }
- };
- })(),
- /**
- * @private
- */
- fork: function(obj) {
- var ret, key, value;
- if (obj && obj.constructor === Object) {
- ret = ExtObject.chain(obj);
- for (key in obj) {
- value = obj[key];
- if (value) {
- if (value.constructor === Object) {
- ret[key] = ExtObject.fork(value);
- } else if (value instanceof Array) {
- ret[key] = Ext.Array.clone(value);
- }
- }
- }
- } else {
- ret = obj;
- }
- return ret;
- },
- defineProperty: ('defineProperty' in Object) ? Object.defineProperty : function(object, name, descriptor) {
- if (!Object.prototype.__defineGetter__) {
- return;
- }
- if (descriptor.get) {
- object.__defineGetter__(name, descriptor.get);
- }
- if (descriptor.set) {
- object.__defineSetter__(name, descriptor.set);
- }
- },
- /**
- * @private
- */
- classify: function(object) {
- var prototype = object,
- objectProperties = [],
- propertyClassesMap = {},
- objectClass, key, value;
- objectClass = function() {
- var property, i, ln;
- for (i = 0 , ln = objectProperties.length; i < ln; i++) {
- property = objectProperties[i];
- this[property] = new propertyClassesMap[property]();
- }
- };
- for (key in object) {
- if (object.hasOwnProperty(key)) {
- value = object[key];
- if (value && value.constructor === Object) {
- objectProperties.push(key);
- propertyClassesMap[key] = ExtObject.classify(value);
- }
- }
- }
- objectClass.prototype = prototype;
- return objectClass;
- }
- };
- /**
- * A convenient alias method for {@link Ext.Object#merge}.
- *
- * @member Ext
- * @method merge
- * @inheritdoc Ext.Object#merge
- */
- Ext.merge = Ext.Object.merge;
- /**
- * @private
- * @member Ext
- */
- Ext.mergeIf = Ext.Object.mergeIf;
- }());
- /*
- * This file contains miscellaneous utility methods that depends on various helper classes
- * like `Ext.Array` and `Ext.Date`. Historically these methods were defined in Ext.js or
- * Ext-more.js but that creates circular dependencies so they were consolidated here.
- */
- Ext.apply(Ext, {
- // @define Ext.Util
- // @require Ext
- // @require Ext.lang.*
- // shortcut for the special named scopes for listener scope resolution
- _namedScopes: {
- 'this': {
- isThis: 1
- },
- controller: {
- isController: 1
- },
- owner: {
- isOwner: 1
- },
- // Uses helper Ext.lookUpFn to find the scope where fn is defined (skips the
- // component at which things originate):
- up: {
- isUp: 1
- },
- // These two are private, used to indicate that listeners were declared on the
- // class body with either an unspecified scope, or scope:'controller'
- self: {
- isSelf: 1
- },
- 'self.controller': {
- isSelf: 1,
- isController: 1
- }
- },
- scrollbar: {
- _size: null,
- /**
- * @member Ext.scrollbar
- * Returns the size of the browser scrollbars. This can differ depending on
- * operating system settings, such as the theme or font size.
- * @param {Boolean} [force] Pass `true` to force a recalculation of scrollbar size.
- * @return {Object} An object containing scrollbar sizes.
- * @return {Number} return.width The width of the vertical scrollbar.
- * @return {Number} return.height The height of the horizontal scrollbar.
- */
- size: function(force) {
- var scrollbar = Ext.scrollbar,
- size = scrollbar._size;
- if (!Ext.isDomReady) {
- Ext.raise("Ext.scrollbar.size() called before DomReady");
- }
- if (force || !size) {
- /* eslint-disable-next-line vars-on-top */
- var db = document.body,
- div = document.createElement('div'),
- h, w;
- div.style.width = div.style.height = '100px';
- div.style.overflow = 'scroll';
- div.style.position = 'absolute';
- db.appendChild(div);
- // now we can measure the div...
- // at least in iE9 the div is not 100px - the scrollbar size is removed!
- scrollbar._size = size = {
- width: w = div.offsetWidth - div.clientWidth,
- height: h = div.offsetHeight - div.clientHeight
- };
- size.reservedWidth = w ? 'calc(100% - ' + w + 'px)' : '';
- size.reservedHeight = h ? 'calc(100% - ' + h + 'px)' : '';
- db.removeChild(div);
- }
- return size;
- },
- height: function(force) {
- return Ext.scrollbar.size(force).height;
- },
- width: function(force) {
- return Ext.scrollbar.size(force).width;
- }
- },
- escapeId: (function() {
- /* eslint-disable-next-line no-useless-escape */
- var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,
- escapeRx = /([\W]{1})/g,
- leadingNumRx = /^(\d)/g,
- escapeFn = function(match, capture) {
- return "\\" + capture;
- },
- numEscapeFn = function(match, capture) {
- return '\\00' + capture.charCodeAt(0).toString(16) + ' ';
- };
- return function(id) {
- return validIdRe.test(id) ? id : // replace the number portion last to keep the trailing ' '
- // from being escaped
- id.replace(escapeRx, escapeFn).replace(leadingNumRx, numEscapeFn);
- };
- }()),
- lookUpFn: function(from, fn) {
- if (!from || !Ext.isFunction(from.up)) {
- Ext.raise('Callback "up" syntax requires a caller with "up" method');
- }
- // eslint-disable-next-line vars-on-top
- var controller, scope;
- for (scope = from.up(); scope && !scope[fn]; scope = scope.up()) {
- controller = scope.controller;
- if (controller && controller[fn]) {
- scope = controller;
- break;
- }
- }
- if (!scope || !Ext.isFunction(scope[fn])) {
- Ext.raise('No such method "' + fn + '" found up() from ' + (from.getId ? from.getId() : from.id));
- }
- return scope;
- },
- /**
- * @method callback
- * @member Ext
- * Execute a callback function in a particular scope. If `callback` argument is a
- * function reference, that is called. If it is a string, the string is assumed to
- * be the name of a method on the given `scope`. If no function is passed the call
- * is ignored.
- *
- * For example, these calls are equivalent:
- *
- * var myFunc = this.myFunc;
- *
- * Ext.callback('myFunc', this, [arg1, arg2]);
- * Ext.callback(myFunc, this, [arg1, arg2]);
- *
- * Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
- *
- * @param {Function/String} callback The callback function to execute or the name of
- * the callback method on the provided `scope`.
- * @param {Object} [scope] The scope in which `callback` should be invoked. If `callback`
- * is a string this object provides the method by that name. If this is `null` then
- * the `caller` is used to resolve the scope to a `ViewController` or the proper
- * `defaultListenerScope`.
- * @param {Array} [args] The arguments to pass to the function.
- * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
- * @param {Object} [caller] The object calling the callback. This is used to resolve
- * named methods when no explicit `scope` is provided.
- * @param {Object} [defaultScope=caller] The default scope to return if none is found.
- * @return The value returned by the callback or `undefined` (if there is a `delay`
- * or if the `callback` is not a function).
- */
- callback: function(callback, scope, args, delay, caller, defaultScope) {
- if (!callback) {
- return;
- }
- /* eslint-disable-next-line vars-on-top */
- var namedScope = (scope in Ext._namedScopes),
- ret;
- if (callback.charAt) {
- // if (isString(fn))
- // Custom components cannot often use declarative method resolution when
- // they need to allow the user to supply declarative method names that can
- // reach the user's controller. The "up" callback syntax can help with that:
- //
- // xtype: 'button',
- // handler: 'up.onFoo',
- //
- // When Ext.callback('up.onFoo',..., button) is called, we can perform a
- // "button.up('[onFoo]')" search for the handler. Thus we have a declarative
- // way to dispatch such handlers that will work even if the user can supply
- // such handlers.
- //
- if (callback[2] === '.') {
- // callback = 'up.foo'
- if (callback.substr(0, 2) !== 'up') {
- Ext.raise('Invalid callback method name "' + callback + '"');
- }
- if (scope) {
- Ext.raise('Callback "up" syntax is incompatible with scopes');
- }
- scope = Ext.lookUpFn(caller, callback = callback.substr(3));
- } else if (caller) {
- if (namedScope && namedScope.isUp) {
- scope = Ext.lookUpFn(caller, callback);
- } else if (!scope || namedScope) {
- scope = caller.resolveListenerScope(namedScope ? scope : defaultScope);
- }
- }
- if (!scope || !Ext.isObject(scope)) {
- Ext.raise('Named method "' + callback + '" requires a scope object');
- }
- if (!Ext.isFunction(scope[callback])) {
- Ext.raise('No method named "' + callback + '" on ' + (scope.$className || 'scope object'));
- }
- callback = scope[callback];
- } else if (namedScope) {
- scope = defaultScope || caller;
- } else if (!scope) {
- scope = caller;
- }
- if (callback && Ext.isFunction(callback)) {
- scope = scope || Ext.global;
- if (delay) {
- Ext.defer(callback, delay, scope, args);
- } else {
- ret = args ? callback.apply(scope, args) : callback.call(scope);
- }
- }
- return ret;
- },
- /**
- * @method coerce
- * @member Ext
- * Coerces the first value if possible so that it is comparable to the second value.
- *
- * Coercion only works between the basic atomic data types String, Boolean, Number, Date, null
- * and undefined. Numbers and numeric strings are coerced to Dates using the value
- * as the millisecond era value.
- *
- * Strings are coerced to Dates by parsing using the
- * {@link Ext.Date#defaultFormat defaultFormat}.
- *
- * For example
- *
- * Ext.coerce('false', true);
- *
- * returns the boolean value `false` because the second parameter is of type `Boolean`.
- *
- * @param {Mixed} from The value to coerce
- * @param {Mixed} to The value it must be compared against
- * @return The coerced value.
- */
- coerce: function(from, to) {
- var fromType = Ext.typeOf(from),
- toType = Ext.typeOf(to),
- isString = typeof from === 'string';
- if (fromType !== toType) {
- switch (toType) {
- case 'string':
- return String(from);
- case 'number':
- return Number(from);
- case 'boolean':
- // See http://ecma262-5.com/ELS5_HTML.htm#Section_11.9.3 as to why '0'.
- // TL;DR => ('0' == 0), so if given string '0', we must return boolean false.
- return isString && (!from || from === 'false' || from === '0') ? false : Boolean(from);
- case 'null':
- return isString && (!from || from === 'null') ? null : false;
- case 'undefined':
- return isString && (!from || from === 'undefined') ? undefined : false;
- case 'date':
- return isString && isNaN(from) ? Ext.Date.parse(from, Ext.Date.defaultFormat) : Date(Number(from));
- }
- }
- return from;
- },
- /**
- * @method copyTo
- * @member Ext
- * Copies a set of named properties fom the source object to the destination object.
- *
- * Example:
- *
- * var foo = { a: 1, b: 2, c: 3 };
- *
- * var bar = Ext.copyTo({}, foo, 'a,c');
- * // bar = { a: 1, c: 3 };
- *
- * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
- *
- * @param {Object} dest The destination object.
- * @param {Object} source The source object.
- * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
- * of property names to copy.
- * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
- * prototype as well as the instance.
- * @return {Object} The `dest` object.
- * @deprecated 6.0.1 Use {@link Ext#copy Ext.copy} instead. This old method
- * would copy the named preoperties even if they did not exist in the source which
- * could produce `undefined` values in the destination.
- */
- copyTo: function(dest, source, names, usePrototypeKeys) {
- var name, i, n;
- if (typeof names === 'string') {
- names = names.split(Ext.propertyNameSplitRe);
- }
- for (i = 0 , n = names ? names.length : 0; i < n; i++) {
- name = names[i];
- if (usePrototypeKeys || source.hasOwnProperty(name)) {
- dest[name] = source[name];
- }
- }
- return dest;
- },
- /**
- * @method copy
- * @member Ext
- * Copies a set of named properties fom the source object to the destination object.
- *
- * Example:
- *
- * var foo = { a: 1, b: 2, c: 3 };
- *
- * var bar = Ext.copy({}, foo, 'a,c');
- * // bar = { a: 1, c: 3 };
- *
- * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
- *
- * @param {Object} dest The destination object.
- * @param {Object} source The source object.
- * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
- * of property names to copy.
- * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
- * prototype as well as the instance.
- * @return {Object} The `dest` object.
- */
- copy: function(dest, source, names, usePrototypeKeys) {
- var name, i, n;
- if (typeof names === 'string') {
- names = names.split(Ext.propertyNameSplitRe);
- }
- for (i = 0 , n = names ? names.length : 0; i < n; i++) {
- name = names[i];
- // Only copy a property if the source actually *has* that property.
- // If we are including prototype properties, then ensure that a property of
- // that name can be found *somewhere* in the prototype chain (otherwise we'd be
- // copying undefined in which may break things)
- if (source.hasOwnProperty(name) || (usePrototypeKeys && name in source)) {
- dest[name] = source[name];
- }
- }
- return dest;
- },
- propertyNameSplitRe: /[,;\s]+/,
- /**
- * @method copyToIf
- * @member Ext
- * Copies a set of named properties fom the source object to the destination object
- * if the destination object does not already have them.
- *
- * Example:
- *
- * var foo = { a: 1, b: 2, c: 3 };
- *
- * var bar = Ext.copyToIf({ a:42 }, foo, 'a,c');
- * // bar = { a: 42, c: 3 };
- *
- * @param {Object} destination The destination object.
- * @param {Object} source The source object.
- * @param {String/String[]} names Either an Array of property names, or a single string
- * with a list of property names separated by ",", ";" or spaces.
- * @return {Object} The `dest` object.
- * @deprecated 6.0.1 Use {@link Ext#copyIf Ext.copyIf} instead. This old method
- * would copy the named preoperties even if they did not exist in the source which
- * could produce `undefined` values in the destination.
- */
- copyToIf: function(destination, source, names) {
- var name, i, n;
- if (typeof names === 'string') {
- names = names.split(Ext.propertyNameSplitRe);
- }
- for (i = 0 , n = names ? names.length : 0; i < n; i++) {
- name = names[i];
- if (destination[name] === undefined) {
- destination[name] = source[name];
- }
- }
- return destination;
- },
- /**
- * @method copyIf
- * @member Ext
- * Copies a set of named properties fom the source object to the destination object
- * if the destination object does not already have them.
- *
- * Example:
- *
- * var foo = { a: 1, b: 2, c: 3 };
- *
- * var bar = Ext.copyIf({ a:42 }, foo, 'a,c');
- * // bar = { a: 42, c: 3 };
- *
- * @param {Object} destination The destination object.
- * @param {Object} source The source object.
- * @param {String/String[]} names Either an Array of property names, or a single string
- * with a list of property names separated by ",", ";" or spaces.
- * @return {Object} The `dest` object.
- */
- copyIf: function(destination, source, names) {
- var name, i, n;
- if (typeof names === 'string') {
- names = names.split(Ext.propertyNameSplitRe);
- }
- for (i = 0 , n = names ? names.length : 0; i < n; i++) {
- name = names[i];
- // Only copy a property if the destination has no property by that name
- if (!(name in destination) && (name in source)) {
- destination[name] = source[name];
- }
- }
- return destination;
- },
- /**
- * @method extend
- * @member Ext
- * This method deprecated. Use {@link Ext#define Ext.define} instead.
- * @param {Function} superclass
- * @param {Object} overrides
- * @return {Function} The subclass constructor from the <tt>overrides</tt> parameter,
- * or a generated one if not provided.
- * @deprecated 4.0.0 Use {@link Ext#define Ext.define} instead
- */
- extend: (function() {
- // inline overrides
- var objectConstructor = Object.prototype.constructor,
- inlineOverrides = function(o) {
- var m;
- for (m in o) {
- if (!o.hasOwnProperty(m)) {
-
- continue;
- }
- this[m] = o[m];
- }
- };
- return function(subclass, superclass, overrides) {
- // First we check if the user passed in just the superClass with overrides
- if (Ext.isObject(superclass)) {
- overrides = superclass;
- superclass = subclass;
- subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
- superclass.apply(this, arguments);
- };
- }
- if (!superclass) {
- Ext.raise({
- sourceClass: 'Ext',
- sourceMethod: 'extend',
- msg: 'Attempting to extend from a class which has not been loaded on the page.'
- });
- }
- // We create a new temporary class
- /* eslint-disable-next-line vars-on-top */
- var F = function() {},
- superclassProto = superclass.prototype,
- subclassProto;
- F.prototype = superclassProto;
- subclassProto = subclass.prototype = new F();
- subclassProto.constructor = subclass;
- subclass.superclass = superclassProto;
- if (superclassProto.constructor === objectConstructor) {
- superclassProto.constructor = superclass;
- }
- subclass.override = function(overrides) {
- Ext.override(subclass, overrides);
- };
- subclassProto.override = inlineOverrides;
- subclassProto.proto = subclassProto;
- subclass.override(overrides);
- subclass.extend = function(o) {
- return Ext.extend(subclass, o);
- };
- return subclass;
- };
- }()),
- /**
- * Indicates if the page is currently running in online or offline mode, according
- * to the `navigator.onLine` property.
- * @return {Boolean} `true` if the page is currently running in an online mode.
- *
- * @since 6.2.1
- */
- isOnline: function() {
- return Ext.global.navigator.onLine;
- },
- /**
- * @method iterate
- * @member Ext
- * Iterates either an array or an object. This method delegates to
- * {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and
- * {@link Ext.Object#each Ext.Object.each} otherwise.
- *
- * @param {Object/Array} object The object or array to be iterated.
- * @param {Function} fn The function to be called for each iteration. See and
- * {@link Ext.Array#each Ext.Array.each} and {@link Ext.Object#each Ext.Object.each}
- * for detailed lists of arguments passed to this function depending on the given object
- * type that is being iterated.
- * @param {Object} [scope] The scope (`this` reference) in which the specified function
- * is executed. Defaults to the object being iterated itself.
- */
- iterate: function(object, fn, scope) {
- if (Ext.isEmpty(object)) {
- return;
- }
- if (scope === undefined) {
- scope = object;
- }
- if (Ext.isIterable(object)) {
- Ext.Array.each.call(Ext.Array, object, fn, scope);
- } else {
- Ext.Object.each.call(Ext.Object, object, fn, scope);
- }
- },
- _resourcePoolRe: /^[<]([^<>@:]*)(?:[@]([^<>@:]+))?[>](.+)$/,
- /**
- * Resolves a resource URL that may contain a resource pool identifier token at the
- * front. The tokens are formatted as HTML tags "<poolName@packageName>" followed
- * by a normal relative path. This token is only processed if present at the first
- * character of the given string.
- *
- * These tokens are parsed and the pieces are then passed to the
- * {@link Ext#getResourcePath} method.
- *
- * For example:
- *
- * [{
- * xtype: 'image',
- * src: '<shared>images/foo.png'
- * },{
- * xtype: 'image',
- * src: '<@package>images/foo.png'
- * },{
- * xtype: 'image',
- * src: '<shared@package>images/foo.png'
- * }]
- *
- * In the above example, "shared" is the name of a Sencha Cmd resource pool and
- * "package" is the name of a Sencha Cmd package.
- * @member Ext
- * @param {String} url The URL that may contain a resource pool token at the front.
- * @return {String}
- * @since 6.0.1
- */
- resolveResource: function(url) {
- var ret = url,
- m;
- if (url && url.charAt(0) === '<') {
- m = Ext._resourcePoolRe.exec(url);
- if (m) {
- ret = Ext.getResourcePath(m[3], m[1], m[2]);
- }
- }
- return ret;
- },
- /**
- *
- * @member Ext
- * @method urlEncode
- * @inheritdoc Ext.Object#toQueryString
- * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
- */
- urlEncode: function() {
- var args = Ext.Array.from(arguments),
- prefix = '';
- // Support for the old `pre` argument
- if (Ext.isString(args[1])) {
- prefix = args[1] + '&';
- args[1] = false;
- }
- return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
- },
- /**
- * Alias for {@link Ext.Object#fromQueryString}.
- *
- * @member Ext
- * @method urlDecode
- * @inheritdoc Ext.Object#fromQueryString
- * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
- */
- urlDecode: function() {
- return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
- },
- /**
- * @method getScrollbarSize
- * @member Ext
- * Returns the size of the browser scrollbars. This can differ depending on
- * operating system settings, such as the theme or font size.
- * @param {Boolean} [force] true to force a recalculation of the value.
- * @return {Object} An object containing scrollbar sizes.
- * @return {Number} return.width The width of the vertical scrollbar.
- * @return {Number} return.height The height of the horizontal scrollbar.
- * @deprecated 7.0 Use `Ext.scrollbar.size` instead.
- */
- getScrollbarSize: function(force) {
- return Ext.scrollbar.size(force);
- },
- /**
- * @method typeOf
- * @member Ext
- * Returns the type of the given variable in string format. List of possible values are:
- *
- * - `undefined`: If the given value is `undefined`
- * - `null`: If the given value is `null`
- * - `string`: If the given value is a string
- * - `number`: If the given value is a number
- * - `boolean`: If the given value is a boolean value
- * - `date`: If the given value is a `Date` object
- * - `function`: If the given value is a function reference
- * - `object`: If the given value is an object
- * - `array`: If the given value is an array
- * - `regexp`: If the given value is a regular expression
- * - `element`: If the given value is a DOM Element
- * - `textnode`: If the given value is a DOM text node and contains something other than
- * whitespace
- * - `whitespace`: If the given value is a DOM text node and contains only whitespace
- *
- * @param {Object} value
- * @return {String}
- */
- typeOf: (function() {
- var nonWhitespaceRe = /\S/,
- toString = Object.prototype.toString,
- typeofTypes = {
- number: 1,
- string: 1,
- 'boolean': 1,
- 'undefined': 1
- },
- toStringTypes = {
- '[object Array]': 'array',
- '[object Date]': 'date',
- '[object Boolean]': 'boolean',
- '[object Number]': 'number',
- '[object RegExp]': 'regexp'
- };
- return function(value) {
- if (value === null) {
- return 'null';
- }
- /* eslint-disable-next-line vars-on-top */
- var type = typeof value,
- ret, typeToString;
- if (typeofTypes[type]) {
- return type;
- }
- ret = toStringTypes[typeToString = toString.call(value)];
- if (ret) {
- return ret;
- }
- if (type === 'function') {
- return 'function';
- }
- if (type === 'object') {
- if (value.nodeType !== undefined) {
- if (value.nodeType === 3) {
- return nonWhitespaceRe.test(value.nodeValue) ? 'textnode' : 'whitespace';
- } else {
- return 'element';
- }
- }
- return 'object';
- }
- Ext.raise({
- sourceClass: 'Ext',
- sourceMethod: 'typeOf',
- msg: 'Failed to determine the type of "' + value + '".'
- });
- return typeToString;
- };
- }()),
- /**
- * A global factory method to instantiate a class from a config object. For example,
- * these two calls are equivalent:
- *
- * Ext.factory({ text: 'My Button' }, 'Ext.Button');
- * Ext.create('Ext.Button', { text: 'My Button' });
- *
- * If an existing instance is also specified, it will be updated with the supplied config
- * object. This is useful if you need to either create or update an object, depending on
- * if an instance already exists. For example:
- *
- * var button;
- * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created
- * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated
- *
- * @param {Object} config The config object to instantiate or update an instance with.
- * @param {String} [classReference] The class to instantiate from (if there is a default).
- * @param {Object} [instance] The instance to update.
- * @param [aliasNamespace]
- * @member Ext
- * @deprecated 6.5.0 Use the {@link Ext.Factory#method!update update} method of the
- * associated factory instead.
- */
- factory: function(config, classReference, instance, aliasNamespace) {
- var manager = Ext.ClassManager,
- newInstance;
- // If config is falsy or a valid instance, destroy the current instance
- // (if it exists) and replace with the new one
- if (!config || config.isInstance) {
- if (instance && instance !== config) {
- instance.destroy();
- }
- return config;
- }
- if (aliasNamespace) {
- // If config is a string value, treat it as an alias
- if (typeof config === 'string') {
- return manager.instantiateByAlias(aliasNamespace + '.' + config);
- }
- // Same if 'type' is given in config
- else if (Ext.isObject(config) && 'type' in config) {
- return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config);
- }
- }
- if (config === true) {
- if (!instance && !classReference) {
- Ext.raise('[Ext.factory] Cannot determine type of class to create');
- }
- return instance || Ext.create(classReference);
- }
- if (!Ext.isObject(config)) {
- Ext.raise("Invalid config, must be a valid config object");
- }
- if ('xtype' in config) {
- newInstance = manager.instantiateByAlias('widget.' + config.xtype, config);
- } else if ('xclass' in config) {
- newInstance = Ext.create(config.xclass, config);
- }
- if (newInstance) {
- if (instance) {
- instance.destroy();
- }
- return newInstance;
- }
- if (instance) {
- return instance.setConfig(config);
- }
- return Ext.create(classReference, config);
- },
- /**
- * This method converts an object containing config objects keyed by `itemId` into
- * an array of config objects.
- *
- * @param {Object} items An object containing config objects keyed by `itemId`.
- * @param {String} [defaultProperty="xtype"] The property to set for string items.
- * @param functionProperty
- * @return {Object[]}
- * @member Ext
- * @since 6.5.0
- * @private
- */
- convertKeyedItems: function(items, defaultProperty, functionProperty) {
- if (items && !items.isInstance && Ext.isObject(items)) {
- /* eslint-disable-next-line vars-on-top */
- var obj = items,
- item, itemId, value;
- items = [];
- // See if obj looks like a single thing
- if (obj.xtype || obj.xclass || obj.itemId || obj.id) {
- items.push(obj);
- } else {
- for (itemId in obj) {
- item = obj[itemId];
- if (item) {
- if (item === true) {
- item = {};
- } else if (typeof item === 'function') {
- if (!functionProperty) {
- Ext.raise('Function not expected here');
- }
- value = item;
- item = {};
- item[functionProperty] = value;
- } else if (typeof item === 'string') {
- value = item;
- item = {};
- item[defaultProperty || 'xtype'] = value;
- } else {
- item = Ext.apply({}, item);
- }
- item.itemId = itemId;
- items.push(item);
- }
- }
- }
- }
- return items;
- },
- sortByWeight: function(items) {
- if (items) {
- Ext.Array.sort(items, Ext.weightSortFn);
- }
- },
- /**
- * Comparison function for sorting an array of objects in ascending order of `weight`.
- * @param {Object} lhs
- * @param {Object} rhs
- * @return {Number}
- * @member Ext
- * @private
- * @since 6.5.0
- */
- weightSortFn: function(lhs, rhs) {
- return (lhs.weight || 0) - (rhs.weight || 0);
- },
- /**
- * Concatenate 2 arrays. If either argument is `null` or `undefined` then it's not
- * concatenated.
- *
- * @param {Object/Object[]} a
- * @param {Object/Object[]} b
- * @return {Object[]}
- * @member Ext
- * @private
- * @since 6.5.1
- */
- concat: function(a, b) {
- var noB = b == null,
- E = Ext.emptyArray;
- return (a == null) ? (noB ? a : E.concat(b)) : (noB ? E.concat(a) : E.concat(a, b));
- },
- /**
- * @method log
- * @member Ext
- * Logs a message. If a console is present it will be used. On Opera, the method
- * "opera.postError" is called. In other cases, the message is logged to an array
- * "Ext.log.out". An attached debugger can watch this array and view the log. The
- * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
- *
- * If additional parameters are passed, they are joined and appended to the message.
- * A technique for tracing entry and exit of a function is this:
- *
- * function foo () {
- * Ext.log({ indent: 1 }, '>> foo');
- *
- * // log statements in here or methods called from here will be indented
- * // by one step
- *
- * Ext.log({ outdent: 1 }, '<< foo');
- * }
- *
- * This method does nothing in a release build.
- *
- * @param {String/Object} [options] The message to log or an options object with any
- * of the following properties:
- *
- * - `msg`: The message to log (required).
- * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
- * - `dump`: An object to dump to the log as part of the message.
- * - `stack`: True to include a stack trace in the log.
- * - `indent`: Cause subsequent log statements to be indented one step.
- * - `outdent`: Cause this and following statements to be one step less indented.
- *
- * @param {String...} [message] The message to log (required unless specified in
- * options object).
- */
- log: (function() {
- /*
- * Iterate through an object to dump its content into a string.
- * For example:
- * {
- * style: {
- * lineWidth: 1
- * },
- * label: {},
- * marker: {
- * strokeStyle: "#555",
- * radius: 3,
- * size: 3
- * },
- * subStyle: {
- * fillStyle: [
- * 0: "#133987",
- * 1: "#1c55ca",
- * 2: "#4d7fe6"
- * ]
- * },
- * markerSubStyle: {}
- * }
- *
- * @param {Object} object The object to iterate
- * @param {Number} [level] Current level of identation (and recursion). Default is 0.
- * @param {Number} [maxLevel] Maximum level of recursion. Default is 3.
- * @param {Boolean} [withFunctions] Include functions in the output.
- * @return {String} The string with the contents of the object
- */
- var primitiveRe = /string|number|boolean/;
- function dumpObject(object, level, maxLevel, withFunctions) {
- var member, type, value, name, prefix, suffix,
- members = [];
- if (Ext.isArray(object)) {
- prefix = '[';
- suffix = ']';
- } else if (Ext.isObject(object)) {
- prefix = '{';
- suffix = '}';
- }
- if (!maxLevel) {
- maxLevel = 3;
- }
- if (level > maxLevel) {
- return prefix + '...' + suffix;
- }
- level = level || 1;
- /* eslint-disable-next-line vars-on-top */
- var spacer = (new Array(level)).join(' ');
- // Cannot use Ext.encode since it can recurse endlessly
- for (name in object) {
- if (object.hasOwnProperty(name)) {
- value = object[name];
- type = typeof value;
- if (type === 'function') {
- if (!withFunctions) {
-
- continue;
- }
- member = type;
- } else if (type === 'undefined') {
- member = type;
- } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
- member = Ext.encode(value);
- } else if (Ext.isArray(value)) {
- member = dumpObject(value, level + 1, maxLevel, withFunctions);
- } else if (Ext.isObject(value)) {
- member = dumpObject(value, level + 1, maxLevel, withFunctions);
- } else {
- member = type;
- }
- members.push(spacer + name + ': ' + member);
- }
- }
- // or Ext.encode(name)
- if (members.length) {
- return prefix + '\n ' + members.join(',\n ') + '\n' + spacer + suffix;
- }
- return prefix + suffix;
- }
- function log(message) {
- var options, dump,
- con = Ext.global.console,
- level = 'log',
- indent = log.indent || 0,
- prefix, stack, fn, out, max;
- log.indent = indent;
- if (typeof message !== 'string') {
- options = message;
- message = options.msg || '';
- level = options.level || level;
- dump = options.dump;
- stack = options.stack;
- prefix = options.prefix;
- fn = options.fn;
- if (options.indent) {
- ++log.indent;
- } else if (options.outdent) {
- log.indent = indent = Math.max(indent - 1, 0);
- }
- if (dump && !(con && con.dir)) {
- message += dumpObject(dump);
- dump = null;
- }
- }
- if (arguments.length > 1) {
- message += Array.prototype.slice.call(arguments, 1).join('');
- }
- if (prefix) {
- message = prefix + ' - ' + message;
- }
- message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
- // w/o console, all messages are equal, so munge the level into the message:
- if (level !== 'log') {
- message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
- }
- if (fn) {
- message += '\nCaller: ' + fn.toString();
- }
- // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
- // an early test may fail either direction if Firebug is toggled.
- //
- if (con) {
- // if (Firebug-like console)
- if (con[level]) {
- con[level](message);
- } else {
- con.log(message);
- }
- if (dump) {
- con.dir(dump);
- }
- if (stack && con.trace) {
- // Firebug's console.error() includes a trace already...
- if (!con.firebug || level !== 'error') {
- con.trace();
- }
- }
- } else if (Ext.isOpera) {
- /* eslint-disable-next-line no-undef */
- opera.postError(message);
- } else {
- out = log.out;
- max = log.max;
- if (out.length >= max) {
- // this formula allows out.max to change (via debugger), where the
- // more obvious "max/4" would not quite be the same
- // keep newest 75%
- Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4));
- }
- out.push(message);
- }
- // Mostly informational, but the Ext.Error notifier uses them:
- ++log.count;
- ++log.counters[level];
- }
- function logx(level, args) {
- if (typeof args[0] === 'string') {
- args.unshift({});
- }
- args[0].level = level;
- log.apply(this, args);
- }
- log.error = function() {
- logx('error', Array.prototype.slice.call(arguments));
- };
- log.info = function() {
- logx('info', Array.prototype.slice.call(arguments));
- };
- log.warn = function() {
- logx('warn', Array.prototype.slice.call(arguments));
- };
- log.count = 0;
- log.counters = {
- error: 0,
- warn: 0,
- info: 0,
- log: 0
- };
- log.indentSize = 2;
- log.out = [];
- log.max = 750;
- return log;
- }()) || (function() {
- var nullLog = function() {};
- nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
- return nullLog;
- }())
- });
- /**
- * @class Ext.Version
- *
- * A utility class that wraps around a version number string and provides convenient methods
- * to perform comparisons. A version number is expressed in the following general format:
- *
- * major[.minor[.patch[.build[release]]]]
- *
- * The `Version` instance holds various readonly properties that contain the digested form
- * of the version string. The numeric componnets of `major`, `minor`, `patch` and `build`
- * as well as the textual suffix called `release`.
- *
- * Not depicted in the above syntax are three possible prefixes used to control partial
- * matching. These are '^' (the default), '>' and '~'. These are discussed below.
- *
- * Examples:
- *
- * var version = new Ext.Version('1.0.2beta'); // or maybe "1.0" or "1.2.3.4RC"
- * console.log("Version is " + version); // Version is 1.0.2beta
- *
- * console.log(version.getMajor()); // 1
- * console.log(version.getMinor()); // 0
- * console.log(version.getPatch()); // 2
- * console.log(version.getBuild()); // 0
- * console.log(version.getRelease()); // beta
- *
- * The understood values of `release` are assigned numberic equivalents for the sake of
- * comparsion. The order of these from smallest to largest is as follows:
- *
- * * `"dev"`
- * * `"alpha"` or `"a"`
- * * `"beta"` or `"b"`
- * * `"RC"` or `"rc"`
- * * `"#"`
- * * `"pl"` or `"p"`
- *
- * Any other (unrecognized) suffix is consider greater than any of these.
- *
- * ## Comparisons
- * There are two forms of comparison that are commonly needed: full and partial. Full
- * comparison is simpler and is also the default.
- *
- * Example:
- *
- * var version = new Ext.Version('1.0.2beta');
- *
- * console.log(version.isGreaterThan('1.0.1')); // True
- * console.log(version.isGreaterThan('1.0.2alpha')); // True
- * console.log(version.isGreaterThan('1.0.2RC')); // False
- * console.log(version.isGreaterThan('1.0.2')); // False
- * console.log(version.isLessThan('1.0.2')); // True
- *
- * console.log(version.match(1.0)); // True (using a Number)
- * console.log(version.match('1.0.2')); // True (using a String)
- *
- * These comparisons are ultimately implemented by {@link Ext.Version#compareTo compareTo}
- * which returns -1, 0 or 1 depending on whether the `Version' instance is less than, equal
- * to, or greater than the given "other" version.
- *
- * For example:
- *
- * var n = version.compareTo('1.0.1'); // == 1 (because 1.0.2beta > 1.0.1)
- *
- * n = version.compareTo('1.1'); // == -1
- * n = version.compareTo(version); // == 0
- *
- * ### Partial Comparisons
- * By default, unspecified version number fields are filled with 0. In other words, the
- * version number fields are 0-padded on the right or a "lower bound". This produces the
- * most commonly used forms of comparsion:
- *
- * var ver = new Version('4.2');
- *
- * n = ver.compareTo('4.2.1'); // == -1 (4.2 promotes to 4.2.0 and is less than 4.2.1)
- *
- * There are two other ways to interpret comparisons of versions of different length. The
- * first of these is to change the padding on the right to be a large number (scuh as
- * Infinity) instead of 0. This has the effect of making the version an upper bound. For
- * example:
- *
- * var ver = new Version('^4.2'); // NOTE: the '^' prefix used
- *
- * n = ver.compareTo('4.3'); // == -1 (less than 4.3)
- *
- * n = ver.compareTo('4.2'); // == 1 (greater than all 4.2's)
- * n = ver.compareTo('4.2.1'); // == 1
- * n = ver.compareTo('4.2.9'); // == 1
- *
- * The second way to interpret this comparison is to ignore the extra digits, making the
- * match a prefix match. For example:
- *
- * var ver = new Version('~4.2'); // NOTE: the '~' prefix used
- *
- * n = ver.compareTo('4.3'); // == -1
- *
- * n = ver.compareTo('4.2'); // == 0
- * n = ver.compareTo('4.2.1'); // == 0
- *
- * This final form can be useful when version numbers contain more components than are
- * important for certain comparisons. For example, the full version of Ext JS 4.2.1 is
- * "4.2.1.883" where 883 is the `build` number.
- *
- * This is how to create a "partial" `Version` and compare versions to it:
- *
- * var version421ish = new Version('~4.2.1');
- *
- * n = version421ish.compareTo('4.2.1.883'); // == 0
- * n = version421ish.compareTo('4.2.1.2'); // == 0
- * n = version421ish.compareTo('4.2.1'); // == 0
- *
- * n = version421ish.compareTo('4.2'); // == 1
- *
- * In the above example, '4.2.1.2' compares as equal to '4.2.1' because digits beyond the
- * given "4.2.1" are ignored. However, '4.2' is less than the '4.2.1' prefix; its missing
- * digit is filled with 0.
- */
- /* eslint-disable indent */
- (function() {
- // @define Ext.Version
- // @require Ext.String
- var // used by checkVersion to avoid temp arrays:
- checkVerTemp = [
- ''
- ],
- endOfVersionRe = /([^\d.])/,
- notDigitsRe = /[^\d]/g,
- plusMinusRe = /[-+]/g,
- stripRe = /\s/g,
- underscoreRe = /_/g,
- toolkitNames = {
- classic: 1,
- modern: 1
- },
- Version;
- Ext.Version = Version = function(version, defaultMode) {
- var me = this,
- padModes = me.padModes,
- ch, i, pad, parts, release, releaseStartIndex, ver;
- if (version.isVersion) {
- version = version.version;
- }
- me.version = ver = String(version).toLowerCase().replace(underscoreRe, '.').replace(plusMinusRe, '');
- ch = ver.charAt(0);
- if (ch in padModes) {
- ver = ver.substring(1);
- pad = padModes[ch];
- } else {
- pad = defaultMode ? padModes[defaultMode] : 0;
- }
- // careful - NaN is falsey!
- me.pad = pad;
- releaseStartIndex = ver.search(endOfVersionRe);
- me.shortVersion = ver;
- if (releaseStartIndex !== -1) {
- me.release = release = ver.substr(releaseStartIndex, version.length);
- me.shortVersion = ver.substr(0, releaseStartIndex);
- release = Version.releaseValueMap[release] || release;
- }
- me.releaseValue = release || pad;
- me.shortVersion = me.shortVersion.replace(notDigitsRe, '');
- /**
- * @property {Number[]} parts
- * The split array of version number components found in the version string.
- * For example, for "1.2.3", this would be `[1, 2, 3]`.
- * @readonly
- * @private
- */
- me.parts = parts = ver.split('.');
- for (i = parts.length; i--; ) {
- parts[i] = parseInt(parts[i], 10);
- }
- if (pad === Infinity) {
- // have to add this to the end to create an upper bound:
- parts.push(pad);
- }
- /**
- * @property {Number} major
- * The first numeric part of the version number string.
- * @readonly
- */
- me.major = parts[0] || pad;
- /**
- * @property {Number} [minor]
- * The second numeric part of the version number string.
- * @readonly
- */
- me.minor = parts[1] || pad;
- /**
- * @property {Number} [patch]
- * The third numeric part of the version number string.
- * @readonly
- */
- me.patch = parts[2] || pad;
- /**
- * @property {Number} [build]
- * The fourth numeric part of the version number string.
- * @readonly
- */
- me.build = parts[3] || pad;
- return me;
- };
- Version.prototype = {
- isVersion: true,
- padModes: {
- '~': NaN,
- '^': Infinity
- },
- /**
- * @property {String} [release=""]
- * The release level. The following values are understood:
- *
- * * `"dev"`
- * * `"alpha"` or `"a"`
- * * `"beta"` or `"b"`
- * * `"RC"` or `"rc"`
- * * `"#"`
- * * `"pl"` or `"p"`
- * @readonly
- */
- release: '',
- /**
- * Compares this version instance to the specified `other` version.
- *
- * @param {String/Number/Ext.Version} other The other version to which to compare.
- * @return {Number} -1 if this version is less than the target version, 1 if this
- * version is greater, and 0 if they are equal.
- */
- compareTo: function(other) {
- // "lhs" == "left-hand-side"
- // "rhs" == "right-hand-side"
- var me = this,
- lhsPad = me.pad,
- lhsParts = me.parts,
- lhsLength = lhsParts.length,
- rhsVersion = other.isVersion ? other : new Version(other),
- rhsPad = rhsVersion.pad,
- rhsParts = rhsVersion.parts,
- rhsLength = rhsParts.length,
- length = Math.max(lhsLength, rhsLength),
- i, lhs, rhs;
- for (i = 0; i < length; i++) {
- lhs = (i < lhsLength) ? lhsParts[i] : lhsPad;
- rhs = (i < rhsLength) ? rhsParts[i] : rhsPad;
- // When one or both of the values are NaN these tests produce false
- // and we end up treating NaN as equal to anything.
- if (lhs < rhs) {
- return -1;
- }
- if (lhs > rhs) {
- return 1;
- }
- }
- // same comments about NaN apply here...
- lhs = me.releaseValue;
- rhs = rhsVersion.releaseValue;
- if (lhs < rhs) {
- return -1;
- }
- if (lhs > rhs) {
- return 1;
- }
- return 0;
- },
- /**
- * Override the native `toString` method
- * @private
- * @return {String} version
- */
- toString: function() {
- return this.version;
- },
- /**
- * Override the native `valueOf` method
- * @private
- * @return {String} version
- */
- valueOf: function() {
- return this.version;
- },
- /**
- * Returns the major component value.
- * @return {Number}
- */
- getMajor: function() {
- return this.major;
- },
- /**
- * Returns the minor component value.
- * @return {Number}
- */
- getMinor: function() {
- return this.minor;
- },
- /**
- * Returns the patch component value.
- * @return {Number}
- */
- getPatch: function() {
- return this.patch;
- },
- /**
- * Returns the build component value.
- * @return {Number}
- */
- getBuild: function() {
- return this.build;
- },
- /**
- * Returns the release component text (e.g., "beta").
- * @return {String}
- */
- getRelease: function() {
- return this.release;
- },
- /**
- * Returns the release component value for comparison purposes.
- * @return {Number/String}
- */
- getReleaseValue: function() {
- return this.releaseValue;
- },
- /**
- * Returns whether this version if greater than the supplied argument
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version if greater than the target, `false` otherwise
- */
- isGreaterThan: function(target) {
- return this.compareTo(target) > 0;
- },
- /**
- * Returns whether this version if greater than or equal to the supplied argument
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version if greater than or equal to the target,
- * `false` otherwise
- */
- isGreaterThanOrEqual: function(target) {
- return this.compareTo(target) >= 0;
- },
- /**
- * Returns whether this version if smaller than the supplied argument
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version if smaller than the target, `false` otherwise
- */
- isLessThan: function(target) {
- return this.compareTo(target) < 0;
- },
- /**
- * Returns whether this version if less than or equal to the supplied argument
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version if less than or equal to the target,
- * `false` otherwise
- */
- isLessThanOrEqual: function(target) {
- return this.compareTo(target) <= 0;
- },
- /**
- * Returns whether this version equals to the supplied argument
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version equals to the target, `false` otherwise
- */
- equals: function(target) {
- return this.compareTo(target) === 0;
- },
- /**
- * Returns whether this version matches the supplied argument. Example:
- *
- * var version = new Ext.Version('1.0.2beta');
- * console.log(version.match(1)); // true
- * console.log(version.match(1.0)); // true
- * console.log(version.match('1.0.2')); // true
- * console.log(version.match('1.0.2RC')); // false
- *
- * @param {String/Number} target The version to compare with
- * @return {Boolean} `true` if this version matches the target, `false` otherwise
- */
- match: function(target) {
- target = String(target);
- return this.version.substr(0, target.length) === target;
- },
- /**
- * Returns this format: [major, minor, patch, build, release]. Useful for comparison.
- * @return {Number[]}
- */
- toArray: function() {
- var me = this;
- return [
- me.getMajor(),
- me.getMinor(),
- me.getPatch(),
- me.getBuild(),
- me.getRelease()
- ];
- },
- /**
- * Returns shortVersion version without dots and release
- * @return {String}
- */
- getShortVersion: function() {
- return this.shortVersion;
- },
- /**
- * Convenient alias to {@link Ext.Version#isGreaterThan isGreaterThan}
- * @param {String/Number/Ext.Version} target
- * @return {Boolean}
- */
- gt: function(target) {
- return this.compareTo(target) > 0;
- },
- /**
- * Convenient alias to {@link Ext.Version#isLessThan isLessThan}
- * @param {String/Number/Ext.Version} target
- * @return {Boolean}
- */
- lt: function(target) {
- return this.compareTo(target) < 0;
- },
- /**
- * Convenient alias to {@link Ext.Version#isGreaterThanOrEqual isGreaterThanOrEqual}
- * @param {String/Number/Ext.Version} target
- * @return {Boolean}
- */
- gtEq: function(target) {
- return this.compareTo(target) >= 0;
- },
- /**
- * Convenient alias to {@link Ext.Version#isLessThanOrEqual isLessThanOrEqual}
- * @param {String/Number/Ext.Version} target
- * @return {Boolean}
- */
- ltEq: function(target) {
- return this.compareTo(target) <= 0;
- }
- };
- Ext.apply(Version, {
- aliases: {
- from: {
- extjs: 'ext',
- core: 'core',
- touch: 'modern'
- },
- to: {
- ext: [
- 'extjs'
- ],
- 'core': [
- 'core'
- ],
- modern: [
- 'touch'
- ]
- }
- },
- /**
- * @private
- */
- releaseValueMap: {
- dev: -6,
- alpha: -5,
- a: -5,
- beta: -4,
- b: -4,
- rc: -3,
- '#': -2,
- p: -1,
- pl: -1
- },
- /**
- * Converts a version component to a comparable value
- *
- * @static
- * @param {Object} value The value to convert
- * @return {Object}
- */
- getComponentValue: function(value) {
- // eslint-disable-next-line max-len
- return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
- },
- /**
- * Compare 2 specified versions by ensuring the first parameter is a `Version`
- * instance and then calling the `compareTo` method.
- *
- * @static
- * @param {String} current The current version to compare to
- * @param {String} target The target version to compare to
- * @return {Number} Returns -1 if the current version is smaller than the target version,
- * 1 if greater, and 0 if they're equivalent
- */
- compare: function(current, target) {
- var ver = current.isVersion ? current : new Version(current);
- return ver.compareTo(target);
- },
- set: function(collection, packageName, version) {
- var aliases = Version.aliases.to[packageName],
- ver = version.isVersion ? version : new Version(version),
- i;
- collection[packageName] = ver;
- if (aliases) {
- for (i = aliases.length; i-- > 0; ) {
- collection[aliases[i]] = ver;
- }
- }
- return ver;
- }
- });
- /**
- * @class Ext
- */
- Ext.apply(Ext, {
- /**
- * @private
- */
- compatVersions: {},
- /**
- * @private
- *
- * Object containing version information for all packages utilized by your
- * application.
- *
- * For a public getter, please see `Ext.getVersion()`.
- */
- versions: {},
- /**
- * @private
- */
- lastRegisteredVersion: null,
- /**
- * Get the compatibility level (a version number) for the given package name. If
- * none has been registered with `Ext.setCompatVersion` then `Ext.getVersion` is
- * used to get the current version.
- *
- * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
- * @since 5.0.0
- * @private
- */
- getCompatVersion: function(packageName) {
- var versions = Ext.compatVersions,
- compat;
- if (!packageName) {
- compat = versions.ext || versions.touch || versions.core;
- } else {
- compat = versions[Version.aliases.from[packageName] || packageName];
- }
- return compat || Ext.getVersion(packageName);
- },
- /**
- * Set the compatibility level (a version number) for the given package name.
- *
- * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
- * @param {String/Ext.Version} version The version, e.g. '4.2'.
- * @since 5.0.0
- * @private
- */
- setCompatVersion: function(packageName, version) {
- Version.set(Ext.compatVersions, packageName, version);
- },
- /**
- * Set version number for the given package name.
- *
- * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
- * @param {String/Ext.Version} version The version, e.g. '1.2.3alpha', '2.4.0-dev'.
- * @return {Ext}
- */
- setVersion: function(packageName, version) {
- if (packageName in toolkitNames) {
- Ext.toolkit = packageName;
- }
- Ext.lastRegisteredVersion = Version.set(Ext.versions, packageName, version);
- return this;
- },
- /**
- * Get the version number of the supplied package name; will return the version of
- * the framework.
- *
- * @param {String} [packageName] The package name, e.g., 'core', 'touch', 'ext'.
- * @return {Ext.Version} The version.
- */
- getVersion: function(packageName) {
- var versions = Ext.versions;
- if (!packageName) {
- return versions.ext || versions.touch || versions.core;
- }
- return versions[Version.aliases.from[packageName] || packageName];
- },
- /**
- * This method checks the registered package versions against the provided version
- * `specs`. A `spec` is either a string or an object indicating a boolean operator.
- * This method accepts either form or an array of these as the first argument. The
- * second argument applies only when the first is an array and indicates whether
- * all `specs` must match or just one.
- *
- * ## Package Version Specifications
- * The string form of a `spec` is used to indicate a version or range of versions
- * for a particular package. This form of `spec` consists of three (3) parts:
- *
- * * Package name followed by "@". If not provided, the framework is assumed.
- * * Minimum version.
- * * Maximum version.
- *
- * At least one version number must be provided. If both minimum and maximum are
- * provided, these must be separated by a "-".
- *
- * Some examples of package version specifications:
- *
- * 4.2.2 (exactly version 4.2.2 of the framework)
- * 4.2.2+ (version 4.2.2 or higher of the framework)
- * 4.2.2- (version 4.2.2 or higher of the framework)
- * 4.2.1 - 4.2.3 (versions from 4.2.1 up to 4.2.3 of the framework)
- * - 4.2.2 (any version up to version 4.2.1 of the framework)
- *
- * foo@1.0 (exactly version 1.0 of package "foo")
- * foo@1.0-1.3 (versions 1.0 up to 1.3 of package "foo")
- *
- * **NOTE:** This syntax is the same as that used in Sencha Cmd's package
- * requirements declarations.
- *
- * ## Boolean Operator Specifications
- * Instead of a string, an object can be used to describe a boolean operation to
- * perform on one or more `specs`. The operator is either **`and`** or **`or`**
- * and can contain an optional **`not`**.
- *
- * For example:
- *
- * {
- * not: true, // negates boolean result
- * and: [
- * '4.2.2',
- * 'foo@1.0.1 - 2.0.1'
- * ]
- * }
- *
- * Each element of the array can in turn be a string or object spec. In other
- * words, the value is passed to this method (recursively) as the first argument
- * so these two calls are equivalent:
- *
- * Ext.checkVersion({
- * not: true, // negates boolean result
- * and: [
- * '4.2.2',
- * 'foo@1.0.1 - 2.0.1'
- * ]
- * });
- *
- * !Ext.checkVersion([
- * '4.2.2',
- * 'foo@1.0.1 - 2.0.1'
- * ], true);
- *
- * ## Examples
- *
- * // A specific framework version
- * Ext.checkVersion('4.2.2');
- *
- * // A range of framework versions:
- * Ext.checkVersion('4.2.1-4.2.3');
- *
- * // A specific version of a package:
- * Ext.checkVersion('foo@1.0.1');
- *
- * // A single spec that requires both a framework version and package
- * // version range to match:
- * Ext.checkVersion({
- * and: [
- * '4.2.2',
- * 'foo@1.0.1-1.0.2'
- * ]
- * });
- *
- * // These checks can be nested:
- * Ext.checkVersion({
- * and: [
- * '4.2.2', // exactly version 4.2.2 of the framework *AND*
- * {
- * // either (or both) of these package specs:
- * or: [
- * 'foo@1.0.1-1.0.2',
- * 'bar@3.0+'
- * ]
- * }
- * ]
- * });
- *
- * ## Version Comparisons
- * Version comparsions are assumed to be "prefix" based. That is to say, `"foo@1.2"`
- * matches any version of "foo" that has a major version 1 and a minor version of 2.
- *
- * This also applies to ranges. For example `"foo@1.2-2.2"` matches all versions
- * of "foo" from 1.2 up to 2.2 regardless of the specific patch and build.
- *
- * ## Use in Overrides
- * This methods primary use is in support of conditional overrides on an
- * `Ext.define` declaration.
- *
- * @param {String/Array/Object} specs A version specification string, an object
- * containing `or` or `and` with a value that is equivalent to `specs` or an array
- * of either of these.
- * @param {Boolean} [matchAll=false] Pass `true` to require all specs to match.
- * @return {Boolean} True if `specs` matches the registered package versions.
- */
- checkVersion: function(specs, matchAll) {
- var isArray = Ext.isArray(specs),
- aliases = Version.aliases.from,
- compat = isArray ? specs : checkVerTemp,
- length = compat.length,
- versions = Ext.versions,
- frameworkVer = versions.ext || versions.touch,
- i, index, matches, minVer, maxVer, packageName, spec, range, ver;
- if (!isArray) {
- checkVerTemp[0] = specs;
- }
- for (i = 0; i < length; ++i) {
- if (!Ext.isString(spec = compat[i])) {
- matches = Ext.checkVersion(spec.and || spec.or, !spec.or);
- if (spec.not) {
- matches = !matches;
- }
- } else {
- if (spec.indexOf(' ') >= 0) {
- spec = spec.replace(stripRe, '');
- }
- // For "name@..." syntax, we need to find the package by the given name
- // as a registered package.
- index = spec.indexOf('@');
- if (index < 0) {
- range = spec;
- ver = frameworkVer;
- } else {
- packageName = spec.substring(0, index);
- if (!(ver = versions[aliases[packageName] || packageName])) {
- // The package is not registered, so if we must matchAll then
- // we are done - FAIL:
- if (matchAll) {
- return false;
- }
- // Otherwise this spec is not a match so we can move on to the
- // next...
-
- continue;
- }
- range = spec.substring(index + 1);
- }
- // Now look for a version, version range or partial range:
- index = range.indexOf('-');
- if (index < 0) {
- // just a version or "1.0+"
- if (range.charAt(index = range.length - 1) === '+') {
- minVer = range.substring(0, index);
- maxVer = null;
- } else {
- minVer = maxVer = range;
- }
- } else if (index > 0) {
- // a range like "1.0-1.5" or "1.0-"
- minVer = range.substring(0, index);
- maxVer = range.substring(index + 1);
- } else // may be empty
- {
- // an upper limit like "-1.5"
- minVer = null;
- maxVer = range.substring(index + 1);
- }
- matches = true;
- if (minVer) {
- minVer = new Version(minVer, '~');
- // prefix matching
- matches = minVer.ltEq(ver);
- }
- if (matches && maxVer) {
- maxVer = new Version(maxVer, '~');
- // prefix matching
- matches = maxVer.gtEq(ver);
- }
- }
- // string spec
- if (matches) {
- // spec matched and we are looking for any match, so we are GO!
- if (!matchAll) {
- return true;
- }
- } else if (matchAll) {
- // spec does not match the registered package version
- return false;
- }
- }
- // In the loop above, for matchAll we return FALSE on mismatch, so getting
- // here with matchAll means we had no mismatches. On the other hand, if we
- // are !matchAll, we return TRUE on match and so we get here only if we found
- // no matches.
- return !!matchAll;
- },
- /**
- * Create a closure for deprecated code.
- *
- * // This means Ext.oldMethod is only supported in 4.0.0beta and older.
- * // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta',
- * // for example '4.0.0RC', the closure will not be invoked
- * Ext.deprecate('extjs', '4.0.0beta', function() {
- * Ext.oldMethod = Ext.newMethod;
- *
- * ...
- * });
- *
- * @param {String} packageName The package name
- * @param {String} since The last version before it's deprecated
- * @param {Function} closure The callback function to be executed with the specified
- * version is less than the current version
- * @param {Object} scope The execution scope (`this`) if the closure
- * @private
- */
- deprecate: function(packageName, since, closure, scope) {
- if (Version.compare(Ext.getVersion(packageName), since) < 1) {
- closure.call(scope);
- }
- }
- });
- }());
- // End Versioning
- // load the cmd-5 style app manifest metadata now, if available...
- (function(manifest) {
- var packages = (manifest && manifest.packages) || {},
- compat = manifest && manifest.compatibility,
- name, pkg;
- for (name in packages) {
- pkg = packages[name];
- if (pkg && pkg.version) {
- Ext.setVersion(name, pkg.version);
- }
- }
- if (compat) {
- if (Ext.isString(compat)) {
- Ext.setCompatVersion('core', compat);
- } else {
- for (name in compat) {
- Ext.setCompatVersion(name, compat[name]);
- }
- }
- }
- if (!packages.ext && !packages.touch) {
- Ext.setVersion('ext', '7.0.0.168');
- Ext.setVersion('core', '7.0.0.168');
- }
- })(Ext.manifest);
- /**
- * @class Ext.Config
- * This class manages a config property. Instances of this type are created and cached as
- * classes declare their config properties. One instance of this class is created per
- * config property name.
- *
- * Ext.define('MyClass', {
- * config: {
- * foo: 42
- * }
- * });
- *
- * This uses the cached `Ext.Config` instance for the "foo" property.
- *
- * When config properties apply options to config properties a prototype chained object is
- * created from the cached instance. For example:
- *
- * Ext.define('MyClass', {
- * config: {
- * foo: {
- * $value: 42,
- * lazy: true
- * }
- * }
- * });
- *
- * This creates a prototype chain to the cached "foo" instance of `Ext.Config` and applies
- * the `lazy` option to that new instance. This chained instance is then kept by the
- * `Ext.Configurator` for that class.
- * @private
- */
- Ext.Config = function(name) {
- // @define Ext.class.Config
- // @define Ext.Config
- var me = this,
- capitalizedName = name.charAt(0).toUpperCase() + name.substr(1);
- /**
- * @property {String} name
- * The name of this config property.
- * @readonly
- * @private
- * @since 5.0.0
- */
- me.name = name;
- /**
- * @property {Object} names
- * This object holds the cached names used to lookup properties or methods for this
- * config property. The properties of this object are explained in the context of an
- * example property named "foo".
- *
- * @property {String} names.internal The default backing property ("_foo").
- *
- * @property {String} names.initializing The property that is `true` when the config
- * is being initialized ("isFooInitializing").
- *
- * @property {String} names.apply The name of the applier method ("applyFoo").
- *
- * @property {String} names.update The name of the updater method ("updateFoo").
- *
- * @property {String} names.get The name of the getter method ("getFoo").
- *
- * @property {String} names.set The name of the setter method ("setFoo").
- *
- * @property {String} names.initGet The name of the initializing getter ("initGetFoo").
- *
- * @property {String} names.changeEvent The name of the change event ("foochange").
- *
- * @readonly
- * @private
- * @since 5.0.0
- */
- me.names = {
- internal: '_' + name,
- initializing: 'is' + capitalizedName + 'Initializing',
- apply: 'apply' + capitalizedName,
- update: 'update' + capitalizedName,
- get: 'get' + capitalizedName,
- set: 'set' + capitalizedName,
- initGet: 'initGet' + capitalizedName,
- changeEvent: name.toLowerCase() + 'change'
- };
- // This allows folks to prototype chain on top of these objects and yet still cache
- // generated methods at the bottom of the chain.
- me.root = me;
- };
- Ext.Config.map = {};
- Ext.Config.get = function(name) {
- var map = Ext.Config.map,
- ret = map[name] || (map[name] = new Ext.Config(name));
- return ret;
- };
- Ext.Config.prototype = {
- self: Ext.Config,
- isConfig: true,
- /**
- * @cfg {Boolean} [cached=false]
- * When set as `true` the config property will be stored on the class prototype once
- * the first instance has had a chance to process the default value.
- * @private
- * @since 5.0.0
- */
- /**
- * @cfg {Boolean} [lazy=false]
- * When set as `true` the config property will not be immediately initialized during
- * the `initConfig` call.
- * @private
- * @since 5.0.0
- */
- /**
- * @cfg {Boolean} [evented=false]
- * When set as `true` the config property will be treated as a
- * {@link Ext.Evented Evented Config}.
- * @private
- * @since 6.0.0
- */
- /**
- * @cfg {Function} [merge]
- * This function if supplied will be called as classes or instances provide values
- * that need to be combined with inherited values. The function should return the
- * value that will be the config value. Further calls may receive such returned
- * values as `oldValue`.
- *
- * @cfg {Mixed} merge.newValue The new value to merge with the old.
- *
- * @cfg {Mixed} merge.oldValue The current value prior to `newValue` being merged.
- *
- * @cfg {Mixed} merge.target The class or instance to which the merged config value
- * will be applied.
- *
- * @cfg {Ext.Class} merge.mixinClass The mixin providing the `newValue` or `null` if
- * the `newValue` is not being provided by a mixin.
- */
- combine: function(value, baseValue, instance, clone) {
- var cfg = this;
- if (cfg.merge) {
- value = cfg.merge(clone ? Ext.clone(value) : value, baseValue, instance);
- } else if (value && value.constructor === Object && baseValue && baseValue.constructor === Object) {
- value = Ext.merge({}, baseValue, value);
- } else if (clone && value) {
- value = Ext.clone(value);
- }
- return value;
- },
- equals: function(value1, value2) {
- return value1 === value2;
- },
- getGetter: function() {
- return this.getter || (this.root.getter = this.makeGetter());
- },
- getInitGetter: function() {
- return this.initGetter || (this.root.initGetter = this.makeInitGetter());
- },
- getSetter: function() {
- return this.setter || (this.root.setter = this.makeSetter());
- },
- getEventedSetter: function() {
- return this.eventedSetter || (this.root.eventedSetter = this.makeEventedSetter());
- },
- /**
- * Returns the name of the property that stores this config on the given instance or
- * class prototype.
- * @param {Object} target
- * @return {String}
- */
- getInternalName: function(target) {
- return target.$configPrefixed ? this.names.internal : this.name;
- },
- mergeNew: function(newValue, oldValue, target, mixinClass) {
- var ret, key;
- if (!oldValue) {
- ret = newValue;
- } else if (!newValue) {
- ret = oldValue;
- } else {
- ret = Ext.Object.chain(oldValue);
- for (key in newValue) {
- if (!mixinClass || !(key in ret)) {
- ret[key] = newValue[key];
- }
- }
- }
- return ret;
- },
- /**
- * Merges the `newValue` and the `oldValue` assuming that these are basically objects
- * the represent sets. For example something like:
- *
- * {
- * foo: true,
- * bar: true
- * }
- *
- * The merge process converts arrays like the following into the above:
- *
- * [ 'foo', 'bar' ]
- *
- * @param {String/String[]/Object} newValue
- * @param {Object} oldValue
- * @param {Boolean} [preserveExisting=false]
- * @return {Object}
- * @private
- * @since 5.0.0
- */
- mergeSets: function(newValue, oldValue, preserveExisting) {
- var ret = oldValue ? Ext.Object.chain(oldValue) : {},
- i, val;
- if (newValue instanceof Array) {
- for (i = newValue.length; i--; ) {
- val = newValue[i];
- if (!preserveExisting || !(val in ret)) {
- ret[val] = true;
- }
- }
- } else if (newValue) {
- if (newValue.constructor === Object) {
- for (i in newValue) {
- val = newValue[i];
- if (!preserveExisting || !(i in ret)) {
- ret[i] = val;
- }
- }
- } else if (!preserveExisting || !(newValue in ret)) {
- ret[newValue] = true;
- }
- }
- return ret;
- },
- //--------------------------------------------------
- // Factories
- makeGetter: function() {
- var name = this.name,
- prefixedName = this.names.internal;
- return function() {
- var internalName = this.$configPrefixed ? prefixedName : name;
- return this[internalName];
- };
- },
- makeInitGetter: function() {
- var name = this.name,
- names = this.names,
- setName = names.set,
- getName = names.get,
- initializingName = names.initializing;
- return function() {
- var me = this;
- me[initializingName] = true;
- // Remove the initGetter from the instance now that the value has been set.
- delete me[getName];
- me[setName](me.config[name]);
- delete me[initializingName];
- return me[getName].apply(me, arguments);
- };
- },
- makeSetter: function() {
- var name = this.name,
- names = this.names,
- prefixedName = names.internal,
- getName = names.get,
- applyName = names.apply,
- updateName = names.update,
- setter;
- // http://jsperf.com/method-call-apply-or-direct
- // http://jsperf.com/method-detect-invoke
- setter = function(value) {
- var me = this,
- internalName = me.$configPrefixed ? prefixedName : name,
- oldValue = me[internalName],
- watch;
- // Remove the initGetter from the instance now that the value has been set.
- delete me[getName];
- if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
- // The old value might have been changed at this point
- // (after the apply call chain) so it should be read again
- if (value !== (oldValue = me[internalName])) {
- me[internalName] = value;
- if (me[updateName]) {
- me[updateName](value, oldValue);
- }
- watch = me.$configWatch;
- if (watch && !me.isConfiguring) {
- // Since the updater could have modified things (tho unlikely), just
- // re-read the stored value:
- watch.fire(name, [
- me,
- name,
- me[internalName],
- oldValue
- ]);
- }
- }
- }
- return me;
- };
- setter.$isDefault = true;
- return setter;
- },
- makeEventedSetter: function() {
- var name = this.name,
- names = this.names,
- prefixedName = names.internal,
- getName = names.get,
- applyName = names.apply,
- updateName = names.update,
- changeEventName = names.changeEvent,
- updateFn = function(me, value, oldValue, internalName) {
- me[internalName] = value;
- if (me[updateName]) {
- me[updateName](value, oldValue);
- }
- // eslint-disable-next-line vars-on-top
- var watch = me.$configWatch;
- if (watch) {
- // !me.isConfiguring is assured
- watch.fire(name, [
- me,
- name,
- value,
- oldValue
- ]);
- }
- },
- setter;
- // http://jsperf.com/method-call-apply-or-direct
- // http://jsperf.com/method-detect-invoke
- setter = function(value) {
- var me = this,
- internalName = me.$configPrefixed ? prefixedName : name,
- oldValue = me[internalName];
- // Remove the initGetter from the instance now that the value has been set.
- delete me[getName];
- if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
- // The old value might have been changed at this point
- // (after the apply call chain) so it should be read again
- if (value !== (oldValue = me[internalName])) {
- if (me.isConfiguring) {
- me[internalName] = value;
- if (me[updateName]) {
- me[updateName](value, oldValue);
- }
- } else {
- me.fireEventedAction(changeEventName, [
- me,
- value,
- oldValue
- ], updateFn, me, [
- me,
- value,
- oldValue,
- internalName
- ]);
- }
- }
- }
- return me;
- };
- setter.$isDefault = true;
- return setter;
- }
- };
- /**
- * @class Ext.Configurator
- * This class manages the config properties for a class.
- * @private
- */
- (function() {
- // see end of file (and please don't indent the whole file)
- var ExtConfig = Ext.Config,
- configPropMap = ExtConfig.map,
- ExtObject = Ext.Object;
- Ext.Configurator = function(cls) {
- // @define Ext.class.Configurator
- // @define Ext.Configurator
- // @require Ext.Config
- var me = this,
- prototype = cls.prototype,
- superCfg = cls.superclass ? cls.superclass.self.$config : null;
- /**
- * @property {Ext.Class} cls The class to which this instance is associated.
- * @private
- * @readonly
- */
- me.cls = cls;
- /**
- * The super class `Configurator` instance or `null` if there is no super class.
- *
- * @property {Ext.Configurator} superCfg
- * @private
- * @readonly
- */
- me.superCfg = superCfg;
- if (superCfg) {
- /**
- * This object holds an `Ext.Config` value for each config property keyed by name.
- * This object has as its prototype object the `configs` of its super class.
- *
- * This map is maintained as each property is added via the `add` method.
- *
- * @property {Object} configs
- * @private
- * @readonly
- */
- me.configs = ExtObject.chain(superCfg.configs);
- /**
- * This object holds a bool value for each cachedConfig property keyed by name.
- *
- * This map is maintained as each property is added via the `add` method.
- *
- * @property {Object} cachedConfigs
- * @private
- * @readonly
- */
- me.cachedConfigs = ExtObject.chain(superCfg.cachedConfigs);
- /**
- * This object holds a `Number` for each config property keyed by name. This object has
- * as its prototype object the `initMap` of its super class. The value of each property
- * has the following meaning:
- *
- * * `0` - initial value is `null` and requires no processing.
- * * `1` - initial value must be set on each instance.
- * * `2` - initial value can be cached on the prototype by the first instance.
- *
- * Any `null` values will either never be added to this map or (if added by a base
- * class and set to `null` by a derived class) will cause the entry to be 0.
- *
- * This map is maintained as each property is added via the `add` method.
- *
- * @property {Object} initMap
- * @private
- * @readonly
- */
- me.initMap = ExtObject.chain(superCfg.initMap);
- /**
- * This object holds the default value for each config property keyed by name. This
- * object has as its prototype object the `values` of its super class.
- *
- * This map is maintained as each property is added via the `add` method.
- *
- * @property {Object} values
- * @private
- * @readonly
- */
- me.values = ExtObject.chain(superCfg.values);
- me.needsFork = superCfg.needsFork;
- // The reason this feature is debug only is that we would have to create this
- // map for all classes because deprecations could be added to bases after the
- // derived class had created its Configurator.
- me.deprecations = ExtObject.chain(superCfg.deprecations);
- } else {
- me.configs = {};
- me.cachedConfigs = {};
- me.initMap = {};
- me.values = {};
- me.deprecations = {};
- }
- prototype.config = prototype.defaultConfig = me.values;
- cls.$config = me;
- };
- Ext.Configurator.prototype = {
- self: Ext.Configurator,
- needsFork: false,
- /**
- * This array holds the properties that need to be set on new instances.
- *
- * This array is populated when the first instance is passed to `configure` (basically
- * when the first instance is created). The entries in `initMap` are iterated to find
- * those configs needing per-instance processing.
- *
- * @property {Ext.Config[]} initList
- * @private
- */
- initList: null,
- /**
- * This method adds new config properties. This is called for classes when they are
- * declared, then for any mixins that class may define and finally for any overrides
- * defined that target the class.
- *
- * @param {Object} config The config object containing the new config properties.
- * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
- * @private
- */
- add: function(config, mixinClass) {
- var me = this,
- Cls = me.cls,
- configs = me.configs,
- cachedConfigs = me.cachedConfigs,
- initMap = me.initMap,
- prototype = Cls.prototype,
- mixinConfigs = mixinClass && mixinClass.$config.configs,
- values = me.values,
- isObject, meta, isCached, merge, cfg, currentValue, name, names, s, value;
- for (name in config) {
- value = config[name];
- isObject = value && value.constructor === Object;
- meta = isObject && '$value' in value ? value : null;
- isCached = false;
- if (meta) {
- isCached = !!meta.cached;
- value = meta.$value;
- isObject = value && value.constructor === Object;
- }
- merge = meta && meta.merge;
- cfg = configs[name];
- if (cfg) {
- // Only proceed with a mixin if we have a custom merge.
- if (mixinClass) {
- merge = cfg.merge;
- if (!merge) {
-
- continue;
- }
- // Don't want the mixin meta modifying our own
- meta = null;
- } else {
- merge = merge || cfg.merge;
- }
- // This means that we've already declared this as a config in a superclass
- // Let's not allow us to change it here.
- if (!mixinClass && isCached && !cachedConfigs[name]) {
- Ext.raise('Redefining config as cached: ' + name + ' in class: ' + Cls.$className);
- }
- // There is already a value for this config and we are not allowed to
- // modify it. So, if it is an object and the new value is also an object,
- // the result is a merge so we have to merge both on to a new object.
- currentValue = values[name];
- if (merge) {
- value = merge.call(cfg, value, currentValue, Cls, mixinClass);
- } else if (isObject) {
- if (currentValue && currentValue.constructor === Object) {
- // We favor moving the cost of an "extra" copy here because this
- // is likely to be a rare thing two object values for the same
- // property. The alternative would be to clone the initial value
- // to make it safely modifiable even though it is likely to never
- // need to be modified.
- value = Ext.merge({}, currentValue, value);
- }
- }
- } else // else "currentValue" is a primitive so "value" can just replace it
- // else "value" is a primitive and it can just replace currentValue
- {
- // This is a new property value, so add it to the various maps "as is".
- // In the majority of cases this value will not be overridden or need to
- // be forked.
- if (mixinConfigs) {
- // Since this is a config from a mixin, we don't want to apply its
- // meta-ness because it already has. Instead we want to use its cfg
- // instance:
- cfg = mixinConfigs[name];
- meta = null;
- } else {
- cfg = ExtConfig.get(name);
- }
- configs[name] = cfg;
- if (cfg.cached || isCached) {
- cachedConfigs[name] = true;
- }
- // Ensure that the new config has a getter and setter. Because this method
- // is called during class creation as the "config" (or "cachedConfig") is
- // being processed, the user's methods will not be on the prototype yet.
- //
- // This has the following trade-offs:
- //
- // - Custom getters are rare so there is minimal waste generated by them.
- //
- // - Custom setters are more common but, by putting the default setter on
- // the prototype prior to addMembers, when the user methods are added
- // callParent can be used to call the generated setter. This is almost
- // certainly desirable as the setter has some very important semantics
- // that a custom setter would probably want to preserve by just adding
- // logic before and/or after the callParent.
- //
- // - By not adding these to the class body we avoid all the "is function"
- // tests that get applied to each class member thereby streamlining the
- // downstream class creation process.
- //
- // We still check for getter and/or setter but primarily for reasons of
- // backwards compatibility and "just in case" someone relied on inherited
- // getter/setter even though the base did not have the property listed as
- // a "config" (obscure case certainly).
- //
- names = cfg.names;
- if (!prototype[s = names.get]) {
- prototype[s] = cfg.getter || cfg.getGetter();
- }
- if (!prototype[s = names.set]) {
- prototype[s] = (meta && meta.evented) ? (cfg.eventedSetter || cfg.getEventedSetter()) : (cfg.setter || cfg.getSetter());
- }
- }
- if (meta) {
- if (cfg.owner !== Cls) {
- configs[name] = cfg = Ext.Object.chain(cfg);
- cfg.owner = Cls;
- }
- Ext.apply(cfg, meta);
- delete cfg.$value;
- }
- // Fork checks all the default values to see if they are arrays or objects
- // Do this to save us from doing it on each run
- if (!me.needsFork && value && (value.constructor === Object || value instanceof Array)) {
- me.needsFork = true;
- }
- // If the value is non-null, we need to initialize it.
- if (value !== null) {
- initMap[name] = true;
- } else {
- if (prototype.$configPrefixed) {
- prototype[configs[name].names.internal] = null;
- } else {
- prototype[configs[name].name] = null;
- }
- if (name in initMap) {
- // Only set this to false if we already have it in the map, otherwise,
- // just leave it out!
- initMap[name] = false;
- }
- }
- values[name] = value;
- }
- },
- addDeprecations: function(configs) {
- var me = this,
- deprecations = me.deprecations,
- className = (me.cls.$className || '') + '#',
- message, newName, oldName;
- for (oldName in configs) {
- newName = configs[oldName];
- // configs: {
- // dead: null,
- //
- // renamed: 'newName',
- //
- // removed: {
- // message: 'This config was replaced by pixie dust'
- // }
- // }
- if (!newName) {
- message = 'This config has been removed.';
- } else if (!(message = newName.message)) {
- message = 'This config has been renamed to "' + newName + '"';
- }
- deprecations[oldName] = className + oldName + ': ' + message;
- }
- },
- /**
- * This method configures the given `instance` using the specified `instanceConfig`.
- * The given `instance` should have been created by this object's `cls`.
- *
- * @param {Object} instance The instance to configure.
- * @param {Object} instanceConfig The configuration properties to apply to `instance`.
- * @private
- */
- configure: function(instance, instanceConfig) {
- var me = this,
- configs = me.configs,
- deprecations = me.deprecations,
- initMap = me.initMap,
- initListMap = me.initListMap,
- initList = me.initList,
- prototype = me.cls.prototype,
- values = me.values,
- remaining = 0,
- firstInstance = !initList,
- cachedInitList, cfg, getter, i, internalName, ln, names, name, value, isCached, valuesKey, field, transforms;
- values = me.needsFork ? ExtObject.fork(values) : ExtObject.chain(values);
- // Let apply/update methods know that the initConfig is currently running.
- instance.isConfiguring = true;
- if (firstInstance) {
- // When called to configure the first instance of the class to which we are
- // bound we take a bit to plan for instance 2+.
- me.initList = initList = [];
- me.initListMap = initListMap = {};
- instance.isFirstInstance = true;
- for (name in initMap) {
- cfg = configs[name];
- isCached = cfg.cached;
- if (initMap[name]) {
- names = cfg.names;
- value = values[name];
- if (!prototype[names.set].$isDefault || prototype[names.apply] || prototype[names.update] || typeof value === 'object') {
- if (isCached) {
- // This is a cachedConfig, so it needs to be initialized with
- // the default value and placed on the prototype... but the
- // instanceConfig may have a different value so the value may
- // need resetting. We have to defer the call to the setter so
- // that all of the initGetters are set up first.
- (cachedInitList || (cachedInitList = [])).push(cfg);
- } else {
- // Remember this config so that all instances (including this
- // one) can invoke the setter to properly initialize it.
- initList.push(cfg);
- initListMap[name] = true;
- }
- // Point all getters to the initGetters. By doing this here we
- // avoid creating initGetters for configs that don't need them
- // and we can easily pick up the cached fn to save the call.
- instance[names.get] = cfg.initGetter || cfg.getInitGetter();
- } else {
- // Non-object configs w/o custom setter, applier or updater can
- // be simply stored on the prototype.
- prototype[cfg.getInternalName(prototype)] = value;
- }
- } else if (isCached) {
- prototype[cfg.getInternalName(prototype)] = undefined;
- }
- }
- }
- // TODO - we need to combine the cached loop with the instanceConfig loop to
- // avoid duplication of init getter setups (for correctness if a cached cfg
- // calls on a non-cached cfg)
- ln = cachedInitList && cachedInitList.length;
- if (ln) {
- // This is only ever done on the first instance we configure. Any config in
- // cachedInitList has to be set to the default value to allow any side-effects
- // or transformations to occur. The resulting values can then be elevated to
- // the prototype and this property need not be initialized on each instance.
- for (i = 0; i < ln; ++i) {
- internalName = cachedInitList[i].getInternalName(prototype);
- // Since these are cached configs the base class will potentially have put
- // its cached values on the prototype so we need to hide these while we
- // run the inits for our cached configs.
- instance[internalName] = null;
- }
- for (i = 0; i < ln; ++i) {
- names = (cfg = cachedInitList[i]).names;
- getter = names.get;
- if (instance.hasOwnProperty(getter)) {
- instance[names.set](values[cfg.name]);
- delete instance[getter];
- }
- }
- for (i = 0; i < ln; ++i) {
- internalName = cachedInitList[i].getInternalName(prototype);
- prototype[internalName] = instance[internalName];
- delete instance[internalName];
- }
- }
- // The cachedConfigs have all been set to the default values including any of
- // those that may have been triggered by their getter.
- // If the instanceConfig has a platformConfig in it, we need to merge the active
- // rules of that object to make the actual instanceConfig.
- if (instanceConfig && instanceConfig.platformConfig) {
- instanceConfig = me.resolvePlatformConfig(instance, instanceConfig);
- }
- if (firstInstance) {
- // Allow the class to do things once the cachedConfig has been processed.
- // We need to call this method always when the first instance is configured
- // whether or not it actually has cached configs
- if (instance.afterCachedConfig && !instance.afterCachedConfig.$nullFn) {
- instance.afterCachedConfig(instanceConfig);
- }
- }
- // Now that the cachedConfigs have been processed we can apply the instanceConfig
- // and hide the "configs" on the prototype. This will serve as the source for any
- // configs that need to initialize from their initial getter call.
- // IMPORTANT: "this.hasOwnProperty('config')" is how a config applier/updater can
- // tell it is processing the cached config value vs an instance config value.
- instance.config = values;
- // There are 2 possibilities here:
- // 1) If it's the first time in this function, we may have had cachedConfigs running.
- // these configs may have called the getters for any of the normal getters, which
- // means the initial getters have been clobbered on the instance and won't be able
- // to be called below when we iterate over the initList. As such, we need to
- // reinitialize them here, even though we've done it up above.
- //
- // 2) If this the second time in this function, the cachedConfigs won't be processed,
- // so we don't need to worry about them clobbering config values. However, since
- // we've already done all our setup, we won't enter into the block that sets the
- // initGetter, so we need to do it here anyway.
- //
- // Also note, that lazy configs will appear in the initList because we need
- // to spin up the initGetter.
- for (i = 0 , ln = initList.length; i < ln; ++i) {
- cfg = initList[i];
- instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
- }
- // Give the class a chance to transform the configs. These are stored on the class
- // as a sorted array after the first instance is created. Prior to that, these are
- // stored as a prototype chained object on the class prototype. This allows the
- // transforms to be registered at any time during class load so long as they are
- // all loaded before instances are created.
- if (!(transforms = instance.self.$configTransforms)) {
- instance.self.$configTransforms = transforms = [];
- ln = instance.$configTransforms;
- for (name in ln) {
- transforms.push([
- name,
- ln[name]
- ]);
- }
- ln = transforms.length;
- if (ln > 1) {
- transforms.sort(me.transformSorter);
- for (i = 0; i < ln; ++i) {
- transforms[i] = transforms[i][0];
- }
- } else if (ln) {
- transforms[0] = transforms[0][0];
- }
- }
- for (i = 0; i < transforms.length; ++i) {
- name = transforms[i];
- if (instance[name]) {
- instanceConfig = instance[name](instanceConfig, me);
- }
- }
- // Important: We are looping here twice on purpose. This first loop serves 2 purposes:
- //
- // 1) Ensure the values collection is fully populated before we call any setters. Since
- // a setter may have an updater/applier, it could potentially call another getter() to grab
- // the value for some other property, so this ensures they are all set on the config object.
- //
- // 2) Ensure that the initGetter is set as the getter for any config that doesn't appear in
- // the initList. We need to ensure that the initGetter is pushed on for everything that
- // we will be setting during init time.
- //
- // The merging in this loop cannot be completed by Ext.merge(), since we do NOT want
- // to merge non-strict values, they should always just be assigned across without
- // modification.
- if (instanceConfig) {
- for (name in instanceConfig) {
- value = instanceConfig[name];
- cfg = configs[name];
- if (deprecations[name]) {
- Ext.log.warn(deprecations[name]);
- if (!cfg) {
- // If there is a Config for this, perhaps the class is emulating
- // the old config... If there is not a Config we don't want to
- // proceed and put the property on the instance. That will likely
- // hide the bug during development.
-
- continue;
- }
- }
- if (!cfg) {
- field = instance.self.prototype[name];
- if (instance.$configStrict && (typeof field === 'function') && !field.$nullFn) {
- // In strict mode you cannot override functions
- Ext.raise('Cannot override method ' + name + ' on ' + instance.$className + ' instance.');
- }
- // Not all "configs" use the config system so in this case simply put
- // the value on the instance:
- instance[name] = value;
- } else {
- // However we still need to create the initial value that needs
- // to be used. We also need to spin up the initGetter.
- if (!cfg.lazy) {
- ++remaining;
- }
- if (!initListMap[name]) {
- instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
- }
- valuesKey = values[name];
- if (cfg.merge) {
- value = cfg.merge(value, valuesKey, instance);
- } else if (value && value.constructor === Object) {
- if (valuesKey && valuesKey.constructor === Object) {
- value = Ext.merge(values[name], value);
- } else {
- value = Ext.clone(value, false);
- }
- }
- }
- values[name] = value;
- }
- }
- // Give the class a chance to hook in prior to initializing the configs.
- if (instance.beforeInitConfig && !instance.beforeInitConfig.$nullFn) {
- if (instance.beforeInitConfig(instanceConfig) === false) {
- return;
- }
- }
- if (instanceConfig) {
- for (name in instanceConfig) {
- if (!remaining) {
- // For classes that have few proper Config properties, this saves us
- // from making the full 2 passes over the instanceConfig.
- break;
- }
- // We can ignore deprecated configs here because we warned about them
- // above. Further, since we only process proper Config's here we would
- // not be skipping them anyway.
- cfg = configs[name];
- if (cfg && !cfg.lazy) {
- --remaining;
- // A proper "config" property so call the setter to set the value.
- names = cfg.names;
- getter = names.get;
- // At this point the initGetter may have already been called and
- // cleared if the getter was called from the applier or updater of a
- // previously processed instance config. checking if the instance has
- // its own getter ensures the setter does not get called twice.
- if (instance.hasOwnProperty(getter)) {
- instance[names.set](values[name]);
- // The generated setter will remove the initGetter from the instance
- // but the user may have provided their own setter so we have to do
- // this here as well:
- delete instance[names.get];
- }
- }
- }
- }
- // Process configs declared on the class that need per-instance initialization.
- for (i = 0 , ln = initList.length; i < ln; ++i) {
- cfg = initList[i];
- names = cfg.names;
- getter = names.get;
- if (!cfg.lazy && instance.hasOwnProperty(getter)) {
- // Since the instance still hasOwn the getter, that means we've set an initGetter
- // and it hasn't been cleared by calling any setter. Since we've never set the value
- // because it wasn't passed in the instance, we go and set it here, taking the value
- // from our definition config and passing it through finally clear off the getter.
- instance[names.set](values[cfg.name]);
- delete instance[getter];
- }
- }
- // Expose the value from the prototype chain (false):
- delete instance.isConfiguring;
- },
- getCurrentConfig: function(instance) {
- var defaultConfig = instance.defaultConfig,
- config = {},
- name;
- for (name in defaultConfig) {
- config[name] = instance[configPropMap[name].names.get]();
- }
- return config;
- },
- /**
- * This method is called to update the internal state of a given config when that
- * config is needed in a config transform (such as responsive or stateful mixins).
- *
- * @param {Ext.Base} instance The instance to configure.
- * @param {Object} instanceConfig The config for the instance.
- * @param {String[]} names The name(s) of the config(s) to process.
- * @private
- * @since 6.7.0
- */
- hoistConfigs: function(instance, instanceConfig, names) {
- var config = instance.config,
- configs = this.configs,
- initListMap = this.initListMap,
- ret = false,
- cfg, i, name;
- for (i = 0; i < names.length; ++i) {
- name = names[i];
- if (instanceConfig && name in instanceConfig) {
- cfg = configs[name];
- // the Ext.Config instance
- config[name] = cfg.combine(instanceConfig[name], config[name], instance);
- if (!initListMap[name]) {
- instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
- }
- }
- // The config could be defined on the class, so may be present even if
- // not in instance config.
- if (config[name] != null) {
- ret = true;
- }
- }
- return ret;
- },
- /**
- * Merges the values of a config object onto a base config.
- * @param {Ext.Base} instance
- * @param {Object} baseConfig
- * @param {Object} config
- * @param {Boolean} [clone=false]
- * @return {Object} the merged config
- * @private
- */
- merge: function(instance, baseConfig, config, clone) {
- // Although this is a "private" method. It is used by Sencha Architect and so
- // its api should remain stable.
- var configs = this.configs,
- name, value, baseValue, cfg;
- if (clone) {
- baseConfig = Ext.clone(baseConfig, /* cloneDom= */
- false);
- }
- for (name in config) {
- value = config[name];
- cfg = configs[name];
- if (cfg) {
- baseValue = baseConfig[name];
- if (cfg.merge) {
- value = cfg.merge(value, baseValue, instance);
- } else if (value && value.constructor === Object) {
- if (baseValue && baseValue.constructor === Object) {
- value = Ext.merge(baseValue, value);
- } else {
- value = Ext.clone(value, false);
- }
- }
- }
- baseConfig[name] = value;
- }
- return baseConfig;
- },
- /**
- * @private
- */
- reconfigure: function(instance, instanceConfig, options) {
- var currentConfig = instance.config,
- configList = [],
- strict = instance.$configStrict && !(options && options.strict === false),
- configs = this.configs,
- defaults = options && options.defaults,
- cfg, getter, i, len, name, names, prop;
- for (name in instanceConfig) {
- cfg = configs[name];
- /* eslint-disable-next-line max-len */
- if (defaults && instance.hasOwnProperty(cfg && instance.$configPrefixed ? cfg.names.internal : name)) {
-
- continue;
- }
- currentConfig[name] = instanceConfig[name];
- if (this.deprecations[name]) {
- // See similar logic doc in configure() method.
- Ext.log.warn(this.deprecations[name]);
- if (!cfg) {
-
- continue;
- }
- }
- if (cfg) {
- // To ensure that configs being set here get processed in the proper order
- // we must give them init getters just in case they depend upon each other
- instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
- } else {
- // Check for existence of the property on the prototype before proceeding.
- // If present on the prototype, and if the property is a function we
- // do not allow it to be overridden by a property in the config object
- // in strict mode (unless the function on the prototype is a emptyFn or
- // identityFn). Note that we always check the prototype, not the instance
- // because calling setConfig a second time should have the same results -
- // the first call may have set a function on the instance.
- prop = instance.self.prototype[name];
- if (strict) {
- if ((typeof prop === 'function') && !prop.$nullFn) {
- Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance.");
-
- continue;
- } else {
- if (name !== 'type') {
- Ext.log.warn('No such config "' + name + '" for class ' + instance.$className);
- }
- }
- }
- }
- configList.push(name);
- }
- for (i = 0 , len = configList.length; i < len; i++) {
- name = configList[i];
- cfg = configs[name];
- if (cfg) {
- names = cfg.names;
- getter = names.get;
- if (instance.hasOwnProperty(getter)) {
- // Since the instance still hasOwn the getter, that means we've set
- // an initGetter and it hasn't been cleared by calling any setter.
- // Since we've never set the value because it wasn't passed in the instance,
- // we go and set it here, taking the value from our definition config
- // and passing it through finally clear off the getter.
- instance[names.set](instanceConfig[name]);
- delete instance[getter];
- }
- } else {
- cfg = configPropMap[name] || Ext.Config.get(name);
- names = cfg.names;
- if (instance[names.set]) {
- instance[names.set](instanceConfig[name]);
- } else {
- // apply non-config props directly to the instance
- instance[name] = instanceConfig[name];
- }
- }
- }
- },
- /**
- * This method accepts an instance config object containing a `platformConfig`
- * property and merges the appropriate rules from that sub-object with the root object
- * to create the final config object that should be used. This is method called by
- * `{@link #configure}` when it receives an `instanceConfig` containing a
- * `platformConfig` property.
- *
- * @param {Ext.Base} instance
- * @param {Object} instanceConfig The instance config parameter.
- * @return {Object} The new instance config object with platformConfig results applied.
- * @private
- * @since 5.1.0
- */
- resolvePlatformConfig: function(instance, instanceConfig) {
- var platformConfig = instanceConfig && instanceConfig.platformConfig,
- ret = instanceConfig,
- i, keys, n;
- if (platformConfig) {
- keys = Ext.getPlatformConfigKeys(platformConfig);
- n = keys.length;
- if (n) {
- ret = Ext.merge({}, ret);
- // this deep copies sub-objects
- for (i = 0 , n = keys.length; i < n; ++i) {
- this.merge(instance, ret, platformConfig[keys[i]]);
- }
- }
- }
- return ret;
- },
- transformSorter: function(a, b) {
- return a[1] - b[1];
- }
- };
- }());
- // prototype
- // closure on whole file
- // @tag class
- /**
- * @class Ext.Base
- *
- * The root of all classes created with {@link Ext#define}.
- *
- * Ext.Base is the building block of all Ext classes. All classes in Ext inherit from Ext.Base.
- * All prototype and static members of this class are inherited by all other classes.
- */
- Ext.Base = (function(flexSetter) {
- // @define Ext.Base
- // @require Ext.Util
- // @require Ext.Version
- // @require Ext.Configurator
- // @uses Ext.ClassManager
- // @uses Ext.mixin.Watchable
- /* eslint-disable indent */
- var noArgs = [],
- baseStaticMember,
- baseStaticMembers = [],
- makeDeprecatedMethod = function(oldName, newName, msg) {
- var message = '"' + oldName + '" is deprecated.';
- if (msg) {
- message += ' ' + msg;
- } else if (newName) {
- message += ' Please use "' + newName + '" instead.';
- }
- return function() {
- Ext.raise(message);
- };
- },
- addDeprecatedProperty = function(object, oldName, newName, message) {
- if (!message) {
- message = '"' + oldName + '" is deprecated.';
- }
- if (newName) {
- message += ' Please use "' + newName + '" instead.';
- }
- if (message) {
- Ext.Object.defineProperty(object, oldName, {
- get: function() {
- // eslint-disable-line getter-return
- Ext.raise(message);
- },
- set: function(value) {
- Ext.raise(message);
- },
- configurable: true
- });
- }
- },
- getOwnObject = function(proto, name) {
- if (!proto.hasOwnProperty(name)) {
- proto[name] = Ext.Object.chain(getOwnObject(proto.superclass, name));
- }
- return proto[name];
- },
- makeAliasFn = function(name) {
- return function() {
- return this[name].apply(this, arguments);
- };
- },
- Version = Ext.Version,
- leadingDigitRe = /^\d/,
- oneMember = {},
- aliasOneMember = {},
- Base = function() {},
- BasePrototype = Base.prototype,
- Reaper;
- Ext.Reaper = Reaper = {
- delay: 100,
- queue: [],
- timer: null,
- add: function(obj) {
- if (!Reaper.timer) {
- Reaper.timer = Ext.defer(Reaper.tick, Reaper.delay);
- }
- Reaper.queue.push(obj);
- },
- flush: function() {
- if (Reaper.timer) {
- Ext.undefer(Reaper.timer);
- Reaper.timer = null;
- }
- /* eslint-disable-next-line vars-on-top */
- var queue = Reaper.queue,
- n = queue.length,
- i, obj;
- Reaper.queue = [];
- for (i = 0; i < n; ++i) {
- obj = queue[i];
- if (obj && obj.$reap) {
- obj.$reap();
- }
- }
- },
- tick: function() {
- Reaper.timer = null;
- Reaper.flush();
- }
- };
- // These static properties will be copied to every newly created class with {@link Ext#define}
- Ext.apply(Base, {
- $className: 'Ext.Base',
- $isClass: true,
- /**
- * Create a new instance of this Class.
- *
- * Ext.define('My.cool.Class', {
- * ...
- * });
- *
- * My.cool.Class.create({
- * someConfig: true
- * });
- *
- * All parameters are passed to the constructor of the class.
- *
- * @return {Object} the created instance.
- * @static
- * @inheritable
- */
- create: function() {
- return Ext.create.apply(Ext, [
- this
- ].concat(Array.prototype.slice.call(arguments, 0)));
- },
- addConfigTransform: function(methodName, priority) {
- var transforms = getOwnObject(this.prototype, '$configTransforms');
- if (this.$configTransforms) {
- Ext.raise('Config transforms cannot be added after instances are created');
- }
- transforms[methodName] = priority;
- },
- /**
- * This method applies a versioned, deprecation declaration to this class. This
- * is typically called by the `deprecated` config.
- * @private
- */
- addDeprecations: function(deprecations) {
- var me = this,
- all = [],
- compatVersion = Ext.getCompatVersion(deprecations.name),
- configurator = me.getConfigurator(),
- displayName = (me.$className || '') + '#',
- deprecate, versionSpec, index, message, target, enabled, existing, fn, names, oldName, newName, member, statics, version;
- for (versionSpec in deprecations) {
- if (leadingDigitRe.test(versionSpec)) {
- version = new Ext.Version(versionSpec);
- version.deprecations = deprecations[versionSpec];
- all.push(version);
- }
- }
- all.sort(Version.compare);
- for (index = all.length; index--; ) {
- deprecate = (version = all[index]).deprecations;
- target = me.prototype;
- statics = deprecate.statics;
- // If user specifies, say 4.2 compatibility and we have a 5.0 deprecation
- // then that block needs to be "enabled" to "revert" to behaviors prior
- // to 5.0. By default, compatVersion === currentVersion, so there are no
- // enabled blocks. In dev mode we still want to visit all the blocks and
- // possibly add shims to detect use of deprecated methods, but in a build
- // (if the deprecated block remains somehow) we just break the loop.
- enabled = compatVersion && compatVersion.lt(version);
- if (!enabled) {}
- // eslint-disable-line no-empty, brace-style
- else if (!enabled) {
- // we won't get here in dev mode when !enabled
- break;
- }
- while (deprecate) {
- names = deprecate.methods;
- if (names) {
- for (oldName in names) {
- member = names[oldName];
- fn = null;
- if (!member) {
- /*
- * Something like:
- *
- * '5.1': {
- * methods: {
- * removedMethod: null
- * }
- * }
- *
- * Since there is no recovering the method, we always put
- * on a shim to catch abuse.
- */
- // The class should not already have a method by the oldName
- Ext.Assert.isNotDefinedProp(target, oldName);
- fn = makeDeprecatedMethod(displayName + oldName);
- } else if (Ext.isString(member)) {
- /*
- * Something like:
- *
- * '5.1': {
- * methods: {
- * oldName: 'newName'
- * }
- * }
- *
- * If this block is enabled, we just put an alias in place.
- * Otherwise we need to inject a
- */
- // The class should not already have a method by the oldName
- Ext.Assert.isNotDefinedProp(target, oldName);
- Ext.Assert.isDefinedProp(target, member);
- if (enabled) {
- // This call to the real method name must be late
- // bound if it is to pick up overrides and such.
- fn = makeAliasFn(member);
- } else {
- fn = makeDeprecatedMethod(displayName + oldName, member);
- }
- } else {
- /*
- * Something like:
- *
- * '5.1': {
- * methods: {
- * foo: function() { ... }
- * }
- * }
- *
- * Or this:
- *
- * '5.1': {
- * methods: {
- * foo: {
- * fn: function() { ... },
- * message: 'Please use "bar" instead.'
- * }
- * }
- * }
- *
- * Or just this:
- *
- * '5.1': {
- * methods: {
- * foo: {
- * message: 'Use something else instead.'
- * }
- * }
- * }
- *
- * If this block is enabled, and "foo" is an existing
- * method, than we apply the given method as an override.
- * If "foo" is not existing, we simply add the method.
- *
- * If the block is not enabled and there is no existing
- * method by that name, than we add a shim to prevent
- * abuse.
- */
- message = '';
- if (member.message || member.fn) {
- message = member.message;
- member = member.fn;
- }
- existing = target.hasOwnProperty(oldName) && target[oldName];
- if (enabled && member) {
- member.$owner = me;
- member.$name = oldName;
- member.name = displayName + oldName;
- if (existing) {
- member.$previous = existing;
- }
- fn = member;
- } else if (!existing) {
- fn = makeDeprecatedMethod(displayName + oldName, null, message);
- }
- }
- if (fn) {
- target[oldName] = fn;
- }
- }
- }
- // for oldName
- //-------------------------------------
- // Debug only
- names = deprecate.configs;
- if (names) {
- //
- // '6.0': {
- // configs: {
- // dead: null,
- //
- // renamed: 'newName',
- //
- // removed: {
- // message: 'This config was replaced by pixie dust'
- // }
- // }
- // }
- //
- configurator.addDeprecations(names);
- }
- names = deprecate.properties;
- if (names && !enabled) {
- // For properties about the only thing we can do is (on Good
- // Browsers), add warning shims for accessing them. So if the
- // block is enabled, we don't want those.
- for (oldName in names) {
- newName = names[oldName];
- if (Ext.isString(newName)) {
- addDeprecatedProperty(target, displayName + oldName, newName);
- } else if (newName && newName.message) {
- addDeprecatedProperty(target, displayName + oldName, null, newName.message);
- } else {
- addDeprecatedProperty(target, displayName + oldName);
- }
- }
- }
- //-------------------------------------
- // reset to handle statics and apply them to the class
- deprecate = statics;
- statics = null;
- target = me;
- }
- }
- },
- /**
- * @private
- * @static
- * @inheritable
- * @param parentClass
- */
- extend: function(parentClass) {
- var me = this,
- parentPrototype = parentClass.prototype,
- prototype, name, statics;
- prototype = me.prototype = Ext.Object.chain(parentPrototype);
- prototype.self = me;
- me.superclass = prototype.superclass = parentPrototype;
- if (!parentClass.$isClass) {
- for (name in BasePrototype) {
- if (name in prototype) {
- prototype[name] = BasePrototype[name];
- }
- }
- }
- // Statics inheritance
- statics = parentPrototype.$inheritableStatics;
- if (statics) {
- for (name in statics) {
- if (!me.hasOwnProperty(name)) {
- me[name] = parentClass[name];
- }
- }
- }
- if (parentClass.$onExtended) {
- me.$onExtended = parentClass.$onExtended.slice();
- }
- me.getConfigurator();
- },
- /**
- * @private
- * @static
- * @inheritable
- */
- $onExtended: [],
- /**
- * @private
- * @static
- * @inheritable
- */
- triggerExtended: function() {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(this, 'Ext.Base#triggerExtended', arguments);
- }
- /* eslint-disable-next-line vars-on-top */
- var callbacks = this.$onExtended,
- ln = callbacks.length,
- i, callback;
- if (ln > 0) {
- for (i = 0; i < ln; i++) {
- callback = callbacks[i];
- callback.fn.apply(callback.scope || this, arguments);
- }
- }
- },
- /**
- * @private
- * @static
- * @inheritable
- */
- onExtended: function(fn, scope) {
- this.$onExtended.push({
- fn: fn,
- scope: scope
- });
- return this;
- },
- /**
- * Add / override static properties of this class.
- *
- * Ext.define('My.cool.Class', {
- * ...
- * });
- *
- * My.cool.Class.addStatics({
- * someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
- * method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
- * method2: function() { ... } // My.cool.Class.method2 = function() { ... };
- * });
- *
- * @param {Object} members
- * @return {Ext.Base} this
- * @static
- * @inheritable
- */
- addStatics: function(members) {
- this.addMembers(members, true);
- return this;
- },
- /**
- * @private
- * @static
- * @inheritable
- * @param {Object} members
- */
- addInheritableStatics: function(members) {
- var me = this,
- proto = me.prototype,
- inheritableStatics = me.$inheritableStatics,
- name, member, current;
- if (!inheritableStatics) {
- inheritableStatics = Ext.apply({}, proto.$inheritableStatics);
- me.$inheritableStatics = proto.$inheritableStatics = inheritableStatics;
- }
- /* eslint-disable-next-line vars-on-top */
- var className = Ext.getClassName(me) + '.';
- for (name in members) {
- if (members.hasOwnProperty(name)) {
- member = members[name];
- current = me[name];
- if (typeof member === 'function') {
- member.name = className + name;
- }
- if (typeof current === 'function' && !current.$isClass && !current.$nullFn) {
- member.$previous = current;
- }
- me[name] = member;
- inheritableStatics[name] = true;
- }
- }
- return me;
- },
- /**
- * Add methods / properties to the prototype of this class.
- *
- * Ext.define('My.awesome.Cat', {
- * constructor: function() {
- * ...
- * }
- * });
- *
- * My.awesome.Cat.addMembers({
- * meow: function() {
- * alert('Meowww...');
- * }
- * });
- *
- * var kitty = new My.awesome.Cat();
- * kitty.meow();
- *
- * @param {Object} members The members to add to this class.
- * @param {Boolean} [isStatic=false] Pass `true` if the members are static.
- * @param {Boolean} [privacy=false] Pass `true` if the members are private. This
- * only has meaning in debug mode and only for methods.
- * @static
- * @inheritable
- */
- addMembers: function(members, isStatic, privacy) {
- var me = this,
- // this class
- cloneFunction = Ext.Function.clone,
- target = isStatic ? me : me.prototype,
- defaultConfig = !isStatic && target.defaultConfig,
- enumerables = Ext.enumerables,
- privates = members.privates,
- configs, i, ln, member, name, subPrivacy, privateStatics;
- /* eslint-disable-next-line vars-on-top, one-var */
- var displayName = (me.$className || '') + '#';
- if (privates) {
- // This won't run for normal class private members but will pick up all
- // others (statics, overrides, etc).
- delete members.privates;
- if (!isStatic) {
- privateStatics = privates.statics;
- delete privates.statics;
- }
- subPrivacy = privates.privacy || privacy || 'framework';
- me.addMembers(privates, isStatic, subPrivacy);
- if (privateStatics) {
- me.addMembers(privateStatics, true, subPrivacy);
- }
- }
- for (name in members) {
- if (members.hasOwnProperty(name)) {
- member = members[name];
- if (privacy === true) {
- privacy = 'framework';
- }
- if (member && member.$nullFn && privacy !== member.$privacy) {
- Ext.raise('Cannot use stock function for private method ' + (me.$className ? me.$className + '#' : '') + name);
- }
- if (typeof member === 'function' && !member.$isClass && !member.$nullFn) {
- if (member.$owner) {
- member = cloneFunction(member);
- }
- if (target.hasOwnProperty(name)) {
- member.$previous = target[name];
- }
- // This information is needed by callParent() and callSuper() as
- // well as statics() and even Ext.fly().
- member.$owner = me;
- member.$name = name;
- member.name = displayName + name;
- /* eslint-disable-next-line vars-on-top */
- var existing = target[name];
- if (privacy) {
- member.$privacy = privacy;
- // The general idea here is that an existing, non-private
- // method can be marked private. This is because the other
- // way is strictly forbidden (private method going public)
- // so if a method is in that gray area it can only be made
- // private in doc form which allows a derived class to make
- // it public.
- if (existing && existing.$privacy && existing.$privacy !== privacy) {
- Ext.privacyViolation(me, existing, member, isStatic);
- }
- } else if (existing && existing.$privacy) {
- Ext.privacyViolation(me, existing, member, isStatic);
- }
- }
- // The last part of the check here resolves a conflict if we have the same
- // property declared as both a config and a member on the class so that
- // the config wins.
- else if (defaultConfig && (name in defaultConfig) && !target.config.hasOwnProperty(name)) {
- // This is a config property so it must be added to the configs
- // collection not just smashed on the prototype...
- (configs || (configs = {}))[name] = member;
-
- continue;
- }
- target[name] = member;
- }
- }
- if (configs) {
- // Add any configs found in the normal members arena:
- me.addConfig(configs);
- }
- if (enumerables) {
- for (i = 0 , ln = enumerables.length; i < ln; ++i) {
- if (members.hasOwnProperty(name = enumerables[i])) {
- member = members[name];
- // The enumerables are all functions...
- if (member && !member.$nullFn) {
- if (member.$owner) {
- member = cloneFunction(member);
- }
- member.$owner = me;
- member.$name = name;
- member.name = displayName + name;
- if (target.hasOwnProperty(name)) {
- member.$previous = target[name];
- }
- }
- target[name] = member;
- }
- }
- }
- return this;
- },
- /**
- * @private
- * @static
- * @inheritable
- * @param name
- * @param member
- * @param privacy
- */
- addMember: function(name, member, privacy) {
- oneMember[name] = member;
- this.addMembers(oneMember, false, privacy);
- delete oneMember[name];
- return this;
- },
- hookMember: function(name, member) {
- var existing = this.prototype[name];
- return this.addMember(name, member, existing && existing.$privacy);
- },
- /**
- * Borrow another class' members to the prototype of this class.
- *
- * Ext.define('Bank', {
- * money: '$$$',
- * printMoney: function() {
- * alert('$$$$$$$');
- * }
- * });
- *
- * Ext.define('Thief', {
- * ...
- * });
- *
- * Thief.borrow(Bank, ['money', 'printMoney']);
- *
- * var steve = new Thief();
- *
- * alert(steve.money); // alerts '$$$'
- * steve.printMoney(); // alerts '$$$$$$$'
- *
- * @param {Ext.Base} fromClass The class to borrow members from
- * @param {Array/String} members The names of the members to borrow
- * @return {Ext.Base} this
- * @static
- * @inheritable
- * @private
- */
- borrow: function(fromClass, members) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments);
- }
- /* eslint-disable-next-line vars-on-top */
- var prototype = fromClass.prototype,
- membersObj = {},
- i, ln, name;
- members = Ext.Array.from(members);
- for (i = 0 , ln = members.length; i < ln; i++) {
- name = members[i];
- membersObj[name] = prototype[name];
- }
- return this.addMembers(membersObj);
- },
- /**
- * Override members of this class. Overridden methods can be invoked via
- * {@link Ext.Base#method!callParent}.
- *
- * Ext.define('My.Cat', {
- * constructor: function() {
- * alert("I'm a cat!");
- * }
- * });
- *
- * My.Cat.override({
- * constructor: function() {
- * alert("I'm going to be a cat!");
- *
- * this.callParent(arguments);
- *
- * alert("Meeeeoooowwww");
- * }
- * });
- *
- * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
- * // alerts "I'm a cat!"
- * // alerts "Meeeeoooowwww"
- *
- * Direct use of this method should be rare. Use {@link Ext#define Ext.define}
- * instead:
- *
- * Ext.define('My.CatOverride', {
- * override: 'My.Cat',
- * constructor: function() {
- * alert("I'm going to be a cat!");
- *
- * this.callParent(arguments);
- *
- * alert("Meeeeoooowwww");
- * }
- * });
- *
- * The above accomplishes the same result but can be managed by the {@link Ext.Loader}
- * which can properly order the override and its target class and the build process
- * can determine whether the override is needed based on the required state of the
- * target class (My.Cat).
- *
- * @param {Object} members The properties to add to this class. This should be
- * specified as an object literal containing one or more properties.
- * @return {Ext.Base} this class
- * @static
- * @inheritable
- */
- override: function(members) {
- var me = this,
- statics = members.statics,
- inheritableStatics = members.inheritableStatics,
- config = members.config,
- mixins = members.mixins,
- cachedConfig = members.cachedConfig;
- if (statics || inheritableStatics || config) {
- members = Ext.apply({}, members);
- }
- if (statics) {
- me.addMembers(statics, true);
- delete members.statics;
- }
- if (inheritableStatics) {
- me.addInheritableStatics(inheritableStatics);
- delete members.inheritableStatics;
- }
- if (members.platformConfig) {
- me.addPlatformConfig(members);
- }
- if (config) {
- me.addConfig(config);
- delete members.config;
- }
- if (cachedConfig) {
- me.addCachedConfig(cachedConfig);
- delete members.cachedConfig;
- }
- delete members.mixins;
- me.addMembers(members);
- if (mixins) {
- me.mixin(mixins);
- }
- return me;
- },
- addPlatformConfig: function(data) {
- var me = this,
- prototype = me.prototype,
- platformConfigs = data.platformConfig,
- added, classConfigs, configs, configurator, keys, name, value, i, ln;
- delete prototype.platformConfig;
- if (platformConfigs instanceof Array) {
- throw new Error('platformConfigs must be specified as an object.');
- }
- configurator = me.getConfigurator();
- classConfigs = configurator.configs;
- // Get the keys shortest to longest (ish).
- keys = Ext.getPlatformConfigKeys(platformConfigs);
- // To leverage the Configurator#add method, we want to generate potentially
- // two objects to pass in: "added" and "hoisted". For any properties in an
- // active platformConfig rule that set proper Configs in the base class, we
- // need to put them in "added". If instead of the proper Config coming from
- // a base class, it comes from this class's config block, we still need to
- // put that config in "added" but we also need move the class-level config
- // out of "config" and into "hoisted".
- //
- // This will ensure that the config defined at the class level is added to
- // the Configurator first.
- for (i = 0 , ln = keys.length; i < ln; ++i) {
- configs = platformConfigs[keys[i]];
- added = null;
- for (name in configs) {
- value = configs[name];
- // We have a few possibilities for each config name:
- if (name in classConfigs) {
- // It is a proper Config defined by a base class.
- (added || (added = {}))[name] = value;
- } else {
- // It is just a property to put on the prototype.
- prototype[name] = value;
- }
- }
- if (added) {
- configurator.add(added);
- }
- }
- },
- /**
- * @protected
- * @static
- * @inheritable
- */
- callParent: function(args) {
- var method;
- // This code is intentionally inlined for the least amount of debugger stepping
- return (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
- },
- /**
- * @protected
- * @static
- * @inheritable
- */
- callSuper: function(args) {
- var method;
- // This code is intentionally inlined for the least amount of debugger stepping
- return (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name]).apply(this, args || noArgs);
- },
- /**
- * Used internally by the mixins pre-processor
- * @private
- * @static
- * @inheritable
- */
- mixin: function(name, mixinClass) {
- var me = this,
- mixin, prototype, key, statics, i, ln, mixinName, mixinValue, mixins, mixinStatics, staticName;
- if (typeof name !== 'string') {
- mixins = name;
- if (mixins instanceof Array) {
- for (i = 0 , ln = mixins.length; i < ln; i++) {
- mixin = mixins[i];
- me.mixin(mixin.prototype.mixinId || mixin.$className, mixin);
- }
- } else {
- // Not a string or array - process the object form:
- // mixins: {
- // foo: ...
- // }
- for (mixinName in mixins) {
- me.mixin(mixinName, mixins[mixinName]);
- }
- }
- return;
- }
- mixin = mixinClass.prototype;
- prototype = me.prototype;
- if (mixin.onClassMixedIn) {
- mixin.onClassMixedIn.call(mixinClass, me);
- }
- if (!prototype.hasOwnProperty('mixins')) {
- if ('mixins' in prototype) {
- prototype.mixins = Ext.Object.chain(prototype.mixins);
- } else {
- prototype.mixins = {};
- }
- }
- for (key in mixin) {
- mixinValue = mixin[key];
- if (key === 'mixins') {
- // if 2 superclasses (e.g. a base class and a mixin) of this class both
- // have a mixin with the same id, the first one wins, that is to say,
- // the first mixin's methods to be applied to the prototype will not
- // be overwritten by the second one. Since this is the case we also
- // want to make sure we use the first mixin's prototype as the mixin
- // reference, hence the "applyIf" below. A real world example of this
- // is Ext.Widget which mixes in Ext.mixin.Observable. Ext.Widget can
- // be mixed into subclasses of Ext.Component, which mixes in
- // Ext.util.Observable. In this example, since the first "observable"
- // mixin's methods win, we also want its reference to be preserved.
- Ext.applyIf(prototype.mixins, mixinValue);
- }
- /* eslint-disable-next-line max-len */
- else if (!(key === 'mixinId' || key === 'config' || key === '$inheritableStatics') && (prototype[key] === undefined)) {
- prototype[key] = mixinValue;
- }
- }
- // Mixin statics inheritance
- statics = mixin.$inheritableStatics;
- if (statics) {
- mixinStatics = {};
- for (staticName in statics) {
- if (!me.hasOwnProperty(staticName)) {
- mixinStatics[staticName] = mixinClass[staticName];
- }
- }
- me.addInheritableStatics(mixinStatics);
- }
- if ('config' in mixin) {
- me.addConfig(mixin.config, mixinClass);
- }
- prototype.mixins[name] = mixin;
- if (mixin.afterClassMixedIn) {
- mixin.afterClassMixedIn.call(mixinClass, me);
- }
- return me;
- },
- /**
- * Adds new config properties to this class. This is called for classes when they
- * are declared, then for any mixins that class may define and finally for any
- * overrides defined that target the class.
- *
- * @param {Object} config
- * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
- * @private
- * @static
- * @inheritable
- */
- addConfig: function(config, mixinClass) {
- var cfg = this.$config || this.getConfigurator();
- cfg.add(config, mixinClass);
- },
- addCachedConfig: function(config, isMixin) {
- var cached = {},
- key;
- for (key in config) {
- cached[key] = {
- cached: true,
- $value: config[key]
- };
- }
- this.addConfig(cached, isMixin);
- },
- /**
- * Returns the `Ext.Configurator` for this class.
- *
- * @return {Ext.Configurator}
- * @private
- * @static
- * @inheritable
- */
- getConfigurator: function() {
- // the Ext.Configurator ctor will set $config so micro-opt out fn call:
- return this.$config || new Ext.Configurator(this);
- },
- /**
- * Get the current class' name in string format.
- *
- * Ext.define('My.cool.Class', {
- * constructor: function() {
- * alert(this.self.getName()); // alerts 'My.cool.Class'
- * }
- * });
- *
- * My.cool.Class.getName(); // 'My.cool.Class'
- *
- * @return {String} className
- * @static
- * @inheritable
- */
- getName: function() {
- return Ext.getClassName(this);
- },
- /**
- * Create aliases for existing prototype methods. Example:
- *
- * Ext.define('My.cool.Class', {
- * method1: function() { ... },
- * method2: function() { ... }
- * });
- *
- * var test = new My.cool.Class();
- *
- * My.cool.Class.createAlias({
- * method3: 'method1',
- * method4: 'method2'
- * });
- *
- * test.method3(); // test.method1()
- *
- * My.cool.Class.createAlias('method5', 'method3');
- *
- * test.method5(); // test.method3() -> test.method1()
- *
- * @param {String/Object} alias The new method name, or an object to set multiple aliases.
- * See {@link Ext.Function#flexSetter flexSetter}
- * @param {String/Object} origin The original method name
- * @static
- * @inheritable
- * @method
- */
- createAlias: flexSetter(function(alias, origin) {
- aliasOneMember[alias] = function() {
- return this[origin].apply(this, arguments);
- };
- this.override(aliasOneMember);
- delete aliasOneMember[alias];
- })
- });
- // Capture the set of static members on Ext.Base that we want to copy to all
- // derived classes. This array is used by Ext.Class as well as the optimizer.
- for (baseStaticMember in Base) {
- if (Base.hasOwnProperty(baseStaticMember)) {
- baseStaticMembers.push(baseStaticMember);
- }
- }
- Base.$staticMembers = baseStaticMembers;
- Base.getConfigurator();
- // lazily create now so as not capture in $staticMembers
- Base.addMembers({
- /** @private */
- $className: 'Ext.Base',
- /**
- * @property {Object/Array} $configTransforms
- * A prototype-chained object storing transform method names and priorities stored
- * on the class prototype. On first instantiation, this object is converted into
- * an array that is sorted by priority and stored on the constructor.
- * @private
- */
- $configTransforms: {},
- /**
- * @property {Boolean} isInstance
- * This value is `true` and is used to identify plain objects from instances of
- * a defined class.
- * @protected
- * @readonly
- */
- isInstance: true,
- /**
- * @property {Boolean} $configPrefixed
- * The value `true` causes `config` values to be stored on instances using a
- * property name prefixed with an underscore ("_") character. A value of `false`
- * stores `config` values as properties using their exact name (no prefix).
- * @private
- * @since 5.0.0
- */
- $configPrefixed: true,
- /**
- * @property {Boolean} $configStrict
- * The value `true` instructs the `initConfig` method to only honor values for
- * properties declared in the `config` block of a class. When `false`, properties
- * that are not declared in a `config` block will be placed on the instance.
- * @private
- * @since 5.0.0
- */
- $configStrict: true,
- /**
- * @property {Boolean} isConfiguring
- * This property is set to `true` during the call to `initConfig`.
- * @protected
- * @readonly
- * @since 5.0.0
- */
- isConfiguring: false,
- /**
- * @property {Boolean} isFirstInstance
- * This property is set to `true` if this instance is the first of its class.
- * @protected
- * @readonly
- * @since 5.0.0
- */
- isFirstInstance: false,
- /**
- * @property {Boolean} destroyed
- * This property is set to `true` after the `destroy` method is called.
- */
- destroyed: false,
- /**
- * @property {Boolean/"async"} [clearPropertiesOnDestroy=true]
- * Setting this property to `false` will prevent nulling object references
- * on a Class instance after destruction. Setting this to `"async"` will delay
- * the clearing for approx 50ms.
- * @protected
- * @since 6.2.0
- */
- clearPropertiesOnDestroy: true,
- /**
- * @property {Boolean} [clearPrototypeOnDestroy=false]
- * Setting this property to `true` will result in setting the object's
- * prototype to `null` after the destruction sequence is fully completed.
- * After that, most attempts at calling methods on the object instance
- * will result in "method not defined" exception. This can be very helpful
- * with tracking down otherwise hard to find bugs like runaway Ajax requests,
- * timed functions not cleared on destruction, etc.
- *
- * Note that this option can only work in browsers that support `Object.setPrototypeOf`
- * method, and is only available in debugging mode.
- * @private
- * @since 6.2.0
- */
- clearPrototypeOnDestroy: false,
- /**
- * Get the reference to the class from which this object was instantiated. Note that unlike
- * {@link Ext.Base#self}, `this.statics()` is scope-independent and it always returns
- * the class from which it was called, regardless of what `this` points to during run-time
- *
- * Ext.define('My.Cat', {
- * statics: {
- * totalCreated: 0,
- * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
- * },
- *
- * constructor: function() {
- * var statics = this.statics();
- *
- * // always equals to 'Cat' no matter what 'this' refers to
- * // equivalent to: My.Cat.speciesName
- * alert(statics.speciesName);
- *
- *
- * alert(this.self.speciesName); // dependent on 'this'
- *
- * statics.totalCreated++;
- * },
- *
- * clone: function() {
- * var cloned = new this.self(); // dependent on 'this'
- *
- * // equivalent to: My.Cat.speciesName
- * cloned.groupName = this.statics().speciesName;
- *
- * return cloned;
- * }
- * });
- *
- *
- * Ext.define('My.SnowLeopard', {
- * extend: 'My.Cat',
- *
- * statics: {
- * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
- * },
- *
- * constructor: function() {
- * this.callParent();
- * }
- * });
- *
- * var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'
- *
- * var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
- *
- * var clone = snowLeopard.clone();
- * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
- * alert(clone.groupName); // alerts 'Cat'
- *
- * alert(My.Cat.totalCreated); // alerts 3
- *
- * @protected
- * @return {Ext.Class}
- */
- statics: function() {
- var method = this.statics.caller,
- self = this.self;
- if (!method) {
- return self;
- }
- return method.$owner;
- },
- /**
- * Call the "parent" method of the current method. That is the method previously
- * overridden by derivation or by an override (see {@link Ext#define}).
- *
- * Ext.define('My.Base', {
- * constructor: function(x) {
- * this.x = x;
- * },
- *
- * statics: {
- * method: function(x) {
- * return x;
- * }
- * }
- * });
- *
- * Ext.define('My.Derived', {
- * extend: 'My.Base',
- *
- * constructor: function() {
- * this.callParent([21]);
- * }
- * });
- *
- * var obj = new My.Derived();
- *
- * alert(obj.x); // alerts 21
- *
- * This can be used with an override as follows:
- *
- * Ext.define('My.DerivedOverride', {
- * override: 'My.Derived',
- *
- * constructor: function(x) {
- * this.callParent([x*2]); // calls original My.Derived constructor
- * }
- * });
- *
- * var obj = new My.Derived();
- *
- * alert(obj.x); // now alerts 42
- *
- * This also works with static and private methods.
- *
- * Ext.define('My.Derived2', {
- * extend: 'My.Base',
- *
- * // privates: {
- * statics: {
- * method: function(x) {
- * return this.callParent([x*2]); // calls My.Base.method
- * }
- * }
- * });
- *
- * alert(My.Base.method(10)); // alerts 10
- * alert(My.Derived2.method(10)); // alerts 20
- *
- * Lastly, it also works with overridden static methods.
- *
- * Ext.define('My.Derived2Override', {
- * override: 'My.Derived2',
- *
- * // privates: {
- * statics: {
- * method: function(x) {
- * return this.callParent([x*2]); // calls My.Derived2.method
- * }
- * }
- * });
- *
- * alert(My.Derived2.method(10); // now alerts 40
- *
- * To override a method and replace it and also call the superclass method, use
- * {@link #method-callSuper}. This is often done to patch a method to fix a bug.
- *
- * @protected
- * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
- * from the current method, for example: `this.callParent(arguments)`
- * @return {Object} Returns the result of calling the parent method
- */
- callParent: function(args) {
- // NOTE: this code is deliberately as few expressions (and no function calls)
- // as possible so that a debugger can skip over this noise with the minimum number
- // of steps. Basically, just hit Step Into until you are where you really wanted
- // to be.
- var method,
- superMethod = (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]));
- if (!superMethod) {
- method = this.callParent.caller;
- /* eslint-disable-next-line vars-on-top */
- var parentClass, methodName;
- if (!method.$owner) {
- if (!method.caller) {
- throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
- }
- method = method.caller;
- }
- parentClass = method.$owner.superclass;
- methodName = method.$name;
- if (!(methodName in parentClass)) {
- throw new Error("this.callParent() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
- }
- }
- return superMethod.apply(this, args || noArgs);
- },
- /**
- * This method is used by an **override** to call the superclass method but
- * bypass any overridden method. This is often done to "patch" a method that
- * contains a bug but for whatever reason cannot be fixed directly.
- *
- * Consider:
- *
- * Ext.define('Ext.some.Class', {
- * method: function() {
- * console.log('Good');
- * }
- * });
- *
- * Ext.define('Ext.some.DerivedClass', {
- * extend: 'Ext.some.Class',
- *
- * method: function() {
- * console.log('Bad');
- *
- * // ... logic but with a bug ...
- *
- * this.callParent();
- * }
- * });
- *
- * To patch the bug in `Ext.some.DerivedClass.method`, the typical solution is to create an
- * override:
- *
- * Ext.define('App.patches.DerivedClass', {
- * override: 'Ext.some.DerivedClass',
- *
- * method: function() {
- * console.log('Fixed');
- *
- * // ... logic but with bug fixed ...
- *
- * this.callSuper();
- * }
- * });
- *
- * The patch method cannot use {@link #method-callParent} to call the superclass
- * `method` since that would call the overridden method containing the bug. In
- * other words, the above patch would only produce "Fixed" then "Good" in the
- * console log, whereas, using `callParent` would produce "Fixed" then "Bad"
- * then "Good".
- *
- * @protected
- * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
- * from the current method, for example: `this.callSuper(arguments)`
- * @return {Object} Returns the result of calling the superclass method
- */
- callSuper: function(args) {
- // NOTE: this code is deliberately as few expressions (and no function calls)
- // as possible so that a debugger can skip over this noise with the minimum number
- // of steps. Basically, just hit Step Into until you are where you really wanted
- // to be.
- var method,
- superMethod = (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]);
- if (!superMethod) {
- method = this.callSuper.caller;
- /* eslint-disable-next-line vars-on-top */
- var parentClass, methodName;
- if (!method.$owner) {
- if (!method.caller) {
- throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
- }
- method = method.caller;
- }
- parentClass = method.$owner.superclass;
- methodName = method.$name;
- if (!(methodName in parentClass)) {
- throw new Error("this.callSuper() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
- }
- }
- return superMethod.apply(this, args || noArgs);
- },
- /**
- * @property {Ext.Class} self
- *
- * Get the reference to the current class from which this object was instantiated. Unlike
- * {@link Ext.Base#statics}, `this.self` is scope-dependent and it's meant to be used
- * for dynamic inheritance. See {@link Ext.Base#statics} for a detailed comparison
- *
- * Ext.define('My.Cat', {
- * statics: {
- * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
- * },
- *
- * constructor: function() {
- * alert(this.self.speciesName); // dependent on 'this'
- * },
- *
- * clone: function() {
- * return new this.self();
- * }
- * });
- *
- *
- * Ext.define('My.SnowLeopard', {
- * extend: 'My.Cat',
- * statics: {
- * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
- * }
- * });
- *
- * var cat = new My.Cat(); // alerts 'Cat'
- * var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'
- *
- * var clone = snowLeopard.clone();
- * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
- *
- * @protected
- */
- self: Base,
- // Default constructor, simply returns `this`
- constructor: function() {
- return this;
- },
- /**
- * Initialize configuration for this class. a typical example:
- *
- * Ext.define('My.awesome.Class', {
- * // The default config
- * config: {
- * name: 'Awesome',
- * isAwesome: true
- * },
- *
- * constructor: function(config) {
- * this.initConfig(config);
- * }
- * });
- *
- * var awesome = new My.awesome.Class({
- * name: 'Super Awesome'
- * });
- *
- * alert(awesome.getName()); // 'Super Awesome'
- *
- * @protected
- * @param {Object} instanceConfig
- * @return {Ext.Base} this
- * @chainable
- */
- initConfig: function(instanceConfig) {
- var me = this,
- cfg = me.self.getConfigurator();
- me.initConfig = Ext.emptyFn;
- // ignore subsequent calls to initConfig
- me.initialConfig = instanceConfig || {};
- cfg.configure(me, instanceConfig);
- return me;
- },
- beforeInitConfig: Ext.emptyFn,
- /**
- * Returns a specified config property value. If the name parameter is not passed,
- * all current configuration options will be returned as key value pairs.
- * @param {String} [name] The name of the config property to get.
- * @param {Boolean} [peek=false] `true` to peek at the raw value without calling the getter.
- * @param {Boolean} [ifInitialized=false] `true` to only return the initialized property
- * value, not the raw config value, and *not* to trigger initialization. Returns
- * `undefined` if the property has not yet been initialized.
- * @return {Object} The config property value.
- */
- getConfig: function(name, peek, ifInitialized) {
- var me = this,
- ret, cfg, propName;
- if (name) {
- cfg = me.self.$config.configs[name];
- if (cfg) {
- propName = me.$configPrefixed ? cfg.names.internal : name;
- // They only want the fully initialized value, not the initial config,
- // but only if it's already present on this instance.
- // They don't want to trigger the initGetter.
- // This form is used by Bindable#updatePublishes to initially publish
- // the properties it's being asked make publishable.
- if (ifInitialized) {
- ret = me.hasOwnProperty(propName) ? me[propName] : null;
- } else if (peek) {
- // Attempt to return the instantiated property on this instance first.
- // Only return the config object if it has not yet been pulled through
- // the applier into the instance.
- ret = me.hasOwnProperty(propName) ? me[propName] : me.config[name];
- } else {
- ret = me[cfg.names.get]();
- }
- } else {
- ret = me[name];
- }
- } else {
- ret = me.getCurrentConfig();
- }
- return ret;
- },
- /**
- * Destroys member properties by name.
- *
- * If a property name is the name of a *config*, the getter is *not* invoked, so
- * if the config has not been initialized, nothing will be done.
- *
- * The property will be destroyed, and the corrected name (if the property is a *config*
- * and config names are prefixed) will set to `null` in this object's dictionary.
- *
- * @param {String...} args One or more names of the properties to destroy and remove from
- * the object.
- */
- destroyMembers: function() {
- var me = this,
- configs = me.self.$config.configs,
- len = arguments.length,
- cfg, name, value, i;
- for (i = 0; i < len; i++) {
- name = arguments[i];
- cfg = configs[name];
- name = cfg && me.$configPrefixed ? cfg.names.internal : name;
- value = me.hasOwnProperty(name) && me[name];
- if (value) {
- Ext.destroy(value);
- me[name] = null;
- }
- }
- },
- freezeConfig: function(name) {
- var me = this,
- config = Ext.Config.get(name),
- names = config.names,
- value = me[names.get]();
- me[names.set] = function(v) {
- if (v !== value) {
- Ext.raise('Cannot change frozen config "' + name + '"');
- }
- return me;
- };
- if (!Ext.isIE8) {
- Object.defineProperty(me, me.$configPrefixed ? names.internal : name, {
- get: function() {
- return value;
- },
- set: function(v) {
- if (v !== value) {
- Ext.raise('Cannot change frozen config "' + name + '"');
- }
- }
- });
- }
- },
- /**
- * Sets a single/multiple configuration options.
- * @param {String/Object} name The name of the property to set, or a set of key value
- * pairs to set.
- * @param {Object} [value] The value to set for the name parameter.
- * @param {Object} [options] (private)
- * @return {Ext.Base} this
- */
- setConfig: function(name, value, options) {
- // options can have the following properties:
- // - defaults `true` to only set the config(s) that have not been already set on
- // this instance.
- // - strict `false` to apply properties to the instance that are not configs,
- // and do not have setters.
- var me = this,
- configurator, config, prop;
- if (name) {
- configurator = me.self.getConfigurator();
- if (typeof name === 'string') {
- config = configurator.configs[name];
- if (!config) {
- if (me.$configStrict) {
- prop = me.self.prototype[name];
- if ((typeof prop === 'function') && !prop.$nullFn) {
- Ext.Error.raise("Cannot override method " + name + " on " + me.$className + " instance.");
- return me;
- } else {
- if (name !== 'type') {
- Ext.log.warn('No such config "' + name + '" for class ' + me.$className);
- }
- }
- }
- config = Ext.Config.map[name] || Ext.Config.get(name);
- }
- if (me[config.names.set]) {
- me[config.names.set](value);
- } else {
- // apply non-config props directly to the instance
- me[name] = value;
- }
- } else {
- // This should not have "options ||" except that it shipped in that
- // broken state, so we use it if present for compat.
- configurator.reconfigure(me, name, options || value);
- }
- }
- return me;
- },
- getConfigWatcher: function() {
- return this.$configWatch || (this.$configWatch = new Ext.mixin.Watchable());
- },
- /**
- * Watches config properties.
- *
- * instance.watchConfig({
- * title: 'onTitleChange',
- * scope: me
- * });
- *
- * @private
- * @since 6.7.0
- */
- watchConfig: function(name, fn, scope) {
- var watcher = this.getConfigWatcher();
- return watcher.on.apply(watcher, arguments);
- },
- $configWatch: null,
- /**
- * @private
- */
- getCurrentConfig: function() {
- var cfg = this.self.getConfigurator();
- return cfg.getCurrentConfig(this);
- },
- /**
- * @param {String} name
- * @private
- */
- hasConfig: function(name) {
- return name in this.defaultConfig;
- },
- /**
- * Returns the initial configuration passed to the constructor when
- * instantiating this class.
- *
- * Given this example Ext.button.Button definition and instance:
- *
- * Ext.define('MyApp.view.Button', {
- * extend: 'Ext.button.Button',
- * xtype: 'mybutton',
- *
- * scale: 'large',
- * enableToggle: true
- * });
- *
- * var btn = Ext.create({
- * xtype: 'mybutton',
- * renderTo: Ext.getBody(),
- * text: 'Test Button'
- * });
- *
- * Calling `btn.getInitialConfig()` would return an object including the config
- * options passed to the `create` method:
- *
- * xtype: 'mybutton',
- * renderTo: // The document body itself
- * text: 'Test Button'
- *
- * Calling `btn.getInitialConfig('text')`returns **'Test Button'**.
- *
- * @param {String} [name] Name of the config option to return.
- * @return {Object/Mixed} The full config object or a single config value
- * when `name` parameter specified.
- */
- getInitialConfig: function(name) {
- var config = this.config;
- if (!name) {
- return config;
- }
- return config[name];
- },
- $links: null,
- /**
- * Adds a "destroyable" object to an internal list of objects that will be destroyed
- * when this instance is destroyed (via `{@link #method!destroy}`).
- * @param {String} name
- * @param {Object} value
- * @return {Object} The `value` passed.
- * @private
- */
- link: function(name, value) {
- var me = this,
- links = me.$links || (me.$links = {});
- links[name] = true;
- me[name] = value;
- return value;
- },
- /**
- * Destroys a given set of `{@link #link linked}` objects. This is only needed if
- * the linked object is being destroyed before this instance.
- * @param {String[]} names The names of the linked objects to destroy.
- * @return {Ext.Base} this
- * @private
- */
- unlink: function(names) {
- var me = this,
- i, ln, link, value;
- if (!Ext.isArray(names)) {
- Ext.raise('Invalid argument - expected array of strings');
- }
- for (i = 0 , ln = names.length; i < ln; i++) {
- link = names[i];
- value = me[link];
- if (value) {
- if (value.isInstance && !value.destroyed) {
- value.destroy();
- } else if (value.parentNode && 'nodeType' in value) {
- value.parentNode.removeChild(value);
- }
- }
- me[link] = null;
- }
- return me;
- },
- $reap: function() {
- var me = this,
- keepers = me.$noClearOnDestroy,
- props, prop, val, t, i, len;
- // This only returns own keys which is *much* faster than iterating
- // over the whole prototype chain and calling hasOwnProperty()
- props = Ext.Object.getKeys(me);
- for (i = 0 , len = props.length; i < len; i++) {
- prop = props[i];
- val = me[prop];
- // typeof null === 'object' :(
- if (val && !(keepers && keepers[prop])) {
- t = typeof val;
- // Object may retain references to other objects. Functions can do too
- // if they are closures, and most of the *own* function properties
- // are closures indeed. We skip Ext.emptyFn and the like though,
- // they're mostly harmless.
- if (t === 'object' || (t === 'function' && !val.$noClearOnDestroy)) {
- me[prop] = null;
- }
- }
- }
- me.$nulled = true;
- // We also want to make sure no methods are called on the destroyed object,
- // because that may lead to accessing nulled properties and resulting exceptions.
- if (Object.setPrototypeOf) {
- if (me.clearPrototypeOnDestroy && !me.$vetoClearingPrototypeOnDestroy) {
- props = me.$preservePrototypeProperties;
- if (props) {
- for (i = 0 , len = props.length; i < len; i++) {
- prop = props[i];
- if (!me.hasOwnProperty(prop)) {
- /* eslint-disable-next-line no-self-assign */
- me[prop] = me[prop];
- }
- }
- }
- Object.setPrototypeOf(me, null);
- }
- }
- },
- /**
- * This method is called to cleanup an object and its resources. After calling
- * this method, the object should not be used any further in any way, including
- * access to its methods and properties.
- *
- * To prevent potential memory leaks, all object references will be nulled
- * at the end of destruction sequence, unless {@link #clearPropertiesOnDestroy}
- * is set to `false`.
- */
- destroy: function() {
- var me = this,
- links = me.$links,
- clearPropertiesOnDestroy = me.clearPropertiesOnDestroy;
- if (links) {
- me.$links = null;
- me.unlink(Ext.Object.getKeys(links));
- }
- me.destroy = Ext.emptyFn;
- // isDestroyed added for compat reasons
- me.isDestroyed = me.destroyed = true;
- // By this time the destruction is complete. Now we can make sure
- // no objects are retained by the husk of this ex-Instance.
- if (clearPropertiesOnDestroy === true) {
- // Observable mixin will call destroyObservable that will reap the properties.
- if (!me.isObservable) {
- me.$reap();
- }
- } else if (clearPropertiesOnDestroy) {
- if (clearPropertiesOnDestroy !== 'async') {
- Ext.raise('Invalid value for clearPropertiesOnDestroy');
- }
- Reaper.add(me);
- }
- }
- });
- /**
- * @method callOverridden
- * Call the original method that was previously overridden with {@link Ext.Base#override}
- *
- * Ext.define('My.Cat', {
- * constructor: function() {
- * alert("I'm a cat!");
- * }
- * });
- *
- * My.Cat.override({
- * constructor: function() {
- * alert("I'm going to be a cat!");
- *
- * this.callOverridden();
- *
- * alert("Meeeeoooowwww");
- * }
- * });
- *
- * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
- * // alerts "I'm a cat!"
- * // alerts "Meeeeoooowwww"
- *
- * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
- * from the current method, for example: `this.callOverridden(arguments)`
- * @return {Object} Returns the result of calling the overridden method
- * @deprecated 4.1.0 Use {@link #method-callParent} instead.
- * @protected
- */
- BasePrototype.callOverridden = BasePrototype.callParent;
- Ext.privacyViolation = function(cls, existing, member, isStatic) {
- var name = member.$name,
- conflictCls = existing.$owner && existing.$owner.$className,
- s = isStatic ? 'static ' : '',
- msg = member.$privacy ? 'Private ' + s + member.$privacy + ' method "' + name + '"' : 'Public ' + s + 'method "' + name + '"';
- if (cls.$className) {
- msg = cls.$className + ': ' + msg;
- }
- if (!existing.$privacy) {
- msg += conflictCls ? ' hides public method inherited from ' + conflictCls : ' hides inherited public method.';
- } else {
- msg += conflictCls ? ' conflicts with private ' + existing.$privacy + ' method declared by ' + conflictCls : ' conflicts with inherited private ' + existing.$privacy + ' method.';
- }
- /* eslint-disable-next-line vars-on-top */
- var compat = Ext.getCompatVersion(),
- ver = Ext.getVersion();
- // When compatibility is enabled, log problems instead of throwing errors.
- if (ver && compat && compat.lt(ver)) {
- Ext.log.error(msg);
- } else {
- Ext.raise(msg);
- }
- };
- Ext.Reaper.tick.$skipTimerCheck = true;
- return Base;
- }(Ext.Function.flexSetter));
- /**
- * This class manages a double-linked list. It provides an absolutely minimal container
- * interface.
- *
- * @class Ext.util.LRU
- * @private
- * @since 6.5.0
- */
- /* eslint-disable indent */
- (function(LRU, prototype) {
- // @define Ext.util.LRU
- // NOTE: We have to implement this class old-school because it is used by the
- // platformConfig class processor (so Ext.define is not yet ready for action).
- (Ext.util || (Ext.util = {})).LRU = LRU = function(config) {
- var me = this,
- head;
- if (config) {
- Ext.apply(me, config);
- }
- // Give all entries the same object shape.
- me.head = head = {
- id: (me.seed = 0),
- key: null,
- value: null
- };
- /**
- * @property {Object} map
- * The items in the list indexed by their `key`.
- * @readonly
- */
- me.map = {};
- head.next = head.prev = head;
- };
- LRU.prototype = prototype = {
- /**
- * @property {Number} count
- * The number of items in this list.
- * @readonly
- */
- count: 0,
- /**
- * Adds an item to the list with the specified `key`. Items are added at the
- * front (MRU) of the list.
- * @param {String} key
- * @param {Object} value
- */
- add: function(key, value) {
- var me = this,
- map = me.map,
- entry = map[key];
- if (entry) {
- me.unlink(entry);
- --me.count;
- }
- map[key] = entry = {
- id: ++me.seed,
- key: key,
- value: value
- };
- me.link(entry);
- ++me.count;
- return entry;
- },
- /**
- * Removes all items from this list optionally calling a function for each
- * remove item.
- * @param {Function} [fn] A function to call for each removed item.
- * @param {Object} fn.key The key of the removed item.
- * @param {Object} fn.value The removed item.
- * @param {Object} [scope] The `this` pointer for `fn`.
- */
- clear: function(fn, scope) {
- var me = this,
- head = me.head,
- entry = head.next;
- head.next = head.prev = head;
- me.count = 0;
- if (fn && !fn.$nullFn) {
- for (; entry !== head; entry = entry.next) {
- fn.call(scope || me, entry.key, entry.value);
- }
- }
- },
- /**
- * Calls the given function `fn` for each item in the list. The items will be
- * passed to `fn` from most-to-least recently added or touched.
- * @param {Function} fn The function to call for each cache item.
- * @param {String} fn.key The key for the item.
- * @param {Object} fn.value The item.
- * @param {Object} [scope] The `this` pointer to use for `fn`.
- */
- each: function(fn, scope) {
- var head, ent;
- scope = scope || this;
- for (head = this.head , ent = head.next; ent !== head; ent = ent.next) {
- if (fn.call(scope, ent.key, ent.value)) {
- break;
- }
- }
- },
- /**
- * Removes the item at the end (LRU) of the list. Optionally the item can be passed
- * to a callback function. If the list is empty, no callback is made and this
- * method will return `undefined`.
- * @param {Function} fn The function to call for the removed item.
- * @param {Object} fn.key The key of the removed item.
- * @param {Object} fn.value The removed item.
- * @param {Object} [scope] The `this` pointer to use for `fn`.
- * @return {Object} The removed item.
- */
- prune: function(fn, scope) {
- var me = this,
- entry = me.head.prev,
- ret;
- if (me.count) {
- ret = entry.value;
- me.unlink(entry);
- --me.count;
- if (fn) {
- fn.call(scope || me, entry.key, ret);
- }
- }
- return ret;
- },
- /**
- * Removes an item from the list given its key.
- * @param {String} key The key of the item to remove.
- * @return {Object} The removed item or `undefined` if the key was not found.
- */
- remove: function(key) {
- var me = this,
- map = me.map,
- entry = map[key],
- value;
- if (entry) {
- me.unlink(entry);
- value = entry.value;
- delete map[key];
- --me.count;
- }
- return value;
- },
- /**
- * Moves the item with the given key to the front (MRU) of the list.
- * @param {String} key The key of the item to move to the front.
- */
- touch: function(key) {
- var me = this,
- head = me.head,
- entry = me.map[key];
- if (entry && entry.prev !== head) {
- // The entry is not at the front, so remove it and insert it at the front
- // (to make it the MRU - Most Recently Used).
- me.unlink(entry);
- me.link(entry);
- }
- },
- /**
- * Reduces the length of the list to be no more than the specified `size`, removing
- * items from the end of the list as necessary. Optionally each removed item can
- * be passed to a callback `fn`.
- * @param {Number} size The number of items in the list
- * @param {Function} [fn] A function to call for each removed item.
- * @param {Object} fn.key The key of the removed item.
- * @param {Object} fn.value The removed item.
- * @param {Object} [scope] The `this` pointer for `fn`.
- */
- trim: function(size, fn, scope) {
- while (this.count > size) {
- this.prune(fn, scope);
- }
- },
- //-------------------------------------------------------------------------
- // Internals
- /**
- * Inserts the given entry at the front (MRU) end of the entry list.
- * @param {Object} entry The cache item entry.
- * @private
- */
- link: function(entry) {
- var head = this.head,
- first = head.next;
- entry.next = first;
- entry.prev = head;
- head.next = entry;
- first.prev = entry;
- },
- /**
- * Removes the given entry from the entry list.
- * @param {Object} entry The cache item entry.
- * @private
- */
- unlink: function(entry) {
- var next = entry.next,
- prev = entry.prev;
- prev.next = next;
- next.prev = prev;
- }
- };
- prototype.destroy = function() {
- this.clear.apply(this, arguments);
- };
- }());
- /**
- * This class is used to manage simple, LRU caches. It provides an absolutely minimal
- * container interface. It is created like this:
- *
- * this.itemCache = new Ext.util.Cache({
- * miss: function (key) {
- * return new CacheItem(key);
- * }
- * });
- *
- * The `{@link #miss}` abstract method must be implemented by either a derived class or
- * at the instance level as shown above.
- *
- * Once the cache exists and it can handle cache misses, the cache is used like so:
- *
- * var item = this.itemCache.get(key);
- *
- * The `key` is some value that uniquely identifies the cached item.
- *
- * In some cases, creating the cache item may require more than just the lookup key. In
- * that case, any extra arguments passed to `get` will be passed to `miss`.
- *
- * this.otherCache = new Ext.util.Cache({
- * miss: function (key, extra) {
- * return new CacheItem(key, extra);
- * }
- * });
- *
- * var item = this.otherCache.get(key, extra);
- *
- * To process items as they are removed, you can provide an `{@link #evict}` method. The
- * stock method is `Ext.emptyFn` and so does nothing.
- *
- * For example:
- *
- * this.itemCache = new Ext.util.Cache({
- * miss: function (key) {
- * return new CacheItem(key);
- * },
- *
- * evict: function (key, cacheItem) {
- * cacheItem.destroy();
- * }
- * });
- *
- * @class Ext.util.Cache
- * @private
- * @since 5.1.0
- */
- /* eslint-disable indent */
- (function(LRU, fn, Cache) {
- // @require Ext.util.LRU
- // @define Ext.util.Cache
- // NOTE: We have to implement this class old-school because it is used by the
- // platformConfig class processor (so Ext.define is not yet ready for action).
- Ext.util.Cache = Cache = function(config) {
- LRU.call(this, config);
- };
- fn.prototype = LRU.prototype;
- Cache.prototype = Ext.apply(new fn(), {
- /**
- * @cfg {Number} maxSize The maximum size the cache is allowed to grow to before
- * further additions cause removal of the least recently used entry.
- */
- maxSize: 100,
- /**
- * This method is called by `{@link #get}` when the key is not found in the cache.
- * The implementation of this method should create the (expensive) value and return
- * it. Whatever arguments were passed to `{@link #get}` will be passed on to this
- * method.
- *
- * @param {String} key The cache lookup key for the item.
- * @param {Object...} args Any other arguments originally passed to `{@link #get}`.
- * @method miss
- * @abstract
- * @protected
- */
- /**
- * Removes all items from this cache.
- */
- clear: function() {
- LRU.prototype.clear.call(this, this.evict);
- },
- /**
- * Finds an item in this cache and returns its value. If the item is present, it is
- * shuffled into the MRU (most-recently-used) position as necessary. If the item is
- * missing, the `{@link #miss}` method is called to create the item.
- *
- * @param {String} key The cache key of the item.
- * @param {Object...} args Arguments for the `miss` method should it be needed.
- * @return {Object} The cached object.
- */
- get: function(key) {
- var me = this,
- entry = me.map[key],
- value;
- if (entry) {
- value = entry.value;
- me.touch(key);
- } else {
- value = me.miss.apply(me, arguments);
- me.add(key, value);
- me.trim(me.maxSize, me.evict);
- }
- return value;
- },
- //-------------------------------------------------------------------------
- // Internals
- /**
- * This method is called internally from `{@link #get}` when the cache is full and
- * the least-recently-used (LRU) item has been removed.
- *
- * @param {String} key The cache lookup key for the item being removed.
- * @param {Object} value The cache value (returned by `{@link #miss}`) for the item
- * being removed.
- * @method evict
- * @template
- * @protected
- */
- evict: Ext.emptyFn
- });
- }(Ext.util.LRU, function() {}));
- /**
- * @class Ext.Class
- *
- * This is a low level factory that is used by {@link Ext#define Ext.define} and should not be used
- * directly in application code.
- *
- * The configs of this class are intended to be used in `Ext.define` calls to describe the class you
- * are declaring. For example:
- *
- * Ext.define('App.util.Thing', {
- * extend: 'App.util.Other',
- *
- * alias: 'util.thing',
- *
- * config: {
- * foo: 42
- * }
- * });
- *
- * Ext.Class is the factory and **not** the superclass of everything. For the base class
- * that **all** classes inherit from, see {@link Ext.Base}.
- */
- /* eslint-disable indent */
- (function() {
- // @tag class
- // @define Ext.Class
- // @require Ext.Base
- // @require Ext.Util
- // @require Ext.util.Cache
- var ExtClass,
- Base = Ext.Base,
- baseStaticMembers = Base.$staticMembers,
- ruleKeySortFn = function(a, b) {
- // longest to shortest, by text if names are equal
- return (a.length - b.length) || ((a < b) ? -1 : ((a > b) ? 1 : 0));
- };
- // Creates a constructor that has nothing extra in its scope chain.
- function makeCtor(className) {
- function constructor() {
- // Opera has some problems returning from a constructor when Dragonfly isn't running.
- // The || null seems to be sufficient to stop it misbehaving. Known to be required
- // against 10.53, 11.51 and 11.61.
- return this.constructor.apply(this, arguments) || null;
- }
- if (className) {
- constructor.name = className;
- }
- return constructor;
- }
- /**
- * @method constructor
- * Create a new anonymous class.
- *
- * @param Class
- * @param {Object} data An object represent the properties of this class
- * @param {Function} onCreated Optional, the callback function to be executed when this class
- * is fully created. Note that the creation process can be asynchronous depending
- * on the pre-processors used.
- *
- * @return {Ext.Base} The newly created class
- */
- Ext.Class = ExtClass = function(Class, data, onCreated) {
- if (typeof Class !== 'function') {
- onCreated = data;
- data = Class;
- Class = null;
- }
- if (!data) {
- data = {};
- }
- Class = ExtClass.create(Class, data);
- ExtClass.process(Class, data, onCreated);
- return Class;
- };
- Ext.apply(ExtClass, {
- makeCtor: makeCtor,
- /**
- * @private
- */
- onBeforeCreated: function(Class, data, hooks) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, '>> Ext.Class#onBeforeCreated', arguments);
- }
- Class.addMembers(data);
- hooks.onCreated.call(Class, Class);
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, '<< Ext.Class#onBeforeCreated', arguments);
- }
- },
- /**
- * @private
- */
- create: function(Class, data) {
- var i = baseStaticMembers.length,
- name;
- if (!Class) {
- Class = makeCtor(data.$className);
- }
- while (i--) {
- name = baseStaticMembers[i];
- Class[name] = Base[name];
- }
- return Class;
- },
- /**
- * @private
- */
- process: function(Class, data, onCreated) {
- var preprocessorStack = data.preprocessors || ExtClass.defaultPreprocessors,
- registeredPreprocessors = this.preprocessors,
- hooks = {
- onBeforeCreated: this.onBeforeCreated
- },
- preprocessors = [],
- preprocessor, preprocessorsProperties, i, ln, j, subLn, preprocessorProperty;
- delete data.preprocessors;
- Class._classHooks = hooks;
- for (i = 0 , ln = preprocessorStack.length; i < ln; i++) {
- preprocessor = preprocessorStack[i];
- if (typeof preprocessor === 'string') {
- preprocessor = registeredPreprocessors[preprocessor];
- preprocessorsProperties = preprocessor.properties;
- if (preprocessorsProperties === true) {
- preprocessors.push(preprocessor.fn);
- } else if (preprocessorsProperties) {
- for (j = 0 , subLn = preprocessorsProperties.length; j < subLn; j++) {
- preprocessorProperty = preprocessorsProperties[j];
- if (data.hasOwnProperty(preprocessorProperty)) {
- preprocessors.push(preprocessor.fn);
- break;
- }
- }
- }
- } else {
- preprocessors.push(preprocessor);
- }
- }
- hooks.onCreated = onCreated ? onCreated : Ext.emptyFn;
- hooks.preprocessors = preprocessors;
- this.doProcess(Class, data, hooks);
- },
- doProcess: function(Class, data, hooks) {
- var me = this,
- preprocessors = hooks.preprocessors,
- preprocessor = preprocessors.shift(),
- doProcess = me.doProcess;
- for (; preprocessor; preprocessor = preprocessors.shift()) {
- // Returning false signifies an asynchronous preprocessor - it will call doProcess
- // when we can continue
- if (preprocessor.call(me, Class, data, hooks, doProcess) === false) {
- return;
- }
- }
- hooks.onBeforeCreated.apply(me, arguments);
- },
- /**
- * @private
- * */
- preprocessors: {},
- /**
- * Register a new pre-processor to be used during the class creation process
- *
- * @param {String} name The pre-processor's name
- * @param {Function} fn The callback function to be executed. Typical format:
- *
- * function(cls, data, fn) {
- * // Your code here
- *
- * // Execute this when the processing is finished.
- * // Asynchronous processing is perfectly ok
- * if (fn) {
- * fn.call(this, cls, data);
- * }
- * });
- *
- * @param {Function} fn.cls The created class
- * @param {Object} fn.data The set of properties passed in {@link Ext.Class} constructor
- * @param {Function} fn.fn The callback function that **must** to be executed when this
- * pre-processor finishes, regardless of whether the processing is synchronous or
- * asynchronous.
- * @param properties
- * @param position
- * @param relativeTo
- * @return {Ext.Class} this
- * @private
- * @static
- */
- registerPreprocessor: function(name, fn, properties, position, relativeTo) {
- if (!position) {
- position = 'last';
- }
- if (!properties) {
- properties = [
- name
- ];
- }
- this.preprocessors[name] = {
- name: name,
- properties: properties || false,
- fn: fn
- };
- this.setDefaultPreprocessorPosition(name, position, relativeTo);
- return this;
- },
- /**
- * Retrieve a pre-processor callback function by its name, which has been registered before
- *
- * @param {String} name
- * @return {Function} preprocessor
- * @private
- * @static
- */
- getPreprocessor: function(name) {
- return this.preprocessors[name];
- },
- /**
- * @private
- */
- getPreprocessors: function() {
- return this.preprocessors;
- },
- /**
- * @private
- */
- defaultPreprocessors: [],
- /**
- * Retrieve the array stack of default pre-processors
- * @return {Function[]} defaultPreprocessors
- * @private
- * @static
- */
- getDefaultPreprocessors: function() {
- return this.defaultPreprocessors;
- },
- /**
- * Set the default array stack of default pre-processors
- *
- * @private
- * @param {Array} preprocessors
- * @return {Ext.Class} this
- * @static
- */
- setDefaultPreprocessors: function(preprocessors) {
- this.defaultPreprocessors = Ext.Array.from(preprocessors);
- return this;
- },
- /**
- * Insert this pre-processor at a specific position in the stack, optionally relative to
- * any existing pre-processor. For example:
- *
- * Ext.Class.registerPreprocessor('debug', function(cls, data, fn) {
- * // Your code here
- *
- * if (fn) {
- * fn.call(this, cls, data);
- * }
- * }).setDefaultPreprocessorPosition('debug', 'last');
- *
- * @private
- * @param {String} name The pre-processor name. Note that it needs to be registered with
- * {@link Ext.Class#registerPreprocessor registerPreprocessor} before this
- * @param {String} offset The insertion position. Four possible values are:
- * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
- * argument)
- * @param {String} relativeName
- * @return {Ext.Class} this
- * @static
- */
- setDefaultPreprocessorPosition: function(name, offset, relativeName) {
- var defaultPreprocessors = this.defaultPreprocessors,
- index;
- if (typeof offset === 'string') {
- if (offset === 'first') {
- defaultPreprocessors.unshift(name);
- return this;
- } else if (offset === 'last') {
- defaultPreprocessors.push(name);
- return this;
- }
- offset = (offset === 'after') ? 1 : -1;
- }
- index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
- if (index !== -1) {
- Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
- }
- return this;
- }
- });
- /**
- * @cfg {String} extend
- * The parent class that this class extends. For example:
- *
- * Ext.define('Person', {
- * say: function(text) { alert(text); }
- * });
- *
- * Ext.define('Developer', {
- * extend: 'Person',
- * say: function(text) { this.callParent(["print "+text]); }
- * });
- */
- ExtClass.registerPreprocessor('extend', function(Class, data, hooks) {
- var Base = Ext.Base,
- basePrototype = Base.prototype,
- extend = data.extend,
- Parent, parentPrototype, i;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#extendPreProcessor', arguments);
- }
- delete data.extend;
- if (extend && extend !== Object) {
- Parent = extend;
- } else {
- Parent = Base;
- }
- parentPrototype = Parent.prototype;
- if (!Parent.$isClass) {
- for (i in basePrototype) {
- if (!parentPrototype[i]) {
- parentPrototype[i] = basePrototype[i];
- }
- }
- }
- Class.extend(Parent);
- Class.triggerExtended.apply(Class, arguments);
- /**
- * @cfg {Object} eventedConfig
- * Config options defined within `eventedConfig` will auto-generate the setter /
- * getter methods (see {@link #cfg-config config} for more information on
- * auto-generated getter / setter methods). Additionally, when an
- * `eventedConfig` is set it will also fire a before{cfg}change and {cfg}change
- * event when the value of the eventedConfig is changed from its originally
- * defined value.
- *
- * **Note:** When creating a custom class you'll need to extend Ext.Evented
- *
- * Example custom class:
- *
- * Ext.define('MyApp.util.Test', {
- * extend: 'Ext.Evented',
- *
- * eventedConfig: {
- * foo: null
- * }
- * });
- *
- * In this example, the `foo` config will initially be null. Changing it via
- * `setFoo` will fire the `beforefoochange` event. The call to the setter can be
- * halted by returning `false` from a listener on the **before** event.
- *
- * var test = Ext.create('MyApp.util.Test', {
- * listeners: {
- * beforefoochange: function (instance, newValue, oldValue) {
- * return newValue !== 'bar';
- * },
- * foochange: function (instance, newValue, oldValue) {
- * console.log('foo changed to:', newValue);
- * }
- * }
- * });
- *
- * test.setFoo('bar');
- *
- * The `before` event handler can be used to validate changes to `foo`.
- * Returning `false` will prevent the setter from changing the value of the
- * config. In the previous example the `beforefoochange` handler returns false
- * so `foo` will not be updated and `foochange` will not be fired.
- *
- * test.setFoo('baz');
- *
- * Setting `foo` to 'baz' will not be prevented by the `before` handler. Foo
- * will be set to the value: 'baz' and the `foochange` event will be fired.
- */
- if (data.onClassExtended) {
- Class.onExtended(data.onClassExtended, Class);
- delete data.onClassExtended;
- }
- }, true);
- // true to always run this preprocessor even w/o "extend" keyword
- /**
- * @cfg {Object} privates
- * The `privates` config is a list of methods intended to be used internally by the
- * framework. Methods are placed in a `privates` block to prevent developers from
- * accidentally overriding framework methods in custom classes.
- *
- * Ext.define('Computer', {
- * privates: {
- * runFactory: function(brand) {
- * // internal only processing of brand passed to factory
- * this.factory(brand);
- * }
- * },
- *
- * factory: function (brand) {}
- * });
- *
- * In order to override a method from a `privates` block, the overridden method must
- * also be placed in a `privates` block within the override class.
- *
- * Ext.define('Override.Computer', {
- * override: 'Computer',
- * privates: {
- * runFactory: function() {
- * // overriding logic
- * }
- * }
- * });
- */
- ExtClass.registerPreprocessor('privates', function(Class, data) {
- var privates = data.privates,
- statics = privates.statics,
- privacy = privates.privacy || true;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#privatePreprocessor', arguments);
- }
- delete data.privates;
- delete privates.statics;
- // We have to add this preprocessor so that private getters/setters are picked up
- // by the config system. This also catches duplication in the public part of the
- // class since it is an error to override a private method with a public one.
- Class.addMembers(privates, false, privacy);
- if (statics) {
- Class.addMembers(statics, true, privacy);
- }
- });
- /**
- * @cfg {Object} statics
- * List of static methods for this class. For example:
- *
- * Ext.define('Computer', {
- * statics: {
- * factory: function(brand) {
- * // 'this' in static methods refer to the class itself
- * return new this(brand);
- * }
- * },
- *
- * constructor: function() { ... }
- * });
- *
- * var dellComputer = Computer.factory('Dell');
- */
- ExtClass.registerPreprocessor('statics', function(Class, data) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#staticsPreprocessor', arguments);
- }
- Class.addStatics(data.statics);
- delete data.statics;
- });
- /**
- * @cfg {Object} inheritableStatics
- * List of inheritable static methods for this class.
- * Otherwise just like {@link #statics} but subclasses inherit these methods.
- */
- ExtClass.registerPreprocessor('inheritableStatics', function(Class, data) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#inheritableStaticsPreprocessor', arguments);
- }
- Class.addInheritableStatics(data.inheritableStatics);
- delete data.inheritableStatics;
- });
- Ext.createRuleFn = function(code) {
- return new Function('$c', 'with($c) { try { return (' + code + '); } catch(e) { return false;}}');
- };
- Ext.expressionCache = new Ext.util.Cache({
- miss: Ext.createRuleFn
- });
- Ext.ruleKeySortFn = ruleKeySortFn;
- Ext.getPlatformConfigKeys = function(platformConfig) {
- var ret = [],
- platform, rule;
- for (platform in platformConfig) {
- rule = Ext.expressionCache.get(platform);
- if (rule(Ext.platformTags)) {
- ret.push(platform);
- }
- }
- ret.sort(ruleKeySortFn);
- return ret;
- };
- /**
- * @cfg {Object} config
- *
- * List of configuration options with their default values.
- *
- * __Note:__ You need to make sure {@link Ext.Base#initConfig} is called from your constructor
- * if you are defining your own class or singleton, unless you are extending a Component.
- * Otherwise the generated getter and setter methods will not be initialized.
- *
- * Each config item will have its own setter and getter method automatically generated inside
- * the class prototype during class creation time, if the class does not have those methods
- * explicitly defined.
- *
- * As an example, let's convert the name property of a Person class to be a config item, then
- * add extra age and gender items.
- *
- * Ext.define('My.sample.Person', {
- * config: {
- * name: 'Mr. Unknown',
- * age: 0,
- * gender: 'Male'
- * },
- *
- * constructor: function(config) {
- * this.initConfig(config);
- *
- * return this;
- * }
- *
- * // ...
- * });
- *
- * Within the class, this.name still has the default value of "Mr. Unknown". However, it's now
- * publicly accessible without sacrificing encapsulation, via setter and getter methods.
- *
- * var jacky = new My.sample.Person({
- * name: "Jacky",
- * age: 35
- * });
- *
- * alert(jacky.getAge()); // alerts 35
- * alert(jacky.getGender()); // alerts "Male"
- *
- * jacky.setName("Mr. Nguyen");
- * alert(jacky.getName()); // alerts "Mr. Nguyen"
- *
- * Notice that we changed the class constructor to invoke this.initConfig() and pass in the
- * provided config object. Two key things happened:
- *
- * - The provided config object when the class is instantiated is recursively merged with
- * the default config object.
- * - All corresponding setter methods are called with the merged values.
- *
- * Beside storing the given values, throughout the frameworks, setters generally have two key
- * responsibilities:
- *
- * - Filtering / validation / transformation of the given value before it's actually stored
- * within the instance.
- * - Notification (such as firing events) / post-processing after the value has been set,
- * or changed from a previous value.
- *
- * By standardize this common pattern, the default generated setters provide two extra template
- * methods that you can put your own custom logic into, i.e: an "applyFoo" and "updateFoo"
- * method for a "foo" config item, which are executed before and after the value is actually
- * set, respectively. Back to the example class, let's validate that age must be a valid
- * positive number, and fire an 'agechange' if the value is modified.
- *
- * Ext.define('My.sample.Person', {
- * config: {
- * // ...
- * },
- *
- * constructor: {
- * // ...
- * },
- *
- * applyAge: function(age) {
- * if (typeof age !== 'number' || age < 0) {
- * console.warn("Invalid age, must be a positive number");
- * return;
- * }
- *
- * return age;
- * },
- *
- * updateAge: function(newAge, oldAge) {
- * // age has changed from "oldAge" to "newAge"
- * this.fireEvent('agechange', this, newAge, oldAge);
- * }
- *
- * // ...
- * });
- *
- * var jacky = new My.sample.Person({
- * name: "Jacky",
- * age: 'invalid'
- * });
- *
- * alert(jacky.getAge()); // alerts 0
- *
- * alert(jacky.setAge(-100)); // alerts 0
- * alert(jacky.getAge()); // alerts 0
- *
- * alert(jacky.setAge(35)); // alerts 0
- * alert(jacky.getAge()); // alerts 35
- *
- * In other words, when leveraging the config feature, you mostly never need to define setter
- * and getter methods explicitly. Instead, "apply*" and "update*" methods should be implemented
- * where necessary. Your code will be consistent throughout and only contain the minimal logic
- * that you actually care about.
- *
- * When it comes to inheritance, the default config of the parent class is automatically,
- * recursively merged with the child's default config. The same applies for mixins.
- */
- ExtClass.registerPreprocessor('config', function(Class, data) {
- // Need to copy to the prototype here because that happens after preprocessors
- if (data.hasOwnProperty('$configPrefixed')) {
- Class.prototype.$configPrefixed = data.$configPrefixed;
- }
- Class.addConfig(data.config);
- // We need to remove this or it will be applied by addMembers and smash the
- // "config" placed on the prototype by Configurator (which includes *all* configs
- // such as cachedConfigs).
- delete data.config;
- });
- /**
- * @cfg {Object} cachedConfig
- *
- * This configuration works in a very similar manner to the {@link #config} option.
- * The difference is that the configurations are only ever processed when the first instance
- * of that class is created. The processed value is then stored on the class prototype and
- * will not be processed on subsequent instances of the class. Getters/setters will be generated
- * in exactly the same way as {@link #config}.
- *
- * This option is useful for expensive objects that can be shared across class instances.
- * The class itself ensures that the creation only occurs once.
- */
- ExtClass.registerPreprocessor('cachedConfig', function(Class, data) {
- // Need to copy to the prototype here because that happens after preprocessors
- if (data.hasOwnProperty('$configPrefixed')) {
- Class.prototype.$configPrefixed = data.$configPrefixed;
- }
- Class.addCachedConfig(data.cachedConfig);
- // Remove this so it won't be placed on the prototype.
- delete data.cachedConfig;
- });
- /**
- * @cfg {String[]/Object} mixins
- * List of classes to mix into this class. For example:
- *
- * Ext.define('CanSing', {
- * sing: function() {
- * alert("For he's a jolly good fellow...")
- * }
- * });
- *
- * Ext.define('Musician', {
- * mixins: ['CanSing']
- * })
- *
- * In this case the Musician class will get a `sing` method from CanSing mixin.
- *
- * But what if the Musician already has a `sing` method? Or you want to mix
- * in two classes, both of which define `sing`? In such a cases it's good
- * to define mixins as an object, where you assign a name to each mixin:
- *
- * Ext.define('Musician', {
- * mixins: {
- * canSing: 'CanSing'
- * },
- *
- * sing: function() {
- * // delegate singing operation to mixin
- * this.mixins.canSing.sing.call(this);
- * }
- * })
- *
- * In this case the `sing` method of Musician will overwrite the
- * mixed in `sing` method. But you can access the original mixed in method
- * through special `mixins` property.
- */
- ExtClass.registerPreprocessor('mixins', function(Class, data, hooks) {
- var mixins = data.mixins,
- onCreated = hooks.onCreated;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor', arguments);
- }
- delete data.mixins;
- hooks.onCreated = function() {
- /* eslint-disable-next-line max-len */
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor#beforeCreated', arguments);
- }
- // Put back the original onCreated before processing mixins. This allows a
- // mixin to hook onCreated by access Class._classHooks.
- hooks.onCreated = onCreated;
- Class.mixin(mixins);
- // We must go back to hooks.onCreated here because it may have changed during
- // calls to onClassMixedIn.
- return hooks.onCreated.apply(this, arguments);
- };
- });
- // Backwards compatible
- Ext.extend = function(Class, Parent, members) {
- var cls, m;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#extend-backwards-compatible', arguments);
- }
- if (arguments.length === 2 && Ext.isObject(Parent)) {
- members = Parent;
- Parent = Class;
- Class = null;
- }
- if (!Parent) {
- throw new Error("[Ext.extend] Attempting to extend from a class which has not " + "been loaded on the page.");
- }
- members.extend = Parent;
- /* eslint-disable comma-style */
- members.preprocessors = [
- 'extend',
- 'statics',
- 'inheritableStatics',
- 'mixins',
- 'config'
- ];
- /* eslint-enable comma-style */
- if (Class) {
- cls = new ExtClass(Class, members);
- // The 'constructor' is given as 'Class' but also needs to be on prototype
- cls.prototype.constructor = Class;
- } else {
- cls = new ExtClass(members);
- }
- cls.prototype.override = function(o) {
- for (m in o) {
- if (o.hasOwnProperty(m)) {
- this[m] = o[m];
- }
- }
- };
- return cls;
- };
- }());
- /**
- * This object contains properties that describe the current device or platform. These
- * values can be used in `{@link Ext.Class#platformConfig platformConfig}` as well as
- * `{@link Ext.mixin.Responsive#responsiveConfig responsiveConfig}` statements.
- *
- * This object can be modified to include tags that are useful for the application. To
- * add custom properties, it is advisable to use a sub-object. For example:
- *
- * Ext.platformTags.app = {
- * mobile: true
- * };
- *
- * @property {Object} platformTags
- * @property {Boolean} platformTags.phone
- * @property {Boolean} platformTags.tablet
- * @property {Boolean} platformTags.desktop
- * @property {Boolean} platformTags.touch Indicates touch inputs are available.
- * @property {Boolean} platformTags.safari
- * @property {Boolean} platformTags.chrome
- * @property {Boolean} platformTags.windows
- * @property {Boolean} platformTags.firefox
- * @property {Boolean} platformTags.ios True for iPad, iPhone and iPod.
- * @property {Boolean} platformTags.android
- * @property {Boolean} platformTags.blackberry
- * @property {Boolean} platformTags.tizen
- * @member Ext
- */
- // @tag class
- /**
- * @class Ext.Inventory
- * @private
- */
- Ext.Inventory = function() {
- // @define Ext.Script
- // @define Ext.Inventory
- // @require Ext.Function
- var me = this;
- me.names = [];
- me.paths = {};
- me.alternateToName = {};
- me.aliasToName = {};
- me.nameToAliases = {};
- me.nameToAlternates = {};
- me.nameToPrefix = {};
- };
- Ext.Inventory.prototype = {
- _array1: [
- 0
- ],
- prefixes: null,
- dotRe: /\./g,
- wildcardRe: /\*/g,
- addAlias: function(className, alias, update) {
- return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, update);
- },
- addAlternate: function(className, alternate) {
- return this.addMapping(className, alternate, this.alternateToName, this.nameToAlternates);
- },
- addMapping: function(className, alternate, toName, nameTo, update) {
- var name = className.$className || className,
- mappings = name,
- array = this._array1,
- a, aliases, cls, i, length, nameMapping;
- if (Ext.isString(name)) {
- mappings = {};
- mappings[name] = alternate;
- }
- for (cls in mappings) {
- aliases = mappings[cls];
- if (Ext.isString(aliases)) {
- array[0] = aliases;
- aliases = array;
- }
- length = aliases.length;
- nameMapping = nameTo[cls] || (nameTo[cls] = []);
- for (i = 0; i < length; ++i) {
- if (!(a = aliases[i])) {
-
- continue;
- }
- if (toName[a] !== cls) {
- if (!update && toName[a] && ('Ext.Gadget' !== a)) {
- Ext.log.warn("Overriding existing mapping: '" + a + "' From '" + toName[a] + "' to '" + cls + "'. Is this intentional?");
- }
- toName[a] = cls;
- nameMapping.push(a);
- }
- }
- }
- },
- /**
- * Get the aliases of a class by the class name
- *
- * @param {String} name
- * @return {Array} aliases
- */
- getAliasesByName: function(name) {
- return this.nameToAliases[name] || null;
- },
- getAlternatesByName: function(name) {
- return this.nameToAlternates[name] || null;
- },
- /**
- * Get the name of a class by its alias.
- *
- * @param {String} alias
- * @return {String} className
- */
- getNameByAlias: function(alias) {
- return this.aliasToName[alias] || '';
- },
- /**
- * Get the name of a class by its alternate name.
- *
- * @param {String} alternate
- * @return {String} className
- */
- getNameByAlternate: function(alternate) {
- return this.alternateToName[alternate] || '';
- },
- /**
- * Converts a string expression to an array of matching class names. An expression can
- * either refers to class aliases or class names. Expressions support wildcards:
- *
- * // returns ['Ext.window.Window']
- * var window = Ext.ClassManager.getNamesByExpression('widget.window');
- *
- * // returns ['widget.panel', 'widget.window', ...]
- * var allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');
- *
- * // returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]
- * var allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');
- *
- * @param {String/String[]} expression
- * @param {Object} [exclude=null] An object keyed by class name containing classes to
- * exclude from the returned classes. This must be provided if `accumulate` is set to
- * `true`.
- * @param {Boolean} [accumulate=false] Pass `true` to add matching classes to the
- * specified `exclude` object.
- * @return {String[]} An array of class names.
- */
- getNamesByExpression: function(expression, exclude, accumulate) {
- var me = this,
- aliasToName = me.aliasToName,
- alternateToName = me.alternateToName,
- nameToAliases = me.nameToAliases,
- nameToAlternates = me.nameToAlternates,
- map = accumulate ? exclude : {},
- names = [],
- expressions = Ext.isString(expression) ? [
- expression
- ] : expression,
- length = expressions.length,
- wildcardRe = me.wildcardRe,
- expr, i, list, match, n, name, regex;
- for (i = 0; i < length; ++i) {
- if ((expr = expressions[i]).indexOf('*') < 0) {
- // No wildcard
- if (!(name = aliasToName[expr])) {
- if (!(name = alternateToName[expr])) {
- name = expr;
- }
- }
- if (!(name in map) && !(exclude && (name in exclude))) {
- map[name] = 1;
- names.push(name);
- }
- } else {
- regex = new RegExp('^' + expr.replace(wildcardRe, '(.*?)') + '$');
- for (name in nameToAliases) {
- if (!(name in map) && !(exclude && (name in exclude))) {
- if (!(match = regex.test(name))) {
- n = (list = nameToAliases[name]).length;
- while (!match && n-- > 0) {
- match = regex.test(list[n]);
- }
- list = nameToAlternates[name];
- if (list && !match) {
- n = list.length;
- while (!match && n-- > 0) {
- match = regex.test(list[n]);
- }
- }
- }
- if (match) {
- map[name] = 1;
- names.push(name);
- }
- }
- }
- }
- }
- return names;
- },
- getPath: function(className) {
- var me = this,
- paths = me.paths,
- ret = '',
- prefix;
- if (className in paths) {
- ret = paths[className];
- } else {
- prefix = me.nameToPrefix[className] || (me.nameToPrefix[className] = me.getPrefix(className));
- if (prefix) {
- className = className.substring(prefix.length + 1);
- ret = paths[prefix];
- if (ret) {
- ret += '/';
- }
- }
- ret += className.replace(me.dotRe, '/') + '.js';
- }
- return ret;
- },
- getPrefix: function(className) {
- if (className in this.paths) {
- return className;
- } else if (className in this.nameToPrefix) {
- return this.nameToPrefix[className];
- }
- /* eslint-disable-next-line vars-on-top */
- var prefixes = this.getPrefixes(),
- length = className.length,
- items, currChar, prefix, j, jlen;
- // Walk the prefixes backwards so we consider the longest ones first.
- // Prefixes are kept in a sparse array grouped by length so we don't have to
- // iterate over all of them, just the ones we need.
- while (length-- > 0) {
- items = prefixes[length];
- if (items) {
- currChar = className.charAt(length);
- if (currChar !== '.') {
-
- continue;
- }
- for (j = 0 , jlen = items.length; j < jlen; j++) {
- prefix = items[j];
- if (prefix === className.substring(0, length)) {
- return prefix;
- }
- }
- }
- }
- return '';
- },
- getPrefixes: function() {
- var me = this,
- prefixes = me.prefixes,
- names, name, nameLength, items, i, len;
- if (!prefixes) {
- names = me.names.slice(0);
- me.prefixes = prefixes = [];
- for (i = 0 , len = names.length; i < len; i++) {
- name = names[i];
- nameLength = name.length;
- items = prefixes[nameLength] || (prefixes[nameLength] = []);
- items.push(name);
- }
- }
- return prefixes;
- },
- removeName: function(name) {
- var me = this,
- aliasToName = me.aliasToName,
- alternateToName = me.alternateToName,
- nameToAliases = me.nameToAliases,
- nameToAlternates = me.nameToAlternates,
- aliases = nameToAliases[name],
- alternates = nameToAlternates[name],
- i, a;
- delete nameToAliases[name];
- delete nameToAlternates[name];
- delete me.nameToPrefix[name];
- if (aliases) {
- for (i = aliases.length; i--; ) {
- // Aliases can be reassigned so if this class is the current mapping of
- // the alias, remove it. Since there is no chain to restore what was
- // removed this is not perfect.
- if (name === aliasToName[a = aliases[i]]) {
- delete aliasToName[a];
- }
- }
- }
- if (alternates) {
- for (i = alternates.length; i--; ) {
- // Like aliases, alternate class names can also be remapped.
- if (name === alternateToName[a = alternates[i]]) {
- delete alternateToName[a];
- }
- }
- }
- },
- resolveName: function(name) {
- var me = this,
- trueName;
- // If the name has a registered alias, it is a true className (not an alternate)
- // so we can stop now.
- if (!(name in me.nameToAliases)) {
- // The name is not a known class name, so check to see if it is a known alias:
- if (!(trueName = me.aliasToName[name])) {
- // The name does not correspond to a known alias, so check if it is a known
- // alternateClassName:
- trueName = me.alternateToName[name];
- }
- }
- return trueName || name;
- },
- /**
- * This method returns a selector object that produces a selection of classes and
- * delivers them to the desired `receiver`.
- *
- * The returned selector object has the same methods as the given `receiver` object
- * but these methods on the selector accept a first argument that expects a pattern
- * or array of patterns. The actual method on the `receiver` will be called with an
- * array of classes that match these patterns but with any patterns passed to an
- * `exclude` call removed.
- *
- * For example:
- *
- * var sel = inventory.select({
- * require: function (classes) {
- * console.log('Classes: ' + classes.join(','));
- * }
- * });
- *
- * sel.exclude('Ext.chart.*').exclude('Ext.draw.*').require('*');
- *
- * // Logs all classes except those in the Ext.chart and Ext.draw namespaces.
- *
- * @param {Object} receiver
- * @param {Object} [scope] Optional scope to use when calling `receiver` methods.
- * @return {Object} An object with the same methods as `receiver` plus `exclude`.
- */
- select: function(receiver, scope) {
- var me = this,
- excludes = {},
- ret = {
- excludes: excludes,
- exclude: function() {
- me.getNamesByExpression(arguments[0], excludes, true);
- return this;
- }
- },
- name;
- for (name in receiver) {
- ret[name] = me.selectMethod(excludes, receiver[name], scope || receiver);
- }
- return ret;
- },
- selectMethod: function(excludes, fn, scope) {
- var me = this;
- return function(include) {
- var args = Ext.Array.slice(arguments, 1);
- args.unshift(me.getNamesByExpression(include, excludes));
- return fn.apply(scope, args);
- };
- },
- /**
- * Sets the path of a namespace.
- * For Example:
- *
- * inventory.setPath('Ext', '.');
- * inventory.setPath({
- * Ext: '.'
- * });
- *
- * @param {String/Object} name The name of a single mapping or an object of mappings.
- * @param {String} [path] If `name` is a String, then this is the path for that name.
- * Otherwise this parameter is ignored.
- * @return {Ext.Inventory} this
- * @method
- */
- setPath: Ext.Function.flexSetter(function(name, path) {
- var me = this;
- me.paths[name] = path;
- me.names.push(name);
- me.prefixes = null;
- me.nameToPrefix = {};
- return me;
- })
- };
- // @tag class
- /**
- * @class Ext.ClassManager
- *
- * Ext.ClassManager manages all classes and handles mapping from string class name to
- * actual class objects throughout the whole framework. It is not generally accessed directly,
- * rather through these convenient shorthands:
- *
- * - {@link Ext#define Ext.define}
- * - {@link Ext#method!create Ext.create}
- * - {@link Ext#widget Ext.widget}
- * - {@link Ext#getClass Ext.getClass}
- * - {@link Ext#getClassName Ext.getClassName}
- *
- * # Basic syntax:
- *
- * Ext.define(className, properties);
- *
- * in which `properties` is an object represent a collection of properties that apply to the class.
- * See {@link Ext.ClassManager#method!create} for more detailed instructions.
- *
- * Ext.define('Person', {
- * name: 'Unknown',
- *
- * constructor: function(name) {
- * if (name) {
- * this.name = name;
- * }
- * },
- *
- * eat: function(foodType) {
- * alert("I'm eating: " + foodType);
- *
- * return this;
- * }
- * });
- *
- * var aaron = new Person("Aaron");
- * aaron.eat("Sandwich"); // alert("I'm eating: Sandwich");
- *
- * Ext.Class has a powerful set of extensible {@link Ext.Class#registerPreprocessor pre-processors}
- * which takes care of everything related to class creation, including but not limited to
- * inheritance, mixins, configuration, statics, etc.
- *
- * # Inheritance:
- *
- * Ext.define('Developer', {
- * extend: 'Person',
- *
- * constructor: function(name, isGeek) {
- * this.isGeek = isGeek;
- *
- * // Apply a method from the parent class' prototype
- * this.callParent([name]);
- * },
- *
- * code: function(language) {
- * alert("I'm coding in: " + language);
- *
- * this.eat("Bugs");
- *
- * return this;
- * }
- * });
- *
- * var jacky = new Developer("Jacky", true);
- * jacky.code("JavaScript"); // alert("I'm coding in: JavaScript");
- * // alert("I'm eating: Bugs");
- *
- * See {@link Ext.Base#method!callParent} for more details on calling superclass' methods
- *
- * # Mixins:
- *
- * Ext.define('CanPlayGuitar', {
- * playGuitar: function() {
- * alert("F#...G...D...A");
- * }
- * });
- *
- * Ext.define('CanComposeSongs', {
- * composeSongs: function() { ... }
- * });
- *
- * Ext.define('CanSing', {
- * sing: function() {
- * alert("For he's a jolly good fellow...")
- * }
- * });
- *
- * Ext.define('Musician', {
- * extend: 'Person',
- *
- * mixins: {
- * canPlayGuitar: 'CanPlayGuitar',
- * canComposeSongs: 'CanComposeSongs',
- * canSing: 'CanSing'
- * }
- * })
- *
- * Ext.define('CoolPerson', {
- * extend: 'Person',
- *
- * mixins: {
- * canPlayGuitar: 'CanPlayGuitar',
- * canSing: 'CanSing'
- * },
- *
- * sing: function() {
- * alert("Ahem....");
- *
- * this.mixins.canSing.sing.call(this);
- *
- * alert("[Playing guitar at the same time...]");
- *
- * this.playGuitar();
- * }
- * });
- *
- * var me = new CoolPerson("Jacky");
- *
- * me.sing(); // alert("Ahem...");
- * // alert("For he's a jolly good fellow...");
- * // alert("[Playing guitar at the same time...]");
- * // alert("F#...G...D...A");
- *
- * # Config:
- *
- * Ext.define('SmartPhone', {
- * config: {
- * hasTouchScreen: false,
- * operatingSystem: 'Other',
- * price: 500
- * },
- *
- * isExpensive: false,
- *
- * constructor: function(config) {
- * this.initConfig(config);
- * },
- *
- * applyPrice: function(price) {
- * this.isExpensive = (price > 500);
- *
- * return price;
- * },
- *
- * applyOperatingSystem: function(operatingSystem) {
- * if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {
- * return 'Other';
- * }
- *
- * return operatingSystem;
- * }
- * });
- *
- * var iPhone = new SmartPhone({
- * hasTouchScreen: true,
- * operatingSystem: 'iOS'
- * });
- *
- * iPhone.getPrice(); // 500;
- * iPhone.getOperatingSystem(); // 'iOS'
- * iPhone.getHasTouchScreen(); // true;
- *
- * iPhone.isExpensive; // false;
- * iPhone.setPrice(600);
- * iPhone.getPrice(); // 600
- * iPhone.isExpensive; // true;
- *
- * iPhone.setOperatingSystem('AlienOS');
- * iPhone.getOperatingSystem(); // 'Other'
- *
- * # Statics:
- *
- * Ext.define('Computer', {
- * statics: {
- * factory: function(brand) {
- * // 'this' in static methods refer to the class itself
- * return new this(brand);
- * }
- * },
- *
- * constructor: function() { ... }
- * });
- *
- * var dellComputer = Computer.factory('Dell');
- *
- * Also see {@link Ext.Base#statics} and {@link Ext.Base#self} for more details on accessing
- * static properties within class methods
- *
- * @singleton
- */
- Ext.ClassManager = (function(Class, alias, arraySlice, arrayFrom, global) {
- // @define Ext.ClassManager
- // @require Ext.Inventory
- // @require Ext.Class
- // @require Ext.Function
- // @require Ext.Array
- var makeCtor = Ext.Class.makeCtor,
- nameLookupStack = [],
- namespaceCache = {
- Ext: {
- name: 'Ext',
- value: Ext
- }
- },
- // specially added for sandbox (Ext === global.Ext6)
- /*
- 'Ext.grid': {
- name: 'grid',
- parent: namespaceCache['Ext']
- },
- 'Ext.grid.Panel': {
- name: 'Panel',
- parent: namespaceCache['Ext.grid']
- },
- ...
- Also,
- 'MyApp': {
- name: 'MyApp',
- value: MyApp
- }
- */
- Manager = Ext.apply(new Ext.Inventory(), {
- /**
- * @property {Object} classes
- * All classes which were defined through the ClassManager. Keys are the
- * name of the classes and the values are references to the classes.
- * @private
- */
- classes: {},
- classCount: 0,
- classState: {},
- /*
- * 'Ext.foo.Bar': <state enum>
- *
- * 10 = Ext.define called
- * 20 = Ext.define/override called
- * 30 = Manager.existCache[<name>] == true for define
- * 40 = Manager.existCache[<name>] == true for define/override
- * 50 = Manager.isCreated(<name>) == true for define
- * 60 = Manager.isCreated(<name>) == true for define/override
- *
- */
- /**
- * @private
- */
- existCache: {},
- /** @private */
- instantiators: [],
- /**
- * Checks if a class has already been created.
- *
- * @param {String} className
- * @return {Boolean} exist
- */
- isCreated: function(className) {
- if (typeof className !== 'string' || className.length < 1) {
- throw new Error("[Ext.ClassManager] Invalid classname, must be a string and " + "must not be empty");
- }
- if (Manager.classes[className] || Manager.existCache[className]) {
- return true;
- }
- if (!Manager.lookupName(className, false)) {
- return false;
- }
- Manager.triggerCreated(className);
- return true;
- },
- /**
- * @private
- */
- createdListeners: [],
- /**
- * @private
- */
- nameCreatedListeners: {},
- /**
- * @private
- */
- existsListeners: [],
- /**
- * @private
- */
- nameExistsListeners: {},
- /**
- * @private
- */
- overrideMap: {},
- /**
- * @private
- */
- triggerCreated: function(className, state) {
- Manager.existCache[className] = state || 1;
- Manager.classState[className] += 40;
- Manager.notify(className, Manager.createdListeners, Manager.nameCreatedListeners);
- },
- /**
- * @private
- */
- onCreated: function(fn, scope, className) {
- Manager.addListener(fn, scope, className, Manager.createdListeners, Manager.nameCreatedListeners);
- },
- /**
- * @private
- */
- notify: function(className, listeners, nameListeners) {
- var alternateNames = Manager.getAlternatesByName(className),
- names = [
- className
- ],
- i, ln, j, subLn, listener, name;
- for (i = 0 , ln = listeners.length; i < ln; i++) {
- listener = listeners[i];
- listener.fn.call(listener.scope, className);
- }
- while (names) {
- for (i = 0 , ln = names.length; i < ln; i++) {
- name = names[i];
- listeners = nameListeners[name];
- if (listeners) {
- for (j = 0 , subLn = listeners.length; j < subLn; j++) {
- listener = listeners[j];
- listener.fn.call(listener.scope, name);
- }
- delete nameListeners[name];
- }
- }
- names = alternateNames;
- // for 2nd pass (if needed)
- alternateNames = null;
- }
- },
- // no 3rd pass
- /**
- * @private
- */
- addListener: function(fn, scope, className, listeners, nameListeners) {
- var i;
- if (Ext.isArray(className)) {
- fn = Ext.Function.createBarrier(className.length, fn, scope);
- for (i = 0; i < className.length; i++) {
- this.addListener(fn, null, className[i], listeners, nameListeners);
- }
- return;
- }
- /* eslint-disable-next-line vars-on-top */
- var listener = {
- fn: fn,
- scope: scope
- };
- if (className) {
- if (this.isCreated(className)) {
- fn.call(scope, className);
- return;
- }
- if (!nameListeners[className]) {
- nameListeners[className] = [];
- }
- nameListeners[className].push(listener);
- } else {
- listeners.push(listener);
- }
- },
- /**
- * Supports namespace rewriting.
- * @private
- */
- $namespaceCache: namespaceCache,
- /**
- * See `{@link Ext#addRootNamespaces Ext.addRootNamespaces}`.
- * @since 6.0.0
- * @private
- */
- addRootNamespaces: function(namespaces) {
- var name;
- for (name in namespaces) {
- namespaceCache[name] = {
- name: name,
- value: namespaces[name]
- };
- }
- },
- /**
- * Clears the namespace lookup cache. After application launch, this cache can
- * often contain several hundred entries that are unlikely to be needed again.
- * These will be rebuilt as needed, so it is harmless to clear this cache even
- * if its results will be used again.
- * @since 6.0.0
- * @private
- */
- clearNamespaceCache: function() {
- var name;
- nameLookupStack.length = 0;
- for (name in namespaceCache) {
- if (!namespaceCache[name].value) {
- delete namespaceCache[name];
- }
- }
- },
- /**
- * Return the namespace cache entry for the given a class name or namespace (e.g.,
- * "Ext.grid.Panel").
- *
- * @param {String} namespace The namespace or class name to lookup.
- * @return {Object} The cache entry.
- * @return {String} return.name The leaf name ("Panel" for "Ext.grid.Panel").
- * @return {Object} return.parent The entry of the parent namespace (i.e., "Ext.grid").
- * @return {Object} return.value The namespace object. This is only set for
- * top-level namespace entries to support renaming them for sandboxing ("Ext6" vs
- * "Ext").
- * @since 6.0.0
- * @private
- */
- getNamespaceEntry: function(namespace) {
- var entry, i;
- if (typeof namespace !== 'string') {
- return namespace;
- }
- // assume we've been given an entry object
- entry = namespaceCache[namespace];
- if (!entry) {
- i = namespace.lastIndexOf('.');
- if (i < 0) {
- entry = {
- name: namespace
- };
- } else {
- entry = {
- name: namespace.substring(i + 1),
- parent: Manager.getNamespaceEntry(namespace.substring(0, i))
- };
- }
- namespaceCache[namespace] = entry;
- }
- return entry;
- },
- /**
- * Return the value of the given "dot path" name. This supports remapping (for use
- * in sandbox builds) as well as auto-creating of namespaces.
- *
- * @param {String} namespace The name of the namespace or class.
- * @param {Boolean} [autoCreate] Pass `true` to create objects for undefined names.
- * @return {Object} The object that is the namespace or class name.
- * @since 6.0.0
- * @private
- */
- lookupName: function(namespace, autoCreate) {
- var entry = Manager.getNamespaceEntry(namespace),
- scope = Ext.global,
- i = 0,
- e, parent;
- // Put entries on the stack in reverse order: [ 'Panel', 'grid', 'Ext' ]
- for (e = entry; e; e = e.parent) {
- // since we process only what we add to the array, and that always
- // starts at index=0, we don't need to clean up the array (that would
- // just encourage the GC to do something pointless).
- nameLookupStack[i++] = e;
- }
- while (scope && i-- > 0) {
- // We'll process entries in top-down order ('Ext', 'grid' then 'Panel').
- e = nameLookupStack[i];
- parent = scope;
- scope = e.value || scope[e.name];
- if (!scope && autoCreate) {
- parent[e.name] = scope = {};
- }
- }
- return scope;
- },
- /**
- * Creates a namespace and assign the `value` to the created object.
- *
- * Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);
- *
- * alert(MyCompany.pkg.Example === someObject); // alerts true
- *
- * @param {String} namespace
- * @param {Object} value
- */
- setNamespace: function(namespace, value) {
- var entry = Manager.getNamespaceEntry(namespace),
- scope = Ext.global;
- if (entry.parent) {
- scope = Manager.lookupName(entry.parent, true);
- }
- scope[entry.name] = value;
- return value;
- },
- /**
- * Changes the mapping of an `xtype` to map to the specified component class.
- * @param {String/Ext.Class} cls The class or class name to which `xtype` is mapped.
- * @param {String} xtype The `xtype` to map or redefine as `cls`.
- * @since 6.0.1
- * @private
- */
- setXType: function(cls, xtype) {
- var className = cls.$className,
- C = className ? cls : Manager.get(className = cls),
- proto = C.prototype,
- xtypes = proto.xtypes,
- xtypesChain = proto.xtypesChain,
- xtypesMap = proto.xtypesMap;
- if (!proto.hasOwnProperty('xtypes')) {
- proto.xtypes = xtypes = [];
- proto.xtypesChain = xtypesChain = xtypesChain ? xtypesChain.slice(0) : [];
- proto.xtypesMap = xtypesMap = Ext.apply({}, xtypesMap);
- }
- Manager.addAlias(className, 'widget.' + xtype, true);
- xtypes.push(xtype);
- xtypesChain.push(xtype);
- xtypesMap[xtype] = true;
- },
- // TODO consider updating derived class xtypesChain / xtypesMap
- /**
- * Sets a name reference to a class.
- *
- * @param {String} name
- * @param {Object} value
- * @return {Ext.ClassManager} this
- */
- set: function(name, value) {
- var targetName = Manager.getName(value);
- Manager.classes[name] = Manager.setNamespace(name, value);
- Manager.classCount++;
- if (targetName && targetName !== name) {
- Manager.addAlternate(targetName, name);
- }
- return Manager;
- },
- /**
- * Retrieve a class by its name.
- *
- * @param {String} name
- * @return {Ext.Class} class
- */
- get: function(name) {
- return Manager.classes[name] || Manager.lookupName(name, false);
- },
- /**
- * Adds a batch of class name to alias mappings.
- * @param {Object} aliases The set of mappings of the form.
- * className : [values...]
- */
- addNameAliasMappings: function(aliases) {
- Manager.addAlias(aliases);
- },
- /**
- *
- * @param {Object} alternates The set of mappings of the form
- * className : [values...]
- */
- addNameAlternateMappings: function(alternates) {
- Manager.addAlternate(alternates);
- },
- /**
- * Get a reference to the class by its alias.
- *
- * @param {String} alias
- * @return {Ext.Class} class
- */
- getByAlias: function(alias) {
- return Manager.get(Manager.getNameByAlias(alias));
- },
- /**
- * Get a component class name from a config object.
- * @param {Object} config The config object.
- * @param {String} [aliasPrefix] A prefix to use when getting
- * a class name by alias.
- * @return {Ext.Class} The class.
- *
- * @private
- */
- getByConfig: function(config, aliasPrefix) {
- var xclass = config.xclass,
- name;
- if (xclass) {
- name = xclass;
- } else {
- name = config.xtype;
- if (name) {
- aliasPrefix = 'widget.';
- } else {
- name = config.type;
- }
- name = Manager.getNameByAlias(aliasPrefix + name);
- }
- return Manager.get(name);
- },
- /**
- * Get the name of the class by its reference or its instance. This is
- * usually invoked by the shorthand {@link Ext#getClassName}.
- *
- * Ext.ClassManager.getName(Ext.Action); // returns "Ext.Action"
- *
- * @param {Ext.Class/Object} object
- * @return {String} className
- */
- getName: function(object) {
- return object && object.$className || '';
- },
- /**
- * Get the class of the provided object; returns null if it's not an instance
- * of any class created with Ext.define. This is usually invoked by the
- * shorthand {@link Ext#getClass}.
- *
- * var component = new Ext.Component();
- *
- * Ext.getClass(component); // returns Ext.Component
- *
- * @param {Object} object
- * @return {Ext.Class} class
- */
- getClass: function(object) {
- return object && object.self || null;
- },
- /**
- * Defines a class.
- * @deprecated 4.1 Use {@link Ext#define} instead.
- * @private
- */
- create: function(className, data, createdFn) {
- var ctor;
- if (className != null && typeof className !== 'string') {
- throw new Error("[Ext.define] Invalid class name '" + className + "' specified, must be a non-empty string");
- }
- ctor = makeCtor(className);
- if (typeof data === 'function') {
- data = data(ctor);
- }
- if (className) {
- if (Manager.classes[className]) {
- Ext.log.warn("[Ext.define] Duplicate class name '" + className + "' specified, must be a non-empty string");
- }
- ctor.name = className;
- }
- data.$className = className;
- return new Class(ctor, data, function() {
- var postprocessorStack = data.postprocessors || Manager.defaultPostprocessors,
- registeredPostprocessors = Manager.postprocessors,
- postprocessors = [],
- postprocessor, i, ln, j, subLn, postprocessorProperties, postprocessorProperty;
- delete data.postprocessors;
- for (i = 0 , ln = postprocessorStack.length; i < ln; i++) {
- postprocessor = postprocessorStack[i];
- if (typeof postprocessor === 'string') {
- postprocessor = registeredPostprocessors[postprocessor];
- postprocessorProperties = postprocessor.properties;
- if (postprocessorProperties === true) {
- postprocessors.push(postprocessor.fn);
- } else if (postprocessorProperties) {
- for (j = 0 , subLn = postprocessorProperties.length; j < subLn; j++) {
- postprocessorProperty = postprocessorProperties[j];
- if (data.hasOwnProperty(postprocessorProperty)) {
- postprocessors.push(postprocessor.fn);
- break;
- }
- }
- }
- } else {
- postprocessors.push(postprocessor);
- }
- }
- data.postprocessors = postprocessors;
- data.createdFn = createdFn;
- Manager.processCreate(className, this, data);
- });
- },
- processCreate: function(className, cls, clsData) {
- var me = this,
- postprocessor = clsData.postprocessors.shift(),
- createdFn = clsData.createdFn;
- if (!postprocessor) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(className, 'Ext.ClassManager#classCreated', arguments);
- }
- if (className) {
- me.set(className, cls);
- }
- delete cls._classHooks;
- if (createdFn) {
- createdFn.call(cls, cls);
- }
- if (className) {
- me.triggerCreated(className);
- }
- return;
- }
- if (postprocessor.call(me, className, cls, clsData, me.processCreate) !== false) {
- me.processCreate(className, cls, clsData);
- }
- },
- createOverride: function(className, data, createdFn) {
- var me = this,
- overriddenClassName = data.override,
- requires = data.requires,
- uses = data.uses,
- mixins = data.mixins,
- mixinsIsArray,
- compat = 1,
- // default if 'compatibility' is not specified
- dependenciesLoaded, classReady;
- classReady = function() {
- var cls, dependencies, i, key, temp;
- if (!dependenciesLoaded) {
- dependencies = requires ? requires.slice(0) : [];
- if (mixins) {
- if (!(mixinsIsArray = mixins instanceof Array)) {
- for (key in mixins) {
- if (Ext.isString(cls = mixins[key])) {
- dependencies.push(cls);
- }
- }
- } else {
- for (i = 0 , temp = mixins.length; i < temp; ++i) {
- if (Ext.isString(cls = mixins[i])) {
- dependencies.push(cls);
- }
- }
- }
- }
- dependenciesLoaded = true;
- if (dependencies.length) {
- // Since the override is going to be used (its target class is
- // now created), we need to fetch the required classes for the
- // override and call us back once they are loaded:
- Ext.require(dependencies, classReady);
- return;
- }
- }
- // else we have no dependencies, so proceed
- // transform mixin class names into class references, This
- // loop can handle both the array and object forms of
- // mixin definitions
- if (mixinsIsArray) {
- for (i = 0 , temp = mixins.length; i < temp; ++i) {
- if (Ext.isString(cls = mixins[i])) {
- mixins[i] = Ext.ClassManager.get(cls);
- }
- }
- } else if (mixins) {
- for (key in mixins) {
- if (Ext.isString(cls = mixins[key])) {
- mixins[key] = Ext.ClassManager.get(cls);
- }
- }
- }
- // The target class and the required classes for this override are
- // ready, so we can apply the override now:
- cls = overriddenClassName.$isClass ? overriddenClassName : me.get(overriddenClassName);
- // We don't want to apply these:
- delete data.override;
- delete data.compatibility;
- delete data.requires;
- delete data.uses;
- Ext.override(cls, data);
- // This pushes the overriding file itself into Ext.Loader.history
- // Hence if the target class never exists, the overriding file will
- // never be included in the build.
- Ext.Loader.history.push(className);
- if (uses) {
- // This "hides" from the Cmd auto-dependency scanner since
- // the reference is circular (Loader requires us).
- /* eslint-disable-next-line dot-notation */
- Ext['Loader'].addUsedClasses(uses);
- }
- // get these classes too!
- if (createdFn) {
- createdFn.call(cls, cls);
- }
- };
- // last but not least!
- if (className) {
- Manager.overrideMap[className] = true;
- }
- // If specified, parse strings as versions, but otherwise treat as a
- // boolean (maybe "compatibility: Ext.isIE8" or something).
- //
- if ('compatibility' in data) {
- compat = data.compatibility;
- if (!compat) {
- // Cast '', null, undefined, 0 to false.
- compat = false;
- } else if (typeof compat === 'number') {
- // By virtue of the condition above we must be a nonzero number.
- compat = true;
- } else if (typeof compat !== 'boolean') {
- compat = Ext.checkVersion(compat);
- }
- }
- if (compat) {
- // override the target class right after it's created
- if (overriddenClassName.$isClass) {
- classReady();
- } else {
- me.onCreated(classReady, me, overriddenClassName);
- }
- }
- me.triggerCreated(className, 2);
- return me;
- },
- /**
- * Instantiate a class by its alias. This is usually invoked by the
- * shorthand {@link Ext#createByAlias}.
- *
- * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class
- * has not been defined yet, it will attempt to load the class via synchronous
- * loading.
- *
- * var window = Ext.createByAlias('widget.window', { width: 600, height: 800 });
- *
- * @param {String} alias
- * @param {Object...} args Additional arguments after the alias will be passed to the
- * class constructor.
- * @return {Object} instance
- */
- instantiateByAlias: function() {
- var alias = arguments[0],
- args = arraySlice.call(arguments),
- className = this.getNameByAlias(alias);
- if (!className) {
- throw new Error("[Ext.createByAlias] Unrecognized alias: " + alias);
- }
- args[0] = className;
- return Ext.create.apply(Ext, args);
- },
- /**
- * Instantiate a class by either full name, alias or alternate name
- * @param {String} name
- * @param {Mixed} args Additional arguments after the name will be passed to the class'
- * constructor.
- * @return {Object} instance
- * @deprecated 5.0 Use Ext.create() instead.
- */
- instantiate: function() {
- Ext.log.warn('Ext.ClassManager.instantiate() is deprecated. Use Ext.create() instead.');
- return Ext.create.apply(Ext, arguments);
- },
- /**
- * @private
- * @param name
- * @param args
- */
- dynInstantiate: function(name, args) {
- args = arrayFrom(args, true);
- args.unshift(name);
- return Ext.create.apply(Ext, args);
- },
- /**
- * @private
- * @param length
- */
- getInstantiator: function(length) {
- var instantiators = this.instantiators,
- instantiator, args, i;
- instantiator = instantiators[length];
- if (!instantiator) {
- i = length;
- args = [];
- for (i = 0; i < length; i++) {
- args.push('a[' + i + ']');
- }
- instantiator = instantiators[length] = new Function('c', 'a', 'return new c(' + args.join(',') + ')');
- instantiator.name = "Ext.create" + length;
- }
- return instantiator;
- },
- /**
- * @private
- */
- postprocessors: {},
- /**
- * @private
- */
- defaultPostprocessors: [],
- /**
- * Register a post-processor function.
- *
- * @param {String} name
- * @param {Function} fn
- * @param {String/String[]} properties
- * @param {String} position
- * @param {String} relativeTo
- * @private
- */
- registerPostprocessor: function(name, fn, properties, position, relativeTo) {
- if (!position) {
- position = 'last';
- }
- if (!properties) {
- properties = [
- name
- ];
- }
- this.postprocessors[name] = {
- name: name,
- properties: properties || false,
- fn: fn
- };
- this.setDefaultPostprocessorPosition(name, position, relativeTo);
- return this;
- },
- /**
- * Set the default post processors array stack which are applied to every class.
- *
- * @private
- * @param {String/Array} postprocessors The name of a registered post processor or an array
- * of registered names.
- * @return {Ext.ClassManager} this
- */
- setDefaultPostprocessors: function(postprocessors) {
- this.defaultPostprocessors = arrayFrom(postprocessors);
- return this;
- },
- /**
- * Insert this post-processor at a specific position in the stack, optionally relative to
- * any existing post-processor
- *
- * @private
- * @param {String} name The post-processor name. Note that it needs to be registered with
- * {@link Ext.ClassManager#registerPostprocessor} before this
- * @param {String} offset The insertion position. Four possible values are:
- * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
- * argument)
- * @param {String} relativeName
- * @return {Ext.ClassManager} this
- */
- setDefaultPostprocessorPosition: function(name, offset, relativeName) {
- var defaultPostprocessors = this.defaultPostprocessors,
- index;
- if (typeof offset === 'string') {
- if (offset === 'first') {
- defaultPostprocessors.unshift(name);
- return this;
- } else if (offset === 'last') {
- defaultPostprocessors.push(name);
- return this;
- }
- offset = (offset === 'after') ? 1 : -1;
- }
- index = Ext.Array.indexOf(defaultPostprocessors, relativeName);
- if (index !== -1) {
- Ext.Array.splice(defaultPostprocessors, Math.max(0, index + offset), 0, name);
- }
- return this;
- }
- });
- /* eslint-disable indent */
- /**
- * @cfg xtype
- * @member Ext.Class
- * @inheritdoc Ext.Component#cfg-xtype
- */
- /**
- * @cfg {String} override
- * @member Ext.Class
- * Overrides members of the specified `target` class.
- *
- * **NOTE:** the overridden class must have been defined using
- * {@link Ext#define Ext.define} in order to use the `override` config.
- *
- * Methods defined on the overriding class will not automatically call the methods of
- * the same name in the ancestor class chain. To call the parent's method of the
- * same name you must call {@link Ext.Base#method!callParent callParent}. To skip the
- * method of the overridden class and call its parent you will instead call
- * {@link Ext.Base#method!callSuper callSuper}.
- *
- * See {@link Ext#define Ext.define} for additional usage examples.
- */
- /**
- * @cfg {Object} platformConfig
- * Allows setting config values for a class based on specific platforms. The value
- * of this config is an object whose properties are "rules" and whose values are
- * objects containing config values.
- *
- * For example:
- *
- * Ext.define('App.view.Foo', {
- * extend: 'Ext.panel.Panel',
- *
- * platformConfig: {
- * desktop: {
- * title: 'Some Rather Descriptive Title'
- * },
- *
- * '!desktop': {
- * title: 'Short Title'
- * }
- * }
- * });
- *
- * In the above, "desktop" and "!desktop" are (mutually exclusive) rules. Whichever
- * evaluates to `true` will have its configs applied to the class. In this case, only
- * the "title" property, but the object can contain any number of config properties.
- * In this case, the `platformConfig` is evaluated as part of the class and there is
- * no cost for each instance created.
- *
- * The rules are evaluated expressions in the context of the platform tags contained
- * in `{@link Ext#platformTags Ext.platformTags}`. Any properties of that object are
- * implicitly usable (as shown above).
- *
- * If a `platformConfig` specifies a config value, it will replace any values declared
- * on the class itself.
- *
- * Use of `platformConfig` on instances is handled by the config system when classes
- * call `{@link Ext.Base#initConfig initConfig}`. For example:
- *
- * Ext.create({
- * xtype: 'panel',
- *
- * platformConfig: {
- * desktop: {
- * title: 'Some Rather Descriptive Title'
- * },
- *
- * '!desktop': {
- * title: 'Short Title'
- * }
- * }
- * });
- *
- * The following is equivalent to the above:
- *
- * if (Ext.platformTags.desktop) {
- * Ext.create({
- * xtype: 'panel',
- * title: 'Some Rather Descriptive Title'
- * });
- * } else {
- * Ext.create({
- * xtype: 'panel',
- * title: 'Short Title'
- * });
- * }
- *
- * To adjust configs based on dynamic conditions, see `{@link Ext.mixin.Responsive}`.
- */
- Manager.registerPostprocessor('platformConfig', function(name, Class, data) {
- Class.addPlatformConfig(data);
- });
- /**
- * @cfg {String/String[]} alias
- * @member Ext.Class
- * List of short aliases for class names. An alias consists of a namespace and a name
- * concatenated by a period as <namespace>.<name>
- *
- * - **namespace** - The namespace describes what kind of alias this is and must be
- * all lowercase.
- * - **name** - The name of the alias which allows the lazy-instantiation via the
- * alias. The name shouldn't contain any periods.
- *
- * A list of namespaces and the usages are:
- *
- * - **feature** - {@link Ext.grid.Panel Grid} features
- * - **plugin** - Plugins
- * - **store** - {@link Ext.data.Store}
- * - **widget** - Components
- *
- * Most useful for defining xtypes for widgets:
- *
- * Ext.define('MyApp.CoolPanel', {
- * extend: 'Ext.panel.Panel',
- * alias: ['widget.coolpanel'],
- * title: 'Yeah!'
- * });
- *
- * // Using Ext.create
- * Ext.create('widget.coolpanel');
- *
- * // Using the shorthand for defining widgets by xtype
- * Ext.widget('panel', {
- * items: [
- * {xtype: 'coolpanel', html: 'Foo'},
- * {xtype: 'coolpanel', html: 'Bar'}
- * ]
- * });
- */
- Manager.registerPostprocessor('alias', function(name, cls, data) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(name, 'Ext.ClassManager#aliasPostProcessor', arguments);
- }
- /* eslint-disable-next-line vars-on-top */
- var aliases = Ext.Array.from(data.alias),
- i, ln;
- for (i = 0 , ln = aliases.length; i < ln; i++) {
- alias = aliases[i];
- this.addAlias(cls, alias);
- }
- }, [
- 'xtype',
- 'alias'
- ]);
- /**
- * @cfg {Boolean} singleton
- * @member Ext.Class
- * When set to true, the class will be instantiated as singleton. For example:
- *
- * Ext.define('Logger', {
- * singleton: true,
- * log: function(msg) {
- * console.log(msg);
- * }
- * });
- *
- * Logger.log('Hello');
- */
- Manager.registerPostprocessor('singleton', function(name, cls, data, fn) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(name, 'Ext.ClassManager#singletonPostProcessor', arguments);
- }
- if (data.singleton) {
- fn.call(this, name, new cls(), data);
- } else {
- return true;
- }
- return false;
- });
- /**
- * @cfg {String/String[]} alternateClassName
- * @member Ext.Class
- * Defines alternate names for this class. For example:
- *
- * Ext.define('Developer', {
- * alternateClassName: ['Coder', 'Hacker'],
- * code: function(msg) {
- * alert('Typing... ' + msg);
- * }
- * });
- *
- * var joe = Ext.create('Developer');
- * joe.code('stackoverflow');
- *
- * var rms = Ext.create('Hacker');
- * rms.code('hack hack');
- */
- Manager.registerPostprocessor('alternateClassName', function(name, cls, data) {
- var alternates = data.alternateClassName,
- i, ln, alternate;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(name, 'Ext.ClassManager#alternateClassNamePostprocessor', arguments);
- }
- if (!(alternates instanceof Array)) {
- alternates = [
- alternates
- ];
- }
- for (i = 0 , ln = alternates.length; i < ln; i++) {
- alternate = alternates[i];
- if (typeof alternate !== 'string') {
- throw new Error("[Ext.define] Invalid alternate of: '" + alternate + "' for class: '" + name + "'; must be a valid string");
- }
- this.set(alternate, cls);
- }
- });
- /**
- * @cfg {Object} debugHooks
- * A collection of diagnostic methods to decorate the real methods of the class. These
- * methods are applied as an `override` if this class has debug enabled as defined by
- * `Ext.isDebugEnabled`.
- *
- * These will be automatically removed by the Sencha Cmd compiler for production builds.
- *
- * Example usage:
- *
- * Ext.define('Foo.bar.Class', {
- * foo: function(a, b, c) {
- * ...
- * },
- *
- * bar: function(a, b) {
- * ...
- * return 42;
- * },
- *
- * debugHooks: {
- * foo: function(a, b, c) {
- * // check arguments...
- * return this.callParent(arguments);
- * }
- * }
- * });
- *
- * If you specify a `$enabled` property in the `debugHooks` object that will be used
- * as the default enabled state for the hooks. If the `{@link Ext#manifest}` contains
- * a `debug` object of if `{@link Ext#debugConfig}` is specified, the `$enabled` flag
- * will override its "*" value.
- */
- Manager.registerPostprocessor('debugHooks', function(name, Class, data) {
- var target;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#debugHooks', arguments);
- }
- if (Ext.isDebugEnabled(Class.$className, data.debugHooks.$enabled)) {
- delete data.debugHooks.$enabled;
- Ext.override(Class, data.debugHooks);
- }
- // may already have an instance here in the case of singleton
- target = Class.isInstance ? Class.self : Class;
- delete target.prototype.debugHooks;
- });
- /**
- * @cfg {Object} deprecated
- * The object given has properties that describe the versions at which the deprecations
- * apply.
- *
- * The purpose of the `deprecated` declaration is to enable development mode to give
- * suitable error messages when deprecated methods or properties are used. Methods can
- * always be injected to provide this feedback, but properties can only be handled on
- * some browsers (those that support `Object.defineProperty`).
- *
- * In some cases, deprecated methods can be restored to their previous behavior or
- * added back if they have been removed.
- *
- * The structure of a `deprecated` declaration is this:
- *
- * Ext.define('Foo.bar.Class', {
- * ...
- *
- * deprecated: {
- * // Optional package name - default is the framework (ext or touch)
- * name: 'foobar',
- *
- * '5.0': {
- * methods: {
- * // Throws: '"removedMethod" is deprecated.'
- * removedMethod: null,
- *
- * // Throws: '"oldMethod" is deprecated. Please use "newMethod" instead.'
- * oldMethod: 'newMethod',
- *
- * // When this block is enabled, this method is applied as an
- * // override. Otherwise you get same as "removeMethod".
- * method: function() {
- * // Do what v5 "method" did. If "method" exists in newer
- * // versions callParent can call it. If 5.1 has "method"
- * // then it would be next in line, otherwise 5.2 and last
- * // would be the current class.
- * },
- *
- * moreHelpful: {
- * message: 'Something helpful to do instead.',
- * fn: function() {
- * // The v5 "moreHelpful" method to use when enabled.
- * }
- * }
- * },
- * properties: {
- * // Throws: '"removedProp" is deprecated.'
- * removedProp: null,
- *
- * // Throws: '"oldProp" is deprecated. Please use "newProp" instead.'
- * oldProp: 'newProp',
- *
- * helpful: {
- * message: 'Something helpful message about what to do.'
- * }
- * ...
- * },
- * statics: {
- * methods: {
- * ...
- * },
- * properties: {
- * ...
- * },
- * }
- * },
- *
- * '5.1': {
- * ...
- * },
- *
- * '5.2': {
- * ...
- * }
- * }
- * });
- *
- * The primary content of `deprecated` are the version number keys. These indicate
- * a version number where methods or properties were deprecated. These versions are
- * compared to the version reported by `Ext.getCompatVersion` to determine the action
- * to take for each "block".
- *
- * When the compatibility version is set to a value less than a version number key,
- * that block is said to be "enabled". For example, if a method was deprecated in
- * version 5.0 but the desired compatibility level is 4.2 then the block is used to
- * patch methods and (to some degree) restore pre-5.0 compatibility.
- *
- * When multiple active blocks have the same method name, each method is applied as
- * an override in reverse order of version. In the above example, if a method appears
- * in the "5.0", "5.1" and "5.2" blocks then the "5.2" method is applied as an override
- * first, followed by the "5.1" method and finally the "5.0" method. This means that
- * the `callParent` from the "5.0" method calls the "5.1" method which calls the
- * "5.2" method which can (if applicable) call the current version.
- */
- Manager.registerPostprocessor('deprecated', function(name, Class, data) {
- var target;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(Class, 'Ext.Class#deprecated', arguments);
- }
- // may already have an instance here in the case of singleton
- target = Class.isInstance ? Class.self : Class;
- target.addDeprecations(data.deprecated);
- delete target.prototype.deprecated;
- });
- Ext.apply(Ext, {
- /**
- * Instantiate a class by either full name, alias or alternate name.
- *
- * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class has
- * not been defined yet, it will attempt to load the class via synchronous loading.
- *
- * For example, all these three lines return the same result:
- *
- * // xtype
- * var window = Ext.create({
- * xtype: 'window',
- * width: 600,
- * height: 800,
- * ...
- * });
- *
- * // alias
- * var window = Ext.create('widget.window', {
- * width: 600,
- * height: 800,
- * ...
- * });
- *
- * // alternate name
- * var window = Ext.create('Ext.Window', {
- * width: 600,
- * height: 800,
- * ...
- * });
- *
- * // full class name
- * var window = Ext.create('Ext.window.Window', {
- * width: 600,
- * height: 800,
- * ...
- * });
- *
- * // single object with xclass property:
- * var window = Ext.create({
- * xclass: 'Ext.window.Window', // any valid value for 'name' (above)
- * width: 600,
- * height: 800,
- * ...
- * });
- *
- * @param {String} [name] The class name or alias. Can be specified as `xclass`
- * property if only one object parameter is specified.
- * @param {Object...} [args] Additional arguments after the name will be passed to
- * the class' constructor.
- * @return {Object} instance
- * @member Ext
- * @method create
- */
- create: function() {
- var name = arguments[0],
- nameType = typeof name,
- args = arraySlice.call(arguments, 1),
- cls;
- if (nameType === 'function') {
- cls = name;
- } else {
- if (nameType !== 'string' && args.length === 0) {
- args = [
- name
- ];
- if (!(name = name.xclass)) {
- name = args[0].xtype;
- if (name) {
- name = 'widget.' + name;
- }
- }
- }
- if (typeof name !== 'string' || name.length < 1) {
- throw new Error("[Ext.create] Invalid class name or alias '" + name + "' specified, must be a non-empty string");
- }
- name = Manager.resolveName(name);
- cls = Manager.get(name);
- }
- // Still not existing at this point, try to load it via synchronous mode as the last
- // resort
- if (!cls) {
- Ext.syncRequire(name);
- cls = Manager.get(name);
- }
- if (!cls) {
- throw new Error("[Ext.create] Unrecognized class name / alias: " + name);
- }
- if (typeof cls !== 'function') {
- throw new Error("[Ext.create] Singleton '" + name + "' cannot be instantiated.");
- }
- return Manager.getInstantiator(args.length)(cls, args);
- },
- /**
- * Convenient shorthand to create a widget by its xtype or a config object.
- *
- * var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button');
- *
- * var panel = Ext.widget('panel', { // Equivalent to Ext.create('widget.panel')
- * title: 'Panel'
- * });
- *
- * var grid = Ext.widget({
- * xtype: 'grid',
- * ...
- * });
- *
- * If a {@link Ext.Component component} instance is passed, it is simply returned.
- *
- * @member Ext
- * @param {String} [name] The xtype of the widget to create.
- * @param {Object} [config] The configuration object for the widget constructor.
- * @return {Object} The widget instance
- */
- widget: function(name, config) {
- // forms:
- // 1: (xtype)
- // 2: (xtype, config)
- // 3: (config)
- // 4: (xtype, component)
- // 5: (component)
- //
- var xtype = name,
- alias, className, T;
- if (typeof xtype !== 'string') {
- // if (form 3 or 5)
- // first arg is config or component
- config = name;
- // arguments[0]
- xtype = config.xtype;
- className = config.xclass;
- } else {
- config = config || {};
- }
- if (config.isComponent) {
- return config;
- }
- if (!className) {
- alias = 'widget.' + xtype;
- className = Manager.getNameByAlias(alias);
- }
- // this is needed to support demand loading of the class
- if (className) {
- T = Manager.get(className);
- }
- if (!T) {
- return Ext.create(className || alias, config);
- }
- return new T(config);
- },
- /**
- * @method createByAlias
- * @inheritdoc Ext.ClassManager#method-instantiateByAlias
- * @member Ext
- */
- createByAlias: alias(Manager, 'instantiateByAlias'),
- /**
- * Defines a class or override. A basic class is defined like this:
- *
- * Ext.define('My.awesome.Class', {
- * someProperty: 'something',
- *
- * someMethod: function(s) {
- * alert(s + this.someProperty);
- * }
- *
- * ...
- * });
- *
- * var obj = new My.awesome.Class();
- *
- * obj.someMethod('Say '); // alerts 'Say something'
- *
- * To create an anonymous class, pass `null` for the `className`:
- *
- * Ext.define(null, {
- * constructor: function() {
- * // ...
- * }
- * });
- *
- * In some cases, it is helpful to create a nested scope to contain some private
- * properties. The best way to do this is to pass a function instead of an object
- * as the second parameter. This function will be called to produce the class
- * body:
- *
- * Ext.define('MyApp.foo.Bar', function() {
- * var id = 0;
- *
- * return {
- * nextId: function() {
- * return ++id;
- * }
- * };
- * });
- *
- * _Note_ that when using override, the above syntax will not override successfully,
- * because the passed function would need to be executed first to determine whether or not
- * the result is an override or defining a new object. As such, an alternative syntax that
- * immediately invokes the function can be used:
- *
- * Ext.define('MyApp.override.BaseOverride', function() {
- * var counter = 0;
- *
- * return {
- * override: 'Ext.Component',
- * logId: function() {
- * console.log(++counter, this.id);
- * }
- * };
- * }());
- *
- *
- * When using this form of `Ext.define`, the function is passed a reference to its
- * class. This can be used as an efficient way to access any static properties you
- * may have:
- *
- * Ext.define('MyApp.foo.Bar', function(Bar) {
- * return {
- * statics: {
- * staticMethod: function() {
- * // ...
- * }
- * },
- *
- * method: function() {
- * return Bar.staticMethod();
- * }
- * };
- * });
- *
- * To define an override, include the `override` property. The content of an
- * override is aggregated with the specified class in order to extend or modify
- * that class. This can be as simple as setting default property values or it can
- * extend and/or replace methods. This can also extend the statics of the class.
- *
- * One use for an override is to break a large class into manageable pieces.
- *
- * // File: /src/app/Panel.js
- *
- * Ext.define('My.app.Panel', {
- * extend: 'Ext.panel.Panel',
- * requires: [
- * 'My.app.PanelPart2',
- * 'My.app.PanelPart3'
- * ]
- *
- * constructor: function(config) {
- * this.callParent(arguments); // calls Ext.panel.Panel's constructor
- * //...
- * },
- *
- * statics: {
- * method: function() {
- * return 'abc';
- * }
- * }
- * });
- *
- * // File: /src/app/PanelPart2.js
- * Ext.define('My.app.PanelPart2', {
- * override: 'My.app.Panel',
- *
- * constructor: function(config) {
- * this.callParent(arguments); // calls My.app.Panel's constructor
- * //...
- * }
- * });
- *
- * Another use of overrides is to provide optional parts of classes that can be
- * independently required. In this case, the class may even be unaware of the
- * override altogether.
- *
- * Ext.define('My.ux.CoolTip', {
- * override: 'Ext.tip.ToolTip',
- *
- * constructor: function(config) {
- * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
- * //...
- * }
- * });
- *
- * The above override can now be required as normal.
- *
- * Ext.define('My.app.App', {
- * requires: [
- * 'My.ux.CoolTip'
- * ]
- * });
- *
- * Overrides can also contain statics, inheritableStatics, or privates:
- *
- * Ext.define('My.app.BarMod', {
- * override: 'Ext.foo.Bar',
- *
- * statics: {
- * method: function(x) {
- * return this.callParent([x * 2]); // call Ext.foo.Bar.method
- * }
- * }
- * });
- *
- * Starting in version 4.2.2, overrides can declare their `compatibility` based
- * on the framework version or on versions of other packages. For details on the
- * syntax and options for these checks, see `Ext.checkVersion`.
- *
- * The simplest use case is to test framework version for compatibility:
- *
- * Ext.define('App.overrides.grid.Panel', {
- * override: 'Ext.grid.Panel',
- *
- * compatibility: '4.2.2', // only if framework version is 4.2.2
- *
- * //...
- * });
- *
- * An array is treated as an OR, so if any specs match, the override is
- * compatible.
- *
- * Ext.define('App.overrides.some.Thing', {
- * override: 'Foo.some.Thing',
- *
- * compatibility: [
- * '4.2.2',
- * 'foo@1.0.1-1.0.2'
- * ],
- *
- * //...
- * });
- *
- * To require that all specifications match, an object can be provided:
- *
- * Ext.define('App.overrides.some.Thing', {
- * override: 'Foo.some.Thing',
- *
- * compatibility: {
- * and: [
- * '4.2.2',
- * 'foo@1.0.1-1.0.2'
- * ]
- * },
- *
- * //...
- * });
- *
- * Because the object form is just a recursive check, these can be nested:
- *
- * Ext.define('App.overrides.some.Thing', {
- * override: 'Foo.some.Thing',
- *
- * compatibility: {
- * and: [
- * '4.2.2', // exactly version 4.2.2 of the framework *AND*
- * {
- * // either (or both) of these package specs:
- * or: [
- * 'foo@1.0.1-1.0.2',
- * 'bar@3.0+'
- * ]
- * }
- * ]
- * },
- *
- * //...
- * });
- *
- * IMPORTANT: An override is only included in a build if the class it overrides is
- * required. Otherwise, the override, like the target class, is not included. In
- * Sencha Cmd v4, the `compatibility` declaration can likewise be used to remove
- * incompatible overrides from a build.
- *
- * @param {String} className The class name to create in string dot-namespaced format,
- * for example: 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
- *
- * It is highly recommended to follow this simple convention:
- * - The root and the class name are 'CamelCased'
- * - Everything else is lower-cased
- * Pass `null` to create an anonymous class.
- * @param {Object} data The key - value pairs of properties to apply to this class.
- * Property names can be of any valid strings, except those in the reserved listed below:
- *
- * - {@link Ext.Class#cfg-alias alias}
- * - {@link Ext.Class#cfg-alternateClassName alternateClassName}
- * - {@link Ext.Class#cfg-cachedConfig cachedConfig}
- * - {@link Ext.Class#cfg-config config}
- * - {@link Ext.Class#cfg-extend extend}
- * - {@link Ext.Class#cfg-inheritableStatics inheritableStatics}
- * - {@link Ext.Class#cfg-mixins mixins}
- * - {@link Ext.Class#cfg-override override}
- * - {@link Ext.Class#cfg-platformConfig platformConfig}
- * - {@link Ext.Class#cfg-privates privates}
- * - {@link Ext.Class#cfg-requires requires}
- * - `self`
- * - {@link Ext.Class#cfg-singleton singleton}
- * - {@link Ext.Class#cfg-statics statics}
- * - {@link Ext.Class#cfg-uses uses}
- * - {@link Ext.Class#cfg-xtype xtype} (for {@link Ext.Component Components} only)
- *
- * @param {Function} [createdFn] Callback to execute after the class is created,
- * the execution scope of which (`this`) will be the newly created class itself.
- * @return {Ext.Base}
- * @member Ext
- */
- define: function(className, data, createdFn) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(className, 'ClassManager#define', arguments);
- }
- if (data.override) {
- Manager.classState[className] = 20;
- return Manager.createOverride.apply(Manager, arguments);
- }
- Manager.classState[className] = 10;
- return Manager.create.apply(Manager, arguments);
- },
- /**
- * Undefines a class defined using the #define method. Typically used
- * for unit testing where setting up and tearing down a class multiple
- * times is required. For example:
- *
- * // define a class
- * Ext.define('Foo', {
- * ...
- * });
- *
- * // run test
- *
- * // undefine the class
- * Ext.undefine('Foo');
- * @param {String} className The class name to undefine in string dot-namespaced format.
- * @private
- */
- undefine: function(className) {
- var classes = Manager.classes;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(className, 'Ext.ClassManager#undefine', arguments);
- }
- if (classes[className]) {
- Manager.classCount--;
- }
- delete classes[className];
- delete Manager.existCache[className];
- delete Manager.classState[className];
- Manager.removeName(className);
- // Indiscriminately clear all factory caches here. It might be slightly inefficient
- // however undefine is typically only called during unit testing.
- Ext.Factory.clearCaches();
- /* eslint-disable-next-line vars-on-top */
- var entry = Manager.getNamespaceEntry(className),
- scope = entry.parent ? Manager.lookupName(entry.parent, false) : Ext.global,
- entryName;
- if (scope) {
- entryName = entry.name;
- // Old IE blows up on attempt to delete window property
- try {
- delete scope[entryName];
- } catch (e) {
- scope[entryName] = undefined;
- }
- }
- // We need to know entry name in unit tests
- return entryName;
- },
- /**
- * @method getClassName
- * @inheritdoc Ext.ClassManager#method-getName
- * @member Ext
- */
- getClassName: alias(Manager, 'getName'),
- /**
- * Returns the displayName property or className or object. When all else fails,
- * returns "Anonymous".
- * @param {Object} object
- * @return {String}
- */
- getDisplayName: function(object) {
- if (object) {
- if (object.displayName) {
- return object.displayName;
- }
- if (object.$name && object.$class) {
- return Ext.getClassName(object.$class) + '#' + object.$name;
- }
- if (object.$className) {
- return object.$className;
- }
- }
- return 'Anonymous';
- },
- /**
- * @method getClass
- * @inheritdoc Ext.ClassManager#method-getClass
- * @member Ext
- */
- getClass: alias(Manager, 'getClass'),
- /**
- * Creates namespaces to be used for scoping variables and classes so that they are not
- * global. Specifying the last node of a namespace implicitly creates all other nodes.
- * Usage:
- *
- * Ext.namespace('Company', 'Company.data');
- *
- * // equivalent and preferable to the above syntax
- * Ext.ns('Company.data');
- *
- * Company.Widget = function() { ... };
- *
- * Company.data.CustomStore = function(config) { ... };
- *
- * @param {String...} namespaces
- * @return {Object} The (last) namespace object created.
- * @member Ext
- * @method namespace
- */
- namespace: function() {
- var root = global,
- i;
- for (i = arguments.length; i-- > 0; ) {
- root = Manager.lookupName(arguments[i], true);
- }
- return root;
- }
- });
- /**
- * This function registers top-level (root) namespaces. This is needed for "sandbox"
- * builds.
- *
- * Ext.addRootNamespaces({
- * MyApp: MyApp,
- * Common: Common
- * });
- *
- * In the above example, `MyApp` and `Common` are top-level namespaces that happen
- * to also be included in the sandbox closure. Something like this:
- *
- * (function(Ext) {
- *
- * Ext.sandboxName = 'Ext6';
- * Ext.isSandboxed = true;
- * Ext.buildSettings = { baseCSSPrefix: "x6-", scopeResetCSS: true };
- *
- * var MyApp = MyApp || {};
- * Ext.addRootNamespaces({ MyApp: MyApp );
- *
- * ... normal app.js goes here ...
- *
- * })(this.Ext6 || (this.Ext6 = {}));
- *
- * The sandbox wrapper around the normally built `app.js` content has to take care
- * of introducing top-level namespaces as well as call this method.
- *
- * @param {Object} namespaces
- * @method addRootNamespaces
- * @member Ext
- * @since 6.0.0
- * @private
- */
- Ext.addRootNamespaces = Manager.addRootNamespaces;
- /**
- * Old name for {@link Ext#widget}.
- * @deprecated 5.0 Use {@link Ext#widget} instead.
- * @method createWidget
- * @member Ext
- * @private
- */
- Ext.createWidget = Ext.widget;
- /**
- * @method ns
- * Convenient alias for {@link Ext#namespace Ext.namespace}.
- * @inheritdoc Ext#method-namespace
- * @member Ext
- */
- Ext.ns = Ext.namespace;
- Class.registerPreprocessor('className', function(cls, data) {
- if ('$className' in data) {
- cls.$className = data.$className;
- cls.displayName = cls.$className;
- }
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(cls, 'Ext.ClassManager#classNamePreprocessor', arguments);
- }
- }, true, 'first');
- Class.registerPreprocessor('alias', function(cls, data) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor', arguments);
- }
- /* eslint-disable-next-line vars-on-top */
- var prototype = cls.prototype,
- xtypes = arrayFrom(data.xtype),
- aliases = arrayFrom(data.alias),
- widgetPrefix = 'widget.',
- widgetPrefixLength = widgetPrefix.length,
- xtypesChain = Array.prototype.slice.call(prototype.xtypesChain || []),
- xtypesMap = Ext.merge({}, prototype.xtypesMap || {}),
- i, ln, alias, xtype;
- for (i = 0 , ln = aliases.length; i < ln; i++) {
- alias = aliases[i];
- if (typeof alias !== 'string' || alias.length < 1) {
- throw new Error("[Ext.define] Invalid alias of: '" + alias + "' for class: '" + name + "'; must be a valid string");
- }
- if (alias.substring(0, widgetPrefixLength) === widgetPrefix) {
- xtype = alias.substring(widgetPrefixLength);
- Ext.Array.include(xtypes, xtype);
- }
- }
- cls.xtype = data.xtype = xtypes[0];
- data.xtypes = xtypes;
- for (i = 0 , ln = xtypes.length; i < ln; i++) {
- xtype = xtypes[i];
- if (!xtypesMap[xtype]) {
- xtypesMap[xtype] = true;
- xtypesChain.push(xtype);
- }
- }
- data.xtypesChain = xtypesChain;
- data.xtypesMap = xtypesMap;
- // Class is already extended at this point
- Ext.Function.interceptAfterOnce(cls, 'onClassCreated', function() {
- var cls = this,
- prototype = cls.prototype,
- mixins = prototype.mixins,
- key, mixin;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor#afterClassCreated', arguments);
- }
- for (key in mixins) {
- if (mixins.hasOwnProperty(key)) {
- mixin = mixins[key];
- xtypes = mixin.xtypes;
- if (xtypes) {
- for (i = 0 , ln = xtypes.length; i < ln; i++) {
- xtype = xtypes[i];
- if (!xtypesMap[xtype]) {
- xtypesMap[xtype] = true;
- xtypesChain.push(xtype);
- }
- }
- }
- }
- }
- });
- for (i = 0 , ln = xtypes.length; i < ln; i++) {
- xtype = xtypes[i];
- if (typeof xtype !== 'string' || xtype.length < 1) {
- throw new Error("[Ext.define] Invalid xtype of: '" + xtype + "' for class: '" + name + "'; must be a valid non-empty string");
- }
- Ext.Array.include(aliases, widgetPrefix + xtype);
- }
- data.alias = aliases;
- }, [
- 'xtype',
- 'alias'
- ]);
- // load the cmd-5 style app manifest metadata now, if available...
- if (Ext.manifest) {
- /* eslint-disable-next-line vars-on-top */
- var manifest = Ext.manifest,
- classes = manifest.classes,
- paths = manifest.paths,
- aliases = {},
- alternates = {},
- className, obj, name, path, baseUrl;
- if (paths) {
- // if the manifest paths were calculated as relative to the
- // bootstrap file, then we need to prepend Boot.baseUrl to the
- // paths before processing
- if (manifest.bootRelative) {
- baseUrl = Ext.Boot.baseUrl;
- for (path in paths) {
- if (paths.hasOwnProperty(path)) {
- paths[path] = baseUrl + paths[path];
- }
- }
- }
- Manager.setPath(paths);
- }
- if (classes) {
- for (className in classes) {
- alternates[className] = [];
- aliases[className] = [];
- obj = classes[className];
- if (obj.alias) {
- aliases[className] = obj.alias;
- }
- if (obj.alternates) {
- alternates[className] = obj.alternates;
- }
- }
- }
- Manager.addAlias(aliases);
- Manager.addAlternate(alternates);
- }
- return Manager;
- }(Ext.Class, Ext.Function.alias, Array.prototype.slice, Ext.Array.from, Ext.global));
- // @tag class
- /**
- *
- * @since 6.7.0
- * @private
- */
- Ext.define('Ext.mixin.Watchable', {
- on: function(name, fn, scope) {
- return this._watchUpdate(false, '_watchAdd', name, fn, scope);
- },
- fire: function(event, args) {
- var me = this,
- watching = me.watching,
- watchers = watching && watching[event],
- fn, i, r, scope;
- if (watchers) {
- ++watchers.$firing;
- for (i = 0; i < watchers.length; ++i) {
- scope = watchers[i][0];
- fn = watchers[i][1];
- if (fn.charAt) {
- r = args ? scope[fn].apply(scope, args) : scope[fn]();
- } else {
- r = args ? fn.apply(scope, args) : fn.call(scope);
- }
- if (r === false) {
- return r;
- }
- }
- --watchers.$firing;
- }
- },
- fireEvent: function() {
- var args = Ext.Array.slice(arguments),
- event = args.shift();
- return this.fire(event, args);
- },
- un: function(name, fn, scope) {
- return this._watchUpdate(true, '_watchRemove', name, fn, scope);
- },
- privates: {
- watching: null,
- $watchOptions: {
- destroyable: 1,
- scope: 1
- },
- _watchAdd: function(watching, name, fn, scope, destroyable) {
- if (typeof fn === 'string' && !scope[fn]) {
- Ext.raise('No such method "' + fn + '" on ' + scope.$className);
- }
- // eslint-disable-next-line vars-on-top
- var watchers = watching[name],
- entry = [
- scope,
- fn
- ],
- i, ent;
- if (!watchers) {
- watching[name] = watchers = [];
- watchers.$firing = 0;
- } else {
- // If the scope/fn pair is already registered, don't duplicate it.
- for (i = watchers.length; i-- > 0; ) /* empty */
- {
- ent = watchers[i];
- if (fn === ent[1]) {
- if (scope ? ent[0] === scope : !ent[0]) {
- return;
- }
- }
- }
- if (watchers.$firing) {
- watching[name] = watchers = watchers.slice();
- watchers.$firing = 0;
- }
- }
- watchers.push(entry);
- if (destroyable) {
- entry.push(name);
- destroyable.items.push(entry);
- }
- },
- _watchRemove: function(watching, name, fn, scope) {
- var watchers = watching[name],
- i;
- if (watchers) {
- if (watchers.$firing) {
- watching[name] = watchers = watchers.slice();
- watchers.$firing = 0;
- }
- for (i = watchers.length; i-- > 0; ) /* empty */
- {
- if (watchers[i][0] === scope && watchers[i][1] === fn) {
- watchers.splice(i, 1);
- }
- }
- }
- },
- _watchUpdate: function(remove, process, name, fn, scope) {
- var me = this,
- watch = name,
- watching = me.watching,
- destroyable;
- if (!watching) {
- if (remove) {
- return;
- }
- me.watching = watching = {};
- }
- if (typeof name === 'string') {
- me[process](watching, name, fn, scope);
- } else {
- destroyable = watch.destroyable ? {
- owner: me,
- items: [],
- destroy: me._watcherDestroyer
- } : null;
- scope = watch.scope;
- for (name in watch) {
- if (!me.$watchOptions[name]) {
- me[process](watching, name, watch[name], scope, destroyable);
- }
- }
- }
- return destroyable;
- },
- _watcherDestroyer: function() {
- var me = this.owner,
- watching = me.watching,
- items = this.items,
- entry, i;
- for (i = 0; i < items.length; ++i) {
- entry = items[i];
- me._watchRemove(watching, entry[2], entry[1], entry[0]);
- }
- }
- }
- });
- /**
- * @class Ext.env.Browser
- * Provides information about browser.
- *
- * Should not be manually instantiated unless for unit-testing.
- * Access the global instance stored in {@link Ext.browser} instead.
- * @private
- */
- (Ext.env || (Ext.env = {})).Browser = function(userAgent, publish) {
- // @define Ext.env.Browser
- // @define Ext.browser
- // @require Ext.Object
- // @require Ext.Version
- var me = this,
- browserPrefixes = Ext.Boot.browserPrefixes,
- browserNames = Ext.Boot.browserNames,
- enginePrefixes = me.enginePrefixes,
- engineNames = me.engineNames,
- browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')),
- engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')),
- browserName = browserNames.other,
- engineName = engineNames.other,
- browserVersion = '',
- engineVersion = '',
- majorVer = '',
- isWebView = false,
- edgeRE = /(Edge\/)([\w.]+)/,
- ripple = '',
- i, prefix, name;
- /**
- * @property {String}
- * Browser User Agent string.
- */
- me.userAgent = userAgent;
- /**
- * A "hybrid" property, can be either accessed as a method call, for example:
- *
- * if (Ext.browser.is('IE')) {
- * // ...
- * }
- *
- * Or as an object with Boolean properties, for example:
- *
- * if (Ext.browser.is.IE) {
- * // ...
- * }
- *
- * Versions can be conveniently checked as well. For example:
- *
- * if (Ext.browser.is.IE10) {
- * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(10))
- * }
- *
- * __Note:__ Only {@link Ext.Version#getMajor major component} and
- * {@link Ext.Version#getShortVersion simplified} value of the version are available via
- * direct property checking.
- *
- * Supported values are:
- *
- * - IE
- * - Firefox
- * - Safari
- * - Chrome
- * - Opera
- * - WebKit
- * - Gecko
- * - Presto
- * - Trident
- * - WebView
- * - Other
- *
- * @param {String} name The OS name to check.
- * @return {Boolean}
- */
- this.is = function(name) {
- // Since this function reference also acts as a map, we do not want it to be
- // shared between instances, so it is defined here, not on the prototype.
- return !!this.is[name];
- };
- // Edge has a userAgent with All browsers so we manage it separately
- // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
- // Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
- if (/Edge\//.test(userAgent)) {
- browserMatch = userAgent.match(edgeRE);
- engineMatch = userAgent.match(edgeRE);
- }
- if (browserMatch) {
- browserName = browserNames[Ext.Object.getKey(browserPrefixes, browserMatch[1])];
- if (browserName === 'Safari' && /^Opera/.test(userAgent)) {
- // Prevent Opera 12 and earlier from being incorrectly reported as Safari
- browserName = 'Opera';
- }
- browserVersion = new Ext.Version(browserMatch[2]);
- }
- if (engineMatch) {
- engineName = engineNames[Ext.Object.getKey(enginePrefixes, engineMatch[1])];
- engineVersion = new Ext.Version(engineMatch[2]);
- }
- if (engineName === 'Trident' && browserName !== 'IE') {
- browserName = 'IE';
- var version = userAgent.match(/.*rv:(\d+.\d+)/);
- // eslint-disable-line vars-on-top
- if (version && version.length) {
- version = version[1];
- browserVersion = new Ext.Version(version);
- }
- }
- if (browserName && browserVersion) {
- Ext.setVersion(browserName, browserVersion);
- }
- /**
- * @property chromeVersion
- * The current version of Chrome (0 if the browser is not Chrome).
- * @readonly
- * @type Number
- * @member Ext
- */
- /**
- * @property firefoxVersion
- * The current version of Firefox (0 if the browser is not Firefox).
- * @readonly
- * @type Number
- * @member Ext
- */
- /**
- * @property ieVersion
- * The current version of IE (0 if the browser is not IE). This does not account
- * for the documentMode of the current page, which is factored into {@link #isIE8},
- * and {@link #isIE9}. Thus this is not always true:
- *
- * Ext.isIE8 == (Ext.ieVersion == 8)
- *
- * @readonly
- * @type Number
- * @member Ext
- */
- /**
- * @property isChrome
- * True if the detected browser is Chrome.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isGecko
- * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE
- * True if the detected browser is Internet Explorer.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE8
- * True if the detected browser is Internet Explorer 8.x.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE8m
- * True if the detected browser is Internet Explorer 8.x or lower.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE8p
- * True if the detected browser is Internet Explorer 8.x or higher.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE9
- * True if the detected browser is Internet Explorer 9.x.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE9m
- * True if the detected browser is Internet Explorer 9.x or lower.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE9p
- * True if the detected browser is Internet Explorer 9.x or higher.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE10
- * True if the detected browser is Internet Explorer 10.x.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE10m
- * True if the detected browser is Internet Explorer 10.x or lower.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE10p
- * True if the detected browser is Internet Explorer 10.x or higher.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE11
- * True if the detected browser is Internet Explorer 11.x.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE11m
- * True if the detected browser is Internet Explorer 11.x or lower.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isIE11p
- * True if the detected browser is Internet Explorer 11.x or higher.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isEdge
- * True if the detected browser is Edge.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isLinux
- * True if the detected platform is Linux.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isMac
- * True if the detected platform is Mac OS.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isOpera
- * True if the detected browser is Opera.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isSafari
- * True if the detected browser is Safari.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isWebKit
- * True if the detected browser uses WebKit.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property isWindows
- * True if the detected platform is Windows.
- * @readonly
- * @type Boolean
- * @member Ext
- */
- /**
- * @property operaVersion
- * The current version of Opera (0 if the browser is not Opera).
- * @readonly
- * @type Number
- * @member Ext
- */
- /**
- * @property safariVersion
- * The current version of Safari (0 if the browser is not Safari).
- * @readonly
- * @type Number
- * @member Ext
- */
- /**
- * @property webKitVersion
- * The current version of WebKit (0 if the browser does not use WebKit).
- * @readonly
- * @type Number
- * @member Ext
- */
- // Facebook changes the userAgent when you view a website within their iOS app.
- // For some reason, the strip out information about the browser, so we have to detect
- // that and fake it...
- if (userAgent.match(/FB/) && browserName === 'Other') {
- browserName = browserNames.safari;
- engineName = engineNames.webkit;
- }
- // Detect chrome first as Chrome in Android 8.0 introduced OPR in the user agent
- else if (userAgent.match(/Android.*Chrome/g)) {
- browserName = 'ChromeMobile';
- } else {
- browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
- if (browserMatch) {
- browserName = 'Opera';
- browserVersion = new Ext.Version(browserMatch[1]);
- }
- }
- Ext.apply(this, {
- engineName: engineName,
- engineVersion: engineVersion,
- name: browserName,
- version: browserVersion
- });
- this.setFlag(browserName, true, publish);
- // e.g., Ext.isIE
- if (browserVersion) {
- majorVer = browserVersion.getMajor() || '';
- if (me.is.IE) {
- majorVer = document.documentMode || parseInt(majorVer, 10);
- for (i = 7; i <= 11; ++i) {
- prefix = 'isIE' + i;
- Ext[prefix] = majorVer === i;
- Ext[prefix + 'm'] = majorVer <= i;
- Ext[prefix + 'p'] = majorVer >= i;
- }
- }
- if (me.is.Opera && parseInt(majorVer, 10) <= 12) {
- Ext.isOpera12m = true;
- }
- Ext.chromeVersion = Ext.isChrome ? majorVer : 0;
- Ext.firefoxVersion = Ext.isFirefox ? majorVer : 0;
- Ext.ieVersion = Ext.isIE ? majorVer : 0;
- Ext.operaVersion = Ext.isOpera ? majorVer : 0;
- Ext.safariVersion = Ext.isSafari ? majorVer : 0;
- Ext.webKitVersion = Ext.isWebKit ? majorVer : 0;
- this.setFlag(browserName + majorVer, true, publish);
- // Ext.isIE10
- this.setFlag(browserName + browserVersion.getShortVersion());
- }
- for (i in browserNames) {
- if (browserNames.hasOwnProperty(i)) {
- name = browserNames[i];
- this.setFlag(name, browserName === name);
- }
- }
- this.setFlag(name);
- if (engineVersion) {
- this.setFlag(engineName + (engineVersion.getMajor() || ''));
- this.setFlag(engineName + engineVersion.getShortVersion());
- }
- for (i in engineNames) {
- if (engineNames.hasOwnProperty(i)) {
- name = engineNames[i];
- this.setFlag(name, engineName === name, publish);
- }
- }
- this.setFlag('Standalone', !!navigator.standalone);
- // Cross domain access could throw an error
- try {
- ripple = window.top.ripple;
- } catch (e) {}
- // Do nothing, can't access cross frame so leave it empty
- /* eslint-disable-next-line max-len */
- this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(ripple));
- this.setFlag('WebWorks', !!window.blackberry);
- if (window.PhoneGap !== undefined || window.Cordova !== undefined || window.cordova !== undefined) {
- isWebView = true;
- this.setFlag('PhoneGap');
- this.setFlag('Cordova');
- }
- // Check if running in UIWebView
- if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) {
- isWebView = true;
- }
- // Flag to check if it we are in the WebView
- this.setFlag('WebView', isWebView);
- /**
- * @property {Boolean}
- * `true` if browser is using strict mode.
- */
- this.isStrict = Ext.isStrict = document.compatMode === "CSS1Compat";
- /**
- * @property {Boolean}
- * `true` if page is running over SSL.
- */
- this.isSecure = Ext.isSecure;
- // IE10Quirks, Chrome26Strict, etc.
- this.identity = browserName + majorVer + (this.isStrict ? 'Strict' : 'Quirks');
- };
- Ext.env.Browser.prototype = {
- constructor: Ext.env.Browser,
- engineNames: {
- edge: 'Edge',
- webkit: 'WebKit',
- gecko: 'Gecko',
- presto: 'Presto',
- trident: 'Trident',
- other: 'Other'
- },
- enginePrefixes: {
- edge: 'Edge/',
- webkit: 'AppleWebKit/',
- gecko: 'Gecko/',
- presto: 'Presto/',
- trident: 'Trident/'
- },
- styleDashPrefixes: {
- WebKit: '-webkit-',
- Gecko: '-moz-',
- Trident: '-ms-',
- Presto: '-o-',
- Other: ''
- },
- stylePrefixes: {
- WebKit: 'Webkit',
- Gecko: 'Moz',
- Trident: 'ms',
- Presto: 'O',
- Other: ''
- },
- propertyPrefixes: {
- WebKit: 'webkit',
- Gecko: 'moz',
- Trident: 'ms',
- Presto: 'o',
- Other: ''
- },
- // scope: Ext.env.Browser.prototype
- /**
- * The full name of the current browser.
- * Possible values are:
- *
- * - IE
- * - Firefox
- * - Safari
- * - Chrome
- * - Opera
- * - Other
- * @type String
- * @readonly
- */
- name: null,
- /**
- * Refer to {@link Ext.Version}.
- * @type Ext.Version
- * @readonly
- */
- version: null,
- /**
- * The full name of the current browser's engine.
- * Possible values are:
- *
- * - WebKit
- * - Gecko
- * - Presto
- * - Trident
- * - Other
- * @type String
- * @readonly
- */
- engineName: null,
- /**
- * Refer to {@link Ext.Version}.
- * @type Ext.Version
- * @readonly
- */
- engineVersion: null,
- setFlag: function(name, value, publish) {
- if (value === undefined) {
- value = true;
- }
- this.is[name] = value;
- this.is[name.toLowerCase()] = value;
- if (publish) {
- Ext['is' + name] = value;
- }
- return this;
- },
- getStyleDashPrefix: function() {
- return this.styleDashPrefixes[this.engineName];
- },
- getStylePrefix: function() {
- return this.stylePrefixes[this.engineName];
- },
- getVendorProperyName: function(name) {
- var prefix = this.propertyPrefixes[this.engineName];
- if (prefix.length > 0) {
- return prefix + Ext.String.capitalize(name);
- }
- return name;
- }
- };
- /**
- * @class Ext.browser
- * @extends Ext.env.Browser
- * @singleton
- * Provides useful information about the current browser.
- *
- * Example:
- *
- * if (Ext.browser.is.IE) {
- * // IE specific code here
- * }
- *
- * if (Ext.browser.is.WebKit) {
- * // WebKit specific code here
- * }
- *
- * console.log("Version " + Ext.browser.version);
- *
- * For a full list of supported values, refer to {@link #is} property/method.
- *
- */
- (function(userAgent) {
- Ext.browser = new Ext.env.Browser(userAgent, true);
- Ext.userAgent = userAgent.toLowerCase();
- /**
- * @property {String} SSL_SECURE_URL
- * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
- * to prevent the IE insecure content warning (`'about:blank'`, except for IE
- * in secure mode, which is `'javascript:""'`).
- * @member Ext
- */
- Ext.SSL_SECURE_URL = Ext.isSecure && Ext.isIE ? 'javascript:\'\'' : 'about:blank';
- }(Ext.global.navigator.userAgent));
- /**
- * @class Ext.env.OS
- *
- * Provides information about operating system environment.
- *
- * Should not be manually instantiated unless for unit-testing.
- * Access the global instance stored in {@link Ext.os} instead.
- * @private
- */
- Ext.env.OS = function(userAgent, platform, browserScope) {
- // @define Ext.env.OS
- // @define Ext.os
- // @require Ext.Version
- // @require Ext.env.Browser
- var me = this,
- names = Ext.Boot.osNames,
- prefixes = Ext.Boot.osPrefixes,
- name,
- version = '',
- is = me.is,
- i, prefix, match, item, match1;
- browserScope = browserScope || Ext.browser;
- for (i in prefixes) {
- if (prefixes.hasOwnProperty(i)) {
- prefix = prefixes[i];
- match = userAgent.match(new RegExp('(?:' + prefix + ')([^\\s;]+)'));
- if (match) {
- name = names[i];
- match1 = match[1];
- // This is here because some HTC android devices show an OSX Snow Leopard
- // userAgent by default.
- // And the Kindle Fire doesn't have any indicator of Android as the OS in its
- // User Agent
- if (match1 && match1 === "HTC_") {
- version = new Ext.Version("2.3");
- } else if (match1 && match1 === "Silk/") {
- version = new Ext.Version("2.3");
- } else {
- version = new Ext.Version(match[match.length - 1]);
- }
- break;
- }
- }
- }
- if (!name) {
- name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || [
- 'other'
- ])[0]];
- version = new Ext.Version('');
- }
- this.name = name;
- this.version = version;
- // This is added as a workaround for Chrome iPad emulation mode
- // it will report the platform of the machine (MacIntel, Win32, etc) instead
- // of an emulated platform
- if (userAgent.match(/ipad/i)) {
- platform = 'iPad';
- }
- if (platform) {
- this.setFlag(platform.replace(/ simulator$/i, ''));
- }
- this.setFlag(name);
- if (version) {
- this.setFlag(name + (version.getMajor() || ''));
- this.setFlag(name + version.getShortVersion());
- }
- for (i in names) {
- if (names.hasOwnProperty(i)) {
- item = names[i];
- if (!is.hasOwnProperty(name)) {
- this.setFlag(item, (name === item));
- }
- }
- }
- // Detect if the device is the iPhone 5.
- if (this.name === "iOS" && window.screen.height === 568) {
- this.setFlag('iPhone5');
- }
- if (browserScope.is.Safari || browserScope.is.Silk) {
- // Ext.browser.version.shortVersion == 501 is for debugging off device
- if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion === 501) {
- browserScope.setFlag("AndroidStock");
- }
- if (this.is.Android4) {
- browserScope.setFlag("AndroidStock");
- browserScope.setFlag("AndroidStock4");
- }
- }
- };
- Ext.env.OS.prototype = {
- constructor: Ext.env.OS,
- /**
- * A "hybrid" property, can be either accessed as a method call, i.e:
- *
- * if (Ext.os.is('Android')) {
- * // ...
- * }
- *
- * or as an object with boolean properties, i.e:
- *
- * if (Ext.os.is.Android) {
- * // ...
- * }
- *
- * Versions can be conveniently checked as well. For example:
- *
- * if (Ext.os.is.Android2) {
- * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2))
- * }
- *
- * if (Ext.os.is.iOS32) {
- * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2))
- * }
- *
- * Note that only {@link Ext.Version#getMajor major component} and
- * {@link Ext.Version#getShortVersion simplified} value of the version are available
- * via direct property checking. Supported values are:
- *
- * - iOS
- * - iPad
- * - iPhone
- * - iPhone5 (also true for 4in iPods).
- * - iPod
- * - Android
- * - WebOS
- * - BlackBerry
- * - Bada
- * - MacOS
- * - Windows
- * - Linux
- * - Other
- * @member Ext.os
- * @param {String} name The OS name to check.
- * @return {Boolean}
- */
- is: function(name) {
- return !!this[name];
- },
- /**
- * @property {String} [name=null]
- * @readonly
- * @member Ext.os
- * The full name of the current operating system. Possible values are:
- *
- * - iOS
- * - Android
- * - WebOS
- * - BlackBerry,
- * - MacOS
- * - Windows
- * - Linux
- * - Other
- */
- name: null,
- /**
- * @property {Ext.Version} [version=null]
- * Refer to {@link Ext.Version}
- * @member Ext.os
- * @readonly
- */
- version: null,
- setFlag: function(name, value) {
- if (value === undefined) {
- value = true;
- }
- if (this.flags) {
- this.flags[name] = value;
- }
- this.is[name] = value;
- this.is[name.toLowerCase()] = value;
- return this;
- }
- };
- (function() {
- var navigation = Ext.global.navigator,
- userAgent = navigation.userAgent,
- OS = Ext.env.OS,
- is = (Ext.is || (Ext.is = {})),
- osEnv, osName, deviceType;
- OS.prototype.flags = is;
- /**
- * @class Ext.os
- * @extends Ext.env.OS
- * @singleton
- * Provides useful information about the current operating system environment.
- *
- * Example:
- *
- * if (Ext.os.is.Windows) {
- * // Windows specific code here
- * }
- *
- * if (Ext.os.is.iOS) {
- * // iPad, iPod, iPhone, etc.
- * }
- *
- * console.log("Version " + Ext.os.version);
- *
- * For a full list of supported values, refer to the {@link #is} property/method.
- *
- */
- Ext.os = osEnv = new OS(userAgent, navigation.platform);
- osName = osEnv.name;
- // A couple compatible flavors:
- Ext['is' + osName] = true;
- // e.g., Ext.isWindows
- Ext.isMac = is.Mac = is.MacOS;
- Ext.isApple = Ext.isMac || Ext.isiOS;
- // eslint-disable-next-line vars-on-top
- var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
- nativeDeviceType = window.deviceType;
- // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP.
- // E.g: example/kitchen-sink.html?deviceType=Phone
- if (search && search[1]) {
- deviceType = search[1];
- } else if (nativeDeviceType === 'iPhone') {
- deviceType = 'Phone';
- } else if (nativeDeviceType === 'iPad') {
- deviceType = 'Tablet';
- } else {
- if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS|ChromeOS/.test(osName)) {
- deviceType = 'Desktop';
- // always set it to false when you are on a desktop not using Ripple Emulation
- Ext.browser.is.WebView = !!Ext.browser.is.Ripple;
- } else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) === -1)) {
- deviceType = 'Tablet';
- } else {
- deviceType = 'Phone';
- }
- }
- /**
- * @property {String} deviceType
- * The generic type of the current device.
- *
- * Possible values:
- *
- * - Phone
- * - Tablet
- * - Desktop
- *
- * For testing purposes the deviceType can be overridden by adding
- * a deviceType parameter to the URL of the page, like so:
- *
- * http://localhost/mypage.html?deviceType=Tablet
- *
- * @member Ext.os
- */
- osEnv.setFlag(deviceType, true);
- osEnv.deviceType = deviceType;
- delete OS.prototype.flags;
- }());
- /**
- * @class Ext.feature
- * @singleton
- *
- * A simple class to verify if a browser feature exists or not on the current device.
- *
- * if (Ext.feature.has.Canvas) {
- * // do some cool things with canvas here
- * }
- *
- * See the {@link #has} property/method for details of the features that can be detected.
- *
- */
- /* eslint-disable vars-on-top */
- Ext.feature = {
- // @define Ext.env.Feature
- // @define Ext.feature
- // @define Ext.supports
- // @require Ext.String
- // @require Ext.env.Browser
- // @require Ext.env.OS
- /**
- * @method has
- * @member Ext.feature
- * Verifies if a browser feature exists or not on the current device.
- *
- * A "hybrid" property, can be either accessed as a method call, i.e:
- *
- * if (Ext.feature.has('Canvas')) {
- * // ...
- * }
- *
- * or as an object with boolean properties, i.e:
- *
- * if (Ext.feature.has.Canvas) {
- * // ...
- * }
- *
- * For possible properties/parameter values see `Ext.supports`.
- *
- * @param {String} name The feature name to check.
- * @return {Boolean}
- */
- has: function(name) {
- return !!this.has[name];
- },
- testElements: {},
- getTestElement: function(tag, createNew) {
- if (tag === undefined) {
- tag = 'div';
- } else if (typeof tag !== 'string') {
- return tag;
- }
- if (createNew) {
- return document.createElement(tag);
- }
- if (!this.testElements[tag]) {
- this.testElements[tag] = document.createElement(tag);
- }
- return this.testElements[tag];
- },
- isStyleSupported: function(name, tag) {
- var elementStyle = this.getTestElement(tag).style,
- cName = Ext.String.capitalize(name);
- if (typeof elementStyle[name] !== 'undefined' || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') {
- return true;
- }
- return false;
- },
- isStyleSupportedWithoutPrefix: function(name, tag) {
- var elementStyle = this.getTestElement(tag).style;
- if (typeof elementStyle[name] !== 'undefined') {
- return true;
- }
- return false;
- },
- isEventSupported: function(name, tag) {
- if (tag === undefined) {
- tag = window;
- }
- var element = this.getTestElement(tag),
- eventName = 'on' + name.toLowerCase(),
- isSupported = (eventName in element);
- if (!isSupported) {
- if (element.setAttribute && element.removeAttribute) {
- element.setAttribute(eventName, '');
- isSupported = typeof element[eventName] === 'function';
- if (typeof element[eventName] !== 'undefined') {
- element[eventName] = undefined;
- }
- element.removeAttribute(eventName);
- }
- }
- return isSupported;
- },
- // This is a local copy of certain logic from Element.getStyle
- // to break a dependancy between the supports mechanism and Element
- // use this instead of element references to check for styling info
- getStyle: function(element, styleName) {
- var view = element.ownerDocument.defaultView,
- style = (view ? view.getComputedStyle(element, null) : element.currentStyle);
- return (style || element.style)[styleName];
- },
- getSupportedPropertyName: function(object, name) {
- var vendorName = Ext.browser.getVendorProperyName(name);
- if (vendorName in object) {
- return vendorName;
- } else if (name in object) {
- return name;
- }
- return null;
- },
- /**
- * Runs feature detection routines and sets the various flags. This is called when
- * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
- * can be run immediately. Others that require the document body will not run until
- * domready (these have the `ready` flag set).
- *
- * Each test is run only once, so calling this method from an onReady function is safe
- * and ensures that all flags have been set.
- * @private
- */
- detect: function(isReady) {
- var me = this,
- doc = document,
- toRun = me.toRun || me.tests,
- n = toRun.length,
- div = doc.createElement('div'),
- notRun = [],
- supports = Ext.supports,
- has = me.has,
- name, names, test, vector, value;
- // Only the legacy browser tests use this div so clip this out if we don't need
- // to use it.
- div.innerHTML = '<div style="height:30px;width:50px;">' + '<div style="height:20px;width:20px;"></div>' + '</div>' + '<div style="width: 200px; height: 200px; position: relative; padding: 5px;">' + '<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></div>' + // eslint-disable-line max-len
- '</div>' + '<div style="position: absolute; left: 10%; top: 10%;"></div>' + '<div style="float:left; background-color:transparent;"></div>';
- if (isReady) {
- doc.body.appendChild(div);
- }
- vector = me.preDetected[Ext.browser.identity] || [];
- while (n--) {
- test = toRun[n];
- value = vector[n];
- name = test.name;
- names = test.names;
- if (value === undefined) {
- if (!isReady && test.ready) {
- // test requires domready state
- notRun.push(test);
-
- continue;
- }
- value = test.fn.call(me, doc, div);
- }
- // Store test results on Ext.supports and Ext.feature.has
- if (name) {
- supports[name] = has[name] = value;
- } else if (names) {
- while (names.length) {
- name = names.pop();
- supports[name] = has[name] = value;
- }
- }
- }
- if (isReady) {
- doc.body.removeChild(div);
- }
- me.toRun = notRun;
- },
- //</debug>
- report: function() {
- var values = [],
- len = this.tests.length,
- i;
- for (i = 0; i < len; ++i) {
- values.push(this.has[this.tests[i].name] ? 1 : 0);
- }
- Ext.log(Ext.browser.identity + ': [' + values.join(',') + ']');
- },
- //</debug>
- preDetected: {},
- // TODO
- /**
- * @class Ext.supports
- *
- * Contains information about features supported in the current environment as well
- * as bugs detected.
- *
- * @singleton
- */
- tests: [
- {
- /**
- * @property CloneNodeCopiesExpando `true` if the native DOM cloneNode method copies
- * expando properties to the newly cloned node.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'CloneNodeCopiesExpando',
- fn: function() {
- var el = document.createElement('div');
- el.expandoProp = {};
- return el.cloneNode().expandoProp === el.expandoProp;
- }
- },
- {
- /**
- * @property CSSPointerEvents `true` if document environment supports the CSS3
- * pointer-events style.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'CSSPointerEvents',
- fn: function(doc) {
- return 'pointerEvents' in doc.documentElement.style;
- }
- },
- {
- /**
- * @property CSS3BoxShadow `true` if document environment supports the CSS3
- * box-shadow style.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'CSS3BoxShadow',
- fn: function(doc) {
- return 'boxShadow' in doc.documentElement.style || 'WebkitBoxShadow' in doc.documentElement.style || 'MozBoxShadow' in doc.documentElement.style;
- }
- },
- {
- name: 'CSS3NegationSelector',
- fn: function(doc) {
- try {
- doc.querySelectorAll("foo:not(bar)");
- } catch (e) {
- return false;
- }
- return true;
- }
- },
- {
- /**
- * @property ClassList `true` if document environment supports the HTML5
- * classList API.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'ClassList',
- fn: function(doc) {
- return !!doc.documentElement.classList;
- }
- },
- {
- /**
- * @property Canvas `true` if the device supports Canvas.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'Canvas',
- fn: function() {
- var element = this.getTestElement('canvas');
- return !!(element && element.getContext && element.getContext('2d'));
- }
- },
- {
- /**
- * @property Svg `true` if the device supports SVG.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'Svg',
- fn: function(doc) {
- /* eslint-disable-next-line max-len */
- return !!(doc.createElementNS && !!doc.createElementNS("http:/" + "/www.w3.org/2000/svg", "svg").createSVGRect);
- }
- },
- {
- /**
- * @property Vml `true` if the device supports VML.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Vml',
- fn: function() {
- var element = this.getTestElement(),
- ret = false;
- element.innerHTML = "<!--[if vml]><br><![endif]-->";
- ret = (element.childNodes.length === 1);
- element.innerHTML = "";
- return ret;
- }
- },
- {
- /**
- * @property {Boolean} Touch `true` if the browser supports touch input.
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Touch',
- fn: function() {
- // IE10 uses a vendor-prefixed maxTouchPoints property
- var maxTouchPoints = navigator.msMaxTouchPoints || navigator.maxTouchPoints;
- // if the browser has touch events we can be reasonably sure the device has
- // a touch screen
- // browsers that use pointer event have maxTouchPoints > 1 if the
- // device supports touch input
- // Chrome Desktop < 39 reports maxTouchPoints === 1 even if there is no
- // touch support on the device
- // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
- // Chrome Desktop > 39 properly reports maxTouchPoints === 0 and
- // Chrome Desktop Device Emulation mode reports maxTouchPoints === 1
- if (Ext.browser.is.Chrome && Ext.browser.version.isLessThanOrEqual(39)) {
- return (Ext.supports.TouchEvents && maxTouchPoints !== 1) || maxTouchPoints > 1;
- } else {
- return Ext.supports.TouchEvents || maxTouchPoints > 0;
- }
- }
- },
- {
- /**
- * @property {Boolean} PointerEvents
- * @type {Boolean}
- * @private
- *
- * `true` If the event system should use [pointer events](https://www.w3.org/TR/pointerevents/).
- * Currently only set to true if the browser supports pointer events and does not
- * also support touch events. Touch events are preferred since they allow run-time
- * cancellation of browser default behavior such as scrolling by invoking
- * `e.preventDefault()` whereas pointer events require such intentions to be declared
- * in advance via CSS [touch-action](https://www.w3.org/TR/pointerevents/#h3_the-touch-action-css-property).
- * This means that when pointer events are used, certain interactions are not possible
- * such as long-press to drag within a scrollable element.
- */
- name: 'PointerEvents',
- fn: function() {
- var pointerEvent = window.PointerEvent,
- nav = window.navigator,
- pointerEnabled = !!(pointerEvent && (nav.pointerEnabled || !Ext.isIE));
- return pointerEnabled && !Ext.supports.TouchEvents;
- }
- },
- {
- /**
- * @property {Boolean} MSPointerEvents
- * @private
- */
- name: 'MSPointerEvents',
- fn: function() {
- return Ext.isIE10;
- }
- },
- {
- /**
- * @property {Boolean} TouchEvents
- *
- * `true` if the device supports touch events (`touchstart`, `touchmove`, `touchend`).
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'TouchEvents',
- fn: function() {
- return this.isEventSupported('touchend');
- }
- },
- {
- /**
- * @property {Boolean} TouchAction
- * @private
- *
- * A bit flag representing which property values the browser recognizes as valid
- * values of the CSS `touch-action` property.
- *
- * panX 1 "00000001"
- * panY 2 "00000010"
- * pinchZoom 4 "00000100"
- * doubleTapZoom 8 "00001000"
- */
- name: 'TouchAction',
- ready: true,
- fn: function(doc, div) {
- if (!window.getComputedStyle) {
- return 0;
- }
- var values = [
- 'pan-x',
- 'pan-y',
- 'pinch-zoom',
- 'double-tap-zoom'
- ],
- flags = [
- 1,
- 2,
- 4,
- 8
- ],
- ln = values.length,
- flag = 0,
- i, value;
- for (i = 0; i < ln; i++) {
- value = values[i];
- div.style.touchAction = value;
- if (getComputedStyle(div).touchAction === value) {
- flag |= flags[i];
- }
- }
- return flag;
- }
- },
- {
- /**
- * @property Orientation `true` if the device supports different orientations.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Orientation',
- fn: function() {
- return ('orientation' in window) && this.isEventSupported('orientationchange');
- }
- },
- {
- /**
- * @property OrientationChange `true` if the device supports the `orientationchange`
- * event.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'OrientationChange',
- fn: function() {
- return this.isEventSupported('orientationchange');
- }
- },
- {
- /**
- * @property DeviceMotion `true` if the device supports device motion (acceleration
- * and rotation rate).
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'DeviceMotion',
- fn: function() {
- return this.isEventSupported('devicemotion');
- }
- },
- {
- /**
- * @property Geolocation `true` if the device supports GeoLocation.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- /**
- * @property GeoLocation `true` if the device supports Geo-location.
- * @type {Boolean}
- * @deprecated 5.0.0 Use `Geolocation` instead (notice the lower-casing of 'L').
- */
- names: [
- 'Geolocation',
- 'GeoLocation'
- ],
- fn: function() {
- return 'geolocation' in window.navigator;
- }
- },
- {
- name: 'SqlDatabase',
- fn: function() {
- return 'openDatabase' in window;
- }
- },
- {
- name: 'WebSockets',
- fn: function() {
- return 'WebSocket' in window;
- }
- },
- {
- /**
- * @property Range `true` if browser support document.createRange native method.
- * See https://developer.mozilla.org/en/DOM/range.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'Range',
- fn: function() {
- return !!document.createRange;
- }
- },
- {
- /**
- * @property CreateContextualFragment `true` if browser support CreateContextualFragment
- * range native methods.
- * See https://developer.mozilla.org/en/DOM/range.createContextualFragment
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'CreateContextualFragment',
- fn: function() {
- var range = !!document.createRange ? document.createRange() : false;
- return range && !!range.createContextualFragment;
- }
- },
- {
- /**
- * @property History `true` if the device supports HTML5 history. See
- * https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'History',
- fn: function() {
- return ('history' in window && 'pushState' in window.history);
- }
- },
- {
- /**
- * @property Css3DTransforms `true` if the device supports CSS3DTransform.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Css3dTransforms',
- fn: function() {
- // See https://sencha.jira.com/browse/TOUCH-1544
- return this.has('CssTransforms') && this.isStyleSupported('perspective');
- }
- },
- // TODO - double check vs Ext JS flavor:
- /* eslint-disable-next-line max-len */
- // return (typeof WebKitCSSMatrix != 'undefined' && new WebKitCSSMatrix().hasOwnProperty('m41'));
- {
- // Important that this goes after Css3dTransforms, since tests are run in reverse order
- name: 'CssTransforms',
- fn: function() {
- return this.isStyleSupported('transform');
- }
- },
- {
- name: 'CssTransformNoPrefix',
- fn: function() {
- return this.isStyleSupportedWithoutPrefix('transform');
- }
- },
- {
- name: 'CssAnimations',
- fn: function() {
- return this.isStyleSupported('animationName');
- }
- },
- {
- /**
- * @property Transitions `true` if the device supports CSS3 Transitions.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- names: [
- 'CssTransitions',
- 'Transitions'
- ],
- fn: function() {
- return this.isStyleSupported('transitionProperty');
- }
- },
- {
- /**
- * @property Audio `true` if the device supports the HTML5 `audio` tag.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- /**
- * @property AudioTag `true` if the device supports the HTML5 `audio` tag.
- * @type {Boolean}
- * @deprecated 5.0.0 Use `Audio` instead.
- */
- names: [
- 'Audio',
- 'AudioTag'
- ],
- fn: function() {
- return !!this.getTestElement('audio').canPlayType;
- }
- },
- {
- /**
- * @property Video `true` if the device supports the HTML5 `video` tag.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'Video',
- fn: function() {
- return !!this.getTestElement('video').canPlayType;
- }
- },
- {
- /**
- * @property LocalStorage `true` if localStorage is supported.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'LocalStorage',
- fn: function() {
- try {
- // IE10/Win8 throws "Access Denied" accessing window.localStorage, so
- // this test needs to have a try/catch
- /* eslint-disable-next-line dot-notation */
- if ('localStorage' in window && window['localStorage'] !== null) {
- // this should throw an error in private browsing mode in iOS as well
- localStorage.setItem('sencha-localstorage-test', 'test success');
- // clean up if setItem worked
- localStorage.removeItem('sencha-localstorage-test');
- return true;
- }
- } catch (e) {}
- // ignore
- return false;
- }
- },
- {
- /**
- * @property {Boolean} XmlQuerySelector `true` if the browsers supports querySelector
- * and querySelectorAll methods on XML nodes.
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'XmlQuerySelector',
- fn: function() {
- var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><root></root>',
- xmlDoc;
- // IE10 doesn't create IXMLDOMDocument via DOMParser
- if (window.ActiveXObject) {
- xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
- // eslint-disable-line no-undef
- xmlDoc.async = false;
- // eslint-disable-line id-blacklist
- xmlDoc.loadXML(xmlString);
- } else if (window.DOMParser) {
- var parser = new DOMParser();
- xmlDoc = parser.parseFromString(xmlString, 'text/xml');
- }
- return xmlDoc ? !!xmlDoc.lastChild.querySelector : false;
- }
- },
- {
- /**
- * @property XHR2 `true` if the browser supports XMLHttpRequest
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'XHR2',
- fn: function() {
- return window.ProgressEvent && window.FormData && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
- }
- },
- {
- /**
- * @property XHRUploadProgress `true` if the browser supports XMLHttpRequest
- * upload progress info
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'XHRUploadProgress',
- fn: function() {
- var xhr;
- if (window.XMLHttpRequest && !Ext.browser.is.AndroidStock) {
- xhr = new XMLHttpRequest();
- return xhr && ('upload' in xhr) && ('onprogress' in xhr.upload);
- }
- return false;
- }
- },
- {
- /**
- * @property NumericInputPlaceHolder `true` if the browser supports placeholders
- * on numeric input fields
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'NumericInputPlaceHolder',
- fn: function() {
- return !(Ext.browser.is.AndroidStock4 && Ext.os.version.getMinor() < 2);
- }
- },
- {
- /**
- * @property {String} matchesSelector
- * The method name which matches an element against a selector if implemented in this
- * environment.
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'matchesSelector',
- fn: function() {
- var el = document.documentElement,
- w3 = 'matches',
- wk = 'webkitMatchesSelector',
- ms = 'msMatchesSelector',
- mz = 'mozMatchesSelector';
- return el[w3] ? w3 : el[wk] ? wk : el[ms] ? ms : el[mz] ? mz : null;
- }
- },
- {
- /**
- * @property RightMargin `true` if the device supports right margin.
- * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @type {Boolean}
- */
- name: 'RightMargin',
- ready: true,
- fn: function(doc, div) {
- var view = doc.defaultView;
- /* eslint-disable-next-line max-len */
- return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight !== '0px');
- }
- },
- {
- /**
- * @property DisplayChangeInputSelectionBug `true` if INPUT elements lose their
- * selection when their display style is changed. Essentially, if a text input
- * has focus and its display style is changed, the I-beam disappears.
- *
- * This bug is encountered due to the work around in place for the {@link #RightMargin}
- * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
- * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
- * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'DisplayChangeInputSelectionBug',
- fn: function() {
- var webKitVersion = Ext.webKitVersion;
- // WebKit but older than Safari 5 or Chrome 6:
- return 0 < webKitVersion && webKitVersion < 533;
- }
- },
- {
- /**
- * @property DisplayChangeTextAreaSelectionBug `true` if TEXTAREA elements lose their
- * selection when their display style is changed. Essentially, if a text area has
- * focus and its display style is changed, the I-beam disappears.
- *
- * This bug is encountered due to the work around in place for the {@link #RightMargin}
- * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
- * be fixed in Chrome 11.
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'DisplayChangeTextAreaSelectionBug',
- fn: function() {
- var webKitVersion = Ext.webKitVersion;
- /*
- Has bug w/textarea:
- (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
- AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
- Safari/534.16
- (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
- AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
- Safari/533.21.1
- No bug:
- (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
- AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
- Safari/534.24
- */
- return 0 < webKitVersion && webKitVersion < 534.24;
- }
- },
- {
- /**
- * @property TransparentColor `true` if the device supports transparent color.
- * @type {Boolean}
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'TransparentColor',
- ready: true,
- fn: function(doc, div, view) {
- view = doc.defaultView;
- /* eslint-disable-next-line max-len */
- return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor !== 'transparent');
- }
- },
- {
- /**
- * @property ComputedStyle `true` if the browser supports
- * document.defaultView.getComputedStyle().
- * @type {Boolean}
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'ComputedStyle',
- ready: true,
- fn: function(doc, div, view) {
- view = doc.defaultView;
- return !!(view && view.getComputedStyle);
- }
- },
- {
- /**
- * @property Float `true` if the device supports CSS float.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Float',
- fn: function(doc) {
- return 'cssFloat' in doc.documentElement.style;
- }
- },
- {
- /**
- * @property CSS3BorderRadius `true` if the device supports CSS3 border radius.
- * @type {Boolean}
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'CSS3BorderRadius',
- ready: true,
- fn: function(doc) {
- var domPrefixes = [
- 'borderRadius',
- 'BorderRadius',
- 'MozBorderRadius',
- 'WebkitBorderRadius',
- 'OBorderRadius',
- 'KhtmlBorderRadius'
- ],
- pass = false,
- i;
- for (i = 0; i < domPrefixes.length; i++) {
- if (doc.documentElement.style[domPrefixes[i]] !== undefined) {
- pass = true;
- }
- }
- return pass && !Ext.isIE9;
- }
- },
- {
- /**
- * @property CSS3LinearGradient `true` if the device supports CSS3 linear gradients.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'CSS3LinearGradient',
- fn: function(doc, div) {
- var property = 'background-image:',
- webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
- w3c = 'linear-gradient(left top, black, white)',
- moz = '-moz-' + w3c,
- ms = '-ms-' + w3c,
- opera = '-o-' + w3c,
- options = [
- property + webkit,
- property + w3c,
- property + moz,
- property + ms,
- property + opera
- ];
- div.style.cssText = options.join(';');
- return (("" + div.style.backgroundImage).indexOf('gradient') !== -1) && !Ext.isIE9;
- }
- },
- {
- /**
- * @property MouseEnterLeave `true` if the browser supports mouseenter and mouseleave events
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'MouseEnterLeave',
- fn: function(doc) {
- return ('onmouseenter' in doc.documentElement && 'onmouseleave' in doc.documentElement);
- }
- },
- {
- /**
- * @property MouseWheel `true` if the browser supports the mousewheel event
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'MouseWheel',
- fn: function(doc) {
- return ('onmousewheel' in doc.documentElement);
- }
- },
- {
- /**
- * @property Opacity `true` if the browser supports normal css opacity
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Opacity',
- fn: function(doc, div) {
- // Not a strict equal comparison in case opacity can be converted to a number.
- if (Ext.isIE8) {
- return false;
- }
- div.firstChild.style.cssText = 'opacity:0.73';
- return div.firstChild.style.opacity == '0.73';
- }
- },
- // eslint-disable-line eqeqeq
- {
- /**
- * @property Placeholder `true` if the browser supports the HTML5 placeholder attribute
- * on inputs
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'Placeholder',
- fn: function(doc) {
- return 'placeholder' in doc.createElement('input');
- }
- },
- {
- /**
- * @property Direct2DBug `true` if when asking for an element's dimension via offsetWidth
- * or offsetHeight, getBoundingClientRect, etc. the browser returns the subpixel width
- * rounded to the nearest pixel.
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- name: 'Direct2DBug',
- fn: function(doc) {
- return Ext.isString(doc.documentElement.style.msTransformOrigin) && Ext.isIE9m;
- }
- },
- {
- /**
- * @property BoundingClientRect `true` if the browser supports the getBoundingClientRect
- * method on elements
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'BoundingClientRect',
- fn: function(doc) {
- return 'getBoundingClientRect' in doc.documentElement;
- }
- },
- {
- /**
- * @property RotatedBoundingClientRect `true` if the BoundingClientRect is
- * rotated when the element is rotated using a CSS transform.
- * @type {Boolean}
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'RotatedBoundingClientRect',
- ready: true,
- fn: function(doc) {
- var body = doc.body,
- supports = false,
- el = doc.createElement('div'),
- style = el.style;
- if (el.getBoundingClientRect) {
- // If the document body already has child nodes (text nodes etc) we can end
- // up with subpixel rounding errors in IE11 when measuring the height.
- // Absolute positioning prevents this.
- style.position = 'absolute';
- style.top = "0";
- style.WebkitTransform = style.MozTransform = style.msTransform = style.OTransform = style.transform = 'rotate(90deg)';
- style.width = '100px';
- style.height = '30px';
- body.appendChild(el);
- supports = el.getBoundingClientRect().height !== 100;
- body.removeChild(el);
- }
- return supports;
- }
- },
- {
- /**
- * @property ChildContentClearedWhenSettingInnerHTML `true` if created child elements
- * lose their innerHTML when modifying the innerHTML of the parent element.
- * @type {Boolean}
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'ChildContentClearedWhenSettingInnerHTML',
- ready: true,
- fn: function() {
- var el = this.getTestElement(),
- child;
- el.innerHTML = '<div>a</div>';
- child = el.firstChild;
- el.innerHTML = '<div>b</div>';
- return child.innerHTML !== 'a';
- }
- },
- {
- name: 'IncludePaddingInWidthCalculation',
- ready: true,
- fn: function(doc, div) {
- return div.childNodes[1].firstChild.offsetWidth === 210;
- }
- },
- {
- name: 'IncludePaddingInHeightCalculation',
- ready: true,
- fn: function(doc, div) {
- return div.childNodes[1].firstChild.offsetHeight === 210;
- }
- },
- {
- /**
- * @property TextAreaMaxLength `true` if the browser supports maxlength on textareas.
- * @type {Boolean}
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'TextAreaMaxLength',
- fn: function(doc) {
- return ('maxlength' in doc.createElement('textarea'));
- }
- },
- {
- /**
- * @property GetPositionPercentage `true` if the browser will return the
- * left/top/right/bottom position as a percentage when explicitly set as a percentage value.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @type {Boolean}
- */
- // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
- name: 'GetPositionPercentage',
- ready: true,
- fn: function(doc, div) {
- return Ext.feature.getStyle(div.childNodes[2], 'left') === '10%';
- }
- },
- {
- /**
- * @property {Boolean} PercentageHeightOverflowBug
- * In some browsers (IE quirks, IE6, IE7, IE9, chrome, safari and opera at the time
- * of this writing) a percentage-height element ignores the horizontal scrollbar
- * of its parent element. This method returns true if the browser is affected
- * by this bug.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @private
- */
- name: 'PercentageHeightOverflowBug',
- ready: true,
- fn: function(doc) {
- var hasBug = false,
- style, el;
- if (Ext.getScrollbarSize().height) {
- // must have space-consuming scrollbars for bug to be possible
- el = this.getTestElement('div', true);
- style = el.style;
- style.height = '50px';
- style.width = '50px';
- style.overflow = 'auto';
- style.position = 'absolute';
- /* eslint-disable indent */
- el.innerHTML = [
- '<div style="display:table;height:100%;">',
- // The element that causes the horizontal overflow must be
- // a child of the element with the 100% height, otherwise
- // horizontal overflow is not triggered in webkit quirks mode
- '<div style="width:51px;"></div>',
- '</div>'
- ].join('');
- /* eslint-enable indent */
- doc.body.appendChild(el);
- if (el.firstChild.offsetHeight === 50) {
- hasBug = true;
- }
- doc.body.removeChild(el);
- }
- return hasBug;
- }
- },
- {
- /**
- * @property {Boolean} xOriginBug
- * In Chrome 24.0, an RTL element which has vertical overflow positions its right X origin
- * incorrectly. It skips a non-existent scrollbar which has been moved to the left edge
- * due to the RTL setting.
- *
- * http://code.google.com/p/chromium/issues/detail?id=174656
- *
- * This method returns true if the browser is affected by this bug.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @private
- */
- name: 'xOriginBug',
- ready: true,
- fn: function(doc, div) {
- /* eslint-disable max-len */
- div.innerHTML = '<div id="b1" style="height:100px;width:100px;direction:rtl;position:relative;overflow:scroll">' + '<div id="b2" style="position:relative;width:100%;height:20px;"></div>' + '<div id="b3" style="position:absolute;width:20px;height:20px;top:0px;right:0px"></div>' + '</div>';
- /* eslint-enable max-len */
- var outerBox = document.getElementById('b1').getBoundingClientRect(),
- b2 = document.getElementById('b2').getBoundingClientRect(),
- b3 = document.getElementById('b3').getBoundingClientRect();
- return (b2.left !== outerBox.left && b3.right !== outerBox.right);
- }
- },
- {
- /**
- * @property {Boolean} ScrollWidthInlinePaddingBug
- * In some browsers the right padding of an overflowing element is not accounted
- * for in its scrollWidth. The result can vary depending on whether or not
- * The element contains block-level children. This method tests the effect
- * of padding on scrollWidth when there are no block-level children inside the
- * overflowing element.
- *
- * This method returns true if the browser is affected by this bug.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'ScrollWidthInlinePaddingBug',
- ready: true,
- fn: function(doc) {
- var hasBug = false,
- style, el;
- el = doc.createElement('div');
- style = el.style;
- style.height = '50px';
- style.width = '50px';
- style.padding = '10px';
- style.overflow = 'hidden';
- style.position = 'absolute';
- el.innerHTML = '<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';
- doc.body.appendChild(el);
- if (el.scrollWidth === 70) {
- hasBug = true;
- }
- doc.body.removeChild(el);
- return hasBug;
- }
- },
- {
- /**
- * @property {Boolean} rtlVertScrollbarOnRight
- * Safari, in RTL mode keeps the scrollbar at the right side.
- * This means that when two elements must keep their left/right positions synched, if one
- * has no vert scrollbar, it must have some extra padding.
- * See https://sencha.jira.com/browse/EXTJSIV-11245
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @private
- */
- name: 'rtlVertScrollbarOnRight',
- ready: true,
- fn: function(doc, div) {
- div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:scroll">' + '<div style="width:20px;height:200px;"></div>' + '</div>';
- var outerBox = div.firstChild,
- innerBox = outerBox.firstChild;
- /* eslint-disable-next-line max-len */
- return (innerBox.offsetLeft + innerBox.offsetWidth !== outerBox.offsetLeft + outerBox.offsetWidth);
- }
- },
- {
- /**
- * @property {Boolean} rtlVertScrollbarOverflowBug
- * In Chrome, in RTL mode, horizontal overflow only into the vertical scrollbar does NOT
- * trigger horizontal scrollability.
- * See https://code.google.com/p/chromium/issues/detail?id=179332
- * We need to detect this for when a grid header needs to have exactly the same horizontal
- * scrolling range as its table view. See {@link Ext.grid.ColumnLayout#publishInnerCtSize}
- * TODO: Remove this when all supported Chrome versions are fixed.
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- * @private
- */
- name: 'rtlVertScrollbarOverflowBug',
- ready: true,
- fn: function(doc, div) {
- div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:auto">' + '<div style="width:95px;height:200px;"></div>' + '</div>';
- // If the bug is present, the 95 pixel wide inner div, encroaches into the
- // vertical scrollbar, but does NOT trigger horizontal overflow, so the clientHeight
- // remains equal to the offset height.
- var outerBox = div.firstChild,
- style = div.style,
- pos = style.position;
- // This issue seems to require a repaint to measure correctly
- style.position = 'absolute';
- // eslint-disable-next-line no-unused-expressions
- outerBox.offsetHeight;
- style.position = pos;
- return outerBox.clientHeight === outerBox.offsetHeight;
- }
- },
- {
- identity: 'defineProperty',
- fn: function() {
- if (Ext.isIE8m) {
- Ext.Object.defineProperty = Ext.emptyFn;
- return false;
- }
- return true;
- }
- },
- {
- identify: 'nativeXhr',
- fn: function() {
- if (typeof XMLHttpRequest !== 'undefined') {
- return true;
- }
- // Apply a polyfill:
- XMLHttpRequest = function() {
- // eslint-disable-line no-global-assign
- try {
- // eslint-disable-next-line no-undef
- return new ActiveXObject('MSXML2.XMLHTTP.3.0');
- } catch (ex) {
- return null;
- }
- };
- return false;
- }
- },
- {
- /**
- * @property {Boolean} SpecialKeyDownRepeat
- * True if the browser fires the keydown event on specialkey autorepeat
- *
- * note 1: IE fires ONLY the keydown event on specialkey autorepeat
- * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on
- * specialkey autorepeat (research done by Jan Wolter at
- * http://unixpapa.com/js/key.html)
- * note 3: Opera 12 behaves like other modern browsers so this workaround does not
- * work anymore
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'SpecialKeyDownRepeat',
- fn: function() {
- return Ext.isWebKit ? parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 : !(!(Ext.isGecko || Ext.isIE || Ext.isEdge) || (Ext.isOpera && Ext.operaVersion < 12));
- }
- },
- // eslint-disable-line max-len
- {
- /**
- * @property {Boolean} EmulatedMouseOver
- * True if the browser emulates a mouseover event on tap (mobile safari)
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'EmulatedMouseOver',
- fn: function() {
- // TODO: is it possible to feature detect this?
- return Ext.os.is.iOS;
- }
- },
- {
- /**
- * @property Hashchange True if the user agent supports the hashchange event
- *
- * This property is available at application boot time, before document ready.
- * @type {Boolean}
- */
- // support Vector 12
- name: 'Hashchange',
- fn: function() {
- // Note that IE8 in IE7 compatibility mode reports true for 'onhashchange' in window,
- // so also test documentMode
- var docMode = document.documentMode;
- return 'onhashchange' in window && (docMode === undefined || docMode > 7);
- }
- },
- {
- /**
- * @property FixedTableWidthBug
- * @private
- * @type {Boolean}
- * `true` if the browser has this bug: https://bugs.webkit.org/show_bug.cgi?id=130239
- *
- * This property is *NOT* available at application boot time. Only after the document
- * ready event.
- */
- name: 'FixedTableWidthBug',
- ready: true,
- fn: function() {
- if (Ext.isIE8) {
- // IE8 incorrectly detects that we have this bug.
- return false;
- }
- var outer = document.createElement('div'),
- inner = document.createElement('div'),
- width;
- outer.setAttribute('style', 'display:table;table-layout:fixed;');
- inner.setAttribute('style', 'display:table-cell;min-width:50px;');
- outer.appendChild(inner);
- document.body.appendChild(outer);
- // must poke offsetWidth to trigger a reflow before setting width
- // eslint-disable-next-line no-unused-expressions
- outer.offsetWidth;
- outer.style.width = '25px';
- width = outer.offsetWidth;
- document.body.removeChild(outer);
- return width === 50;
- }
- },
- {
- /**
- * @property FocusinFocusoutEvents
- * @private
- * @type {Boolean}
- * `true` if the browser supports focusin and focusout events:
- * https://developer.mozilla.org/en-US/docs/Web/Events/focusin
- * At this point, only Firefox does not, see this bug:
- * https://bugzilla.mozilla.org/show_bug.cgi?id=687787
- *
- * This property is available at application boot time, before document ready.
- */
- name: 'FocusinFocusoutEvents',
- fn: function() {
- // There is no reliable way to feature detect focusin/focusout event support.
- // window.onfocusin will return undefined both in Chrome (where it is supported)
- // and in Firefox (where it is not supported); adding an element and trying to
- // focus it will fail when the browser window itself is not focused.
- return !(Ext.isGecko && Ext.firefoxVersion < 52);
- }
- },
- {
- /**
- * @property {Boolean} AsyncFocusEvents
- * `true` if the browser fires focus events (focus, blur, focusin, focusout)
- * asynchronously, i.e. in a separate event loop invocation. This is only true
- * for all versions Internet Explorer; Microsoft Edge and other browsers fire
- * focus events synchronously.
- */
- name: 'AsyncFocusEvents',
- fn: function() {
- // The sad part is that we can't feature detect this because the focus
- // event won't be fired when the browser window itself is not focused.
- // Private shortcut for brevity
- return Ext.asyncFocus = !!Ext.isIE;
- }
- },
- {
- /**
- * @property {Object} accessibility Accessibility features.
- *
- * @property {Boolean} accessibility.Images `true` if the browser is configured
- * to display images.
- *
- * @property {Boolean} accessibility.BackgroundImages `true` if the browser
- * is configured to display background images.
- *
- * @property {Boolean} accessibility.BorderColors `true` if the browser
- * is configured to honor CSS styling for border colors.
- *
- * @property {Boolean} accessibility.LightOnDark `true` if the browser
- * is currently using reverse colors in light-on-dark accessibility mode.
- */
- name: 'accessibility',
- ready: true,
- fn: function(doc) {
- var body = doc.body,
- div, img, style, supports, bgImg;
- function getColor(colorTxt) {
- var values = [],
- colorValue = 0,
- regex, match;
- if (colorTxt.indexOf('rgb(') !== -1) {
- values = colorTxt.replace('rgb(', '').replace(')', '').split(', ');
- } else if (colorTxt.indexOf('#') !== -1) {
- regex = colorTxt.length === 7 ? /^#(\S\S)(\S\S)(\S\S)$/ : /^#(\S)(\S)(\S)$/;
- match = colorTxt.match(regex);
- if (match) {
- values = [
- '0x' + match[1],
- '0x' + match[2],
- '0x' + match[3]
- ];
- }
- }
- for (var i = 0; i < values.length; i++) {
- colorValue += parseInt(values[i]);
- }
- return colorValue;
- }
- div = doc.createElement('div');
- img = doc.createElement('img');
- style = div.style;
- Ext.apply(style, {
- width: '2px',
- position: 'absolute',
- clip: 'rect(1px,1px,1px,1px)',
- borderWidth: '1px',
- borderStyle: 'solid',
- borderTopTolor: '#f00',
- borderRightColor: '#ff0',
- backgroundColor: '#fff',
- backgroundImage: 'url(' + Ext.BLANK_IMAGE_URL + ')'
- });
- img.alt = '';
- img.src = Ext.BLANK_IMAGE_URL;
- div.appendChild(img);
- body.appendChild(div);
- // Now check if the styles were indeed honored
- style = div.currentStyle || div.style;
- bgImg = style.backgroundImage;
- supports = {
- // In IE it is possible to untick "Show pictures" option in Advanced
- // settings; this will result in img element reporting its readyState
- // as 'uninitialized'.
- // See http://www.paciellogroup.com/blog/2011/10/detecting-if-images-are-disabled-in-browsers/
- Images: img.offsetWidth === 1 && img.readyState !== 'uninitialized',
- BackgroundImages: !(bgImg !== null && (bgImg === "none" || bgImg === "url(invalid-url:)")),
- BorderColors: style.borderTopColor !== style.borderRightColor,
- LightOnDark: getColor(style.color) - getColor(style.backgroundColor) > 0
- };
- Ext.supports.HighContrastMode = !supports.BackgroundImages;
- body.removeChild(div);
- div = img = null;
- return supports;
- }
- },
- {
- /**
- * @property ViewportUnits `true` if the device supports ViewportUnits.
- * @type {Boolean}
- *
- */
- name: 'ViewportUnits',
- ready: true,
- fn: function(doc) {
- // Even attempting to detect the feature throws a fatal error on IE8
- if (Ext.isIE8) {
- return false;
- }
- var body = doc.body,
- div = document.createElement('div'),
- style = div.currentStyle || div.style,
- width, divWidth;
- body.appendChild(div);
- Ext.apply(style, {
- width: '50vw'
- });
- width = parseInt(window.innerWidth / 2, 10);
- // eslint-disable-next-line max-len
- divWidth = parseInt((window.getComputedStyle ? getComputedStyle(div, null) : div.currentStyle).width, 10);
- body.removeChild(div);
- div = null;
- return width === divWidth;
- }
- },
- {
- name: 'CSSVariables',
- ready: false,
- fn: function() {
- // Legacy browsers do not have this method.
- if (!window.getComputedStyle) {
- return false;
- }
- return window.CSS && window.CSS.supports && window.CSS.supports('--test-var', 0);
- }
- },
- {
- /**
- * @property Selectors2 `true` if the browser supports the CSS selector API level 2.
- * https://dev.w3.org/2006/webapi/selectors-api2/
- * @type {Boolean}
- *
- */
- name: 'Selectors2',
- ready: false,
- fn: function(doc) {
- try {
- return !!doc.querySelectorAll(':scope');
- } catch (e) {
- return false;
- }
- }
- },
- {
- /**
- * @property CSSScrollSnap
- * @private
- * @type {Boolean}
- */
- name: 'CSSScrollSnap',
- ready: false,
- fn: function(doc) {
- var style = doc.documentElement.style;
- return 'scrollSnapType' in style || 'webkitScrollSnapType' in style || 'msScrollSnapType' in style;
- }
- },
- {
- /**
- * @property TranslateYCausesHorizontalScroll
- * @private
- * @type {Boolean}
- *
- * Bug for Edge logged here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9743268/
- */
- name: 'TranslateYCausesHorizontalScroll',
- ready: true,
- fn: function(doc, div) {
- div.innerHTML = '<div style="position: relative; overflow: auto; height: 200px; width: 200px;">' + // eslint-disable-line max-len
- '<div>' + '<div style="transform: translateY(260px); width: 50px;">a</div>' + '</div>' + '</div>';
- return div.firstChild.scrollWidth > div.firstChild.clientWidth;
- }
- },
- {
- /**
- * @property FlexBoxBasisBug
- * @private
- * @type {Boolean}
- * Allows align: stretch to align items to the height of the tallest item
- * in an auto-heighted hbox layout.
- * can't use flex-basis: auto everywhere because it breaks percentage-sized children
- * https://bugs.chromium.org/p/chromium/issues/detail?id=680484
- */
- name: 'FlexBoxBasisBug',
- ready: true,
- fn: function() {
- if (Ext.isIE11 || (Ext.os.is.iOS && Ext.os.version.major <= 10) || (Ext.isSafari && Ext.browser.version.isLessThan(11)) || (Ext.os.is.Android && Ext.os.version.isLessThan(6))) {
- return true;
- }
- return false;
- }
- },
- {
- /**
- * @property PercentageSizeFlexBug
- * @private
- * @type {Boolean}
- *
- * Detects https://bugs.webkit.org/show_bug.cgi?id=137730
- */
- name: 'PercentageSizeFlexBug',
- ready: true,
- fn: function(doc, div) {
- if (Ext.isIE9m) {
- return false;
- }
- var style = div.style;
- style.display = 'flex';
- style.flexDirection = 'column';
- style.height = style.width = '100px';
- div.innerHTML = '<div style="flex: 1 1;"><div style="height:50%"></div></div>';
- return div.firstChild.firstChild.offsetHeight !== 50;
- }
- },
- {
- /**
- * @property CannotScrollExactHeight
- * @type {Boolean}
- *
- * Feature detect the support of browsers that are unable to scroll elements that are
- * the same height as the native scrollbar height.
- */
- name: 'CannotScrollExactHeight',
- fn: function() {
- return Ext.isIE10p;
- }
- },
- {
- /**
- * @property WebKitTextInputMarginBug
- * @private
- * @type {Boolean}
- *
- * Detects the following bug:
- * https://bugs.webkit.org/show_bug.cgi?id=137693
- *
- * Feb 22, 2017: This bug used to affect chrome as well, but appears to be fixed in
- * Chrome 56. The issue still exists in safari 10
- */
- name: 'WebKitInputTableBoxModelBug',
- ready: true,
- fn: function(doc, div) {
- var table = document.createElement('div'),
- cell = document.createElement('div'),
- input = document.createElement('input'),
- tableStyle = table.style,
- cellStyle = cell.style,
- inputStyle = input.style,
- body = doc.body,
- hasBug;
- input.type = 'text';
- tableStyle.display = 'table';
- tableStyle.height = '100px';
- cellStyle.display = 'table-cell';
- inputStyle.border = '0';
- inputStyle.padding = '10px';
- inputStyle.boxSizing = 'border-box';
- inputStyle.height = '100%';
- cell.appendChild(input);
- table.appendChild(cell);
- body.appendChild(table);
- hasBug = input.offsetHeight === 80;
- body.removeChild(table);
- return hasBug;
- }
- },
- {
- /**
- * @property PassiveEventListener
- * @private
- * @type {Boolean}
- *
- * Detects support for the "passive" event listener option
- */
- name: 'PassiveEventListener',
- fn: function(doc, div) {
- var supportsPassive = false,
- options;
- try {
- options = Object.defineProperty({}, 'passive', {
- get: function() {
- // eslint-disable-line getter-return
- supportsPassive = true;
- }
- });
- window.addEventListener('e', null, options);
- window.removeEventListener('e', null, options);
- } catch (e) {}
- // ignore
- return supportsPassive;
- }
- },
- {
- /**
- * @property MinContent
- * @private
- * @type {Boolean}
- *
- * Detects support for CSS "min-content"
- */
- name: 'CSSMinContent',
- ready: true,
- fn: function(doc, div) {
- // As of 3/24/2017 IE/Edge have no min-content support, and firefox has
- // partial/buggy support: https://bugzilla.mozilla.org/show_bug.cgi?id=135015
- // This feature detector is designed to return false if there is not "full" support.
- // eslint-disable-next-line max-len
- div.innerHTML = '<div style="height:4px;width:4px;min-height:-webkit-min-content;min-height:-moz-min-content;min-height:min-content"><div style="height:8px;width:8px"></div></div>';
- return div.firstChild.offsetHeight === 8;
- }
- },
- {
- name: 'ComputedSizeIncludesPadding',
- ready: true,
- fn: function(doc, div) {
- var ret = false,
- bd = document.body,
- el, w;
- if (window.getComputedStyle) {
- el = document.createElement('div');
- el.style.cssText = 'width:10px;padding:2px;' + '-webkit-box-sizing:border-box;box-sizing:border-box;';
- bd.appendChild(el);
- w = window.getComputedStyle(el, null).width;
- ret = w === '10px';
- bd.removeChild(el);
- }
- return ret;
- }
- },
- {
- name: 'inputEventData',
- ready: false,
- fn: function() {
- return !!(window.InputEvent && 'data' in new InputEvent('input'));
- }
- },
- /* eslint-disable indent */
- // placeholder so legacy browser detectors can come/go cleanly
- 0
- ]
- };
- /* eslint-enable indent */
- Ext.feature.tests.pop();
- // remove the placeholder
- Ext.supports = {};
- Ext.feature.detect();
- /**
- * This class manages ready detection and handling. Direct use of this class is not
- * recommended. Instead use `Ext.onReady`:
- *
- * Ext.onReady(function () {
- * // DOM and Framework are ready...
- * });
- *
- * ## DOM Ready
- *
- * The lowest-level of readiness is DOM readiness. This level implies only that the document
- * body exists. Many things require the DOM to be ready for manipulation. If that is all
- * that is required, the `Ext.onDocumentReady` method can be called to register a callback
- * to be called as soon as the DOM is ready:
- *
- * Ext.onDocumentReady(function () {
- * // the document body is ready
- * });
- *
- * ## Framework Ready
- *
- * In production builds of applications it is common to have all of the code loaded before
- * DOM ready, so the need to wait for "onReady" is often confused with only that concern.
- * This is easy to understand, at least in part because historically `Ext.onReady` only
- * waited for DOM ready.
- *
- * With the introduction of `Ext.Loader`, however, it became common for DOM ready to occur
- * in the middle of dynamically loading code. If application code were executed at that
- * time, any use of the yet-to-be-loaded classes would throw errors. As a consequence of
- * this, the `Ext.onReady` mechanism was extended to wait for both DOM ready *and* all of
- * the required classes to be loaded.
- *
- * When the framework enters or leaves a state where it is not ready (for example, the
- * first dynamic load is requested or last load completes), `Ext.env.Ready` is informed.
- * For example:
- *
- * Ext.env.Ready.block();
- *
- * //...
- *
- * Ext.env.Ready.unblock();
- *
- * When there are no blocks and the DOM is ready, the Framework is ready and the "onReady"
- * callbacks are called.
- *
- * Priority can be used to control the ordering of onReady listeners, for example:
- *
- * Ext.onReady(function() {
- *
- * }, null, {
- * priority: 100
- * });
- *
- * Ready listeners with higher priorities will run sooner than those with lower priorities,
- * the default priority being `0`. Internally the framework reserves priorities of 1000
- * or greater, and -1000 or lesser for onReady handlers that must run before or after
- * any application code. Applications should stick to using priorities in the -999 - 999
- * range. The following priorities are currently in use by the framework:
- *
- * - Element_scroll rtl override: `1001`
- * - Event system initialization: `2000`
- * - Ext.dom.Element: `1500`
- *
- * @class Ext.env.Ready
- * @singleton
- * @private
- * @since 5.0.0
- */
- Ext.env.Ready = {
- // @define Ext.env.Ready
- // @require Ext.env.Browser
- // @require Ext.env.OS
- // @require Ext.env.Feature
- /**
- * @property {Number} blocks The number of Framework readiness blocks.
- * @private
- */
- blocks: (location.search || '').indexOf('ext-pauseReadyFire') > 0 ? 1 : 0,
- /**
- * @property {Number} bound This property stores the state of event listeners bound
- * to the document or window to detect ready state.
- * @private
- */
- bound: 0,
- /**
- * @property {Number} [delay=1]
- * This allows the DOM listener thread to complete (usually desirable with mobWebkit,
- * Gecko) before firing the entire onReady chain (high stack load on Loader). For mobile
- * devices when running from Home Screen, the splash screen will not disappear until
- * all external resource requests finish. This delay clears the splash screen.
- * @private
- */
- delay: 1,
- /**
- * @property {Event[]} events An array of events that have triggered ready state. This
- * is for diagnostic purposes only and is only available in debug builds.
- * An array
- * @private
- */
- events: [],
- /**
- * @property {Boolean} firing This property is `true` when we currently calling the
- * listeners.
- * @private
- */
- firing: false,
- /**
- * @property {Number} generation A counter of the number of mutations of `listeners`.
- * @private
- */
- generation: 0,
- /**
- * @property {Object[]} listeners The set of listeners waiting for ready.
- * @private
- */
- listeners: [],
- /**
- * @property {Number} nextId A counter so we can assign listeners an `id` to keep
- * them in FIFO order.
- * @private
- */
- nextId: 0,
- /**
- * @property {Number} sortGeneration A captured value of `generation` that indicates
- * when the `listeners` were last sorted.
- * @private
- */
- sortGeneration: 0,
- /**
- * @property {Number} state
- * Holds the current ready state as managed by this class. The values possible are:
- *
- * * 0 - Not ready.
- * * 1 - Ready detected but listeners are not yet notified.
- * * 2 - Ready detected and listeners are notified. See also `firing`.
- *
- * @private
- */
- state: 0,
- /**
- * @property {Object} timer The handle from `setTimeout` for the delayed notification
- * of ready.
- * @private
- */
- timer: null,
- /**
- * Binds the appropriate browser event for checking if the DOM has loaded.
- * @private
- */
- bind: function() {
- var me = Ext.env.Ready,
- doc = document;
- if (!me.bound) {
- // Test scenario where load is dynamic AFTER window.load
- if (doc.readyState === 'complete') {
- // Firefox4+ got support for this state, others already do.
- me.onReadyEvent({
- type: doc.readyState || 'body'
- });
- } else {
- me.bound = 1;
- if (Ext.browser.is.PhoneGap && !Ext.os.is.Desktop) {
- me.bound = 2;
- doc.addEventListener('deviceready', me.onReadyEvent, false);
- }
- doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false);
- window.addEventListener('load', me.onReadyEvent, false);
- }
- }
- },
- block: function() {
- ++this.blocks;
- Ext.isReady = false;
- },
- /**
- * This method starts the process of firing the ready event. This may be delayed based
- * on the `delay` property.
- * @private
- */
- fireReady: function() {
- var me = Ext.env.Ready;
- if (!me.state) {
- Ext._readyTime = Ext.ticks();
- Ext.isDomReady = true;
- me.state = 1;
- // As soon as we transition to domready, complete the feature detection:
- Ext.feature.detect(true);
- if (!me.delay) {
- me.handleReady();
- } else if (navigator.standalone) {
- // When running from Home Screen, the splash screen will not disappear
- // until all external resource requests finish.
- // The first timeout clears the splash screen
- // The second timeout allows inital HTML content to be displayed
- me.timer = Ext.defer(function() {
- me.timer = null;
- me.handleReadySoon();
- }, 1);
- } else {
- me.handleReadySoon();
- }
- }
- },
- /**
- * This method iterates over the `listeners` and invokes them. This advances the
- * `state` from 1 to 2 and ensure the proper subset of `listeners` are invoked.
- * @private
- */
- handleReady: function() {
- var me = this;
- if (me.state === 1) {
- me.state = 2;
- Ext._beforeReadyTime = Ext.ticks();
- me.invokeAll();
- Ext._afterReadyTime = Ext.ticks();
- }
- },
- /**
- * This method is called to schedule a call to `handleReady` using a `setTimeout`. It
- * ensures that only one timer is pending.
- * @param {Number} [delay] If passed, this overrides the `delay` property.
- * @private
- */
- handleReadySoon: function(delay) {
- var me = this;
- if (!me.timer) {
- me.timer = Ext.defer(function() {
- me.timer = null;
- me.handleReady();
- }, delay || me.delay);
- }
- },
- /**
- * This method invokes the given `listener` instance based on its options.
- * @param {Object} listener
- */
- invoke: function(listener) {
- var delay = listener.delay;
- if (delay) {
- Ext.defer(listener.fn, delay, listener.scope);
- } else {
- if (Ext.elevateFunction) {
- Ext.elevateFunction(listener.fn, listener.scope);
- } else {
- listener.fn.call(listener.scope);
- }
- }
- },
- /**
- * Invokes as many listeners as are appropriate given the current state. This should
- * only be called when DOM ready is achieved. The remaining business of `blocks` is
- * handled here.
- */
- invokeAll: function() {
- if (Ext.elevateFunction) {
- Ext.elevateFunction(this.doInvokeAll, this);
- } else {
- this.doInvokeAll();
- }
- },
- doInvokeAll: function() {
- var me = this,
- listeners = me.listeners,
- listener;
- if (!me.blocks) {
- // Since DOM is ready and we have no blocks, we mark the framework as ready.
- Ext.isReady = true;
- }
- me.firing = true;
- // NOTE: We cannot cache this length because each time through the loop a callback
- // may have added new callbacks.
- while (listeners.length) {
- if (me.sortGeneration !== me.generation) {
- me.sortGeneration = me.generation;
- // This will happen just once on the first pass... if nothing is being
- // added as we call the callbacks. This sorts the listeners such that the
- // highest priority listener is at the *end* of the array ... so we can
- // use pop (as opposed to shift) to extract it.
- listeners.sort(me.sortFn);
- }
- listener = listeners.pop();
- if (me.blocks && !listener.dom) {
- // If we are blocked (i.e., only DOM ready) and this listener is not a
- // DOM-ready listener we have reached the end of the line. The remaining
- // listeners are Framework ready listeners.
- listeners.push(listener);
- break;
- }
- me.invoke(listener);
- }
- me.firing = false;
- },
- /**
- * This method wraps the given listener pieces in a proper object for the `listeners`
- * array and `invoke` methods.
- * @param {Function} fn The method to call.
- * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
- * Defaults to the browser window.
- * @param {Object} [options] An object with extra options.
- * @param {Number} [options.delay=0] A number of milliseconds to delay.
- * @param {Number} [options.priority=0] Relative priority of this callback. A larger
- * number will result in the callback being sorted before the others. Priorities
- * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
- * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
- * means full Framework and DOM readiness.
- * @return {Object} The listener instance.
- * @private
- */
- makeListener: function(fn, scope, options) {
- var ret = {
- fn: fn,
- id: ++this.nextId,
- // so sortFn can respect FIFO
- scope: scope,
- dom: false,
- priority: 0
- };
- if (options) {
- Ext.apply(ret, options);
- }
- ret.phase = ret.dom ? 0 : 1;
- // to simplify the sortFn
- return ret;
- },
- /**
- * Adds a listener to be notified when the document is ready (before onload and before
- * images are loaded).
- *
- * @param {Function} fn The method to call.
- * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
- * Defaults to the browser window.
- * @param {Object} [options] An object with extra options.
- * @param {Number} [options.delay=0] A number of milliseconds to delay.
- * @param {Number} [options.priority=0] Relative priority of this callback. A larger
- * number will result in the callback being sorted before the others. Priorities
- * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
- * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
- * means full Framework and DOM readiness.
- * @private
- */
- on: function(fn, scope, options) {
- var me = Ext.env.Ready,
- listener = me.makeListener(fn, scope, options);
- if (me.state === 2 && !me.firing && (listener.dom || !me.blocks)) {
- // If we are DOM ready (state === 2) and not currently in invokeAll (!firing)
- // and this listener is ready to call (either a DOM ready listener or there
- // are no blocks), then we need to invoke the listener now.
- //
- // Otherwise we can fall to the else block and push the listener. The eventual
- // (or currently executing) call to handleReady or unblock will trigger its
- // delivery in proper priority order.
- me.invoke(listener);
- } else {
- me.listeners.push(listener);
- ++me.generation;
- if (!me.bound) {
- // If we have never bound then bind the ready event now. If we have unbound
- // the event then me.bound == -1 and we don't want to rebind it as the DOM
- // is ready.
- me.bind();
- }
- }
- },
- /**
- * This is a generic event handler method attached to all of the various events that
- * may indicate ready state. The first call to this method indicates ready state has
- * been achieved.
- * @param {Event} [ev] The event instance.
- * @private
- */
- onReadyEvent: function(ev) {
- var me = Ext.env.Ready;
- if (Ext.elevateFunction) {
- Ext.elevateFunction(me.doReadyEvent, me, arguments);
- } else {
- me.doReadyEvent(ev);
- }
- },
- doReadyEvent: function(ev) {
- var me = this;
- if (ev && ev.type) {
- me.events.push(ev);
- }
- if (me.bound > 0) {
- me.unbind();
- me.bound = -1;
- }
- // NOTE: *not* 0 or false - we never want to rebind!
- if (!me.state) {
- me.fireReady();
- }
- },
- /**
- * Sorts the `listeners` array by `phase` and `priority` such that the first listener
- * to fire can be determined using `pop` on the `listeners` array.
- * @private
- */
- sortFn: function(a, b) {
- return -((a.phase - b.phase) || (b.priority - a.priority) || (a.id - b.id));
- },
- unblock: function() {
- var me = this;
- if (me.blocks) {
- if (!--me.blocks) {
- if (me.state === 2 && !me.firing) {
- // We have already finished handleReady (the DOM ready handler) so
- // this trigger just needs to dispatch all the remaining listeners.
- me.invokeAll();
- }
- }
- }
- },
- // if we are currently firing then invokeAll will pick up the Framework
- // ready listeners automatically.
- //
- // If me.state < 2 then we are waiting for DOM ready so it will eventually
- // call handleReady and invokeAll when everything is ready.
- /**
- * This method is called to remove all event listeners that may have been set up to
- * detect ready state.
- * @private
- */
- unbind: function() {
- var me = this,
- doc = document;
- if (me.bound > 1) {
- doc.removeEventListener('deviceready', me.onReadyEvent, false);
- }
- doc.removeEventListener('DOMContentLoaded', me.onReadyEvent, false);
- window.removeEventListener('load', me.onReadyEvent, false);
- }
- };
- (function() {
- var Ready = Ext.env.Ready;
- /*
- * EXTJS-13522
- * Although IE 9 has the DOMContentLoaded event available, usage of that causes
- * timing issues when attempting to access document.namespaces (VmlCanvas.js).
- * Consequently, even in IE 9 we need to use the legacy bind override for ready
- * detection. This defers ready firing enough to allow access to the
- * document.namespaces property.
- *
- * NOTE: this issue is very timing sensitive, and typically only displays itself
- * when there is a large amount of latency between the browser and the server, and
- * when testing against a built page (ext-all.js) and not a dev mode page.
- */
- if (Ext.isIE9m) {
- /* Customized implementation for Legacy IE. The default implementation is
- * configured for use with all other 'standards compliant' agents.
- * References: http://javascript.nwbox.com/IEContentLoaded/
- * licensed courtesy of http://developer.yahoo.com/yui/license.html
- */
- Ext.apply(Ready, {
- /**
- * Timer for doScroll polling
- * @private
- */
- scrollTimer: null,
- /**
- * @private
- */
- readyStatesRe: /complete/i,
- /**
- * This strategy has minimal benefits for Sencha solutions that build
- * themselves (ie. minimal initial page markup). However, progressively-enhanced
- * pages (with image content and/or embedded frames) will benefit the most
- * from it. Browser timer resolution is too poor to ensure a doScroll check
- * more than once on a page loaded with minimal assets (the readystatechange
- * event 'complete' usually beats the doScroll timer on a 'lightly-loaded'
- * initial document).
- * @private
- */
- pollScroll: function() {
- var scrollable = true;
- try {
- document.documentElement.doScroll('left');
- } catch (e) {
- scrollable = false;
- }
- // on IE8, when running within an iFrame, document.body is not immediately
- // available
- if (scrollable && document.body) {
- Ready.onReadyEvent({
- type: 'doScroll'
- });
- } else {
- // Minimize thrashing --
- // adjusted for setTimeout's close-to-minimums (not too low),
- // as this method SHOULD always be called once initially
- Ready.scrollTimer = Ext.defer(Ready.pollScroll, 20);
- }
- return scrollable;
- },
- bind: function() {
- var doc = document,
- topContext;
- if (Ready.bound) {
- return;
- }
- // See if we are in an IFRAME? (doScroll ineffective here)
- try {
- topContext = window.frameElement === undefined;
- } catch (e) {}
- // If we throw an exception, it means we're probably getting access
- // denied, which means we're in an iframe cross domain.
- if (!topContext || !doc.documentElement.doScroll) {
- Ready.pollScroll = Ext.emptyFn;
- }
- // then noop this test altogether
- else if (Ready.pollScroll()) {
- // starts scroll polling if necessary
- return;
- }
- if (doc.readyState === 'complete') {
- // Loaded AFTER initial document write/load...
- Ready.onReadyEvent({
- type: 'already ' + (doc.readyState || 'body')
- });
- } else {
- doc.attachEvent('onreadystatechange', Ready.onReadyStateChange);
- window.attachEvent('onload', Ready.onReadyEvent);
- Ready.bound = 1;
- }
- },
- unbind: function() {
- document.detachEvent('onreadystatechange', Ready.onReadyStateChange);
- window.detachEvent('onload', Ready.onReadyEvent);
- if (Ext.isNumber(Ready.scrollTimer)) {
- Ext.undefer(Ready.scrollTimer);
- Ready.scrollTimer = null;
- }
- },
- /**
- * This event handler is called when the readyState changes.
- * @private
- */
- onReadyStateChange: function() {
- var state = document.readyState;
- if (Ready.readyStatesRe.test(state)) {
- Ready.onReadyEvent({
- type: state
- });
- }
- }
- });
- }
- /**
- * @property {Boolean} isDomReady
- * `true` when the document body is ready for use.
- * @member Ext
- * @readonly
- */
- /**
- * @property {Boolean} isReady
- * `true` when `isDomReady` is true and the Framework is ready for use.
- * @member Ext
- * @readonly
- */
- /**
- * @method onDocumentReady
- * @member Ext
- * Adds a listener to be notified when the document is ready (before onload and before
- * images are loaded).
- *
- * @param {Function} fn The method to call.
- * @param {Object} [scope] The scope (`this` reference) in which the handler function
- * executes. Defaults to the browser window.
- * @param {Object} [options] An object with extra options.
- * @param {Number} [options.delay=0] A number of milliseconds to delay.
- * @param {Number} [options.priority=0] Relative priority of this callback. A larger
- * number will result in the callback being sorted before the others. Priorities
- * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
- * @private
- */
- Ext.onDocumentReady = function(fn, scope, options) {
- var opt = {
- dom: true
- };
- if (options) {
- Ext.apply(opt, options);
- }
- Ready.on(fn, scope, opt);
- };
- /**
- * @method onReady
- * @member Ext
- * Adds a listener to be notified when the document is ready (before onload and before
- * images are loaded).
- *
- * @param {Function} fn The method to call.
- * @param {Object} [scope] The scope (`this` reference) in which the handler function
- * executes. Defaults to the browser window.
- * @param {Object} [options] An object with extra options.
- * @param {Number} [options.delay=0] A number of milliseconds to delay.
- * @param {Number} [options.priority=0] Relative priority of this callback. A larger
- * number will result in the callback being sorted before the others. Priorities
- * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
- * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
- * means full Framework and DOM readiness.
- * numbers are reserved.
- */
- Ext.onReady = function(fn, scope, options) {
- Ready.on(fn, scope, options);
- };
- // A shortcut method for onReady with a high priority
- Ext.onInternalReady = function(fn, scope, options) {
- Ready.on(fn, scope, Ext.apply({
- priority: 1000
- }, options));
- };
- Ready.bind();
- }());
- // @tag class
- /**
- * This class provides dynamic loading support for JavaScript classes. Application code
- * does not typically need to call `Ext.Loader` except perhaps to configure path mappings
- * when not using [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/).
- *
- * Ext.Loader.setPath('MyApp', 'app');
- *
- * When using Sencha Cmd, this is handled by the "bootstrap" provided by the application
- * build script and such configuration is not necessary.
- *
- * # Typical Usage
- *
- * The `Ext.Loader` is most often used behind the scenes to satisfy class references in
- * class declarations. Like so:
- *
- * Ext.define('MyApp.view.Main', {
- * extend: 'Ext.panel.Panel',
- *
- * mixins: [
- * 'MyApp.util.Mixin'
- * ],
- *
- * requires: [
- * 'Ext.grid.Panel'
- * ],
- *
- * uses: [
- * 'MyApp.util.Stuff'
- * ]
- * });
- *
- * In all of these cases, `Ext.Loader` is used internally to resolve these class names
- * and ensure that the necessary class files are loaded.
- *
- * During development, these files are loaded individually for optimal debugging. For a
- * production use, [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/) will replace
- * all of these strings with the actual resolved class references because it ensures that
- * the classes are all contained in the build in the correct order. In development, these
- * files will not be loaded until the `MyApp.view.Main` class indicates they are needed
- * as shown above.
- *
- * # Loading Classes
- *
- * You can also use `Ext.Loader` directly to load classes or files. The simplest form of
- * use is `{@link Ext#require}`.
- *
- * For example:
- *
- * Ext.require('MyApp.view.Main', function () {
- * // On callback, the MyApp.view.Main class is now loaded
- *
- * var view = new MyApp.view.Main();
- * });
- *
- * You can alternatively require classes by alias or wildcard.
- *
- * Ext.require('widget.window');
- *
- * Ext.require(['widget.window', 'layout.border', 'Ext.data.Connection']);
- *
- * Ext.require(['widget.*', 'layout.*', 'Ext.data.*']);
- *
- * The callback function is optional.
- *
- * **Note** Using `Ext.require` at global scope will cause `{@link Ext#onReady}` and
- * `{@link Ext.app.Application#launch}` methods to be deferred until the required classes
- * are loaded. It is these cases where the callback function is most often unnecessary.
- *
- * ## Using Excludes
- *
- * Alternatively, you can exclude what you don't need:
- *
- * // Include everything except Ext.tree.*
- * Ext.exclude('Ext.tree.*').require('*');
- *
- * // Include all widgets except widget.checkbox* (this will exclude
- * // widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.)
- * Ext.exclude('widget.checkbox*').require('widget.*');
- *
- * # Dynamic Instantiation
- *
- * Another feature enabled by `Ext.Loader` is instantiation using class names or aliases.
- *
- * For example:
- *
- * var win = Ext.create({
- * xtype: 'window',
- *
- * // or
- * // xclass: 'Ext.window.Window'
- *
- * title: 'Hello'
- * });
- *
- * This form of creation can be useful if the type to create (`window` in the above) is
- * not known statically. Internally, `{@link Ext#method!create}` may need to *synchronously*
- * load the desired class and its requirements. Doing this will generate a warning in
- * the console:
- *
- * [Ext.Loader] Synchronously loading 'Ext.window.Window'...
- *
- * If you see these in your debug console, you should add the indicated class(es) to the
- * appropriate `requires` array (as above) or make an `{@link Ext#require}` call.
- *
- *
- * **Note** Using `{@link Ext#method!create}` has some performance overhead and is best reserved
- * for cases where the target class is not known until run-time.
- *
- * @class Ext.Loader
- * @singleton
- */
- Ext.Loader = (new function() {
- // @define Ext.Loader
- // @require Ext.Base
- // @require Ext.Class
- // @require Ext.ClassManager
- // @require Ext.mixin.Watchable
- // @require Ext.Function
- // @require Ext.Array
- // @require Ext.env.Ready
- var Loader = this,
- Manager = Ext.ClassManager,
- // this is an instance of Ext.Inventory
- Boot = Ext.Boot,
- Class = Ext.Class,
- Ready = Ext.env.Ready,
- alias = Ext.Function.alias,
- dependencyProperties = [
- 'extend',
- 'mixins',
- 'requires'
- ],
- isInHistory = {},
- history = [],
- readyListeners = [],
- usedClasses = [],
- _requiresMap = {},
- _config = {
- /**
- * @cfg {Boolean} [enabled=true]
- * Whether or not to enable the dynamic dependency loading feature.
- */
- enabled: true,
- /**
- * @cfg {Boolean} [scriptChainDelay=false]
- * millisecond delay between asynchronous script injection (prevents stack
- * overflow on some user agents) 'false' disables delay but potentially
- * increases stack load.
- */
- scriptChainDelay: false,
- /**
- * @cfg {Boolean} [disableCaching=true]
- * Appends current timestamp to script files to prevent caching.
- */
- disableCaching: true,
- /**
- * @cfg {String} [disableCachingParam="_dc"]
- * The get parameter name for the cache buster's timestamp.
- */
- disableCachingParam: '_dc',
- /**
- * @cfg {Object} paths
- * The mapping from namespaces to file paths
- *
- * {
- * 'Ext': '.', // This is set by default, Ext.layout.container.Container will be
- * // loaded from ./layout/Container.js
- *
- * 'My': './src/my_own_folder' // My.layout.Container will be loaded from
- * // ./src/my_own_folder/layout/Container.js
- * }
- *
- * Note that all relative paths are relative to the current HTML document.
- * If not being specified, for example, `Other.awesome.Class` will simply be
- * loaded from `"./Other/awesome/Class.js"`.
- */
- paths: Manager.paths,
- /**
- * @cfg {Boolean} preserveScripts
- * `false` to remove asynchronously loaded scripts, `true` to retain script
- * element for browser debugger compatibility and improved load performance.
- */
- preserveScripts: true,
- /**
- * @cfg {String} scriptCharset
- * Optional charset to specify encoding of dynamic script content.
- */
- scriptCharset: undefined
- },
- // These configs are delegated to Ext.Script and may need different names:
- delegatedConfigs = {
- disableCaching: true,
- disableCachingParam: true,
- preserveScripts: true,
- scriptChainDelay: 'loadDelay'
- };
- Ext.apply(Loader, {
- /**
- * @private
- */
- isInHistory: isInHistory,
- /**
- * Flag indicating whether there are still files being loaded
- * @private
- */
- isLoading: false,
- /**
- * An array of class names to keep track of the dependency loading order.
- * This is not guaranteed to be the same everytime due to the asynchronous
- * nature of the Loader.
- *
- * @property {Array} history
- */
- history: history,
- /**
- * Configuration
- * @private
- */
- config: _config,
- /**
- * Maintain the list of listeners to execute when all required scripts are fully loaded
- * @private
- */
- readyListeners: readyListeners,
- /**
- * Contains classes referenced in `uses` properties.
- * @private
- */
- optionalRequires: usedClasses,
- /**
- * Map of fully qualified class names to an array of dependent classes.
- * @private
- */
- requiresMap: _requiresMap,
- /** @private */
- hasFileLoadError: false,
- /**
- * The number of scripts loading via loadScript.
- * @private
- */
- scriptsLoading: 0,
- /**
- * @private
- */
- classesLoading: {},
- missingCount: 0,
- missingQueue: {},
- /**
- * @private
- */
- syncModeEnabled: false,
- init: function() {
- // initalize the default path of the framework
- var scripts = document.getElementsByTagName('script'),
- src = scripts[scripts.length - 1].src,
- path = src.substring(0, src.lastIndexOf('/') + 1),
- meta = Ext._classPathMetadata,
- microloader = Ext.Microloader,
- manifest = Ext.manifest,
- loadOrder, baseUrl, loadlen, l, loadItem;
- if (src.indexOf("packages/core/src/") !== -1) {
- path = path + "../../";
- } else if (src.indexOf("/core/src/class/") !== -1) {
- path = path + "../../../";
- }
- if (!Manager.getPath("Ext")) {
- Manager.setPath('Ext', path + 'src');
- }
- // Pull in Cmd generated metadata if available.
- if (meta) {
- Ext._classPathMetadata = null;
- Loader.addClassPathMappings(meta);
- }
- if (manifest) {
- loadOrder = manifest.loadOrder;
- // if the manifest paths were calculated as relative to the
- // bootstrap file, then we need to prepend Boot.baseUrl to the
- // paths before processing
- baseUrl = Ext.Boot.baseUrl;
- if (loadOrder && manifest.bootRelative) {
- for (loadlen = loadOrder.length , l = 0; l < loadlen; l++) {
- loadItem = loadOrder[l];
- loadItem.path = baseUrl + loadItem.path;
- loadItem.canonicalPath = true;
- }
- }
- }
- if (microloader) {
- Ready.block();
- microloader.onMicroloaderReady(function() {
- Ready.unblock();
- });
- }
- },
- /**
- * @method setConfig
- * Set the configuration for the loader. This should be called right after ext-(debug).js
- * is included in the page, and before Ext.onReady. i.e:
- *
- * <script type="text/javascript" src="ext-core-debug.js"></script>
- * <script type="text/javascript">
- * Ext.Loader.setConfig({
- * enabled: true,
- * paths: {
- * 'My': 'my_own_path'
- * }
- * });
- * </script>
- * <script type="text/javascript">
- * Ext.require(...);
- *
- * Ext.onReady(function() {
- * // application code here
- * });
- * </script>
- *
- * Refer to config options of {@link Ext.Loader} for the list of possible properties
- *
- * @param {Object} config The config object to override the default values
- * @return {Ext.Loader} this
- */
- setConfig: Ext.Function.flexSetter(function(name, value) {
- var delegated = delegatedConfigs[name];
- if (name === 'paths') {
- Loader.setPath(value);
- } else {
- _config[name] = value;
- if (delegated) {
- Boot.setConfig((delegated === true) ? name : delegated, value);
- }
- }
- return Loader;
- }),
- /**
- * Get the config value corresponding to the specified name. If no name is given,
- * will return the config object
- *
- * @param {String} name The config property name
- * @return {Object}
- */
- getConfig: function(name) {
- return name ? _config[name] : _config;
- },
- /**
- * Sets the path of a namespace.
- * For Example:
- *
- * Ext.Loader.setPath('Ext', '.');
- *
- * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter}
- * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter}
- * @return {Ext.Loader} this
- * @method
- */
- setPath: function() {
- // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
- Manager.setPath.apply(Manager, arguments);
- return Loader;
- },
- /**
- * Sets a batch of path entries
- *
- * @param {Object} paths a set of className: path mappings
- * @return {Ext.Loader} this
- */
- addClassPathMappings: function(paths) {
- // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
- Manager.setPath(paths);
- return Loader;
- },
- /**
- * fixes up loader path configs by prepending Ext.Boot#baseUrl to the beginning
- * of the path, then delegates to Ext.Loader#addClassPathMappings
- * @param pathConfig
- */
- addBaseUrlClassPathMappings: function(pathConfig) {
- var name;
- for (name in pathConfig) {
- pathConfig[name] = Boot.baseUrl + pathConfig[name];
- }
- Ext.Loader.addClassPathMappings(pathConfig);
- },
- /**
- * Translates a className to a file path by adding the
- * the proper prefix and converting the .'s to /'s. For example:
- *
- * Ext.Loader.setPath('My', '/path/to/My');
- *
- * // alerts '/path/to/My/awesome/Class.js'
- * alert(Ext.Loader.getPath('My.awesome.Class'));
- *
- * Note that the deeper namespace levels, if explicitly set, are always resolved first.
- * For example:
- *
- * Ext.Loader.setPath({
- * 'My': '/path/to/lib',
- * 'My.awesome': '/other/path/for/awesome/stuff',
- * 'My.awesome.more': '/more/awesome/path'
- * });
- *
- * // alerts '/other/path/for/awesome/stuff/Class.js'
- * alert(Ext.Loader.getPath('My.awesome.Class'));
- *
- * // alerts '/more/awesome/path/Class.js'
- * alert(Ext.Loader.getPath('My.awesome.more.Class'));
- *
- * // alerts '/path/to/lib/cool/Class.js'
- * alert(Ext.Loader.getPath('My.cool.Class'));
- *
- * // alerts 'Unknown/strange/Stuff.js'
- * alert(Ext.Loader.getPath('Unknown.strange.Stuff'));
- *
- * @param {String} className
- * @return {String} path
- */
- getPath: function(className) {
- // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
- return Manager.getPath(className);
- },
- require: function(expressions, fn, scope, excludes) {
- var classNames;
- if (excludes) {
- return Loader.exclude(excludes).require(expressions, fn, scope);
- }
- classNames = Manager.getNamesByExpression(expressions);
- return Loader.load(classNames, fn, scope);
- },
- syncRequire: function() {
- var wasEnabled = Loader.syncModeEnabled,
- ret;
- Loader.syncModeEnabled = true;
- ret = Loader.require.apply(Loader, arguments);
- Loader.syncModeEnabled = wasEnabled;
- return ret;
- },
- exclude: function(excludes) {
- var selector = Manager.select({
- require: function(classNames, fn, scope) {
- return Loader.load(classNames, fn, scope);
- },
- syncRequire: function(classNames, fn, scope) {
- var wasEnabled = Loader.syncModeEnabled,
- ret;
- Loader.syncModeEnabled = true;
- ret = Loader.load(classNames, fn, scope);
- Loader.syncModeEnabled = wasEnabled;
- return ret;
- }
- });
- selector.exclude(excludes);
- return selector;
- },
- load: function(classNames, callback, scope) {
- if (callback) {
- if (callback.length) {
- // If callback expects arguments, shim it with a function that will map
- // the requires class(es) from the names we are given.
- callback = Loader.makeLoadCallback(classNames, callback);
- }
- callback = callback.bind(scope || Ext.global);
- }
- /* eslint-disable-next-line vars-on-top */
- var state = Manager.classState,
- missingClassNames = [],
- urls = [],
- urlByClass = {},
- numClasses = classNames.length,
- className, i, numMissing;
- for (i = 0; i < numClasses; ++i) {
- className = Manager.resolveName(classNames[i]);
- if (!Manager.isCreated(className)) {
- missingClassNames.push(className);
- if (!state[className]) {
- urlByClass[className] = Loader.getPath(className);
- urls.push(urlByClass[className]);
- }
- }
- }
- // If the dynamic dependency feature is not being used, throw an error
- // if the dependencies are not defined
- numMissing = missingClassNames.length;
- if (numMissing) {
- Loader.missingCount += numMissing;
- Manager.onCreated(function() {
- if (callback) {
- Ext.callback(callback, scope, arguments);
- }
- Loader.checkReady();
- }, Loader, missingClassNames);
- if (!_config.enabled) {
- Ext.raise("Ext.Loader is not enabled, so dependencies cannot be resolved " + "dynamically. Missing required class" + ((missingClassNames.length > 1) ? "es" : "") + ": " + missingClassNames.join(', '));
- }
- if (urls.length) {
- Loader.loadScripts({
- url: urls,
- // scope will be this options object so we can pass these along:
- _classNames: missingClassNames,
- _urlByClass: urlByClass
- });
- } else {
- // need to call checkReady here, as the _missingCoun
- // may have transitioned from 0 to > 0, meaning we
- // need to block ready
- Loader.checkReady();
- }
- } else {
- if (callback) {
- callback.call(scope);
- }
- // need to call checkReady here, as the _missingCoun
- // may have transitioned from 0 to > 0, meaning we
- // need to block ready
- Loader.checkReady();
- }
- if (Loader.syncModeEnabled) {
- // Class may have been just loaded or was already loaded
- if (numClasses === 1) {
- return Manager.get(classNames[0]);
- }
- }
- return Loader;
- },
- makeLoadCallback: function(classNames, callback) {
- return function() {
- var classes = [],
- i = classNames.length;
- while (i-- > 0) {
- classes[i] = Manager.get(classNames[i]);
- }
- return callback.apply(this, classes);
- };
- },
- onLoadFailure: function(request) {
- var options = this,
- entries = request.entries || [],
- onError = options.onError,
- error, entry, i;
- Loader.hasFileLoadError = true;
- --Loader.scriptsLoading;
- if (onError) {
- for (i = 0; i < entries.length; i++) {
- entry = entries[i];
- if (entry.error) {
- error = new Error('Failed to load: ' + entry.url);
- break;
- }
- }
- error = error || new Error('Failed to load');
- onError.call(options.userScope, options, error, request);
- } else {
- Ext.log.error("[Ext.Loader] Some requested files failed to load.");
- }
- Loader.checkReady();
- },
- onLoadSuccess: function() {
- var options = this,
- onLoad = options.onLoad,
- classNames = options._classNames,
- urlByClass = options._urlByClass,
- state = Manager.classState,
- missingQueue = Loader.missingQueue,
- className, i, len;
- --Loader.scriptsLoading;
- if (onLoad) {
- // TODO: need an adapter to convert to v4 onLoad signatures
- onLoad.call(options.userScope, options);
- }
- // onLoad can cause more loads to start, so it must run first
- // classNames is the array of *all* classes that load() was asked to load,
- // including those that might have been already loaded but not yet created.
- // urlByClass is a map of only those classes that we asked Boot to load.
- for (i = 0 , len = classNames.length; i < len; i++) {
- className = classNames[i];
- // When a script is loaded and executed, we should have Ext.define() called
- // for at least one of the classes in the list, which will set the state
- // for that class. That by itself does not mean that the class is available
- // *now* but it means that ClassManager is tracking it and will fire the
- // onCreated callback that we set back in load().
- // However if there is no state for the class, that may mean two things:
- // either it is not a Ext class, or it is truly missing. In any case we need
- // to watch for that thing ourselves, which we will do every checkReady().
- if (!state[className]) {
- missingQueue[className] = urlByClass[className];
- }
- }
- Loader.checkReady();
- },
- // TODO: this timing of this needs to be deferred until all classes have had
- // a chance to be created
- reportMissingClasses: function() {
- var missingQueue = Loader.missingQueue,
- missingClasses = [],
- missingPaths = [],
- missingClassName;
- if (!Loader.syncModeEnabled && !Loader.scriptsLoading && Loader.isLoading && !Loader.hasFileLoadError) {
- for (missingClassName in missingQueue) {
- missingClasses.push(missingClassName);
- missingPaths.push(missingQueue[missingClassName]);
- }
- if (missingClasses.length) {
- throw new Error("The following classes are not declared even if their files " + "have been loaded: '" + missingClasses.join("', '") + "'. Please check the source code of their " + "corresponding files for possible typos: '" + missingPaths.join("', '"));
- }
- }
- },
- /**
- * Add a new listener to be executed when all required scripts are fully loaded
- *
- * @param {Function} fn The function callback to be executed
- * @param {Object} scope The execution scope (`this`) of the callback function.
- * @param {Boolean} [withDomReady=true] Pass `false` to not also wait for document
- * dom ready.
- * @param {Object} [options] Additional callback options.
- * @param {Number} [options.delay=0] A number of milliseconds to delay.
- * @param {Number} [options.priority=0] Relative priority of this callback. Negative
- * numbers are reserved.
- */
- onReady: function(fn, scope, withDomReady, options) {
- var listener;
- if (withDomReady) {
- Ready.on(fn, scope, options);
- } else {
- listener = Ready.makeListener(fn, scope, options);
- if (Loader.isLoading) {
- readyListeners.push(listener);
- } else {
- Ready.invoke(listener);
- }
- }
- },
- /**
- * @private
- * Ensure that any classes referenced in the `uses` property are loaded.
- */
- addUsedClasses: function(classes) {
- var cls, i, ln;
- if (classes) {
- classes = (typeof classes === 'string') ? [
- classes
- ] : classes;
- for (i = 0 , ln = classes.length; i < ln; i++) {
- cls = classes[i];
- if (typeof cls === 'string' && !Ext.Array.contains(usedClasses, cls)) {
- usedClasses.push(cls);
- }
- }
- }
- return Loader;
- },
- /**
- * @private
- */
- triggerReady: function() {
- var listener,
- refClasses = usedClasses;
- if (Loader.isLoading && refClasses.length) {
- // Empty the array to eliminate potential recursive loop issue
- usedClasses = [];
- // this may immediately call us back if all 'uses' classes
- // have been loaded
- Loader.require(refClasses);
- } else {
- // Must clear this before calling callbacks. This will cause any new loads
- // to call Ready.block() again. See below for more on this.
- Loader.isLoading = false;
- // These listeners are just those attached directly to Loader to wait for
- // class loading only.
- readyListeners.sort(Ready.sortFn);
- // this method can be called with Loader.isLoading either true or false
- // (can be called with false when all 'uses' classes are already loaded)
- // this may bypass the above if condition
- while (readyListeners.length && !Loader.isLoading) {
- // we may re-enter triggerReady so we cannot necessarily iterate the
- // readyListeners array
- listener = readyListeners.pop();
- Ready.invoke(listener);
- }
- // If the DOM is also ready, this will fire the normal onReady listeners.
- // An astute observer would note that we may now be back to isLoading and
- // so ask "Why you call unblock?". The reason is that we must match the
- // calls to block and since we transitioned from isLoading to !isLoading
- // here we must call unblock. If we have transitioned back to isLoading in
- // the above loop it will have called block again so the counter will be
- // increased and this call will not reduce the block count to 0. This is
- // done by loadScripts.
- Ready.unblock();
- }
- },
- /**
- * @private
- * @param {String} className
- */
- historyPush: function(className) {
- if (className && !isInHistory[className] && !Manager.overrideMap[className]) {
- isInHistory[className] = true;
- history.push(className);
- }
- return Loader;
- },
- /**
- * This is an internal method that delegate content loading to the
- * bootstrap layer.
- * @private
- * @param params
- */
- loadScripts: function(params) {
- var manifest = Ext.manifest,
- loadOrder = manifest && manifest.loadOrder,
- loadOrderMap = manifest && manifest.loadOrderMap,
- options;
- ++Loader.scriptsLoading;
- // if the load order map hasn't been created, create it now
- // and cache on the manifest
- if (loadOrder && !loadOrderMap) {
- manifest.loadOrderMap = loadOrderMap = Boot.createLoadOrderMap(loadOrder);
- }
- // verify the loading state, as this may have transitioned us from
- // not loading to loading
- Loader.checkReady();
- options = Ext.apply({
- loadOrder: loadOrder,
- loadOrderMap: loadOrderMap,
- charset: _config.scriptCharset,
- success: Loader.onLoadSuccess,
- failure: Loader.onLoadFailure,
- sync: Loader.syncModeEnabled,
- _classNames: []
- }, params);
- options.userScope = options.scope;
- options.scope = options;
- Boot.load(options);
- },
- /**
- * This method is provide for use by the bootstrap layer.
- * @private
- * @param {String[]} urls
- */
- loadScriptsSync: function(urls) {
- var syncwas = Loader.syncModeEnabled;
- Loader.syncModeEnabled = true;
- Loader.loadScripts({
- url: urls
- });
- Loader.syncModeEnabled = syncwas;
- },
- /**
- * This method is provide for use by the bootstrap layer.
- * @private
- * @param {String[]} urls
- */
- loadScriptsSyncBasePrefix: function(urls) {
- var syncwas = Loader.syncModeEnabled;
- Loader.syncModeEnabled = true;
- Loader.loadScripts({
- url: urls,
- prependBaseUrl: true
- });
- Loader.syncModeEnabled = syncwas;
- },
- /**
- * Loads the specified script URL and calls the supplied callbacks. If this method
- * is called before {@link Ext#isReady}, the script's load will delay the transition
- * to ready. This can be used to load arbitrary scripts that may contain further
- * {@link Ext#require Ext.require} calls.
- *
- * @param {Object/String/String[]} options The options object or simply the URL(s) to load.
- * @param {String} options.url The URL from which to load the script.
- * @param {Function} [options.onLoad] The callback to call on successful load.
- * @param {Function} [options.onError] The callback to call on failure to load.
- * @param {Object} [options.scope] The scope (`this`) for the supplied callbacks.
- */
- loadScript: function(options) {
- var isString = typeof options === 'string',
- isArray = options instanceof Array,
- isObject = !isArray && !isString,
- url = isObject ? options.url : options,
- onError = isObject && options.onError,
- onLoad = isObject && options.onLoad,
- scope = isObject && options.scope,
- request = {
- url: url,
- scope: scope,
- onLoad: onLoad,
- onError: onError,
- _classNames: []
- };
- Loader.loadScripts(request);
- },
- /**
- * @private
- */
- checkMissingQueue: function() {
- var missingQueue = Loader.missingQueue,
- newQueue = {},
- missing = 0,
- name;
- for (name in missingQueue) {
- // If class state is available for the name, that means ClassManager
- // is tracking it and will fire callback when it is created.
- // We only need to track non-class things in the Loader.
- if (!(Manager.classState[name] || Manager.isCreated(name))) {
- newQueue[name] = missingQueue[name];
- missing++;
- }
- }
- Loader.missingCount = missing;
- Loader.missingQueue = newQueue;
- },
- /**
- * @private
- */
- checkReady: function() {
- var wasLoading = Loader.isLoading,
- isLoading;
- Loader.checkMissingQueue();
- isLoading = Loader.missingCount + Loader.scriptsLoading;
- if (isLoading && !wasLoading) {
- Ready.block();
- Loader.isLoading = !!isLoading;
- } else if (!isLoading && wasLoading) {
- Loader.triggerReady();
- }
- if (!Loader.scriptsLoading && Loader.missingCount) {
- // Things look bad, but since load requests may come later, defer this
- // for a bit then check if things are still stuck.
- Ext.defer(function() {
- var name;
- if (!Loader.scriptsLoading && Loader.missingCount) {
- Ext.log.error('[Loader] The following classes failed to load:');
- for (name in Loader.missingQueue) {
- Ext.log.error('[Loader] ' + name + ' from ' + Loader.missingQueue[name]);
- }
- }
- }, 1000);
- }
- }
- });
- /**
- * Loads all classes by the given names and all their direct dependencies; optionally
- * executes the given callback function when finishes, within the optional scope.
- *
- * @param {String/String[]} expressions The class, classes or wildcards to load.
- * @param {Function} [fn] The callback function.
- * @param {Object} [scope] The execution scope (`this`) of the callback function.
- * @member Ext
- * @method require
- */
- Ext.require = alias(Loader, 'require');
- /**
- * Synchronously loads all classes by the given names and all their direct dependencies;
- * optionally executes the given callback function when finishes, within the optional scope.
- *
- * @param {String/String[]} expressions The class, classes or wildcards to load.
- * @param {Function} [fn] The callback function.
- * @param {Object} [scope] The execution scope (`this`) of the callback function.
- * @member Ext
- * @method syncRequire
- */
- Ext.syncRequire = alias(Loader, 'syncRequire');
- /**
- * Explicitly exclude files from being loaded. Useful when used in conjunction with a
- * broad include expression. Can be chained with more `require` and `exclude` methods,
- * for example:
- *
- * Ext.exclude('Ext.data.*').require('*');
- *
- * Ext.exclude('widget.button*').require('widget.*');
- *
- * @param {String/String[]} excludes
- * @return {Object} Contains `exclude`, `require` and `syncRequire` methods for chaining.
- * @member Ext
- * @method exclude
- */
- Ext.exclude = alias(Loader, 'exclude');
- /**
- * @cfg {String[]} requires
- * @member Ext.Class
- * List of classes that have to be loaded before instantiating this class.
- * For example:
- *
- * Ext.define('Mother', {
- * requires: ['Child'],
- * giveBirth: function() {
- * // we can be sure that child class is available.
- * return new Child();
- * }
- * });
- */
- Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) {
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(cls, 'Ext.Loader#loaderPreprocessor', arguments);
- }
- /* eslint-disable-next-line vars-on-top */
- var me = this,
- dependencies = [],
- dependency,
- className = Manager.getName(cls),
- i, j, ln, subLn, value, propertyName, propertyValue, requiredMap;
- /*
- Loop through the dependencyProperties, look for string class names and push
- them into a stack, regardless of whether the property's value is a string, array or object.
- For example:
- {
- extend: 'Ext.MyClass',
- requires: ['Ext.some.OtherClass'],
- mixins: {
- thing: 'Foo.bar.Thing';
- }
- }
- which will later be transformed into:
- {
- extend: Ext.MyClass,
- requires: [Ext.some.OtherClass],
- mixins: {
- thing: Foo.bar.Thing;
- }
- }
- */
- for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
- propertyName = dependencyProperties[i];
- if (data.hasOwnProperty(propertyName)) {
- propertyValue = data[propertyName];
- if (typeof propertyValue === 'string') {
- dependencies.push(propertyValue);
- } else if (propertyValue instanceof Array) {
- for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
- value = propertyValue[j];
- if (typeof value === 'string') {
- dependencies.push(value);
- }
- }
- } else if (typeof propertyValue !== 'function') {
- for (j in propertyValue) {
- if (propertyValue.hasOwnProperty(j)) {
- value = propertyValue[j];
- if (typeof value === 'string') {
- dependencies.push(value);
- }
- }
- }
- }
- }
- }
- if (dependencies.length === 0) {
- return;
- }
- if (className) {
- _requiresMap[className] = dependencies;
- }
- /* eslint-disable-next-line vars-on-top */
- var manifestClasses = Ext.manifest && Ext.manifest.classes,
- deadlockPath = [],
- detectDeadlock;
- /*
- * Automatically detect deadlocks before-hand,
- * will throw an error with detailed path for ease of debugging. Examples
- * of deadlock cases:
- *
- * - A extends B, then B extends A
- * - A requires B, B requires C, then C requires A
- *
- * The detectDeadlock function will recursively transverse till the leaf, hence
- * it can detect deadlocks no matter how deep the path is. However we don't need
- * to run this check if the class name is in the manifest: that means Cmd has
- * already resolved all dependencies for this class with no deadlocks.
- */
- if (className && (!manifestClasses || !manifestClasses[className])) {
- requiredMap = Loader.requiredByMap || (Loader.requiredByMap = {});
- for (i = 0 , ln = dependencies.length; i < ln; i++) {
- dependency = dependencies[i];
- (requiredMap[dependency] || (requiredMap[dependency] = [])).push(className);
- }
- detectDeadlock = function(cls) {
- var requires = _requiresMap[cls],
- dep, i, ln;
- deadlockPath.push(cls);
- if (requires) {
- if (Ext.Array.contains(requires, className)) {
- Ext.Error.raise("Circular requirement detected! '" + className + "' and '" + deadlockPath[1] + "' mutually require each other. " + "Path: " + deadlockPath.join(' -> ') + " -> " + deadlockPath[0]);
- }
- for (i = 0 , ln = requires.length; i < ln; i++) {
- dep = requires[i];
- if (!isInHistory[dep]) {
- detectDeadlock(requires[i]);
- }
- }
- }
- };
- detectDeadlock(className);
- }
- (className ? Loader.exclude(className) : Loader).require(dependencies, function() {
- var i, ln, j, subLn, k;
- for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
- propertyName = dependencyProperties[i];
- if (data.hasOwnProperty(propertyName)) {
- propertyValue = data[propertyName];
- if (typeof propertyValue === 'string') {
- data[propertyName] = Manager.get(propertyValue);
- } else if (propertyValue instanceof Array) {
- for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
- value = propertyValue[j];
- if (typeof value === 'string') {
- data[propertyName][j] = Manager.get(value);
- }
- }
- } else if (typeof propertyValue !== 'function') {
- for (k in propertyValue) {
- if (propertyValue.hasOwnProperty(k)) {
- value = propertyValue[k];
- if (typeof value === 'string') {
- data[propertyName][k] = Manager.get(value);
- }
- }
- }
- }
- }
- }
- continueFn.call(me, cls, data, hooks);
- });
- return false;
- }, true, 'after', 'className');
- /**
- * @cfg {String[]} uses
- * @member Ext.Class
- * List of optional classes to load together with this class. These aren't neccessarily loaded
- * before this class is created, but are guaranteed to be available before Ext.onReady
- * listeners are invoked. For example:
- *
- * Ext.define('Mother', {
- * uses: ['Child'],
- * giveBirth: function() {
- * // This code might, or might not work:
- * // return new Child();
- *
- * // Instead use Ext.create() to load the class at the spot if not loaded already:
- * return Ext.create('Child');
- * }
- * });
- */
- Manager.registerPostprocessor('uses', function(name, cls, data) {
- var uses = data.uses,
- classNames;
- if (Ext.classSystemMonitor) {
- Ext.classSystemMonitor(cls, 'Ext.Loader#usesPostprocessor', arguments);
- }
- if (uses) {
- classNames = Manager.getNamesByExpression(data.uses);
- Loader.addUsedClasses(classNames);
- }
- });
- Manager.onCreated(Loader.historyPush);
- Loader.init();
- }());
- //-----------------------------------------------------------------------------
- // Use performance.now when available to keep timestamps consistent.
- Ext._endTime = Ext.ticks();
- // This hook is to allow tools like DynaTrace to deterministically detect the availability
- // of Ext.onReady. Since Loader takes over Ext.onReady this must be done here and not in
- // Ext.env.Ready.
- if (Ext._beforereadyhandler) {
- Ext._beforereadyhandler();
- }
- /**
- * @class Ext.util.Positionable
- */
- Ext.define('Ext.overrides.util.Positionable', {
- override: 'Ext.util.Positionable',
- /**
- * @method alignTo
- * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
- * HTMLElement, or id of the element to align to.
- * @param {String} [alignment="tl-bl?"] The position to align to
- * @param {Number[]} [offsets] Offset the positioning by [x, y]
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object
- * @return {Ext.util.Positionable} this
- */
- /**
- * @method anchorTo
- * Anchors an element to another element and realigns it when the window is resized.
- * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
- * HTMLElement, or id of the element to align to.
- * @param {String} [alignment="tl-bl?"] The position to align to
- * @param {Number[]} [offsets] Offset the positioning by [x, y]
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object
- * @param {Boolean/Number} [monitorScroll=50] True to monitor body scroll and
- * reposition. If this parameter is a number, it is used as the buffer delay in
- * milliseconds.
- * @param {Function} [callback] The function to call after the animation finishes
- * @return {Ext.util.Positionable} this
- */
- anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
- var me = this,
- scroll = !Ext.isEmpty(monitorScroll),
- action = function() {
- me.mixins.positionable.alignTo.call(me, anchorToEl, alignment, offsets, animate);
- Ext.callback(callback, me);
- },
- anchor = me.getAnchor();
- // previous listener anchor, remove it
- me.removeAnchor();
- Ext.apply(anchor, {
- fn: action,
- scroll: scroll
- });
- Ext.on('resize', action, null);
- if (scroll) {
- Ext.getWin().on('scroll', action, null, {
- buffer: !isNaN(monitorScroll) ? monitorScroll : 50
- });
- }
- action();
- // align immediately
- return me;
- },
- getAnchor: function() {
- var el = this.el,
- data, anchor;
- if (!el || !el.dom) {
- return;
- }
- data = el.getData();
- anchor = data._anchor;
- if (!anchor) {
- anchor = data._anchor = {};
- }
- return anchor;
- },
- alignTo: function(element, position, offsets, /* private (documented in ext) */
- animate) {
- var me = this,
- el = me.el,
- newMaxHeight, newRegion;
- // Release any height constraint prior to aligning if we are shrinkwrap height.
- if (me.isComponent && me.getSizeModel().height.shrinkWrap) {
- if (me.maxHeight) {
- me.setMaxHeight(null);
- }
- newMaxHeight = true;
- }
- newRegion = me.getAlignToRegion(element, position, offsets, me.minHeight || 150);
- me.setXY([
- newRegion.x,
- newRegion.y
- ], el.anim && !!animate ? el.anim(animate) : false);
- // Impose calculated height constraint.
- if (newMaxHeight && (newMaxHeight = newRegion.getHeight()) !== me.getHeight()) {
- me.setMaxHeight(newMaxHeight);
- }
- return me;
- },
- /**
- * @method move
- * Move the element relative to its current position.
- * @param {String} direction Possible values are:
- *
- * - `"l"` (or `"left"`)
- * - `"r"` (or `"right"`)
- * - `"t"` (or `"top"`, or `"up"`)
- * - `"b"` (or `"bottom"`, or `"down"`)
- *
- * @param {Number} distance How far to move the element in pixels
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object
- */
- /**
- * Remove any anchor to this element. See {@link #anchorTo}.
- * @return {Ext.util.Positionable} this
- */
- removeAnchor: function() {
- var anchor = this.getAnchor();
- if (anchor && anchor.fn) {
- Ext.un('resize', anchor.fn);
- if (anchor.scroll) {
- Ext.getWin().on('scroll', anchor.fn);
- }
- delete anchor.fn;
- }
- return this;
- },
- /**
- * @method setBox
- * Sets the element's box. If animate is true then x, y, width, and height will be
- * animated concurrently.
- * @param {Object} box The box to fill {x, y, width, height}
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object
- * @return {Ext.util.Positionable} this
- */
- setBox: function(box, animate) {
- var me = this;
- if (box.isRegion) {
- box = {
- x: box.left,
- y: box.top,
- width: box.right - box.left,
- height: box.bottom - box.top
- };
- }
- if (animate) {
- me.constrainBox(box);
- me.animate(Ext.applyIf({
- to: box,
- listeners: {
- afteranimate: Ext.Function.bind(me.afterSetPosition, me, [
- box.x,
- box.y
- ])
- }
- }, animate));
- } else {
- me.callParent([
- box
- ]);
- }
- return me;
- }
- });
- /**
- * @method setX
- * Sets the X position of the DOM element based on page coordinates.
- * @param {Number} x The X position
- * @param {Boolean/Object} [animate] True for the default animation, or a standard
- * Element animation config object
- * @return {Ext.util.Positionable} this
- */
- /**
- * @method setXY
- * Sets the position of the DOM element in page coordinates.
- * @param {Number[]} pos Contains X & Y [x, y] values for new position (coordinates
- * are page-based)
- * @param {Boolean/Object} [animate] True for the default animation, or a standard
- * Element animation config object
- * @return {Ext.util.Positionable} this
- */
- /**
- * @method setY
- * Sets the Y position of the DOM element based on page coordinates.
- * @param {Number} y The Y position
- * @param {Boolean/Object} [animate] True for the default animation, or a standard
- * Element animation config object
- * @return {Ext.util.Positionable} this
- */
- /**
- * @class Ext.event.Event
- */
- Ext.define('Ext.overrides.event.Event', {
- override: 'Ext.event.Event',
- /**
- * @method injectEvent
- * @member Ext.event.Event
- * Injects a DOM event using the data in this object and (optionally) a new target.
- * This is a low-level technique and not likely to be used by application code. The
- * currently supported event types are:
- * <p><b>HTMLEvents</b></p>
- * <ul>
- * <li>load</li>
- * <li>unload</li>
- * <li>select</li>
- * <li>change</li>
- * <li>submit</li>
- * <li>reset</li>
- * <li>resize</li>
- * <li>scroll</li>
- * </ul>
- * <p><b>MouseEvents</b></p>
- * <ul>
- * <li>click</li>
- * <li>dblclick</li>
- * <li>mousedown</li>
- * <li>mouseup</li>
- * <li>mouseover</li>
- * <li>mousemove</li>
- * <li>mouseout</li>
- * </ul>
- * <p><b>UIEvents</b></p>
- * <ul>
- * <li>focusin</li>
- * <li>focusout</li>
- * <li>activate</li>
- * <li>focus</li>
- * <li>blur</li>
- * </ul>
- * @param {Ext.Element/HTMLElement} target (optional) If specified, the target for the event.
- * This is likely to be used when relaying a DOM event. If not specified, {@link #getTarget}
- * is used to determine the target.
- */
- injectEvent: (function() {
- var API,
- dispatchers = {},
- // keyed by event type (e.g., 'mousedown')
- crazyIEButtons;
- // Good reference: http://developer.yahoo.com/yui/docs/UserAction.js.html
- // IE9 has createEvent, but this code causes major problems with htmleditor (it
- // blocks all mouse events and maybe more). TODO
- if (!Ext.isIE9m && document.createEvent) {
- // if (DOM compliant)
- API = {
- createHtmlEvent: function(doc, type, bubbles, cancelable) {
- var event = doc.createEvent('HTMLEvents');
- event.initEvent(type, bubbles, cancelable);
- return event;
- },
- createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
- var event = doc.createEvent('MouseEvents'),
- view = doc.defaultView || window;
- if (event.initMouseEvent) {
- event.initMouseEvent(type, bubbles, cancelable, view, detail, clientX, clientY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
- } else {
- // old Safari
- event = doc.createEvent('UIEvents');
- event.initEvent(type, bubbles, cancelable);
- event.view = view;
- event.detail = detail;
- event.screenX = clientX;
- event.screenY = clientY;
- event.clientX = clientX;
- event.clientY = clientY;
- event.ctrlKey = ctrlKey;
- event.altKey = altKey;
- event.metaKey = metaKey;
- event.shiftKey = shiftKey;
- event.button = button;
- event.relatedTarget = relatedTarget;
- }
- return event;
- },
- createUIEvent: function(doc, type, bubbles, cancelable, detail) {
- var event = doc.createEvent('UIEvents'),
- view = doc.defaultView || window;
- event.initUIEvent(type, bubbles, cancelable, view, detail);
- return event;
- },
- fireEvent: function(target, type, event) {
- target.dispatchEvent(event);
- }
- };
- } else if (document.createEventObject) {
- // else if (IE)
- crazyIEButtons = {
- 0: 1,
- 1: 4,
- 2: 2
- };
- API = {
- createHtmlEvent: function(doc, type, bubbles, cancelable) {
- var event = doc.createEventObject();
- event.bubbles = bubbles;
- event.cancelable = cancelable;
- return event;
- },
- createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
- var event = doc.createEventObject();
- event.bubbles = bubbles;
- event.cancelable = cancelable;
- event.detail = detail;
- event.screenX = clientX;
- event.screenY = clientY;
- event.clientX = clientX;
- event.clientY = clientY;
- event.ctrlKey = ctrlKey;
- event.altKey = altKey;
- event.shiftKey = shiftKey;
- event.metaKey = metaKey;
- event.button = crazyIEButtons[button] || button;
- event.relatedTarget = relatedTarget;
- // cannot assign to/fromElement
- return event;
- },
- createUIEvent: function(doc, type, bubbles, cancelable, detail) {
- var event = doc.createEventObject();
- event.bubbles = bubbles;
- event.cancelable = cancelable;
- return event;
- },
- fireEvent: function(target, type, event) {
- target.fireEvent('on' + type, event);
- }
- };
- }
- //----------------
- // HTMLEvents
- Ext.Object.each({
- load: [
- false,
- false
- ],
- unload: [
- false,
- false
- ],
- select: [
- true,
- false
- ],
- change: [
- true,
- false
- ],
- submit: [
- true,
- true
- ],
- reset: [
- true,
- false
- ],
- resize: [
- true,
- false
- ],
- scroll: [
- true,
- false
- ]
- }, function(name, value) {
- var bubbles = value[0],
- cancelable = value[1];
- dispatchers[name] = function(targetEl, srcEvent) {
- var e = API.createHtmlEvent(name, bubbles, cancelable);
- API.fireEvent(targetEl, name, e);
- };
- });
- //----------------
- // MouseEvents
- function createMouseEventDispatcher(type, detail) {
- var cancelable = (type !== 'mousemove');
- return function(targetEl, srcEvent) {
- var xy = srcEvent.getXY(),
- e;
- e = API.createMouseEvent(targetEl.ownerDocument, type, true, cancelable, detail, xy[0], xy[1], srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey, srcEvent.button, srcEvent.relatedTarget);
- API.fireEvent(targetEl, type, e);
- };
- }
- Ext.each([
- 'click',
- 'dblclick',
- 'mousedown',
- 'mouseup',
- 'mouseover',
- 'mousemove',
- 'mouseout'
- ], function(eventName) {
- dispatchers[eventName] = createMouseEventDispatcher(eventName, 1);
- });
- //----------------
- // UIEvents
- Ext.Object.each({
- focusin: [
- true,
- false
- ],
- focusout: [
- true,
- false
- ],
- activate: [
- true,
- true
- ],
- focus: [
- false,
- false
- ],
- blur: [
- false,
- false
- ]
- }, function(name, value) {
- var bubbles = value[0],
- cancelable = value[1];
- dispatchers[name] = function(targetEl, srcEvent) {
- var e = API.createUIEvent(targetEl.ownerDocument, name, bubbles, cancelable, 1);
- API.fireEvent(targetEl, name, e);
- };
- });
- //---------
- if (!API) {
- // not even sure what ancient browsers fall into this category...
- dispatchers = {};
- // never mind all those we just built :P
- API = {};
- }
- function cannotInject(target, srcEvent) {}
- // TODO log something
- return function(target) {
- var me = this,
- dispatcher = dispatchers[me.type] || cannotInject,
- t = target ? (target.dom || target) : me.getTarget();
- dispatcher(t, me);
- };
- }()),
- // call to produce method
- preventDefault: function(browserOnly) {
- var me = this,
- event = me.browserEvent,
- parentEvent = me.parentEvent,
- unselectable, target, fn;
- // This check is for IE8/9. The event object may have been
- // invalidated, so we can't delve into the details of it. If so,
- // just fall out gracefully and don't attempt to do anything.
- // eslint-disable-next-line valid-typeof
- if (typeof event.type !== 'unknown') {
- // In some cases we want to prevent default on the browser event
- // but keep propagating it through our event system. For example,
- // in Checkbox selection where the cells with checkboxes should
- // prevent focusing on mousedown but still fire the click event.
- if (!browserOnly) {
- me.defaultPrevented = true;
- }
- // if the event was created by prototype-chaining a new object to an existing event
- // instance, we need to make sure the parent event is defaultPrevented as well.
- if (parentEvent) {
- parentEvent.defaultPrevented = true;
- }
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- // The purpose of the code below is for preventDefault to stop focus from
- // occurring like it does in other modern browsers. This only happens in
- // IE8/9 when using attachEvent. The use of unselectable seems the most reliable
- // way to prevent this from happening. We need to use a timeout to restore the
- // unselectable state because if we don't setting it has no effect. It's important
- // to set the atrribute to 'on' as opposed to just setting the property on the
- // DOM element. See the link below for a discussion on the issue:
- // http://bugs.jquery.com/ticket/10345
- if (event.type === 'mousedown') {
- target = event.target;
- unselectable = target.getAttribute('unselectable');
- if (unselectable !== 'on') {
- target.setAttribute('unselectable', 'on');
- fn = function() {
- target.setAttribute('unselectable', unselectable);
- };
- // This function is hard to track, with a potential to be called
- // for any HtmlElement in the document. It may be a Fly, it may
- // not belong to any Component, and it may even be created by
- // 3rd party code that we have no control over and cannot intercept
- // the element being destroyed.
- // On the other hand, the function is pretty simple, cannot lead
- // to memory leaks and is only fired once. So, no harm no foul.
- fn.$skipTimerCheck = true;
- Ext.defer(fn, 1);
- }
- }
- // IE9 and earlier do not support preventDefault
- event.returnValue = false;
- // Some keys events require setting the keyCode to -1 to be prevented
- // all ctrl + X and F1 -> F12
- if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
- event.keyCode = -1;
- }
- }
- }
- return me;
- },
- deprecated: {
- '5.0': {
- methods: {
- /**
- * @method clone
- * @member Ext.event.Event
- * Clones this event.
- * @return {Ext.event.Event} The cloned copy
- * @deprecated 5.0.0 This method is deprecated.
- */
- clone: function() {
- return new this.self(this.browserEvent, this);
- }
- }
- }
- }
- }, function() {
- var Event = this,
- btnMap;
- if (Ext.isIE9m) {
- btnMap = {
- 0: 0,
- 1: 0,
- 4: 1,
- 2: 2
- };
- Event.override({
- statics: {
- /**
- * @member Ext.event.Event
- * When events are attached using IE's attachEvent API instead of
- * addEventListener accessing any members of an event object asynchronously
- * results in "Member not found" error. To work around this we fabricate
- * our own event object by copying all of its members to a new object.
- * @param {Event} browserEvent The native browser event object
- * @private
- * @static
- */
- enableIEAsync: function(browserEvent) {
- var name,
- fakeEvent = {};
- for (name in browserEvent) {
- fakeEvent[name] = browserEvent[name];
- }
- return fakeEvent;
- }
- },
- constructor: function(event, info, touchesMap, identifiers) {
- var me = this;
- me.callParent([
- event,
- info,
- touchesMap,
- identifiers
- ]);
- me.button = btnMap[event.button];
- if (event.type === 'contextmenu') {
- // IE8/9 reports click as 0, so we can at least attempt to infer here
- me.button = 2;
- }
- // IE8 can throw an error when trying to access properties on a browserEvent
- // object when the event has been buffered or delayed. Cache them here
- // so we can access them later.
- me.toElement = event.toElement;
- me.fromElement = event.fromElement;
- },
- mouseLeaveRe: /(mouseout|mouseleave)/,
- mouseEnterRe: /(mouseover|mouseenter)/,
- /**
- * @method enableIEAsync
- * @member Ext.event.Event
- * @inheritdoc Ext.event.Event#static-method-enableIEAsync
- * @private
- */
- enableIEAsync: function(browserEvent) {
- this.browserEvent = this.self.enableIEAsync(browserEvent);
- },
- getRelatedTarget: function(selector, maxDepth, returnEl) {
- var me = this,
- type, target;
- if (!me.relatedTarget) {
- type = me.type;
- if (me.mouseLeaveRe.test(type)) {
- target = me.toElement;
- } else if (me.mouseEnterRe.test(type)) {
- target = me.fromElement;
- }
- if (target) {
- me.relatedTarget = me.self.resolveTextNode(target);
- }
- }
- return me.callParent([
- selector,
- maxDepth,
- returnEl
- ]);
- }
- });
- // We place these listeners to capture Tab and Shift-Tab key strokes
- // and pass this information in the focus/blur event if it happens
- // between keydown/keyup pair.
- document.attachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
- document.attachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
- window.attachEvent('onunload', function() {
- document.detachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
- document.detachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
- });
- }
- });
- Ext.define('Ext.overrides.event.publisher.Dom', {
- override: 'Ext.event.publisher.Dom'
- }, function(DomPublisher) {
- var focusEvents = {
- focus: true,
- focusin: true,
- focusout: true,
- blur: true
- };
- if (Ext.isIE10m) {
- DomPublisher.override({
- isEventBlocked: function(e) {
- if (!focusEvents[e.type]) {
- return this.callParent([
- e
- ]);
- }
- // eslint-disable-next-line vars-on-top
- var body = document.body,
- ev = e.browserEvent,
- el = Ext.synchronouslyFocusing;
- /* eslint-disable max-len, brace-style */
- // This horrid hack is necessary to work around the issue with input elements
- // in IE10m that can fail to focus under certain conditions. See comment in
- // Ext.dom.Element override.
- if (el && ((ev.type === 'focusout' && (ev.srcElement === el || ev.srcElement === window) && ev.toElement === body) || (ev.type === 'focusin' && (ev.srcElement === body || ev.srcElement === window) && ev.fromElement === el && ev.toElement === null))) {
- return true;
- }
- /* eslint-enable max-len, brace-style */
- return false;
- }
- });
- }
- if (Ext.isIE9m) {
- // eslint-disable-next-line vars-on-top
- var docElement = document.documentElement,
- docBody = document.body,
- prototype = DomPublisher.prototype,
- onDirectEvent, onDirectCaptureEvent;
- // eslint-disable-line no-unused-vars
- prototype.target = document;
- prototype.directBoundListeners = {};
- // This method gets bound to the element scope in addDirectListener so that
- // the currentTarget can be captured using "this".
- onDirectEvent = function(e, publisher, capture) {
- e.target = e.srcElement || window;
- e.currentTarget = this;
- if (capture) {
- // Although directly attached capture listeners are not supported in IE9m
- // we still need to call the handler so at least the event fires.
- publisher.onDirectCaptureEvent(e);
- } else {
- publisher.onDirectEvent(e);
- }
- };
- onDirectCaptureEvent = function(e, publisher) {
- e.target = e.srcElement || window;
- e.currentTarget = this;
- // this, not DomPublisher
- publisher.onDirectCaptureEvent(e);
- };
- DomPublisher.override({
- addDelegatedListener: function(eventName) {
- this.delegatedListeners[eventName] = 1;
- // Use attachEvent for IE9 and below. Even though IE9 strict supports
- // addEventListener, it has issues with using synthetic events.
- this.target.attachEvent('on' + eventName, this.onDelegatedEvent);
- },
- removeDelegatedListener: function(eventName) {
- delete this.delegatedListeners[eventName];
- this.target.detachEvent('on' + eventName, this.onDelegatedEvent);
- },
- addDirectListener: function(eventName, element, capture) {
- var me = this,
- dom = element.dom,
- // binding the listener to the element allows us to capture the
- // "currentTarget" (see onDirectEvent)
- boundFn = Ext.Function.bind(onDirectEvent, dom, [
- me,
- capture
- ], true),
- directBoundListeners = me.directBoundListeners,
- handlers = directBoundListeners[eventName] || (directBoundListeners[eventName] = {});
- handlers[dom.id] = boundFn;
- // may be called with an SVG element here, which
- // does not have the attachEvent method on IE 9 strict
- if (dom.attachEvent) {
- dom.attachEvent('on' + eventName, boundFn);
- } else {
- me.callParent([
- eventName,
- element,
- capture
- ]);
- }
- },
- removeDirectListener: function(eventName, element, capture) {
- var dom = element.dom;
- if (dom.detachEvent) {
- dom.detachEvent('on' + eventName, this.directBoundListeners[eventName][dom.id]);
- } else {
- this.callParent([
- eventName,
- element,
- capture
- ]);
- }
- },
- doDelegatedEvent: function(e) {
- e.target = e.srcElement || window;
- if (e.type === 'focusin') {
- // IE8 sometimes happen to focus <html> element instead of the body
- // eslint-disable-next-line max-len
- e.relatedTarget = e.fromElement === docBody || e.fromElement === docElement ? null : e.fromElement;
- } else if (e.type === 'focusout') {
- // eslint-disable-next-line max-len
- e.relatedTarget = e.toElement === docBody || e.toElement === docElement ? null : e.toElement;
- }
- return this.callParent([
- e
- ]);
- }
- });
- // can't capture any events without addEventListener. Have to have direct
- // listeners for every event that does not bubble.
- Ext.apply(prototype.directEvents, prototype.captureEvents);
- // These do not bubble in IE9m so have to attach direct listeners as well.
- Ext.apply(prototype.directEvents, {
- change: 1,
- input: 1,
- paste: 1
- });
- prototype.captureEvents = {};
- }
- });
- Ext.define('Ext.overrides.event.publisher.Gesture', {
- override: 'Ext.event.publisher.Gesture'
- }, function() {
- if (Ext.isIE9m) {
- this.override({
- updateTouches: function(e, isEnd) {
- var browserEvent = e.browserEvent,
- xy = e.getXY();
- // I don't always set pageX and pageY on the event object, but when I do
- // it's because the Gesture publisher expects an event object that has them.
- browserEvent.pageX = xy[0];
- browserEvent.pageY = xy[1];
- this.callParent([
- e,
- isEnd
- ]);
- },
- doDelegatedEvent: function(e) {
- // Workaround IE's "Member not found" errors when accessing an event
- // object asynchronously. Needed for all gesture handlers because
- // they use requestAnimationFrame (see enableIEAsync for more details)
- this.callParent([
- Ext.event.Event.enableIEAsync(e)
- ]);
- }
- });
- }
- });
- /**
- * @class Ext.dom.Element
- * @override Ext.dom.Element
- */
- Ext.define('Ext.overrides.dom.Element', (function() {
- var Element,
- // we cannot do this yet "= Ext.dom.Element"
- WIN = window,
- DOC = document,
- HIDDEN = 'hidden',
- ISCLIPPED = 'isClipped',
- OVERFLOW = 'overflow',
- OVERFLOWX = 'overflow-x',
- OVERFLOWY = 'overflow-y',
- ORIGINALCLIP = 'originalClip',
- HEIGHT = 'height',
- WIDTH = 'width',
- VISIBILITY = 'visibility',
- DISPLAY = 'display',
- NONE = 'none',
- OFFSETS = 'offsets',
- CLIP = 'clip',
- ORIGINALDISPLAY = 'originalDisplay',
- VISMODE = 'visibilityMode',
- ISVISIBLE = 'isVisible',
- OFFSETCLASS = Ext.baseCSSPrefix + 'hidden-offsets',
- CLIPCLASS = Ext.baseCSSPrefix + 'hidden-clip',
- /* eslint-disable indent */
- boxMarkup = [
- '<div class="{0}-tl" role="presentation">',
- '<div class="{0}-tr" role="presentation">',
- '<div class="{0}-tc" role="presentation"></div>',
- '</div>',
- '</div>',
- '<div class="{0}-ml" role="presentation">',
- '<div class="{0}-mr" role="presentation">',
- '<div class="{0}-mc" role="presentation"></div>',
- '</div>',
- '</div>',
- '<div class="{0}-bl" role="presentation">',
- '<div class="{0}-br" role="presentation">',
- '<div class="{0}-bc" role="presentation"></div>',
- '</div>',
- '</div>'
- ].join(''),
- /* eslint-enable indent */
- scriptTagRe = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
- replaceScriptTagRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
- srcRe = /\ssrc=(['"])(.*?)\1/i,
- nonSpaceRe = /\S/,
- typeRe = /\stype=(['"])(.*?)\1/i,
- adjustDirect2DTableRe = /table-row|table-.*-group/,
- msRe = /^-ms-/,
- camelRe = /(-[a-z])/gi,
- camelReplaceFn = function(m, a) {
- return a.charAt(1).toUpperCase();
- },
- XMASKED = Ext.baseCSSPrefix + "masked",
- XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
- EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
- bodyRe = /^body/i,
- propertyCache = {},
- getVisMode = function(el) {
- var data = el.getData(),
- visMode = data[VISMODE];
- if (visMode === undefined) {
- data[VISMODE] = visMode = Element.VISIBILITY;
- }
- return visMode;
- },
- emptyRange = DOC.createRange ? DOC.createRange() : null,
- syncContentFly;
- if (Ext.isIE8) {
- // eslint-disable-next-line vars-on-top
- var garbageBin = DOC.createElement('div'),
- destroyQueue = [],
- // prevent memory leaks in IE8
- // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
- // This function is called to fully destroy an element on a timer so that code
- // following the remove call can still access the element.
- clearGarbage,
- clearGarbageFn = function() {
- var len = destroyQueue.length,
- i;
- for (i = 0; i < len; i++) {
- garbageBin.appendChild(destroyQueue[i]);
- }
- garbageBin.innerHTML = '';
- destroyQueue.length = 0;
- };
- clearGarbageFn.$skipTimerCheck = true;
- clearGarbage = Ext.Function.createBuffered(clearGarbageFn, 10);
- }
- return {
- override: 'Ext.dom.Element',
- mixins: [
- 'Ext.util.Animate'
- ],
- uses: [
- 'Ext.dom.GarbageCollector',
- 'Ext.dom.Fly',
- 'Ext.event.publisher.MouseEnterLeave',
- 'Ext.fx.Manager',
- 'Ext.fx.Anim'
- ],
- skipGarbageCollection: false,
- _init: function(E) {
- Element = E;
- // now we can poke this into closure scope
- // We want to expose destroyQueue on the prototype for testing purposes
- if (WIN.__UNIT_TESTING__) {
- E.destroyQueue = destroyQueue;
- }
- },
- statics: {
- normalize: function(prop) {
- if (prop === 'float') {
- prop = Ext.supports.Float ? 'cssFloat' : 'styleFloat';
- }
- // For '-ms-foo' we need msFoo
- return propertyCache[prop] || (propertyCache[prop] = prop.replace(msRe, 'ms-').replace(camelRe, camelReplaceFn));
- }
- },
- /**
- * Convenience method for constructing a KeyMap
- * @param {String/Number/Number[]/Object} key Either a string with the keys to listen for,
- * the numeric key code, array of key codes or an object with the following options:
- * @param {Number/Array} key.key
- * @param {Boolean} key.shift
- * @param {Boolean} key.ctrl
- * @param {Boolean} key.alt
- * @param {Function} fn The function to call
- * @param {Object} [scope] The scope (`this` reference) in which the specified function
- * is executed. Defaults to this Element.
- * @return {Ext.util.KeyMap} The KeyMap created
- */
- addKeyListener: function(key, fn, scope) {
- var config;
- if (typeof key !== 'object' || Ext.isArray(key)) {
- config = {
- target: this,
- key: key,
- fn: fn,
- scope: scope
- };
- } else {
- config = {
- target: this,
- key: key.key,
- shift: key.shift,
- ctrl: key.ctrl,
- alt: key.alt,
- fn: fn,
- scope: scope
- };
- }
- return new Ext.util.KeyMap(config);
- },
- /**
- * Creates a KeyMap for this element
- * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
- * @return {Ext.util.KeyMap} The KeyMap created
- */
- addKeyMap: function(config) {
- return new Ext.util.KeyMap(Ext.apply({
- target: this
- }, config));
- },
- /**
- * @private
- * Returns the fractional portion of this element's measurement in the given dimension.
- * (IE9+ only)
- * @return {Number}
- */
- adjustDirect2DDimension: function(dimension) {
- var me = this,
- dom = me.dom,
- display = me.getStyle('display'),
- inlineDisplay = dom.style.display,
- inlinePosition = dom.style.position,
- originIndex = dimension === WIDTH ? 0 : 1,
- currentStyle = dom.currentStyle,
- floating;
- if (display === 'inline') {
- dom.style.display = 'inline-block';
- }
- dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
- // floating will contain digits that appears after the decimal point
- // if height or width are set to auto we fallback to msTransformOrigin calculation
- // Use currentStyle here instead of getStyle. In some difficult to reproduce
- // instances it resets the scrollWidth of the element
- floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
- dom.style.position = inlinePosition;
- if (display === 'inline') {
- dom.style.display = inlineDisplay;
- }
- return floating;
- },
- /**
- * @private
- */
- afterAnimate: function() {
- var shadow = this.shadow;
- if (shadow && !shadow.disabled && !shadow.animate) {
- shadow.show();
- }
- },
- /**
- * @private
- */
- anchorAnimX: function(anchor) {
- var xName = (anchor === 'l') ? 'right' : 'left';
- this.dom.style[xName] = '0px';
- },
- /**
- * @private
- * process the passed fx configuration.
- */
- anim: function(config) {
- if (!Ext.isObject(config)) {
- return (config) ? {} : false;
- }
- // eslint-disable-next-line vars-on-top
- var me = this,
- duration = config.duration || Ext.fx.Anim.prototype.duration,
- easing = config.easing || 'ease',
- animConfig;
- if (config.stopAnimation) {
- me.stopAnimation();
- }
- Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
- // Clear any 'paused' defaults.
- Ext.fx.Manager.setFxDefaults(me.id, {
- delay: 0
- });
- animConfig = {
- // Pass the DOM reference. That's tested first so will be converted
- // to an Ext.fx.Target fastest.
- target: me.dom,
- remove: config.remove,
- alternate: config.alternate || false,
- duration: duration,
- easing: easing,
- callback: config.callback,
- listeners: config.listeners,
- iterations: config.iterations || 1,
- scope: config.scope,
- block: config.block,
- concurrent: config.concurrent,
- delay: config.delay || 0,
- paused: true,
- keyframes: config.keyframes,
- from: config.from || {},
- to: Ext.apply({}, config),
- userConfig: config
- };
- Ext.apply(animConfig.to, config.to);
- // Anim API properties - backward compat
- delete animConfig.to.to;
- delete animConfig.to.from;
- delete animConfig.to.remove;
- delete animConfig.to.alternate;
- delete animConfig.to.keyframes;
- delete animConfig.to.iterations;
- delete animConfig.to.listeners;
- delete animConfig.to.target;
- delete animConfig.to.paused;
- delete animConfig.to.callback;
- delete animConfig.to.scope;
- delete animConfig.to.duration;
- delete animConfig.to.easing;
- delete animConfig.to.concurrent;
- delete animConfig.to.block;
- delete animConfig.to.stopAnimation;
- delete animConfig.to.delay;
- return animConfig;
- },
- /**
- * Calls `{@link #addAnimation}` and returns this Element (for call chaining). For
- * details, see `{@link #addAnimation}`.
- *
- * @param {Object} config Configuration for {@link Ext.fx.Anim}.
- * Note that the {@link Ext.fx.Anim#to to} config is required.
- * @return {Ext.dom.Element} this
- */
- animate: function(config) {
- this.addAnimation(config);
- return this;
- },
- /**
- * Starts a custom animation on this Element.
- *
- * The following properties may be specified in `from`, `to`, and `keyframe` objects:
- *
- * - `x` - The page X position in pixels.
- * - `y` - The page Y position in pixels
- * - `left` - The element's CSS `left` value. Units must be supplied.
- * - `top` - The element's CSS `top` value. Units must be supplied.
- * - `width` - The element's CSS `width` value. Units must be supplied.
- * - `height` - The element's CSS `height` value. Units must be supplied.
- * - `scrollLeft` - The element's `scrollLeft` value.
- * - `scrollTop` - The element's `scrollTop` value.
- * - `opacity` - The element's `opacity` value (between `0` and `1`).
- *
- * **Be aware** that animating an Element which is being used by an Ext Component
- * without in some way informing the Component about the changed element state will
- * result in incorrect Component behaviour. This is because the Component will be
- * using the old state of the element. To avoid this problem, it is now possible
- * to directly animate certain properties of Components.
- *
- * @param {Object} config Configuration for {@link Ext.fx.Anim}.
- * Note that the {@link Ext.fx.Anim#to to} config is required.
- * @return {Ext.fx.Anim} The new animation.
- */
- addAnimation: function(config) {
- var me = this,
- animId = me.dom.id || Ext.id(me.dom),
- listeners, anim, end;
- if (!Ext.fx.Manager.hasFxBlock(animId)) {
- // Bit of gymnastics here to ensure our internal listeners get bound first
- if (config.listeners) {
- listeners = config.listeners;
- delete config.listeners;
- }
- if (config.internalListeners) {
- config.listeners = config.internalListeners;
- delete config.internalListeners;
- }
- end = config.autoEnd;
- delete config.autoEnd;
- anim = new Ext.fx.Anim(me.anim(config));
- anim.on({
- afteranimate: 'afterAnimate',
- beforeanimate: 'beforeAnimate',
- scope: me,
- single: true
- });
- if (listeners) {
- anim.on(listeners);
- }
- Ext.fx.Manager.queueFx(anim);
- if (end) {
- anim.jumpToEnd();
- }
- }
- return anim;
- },
- /**
- * @private
- */
- beforeAnimate: function() {
- var shadow = this.shadow;
- if (shadow && !shadow.disabled && !shadow.animate) {
- shadow.hide();
- }
- },
- /**
- * Wraps the specified element with a special 9 element markup/CSS block that renders
- * by default as a gray container with a gradient background, rounded corners
- * and a 4-way shadow.
- *
- * This special markup is used throughout Ext when box wrapping elements
- * ({@link Ext.button.Button}, {@link Ext.panel.Panel} when
- * {@link Ext.panel.Panel#frame frame=true}, {@link Ext.window.Window}).
- * The markup is of this form:
- *
- * <div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
- * <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
- * <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>
- *
- * Example usage:
- *
- * // Basic box wrap
- * Ext.get("foo").boxWrap();
- *
- * // You can also add a custom class and use CSS inheritance rules to customize
- * // the box look.
- * // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions
- * // as an example for how to create a custom box wrap style.
- * Ext.get("foo").boxWrap().addCls("x-box-blue");
- *
- * @param {String} [cls='x-box'] A base CSS class to apply to the containing wrapper
- * element. Note that there are a number of CSS rules that are dependent on this name
- * to make the overall effect work, so if you supply an alternate base class, make sure
- * you also supply all of the necessary rules.
- * @return {Ext.dom.Element} The outermost wrapping element of the created box structure.
- */
- boxWrap: function(cls) {
- var el;
- cls = cls || Ext.baseCSSPrefix + 'box';
- el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "' role='presentation'>" + Ext.String.format(boxMarkup, cls) + "</div>"));
- el.selectNode('.' + cls + '-mc').appendChild(this.dom);
- return el;
- },
- /**
- * Removes Empty, or whitespace filled text nodes. Combines adjacent text nodes.
- * @param {Boolean} [forceReclean=false] By default the element keeps track if it has been
- * cleaned already so you can call this over and over. However, if you update the element
- * and need to force a re-clean, you can pass true.
- */
- clean: function(forceReclean) {
- var me = this,
- dom = me.dom,
- data = me.getData(),
- n = dom.firstChild,
- ni = -1,
- nx;
- if (data.isCleaned && forceReclean !== true) {
- return me;
- }
- while (n) {
- nx = n.nextSibling;
- if (n.nodeType === 3) {
- // Remove empty/whitespace text nodes
- if (!(nonSpaceRe.test(n.nodeValue))) {
- dom.removeChild(n);
- }
- // Combine adjacent text nodes
- else if (nx && nx.nodeType === 3) {
- n.appendData(Ext.String.trim(nx.data));
- dom.removeChild(nx);
- nx = n.nextSibling;
- n.nodeIndex = ++ni;
- }
- } else {
- // Recursively clean
- Ext.fly(n, '_clean').clean();
- n.nodeIndex = ++ni;
- }
- n = nx;
- }
- data.isCleaned = true;
- return me;
- },
- /**
- * @method
- * Empties this element. Removes all child nodes.
- */
- empty: emptyRange ? function() {
- var dom = this.dom;
- if (dom.firstChild) {
- emptyRange.setStartBefore(dom.firstChild);
- emptyRange.setEndAfter(dom.lastChild);
- emptyRange.deleteContents();
- }
- } : function() {
- var dom = this.dom;
- while (dom.lastChild) {
- dom.removeChild(dom.lastChild);
- }
- },
- clearListeners: function() {
- this.removeAnchor();
- this.callParent();
- },
- /**
- * Clears positioning back to the default when the document was loaded.
- * @param {String} [value=''] The value to use for the left, right, top, bottom.
- * You could use 'auto'.
- * @return {Ext.dom.Element} this
- */
- clearPositioning: function(value) {
- value = value || '';
- return this.setStyle({
- left: value,
- right: value,
- top: value,
- bottom: value,
- 'z-index': '',
- position: 'static'
- });
- },
- /**
- * Creates a proxy element of this element
- * @param {String/Object} config The class name of the proxy element or a DomHelper config
- * object
- * @param {String/HTMLElement} [renderTo] The element or element id to render the proxy to.
- * Defaults to: document.body.
- * @param {Boolean} [matchBox=false] True to align and size the proxy to this element now.
- * @return {Ext.dom.Element} The new proxy element
- */
- createProxy: function(config, renderTo, matchBox) {
- config = (typeof config === 'object') ? config : {
- tag: "div",
- role: 'presentation',
- cls: config
- };
- // eslint-disable-next-line vars-on-top
- var me = this,
- proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true);
- proxy.setVisibilityMode(Element.DISPLAY);
- proxy.hide();
- // check to make sure Element_position.js is loaded
- if (matchBox && me.setBox && me.getBox) {
- proxy.setBox(me.getBox());
- }
- return proxy;
- },
- /**
- * Clears any opacity settings from this element. Required in some cases for IE.
- * @return {Ext.dom.Element} this
- */
- clearOpacity: function() {
- return this.setOpacity('');
- },
- /**
- * Store the current overflow setting and clip overflow on the element - use {@link #unclip}
- * to remove
- * @return {Ext.dom.Element} this
- */
- clip: function() {
- var me = this,
- data = me.getData(),
- style;
- if (!data[ISCLIPPED]) {
- data[ISCLIPPED] = true;
- style = me.getStyle([
- OVERFLOW,
- OVERFLOWX,
- OVERFLOWY
- ]);
- data[ORIGINALCLIP] = {
- o: style[OVERFLOW],
- x: style[OVERFLOWX],
- y: style[OVERFLOWY]
- };
- me.setStyle(OVERFLOW, HIDDEN);
- me.setStyle(OVERFLOWX, HIDDEN);
- me.setStyle(OVERFLOWY, HIDDEN);
- }
- return me;
- },
- destroy: function() {
- var me = this,
- dom = me.dom,
- data = me.peekData(),
- maskEl, maskMsg;
- if (dom) {
- if (me.isAnimate) {
- me.stopAnimation(true);
- }
- me.removeAnchor();
- }
- if (me.deferredFocusTimer) {
- Ext.undefer(me.deferredFocusTimer);
- me.deferredFocusTimer = null;
- }
- me.callParent();
- // prevent memory leaks in IE8
- // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
- // must not be document, documentElement, body or window object
- // Have to use != instead of !== for IE8 or it will not recognize that the window
- // objects are equal
- // eslint-disable-next-line eqeqeq
- if (dom && Ext.isIE8 && (dom.window != dom) && (dom.nodeType !== 9) && (dom.tagName !== 'BODY') && (dom.tagName !== 'HTML')) {
- destroyQueue[destroyQueue.length] = dom;
- // Will perform extra IE8 cleanup in 10 milliseconds
- // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
- clearGarbage();
- }
- if (data) {
- maskEl = data.maskEl;
- maskMsg = data.maskMsg;
- if (maskEl) {
- maskEl.destroy();
- }
- if (maskMsg) {
- maskMsg.destroy();
- }
- }
- },
- /**
- * Convenience method for setVisibilityMode(Element.DISPLAY).
- * @param {String} [display] What to set display to when visible
- * @return {Ext.dom.Element} this
- */
- enableDisplayMode: function(display) {
- var me = this;
- me.setVisibilityMode(Element.DISPLAY);
- if (display !== undefined) {
- me.getData()[ORIGINALDISPLAY] = display;
- }
- return me;
- },
- /**
- * Fade an element in (from transparent to opaque). The ending opacity can be specified
- * using the `opacity` config option. Usage:
- *
- * // default: fade in from opacity 0 to 100%
- * el.fadeIn();
- *
- * // custom: fade in from opacity 0 to 75% over 2 seconds
- * el.fadeIn({ opacity: .75, duration: 2000});
- *
- * // common config options shown with default values
- * el.fadeIn({
- * opacity: 1, //can be any value between 0 and 1 (e.g. .5)
- * easing: 'easeOut',
- * duration: 500
- * });
- *
- * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- fadeIn: function(options) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly();
- me.animate(Ext.apply({}, options, {
- opacity: 1,
- internalListeners: {
- beforeanimate: function(anim) {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- // restore any visibility/display that may have
- // been applied by a fadeout animation
- if (animFly.isStyle('display', 'none')) {
- animFly.setDisplayed('');
- } else {
- animFly.show();
- }
- }
- }
- }));
- return this;
- },
- /**
- * Fade an element out (from opaque to transparent). The ending opacity can be specified
- * using the `opacity` config option. Note that IE may require `useDisplay: true` in order
- * to redisplay correctly. Usage:
- *
- * // default: fade out from the element's current opacity to 0
- * el.fadeOut();
- *
- * // custom: fade out from the element's current opacity to 25% over 2 seconds
- * el.fadeOut({ opacity: .25, duration: 2000});
- *
- * // common config options shown with default values
- * el.fadeOut({
- * opacity: 0, //can be any value between 0 and 1 (e.g. .5)
- * easing: 'easeOut',
- * duration: 500,
- * remove: false,
- * useDisplay: false
- * });
- *
- * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- fadeOut: function(options) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly();
- options = Ext.apply({
- opacity: 0,
- internalListeners: {
- afteranimate: function(anim) {
- if (anim.to.opacity === 0) {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- if (options.useDisplay) {
- animFly.setDisplayed(false);
- } else {
- animFly.hide();
- }
- }
- }
- }
- }, options);
- me.animate(options);
- return me;
- },
- /**
- * @private
- */
- fixDisplay: function() {
- var me = this;
- if (me.isStyle(DISPLAY, NONE)) {
- me.setStyle(VISIBILITY, HIDDEN);
- me.setStyle(DISPLAY, me._getDisplay());
- // first try reverting to default
- if (me.isStyle(DISPLAY, NONE)) {
- // if that fails, default to block
- me.setStyle(DISPLAY, "block");
- }
- }
- },
- /**
- * Shows a ripple of exploding, attenuating borders to draw attention to an Element. Usage:
- *
- * // default: a single light blue ripple
- * el.frame();
- *
- * // custom: 3 red ripples lasting 3 seconds total
- * el.frame("#ff0000", 3, { duration: 3000 });
- *
- * // common config options shown with default values
- * el.frame("#C3DAF9", 1, {
- * duration: 1000 // duration of each individual ripple.
- * // Note: Easing is not configurable and will be ignored if included
- * });
- *
- * @param {String} [color='#C3DAF9'] The hex color value for the border.
- * @param {Number} [count=1] The number of ripples to display.
- * @param {Object} [obj] Object literal with any of the {@link Ext.fx.Anim} config options
- * @return {Ext.dom.Element} The Element
- */
- frame: function(color, count, obj) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly(),
- beforeAnim;
- color = color || '#C3DAF9';
- count = count || 1;
- obj = obj || {};
- beforeAnim = function() {
- var animScope = this,
- box, proxy, proxyAnim;
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- animFly.show();
- box = animFly.getBox();
- proxy = Ext.getBody().createChild({
- role: 'presentation',
- id: animFly.dom.id + '-anim-proxy',
- style: {
- position: 'absolute',
- 'pointer-events': 'none',
- 'z-index': 35000,
- border: '0px solid ' + color
- }
- });
- proxyAnim = new Ext.fx.Anim({
- target: proxy,
- duration: obj.duration || 1000,
- iterations: count,
- from: {
- top: box.y,
- left: box.x,
- borderWidth: 0,
- opacity: 1,
- height: box.height,
- width: box.width
- },
- to: {
- top: box.y - 20,
- left: box.x - 20,
- borderWidth: 10,
- opacity: 0,
- height: box.height + 40,
- width: box.width + 40
- }
- });
- proxyAnim.on('afteranimate', function() {
- proxy.destroy();
- // kill the no-op element animation created below
- animScope.end();
- });
- };
- me.animate({
- // See "A Note About Wrapped Animations" at the top of this class:
- duration: (Math.max(obj.duration, 500) * 2) || 2000,
- listeners: {
- beforeanimate: {
- fn: beforeAnim
- }
- },
- callback: obj.callback,
- scope: obj.scope
- });
- return me;
- },
- /**
- * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like `#fff`)
- * and valid values are convert to standard 6 digit hex color.
- * @param {String} attr The css attribute
- * @param {String} defaultValue The default value to use when a valid color isn't found
- * @param {String} [prefix] defaults to #. Use an empty string when working with
- * color anims.
- * @private
- */
- getColor: function(attr, defaultValue, prefix) {
- var v = this.getStyle(attr),
- color = prefix || prefix === '' ? prefix : '#',
- h, len, i;
- if (!v || (/transparent|inherit/.test(v))) {
- return defaultValue;
- }
- if (/^r/.test(v)) {
- v = v.slice(4, v.length - 1).split(',');
- len = v.length;
- for (i = 0; i < len; i++) {
- h = parseInt(v[i], 10);
- color += (h < 16 ? '0' : '') + h.toString(16);
- }
- } else {
- v = v.replace('#', '');
- color += v.length === 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
- }
- return (color.length > 5 ? color.toLowerCase() : defaultValue);
- },
- /**
- * Gets this element's {@link Ext.ElementLoader ElementLoader}
- * @return {Ext.ElementLoader} The loader
- */
- getLoader: function() {
- var me = this,
- data = me.getData(),
- loader = data.loader;
- if (!loader) {
- data.loader = loader = new Ext.ElementLoader({
- target: me
- });
- }
- return loader;
- },
- /**
- * Gets an object with all CSS positioning properties. Useful along with
- * `setPositioning` to get snapshot before performing an update and then restoring
- * the element.
- * @param {Boolean} [autoPx=false] true to return pixel values for "auto" styles.
- * @return {Object}
- */
- getPositioning: function(autoPx) {
- var styles = this.getStyle([
- 'left',
- 'top',
- 'position',
- 'z-index'
- ]),
- dom = this.dom;
- if (autoPx) {
- if (styles.left === 'auto') {
- styles.left = dom.offsetLeft + 'px';
- }
- if (styles.top === 'auto') {
- styles.top = dom.offsetTop + 'px';
- }
- }
- return styles;
- },
- /**
- * Slides the element while fading it out of view. An anchor point can be optionally passed
- * to set the ending point of the effect. Usage:
- *
- * // default: slide the element downward while fading out
- * el.ghost();
- *
- * // custom: slide the element out to the right with a 2-second duration
- * el.ghost('r', { duration: 2000 });
- *
- * // common config options shown with default values
- * el.ghost('b', {
- * easing: 'easeOut',
- * duration: 500
- * });
- *
- * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
- * (defaults to bottom: 'b')
- * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- ghost: function(anchor, options) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly(),
- beforeAnim;
- anchor = anchor || "b";
- beforeAnim = function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- // eslint-disable-next-line vars-on-top
- var width = animFly.getWidth(),
- height = animFly.getHeight(),
- xy = animFly.getXY(),
- position = animFly.getPositioning(),
- to = {
- opacity: 0
- };
- switch (anchor) {
- case 't':
- to.y = xy[1] - height;
- break;
- case 'l':
- to.x = xy[0] - width;
- break;
- case 'r':
- to.x = xy[0] + width;
- break;
- case 'b':
- to.y = xy[1] + height;
- break;
- case 'tl':
- to.x = xy[0] - width;
- to.y = xy[1] - height;
- break;
- case 'bl':
- to.x = xy[0] - width;
- to.y = xy[1] + height;
- break;
- case 'br':
- to.x = xy[0] + width;
- to.y = xy[1] + height;
- break;
- case 'tr':
- to.x = xy[0] + width;
- to.y = xy[1] - height;
- break;
- }
- this.to = to;
- this.on('afteranimate', function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- if (animFly) {
- animFly.hide();
- animFly.clearOpacity();
- animFly.setPositioning(position);
- }
- });
- };
- me.animate(Ext.applyIf(options || {}, {
- duration: 500,
- easing: 'ease-out',
- listeners: {
- beforeanimate: beforeAnim
- }
- }));
- return me;
- },
- getTextSelection: function() {
- var ret, dom, doc, range, textRange;
- ret = this.callParent();
- if (typeof ret[0] !== 'number') {
- dom = this.dom;
- doc = dom.ownerDocument;
- range = doc.selection.createRange();
- textRange = dom.createTextRange();
- textRange.setEndPoint('EndToStart', range);
- ret[0] = textRange.text.length;
- ret[1] = ret[0] + range.text.length;
- }
- return ret;
- },
- /**
- * Hide this element - Uses display mode to determine whether to use "display",
- * "visibility", "offsets", or "clip". See {@link #setVisible}.
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object
- * @return {Ext.dom.Element} this
- */
- hide: function(animate) {
- // hideMode override
- if (typeof animate === 'string') {
- this.setVisible(false, animate);
- return this;
- }
- this.setVisible(false, this.anim(animate));
- return this;
- },
- /**
- * Highlights the Element by setting a color (applies to the background-color by default,
- * but can be changed using the "attr" config option) and then fading back to the original
- * color. If no original color is available, you should provide the "endColor" config option
- * which will be cleared after the animation. Usage:
- *
- * // default: highlight background to yellow
- * el.highlight();
- *
- * // custom: highlight foreground text to blue for 2 seconds
- * el.highlight("0000ff", { attr: 'color', duration: 2000 });
- *
- * // common config options shown with default values
- * el.highlight("ffff9c", {
- * // can be any valid CSS property (attribute) that supports a color value
- * attr: "backgroundColor",
- * endColor: (current color) or "ffffff",
- * easing: 'easeIn',
- * duration: 1000
- * });
- *
- * @param {String} color (optional) The highlight color. Should be a 6 char hex color
- * without the leading # (defaults to yellow: 'ffff9c')
- * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- highlight: function(color, options) {
- var me = this,
- dom = me.dom,
- from = {},
- animFly = new Ext.dom.Fly(),
- restore, to, attr, lns, event, fn;
- options = options || {};
- lns = options.listeners || {};
- attr = options.attr || 'backgroundColor';
- from[attr] = color || 'ffff9c';
- if (!options.to) {
- to = {};
- to[attr] = options.endColor || me.getColor(attr, 'ffffff', '');
- } else {
- to = options.to;
- }
- // Don't apply directly on lns, since we reference it in our own callbacks below
- options.listeners = Ext.apply(Ext.apply({}, lns), {
- beforeanimate: function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- restore = dom.style[attr];
- animFly.clearOpacity();
- animFly.show();
- event = lns.beforeanimate;
- if (event) {
- fn = event.fn || event;
- return fn.apply(event.scope || lns.scope || WIN, arguments);
- }
- },
- afteranimate: function() {
- if (dom) {
- dom.style[attr] = restore;
- }
- event = lns.afteranimate;
- if (event) {
- fn = event.fn || event;
- fn.apply(event.scope || lns.scope || WIN, arguments);
- }
- }
- });
- me.animate(Ext.apply({}, options, {
- duration: 1000,
- easing: 'ease-in',
- from: from,
- to: to
- }));
- return me;
- },
- /**
- * Initializes a {@link Ext.dd.DD} drag drop object for this element.
- * @param {String} group The group the DD object is member of
- * @param {Object} config The DD config object
- * @param {Object} overrides An object containing methods to override/implement
- * on the DD object
- * @return {Ext.dd.DD} The DD object
- */
- initDD: function(group, config, overrides) {
- var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
- return Ext.apply(dd, overrides);
- },
- /**
- * Initializes a {@link Ext.dd.DDProxy} object for this element.
- * @param {String} group The group the DDProxy object is member of
- * @param {Object} config The DDProxy config object
- * @param {Object} overrides An object containing methods to override/implement
- * on the DDProxy object
- * @return {Ext.dd.DDProxy} The DDProxy object
- */
- initDDProxy: function(group, config, overrides) {
- var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
- return Ext.apply(dd, overrides);
- },
- /**
- * Initializes a {@link Ext.dd.DDTarget} object for this element.
- * @param {String} group The group the DDTarget object is member of
- * @param {Object} config The DDTarget config object
- * @param {Object} overrides An object containing methods to override/implement
- * on the DDTarget object
- * @return {Ext.dd.DDTarget} The DDTarget object
- */
- initDDTarget: function(group, config, overrides) {
- var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
- return Ext.apply(dd, overrides);
- },
- /**
- * Returns true if this element is masked. Also re-centers any displayed message
- * within the mask.
- *
- * @param {Boolean} [deep] Go up the DOM hierarchy to determine if any parent
- * element is masked.
- *
- * @return {Boolean}
- */
- isMasked: function(deep) {
- var me = this,
- data = me.getData(),
- maskEl = data.maskEl,
- maskMsg = data.maskMsg,
- hasMask = false,
- parent;
- if (maskEl && maskEl.isVisible()) {
- if (maskMsg) {
- maskMsg.center(me);
- }
- hasMask = true;
- } else if (deep) {
- parent = me.findParentNode();
- if (parent) {
- return Ext.fly(parent).isMasked(deep);
- }
- }
- return hasMask;
- },
- /**
- * Direct access to the Ext.ElementLoader {@link Ext.ElementLoader#method-load} method.
- * The method takes the same object parameter as {@link Ext.ElementLoader#method-load}
- * @param {Object} options a options object for Ext.ElementLoader
- * {@link Ext.ElementLoader#method-load}
- * @return {Ext.dom.Element} this
- */
- load: function(options) {
- this.getLoader().load(options);
- return this;
- },
- /**
- * Puts a mask over this element to disable user interaction.
- * This method can only be applied to elements which accept child nodes. Use
- * {@link #unmask} to remove the mask.
- *
- * @param {String} [msg] A message to display in the mask
- * @param {String} [msgCls] A css class to apply to the msg element
- * @param {Number} elHeight (private) Passed by AbstractComponent.mask to avoid the need
- * to interrogate the DOM to get the height
- * @return {Ext.dom.Element} The mask element
- */
- mask: function(msg, msgCls, elHeight) {
- var me = this,
- dom = me.dom,
- data = me.getData(),
- maskEl = data.maskEl,
- maskMsg;
- if (!(bodyRe.test(dom.tagName) && me.getStyle('position') === 'static')) {
- me.addCls(XMASKEDRELATIVE);
- }
- // We always needs to recreate the mask since the DOM element may have been re-created
- if (maskEl) {
- maskEl.destroy();
- }
- maskEl = Ext.DomHelper.append(dom, {
- role: 'presentation',
- cls: Ext.baseCSSPrefix + "mask " + Ext.baseCSSPrefix + "border-box",
- children: {
- role: 'presentation',
- cls: msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
- cn: {
- tag: 'div',
- role: 'presentation',
- cls: Ext.baseCSSPrefix + 'mask-msg-inner',
- cn: {
- tag: 'div',
- role: 'presentation',
- cls: Ext.baseCSSPrefix + 'mask-msg-text',
- html: msg || ''
- }
- }
- }
- }, true);
- maskMsg = Ext.fly(maskEl.dom.firstChild);
- data.maskEl = maskEl;
- me.addCls(XMASKED);
- maskEl.setDisplayed(true);
- if (typeof msg === 'string') {
- maskMsg.setDisplayed(true);
- maskMsg.center(me);
- } else {
- maskMsg.setDisplayed(false);
- }
- if (dom === DOC.body) {
- maskEl.addCls(Ext.baseCSSPrefix + 'mask-fixed');
- }
- // When masking the body, don't touch its tabbable state
- me.saveTabbableState({
- skipSelf: dom === DOC.body
- });
- // ie will not expand full height automatically
- if (Ext.isIE9m && dom !== DOC.body && me.isStyle('height', 'auto')) {
- maskEl.setSize(undefined, elHeight || me.getHeight());
- }
- return maskEl;
- },
- /**
- * Fades the element out while slowly expanding it in all directions. When the effect
- * is completed, the element will be hidden (visibility = 'hidden') but block elements
- * will still take up space in the document. Usage:
- *
- * // default
- * el.puff();
- *
- * // common config options shown with default values
- * el.puff({
- * easing: 'easeOut',
- * duration: 500,
- * useDisplay: false
- * });
- *
- * @param {Object} obj (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- puff: function(obj) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly(),
- beforeAnim,
- box = me.getBox(),
- originalStyles;
- originalStyles = me.getStyle([
- 'width',
- 'height',
- 'left',
- 'right',
- 'top',
- 'bottom',
- 'position',
- 'z-index',
- 'font-size',
- 'opacity'
- ], true);
- obj = Ext.applyIf(obj || {}, {
- easing: 'ease-out',
- duration: 500,
- useDisplay: false
- });
- beforeAnim = function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- animFly.clearOpacity();
- animFly.show();
- this.to = {
- width: box.width * 2,
- height: box.height * 2,
- x: box.x - (box.width / 2),
- y: box.y - (box.height / 2),
- opacity: 0,
- fontSize: '200%'
- };
- this.on('afteranimate', function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- if (obj.useDisplay) {
- animFly.setDisplayed(false);
- } else {
- animFly.hide();
- }
- animFly.setStyle(originalStyles);
- Ext.callback(obj.callback, obj.scope);
- });
- };
- me.animate({
- duration: obj.duration,
- easing: obj.easing,
- listeners: {
- beforeanimate: {
- fn: beforeAnim
- }
- }
- });
- return me;
- },
- // private
- // used to ensure the mouseup event is captured if it occurs outside of the
- // window in IE9m. The only reason this method exists, (vs just calling
- // el.dom.setCapture() directly) is so that we can override it to emptyFn
- // during testing because setCapture() can wreak havoc on emulated mouse events
- // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262(v=vs.85).aspx
- setCapture: function() {
- var dom = this.dom;
- if (Ext.isIE9m && dom.setCapture) {
- dom.setCapture();
- }
- },
- /**
- * Set the height of this Element.
- *
- * // change the height to 200px and animate with default configuration
- * Ext.fly('elementId').setHeight(200, true);
- *
- * // change the height to 150px and animate with a custom configuration
- * Ext.fly('elId').setHeight(150, {
- * duration : 500, // animation will have a duration of .5 seconds
- * // will change the content to "finished"
- * callback: function(){ this.setHtml("finished"); }
- * });
- *
- * @param {Number/String} height The new height. This may be one of:
- *
- * - A Number specifying the new height in pixels.
- * - A String used to set the CSS height style. Animation may **not** be used.
- *
- * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
- * for the default animation (`{duration: 350, easing: 'ease-in'}`)
- * @return {Ext.dom.Element} this
- */
- setHeight: function(height, animate) {
- var me = this;
- if (!animate || !me.anim) {
- me.callParent(arguments);
- } else {
- if (!Ext.isObject(animate)) {
- animate = {};
- }
- me.animate(Ext.applyIf({
- to: {
- height: height
- }
- }, animate));
- }
- return me;
- },
- /**
- * Removes "vertical" state from this element (reverses everything done
- * by {@link #setVertical}).
- * @private
- */
- setHorizontal: function() {
- var me = this,
- cls = me.verticalCls;
- delete me.vertical;
- if (cls) {
- delete me.verticalCls;
- me.removeCls(cls);
- }
- // delete the inverted methods and revert to inheriting from the prototype
- delete me.setWidth;
- delete me.setHeight;
- if (!Ext.isIE8) {
- delete me.getWidth;
- delete me.getHeight;
- }
- // revert to inheriting styleHooks from the prototype
- delete me.styleHooks;
- },
- /**
- * Updates the *text* value of this element.
- * Replaces the content of this element with a *single text node* containing
- * the passed text.
- * @param {String} text The text to display in this Element.
- */
- updateText: function(text) {
- var me = this,
- dom, textNode;
- if (dom) {
- textNode = dom.firstChild;
- if (!textNode || (textNode.nodeType !== 3 || textNode.nextSibling)) {
- textNode = DOC.createTextNode();
- me.empty();
- dom.appendChild(textNode);
- }
- if (text) {
- textNode.data = text;
- }
- }
- },
- /**
- * Updates the innerHTML of this element, optionally searching for and processing scripts.
- * @param {String} html The new HTML
- * @param {Boolean} [loadScripts] Pass `true` to look for and process scripts.
- * @param {Function} [callback] For async script loading you can be notified
- * when the update completes.
- * @param {Object} [scope=`this`] The scope (`this` reference) in which to execute
- * the callback.
- *
- * Also used as the scope for any *inline* script source if the `loadScripts` parameter
- * is `true`. Scripts with a `src` attribute cannot be executed in this scope.
- *
- * Defaults to this Element.
- * @return {Ext.dom.Element} this
- */
- setHtml: function(html, loadScripts, callback, scope) {
- var me = this,
- id, dom, interval;
- if (!me.dom) {
- return me;
- }
- html = html || '';
- dom = me.dom;
- if (loadScripts !== true) {
- // Setting innerHtml changes the DOM and replace all dom nodes
- // with the new html. For IE specifically, all dom child nodes get
- // destroyed when removed from DOM tree even if DOM is referenced
- // within some JS file. Thus, before setting innerHTML, remove the
- // children so that they are not destroyed/removed from DOM tree.
- if (Ext.isIE) {
- while (dom.firstChild) {
- dom.removeChild(dom.firstChild);
- }
- }
- dom.innerHTML = html;
- Ext.callback(callback, me);
- return me;
- }
- id = Ext.id();
- html += '<span id="' + id + '" role="presentation"></span>';
- interval = Ext.interval(function() {
- var hd, match, attrs, srcMatch, typeMatch, el, s;
- if (!(el = DOC.getElementById(id))) {
- return false;
- }
- Ext.uninterval(interval);
- Ext.removeNode(el);
- hd = Ext.getHead().dom;
- while ((match = scriptTagRe.exec(html))) {
- attrs = match[1];
- srcMatch = attrs ? attrs.match(srcRe) : false;
- if (srcMatch && srcMatch[2]) {
- s = DOC.createElement("script");
- s.src = srcMatch[2];
- typeMatch = attrs.match(typeRe);
- if (typeMatch && typeMatch[2]) {
- s.type = typeMatch[2];
- }
- hd.appendChild(s);
- } else if (match[2] && match[2].length > 0) {
- if (scope) {
- Ext.functionFactory(match[2]).call(scope);
- } else {
- Ext.globalEval(match[2]);
- }
- }
- }
- Ext.callback(callback, scope || me);
- }, 20);
- dom.innerHTML = html.replace(replaceScriptTagRe, '');
- return me;
- },
- /**
- * Set the opacity of the element
- * @param {Number} opacity The new opacity. 0 = transparent, .5 = 50% visible,
- * 1 = fully visible, etc
- * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
- * for the default animation (`{duration: 350, easing: 'ease-in'}`)
- * @return {Ext.dom.Element} this
- */
- setOpacity: function(opacity, animate) {
- var me = this;
- if (!me.dom) {
- return me;
- }
- if (!animate || !me.anim) {
- me.setStyle('opacity', opacity);
- } else {
- if (typeof animate !== 'object') {
- animate = {
- duration: 350,
- easing: 'ease-in'
- };
- }
- me.animate(Ext.applyIf({
- to: {
- opacity: opacity
- }
- }, animate));
- }
- return me;
- },
- /**
- * Set positioning with an object returned by `getPositioning`.
- * @param {Object} pc
- * @return {Ext.dom.Element} this
- */
- setPositioning: function(pc) {
- return this.setStyle(pc);
- },
- /**
- * Changes this Element's state to "vertical" (rotated 90 or 270 degrees).
- * This involves inverting the getters and setters for height and width,
- * and applying hooks for rotating getters and setters for border/margin/padding.
- * (getWidth becomes getHeight and vice versa), setStyle and getStyle will
- * also return the inverse when height or width are being operated on.
- *
- * @param {Number} angle the angle of rotation - either 90 or 270
- * @param {String} cls an optional css class that contains the required
- * styles for switching the element to vertical orientation. Omit this if
- * the element already contains vertical styling. If cls is provided,
- * it will be removed from the element when {@link #setHorizontal} is called.
- * @private
- */
- setVertical: function(angle, cls) {
- var me = this,
- proto = Element.prototype;
- me.vertical = true;
- if (cls) {
- me.addCls(me.verticalCls = cls);
- }
- me.setWidth = proto.setHeight;
- me.setHeight = proto.setWidth;
- if (!Ext.isIE8) {
- // In browsers that use CSS3 transforms we must invert getHeight and
- // get Width. In IE8 no adjustment is needed because we use
- // a BasicImage filter to rotate the element and the element's
- // offsetWidth and offsetHeight are automatically inverted.
- me.getWidth = proto.getHeight;
- me.getHeight = proto.getWidth;
- }
- // Switch to using the appropriate vertical style hooks
- me.styleHooks = (angle === 270) ? proto.verticalStyleHooks270 : proto.verticalStyleHooks90;
- },
- /**
- * Set the size of this Element. If animation is true, both width and height will be
- * animated concurrently.
- * @param {Number/String} width The new width. This may be one of:
- *
- * - A Number specifying the new width in pixels.
- * - A String used to set the CSS width style. Animation may **not** be used.
- * - A size object in the format `{width: widthValue, height: heightValue}`.
- *
- * @param {Number/String} height The new height. This may be one of:
- *
- * - A Number specifying the new height in pixels.
- * - A String used to set the CSS height style. Animation may **not** be used.
- *
- * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
- * for the default animation (`{duration: 350, easing: 'ease-in'}`)
- *
- * @return {Ext.dom.Element} this
- */
- setSize: function(width, height, animate) {
- var me = this;
- if (Ext.isObject(width)) {
- // in case of object from getSize()
- animate = height;
- height = width.height;
- width = width.width;
- }
- if (!animate || !me.anim) {
- me.dom.style.width = Element.addUnits(width);
- me.dom.style.height = Element.addUnits(height);
- if (me.shadow || me.shim) {
- me.syncUnderlays();
- }
- } else {
- if (animate === true) {
- animate = {};
- }
- me.animate(Ext.applyIf({
- to: {
- width: width,
- height: height
- }
- }, animate));
- }
- return me;
- },
- /**
- * Sets the visibility of the element (see details). If the visibilityMode is set
- * to Element.DISPLAY, it will use the display property to hide the element,
- * otherwise it uses visibility. The default is to hide and show using the
- * visibility property.
- *
- * @param {Boolean} visible Whether the element is visible
- * @param {Boolean/Object} [animate] True for the default animation,
- * or a standard Element animation config object.
- *
- * @return {Ext.dom.Element} this
- */
- setVisible: function(visible, animate) {
- var me = this,
- dom = me.dom,
- animFly,
- visMode = getVisMode(me);
- // hideMode string override
- if (typeof animate === 'string') {
- switch (animate) {
- case DISPLAY:
- visMode = Element.DISPLAY;
- break;
- case VISIBILITY:
- visMode = Element.VISIBILITY;
- break;
- case OFFSETS:
- visMode = Element.OFFSETS;
- break;
- case CLIP:
- visMode = Element.CLIP;
- break;
- }
- me.setVisibilityMode(visMode);
- animate = false;
- }
- if (!animate || !me.anim) {
- if (visMode === Element.DISPLAY) {
- return me.setDisplayed(visible);
- } else if (visMode === Element.OFFSETS) {
- me[visible ? 'removeCls' : 'addCls'](OFFSETCLASS);
- } else if (visMode === Element.CLIP) {
- me[visible ? 'removeCls' : 'addCls'](CLIPCLASS);
- } else if (visMode === Element.VISIBILITY) {
- me.fixDisplay();
- // Show by clearing visibility style.
- // Explicitly setting to "visible" overrides parent visibility setting
- dom.style.visibility = visible ? '' : HIDDEN;
- }
- } else {
- // closure for composites
- if (visible) {
- me.setOpacity(0.01);
- me.setVisible(true);
- }
- if (!Ext.isObject(animate)) {
- animate = {
- duration: 350,
- easing: 'ease-in'
- };
- }
- animFly = new Ext.dom.Fly();
- me.animate(Ext.applyIf({
- callback: function() {
- if (!visible) {
- // Grab the dom again, since the reference may have changed
- // if we use fly
- animFly.attach(dom).setVisible(false).setOpacity(1);
- }
- },
- to: {
- opacity: (visible) ? 1 : 0
- }
- }, animate));
- }
- me.getData()[ISVISIBLE] = visible;
- if (me.shadow || me.shim) {
- me.setUnderlaysVisible(visible);
- }
- return me;
- },
- /**
- * Set the width of this Element.
- *
- * // change the width to 200px and animate with default configuration
- * Ext.fly('elementId').setWidth(200, true);
- *
- * // change the width to 150px and animate with a custom configuration
- * Ext.fly('elId').setWidth(150, {
- * duration : 500, // animation will have a duration of .5 seconds
- * // will change the content to "finished"
- * callback: function(){ this.setHtml("finished"); }
- * });
- *
- * @param {Number/String} width The new width. This may be one of:
- *
- * - A Number specifying the new width in pixels.
- * - A String used to set the CSS width style. Animation may **not** be used.
- *
- * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
- * for the default animation (`{duration: 350, easing: 'ease-in'}`)
- * @return {Ext.dom.Element} this
- */
- setWidth: function(width, animate) {
- var me = this;
- if (!animate || !me.anim) {
- me.callParent(arguments);
- } else {
- if (!Ext.isObject(animate)) {
- animate = {};
- }
- me.animate(Ext.applyIf({
- to: {
- width: width
- }
- }, animate));
- }
- return me;
- },
- setX: function(x, animate) {
- return this.setXY([
- x,
- this.getY()
- ], animate);
- },
- setXY: function(xy, animate) {
- var me = this;
- if (!animate || !me.anim) {
- me.callParent([
- xy
- ]);
- } else {
- if (!Ext.isObject(animate)) {
- animate = {};
- }
- me.animate(Ext.applyIf({
- to: {
- x: xy[0],
- y: xy[1]
- }
- }, animate));
- }
- return this;
- },
- setY: function(y, animate) {
- return this.setXY([
- this.getX(),
- y
- ], animate);
- },
- /**
- * Show this element - Uses display mode to determine whether to use "display",
- * "visibility", "offsets", or "clip". See {@link #setVisible}.
- *
- * @param {Boolean/Object} [animate] true for the default animation or a standard
- * Element animation config object.
- *
- * @return {Ext.dom.Element} this
- */
- show: function(animate) {
- // hideMode override
- if (typeof animate === 'string') {
- this.setVisible(true, animate);
- return this;
- }
- this.setVisible(true, this.anim(animate));
- return this;
- },
- /**
- * Slides the element into view. An anchor point can be optionally passed to set the point
- * of origin for the slide effect. This function automatically handles wrapping the element
- * with a fixed-size container if needed. See the {@link Ext.fx.Anim} class overview
- * for valid anchor point options. Usage:
- *
- * // default: slide the element in from the top
- * el.slideIn();
- *
- * // custom: slide the element in from the right with a 2-second duration
- * el.slideIn('r', { duration: 2000 });
- *
- * // common config options shown with default values
- * el.slideIn('t', {
- * easing: 'easeOut',
- * duration: 500
- * });
- *
- * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
- * (defaults to top: 't')
- * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @param {Boolean} options.preserveScroll Set to true if preservation of any descendant
- * elements' `scrollTop` values is required. By default the DOM wrapping operation
- * performed by `slideIn` and `slideOut` causes the browser to lose all scroll positions.
- * @param {Boolean} slideOut
- * @return {Ext.dom.Element} The Element
- */
- slideIn: function(anchor, options, slideOut) {
- var me = this,
- dom = me.dom,
- elStyle = dom.style,
- animFly = new Ext.dom.Fly(),
- beforeAnim, wrapAnim, restoreScroll, wrapDomParentNode;
- anchor = anchor || "t";
- options = options || {};
- beforeAnim = function() {
- var animScope = this,
- listeners = options.listeners,
- box, originalStyles, anim, wrap;
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- if (!slideOut) {
- animFly.fixDisplay();
- }
- box = animFly.getBox();
- if ((anchor === 't' || anchor === 'b') && box.height === 0) {
- box.height = dom.scrollHeight;
- } else if ((anchor === 'l' || anchor === 'r') && box.width === 0) {
- box.width = dom.scrollWidth;
- }
- originalStyles = animFly.getStyle([
- 'width',
- 'height',
- 'left',
- 'right',
- 'top',
- 'bottom',
- 'position',
- 'z-index'
- ], true);
- animFly.setSize(box.width, box.height);
- // Cache all descendants' scrollTop & scrollLeft values
- // if configured to preserve scroll.
- if (options.preserveScroll) {
- restoreScroll = animFly.cacheScrollValues();
- }
- wrap = animFly.wrap({
- role: 'presentation',
- id: Ext.id() + '-anim-wrap-for-' + dom.id,
- style: {
- visibility: slideOut ? 'visible' : 'hidden'
- }
- });
- wrapDomParentNode = wrap.dom.parentNode;
- wrap.setPositioning(animFly.getPositioning());
- if (wrap.isStyle('position', 'static')) {
- wrap.position('relative');
- }
- animFly.clearPositioning('auto');
- wrap.clip();
- // The wrap will have reset all descendant scrollTops.
- // Restore them if we cached them.
- if (restoreScroll) {
- restoreScroll();
- }
- // This element is temporarily positioned absolute within its wrapper.
- // Restore to its default, CSS-inherited visibility setting.
- // We cannot explicitly poke visibility:visible into its style
- // because that overrides the visibility of the wrap.
- animFly.setStyle({
- visibility: '',
- position: 'absolute'
- });
- if (slideOut) {
- wrap.setSize(box.width, box.height);
- }
- switch (anchor) {
- case 't':
- anim = {
- from: {
- width: box.width + 'px',
- height: '0px'
- },
- to: {
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- elStyle.bottom = '0px';
- break;
- case 'l':
- anim = {
- from: {
- width: '0px',
- height: box.height + 'px'
- },
- to: {
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- me.anchorAnimX(anchor);
- break;
- case 'r':
- anim = {
- from: {
- x: box.x + box.width,
- width: '0px',
- height: box.height + 'px'
- },
- to: {
- x: box.x,
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- me.anchorAnimX(anchor);
- break;
- case 'b':
- anim = {
- from: {
- y: box.y + box.height,
- width: box.width + 'px',
- height: '0px'
- },
- to: {
- y: box.y,
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- break;
- case 'tl':
- anim = {
- from: {
- x: box.x,
- y: box.y,
- width: '0px',
- height: '0px'
- },
- to: {
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- elStyle.bottom = '0px';
- me.anchorAnimX('l');
- break;
- case 'bl':
- anim = {
- from: {
- y: box.y + box.height,
- width: '0px',
- height: '0px'
- },
- to: {
- y: box.y,
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- me.anchorAnimX('l');
- break;
- case 'br':
- anim = {
- from: {
- x: box.x + box.width,
- y: box.y + box.height,
- width: '0px',
- height: '0px'
- },
- to: {
- x: box.x,
- y: box.y,
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- me.anchorAnimX('r');
- break;
- case 'tr':
- anim = {
- from: {
- x: box.x + box.width,
- width: '0px',
- height: '0px'
- },
- to: {
- x: box.x,
- width: box.width + 'px',
- height: box.height + 'px'
- }
- };
- elStyle.bottom = '0px';
- me.anchorAnimX('r');
- break;
- }
- wrap.show();
- wrapAnim = Ext.apply({}, options);
- delete wrapAnim.listeners;
- wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
- target: wrap,
- duration: 500,
- easing: 'ease-out',
- from: slideOut ? anim.to : anim.from,
- to: slideOut ? anim.from : anim.to
- }));
- // In the absence of a callback, this listener MUST be added first
- wrapAnim.on('afteranimate', function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- animFly.setStyle(originalStyles);
- if (slideOut) {
- if (options.useDisplay) {
- animFly.setDisplayed(false);
- } else {
- animFly.hide();
- }
- }
- if (wrap.dom) {
- if (wrap.dom.parentNode) {
- wrap.dom.parentNode.insertBefore(dom, wrap.dom);
- } else {
- wrapDomParentNode.appendChild(dom);
- }
- wrap.destroy();
- }
- // The unwrap will have reset all descendant scrollTops.
- // Restore them if we cached them.
- if (restoreScroll) {
- restoreScroll();
- }
- // kill the no-op element animation created below
- animScope.end();
- });
- // Add configured listeners after
- if (listeners) {
- wrapAnim.on(listeners);
- }
- };
- me.animate({
- // See "A Note About Wrapped Animations" at the top of this class:
- duration: options.duration ? Math.max(options.duration, 500) * 2 : 1000,
- listeners: {
- beforeanimate: beforeAnim
- }
- });
- // kick off the wrap animation
- return me;
- },
- /**
- * Slides the element out of view. An anchor point can be optionally passed to set the end
- * point for the slide effect. When the effect is completed, the element will be hidden
- * (visibility = 'hidden') but block elements will still take up space in the document.
- * The element must be removed from the DOM using the 'remove' config option if
- * desired. This function automatically handles wrapping the element with a fixed-size
- * container if needed. See the {@link Ext.fx.Anim} class overview for valid anchor point
- * options. Usage:
- *
- * // default: slide the element out to the top
- * el.slideOut();
- *
- * // custom: slide the element out to the right with a 2-second duration
- * el.slideOut('r', { duration: 2000 });
- *
- * // common config options shown with default values
- * el.slideOut('t', {
- * easing: 'easeOut',
- * duration: 500,
- * remove: false,
- * useDisplay: false
- * });
- *
- * @param {String} anchor (optional) One of the valid {@link Ext.fx.Anim} anchor positions
- * (defaults to top: 't')
- * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- slideOut: function(anchor, options) {
- return this.slideIn(anchor, options, true);
- },
- /**
- * Blinks the element as if it was clicked and then collapses on its center (similar to
- * switching off a television). When the effect is completed, the element will be hidden
- * (visibility = 'hidden') but block elements will still take up space in the document.
- * The element must be removed from the DOM using the 'remove' config option if desired.
- * Usage:
- *
- * // default
- * el.switchOff();
- *
- * // all config options shown with default values
- * el.switchOff({
- * easing: 'easeIn',
- * duration: .3,
- * remove: false,
- * useDisplay: false
- * });
- *
- * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- switchOff: function(options) {
- var me = this,
- dom = me.dom,
- animFly = new Ext.dom.Fly(),
- beforeAnim;
- options = Ext.applyIf(options || {}, {
- easing: 'ease-in',
- duration: 500,
- remove: false,
- useDisplay: false
- });
- beforeAnim = function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- // eslint-disable-next-line vars-on-top
- var animScope = this,
- size = animFly.getSize(),
- xy = animFly.getXY(),
- keyframe, position;
- animFly.clearOpacity();
- animFly.clip();
- position = animFly.getPositioning();
- keyframe = new Ext.fx.Animator({
- target: dom,
- duration: options.duration,
- easing: options.easing,
- keyframes: {
- 33: {
- opacity: 0.3
- },
- 66: {
- height: 1,
- y: xy[1] + size.height / 2
- },
- 100: {
- width: 1,
- x: xy[0] + size.width / 2
- }
- }
- });
- keyframe.on('afteranimate', function() {
- // Reattach to the DOM in case the caller animated a Fly
- // in which case the dom reference will have changed by now.
- animFly.attach(dom);
- if (options.useDisplay) {
- animFly.setDisplayed(false);
- } else {
- animFly.hide();
- }
- animFly.clearOpacity();
- animFly.setPositioning(position);
- animFly.setSize(size);
- // kill the no-op element animation created below
- animScope.end();
- });
- };
- me.animate({
- // See "A Note About Wrapped Animations" at the top of this class:
- duration: (Math.max(options.duration, 500) * 2),
- listeners: {
- beforeanimate: {
- fn: beforeAnim
- }
- },
- callback: options.callback,
- scope: options.scope
- });
- return me;
- },
- /**
- * @private
- * Currently used for updating grid cells without modifying DOM structure
- *
- * Synchronizes content of this Element with the content of the passed element.
- *
- * Style and CSS class are copied from source into this Element, and contents are synced
- * recursively. If a child node is a text node, the textual data is copied.
- */
- syncContent: function(source) {
- source = Ext.getDom(source);
- // eslint-disable-next-line vars-on-top
- var sourceNodes = source.childNodes,
- sourceLen = sourceNodes.length,
- dest = this.dom,
- destNodes = dest.childNodes,
- destLen = destNodes.length,
- i, destNode, sourceNode, sourceStyle, nodeType, newAttrs, attLen, attName, value,
- elData = dest._extData;
- if (!syncContentFly) {
- syncContentFly = new Ext.dom.Fly();
- }
- // Update any attributes who's values have changed..
- newAttrs = source.attributes;
- attLen = newAttrs.length;
- for (i = 0; i < attLen; i++) {
- attName = newAttrs[i].name;
- value = newAttrs[i].value;
- if (attName !== 'id' && dest.getAttribute(attName) !== value) {
- dest.setAttribute(attName, newAttrs[i].value);
- }
- }
- // The element's data is no longer synchronized. We just overwrite it in the DOM
- if (elData) {
- elData.isSynchronized = false;
- }
- // If the number of child nodes does not match, fall back to replacing innerHTML
- if (sourceLen !== destLen) {
- dest.innerHTML = source.innerHTML;
- return;
- }
- // Loop through source nodes.
- // If there are fewer, we must remove excess
- for (i = 0; i < sourceLen; i++) {
- sourceNode = sourceNodes[i];
- destNode = destNodes[i];
- nodeType = sourceNode.nodeType;
- sourceStyle = sourceNode.style;
- // If node structure is out of sync, just drop innerHTML in and return
- if (nodeType !== destNode.nodeType || (nodeType === 1 && sourceNode.tagName !== destNode.tagName)) {
- dest.innerHTML = source.innerHTML;
- return;
- }
- // Update non-Element node (text, comment)
- if (!sourceStyle) {
- destNode.data = sourceNode.data;
- } else // Sync element content
- {
- if (sourceNode.id && destNode.id !== sourceNode.id) {
- destNode.id = sourceNode.id;
- }
- destNode.style.cssText = sourceStyle.cssText;
- destNode.className = sourceNode.className;
- syncContentFly.attach(destNode).syncContent(sourceNode);
- }
- }
- },
- /**
- * Toggles the element's visibility, depending on visibility mode.
- * @param {Boolean/Object} [animate] True for the default animation, or a standard Element
- * animation config object
- * @return {Ext.dom.Element} this
- */
- toggle: function(animate) {
- var me = this;
- me.setVisible(!me.isVisible(), me.anim(animate));
- return me;
- },
- /**
- * Hides a previously applied mask.
- */
- unmask: function() {
- var me = this,
- data = me.getData(),
- maskEl = data.maskEl,
- style;
- if (maskEl) {
- style = maskEl.dom.style;
- // Remove resource-intensive CSS expressions as soon as they are not required.
- if (style.clearExpression) {
- style.clearExpression('width');
- style.clearExpression('height');
- }
- if (maskEl) {
- maskEl.destroy();
- delete data.maskEl;
- }
- me.removeCls([
- XMASKED,
- XMASKEDRELATIVE
- ]);
- }
- me.restoreTabbableState(me.dom === DOC.body);
- },
- /**
- * Return clipping (overflow) to original clipping before {@link #clip} was called
- * @return {Ext.dom.Element} this
- */
- unclip: function() {
- var me = this,
- data = me.getData(),
- clip;
- if (data[ISCLIPPED]) {
- data[ISCLIPPED] = false;
- clip = data[ORIGINALCLIP];
- if (clip.o) {
- me.setStyle(OVERFLOW, clip.o);
- }
- if (clip.x) {
- me.setStyle(OVERFLOWX, clip.x);
- }
- if (clip.y) {
- me.setStyle(OVERFLOWY, clip.y);
- }
- }
- return me;
- },
- translate: function(x, y, z) {
- if (Ext.supports.CssTransforms && !Ext.isIE9m) {
- this.callParent(arguments);
- } else {
- if (x != null) {
- this.dom.style.left = x + 'px';
- }
- if (y != null) {
- this.dom.style.top = y + 'px';
- }
- }
- },
- deprecated: {
- '4.0': {
- methods: {
- /**
- * @method pause
- * Creates a pause before any subsequent queued effects begin. If there are
- * no effects queued after the pause it will have no effect. Usage:
- *
- * el.pause(1);
- *
- * @deprecated 4.0 Use the `delay` config to {@link #animate} instead.
- * @param {Number} ms The length of time to pause (in milliseconds)
- * @return {Ext.dom.Element} The Element
- */
- pause: function(ms) {
- var me = this;
- Ext.fx.Manager.setFxDefaults(me.id, {
- delay: ms
- });
- return me;
- },
- /**
- * @method scale
- * Animates the transition of an element's dimensions from a starting
- * height/width to an ending height/width. This method is a convenience
- * implementation of {@link #shift}. Usage:
- *
- * // change height and width to 100x100 pixels
- * el.scale(100, 100);
- *
- * // common config options shown with default values.
- * // The height and width will default to the element's existing values
- * // if passed as null.
- * el.scale(
- * [element's width],
- * [element's height], {
- * easing: 'easeOut',
- * duration: 350
- * }
- * );
- *
- * @deprecated 4.0 Just use {@link #animate} instead.
- * @param {Number} width The new width (pass undefined to keep the original
- * width)
- * @param {Number} height The new height (pass undefined to keep the original
- * height)
- * @param {Object} options (optional) Object literal with any of the
- * {@link Ext.fx.Anim} config options
- * @return {Ext.dom.Element} The Element
- */
- scale: function(width, height, options) {
- this.animate(Ext.apply({}, options, {
- width: width,
- height: height
- }));
- return this;
- },
- /**
- * @method shift
- * Animates the transition of any combination of an element's dimensions,
- * xy position and/or opacity. Any of these properties not specified in the
- * config object will not be changed. This effect requires that at least one new
- * dimension, position or opacity setting must be passed in on the config object
- * in order for the function to have any effect. Usage:
- *
- * // slide the element horizontally to x position 200
- * // while changing the height and opacity
- * el.shift({ x: 200, height: 50, opacity: .8 });
- *
- * // common config options shown with default values.
- * el.shift({
- * width: [element's width],
- * height: [element's height],
- * x: [element's x position],
- * y: [element's y position],
- * opacity: [element's opacity],
- * easing: 'easeOut',
- * duration: 350
- * });
- *
- * @deprecated 4.0 Just use {@link #animate} instead.
- * @param {Object} options Object literal with any of the {@link Ext.fx.Anim}
- * config options
- * @return {Ext.dom.Element} The Element
- */
- shift: function(options) {
- this.animate(options);
- return this;
- }
- }
- },
- '4.2': {
- methods: {
- /**
- * @method moveTo
- * Sets the position of the element in page coordinates.
- * @param {Number} x X value for new position (coordinates are page-based)
- * @param {Number} y Y value for new position (coordinates are page-based)
- * @param {Boolean/Object} [animate] True for the default animation,
- * or a standard Element animation config object
- * @return {Ext.dom.Element} this
- * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
- */
- moveTo: function(x, y, animate) {
- return this.setXY([
- x,
- y
- ], animate);
- },
- /**
- * @method setBounds
- * Sets the element's position and size in one shot. If animation is true then
- * width, height, x and y will be animated concurrently.
- *
- * @param {Number} x X value for new position (coordinates are page-based)
- * @param {Number} y Y value for new position (coordinates are page-based)
- * @param {Number/String} width The new width. This may be one of:
- *
- * - A Number specifying the new width in pixels
- * - A String used to set the CSS width style. Animation may **not** be used.
- *
- * @param {Number/String} height The new height. This may be one of:
- *
- * - A Number specifying the new height in pixels
- * - A String used to set the CSS height style. Animation may **not** be used.
- *
- * @param {Boolean/Object} [animate] true for the default animation or
- * a standard Element animation config object
- *
- * @return {Ext.dom.Element} this
- * @deprecated 4.2.0 Use {@link Ext.util.Positionable#setBox} instead.
- */
- setBounds: function(x, y, width, height, animate) {
- return this.setBox({
- x: x,
- y: y,
- width: width,
- height: height
- }, animate);
- },
- /**
- * @method setLeftTop
- * Sets the element's left and top positions directly using CSS style
- * @param {Number/String} left Number of pixels or CSS string value to
- * set as the left CSS property value
- * @param {Number/String} top Number of pixels or CSS string value to
- * set as the top CSS property value
- * @return {Ext.dom.Element} this
- * @deprecated 4.2.0 Use {@link Ext.dom.Element#setLocalXY} instead
- */
- setLeftTop: function(left, top) {
- var me = this,
- style = me.dom.style;
- style.left = Element.addUnits(left);
- style.top = Element.addUnits(top);
- if (me.shadow || me.shim) {
- me.syncUnderlays();
- }
- return me;
- },
- /**
- * @method setLocation
- * Sets the position of the element in page coordinates.
- * @param {Number} x X value for new position
- * @param {Number} y Y value for new position
- * @param {Boolean/Object} [animate] True for the default animation,
- * or a standard Element animation config object
- * @return {Ext.dom.Element} this
- * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
- */
- setLocation: function(x, y, animate) {
- return this.setXY([
- x,
- y
- ], animate);
- }
- }
- },
- '5.0': {
- methods: {
- /**
- * @method getAttributeNS
- * Returns the value of a namespaced attribute from the element's underlying
- * DOM node.
- * @param {String} namespace The namespace in which to look for the attribute
- * @param {String} name The attribute name
- * @return {String} The attribute value
- * @deprecated 5.0.0 Please use {@link Ext.dom.Element#getAttribute} instead.
- */
- getAttributeNS: function(namespace, name) {
- return this.getAttribute(name, namespace);
- },
- /**
- * @method getCenterXY
- * Calculates the x, y to center this element on the screen
- * @return {Number[]} The x, y values [x, y]
- * @deprecated 5.0.0 Use {@link Ext.dom.Element#getAlignToXY} instead.
- * el.getAlignToXY(document, 'c-c');
- */
- getCenterXY: function() {
- return this.getAlignToXY(DOC, 'c-c');
- },
- /**
- * @method getComputedHeight
- * Returns either the offsetHeight or the height of this element based on CSS
- * height adjusted by padding or borders when needed to simulate offsetHeight
- * when offsets aren't available. This may not work on display:none elements
- * if a height has not been set using CSS.
- * @return {Number}
- * @deprecated 5.0.0 use {@link Ext.dom.Element#getHeight} instead
- */
- getComputedHeight: function() {
- return Math.max(this.dom.offsetHeight, this.dom.clientHeight) || parseFloat(this.getStyle(HEIGHT)) || 0;
- },
- /**
- * @method getComputedWidth
- * Returns either the offsetWidth or the width of this element based on CSS
- * width adjusted by padding or borders when needed to simulate offsetWidth
- * when offsets aren't available. This may not work on display:none elements
- * if a width has not been set using CSS.
- * @return {Number}
- * @deprecated 5.0.0 use {@link Ext.dom.Element#getWidth} instead.
- */
- getComputedWidth: function() {
- return Math.max(this.dom.offsetWidth, this.dom.clientWidth) || parseFloat(this.getStyle(WIDTH)) || 0;
- },
- /**
- * @method getStyleSize
- * Returns the dimensions of the element available to lay content out in.
- *
- * getStyleSize utilizes prefers style sizing if present, otherwise it chooses
- * the larger of offsetHeight/clientHeight and offsetWidth/clientWidth.
- * To obtain the size excluding scrollbars, use getViewSize.
- *
- * Sizing of the document body is handled at the adapter level which handles
- * special cases for IE and strict modes, etc.
- *
- * @return {Object} Object describing width and height.
- * @return {Number} return.width
- * @return {Number} return.height
- * @deprecated 5.0.0 Use {@link Ext.dom.Element#getSize} instead.
- */
- getStyleSize: function() {
- var me = this,
- d = this.dom,
- isDoc = (d === DOC || d === DOC.body),
- s, w, h;
- // If the body, use static methods
- if (isDoc) {
- return {
- width: Element.getViewportWidth(),
- height: Element.getViewportHeight()
- };
- }
- s = me.getStyle([
- 'height',
- 'width'
- ], true);
- // seek inline
- // Use Styles if they are set
- if (s.width && s.width !== 'auto') {
- w = parseFloat(s.width);
- }
- // Use Styles if they are set
- if (s.height && s.height !== 'auto') {
- h = parseFloat(s.height);
- }
- // Use getWidth/getHeight if style not set.
- return {
- width: w || me.getWidth(true),
- height: h || me.getHeight(true)
- };
- },
- /**
- * @method isBorderBox
- * Returns true if this element uses the border-box-sizing model.
- * This method is deprecated as of version 5.0 because border-box sizing
- * is forced upon all elements via a style sheet rule, and the browsers
- * that do not support border-box (IE6/7 strict mode) are no longer supported.
- * @deprecated 5.0.0 This method is deprecated. Browsers that do not
- * support border-box (IE6/7 strict mode) are no longer supported.
- * @return {Boolean}
- */
- isBorderBox: function() {
- return true;
- },
- /**
- * @method isDisplayed
- * Returns true if display is not "none"
- * @return {Boolean}
- * @deprecated 5.0.0 use element.isStyle('display', 'none');
- */
- isDisplayed: function() {
- return !this.isStyle('display', 'none');
- },
- /**
- * @method focusable
- * Checks whether this element can be focused.
- * @return {Boolean} True if the element is focusable
- * @deprecated 5.0.0 use {@link #isFocusable} instead
- */
- focusable: 'isFocusable'
- }
- }
- }
- };
- })(), function() {
- var Element = Ext.dom.Element,
- proto = Element.prototype,
- useDocForId = !Ext.isIE8,
- DOC = document,
- view = DOC.defaultView,
- opacityRe = /alpha\(opacity=(.*)\)/i,
- trimRe = /^\s+|\s+$/g,
- styleHooks = proto.styleHooks,
- supports = Ext.supports,
- verticalStyleHooks90, verticalStyleHooks270, edges, k, edge, borderWidth, getBorderWidth;
- proto._init(Element);
- delete proto._init;
- Ext.plainTableCls = Ext.baseCSSPrefix + 'table-plain';
- Ext.plainListCls = Ext.baseCSSPrefix + 'list-plain';
- // ensure that any methods added by this override are also added to Ext.CompositeElementLite
- if (Ext.CompositeElementLite) {
- Ext.CompositeElementLite.importElementMethods();
- }
- if (!supports.Opacity && Ext.isIE) {
- Ext.apply(styleHooks.opacity, {
- get: function(dom) {
- var filter = dom.style.filter,
- match, opacity;
- if (filter.match) {
- match = filter.match(opacityRe);
- if (match) {
- opacity = parseFloat(match[1]);
- if (!isNaN(opacity)) {
- return opacity ? opacity / 100 : 0;
- }
- }
- }
- return 1;
- },
- set: function(dom, value) {
- var style = dom.style,
- val = style.filter.replace(opacityRe, '').replace(trimRe, '');
- style.zoom = 1;
- // ensure dom.hasLayout
- // value can be a number or '' or null... so treat falsey as no opacity
- if (typeof (value) === 'number' && value >= 0 && value < 1) {
- value *= 100;
- style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity=' + value + ')';
- } else {
- style.filter = val;
- }
- }
- });
- }
- if (!supports.matchesSelector) {
- // Match basic tagName.ClassName selector syntax for is implementation
- // eslint-disable-next-line vars-on-top
- var simpleSelectorRe = /^([a-z]+|\*)?(?:\.([a-z][a-z\-_0-9]*))?$/i,
- dashRe = /-/g,
- fragment,
- classMatcher = function(tag, cls) {
- var classRe = new RegExp('(?:^|\\s+)' + cls.replace(dashRe, '\\-') + '(?:\\s+|$)');
- if (tag && tag !== '*') {
- tag = tag.toUpperCase();
- return function(el) {
- return el.tagName === tag && classRe.test(el.className);
- };
- }
- return function(el) {
- return classRe.test(el.className);
- };
- },
- tagMatcher = function(tag) {
- tag = tag.toUpperCase();
- return function(el) {
- return el.tagName === tag;
- };
- },
- cache = {};
- proto.matcherCache = cache;
- proto.is = function(selector) {
- var dom = this.dom,
- cls, match, testFn, root, isOrphan, is, tag;
- // Empty selector always matches
- if (!selector) {
- return true;
- }
- // Only Element node types can be matched.
- if (dom.nodeType !== 1) {
- return false;
- }
- // eslint-disable-next-line no-cond-assign
- if (!(testFn = Ext.isFunction(selector) ? selector : cache[selector])) {
- // eslint-disable-next-line no-cond-assign
- if (!(match = selector.match(simpleSelectorRe))) {
- // Not a simple tagName.className selector, do it the hard way
- root = dom.parentNode;
- if (!root) {
- isOrphan = true;
- root = fragment || (fragment = DOC.createDocumentFragment());
- fragment.appendChild(dom);
- }
- is = Ext.Array.indexOf(Ext.fly(root, '_is').query(selector), dom) !== -1;
- if (isOrphan) {
- fragment.removeChild(dom);
- }
- return is;
- }
- tag = match[1];
- cls = match[2];
- cache[selector] = testFn = cls ? classMatcher(tag, cls) : tagMatcher(tag);
- }
- return testFn(dom);
- };
- }
- // IE8 needs its own implementation of getStyle because it doesn't support getComputedStyle
- if (!view || !view.getComputedStyle) {
- proto.getStyle = function(property, inline) {
- var me = this,
- dom = me.dom,
- multiple = typeof property !== 'string',
- prop = property,
- props = prop,
- len = 1,
- isInline = inline,
- styleHooks = me.styleHooks,
- camel, domStyle, values, hook, out, style, i;
- if (multiple) {
- values = {};
- prop = props[0];
- i = 0;
- if (!(len = props.length)) {
- return values;
- }
- }
- if (!dom || dom.documentElement) {
- return values || '';
- }
- domStyle = dom.style;
- if (inline) {
- style = domStyle;
- } else {
- style = dom.currentStyle;
- // fallback to inline style if rendering context not available
- if (!style) {
- isInline = true;
- style = domStyle;
- }
- }
- do {
- hook = styleHooks[prop];
- if (!hook) {
- styleHooks[prop] = hook = {
- name: Element.normalize(prop)
- };
- }
- if (hook.get) {
- out = hook.get(dom, me, isInline, style);
- } else {
- camel = hook.name;
- out = style[camel];
- }
- if (!multiple) {
- return out;
- }
- values[prop] = out;
- prop = props[++i];
- } while (i < len);
- return values;
- };
- }
- // override getStyle for border-*-width
- if (Ext.isIE8) {
- getBorderWidth = function(dom, el, inline, style) {
- if (style[this.styleName] === 'none') {
- return '0px';
- }
- return style[this.name];
- };
- edges = [
- 'Top',
- 'Right',
- 'Bottom',
- 'Left'
- ];
- k = edges.length;
- while (k--) {
- edge = edges[k];
- borderWidth = 'border' + edge + 'Width';
- styleHooks['border-' + edge.toLowerCase() + '-width'] = styleHooks[borderWidth] = {
- name: borderWidth,
- styleName: 'border' + edge + 'Style',
- get: getBorderWidth
- };
- }
- // IE8 has an odd bug with handling font icons in pseudo elements;
- // it will render the icon once and not update it when something
- // like text color is changed via style addition or removal.
- // We have to force icon repaint by adding a style with forced empty
- // pseudo element content, (x-sync-repaint) and removing it back to work
- // around this issue.
- // See this: https://github.com/FortAwesome/Font-Awesome/issues/954
- // and this: https://github.com/twbs/bootstrap/issues/13863
- // eslint-disable-next-line vars-on-top
- var syncRepaintCls = Ext.baseCSSPrefix + 'sync-repaint';
- proto.syncRepaint = function() {
- this.addCls(syncRepaintCls);
- // Measuring element width will make the browser to repaint it
- this.getWidth();
- // Removing empty content makes the icon to appear again and be redrawn
- this.removeCls(syncRepaintCls);
- };
- }
- if (Ext.isIE10m) {
- Ext.override(Element, {
- focus: function(defer, dom) {
- var me = this,
- ex;
- dom = dom || me.dom;
- if (me.deferredFocusTimer) {
- Ext.undefer(me.deferredFocusTimer);
- }
- me.deferredFocusTimer = null;
- if (Number(defer)) {
- me.deferredFocusTimer = Ext.defer(me.focus, defer, me, [
- null,
- dom
- ]);
- } else {
- Ext.GlobalEvents.fireEvent('beforefocus', dom);
- // IE10m has an acute problem with focusing input elements;
- // when the element was just shown and did not have enough
- // time to initialize, focusing it might fail. The problem
- // is somewhat random in nature; most of the time focusing
- // an input element will succeed, failing only occasionally.
- // When it fails, the focus will be thrown to the document
- // body element, with subsequent focusout/focusin event pair
- // on the body, which throws off our focusenter/focusleave
- // processing.
- // Fortunately for us, when this focus failure happens, the
- // resulting focusout event will happen *synchronously*
- // unlike the normal focusing events which IE will fire
- // asynchronously. Also fortunately for us, in most cases
- // trying to focus the given element the second time
- // immediately after it failed to focus the first time
- // seems to do the trick; however when second focus attempt
- // succeeds, it will result in focusout on the body and
- // focusin on the given element, which again wreaks havoc
- // on our focusenter/focusleave handling.
- // The only workable solution we have is to pretend that
- // focus never went to the document body and ignore the
- // focusout and focusin caused by failed first focus attempt.
- // To this end, we fudge the event stream in Focus publisher
- // override.
- if (dom && (dom.tagName === 'INPUT' || dom.tagname === 'TEXTAREA')) {
- Ext.synchronouslyFocusing = document.activeElement;
- }
- // Also note that trying to focus an unfocusable element
- // might throw an exception in IE8. What a cute idea, MS. :(
- try {
- dom.focus();
- } catch (xcpt) {
- ex = xcpt;
- }
- // Ok so now we have this situation when we tried to focus
- // the first time but did not succeed. Let's try again but
- // not if there was an exception the first time - when the
- // "focus failure" happens it does so silently. :(
- if (Ext.synchronouslyFocusing && document.activeElement !== dom && !ex) {
- dom.focus();
- }
- Ext.synchronouslyFocusing = null;
- }
- return me;
- }
- });
- }
- Ext.apply(Ext, {
- /**
- * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
- * `false`, the application will be required to clean up orphaned Ext.Elements and
- * it's listeners as to not cause memory leakage.
- * @member Ext
- */
- enableGarbageCollector: true,
- // In sencha v5 isBorderBox is no longer needed since all supported browsers
- // support border-box, but it is hard coded to true for backward compatibility
- isBorderBox: true,
- /**
- * @property {Boolean} useShims
- * @member Ext
- * Set to `true` to use a {@link Ext.util.Floating#shim shim} on all floating Components
- * and {@link Ext.LoadMask LoadMasks}
- */
- useShims: false,
- getElementById: function(id) {
- var el = DOC.getElementById(id),
- detachedBodyEl;
- if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
- el = detachedBodyEl.dom.querySelector(Ext.makeIdSelector(id));
- }
- return el;
- },
- /**
- * Applies event listeners to elements by selectors when the document is ready.
- * The event name is specified with an `@` suffix.
- *
- * Ext.addBehaviors({
- * // add a listener for click on all anchors in element with id foo
- * '#foo a@click': function(e, t){
- * // do something
- * },
- *
- * // add the same listener to multiple selectors (separated by comma BEFORE the @)
- * '#foo a, #bar span.some-class@mouseover': function(){
- * // do something
- * }
- * });
- *
- * @param {Object} obj The list of behaviors to apply
- * @member Ext
- */
- addBehaviors: function(obj) {
- // simple cache for applying multiple behaviors to same selector
- // does query multiple times
- var cache = {},
- parts, b, s;
- if (!Ext.isReady) {
- Ext.onInternalReady(function() {
- Ext.addBehaviors(obj);
- });
- } else {
- for (b in obj) {
- if ((parts = b.split('@'))[1]) {
- // for Object prototype breakers
- s = parts[0];
- if (!cache[s]) {
- cache[s] = Ext.fly(document).select(s, true);
- }
- cache[s].on(parts[1], obj[b]);
- }
- }
- cache = null;
- }
- }
- });
- if (Ext.isIE9m) {
- Ext.getElementById = function(id) {
- var el = DOC.getElementById(id),
- detachedBodyEl;
- if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
- el = detachedBodyEl.dom.all[id];
- }
- return el;
- };
- proto.getById = function(id, asDom) {
- var dom = this.dom,
- ret = null,
- entry, el;
- if (dom) {
- // for normal elements getElementById is the best solution, but if the el is
- // not part of the document.body, we need to use all[]
- el = (useDocForId && DOC.getElementById(id)) || dom.all[id];
- if (el) {
- if (asDom) {
- ret = el;
- } else {
- // calling Element.get here is a real hit (2x slower) because it has to
- // redetermine that we are giving it a dom el.
- entry = Ext.cache[id];
- if (entry) {
- if (entry.skipGarbageCollection || !Ext.isGarbage(entry.dom)) {
- ret = entry;
- } else {
- Ext.raise("Stale Element with id '" + el.id + "' found in Element cache. " + "Make sure to clean up Element instances using destroy()");
- entry.destroy();
- }
- }
- ret = ret || new Ext.Element(el);
- }
- }
- }
- return ret;
- };
- } else if (!DOC.querySelector) {
- Ext.getDetachedBody = Ext.getBody;
- Ext.getElementById = function(id) {
- return DOC.getElementById(id);
- };
- proto.getById = function(id, asDom) {
- var dom = DOC.getElementById(id);
- return asDom ? dom : (dom ? Ext.get(dom) : null);
- };
- }
- if (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) {
- // Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera,
- // Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified
- // attribute does not exist on the specified element.
- // The DOM specification says that the correct return value in this case is actually
- // the empty string, and some DOM implementations implement this behavior.
- // The implementation of getAttribute in XUL (Gecko) actually follows the specification
- // and returns an empty string. Consequently, you should use hasAttribute to check
- // for an attribute's existence prior to calling getAttribute() if it is possible that
- // the requested attribute does not exist on the specified element.
- //
- // https://developer.mozilla.org/en-US/docs/DOM/element.getAttribute
- // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
- proto.getAttribute = function(name, ns) {
- var d = this.dom,
- type;
- if (ns) {
- type = typeof d[ns + ":" + name];
- if (type !== 'undefined' && type !== 'unknown') {
- return d[ns + ":" + name] || null;
- }
- return null;
- }
- if (name === "for") {
- name = "htmlFor";
- }
- return d[name] || null;
- };
- }
- Ext.onInternalReady(function() {
- var transparentRe = /^(?:transparent|(?:rgba[(](?:\s*\d+\s*[,]){3}\s*0\s*[)]))$/i,
- origSetWidth = proto.setWidth,
- origSetHeight = proto.setHeight,
- origSetSize = proto.setSize,
- origUnselectable = proto.unselectable,
- pxRe = /^\d+(?:\.\d*)?px$/i,
- colorStyles, i, name, camel;
- if (supports.FixedTableWidthBug) {
- // EXTJSIV-12665
- // https://bugs.webkit.org/show_bug.cgi?id=130239
- // Webkit browsers fail to layout correctly when a form field's width is less
- // than the min-width of the body element. The only way to fix it seems to be
- // to toggle the display style of the field's element before and after setting
- // the width. Note: once the bug has been corrected by toggling the element's
- // display, successive calls to setWidth will work without the hack. It's only
- // when going from naturally widthed to having an explicit width that the bug
- // occurs.
- styleHooks.width = {
- name: 'width',
- set: function(dom, value, el) {
- var style = dom.style,
- needsFix = el._needsTableWidthFix,
- origDisplay = style.display;
- if (needsFix) {
- style.display = 'none';
- }
- style.width = value;
- if (needsFix) {
- // repaint
- // eslint-disable-next-line no-unused-expressions
- dom.scrollWidth;
- style.display = origDisplay;
- }
- }
- };
- proto.setWidth = function(width, animate) {
- var me = this,
- dom = me.dom,
- style = dom.style,
- needsFix = me._needsTableWidthFix,
- origDisplay = style.display;
- if (needsFix && !animate) {
- style.display = 'none';
- }
- origSetWidth.call(me, width, animate);
- if (needsFix && !animate) {
- // repaint
- // eslint-disable-next-line no-unused-expressions
- dom.scrollWidth;
- style.display = origDisplay;
- }
- return me;
- };
- proto.setSize = function(width, height, animate) {
- var me = this,
- dom = me.dom,
- style = dom.style,
- needsFix = me._needsTableWidthFix,
- origDisplay = style.display;
- if (needsFix && !animate) {
- style.display = 'none';
- }
- origSetSize.call(me, width, height, animate);
- if (needsFix && !animate) {
- // repaint
- // eslint-disable-next-line no-unused-expressions
- dom.scrollWidth;
- style.display = origDisplay;
- }
- return me;
- };
- }
- if (Ext.isIE8) {
- styleHooks.height = {
- name: 'height',
- set: function(dom, value, el) {
- var component = el.component,
- frameInfo, frameBodyStyle;
- if (component && component._syncFrameHeight && el === component.el) {
- frameBodyStyle = component.frameBody.dom.style;
- if (pxRe.test(value)) {
- frameInfo = component.getFrameInfo();
- if (frameInfo) {
- frameBodyStyle.height = (parseInt(value, 10) - frameInfo.height) + 'px';
- }
- } else if (!value || value === 'auto') {
- frameBodyStyle.height = '';
- }
- }
- dom.style.height = value;
- }
- };
- proto.setHeight = function(height, animate) {
- var component = this.component,
- frameInfo, frameBodyStyle;
- if (component && component._syncFrameHeight && this === component.el) {
- frameBodyStyle = component.frameBody.dom.style;
- if (!height || height === 'auto') {
- frameBodyStyle.height = '';
- } else {
- frameInfo = component.getFrameInfo();
- if (frameInfo) {
- frameBodyStyle.height = (height - frameInfo.height) + 'px';
- }
- }
- }
- return origSetHeight.call(this, height, animate);
- };
- proto.setSize = function(width, height, animate) {
- var component = this.component,
- frameInfo, frameBodyStyle;
- if (component && component._syncFrameHeight && this === component.el) {
- frameBodyStyle = component.frameBody.dom.style;
- if (!height || height === 'auto') {
- frameBodyStyle.height = '';
- } else {
- frameInfo = component.getFrameInfo();
- if (frameInfo) {
- frameBodyStyle.height = (height - frameInfo.height) + 'px';
- }
- }
- }
- return origSetSize.call(this, width, height, animate);
- };
- // Override for IE8 which throws an error setting innerHTML when inside
- // an event handler invoked from that element.
- proto.setText = function(text) {
- var dom = this.dom;
- // Remove all child nodes, leave only a single textNode
- if (!(dom.childNodes.length === 1 && dom.firstChild.nodeType === 3)) {
- while (dom.lastChild && dom.lastChild.nodeType !== 3) {
- dom.removeChild(dom.lastChild);
- }
- dom.appendChild(document.createTextNode());
- }
- // Set the data of the textNode
- dom.firstChild.data = text;
- };
- proto.unselectable = function() {
- origUnselectable.call(this);
- this.dom.onselectstart = function() {
- return false;
- };
- };
- }
- function fixTransparent(dom, el, inline, style) {
- var value = style[this.name] || '';
- return transparentRe.test(value) ? 'transparent' : value;
- }
- /*
- * Helper function to create the function that will restore the selection.
- */
- function makeSelectionRestoreFn(activeEl, start, end) {
- return function() {
- activeEl.selectionStart = start;
- activeEl.selectionEnd = end;
- };
- }
- /*
- * Creates a function to call to clean up problems with the work-around for the
- * WebKit RightMargin bug. The work-around is to add "display: 'inline-block'" to
- * the element before calling getComputedStyle and then to restore its original
- * display value. The problem with this is that it corrupts the selection of an
- * INPUT or TEXTAREA element (as in the "I-beam" goes away but the focus remains).
- * To cleanup after this, we need to capture the selection of any such element and
- * then restore it after we have restored the display style.
- *
- * @param {HTMLElement} target The top-most element being adjusted.
- * @private
- */
- function getRightMarginFixCleaner(target) {
- var hasInputBug = supports.DisplayChangeInputSelectionBug,
- hasTextAreaBug = supports.DisplayChangeTextAreaSelectionBug,
- activeEl, tag, start, end;
- if (hasInputBug || hasTextAreaBug) {
- activeEl = Element.getActiveElement();
- tag = activeEl && activeEl.tagName;
- if ((hasTextAreaBug && tag === 'TEXTAREA') || (hasInputBug && tag === 'INPUT' && activeEl.type === 'text')) {
- if (Ext.fly(target).isAncestor(activeEl)) {
- start = activeEl.selectionStart;
- end = activeEl.selectionEnd;
- if (Ext.isNumber(start) && Ext.isNumber(end)) {
- // to be safe...
- // We don't create the raw closure here inline because that
- // will be costly even if we don't want to return it (nested
- // function decls and exprs are often instantiated on entry
- // regardless of whether execution ever reaches them):
- return makeSelectionRestoreFn(activeEl, start, end);
- }
- }
- }
- }
- return Ext.emptyFn;
- }
- // avoid special cases, just return a nop
- function fixRightMargin(dom, el, inline, style) {
- var result = style.marginRight,
- domStyle, display;
- // Ignore cases when the margin is correctly reported as 0, the bug only shows
- // numbers larger.
- if (result !== '0px') {
- domStyle = dom.style;
- display = domStyle.display;
- domStyle.display = 'inline-block';
- // eslint-disable-next-line max-len
- result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, null)).marginRight;
- domStyle.display = display;
- }
- return result;
- }
- function fixRightMarginAndInputFocus(dom, el, inline, style) {
- var result = style.marginRight,
- domStyle, cleaner, display;
- if (result !== '0px') {
- domStyle = dom.style;
- cleaner = getRightMarginFixCleaner(dom);
- display = domStyle.display;
- domStyle.display = 'inline-block';
- // eslint-disable-next-line max-len
- result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, '')).marginRight;
- domStyle.display = display;
- cleaner();
- }
- return result;
- }
- // TODO - this was fixed in Safari 3 - verify if this is still an issue
- // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
- if (!supports.RightMargin) {
- styleHooks.marginRight = styleHooks['margin-right'] = {
- name: 'marginRight',
- // TODO - Touch should use conditional compilation here or ensure that the
- // underlying Ext.supports flags are set correctly...
- // eslint-disable-next-line max-len
- get: (supports.DisplayChangeInputSelectionBug || supports.DisplayChangeTextAreaSelectionBug) ? fixRightMarginAndInputFocus : fixRightMargin
- };
- }
- if (!supports.TransparentColor) {
- colorStyles = [
- 'background-color',
- 'border-color',
- 'color',
- 'outline-color'
- ];
- for (i = colorStyles.length; i--; ) {
- name = colorStyles[i];
- camel = Element.normalize(name);
- styleHooks[name] = styleHooks[camel] = {
- name: camel,
- get: fixTransparent
- };
- }
- }
- // When elements are rotated 80 or 270 degrees, their border, margin and padding hooks
- // need to be rotated as well.
- proto.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(styleHooks);
- proto.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(styleHooks);
- verticalStyleHooks90.width = styleHooks.height || {
- name: 'height'
- };
- verticalStyleHooks90.height = styleHooks.width || {
- name: 'width'
- };
- verticalStyleHooks90['margin-top'] = {
- name: 'marginLeft'
- };
- verticalStyleHooks90['margin-right'] = {
- name: 'marginTop'
- };
- verticalStyleHooks90['margin-bottom'] = {
- name: 'marginRight'
- };
- verticalStyleHooks90['margin-left'] = {
- name: 'marginBottom'
- };
- verticalStyleHooks90['padding-top'] = {
- name: 'paddingLeft'
- };
- verticalStyleHooks90['padding-right'] = {
- name: 'paddingTop'
- };
- verticalStyleHooks90['padding-bottom'] = {
- name: 'paddingRight'
- };
- verticalStyleHooks90['padding-left'] = {
- name: 'paddingBottom'
- };
- verticalStyleHooks90['border-top'] = {
- name: 'borderLeft'
- };
- verticalStyleHooks90['border-right'] = {
- name: 'borderTop'
- };
- verticalStyleHooks90['border-bottom'] = {
- name: 'borderRight'
- };
- verticalStyleHooks90['border-left'] = {
- name: 'borderBottom'
- };
- verticalStyleHooks270.width = styleHooks.height || {
- name: 'height'
- };
- verticalStyleHooks270.height = styleHooks.width || {
- name: 'width'
- };
- verticalStyleHooks270['margin-top'] = {
- name: 'marginRight'
- };
- verticalStyleHooks270['margin-right'] = {
- name: 'marginBottom'
- };
- verticalStyleHooks270['margin-bottom'] = {
- name: 'marginLeft'
- };
- verticalStyleHooks270['margin-left'] = {
- name: 'marginTop'
- };
- verticalStyleHooks270['padding-top'] = {
- name: 'paddingRight'
- };
- verticalStyleHooks270['padding-right'] = {
- name: 'paddingBottom'
- };
- verticalStyleHooks270['padding-bottom'] = {
- name: 'paddingLeft'
- };
- verticalStyleHooks270['padding-left'] = {
- name: 'paddingTop'
- };
- verticalStyleHooks270['border-top'] = {
- name: 'borderRight'
- };
- verticalStyleHooks270['border-right'] = {
- name: 'borderBottom'
- };
- verticalStyleHooks270['border-bottom'] = {
- name: 'borderLeft'
- };
- verticalStyleHooks270['border-left'] = {
- name: 'borderTop'
- };
- /**
- * @property {Boolean} scopeCss
- * @member Ext
- * Set this to true before onReady to prevent any styling from being added to
- * the body element. By default a few styles such as font-family, and color
- * are added to the body element via a "x-body" class. When this is set to
- * `true` the "x-body" class is not added to the body element, but is added
- * to the elements of root-level containers instead.
- */
- if (!Ext.scopeCss) {
- Ext.getBody().addCls(Ext.baseCSSPrefix + 'body');
- }
- }, null, {
- priority: 1500
- });
- });
- // onReady
- // @tag core
- /**
- * @class Ext.GlobalEvents
- */
- Ext.define('Ext.overrides.GlobalEvents', {
- override: 'Ext.GlobalEvents',
- /**
- * @event resumelayouts
- * Fires after global layout processing has been resumed in {@link
- * Ext.Component#resumeLayouts}.
- */
- attachListeners: function() {
- var me = this,
- docElement, bufferedFn;
- // In IE9- when using legacy onresize event via attachEvent or onresize property,
- // the event may fire for *content size changes* as well as actual document view
- // size changes. See this: https://msdn.microsoft.com/en-us/library/ms536959(v=vs.85).aspx
- // and this: http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer
- // The amount of these events firing all at once can be entirely staggering, and they
- // often happen during layouts so we have to be über careful to execute as few JavaScript
- // statements as possible to improve overall framework performance.
- if (Ext.isIE8) {
- docElement = Ext.getDoc().dom.documentElement;
- bufferedFn = Ext.Function.createBuffered(me.fireResize, me.resizeBuffer, me);
- Ext.getWin().dom.attachEvent('onresize', function() {
- if (docElement.clientWidth !== Ext.GlobalEvents.curWidth || docElement.clientHeight !== Ext.GlobalEvents.curHeight) {
- bufferedFn();
- }
- });
- }
- me.callParent();
- },
- deprecated: {
- 5: {
- methods: {
- addListener: function(ename, fn, scope, options, order, caller, eventOptions) {
- var name, readyFn;
- // The "ready" event was removed from Ext.globalEvents in 5.0 in favor of
- // Ext.onReady(). This function adds compatibility for the ready event
- if (ename === 'ready') {
- readyFn = fn;
- } else if (typeof ename !== 'string') {
- for (name in ename) {
- if (name === 'ready') {
- readyFn = ename[name];
- }
- }
- }
- if (readyFn) {
- Ext.log.warn("Ext.on('ready', fn) is deprecated. " + "Please use Ext.onReady(fn) instead.");
- Ext.onReady(readyFn);
- }
- this.callParent([
- ename,
- fn,
- scope,
- options,
- order,
- caller,
- eventOptions
- ]);
- }
- }
- }
- }
- });
- /**
- * @class Ext.plugin.Abstract
- */
- Ext.define('Ext.overrides.plugin.Abstract', {
- override: 'Ext.plugin.Abstract',
- $configStrict: false,
- $configPrefixed: false,
- disabled: false,
- /**
- * @cfg {String|Array} stateEvents
- * The configured list of stateEvents used to (optionally) participate in Owner Component's
- * state management.
- * @member Ext.plugin.Abstract
- */
- /**
- * @method
- * The getState method is invoked by the client Component's State mixin when one or more of the
- * specified {@link #stateEvents} are raised.
- *
- * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
- * in the client Component's state management, implementers should provide a suitable method
- * which returns a state object.
- * @return {Object} state
- * @member Ext.plugin.Abstract
- */
- getState: null,
- /**
- * @method
- * The applyState method is invoked by the client Component's State mixin after initComponent
- * method has been run for the client.
- *
- * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
- * in the client Component's state management, implementers should provide a suitable method
- * to utilize it.
- * @param {Object} state The current plugin state object to be applied.
- * @param {Object} allState The current aggregate state of the Component and all plugins.
- * @member Ext.plugin.Abstract
- */
- applyState: null,
- /**
- * The base implementation just sets the plugin's `disabled` flag to `false`
- *
- * Plugin subclasses which need more complex processing may implement an overriding
- * implementation.
- * @member Ext.plugin.Abstract
- */
- enable: function() {
- this.disabled = false;
- },
- /**
- * The base implementation just sets the plugin's `disabled` flag to `true`
- *
- * Plugin subclasses which need more complex processing may implement an overriding
- * implementation.
- * @member Ext.plugin.Abstract
- */
- disable: function() {
- this.disabled = true;
- }
- });
- /**
- * @class Ext.Widget
- */
- Ext.define('Ext.overrides.Widget', {
- override: 'Ext.Widget',
- uses: [
- 'Ext.Component',
- 'Ext.layout.component.Auto'
- ],
- $configStrict: false,
- isComponent: true,
- liquidLayout: true,
- // in Ext JS the rendered flag is set as soon as a component has its element. Since
- // widgets always have an element when constructed, they are always considered to be
- // "rendered"
- rendered: true,
- rendering: true,
- config: {
- renderTo: null
- },
- constructor: function(config) {
- var me = this,
- renderTo;
- me.callParent([
- config
- ]);
- // initialize the component layout
- me.getComponentLayout();
- renderTo = me.getRenderTo();
- if (renderTo) {
- me.render(renderTo);
- }
- },
- addClsWithUI: function(cls) {
- this.el.addCls(cls);
- },
- afterComponentLayout: Ext.emptyFn,
- updateLayout: function() {
- var owner = this.getRefOwner();
- if (owner) {
- owner.updateLayout();
- }
- },
- destroy: function() {
- var me = this,
- ownerCt = me.ownerCt;
- if (ownerCt && ownerCt.remove) {
- ownerCt.remove(me, false);
- }
- me.callParent();
- },
- finishRender: function() {
- this.rendering = false;
- this.initBindable();
- this.initKeyMap();
- },
- getAnimationProps: function() {
- // see Ext.util.Animate mixin
- return {};
- },
- getComponentLayout: function() {
- var me = this,
- layout = me.componentLayout;
- if (!layout) {
- layout = me.componentLayout = new Ext.layout.component.Auto();
- layout.setOwner(me);
- }
- return layout;
- },
- getEl: function() {
- return this.element;
- },
- /**
- * @private
- * Needed for when widget is rendered into a grid cell. The class to add to the cell element.
- * @member Ext.Widget
- */
- getTdCls: function() {
- return Ext.baseCSSPrefix + this.getTdType() + '-' + (this.ui || 'default') + '-cell';
- },
- /**
- * @private
- * Partner method to {@link #getTdCls}.
- *
- * Returns the base type for the component. Defaults to return `this.xtype`, but
- * All derived classes of {@link Ext.form.field.Text TextField} can return the type 'textfield',
- * and all derived classes of {@link Ext.button.Button Button} can return the type 'button'
- * @member Ext.Widget
- */
- getTdType: function() {
- return this.xtype;
- },
- getItemId: function() {
- // needed by ComponentQuery
- return this.itemId || this.id;
- },
- getSizeModel: function() {
- return Ext.Component.prototype.getSizeModel.apply(this, arguments);
- },
- onAdded: function(container, pos, instanced) {
- var me = this;
- me.ownerCt = container;
- me.onInheritedAdd(me, instanced);
- // this component is no longer detached from the body
- me.isDetached = false;
- },
- onRemoved: function(destroying) {
- this.onInheritedRemove(destroying);
- this.ownerCt = this.ownerLayout = null;
- },
- parseBox: function(box) {
- return Ext.Element.parseBox(box);
- },
- removeClsWithUI: function(cls) {
- this.el.removeCls(cls);
- },
- render: function(container, position) {
- var me = this,
- element = me.element,
- proto = Ext.Component.prototype,
- nextSibling;
- if (!me.ownerCt || me.floating) {
- if (Ext.scopeCss) {
- element.addCls(proto.rootCls);
- }
- element.addCls(proto.borderBoxCls);
- }
- if (position) {
- nextSibling = container.childNodes[position];
- if (nextSibling) {
- Ext.fly(container).insertBefore(element, nextSibling);
- return;
- }
- }
- Ext.fly(container).appendChild(element);
- me.finishRender();
- },
- setPosition: function(x, y) {
- this.el.setLocalXY(x, y);
- },
- up: function() {
- return Ext.Component.prototype.up.apply(this, arguments);
- },
- isAncestor: function() {
- return Ext.Component.prototype.isAncestor.apply(this, arguments);
- },
- onFocusEnter: function() {
- return Ext.Component.prototype.onFocusEnter.apply(this, arguments);
- },
- onFocusLeave: function() {
- return Ext.Component.prototype.onFocusLeave.apply(this, arguments);
- },
- isLayoutChild: function(candidate) {
- var ownerCt = this.ownerCt;
- return ownerCt ? (ownerCt === candidate || ownerCt.isLayoutChild(candidate)) : false;
- },
- privates: {
- doAddListener: function(name, fn, scope, options, order, caller, manager) {
- if (name === 'painted' || name === 'resize') {
- this.element.doAddListener(name, fn, scope || this, options, order);
- }
- this.callParent([
- name,
- fn,
- scope,
- options,
- order,
- caller,
- manager
- ]);
- },
- doRemoveListener: function(name, fn, scope) {
- if (name === 'painted' || name === 'resize') {
- this.element.doRemoveListener(name, fn, scope);
- }
- this.callParent([
- name,
- fn,
- scope
- ]);
- }
- }
- }, function(Cls) {
- var prototype = Cls.prototype;
- if (Ext.isIE9m) {
- // Since IE8/9 don't not support Object.defineProperty correctly we can't add the reference
- // nodes on demand, so we just fall back to adding all references up front.
- prototype.addElementReferenceOnDemand = prototype.addElementReference;
- }
- });
- /**
- * @class Ext.Progress
- *
- * @example
- * Ext.create({
- * xtype: 'grid',
- * title: 'Simpsons',
- * store: {
- * data: [
- * { name: 'Lisa', progress: .159 },
- * { name: 'Bart', progress: .216 },
- * { name: 'Homer', progress: .55 },
- * { name: 'Maggie', progress: .167 },
- * { name: 'Marge', progress: .145 }
- * ]
- * },
- * columns: [
- * { text: 'Name', dataIndex: 'name' },
- * {
- * text: 'Progress',
- * xtype: 'widgetcolumn',
- * width: 120,
- * dataIndex: 'progress',
- * widget: {
- * xtype: 'progress'
- * }
- * }
- * ],
- * height: 200,
- * width: 400,
- * renderTo: Ext.getBody()
- * });
- */
- Ext.define('Ext.overrides.Progress', {
- override: 'Ext.Progress',
- config: {
- ui: 'default'
- },
- updateWidth: function(width, oldWidth) {
- var me = this;
- me.callParent([
- width,
- oldWidth
- ]);
- width -= me.element.getBorderWidth('lr');
- me.backgroundEl.setWidth(width);
- me.textEl.setWidth(width);
- },
- privates: {
- startBarAnimation: function(o) {
- this.barEl.animate(o);
- },
- stopBarAnimation: function() {
- this.barEl.stopAnimation();
- }
- }
- });
- /**
- * @class Ext.mixin.Focusable
- */
- Ext.define('Ext.overrides.mixin.Focusable', {
- override: 'Ext.Component',
- /**
- * @cfg {String} [focusCls='focus'] CSS class suffix that will be used to
- * compose the CSS class name that will be added to Component's {@link #focusClsEl},
- * and removed when Component blurs.
- *
- * **Note** that this is not a full CSS class name; this suffix will be combined
- * with component's UI class via {@link #addClsWithUI} and {@link #removeClsWithUI} methods.
- */
- focusCls: 'focus',
- /**
- * Try to focus this component.
- *
- * If this component is disabled, a close relation will be targeted for focus instead
- * to keep focus localized for keyboard users.
- * @param {Mixed} [selectText] If applicable, `true` to also select all the text in this
- * component, or an array consisting of start and end (defaults to start) position of selection.
- * @param {Boolean/Number} [delay] Delay the focus this number of milliseconds (true for
- * 10 milliseconds).
- * @param {Function} [callback] Only needed if the `delay` parameter is used. A function to call
- * upon focus.
- * @param {Function} [scope] Only needed if the `delay` parameter is used. The scope (`this`
- * reference) in which to execute the callback.
- * @return {Ext.Component} The focused Component. Usually `this` Component. Some Containers may
- * delegate focus to a descendant Component ({@link Ext.window.Window Window}s can do this
- * through their {@link Ext.window.Window#defaultFocus defaultFocus} config option. If this
- * component is disabled, a closely related component will be focused and that will be returned.
- */
- focus: function(selectText, delay, callback, scope) {
- var me = this,
- containerScrollTop;
- if ((!me.focusable && !me.isContainer) || me.destroyed || me.destroying) {
- return me;
- }
- // If delay is wanted, queue a call to this function.
- if (delay) {
- me.getFocusTask().delay(Ext.isNumber(delay) ? delay : 10, me.focus, me, [
- selectText,
- false,
- callback,
- scope
- ]);
- return me;
- }
- // An immediate focus call must cancel any outstanding delayed focus calls.
- me.cancelFocus();
- if (me.floating && me.container && me.container.dom) {
- containerScrollTop = me.container.dom.scrollTop;
- }
- // Core Focusable method will return true if focusing was attempted
- if (me.mixins.focusable.focus.apply(me, arguments) !== false) {
- if (callback) {
- Ext.callback(callback, scope);
- }
- // Focusing a floating Component brings it to the front of its stack.
- // this is performed by its zIndexManager. Pass preventFocus true to avoid recursion.
- if (me.floating && containerScrollTop !== undefined) {
- me.container.dom.scrollTop = containerScrollTop;
- }
- }
- return me;
- },
- /**
- * Cancel any deferred focus on this component
- * @protected
- */
- cancelFocus: function() {
- var me = this,
- task = me.getFocusTask();
- if (task) {
- task.cancel();
- }
- },
- /**
- * @method
- * Template method to do any pre-blur processing.
- * @protected
- * @param {Ext.event.Event} e The event object
- */
- beforeBlur: Ext.emptyFn,
- /**
- * @method
- * Template method to do any post-blur processing.
- * @protected
- * @param {Ext.event.Event} e The event object
- */
- postBlur: Ext.emptyFn,
- /**
- * @method
- * Template method to do any pre-focus processing.
- * @protected
- * @param {Ext.event.Event} e The event object
- */
- beforeFocus: Ext.emptyFn,
- /**
- * @method
- * Template method to do any post-focus processing.
- * @protected
- * @param {Ext.event.Event} e The event object
- */
- postFocus: Ext.emptyFn,
- onFocusEnter: function(e) {
- var me = this;
- if (me.destroying || me.destroyed) {
- return;
- }
- // Focusing must being a floating component to the front.
- // Only bring to front if this component is not the manager's
- // topmost component (may be a result of focusOnToFront).
- if (me.floating && me !== me.zIndexManager.getActive()) {
- me.toFront(true);
- }
- me.callParent([
- e
- ]);
- },
- destroyFocusable: function() {
- var me = this;
- // Calling cancelFocus() will assign focusTask property,
- // which we don't want during destruction
- if (me.focusTask) {
- me.focusTask.stop(me.focus, me);
- }
- me.callParent();
- },
- privates: {
- addFocusCls: function(e) {
- var me = this,
- focusCls = me.focusCls,
- el;
- if (focusCls) {
- el = me.getFocusClsEl(e);
- if (el) {
- el.addCls(me.addClsWithUI(focusCls, true));
- }
- }
- },
- removeFocusCls: function(e) {
- var me = this,
- focusCls = me.focusCls,
- el;
- if (focusCls) {
- el = me.getFocusClsEl(e);
- if (el) {
- el.removeCls(me.removeClsWithUI(focusCls, true));
- }
- }
- },
- /**
- * @private
- */
- getFocusTask: function() {
- if (!this.focusTask) {
- this.focusTask = Ext.focusTask;
- }
- return this.focusTask;
- },
- updateMaskState: function(state, mask) {
- var me = this,
- ariaEl = me.ariaEl.dom,
- skipMask = me.getInherited().disabled && me.getInherited().disableMask,
- value;
- if (state) {
- me.disableTabbing();
- if (!skipMask) {
- me.setMasked(true);
- }
- if (ariaEl) {
- ariaEl.setAttribute('aria-busy', 'true');
- // It is possible that ariaEl already has aria-describedby attribute;
- // in that case we need to save it to restore later.
- value = ariaEl.getAttribute('aria-describedby');
- if (value) {
- me._savedAriaDescribedBy = value;
- }
- ariaEl.setAttribute('aria-describedby', mask.ariaEl.id);
- }
- } else {
- me.enableTabbing();
- if (!skipMask) {
- me.setMasked(false);
- }
- if (ariaEl) {
- ariaEl.removeAttribute('aria-busy');
- value = ariaEl.getAttribute('aria-describedby');
- ariaEl.removeAttribute('aria-describedby');
- if (value === mask.ariaEl.id && me._savedAriaDescribedBy) {
- ariaEl.setAttribute('aria-describedby', me._savedAriaDescribedBy);
- delete me._savedAriaDescribedBy;
- }
- }
- }
- }
- }
- }, function() {
- // One global DelayedTask to assign focus
- // So that the last focus call wins.
- if (!Ext.focusTask) {
- Ext.focusTask = new Ext.util.DelayedTask();
- }
- });
- Ext.define('Ext.overrides.app.domain.Component', {
- override: 'Ext.app.domain.Component',
- requires: [
- 'Ext.Component'
- ]
- }, function(ComponentDomain) {
- // The core Component domain monitors events on the Ext.Widget class
- // in Ext Components are not widgets so we need to monitor Ext.Component as well.
- ComponentDomain.monitor(Ext.Component);
- });
- // This is an override because it must be loaded very early, possibly before Ext.app.Application
- // in dev mode so that Ext.application() can be called.
- // Being an override also ensures that it is only included in a built app if Ext.app.Application
- // is present.
- //
- // @override Ext.app.Application
- /**
- * @method application
- * @member Ext
- * Loads Ext.app.Application class and starts it up with given configuration after the
- * page is ready.
- *
- * See `Ext.app.Application` for details.
- *
- * @param {Object/String} config Application config object or name of a class derived
- * from Ext.app.Application.
- */
- Ext.application = function(config) {
- var createApp = function(App) {
- // This won't be called until App class has been created.
- Ext.onReady(function() {
- var Viewport = Ext.viewport;
- // eslint-disable-next-line dot-notation
- Viewport = Viewport && Viewport['Viewport'];
- if (Viewport && Viewport.setup) {
- Viewport.setup(App.prototype.config.viewport);
- }
- Ext.app.Application.instance = new App();
- });
- };
- if (typeof config === "string") {
- Ext.require(config, function() {
- createApp(Ext.ClassManager.get(config));
- });
- } else {
- config = Ext.apply({
- extend: 'Ext.app.Application'
- }, // can be replaced by config!
- config);
- // We have to process "paths" before creating Application class,
- // or `requires` won't work.
- Ext.app.setupPaths(config.name, config.appFolder, config.paths);
- config['paths processed'] = true;
- // Let Ext.define do the hard work but don't assign a class name.
- Ext.define(config.name + ".$application", config, function() {
- createApp(this);
- });
- }
- };
- /**
- * @class Ext.app.Application
- */
- Ext.define('Ext.overrides.app.Application', {
- override: 'Ext.app.Application',
- uses: [
- 'Ext.tip.QuickTipManager'
- ],
- // @cmd-auto-dependency {aliasPrefix: "view.", mvc: true, requires: ["Ext.plugin.Viewport"]}
- /**
- * @cfg {Boolean/String} [autoCreateViewport=false]
- * @deprecated 5.1 Instead use {@link #mainView}
- * @member Ext.app.Application
- */
- autoCreateViewport: false,
- config: {
- /**
- * @cfg {Boolean} enableQuickTips
- * @deprecated 6.2.0 Use {@link #quickTips}.
- */
- enableQuickTips: null
- },
- /**
- * @cfg {Boolean} quickTips
- * True to automatically set up Ext.tip.QuickTip support.
- *
- * @since 6.2.0
- */
- quickTips: true,
- updateEnableQuickTips: function(enableQuickTips) {
- this.setQuickTips(enableQuickTips);
- },
- applyMainView: function(mainView) {
- var view, proto, config, protoPlugins, configPlugins;
- if (typeof mainView === 'string') {
- view = this.getView(mainView);
- config = {};
- } else {
- config = mainView;
- view = Ext.ClassManager.getByConfig(mainView);
- }
- proto = view.prototype;
- if (!proto.isViewport) {
- // Need to copy over any plugins defined on the prototype and on the config.
- protoPlugins = Ext.Array.from(proto.plugins);
- configPlugins = Ext.Array.from(config.plugins);
- config = Ext.apply({}, config);
- config.plugins = [
- 'viewport'
- ].concat(protoPlugins, configPlugins);
- }
- return view.create(config);
- },
- getDependencies: function(cls, data, requires) {
- var Controller = Ext.app.Controller,
- proto = cls.prototype,
- namespace = data.$namespace,
- viewportClass = data.autoCreateViewport;
- if (viewportClass) {
- if (!namespace) {
- Ext.raise("[Ext.app.Application] Can't resolve namespace for " + data.$className + ", did you forget to specify 'name' property?");
- }
- if (viewportClass === true) {
- viewportClass = 'Viewport';
- } else {
- requires.push('Ext.plugin.Viewport');
- }
- Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
- }
- },
- onBeforeLaunch: function() {
- var me = this,
- autoCreateViewport = me.autoCreateViewport;
- if (me.getQuickTips()) {
- me.initQuickTips();
- }
- if (autoCreateViewport) {
- me.initViewport();
- }
- this.callParent(arguments);
- },
- getViewportName: function() {
- var name = null,
- autoCreate = this.autoCreateViewport;
- if (autoCreate) {
- name = (autoCreate === true) ? 'Viewport' : autoCreate;
- }
- return name;
- },
- initViewport: function() {
- this.setMainView(this.getViewportName());
- },
- initQuickTips: function() {
- Ext.tip.QuickTipManager.init();
- }
- });
- Ext.define('Ext.overrides.app.domain.View', {
- override: 'Ext.app.domain.View',
- requires: [
- 'Ext.Component'
- ],
- constructor: function(controller) {
- this.callParent([
- controller
- ]);
- // The base class handles Ext.Widget, which encompasses
- // component for modern, so we only need the override here.
- this.monitoredClasses.push(Ext.Component);
- }
- });
- /**
- * @class Ext.dom.Helper
- */
- Ext.define('Ext.overrides.dom.Helper', (function() {
- var tableRe = /^(?:table|thead|tbody|tr|td)$/i,
- tableElRe = /td|tr|tbody|thead/i,
- ts = '<table>',
- te = '</table>',
- tbs = ts + '<tbody>',
- tbe = '</tbody>' + te,
- trs = tbs + '<tr>',
- tre = '</tr>' + tbe;
- return {
- override: 'Ext.dom.Helper',
- ieInsertHtml: function(where, el, html) {
- var frag = null;
- // IE's incomplete table implementation: http://www.ericvasilik.com/2006/07/code-karma.html
- if (Ext.isIE9m && tableRe.test(el.tagName)) {
- frag = this.insertIntoTable(el.tagName.toLowerCase(), where, el, html);
- }
- return frag;
- },
- ieOverwrite: function(el, html) {
- // IE Inserting HTML into a table/tbody/tr requires extra processing:
- // http://www.ericvasilik.com/2006/07/code-karma.html
- if (Ext.isIE9m && tableRe.test(el.tagName)) {
- // Clearing table elements requires removal of all elements.
- while (el.firstChild) {
- el.removeChild(el.firstChild);
- }
- if (html) {
- return this.insertHtml('afterbegin', el, html);
- }
- }
- },
- ieTable: function(depth, openingTags, htmlContent, closingTags) {
- var i = -1,
- el = this.detachedDiv,
- ns, nx;
- el.innerHTML = [
- openingTags,
- htmlContent,
- closingTags
- ].join('');
- while (++i < depth) {
- el = el.firstChild;
- }
- // If the result is multiple siblings, then encapsulate them into one fragment.
- ns = el.nextSibling;
- if (ns) {
- ns = el;
- el = document.createDocumentFragment();
- while (ns) {
- nx = ns.nextSibling;
- el.appendChild(ns);
- ns = nx;
- }
- }
- return el;
- },
- /**
- * @private
- * @method insertIntoTable
- * @member Ext.dom.Helper
- * workaround for broken table implementation in IE9m
- * http://www.ericvasilik.com/2006/07/code-karma.html
- */
- insertIntoTable: function(tag, where, destinationEl, html) {
- var node, before,
- bb = where === 'beforebegin',
- ab = where === 'afterbegin',
- be = where === 'beforeend',
- ae = where === 'afterend';
- if (tag === 'td' && (ab || be) || !tableElRe.test(tag) && (bb || ae)) {
- return null;
- }
- /* eslint-disable indent, multiline-ternary, no-multi-spaces */
- before = bb ? destinationEl : ae ? destinationEl.nextSibling : ab ? destinationEl.firstChild : null;
- /* eslint-enable indent, multiline-ternary, no-multi-spaces */
- if (bb || ae) {
- destinationEl = destinationEl.parentNode;
- }
- if (tag === 'td' || (tag === 'tr' && (be || ab))) {
- node = this.ieTable(4, trs, html, tre);
- } else if (((tag === 'tbody' || tag === 'thead') && (be || ab)) || (tag === 'tr' && (bb || ae))) {
- node = this.ieTable(3, tbs, html, tbe);
- } else {
- node = this.ieTable(2, ts, html, te);
- }
- destinationEl.insertBefore(node, before);
- return node;
- }
- };
- })());
- /**
- * @class Ext.list.AbstractTreeItem
- */
- Ext.define('Ext.overrides.list.AbstractTreeItem', {
- override: 'Ext.list.AbstractTreeItem',
- // This config is used by TreeIten, however to support the generic API (RootItem),
- // we need this up here.
- config: {
- floated: null
- }
- });
- /**
- * @class Ext.list.TreeItem
- */
- Ext.define('Ext.overrides.list.TreeItem', {
- override: 'Ext.list.TreeItem',
- // Implement a setter.
- // There *is* no "floated" config in Classic.
- // We're still an inner item, we just get put inside a Container.
- setFloated: function(floated) {
- var me = this,
- el = me.element,
- placeholder = me.placeholder,
- node, wasExpanded;
- if (me.treeItemFloated !== floated) {
- if (floated) {
- placeholder = el.clone(false, true);
- // shallow, asDom
- placeholder.id += '-placeholder';
- // avoid duplicate id
- me.placeholder = Ext.get(placeholder);
- me.wasExpanded = me.getExpanded();
- me.setExpanded(true);
- el.addCls(me.floatedCls);
- el.dom.parentNode.insertBefore(placeholder, el.dom);
- me.floater = me.createFloater();
- }
- // toolkit-specific
- else if (placeholder) {
- wasExpanded = me.wasExpanded;
- node = me.getNode();
- me.setExpanded(wasExpanded);
- if (!wasExpanded && node.isExpanded()) {
- // If we have been floating and expanded a child, we may have been
- // expanded as part of the ancestors. Attempt to restore state.
- me.preventAnimation = true;
- node.collapse();
- me.preventAnimation = false;
- }
- me.floater.remove(me, false);
- // don't destroy
- el.removeCls(me.floatedCls);
- placeholder.dom.parentNode.insertBefore(el.dom, placeholder.dom);
- placeholder.destroy();
- me.floater.destroy();
- me.placeholder = me.floater = null;
- }
- // Use an internal property name. We are NOT really floated
- me.treeItemFloated = floated;
- }
- },
- getFloated: function() {
- return this.treeItemFloated;
- },
- runAnimation: function(animation) {
- return this.itemContainer.addAnimation(animation);
- },
- stopAnimation: function(animation) {
- animation.jumpToEnd();
- },
- privates: {
- createFloater: function() {
- var me = this,
- owner = me.getOwner(),
- ownerTree = me.up('treelist'),
- floater,
- toolElement = me.getToolElement(),
- expandedWidth = ownerTree.expandedWidth,
- defaultListWidth = ownerTree.defaultListWidth;
- if (expandedWidth === null) {
- expandedWidth = defaultListWidth;
- }
- me.floater = floater = new Ext.container.Container({
- cls: ownerTree.self.prototype.element.cls + ' ' + ownerTree.uiPrefix + ownerTree.getUi() + ' ' + Ext.baseCSSPrefix + 'treelist-floater',
- floating: true,
- // We do not get element resize events on IE8
- // so fall back to 6.0.1 sizing to 200 wide.
- width: Ext.isIE8 ? defaultListWidth : (expandedWidth - toolElement.getWidth()),
- shadow: false,
- hidden: true,
- renderTo: Ext.getBody(),
- listeners: {
- element: 'el',
- click: function(e) {
- return owner.onClick(e);
- }
- }
- });
- floater.add(me);
- floater.show();
- floater.el.alignTo(toolElement, 'tr?');
- return floater;
- }
- }
- });
- /**
- * @class Ext.list.Tree
- */
- Ext.define('Ext.overrides.list.Tree', {
- override: 'Ext.list.Tree',
- canMeasure: true,
- constructor: function(config) {
- this.callParent([
- config
- ]);
- // Track size so that we can track the expanded size
- // for use by the floated state of items when in micro mode.
- // Browsers where this event is not supported, fall back to a width
- // of 200px for floated tree items.
- if (!Ext.isIE8) {
- this.element.on('resize', 'onElResize', this);
- }
- },
- beforeLayout: function() {
- this.syncIconSize();
- },
- onElResize: function(el, details) {
- if (!this.getMicro() && this.canMeasure) {
- this.expandedWidth = details.width;
- }
- },
- privates: {
- defaultListWidth: 200,
- expandedWidth: null
- }
- });
- /**
- * @class Ext.sparkline.Base
- */
- Ext.define('Ext.override.sparkline.Base', {
- override: 'Ext.sparkline.Base',
- statics: {
- constructTip: function() {
- // eslint-disable-next-line dot-notation
- return new Ext.tip['ToolTip']({
- id: 'sparklines-tooltip',
- showDelay: 0,
- dismissDelay: 0,
- hideDelay: 400
- });
- }
- },
- onMouseMove: function(e) {
- this.getSharedTooltip().triggerEvent = e;
- this.callParent([
- e
- ]);
- },
- onMouseLeave: function(e) {
- this.callParent([
- e
- ]);
- this.getSharedTooltip().target = null;
- },
- privates: {
- hideTip: function() {
- var tip = this.getSharedTooltip();
- tip.target = null;
- tip.hide();
- },
- showTip: function() {
- var tip = this.getSharedTooltip();
- tip.target = this.el;
- tip.onTargetOver(tip.triggerEvent);
- }
- }
- }, function(Cls) {
- // If we are on a VML platform (IE8 - TODO: remove this when that retires)...
- if (!Ext.supports.Canvas) {
- Cls.prototype.element = {
- tag: 'span',
- reference: 'element',
- listeners: {
- mouseenter: 'onMouseEnter',
- mouseleave: 'onMouseLeave',
- mousemove: 'onMouseMove'
- },
- style: {
- display: 'inline-block',
- position: 'relative',
- overflow: 'hidden',
- margin: '0px',
- padding: '0px',
- verticalAlign: 'top',
- cursor: 'default'
- },
- children: [
- {
- tag: 'svml:group',
- reference: 'groupEl',
- coordorigin: '0 0',
- coordsize: '0 0',
- style: 'position:absolute;width:0;height:0;pointer-events:none'
- }
- ]
- };
- }
- });
- /**
- * @class Ext.app.ViewController
- */
- /**
- * @method beforeRender
- * @template
- * Template method called by the owning component's
- * {@link Ext.Component#method-beforeRender beforeRender} method.
- * @param {Ext.Component} component The owner component attached to the
- * ViewController
- */
- /**
- * @method afterRender
- * @template
- * Template method called by the owning component's
- * {@link Ext.Component#method-afterRender afterRender} method.
- * @param {Ext.Component} component The owner component attached to the
- * ViewController
- */
- /**
- * @method boxReady
- * @template
- * Template method called by the owning component's
- * {@link Ext.Component#method-onBoxReady onBoxReady} method.
- * @param {Ext.Component} component The owner component attached to the
- * ViewController
- */
- /**
- * @class Ext.form.field.Checkbox
- */
- Ext.define(null, {
- override: 'Ext.form.field.Checkbox',
- compatibility: Ext.isIE8,
- // IE8 does not support change event but it has propertychange which is even better
- changeEventName: 'propertychange',
- onChangeEvent: function(e) {
- // IE8 propertychange fires for *any* property change but we're only interested in checked
- // We also don't want to react to propertychange fired as the result of assigning
- // checked property in setRawValue().
- if (this.duringSetRawValue || e.browserEvent.propertyName !== 'checked') {
- return;
- }
- this.callParent([
- e
- ]);
- },
- updateCheckedCls: function(checked) {
- var me = this,
- displayEl = me.displayEl;
- me.callParent([
- checked
- ]);
- // IE8 has a bug with font icons and pseudo-elements
- if (displayEl && checked !== me.lastValue) {
- displayEl.repaint();
- }
- }
- });
- /**
- * @class Ext.form.field.Radio
- */
- Ext.define(null, {
- override: 'Ext.form.field.Radio',
- compatibility: Ext.isIE8,
- getSubTplData: function(fieldData) {
- var data = this.callParent([
- fieldData
- ]);
- // Rendering a radio button with checked attribute
- // will have a curious side effect in IE8: the DOM
- // node will have checked property set to `true` but
- // radio group (radios with the same name attribute)
- // will behave as if no radio is checked in the group;
- // tabbing into the group will select first or last
- // button instead of the checked one.
- // So instead of rendering the attribute we will set
- // checked value in the DOM after rendering. Apparently
- // such a tiny nudge is enough for the browser to behave.
- delete data.checked;
- return data;
- },
- afterRender: function() {
- this.callParent();
- if (this.checked) {
- this.inputEl.dom.checked = true;
- }
- },
- onChange: function(newValue, oldValue) {
- // We don't need to bother updating other radio buttons in IE8
- // since it will fire propertychange event on any change, not only false -> true.
- // This is unlike standard compliant browsers, see main class.
- this.callSuper([
- newValue,
- oldValue
- ]);
- }
- });
- /**
- * @class Ext.scroll.Scroller
- */
- Ext.define(null, {
- override: 'Ext.scroll.Scroller',
- compatibility: Ext.isIE8,
- privates: {
- // Important note: this code had to be copied as a whole
- // because the scrollLeft assignment trickery only works
- // reliably when it is done within the same function context.
- doScrollTo: function(x, y, animate) {
- var me = this,
- element = me.getScrollElement(),
- maxPosition, dom, to, xInf, yInf, ret, deferred, callback;
- if (element && !element.destroyed) {
- dom = element.dom;
- xInf = (x === Infinity);
- yInf = (y === Infinity);
- if (xInf || yInf) {
- maxPosition = me.getMaxPosition();
- if (xInf) {
- x = maxPosition.x;
- }
- if (yInf) {
- y = maxPosition.y;
- }
- }
- if (x !== null) {
- x = me.convertX(x);
- }
- if (animate) {
- to = {};
- if (y != null) {
- to.scrollTop = y;
- }
- if (x != null) {
- to.scrollLeft = x;
- }
- animate = Ext.mergeIf({
- to: {
- scrollTop: y,
- scrollLeft: x
- }
- }, animate);
- deferred = new Ext.Deferred();
- callback = animate.callback;
- animate.callback = function() {
- if (callback) {
- callback.call(animate.scope || Ext.global, arguments);
- }
- // The callback will be called if the element is destroyed
- if (me.destroyed) {
- deferred.reject();
- } else {
- deferred.resolve();
- }
- };
- element.animate(animate);
- ret = deferred.promise;
- } else {
- // When we need to assign both scrollTop and scrollLeft,
- // IE8 might fire scroll event on the first assignment
- // but not on the second; that behavior is unlike the other
- // browsers which will wait for the second assignment
- // to happen before firing the event. This leads to our
- // scrollstart event firing prematurely, when the scrolling
- // has not actually finished yet.
- // To work around that, we ignore the first event and then
- // force another one by assigning scrollLeft the second time.
- if ((x != null && x !== 0) && y != null) {
- me.deferDomScroll = true;
- }
- if (y != null) {
- dom.scrollTop = y;
- }
- if (x != null) {
- dom.scrollLeft = x;
- }
- if (me.deferDomScroll) {
- me.deferDomScroll = false;
- // Reading the DOM makes sure the second assignment will fire the event.
- // eslint-disable-next-line no-unused-expressions
- +dom.scrollLeft;
- dom.scrollLeft = x;
- // eslint-disable-next-line no-unused-expressions
- +dom.scrollTop;
- dom.scrollTop = y;
- }
- ret = Ext.Deferred.getCachedResolved();
- }
- // Our position object will need refreshing before returning.
- me.positionDirty = true;
- } else {
- ret = Ext.Deferred.getCachedRejected();
- }
- return ret;
- },
- onDomScroll: function() {
- var me = this;
- if (me.deferDomScroll) {
- return;
- }
- me.callParent();
- }
- }
- });
|