ext-debug.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585
  1. /*
  2. This file is part of Ext JS 7.0.0.168
  3. Copyright (c) 2011-2020 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. This file may be used under the terms of the GNU General Public License version 3.0 as
  7. published by the Free Software Foundation and appearing in the file LICENSE included in the
  8. packaging of this file.
  9. Please review the following information to ensure the GNU General Public License version 3.0
  10. requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  11. If you are unsure which license is appropriate for your use, please contact the sales department
  12. at http://www.sencha.com/contact.
  13. Version: 7.0.0.168 Build date: 2020-01-14 07:07:49 (513838d69a96c96beec9d0851e67aa660b7f288d)
  14. */
  15. var Ext = Ext || {};
  16. (function(manifest){
  17. if(!Ext.manifest) {
  18. Ext.manifest = manifest;
  19. } else {
  20. for(var name in manifest) {
  21. Ext.manifest[name] = manifest[name];
  22. }
  23. }
  24. })({
  25. "paths": {
  26. "Ext": "../classic/classic/src",
  27. "Ext.AbstractManager": "../packages/core/src/AbstractManager.js",
  28. "Ext.Ajax": "../packages/core/src/Ajax.js",
  29. "Ext.AnimationQueue": "../packages/core/src/AnimationQueue.js",
  30. "Ext.ComponentManager": "../packages/core/src/ComponentManager.js",
  31. "Ext.ComponentQuery": "../packages/core/src/ComponentQuery.js",
  32. "Ext.Deferred": "../packages/core/src/Deferred.js",
  33. "Ext.Evented": "../packages/core/src/Evented.js",
  34. "Ext.Factory": "../packages/core/src/mixin/Factoryable.js",
  35. "Ext.GlobalEvents": "../packages/core/src/GlobalEvents.js",
  36. "Ext.Glyph": "../packages/core/src/Glyph.js",
  37. "Ext.JSON": "../packages/core/src/JSON.js",
  38. "Ext.Mixin": "../packages/core/src/class/Mixin.js",
  39. "Ext.Msg": "../classic/classic/src/window/MessageBox.js",
  40. "Ext.Progress": "../packages/core/src/Progress.js",
  41. "Ext.ProgressBase": "../packages/core/src/ProgressBase.js",
  42. "Ext.Promise": "../packages/core/src/Promise.js",
  43. "Ext.String.format": "../packages/core/src/Template.js",
  44. "Ext.TaskQueue": "../packages/core/src/TaskQueue.js",
  45. "Ext.Template": "../packages/core/src/Template.js",
  46. "Ext.Widget": "../packages/core/src/Widget.js",
  47. "Ext.XTemplate": "../packages/core/src/XTemplate.js",
  48. "Ext.app": "../packages/core/src/app",
  49. "Ext.data": "../packages/core/src/data",
  50. "Ext.direct": "../packages/core/src/direct",
  51. "Ext.dom": "../packages/core/src/dom",
  52. "Ext.dom.ButtonElement": "../classic/classic/src/dom/ButtonElement.js",
  53. "Ext.dom.Layer": "../classic/classic/src/dom/Layer.js",
  54. "Ext.drag": "../packages/core/src/drag",
  55. "Ext.event": "../packages/core/src/event",
  56. "Ext.event.publisher.MouseEnterLeave": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  57. "Ext.field": "../packages/core/src/field",
  58. "Ext.fx.Animation": "../packages/core/src/fx/Animation.js",
  59. "Ext.fx.Runner": "../packages/core/src/fx/Runner.js",
  60. "Ext.fx.State": "../packages/core/src/fx/State.js",
  61. "Ext.fx.animation": "../packages/core/src/fx/animation",
  62. "Ext.fx.easing": "../packages/core/src/fx/easing",
  63. "Ext.fx.runner": "../packages/core/src/fx/runner",
  64. "Ext.list": "../packages/core/src/list",
  65. "Ext.mixin": "../packages/core/src/mixin",
  66. "Ext.parse": "../packages/core/src/parse",
  67. "Ext.perf": "../packages/core/src/perf",
  68. "Ext.plugin.Abstract": "../packages/core/src/plugin/Abstract.js",
  69. "Ext.plugin.AbstractClipboard": "../packages/core/src/plugin/AbstractClipboard.js",
  70. "Ext.plugin.MouseEnter": "../packages/core/src/plugin/MouseEnter.js",
  71. "Ext.promise": "../packages/core/src/promise",
  72. "Ext.route": "../packages/core/src/route",
  73. "Ext.sparkline": "../packages/core/src/sparkline",
  74. "Ext.util": "../packages/core/src/util",
  75. "Ext.util.Animate": "../classic/classic/src/util/Animate.js",
  76. "Ext.util.ComponentDragger": "../classic/classic/src/util/ComponentDragger.js",
  77. "Ext.util.ElementContainer": "../classic/classic/src/util/ElementContainer.js",
  78. "Ext.util.Floating": "../classic/classic/src/util/Floating.js",
  79. "Ext.util.Format.format": "../packages/core/src/Template.js",
  80. "Ext.util.Memento": "../classic/classic/src/util/Memento.js",
  81. "Ext.util.ProtoElement": "../classic/classic/src/util/ProtoElement.js",
  82. "Ext.util.Queue": "../classic/classic/src/util/Queue.js",
  83. "Ext.util.Renderable": "../classic/classic/src/util/Renderable.js",
  84. "Ext.util.StoreHolder": "../classic/classic/src/util/StoreHolder.js",
  85. "Ext.util.TsvDecoder": "../packages/core/src/util/TSV.js"
  86. },
  87. "loadOrder": [
  88. {
  89. "path": "../packages/core/src/class/Mixin.js",
  90. "requires": [],
  91. "uses": [],
  92. "idx": 0
  93. },
  94. {
  95. "path": "../packages/core/src/util/DelayedTask.js",
  96. "requires": [],
  97. "uses": [
  98. 77
  99. ],
  100. "idx": 1
  101. },
  102. {
  103. "path": "../packages/core/src/util/Event.js",
  104. "requires": [
  105. 1
  106. ],
  107. "uses": [
  108. 24
  109. ],
  110. "idx": 2
  111. },
  112. {
  113. "path": "../packages/core/src/mixin/Identifiable.js",
  114. "requires": [],
  115. "uses": [],
  116. "idx": 3
  117. },
  118. {
  119. "path": "../packages/core/src/mixin/Observable.js",
  120. "requires": [
  121. 0,
  122. 2,
  123. 3
  124. ],
  125. "uses": [
  126. 52
  127. ],
  128. "idx": 4
  129. },
  130. {
  131. "path": "../packages/core/src/util/HashMap.js",
  132. "requires": [
  133. 4
  134. ],
  135. "uses": [],
  136. "idx": 5
  137. },
  138. {
  139. "path": "../packages/core/src/AbstractManager.js",
  140. "requires": [
  141. 5
  142. ],
  143. "uses": [],
  144. "idx": 6
  145. },
  146. {
  147. "path": "../packages/core/src/promise/Consequence.js",
  148. "requires": [],
  149. "uses": [
  150. 8
  151. ],
  152. "idx": 7
  153. },
  154. {
  155. "path": "../packages/core/src/promise/Deferred.js",
  156. "requires": [
  157. 7
  158. ],
  159. "uses": [
  160. 9
  161. ],
  162. "idx": 8
  163. },
  164. {
  165. "path": "../packages/core/src/promise/Promise.js",
  166. "requires": [
  167. 8
  168. ],
  169. "uses": [],
  170. "idx": 9
  171. },
  172. {
  173. "path": "../packages/core/src/Promise.js",
  174. "requires": [
  175. 9
  176. ],
  177. "uses": [
  178. 8
  179. ],
  180. "idx": 10
  181. },
  182. {
  183. "path": "../packages/core/src/Deferred.js",
  184. "requires": [
  185. 8,
  186. 10
  187. ],
  188. "uses": [
  189. 9
  190. ],
  191. "idx": 11
  192. },
  193. {
  194. "path": "../packages/core/src/mixin/Factoryable.js",
  195. "requires": [],
  196. "uses": [],
  197. "idx": 12
  198. },
  199. {
  200. "path": "../packages/core/src/data/request/Base.js",
  201. "requires": [
  202. 11,
  203. 12
  204. ],
  205. "uses": [
  206. 17
  207. ],
  208. "idx": 13
  209. },
  210. {
  211. "path": "../packages/core/src/data/flash/BinaryXhr.js",
  212. "requires": [],
  213. "uses": [
  214. 77
  215. ],
  216. "idx": 14
  217. },
  218. {
  219. "path": "../packages/core/src/data/request/Ajax.js",
  220. "requires": [
  221. 13,
  222. 14
  223. ],
  224. "uses": [],
  225. "idx": 15
  226. },
  227. {
  228. "path": "../packages/core/src/data/request/Form.js",
  229. "requires": [
  230. 13
  231. ],
  232. "uses": [],
  233. "idx": 16
  234. },
  235. {
  236. "path": "../packages/core/src/data/Connection.js",
  237. "requires": [
  238. 4,
  239. 11,
  240. 14,
  241. 15,
  242. 16
  243. ],
  244. "uses": [
  245. 12,
  246. 49
  247. ],
  248. "idx": 17
  249. },
  250. {
  251. "path": "../packages/core/src/Ajax.js",
  252. "requires": [
  253. 17
  254. ],
  255. "uses": [],
  256. "idx": 18
  257. },
  258. {
  259. "path": "../packages/core/src/AnimationQueue.js",
  260. "requires": [],
  261. "uses": [],
  262. "idx": 19
  263. },
  264. {
  265. "path": "../packages/core/src/mixin/Bufferable.js",
  266. "requires": [
  267. 0
  268. ],
  269. "uses": [],
  270. "idx": 20
  271. },
  272. {
  273. "path": "../packages/core/src/ComponentManager.js",
  274. "requires": [
  275. 20
  276. ],
  277. "uses": [
  278. 24,
  279. 36,
  280. 49,
  281. 89
  282. ],
  283. "idx": 21
  284. },
  285. {
  286. "path": "../packages/core/src/util/Operators.js",
  287. "requires": [],
  288. "uses": [],
  289. "idx": 22
  290. },
  291. {
  292. "path": "../packages/core/src/util/LruCache.js",
  293. "requires": [
  294. 5
  295. ],
  296. "uses": [],
  297. "idx": 23
  298. },
  299. {
  300. "path": "../packages/core/src/ComponentQuery.js",
  301. "requires": [
  302. 21,
  303. 22,
  304. 23
  305. ],
  306. "uses": [
  307. 95
  308. ],
  309. "idx": 24
  310. },
  311. {
  312. "path": "../packages/core/src/Evented.js",
  313. "requires": [
  314. 4
  315. ],
  316. "uses": [],
  317. "idx": 25
  318. },
  319. {
  320. "path": "../packages/core/src/util/Positionable.js",
  321. "requires": [],
  322. "uses": [
  323. 34,
  324. 49
  325. ],
  326. "idx": 26
  327. },
  328. {
  329. "path": "../packages/core/src/dom/UnderlayPool.js",
  330. "requires": [],
  331. "uses": [
  332. 49
  333. ],
  334. "idx": 27
  335. },
  336. {
  337. "path": "../packages/core/src/dom/Underlay.js",
  338. "requires": [
  339. 27
  340. ],
  341. "uses": [],
  342. "idx": 28
  343. },
  344. {
  345. "path": "../packages/core/src/dom/Shadow.js",
  346. "requires": [
  347. 28
  348. ],
  349. "uses": [],
  350. "idx": 29
  351. },
  352. {
  353. "path": "../packages/core/src/dom/Shim.js",
  354. "requires": [
  355. 28
  356. ],
  357. "uses": [],
  358. "idx": 30
  359. },
  360. {
  361. "path": "../packages/core/src/dom/ElementEvent.js",
  362. "requires": [
  363. 2
  364. ],
  365. "uses": [
  366. 37
  367. ],
  368. "idx": 31
  369. },
  370. {
  371. "path": "../packages/core/src/event/publisher/Publisher.js",
  372. "requires": [],
  373. "uses": [],
  374. "idx": 32
  375. },
  376. {
  377. "path": "../packages/core/src/util/Offset.js",
  378. "requires": [],
  379. "uses": [],
  380. "idx": 33
  381. },
  382. {
  383. "path": "../packages/core/src/util/Region.js",
  384. "requires": [
  385. 33
  386. ],
  387. "uses": [
  388. 49
  389. ],
  390. "idx": 34
  391. },
  392. {
  393. "path": "../packages/core/src/util/Point.js",
  394. "requires": [
  395. 34
  396. ],
  397. "uses": [],
  398. "idx": 35
  399. },
  400. {
  401. "path": "../packages/core/src/event/Event.js",
  402. "requires": [
  403. 35
  404. ],
  405. "uses": [
  406. 37,
  407. 77
  408. ],
  409. "idx": 36
  410. },
  411. {
  412. "path": "../packages/core/src/event/publisher/Dom.js",
  413. "requires": [
  414. 32,
  415. 36
  416. ],
  417. "uses": [
  418. 77
  419. ],
  420. "idx": 37
  421. },
  422. {
  423. "path": "../packages/core/src/event/publisher/Gesture.js",
  424. "requires": [
  425. 19,
  426. 35,
  427. 37
  428. ],
  429. "uses": [
  430. 36,
  431. 49,
  432. 307,
  433. 318,
  434. 319,
  435. 320,
  436. 321,
  437. 322,
  438. 323,
  439. 324,
  440. 325,
  441. 326,
  442. 327,
  443. 328
  444. ],
  445. "idx": 38
  446. },
  447. {
  448. "path": "../packages/core/src/mixin/Templatable.js",
  449. "requires": [
  450. 0
  451. ],
  452. "uses": [
  453. 49
  454. ],
  455. "idx": 39
  456. },
  457. {
  458. "path": "../packages/core/src/TaskQueue.js",
  459. "requires": [
  460. 19
  461. ],
  462. "uses": [],
  463. "idx": 40
  464. },
  465. {
  466. "path": "../packages/core/src/util/sizemonitor/Abstract.js",
  467. "requires": [
  468. 39,
  469. 40
  470. ],
  471. "uses": [],
  472. "idx": 41
  473. },
  474. {
  475. "path": "../packages/core/src/util/sizemonitor/Scroll.js",
  476. "requires": [
  477. 41
  478. ],
  479. "uses": [
  480. 40
  481. ],
  482. "idx": 42
  483. },
  484. {
  485. "path": "../packages/core/src/util/SizeMonitor.js",
  486. "requires": [
  487. 42
  488. ],
  489. "uses": [],
  490. "idx": 43
  491. },
  492. {
  493. "path": "../packages/core/src/event/publisher/ElementSize.js",
  494. "requires": [
  495. 32,
  496. 43
  497. ],
  498. "uses": [
  499. 40
  500. ],
  501. "idx": 44
  502. },
  503. {
  504. "path": "../packages/core/src/util/paintmonitor/Abstract.js",
  505. "requires": [],
  506. "uses": [
  507. 49
  508. ],
  509. "idx": 45
  510. },
  511. {
  512. "path": "../packages/core/src/util/paintmonitor/CssAnimation.js",
  513. "requires": [
  514. 45
  515. ],
  516. "uses": [],
  517. "idx": 46
  518. },
  519. {
  520. "path": "../packages/core/src/util/PaintMonitor.js",
  521. "requires": [
  522. 46
  523. ],
  524. "uses": [],
  525. "idx": 47
  526. },
  527. {
  528. "path": "../packages/core/src/event/publisher/ElementPaint.js",
  529. "requires": [
  530. 32,
  531. 40,
  532. 47
  533. ],
  534. "uses": [],
  535. "idx": 48
  536. },
  537. {
  538. "path": "../packages/core/src/dom/Element.js",
  539. "requires": [
  540. 4,
  541. 26,
  542. 29,
  543. 30,
  544. 31,
  545. 37,
  546. 38,
  547. 44,
  548. 48
  549. ],
  550. "uses": [
  551. 32,
  552. 34,
  553. 36,
  554. 75,
  555. 76,
  556. 95,
  557. 102,
  558. 250,
  559. 308,
  560. 329,
  561. 340,
  562. 342
  563. ],
  564. "idx": 49
  565. },
  566. {
  567. "path": "../packages/core/src/util/BasicFilter.js",
  568. "requires": [],
  569. "uses": [],
  570. "idx": 50
  571. },
  572. {
  573. "path": "../packages/core/src/util/Filter.js",
  574. "requires": [
  575. 50
  576. ],
  577. "uses": [],
  578. "idx": 51
  579. },
  580. {
  581. "path": "../packages/core/src/util/Observable.js",
  582. "requires": [
  583. 4
  584. ],
  585. "uses": [],
  586. "idx": 52
  587. },
  588. {
  589. "path": "../packages/core/src/util/AbstractMixedCollection.js",
  590. "requires": [
  591. 51,
  592. 52
  593. ],
  594. "uses": [],
  595. "idx": 53
  596. },
  597. {
  598. "path": "../packages/core/src/util/Sorter.js",
  599. "requires": [],
  600. "uses": [],
  601. "idx": 54
  602. },
  603. {
  604. "path": "../packages/core/src/util/Sortable.js",
  605. "requires": [
  606. 54
  607. ],
  608. "uses": [
  609. 56
  610. ],
  611. "idx": 55
  612. },
  613. {
  614. "path": "../packages/core/src/util/MixedCollection.js",
  615. "requires": [
  616. 53,
  617. 55
  618. ],
  619. "uses": [],
  620. "idx": 56
  621. },
  622. {
  623. "path": "../packages/core/src/util/TaskRunner.js",
  624. "requires": [],
  625. "uses": [],
  626. "idx": 57
  627. },
  628. {
  629. "path": "../classic/classic/src/fx/target/Target.js",
  630. "requires": [],
  631. "uses": [],
  632. "idx": 58
  633. },
  634. {
  635. "path": "../classic/classic/src/fx/target/Element.js",
  636. "requires": [
  637. 58
  638. ],
  639. "uses": [],
  640. "idx": 59
  641. },
  642. {
  643. "path": "../classic/classic/src/fx/target/ElementCSS.js",
  644. "requires": [
  645. 59
  646. ],
  647. "uses": [],
  648. "idx": 60
  649. },
  650. {
  651. "path": "../classic/classic/src/fx/target/CompositeElement.js",
  652. "requires": [
  653. 59
  654. ],
  655. "uses": [],
  656. "idx": 61
  657. },
  658. {
  659. "path": "../classic/classic/src/fx/target/CompositeElementCSS.js",
  660. "requires": [
  661. 60,
  662. 61
  663. ],
  664. "uses": [],
  665. "idx": 62
  666. },
  667. {
  668. "path": "../classic/classic/src/fx/target/Sprite.js",
  669. "requires": [
  670. 58
  671. ],
  672. "uses": [],
  673. "idx": 63
  674. },
  675. {
  676. "path": "../classic/classic/src/fx/target/CompositeSprite.js",
  677. "requires": [
  678. 63
  679. ],
  680. "uses": [],
  681. "idx": 64
  682. },
  683. {
  684. "path": "../classic/classic/src/fx/target/Component.js",
  685. "requires": [
  686. 58
  687. ],
  688. "uses": [
  689. 77
  690. ],
  691. "idx": 65
  692. },
  693. {
  694. "path": "../classic/classic/src/fx/Queue.js",
  695. "requires": [
  696. 5
  697. ],
  698. "uses": [],
  699. "idx": 66
  700. },
  701. {
  702. "path": "../classic/classic/src/fx/Manager.js",
  703. "requires": [
  704. 56,
  705. 57,
  706. 59,
  707. 60,
  708. 61,
  709. 62,
  710. 63,
  711. 64,
  712. 65,
  713. 66
  714. ],
  715. "uses": [],
  716. "idx": 67
  717. },
  718. {
  719. "path": "../classic/classic/src/fx/Animator.js",
  720. "requires": [
  721. 52,
  722. 67
  723. ],
  724. "uses": [
  725. 73
  726. ],
  727. "idx": 68
  728. },
  729. {
  730. "path": "../classic/classic/src/fx/CubicBezier.js",
  731. "requires": [],
  732. "uses": [],
  733. "idx": 69
  734. },
  735. {
  736. "path": "../classic/classic/src/fx/Easing.js",
  737. "requires": [
  738. 69
  739. ],
  740. "uses": [],
  741. "idx": 70
  742. },
  743. {
  744. "path": "../classic/classic/src/fx/DrawPath.js",
  745. "requires": [],
  746. "uses": [],
  747. "idx": 71
  748. },
  749. {
  750. "path": "../classic/classic/src/fx/PropertyHandler.js",
  751. "requires": [
  752. 71
  753. ],
  754. "uses": [],
  755. "idx": 72
  756. },
  757. {
  758. "path": "../classic/classic/src/fx/Anim.js",
  759. "requires": [
  760. 52,
  761. 67,
  762. 68,
  763. 69,
  764. 70,
  765. 72
  766. ],
  767. "uses": [],
  768. "idx": 73
  769. },
  770. {
  771. "path": "../classic/classic/src/util/Animate.js",
  772. "requires": [
  773. 67,
  774. 73
  775. ],
  776. "uses": [],
  777. "idx": 74
  778. },
  779. {
  780. "path": "../packages/core/src/dom/Fly.js",
  781. "requires": [
  782. 49
  783. ],
  784. "uses": [],
  785. "idx": 75
  786. },
  787. {
  788. "path": "../packages/core/src/dom/CompositeElementLite.js",
  789. "requires": [
  790. 75
  791. ],
  792. "uses": [
  793. 49
  794. ],
  795. "idx": 76
  796. },
  797. {
  798. "path": "../packages/core/src/GlobalEvents.js",
  799. "requires": [
  800. 4,
  801. 49
  802. ],
  803. "uses": [
  804. 21
  805. ],
  806. "idx": 77
  807. },
  808. {
  809. "path": "../packages/core/src/Glyph.js",
  810. "requires": [],
  811. "uses": [],
  812. "idx": 78
  813. },
  814. {
  815. "path": "../packages/core/src/JSON.js",
  816. "requires": [],
  817. "uses": [],
  818. "idx": 79
  819. },
  820. {
  821. "path": "../packages/core/src/Manifest.js",
  822. "requires": [],
  823. "uses": [],
  824. "idx": 80
  825. },
  826. {
  827. "path": "../packages/core/src/mixin/Inheritable.js",
  828. "requires": [
  829. 0
  830. ],
  831. "uses": [
  832. 21
  833. ],
  834. "idx": 81
  835. },
  836. {
  837. "path": "../packages/core/src/mixin/Bindable.js",
  838. "requires": [],
  839. "uses": [
  840. 12
  841. ],
  842. "idx": 82
  843. },
  844. {
  845. "path": "../packages/core/src/mixin/ComponentDelegation.js",
  846. "requires": [
  847. 0,
  848. 4
  849. ],
  850. "uses": [
  851. 2
  852. ],
  853. "idx": 83
  854. },
  855. {
  856. "path": "../packages/core/src/plugin/Abstract.js",
  857. "requires": [
  858. 3
  859. ],
  860. "uses": [],
  861. "idx": 84
  862. },
  863. {
  864. "path": "../packages/core/src/mixin/Pluggable.js",
  865. "requires": [
  866. 84
  867. ],
  868. "uses": [],
  869. "idx": 85
  870. },
  871. {
  872. "path": "../packages/core/src/mixin/Keyboard.js",
  873. "requires": [
  874. 0
  875. ],
  876. "uses": [
  877. 36
  878. ],
  879. "idx": 86
  880. },
  881. {
  882. "path": "../packages/core/src/mixin/Focusable.js",
  883. "requires": [],
  884. "uses": [
  885. 21,
  886. 24,
  887. 36,
  888. 49
  889. ],
  890. "idx": 87
  891. },
  892. {
  893. "path": "../packages/core/src/mixin/Accessible.js",
  894. "requires": [
  895. 0
  896. ],
  897. "uses": [],
  898. "idx": 88
  899. },
  900. {
  901. "path": "../packages/core/src/Widget.js",
  902. "requires": [
  903. 12,
  904. 25,
  905. 49,
  906. 81,
  907. 82,
  908. 83,
  909. 85,
  910. 86,
  911. 87,
  912. 88
  913. ],
  914. "uses": [
  915. 21,
  916. 24,
  917. 98
  918. ],
  919. "idx": 89
  920. },
  921. {
  922. "path": "../packages/core/src/mixin/Responsive.js",
  923. "requires": [
  924. 0
  925. ],
  926. "uses": [
  927. 49
  928. ],
  929. "idx": 90
  930. },
  931. {
  932. "path": "../classic/classic/src/ResponsiveWidget.js",
  933. "requires": [
  934. 90
  935. ],
  936. "uses": [],
  937. "idx": 91
  938. },
  939. {
  940. "path": "../packages/core/src/ProgressBase.js",
  941. "requires": [],
  942. "uses": [
  943. 98
  944. ],
  945. "idx": 92
  946. },
  947. {
  948. "path": "../packages/core/src/Progress.js",
  949. "requires": [
  950. 89,
  951. 92
  952. ],
  953. "uses": [],
  954. "idx": 93
  955. },
  956. {
  957. "path": "../packages/core/src/util/Format.js",
  958. "requires": [],
  959. "uses": [
  960. 95,
  961. 250
  962. ],
  963. "idx": 94
  964. },
  965. {
  966. "path": "../packages/core/src/Template.js",
  967. "requires": [
  968. 94
  969. ],
  970. "uses": [
  971. 250
  972. ],
  973. "idx": 95
  974. },
  975. {
  976. "path": "../packages/core/src/util/XTemplateParser.js",
  977. "requires": [],
  978. "uses": [],
  979. "idx": 96
  980. },
  981. {
  982. "path": "../packages/core/src/util/XTemplateCompiler.js",
  983. "requires": [
  984. 96
  985. ],
  986. "uses": [],
  987. "idx": 97
  988. },
  989. {
  990. "path": "../packages/core/src/XTemplate.js",
  991. "requires": [
  992. 95,
  993. 97
  994. ],
  995. "uses": [],
  996. "idx": 98
  997. },
  998. {
  999. "path": "../packages/core/src/app/EventDomain.js",
  1000. "requires": [
  1001. 2
  1002. ],
  1003. "uses": [],
  1004. "idx": 99
  1005. },
  1006. {
  1007. "path": "../packages/core/src/app/domain/Component.js",
  1008. "requires": [
  1009. 89,
  1010. 99
  1011. ],
  1012. "uses": [],
  1013. "idx": 100
  1014. },
  1015. {
  1016. "path": "../classic/classic/src/util/ProtoElement.js",
  1017. "requires": [],
  1018. "uses": [
  1019. 49,
  1020. 250
  1021. ],
  1022. "idx": 101
  1023. },
  1024. {
  1025. "path": "../packages/core/src/dom/CompositeElement.js",
  1026. "requires": [
  1027. 76
  1028. ],
  1029. "uses": [],
  1030. "idx": 102
  1031. },
  1032. {
  1033. "path": "../classic/classic/src/plugin/Manager.js",
  1034. "requires": [],
  1035. "uses": [],
  1036. "idx": 103
  1037. },
  1038. {
  1039. "path": "../packages/core/src/util/CSS.js",
  1040. "requires": [],
  1041. "uses": [
  1042. 49
  1043. ],
  1044. "idx": 104
  1045. },
  1046. {
  1047. "path": "../packages/core/src/fx/easing/Abstract.js",
  1048. "requires": [],
  1049. "uses": [],
  1050. "idx": 105
  1051. },
  1052. {
  1053. "path": "../packages/core/src/fx/easing/Linear.js",
  1054. "requires": [
  1055. 105
  1056. ],
  1057. "uses": [],
  1058. "idx": 106
  1059. },
  1060. {
  1061. "path": "../packages/core/src/util/translatable/Abstract.js",
  1062. "requires": [
  1063. 12,
  1064. 25,
  1065. 106
  1066. ],
  1067. "uses": [
  1068. 19
  1069. ],
  1070. "idx": 107
  1071. },
  1072. {
  1073. "path": "../packages/core/src/util/translatable/Dom.js",
  1074. "requires": [
  1075. 107
  1076. ],
  1077. "uses": [],
  1078. "idx": 108
  1079. },
  1080. {
  1081. "path": "../packages/core/src/util/translatable/ScrollPosition.js",
  1082. "requires": [
  1083. 108
  1084. ],
  1085. "uses": [],
  1086. "idx": 109
  1087. },
  1088. {
  1089. "path": "../classic/classic/src/scroll/Scroller.js",
  1090. "requires": [
  1091. 11,
  1092. 12,
  1093. 20,
  1094. 25,
  1095. 104,
  1096. 109
  1097. ],
  1098. "uses": [
  1099. 77,
  1100. 461
  1101. ],
  1102. "idx": 110
  1103. },
  1104. {
  1105. "path": "../classic/classic/src/util/Floating.js",
  1106. "requires": [],
  1107. "uses": [
  1108. 21,
  1109. 49,
  1110. 75,
  1111. 413
  1112. ],
  1113. "idx": 111
  1114. },
  1115. {
  1116. "path": "../classic/classic/src/util/ElementContainer.js",
  1117. "requires": [],
  1118. "uses": [],
  1119. "idx": 112
  1120. },
  1121. {
  1122. "path": "../classic/classic/src/util/Renderable.js",
  1123. "requires": [
  1124. 49
  1125. ],
  1126. "uses": [
  1127. 98,
  1128. 117,
  1129. 250
  1130. ],
  1131. "idx": 113
  1132. },
  1133. {
  1134. "path": "../classic/classic/src/state/Provider.js",
  1135. "requires": [
  1136. 52
  1137. ],
  1138. "uses": [],
  1139. "idx": 114
  1140. },
  1141. {
  1142. "path": "../classic/classic/src/state/Manager.js",
  1143. "requires": [
  1144. 114
  1145. ],
  1146. "uses": [],
  1147. "idx": 115
  1148. },
  1149. {
  1150. "path": "../classic/classic/src/state/Stateful.js",
  1151. "requires": [
  1152. 57,
  1153. 115
  1154. ],
  1155. "uses": [],
  1156. "idx": 116
  1157. },
  1158. {
  1159. "path": "../classic/classic/src/Component.js",
  1160. "requires": [
  1161. 21,
  1162. 24,
  1163. 26,
  1164. 52,
  1165. 74,
  1166. 77,
  1167. 81,
  1168. 82,
  1169. 83,
  1170. 84,
  1171. 86,
  1172. 87,
  1173. 88,
  1174. 101,
  1175. 102,
  1176. 103,
  1177. 110,
  1178. 111,
  1179. 112,
  1180. 113,
  1181. 116
  1182. ],
  1183. "uses": [
  1184. 1,
  1185. 49,
  1186. 67,
  1187. 98,
  1188. 250,
  1189. 408,
  1190. 409,
  1191. 410,
  1192. 413,
  1193. 421,
  1194. 423,
  1195. 488,
  1196. 635,
  1197. 655
  1198. ],
  1199. "idx": 117
  1200. },
  1201. {
  1202. "path": "../classic/classic/src/Responsive.js",
  1203. "requires": [
  1204. 90,
  1205. 91
  1206. ],
  1207. "uses": [],
  1208. "idx": 118
  1209. },
  1210. {
  1211. "path": "../classic/classic/src/layout/container/border/Region.js",
  1212. "requires": [],
  1213. "uses": [],
  1214. "idx": 119
  1215. },
  1216. {
  1217. "path": "../packages/core/src/app/EventBus.js",
  1218. "requires": [
  1219. 100
  1220. ],
  1221. "uses": [
  1222. 99
  1223. ],
  1224. "idx": 120
  1225. },
  1226. {
  1227. "path": "../packages/core/src/app/domain/Global.js",
  1228. "requires": [
  1229. 77,
  1230. 99
  1231. ],
  1232. "uses": [],
  1233. "idx": 121
  1234. },
  1235. {
  1236. "path": "../packages/core/src/route/Handler.js",
  1237. "requires": [],
  1238. "uses": [],
  1239. "idx": 122
  1240. },
  1241. {
  1242. "path": "../packages/core/src/route/Action.js",
  1243. "requires": [],
  1244. "uses": [
  1245. 11
  1246. ],
  1247. "idx": 123
  1248. },
  1249. {
  1250. "path": "../packages/core/src/route/Route.js",
  1251. "requires": [
  1252. 122,
  1253. 123
  1254. ],
  1255. "uses": [
  1256. 10,
  1257. 126
  1258. ],
  1259. "idx": 124
  1260. },
  1261. {
  1262. "path": "../packages/core/src/util/History.js",
  1263. "requires": [
  1264. 52
  1265. ],
  1266. "uses": [],
  1267. "idx": 125
  1268. },
  1269. {
  1270. "path": "../packages/core/src/route/Router.js",
  1271. "requires": [
  1272. 123,
  1273. 124,
  1274. 125
  1275. ],
  1276. "uses": [
  1277. 122
  1278. ],
  1279. "idx": 126
  1280. },
  1281. {
  1282. "path": "../packages/core/src/route/Mixin.js",
  1283. "requires": [
  1284. 0,
  1285. 122,
  1286. 126
  1287. ],
  1288. "uses": [
  1289. 125
  1290. ],
  1291. "idx": 127
  1292. },
  1293. {
  1294. "path": "../packages/core/src/app/BaseController.js",
  1295. "requires": [
  1296. 4,
  1297. 120,
  1298. 121,
  1299. 127
  1300. ],
  1301. "uses": [
  1302. 223
  1303. ],
  1304. "idx": 128
  1305. },
  1306. {
  1307. "path": "../packages/core/src/app/Util.js",
  1308. "requires": [],
  1309. "uses": [],
  1310. "idx": 129
  1311. },
  1312. {
  1313. "path": "../packages/core/src/util/CollectionKey.js",
  1314. "requires": [
  1315. 3
  1316. ],
  1317. "uses": [],
  1318. "idx": 130
  1319. },
  1320. {
  1321. "path": "../packages/core/src/util/Grouper.js",
  1322. "requires": [
  1323. 54
  1324. ],
  1325. "uses": [],
  1326. "idx": 131
  1327. },
  1328. {
  1329. "path": "../packages/core/src/util/Collection.js",
  1330. "requires": [
  1331. 4,
  1332. 51,
  1333. 54,
  1334. 130,
  1335. 131
  1336. ],
  1337. "uses": [
  1338. 176,
  1339. 177,
  1340. 178
  1341. ],
  1342. "idx": 132
  1343. },
  1344. {
  1345. "path": "../packages/core/src/data/Range.js",
  1346. "requires": [
  1347. 1
  1348. ],
  1349. "uses": [],
  1350. "idx": 133
  1351. },
  1352. {
  1353. "path": "../packages/core/src/util/ObjectTemplate.js",
  1354. "requires": [
  1355. 98
  1356. ],
  1357. "uses": [],
  1358. "idx": 134
  1359. },
  1360. {
  1361. "path": "../packages/core/src/data/schema/Role.js",
  1362. "requires": [],
  1363. "uses": [
  1364. 12
  1365. ],
  1366. "idx": 135
  1367. },
  1368. {
  1369. "path": "../packages/core/src/data/schema/Association.js",
  1370. "requires": [
  1371. 135
  1372. ],
  1373. "uses": [],
  1374. "idx": 136
  1375. },
  1376. {
  1377. "path": "../packages/core/src/data/schema/OneToOne.js",
  1378. "requires": [
  1379. 136
  1380. ],
  1381. "uses": [],
  1382. "idx": 137
  1383. },
  1384. {
  1385. "path": "../packages/core/src/data/schema/ManyToOne.js",
  1386. "requires": [
  1387. 136
  1388. ],
  1389. "uses": [],
  1390. "idx": 138
  1391. },
  1392. {
  1393. "path": "../packages/core/src/data/schema/ManyToMany.js",
  1394. "requires": [
  1395. 136
  1396. ],
  1397. "uses": [],
  1398. "idx": 139
  1399. },
  1400. {
  1401. "path": "../packages/core/src/util/Inflector.js",
  1402. "requires": [],
  1403. "uses": [],
  1404. "idx": 140
  1405. },
  1406. {
  1407. "path": "../packages/core/src/data/schema/Namer.js",
  1408. "requires": [
  1409. 12,
  1410. 140
  1411. ],
  1412. "uses": [],
  1413. "idx": 141
  1414. },
  1415. {
  1416. "path": "../packages/core/src/data/schema/Schema.js",
  1417. "requires": [
  1418. 12,
  1419. 134,
  1420. 137,
  1421. 138,
  1422. 139,
  1423. 141
  1424. ],
  1425. "uses": [],
  1426. "idx": 142
  1427. },
  1428. {
  1429. "path": "../packages/core/src/data/AbstractStore.js",
  1430. "requires": [
  1431. 4,
  1432. 12,
  1433. 51,
  1434. 132,
  1435. 133,
  1436. 142
  1437. ],
  1438. "uses": [
  1439. 182
  1440. ],
  1441. "idx": 143
  1442. },
  1443. {
  1444. "path": "../packages/core/src/data/Error.js",
  1445. "requires": [],
  1446. "uses": [],
  1447. "idx": 144
  1448. },
  1449. {
  1450. "path": "../packages/core/src/data/ErrorCollection.js",
  1451. "requires": [
  1452. 56,
  1453. 144
  1454. ],
  1455. "uses": [
  1456. 153
  1457. ],
  1458. "idx": 145
  1459. },
  1460. {
  1461. "path": "../packages/core/src/data/operation/Operation.js",
  1462. "requires": [],
  1463. "uses": [],
  1464. "idx": 146
  1465. },
  1466. {
  1467. "path": "../packages/core/src/data/operation/Create.js",
  1468. "requires": [
  1469. 146
  1470. ],
  1471. "uses": [],
  1472. "idx": 147
  1473. },
  1474. {
  1475. "path": "../packages/core/src/data/operation/Destroy.js",
  1476. "requires": [
  1477. 146
  1478. ],
  1479. "uses": [],
  1480. "idx": 148
  1481. },
  1482. {
  1483. "path": "../packages/core/src/data/operation/Read.js",
  1484. "requires": [
  1485. 146
  1486. ],
  1487. "uses": [],
  1488. "idx": 149
  1489. },
  1490. {
  1491. "path": "../packages/core/src/data/operation/Update.js",
  1492. "requires": [
  1493. 146
  1494. ],
  1495. "uses": [],
  1496. "idx": 150
  1497. },
  1498. {
  1499. "path": "../packages/core/src/data/SortTypes.js",
  1500. "requires": [],
  1501. "uses": [],
  1502. "idx": 151
  1503. },
  1504. {
  1505. "path": "../packages/core/src/data/validator/Validator.js",
  1506. "requires": [
  1507. 12
  1508. ],
  1509. "uses": [],
  1510. "idx": 152
  1511. },
  1512. {
  1513. "path": "../packages/core/src/data/field/Field.js",
  1514. "requires": [
  1515. 12,
  1516. 151,
  1517. 152
  1518. ],
  1519. "uses": [],
  1520. "idx": 153
  1521. },
  1522. {
  1523. "path": "../packages/core/src/data/field/Boolean.js",
  1524. "requires": [
  1525. 153
  1526. ],
  1527. "uses": [],
  1528. "idx": 154
  1529. },
  1530. {
  1531. "path": "../packages/core/src/data/field/Date.js",
  1532. "requires": [
  1533. 153
  1534. ],
  1535. "uses": [],
  1536. "idx": 155
  1537. },
  1538. {
  1539. "path": "../packages/core/src/data/field/Integer.js",
  1540. "requires": [
  1541. 153
  1542. ],
  1543. "uses": [],
  1544. "idx": 156
  1545. },
  1546. {
  1547. "path": "../packages/core/src/data/field/Number.js",
  1548. "requires": [
  1549. 156
  1550. ],
  1551. "uses": [],
  1552. "idx": 157
  1553. },
  1554. {
  1555. "path": "../packages/core/src/data/field/String.js",
  1556. "requires": [
  1557. 153
  1558. ],
  1559. "uses": [],
  1560. "idx": 158
  1561. },
  1562. {
  1563. "path": "../packages/core/src/data/identifier/Generator.js",
  1564. "requires": [
  1565. 12
  1566. ],
  1567. "uses": [],
  1568. "idx": 159
  1569. },
  1570. {
  1571. "path": "../packages/core/src/data/identifier/Sequential.js",
  1572. "requires": [
  1573. 159
  1574. ],
  1575. "uses": [],
  1576. "idx": 160
  1577. },
  1578. {
  1579. "path": "../packages/core/src/data/Model.js",
  1580. "requires": [
  1581. 142,
  1582. 145,
  1583. 146,
  1584. 147,
  1585. 148,
  1586. 149,
  1587. 150,
  1588. 152,
  1589. 153,
  1590. 154,
  1591. 155,
  1592. 156,
  1593. 157,
  1594. 158,
  1595. 159,
  1596. 160
  1597. ],
  1598. "uses": [
  1599. 12,
  1600. 163,
  1601. 249
  1602. ],
  1603. "idx": 161
  1604. },
  1605. {
  1606. "path": "../packages/core/src/data/ResultSet.js",
  1607. "requires": [],
  1608. "uses": [],
  1609. "idx": 162
  1610. },
  1611. {
  1612. "path": "../packages/core/src/data/reader/Reader.js",
  1613. "requires": [
  1614. 4,
  1615. 12,
  1616. 23,
  1617. 98,
  1618. 162
  1619. ],
  1620. "uses": [
  1621. 142
  1622. ],
  1623. "idx": 163
  1624. },
  1625. {
  1626. "path": "../packages/core/src/data/writer/Writer.js",
  1627. "requires": [
  1628. 12
  1629. ],
  1630. "uses": [],
  1631. "idx": 164
  1632. },
  1633. {
  1634. "path": "../packages/core/src/data/proxy/Proxy.js",
  1635. "requires": [
  1636. 4,
  1637. 12,
  1638. 142,
  1639. 163,
  1640. 164
  1641. ],
  1642. "uses": [
  1643. 146,
  1644. 147,
  1645. 148,
  1646. 149,
  1647. 150,
  1648. 161,
  1649. 191
  1650. ],
  1651. "idx": 165
  1652. },
  1653. {
  1654. "path": "../packages/core/src/data/proxy/Client.js",
  1655. "requires": [
  1656. 165
  1657. ],
  1658. "uses": [],
  1659. "idx": 166
  1660. },
  1661. {
  1662. "path": "../packages/core/src/data/proxy/Memory.js",
  1663. "requires": [
  1664. 166
  1665. ],
  1666. "uses": [
  1667. 51,
  1668. 55
  1669. ],
  1670. "idx": 167
  1671. },
  1672. {
  1673. "path": "../packages/core/src/data/ProxyStore.js",
  1674. "requires": [
  1675. 143,
  1676. 146,
  1677. 147,
  1678. 148,
  1679. 149,
  1680. 150,
  1681. 161,
  1682. 165,
  1683. 167
  1684. ],
  1685. "uses": [
  1686. 142
  1687. ],
  1688. "idx": 168
  1689. },
  1690. {
  1691. "path": "../packages/core/src/util/Group.js",
  1692. "requires": [
  1693. 132
  1694. ],
  1695. "uses": [],
  1696. "idx": 169
  1697. },
  1698. {
  1699. "path": "../packages/core/src/data/Group.js",
  1700. "requires": [
  1701. 169
  1702. ],
  1703. "uses": [],
  1704. "idx": 170
  1705. },
  1706. {
  1707. "path": "../packages/core/src/data/LocalStore.js",
  1708. "requires": [
  1709. 0,
  1710. 170
  1711. ],
  1712. "uses": [
  1713. 132
  1714. ],
  1715. "idx": 171
  1716. },
  1717. {
  1718. "path": "../packages/core/src/data/proxy/Server.js",
  1719. "requires": [
  1720. 165
  1721. ],
  1722. "uses": [
  1723. 95,
  1724. 246
  1725. ],
  1726. "idx": 172
  1727. },
  1728. {
  1729. "path": "../packages/core/src/data/proxy/Ajax.js",
  1730. "requires": [
  1731. 18,
  1732. 172
  1733. ],
  1734. "uses": [],
  1735. "idx": 173
  1736. },
  1737. {
  1738. "path": "../packages/core/src/data/reader/Json.js",
  1739. "requires": [
  1740. 79,
  1741. 163
  1742. ],
  1743. "uses": [],
  1744. "idx": 174
  1745. },
  1746. {
  1747. "path": "../packages/core/src/data/writer/Json.js",
  1748. "requires": [
  1749. 164
  1750. ],
  1751. "uses": [],
  1752. "idx": 175
  1753. },
  1754. {
  1755. "path": "../packages/core/src/util/SorterCollection.js",
  1756. "requires": [
  1757. 54,
  1758. 132
  1759. ],
  1760. "uses": [],
  1761. "idx": 176
  1762. },
  1763. {
  1764. "path": "../packages/core/src/util/FilterCollection.js",
  1765. "requires": [
  1766. 51,
  1767. 132
  1768. ],
  1769. "uses": [],
  1770. "idx": 177
  1771. },
  1772. {
  1773. "path": "../packages/core/src/util/GroupCollection.js",
  1774. "requires": [
  1775. 132,
  1776. 169,
  1777. 176,
  1778. 177
  1779. ],
  1780. "uses": [],
  1781. "idx": 178
  1782. },
  1783. {
  1784. "path": "../packages/core/src/data/Store.js",
  1785. "requires": [
  1786. 1,
  1787. 161,
  1788. 168,
  1789. 171,
  1790. 173,
  1791. 174,
  1792. 175,
  1793. 178
  1794. ],
  1795. "uses": [
  1796. 131,
  1797. 182
  1798. ],
  1799. "idx": 179
  1800. },
  1801. {
  1802. "path": "../packages/core/src/data/reader/Array.js",
  1803. "requires": [
  1804. 174
  1805. ],
  1806. "uses": [],
  1807. "idx": 180
  1808. },
  1809. {
  1810. "path": "../packages/core/src/data/ArrayStore.js",
  1811. "requires": [
  1812. 167,
  1813. 179,
  1814. 180
  1815. ],
  1816. "uses": [],
  1817. "idx": 181
  1818. },
  1819. {
  1820. "path": "../packages/core/src/data/StoreManager.js",
  1821. "requires": [
  1822. 56,
  1823. 181
  1824. ],
  1825. "uses": [
  1826. 12,
  1827. 167,
  1828. 175,
  1829. 179,
  1830. 180
  1831. ],
  1832. "idx": 182
  1833. },
  1834. {
  1835. "path": "../packages/core/src/app/domain/Store.js",
  1836. "requires": [
  1837. 99,
  1838. 143
  1839. ],
  1840. "uses": [],
  1841. "idx": 183
  1842. },
  1843. {
  1844. "path": "../packages/core/src/app/Controller.js",
  1845. "requires": [
  1846. 21,
  1847. 100,
  1848. 128,
  1849. 129,
  1850. 182,
  1851. 183
  1852. ],
  1853. "uses": [
  1854. 24,
  1855. 142
  1856. ],
  1857. "idx": 184
  1858. },
  1859. {
  1860. "path": "../packages/core/src/app/Application.js",
  1861. "requires": [
  1862. 56,
  1863. 125,
  1864. 184
  1865. ],
  1866. "uses": [
  1867. 126
  1868. ],
  1869. "idx": 185
  1870. },
  1871. {
  1872. "path": "../packages/core/src/app/Profile.js",
  1873. "requires": [
  1874. 4,
  1875. 184
  1876. ],
  1877. "uses": [],
  1878. "idx": 186
  1879. },
  1880. {
  1881. "path": "../packages/core/src/app/domain/View.js",
  1882. "requires": [
  1883. 89,
  1884. 99
  1885. ],
  1886. "uses": [],
  1887. "idx": 187
  1888. },
  1889. {
  1890. "path": "../packages/core/src/app/ViewController.js",
  1891. "requires": [
  1892. 12,
  1893. 128,
  1894. 187
  1895. ],
  1896. "uses": [],
  1897. "idx": 188
  1898. },
  1899. {
  1900. "path": "../packages/core/src/util/Bag.js",
  1901. "requires": [],
  1902. "uses": [],
  1903. "idx": 189
  1904. },
  1905. {
  1906. "path": "../packages/core/src/util/Scheduler.js",
  1907. "requires": [
  1908. 4,
  1909. 189
  1910. ],
  1911. "uses": [
  1912. 77
  1913. ],
  1914. "idx": 190
  1915. },
  1916. {
  1917. "path": "../packages/core/src/data/Batch.js",
  1918. "requires": [
  1919. 4
  1920. ],
  1921. "uses": [],
  1922. "idx": 191
  1923. },
  1924. {
  1925. "path": "../packages/core/src/data/matrix/Slice.js",
  1926. "requires": [],
  1927. "uses": [],
  1928. "idx": 192
  1929. },
  1930. {
  1931. "path": "../packages/core/src/data/matrix/Side.js",
  1932. "requires": [
  1933. 192
  1934. ],
  1935. "uses": [],
  1936. "idx": 193
  1937. },
  1938. {
  1939. "path": "../packages/core/src/data/matrix/Matrix.js",
  1940. "requires": [
  1941. 193
  1942. ],
  1943. "uses": [],
  1944. "idx": 194
  1945. },
  1946. {
  1947. "path": "../packages/core/src/data/session/ChangesVisitor.js",
  1948. "requires": [],
  1949. "uses": [],
  1950. "idx": 195
  1951. },
  1952. {
  1953. "path": "../packages/core/src/data/session/ChildChangesVisitor.js",
  1954. "requires": [
  1955. 195
  1956. ],
  1957. "uses": [],
  1958. "idx": 196
  1959. },
  1960. {
  1961. "path": "../packages/core/src/data/session/BatchVisitor.js",
  1962. "requires": [],
  1963. "uses": [
  1964. 191
  1965. ],
  1966. "idx": 197
  1967. },
  1968. {
  1969. "path": "../packages/core/src/mixin/Dirty.js",
  1970. "requires": [],
  1971. "uses": [],
  1972. "idx": 198
  1973. },
  1974. {
  1975. "path": "../packages/core/src/data/Session.js",
  1976. "requires": [
  1977. 4,
  1978. 142,
  1979. 191,
  1980. 194,
  1981. 195,
  1982. 196,
  1983. 197,
  1984. 198
  1985. ],
  1986. "uses": [],
  1987. "idx": 199
  1988. },
  1989. {
  1990. "path": "../packages/core/src/util/Schedulable.js",
  1991. "requires": [],
  1992. "uses": [],
  1993. "idx": 200
  1994. },
  1995. {
  1996. "path": "../packages/core/src/app/bind/BaseBinding.js",
  1997. "requires": [
  1998. 200
  1999. ],
  2000. "uses": [],
  2001. "idx": 201
  2002. },
  2003. {
  2004. "path": "../packages/core/src/app/bind/Binding.js",
  2005. "requires": [
  2006. 201
  2007. ],
  2008. "uses": [],
  2009. "idx": 202
  2010. },
  2011. {
  2012. "path": "../packages/core/src/app/bind/AbstractStub.js",
  2013. "requires": [
  2014. 200,
  2015. 202
  2016. ],
  2017. "uses": [],
  2018. "idx": 203
  2019. },
  2020. {
  2021. "path": "../packages/core/src/app/bind/Stub.js",
  2022. "requires": [
  2023. 202,
  2024. 203
  2025. ],
  2026. "uses": [
  2027. 208
  2028. ],
  2029. "idx": 204
  2030. },
  2031. {
  2032. "path": "../packages/core/src/app/bind/LinkStub.js",
  2033. "requires": [
  2034. 204
  2035. ],
  2036. "uses": [],
  2037. "idx": 205
  2038. },
  2039. {
  2040. "path": "../packages/core/src/app/bind/RootStub.js",
  2041. "requires": [
  2042. 203,
  2043. 204,
  2044. 205
  2045. ],
  2046. "uses": [],
  2047. "idx": 206
  2048. },
  2049. {
  2050. "path": "../packages/core/src/app/bind/Multi.js",
  2051. "requires": [
  2052. 201
  2053. ],
  2054. "uses": [],
  2055. "idx": 207
  2056. },
  2057. {
  2058. "path": "../packages/core/src/app/bind/Formula.js",
  2059. "requires": [
  2060. 23,
  2061. 200
  2062. ],
  2063. "uses": [],
  2064. "idx": 208
  2065. },
  2066. {
  2067. "path": "../packages/core/src/util/Fly.js",
  2068. "requires": [],
  2069. "uses": [],
  2070. "idx": 209
  2071. },
  2072. {
  2073. "path": "../packages/core/src/parse/Tokenizer.js",
  2074. "requires": [
  2075. 209
  2076. ],
  2077. "uses": [],
  2078. "idx": 210
  2079. },
  2080. {
  2081. "path": "../packages/core/src/parse/Symbol.js",
  2082. "requires": [],
  2083. "uses": [],
  2084. "idx": 211
  2085. },
  2086. {
  2087. "path": "../packages/core/src/parse/symbol/Constant.js",
  2088. "requires": [
  2089. 211
  2090. ],
  2091. "uses": [],
  2092. "idx": 212
  2093. },
  2094. {
  2095. "path": "../packages/core/src/parse/symbol/Infix.js",
  2096. "requires": [
  2097. 211
  2098. ],
  2099. "uses": [],
  2100. "idx": 213
  2101. },
  2102. {
  2103. "path": "../packages/core/src/parse/symbol/InfixRight.js",
  2104. "requires": [
  2105. 213
  2106. ],
  2107. "uses": [],
  2108. "idx": 214
  2109. },
  2110. {
  2111. "path": "../packages/core/src/parse/symbol/Paren.js",
  2112. "requires": [
  2113. 211
  2114. ],
  2115. "uses": [],
  2116. "idx": 215
  2117. },
  2118. {
  2119. "path": "../packages/core/src/parse/symbol/Prefix.js",
  2120. "requires": [
  2121. 211
  2122. ],
  2123. "uses": [],
  2124. "idx": 216
  2125. },
  2126. {
  2127. "path": "../packages/core/src/parse/Parser.js",
  2128. "requires": [
  2129. 209,
  2130. 210,
  2131. 212,
  2132. 214,
  2133. 215,
  2134. 216
  2135. ],
  2136. "uses": [
  2137. 211,
  2138. 213
  2139. ],
  2140. "idx": 217
  2141. },
  2142. {
  2143. "path": "../packages/core/src/app/bind/Parser.js",
  2144. "requires": [
  2145. 94,
  2146. 217
  2147. ],
  2148. "uses": [],
  2149. "idx": 218
  2150. },
  2151. {
  2152. "path": "../packages/core/src/app/bind/Template.js",
  2153. "requires": [
  2154. 94,
  2155. 218
  2156. ],
  2157. "uses": [],
  2158. "idx": 219
  2159. },
  2160. {
  2161. "path": "../packages/core/src/app/bind/TemplateBinding.js",
  2162. "requires": [
  2163. 201,
  2164. 207,
  2165. 219
  2166. ],
  2167. "uses": [],
  2168. "idx": 220
  2169. },
  2170. {
  2171. "path": "../packages/core/src/data/ChainedStore.js",
  2172. "requires": [
  2173. 143,
  2174. 171
  2175. ],
  2176. "uses": [
  2177. 95,
  2178. 182
  2179. ],
  2180. "idx": 221
  2181. },
  2182. {
  2183. "path": "../packages/core/src/app/ViewModel.js",
  2184. "requires": [
  2185. 3,
  2186. 12,
  2187. 190,
  2188. 199,
  2189. 205,
  2190. 206,
  2191. 207,
  2192. 208,
  2193. 220,
  2194. 221
  2195. ],
  2196. "uses": [
  2197. 1,
  2198. 142
  2199. ],
  2200. "idx": 222
  2201. },
  2202. {
  2203. "path": "../packages/core/src/app/domain/Controller.js",
  2204. "requires": [
  2205. 99,
  2206. 184
  2207. ],
  2208. "uses": [
  2209. 128
  2210. ],
  2211. "idx": 223
  2212. },
  2213. {
  2214. "path": "../packages/core/src/direct/Manager.js",
  2215. "requires": [
  2216. 4,
  2217. 56
  2218. ],
  2219. "uses": [
  2220. 95
  2221. ],
  2222. "idx": 224
  2223. },
  2224. {
  2225. "path": "../packages/core/src/direct/Provider.js",
  2226. "requires": [
  2227. 4,
  2228. 224
  2229. ],
  2230. "uses": [
  2231. 18
  2232. ],
  2233. "idx": 225
  2234. },
  2235. {
  2236. "path": "../packages/core/src/app/domain/Direct.js",
  2237. "requires": [
  2238. 99,
  2239. 225
  2240. ],
  2241. "uses": [],
  2242. "idx": 226
  2243. },
  2244. {
  2245. "path": "../packages/core/src/data/PageMap.js",
  2246. "requires": [
  2247. 23
  2248. ],
  2249. "uses": [],
  2250. "idx": 227
  2251. },
  2252. {
  2253. "path": "../packages/core/src/data/BufferedStore.js",
  2254. "requires": [
  2255. 51,
  2256. 54,
  2257. 131,
  2258. 168,
  2259. 227
  2260. ],
  2261. "uses": [
  2262. 176,
  2263. 177,
  2264. 178
  2265. ],
  2266. "idx": 228
  2267. },
  2268. {
  2269. "path": "../packages/core/src/data/ClientStore.js",
  2270. "requires": [
  2271. 167,
  2272. 179
  2273. ],
  2274. "uses": [],
  2275. "idx": 229
  2276. },
  2277. {
  2278. "path": "../packages/core/src/data/proxy/Direct.js",
  2279. "requires": [
  2280. 172,
  2281. 224
  2282. ],
  2283. "uses": [],
  2284. "idx": 230
  2285. },
  2286. {
  2287. "path": "../packages/core/src/data/DirectStore.js",
  2288. "requires": [
  2289. 179,
  2290. 230
  2291. ],
  2292. "uses": [],
  2293. "idx": 231
  2294. },
  2295. {
  2296. "path": "../packages/core/src/data/JsonP.js",
  2297. "requires": [],
  2298. "uses": [],
  2299. "idx": 232
  2300. },
  2301. {
  2302. "path": "../packages/core/src/data/proxy/JsonP.js",
  2303. "requires": [
  2304. 172,
  2305. 232
  2306. ],
  2307. "uses": [],
  2308. "idx": 233
  2309. },
  2310. {
  2311. "path": "../packages/core/src/data/JsonPStore.js",
  2312. "requires": [
  2313. 174,
  2314. 179,
  2315. 233
  2316. ],
  2317. "uses": [],
  2318. "idx": 234
  2319. },
  2320. {
  2321. "path": "../packages/core/src/data/JsonStore.js",
  2322. "requires": [
  2323. 173,
  2324. 174,
  2325. 175,
  2326. 179
  2327. ],
  2328. "uses": [],
  2329. "idx": 235
  2330. },
  2331. {
  2332. "path": "../packages/core/src/data/ModelManager.js",
  2333. "requires": [
  2334. 142
  2335. ],
  2336. "uses": [
  2337. 161
  2338. ],
  2339. "idx": 236
  2340. },
  2341. {
  2342. "path": "../packages/core/src/data/NodeInterface.js",
  2343. "requires": [
  2344. 4,
  2345. 154,
  2346. 156,
  2347. 158,
  2348. 175
  2349. ],
  2350. "uses": [
  2351. 142
  2352. ],
  2353. "idx": 237
  2354. },
  2355. {
  2356. "path": "../packages/core/src/mixin/Queryable.js",
  2357. "requires": [],
  2358. "uses": [
  2359. 24
  2360. ],
  2361. "idx": 238
  2362. },
  2363. {
  2364. "path": "../packages/core/src/data/TreeModel.js",
  2365. "requires": [
  2366. 161,
  2367. 237,
  2368. 238
  2369. ],
  2370. "uses": [],
  2371. "idx": 239
  2372. },
  2373. {
  2374. "path": "../packages/core/src/data/NodeStore.js",
  2375. "requires": [
  2376. 179,
  2377. 237,
  2378. 239
  2379. ],
  2380. "uses": [
  2381. 161
  2382. ],
  2383. "idx": 240
  2384. },
  2385. {
  2386. "path": "../packages/core/src/data/query/Compiler.js",
  2387. "requires": [],
  2388. "uses": [
  2389. 79
  2390. ],
  2391. "idx": 241
  2392. },
  2393. {
  2394. "path": "../packages/core/src/data/query/Converter.js",
  2395. "requires": [],
  2396. "uses": [],
  2397. "idx": 242
  2398. },
  2399. {
  2400. "path": "../packages/core/src/data/query/Stringifier.js",
  2401. "requires": [],
  2402. "uses": [
  2403. 79
  2404. ],
  2405. "idx": 243
  2406. },
  2407. {
  2408. "path": "../packages/core/src/data/query/Parser.js",
  2409. "requires": [
  2410. 217
  2411. ],
  2412. "uses": [],
  2413. "idx": 244
  2414. },
  2415. {
  2416. "path": "../packages/core/src/data/Query.js",
  2417. "requires": [
  2418. 12,
  2419. 50,
  2420. 241,
  2421. 242,
  2422. 243,
  2423. 244
  2424. ],
  2425. "uses": [],
  2426. "idx": 245
  2427. },
  2428. {
  2429. "path": "../packages/core/src/data/Request.js",
  2430. "requires": [],
  2431. "uses": [],
  2432. "idx": 246
  2433. },
  2434. {
  2435. "path": "../packages/core/src/data/TreeStore.js",
  2436. "requires": [
  2437. 54,
  2438. 179,
  2439. 237,
  2440. 239
  2441. ],
  2442. "uses": [
  2443. 161
  2444. ],
  2445. "idx": 247
  2446. },
  2447. {
  2448. "path": "../packages/core/src/data/Types.js",
  2449. "requires": [
  2450. 151
  2451. ],
  2452. "uses": [],
  2453. "idx": 248
  2454. },
  2455. {
  2456. "path": "../packages/core/src/data/Validation.js",
  2457. "requires": [
  2458. 161
  2459. ],
  2460. "uses": [],
  2461. "idx": 249
  2462. },
  2463. {
  2464. "path": "../packages/core/src/dom/Helper.js",
  2465. "requires": [],
  2466. "uses": [
  2467. 95
  2468. ],
  2469. "idx": 250
  2470. },
  2471. {
  2472. "path": "../packages/core/src/dom/Query.js",
  2473. "requires": [
  2474. 22,
  2475. 250
  2476. ],
  2477. "uses": [
  2478. 23
  2479. ],
  2480. "idx": 251
  2481. },
  2482. {
  2483. "path": "../packages/core/src/data/reader/Xml.js",
  2484. "requires": [
  2485. 163,
  2486. 251
  2487. ],
  2488. "uses": [],
  2489. "idx": 252
  2490. },
  2491. {
  2492. "path": "../packages/core/src/data/writer/Xml.js",
  2493. "requires": [
  2494. 164
  2495. ],
  2496. "uses": [],
  2497. "idx": 253
  2498. },
  2499. {
  2500. "path": "../packages/core/src/data/XmlStore.js",
  2501. "requires": [
  2502. 173,
  2503. 179,
  2504. 252,
  2505. 253
  2506. ],
  2507. "uses": [],
  2508. "idx": 254
  2509. },
  2510. {
  2511. "path": "../packages/core/src/data/identifier/Negative.js",
  2512. "requires": [
  2513. 160
  2514. ],
  2515. "uses": [],
  2516. "idx": 255
  2517. },
  2518. {
  2519. "path": "../packages/core/src/data/identifier/Uuid.js",
  2520. "requires": [
  2521. 159
  2522. ],
  2523. "uses": [],
  2524. "idx": 256
  2525. },
  2526. {
  2527. "path": "../packages/core/src/data/proxy/WebStorage.js",
  2528. "requires": [
  2529. 160,
  2530. 166
  2531. ],
  2532. "uses": [
  2533. 54,
  2534. 95,
  2535. 162
  2536. ],
  2537. "idx": 257
  2538. },
  2539. {
  2540. "path": "../packages/core/src/data/proxy/LocalStorage.js",
  2541. "requires": [
  2542. 257
  2543. ],
  2544. "uses": [],
  2545. "idx": 258
  2546. },
  2547. {
  2548. "path": "../packages/core/src/data/proxy/Rest.js",
  2549. "requires": [
  2550. 173
  2551. ],
  2552. "uses": [],
  2553. "idx": 259
  2554. },
  2555. {
  2556. "path": "../packages/core/src/data/proxy/SessionStorage.js",
  2557. "requires": [
  2558. 257
  2559. ],
  2560. "uses": [],
  2561. "idx": 260
  2562. },
  2563. {
  2564. "path": "../packages/core/src/data/schema/BelongsTo.js",
  2565. "requires": [],
  2566. "uses": [],
  2567. "idx": 261
  2568. },
  2569. {
  2570. "path": "../packages/core/src/data/schema/HasMany.js",
  2571. "requires": [],
  2572. "uses": [],
  2573. "idx": 262
  2574. },
  2575. {
  2576. "path": "../packages/core/src/data/schema/HasOne.js",
  2577. "requires": [],
  2578. "uses": [],
  2579. "idx": 263
  2580. },
  2581. {
  2582. "path": "../packages/core/src/data/schema/Reference.js",
  2583. "requires": [],
  2584. "uses": [],
  2585. "idx": 264
  2586. },
  2587. {
  2588. "path": "../packages/core/src/data/summary/Base.js",
  2589. "requires": [
  2590. 12
  2591. ],
  2592. "uses": [],
  2593. "idx": 265
  2594. },
  2595. {
  2596. "path": "../packages/core/src/data/summary/Sum.js",
  2597. "requires": [
  2598. 265
  2599. ],
  2600. "uses": [],
  2601. "idx": 266
  2602. },
  2603. {
  2604. "path": "../packages/core/src/data/summary/Average.js",
  2605. "requires": [
  2606. 266
  2607. ],
  2608. "uses": [],
  2609. "idx": 267
  2610. },
  2611. {
  2612. "path": "../packages/core/src/data/summary/Count.js",
  2613. "requires": [
  2614. 265
  2615. ],
  2616. "uses": [],
  2617. "idx": 268
  2618. },
  2619. {
  2620. "path": "../packages/core/src/data/summary/Max.js",
  2621. "requires": [
  2622. 265
  2623. ],
  2624. "uses": [],
  2625. "idx": 269
  2626. },
  2627. {
  2628. "path": "../packages/core/src/data/summary/Min.js",
  2629. "requires": [
  2630. 265
  2631. ],
  2632. "uses": [],
  2633. "idx": 270
  2634. },
  2635. {
  2636. "path": "../packages/core/src/data/summary/None.js",
  2637. "requires": [
  2638. 265
  2639. ],
  2640. "uses": [],
  2641. "idx": 271
  2642. },
  2643. {
  2644. "path": "../packages/core/src/data/validator/AbstractDate.js",
  2645. "requires": [
  2646. 152
  2647. ],
  2648. "uses": [],
  2649. "idx": 272
  2650. },
  2651. {
  2652. "path": "../packages/core/src/data/validator/Bound.js",
  2653. "requires": [
  2654. 152
  2655. ],
  2656. "uses": [
  2657. 95
  2658. ],
  2659. "idx": 273
  2660. },
  2661. {
  2662. "path": "../packages/core/src/data/validator/Format.js",
  2663. "requires": [
  2664. 152
  2665. ],
  2666. "uses": [],
  2667. "idx": 274
  2668. },
  2669. {
  2670. "path": "../packages/core/src/data/validator/CIDRv4.js",
  2671. "requires": [
  2672. 274
  2673. ],
  2674. "uses": [],
  2675. "idx": 275
  2676. },
  2677. {
  2678. "path": "../packages/core/src/data/validator/CIDRv6.js",
  2679. "requires": [
  2680. 274
  2681. ],
  2682. "uses": [],
  2683. "idx": 276
  2684. },
  2685. {
  2686. "path": "../packages/core/src/data/validator/Number.js",
  2687. "requires": [
  2688. 152
  2689. ],
  2690. "uses": [
  2691. 94
  2692. ],
  2693. "idx": 277
  2694. },
  2695. {
  2696. "path": "../packages/core/src/data/validator/Currency.js",
  2697. "requires": [
  2698. 277
  2699. ],
  2700. "uses": [
  2701. 94
  2702. ],
  2703. "idx": 278
  2704. },
  2705. {
  2706. "path": "../packages/core/src/data/validator/CurrencyUS.js",
  2707. "requires": [
  2708. 278
  2709. ],
  2710. "uses": [],
  2711. "idx": 279
  2712. },
  2713. {
  2714. "path": "../packages/core/src/data/validator/Date.js",
  2715. "requires": [
  2716. 272
  2717. ],
  2718. "uses": [],
  2719. "idx": 280
  2720. },
  2721. {
  2722. "path": "../packages/core/src/data/validator/DateTime.js",
  2723. "requires": [
  2724. 272
  2725. ],
  2726. "uses": [],
  2727. "idx": 281
  2728. },
  2729. {
  2730. "path": "../packages/core/src/data/validator/Email.js",
  2731. "requires": [
  2732. 274
  2733. ],
  2734. "uses": [],
  2735. "idx": 282
  2736. },
  2737. {
  2738. "path": "../packages/core/src/data/validator/List.js",
  2739. "requires": [
  2740. 152
  2741. ],
  2742. "uses": [],
  2743. "idx": 283
  2744. },
  2745. {
  2746. "path": "../packages/core/src/data/validator/Exclusion.js",
  2747. "requires": [
  2748. 283
  2749. ],
  2750. "uses": [],
  2751. "idx": 284
  2752. },
  2753. {
  2754. "path": "../packages/core/src/data/validator/IPAddress.js",
  2755. "requires": [
  2756. 274
  2757. ],
  2758. "uses": [],
  2759. "idx": 285
  2760. },
  2761. {
  2762. "path": "../packages/core/src/data/validator/Inclusion.js",
  2763. "requires": [
  2764. 283
  2765. ],
  2766. "uses": [],
  2767. "idx": 286
  2768. },
  2769. {
  2770. "path": "../packages/core/src/data/validator/Length.js",
  2771. "requires": [
  2772. 273
  2773. ],
  2774. "uses": [],
  2775. "idx": 287
  2776. },
  2777. {
  2778. "path": "../packages/core/src/data/validator/Presence.js",
  2779. "requires": [
  2780. 152
  2781. ],
  2782. "uses": [],
  2783. "idx": 288
  2784. },
  2785. {
  2786. "path": "../packages/core/src/data/validator/NotNull.js",
  2787. "requires": [
  2788. 288
  2789. ],
  2790. "uses": [],
  2791. "idx": 289
  2792. },
  2793. {
  2794. "path": "../packages/core/src/data/validator/Phone.js",
  2795. "requires": [
  2796. 274
  2797. ],
  2798. "uses": [],
  2799. "idx": 290
  2800. },
  2801. {
  2802. "path": "../packages/core/src/data/validator/Range.js",
  2803. "requires": [
  2804. 273
  2805. ],
  2806. "uses": [],
  2807. "idx": 291
  2808. },
  2809. {
  2810. "path": "../packages/core/src/data/validator/Time.js",
  2811. "requires": [
  2812. 272
  2813. ],
  2814. "uses": [],
  2815. "idx": 292
  2816. },
  2817. {
  2818. "path": "../packages/core/src/data/validator/Url.js",
  2819. "requires": [
  2820. 274
  2821. ],
  2822. "uses": [],
  2823. "idx": 293
  2824. },
  2825. {
  2826. "path": "../packages/core/src/data/virtual/Group.js",
  2827. "requires": [],
  2828. "uses": [],
  2829. "idx": 294
  2830. },
  2831. {
  2832. "path": "../packages/core/src/data/virtual/Page.js",
  2833. "requires": [],
  2834. "uses": [],
  2835. "idx": 295
  2836. },
  2837. {
  2838. "path": "../packages/core/src/data/virtual/PageMap.js",
  2839. "requires": [
  2840. 295
  2841. ],
  2842. "uses": [],
  2843. "idx": 296
  2844. },
  2845. {
  2846. "path": "../packages/core/src/data/virtual/Range.js",
  2847. "requires": [
  2848. 133
  2849. ],
  2850. "uses": [],
  2851. "idx": 297
  2852. },
  2853. {
  2854. "path": "../packages/core/src/data/virtual/Store.js",
  2855. "requires": [
  2856. 168,
  2857. 176,
  2858. 177,
  2859. 296,
  2860. 297
  2861. ],
  2862. "uses": [
  2863. 131,
  2864. 132,
  2865. 161,
  2866. 294
  2867. ],
  2868. "idx": 298
  2869. },
  2870. {
  2871. "path": "../packages/core/src/direct/Event.js",
  2872. "requires": [],
  2873. "uses": [],
  2874. "idx": 299
  2875. },
  2876. {
  2877. "path": "../packages/core/src/direct/RemotingEvent.js",
  2878. "requires": [
  2879. 299
  2880. ],
  2881. "uses": [
  2882. 224
  2883. ],
  2884. "idx": 300
  2885. },
  2886. {
  2887. "path": "../packages/core/src/direct/ExceptionEvent.js",
  2888. "requires": [
  2889. 300
  2890. ],
  2891. "uses": [],
  2892. "idx": 301
  2893. },
  2894. {
  2895. "path": "../packages/core/src/direct/JsonProvider.js",
  2896. "requires": [
  2897. 225
  2898. ],
  2899. "uses": [
  2900. 224,
  2901. 301
  2902. ],
  2903. "idx": 302
  2904. },
  2905. {
  2906. "path": "../packages/core/src/direct/PollingProvider.js",
  2907. "requires": [
  2908. 18,
  2909. 57,
  2910. 301,
  2911. 302
  2912. ],
  2913. "uses": [
  2914. 224,
  2915. 399
  2916. ],
  2917. "idx": 303
  2918. },
  2919. {
  2920. "path": "../packages/core/src/direct/RemotingMethod.js",
  2921. "requires": [],
  2922. "uses": [],
  2923. "idx": 304
  2924. },
  2925. {
  2926. "path": "../packages/core/src/direct/Transaction.js",
  2927. "requires": [],
  2928. "uses": [],
  2929. "idx": 305
  2930. },
  2931. {
  2932. "path": "../packages/core/src/direct/RemotingProvider.js",
  2933. "requires": [
  2934. 1,
  2935. 56,
  2936. 224,
  2937. 302,
  2938. 304,
  2939. 305
  2940. ],
  2941. "uses": [
  2942. 79,
  2943. 301
  2944. ],
  2945. "idx": 306
  2946. },
  2947. {
  2948. "path": "../packages/core/src/dom/GarbageCollector.js",
  2949. "requires": [],
  2950. "uses": [
  2951. 49
  2952. ],
  2953. "idx": 307
  2954. },
  2955. {
  2956. "path": "../packages/core/src/dom/TouchAction.js",
  2957. "requires": [
  2958. 35,
  2959. 49
  2960. ],
  2961. "uses": [],
  2962. "idx": 308
  2963. },
  2964. {
  2965. "path": "../packages/core/src/drag/Constraint.js",
  2966. "requires": [
  2967. 12
  2968. ],
  2969. "uses": [
  2970. 34
  2971. ],
  2972. "idx": 309
  2973. },
  2974. {
  2975. "path": "../packages/core/src/drag/Info.js",
  2976. "requires": [
  2977. 10
  2978. ],
  2979. "uses": [],
  2980. "idx": 310
  2981. },
  2982. {
  2983. "path": "../packages/core/src/drag/Item.js",
  2984. "requires": [
  2985. 3,
  2986. 4
  2987. ],
  2988. "uses": [],
  2989. "idx": 311
  2990. },
  2991. {
  2992. "path": "../packages/core/src/drag/Manager.js",
  2993. "requires": [],
  2994. "uses": [
  2995. 49,
  2996. 81,
  2997. 310
  2998. ],
  2999. "idx": 312
  3000. },
  3001. {
  3002. "path": "../packages/core/src/drag/Source.js",
  3003. "requires": [
  3004. 77,
  3005. 309,
  3006. 311
  3007. ],
  3008. "uses": [
  3009. 12,
  3010. 310
  3011. ],
  3012. "idx": 313
  3013. },
  3014. {
  3015. "path": "../packages/core/src/drag/Target.js",
  3016. "requires": [
  3017. 311,
  3018. 312
  3019. ],
  3020. "uses": [],
  3021. "idx": 314
  3022. },
  3023. {
  3024. "path": "../packages/core/src/drag/proxy/None.js",
  3025. "requires": [
  3026. 12
  3027. ],
  3028. "uses": [],
  3029. "idx": 315
  3030. },
  3031. {
  3032. "path": "../packages/core/src/drag/proxy/Original.js",
  3033. "requires": [
  3034. 315
  3035. ],
  3036. "uses": [],
  3037. "idx": 316
  3038. },
  3039. {
  3040. "path": "../packages/core/src/drag/proxy/Placeholder.js",
  3041. "requires": [
  3042. 315
  3043. ],
  3044. "uses": [],
  3045. "idx": 317
  3046. },
  3047. {
  3048. "path": "../packages/core/src/event/gesture/Recognizer.js",
  3049. "requires": [
  3050. 3,
  3051. 38
  3052. ],
  3053. "uses": [],
  3054. "idx": 318
  3055. },
  3056. {
  3057. "path": "../packages/core/src/event/gesture/SingleTouch.js",
  3058. "requires": [
  3059. 318
  3060. ],
  3061. "uses": [],
  3062. "idx": 319
  3063. },
  3064. {
  3065. "path": "../packages/core/src/event/gesture/DoubleTap.js",
  3066. "requires": [
  3067. 319
  3068. ],
  3069. "uses": [
  3070. 49
  3071. ],
  3072. "idx": 320
  3073. },
  3074. {
  3075. "path": "../packages/core/src/event/gesture/Drag.js",
  3076. "requires": [
  3077. 319
  3078. ],
  3079. "uses": [
  3080. 49
  3081. ],
  3082. "idx": 321
  3083. },
  3084. {
  3085. "path": "../packages/core/src/event/gesture/Swipe.js",
  3086. "requires": [
  3087. 319
  3088. ],
  3089. "uses": [],
  3090. "idx": 322
  3091. },
  3092. {
  3093. "path": "../packages/core/src/event/gesture/EdgeSwipe.js",
  3094. "requires": [
  3095. 322
  3096. ],
  3097. "uses": [
  3098. 49
  3099. ],
  3100. "idx": 323
  3101. },
  3102. {
  3103. "path": "../packages/core/src/event/gesture/LongPress.js",
  3104. "requires": [
  3105. 319
  3106. ],
  3107. "uses": [
  3108. 38,
  3109. 49,
  3110. 321
  3111. ],
  3112. "idx": 324
  3113. },
  3114. {
  3115. "path": "../packages/core/src/event/gesture/MultiTouch.js",
  3116. "requires": [
  3117. 318
  3118. ],
  3119. "uses": [],
  3120. "idx": 325
  3121. },
  3122. {
  3123. "path": "../packages/core/src/event/gesture/Pinch.js",
  3124. "requires": [
  3125. 325
  3126. ],
  3127. "uses": [],
  3128. "idx": 326
  3129. },
  3130. {
  3131. "path": "../packages/core/src/event/gesture/Rotate.js",
  3132. "requires": [
  3133. 325
  3134. ],
  3135. "uses": [],
  3136. "idx": 327
  3137. },
  3138. {
  3139. "path": "../packages/core/src/event/gesture/Tap.js",
  3140. "requires": [
  3141. 319
  3142. ],
  3143. "uses": [
  3144. 49
  3145. ],
  3146. "idx": 328
  3147. },
  3148. {
  3149. "path": "../packages/core/src/event/publisher/Focus.js",
  3150. "requires": [
  3151. 37,
  3152. 49,
  3153. 75,
  3154. 77
  3155. ],
  3156. "uses": [
  3157. 36
  3158. ],
  3159. "idx": 329
  3160. },
  3161. {
  3162. "path": "../packages/core/src/field/InputMask.js",
  3163. "requires": [],
  3164. "uses": [],
  3165. "idx": 330
  3166. },
  3167. {
  3168. "path": "../packages/core/src/fx/State.js",
  3169. "requires": [],
  3170. "uses": [],
  3171. "idx": 331
  3172. },
  3173. {
  3174. "path": "../packages/core/src/fx/animation/Abstract.js",
  3175. "requires": [
  3176. 12,
  3177. 25,
  3178. 331
  3179. ],
  3180. "uses": [],
  3181. "idx": 332
  3182. },
  3183. {
  3184. "path": "../packages/core/src/fx/animation/Slide.js",
  3185. "requires": [
  3186. 332
  3187. ],
  3188. "uses": [],
  3189. "idx": 333
  3190. },
  3191. {
  3192. "path": "../packages/core/src/fx/animation/SlideOut.js",
  3193. "requires": [
  3194. 333
  3195. ],
  3196. "uses": [],
  3197. "idx": 334
  3198. },
  3199. {
  3200. "path": "../packages/core/src/fx/animation/Fade.js",
  3201. "requires": [
  3202. 332
  3203. ],
  3204. "uses": [],
  3205. "idx": 335
  3206. },
  3207. {
  3208. "path": "../packages/core/src/fx/animation/FadeOut.js",
  3209. "requires": [
  3210. 335
  3211. ],
  3212. "uses": [],
  3213. "idx": 336
  3214. },
  3215. {
  3216. "path": "../packages/core/src/fx/animation/Flip.js",
  3217. "requires": [
  3218. 332
  3219. ],
  3220. "uses": [],
  3221. "idx": 337
  3222. },
  3223. {
  3224. "path": "../packages/core/src/fx/animation/Pop.js",
  3225. "requires": [
  3226. 332
  3227. ],
  3228. "uses": [],
  3229. "idx": 338
  3230. },
  3231. {
  3232. "path": "../packages/core/src/fx/animation/PopOut.js",
  3233. "requires": [
  3234. 338
  3235. ],
  3236. "uses": [],
  3237. "idx": 339
  3238. },
  3239. {
  3240. "path": "../packages/core/src/fx/Animation.js",
  3241. "requires": [
  3242. 333,
  3243. 334,
  3244. 335,
  3245. 336,
  3246. 337,
  3247. 338,
  3248. 339
  3249. ],
  3250. "uses": [
  3251. 332
  3252. ],
  3253. "idx": 340
  3254. },
  3255. {
  3256. "path": "../packages/core/src/fx/runner/Css.js",
  3257. "requires": [
  3258. 25,
  3259. 340
  3260. ],
  3261. "uses": [
  3262. 49
  3263. ],
  3264. "idx": 341
  3265. },
  3266. {
  3267. "path": "../packages/core/src/fx/runner/CssTransition.js",
  3268. "requires": [
  3269. 19,
  3270. 341
  3271. ],
  3272. "uses": [
  3273. 340
  3274. ],
  3275. "idx": 342
  3276. },
  3277. {
  3278. "path": "../packages/core/src/fx/Runner.js",
  3279. "requires": [
  3280. 342
  3281. ],
  3282. "uses": [],
  3283. "idx": 343
  3284. },
  3285. {
  3286. "path": "../packages/core/src/fx/animation/Cube.js",
  3287. "requires": [
  3288. 332
  3289. ],
  3290. "uses": [],
  3291. "idx": 344
  3292. },
  3293. {
  3294. "path": "../packages/core/src/fx/animation/Wipe.js",
  3295. "requires": [
  3296. 340
  3297. ],
  3298. "uses": [],
  3299. "idx": 345
  3300. },
  3301. {
  3302. "path": "../packages/core/src/fx/animation/WipeOut.js",
  3303. "requires": [
  3304. 345
  3305. ],
  3306. "uses": [],
  3307. "idx": 346
  3308. },
  3309. {
  3310. "path": "../packages/core/src/fx/easing/Bounce.js",
  3311. "requires": [
  3312. 105
  3313. ],
  3314. "uses": [],
  3315. "idx": 347
  3316. },
  3317. {
  3318. "path": "../packages/core/src/fx/easing/Momentum.js",
  3319. "requires": [
  3320. 105
  3321. ],
  3322. "uses": [],
  3323. "idx": 348
  3324. },
  3325. {
  3326. "path": "../packages/core/src/fx/easing/BoundMomentum.js",
  3327. "requires": [
  3328. 105,
  3329. 347,
  3330. 348
  3331. ],
  3332. "uses": [],
  3333. "idx": 349
  3334. },
  3335. {
  3336. "path": "../packages/core/src/fx/easing/EaseIn.js",
  3337. "requires": [
  3338. 106
  3339. ],
  3340. "uses": [],
  3341. "idx": 350
  3342. },
  3343. {
  3344. "path": "../packages/core/src/fx/easing/EaseOut.js",
  3345. "requires": [
  3346. 106
  3347. ],
  3348. "uses": [],
  3349. "idx": 351
  3350. },
  3351. {
  3352. "path": "../packages/core/src/fx/easing/Easing.js",
  3353. "requires": [
  3354. 106
  3355. ],
  3356. "uses": [],
  3357. "idx": 352
  3358. },
  3359. {
  3360. "path": "../packages/core/src/fx/runner/CssAnimation.js",
  3361. "requires": [
  3362. 341
  3363. ],
  3364. "uses": [
  3365. 340
  3366. ],
  3367. "idx": 353
  3368. },
  3369. {
  3370. "path": "../packages/core/src/list/AbstractTreeItem.js",
  3371. "requires": [
  3372. 89
  3373. ],
  3374. "uses": [],
  3375. "idx": 354
  3376. },
  3377. {
  3378. "path": "../packages/core/src/list/RootTreeItem.js",
  3379. "requires": [
  3380. 354
  3381. ],
  3382. "uses": [],
  3383. "idx": 355
  3384. },
  3385. {
  3386. "path": "../packages/core/src/mixin/ItemRippler.js",
  3387. "requires": [],
  3388. "uses": [],
  3389. "idx": 356
  3390. },
  3391. {
  3392. "path": "../packages/core/src/list/TreeItem.js",
  3393. "requires": [
  3394. 89,
  3395. 354
  3396. ],
  3397. "uses": [],
  3398. "idx": 357
  3399. },
  3400. {
  3401. "path": "../packages/core/src/list/Tree.js",
  3402. "requires": [
  3403. 89,
  3404. 355,
  3405. 356,
  3406. 357
  3407. ],
  3408. "uses": [
  3409. 161,
  3410. 182
  3411. ],
  3412. "idx": 358
  3413. },
  3414. {
  3415. "path": "../packages/core/src/mixin/ConfigProxy.js",
  3416. "requires": [
  3417. 0
  3418. ],
  3419. "uses": [],
  3420. "idx": 359
  3421. },
  3422. {
  3423. "path": "../packages/core/src/mixin/ConfigState.js",
  3424. "requires": [
  3425. 0
  3426. ],
  3427. "uses": [],
  3428. "idx": 360
  3429. },
  3430. {
  3431. "path": "../packages/core/src/mixin/Container.js",
  3432. "requires": [
  3433. 0
  3434. ],
  3435. "uses": [
  3436. 21
  3437. ],
  3438. "idx": 361
  3439. },
  3440. {
  3441. "path": "../packages/core/src/util/KeyMap.js",
  3442. "requires": [],
  3443. "uses": [],
  3444. "idx": 362
  3445. },
  3446. {
  3447. "path": "../packages/core/src/util/KeyNav.js",
  3448. "requires": [
  3449. 362
  3450. ],
  3451. "uses": [
  3452. 36
  3453. ],
  3454. "idx": 363
  3455. },
  3456. {
  3457. "path": "../packages/core/src/mixin/FocusableContainer.js",
  3458. "requires": [
  3459. 0,
  3460. 363
  3461. ],
  3462. "uses": [
  3463. 21
  3464. ],
  3465. "idx": 364
  3466. },
  3467. {
  3468. "path": "../packages/core/src/mixin/Hookable.js",
  3469. "requires": [
  3470. 0
  3471. ],
  3472. "uses": [],
  3473. "idx": 365
  3474. },
  3475. {
  3476. "path": "../packages/core/src/mixin/Mashup.js",
  3477. "requires": [
  3478. 0
  3479. ],
  3480. "uses": [
  3481. 95
  3482. ],
  3483. "idx": 366
  3484. },
  3485. {
  3486. "path": "../packages/core/src/mixin/Selectable.js",
  3487. "requires": [
  3488. 0
  3489. ],
  3490. "uses": [
  3491. 132
  3492. ],
  3493. "idx": 367
  3494. },
  3495. {
  3496. "path": "../packages/core/src/mixin/StoreWatcher.js",
  3497. "requires": [],
  3498. "uses": [],
  3499. "idx": 368
  3500. },
  3501. {
  3502. "path": "../packages/core/src/mixin/StyleCacher.js",
  3503. "requires": [
  3504. 0
  3505. ],
  3506. "uses": [],
  3507. "idx": 369
  3508. },
  3509. {
  3510. "path": "../packages/core/src/mixin/Traversable.js",
  3511. "requires": [
  3512. 0
  3513. ],
  3514. "uses": [],
  3515. "idx": 370
  3516. },
  3517. {
  3518. "path": "../packages/core/src/perf/Accumulator.js",
  3519. "requires": [
  3520. 98
  3521. ],
  3522. "uses": [],
  3523. "idx": 371
  3524. },
  3525. {
  3526. "path": "../packages/core/src/perf/Monitor.js",
  3527. "requires": [
  3528. 371
  3529. ],
  3530. "uses": [],
  3531. "idx": 372
  3532. },
  3533. {
  3534. "path": "../packages/core/src/plugin/AbstractClipboard.js",
  3535. "requires": [
  3536. 84,
  3537. 362
  3538. ],
  3539. "uses": [
  3540. 49
  3541. ],
  3542. "idx": 373
  3543. },
  3544. {
  3545. "path": "../packages/core/src/plugin/MouseEnter.js",
  3546. "requires": [
  3547. 84
  3548. ],
  3549. "uses": [],
  3550. "idx": 374
  3551. },
  3552. {
  3553. "path": "../packages/core/src/sparkline/Shape.js",
  3554. "requires": [],
  3555. "uses": [],
  3556. "idx": 375
  3557. },
  3558. {
  3559. "path": "../packages/core/src/sparkline/CanvasBase.js",
  3560. "requires": [
  3561. 375
  3562. ],
  3563. "uses": [],
  3564. "idx": 376
  3565. },
  3566. {
  3567. "path": "../packages/core/src/sparkline/CanvasCanvas.js",
  3568. "requires": [
  3569. 376
  3570. ],
  3571. "uses": [],
  3572. "idx": 377
  3573. },
  3574. {
  3575. "path": "../packages/core/src/sparkline/VmlCanvas.js",
  3576. "requires": [
  3577. 376
  3578. ],
  3579. "uses": [],
  3580. "idx": 378
  3581. },
  3582. {
  3583. "path": "../packages/core/src/util/Color.js",
  3584. "requires": [],
  3585. "uses": [],
  3586. "idx": 379
  3587. },
  3588. {
  3589. "path": "../packages/core/src/sparkline/Base.js",
  3590. "requires": [
  3591. 89,
  3592. 98,
  3593. 377,
  3594. 378,
  3595. 379
  3596. ],
  3597. "uses": [],
  3598. "idx": 380
  3599. },
  3600. {
  3601. "path": "../packages/core/src/sparkline/BarBase.js",
  3602. "requires": [
  3603. 380
  3604. ],
  3605. "uses": [],
  3606. "idx": 381
  3607. },
  3608. {
  3609. "path": "../packages/core/src/sparkline/RangeMap.js",
  3610. "requires": [],
  3611. "uses": [],
  3612. "idx": 382
  3613. },
  3614. {
  3615. "path": "../packages/core/src/sparkline/Bar.js",
  3616. "requires": [
  3617. 381,
  3618. 382
  3619. ],
  3620. "uses": [],
  3621. "idx": 383
  3622. },
  3623. {
  3624. "path": "../packages/core/src/sparkline/Box.js",
  3625. "requires": [
  3626. 380
  3627. ],
  3628. "uses": [],
  3629. "idx": 384
  3630. },
  3631. {
  3632. "path": "../packages/core/src/sparkline/Bullet.js",
  3633. "requires": [
  3634. 380
  3635. ],
  3636. "uses": [],
  3637. "idx": 385
  3638. },
  3639. {
  3640. "path": "../packages/core/src/sparkline/Discrete.js",
  3641. "requires": [
  3642. 381
  3643. ],
  3644. "uses": [],
  3645. "idx": 386
  3646. },
  3647. {
  3648. "path": "../packages/core/src/sparkline/Line.js",
  3649. "requires": [
  3650. 380,
  3651. 382
  3652. ],
  3653. "uses": [],
  3654. "idx": 387
  3655. },
  3656. {
  3657. "path": "../packages/core/src/sparkline/Pie.js",
  3658. "requires": [
  3659. 380
  3660. ],
  3661. "uses": [],
  3662. "idx": 388
  3663. },
  3664. {
  3665. "path": "../packages/core/src/sparkline/TriState.js",
  3666. "requires": [
  3667. 381,
  3668. 382
  3669. ],
  3670. "uses": [],
  3671. "idx": 389
  3672. },
  3673. {
  3674. "path": "../packages/core/src/util/Base64.js",
  3675. "requires": [],
  3676. "uses": [],
  3677. "idx": 390
  3678. },
  3679. {
  3680. "path": "../packages/core/src/util/DelimitedValue.js",
  3681. "requires": [],
  3682. "uses": [],
  3683. "idx": 391
  3684. },
  3685. {
  3686. "path": "../packages/core/src/util/CSV.js",
  3687. "requires": [
  3688. 391
  3689. ],
  3690. "uses": [],
  3691. "idx": 392
  3692. },
  3693. {
  3694. "path": "../packages/core/src/util/ClickRepeater.js",
  3695. "requires": [
  3696. 4
  3697. ],
  3698. "uses": [],
  3699. "idx": 393
  3700. },
  3701. {
  3702. "path": "../packages/core/src/util/Cookies.js",
  3703. "requires": [],
  3704. "uses": [],
  3705. "idx": 394
  3706. },
  3707. {
  3708. "path": "../packages/core/src/util/ItemCollection.js",
  3709. "requires": [
  3710. 56
  3711. ],
  3712. "uses": [],
  3713. "idx": 395
  3714. },
  3715. {
  3716. "path": "../packages/core/src/util/LocalStorage.js",
  3717. "requires": [],
  3718. "uses": [],
  3719. "idx": 396
  3720. },
  3721. {
  3722. "path": "../packages/core/src/util/Spans.js",
  3723. "requires": [],
  3724. "uses": [],
  3725. "idx": 397
  3726. },
  3727. {
  3728. "path": "../packages/core/src/util/TSV.js",
  3729. "requires": [
  3730. 391
  3731. ],
  3732. "uses": [],
  3733. "idx": 398
  3734. },
  3735. {
  3736. "path": "../packages/core/src/util/TaskManager.js",
  3737. "requires": [
  3738. 57
  3739. ],
  3740. "uses": [],
  3741. "idx": 399
  3742. },
  3743. {
  3744. "path": "../packages/core/src/util/TextMetrics.js",
  3745. "requires": [
  3746. 49
  3747. ],
  3748. "uses": [
  3749. 75
  3750. ],
  3751. "idx": 400
  3752. },
  3753. {
  3754. "path": "../packages/core/src/util/paintmonitor/OverflowChange.js",
  3755. "requires": [
  3756. 45
  3757. ],
  3758. "uses": [],
  3759. "idx": 401
  3760. },
  3761. {
  3762. "path": "../packages/core/src/util/sizemonitor/OverflowChange.js",
  3763. "requires": [
  3764. 41
  3765. ],
  3766. "uses": [
  3767. 40
  3768. ],
  3769. "idx": 402
  3770. },
  3771. {
  3772. "path": "../packages/core/src/util/translatable/CssPosition.js",
  3773. "requires": [
  3774. 108
  3775. ],
  3776. "uses": [],
  3777. "idx": 403
  3778. },
  3779. {
  3780. "path": "../packages/core/src/util/translatable/CssTransform.js",
  3781. "requires": [
  3782. 108
  3783. ],
  3784. "uses": [],
  3785. "idx": 404
  3786. },
  3787. {
  3788. "path": "../packages/core/src/util/translatable/ScrollParent.js",
  3789. "requires": [
  3790. 108
  3791. ],
  3792. "uses": [],
  3793. "idx": 405
  3794. },
  3795. {
  3796. "path": "../classic/classic/src/Action.js",
  3797. "requires": [],
  3798. "uses": [],
  3799. "idx": 406
  3800. },
  3801. {
  3802. "path": "../classic/classic/src/ElementLoader.js",
  3803. "requires": [
  3804. 52
  3805. ],
  3806. "uses": [
  3807. 17,
  3808. 18
  3809. ],
  3810. "idx": 407
  3811. },
  3812. {
  3813. "path": "../classic/classic/src/ComponentLoader.js",
  3814. "requires": [
  3815. 407
  3816. ],
  3817. "uses": [],
  3818. "idx": 408
  3819. },
  3820. {
  3821. "path": "../classic/classic/src/layout/SizeModel.js",
  3822. "requires": [],
  3823. "uses": [],
  3824. "idx": 409
  3825. },
  3826. {
  3827. "path": "../classic/classic/src/layout/Layout.js",
  3828. "requires": [
  3829. 12,
  3830. 98,
  3831. 409
  3832. ],
  3833. "uses": [
  3834. 635
  3835. ],
  3836. "idx": 410
  3837. },
  3838. {
  3839. "path": "../classic/classic/src/layout/container/Container.js",
  3840. "requires": [
  3841. 98,
  3842. 112,
  3843. 410
  3844. ],
  3845. "uses": [
  3846. 250
  3847. ],
  3848. "idx": 411
  3849. },
  3850. {
  3851. "path": "../classic/classic/src/layout/container/Auto.js",
  3852. "requires": [
  3853. 411
  3854. ],
  3855. "uses": [
  3856. 98
  3857. ],
  3858. "idx": 412
  3859. },
  3860. {
  3861. "path": "../classic/classic/src/ZIndexManager.js",
  3862. "requires": [
  3863. 77,
  3864. 176,
  3865. 177
  3866. ],
  3867. "uses": [
  3868. 49,
  3869. 132
  3870. ],
  3871. "idx": 413
  3872. },
  3873. {
  3874. "path": "../classic/classic/src/container/Container.js",
  3875. "requires": [
  3876. 56,
  3877. 117,
  3878. 238,
  3879. 361,
  3880. 364,
  3881. 395,
  3882. 406,
  3883. 412,
  3884. 413
  3885. ],
  3886. "uses": [
  3887. 12,
  3888. 21,
  3889. 24,
  3890. 49
  3891. ],
  3892. "idx": 414
  3893. },
  3894. {
  3895. "path": "../classic/classic/src/layout/container/Editor.js",
  3896. "requires": [
  3897. 411
  3898. ],
  3899. "uses": [],
  3900. "idx": 415
  3901. },
  3902. {
  3903. "path": "../classic/classic/src/Editor.js",
  3904. "requires": [
  3905. 414,
  3906. 415
  3907. ],
  3908. "uses": [
  3909. 1,
  3910. 21
  3911. ],
  3912. "idx": 416
  3913. },
  3914. {
  3915. "path": "../classic/classic/src/EventManager.js",
  3916. "requires": [],
  3917. "uses": [
  3918. 77
  3919. ],
  3920. "idx": 417
  3921. },
  3922. {
  3923. "path": "../classic/classic/src/Gadget.js",
  3924. "requires": [],
  3925. "uses": [],
  3926. "idx": 418
  3927. },
  3928. {
  3929. "path": "../classic/classic/src/Img.js",
  3930. "requires": [
  3931. 78,
  3932. 117
  3933. ],
  3934. "uses": [],
  3935. "idx": 419
  3936. },
  3937. {
  3938. "path": "../classic/classic/src/util/StoreHolder.js",
  3939. "requires": [
  3940. 182
  3941. ],
  3942. "uses": [],
  3943. "idx": 420
  3944. },
  3945. {
  3946. "path": "../classic/classic/src/LoadMask.js",
  3947. "requires": [
  3948. 117,
  3949. 420
  3950. ],
  3951. "uses": [
  3952. 49,
  3953. 77,
  3954. 182
  3955. ],
  3956. "idx": 421
  3957. },
  3958. {
  3959. "path": "../classic/classic/src/layout/component/Component.js",
  3960. "requires": [
  3961. 410
  3962. ],
  3963. "uses": [],
  3964. "idx": 422
  3965. },
  3966. {
  3967. "path": "../classic/classic/src/layout/component/Auto.js",
  3968. "requires": [
  3969. 422
  3970. ],
  3971. "uses": [],
  3972. "idx": 423
  3973. },
  3974. {
  3975. "path": "../classic/classic/src/layout/component/ProgressBar.js",
  3976. "requires": [
  3977. 423
  3978. ],
  3979. "uses": [],
  3980. "idx": 424
  3981. },
  3982. {
  3983. "path": "../classic/classic/src/ProgressBar.js",
  3984. "requires": [
  3985. 92,
  3986. 95,
  3987. 102,
  3988. 117,
  3989. 399,
  3990. 424
  3991. ],
  3992. "uses": [
  3993. 73
  3994. ],
  3995. "idx": 425
  3996. },
  3997. {
  3998. "path": "../classic/classic/src/dom/ButtonElement.js",
  3999. "requires": [
  4000. 49
  4001. ],
  4002. "uses": [],
  4003. "idx": 426
  4004. },
  4005. {
  4006. "path": "../classic/classic/src/button/Manager.js",
  4007. "requires": [],
  4008. "uses": [],
  4009. "idx": 427
  4010. },
  4011. {
  4012. "path": "../classic/classic/src/menu/Manager.js",
  4013. "requires": [],
  4014. "uses": [
  4015. 21,
  4016. 110,
  4017. 117,
  4018. 599
  4019. ],
  4020. "idx": 428
  4021. },
  4022. {
  4023. "path": "../classic/classic/src/button/Button.js",
  4024. "requires": [
  4025. 78,
  4026. 117,
  4027. 238,
  4028. 393,
  4029. 400,
  4030. 426,
  4031. 427,
  4032. 428
  4033. ],
  4034. "uses": [
  4035. 49,
  4036. 543
  4037. ],
  4038. "idx": 429
  4039. },
  4040. {
  4041. "path": "../classic/classic/src/button/Split.js",
  4042. "requires": [
  4043. 429
  4044. ],
  4045. "uses": [
  4046. 49,
  4047. 427
  4048. ],
  4049. "idx": 430
  4050. },
  4051. {
  4052. "path": "../classic/classic/src/button/Cycle.js",
  4053. "requires": [
  4054. 430
  4055. ],
  4056. "uses": [],
  4057. "idx": 431
  4058. },
  4059. {
  4060. "path": "../classic/classic/src/layout/container/SegmentedButton.js",
  4061. "requires": [
  4062. 411
  4063. ],
  4064. "uses": [],
  4065. "idx": 432
  4066. },
  4067. {
  4068. "path": "../classic/classic/src/button/Segmented.js",
  4069. "requires": [
  4070. 414,
  4071. 429,
  4072. 432
  4073. ],
  4074. "uses": [],
  4075. "idx": 433
  4076. },
  4077. {
  4078. "path": "../classic/classic/src/panel/Bar.js",
  4079. "requires": [
  4080. 414
  4081. ],
  4082. "uses": [],
  4083. "idx": 434
  4084. },
  4085. {
  4086. "path": "../classic/classic/src/panel/Title.js",
  4087. "requires": [
  4088. 78,
  4089. 117
  4090. ],
  4091. "uses": [],
  4092. "idx": 435
  4093. },
  4094. {
  4095. "path": "../classic/classic/src/panel/Tool.js",
  4096. "requires": [
  4097. 78,
  4098. 117
  4099. ],
  4100. "uses": [
  4101. 543
  4102. ],
  4103. "idx": 436
  4104. },
  4105. {
  4106. "path": "../classic/classic/src/panel/Header.js",
  4107. "requires": [
  4108. 423,
  4109. 434,
  4110. 435,
  4111. 436
  4112. ],
  4113. "uses": [
  4114. 21
  4115. ],
  4116. "idx": 437
  4117. },
  4118. {
  4119. "path": "../classic/classic/src/layout/container/boxOverflow/None.js",
  4120. "requires": [
  4121. 12
  4122. ],
  4123. "uses": [],
  4124. "idx": 438
  4125. },
  4126. {
  4127. "path": "../classic/classic/src/layout/container/boxOverflow/Scroller.js",
  4128. "requires": [
  4129. 4,
  4130. 49,
  4131. 393,
  4132. 438
  4133. ],
  4134. "uses": [
  4135. 117
  4136. ],
  4137. "idx": 439
  4138. },
  4139. {
  4140. "path": "../classic/classic/src/dd/DragDropManager.js",
  4141. "requires": [
  4142. 34,
  4143. 35
  4144. ],
  4145. "uses": [
  4146. 49,
  4147. 471,
  4148. 543
  4149. ],
  4150. "idx": 440
  4151. },
  4152. {
  4153. "path": "../classic/classic/src/resizer/Splitter.js",
  4154. "requires": [
  4155. 98,
  4156. 117
  4157. ],
  4158. "uses": [
  4159. 467
  4160. ],
  4161. "idx": 441
  4162. },
  4163. {
  4164. "path": "../classic/classic/src/layout/container/Box.js",
  4165. "requires": [
  4166. 94,
  4167. 411,
  4168. 438,
  4169. 439,
  4170. 440,
  4171. 441
  4172. ],
  4173. "uses": [
  4174. 12,
  4175. 409,
  4176. 423
  4177. ],
  4178. "idx": 442
  4179. },
  4180. {
  4181. "path": "../classic/classic/src/layout/container/HBox.js",
  4182. "requires": [
  4183. 442
  4184. ],
  4185. "uses": [],
  4186. "idx": 443
  4187. },
  4188. {
  4189. "path": "../classic/classic/src/layout/container/VBox.js",
  4190. "requires": [
  4191. 442
  4192. ],
  4193. "uses": [],
  4194. "idx": 444
  4195. },
  4196. {
  4197. "path": "../classic/classic/src/toolbar/Toolbar.js",
  4198. "requires": [
  4199. 414,
  4200. 423,
  4201. 443,
  4202. 444
  4203. ],
  4204. "uses": [
  4205. 117,
  4206. 374,
  4207. 525,
  4208. 546,
  4209. 671,
  4210. 672
  4211. ],
  4212. "idx": 445
  4213. },
  4214. {
  4215. "path": "../classic/classic/src/dd/DragDrop.js",
  4216. "requires": [
  4217. 440
  4218. ],
  4219. "uses": [
  4220. 49
  4221. ],
  4222. "idx": 446
  4223. },
  4224. {
  4225. "path": "../classic/classic/src/dd/DD.js",
  4226. "requires": [
  4227. 440,
  4228. 446
  4229. ],
  4230. "uses": [
  4231. 49
  4232. ],
  4233. "idx": 447
  4234. },
  4235. {
  4236. "path": "../classic/classic/src/dd/DDProxy.js",
  4237. "requires": [
  4238. 447
  4239. ],
  4240. "uses": [
  4241. 440
  4242. ],
  4243. "idx": 448
  4244. },
  4245. {
  4246. "path": "../classic/classic/src/dd/StatusProxy.js",
  4247. "requires": [
  4248. 117
  4249. ],
  4250. "uses": [],
  4251. "idx": 449
  4252. },
  4253. {
  4254. "path": "../classic/classic/src/dd/DragSource.js",
  4255. "requires": [
  4256. 440,
  4257. 448,
  4258. 449
  4259. ],
  4260. "uses": [
  4261. 423
  4262. ],
  4263. "idx": 450
  4264. },
  4265. {
  4266. "path": "../classic/classic/src/panel/Proxy.js",
  4267. "requires": [],
  4268. "uses": [
  4269. 49
  4270. ],
  4271. "idx": 451
  4272. },
  4273. {
  4274. "path": "../classic/classic/src/panel/DD.js",
  4275. "requires": [
  4276. 450,
  4277. 451
  4278. ],
  4279. "uses": [],
  4280. "idx": 452
  4281. },
  4282. {
  4283. "path": "../classic/classic/src/layout/component/Dock.js",
  4284. "requires": [
  4285. 422
  4286. ],
  4287. "uses": [
  4288. 24,
  4289. 49,
  4290. 409
  4291. ],
  4292. "idx": 453
  4293. },
  4294. {
  4295. "path": "../classic/classic/src/util/Memento.js",
  4296. "requires": [],
  4297. "uses": [],
  4298. "idx": 454
  4299. },
  4300. {
  4301. "path": "../classic/classic/src/container/DockingContainer.js",
  4302. "requires": [
  4303. 49,
  4304. 56
  4305. ],
  4306. "uses": [
  4307. 24,
  4308. 250,
  4309. 395
  4310. ],
  4311. "idx": 455
  4312. },
  4313. {
  4314. "path": "../classic/classic/src/panel/Panel.js",
  4315. "requires": [
  4316. 49,
  4317. 56,
  4318. 73,
  4319. 98,
  4320. 414,
  4321. 437,
  4322. 445,
  4323. 452,
  4324. 453,
  4325. 454,
  4326. 455
  4327. ],
  4328. "uses": [
  4329. 1,
  4330. 21,
  4331. 34,
  4332. 94,
  4333. 101,
  4334. 102,
  4335. 117,
  4336. 250,
  4337. 363,
  4338. 412,
  4339. 423,
  4340. 436,
  4341. 488
  4342. ],
  4343. "idx": 456
  4344. },
  4345. {
  4346. "path": "../classic/classic/src/layout/container/Table.js",
  4347. "requires": [
  4348. 411
  4349. ],
  4350. "uses": [],
  4351. "idx": 457
  4352. },
  4353. {
  4354. "path": "../classic/classic/src/container/ButtonGroup.js",
  4355. "requires": [
  4356. 456,
  4357. 457
  4358. ],
  4359. "uses": [],
  4360. "idx": 458
  4361. },
  4362. {
  4363. "path": "../classic/classic/src/container/Monitor.js",
  4364. "requires": [],
  4365. "uses": [
  4366. 24,
  4367. 56
  4368. ],
  4369. "idx": 459
  4370. },
  4371. {
  4372. "path": "../classic/classic/src/plugin/Viewport.js",
  4373. "requires": [
  4374. 84,
  4375. 118
  4376. ],
  4377. "uses": [
  4378. 49,
  4379. 90,
  4380. 409
  4381. ],
  4382. "idx": 460
  4383. },
  4384. {
  4385. "path": "../classic/classic/src/container/Viewport.js",
  4386. "requires": [
  4387. 118,
  4388. 414,
  4389. 460
  4390. ],
  4391. "uses": [],
  4392. "idx": 461
  4393. },
  4394. {
  4395. "path": "../classic/classic/src/layout/container/Anchor.js",
  4396. "requires": [
  4397. 412
  4398. ],
  4399. "uses": [],
  4400. "idx": 462
  4401. },
  4402. {
  4403. "path": "../classic/classic/src/dashboard/Panel.js",
  4404. "requires": [
  4405. 456
  4406. ],
  4407. "uses": [
  4408. 21
  4409. ],
  4410. "idx": 463
  4411. },
  4412. {
  4413. "path": "../classic/classic/src/dashboard/Column.js",
  4414. "requires": [
  4415. 414,
  4416. 462,
  4417. 463
  4418. ],
  4419. "uses": [],
  4420. "idx": 464
  4421. },
  4422. {
  4423. "path": "../classic/classic/src/layout/container/Column.js",
  4424. "requires": [
  4425. 412
  4426. ],
  4427. "uses": [],
  4428. "idx": 465
  4429. },
  4430. {
  4431. "path": "../classic/classic/src/dd/DragTracker.js",
  4432. "requires": [
  4433. 52
  4434. ],
  4435. "uses": [
  4436. 34,
  4437. 117,
  4438. 363
  4439. ],
  4440. "idx": 466
  4441. },
  4442. {
  4443. "path": "../classic/classic/src/resizer/SplitterTracker.js",
  4444. "requires": [
  4445. 34,
  4446. 466
  4447. ],
  4448. "uses": [
  4449. 49,
  4450. 106
  4451. ],
  4452. "idx": 467
  4453. },
  4454. {
  4455. "path": "../classic/classic/src/layout/container/ColumnSplitterTracker.js",
  4456. "requires": [
  4457. 467
  4458. ],
  4459. "uses": [],
  4460. "idx": 468
  4461. },
  4462. {
  4463. "path": "../classic/classic/src/layout/container/ColumnSplitter.js",
  4464. "requires": [
  4465. 441,
  4466. 468
  4467. ],
  4468. "uses": [],
  4469. "idx": 469
  4470. },
  4471. {
  4472. "path": "../classic/classic/src/layout/container/Dashboard.js",
  4473. "requires": [
  4474. 465,
  4475. 469
  4476. ],
  4477. "uses": [
  4478. 423
  4479. ],
  4480. "idx": 470
  4481. },
  4482. {
  4483. "path": "../classic/classic/src/dd/DDTarget.js",
  4484. "requires": [
  4485. 446
  4486. ],
  4487. "uses": [],
  4488. "idx": 471
  4489. },
  4490. {
  4491. "path": "../classic/classic/src/dd/ScrollManager.js",
  4492. "requires": [
  4493. 440
  4494. ],
  4495. "uses": [],
  4496. "idx": 472
  4497. },
  4498. {
  4499. "path": "../classic/classic/src/dd/DropTarget.js",
  4500. "requires": [
  4501. 471,
  4502. 472
  4503. ],
  4504. "uses": [],
  4505. "idx": 473
  4506. },
  4507. {
  4508. "path": "../classic/classic/src/dashboard/DropZone.js",
  4509. "requires": [
  4510. 473
  4511. ],
  4512. "uses": [],
  4513. "idx": 474
  4514. },
  4515. {
  4516. "path": "../classic/classic/src/dashboard/Part.js",
  4517. "requires": [
  4518. 3,
  4519. 12,
  4520. 134
  4521. ],
  4522. "uses": [],
  4523. "idx": 475
  4524. },
  4525. {
  4526. "path": "../classic/classic/src/dashboard/Dashboard.js",
  4527. "requires": [
  4528. 456,
  4529. 464,
  4530. 470,
  4531. 474,
  4532. 475
  4533. ],
  4534. "uses": [
  4535. 12,
  4536. 115,
  4537. 132
  4538. ],
  4539. "idx": 476
  4540. },
  4541. {
  4542. "path": "../classic/classic/src/dd/DragZone.js",
  4543. "requires": [
  4544. 450
  4545. ],
  4546. "uses": [
  4547. 472,
  4548. 478
  4549. ],
  4550. "idx": 477
  4551. },
  4552. {
  4553. "path": "../classic/classic/src/dd/Registry.js",
  4554. "requires": [],
  4555. "uses": [],
  4556. "idx": 478
  4557. },
  4558. {
  4559. "path": "../classic/classic/src/dd/DropZone.js",
  4560. "requires": [
  4561. 473,
  4562. 478
  4563. ],
  4564. "uses": [
  4565. 440
  4566. ],
  4567. "idx": 479
  4568. },
  4569. {
  4570. "path": "../classic/classic/src/dom/Layer.js",
  4571. "requires": [
  4572. 49
  4573. ],
  4574. "uses": [
  4575. 250
  4576. ],
  4577. "idx": 480
  4578. },
  4579. {
  4580. "path": "../classic/classic/src/enums.js",
  4581. "requires": [],
  4582. "uses": [],
  4583. "idx": 481
  4584. },
  4585. {
  4586. "path": "../classic/classic/src/event/publisher/MouseEnterLeave.js",
  4587. "requires": [
  4588. 37
  4589. ],
  4590. "uses": [],
  4591. "idx": 482
  4592. },
  4593. {
  4594. "path": "../classic/classic/src/flash/Component.js",
  4595. "requires": [
  4596. 117
  4597. ],
  4598. "uses": [],
  4599. "idx": 483
  4600. },
  4601. {
  4602. "path": "../classic/classic/src/form/action/Action.js",
  4603. "requires": [],
  4604. "uses": [],
  4605. "idx": 484
  4606. },
  4607. {
  4608. "path": "../classic/classic/src/form/action/Load.js",
  4609. "requires": [
  4610. 17,
  4611. 484
  4612. ],
  4613. "uses": [
  4614. 18
  4615. ],
  4616. "idx": 485
  4617. },
  4618. {
  4619. "path": "../classic/classic/src/form/action/Submit.js",
  4620. "requires": [
  4621. 484
  4622. ],
  4623. "uses": [
  4624. 18,
  4625. 250
  4626. ],
  4627. "idx": 486
  4628. },
  4629. {
  4630. "path": "../classic/classic/src/form/action/StandardSubmit.js",
  4631. "requires": [
  4632. 486
  4633. ],
  4634. "uses": [],
  4635. "idx": 487
  4636. },
  4637. {
  4638. "path": "../classic/classic/src/util/ComponentDragger.js",
  4639. "requires": [
  4640. 466
  4641. ],
  4642. "uses": [
  4643. 34,
  4644. 49
  4645. ],
  4646. "idx": 488
  4647. },
  4648. {
  4649. "path": "../classic/classic/src/window/Window.js",
  4650. "requires": [
  4651. 34,
  4652. 456,
  4653. 488
  4654. ],
  4655. "uses": [],
  4656. "idx": 489
  4657. },
  4658. {
  4659. "path": "../classic/classic/src/form/Labelable.js",
  4660. "requires": [
  4661. 0,
  4662. 98
  4663. ],
  4664. "uses": [
  4665. 49,
  4666. 542
  4667. ],
  4668. "idx": 490
  4669. },
  4670. {
  4671. "path": "../classic/classic/src/form/field/Field.js",
  4672. "requires": [],
  4673. "uses": [],
  4674. "idx": 491
  4675. },
  4676. {
  4677. "path": "../classic/classic/src/form/field/Base.js",
  4678. "requires": [
  4679. 1,
  4680. 98,
  4681. 117,
  4682. 490,
  4683. 491
  4684. ],
  4685. "uses": [
  4686. 95,
  4687. 250
  4688. ],
  4689. "idx": 492
  4690. },
  4691. {
  4692. "path": "../classic/classic/src/layout/component/field/Text.js",
  4693. "requires": [
  4694. 423
  4695. ],
  4696. "uses": [],
  4697. "idx": 493
  4698. },
  4699. {
  4700. "path": "../classic/classic/src/form/field/VTypes.js",
  4701. "requires": [],
  4702. "uses": [],
  4703. "idx": 494
  4704. },
  4705. {
  4706. "path": "../classic/classic/src/form/trigger/Trigger.js",
  4707. "requires": [
  4708. 12,
  4709. 393
  4710. ],
  4711. "uses": [
  4712. 49,
  4713. 98
  4714. ],
  4715. "idx": 495
  4716. },
  4717. {
  4718. "path": "../classic/classic/src/form/field/Text.js",
  4719. "requires": [
  4720. 400,
  4721. 409,
  4722. 492,
  4723. 493,
  4724. 494,
  4725. 495
  4726. ],
  4727. "uses": [
  4728. 94,
  4729. 95,
  4730. 102
  4731. ],
  4732. "idx": 496
  4733. },
  4734. {
  4735. "path": "../classic/classic/src/form/field/TextArea.js",
  4736. "requires": [
  4737. 1,
  4738. 98,
  4739. 496
  4740. ],
  4741. "uses": [
  4742. 94,
  4743. 400
  4744. ],
  4745. "idx": 497
  4746. },
  4747. {
  4748. "path": "../classic/classic/src/window/MessageBox.js",
  4749. "requires": [
  4750. 425,
  4751. 429,
  4752. 443,
  4753. 445,
  4754. 462,
  4755. 489,
  4756. 496,
  4757. 497
  4758. ],
  4759. "uses": [
  4760. 117,
  4761. 414,
  4762. 423,
  4763. 424
  4764. ],
  4765. "idx": 498
  4766. },
  4767. {
  4768. "path": "../classic/classic/src/form/Basic.js",
  4769. "requires": [
  4770. 1,
  4771. 52,
  4772. 56,
  4773. 145,
  4774. 485,
  4775. 486,
  4776. 487,
  4777. 498
  4778. ],
  4779. "uses": [
  4780. 459
  4781. ],
  4782. "idx": 499
  4783. },
  4784. {
  4785. "path": "../classic/classic/src/layout/component/field/FieldContainer.js",
  4786. "requires": [
  4787. 423
  4788. ],
  4789. "uses": [],
  4790. "idx": 500
  4791. },
  4792. {
  4793. "path": "../classic/classic/src/form/FieldAncestor.js",
  4794. "requires": [
  4795. 0,
  4796. 459
  4797. ],
  4798. "uses": [],
  4799. "idx": 501
  4800. },
  4801. {
  4802. "path": "../classic/classic/src/form/FieldContainer.js",
  4803. "requires": [
  4804. 414,
  4805. 490,
  4806. 500,
  4807. 501
  4808. ],
  4809. "uses": [],
  4810. "idx": 502
  4811. },
  4812. {
  4813. "path": "../classic/classic/src/layout/container/CheckboxGroup.js",
  4814. "requires": [
  4815. 411
  4816. ],
  4817. "uses": [
  4818. 250
  4819. ],
  4820. "idx": 503
  4821. },
  4822. {
  4823. "path": "../classic/classic/src/form/CheckboxManager.js",
  4824. "requires": [
  4825. 56
  4826. ],
  4827. "uses": [],
  4828. "idx": 504
  4829. },
  4830. {
  4831. "path": "../classic/classic/src/form/field/Checkbox.js",
  4832. "requires": [
  4833. 98,
  4834. 492,
  4835. 504
  4836. ],
  4837. "uses": [],
  4838. "idx": 505
  4839. },
  4840. {
  4841. "path": "../classic/classic/src/form/CheckboxGroup.js",
  4842. "requires": [
  4843. 491,
  4844. 492,
  4845. 502,
  4846. 503,
  4847. 505
  4848. ],
  4849. "uses": [],
  4850. "idx": 506
  4851. },
  4852. {
  4853. "path": "../classic/classic/src/form/FieldSet.js",
  4854. "requires": [
  4855. 414,
  4856. 501
  4857. ],
  4858. "uses": [
  4859. 49,
  4860. 101,
  4861. 117,
  4862. 250,
  4863. 423,
  4864. 436,
  4865. 462,
  4866. 505,
  4867. 638
  4868. ],
  4869. "idx": 507
  4870. },
  4871. {
  4872. "path": "../classic/classic/src/form/Label.js",
  4873. "requires": [
  4874. 94,
  4875. 117
  4876. ],
  4877. "uses": [],
  4878. "idx": 508
  4879. },
  4880. {
  4881. "path": "../classic/classic/src/form/Panel.js",
  4882. "requires": [
  4883. 57,
  4884. 456,
  4885. 499,
  4886. 501
  4887. ],
  4888. "uses": [
  4889. 399
  4890. ],
  4891. "idx": 509
  4892. },
  4893. {
  4894. "path": "../classic/classic/src/form/RadioManager.js",
  4895. "requires": [
  4896. 56
  4897. ],
  4898. "uses": [],
  4899. "idx": 510
  4900. },
  4901. {
  4902. "path": "../classic/classic/src/form/field/Radio.js",
  4903. "requires": [
  4904. 505,
  4905. 510
  4906. ],
  4907. "uses": [],
  4908. "idx": 511
  4909. },
  4910. {
  4911. "path": "../classic/classic/src/form/RadioGroup.js",
  4912. "requires": [
  4913. 506,
  4914. 511
  4915. ],
  4916. "uses": [
  4917. 510
  4918. ],
  4919. "idx": 512
  4920. },
  4921. {
  4922. "path": "../classic/classic/src/form/action/DirectAction.js",
  4923. "requires": [
  4924. 0
  4925. ],
  4926. "uses": [
  4927. 224
  4928. ],
  4929. "idx": 513
  4930. },
  4931. {
  4932. "path": "../classic/classic/src/form/action/DirectLoad.js",
  4933. "requires": [
  4934. 224,
  4935. 485,
  4936. 513
  4937. ],
  4938. "uses": [],
  4939. "idx": 514
  4940. },
  4941. {
  4942. "path": "../classic/classic/src/form/action/DirectSubmit.js",
  4943. "requires": [
  4944. 224,
  4945. 486,
  4946. 513
  4947. ],
  4948. "uses": [],
  4949. "idx": 515
  4950. },
  4951. {
  4952. "path": "../classic/classic/src/form/field/Picker.js",
  4953. "requires": [
  4954. 363,
  4955. 496
  4956. ],
  4957. "uses": [],
  4958. "idx": 516
  4959. },
  4960. {
  4961. "path": "../classic/classic/src/selection/Model.js",
  4962. "requires": [
  4963. 4,
  4964. 12,
  4965. 189,
  4966. 420
  4967. ],
  4968. "uses": [],
  4969. "idx": 517
  4970. },
  4971. {
  4972. "path": "../classic/classic/src/selection/DataViewModel.js",
  4973. "requires": [
  4974. 363,
  4975. 517
  4976. ],
  4977. "uses": [],
  4978. "idx": 518
  4979. },
  4980. {
  4981. "path": "../classic/classic/src/view/NavigationModel.js",
  4982. "requires": [
  4983. 12,
  4984. 52,
  4985. 420
  4986. ],
  4987. "uses": [
  4988. 363
  4989. ],
  4990. "idx": 519
  4991. },
  4992. {
  4993. "path": "../classic/classic/src/view/AbstractView.js",
  4994. "requires": [
  4995. 75,
  4996. 76,
  4997. 104,
  4998. 117,
  4999. 420,
  5000. 421,
  5001. 518,
  5002. 519
  5003. ],
  5004. "uses": [
  5005. 1,
  5006. 12,
  5007. 49,
  5008. 95,
  5009. 98,
  5010. 182,
  5011. 250
  5012. ],
  5013. "idx": 520
  5014. },
  5015. {
  5016. "path": "../classic/classic/src/view/View.js",
  5017. "requires": [
  5018. 520
  5019. ],
  5020. "uses": [],
  5021. "idx": 521
  5022. },
  5023. {
  5024. "path": "../classic/classic/src/view/BoundListKeyNav.js",
  5025. "requires": [
  5026. 519
  5027. ],
  5028. "uses": [
  5029. 36,
  5030. 363
  5031. ],
  5032. "idx": 522
  5033. },
  5034. {
  5035. "path": "../classic/classic/src/layout/component/BoundList.js",
  5036. "requires": [
  5037. 423
  5038. ],
  5039. "uses": [],
  5040. "idx": 523
  5041. },
  5042. {
  5043. "path": "../classic/classic/src/toolbar/Item.js",
  5044. "requires": [
  5045. 117,
  5046. 445
  5047. ],
  5048. "uses": [],
  5049. "idx": 524
  5050. },
  5051. {
  5052. "path": "../classic/classic/src/toolbar/TextItem.js",
  5053. "requires": [
  5054. 98,
  5055. 445,
  5056. 524
  5057. ],
  5058. "uses": [],
  5059. "idx": 525
  5060. },
  5061. {
  5062. "path": "../classic/classic/src/form/trigger/Spinner.js",
  5063. "requires": [
  5064. 495
  5065. ],
  5066. "uses": [],
  5067. "idx": 526
  5068. },
  5069. {
  5070. "path": "../classic/classic/src/form/field/Spinner.js",
  5071. "requires": [
  5072. 363,
  5073. 496,
  5074. 526
  5075. ],
  5076. "uses": [],
  5077. "idx": 527
  5078. },
  5079. {
  5080. "path": "../classic/classic/src/form/field/Number.js",
  5081. "requires": [
  5082. 527
  5083. ],
  5084. "uses": [
  5085. 94,
  5086. 95
  5087. ],
  5088. "idx": 528
  5089. },
  5090. {
  5091. "path": "../classic/classic/src/toolbar/Paging.js",
  5092. "requires": [
  5093. 420,
  5094. 445,
  5095. 525,
  5096. 528
  5097. ],
  5098. "uses": [
  5099. 95,
  5100. 423,
  5101. 493,
  5102. 526
  5103. ],
  5104. "idx": 529
  5105. },
  5106. {
  5107. "path": "../classic/classic/src/view/BoundList.js",
  5108. "requires": [
  5109. 49,
  5110. 238,
  5111. 521,
  5112. 522,
  5113. 523,
  5114. 529
  5115. ],
  5116. "uses": [
  5117. 98,
  5118. 423
  5119. ],
  5120. "idx": 530
  5121. },
  5122. {
  5123. "path": "../classic/classic/src/form/field/ComboBox.js",
  5124. "requires": [
  5125. 1,
  5126. 182,
  5127. 420,
  5128. 516,
  5129. 530
  5130. ],
  5131. "uses": [
  5132. 49,
  5133. 51,
  5134. 98,
  5135. 132,
  5136. 161,
  5137. 177,
  5138. 250,
  5139. 363,
  5140. 518,
  5141. 522,
  5142. 523
  5143. ],
  5144. "idx": 531
  5145. },
  5146. {
  5147. "path": "../classic/classic/src/picker/Month.js",
  5148. "requires": [
  5149. 98,
  5150. 117,
  5151. 393,
  5152. 429
  5153. ],
  5154. "uses": [
  5155. 423
  5156. ],
  5157. "idx": 532
  5158. },
  5159. {
  5160. "path": "../classic/classic/src/picker/Date.js",
  5161. "requires": [
  5162. 67,
  5163. 98,
  5164. 117,
  5165. 363,
  5166. 393,
  5167. 429,
  5168. 430,
  5169. 532
  5170. ],
  5171. "uses": [
  5172. 95,
  5173. 250,
  5174. 423
  5175. ],
  5176. "idx": 533
  5177. },
  5178. {
  5179. "path": "../classic/classic/src/form/field/Date.js",
  5180. "requires": [
  5181. 516,
  5182. 533
  5183. ],
  5184. "uses": [
  5185. 95,
  5186. 423
  5187. ],
  5188. "idx": 534
  5189. },
  5190. {
  5191. "path": "../classic/classic/src/form/field/Display.js",
  5192. "requires": [
  5193. 94,
  5194. 98,
  5195. 492
  5196. ],
  5197. "uses": [],
  5198. "idx": 535
  5199. },
  5200. {
  5201. "path": "../classic/classic/src/form/field/FileButton.js",
  5202. "requires": [
  5203. 429
  5204. ],
  5205. "uses": [],
  5206. "idx": 536
  5207. },
  5208. {
  5209. "path": "../classic/classic/src/form/trigger/Component.js",
  5210. "requires": [
  5211. 495
  5212. ],
  5213. "uses": [],
  5214. "idx": 537
  5215. },
  5216. {
  5217. "path": "../classic/classic/src/form/field/File.js",
  5218. "requires": [
  5219. 496,
  5220. 536,
  5221. 537
  5222. ],
  5223. "uses": [
  5224. 423
  5225. ],
  5226. "idx": 538
  5227. },
  5228. {
  5229. "path": "../classic/classic/src/form/field/Hidden.js",
  5230. "requires": [
  5231. 492
  5232. ],
  5233. "uses": [],
  5234. "idx": 539
  5235. },
  5236. {
  5237. "path": "../classic/classic/src/tip/Tip.js",
  5238. "requires": [
  5239. 456
  5240. ],
  5241. "uses": [
  5242. 35,
  5243. 117
  5244. ],
  5245. "idx": 540
  5246. },
  5247. {
  5248. "path": "../classic/classic/src/tip/ToolTip.js",
  5249. "requires": [
  5250. 33,
  5251. 540
  5252. ],
  5253. "uses": [
  5254. 35,
  5255. 75
  5256. ],
  5257. "idx": 541
  5258. },
  5259. {
  5260. "path": "../classic/classic/src/tip/QuickTip.js",
  5261. "requires": [
  5262. 541
  5263. ],
  5264. "uses": [],
  5265. "idx": 542
  5266. },
  5267. {
  5268. "path": "../classic/classic/src/tip/QuickTipManager.js",
  5269. "requires": [
  5270. 542
  5271. ],
  5272. "uses": [],
  5273. "idx": 543
  5274. },
  5275. {
  5276. "path": "../classic/classic/src/picker/Color.js",
  5277. "requires": [
  5278. 98,
  5279. 117
  5280. ],
  5281. "uses": [],
  5282. "idx": 544
  5283. },
  5284. {
  5285. "path": "../classic/classic/src/layout/component/field/HtmlEditor.js",
  5286. "requires": [
  5287. 500
  5288. ],
  5289. "uses": [],
  5290. "idx": 545
  5291. },
  5292. {
  5293. "path": "../classic/classic/src/toolbar/Separator.js",
  5294. "requires": [
  5295. 445,
  5296. 524
  5297. ],
  5298. "uses": [],
  5299. "idx": 546
  5300. },
  5301. {
  5302. "path": "../classic/classic/src/layout/container/boxOverflow/Menu.js",
  5303. "requires": [
  5304. 429,
  5305. 438,
  5306. 546
  5307. ],
  5308. "uses": [
  5309. 423,
  5310. 439,
  5311. 444,
  5312. 453,
  5313. 505,
  5314. 597,
  5315. 599,
  5316. 671
  5317. ],
  5318. "idx": 547
  5319. },
  5320. {
  5321. "path": "../classic/classic/src/form/field/HtmlEditor.js",
  5322. "requires": [
  5323. 94,
  5324. 399,
  5325. 444,
  5326. 445,
  5327. 491,
  5328. 502,
  5329. 524,
  5330. 543,
  5331. 544,
  5332. 545,
  5333. 547
  5334. ],
  5335. "uses": [
  5336. 1,
  5337. 95,
  5338. 117,
  5339. 250,
  5340. 423,
  5341. 439,
  5342. 453,
  5343. 599
  5344. ],
  5345. "idx": 548
  5346. },
  5347. {
  5348. "path": "../classic/classic/src/view/TagKeyNav.js",
  5349. "requires": [
  5350. 522
  5351. ],
  5352. "uses": [],
  5353. "idx": 549
  5354. },
  5355. {
  5356. "path": "../classic/classic/src/form/field/Tag.js",
  5357. "requires": [
  5358. 179,
  5359. 221,
  5360. 517,
  5361. 531,
  5362. 549
  5363. ],
  5364. "uses": [
  5365. 51,
  5366. 95,
  5367. 98,
  5368. 167,
  5369. 174,
  5370. 175
  5371. ],
  5372. "idx": 550
  5373. },
  5374. {
  5375. "path": "../classic/classic/src/picker/Time.js",
  5376. "requires": [
  5377. 179,
  5378. 530
  5379. ],
  5380. "uses": [
  5381. 51
  5382. ],
  5383. "idx": 551
  5384. },
  5385. {
  5386. "path": "../classic/classic/src/form/field/Time.js",
  5387. "requires": [
  5388. 522,
  5389. 531,
  5390. 534,
  5391. 551
  5392. ],
  5393. "uses": [
  5394. 95,
  5395. 98,
  5396. 518,
  5397. 523
  5398. ],
  5399. "idx": 552
  5400. },
  5401. {
  5402. "path": "../classic/classic/src/form/field/Trigger.js",
  5403. "requires": [
  5404. 250,
  5405. 393,
  5406. 496
  5407. ],
  5408. "uses": [],
  5409. "idx": 553
  5410. },
  5411. {
  5412. "path": "../classic/classic/src/grid/CellContext.js",
  5413. "requires": [],
  5414. "uses": [],
  5415. "idx": 554
  5416. },
  5417. {
  5418. "path": "../classic/classic/src/grid/CellEditor.js",
  5419. "requires": [
  5420. 416
  5421. ],
  5422. "uses": [
  5423. 49,
  5424. 414
  5425. ],
  5426. "idx": 555
  5427. },
  5428. {
  5429. "path": "../classic/classic/src/grid/ColumnComponentLayout.js",
  5430. "requires": [
  5431. 423
  5432. ],
  5433. "uses": [],
  5434. "idx": 556
  5435. },
  5436. {
  5437. "path": "../classic/classic/src/layout/container/Fit.js",
  5438. "requires": [
  5439. 411
  5440. ],
  5441. "uses": [],
  5442. "idx": 557
  5443. },
  5444. {
  5445. "path": "../classic/classic/src/panel/Table.js",
  5446. "requires": [
  5447. 456,
  5448. 557
  5449. ],
  5450. "uses": [
  5451. 1,
  5452. 77,
  5453. 115,
  5454. 182,
  5455. 222,
  5456. 250,
  5457. 554,
  5458. 561,
  5459. 568,
  5460. 578,
  5461. 612,
  5462. 613,
  5463. 656,
  5464. 657,
  5465. 658
  5466. ],
  5467. "idx": 558
  5468. },
  5469. {
  5470. "path": "../classic/classic/src/grid/ColumnLayout.js",
  5471. "requires": [
  5472. 443,
  5473. 558
  5474. ],
  5475. "uses": [],
  5476. "idx": 559
  5477. },
  5478. {
  5479. "path": "../classic/classic/src/grid/ColumnManager.js",
  5480. "requires": [],
  5481. "uses": [],
  5482. "idx": 560
  5483. },
  5484. {
  5485. "path": "../classic/classic/src/grid/NavigationModel.js",
  5486. "requires": [
  5487. 519
  5488. ],
  5489. "uses": [
  5490. 21,
  5491. 36,
  5492. 49,
  5493. 75,
  5494. 117,
  5495. 363,
  5496. 554
  5497. ],
  5498. "idx": 561
  5499. },
  5500. {
  5501. "path": "../classic/classic/src/view/TableLayout.js",
  5502. "requires": [
  5503. 423
  5504. ],
  5505. "uses": [],
  5506. "idx": 562
  5507. },
  5508. {
  5509. "path": "../classic/classic/src/grid/locking/RowSynchronizer.js",
  5510. "requires": [],
  5511. "uses": [],
  5512. "idx": 563
  5513. },
  5514. {
  5515. "path": "../classic/classic/src/view/NodeCache.js",
  5516. "requires": [
  5517. 76
  5518. ],
  5519. "uses": [
  5520. 49,
  5521. 75
  5522. ],
  5523. "idx": 564
  5524. },
  5525. {
  5526. "path": "../classic/classic/src/scroll/TableScroller.js",
  5527. "requires": [
  5528. 110
  5529. ],
  5530. "uses": [
  5531. 10
  5532. ],
  5533. "idx": 565
  5534. },
  5535. {
  5536. "path": "../classic/classic/src/view/Table.js",
  5537. "requires": [
  5538. 1,
  5539. 56,
  5540. 75,
  5541. 238,
  5542. 521,
  5543. 554,
  5544. 562,
  5545. 563,
  5546. 564,
  5547. 565
  5548. ],
  5549. "uses": [
  5550. 12,
  5551. 49,
  5552. 98,
  5553. 117,
  5554. 161,
  5555. 578
  5556. ],
  5557. "idx": 566
  5558. },
  5559. {
  5560. "path": "../classic/classic/src/grid/Panel.js",
  5561. "requires": [
  5562. 558,
  5563. 566
  5564. ],
  5565. "uses": [],
  5566. "idx": 567
  5567. },
  5568. {
  5569. "path": "../classic/classic/src/grid/RowContext.js",
  5570. "requires": [],
  5571. "uses": [
  5572. 12
  5573. ],
  5574. "idx": 568
  5575. },
  5576. {
  5577. "path": "../classic/classic/src/grid/RowEditorButtons.js",
  5578. "requires": [
  5579. 414
  5580. ],
  5581. "uses": [
  5582. 423,
  5583. 429,
  5584. 456
  5585. ],
  5586. "idx": 569
  5587. },
  5588. {
  5589. "path": "../classic/classic/src/grid/RowEditor.js",
  5590. "requires": [
  5591. 363,
  5592. 509,
  5593. 541,
  5594. 569
  5595. ],
  5596. "uses": [
  5597. 49,
  5598. 67,
  5599. 77,
  5600. 412,
  5601. 414,
  5602. 423,
  5603. 453,
  5604. 535,
  5605. 554
  5606. ],
  5607. "idx": 570
  5608. },
  5609. {
  5610. "path": "../classic/classic/src/grid/Scroller.js",
  5611. "requires": [],
  5612. "uses": [],
  5613. "idx": 571
  5614. },
  5615. {
  5616. "path": "../classic/classic/src/view/DropZone.js",
  5617. "requires": [
  5618. 479
  5619. ],
  5620. "uses": [
  5621. 117,
  5622. 423
  5623. ],
  5624. "idx": 572
  5625. },
  5626. {
  5627. "path": "../classic/classic/src/grid/ViewDropZone.js",
  5628. "requires": [
  5629. 572
  5630. ],
  5631. "uses": [],
  5632. "idx": 573
  5633. },
  5634. {
  5635. "path": "../classic/classic/src/grid/plugin/HeaderResizer.js",
  5636. "requires": [
  5637. 34,
  5638. 84,
  5639. 466
  5640. ],
  5641. "uses": [
  5642. 579
  5643. ],
  5644. "idx": 574
  5645. },
  5646. {
  5647. "path": "../classic/classic/src/grid/header/DragZone.js",
  5648. "requires": [
  5649. 477
  5650. ],
  5651. "uses": [],
  5652. "idx": 575
  5653. },
  5654. {
  5655. "path": "../classic/classic/src/grid/header/DropZone.js",
  5656. "requires": [
  5657. 479
  5658. ],
  5659. "uses": [
  5660. 440
  5661. ],
  5662. "idx": 576
  5663. },
  5664. {
  5665. "path": "../classic/classic/src/grid/plugin/HeaderReorderer.js",
  5666. "requires": [
  5667. 84,
  5668. 575,
  5669. 576
  5670. ],
  5671. "uses": [],
  5672. "idx": 577
  5673. },
  5674. {
  5675. "path": "../classic/classic/src/grid/header/Container.js",
  5676. "requires": [
  5677. 363,
  5678. 414,
  5679. 559,
  5680. 574,
  5681. 577
  5682. ],
  5683. "uses": [
  5684. 1,
  5685. 117,
  5686. 423,
  5687. 439,
  5688. 444,
  5689. 453,
  5690. 560,
  5691. 579,
  5692. 597,
  5693. 598,
  5694. 599
  5695. ],
  5696. "idx": 578
  5697. },
  5698. {
  5699. "path": "../classic/classic/src/grid/column/Column.js",
  5700. "requires": [
  5701. 218,
  5702. 556,
  5703. 559,
  5704. 578
  5705. ],
  5706. "uses": [
  5707. 54,
  5708. 94,
  5709. 574
  5710. ],
  5711. "idx": 579
  5712. },
  5713. {
  5714. "path": "../classic/classic/src/grid/column/ActionProxy.js",
  5715. "requires": [],
  5716. "uses": [],
  5717. "idx": 580
  5718. },
  5719. {
  5720. "path": "../classic/classic/src/grid/column/Action.js",
  5721. "requires": [
  5722. 78,
  5723. 94,
  5724. 579,
  5725. 580
  5726. ],
  5727. "uses": [
  5728. 49
  5729. ],
  5730. "idx": 581
  5731. },
  5732. {
  5733. "path": "../classic/classic/src/grid/column/Boolean.js",
  5734. "requires": [
  5735. 579
  5736. ],
  5737. "uses": [],
  5738. "idx": 582
  5739. },
  5740. {
  5741. "path": "../classic/classic/src/grid/column/Check.js",
  5742. "requires": [
  5743. 579
  5744. ],
  5745. "uses": [
  5746. 554
  5747. ],
  5748. "idx": 583
  5749. },
  5750. {
  5751. "path": "../classic/classic/src/grid/column/Date.js",
  5752. "requires": [
  5753. 579
  5754. ],
  5755. "uses": [
  5756. 94
  5757. ],
  5758. "idx": 584
  5759. },
  5760. {
  5761. "path": "../classic/classic/src/grid/column/Number.js",
  5762. "requires": [
  5763. 94,
  5764. 579
  5765. ],
  5766. "uses": [],
  5767. "idx": 585
  5768. },
  5769. {
  5770. "path": "../classic/classic/src/grid/column/RowNumberer.js",
  5771. "requires": [
  5772. 579
  5773. ],
  5774. "uses": [
  5775. 554
  5776. ],
  5777. "idx": 586
  5778. },
  5779. {
  5780. "path": "../classic/classic/src/grid/column/Template.js",
  5781. "requires": [
  5782. 98,
  5783. 579
  5784. ],
  5785. "uses": [
  5786. 583
  5787. ],
  5788. "idx": 587
  5789. },
  5790. {
  5791. "path": "../classic/classic/src/grid/column/Widget.js",
  5792. "requires": [
  5793. 369,
  5794. 579
  5795. ],
  5796. "uses": [],
  5797. "idx": 588
  5798. },
  5799. {
  5800. "path": "../classic/classic/src/grid/feature/Feature.js",
  5801. "requires": [
  5802. 52
  5803. ],
  5804. "uses": [],
  5805. "idx": 589
  5806. },
  5807. {
  5808. "path": "../classic/classic/src/grid/feature/AbstractSummary.js",
  5809. "requires": [
  5810. 589
  5811. ],
  5812. "uses": [],
  5813. "idx": 590
  5814. },
  5815. {
  5816. "path": "../classic/classic/src/grid/feature/GroupStore.js",
  5817. "requires": [
  5818. 52
  5819. ],
  5820. "uses": [
  5821. 132
  5822. ],
  5823. "idx": 591
  5824. },
  5825. {
  5826. "path": "../classic/classic/src/grid/feature/Grouping.js",
  5827. "requires": [
  5828. 589,
  5829. 590,
  5830. 591
  5831. ],
  5832. "uses": [
  5833. 98,
  5834. 161
  5835. ],
  5836. "idx": 592
  5837. },
  5838. {
  5839. "path": "../classic/classic/src/grid/feature/GroupingSummary.js",
  5840. "requires": [
  5841. 592
  5842. ],
  5843. "uses": [],
  5844. "idx": 593
  5845. },
  5846. {
  5847. "path": "../classic/classic/src/grid/feature/RowBody.js",
  5848. "requires": [
  5849. 589
  5850. ],
  5851. "uses": [
  5852. 98
  5853. ],
  5854. "idx": 594
  5855. },
  5856. {
  5857. "path": "../classic/classic/src/grid/feature/Summary.js",
  5858. "requires": [
  5859. 590
  5860. ],
  5861. "uses": [
  5862. 117,
  5863. 161,
  5864. 423
  5865. ],
  5866. "idx": 595
  5867. },
  5868. {
  5869. "path": "../classic/classic/src/menu/Item.js",
  5870. "requires": [
  5871. 78,
  5872. 117,
  5873. 238
  5874. ],
  5875. "uses": [
  5876. 428,
  5877. 543
  5878. ],
  5879. "idx": 596
  5880. },
  5881. {
  5882. "path": "../classic/classic/src/menu/CheckItem.js",
  5883. "requires": [
  5884. 596
  5885. ],
  5886. "uses": [
  5887. 428
  5888. ],
  5889. "idx": 597
  5890. },
  5891. {
  5892. "path": "../classic/classic/src/menu/Separator.js",
  5893. "requires": [
  5894. 596
  5895. ],
  5896. "uses": [],
  5897. "idx": 598
  5898. },
  5899. {
  5900. "path": "../classic/classic/src/menu/Menu.js",
  5901. "requires": [
  5902. 428,
  5903. 444,
  5904. 456,
  5905. 596,
  5906. 597,
  5907. 598
  5908. ],
  5909. "uses": [
  5910. 1,
  5911. 21,
  5912. 36,
  5913. 49,
  5914. 363,
  5915. 423
  5916. ],
  5917. "idx": 599
  5918. },
  5919. {
  5920. "path": "../classic/classic/src/grid/filters/filter/Base.js",
  5921. "requires": [
  5922. 12,
  5923. 439,
  5924. 444,
  5925. 453,
  5926. 599
  5927. ],
  5928. "uses": [
  5929. 1,
  5930. 51
  5931. ],
  5932. "idx": 600
  5933. },
  5934. {
  5935. "path": "../classic/classic/src/grid/filters/filter/SingleFilter.js",
  5936. "requires": [
  5937. 600
  5938. ],
  5939. "uses": [],
  5940. "idx": 601
  5941. },
  5942. {
  5943. "path": "../classic/classic/src/grid/filters/filter/Boolean.js",
  5944. "requires": [
  5945. 601
  5946. ],
  5947. "uses": [],
  5948. "idx": 602
  5949. },
  5950. {
  5951. "path": "../classic/classic/src/grid/filters/filter/TriFilter.js",
  5952. "requires": [
  5953. 600
  5954. ],
  5955. "uses": [],
  5956. "idx": 603
  5957. },
  5958. {
  5959. "path": "../classic/classic/src/grid/filters/filter/Date.js",
  5960. "requires": [
  5961. 423,
  5962. 597,
  5963. 603
  5964. ],
  5965. "uses": [
  5966. 439,
  5967. 444,
  5968. 453,
  5969. 533,
  5970. 648
  5971. ],
  5972. "idx": 604
  5973. },
  5974. {
  5975. "path": "../classic/classic/src/grid/filters/filter/List.js",
  5976. "requires": [
  5977. 601
  5978. ],
  5979. "uses": [
  5980. 179,
  5981. 182
  5982. ],
  5983. "idx": 605
  5984. },
  5985. {
  5986. "path": "../classic/classic/src/grid/filters/filter/Number.js",
  5987. "requires": [
  5988. 493,
  5989. 526,
  5990. 603
  5991. ],
  5992. "uses": [
  5993. 528
  5994. ],
  5995. "idx": 606
  5996. },
  5997. {
  5998. "path": "../classic/classic/src/grid/filters/filter/String.js",
  5999. "requires": [
  6000. 493,
  6001. 496,
  6002. 601
  6003. ],
  6004. "uses": [
  6005. 51
  6006. ],
  6007. "idx": 607
  6008. },
  6009. {
  6010. "path": "../classic/classic/src/grid/filters/Filters.js",
  6011. "requires": [
  6012. 84,
  6013. 420,
  6014. 600,
  6015. 601,
  6016. 602,
  6017. 603,
  6018. 604,
  6019. 605,
  6020. 606,
  6021. 607
  6022. ],
  6023. "uses": [
  6024. 12
  6025. ],
  6026. "idx": 608
  6027. },
  6028. {
  6029. "path": "../classic/classic/src/grid/locking/HeaderContainer.js",
  6030. "requires": [
  6031. 560,
  6032. 578
  6033. ],
  6034. "uses": [],
  6035. "idx": 609
  6036. },
  6037. {
  6038. "path": "../classic/classic/src/grid/locking/View.js",
  6039. "requires": [
  6040. 52,
  6041. 87,
  6042. 117,
  6043. 420,
  6044. 520,
  6045. 566
  6046. ],
  6047. "uses": [
  6048. 110,
  6049. 421,
  6050. 554
  6051. ],
  6052. "idx": 610
  6053. },
  6054. {
  6055. "path": "../classic/classic/src/scroll/LockingScroller.js",
  6056. "requires": [
  6057. 110
  6058. ],
  6059. "uses": [
  6060. 10
  6061. ],
  6062. "idx": 611
  6063. },
  6064. {
  6065. "path": "../classic/classic/src/grid/locking/Lockable.js",
  6066. "requires": [
  6067. 117,
  6068. 566,
  6069. 578,
  6070. 609,
  6071. 610,
  6072. 611
  6073. ],
  6074. "uses": [
  6075. 1,
  6076. 34,
  6077. 110,
  6078. 182,
  6079. 412,
  6080. 423,
  6081. 441,
  6082. 442,
  6083. 456,
  6084. 558
  6085. ],
  6086. "idx": 612
  6087. },
  6088. {
  6089. "path": "../classic/classic/src/grid/plugin/BufferedRenderer.js",
  6090. "requires": [
  6091. 84,
  6092. 563
  6093. ],
  6094. "uses": [
  6095. 1,
  6096. 49,
  6097. 117
  6098. ],
  6099. "idx": 613
  6100. },
  6101. {
  6102. "path": "../classic/classic/src/grid/plugin/Editing.js",
  6103. "requires": [
  6104. 4,
  6105. 84,
  6106. 363,
  6107. 492,
  6108. 566,
  6109. 579
  6110. ],
  6111. "uses": [
  6112. 21,
  6113. 117,
  6114. 423,
  6115. 554
  6116. ],
  6117. "idx": 614
  6118. },
  6119. {
  6120. "path": "../classic/classic/src/grid/plugin/CellEditing.js",
  6121. "requires": [
  6122. 1,
  6123. 555,
  6124. 614
  6125. ],
  6126. "uses": [
  6127. 56,
  6128. 415,
  6129. 423,
  6130. 554
  6131. ],
  6132. "idx": 615
  6133. },
  6134. {
  6135. "path": "../classic/classic/src/grid/plugin/Clipboard.js",
  6136. "requires": [
  6137. 94,
  6138. 373,
  6139. 398
  6140. ],
  6141. "uses": [
  6142. 554
  6143. ],
  6144. "idx": 616
  6145. },
  6146. {
  6147. "path": "../classic/classic/src/grid/plugin/DragDrop.js",
  6148. "requires": [
  6149. 84
  6150. ],
  6151. "uses": [
  6152. 573,
  6153. 677
  6154. ],
  6155. "idx": 617
  6156. },
  6157. {
  6158. "path": "../classic/classic/src/grid/plugin/RowEditing.js",
  6159. "requires": [
  6160. 570,
  6161. 614
  6162. ],
  6163. "uses": [],
  6164. "idx": 618
  6165. },
  6166. {
  6167. "path": "../classic/classic/src/grid/plugin/RowExpander.js",
  6168. "requires": [
  6169. 84,
  6170. 594
  6171. ],
  6172. "uses": [
  6173. 98,
  6174. 579
  6175. ],
  6176. "idx": 619
  6177. },
  6178. {
  6179. "path": "../classic/classic/src/grid/plugin/RowWidget.js",
  6180. "requires": [
  6181. 3,
  6182. 369,
  6183. 619
  6184. ],
  6185. "uses": [
  6186. 84,
  6187. 594
  6188. ],
  6189. "idx": 620
  6190. },
  6191. {
  6192. "path": "../classic/classic/src/grid/property/Grid.js",
  6193. "requires": [
  6194. 567
  6195. ],
  6196. "uses": [
  6197. 21,
  6198. 98,
  6199. 161,
  6200. 415,
  6201. 423,
  6202. 492,
  6203. 493,
  6204. 496,
  6205. 526,
  6206. 528,
  6207. 531,
  6208. 534,
  6209. 554,
  6210. 555,
  6211. 566,
  6212. 615,
  6213. 622,
  6214. 625
  6215. ],
  6216. "idx": 621
  6217. },
  6218. {
  6219. "path": "../classic/classic/src/grid/property/HeaderContainer.js",
  6220. "requires": [
  6221. 94,
  6222. 578
  6223. ],
  6224. "uses": [],
  6225. "idx": 622
  6226. },
  6227. {
  6228. "path": "../classic/classic/src/grid/property/Property.js",
  6229. "requires": [
  6230. 161
  6231. ],
  6232. "uses": [],
  6233. "idx": 623
  6234. },
  6235. {
  6236. "path": "../classic/classic/src/grid/property/Reader.js",
  6237. "requires": [
  6238. 163
  6239. ],
  6240. "uses": [
  6241. 162
  6242. ],
  6243. "idx": 624
  6244. },
  6245. {
  6246. "path": "../classic/classic/src/grid/property/Store.js",
  6247. "requires": [
  6248. 167,
  6249. 179,
  6250. 623,
  6251. 624
  6252. ],
  6253. "uses": [
  6254. 175
  6255. ],
  6256. "idx": 625
  6257. },
  6258. {
  6259. "path": "../classic/classic/src/grid/selection/Selection.js",
  6260. "requires": [],
  6261. "uses": [],
  6262. "idx": 626
  6263. },
  6264. {
  6265. "path": "../classic/classic/src/grid/selection/Cells.js",
  6266. "requires": [
  6267. 626
  6268. ],
  6269. "uses": [
  6270. 554
  6271. ],
  6272. "idx": 627
  6273. },
  6274. {
  6275. "path": "../classic/classic/src/grid/selection/Columns.js",
  6276. "requires": [
  6277. 626
  6278. ],
  6279. "uses": [
  6280. 554
  6281. ],
  6282. "idx": 628
  6283. },
  6284. {
  6285. "path": "../classic/classic/src/grid/selection/Replicator.js",
  6286. "requires": [
  6287. 84
  6288. ],
  6289. "uses": [],
  6290. "idx": 629
  6291. },
  6292. {
  6293. "path": "../classic/classic/src/grid/selection/Rows.js",
  6294. "requires": [
  6295. 132,
  6296. 626
  6297. ],
  6298. "uses": [
  6299. 554
  6300. ],
  6301. "idx": 630
  6302. },
  6303. {
  6304. "path": "../classic/classic/src/grid/selection/SelectionExtender.js",
  6305. "requires": [
  6306. 466
  6307. ],
  6308. "uses": [
  6309. 49,
  6310. 399
  6311. ],
  6312. "idx": 631
  6313. },
  6314. {
  6315. "path": "../classic/classic/src/grid/selection/SpreadsheetModel.js",
  6316. "requires": [
  6317. 517,
  6318. 586,
  6319. 626,
  6320. 627,
  6321. 628,
  6322. 630,
  6323. 631
  6324. ],
  6325. "uses": [
  6326. 399,
  6327. 412,
  6328. 472,
  6329. 554,
  6330. 556,
  6331. 583
  6332. ],
  6333. "idx": 632
  6334. },
  6335. {
  6336. "path": "../classic/classic/src/util/Queue.js",
  6337. "requires": [],
  6338. "uses": [],
  6339. "idx": 633
  6340. },
  6341. {
  6342. "path": "../classic/classic/src/layout/ContextItem.js",
  6343. "requires": [],
  6344. "uses": [
  6345. 56,
  6346. 67,
  6347. 73,
  6348. 409
  6349. ],
  6350. "idx": 634
  6351. },
  6352. {
  6353. "path": "../classic/classic/src/layout/Context.js",
  6354. "requires": [
  6355. 67,
  6356. 73,
  6357. 372,
  6358. 410,
  6359. 633,
  6360. 634
  6361. ],
  6362. "uses": [],
  6363. "idx": 635
  6364. },
  6365. {
  6366. "path": "../classic/classic/src/layout/SizePolicy.js",
  6367. "requires": [],
  6368. "uses": [],
  6369. "idx": 636
  6370. },
  6371. {
  6372. "path": "../classic/classic/src/layout/component/Body.js",
  6373. "requires": [
  6374. 423
  6375. ],
  6376. "uses": [],
  6377. "idx": 637
  6378. },
  6379. {
  6380. "path": "../classic/classic/src/layout/component/FieldSet.js",
  6381. "requires": [
  6382. 637
  6383. ],
  6384. "uses": [],
  6385. "idx": 638
  6386. },
  6387. {
  6388. "path": "../classic/classic/src/layout/container/Absolute.js",
  6389. "requires": [
  6390. 462
  6391. ],
  6392. "uses": [],
  6393. "idx": 639
  6394. },
  6395. {
  6396. "path": "../classic/classic/src/layout/container/Accordion.js",
  6397. "requires": [
  6398. 444
  6399. ],
  6400. "uses": [],
  6401. "idx": 640
  6402. },
  6403. {
  6404. "path": "../classic/classic/src/resizer/BorderSplitter.js",
  6405. "requires": [
  6406. 441
  6407. ],
  6408. "uses": [
  6409. 652
  6410. ],
  6411. "idx": 641
  6412. },
  6413. {
  6414. "path": "../classic/classic/src/layout/container/Border.js",
  6415. "requires": [
  6416. 73,
  6417. 119,
  6418. 411,
  6419. 641
  6420. ],
  6421. "uses": [
  6422. 94,
  6423. 423
  6424. ],
  6425. "idx": 642
  6426. },
  6427. {
  6428. "path": "../classic/classic/src/layout/container/Card.js",
  6429. "requires": [
  6430. 557
  6431. ],
  6432. "uses": [
  6433. 49
  6434. ],
  6435. "idx": 643
  6436. },
  6437. {
  6438. "path": "../classic/classic/src/layout/container/Center.js",
  6439. "requires": [
  6440. 557
  6441. ],
  6442. "uses": [],
  6443. "idx": 644
  6444. },
  6445. {
  6446. "path": "../classic/classic/src/layout/container/Form.js",
  6447. "requires": [
  6448. 412
  6449. ],
  6450. "uses": [],
  6451. "idx": 645
  6452. },
  6453. {
  6454. "path": "../classic/classic/src/menu/Bar.js",
  6455. "requires": [
  6456. 599
  6457. ],
  6458. "uses": [],
  6459. "idx": 646
  6460. },
  6461. {
  6462. "path": "../classic/classic/src/menu/ColorPicker.js",
  6463. "requires": [
  6464. 544,
  6465. 599
  6466. ],
  6467. "uses": [
  6468. 423,
  6469. 428
  6470. ],
  6471. "idx": 647
  6472. },
  6473. {
  6474. "path": "../classic/classic/src/menu/DatePicker.js",
  6475. "requires": [
  6476. 533,
  6477. 599
  6478. ],
  6479. "uses": [
  6480. 423,
  6481. 428
  6482. ],
  6483. "idx": 648
  6484. },
  6485. {
  6486. "path": "../classic/classic/src/panel/Pinnable.js",
  6487. "requires": [
  6488. 0
  6489. ],
  6490. "uses": [
  6491. 423,
  6492. 436
  6493. ],
  6494. "idx": 649
  6495. },
  6496. {
  6497. "path": "../classic/classic/src/plugin/LazyItems.js",
  6498. "requires": [
  6499. 84
  6500. ],
  6501. "uses": [],
  6502. "idx": 650
  6503. },
  6504. {
  6505. "path": "../classic/classic/src/plugin/Responsive.js",
  6506. "requires": [
  6507. 84,
  6508. 118
  6509. ],
  6510. "uses": [],
  6511. "idx": 651
  6512. },
  6513. {
  6514. "path": "../classic/classic/src/resizer/BorderSplitterTracker.js",
  6515. "requires": [
  6516. 34,
  6517. 467
  6518. ],
  6519. "uses": [],
  6520. "idx": 652
  6521. },
  6522. {
  6523. "path": "../classic/classic/src/resizer/Handle.js",
  6524. "requires": [
  6525. 117
  6526. ],
  6527. "uses": [],
  6528. "idx": 653
  6529. },
  6530. {
  6531. "path": "../classic/classic/src/resizer/ResizeTracker.js",
  6532. "requires": [
  6533. 466
  6534. ],
  6535. "uses": [
  6536. 49
  6537. ],
  6538. "idx": 654
  6539. },
  6540. {
  6541. "path": "../classic/classic/src/resizer/Resizer.js",
  6542. "requires": [
  6543. 52
  6544. ],
  6545. "uses": [
  6546. 49,
  6547. 95,
  6548. 117,
  6549. 654
  6550. ],
  6551. "idx": 655
  6552. },
  6553. {
  6554. "path": "../classic/classic/src/selection/CellModel.js",
  6555. "requires": [
  6556. 518,
  6557. 554
  6558. ],
  6559. "uses": [],
  6560. "idx": 656
  6561. },
  6562. {
  6563. "path": "../classic/classic/src/selection/RowModel.js",
  6564. "requires": [
  6565. 518,
  6566. 554
  6567. ],
  6568. "uses": [],
  6569. "idx": 657
  6570. },
  6571. {
  6572. "path": "../classic/classic/src/selection/CheckboxModel.js",
  6573. "requires": [
  6574. 583,
  6575. 657
  6576. ],
  6577. "uses": [
  6578. 412,
  6579. 554,
  6580. 556
  6581. ],
  6582. "idx": 658
  6583. },
  6584. {
  6585. "path": "../classic/classic/src/selection/TreeModel.js",
  6586. "requires": [
  6587. 657
  6588. ],
  6589. "uses": [],
  6590. "idx": 659
  6591. },
  6592. {
  6593. "path": "../classic/classic/src/slider/Thumb.js",
  6594. "requires": [
  6595. 94,
  6596. 466
  6597. ],
  6598. "uses": [
  6599. 73
  6600. ],
  6601. "idx": 660
  6602. },
  6603. {
  6604. "path": "../classic/classic/src/slider/Tip.js",
  6605. "requires": [
  6606. 540
  6607. ],
  6608. "uses": [],
  6609. "idx": 661
  6610. },
  6611. {
  6612. "path": "../classic/classic/src/slider/Multi.js",
  6613. "requires": [
  6614. 94,
  6615. 95,
  6616. 492,
  6617. 660,
  6618. 661
  6619. ],
  6620. "uses": [
  6621. 250
  6622. ],
  6623. "idx": 662
  6624. },
  6625. {
  6626. "path": "../classic/classic/src/slider/Single.js",
  6627. "requires": [
  6628. 662
  6629. ],
  6630. "uses": [],
  6631. "idx": 663
  6632. },
  6633. {
  6634. "path": "../classic/classic/src/slider/Widget.js",
  6635. "requires": [
  6636. 89,
  6637. 662
  6638. ],
  6639. "uses": [
  6640. 73,
  6641. 94
  6642. ],
  6643. "idx": 664
  6644. },
  6645. {
  6646. "path": "../classic/classic/src/state/CookieProvider.js",
  6647. "requires": [
  6648. 114
  6649. ],
  6650. "uses": [],
  6651. "idx": 665
  6652. },
  6653. {
  6654. "path": "../classic/classic/src/state/LocalStorageProvider.js",
  6655. "requires": [
  6656. 114,
  6657. 396
  6658. ],
  6659. "uses": [],
  6660. "idx": 666
  6661. },
  6662. {
  6663. "path": "../classic/classic/src/tab/Tab.js",
  6664. "requires": [
  6665. 429
  6666. ],
  6667. "uses": [],
  6668. "idx": 667
  6669. },
  6670. {
  6671. "path": "../classic/classic/src/tab/Bar.js",
  6672. "requires": [
  6673. 35,
  6674. 434,
  6675. 637,
  6676. 667
  6677. ],
  6678. "uses": [
  6679. 34
  6680. ],
  6681. "idx": 668
  6682. },
  6683. {
  6684. "path": "../classic/classic/src/tab/Panel.js",
  6685. "requires": [
  6686. 456,
  6687. 643,
  6688. 668
  6689. ],
  6690. "uses": [
  6691. 423,
  6692. 667
  6693. ],
  6694. "idx": 669
  6695. },
  6696. {
  6697. "path": "../classic/classic/src/toolbar/Breadcrumb.js",
  6698. "requires": [
  6699. 247,
  6700. 414,
  6701. 430
  6702. ],
  6703. "uses": [
  6704. 24,
  6705. 182
  6706. ],
  6707. "idx": 670
  6708. },
  6709. {
  6710. "path": "../classic/classic/src/toolbar/Fill.js",
  6711. "requires": [
  6712. 117,
  6713. 445
  6714. ],
  6715. "uses": [],
  6716. "idx": 671
  6717. },
  6718. {
  6719. "path": "../classic/classic/src/toolbar/Spacer.js",
  6720. "requires": [
  6721. 117,
  6722. 445
  6723. ],
  6724. "uses": [],
  6725. "idx": 672
  6726. },
  6727. {
  6728. "path": "../classic/classic/src/tree/Column.js",
  6729. "requires": [
  6730. 579
  6731. ],
  6732. "uses": [
  6733. 78
  6734. ],
  6735. "idx": 673
  6736. },
  6737. {
  6738. "path": "../classic/classic/src/tree/NavigationModel.js",
  6739. "requires": [
  6740. 561
  6741. ],
  6742. "uses": [
  6743. 36
  6744. ],
  6745. "idx": 674
  6746. },
  6747. {
  6748. "path": "../classic/classic/src/tree/View.js",
  6749. "requires": [
  6750. 566
  6751. ],
  6752. "uses": [
  6753. 49
  6754. ],
  6755. "idx": 675
  6756. },
  6757. {
  6758. "path": "../classic/classic/src/tree/Panel.js",
  6759. "requires": [
  6760. 247,
  6761. 558,
  6762. 659,
  6763. 673,
  6764. 674,
  6765. 675
  6766. ],
  6767. "uses": [
  6768. 182,
  6769. 412,
  6770. 556
  6771. ],
  6772. "idx": 676
  6773. },
  6774. {
  6775. "path": "../classic/classic/src/view/DragZone.js",
  6776. "requires": [
  6777. 477
  6778. ],
  6779. "uses": [
  6780. 49,
  6781. 95
  6782. ],
  6783. "idx": 677
  6784. },
  6785. {
  6786. "path": "../classic/classic/src/tree/ViewDragZone.js",
  6787. "requires": [
  6788. 677
  6789. ],
  6790. "uses": [
  6791. 95
  6792. ],
  6793. "idx": 678
  6794. },
  6795. {
  6796. "path": "../classic/classic/src/tree/ViewDropZone.js",
  6797. "requires": [
  6798. 572
  6799. ],
  6800. "uses": [],
  6801. "idx": 679
  6802. },
  6803. {
  6804. "path": "../classic/classic/src/tree/plugin/TreeViewDragDrop.js",
  6805. "requires": [
  6806. 84
  6807. ],
  6808. "uses": [
  6809. 678,
  6810. 679
  6811. ],
  6812. "idx": 680
  6813. },
  6814. {
  6815. "path": "../classic/classic/src/view/MultiSelectorSearch.js",
  6816. "requires": [
  6817. 456
  6818. ],
  6819. "uses": [
  6820. 51,
  6821. 182,
  6822. 453,
  6823. 493,
  6824. 496,
  6825. 557,
  6826. 567
  6827. ],
  6828. "idx": 681
  6829. },
  6830. {
  6831. "path": "../classic/classic/src/view/MultiSelector.js",
  6832. "requires": [
  6833. 453,
  6834. 557,
  6835. 567,
  6836. 681
  6837. ],
  6838. "uses": [],
  6839. "idx": 682
  6840. },
  6841. {
  6842. "path": "../classic/classic/src/window/Toast.js",
  6843. "requires": [
  6844. 489
  6845. ],
  6846. "uses": [
  6847. 1
  6848. ],
  6849. "idx": 683
  6850. }
  6851. ],
  6852. "classes": {
  6853. "Ext.AbstractManager": {
  6854. "idx": 6,
  6855. "alias": [],
  6856. "alternates": []
  6857. },
  6858. "Ext.Action": {
  6859. "idx": 406,
  6860. "alias": [],
  6861. "alternates": []
  6862. },
  6863. "Ext.Ajax": {
  6864. "idx": 18,
  6865. "alias": [],
  6866. "alternates": []
  6867. },
  6868. "Ext.AnimationQueue": {
  6869. "idx": 19,
  6870. "alias": [],
  6871. "alternates": []
  6872. },
  6873. "Ext.Component": {
  6874. "idx": 117,
  6875. "alias": [
  6876. "widget.box",
  6877. "widget.component"
  6878. ],
  6879. "alternates": [
  6880. "Ext.AbstractComponent"
  6881. ]
  6882. },
  6883. "Ext.ComponentLoader": {
  6884. "idx": 408,
  6885. "alias": [],
  6886. "alternates": []
  6887. },
  6888. "Ext.ComponentManager": {
  6889. "idx": 21,
  6890. "alias": [],
  6891. "alternates": [
  6892. "Ext.ComponentMgr"
  6893. ]
  6894. },
  6895. "Ext.ComponentQuery": {
  6896. "idx": 24,
  6897. "alias": [],
  6898. "alternates": []
  6899. },
  6900. "Ext.Deferred": {
  6901. "idx": 11,
  6902. "alias": [],
  6903. "alternates": []
  6904. },
  6905. "Ext.Editor": {
  6906. "idx": 416,
  6907. "alias": [
  6908. "widget.editor"
  6909. ],
  6910. "alternates": []
  6911. },
  6912. "Ext.ElementLoader": {
  6913. "idx": 407,
  6914. "alias": [],
  6915. "alternates": []
  6916. },
  6917. "Ext.EventManager": {
  6918. "idx": 417,
  6919. "alias": [],
  6920. "alternates": []
  6921. },
  6922. "Ext.Evented": {
  6923. "idx": 25,
  6924. "alias": [],
  6925. "alternates": [
  6926. "Ext.EventedBase"
  6927. ]
  6928. },
  6929. "Ext.GlobalEvents": {
  6930. "idx": 77,
  6931. "alias": [],
  6932. "alternates": [
  6933. "Ext.globalEvents"
  6934. ]
  6935. },
  6936. "Ext.Glyph": {
  6937. "idx": 78,
  6938. "alias": [],
  6939. "alternates": []
  6940. },
  6941. "Ext.Img": {
  6942. "idx": 419,
  6943. "alias": [
  6944. "widget.image",
  6945. "widget.imagecomponent"
  6946. ],
  6947. "alternates": []
  6948. },
  6949. "Ext.LoadMask": {
  6950. "idx": 421,
  6951. "alias": [
  6952. "widget.loadmask"
  6953. ],
  6954. "alternates": []
  6955. },
  6956. "Ext.Mixin": {
  6957. "idx": 0,
  6958. "alias": [],
  6959. "alternates": []
  6960. },
  6961. "Ext.Progress": {
  6962. "idx": 93,
  6963. "alias": [
  6964. "widget.progress",
  6965. "widget.progressbarwidget"
  6966. ],
  6967. "alternates": [
  6968. "Ext.ProgressBarWidget"
  6969. ]
  6970. },
  6971. "Ext.ProgressBar": {
  6972. "idx": 425,
  6973. "alias": [
  6974. "widget.progressbar"
  6975. ],
  6976. "alternates": []
  6977. },
  6978. "Ext.ProgressBase": {
  6979. "idx": 92,
  6980. "alias": [],
  6981. "alternates": []
  6982. },
  6983. "Ext.Promise": {
  6984. "idx": 10,
  6985. "alias": [],
  6986. "alternates": []
  6987. },
  6988. "Ext.Responsive": {
  6989. "idx": 118,
  6990. "alias": [],
  6991. "alternates": []
  6992. },
  6993. "Ext.ResponsiveWidget": {
  6994. "idx": 91,
  6995. "alias": [],
  6996. "alternates": []
  6997. },
  6998. "Ext.TaskQueue": {
  6999. "idx": 40,
  7000. "alias": [],
  7001. "alternates": []
  7002. },
  7003. "Ext.Template": {
  7004. "idx": 95,
  7005. "alias": [],
  7006. "alternates": []
  7007. },
  7008. "Ext.Widget": {
  7009. "idx": 89,
  7010. "alias": [
  7011. "widget.widget"
  7012. ],
  7013. "alternates": [
  7014. "Ext.Gadget"
  7015. ]
  7016. },
  7017. "Ext.XTemplate": {
  7018. "idx": 98,
  7019. "alias": [],
  7020. "alternates": []
  7021. },
  7022. "Ext.ZIndexManager": {
  7023. "idx": 413,
  7024. "alias": [],
  7025. "alternates": [
  7026. "Ext.WindowGroup"
  7027. ]
  7028. },
  7029. "Ext.app.Application": {
  7030. "idx": 185,
  7031. "alias": [],
  7032. "alternates": []
  7033. },
  7034. "Ext.app.BaseController": {
  7035. "idx": 128,
  7036. "alias": [],
  7037. "alternates": []
  7038. },
  7039. "Ext.app.Controller": {
  7040. "idx": 184,
  7041. "alias": [],
  7042. "alternates": []
  7043. },
  7044. "Ext.app.EventBus": {
  7045. "idx": 120,
  7046. "alias": [],
  7047. "alternates": []
  7048. },
  7049. "Ext.app.EventDomain": {
  7050. "idx": 99,
  7051. "alias": [],
  7052. "alternates": []
  7053. },
  7054. "Ext.app.Profile": {
  7055. "idx": 186,
  7056. "alias": [],
  7057. "alternates": []
  7058. },
  7059. "Ext.app.Util": {
  7060. "idx": 129,
  7061. "alias": [],
  7062. "alternates": []
  7063. },
  7064. "Ext.app.ViewController": {
  7065. "idx": 188,
  7066. "alias": [
  7067. "controller.controller"
  7068. ],
  7069. "alternates": []
  7070. },
  7071. "Ext.app.ViewModel": {
  7072. "idx": 222,
  7073. "alias": [
  7074. "viewmodel.default"
  7075. ],
  7076. "alternates": []
  7077. },
  7078. "Ext.app.bind.AbstractStub": {
  7079. "idx": 203,
  7080. "alias": [],
  7081. "alternates": []
  7082. },
  7083. "Ext.app.bind.BaseBinding": {
  7084. "idx": 201,
  7085. "alias": [],
  7086. "alternates": []
  7087. },
  7088. "Ext.app.bind.Binding": {
  7089. "idx": 202,
  7090. "alias": [],
  7091. "alternates": []
  7092. },
  7093. "Ext.app.bind.Formula": {
  7094. "idx": 208,
  7095. "alias": [],
  7096. "alternates": []
  7097. },
  7098. "Ext.app.bind.LinkStub": {
  7099. "idx": 205,
  7100. "alias": [],
  7101. "alternates": []
  7102. },
  7103. "Ext.app.bind.Multi": {
  7104. "idx": 207,
  7105. "alias": [],
  7106. "alternates": []
  7107. },
  7108. "Ext.app.bind.Parser": {
  7109. "idx": 218,
  7110. "alias": [],
  7111. "alternates": []
  7112. },
  7113. "Ext.app.bind.RootStub": {
  7114. "idx": 206,
  7115. "alias": [],
  7116. "alternates": []
  7117. },
  7118. "Ext.app.bind.Stub": {
  7119. "idx": 204,
  7120. "alias": [],
  7121. "alternates": []
  7122. },
  7123. "Ext.app.bind.Template": {
  7124. "idx": 219,
  7125. "alias": [],
  7126. "alternates": []
  7127. },
  7128. "Ext.app.bind.TemplateBinding": {
  7129. "idx": 220,
  7130. "alias": [],
  7131. "alternates": []
  7132. },
  7133. "Ext.app.domain.Component": {
  7134. "idx": 100,
  7135. "alias": [],
  7136. "alternates": []
  7137. },
  7138. "Ext.app.domain.Controller": {
  7139. "idx": 223,
  7140. "alias": [],
  7141. "alternates": []
  7142. },
  7143. "Ext.app.domain.Direct": {
  7144. "idx": 226,
  7145. "alias": [],
  7146. "alternates": []
  7147. },
  7148. "Ext.app.domain.Global": {
  7149. "idx": 121,
  7150. "alias": [],
  7151. "alternates": []
  7152. },
  7153. "Ext.app.domain.Store": {
  7154. "idx": 183,
  7155. "alias": [],
  7156. "alternates": []
  7157. },
  7158. "Ext.app.domain.View": {
  7159. "idx": 187,
  7160. "alias": [],
  7161. "alternates": []
  7162. },
  7163. "Ext.button.Button": {
  7164. "idx": 429,
  7165. "alias": [
  7166. "widget.button"
  7167. ],
  7168. "alternates": [
  7169. "Ext.Button"
  7170. ]
  7171. },
  7172. "Ext.button.Cycle": {
  7173. "idx": 431,
  7174. "alias": [
  7175. "widget.cycle"
  7176. ],
  7177. "alternates": [
  7178. "Ext.CycleButton"
  7179. ]
  7180. },
  7181. "Ext.button.Manager": {
  7182. "idx": 427,
  7183. "alias": [],
  7184. "alternates": [
  7185. "Ext.ButtonToggleManager"
  7186. ]
  7187. },
  7188. "Ext.button.Segmented": {
  7189. "idx": 433,
  7190. "alias": [
  7191. "widget.segmentedbutton"
  7192. ],
  7193. "alternates": []
  7194. },
  7195. "Ext.button.Split": {
  7196. "idx": 430,
  7197. "alias": [
  7198. "widget.splitbutton"
  7199. ],
  7200. "alternates": [
  7201. "Ext.SplitButton"
  7202. ]
  7203. },
  7204. "Ext.container.ButtonGroup": {
  7205. "idx": 458,
  7206. "alias": [
  7207. "widget.buttongroup"
  7208. ],
  7209. "alternates": [
  7210. "Ext.ButtonGroup"
  7211. ]
  7212. },
  7213. "Ext.container.Container": {
  7214. "idx": 414,
  7215. "alias": [
  7216. "widget.container"
  7217. ],
  7218. "alternates": [
  7219. "Ext.Container",
  7220. "Ext.AbstractContainer"
  7221. ]
  7222. },
  7223. "Ext.container.DockingContainer": {
  7224. "idx": 455,
  7225. "alias": [],
  7226. "alternates": []
  7227. },
  7228. "Ext.container.Monitor": {
  7229. "idx": 459,
  7230. "alias": [],
  7231. "alternates": []
  7232. },
  7233. "Ext.container.Viewport": {
  7234. "idx": 461,
  7235. "alias": [
  7236. "widget.viewport"
  7237. ],
  7238. "alternates": [
  7239. "Ext.Viewport"
  7240. ]
  7241. },
  7242. "Ext.dashboard.Column": {
  7243. "idx": 464,
  7244. "alias": [
  7245. "widget.dashboard-column"
  7246. ],
  7247. "alternates": []
  7248. },
  7249. "Ext.dashboard.Dashboard": {
  7250. "idx": 476,
  7251. "alias": [
  7252. "widget.dashboard"
  7253. ],
  7254. "alternates": []
  7255. },
  7256. "Ext.dashboard.DropZone": {
  7257. "idx": 474,
  7258. "alias": [],
  7259. "alternates": []
  7260. },
  7261. "Ext.dashboard.Panel": {
  7262. "idx": 463,
  7263. "alias": [
  7264. "widget.dashboard-panel"
  7265. ],
  7266. "alternates": []
  7267. },
  7268. "Ext.dashboard.Part": {
  7269. "idx": 475,
  7270. "alias": [
  7271. "part.part"
  7272. ],
  7273. "alternates": []
  7274. },
  7275. "Ext.data.AbstractStore": {
  7276. "idx": 143,
  7277. "alias": [],
  7278. "alternates": []
  7279. },
  7280. "Ext.data.ArrayStore": {
  7281. "idx": 181,
  7282. "alias": [
  7283. "store.array"
  7284. ],
  7285. "alternates": [
  7286. "Ext.data.SimpleStore"
  7287. ]
  7288. },
  7289. "Ext.data.Batch": {
  7290. "idx": 191,
  7291. "alias": [],
  7292. "alternates": []
  7293. },
  7294. "Ext.data.BufferedStore": {
  7295. "idx": 228,
  7296. "alias": [
  7297. "store.buffered"
  7298. ],
  7299. "alternates": []
  7300. },
  7301. "Ext.data.ChainedStore": {
  7302. "idx": 221,
  7303. "alias": [
  7304. "store.chained"
  7305. ],
  7306. "alternates": []
  7307. },
  7308. "Ext.data.ClientStore": {
  7309. "idx": 229,
  7310. "alias": [
  7311. "store.clientstorage"
  7312. ],
  7313. "alternates": []
  7314. },
  7315. "Ext.data.Connection": {
  7316. "idx": 17,
  7317. "alias": [],
  7318. "alternates": []
  7319. },
  7320. "Ext.data.DirectStore": {
  7321. "idx": 231,
  7322. "alias": [
  7323. "store.direct"
  7324. ],
  7325. "alternates": []
  7326. },
  7327. "Ext.data.Error": {
  7328. "idx": 144,
  7329. "alias": [],
  7330. "alternates": []
  7331. },
  7332. "Ext.data.ErrorCollection": {
  7333. "idx": 145,
  7334. "alias": [],
  7335. "alternates": [
  7336. "Ext.data.Errors"
  7337. ]
  7338. },
  7339. "Ext.data.Group": {
  7340. "idx": 170,
  7341. "alias": [],
  7342. "alternates": []
  7343. },
  7344. "Ext.data.JsonP": {
  7345. "idx": 232,
  7346. "alias": [],
  7347. "alternates": []
  7348. },
  7349. "Ext.data.JsonPStore": {
  7350. "idx": 234,
  7351. "alias": [
  7352. "store.jsonp"
  7353. ],
  7354. "alternates": []
  7355. },
  7356. "Ext.data.JsonStore": {
  7357. "idx": 235,
  7358. "alias": [
  7359. "store.json"
  7360. ],
  7361. "alternates": []
  7362. },
  7363. "Ext.data.LocalStore": {
  7364. "idx": 171,
  7365. "alias": [],
  7366. "alternates": []
  7367. },
  7368. "Ext.data.Model": {
  7369. "idx": 161,
  7370. "alias": [],
  7371. "alternates": [
  7372. "Ext.data.Record"
  7373. ]
  7374. },
  7375. "Ext.data.ModelManager": {
  7376. "idx": 236,
  7377. "alias": [],
  7378. "alternates": [
  7379. "Ext.ModelMgr"
  7380. ]
  7381. },
  7382. "Ext.data.NodeInterface": {
  7383. "idx": 237,
  7384. "alias": [],
  7385. "alternates": []
  7386. },
  7387. "Ext.data.NodeStore": {
  7388. "idx": 240,
  7389. "alias": [
  7390. "store.node"
  7391. ],
  7392. "alternates": []
  7393. },
  7394. "Ext.data.PageMap": {
  7395. "idx": 227,
  7396. "alias": [],
  7397. "alternates": []
  7398. },
  7399. "Ext.data.ProxyStore": {
  7400. "idx": 168,
  7401. "alias": [],
  7402. "alternates": []
  7403. },
  7404. "Ext.data.Query": {
  7405. "idx": 245,
  7406. "alias": [
  7407. "query.default"
  7408. ],
  7409. "alternates": []
  7410. },
  7411. "Ext.data.Range": {
  7412. "idx": 133,
  7413. "alias": [],
  7414. "alternates": []
  7415. },
  7416. "Ext.data.Request": {
  7417. "idx": 246,
  7418. "alias": [],
  7419. "alternates": []
  7420. },
  7421. "Ext.data.ResultSet": {
  7422. "idx": 162,
  7423. "alias": [],
  7424. "alternates": []
  7425. },
  7426. "Ext.data.Session": {
  7427. "idx": 199,
  7428. "alias": [],
  7429. "alternates": []
  7430. },
  7431. "Ext.data.SortTypes": {
  7432. "idx": 151,
  7433. "alias": [],
  7434. "alternates": []
  7435. },
  7436. "Ext.data.Store": {
  7437. "idx": 179,
  7438. "alias": [
  7439. "store.store"
  7440. ],
  7441. "alternates": []
  7442. },
  7443. "Ext.data.StoreManager": {
  7444. "idx": 182,
  7445. "alias": [],
  7446. "alternates": [
  7447. "Ext.StoreMgr",
  7448. "Ext.data.StoreMgr",
  7449. "Ext.StoreManager"
  7450. ]
  7451. },
  7452. "Ext.data.TreeModel": {
  7453. "idx": 239,
  7454. "alias": [],
  7455. "alternates": []
  7456. },
  7457. "Ext.data.TreeStore": {
  7458. "idx": 247,
  7459. "alias": [
  7460. "store.tree"
  7461. ],
  7462. "alternates": []
  7463. },
  7464. "Ext.data.Types": {
  7465. "idx": 248,
  7466. "alias": [],
  7467. "alternates": []
  7468. },
  7469. "Ext.data.Validation": {
  7470. "idx": 249,
  7471. "alias": [],
  7472. "alternates": []
  7473. },
  7474. "Ext.data.XmlStore": {
  7475. "idx": 254,
  7476. "alias": [
  7477. "store.xml"
  7478. ],
  7479. "alternates": []
  7480. },
  7481. "Ext.data.field.Boolean": {
  7482. "idx": 154,
  7483. "alias": [
  7484. "data.field.bool",
  7485. "data.field.boolean"
  7486. ],
  7487. "alternates": []
  7488. },
  7489. "Ext.data.field.Date": {
  7490. "idx": 155,
  7491. "alias": [
  7492. "data.field.date"
  7493. ],
  7494. "alternates": []
  7495. },
  7496. "Ext.data.field.Field": {
  7497. "idx": 153,
  7498. "alias": [
  7499. "data.field.auto"
  7500. ],
  7501. "alternates": [
  7502. "Ext.data.Field"
  7503. ]
  7504. },
  7505. "Ext.data.field.Integer": {
  7506. "idx": 156,
  7507. "alias": [
  7508. "data.field.int",
  7509. "data.field.integer"
  7510. ],
  7511. "alternates": []
  7512. },
  7513. "Ext.data.field.Number": {
  7514. "idx": 157,
  7515. "alias": [
  7516. "data.field.float",
  7517. "data.field.number"
  7518. ],
  7519. "alternates": []
  7520. },
  7521. "Ext.data.field.String": {
  7522. "idx": 158,
  7523. "alias": [
  7524. "data.field.string"
  7525. ],
  7526. "alternates": []
  7527. },
  7528. "Ext.data.flash.BinaryXhr": {
  7529. "idx": 14,
  7530. "alias": [],
  7531. "alternates": []
  7532. },
  7533. "Ext.data.identifier.Generator": {
  7534. "idx": 159,
  7535. "alias": [
  7536. "data.identifier.default"
  7537. ],
  7538. "alternates": []
  7539. },
  7540. "Ext.data.identifier.Negative": {
  7541. "idx": 255,
  7542. "alias": [
  7543. "data.identifier.negative"
  7544. ],
  7545. "alternates": []
  7546. },
  7547. "Ext.data.identifier.Sequential": {
  7548. "idx": 160,
  7549. "alias": [
  7550. "data.identifier.sequential"
  7551. ],
  7552. "alternates": []
  7553. },
  7554. "Ext.data.identifier.Uuid": {
  7555. "idx": 256,
  7556. "alias": [
  7557. "data.identifier.uuid"
  7558. ],
  7559. "alternates": []
  7560. },
  7561. "Ext.data.matrix.Matrix": {
  7562. "idx": 194,
  7563. "alias": [],
  7564. "alternates": []
  7565. },
  7566. "Ext.data.matrix.Side": {
  7567. "idx": 193,
  7568. "alias": [],
  7569. "alternates": []
  7570. },
  7571. "Ext.data.matrix.Slice": {
  7572. "idx": 192,
  7573. "alias": [],
  7574. "alternates": []
  7575. },
  7576. "Ext.data.operation.Create": {
  7577. "idx": 147,
  7578. "alias": [
  7579. "data.operation.create"
  7580. ],
  7581. "alternates": []
  7582. },
  7583. "Ext.data.operation.Destroy": {
  7584. "idx": 148,
  7585. "alias": [
  7586. "data.operation.destroy"
  7587. ],
  7588. "alternates": []
  7589. },
  7590. "Ext.data.operation.Operation": {
  7591. "idx": 146,
  7592. "alias": [],
  7593. "alternates": [
  7594. "Ext.data.Operation"
  7595. ]
  7596. },
  7597. "Ext.data.operation.Read": {
  7598. "idx": 149,
  7599. "alias": [
  7600. "data.operation.read"
  7601. ],
  7602. "alternates": []
  7603. },
  7604. "Ext.data.operation.Update": {
  7605. "idx": 150,
  7606. "alias": [
  7607. "data.operation.update"
  7608. ],
  7609. "alternates": []
  7610. },
  7611. "Ext.data.proxy.Ajax": {
  7612. "idx": 173,
  7613. "alias": [
  7614. "proxy.ajax"
  7615. ],
  7616. "alternates": [
  7617. "Ext.data.HttpProxy",
  7618. "Ext.data.AjaxProxy"
  7619. ]
  7620. },
  7621. "Ext.data.proxy.Client": {
  7622. "idx": 166,
  7623. "alias": [],
  7624. "alternates": [
  7625. "Ext.data.ClientProxy"
  7626. ]
  7627. },
  7628. "Ext.data.proxy.Direct": {
  7629. "idx": 230,
  7630. "alias": [
  7631. "proxy.direct"
  7632. ],
  7633. "alternates": [
  7634. "Ext.data.DirectProxy"
  7635. ]
  7636. },
  7637. "Ext.data.proxy.JsonP": {
  7638. "idx": 233,
  7639. "alias": [
  7640. "proxy.jsonp",
  7641. "proxy.scripttag"
  7642. ],
  7643. "alternates": [
  7644. "Ext.data.ScriptTagProxy"
  7645. ]
  7646. },
  7647. "Ext.data.proxy.LocalStorage": {
  7648. "idx": 258,
  7649. "alias": [
  7650. "proxy.localstorage"
  7651. ],
  7652. "alternates": [
  7653. "Ext.data.LocalStorageProxy"
  7654. ]
  7655. },
  7656. "Ext.data.proxy.Memory": {
  7657. "idx": 167,
  7658. "alias": [
  7659. "proxy.memory"
  7660. ],
  7661. "alternates": [
  7662. "Ext.data.MemoryProxy"
  7663. ]
  7664. },
  7665. "Ext.data.proxy.Proxy": {
  7666. "idx": 165,
  7667. "alias": [
  7668. "proxy.proxy"
  7669. ],
  7670. "alternates": [
  7671. "Ext.data.DataProxy",
  7672. "Ext.data.Proxy"
  7673. ]
  7674. },
  7675. "Ext.data.proxy.Rest": {
  7676. "idx": 259,
  7677. "alias": [
  7678. "proxy.rest"
  7679. ],
  7680. "alternates": [
  7681. "Ext.data.RestProxy"
  7682. ]
  7683. },
  7684. "Ext.data.proxy.Server": {
  7685. "idx": 172,
  7686. "alias": [
  7687. "proxy.server"
  7688. ],
  7689. "alternates": [
  7690. "Ext.data.ServerProxy"
  7691. ]
  7692. },
  7693. "Ext.data.proxy.SessionStorage": {
  7694. "idx": 260,
  7695. "alias": [
  7696. "proxy.sessionstorage"
  7697. ],
  7698. "alternates": [
  7699. "Ext.data.SessionStorageProxy"
  7700. ]
  7701. },
  7702. "Ext.data.proxy.WebStorage": {
  7703. "idx": 257,
  7704. "alias": [],
  7705. "alternates": [
  7706. "Ext.data.WebStorageProxy"
  7707. ]
  7708. },
  7709. "Ext.data.query.Compiler": {
  7710. "idx": 241,
  7711. "alias": [],
  7712. "alternates": []
  7713. },
  7714. "Ext.data.query.Converter": {
  7715. "idx": 242,
  7716. "alias": [],
  7717. "alternates": []
  7718. },
  7719. "Ext.data.query.Parser": {
  7720. "idx": 244,
  7721. "alias": [],
  7722. "alternates": []
  7723. },
  7724. "Ext.data.query.Stringifier": {
  7725. "idx": 243,
  7726. "alias": [],
  7727. "alternates": []
  7728. },
  7729. "Ext.data.reader.Array": {
  7730. "idx": 180,
  7731. "alias": [
  7732. "reader.array"
  7733. ],
  7734. "alternates": [
  7735. "Ext.data.ArrayReader"
  7736. ]
  7737. },
  7738. "Ext.data.reader.Json": {
  7739. "idx": 174,
  7740. "alias": [
  7741. "reader.json"
  7742. ],
  7743. "alternates": [
  7744. "Ext.data.JsonReader"
  7745. ]
  7746. },
  7747. "Ext.data.reader.Reader": {
  7748. "idx": 163,
  7749. "alias": [
  7750. "reader.base"
  7751. ],
  7752. "alternates": [
  7753. "Ext.data.Reader",
  7754. "Ext.data.DataReader"
  7755. ]
  7756. },
  7757. "Ext.data.reader.Xml": {
  7758. "idx": 252,
  7759. "alias": [
  7760. "reader.xml"
  7761. ],
  7762. "alternates": [
  7763. "Ext.data.XmlReader"
  7764. ]
  7765. },
  7766. "Ext.data.request.Ajax": {
  7767. "idx": 15,
  7768. "alias": [
  7769. "request.ajax"
  7770. ],
  7771. "alternates": []
  7772. },
  7773. "Ext.data.request.Base": {
  7774. "idx": 13,
  7775. "alias": [],
  7776. "alternates": []
  7777. },
  7778. "Ext.data.request.Form": {
  7779. "idx": 16,
  7780. "alias": [
  7781. "request.form"
  7782. ],
  7783. "alternates": []
  7784. },
  7785. "Ext.data.schema.Association": {
  7786. "idx": 136,
  7787. "alias": [],
  7788. "alternates": []
  7789. },
  7790. "Ext.data.schema.ManyToMany": {
  7791. "idx": 139,
  7792. "alias": [],
  7793. "alternates": []
  7794. },
  7795. "Ext.data.schema.ManyToOne": {
  7796. "idx": 138,
  7797. "alias": [],
  7798. "alternates": []
  7799. },
  7800. "Ext.data.schema.Namer": {
  7801. "idx": 141,
  7802. "alias": [
  7803. "namer.default"
  7804. ],
  7805. "alternates": []
  7806. },
  7807. "Ext.data.schema.OneToOne": {
  7808. "idx": 137,
  7809. "alias": [],
  7810. "alternates": []
  7811. },
  7812. "Ext.data.schema.Role": {
  7813. "idx": 135,
  7814. "alias": [],
  7815. "alternates": []
  7816. },
  7817. "Ext.data.schema.Schema": {
  7818. "idx": 142,
  7819. "alias": [
  7820. "schema.default"
  7821. ],
  7822. "alternates": []
  7823. },
  7824. "Ext.data.session.BatchVisitor": {
  7825. "idx": 197,
  7826. "alias": [],
  7827. "alternates": []
  7828. },
  7829. "Ext.data.session.ChangesVisitor": {
  7830. "idx": 195,
  7831. "alias": [],
  7832. "alternates": []
  7833. },
  7834. "Ext.data.session.ChildChangesVisitor": {
  7835. "idx": 196,
  7836. "alias": [],
  7837. "alternates": []
  7838. },
  7839. "Ext.data.summary.Average": {
  7840. "idx": 267,
  7841. "alias": [
  7842. "data.summary.average"
  7843. ],
  7844. "alternates": []
  7845. },
  7846. "Ext.data.summary.Base": {
  7847. "idx": 265,
  7848. "alias": [
  7849. "data.summary.base"
  7850. ],
  7851. "alternates": []
  7852. },
  7853. "Ext.data.summary.Count": {
  7854. "idx": 268,
  7855. "alias": [
  7856. "data.summary.count"
  7857. ],
  7858. "alternates": []
  7859. },
  7860. "Ext.data.summary.Max": {
  7861. "idx": 269,
  7862. "alias": [
  7863. "data.summary.max"
  7864. ],
  7865. "alternates": []
  7866. },
  7867. "Ext.data.summary.Min": {
  7868. "idx": 270,
  7869. "alias": [
  7870. "data.summary.min"
  7871. ],
  7872. "alternates": []
  7873. },
  7874. "Ext.data.summary.None": {
  7875. "idx": 271,
  7876. "alias": [
  7877. "data.summary.none"
  7878. ],
  7879. "alternates": []
  7880. },
  7881. "Ext.data.summary.Sum": {
  7882. "idx": 266,
  7883. "alias": [
  7884. "data.summary.sum"
  7885. ],
  7886. "alternates": []
  7887. },
  7888. "Ext.data.validator.AbstractDate": {
  7889. "idx": 272,
  7890. "alias": [],
  7891. "alternates": []
  7892. },
  7893. "Ext.data.validator.Bound": {
  7894. "idx": 273,
  7895. "alias": [
  7896. "data.validator.bound"
  7897. ],
  7898. "alternates": []
  7899. },
  7900. "Ext.data.validator.CIDRv4": {
  7901. "idx": 275,
  7902. "alias": [
  7903. "data.validator.cidrv4"
  7904. ],
  7905. "alternates": []
  7906. },
  7907. "Ext.data.validator.CIDRv6": {
  7908. "idx": 276,
  7909. "alias": [
  7910. "data.validator.cidrv6"
  7911. ],
  7912. "alternates": []
  7913. },
  7914. "Ext.data.validator.Currency": {
  7915. "idx": 278,
  7916. "alias": [
  7917. "data.validator.currency"
  7918. ],
  7919. "alternates": []
  7920. },
  7921. "Ext.data.validator.CurrencyUS": {
  7922. "idx": 279,
  7923. "alias": [
  7924. "data.validator.currency-us"
  7925. ],
  7926. "alternates": []
  7927. },
  7928. "Ext.data.validator.Date": {
  7929. "idx": 280,
  7930. "alias": [
  7931. "data.validator.date"
  7932. ],
  7933. "alternates": []
  7934. },
  7935. "Ext.data.validator.DateTime": {
  7936. "idx": 281,
  7937. "alias": [
  7938. "data.validator.datetime"
  7939. ],
  7940. "alternates": []
  7941. },
  7942. "Ext.data.validator.Email": {
  7943. "idx": 282,
  7944. "alias": [
  7945. "data.validator.email"
  7946. ],
  7947. "alternates": []
  7948. },
  7949. "Ext.data.validator.Exclusion": {
  7950. "idx": 284,
  7951. "alias": [
  7952. "data.validator.exclusion"
  7953. ],
  7954. "alternates": []
  7955. },
  7956. "Ext.data.validator.Format": {
  7957. "idx": 274,
  7958. "alias": [
  7959. "data.validator.format"
  7960. ],
  7961. "alternates": []
  7962. },
  7963. "Ext.data.validator.IPAddress": {
  7964. "idx": 285,
  7965. "alias": [
  7966. "data.validator.ipaddress"
  7967. ],
  7968. "alternates": []
  7969. },
  7970. "Ext.data.validator.Inclusion": {
  7971. "idx": 286,
  7972. "alias": [
  7973. "data.validator.inclusion"
  7974. ],
  7975. "alternates": []
  7976. },
  7977. "Ext.data.validator.Length": {
  7978. "idx": 287,
  7979. "alias": [
  7980. "data.validator.length"
  7981. ],
  7982. "alternates": []
  7983. },
  7984. "Ext.data.validator.List": {
  7985. "idx": 283,
  7986. "alias": [
  7987. "data.validator.list"
  7988. ],
  7989. "alternates": []
  7990. },
  7991. "Ext.data.validator.NotNull": {
  7992. "idx": 289,
  7993. "alias": [
  7994. "data.validator.notnull"
  7995. ],
  7996. "alternates": []
  7997. },
  7998. "Ext.data.validator.Number": {
  7999. "idx": 277,
  8000. "alias": [
  8001. "data.validator.number"
  8002. ],
  8003. "alternates": []
  8004. },
  8005. "Ext.data.validator.Phone": {
  8006. "idx": 290,
  8007. "alias": [
  8008. "data.validator.phone"
  8009. ],
  8010. "alternates": []
  8011. },
  8012. "Ext.data.validator.Presence": {
  8013. "idx": 288,
  8014. "alias": [
  8015. "data.validator.presence"
  8016. ],
  8017. "alternates": []
  8018. },
  8019. "Ext.data.validator.Range": {
  8020. "idx": 291,
  8021. "alias": [
  8022. "data.validator.range"
  8023. ],
  8024. "alternates": []
  8025. },
  8026. "Ext.data.validator.Time": {
  8027. "idx": 292,
  8028. "alias": [
  8029. "data.validator.time"
  8030. ],
  8031. "alternates": []
  8032. },
  8033. "Ext.data.validator.Url": {
  8034. "idx": 293,
  8035. "alias": [
  8036. "data.validator.url"
  8037. ],
  8038. "alternates": []
  8039. },
  8040. "Ext.data.validator.Validator": {
  8041. "idx": 152,
  8042. "alias": [
  8043. "data.validator.base"
  8044. ],
  8045. "alternates": []
  8046. },
  8047. "Ext.data.virtual.Group": {
  8048. "idx": 294,
  8049. "alias": [],
  8050. "alternates": []
  8051. },
  8052. "Ext.data.virtual.Page": {
  8053. "idx": 295,
  8054. "alias": [],
  8055. "alternates": []
  8056. },
  8057. "Ext.data.virtual.PageMap": {
  8058. "idx": 296,
  8059. "alias": [],
  8060. "alternates": []
  8061. },
  8062. "Ext.data.virtual.Range": {
  8063. "idx": 297,
  8064. "alias": [],
  8065. "alternates": []
  8066. },
  8067. "Ext.data.virtual.Store": {
  8068. "idx": 298,
  8069. "alias": [
  8070. "store.virtual"
  8071. ],
  8072. "alternates": []
  8073. },
  8074. "Ext.data.writer.Json": {
  8075. "idx": 175,
  8076. "alias": [
  8077. "writer.json"
  8078. ],
  8079. "alternates": [
  8080. "Ext.data.JsonWriter"
  8081. ]
  8082. },
  8083. "Ext.data.writer.Writer": {
  8084. "idx": 164,
  8085. "alias": [
  8086. "writer.base"
  8087. ],
  8088. "alternates": [
  8089. "Ext.data.DataWriter",
  8090. "Ext.data.Writer"
  8091. ]
  8092. },
  8093. "Ext.data.writer.Xml": {
  8094. "idx": 253,
  8095. "alias": [
  8096. "writer.xml"
  8097. ],
  8098. "alternates": [
  8099. "Ext.data.XmlWriter"
  8100. ]
  8101. },
  8102. "Ext.dd.DD": {
  8103. "idx": 447,
  8104. "alias": [],
  8105. "alternates": []
  8106. },
  8107. "Ext.dd.DDProxy": {
  8108. "idx": 448,
  8109. "alias": [],
  8110. "alternates": []
  8111. },
  8112. "Ext.dd.DDTarget": {
  8113. "idx": 471,
  8114. "alias": [],
  8115. "alternates": []
  8116. },
  8117. "Ext.dd.DragDrop": {
  8118. "idx": 446,
  8119. "alias": [],
  8120. "alternates": []
  8121. },
  8122. "Ext.dd.DragDropManager": {
  8123. "idx": 440,
  8124. "alias": [],
  8125. "alternates": [
  8126. "Ext.dd.DragDropMgr",
  8127. "Ext.dd.DDM"
  8128. ]
  8129. },
  8130. "Ext.dd.DragSource": {
  8131. "idx": 450,
  8132. "alias": [],
  8133. "alternates": []
  8134. },
  8135. "Ext.dd.DragTracker": {
  8136. "idx": 466,
  8137. "alias": [],
  8138. "alternates": []
  8139. },
  8140. "Ext.dd.DragZone": {
  8141. "idx": 477,
  8142. "alias": [],
  8143. "alternates": []
  8144. },
  8145. "Ext.dd.DropTarget": {
  8146. "idx": 473,
  8147. "alias": [],
  8148. "alternates": []
  8149. },
  8150. "Ext.dd.DropZone": {
  8151. "idx": 479,
  8152. "alias": [],
  8153. "alternates": []
  8154. },
  8155. "Ext.dd.Registry": {
  8156. "idx": 478,
  8157. "alias": [],
  8158. "alternates": []
  8159. },
  8160. "Ext.dd.ScrollManager": {
  8161. "idx": 472,
  8162. "alias": [],
  8163. "alternates": []
  8164. },
  8165. "Ext.dd.StatusProxy": {
  8166. "idx": 449,
  8167. "alias": [],
  8168. "alternates": []
  8169. },
  8170. "Ext.direct.Event": {
  8171. "idx": 299,
  8172. "alias": [
  8173. "direct.event"
  8174. ],
  8175. "alternates": []
  8176. },
  8177. "Ext.direct.ExceptionEvent": {
  8178. "idx": 301,
  8179. "alias": [
  8180. "direct.exception"
  8181. ],
  8182. "alternates": []
  8183. },
  8184. "Ext.direct.JsonProvider": {
  8185. "idx": 302,
  8186. "alias": [
  8187. "direct.jsonprovider"
  8188. ],
  8189. "alternates": []
  8190. },
  8191. "Ext.direct.Manager": {
  8192. "idx": 224,
  8193. "alias": [],
  8194. "alternates": []
  8195. },
  8196. "Ext.direct.PollingProvider": {
  8197. "idx": 303,
  8198. "alias": [
  8199. "direct.pollingprovider"
  8200. ],
  8201. "alternates": []
  8202. },
  8203. "Ext.direct.Provider": {
  8204. "idx": 225,
  8205. "alias": [
  8206. "direct.provider"
  8207. ],
  8208. "alternates": []
  8209. },
  8210. "Ext.direct.RemotingEvent": {
  8211. "idx": 300,
  8212. "alias": [
  8213. "direct.rpc"
  8214. ],
  8215. "alternates": []
  8216. },
  8217. "Ext.direct.RemotingMethod": {
  8218. "idx": 304,
  8219. "alias": [],
  8220. "alternates": []
  8221. },
  8222. "Ext.direct.RemotingProvider": {
  8223. "idx": 306,
  8224. "alias": [
  8225. "direct.remotingprovider"
  8226. ],
  8227. "alternates": []
  8228. },
  8229. "Ext.direct.Transaction": {
  8230. "idx": 305,
  8231. "alias": [
  8232. "direct.transaction"
  8233. ],
  8234. "alternates": []
  8235. },
  8236. "Ext.dom.ButtonElement": {
  8237. "idx": 426,
  8238. "alias": [],
  8239. "alternates": []
  8240. },
  8241. "Ext.dom.CompositeElement": {
  8242. "idx": 102,
  8243. "alias": [],
  8244. "alternates": [
  8245. "Ext.CompositeElement"
  8246. ]
  8247. },
  8248. "Ext.dom.CompositeElementLite": {
  8249. "idx": 76,
  8250. "alias": [],
  8251. "alternates": [
  8252. "Ext.CompositeElementLite"
  8253. ]
  8254. },
  8255. "Ext.dom.Element": {
  8256. "idx": 49,
  8257. "alias": [],
  8258. "alternates": [
  8259. "Ext.Element"
  8260. ]
  8261. },
  8262. "Ext.dom.ElementEvent": {
  8263. "idx": 31,
  8264. "alias": [],
  8265. "alternates": []
  8266. },
  8267. "Ext.dom.Fly": {
  8268. "idx": 75,
  8269. "alias": [],
  8270. "alternates": [
  8271. "Ext.dom.Element.Fly"
  8272. ]
  8273. },
  8274. "Ext.dom.GarbageCollector": {
  8275. "idx": 307,
  8276. "alias": [],
  8277. "alternates": []
  8278. },
  8279. "Ext.dom.Helper": {
  8280. "idx": 250,
  8281. "alias": [],
  8282. "alternates": [
  8283. "Ext.DomHelper",
  8284. "Ext.core.DomHelper"
  8285. ]
  8286. },
  8287. "Ext.dom.Layer": {
  8288. "idx": 480,
  8289. "alias": [],
  8290. "alternates": [
  8291. "Ext.Layer"
  8292. ]
  8293. },
  8294. "Ext.dom.Query": {
  8295. "idx": 251,
  8296. "alias": [],
  8297. "alternates": [
  8298. "Ext.core.DomQuery",
  8299. "Ext.DomQuery"
  8300. ]
  8301. },
  8302. "Ext.dom.Shadow": {
  8303. "idx": 29,
  8304. "alias": [],
  8305. "alternates": [
  8306. "Ext.Shadow"
  8307. ]
  8308. },
  8309. "Ext.dom.Shim": {
  8310. "idx": 30,
  8311. "alias": [],
  8312. "alternates": []
  8313. },
  8314. "Ext.dom.TouchAction": {
  8315. "idx": 308,
  8316. "alias": [],
  8317. "alternates": []
  8318. },
  8319. "Ext.dom.Underlay": {
  8320. "idx": 28,
  8321. "alias": [],
  8322. "alternates": []
  8323. },
  8324. "Ext.dom.UnderlayPool": {
  8325. "idx": 27,
  8326. "alias": [],
  8327. "alternates": []
  8328. },
  8329. "Ext.drag.Constraint": {
  8330. "idx": 309,
  8331. "alias": [
  8332. "drag.constraint.base"
  8333. ],
  8334. "alternates": []
  8335. },
  8336. "Ext.drag.Info": {
  8337. "idx": 310,
  8338. "alias": [],
  8339. "alternates": []
  8340. },
  8341. "Ext.drag.Item": {
  8342. "idx": 311,
  8343. "alias": [],
  8344. "alternates": []
  8345. },
  8346. "Ext.drag.Manager": {
  8347. "idx": 312,
  8348. "alias": [],
  8349. "alternates": []
  8350. },
  8351. "Ext.drag.Source": {
  8352. "idx": 313,
  8353. "alias": [],
  8354. "alternates": []
  8355. },
  8356. "Ext.drag.Target": {
  8357. "idx": 314,
  8358. "alias": [],
  8359. "alternates": []
  8360. },
  8361. "Ext.drag.proxy.None": {
  8362. "idx": 315,
  8363. "alias": [
  8364. "drag.proxy.none"
  8365. ],
  8366. "alternates": []
  8367. },
  8368. "Ext.drag.proxy.Original": {
  8369. "idx": 316,
  8370. "alias": [
  8371. "drag.proxy.original"
  8372. ],
  8373. "alternates": []
  8374. },
  8375. "Ext.drag.proxy.Placeholder": {
  8376. "idx": 317,
  8377. "alias": [
  8378. "drag.proxy.placeholder"
  8379. ],
  8380. "alternates": []
  8381. },
  8382. "Ext.event.Event": {
  8383. "idx": 36,
  8384. "alias": [],
  8385. "alternates": [
  8386. "Ext.EventObjectImpl"
  8387. ]
  8388. },
  8389. "Ext.event.gesture.DoubleTap": {
  8390. "idx": 320,
  8391. "alias": [],
  8392. "alternates": []
  8393. },
  8394. "Ext.event.gesture.Drag": {
  8395. "idx": 321,
  8396. "alias": [],
  8397. "alternates": []
  8398. },
  8399. "Ext.event.gesture.EdgeSwipe": {
  8400. "idx": 323,
  8401. "alias": [],
  8402. "alternates": []
  8403. },
  8404. "Ext.event.gesture.LongPress": {
  8405. "idx": 324,
  8406. "alias": [],
  8407. "alternates": []
  8408. },
  8409. "Ext.event.gesture.MultiTouch": {
  8410. "idx": 325,
  8411. "alias": [],
  8412. "alternates": []
  8413. },
  8414. "Ext.event.gesture.Pinch": {
  8415. "idx": 326,
  8416. "alias": [],
  8417. "alternates": []
  8418. },
  8419. "Ext.event.gesture.Recognizer": {
  8420. "idx": 318,
  8421. "alias": [],
  8422. "alternates": []
  8423. },
  8424. "Ext.event.gesture.Rotate": {
  8425. "idx": 327,
  8426. "alias": [],
  8427. "alternates": []
  8428. },
  8429. "Ext.event.gesture.SingleTouch": {
  8430. "idx": 319,
  8431. "alias": [],
  8432. "alternates": []
  8433. },
  8434. "Ext.event.gesture.Swipe": {
  8435. "idx": 322,
  8436. "alias": [],
  8437. "alternates": []
  8438. },
  8439. "Ext.event.gesture.Tap": {
  8440. "idx": 328,
  8441. "alias": [],
  8442. "alternates": []
  8443. },
  8444. "Ext.event.publisher.Dom": {
  8445. "idx": 37,
  8446. "alias": [],
  8447. "alternates": []
  8448. },
  8449. "Ext.event.publisher.ElementPaint": {
  8450. "idx": 48,
  8451. "alias": [],
  8452. "alternates": []
  8453. },
  8454. "Ext.event.publisher.ElementSize": {
  8455. "idx": 44,
  8456. "alias": [],
  8457. "alternates": []
  8458. },
  8459. "Ext.event.publisher.Focus": {
  8460. "idx": 329,
  8461. "alias": [],
  8462. "alternates": []
  8463. },
  8464. "Ext.event.publisher.Gesture": {
  8465. "idx": 38,
  8466. "alias": [],
  8467. "alternates": []
  8468. },
  8469. "Ext.event.publisher.MouseEnterLeave": {
  8470. "idx": 482,
  8471. "alias": [],
  8472. "alternates": []
  8473. },
  8474. "Ext.event.publisher.Publisher": {
  8475. "idx": 32,
  8476. "alias": [],
  8477. "alternates": []
  8478. },
  8479. "Ext.field.InputMask": {
  8480. "idx": 330,
  8481. "alias": [],
  8482. "alternates": []
  8483. },
  8484. "Ext.flash.Component": {
  8485. "idx": 483,
  8486. "alias": [
  8487. "widget.flash"
  8488. ],
  8489. "alternates": [
  8490. "Ext.FlashComponent"
  8491. ]
  8492. },
  8493. "Ext.form.Basic": {
  8494. "idx": 499,
  8495. "alias": [],
  8496. "alternates": [
  8497. "Ext.form.BasicForm"
  8498. ]
  8499. },
  8500. "Ext.form.CheckboxGroup": {
  8501. "idx": 506,
  8502. "alias": [
  8503. "widget.checkboxgroup"
  8504. ],
  8505. "alternates": []
  8506. },
  8507. "Ext.form.CheckboxManager": {
  8508. "idx": 504,
  8509. "alias": [],
  8510. "alternates": []
  8511. },
  8512. "Ext.form.FieldAncestor": {
  8513. "idx": 501,
  8514. "alias": [],
  8515. "alternates": []
  8516. },
  8517. "Ext.form.FieldContainer": {
  8518. "idx": 502,
  8519. "alias": [
  8520. "widget.fieldcontainer"
  8521. ],
  8522. "alternates": []
  8523. },
  8524. "Ext.form.FieldSet": {
  8525. "idx": 507,
  8526. "alias": [
  8527. "widget.fieldset"
  8528. ],
  8529. "alternates": []
  8530. },
  8531. "Ext.form.Label": {
  8532. "idx": 508,
  8533. "alias": [
  8534. "widget.label"
  8535. ],
  8536. "alternates": []
  8537. },
  8538. "Ext.form.Labelable": {
  8539. "idx": 490,
  8540. "alias": [],
  8541. "alternates": []
  8542. },
  8543. "Ext.form.Panel": {
  8544. "idx": 509,
  8545. "alias": [
  8546. "widget.form"
  8547. ],
  8548. "alternates": [
  8549. "Ext.FormPanel",
  8550. "Ext.form.FormPanel"
  8551. ]
  8552. },
  8553. "Ext.form.RadioGroup": {
  8554. "idx": 512,
  8555. "alias": [
  8556. "widget.radiogroup"
  8557. ],
  8558. "alternates": []
  8559. },
  8560. "Ext.form.RadioManager": {
  8561. "idx": 510,
  8562. "alias": [],
  8563. "alternates": []
  8564. },
  8565. "Ext.form.action.Action": {
  8566. "idx": 484,
  8567. "alias": [],
  8568. "alternates": [
  8569. "Ext.form.Action"
  8570. ]
  8571. },
  8572. "Ext.form.action.DirectAction": {
  8573. "idx": 513,
  8574. "alias": [],
  8575. "alternates": []
  8576. },
  8577. "Ext.form.action.DirectLoad": {
  8578. "idx": 514,
  8579. "alias": [
  8580. "formaction.directload"
  8581. ],
  8582. "alternates": [
  8583. "Ext.form.Action.DirectLoad"
  8584. ]
  8585. },
  8586. "Ext.form.action.DirectSubmit": {
  8587. "idx": 515,
  8588. "alias": [
  8589. "formaction.directsubmit"
  8590. ],
  8591. "alternates": [
  8592. "Ext.form.Action.DirectSubmit"
  8593. ]
  8594. },
  8595. "Ext.form.action.Load": {
  8596. "idx": 485,
  8597. "alias": [
  8598. "formaction.load"
  8599. ],
  8600. "alternates": [
  8601. "Ext.form.Action.Load"
  8602. ]
  8603. },
  8604. "Ext.form.action.StandardSubmit": {
  8605. "idx": 487,
  8606. "alias": [
  8607. "formaction.standardsubmit"
  8608. ],
  8609. "alternates": []
  8610. },
  8611. "Ext.form.action.Submit": {
  8612. "idx": 486,
  8613. "alias": [
  8614. "formaction.submit"
  8615. ],
  8616. "alternates": [
  8617. "Ext.form.Action.Submit"
  8618. ]
  8619. },
  8620. "Ext.form.field.Base": {
  8621. "idx": 492,
  8622. "alias": [
  8623. "widget.field"
  8624. ],
  8625. "alternates": [
  8626. "Ext.form.Field",
  8627. "Ext.form.BaseField"
  8628. ]
  8629. },
  8630. "Ext.form.field.Checkbox": {
  8631. "idx": 505,
  8632. "alias": [
  8633. "widget.checkbox",
  8634. "widget.checkboxfield"
  8635. ],
  8636. "alternates": [
  8637. "Ext.form.Checkbox"
  8638. ]
  8639. },
  8640. "Ext.form.field.ComboBox": {
  8641. "idx": 531,
  8642. "alias": [
  8643. "widget.combo",
  8644. "widget.combobox"
  8645. ],
  8646. "alternates": [
  8647. "Ext.form.ComboBox"
  8648. ]
  8649. },
  8650. "Ext.form.field.Date": {
  8651. "idx": 534,
  8652. "alias": [
  8653. "widget.datefield"
  8654. ],
  8655. "alternates": [
  8656. "Ext.form.DateField",
  8657. "Ext.form.Date"
  8658. ]
  8659. },
  8660. "Ext.form.field.Display": {
  8661. "idx": 535,
  8662. "alias": [
  8663. "widget.displayfield"
  8664. ],
  8665. "alternates": [
  8666. "Ext.form.DisplayField",
  8667. "Ext.form.Display"
  8668. ]
  8669. },
  8670. "Ext.form.field.Field": {
  8671. "idx": 491,
  8672. "alias": [],
  8673. "alternates": []
  8674. },
  8675. "Ext.form.field.File": {
  8676. "idx": 538,
  8677. "alias": [
  8678. "widget.filefield",
  8679. "widget.fileuploadfield"
  8680. ],
  8681. "alternates": [
  8682. "Ext.form.FileUploadField",
  8683. "Ext.ux.form.FileUploadField",
  8684. "Ext.form.File"
  8685. ]
  8686. },
  8687. "Ext.form.field.FileButton": {
  8688. "idx": 536,
  8689. "alias": [
  8690. "widget.filebutton"
  8691. ],
  8692. "alternates": []
  8693. },
  8694. "Ext.form.field.Hidden": {
  8695. "idx": 539,
  8696. "alias": [
  8697. "widget.hidden",
  8698. "widget.hiddenfield"
  8699. ],
  8700. "alternates": [
  8701. "Ext.form.Hidden"
  8702. ]
  8703. },
  8704. "Ext.form.field.HtmlEditor": {
  8705. "idx": 548,
  8706. "alias": [
  8707. "widget.htmleditor"
  8708. ],
  8709. "alternates": [
  8710. "Ext.form.HtmlEditor"
  8711. ]
  8712. },
  8713. "Ext.form.field.Number": {
  8714. "idx": 528,
  8715. "alias": [
  8716. "widget.numberfield"
  8717. ],
  8718. "alternates": [
  8719. "Ext.form.NumberField",
  8720. "Ext.form.Number"
  8721. ]
  8722. },
  8723. "Ext.form.field.Picker": {
  8724. "idx": 516,
  8725. "alias": [
  8726. "widget.pickerfield"
  8727. ],
  8728. "alternates": [
  8729. "Ext.form.Picker"
  8730. ]
  8731. },
  8732. "Ext.form.field.Radio": {
  8733. "idx": 511,
  8734. "alias": [
  8735. "widget.radio",
  8736. "widget.radiofield"
  8737. ],
  8738. "alternates": [
  8739. "Ext.form.Radio"
  8740. ]
  8741. },
  8742. "Ext.form.field.Spinner": {
  8743. "idx": 527,
  8744. "alias": [
  8745. "widget.spinnerfield"
  8746. ],
  8747. "alternates": [
  8748. "Ext.form.Spinner"
  8749. ]
  8750. },
  8751. "Ext.form.field.Tag": {
  8752. "idx": 550,
  8753. "alias": [
  8754. "widget.tagfield"
  8755. ],
  8756. "alternates": []
  8757. },
  8758. "Ext.form.field.Text": {
  8759. "idx": 496,
  8760. "alias": [
  8761. "widget.textfield"
  8762. ],
  8763. "alternates": [
  8764. "Ext.form.TextField",
  8765. "Ext.form.Text"
  8766. ]
  8767. },
  8768. "Ext.form.field.TextArea": {
  8769. "idx": 497,
  8770. "alias": [
  8771. "widget.textarea",
  8772. "widget.textareafield"
  8773. ],
  8774. "alternates": [
  8775. "Ext.form.TextArea"
  8776. ]
  8777. },
  8778. "Ext.form.field.Time": {
  8779. "idx": 552,
  8780. "alias": [
  8781. "widget.timefield"
  8782. ],
  8783. "alternates": [
  8784. "Ext.form.TimeField",
  8785. "Ext.form.Time"
  8786. ]
  8787. },
  8788. "Ext.form.field.Trigger": {
  8789. "idx": 553,
  8790. "alias": [
  8791. "widget.trigger",
  8792. "widget.triggerfield"
  8793. ],
  8794. "alternates": [
  8795. "Ext.form.TriggerField",
  8796. "Ext.form.TwinTriggerField",
  8797. "Ext.form.Trigger"
  8798. ]
  8799. },
  8800. "Ext.form.field.VTypes": {
  8801. "idx": 494,
  8802. "alias": [],
  8803. "alternates": [
  8804. "Ext.form.VTypes"
  8805. ]
  8806. },
  8807. "Ext.form.trigger.Component": {
  8808. "idx": 537,
  8809. "alias": [
  8810. "trigger.component"
  8811. ],
  8812. "alternates": []
  8813. },
  8814. "Ext.form.trigger.Spinner": {
  8815. "idx": 526,
  8816. "alias": [
  8817. "trigger.spinner"
  8818. ],
  8819. "alternates": []
  8820. },
  8821. "Ext.form.trigger.Trigger": {
  8822. "idx": 495,
  8823. "alias": [
  8824. "trigger.trigger"
  8825. ],
  8826. "alternates": []
  8827. },
  8828. "Ext.fx.Anim": {
  8829. "idx": 73,
  8830. "alias": [],
  8831. "alternates": []
  8832. },
  8833. "Ext.fx.Animation": {
  8834. "idx": 340,
  8835. "alias": [],
  8836. "alternates": []
  8837. },
  8838. "Ext.fx.Animator": {
  8839. "idx": 68,
  8840. "alias": [],
  8841. "alternates": []
  8842. },
  8843. "Ext.fx.CubicBezier": {
  8844. "idx": 69,
  8845. "alias": [],
  8846. "alternates": []
  8847. },
  8848. "Ext.fx.DrawPath": {
  8849. "idx": 71,
  8850. "alias": [],
  8851. "alternates": []
  8852. },
  8853. "Ext.fx.Easing": {
  8854. "idx": 70,
  8855. "alias": [],
  8856. "alternates": []
  8857. },
  8858. "Ext.fx.Manager": {
  8859. "idx": 67,
  8860. "alias": [],
  8861. "alternates": []
  8862. },
  8863. "Ext.fx.PropertyHandler": {
  8864. "idx": 72,
  8865. "alias": [],
  8866. "alternates": []
  8867. },
  8868. "Ext.fx.Queue": {
  8869. "idx": 66,
  8870. "alias": [],
  8871. "alternates": []
  8872. },
  8873. "Ext.fx.Runner": {
  8874. "idx": 343,
  8875. "alias": [],
  8876. "alternates": []
  8877. },
  8878. "Ext.fx.State": {
  8879. "idx": 331,
  8880. "alias": [],
  8881. "alternates": []
  8882. },
  8883. "Ext.fx.animation.Abstract": {
  8884. "idx": 332,
  8885. "alias": [],
  8886. "alternates": []
  8887. },
  8888. "Ext.fx.animation.Cube": {
  8889. "idx": 344,
  8890. "alias": [
  8891. "animation.cube"
  8892. ],
  8893. "alternates": []
  8894. },
  8895. "Ext.fx.animation.Fade": {
  8896. "idx": 335,
  8897. "alias": [
  8898. "animation.fade",
  8899. "animation.fadeIn"
  8900. ],
  8901. "alternates": [
  8902. "Ext.fx.animation.FadeIn"
  8903. ]
  8904. },
  8905. "Ext.fx.animation.FadeOut": {
  8906. "idx": 336,
  8907. "alias": [
  8908. "animation.fadeOut"
  8909. ],
  8910. "alternates": []
  8911. },
  8912. "Ext.fx.animation.Flip": {
  8913. "idx": 337,
  8914. "alias": [
  8915. "animation.flip"
  8916. ],
  8917. "alternates": []
  8918. },
  8919. "Ext.fx.animation.Pop": {
  8920. "idx": 338,
  8921. "alias": [
  8922. "animation.pop",
  8923. "animation.popIn"
  8924. ],
  8925. "alternates": [
  8926. "Ext.fx.animation.PopIn"
  8927. ]
  8928. },
  8929. "Ext.fx.animation.PopOut": {
  8930. "idx": 339,
  8931. "alias": [
  8932. "animation.popOut"
  8933. ],
  8934. "alternates": []
  8935. },
  8936. "Ext.fx.animation.Slide": {
  8937. "idx": 333,
  8938. "alias": [
  8939. "animation.slide",
  8940. "animation.slideIn"
  8941. ],
  8942. "alternates": [
  8943. "Ext.fx.animation.SlideIn"
  8944. ]
  8945. },
  8946. "Ext.fx.animation.SlideOut": {
  8947. "idx": 334,
  8948. "alias": [
  8949. "animation.slideOut"
  8950. ],
  8951. "alternates": []
  8952. },
  8953. "Ext.fx.animation.Wipe": {
  8954. "idx": 345,
  8955. "alias": [],
  8956. "alternates": [
  8957. "Ext.fx.animation.WipeIn"
  8958. ]
  8959. },
  8960. "Ext.fx.animation.WipeOut": {
  8961. "idx": 346,
  8962. "alias": [],
  8963. "alternates": []
  8964. },
  8965. "Ext.fx.easing.Abstract": {
  8966. "idx": 105,
  8967. "alias": [],
  8968. "alternates": []
  8969. },
  8970. "Ext.fx.easing.Bounce": {
  8971. "idx": 347,
  8972. "alias": [],
  8973. "alternates": []
  8974. },
  8975. "Ext.fx.easing.BoundMomentum": {
  8976. "idx": 349,
  8977. "alias": [],
  8978. "alternates": []
  8979. },
  8980. "Ext.fx.easing.EaseIn": {
  8981. "idx": 350,
  8982. "alias": [
  8983. "easing.ease-in"
  8984. ],
  8985. "alternates": []
  8986. },
  8987. "Ext.fx.easing.EaseOut": {
  8988. "idx": 351,
  8989. "alias": [
  8990. "easing.ease-out"
  8991. ],
  8992. "alternates": []
  8993. },
  8994. "Ext.fx.easing.Easing": {
  8995. "idx": 352,
  8996. "alias": [],
  8997. "alternates": []
  8998. },
  8999. "Ext.fx.easing.Linear": {
  9000. "idx": 106,
  9001. "alias": [
  9002. "easing.linear"
  9003. ],
  9004. "alternates": []
  9005. },
  9006. "Ext.fx.easing.Momentum": {
  9007. "idx": 348,
  9008. "alias": [],
  9009. "alternates": []
  9010. },
  9011. "Ext.fx.runner.Css": {
  9012. "idx": 341,
  9013. "alias": [],
  9014. "alternates": []
  9015. },
  9016. "Ext.fx.runner.CssAnimation": {
  9017. "idx": 353,
  9018. "alias": [],
  9019. "alternates": []
  9020. },
  9021. "Ext.fx.runner.CssTransition": {
  9022. "idx": 342,
  9023. "alias": [],
  9024. "alternates": [
  9025. "Ext.Animator"
  9026. ]
  9027. },
  9028. "Ext.fx.target.Component": {
  9029. "idx": 65,
  9030. "alias": [],
  9031. "alternates": []
  9032. },
  9033. "Ext.fx.target.CompositeElement": {
  9034. "idx": 61,
  9035. "alias": [],
  9036. "alternates": []
  9037. },
  9038. "Ext.fx.target.CompositeElementCSS": {
  9039. "idx": 62,
  9040. "alias": [],
  9041. "alternates": []
  9042. },
  9043. "Ext.fx.target.CompositeSprite": {
  9044. "idx": 64,
  9045. "alias": [],
  9046. "alternates": []
  9047. },
  9048. "Ext.fx.target.Element": {
  9049. "idx": 59,
  9050. "alias": [],
  9051. "alternates": []
  9052. },
  9053. "Ext.fx.target.ElementCSS": {
  9054. "idx": 60,
  9055. "alias": [],
  9056. "alternates": []
  9057. },
  9058. "Ext.fx.target.Sprite": {
  9059. "idx": 63,
  9060. "alias": [],
  9061. "alternates": []
  9062. },
  9063. "Ext.fx.target.Target": {
  9064. "idx": 58,
  9065. "alias": [],
  9066. "alternates": []
  9067. },
  9068. "Ext.grid.CellContext": {
  9069. "idx": 554,
  9070. "alias": [],
  9071. "alternates": []
  9072. },
  9073. "Ext.grid.CellEditor": {
  9074. "idx": 555,
  9075. "alias": [
  9076. "widget.celleditor"
  9077. ],
  9078. "alternates": []
  9079. },
  9080. "Ext.grid.ColumnComponentLayout": {
  9081. "idx": 556,
  9082. "alias": [
  9083. "layout.columncomponent"
  9084. ],
  9085. "alternates": []
  9086. },
  9087. "Ext.grid.ColumnLayout": {
  9088. "idx": 559,
  9089. "alias": [
  9090. "layout.gridcolumn"
  9091. ],
  9092. "alternates": []
  9093. },
  9094. "Ext.grid.ColumnManager": {
  9095. "idx": 560,
  9096. "alias": [],
  9097. "alternates": [
  9098. "Ext.grid.ColumnModel"
  9099. ]
  9100. },
  9101. "Ext.grid.NavigationModel": {
  9102. "idx": 561,
  9103. "alias": [
  9104. "view.navigation.grid"
  9105. ],
  9106. "alternates": []
  9107. },
  9108. "Ext.grid.Panel": {
  9109. "idx": 567,
  9110. "alias": [
  9111. "widget.grid",
  9112. "widget.gridpanel"
  9113. ],
  9114. "alternates": [
  9115. "Ext.list.ListView",
  9116. "Ext.ListView",
  9117. "Ext.grid.GridPanel"
  9118. ]
  9119. },
  9120. "Ext.grid.RowContext": {
  9121. "idx": 568,
  9122. "alias": [],
  9123. "alternates": []
  9124. },
  9125. "Ext.grid.RowEditor": {
  9126. "idx": 570,
  9127. "alias": [
  9128. "widget.roweditor"
  9129. ],
  9130. "alternates": []
  9131. },
  9132. "Ext.grid.RowEditorButtons": {
  9133. "idx": 569,
  9134. "alias": [
  9135. "widget.roweditorbuttons"
  9136. ],
  9137. "alternates": []
  9138. },
  9139. "Ext.grid.Scroller": {
  9140. "idx": 571,
  9141. "alias": [],
  9142. "alternates": []
  9143. },
  9144. "Ext.grid.ViewDropZone": {
  9145. "idx": 573,
  9146. "alias": [],
  9147. "alternates": []
  9148. },
  9149. "Ext.grid.column.Action": {
  9150. "idx": 581,
  9151. "alias": [
  9152. "widget.actioncolumn"
  9153. ],
  9154. "alternates": [
  9155. "Ext.grid.ActionColumn"
  9156. ]
  9157. },
  9158. "Ext.grid.column.ActionProxy": {
  9159. "idx": 580,
  9160. "alias": [],
  9161. "alternates": []
  9162. },
  9163. "Ext.grid.column.Boolean": {
  9164. "idx": 582,
  9165. "alias": [
  9166. "widget.booleancolumn"
  9167. ],
  9168. "alternates": [
  9169. "Ext.grid.BooleanColumn"
  9170. ]
  9171. },
  9172. "Ext.grid.column.Check": {
  9173. "idx": 583,
  9174. "alias": [
  9175. "widget.checkcolumn"
  9176. ],
  9177. "alternates": [
  9178. "Ext.ux.CheckColumn",
  9179. "Ext.grid.column.CheckColumn"
  9180. ]
  9181. },
  9182. "Ext.grid.column.Column": {
  9183. "idx": 579,
  9184. "alias": [
  9185. "widget.gridcolumn"
  9186. ],
  9187. "alternates": [
  9188. "Ext.grid.Column"
  9189. ]
  9190. },
  9191. "Ext.grid.column.Date": {
  9192. "idx": 584,
  9193. "alias": [
  9194. "widget.datecolumn"
  9195. ],
  9196. "alternates": [
  9197. "Ext.grid.DateColumn"
  9198. ]
  9199. },
  9200. "Ext.grid.column.Number": {
  9201. "idx": 585,
  9202. "alias": [
  9203. "widget.numbercolumn"
  9204. ],
  9205. "alternates": [
  9206. "Ext.grid.NumberColumn"
  9207. ]
  9208. },
  9209. "Ext.grid.column.RowNumberer": {
  9210. "idx": 586,
  9211. "alias": [
  9212. "widget.rownumberer"
  9213. ],
  9214. "alternates": [
  9215. "Ext.grid.RowNumberer"
  9216. ]
  9217. },
  9218. "Ext.grid.column.Template": {
  9219. "idx": 587,
  9220. "alias": [
  9221. "widget.templatecolumn"
  9222. ],
  9223. "alternates": [
  9224. "Ext.grid.TemplateColumn"
  9225. ]
  9226. },
  9227. "Ext.grid.column.Widget": {
  9228. "idx": 588,
  9229. "alias": [
  9230. "widget.widgetcolumn"
  9231. ],
  9232. "alternates": []
  9233. },
  9234. "Ext.grid.feature.AbstractSummary": {
  9235. "idx": 590,
  9236. "alias": [
  9237. "feature.abstractsummary"
  9238. ],
  9239. "alternates": []
  9240. },
  9241. "Ext.grid.feature.Feature": {
  9242. "idx": 589,
  9243. "alias": [
  9244. "feature.feature"
  9245. ],
  9246. "alternates": []
  9247. },
  9248. "Ext.grid.feature.GroupStore": {
  9249. "idx": 591,
  9250. "alias": [],
  9251. "alternates": []
  9252. },
  9253. "Ext.grid.feature.Grouping": {
  9254. "idx": 592,
  9255. "alias": [
  9256. "feature.grouping"
  9257. ],
  9258. "alternates": []
  9259. },
  9260. "Ext.grid.feature.GroupingSummary": {
  9261. "idx": 593,
  9262. "alias": [
  9263. "feature.groupingsummary"
  9264. ],
  9265. "alternates": []
  9266. },
  9267. "Ext.grid.feature.RowBody": {
  9268. "idx": 594,
  9269. "alias": [
  9270. "feature.rowbody"
  9271. ],
  9272. "alternates": []
  9273. },
  9274. "Ext.grid.feature.Summary": {
  9275. "idx": 595,
  9276. "alias": [
  9277. "feature.summary"
  9278. ],
  9279. "alternates": []
  9280. },
  9281. "Ext.grid.filters.Filters": {
  9282. "idx": 608,
  9283. "alias": [
  9284. "plugin.gridfilters"
  9285. ],
  9286. "alternates": []
  9287. },
  9288. "Ext.grid.filters.filter.Base": {
  9289. "idx": 600,
  9290. "alias": [],
  9291. "alternates": []
  9292. },
  9293. "Ext.grid.filters.filter.Boolean": {
  9294. "idx": 602,
  9295. "alias": [
  9296. "grid.filter.boolean"
  9297. ],
  9298. "alternates": []
  9299. },
  9300. "Ext.grid.filters.filter.Date": {
  9301. "idx": 604,
  9302. "alias": [
  9303. "grid.filter.date"
  9304. ],
  9305. "alternates": []
  9306. },
  9307. "Ext.grid.filters.filter.List": {
  9308. "idx": 605,
  9309. "alias": [
  9310. "grid.filter.list"
  9311. ],
  9312. "alternates": []
  9313. },
  9314. "Ext.grid.filters.filter.Number": {
  9315. "idx": 606,
  9316. "alias": [
  9317. "grid.filter.number",
  9318. "grid.filter.numeric"
  9319. ],
  9320. "alternates": []
  9321. },
  9322. "Ext.grid.filters.filter.SingleFilter": {
  9323. "idx": 601,
  9324. "alias": [],
  9325. "alternates": []
  9326. },
  9327. "Ext.grid.filters.filter.String": {
  9328. "idx": 607,
  9329. "alias": [
  9330. "grid.filter.string"
  9331. ],
  9332. "alternates": []
  9333. },
  9334. "Ext.grid.filters.filter.TriFilter": {
  9335. "idx": 603,
  9336. "alias": [],
  9337. "alternates": []
  9338. },
  9339. "Ext.grid.header.Container": {
  9340. "idx": 578,
  9341. "alias": [
  9342. "widget.headercontainer"
  9343. ],
  9344. "alternates": []
  9345. },
  9346. "Ext.grid.header.DragZone": {
  9347. "idx": 575,
  9348. "alias": [],
  9349. "alternates": []
  9350. },
  9351. "Ext.grid.header.DropZone": {
  9352. "idx": 576,
  9353. "alias": [],
  9354. "alternates": []
  9355. },
  9356. "Ext.grid.locking.HeaderContainer": {
  9357. "idx": 609,
  9358. "alias": [],
  9359. "alternates": []
  9360. },
  9361. "Ext.grid.locking.Lockable": {
  9362. "idx": 612,
  9363. "alias": [],
  9364. "alternates": [
  9365. "Ext.grid.Lockable"
  9366. ]
  9367. },
  9368. "Ext.grid.locking.RowSynchronizer": {
  9369. "idx": 563,
  9370. "alias": [],
  9371. "alternates": []
  9372. },
  9373. "Ext.grid.locking.View": {
  9374. "idx": 610,
  9375. "alias": [],
  9376. "alternates": [
  9377. "Ext.grid.LockingView"
  9378. ]
  9379. },
  9380. "Ext.grid.plugin.BufferedRenderer": {
  9381. "idx": 613,
  9382. "alias": [
  9383. "plugin.bufferedrenderer"
  9384. ],
  9385. "alternates": []
  9386. },
  9387. "Ext.grid.plugin.CellEditing": {
  9388. "idx": 615,
  9389. "alias": [
  9390. "plugin.cellediting"
  9391. ],
  9392. "alternates": []
  9393. },
  9394. "Ext.grid.plugin.Clipboard": {
  9395. "idx": 616,
  9396. "alias": [
  9397. "plugin.clipboard"
  9398. ],
  9399. "alternates": []
  9400. },
  9401. "Ext.grid.plugin.DragDrop": {
  9402. "idx": 617,
  9403. "alias": [
  9404. "plugin.gridviewdragdrop"
  9405. ],
  9406. "alternates": []
  9407. },
  9408. "Ext.grid.plugin.Editing": {
  9409. "idx": 614,
  9410. "alias": [
  9411. "editing.editing"
  9412. ],
  9413. "alternates": []
  9414. },
  9415. "Ext.grid.plugin.HeaderReorderer": {
  9416. "idx": 577,
  9417. "alias": [
  9418. "plugin.gridheaderreorderer"
  9419. ],
  9420. "alternates": []
  9421. },
  9422. "Ext.grid.plugin.HeaderResizer": {
  9423. "idx": 574,
  9424. "alias": [
  9425. "plugin.gridheaderresizer"
  9426. ],
  9427. "alternates": []
  9428. },
  9429. "Ext.grid.plugin.RowEditing": {
  9430. "idx": 618,
  9431. "alias": [
  9432. "plugin.rowediting"
  9433. ],
  9434. "alternates": []
  9435. },
  9436. "Ext.grid.plugin.RowExpander": {
  9437. "idx": 619,
  9438. "alias": [
  9439. "plugin.rowexpander"
  9440. ],
  9441. "alternates": []
  9442. },
  9443. "Ext.grid.plugin.RowWidget": {
  9444. "idx": 620,
  9445. "alias": [
  9446. "plugin.rowwidget"
  9447. ],
  9448. "alternates": []
  9449. },
  9450. "Ext.grid.property.Grid": {
  9451. "idx": 621,
  9452. "alias": [
  9453. "widget.propertygrid"
  9454. ],
  9455. "alternates": [
  9456. "Ext.grid.PropertyGrid"
  9457. ]
  9458. },
  9459. "Ext.grid.property.HeaderContainer": {
  9460. "idx": 622,
  9461. "alias": [],
  9462. "alternates": [
  9463. "Ext.grid.PropertyColumnModel"
  9464. ]
  9465. },
  9466. "Ext.grid.property.Property": {
  9467. "idx": 623,
  9468. "alias": [],
  9469. "alternates": [
  9470. "Ext.PropGridProperty"
  9471. ]
  9472. },
  9473. "Ext.grid.property.Reader": {
  9474. "idx": 624,
  9475. "alias": [],
  9476. "alternates": []
  9477. },
  9478. "Ext.grid.property.Store": {
  9479. "idx": 625,
  9480. "alias": [],
  9481. "alternates": [
  9482. "Ext.grid.PropertyStore"
  9483. ]
  9484. },
  9485. "Ext.grid.selection.Cells": {
  9486. "idx": 627,
  9487. "alias": [],
  9488. "alternates": []
  9489. },
  9490. "Ext.grid.selection.Columns": {
  9491. "idx": 628,
  9492. "alias": [],
  9493. "alternates": []
  9494. },
  9495. "Ext.grid.selection.Replicator": {
  9496. "idx": 629,
  9497. "alias": [
  9498. "plugin.selectionreplicator"
  9499. ],
  9500. "alternates": []
  9501. },
  9502. "Ext.grid.selection.Rows": {
  9503. "idx": 630,
  9504. "alias": [],
  9505. "alternates": []
  9506. },
  9507. "Ext.grid.selection.Selection": {
  9508. "idx": 626,
  9509. "alias": [],
  9510. "alternates": []
  9511. },
  9512. "Ext.grid.selection.SelectionExtender": {
  9513. "idx": 631,
  9514. "alias": [],
  9515. "alternates": []
  9516. },
  9517. "Ext.grid.selection.SpreadsheetModel": {
  9518. "idx": 632,
  9519. "alias": [
  9520. "selection.spreadsheet"
  9521. ],
  9522. "alternates": []
  9523. },
  9524. "Ext.layout.Context": {
  9525. "idx": 635,
  9526. "alias": [],
  9527. "alternates": []
  9528. },
  9529. "Ext.layout.ContextItem": {
  9530. "idx": 634,
  9531. "alias": [],
  9532. "alternates": []
  9533. },
  9534. "Ext.layout.Layout": {
  9535. "idx": 410,
  9536. "alias": [],
  9537. "alternates": []
  9538. },
  9539. "Ext.layout.SizeModel": {
  9540. "idx": 409,
  9541. "alias": [],
  9542. "alternates": []
  9543. },
  9544. "Ext.layout.component.Auto": {
  9545. "idx": 423,
  9546. "alias": [
  9547. "layout.autocomponent"
  9548. ],
  9549. "alternates": []
  9550. },
  9551. "Ext.layout.component.Body": {
  9552. "idx": 637,
  9553. "alias": [
  9554. "layout.body"
  9555. ],
  9556. "alternates": []
  9557. },
  9558. "Ext.layout.component.BoundList": {
  9559. "idx": 523,
  9560. "alias": [
  9561. "layout.boundlist"
  9562. ],
  9563. "alternates": []
  9564. },
  9565. "Ext.layout.component.Component": {
  9566. "idx": 422,
  9567. "alias": [],
  9568. "alternates": []
  9569. },
  9570. "Ext.layout.component.Dock": {
  9571. "idx": 453,
  9572. "alias": [
  9573. "layout.dock"
  9574. ],
  9575. "alternates": [
  9576. "Ext.layout.component.AbstractDock"
  9577. ]
  9578. },
  9579. "Ext.layout.component.FieldSet": {
  9580. "idx": 638,
  9581. "alias": [
  9582. "layout.fieldset"
  9583. ],
  9584. "alternates": []
  9585. },
  9586. "Ext.layout.component.ProgressBar": {
  9587. "idx": 424,
  9588. "alias": [
  9589. "layout.progressbar"
  9590. ],
  9591. "alternates": []
  9592. },
  9593. "Ext.layout.component.field.FieldContainer": {
  9594. "idx": 500,
  9595. "alias": [
  9596. "layout.fieldcontainer"
  9597. ],
  9598. "alternates": []
  9599. },
  9600. "Ext.layout.component.field.HtmlEditor": {
  9601. "idx": 545,
  9602. "alias": [
  9603. "layout.htmleditor"
  9604. ],
  9605. "alternates": []
  9606. },
  9607. "Ext.layout.component.field.Text": {
  9608. "idx": 493,
  9609. "alias": [
  9610. "layout.textfield"
  9611. ],
  9612. "alternates": []
  9613. },
  9614. "Ext.layout.container.Absolute": {
  9615. "idx": 639,
  9616. "alias": [
  9617. "layout.absolute"
  9618. ],
  9619. "alternates": [
  9620. "Ext.layout.AbsoluteLayout"
  9621. ]
  9622. },
  9623. "Ext.layout.container.Accordion": {
  9624. "idx": 640,
  9625. "alias": [
  9626. "layout.accordion"
  9627. ],
  9628. "alternates": [
  9629. "Ext.layout.AccordionLayout"
  9630. ]
  9631. },
  9632. "Ext.layout.container.Anchor": {
  9633. "idx": 462,
  9634. "alias": [
  9635. "layout.anchor"
  9636. ],
  9637. "alternates": [
  9638. "Ext.layout.AnchorLayout"
  9639. ]
  9640. },
  9641. "Ext.layout.container.Auto": {
  9642. "idx": 412,
  9643. "alias": [
  9644. "layout.auto",
  9645. "layout.autocontainer"
  9646. ],
  9647. "alternates": []
  9648. },
  9649. "Ext.layout.container.Border": {
  9650. "idx": 642,
  9651. "alias": [
  9652. "layout.border"
  9653. ],
  9654. "alternates": [
  9655. "Ext.layout.BorderLayout"
  9656. ]
  9657. },
  9658. "Ext.layout.container.Box": {
  9659. "idx": 442,
  9660. "alias": [
  9661. "layout.box"
  9662. ],
  9663. "alternates": [
  9664. "Ext.layout.BoxLayout"
  9665. ]
  9666. },
  9667. "Ext.layout.container.Card": {
  9668. "idx": 643,
  9669. "alias": [
  9670. "layout.card"
  9671. ],
  9672. "alternates": [
  9673. "Ext.layout.CardLayout"
  9674. ]
  9675. },
  9676. "Ext.layout.container.Center": {
  9677. "idx": 644,
  9678. "alias": [
  9679. "layout.center",
  9680. "layout.ux.center"
  9681. ],
  9682. "alternates": [
  9683. "Ext.ux.layout.Center"
  9684. ]
  9685. },
  9686. "Ext.layout.container.CheckboxGroup": {
  9687. "idx": 503,
  9688. "alias": [
  9689. "layout.checkboxgroup"
  9690. ],
  9691. "alternates": []
  9692. },
  9693. "Ext.layout.container.Column": {
  9694. "idx": 465,
  9695. "alias": [
  9696. "layout.column"
  9697. ],
  9698. "alternates": [
  9699. "Ext.layout.ColumnLayout"
  9700. ]
  9701. },
  9702. "Ext.layout.container.ColumnSplitter": {
  9703. "idx": 469,
  9704. "alias": [
  9705. "widget.columnsplitter"
  9706. ],
  9707. "alternates": []
  9708. },
  9709. "Ext.layout.container.ColumnSplitterTracker": {
  9710. "idx": 468,
  9711. "alias": [],
  9712. "alternates": []
  9713. },
  9714. "Ext.layout.container.Container": {
  9715. "idx": 411,
  9716. "alias": [
  9717. "layout.container"
  9718. ],
  9719. "alternates": [
  9720. "Ext.layout.ContainerLayout"
  9721. ]
  9722. },
  9723. "Ext.layout.container.Dashboard": {
  9724. "idx": 470,
  9725. "alias": [
  9726. "layout.dashboard"
  9727. ],
  9728. "alternates": []
  9729. },
  9730. "Ext.layout.container.Editor": {
  9731. "idx": 415,
  9732. "alias": [
  9733. "layout.editor"
  9734. ],
  9735. "alternates": []
  9736. },
  9737. "Ext.layout.container.Fit": {
  9738. "idx": 557,
  9739. "alias": [
  9740. "layout.fit"
  9741. ],
  9742. "alternates": [
  9743. "Ext.layout.FitLayout",
  9744. "Ext.layout.Fit"
  9745. ]
  9746. },
  9747. "Ext.layout.container.Form": {
  9748. "idx": 645,
  9749. "alias": [
  9750. "layout.form"
  9751. ],
  9752. "alternates": [
  9753. "Ext.layout.FormLayout"
  9754. ]
  9755. },
  9756. "Ext.layout.container.HBox": {
  9757. "idx": 443,
  9758. "alias": [
  9759. "layout.hbox"
  9760. ],
  9761. "alternates": [
  9762. "Ext.layout.HBoxLayout"
  9763. ]
  9764. },
  9765. "Ext.layout.container.SegmentedButton": {
  9766. "idx": 432,
  9767. "alias": [
  9768. "layout.segmentedbutton"
  9769. ],
  9770. "alternates": []
  9771. },
  9772. "Ext.layout.container.Table": {
  9773. "idx": 457,
  9774. "alias": [
  9775. "layout.table"
  9776. ],
  9777. "alternates": [
  9778. "Ext.layout.TableLayout"
  9779. ]
  9780. },
  9781. "Ext.layout.container.VBox": {
  9782. "idx": 444,
  9783. "alias": [
  9784. "layout.vbox"
  9785. ],
  9786. "alternates": [
  9787. "Ext.layout.VBoxLayout"
  9788. ]
  9789. },
  9790. "Ext.layout.container.border.Region": {
  9791. "idx": 119,
  9792. "alias": [],
  9793. "alternates": []
  9794. },
  9795. "Ext.layout.container.boxOverflow.Menu": {
  9796. "idx": 547,
  9797. "alias": [
  9798. "box.overflow.Menu",
  9799. "box.overflow.menu"
  9800. ],
  9801. "alternates": [
  9802. "Ext.layout.boxOverflow.Menu"
  9803. ]
  9804. },
  9805. "Ext.layout.container.boxOverflow.None": {
  9806. "idx": 438,
  9807. "alias": [
  9808. "box.overflow.None",
  9809. "box.overflow.none"
  9810. ],
  9811. "alternates": [
  9812. "Ext.layout.boxOverflow.None"
  9813. ]
  9814. },
  9815. "Ext.layout.container.boxOverflow.Scroller": {
  9816. "idx": 439,
  9817. "alias": [
  9818. "box.overflow.Scroller",
  9819. "box.overflow.scroller"
  9820. ],
  9821. "alternates": [
  9822. "Ext.layout.boxOverflow.Scroller"
  9823. ]
  9824. },
  9825. "Ext.list.AbstractTreeItem": {
  9826. "idx": 354,
  9827. "alias": [],
  9828. "alternates": []
  9829. },
  9830. "Ext.list.RootTreeItem": {
  9831. "idx": 355,
  9832. "alias": [],
  9833. "alternates": []
  9834. },
  9835. "Ext.list.Tree": {
  9836. "idx": 358,
  9837. "alias": [
  9838. "widget.treelist"
  9839. ],
  9840. "alternates": []
  9841. },
  9842. "Ext.list.TreeItem": {
  9843. "idx": 357,
  9844. "alias": [
  9845. "widget.treelistitem"
  9846. ],
  9847. "alternates": []
  9848. },
  9849. "Ext.menu.Bar": {
  9850. "idx": 646,
  9851. "alias": [
  9852. "widget.menubar"
  9853. ],
  9854. "alternates": []
  9855. },
  9856. "Ext.menu.CheckItem": {
  9857. "idx": 597,
  9858. "alias": [
  9859. "widget.menucheckitem"
  9860. ],
  9861. "alternates": []
  9862. },
  9863. "Ext.menu.ColorPicker": {
  9864. "idx": 647,
  9865. "alias": [
  9866. "widget.colormenu"
  9867. ],
  9868. "alternates": []
  9869. },
  9870. "Ext.menu.DatePicker": {
  9871. "idx": 648,
  9872. "alias": [
  9873. "widget.datemenu"
  9874. ],
  9875. "alternates": []
  9876. },
  9877. "Ext.menu.Item": {
  9878. "idx": 596,
  9879. "alias": [
  9880. "widget.menuitem"
  9881. ],
  9882. "alternates": [
  9883. "Ext.menu.TextItem"
  9884. ]
  9885. },
  9886. "Ext.menu.Manager": {
  9887. "idx": 428,
  9888. "alias": [],
  9889. "alternates": [
  9890. "Ext.menu.MenuMgr"
  9891. ]
  9892. },
  9893. "Ext.menu.Menu": {
  9894. "idx": 599,
  9895. "alias": [
  9896. "widget.menu"
  9897. ],
  9898. "alternates": []
  9899. },
  9900. "Ext.menu.Separator": {
  9901. "idx": 598,
  9902. "alias": [
  9903. "widget.menuseparator"
  9904. ],
  9905. "alternates": []
  9906. },
  9907. "Ext.mixin.Accessible": {
  9908. "idx": 88,
  9909. "alias": [],
  9910. "alternates": []
  9911. },
  9912. "Ext.mixin.Bindable": {
  9913. "idx": 82,
  9914. "alias": [],
  9915. "alternates": []
  9916. },
  9917. "Ext.mixin.Bufferable": {
  9918. "idx": 20,
  9919. "alias": [],
  9920. "alternates": []
  9921. },
  9922. "Ext.mixin.ComponentDelegation": {
  9923. "idx": 83,
  9924. "alias": [],
  9925. "alternates": []
  9926. },
  9927. "Ext.mixin.ConfigProxy": {
  9928. "idx": 359,
  9929. "alias": [],
  9930. "alternates": []
  9931. },
  9932. "Ext.mixin.ConfigState": {
  9933. "idx": 360,
  9934. "alias": [],
  9935. "alternates": []
  9936. },
  9937. "Ext.mixin.Container": {
  9938. "idx": 361,
  9939. "alias": [],
  9940. "alternates": []
  9941. },
  9942. "Ext.mixin.Dirty": {
  9943. "idx": 198,
  9944. "alias": [],
  9945. "alternates": []
  9946. },
  9947. "Ext.mixin.Factoryable": {
  9948. "idx": 12,
  9949. "alias": [],
  9950. "alternates": []
  9951. },
  9952. "Ext.mixin.Focusable": {
  9953. "idx": 87,
  9954. "alias": [],
  9955. "alternates": []
  9956. },
  9957. "Ext.mixin.FocusableContainer": {
  9958. "idx": 364,
  9959. "alias": [],
  9960. "alternates": []
  9961. },
  9962. "Ext.mixin.Hookable": {
  9963. "idx": 365,
  9964. "alias": [],
  9965. "alternates": []
  9966. },
  9967. "Ext.mixin.Identifiable": {
  9968. "idx": 3,
  9969. "alias": [],
  9970. "alternates": []
  9971. },
  9972. "Ext.mixin.Inheritable": {
  9973. "idx": 81,
  9974. "alias": [],
  9975. "alternates": []
  9976. },
  9977. "Ext.mixin.ItemRippler": {
  9978. "idx": 356,
  9979. "alias": [],
  9980. "alternates": []
  9981. },
  9982. "Ext.mixin.Keyboard": {
  9983. "idx": 86,
  9984. "alias": [],
  9985. "alternates": []
  9986. },
  9987. "Ext.mixin.Mashup": {
  9988. "idx": 366,
  9989. "alias": [],
  9990. "alternates": []
  9991. },
  9992. "Ext.mixin.Observable": {
  9993. "idx": 4,
  9994. "alias": [],
  9995. "alternates": []
  9996. },
  9997. "Ext.mixin.Pluggable": {
  9998. "idx": 85,
  9999. "alias": [],
  10000. "alternates": []
  10001. },
  10002. "Ext.mixin.Queryable": {
  10003. "idx": 238,
  10004. "alias": [],
  10005. "alternates": []
  10006. },
  10007. "Ext.mixin.Responsive": {
  10008. "idx": 90,
  10009. "alias": [],
  10010. "alternates": []
  10011. },
  10012. "Ext.mixin.Selectable": {
  10013. "idx": 367,
  10014. "alias": [],
  10015. "alternates": []
  10016. },
  10017. "Ext.mixin.StoreWatcher": {
  10018. "idx": 368,
  10019. "alias": [],
  10020. "alternates": []
  10021. },
  10022. "Ext.mixin.StyleCacher": {
  10023. "idx": 369,
  10024. "alias": [],
  10025. "alternates": []
  10026. },
  10027. "Ext.mixin.Templatable": {
  10028. "idx": 39,
  10029. "alias": [],
  10030. "alternates": []
  10031. },
  10032. "Ext.mixin.Traversable": {
  10033. "idx": 370,
  10034. "alias": [],
  10035. "alternates": []
  10036. },
  10037. "Ext.panel.Bar": {
  10038. "idx": 434,
  10039. "alias": [],
  10040. "alternates": []
  10041. },
  10042. "Ext.panel.DD": {
  10043. "idx": 452,
  10044. "alias": [],
  10045. "alternates": []
  10046. },
  10047. "Ext.panel.Header": {
  10048. "idx": 437,
  10049. "alias": [
  10050. "widget.header"
  10051. ],
  10052. "alternates": []
  10053. },
  10054. "Ext.panel.Panel": {
  10055. "idx": 456,
  10056. "alias": [
  10057. "widget.panel"
  10058. ],
  10059. "alternates": [
  10060. "Ext.Panel"
  10061. ]
  10062. },
  10063. "Ext.panel.Pinnable": {
  10064. "idx": 649,
  10065. "alias": [],
  10066. "alternates": []
  10067. },
  10068. "Ext.panel.Proxy": {
  10069. "idx": 451,
  10070. "alias": [],
  10071. "alternates": [
  10072. "Ext.dd.PanelProxy"
  10073. ]
  10074. },
  10075. "Ext.panel.Table": {
  10076. "idx": 558,
  10077. "alias": [
  10078. "widget.tablepanel"
  10079. ],
  10080. "alternates": []
  10081. },
  10082. "Ext.panel.Title": {
  10083. "idx": 435,
  10084. "alias": [
  10085. "widget.title"
  10086. ],
  10087. "alternates": []
  10088. },
  10089. "Ext.panel.Tool": {
  10090. "idx": 436,
  10091. "alias": [
  10092. "widget.tool"
  10093. ],
  10094. "alternates": []
  10095. },
  10096. "Ext.parse.Parser": {
  10097. "idx": 217,
  10098. "alias": [],
  10099. "alternates": []
  10100. },
  10101. "Ext.parse.Symbol": {
  10102. "idx": 211,
  10103. "alias": [],
  10104. "alternates": []
  10105. },
  10106. "Ext.parse.Tokenizer": {
  10107. "idx": 210,
  10108. "alias": [],
  10109. "alternates": []
  10110. },
  10111. "Ext.parse.symbol.Constant": {
  10112. "idx": 212,
  10113. "alias": [],
  10114. "alternates": []
  10115. },
  10116. "Ext.parse.symbol.Infix": {
  10117. "idx": 213,
  10118. "alias": [],
  10119. "alternates": []
  10120. },
  10121. "Ext.parse.symbol.InfixRight": {
  10122. "idx": 214,
  10123. "alias": [],
  10124. "alternates": []
  10125. },
  10126. "Ext.parse.symbol.Paren": {
  10127. "idx": 215,
  10128. "alias": [],
  10129. "alternates": []
  10130. },
  10131. "Ext.parse.symbol.Prefix": {
  10132. "idx": 216,
  10133. "alias": [],
  10134. "alternates": []
  10135. },
  10136. "Ext.perf.Accumulator": {
  10137. "idx": 371,
  10138. "alias": [],
  10139. "alternates": []
  10140. },
  10141. "Ext.perf.Monitor": {
  10142. "idx": 372,
  10143. "alias": [],
  10144. "alternates": [
  10145. "Ext.Perf"
  10146. ]
  10147. },
  10148. "Ext.picker.Color": {
  10149. "idx": 544,
  10150. "alias": [
  10151. "widget.colorpicker"
  10152. ],
  10153. "alternates": [
  10154. "Ext.ColorPalette"
  10155. ]
  10156. },
  10157. "Ext.picker.Date": {
  10158. "idx": 533,
  10159. "alias": [
  10160. "widget.datepicker"
  10161. ],
  10162. "alternates": [
  10163. "Ext.DatePicker"
  10164. ]
  10165. },
  10166. "Ext.picker.Month": {
  10167. "idx": 532,
  10168. "alias": [
  10169. "widget.monthpicker"
  10170. ],
  10171. "alternates": [
  10172. "Ext.MonthPicker"
  10173. ]
  10174. },
  10175. "Ext.picker.Time": {
  10176. "idx": 551,
  10177. "alias": [
  10178. "widget.timepicker"
  10179. ],
  10180. "alternates": []
  10181. },
  10182. "Ext.plugin.Abstract": {
  10183. "idx": 84,
  10184. "alias": [],
  10185. "alternates": [
  10186. "Ext.AbstractPlugin"
  10187. ]
  10188. },
  10189. "Ext.plugin.AbstractClipboard": {
  10190. "idx": 373,
  10191. "alias": [],
  10192. "alternates": []
  10193. },
  10194. "Ext.plugin.LazyItems": {
  10195. "idx": 650,
  10196. "alias": [
  10197. "plugin.lazyitems"
  10198. ],
  10199. "alternates": []
  10200. },
  10201. "Ext.plugin.Manager": {
  10202. "idx": 103,
  10203. "alias": [],
  10204. "alternates": [
  10205. "Ext.PluginManager",
  10206. "Ext.PluginMgr"
  10207. ]
  10208. },
  10209. "Ext.plugin.MouseEnter": {
  10210. "idx": 374,
  10211. "alias": [
  10212. "plugin.mouseenter"
  10213. ],
  10214. "alternates": []
  10215. },
  10216. "Ext.plugin.Responsive": {
  10217. "idx": 651,
  10218. "alias": [
  10219. "plugin.responsive"
  10220. ],
  10221. "alternates": []
  10222. },
  10223. "Ext.plugin.Viewport": {
  10224. "idx": 460,
  10225. "alias": [
  10226. "plugin.viewport"
  10227. ],
  10228. "alternates": []
  10229. },
  10230. "Ext.promise.Consequence": {
  10231. "idx": 7,
  10232. "alias": [],
  10233. "alternates": []
  10234. },
  10235. "Ext.promise.Deferred": {
  10236. "idx": 8,
  10237. "alias": [],
  10238. "alternates": []
  10239. },
  10240. "Ext.promise.Promise": {
  10241. "idx": 9,
  10242. "alias": [],
  10243. "alternates": []
  10244. },
  10245. "Ext.resizer.BorderSplitter": {
  10246. "idx": 641,
  10247. "alias": [
  10248. "widget.bordersplitter"
  10249. ],
  10250. "alternates": []
  10251. },
  10252. "Ext.resizer.BorderSplitterTracker": {
  10253. "idx": 652,
  10254. "alias": [],
  10255. "alternates": []
  10256. },
  10257. "Ext.resizer.Handle": {
  10258. "idx": 653,
  10259. "alias": [],
  10260. "alternates": []
  10261. },
  10262. "Ext.resizer.ResizeTracker": {
  10263. "idx": 654,
  10264. "alias": [],
  10265. "alternates": []
  10266. },
  10267. "Ext.resizer.Resizer": {
  10268. "idx": 655,
  10269. "alias": [],
  10270. "alternates": [
  10271. "Ext.Resizable"
  10272. ]
  10273. },
  10274. "Ext.resizer.Splitter": {
  10275. "idx": 441,
  10276. "alias": [
  10277. "widget.splitter"
  10278. ],
  10279. "alternates": []
  10280. },
  10281. "Ext.resizer.SplitterTracker": {
  10282. "idx": 467,
  10283. "alias": [],
  10284. "alternates": []
  10285. },
  10286. "Ext.route.Action": {
  10287. "idx": 123,
  10288. "alias": [],
  10289. "alternates": []
  10290. },
  10291. "Ext.route.Handler": {
  10292. "idx": 122,
  10293. "alias": [],
  10294. "alternates": []
  10295. },
  10296. "Ext.route.Mixin": {
  10297. "idx": 127,
  10298. "alias": [],
  10299. "alternates": []
  10300. },
  10301. "Ext.route.Route": {
  10302. "idx": 124,
  10303. "alias": [],
  10304. "alternates": []
  10305. },
  10306. "Ext.route.Router": {
  10307. "idx": 126,
  10308. "alias": [],
  10309. "alternates": []
  10310. },
  10311. "Ext.scroll.LockingScroller": {
  10312. "idx": 611,
  10313. "alias": [
  10314. "scroller.locking"
  10315. ],
  10316. "alternates": []
  10317. },
  10318. "Ext.scroll.Scroller": {
  10319. "idx": 110,
  10320. "alias": [
  10321. "scroller.scroller"
  10322. ],
  10323. "alternates": [
  10324. "Ext.scroll.NativeScroller"
  10325. ]
  10326. },
  10327. "Ext.scroll.TableScroller": {
  10328. "idx": 565,
  10329. "alias": [
  10330. "scroller.table"
  10331. ],
  10332. "alternates": []
  10333. },
  10334. "Ext.selection.CellModel": {
  10335. "idx": 656,
  10336. "alias": [
  10337. "selection.cellmodel"
  10338. ],
  10339. "alternates": []
  10340. },
  10341. "Ext.selection.CheckboxModel": {
  10342. "idx": 658,
  10343. "alias": [
  10344. "selection.checkboxmodel"
  10345. ],
  10346. "alternates": []
  10347. },
  10348. "Ext.selection.DataViewModel": {
  10349. "idx": 518,
  10350. "alias": [
  10351. "selection.dataviewmodel"
  10352. ],
  10353. "alternates": []
  10354. },
  10355. "Ext.selection.Model": {
  10356. "idx": 517,
  10357. "alias": [
  10358. "selection.abstract"
  10359. ],
  10360. "alternates": [
  10361. "Ext.AbstractSelectionModel"
  10362. ]
  10363. },
  10364. "Ext.selection.RowModel": {
  10365. "idx": 657,
  10366. "alias": [
  10367. "selection.rowmodel"
  10368. ],
  10369. "alternates": []
  10370. },
  10371. "Ext.selection.TreeModel": {
  10372. "idx": 659,
  10373. "alias": [
  10374. "selection.treemodel"
  10375. ],
  10376. "alternates": []
  10377. },
  10378. "Ext.slider.Multi": {
  10379. "idx": 662,
  10380. "alias": [
  10381. "widget.multislider"
  10382. ],
  10383. "alternates": [
  10384. "Ext.slider.MultiSlider"
  10385. ]
  10386. },
  10387. "Ext.slider.Single": {
  10388. "idx": 663,
  10389. "alias": [
  10390. "widget.slider",
  10391. "widget.sliderfield"
  10392. ],
  10393. "alternates": [
  10394. "Ext.Slider",
  10395. "Ext.form.SliderField",
  10396. "Ext.slider.SingleSlider",
  10397. "Ext.slider.Slider"
  10398. ]
  10399. },
  10400. "Ext.slider.Thumb": {
  10401. "idx": 660,
  10402. "alias": [],
  10403. "alternates": []
  10404. },
  10405. "Ext.slider.Tip": {
  10406. "idx": 661,
  10407. "alias": [
  10408. "widget.slidertip"
  10409. ],
  10410. "alternates": []
  10411. },
  10412. "Ext.slider.Widget": {
  10413. "idx": 664,
  10414. "alias": [
  10415. "widget.sliderwidget"
  10416. ],
  10417. "alternates": []
  10418. },
  10419. "Ext.sparkline.Bar": {
  10420. "idx": 383,
  10421. "alias": [
  10422. "widget.sparklinebar"
  10423. ],
  10424. "alternates": []
  10425. },
  10426. "Ext.sparkline.BarBase": {
  10427. "idx": 381,
  10428. "alias": [],
  10429. "alternates": []
  10430. },
  10431. "Ext.sparkline.Base": {
  10432. "idx": 380,
  10433. "alias": [
  10434. "widget.sparkline"
  10435. ],
  10436. "alternates": []
  10437. },
  10438. "Ext.sparkline.Box": {
  10439. "idx": 384,
  10440. "alias": [
  10441. "widget.sparklinebox"
  10442. ],
  10443. "alternates": []
  10444. },
  10445. "Ext.sparkline.Bullet": {
  10446. "idx": 385,
  10447. "alias": [
  10448. "widget.sparklinebullet"
  10449. ],
  10450. "alternates": []
  10451. },
  10452. "Ext.sparkline.CanvasBase": {
  10453. "idx": 376,
  10454. "alias": [],
  10455. "alternates": []
  10456. },
  10457. "Ext.sparkline.CanvasCanvas": {
  10458. "idx": 377,
  10459. "alias": [],
  10460. "alternates": []
  10461. },
  10462. "Ext.sparkline.Discrete": {
  10463. "idx": 386,
  10464. "alias": [
  10465. "widget.sparklinediscrete"
  10466. ],
  10467. "alternates": []
  10468. },
  10469. "Ext.sparkline.Line": {
  10470. "idx": 387,
  10471. "alias": [
  10472. "widget.sparklineline"
  10473. ],
  10474. "alternates": []
  10475. },
  10476. "Ext.sparkline.Pie": {
  10477. "idx": 388,
  10478. "alias": [
  10479. "widget.sparklinepie"
  10480. ],
  10481. "alternates": []
  10482. },
  10483. "Ext.sparkline.RangeMap": {
  10484. "idx": 382,
  10485. "alias": [],
  10486. "alternates": []
  10487. },
  10488. "Ext.sparkline.Shape": {
  10489. "idx": 375,
  10490. "alias": [],
  10491. "alternates": []
  10492. },
  10493. "Ext.sparkline.TriState": {
  10494. "idx": 389,
  10495. "alias": [
  10496. "widget.sparklinetristate"
  10497. ],
  10498. "alternates": []
  10499. },
  10500. "Ext.sparkline.VmlCanvas": {
  10501. "idx": 378,
  10502. "alias": [],
  10503. "alternates": []
  10504. },
  10505. "Ext.state.CookieProvider": {
  10506. "idx": 665,
  10507. "alias": [],
  10508. "alternates": []
  10509. },
  10510. "Ext.state.LocalStorageProvider": {
  10511. "idx": 666,
  10512. "alias": [
  10513. "state.localstorage"
  10514. ],
  10515. "alternates": []
  10516. },
  10517. "Ext.state.Manager": {
  10518. "idx": 115,
  10519. "alias": [],
  10520. "alternates": []
  10521. },
  10522. "Ext.state.Provider": {
  10523. "idx": 114,
  10524. "alias": [],
  10525. "alternates": []
  10526. },
  10527. "Ext.state.Stateful": {
  10528. "idx": 116,
  10529. "alias": [],
  10530. "alternates": []
  10531. },
  10532. "Ext.tab.Bar": {
  10533. "idx": 668,
  10534. "alias": [
  10535. "widget.tabbar"
  10536. ],
  10537. "alternates": []
  10538. },
  10539. "Ext.tab.Panel": {
  10540. "idx": 669,
  10541. "alias": [
  10542. "widget.tabpanel"
  10543. ],
  10544. "alternates": [
  10545. "Ext.TabPanel"
  10546. ]
  10547. },
  10548. "Ext.tab.Tab": {
  10549. "idx": 667,
  10550. "alias": [
  10551. "widget.tab"
  10552. ],
  10553. "alternates": []
  10554. },
  10555. "Ext.tip.QuickTip": {
  10556. "idx": 542,
  10557. "alias": [
  10558. "widget.quicktip"
  10559. ],
  10560. "alternates": [
  10561. "Ext.QuickTip"
  10562. ]
  10563. },
  10564. "Ext.tip.QuickTipManager": {
  10565. "idx": 543,
  10566. "alias": [],
  10567. "alternates": [
  10568. "Ext.QuickTips"
  10569. ]
  10570. },
  10571. "Ext.tip.Tip": {
  10572. "idx": 540,
  10573. "alias": [
  10574. "widget.tip"
  10575. ],
  10576. "alternates": [
  10577. "Ext.Tip"
  10578. ]
  10579. },
  10580. "Ext.tip.ToolTip": {
  10581. "idx": 541,
  10582. "alias": [
  10583. "widget.tooltip"
  10584. ],
  10585. "alternates": [
  10586. "Ext.ToolTip"
  10587. ]
  10588. },
  10589. "Ext.toolbar.Breadcrumb": {
  10590. "idx": 670,
  10591. "alias": [
  10592. "widget.breadcrumb"
  10593. ],
  10594. "alternates": []
  10595. },
  10596. "Ext.toolbar.Fill": {
  10597. "idx": 671,
  10598. "alias": [
  10599. "widget.tbfill"
  10600. ],
  10601. "alternates": [
  10602. "Ext.Toolbar.Fill"
  10603. ]
  10604. },
  10605. "Ext.toolbar.Item": {
  10606. "idx": 524,
  10607. "alias": [
  10608. "widget.tbitem"
  10609. ],
  10610. "alternates": [
  10611. "Ext.Toolbar.Item"
  10612. ]
  10613. },
  10614. "Ext.toolbar.Paging": {
  10615. "idx": 529,
  10616. "alias": [
  10617. "widget.pagingtoolbar"
  10618. ],
  10619. "alternates": [
  10620. "Ext.PagingToolbar"
  10621. ]
  10622. },
  10623. "Ext.toolbar.Separator": {
  10624. "idx": 546,
  10625. "alias": [
  10626. "widget.tbseparator"
  10627. ],
  10628. "alternates": [
  10629. "Ext.Toolbar.Separator"
  10630. ]
  10631. },
  10632. "Ext.toolbar.Spacer": {
  10633. "idx": 672,
  10634. "alias": [
  10635. "widget.tbspacer"
  10636. ],
  10637. "alternates": [
  10638. "Ext.Toolbar.Spacer"
  10639. ]
  10640. },
  10641. "Ext.toolbar.TextItem": {
  10642. "idx": 525,
  10643. "alias": [
  10644. "widget.tbtext"
  10645. ],
  10646. "alternates": [
  10647. "Ext.Toolbar.TextItem"
  10648. ]
  10649. },
  10650. "Ext.toolbar.Toolbar": {
  10651. "idx": 445,
  10652. "alias": [
  10653. "widget.toolbar"
  10654. ],
  10655. "alternates": [
  10656. "Ext.Toolbar"
  10657. ]
  10658. },
  10659. "Ext.tree.Column": {
  10660. "idx": 673,
  10661. "alias": [
  10662. "widget.treecolumn"
  10663. ],
  10664. "alternates": []
  10665. },
  10666. "Ext.tree.NavigationModel": {
  10667. "idx": 674,
  10668. "alias": [
  10669. "view.navigation.tree"
  10670. ],
  10671. "alternates": []
  10672. },
  10673. "Ext.tree.Panel": {
  10674. "idx": 676,
  10675. "alias": [
  10676. "widget.treepanel"
  10677. ],
  10678. "alternates": [
  10679. "Ext.tree.TreePanel",
  10680. "Ext.TreePanel"
  10681. ]
  10682. },
  10683. "Ext.tree.View": {
  10684. "idx": 675,
  10685. "alias": [
  10686. "widget.treeview"
  10687. ],
  10688. "alternates": []
  10689. },
  10690. "Ext.tree.ViewDragZone": {
  10691. "idx": 678,
  10692. "alias": [],
  10693. "alternates": []
  10694. },
  10695. "Ext.tree.ViewDropZone": {
  10696. "idx": 679,
  10697. "alias": [],
  10698. "alternates": []
  10699. },
  10700. "Ext.tree.plugin.TreeViewDragDrop": {
  10701. "idx": 680,
  10702. "alias": [
  10703. "plugin.treeviewdragdrop"
  10704. ],
  10705. "alternates": []
  10706. },
  10707. "Ext.util.AbstractMixedCollection": {
  10708. "idx": 53,
  10709. "alias": [],
  10710. "alternates": []
  10711. },
  10712. "Ext.util.Animate": {
  10713. "idx": 74,
  10714. "alias": [],
  10715. "alternates": []
  10716. },
  10717. "Ext.util.Bag": {
  10718. "idx": 189,
  10719. "alias": [],
  10720. "alternates": []
  10721. },
  10722. "Ext.util.Base64": {
  10723. "idx": 390,
  10724. "alias": [],
  10725. "alternates": []
  10726. },
  10727. "Ext.util.BasicFilter": {
  10728. "idx": 50,
  10729. "alias": [],
  10730. "alternates": []
  10731. },
  10732. "Ext.util.CSS": {
  10733. "idx": 104,
  10734. "alias": [],
  10735. "alternates": []
  10736. },
  10737. "Ext.util.CSV": {
  10738. "idx": 392,
  10739. "alias": [],
  10740. "alternates": []
  10741. },
  10742. "Ext.util.ClickRepeater": {
  10743. "idx": 393,
  10744. "alias": [],
  10745. "alternates": [
  10746. "Ext.util.TapRepeater"
  10747. ]
  10748. },
  10749. "Ext.util.Collection": {
  10750. "idx": 132,
  10751. "alias": [],
  10752. "alternates": []
  10753. },
  10754. "Ext.util.CollectionKey": {
  10755. "idx": 130,
  10756. "alias": [],
  10757. "alternates": []
  10758. },
  10759. "Ext.util.Color": {
  10760. "idx": 379,
  10761. "alias": [],
  10762. "alternates": [
  10763. "Ext.draw.Color"
  10764. ]
  10765. },
  10766. "Ext.util.ComponentDragger": {
  10767. "idx": 488,
  10768. "alias": [],
  10769. "alternates": []
  10770. },
  10771. "Ext.util.Cookies": {
  10772. "idx": 394,
  10773. "alias": [],
  10774. "alternates": []
  10775. },
  10776. "Ext.util.DelimitedValue": {
  10777. "idx": 391,
  10778. "alias": [],
  10779. "alternates": []
  10780. },
  10781. "Ext.util.ElementContainer": {
  10782. "idx": 112,
  10783. "alias": [],
  10784. "alternates": []
  10785. },
  10786. "Ext.util.Event": {
  10787. "idx": 2,
  10788. "alias": [],
  10789. "alternates": []
  10790. },
  10791. "Ext.util.Filter": {
  10792. "idx": 51,
  10793. "alias": [],
  10794. "alternates": []
  10795. },
  10796. "Ext.util.FilterCollection": {
  10797. "idx": 177,
  10798. "alias": [],
  10799. "alternates": []
  10800. },
  10801. "Ext.util.Floating": {
  10802. "idx": 111,
  10803. "alias": [],
  10804. "alternates": []
  10805. },
  10806. "Ext.util.Fly": {
  10807. "idx": 209,
  10808. "alias": [],
  10809. "alternates": []
  10810. },
  10811. "Ext.util.Format": {
  10812. "idx": 94,
  10813. "alias": [],
  10814. "alternates": []
  10815. },
  10816. "Ext.util.Group": {
  10817. "idx": 169,
  10818. "alias": [],
  10819. "alternates": []
  10820. },
  10821. "Ext.util.GroupCollection": {
  10822. "idx": 178,
  10823. "alias": [],
  10824. "alternates": []
  10825. },
  10826. "Ext.util.Grouper": {
  10827. "idx": 131,
  10828. "alias": [],
  10829. "alternates": []
  10830. },
  10831. "Ext.util.HashMap": {
  10832. "idx": 5,
  10833. "alias": [],
  10834. "alternates": []
  10835. },
  10836. "Ext.util.History": {
  10837. "idx": 125,
  10838. "alias": [],
  10839. "alternates": [
  10840. "Ext.History"
  10841. ]
  10842. },
  10843. "Ext.util.Inflector": {
  10844. "idx": 140,
  10845. "alias": [],
  10846. "alternates": []
  10847. },
  10848. "Ext.util.ItemCollection": {
  10849. "idx": 395,
  10850. "alias": [],
  10851. "alternates": [
  10852. "Ext.ItemCollection"
  10853. ]
  10854. },
  10855. "Ext.util.KeyMap": {
  10856. "idx": 362,
  10857. "alias": [],
  10858. "alternates": [
  10859. "Ext.KeyMap"
  10860. ]
  10861. },
  10862. "Ext.util.KeyNav": {
  10863. "idx": 363,
  10864. "alias": [],
  10865. "alternates": [
  10866. "Ext.KeyNav"
  10867. ]
  10868. },
  10869. "Ext.util.LocalStorage": {
  10870. "idx": 396,
  10871. "alias": [],
  10872. "alternates": []
  10873. },
  10874. "Ext.util.LruCache": {
  10875. "idx": 23,
  10876. "alias": [],
  10877. "alternates": []
  10878. },
  10879. "Ext.util.Memento": {
  10880. "idx": 454,
  10881. "alias": [],
  10882. "alternates": []
  10883. },
  10884. "Ext.util.MixedCollection": {
  10885. "idx": 56,
  10886. "alias": [],
  10887. "alternates": []
  10888. },
  10889. "Ext.util.ObjectTemplate": {
  10890. "idx": 134,
  10891. "alias": [],
  10892. "alternates": []
  10893. },
  10894. "Ext.util.Observable": {
  10895. "idx": 52,
  10896. "alias": [],
  10897. "alternates": []
  10898. },
  10899. "Ext.util.Offset": {
  10900. "idx": 33,
  10901. "alias": [],
  10902. "alternates": []
  10903. },
  10904. "Ext.util.PaintMonitor": {
  10905. "idx": 47,
  10906. "alias": [],
  10907. "alternates": []
  10908. },
  10909. "Ext.util.Point": {
  10910. "idx": 35,
  10911. "alias": [],
  10912. "alternates": []
  10913. },
  10914. "Ext.util.Positionable": {
  10915. "idx": 26,
  10916. "alias": [],
  10917. "alternates": []
  10918. },
  10919. "Ext.util.ProtoElement": {
  10920. "idx": 101,
  10921. "alias": [],
  10922. "alternates": []
  10923. },
  10924. "Ext.util.Queue": {
  10925. "idx": 633,
  10926. "alias": [],
  10927. "alternates": []
  10928. },
  10929. "Ext.util.Region": {
  10930. "idx": 34,
  10931. "alias": [],
  10932. "alternates": []
  10933. },
  10934. "Ext.util.Renderable": {
  10935. "idx": 113,
  10936. "alias": [],
  10937. "alternates": []
  10938. },
  10939. "Ext.util.Schedulable": {
  10940. "idx": 200,
  10941. "alias": [],
  10942. "alternates": []
  10943. },
  10944. "Ext.util.Scheduler": {
  10945. "idx": 190,
  10946. "alias": [],
  10947. "alternates": []
  10948. },
  10949. "Ext.util.SizeMonitor": {
  10950. "idx": 43,
  10951. "alias": [],
  10952. "alternates": []
  10953. },
  10954. "Ext.util.Sortable": {
  10955. "idx": 55,
  10956. "alias": [],
  10957. "alternates": []
  10958. },
  10959. "Ext.util.Sorter": {
  10960. "idx": 54,
  10961. "alias": [],
  10962. "alternates": []
  10963. },
  10964. "Ext.util.SorterCollection": {
  10965. "idx": 176,
  10966. "alias": [],
  10967. "alternates": []
  10968. },
  10969. "Ext.util.Spans": {
  10970. "idx": 397,
  10971. "alias": [],
  10972. "alternates": []
  10973. },
  10974. "Ext.util.StoreHolder": {
  10975. "idx": 420,
  10976. "alias": [],
  10977. "alternates": []
  10978. },
  10979. "Ext.util.TaskManager": {
  10980. "idx": 399,
  10981. "alias": [],
  10982. "alternates": [
  10983. "Ext.TaskManager"
  10984. ]
  10985. },
  10986. "Ext.util.TaskRunner": {
  10987. "idx": 57,
  10988. "alias": [],
  10989. "alternates": []
  10990. },
  10991. "Ext.util.TextMetrics": {
  10992. "idx": 400,
  10993. "alias": [],
  10994. "alternates": []
  10995. },
  10996. "Ext.util.TsvDecoder": {
  10997. "idx": 398,
  10998. "alias": [],
  10999. "alternates": [
  11000. "Ext.util.TSV"
  11001. ]
  11002. },
  11003. "Ext.util.XTemplateCompiler": {
  11004. "idx": 97,
  11005. "alias": [],
  11006. "alternates": []
  11007. },
  11008. "Ext.util.XTemplateParser": {
  11009. "idx": 96,
  11010. "alias": [],
  11011. "alternates": []
  11012. },
  11013. "Ext.util.paintmonitor.Abstract": {
  11014. "idx": 45,
  11015. "alias": [],
  11016. "alternates": []
  11017. },
  11018. "Ext.util.paintmonitor.CssAnimation": {
  11019. "idx": 46,
  11020. "alias": [],
  11021. "alternates": []
  11022. },
  11023. "Ext.util.paintmonitor.OverflowChange": {
  11024. "idx": 401,
  11025. "alias": [],
  11026. "alternates": []
  11027. },
  11028. "Ext.util.sizemonitor.Abstract": {
  11029. "idx": 41,
  11030. "alias": [],
  11031. "alternates": []
  11032. },
  11033. "Ext.util.sizemonitor.OverflowChange": {
  11034. "idx": 402,
  11035. "alias": [],
  11036. "alternates": []
  11037. },
  11038. "Ext.util.sizemonitor.Scroll": {
  11039. "idx": 42,
  11040. "alias": [],
  11041. "alternates": []
  11042. },
  11043. "Ext.util.translatable.Abstract": {
  11044. "idx": 107,
  11045. "alias": [],
  11046. "alternates": []
  11047. },
  11048. "Ext.util.translatable.CssPosition": {
  11049. "idx": 403,
  11050. "alias": [
  11051. "translatable.cssposition"
  11052. ],
  11053. "alternates": []
  11054. },
  11055. "Ext.util.translatable.CssTransform": {
  11056. "idx": 404,
  11057. "alias": [
  11058. "translatable.csstransform"
  11059. ],
  11060. "alternates": []
  11061. },
  11062. "Ext.util.translatable.Dom": {
  11063. "idx": 108,
  11064. "alias": [
  11065. "translatable.dom"
  11066. ],
  11067. "alternates": []
  11068. },
  11069. "Ext.util.translatable.ScrollParent": {
  11070. "idx": 405,
  11071. "alias": [
  11072. "translatable.scrollparent"
  11073. ],
  11074. "alternates": []
  11075. },
  11076. "Ext.util.translatable.ScrollPosition": {
  11077. "idx": 109,
  11078. "alias": [
  11079. "translatable.scrollposition"
  11080. ],
  11081. "alternates": []
  11082. },
  11083. "Ext.view.AbstractView": {
  11084. "idx": 520,
  11085. "alias": [],
  11086. "alternates": []
  11087. },
  11088. "Ext.view.BoundList": {
  11089. "idx": 530,
  11090. "alias": [
  11091. "widget.boundlist"
  11092. ],
  11093. "alternates": [
  11094. "Ext.BoundList"
  11095. ]
  11096. },
  11097. "Ext.view.BoundListKeyNav": {
  11098. "idx": 522,
  11099. "alias": [
  11100. "view.navigation.boundlist"
  11101. ],
  11102. "alternates": []
  11103. },
  11104. "Ext.view.DragZone": {
  11105. "idx": 677,
  11106. "alias": [],
  11107. "alternates": []
  11108. },
  11109. "Ext.view.DropZone": {
  11110. "idx": 572,
  11111. "alias": [],
  11112. "alternates": []
  11113. },
  11114. "Ext.view.MultiSelector": {
  11115. "idx": 682,
  11116. "alias": [
  11117. "widget.multiselector"
  11118. ],
  11119. "alternates": []
  11120. },
  11121. "Ext.view.MultiSelectorSearch": {
  11122. "idx": 681,
  11123. "alias": [
  11124. "widget.multiselector-search"
  11125. ],
  11126. "alternates": []
  11127. },
  11128. "Ext.view.NavigationModel": {
  11129. "idx": 519,
  11130. "alias": [
  11131. "view.navigation.default"
  11132. ],
  11133. "alternates": []
  11134. },
  11135. "Ext.view.NodeCache": {
  11136. "idx": 564,
  11137. "alias": [],
  11138. "alternates": []
  11139. },
  11140. "Ext.view.Table": {
  11141. "idx": 566,
  11142. "alias": [
  11143. "widget.gridview",
  11144. "widget.tableview"
  11145. ],
  11146. "alternates": [
  11147. "Ext.grid.View"
  11148. ]
  11149. },
  11150. "Ext.view.TableLayout": {
  11151. "idx": 562,
  11152. "alias": [
  11153. "layout.tableview"
  11154. ],
  11155. "alternates": []
  11156. },
  11157. "Ext.view.TagKeyNav": {
  11158. "idx": 549,
  11159. "alias": [
  11160. "view.navigation.tagfield"
  11161. ],
  11162. "alternates": []
  11163. },
  11164. "Ext.view.View": {
  11165. "idx": 521,
  11166. "alias": [
  11167. "widget.dataview"
  11168. ],
  11169. "alternates": [
  11170. "Ext.DataView"
  11171. ]
  11172. },
  11173. "Ext.window.MessageBox": {
  11174. "idx": 498,
  11175. "alias": [
  11176. "widget.messagebox"
  11177. ],
  11178. "alternates": []
  11179. },
  11180. "Ext.window.Toast": {
  11181. "idx": 683,
  11182. "alias": [
  11183. "widget.toast"
  11184. ],
  11185. "alternates": []
  11186. },
  11187. "Ext.window.Window": {
  11188. "idx": 489,
  11189. "alias": [
  11190. "widget.window"
  11191. ],
  11192. "alternates": [
  11193. "Ext.Window"
  11194. ]
  11195. }
  11196. },
  11197. "packages": {
  11198. "classic": {
  11199. "css": true,
  11200. "included": true,
  11201. "language": {
  11202. "js": {
  11203. "input": {
  11204. "version": "ES5"
  11205. }
  11206. }
  11207. },
  11208. "namespace": "Ext",
  11209. "properties": {
  11210. "skip.sass": 1,
  11211. "skip.pkg": 1,
  11212. "skip.slice": 1
  11213. },
  11214. "required": true,
  11215. "requires": [
  11216. "ext",
  11217. "core",
  11218. "classic"
  11219. ],
  11220. "version": "7.0.0"
  11221. },
  11222. "cmd": {
  11223. "version": "7.0.0.40"
  11224. },
  11225. "core": {
  11226. "css": true,
  11227. "included": true,
  11228. "properties": {
  11229. "skip.slice": 1,
  11230. "skip.style": 1,
  11231. "skip.pkg": 1,
  11232. "package.tags.classdefs": "class"
  11233. },
  11234. "required": true,
  11235. "requires": [
  11236. "ext"
  11237. ],
  11238. "version": "7.0.0"
  11239. },
  11240. "ext": {
  11241. "css": true,
  11242. "included": true,
  11243. "language": {
  11244. "js": {
  11245. "input": {
  11246. "version": "ES5"
  11247. }
  11248. }
  11249. },
  11250. "license": "dev",
  11251. "namespace": "Ext",
  11252. "properties": {
  11253. "skip.sass": 1,
  11254. "skip.slice": 1
  11255. },
  11256. "required": true,
  11257. "requires": [],
  11258. "version": "7.0.0.168"
  11259. }
  11260. },
  11261. "bootRelative": true
  11262. });
  11263. // @tag core
  11264. // @define Ext.Boot
  11265. var Ext = Ext || {};
  11266. //<editor-fold desc="Boot">
  11267. /**
  11268. * @class Ext.Boot
  11269. * @singleton
  11270. * @private
  11271. */
  11272. Ext.Boot = Ext.Boot || (function(emptyFn) {
  11273. var doc = document,
  11274. _emptyArray = [],
  11275. _config = {
  11276. /**
  11277. * @cfg {Boolean} [disableCaching=true]
  11278. * If `true` current timestamp is added to script URL's to prevent caching.
  11279. * In debug builds, adding a "cache" or "disableCacheBuster" query parameter
  11280. * to the page's URL will set this to `false`.
  11281. */
  11282. disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) || !(/http[s]?\:/i.test(location.href)) || /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false : true,
  11283. /**
  11284. * @cfg {String} [disableCachingParam="_dc"]
  11285. * The query parameter name for the cache buster's timestamp.
  11286. */
  11287. disableCachingParam: '_dc',
  11288. /**
  11289. * @cfg {Boolean} loadDelay
  11290. * Millisecond delay between asynchronous script injection (prevents stack
  11291. * overflow on some user agents) 'false' disables delay but potentially
  11292. * increases stack load.
  11293. */
  11294. loadDelay: false,
  11295. /**
  11296. * @cfg {Boolean} preserveScripts
  11297. * `false` to remove asynchronously loaded scripts, `true` to retain script
  11298. * element for browser debugger compatibility and improved load performance.
  11299. */
  11300. preserveScripts: true,
  11301. /**
  11302. * @cfg {String} [charset=UTF-8]
  11303. * Optional charset to specify encoding of dynamic content.
  11304. */
  11305. charset: 'UTF-8'
  11306. },
  11307. _assetConfig = {},
  11308. cssRe = /\.css(?:\?|$)/i,
  11309. resolverEl = doc.createElement('a'),
  11310. isBrowser = typeof window !== 'undefined',
  11311. _environment = {
  11312. browser: isBrowser,
  11313. node: !isBrowser && (typeof require === 'function'),
  11314. phantom: (window && (window._phantom || window.callPhantom)) || /PhantomJS/.test(window.navigator.userAgent)
  11315. },
  11316. _tags = (Ext.platformTags = {}),
  11317. // All calls to _debug are commented out to speed up old browsers a bit;
  11318. // yes that makes a difference because the cost of concatenating strings
  11319. // and passing them into _debug() adds up pretty quickly.
  11320. _debug = function(message) {},
  11321. //console.log(message);
  11322. _apply = function(object, config, defaults) {
  11323. if (defaults) {
  11324. _apply(object, defaults);
  11325. }
  11326. if (object && config && typeof config === 'object') {
  11327. for (var i in config) {
  11328. object[i] = config[i];
  11329. }
  11330. }
  11331. return object;
  11332. },
  11333. _merge = function() {
  11334. var lowerCase = false,
  11335. obj = Array.prototype.shift.call(arguments),
  11336. index, i, len, value;
  11337. if (typeof arguments[arguments.length - 1] === 'boolean') {
  11338. lowerCase = Array.prototype.pop.call(arguments);
  11339. }
  11340. len = arguments.length;
  11341. for (index = 0; index < len; index++) {
  11342. value = arguments[index];
  11343. if (typeof value === 'object') {
  11344. for (i in value) {
  11345. obj[lowerCase ? i.toLowerCase() : i] = value[i];
  11346. }
  11347. }
  11348. }
  11349. return obj;
  11350. },
  11351. _getKeys = (typeof Object.keys == 'function') ? function(object) {
  11352. if (!object) {
  11353. return [];
  11354. }
  11355. return Object.keys(object);
  11356. } : function(object) {
  11357. var keys = [],
  11358. property;
  11359. for (property in object) {
  11360. if (object.hasOwnProperty(property)) {
  11361. keys.push(property);
  11362. }
  11363. }
  11364. return keys;
  11365. },
  11366. /*
  11367. * The Boot loader class manages Request objects that contain one or
  11368. * more individual urls that need to be loaded. Requests can be performed
  11369. * synchronously or asynchronously, but will always evaluate urls in the
  11370. * order specified on the request object.
  11371. */
  11372. Boot = {
  11373. loading: 0,
  11374. loaded: 0,
  11375. apply: _apply,
  11376. env: _environment,
  11377. config: _config,
  11378. /**
  11379. * @cfg {Object} assetConfig
  11380. * A map (url->assetConfig) that contains information about assets loaded by the Microlaoder.
  11381. */
  11382. assetConfig: _assetConfig,
  11383. // Keyed by absolute URL this object holds "true" if that URL is already loaded
  11384. // or an array of callbacks to call once it loads.
  11385. scripts: {},
  11386. /*
  11387. Entry objects
  11388. 'http://foo.com/bar/baz/Thing.js': {
  11389. done: true,
  11390. el: scriptEl || linkEl,
  11391. preserve: true,
  11392. requests: [ request1, ... ]
  11393. }
  11394. */
  11395. /**
  11396. * contains the current script name being loaded
  11397. * (loadSync or sequential load only)
  11398. */
  11399. currentFile: null,
  11400. suspendedQueue: [],
  11401. currentRequest: null,
  11402. // when loadSync is called, need to cause subsequent load requests to also be loadSync,
  11403. // eg, when Ext.require(...) is called
  11404. syncMode: false,
  11405. /*
  11406. * simple helper method for debugging
  11407. */
  11408. debug: _debug,
  11409. /**
  11410. * enables / disables loading scripts via script / link elements rather
  11411. * than using ajax / eval
  11412. */
  11413. useElements: true,
  11414. listeners: [],
  11415. Request: Request,
  11416. Entry: Entry,
  11417. allowMultipleBrowsers: false,
  11418. browserNames: {
  11419. ie: 'IE',
  11420. firefox: 'Firefox',
  11421. safari: 'Safari',
  11422. chrome: 'Chrome',
  11423. opera: 'Opera',
  11424. dolfin: 'Dolfin',
  11425. edge: 'Edge',
  11426. webosbrowser: 'webOSBrowser',
  11427. chromeMobile: 'ChromeMobile',
  11428. chromeiOS: 'ChromeiOS',
  11429. silk: 'Silk',
  11430. other: 'Other'
  11431. },
  11432. osNames: {
  11433. ios: 'iOS',
  11434. android: 'Android',
  11435. windowsPhone: 'WindowsPhone',
  11436. webos: 'webOS',
  11437. blackberry: 'BlackBerry',
  11438. rimTablet: 'RIMTablet',
  11439. mac: 'MacOS',
  11440. win: 'Windows',
  11441. tizen: 'Tizen',
  11442. linux: 'Linux',
  11443. bada: 'Bada',
  11444. chromeOS: 'ChromeOS',
  11445. other: 'Other'
  11446. },
  11447. browserPrefixes: {
  11448. ie: 'MSIE ',
  11449. edge: 'Edge/',
  11450. firefox: 'Firefox/',
  11451. chrome: 'Chrome/',
  11452. safari: 'Version/',
  11453. opera: 'OPR/',
  11454. dolfin: 'Dolfin/',
  11455. webosbrowser: 'wOSBrowser/',
  11456. chromeMobile: 'CrMo/',
  11457. chromeiOS: 'CriOS/',
  11458. silk: 'Silk/'
  11459. },
  11460. // When a UA reports multiple browsers this list is used to prioritize the 'real' browser
  11461. // lower index number will win
  11462. browserPriority: [
  11463. 'edge',
  11464. 'opera',
  11465. 'dolfin',
  11466. 'webosbrowser',
  11467. 'silk',
  11468. 'chromeiOS',
  11469. 'chromeMobile',
  11470. 'ie',
  11471. 'firefox',
  11472. 'safari',
  11473. 'chrome'
  11474. ],
  11475. osPrefixes: {
  11476. tizen: '(Tizen )',
  11477. ios: 'i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS ',
  11478. android: '(Android |HTC_|Silk/)',
  11479. // Some HTC devices ship with an OSX userAgent by default,
  11480. // so we need to add a direct check for HTC_
  11481. windowsPhone: 'Windows Phone ',
  11482. blackberry: '(?:BlackBerry|BB)(?:.*)Version/',
  11483. rimTablet: 'RIM Tablet OS ',
  11484. webos: '(?:webOS|hpwOS)/',
  11485. bada: 'Bada/',
  11486. chromeOS: 'CrOS '
  11487. },
  11488. fallbackOSPrefixes: {
  11489. windows: 'win',
  11490. mac: 'mac',
  11491. linux: 'linux'
  11492. },
  11493. devicePrefixes: {
  11494. iPhone: 'iPhone',
  11495. iPod: 'iPod',
  11496. iPad: 'iPad'
  11497. },
  11498. maxIEVersion: 12,
  11499. /**
  11500. * The default function that detects various platforms and sets tags
  11501. * in the platform map accordingly. Examples are iOS, android, tablet, etc.
  11502. * @param tags the set of tags to populate
  11503. */
  11504. detectPlatformTags: function() {
  11505. var me = this,
  11506. ua = navigator.userAgent,
  11507. isMobile = /Mobile(\/|\s)/.test(ua),
  11508. element = document.createElement('div'),
  11509. isEventSupported = function(name, tag) {
  11510. if (tag === undefined) {
  11511. tag = window;
  11512. }
  11513. var eventName = 'on' + name.toLowerCase(),
  11514. isSupported = (eventName in element);
  11515. if (!isSupported) {
  11516. if (element.setAttribute && element.removeAttribute) {
  11517. element.setAttribute(eventName, '');
  11518. isSupported = typeof element[eventName] === 'function';
  11519. if (typeof element[eventName] !== 'undefined') {
  11520. element[eventName] = undefined;
  11521. }
  11522. element.removeAttribute(eventName);
  11523. }
  11524. }
  11525. return isSupported;
  11526. },
  11527. // Browser Detection
  11528. getBrowsers = function() {
  11529. var browsers = {},
  11530. maxIEVersion, prefix, value, key, index, len, match, version, matched;
  11531. // MS Edge browser (and possibly others) can report multiple browsers in the UserAgent
  11532. // "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"
  11533. // we use this to prioritize the actual browser in this situation
  11534. len = me.browserPriority.length;
  11535. for (index = 0; index < len; index++) {
  11536. key = me.browserPriority[index];
  11537. if (!matched) {
  11538. value = me.browserPrefixes[key];
  11539. match = ua.match(new RegExp('(' + value + ')([\\w\\._]+)'));
  11540. version = match && match.length > 1 ? parseInt(match[2]) : 0;
  11541. if (version) {
  11542. matched = true;
  11543. }
  11544. } else {
  11545. version = 0;
  11546. }
  11547. browsers[key] = version;
  11548. }
  11549. //Deal with IE document mode
  11550. if (browsers.ie) {
  11551. var mode = document.documentMode;
  11552. if (mode >= 8) {
  11553. browsers.ie = mode;
  11554. }
  11555. }
  11556. // Fancy IE greater than and less then quick tags
  11557. version = browsers.ie || false;
  11558. maxIEVersion = Math.max(version, me.maxIEVersion);
  11559. for (index = 8; index <= maxIEVersion; ++index) {
  11560. prefix = 'ie' + index;
  11561. browsers[prefix + 'm'] = version ? version <= index : 0;
  11562. browsers[prefix] = version ? version === index : 0;
  11563. browsers[prefix + 'p'] = version ? version >= index : 0;
  11564. }
  11565. return browsers;
  11566. },
  11567. //OS Detection
  11568. getOperatingSystems = function() {
  11569. var systems = {},
  11570. value, key, keys, index, len, match, matched, version, activeCount;
  11571. keys = _getKeys(me.osPrefixes);
  11572. len = keys.length;
  11573. for (index = 0 , activeCount = 0; index < len; index++) {
  11574. key = keys[index];
  11575. value = me.osPrefixes[key];
  11576. match = ua.match(new RegExp('(' + value + ')([^\\s;]+)'));
  11577. matched = match ? match[1] : null;
  11578. // This is here because some HTC android devices show an OSX Snow Leopard userAgent by default.
  11579. // And the Kindle Fire doesn't have any indicator of Android as the OS in its User Agent
  11580. if (matched && (matched === 'HTC_' || matched === 'Silk/')) {
  11581. version = 2.3;
  11582. } else {
  11583. version = match && match.length > 1 ? parseFloat(match[match.length - 1]) : 0;
  11584. }
  11585. if (version) {
  11586. activeCount++;
  11587. }
  11588. systems[key] = version;
  11589. }
  11590. keys = _getKeys(me.fallbackOSPrefixes);
  11591. // If no OS could be found we resort to the fallbacks, otherwise we just
  11592. // falsify the fallbacks
  11593. len = keys.length;
  11594. for (index = 0; index < len; index++) {
  11595. key = keys[index];
  11596. // No OS was detected from osPrefixes
  11597. if (activeCount === 0) {
  11598. value = me.fallbackOSPrefixes[key];
  11599. match = ua.toLowerCase().match(new RegExp(value));
  11600. systems[key] = match ? true : 0;
  11601. } else {
  11602. systems[key] = 0;
  11603. }
  11604. }
  11605. return systems;
  11606. },
  11607. // Device Detection
  11608. getDevices = function() {
  11609. var devices = {},
  11610. value, key, keys, index, len, match;
  11611. keys = _getKeys(me.devicePrefixes);
  11612. len = keys.length;
  11613. for (index = 0; index < len; index++) {
  11614. key = keys[index];
  11615. value = me.devicePrefixes[key];
  11616. match = ua.match(new RegExp(value));
  11617. devices[key] = match ? true : 0;
  11618. }
  11619. return devices;
  11620. },
  11621. browsers = getBrowsers(),
  11622. systems = getOperatingSystems(),
  11623. devices = getDevices(),
  11624. platformParams = Boot.loadPlatformsParam();
  11625. // We apply platformParams from the query here first to allow for forced user valued
  11626. // to be used in calculation of generated tags
  11627. _merge(_tags, browsers, systems, devices, platformParams, true);
  11628. _tags.phone = !!((_tags.iphone || _tags.ipod) || (!_tags.silk && (_tags.android && (_tags.android < 3 || isMobile))) || (_tags.blackberry && isMobile) || (_tags.windowsphone));
  11629. _tags.tablet = !!(!_tags.phone && (_tags.ipad || _tags.android || _tags.silk || _tags.rimtablet || (_tags.ie10 && /; Touch/.test(ua))));
  11630. _tags.touch = // if the browser has touch events we can be reasonably sure the device has
  11631. // a touch screen
  11632. isEventSupported('touchend') || // browsers that use pointer event have maxTouchPoints > 0 if the
  11633. // device supports touch input
  11634. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  11635. navigator.maxTouchPoints || // IE10 uses a vendor-prefixed maxTouchPoints property
  11636. navigator.msMaxTouchPoints;
  11637. _tags.desktop = !_tags.phone && !_tags.tablet;
  11638. _tags.cordova = _tags.phonegap = !!(window.PhoneGap || window.Cordova || window.cordova);
  11639. _tags.webview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(ua);
  11640. _tags.androidstock = (_tags.android <= 4.3) && (_tags.safari || _tags.silk);
  11641. // Re-apply any query params here to allow for user override of generated tags (desktop, touch, tablet, etc)
  11642. _merge(_tags, platformParams, true);
  11643. },
  11644. /**
  11645. * Extracts user supplied platform tags from the "platformTags" query parameter
  11646. * of the form:
  11647. *
  11648. * ?platformTags=name:state,name:state,...
  11649. *
  11650. * (each tag defaults to true when state is unspecified)
  11651. *
  11652. * Example:
  11653. *
  11654. * ?platformTags=isTablet,isPhone:false,isDesktop:0,iOS:1,Safari:true, ...
  11655. *
  11656. * @returns {Object} the platform tags supplied by the query string
  11657. */
  11658. loadPlatformsParam: function() {
  11659. // Check if the ?platform parameter is set in the URL
  11660. var paramsString = window.location.search.substr(1),
  11661. paramsArray = paramsString.split("&"),
  11662. params = {},
  11663. i,
  11664. platforms = {},
  11665. tmpArray, tmplen, platform, name, enabled;
  11666. for (i = 0; i < paramsArray.length; i++) {
  11667. tmpArray = paramsArray[i].split("=");
  11668. params[tmpArray[0]] = tmpArray[1];
  11669. }
  11670. if (params.platformTags) {
  11671. tmpArray = params.platformTags.split(",");
  11672. for (tmplen = tmpArray.length , i = 0; i < tmplen; i++) {
  11673. platform = tmpArray[i].split(":");
  11674. name = platform[0];
  11675. enabled = true;
  11676. if (platform.length > 1) {
  11677. enabled = platform[1];
  11678. if (enabled === 'false' || enabled === '0') {
  11679. enabled = false;
  11680. }
  11681. }
  11682. platforms[name] = enabled;
  11683. }
  11684. }
  11685. return platforms;
  11686. },
  11687. filterPlatform: function(platform, excludes) {
  11688. platform = _emptyArray.concat(platform || _emptyArray);
  11689. excludes = _emptyArray.concat(excludes || _emptyArray);
  11690. var plen = platform.length,
  11691. elen = excludes.length,
  11692. include = (!plen && elen),
  11693. // default true if only excludes specified
  11694. i, tag;
  11695. for (i = 0; i < plen && !include; i++) {
  11696. tag = platform[i];
  11697. include = !!_tags[tag];
  11698. }
  11699. for (i = 0; i < elen && include; i++) {
  11700. tag = excludes[i];
  11701. include = !_tags[tag];
  11702. }
  11703. return include;
  11704. },
  11705. init: function() {
  11706. var scriptEls = doc.getElementsByTagName('script'),
  11707. script = scriptEls[0],
  11708. len = scriptEls.length,
  11709. re = /\/ext(\-[a-z\-]+)?\.js$/,
  11710. entry, src, state, baseUrl, key, n, origin;
  11711. // No check for script definedness because there always should be at least one
  11712. Boot.hasReadyState = ("readyState" in script);
  11713. Boot.hasAsync = ("async" in script);
  11714. Boot.hasDefer = ("defer" in script);
  11715. Boot.hasOnLoad = ("onload" in script);
  11716. // Feature detecting IE
  11717. Boot.isIE8 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && !Boot.hasOnLoad;
  11718. Boot.isIE9 = Boot.hasReadyState && !Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11719. Boot.isIE10p = Boot.hasReadyState && Boot.hasAsync && Boot.hasDefer && Boot.hasOnLoad;
  11720. if (Boot.isIE8) {
  11721. Boot.isIE10 = false;
  11722. Boot.isIE10m = true;
  11723. } else {
  11724. Boot.isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
  11725. Boot.isIE10m = Boot.isIE10 || Boot.isIE9 || Boot.isIE8;
  11726. }
  11727. // IE11 does not support conditional compilation so we detect it by exclusion
  11728. Boot.isIE11 = Boot.isIE10p && !Boot.isIE10;
  11729. // Since we are loading after other scripts, and we needed to gather them
  11730. // anyway, we track them in _scripts so we don't have to ask for them all
  11731. // repeatedly.
  11732. for (n = 0; n < len; n++) {
  11733. src = (script = scriptEls[n]).src;
  11734. if (!src) {
  11735. continue;
  11736. }
  11737. state = script.readyState || null;
  11738. // If we find a script file called "ext-*.js", then the base path is that file's base path.
  11739. if (!baseUrl && re.test(src)) {
  11740. baseUrl = src;
  11741. }
  11742. if (!Boot.scripts[key = Boot.canonicalUrl(src)]) {
  11743. // _debug("creating entry " + key + " in Boot.init");
  11744. entry = new Entry({
  11745. key: key,
  11746. url: src,
  11747. done: state === null || // non-IE
  11748. state === 'loaded' || state === 'complete',
  11749. // IE only
  11750. el: script,
  11751. prop: 'src'
  11752. });
  11753. }
  11754. }
  11755. if (!baseUrl) {
  11756. script = scriptEls[scriptEls.length - 1];
  11757. baseUrl = script.src;
  11758. }
  11759. Boot.baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
  11760. origin = window.location.origin || window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
  11761. Boot.origin = origin;
  11762. Boot.detectPlatformTags();
  11763. Ext.filterPlatform = Boot.filterPlatform;
  11764. },
  11765. /**
  11766. * This method returns a canonical URL for the given URL.
  11767. *
  11768. * For example, the following all produce the same canonical URL (which is the
  11769. * last one):
  11770. *
  11771. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js?_dc=12345
  11772. * http://foo.com/bar/baz/zoo/derp/../../goo/Thing.js
  11773. * http://foo.com/bar/baz/zoo/derp/../jazz/../../goo/Thing.js
  11774. * http://foo.com/bar/baz/zoo/../goo/Thing.js
  11775. * http://foo.com/bar/baz/goo/Thing.js
  11776. *
  11777. * @private
  11778. */
  11779. canonicalUrl: function(url) {
  11780. // *WARNING WARNING WARNING*
  11781. // This method yields the most correct result we can get but it is EXPENSIVE!
  11782. // In ALL browsers! When called multiple times in a sequence, as if when
  11783. // we resolve dependencies for entries, it will cause garbage collection events
  11784. // and overall painful slowness. This is why we try to avoid it as much as we can.
  11785. //
  11786. // @TODO - see if we need this fallback logic
  11787. // http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
  11788. resolverEl.href = url;
  11789. var ret = resolverEl.href,
  11790. dc = _config.disableCachingParam,
  11791. pos = dc ? ret.indexOf(dc + '=') : -1,
  11792. c, end;
  11793. // If we have a _dc query parameter we need to remove it from the canonical
  11794. // URL.
  11795. if (pos > 0 && ((c = ret.charAt(pos - 1)) === '?' || c === '&')) {
  11796. end = ret.indexOf('&', pos);
  11797. end = (end < 0) ? '' : ret.substring(end);
  11798. if (end && c === '?') {
  11799. ++pos;
  11800. // keep the '?'
  11801. end = end.substring(1);
  11802. }
  11803. // remove the '&'
  11804. ret = ret.substring(0, pos - 1) + end;
  11805. }
  11806. return ret;
  11807. },
  11808. /**
  11809. * Get the config value corresponding to the specified name. If no name is given, will return the config object
  11810. * @param {String} name The config property name
  11811. * @return {Object}
  11812. */
  11813. getConfig: function(name) {
  11814. return name ? Boot.config[name] : Boot.config;
  11815. },
  11816. /**
  11817. * Set the configuration.
  11818. * @param {Object} config The config object to override the default values.
  11819. * @return {Ext.Boot} this
  11820. */
  11821. setConfig: function(name, value) {
  11822. if (typeof name === 'string') {
  11823. Boot.config[name] = value;
  11824. } else {
  11825. for (var s in name) {
  11826. Boot.setConfig(s, name[s]);
  11827. }
  11828. }
  11829. return Boot;
  11830. },
  11831. getHead: function() {
  11832. return Boot.docHead || (Boot.docHead = doc.head || doc.getElementsByTagName('head')[0]);
  11833. },
  11834. create: function(url, key, cfg) {
  11835. var config = cfg || {};
  11836. config.url = url;
  11837. config.key = key;
  11838. return Boot.scripts[key] = new Entry(config);
  11839. },
  11840. getEntry: function(url, cfg, canonicalPath) {
  11841. var key, entry;
  11842. // Canonicalizing URLs via anchor element href yields the most correct result
  11843. // but is *extremely* resource heavy so we need to avoid it whenever possible
  11844. key = canonicalPath ? url : Boot.canonicalUrl(url);
  11845. entry = Boot.scripts[key];
  11846. if (!entry) {
  11847. entry = Boot.create(url, key, cfg);
  11848. if (canonicalPath) {
  11849. entry.canonicalPath = true;
  11850. }
  11851. }
  11852. return entry;
  11853. },
  11854. registerContent: function(url, type, content) {
  11855. var cfg = {
  11856. content: content,
  11857. loaded: true,
  11858. css: type === 'css'
  11859. };
  11860. return Boot.getEntry(url, cfg);
  11861. },
  11862. processRequest: function(request, sync) {
  11863. request.loadEntries(sync);
  11864. },
  11865. load: function(request) {
  11866. // _debug("Boot.load called");
  11867. var request = new Request(request);
  11868. if (request.sync || Boot.syncMode) {
  11869. return Boot.loadSync(request);
  11870. }
  11871. // If there is a request in progress, we must
  11872. // queue this new request to be fired when the current request completes.
  11873. if (Boot.currentRequest) {
  11874. // _debug("current active request, suspending this request");
  11875. // trigger assignment of entries now to ensure that overlapping
  11876. // entries with currently running requests will synchronize state
  11877. // with this pending one as they complete
  11878. request.getEntries();
  11879. Boot.suspendedQueue.push(request);
  11880. } else {
  11881. Boot.currentRequest = request;
  11882. Boot.processRequest(request, false);
  11883. }
  11884. return Boot;
  11885. },
  11886. loadSync: function(request) {
  11887. // _debug("Boot.loadSync called");
  11888. var request = new Request(request);
  11889. Boot.syncMode++;
  11890. Boot.processRequest(request, true);
  11891. Boot.syncMode--;
  11892. return Boot;
  11893. },
  11894. loadBasePrefix: function(request) {
  11895. request = new Request(request);
  11896. request.prependBaseUrl = true;
  11897. return Boot.load(request);
  11898. },
  11899. loadSyncBasePrefix: function(request) {
  11900. request = new Request(request);
  11901. request.prependBaseUrl = true;
  11902. return Boot.loadSync(request);
  11903. },
  11904. requestComplete: function(request) {
  11905. var next;
  11906. if (Boot.currentRequest === request) {
  11907. Boot.currentRequest = null;
  11908. while (Boot.suspendedQueue.length > 0) {
  11909. next = Boot.suspendedQueue.shift();
  11910. if (!next.done) {
  11911. // _debug("resuming suspended request");
  11912. Boot.load(next);
  11913. break;
  11914. }
  11915. }
  11916. }
  11917. if (!Boot.currentRequest && Boot.suspendedQueue.length == 0) {
  11918. Boot.fireListeners();
  11919. }
  11920. },
  11921. isLoading: function() {
  11922. return !Boot.currentRequest && Boot.suspendedQueue.length == 0;
  11923. },
  11924. fireListeners: function() {
  11925. var listener;
  11926. while (Boot.isLoading() && (listener = Boot.listeners.shift())) {
  11927. listener();
  11928. }
  11929. },
  11930. onBootReady: function(listener) {
  11931. if (!Boot.isLoading()) {
  11932. listener();
  11933. } else {
  11934. Boot.listeners.push(listener);
  11935. }
  11936. },
  11937. /**
  11938. * this is a helper function used by Ext.Loader to flush out
  11939. * 'uses' arrays for classes in some Ext versions
  11940. */
  11941. getPathsFromIndexes: function(indexMap, loadOrder) {
  11942. // In older versions indexMap was an object instead of a sparse array
  11943. if (!('length' in indexMap)) {
  11944. var indexArray = [],
  11945. index;
  11946. for (index in indexMap) {
  11947. if (!isNaN(+index)) {
  11948. indexArray[+index] = indexMap[index];
  11949. }
  11950. }
  11951. indexMap = indexArray;
  11952. }
  11953. return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
  11954. },
  11955. createLoadOrderMap: function(loadOrder) {
  11956. return Request.prototype.createLoadOrderMap(loadOrder);
  11957. },
  11958. fetch: function(url, complete, scope, async) {
  11959. async = (async === undefined) ? !!complete : async;
  11960. var xhr = new XMLHttpRequest(),
  11961. result, status, content,
  11962. exception = false,
  11963. readyStateChange = function() {
  11964. if (xhr && xhr.readyState == 4) {
  11965. status = (xhr.status === 1223) ? 204 : (xhr.status === 0 && ((self.location || {}).protocol === 'file:' || (self.location || {}).protocol === 'ionp:')) ? 200 : xhr.status;
  11966. content = xhr.responseText;
  11967. result = {
  11968. content: content,
  11969. status: status,
  11970. exception: exception
  11971. };
  11972. if (complete) {
  11973. complete.call(scope, result);
  11974. }
  11975. xhr.onreadystatechange = emptyFn;
  11976. xhr = null;
  11977. }
  11978. };
  11979. if (async) {
  11980. xhr.onreadystatechange = readyStateChange;
  11981. }
  11982. try {
  11983. // _debug("fetching " + url + " " + (async ? "async" : "sync"));
  11984. xhr.open('GET', url, async);
  11985. xhr.send(null);
  11986. } catch (err) {
  11987. exception = err;
  11988. readyStateChange();
  11989. return result;
  11990. }
  11991. if (!async) {
  11992. readyStateChange();
  11993. }
  11994. return result;
  11995. },
  11996. notifyAll: function(entry) {
  11997. entry.notifyRequests();
  11998. }
  11999. };
  12000. function Request(cfg) {
  12001. //The request class encapsulates a series of Entry objects
  12002. //and provides notification around the completion of all Entries
  12003. //in this request.
  12004. if (cfg.$isRequest) {
  12005. return cfg;
  12006. }
  12007. var cfg = cfg.url ? cfg : {
  12008. url: cfg
  12009. },
  12010. url = cfg.url,
  12011. urls = url.charAt ? [
  12012. url
  12013. ] : url,
  12014. charset = cfg.charset || Boot.config.charset;
  12015. _apply(this, cfg);
  12016. delete this.url;
  12017. this.urls = urls;
  12018. this.charset = charset;
  12019. }
  12020. Request.prototype = {
  12021. $isRequest: true,
  12022. createLoadOrderMap: function(loadOrder) {
  12023. var len = loadOrder.length,
  12024. loadOrderMap = {},
  12025. i, element;
  12026. for (i = 0; i < len; i++) {
  12027. element = loadOrder[i];
  12028. loadOrderMap[element.path] = element;
  12029. }
  12030. return loadOrderMap;
  12031. },
  12032. getLoadIndexes: function(item, indexMap, loadOrder, includeUses, skipLoaded) {
  12033. var resolved = [],
  12034. queue = [
  12035. item
  12036. ],
  12037. itemIndex = item.idx,
  12038. queue, entry, dependencies, depIndex, i, len;
  12039. if (indexMap[itemIndex]) {
  12040. // prevent cycles
  12041. return resolved;
  12042. }
  12043. // Both indexMap and resolved are sparse arrays keyed by indexes.
  12044. // This gives us a naturally sorted sequence of indexes later on
  12045. // when we need to convert them to paths.
  12046. // indexMap is the map of all indexes we have visited at least once
  12047. // per the current expandUrls() invocation, and resolved is the map
  12048. // of all dependencies for the current item that are not included
  12049. // in indexMap.
  12050. indexMap[itemIndex] = resolved[itemIndex] = true;
  12051. while (item = queue.shift()) {
  12052. // Canonicalizing URLs is expensive, we try to avoid it
  12053. if (item.canonicalPath) {
  12054. entry = Boot.getEntry(item.path, null, true);
  12055. } else {
  12056. entry = Boot.getEntry(this.prepareUrl(item.path));
  12057. }
  12058. if (!(skipLoaded && entry.done)) {
  12059. if (includeUses && item.uses && item.uses.length) {
  12060. dependencies = item.requires.concat(item.uses);
  12061. } else {
  12062. dependencies = item.requires;
  12063. }
  12064. for (i = 0 , len = dependencies.length; i < len; i++) {
  12065. depIndex = dependencies[i];
  12066. if (!indexMap[depIndex]) {
  12067. indexMap[depIndex] = resolved[depIndex] = true;
  12068. queue.push(loadOrder[depIndex]);
  12069. }
  12070. }
  12071. }
  12072. }
  12073. return resolved;
  12074. },
  12075. getPathsFromIndexes: function(indexes, loadOrder) {
  12076. var paths = [],
  12077. index, len;
  12078. // indexes is a sparse array with values being true for defined indexes
  12079. for (index = 0 , len = indexes.length; index < len; index++) {
  12080. if (indexes[index]) {
  12081. paths.push(loadOrder[index].path);
  12082. }
  12083. }
  12084. return paths;
  12085. },
  12086. expandUrl: function(url, loadOrder, loadOrderMap, indexMap, includeUses, skipLoaded) {
  12087. var item, resolved;
  12088. if (loadOrder) {
  12089. item = loadOrderMap[url];
  12090. if (item) {
  12091. resolved = this.getLoadIndexes(item, indexMap, loadOrder, includeUses, skipLoaded);
  12092. if (resolved.length) {
  12093. return this.getPathsFromIndexes(resolved, loadOrder);
  12094. }
  12095. }
  12096. }
  12097. return [
  12098. url
  12099. ];
  12100. },
  12101. expandUrls: function(urls, includeUses) {
  12102. var me = this,
  12103. loadOrder = me.loadOrder,
  12104. expanded = [],
  12105. expandMap = {},
  12106. indexMap = [],
  12107. loadOrderMap, tmpExpanded, i, len, t, tlen, tUrl;
  12108. if (typeof urls === "string") {
  12109. urls = [
  12110. urls
  12111. ];
  12112. }
  12113. if (loadOrder) {
  12114. loadOrderMap = me.loadOrderMap;
  12115. if (!loadOrderMap) {
  12116. loadOrderMap = me.loadOrderMap = me.createLoadOrderMap(loadOrder);
  12117. }
  12118. }
  12119. for (i = 0 , len = urls.length; i < len; i++) {
  12120. // We don't want to skip loaded entries (last argument === false).
  12121. // There are some overrides that get loaded before their respective classes,
  12122. // and when the class dependencies are processed we don't want to skip over
  12123. // the overrides' dependencies just because they were loaded first.
  12124. tmpExpanded = this.expandUrl(urls[i], loadOrder, loadOrderMap, indexMap, includeUses, false);
  12125. for (t = 0 , tlen = tmpExpanded.length; t < tlen; t++) {
  12126. tUrl = tmpExpanded[t];
  12127. if (!expandMap[tUrl]) {
  12128. expandMap[tUrl] = true;
  12129. expanded.push(tUrl);
  12130. }
  12131. }
  12132. }
  12133. if (expanded.length === 0) {
  12134. expanded = urls;
  12135. }
  12136. return expanded;
  12137. },
  12138. expandLoadOrder: function() {
  12139. var me = this,
  12140. urls = me.urls,
  12141. expanded;
  12142. if (!me.expanded) {
  12143. expanded = this.expandUrls(urls, true);
  12144. me.expanded = true;
  12145. } else {
  12146. expanded = urls;
  12147. }
  12148. me.urls = expanded;
  12149. // if we added some urls to the request to honor the indicated
  12150. // load order, the request needs to be sequential
  12151. if (urls.length != expanded.length) {
  12152. me.sequential = true;
  12153. }
  12154. return me;
  12155. },
  12156. getUrls: function() {
  12157. this.expandLoadOrder();
  12158. return this.urls;
  12159. },
  12160. prepareUrl: function(url) {
  12161. if (this.prependBaseUrl) {
  12162. return Boot.baseUrl + url;
  12163. }
  12164. return url;
  12165. },
  12166. getEntries: function() {
  12167. var me = this,
  12168. entries = me.entries,
  12169. loadOrderMap, item, i, entry, urls, url;
  12170. if (!entries) {
  12171. entries = [];
  12172. urls = me.getUrls();
  12173. // If we have loadOrder array then the map will be expanded by now
  12174. if (me.loadOrder) {
  12175. loadOrderMap = me.loadOrderMap;
  12176. }
  12177. for (i = 0; i < urls.length; i++) {
  12178. url = me.prepareUrl(urls[i]);
  12179. if (loadOrderMap) {
  12180. item = loadOrderMap[url];
  12181. }
  12182. entry = Boot.getEntry(url, {
  12183. buster: me.buster,
  12184. charset: me.charset
  12185. }, item && item.canonicalPath);
  12186. entry.requests.push(me);
  12187. entries.push(entry);
  12188. }
  12189. me.entries = entries;
  12190. }
  12191. return entries;
  12192. },
  12193. loadEntries: function(sync) {
  12194. var me = this,
  12195. entries = me.getEntries(),
  12196. len = entries.length,
  12197. start = me.loadStart || 0,
  12198. continueLoad, entries, entry, i;
  12199. if (sync !== undefined) {
  12200. me.sync = sync;
  12201. }
  12202. me.loaded = me.loaded || 0;
  12203. me.loading = me.loading || len;
  12204. for (i = start; i < len; i++) {
  12205. entry = entries[i];
  12206. if (!entry.loaded) {
  12207. continueLoad = entries[i].load(me.sync);
  12208. } else {
  12209. continueLoad = true;
  12210. }
  12211. if (!continueLoad) {
  12212. me.loadStart = i;
  12213. entry.onDone(function() {
  12214. me.loadEntries(sync);
  12215. });
  12216. break;
  12217. }
  12218. }
  12219. me.processLoadedEntries();
  12220. },
  12221. processLoadedEntries: function() {
  12222. var me = this,
  12223. entries = me.getEntries(),
  12224. len = entries.length,
  12225. start = me.startIndex || 0,
  12226. i, entry;
  12227. if (!me.done) {
  12228. for (i = start; i < len; i++) {
  12229. entry = entries[i];
  12230. if (!entry.loaded) {
  12231. me.startIndex = i;
  12232. return;
  12233. }
  12234. if (!entry.evaluated) {
  12235. entry.evaluate();
  12236. }
  12237. if (entry.error) {
  12238. me.error = true;
  12239. }
  12240. }
  12241. me.notify();
  12242. }
  12243. },
  12244. notify: function() {
  12245. var me = this;
  12246. if (!me.done) {
  12247. var error = me.error,
  12248. fn = me[error ? 'failure' : 'success'],
  12249. delay = ('delay' in me) ? me.delay : (error ? 1 : Boot.config.chainDelay),
  12250. scope = me.scope || me;
  12251. me.done = true;
  12252. if (fn) {
  12253. if (delay === 0 || delay > 0) {
  12254. // Free the stack (and defer the next script)
  12255. setTimeout(function() {
  12256. fn.call(scope, me);
  12257. }, delay);
  12258. } else {
  12259. fn.call(scope, me);
  12260. }
  12261. }
  12262. me.fireListeners();
  12263. Boot.requestComplete(me);
  12264. }
  12265. },
  12266. onDone: function(listener) {
  12267. var me = this,
  12268. listeners = me.listeners || (me.listeners = []);
  12269. if (me.done) {
  12270. listener(me);
  12271. } else {
  12272. listeners.push(listener);
  12273. }
  12274. },
  12275. fireListeners: function() {
  12276. var listeners = this.listeners,
  12277. listener;
  12278. if (listeners) {
  12279. // _debug("firing request listeners");
  12280. while ((listener = listeners.shift())) {
  12281. listener(this);
  12282. }
  12283. }
  12284. }
  12285. };
  12286. function Entry(cfg) {
  12287. //The Entry class is a token to manage the load and evaluation
  12288. //state of a particular url. It is used to notify all Requests
  12289. //interested in this url that the content is available.
  12290. if (cfg.$isEntry) {
  12291. return cfg;
  12292. }
  12293. // _debug("creating entry for " + cfg.url);
  12294. var charset = cfg.charset || Boot.config.charset,
  12295. manifest = Ext.manifest,
  12296. loader = manifest && manifest.loader,
  12297. cache = (cfg.cache !== undefined) ? cfg.cache : (loader && loader.cache),
  12298. buster, busterParam;
  12299. if (Boot.config.disableCaching) {
  12300. if (cache === undefined) {
  12301. cache = !Boot.config.disableCaching;
  12302. }
  12303. if (cache === false) {
  12304. buster = +new Date();
  12305. } else if (cache !== true) {
  12306. buster = cache;
  12307. }
  12308. if (buster) {
  12309. busterParam = (loader && loader.cacheParam) || Boot.config.disableCachingParam;
  12310. buster = busterParam + "=" + buster;
  12311. }
  12312. }
  12313. _apply(this, cfg);
  12314. this.charset = charset;
  12315. this.buster = buster;
  12316. this.requests = [];
  12317. }
  12318. Entry.prototype = {
  12319. $isEntry: true,
  12320. done: false,
  12321. evaluated: false,
  12322. loaded: false,
  12323. isCrossDomain: function() {
  12324. var me = this;
  12325. if (me.crossDomain === undefined) {
  12326. // _debug("checking " + me.getLoadUrl() + " for prefix " + Boot.origin);
  12327. me.crossDomain = (me.getLoadUrl().indexOf(Boot.origin) !== 0);
  12328. }
  12329. return me.crossDomain;
  12330. },
  12331. isCss: function() {
  12332. var me = this;
  12333. if (me.css === undefined) {
  12334. if (me.url) {
  12335. var assetConfig = Boot.assetConfig[me.url];
  12336. me.css = assetConfig ? assetConfig.type === "css" : cssRe.test(me.url);
  12337. } else {
  12338. me.css = false;
  12339. }
  12340. }
  12341. return this.css;
  12342. },
  12343. getElement: function(tag) {
  12344. var me = this,
  12345. el = me.el;
  12346. if (!el) {
  12347. // _debug("creating element for " + me.url);
  12348. if (me.isCss()) {
  12349. tag = tag || "link";
  12350. el = doc.createElement(tag);
  12351. if (tag == "link") {
  12352. el.rel = 'stylesheet';
  12353. me.prop = 'href';
  12354. } else {
  12355. me.prop = "textContent";
  12356. }
  12357. el.type = "text/css";
  12358. } else {
  12359. tag = tag || "script";
  12360. el = doc.createElement(tag);
  12361. el.type = 'text/javascript';
  12362. me.prop = 'src';
  12363. if (me.charset) {
  12364. el.charset = me.charset;
  12365. }
  12366. if (Boot.hasAsync) {
  12367. el.async = false;
  12368. }
  12369. }
  12370. me.el = el;
  12371. }
  12372. return el;
  12373. },
  12374. getLoadUrl: function() {
  12375. var me = this,
  12376. url;
  12377. url = me.canonicalPath ? me.url : Boot.canonicalUrl(me.url);
  12378. if (!me.loadUrl) {
  12379. me.loadUrl = !!me.buster ? (url + (url.indexOf('?') === -1 ? '?' : '&') + me.buster) : url;
  12380. }
  12381. return me.loadUrl;
  12382. },
  12383. fetch: function(req) {
  12384. var url = this.getLoadUrl(),
  12385. async = !!req.async,
  12386. complete = req.complete;
  12387. Boot.fetch(url, complete, this, async);
  12388. },
  12389. onContentLoaded: function(response) {
  12390. var me = this,
  12391. status = response.status,
  12392. content = response.content,
  12393. exception = response.exception,
  12394. url = this.getLoadUrl();
  12395. me.loaded = true;
  12396. if ((exception || status === 0) && !_environment.phantom) {
  12397. 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;
  12398. me.evaluated = true;
  12399. } else if ((status >= 200 && status < 300) || status === 304 || _environment.phantom || (status === 0 && content.length > 0)) {
  12400. me.content = content;
  12401. } else {
  12402. me.error = ("Failed loading synchronously via XHR: '" + url + "'. Please verify that the file exists. XHR status code: " + status) || true;
  12403. me.evaluated = true;
  12404. }
  12405. },
  12406. createLoadElement: function(callback) {
  12407. var me = this,
  12408. el = me.getElement();
  12409. me.preserve = true;
  12410. el.onerror = function() {
  12411. me.error = true;
  12412. if (callback) {
  12413. callback();
  12414. callback = null;
  12415. }
  12416. };
  12417. if (Boot.isIE10m) {
  12418. el.onreadystatechange = function() {
  12419. if (this.readyState === 'loaded' || this.readyState === 'complete') {
  12420. if (callback) {
  12421. callback();
  12422. callback = this.onreadystatechange = this.onerror = null;
  12423. }
  12424. }
  12425. };
  12426. } else {
  12427. el.onload = function() {
  12428. callback();
  12429. callback = this.onload = this.onerror = null;
  12430. };
  12431. }
  12432. // IE starts loading here
  12433. el[me.prop] = me.getLoadUrl();
  12434. },
  12435. onLoadElementReady: function() {
  12436. Boot.getHead().appendChild(this.getElement());
  12437. this.evaluated = true;
  12438. },
  12439. inject: function(content, asset) {
  12440. // _debug("injecting content for " + this.url);
  12441. var me = this,
  12442. head = Boot.getHead(),
  12443. url = me.url,
  12444. key = me.key,
  12445. base, el, ieMode, basePath;
  12446. if (me.isCss()) {
  12447. me.preserve = true;
  12448. basePath = key.substring(0, key.lastIndexOf("/") + 1);
  12449. base = doc.createElement('base');
  12450. base.href = basePath;
  12451. if (head.firstChild) {
  12452. head.insertBefore(base, head.firstChild);
  12453. } else {
  12454. head.appendChild(base);
  12455. }
  12456. // reset the href attribute to cuase IE to pick up the change
  12457. base.href = base.href;
  12458. if (url) {
  12459. content += "\n/*# sourceURL=" + key + " */";
  12460. }
  12461. // create element after setting base
  12462. el = me.getElement("style");
  12463. ieMode = ('styleSheet' in el);
  12464. head.appendChild(base);
  12465. if (ieMode) {
  12466. head.appendChild(el);
  12467. el.styleSheet.cssText = content;
  12468. } else {
  12469. el.textContent = content;
  12470. head.appendChild(el);
  12471. }
  12472. head.removeChild(base);
  12473. } else {
  12474. // Debugger friendly, file names are still shown even though they're
  12475. // eval'ed code. Breakpoints work on both Firebug and Chrome's Web
  12476. // Inspector.
  12477. if (url) {
  12478. content += "\n//# sourceURL=" + key;
  12479. }
  12480. Ext.globalEval(content);
  12481. }
  12482. return me;
  12483. },
  12484. loadCrossDomain: function() {
  12485. var me = this,
  12486. complete = function() {
  12487. me.el.onerror = me.el.onload = emptyFn;
  12488. me.el = null;
  12489. me.loaded = me.evaluated = me.done = true;
  12490. me.notifyRequests();
  12491. };
  12492. me.createLoadElement(function() {
  12493. complete();
  12494. });
  12495. me.evaluateLoadElement();
  12496. // at this point, we need sequential evaluation,
  12497. // which means we can't advance the load until
  12498. // this entry has fully completed
  12499. return false;
  12500. },
  12501. loadElement: function() {
  12502. var me = this,
  12503. complete = function() {
  12504. me.el.onerror = me.el.onload = emptyFn;
  12505. me.el = null;
  12506. me.loaded = me.evaluated = me.done = true;
  12507. me.notifyRequests();
  12508. };
  12509. me.createLoadElement(function() {
  12510. complete();
  12511. });
  12512. me.evaluateLoadElement();
  12513. return true;
  12514. },
  12515. loadSync: function() {
  12516. var me = this;
  12517. me.fetch({
  12518. async: false,
  12519. complete: function(response) {
  12520. me.onContentLoaded(response);
  12521. }
  12522. });
  12523. me.evaluate();
  12524. me.notifyRequests();
  12525. },
  12526. load: function(sync) {
  12527. var me = this;
  12528. if (!me.loaded) {
  12529. if (me.loading) {
  12530. // if we're calling back through load and we're loading but haven't
  12531. // yet loaded, then we should be in a sequential, cross domain
  12532. // load scenario which means we can't continue the load on the
  12533. // request until this entry has fully evaluated, which will mean
  12534. // loaded = evaluated = done = true in one step. For css files, this
  12535. // will happen immediately upon <link> element creation / insertion,
  12536. // but <script> elements will set this upon load notification
  12537. return false;
  12538. }
  12539. me.loading = true;
  12540. // for async modes, we have some options
  12541. if (!sync) {
  12542. // if cross domain, just inject the script tag and let the onload
  12543. // events drive the progression.
  12544. // IE10 also needs sequential loading because of a bug that makes it
  12545. // fire readystate event prematurely:
  12546. // https://connect.microsoft.com/IE/feedback/details/729164/ie10-dynamic-script-element-fires-loaded-readystate-prematurely
  12547. if (Boot.isIE10 || me.isCrossDomain()) {
  12548. return me.loadCrossDomain();
  12549. }
  12550. // for IE, use the readyStateChange allows us to load scripts in parallel
  12551. // but serialize the evaluation by appending the script node to the
  12552. // document
  12553. else if (!me.isCss() && Boot.hasReadyState) {
  12554. me.createLoadElement(function() {
  12555. me.loaded = true;
  12556. me.notifyRequests();
  12557. });
  12558. } else if (Boot.useElements && // older webkit, phantomjs included, won't fire load for link elements
  12559. !(me.isCss() && _environment.phantom)) {
  12560. return me.loadElement();
  12561. } else // for other browsers, just ajax the content down in parallel, and use
  12562. // globalEval to serialize evaluation
  12563. {
  12564. me.fetch({
  12565. async: !sync,
  12566. complete: function(response) {
  12567. me.onContentLoaded(response);
  12568. me.notifyRequests();
  12569. }
  12570. });
  12571. }
  12572. } else // for sync mode in js, global eval FTW. IE won't honor the comment
  12573. // paths in the debugger, so eventually we need a sync mode for IE that
  12574. // uses the readyStateChange mechanism
  12575. {
  12576. me.loadSync();
  12577. }
  12578. }
  12579. // signal that the load process can continue
  12580. return true;
  12581. },
  12582. evaluateContent: function() {
  12583. this.inject(this.content);
  12584. this.content = null;
  12585. },
  12586. evaluateLoadElement: function() {
  12587. Boot.getHead().appendChild(this.getElement());
  12588. },
  12589. evaluate: function() {
  12590. var me = this;
  12591. if (!me.evaluated) {
  12592. if (me.evaluating) {
  12593. return;
  12594. }
  12595. me.evaluating = true;
  12596. if (me.content !== undefined) {
  12597. me.evaluateContent();
  12598. } else if (!me.error) {
  12599. me.evaluateLoadElement();
  12600. }
  12601. me.evaluated = me.done = true;
  12602. me.cleanup();
  12603. }
  12604. },
  12605. cleanup: function() {
  12606. var me = this,
  12607. el = me.el,
  12608. prop;
  12609. if (!el) {
  12610. return;
  12611. }
  12612. if (!me.preserve) {
  12613. me.el = null;
  12614. el.parentNode.removeChild(el);
  12615. // Remove, since its useless now
  12616. for (prop in el) {
  12617. try {
  12618. if (prop !== me.prop) {
  12619. // If we set the src property to null IE
  12620. // will try and request a script at './null'
  12621. el[prop] = null;
  12622. }
  12623. delete el[prop];
  12624. } // and prepare for GC
  12625. catch (cleanEx) {}
  12626. }
  12627. }
  12628. //ignore
  12629. // Setting to null can cause exceptions if IE ever needs to call these
  12630. // again (like onreadystatechange). This emptyFn has nothing locked in
  12631. // closure scope so it is about as safe as null for memory leaks.
  12632. el.onload = el.onerror = el.onreadystatechange = emptyFn;
  12633. },
  12634. notifyRequests: function() {
  12635. var requests = this.requests,
  12636. len = requests.length,
  12637. i, request;
  12638. for (i = 0; i < len; i++) {
  12639. request = requests[i];
  12640. request.processLoadedEntries();
  12641. }
  12642. if (this.done) {
  12643. this.fireListeners();
  12644. }
  12645. },
  12646. onDone: function(listener) {
  12647. var me = this,
  12648. listeners = me.listeners || (me.listeners = []);
  12649. if (me.done) {
  12650. listener(me);
  12651. } else {
  12652. listeners.push(listener);
  12653. }
  12654. },
  12655. fireListeners: function() {
  12656. var listeners = this.listeners,
  12657. listener;
  12658. if (listeners && listeners.length > 0) {
  12659. // _debug("firing event listeners for url " + this.url);
  12660. while ((listener = listeners.shift())) {
  12661. listener(this);
  12662. }
  12663. }
  12664. }
  12665. };
  12666. /**
  12667. * Turns on or off the "cache buster" applied to dynamically loaded scripts. Normally
  12668. * dynamically loaded scripts have an extra query parameter appended to avoid stale
  12669. * cached scripts. This method can be used to disable this mechanism, and is primarily
  12670. * useful for testing. This is done using a cookie.
  12671. * @param {Boolean} disable True to disable the cache buster.
  12672. * @param {String} [path="/"] An optional path to scope the cookie.
  12673. */
  12674. Ext.disableCacheBuster = function(disable, path) {
  12675. var date = new Date();
  12676. date.setTime(date.getTime() + (disable ? 10 * 365 : -1) * 24 * 60 * 60 * 1000);
  12677. date = date.toGMTString();
  12678. doc.cookie = 'ext-cache=1; expires=' + date + '; path=' + (path || '/');
  12679. };
  12680. Boot.init();
  12681. return Boot;
  12682. }(// NOTE: We run the eval at global scope to protect the body of the function and allow
  12683. // compressors to still process it.
  12684. function() {}));
  12685. //(eval("/*@cc_on!@*/!1"));
  12686. /**
  12687. * This method evaluates the given code free of any local variable. This
  12688. * will be at global scope, in others it will be in a function.
  12689. * @param {String} code The code to evaluate.
  12690. * @private
  12691. * @method
  12692. * @member Ext
  12693. */
  12694. Ext.globalEval = Ext.globalEval || (this.execScript ? function(code) {
  12695. execScript(code);
  12696. } : function($$code) {
  12697. eval.call(window, $$code);
  12698. });
  12699. /*
  12700. * Only IE8 & IE/Quirks lack Function.prototype.bind so we polyfill that here.
  12701. */
  12702. if (!Function.prototype.bind) {
  12703. (function() {
  12704. var slice = Array.prototype.slice,
  12705. // To reduce overhead on call of the bound fn we have two flavors based on
  12706. // whether we have args to prepend or not:
  12707. bind = function(me) {
  12708. var args = slice.call(arguments, 1),
  12709. method = this;
  12710. if (args.length) {
  12711. return function() {
  12712. var t = arguments;
  12713. // avoid the slice/concat if the caller does not supply args
  12714. return method.apply(me, t.length ? args.concat(slice.call(t)) : args);
  12715. };
  12716. }
  12717. // this is the majority use case - just fn.bind(this) and no args
  12718. args = null;
  12719. return function() {
  12720. return method.apply(me, arguments);
  12721. };
  12722. };
  12723. Function.prototype.bind = bind;
  12724. bind.$extjs = true;
  12725. }());
  12726. }
  12727. // to detect this polyfill if one want to improve it
  12728. //</editor-fold>
  12729. Ext.setResourcePath = function(poolName, path) {
  12730. var manifest = Ext.manifest || (Ext.manifest = {}),
  12731. paths = manifest.resources || (manifest.resources = {});
  12732. if (manifest) {
  12733. if (typeof poolName !== 'string') {
  12734. Ext.apply(paths, poolName);
  12735. } else {
  12736. paths[poolName] = path;
  12737. }
  12738. manifest.resources = paths;
  12739. }
  12740. };
  12741. Ext.getResourcePath = function(path, poolName, packageName) {
  12742. if (typeof path !== 'string') {
  12743. poolName = path.pool;
  12744. packageName = path.packageName;
  12745. path = path.path;
  12746. }
  12747. var manifest = Ext.manifest,
  12748. paths = manifest && manifest.resources,
  12749. poolPath = paths[poolName],
  12750. output = [];
  12751. if (poolPath == null) {
  12752. poolPath = paths.path;
  12753. if (poolPath == null) {
  12754. poolPath = 'resources';
  12755. }
  12756. }
  12757. if (poolPath) {
  12758. output.push(poolPath);
  12759. }
  12760. if (packageName) {
  12761. output.push(packageName);
  12762. }
  12763. output.push(path);
  12764. return output.join('/');
  12765. };
  12766. // @tag core
  12767. /**
  12768. * @class Ext
  12769. *
  12770. * The Ext namespace (global object) encapsulates all classes, singletons, and
  12771. * utility methods provided by Sencha's libraries.
  12772. *
  12773. * Most user interface Components are at a lower level of nesting in the namespace,
  12774. * but many common utility functions are provided as direct properties of the Ext namespace.
  12775. *
  12776. * Also many frequently used methods from other classes are provided as shortcuts
  12777. * within the Ext namespace. For example {@link Ext#getCmp Ext.getCmp} aliases
  12778. * {@link Ext.ComponentManager#get Ext.ComponentManager.get}.
  12779. *
  12780. * Many applications are initiated with {@link Ext#application Ext.application} which is
  12781. * called once the DOM is ready. This ensures all scripts have been loaded, preventing
  12782. * dependency issues. For example:
  12783. *
  12784. * Ext.application({
  12785. * name: 'MyApp',
  12786. *
  12787. * launch: function () {
  12788. * Ext.Msg.alert(this.getName(), 'Ready to go!');
  12789. * }
  12790. * });
  12791. *
  12792. * <b><a href="http://www.sencha.com/products/sencha-cmd/">Sencha Cmd</a></b> is a free tool
  12793. * for helping you generate and build Ext JS (and Sencha Touch) applications. See
  12794. * `{@link Ext.app.Application Application}` for more information about creating an app.
  12795. *
  12796. * A lower-level technique that does not use the `Ext.app.Application` architecture is
  12797. * {@link Ext#onReady Ext.onReady}.
  12798. *
  12799. * You can also discuss concepts and issues with others on the
  12800. * <a href="http://www.sencha.com/forum/">Sencha Forums</a>.
  12801. *
  12802. * @singleton
  12803. */
  12804. var Ext = Ext || {};
  12805. // @define Ext
  12806. /* eslint indent: "off" */
  12807. (function() {
  12808. var global = this,
  12809. objectPrototype = Object.prototype,
  12810. toString = objectPrototype.toString,
  12811. enumerables = [
  12812. // 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable',
  12813. 'valueOf',
  12814. 'toLocaleString',
  12815. 'toString',
  12816. 'constructor'
  12817. ],
  12818. emptyFn = Ext.fireIdle = function() {},
  12819. // see GlobalEvents for true fireIdle
  12820. privateFn = function() {},
  12821. identityFn = function(o) {
  12822. return o;
  12823. },
  12824. // eslint-disable-line
  12825. // This is the "$previous" method of a hook function on an instance. When called, it
  12826. // calls through the class prototype by the name of the called method.
  12827. callOverrideParent = function() {
  12828. var method = callOverrideParent.caller.caller;
  12829. // skip callParent (our caller)
  12830. return method.$owner.prototype[method.$name].apply(this, arguments);
  12831. },
  12832. manifest = Ext.manifest || {},
  12833. iterableRe = /\[object\s*(?:Array|Arguments|\w*Collection|\w*List|HTML\s+document\.all\s+class)\]/,
  12834. MSDateRe = /^\\?\/Date\(([-+])?(\d+)(?:[+-]\d{4})?\)\\?\/$/,
  12835. /* eslint-disable-next-line no-unused-vars */
  12836. elevateArgs, elevateFn, elevateRet, elevateScope, i;
  12837. Ext.global = global;
  12838. Ext.$nextIid = 0;
  12839. /**
  12840. * Returns the current timestamp.
  12841. * @return {Number} Milliseconds since UNIX epoch.
  12842. * @method now
  12843. * @member Ext
  12844. */
  12845. Ext.now = Date.now || (Date.now = function() {
  12846. return +new Date();
  12847. });
  12848. /**
  12849. * Returns the current high-resolution timestamp.
  12850. * @return {Number} Milliseconds ellapsed since arbitrary epoch.
  12851. * @method ticks
  12852. * @member Ext
  12853. * @since 6.0.1
  12854. */
  12855. Ext.ticks = (global.performance && global.performance.now) ? function() {
  12856. return performance.now();
  12857. } : Ext.now;
  12858. Ext._startTime = Ext.ticks();
  12859. // Mark these special fn's for easy identification:
  12860. emptyFn.$nullFn = identityFn.$nullFn = emptyFn.$emptyFn = identityFn.$identityFn = privateFn.$nullFn = true;
  12861. privateFn.$privacy = 'framework';
  12862. // We also want to prevent these functions from being cleaned up on destroy
  12863. emptyFn.$noClearOnDestroy = identityFn.$noClearOnDestroy = true;
  12864. privateFn.$noClearOnDestroy = true;
  12865. // These are emptyFn's in core and are redefined only in Ext JS (we use this syntax
  12866. // so Cmd does not detect them):
  12867. /* eslint-disable-next-line dot-notation */
  12868. Ext['suspendLayouts'] = Ext['resumeLayouts'] = emptyFn;
  12869. for (i in {
  12870. toString: 1
  12871. }) {
  12872. enumerables = null;
  12873. }
  12874. /**
  12875. * An array containing extra enumerables for old browsers
  12876. * @property {String[]}
  12877. */
  12878. Ext.enumerables = enumerables;
  12879. /**
  12880. * Copies all the properties of `config` to the specified `object`. There are two levels
  12881. * of defaulting supported:
  12882. *
  12883. * Ext.apply(obj, { a: 1 }, { a: 2 });
  12884. * //obj.a === 1
  12885. *
  12886. * Ext.apply(obj, { }, { a: 2 });
  12887. * //obj.a === 2
  12888. *
  12889. * Note that if recursive merging and cloning without referencing the original objects
  12890. * or arrays is needed, use {@link Ext.Object#merge} instead.
  12891. *
  12892. * @param {Object} object The receiver of the properties.
  12893. * @param {Object} config The primary source of the properties.
  12894. * @param {Object} [defaults] An object that will also be applied for default values.
  12895. * @return {Object} returns `object`.
  12896. */
  12897. Ext.apply = function(object, config, defaults) {
  12898. var i, j, k;
  12899. if (object) {
  12900. if (defaults) {
  12901. Ext.apply(object, defaults);
  12902. }
  12903. if (config && typeof config === 'object') {
  12904. for (i in config) {
  12905. object[i] = config[i];
  12906. }
  12907. if (enumerables) {
  12908. for (j = enumerables.length; j--; ) {
  12909. k = enumerables[j];
  12910. if (config.hasOwnProperty(k)) {
  12911. object[k] = config[k];
  12912. }
  12913. }
  12914. }
  12915. }
  12916. }
  12917. return object;
  12918. };
  12919. // Used by Ext.override
  12920. function addInstanceOverrides(target, owner, overrides) {
  12921. var name, value;
  12922. for (name in overrides) {
  12923. if (overrides.hasOwnProperty(name)) {
  12924. value = overrides[name];
  12925. if (typeof value === 'function') {
  12926. if (owner.$className) {
  12927. value.name = owner.$className + '#' + name;
  12928. }
  12929. value.$name = name;
  12930. value.$owner = owner;
  12931. value.$previous = target.hasOwnProperty(name) ? target[name] : // already hooked, so call previous hook
  12932. callOverrideParent;
  12933. }
  12934. // calls by name on prototype
  12935. target[name] = value;
  12936. }
  12937. }
  12938. }
  12939. Ext.buildSettings = Ext.apply({
  12940. baseCSSPrefix: 'x-'
  12941. }, Ext.buildSettings || {});
  12942. Ext.apply(Ext, {
  12943. /**
  12944. * @private
  12945. */
  12946. idSeed: 0,
  12947. /**
  12948. * @private
  12949. */
  12950. idPrefix: 'ext-',
  12951. /**
  12952. * @private
  12953. */
  12954. isRobot: false,
  12955. /**
  12956. * @property {Boolean} isSecure
  12957. * True if the page is running over SSL
  12958. * @readonly
  12959. */
  12960. isSecure: /^https/i.test(window.location.protocol),
  12961. /**
  12962. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  12963. * `false`, the application will be required to clean up orphaned Ext.Elements and
  12964. * it's listeners as to not cause memory leakage.
  12965. */
  12966. enableGarbageCollector: false,
  12967. /**
  12968. * True to automatically purge event listeners during garbageCollection.
  12969. */
  12970. enableListenerCollection: true,
  12971. /**
  12972. * @property {String} [name='Ext']
  12973. * The name of the property in the global namespace (The `window` in browser
  12974. * environments) which refers to the current instance of Ext.
  12975. * This is usually `"Ext"`, but if a sandboxed build of ExtJS is being used, this will be
  12976. * an alternative name.
  12977. * If code is being generated for use by `eval` or to create a `new Function`, and the
  12978. * global instance of Ext must be referenced, this is the name that should be built
  12979. * into the code.
  12980. */
  12981. name: Ext.sandboxName || 'Ext',
  12982. /**
  12983. * @property {Function}
  12984. * A reusable empty function for use as `privates` members.
  12985. *
  12986. * Ext.define('MyClass', {
  12987. * nothing: Ext.emptyFn,
  12988. *
  12989. * privates: {
  12990. * privateNothing: Ext.privateFn
  12991. * }
  12992. * });
  12993. *
  12994. */
  12995. privateFn: privateFn,
  12996. /**
  12997. * @property {Function}
  12998. * A reusable empty function.
  12999. */
  13000. emptyFn: emptyFn,
  13001. /**
  13002. * @property {Function}
  13003. * A reusable identity function that simply returns its first argument.
  13004. */
  13005. identityFn: identityFn,
  13006. /**
  13007. * This indicate the start timestamp of current cycle.
  13008. * It is only reliable during dom-event-initiated cycles and
  13009. * {@link Ext.draw.Animator} initiated cycles.
  13010. */
  13011. frameStartTime: Ext.now(),
  13012. /**
  13013. * This object is initialized prior to loading the framework
  13014. * and contains settings and other information describing the application.
  13015. *
  13016. * For applications built using Sencha Cmd, this is produced from the `"app.json"`
  13017. * file with information extracted from all of the required packages' `"package.json"`
  13018. * files. This can be set to a string when your application is using the
  13019. * (microloader)[#/guide/microloader]. In this case, the string of "foo" will be
  13020. * requested as `"foo.json"` and the object in that JSON file will parsed and set
  13021. * as this object.
  13022. *
  13023. * @cfg {String/Ext.Manifest} manifest
  13024. * @since 5.0.0
  13025. */
  13026. manifest: manifest,
  13027. /**
  13028. * @cfg {Object} [debugConfig]
  13029. * This object is used to enable or disable debugging for classes or namespaces. The
  13030. * default instance looks like this:
  13031. *
  13032. * Ext.debugConfig = {
  13033. * hooks: {
  13034. * '*': true
  13035. * }
  13036. * };
  13037. *
  13038. * Typically applications will set this in their `"app.json"` like so:
  13039. *
  13040. * {
  13041. * "debug": {
  13042. * "hooks": {
  13043. * // Default for all namespaces:
  13044. * '*': true,
  13045. *
  13046. * // Except for Ext namespace which is disabled
  13047. * 'Ext': false,
  13048. *
  13049. * // Except for Ext.layout namespace which is enabled
  13050. * 'Ext.layout': true
  13051. * }
  13052. * }
  13053. * }
  13054. *
  13055. * Alternatively, because this property is consumed very early in the load process of
  13056. * the framework, this can be set in a `script` tag that is defined prior to loading
  13057. * the framework itself.
  13058. *
  13059. * For example, to enable debugging for the `Ext.layout` namespace only:
  13060. *
  13061. * var Ext = Ext || {};
  13062. * Ext.debugConfig = {
  13063. * hooks: {
  13064. * //...
  13065. * }
  13066. * };
  13067. *
  13068. * For any class declared, the longest matching namespace specified determines if its
  13069. * `debugHooks` will be enabled. The default setting is specified by the '*' property.
  13070. *
  13071. * **NOTE:** This option only applies to debug builds. All debugging is disabled in
  13072. * production builds.
  13073. */
  13074. debugConfig: Ext.debugConfig || manifest.debug || {
  13075. hooks: {
  13076. '*': true
  13077. }
  13078. },
  13079. /**
  13080. * @property {Boolean} [enableAria=true] This property is provided for backward
  13081. * compatibility with previous versions of Ext JS. Accessibility is always enabled
  13082. * in Ext JS 6.0+.
  13083. *
  13084. * This property is deprecated. To disable WAI-ARIA compatibility warnings,
  13085. * override `Ext.ariaWarn` function in your application startup code:
  13086. *
  13087. * Ext.application({
  13088. * launch: function() {
  13089. * Ext.ariaWarn = Ext.emptyFn;
  13090. * }
  13091. * });
  13092. *
  13093. * For stricter compatibility with WAI-ARIA requirements, replace `Ext.ariaWarn`
  13094. * with a function that will raise an error instead:
  13095. *
  13096. * Ext.application({
  13097. * launch: function() {
  13098. * Ext.ariaWarn = function(target, msg) {
  13099. * Ext.raise({
  13100. * msg: msg,
  13101. * component: target
  13102. * });
  13103. * };
  13104. * }
  13105. * });
  13106. *
  13107. * @since 6.0.0
  13108. * @deprecated 6.0.2 This property is no longer necessary, so no replacement is required.
  13109. */
  13110. enableAria: true,
  13111. startsWithHashRe: /^#/,
  13112. /**
  13113. * @property {RegExp}
  13114. * @private
  13115. * Regular expression used for validating identifiers.
  13116. */
  13117. validIdRe: /^[a-z_][a-z0-9\-_]*$/i,
  13118. /**
  13119. * @property {String} BLANK_IMAGE_URL
  13120. * URL to a 1x1 transparent gif image used by Ext to create inline icons with
  13121. * CSS background images.
  13122. */
  13123. /* eslint-disable-next-line max-len */
  13124. BLANK_IMAGE_URL: 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
  13125. /**
  13126. * Converts an id (`'foo'`) into an id selector (`'#foo'`). This method is used
  13127. * internally by the framework whenever an id needs to be converted into a selector
  13128. * and is provided as a hook for those that need to escape IDs selectors since,
  13129. * as of Ext 5.0, the framework no longer escapes IDs by default.
  13130. * @private
  13131. * @param {String} id
  13132. * @return {String}
  13133. */
  13134. makeIdSelector: function(id) {
  13135. if (!Ext.validIdRe.test(id)) {
  13136. Ext.raise('Invalid id selector: "' + id + '"');
  13137. }
  13138. return '#' + id;
  13139. },
  13140. /**
  13141. * Generates unique ids. If the object/element is passes and it already has an `id`, it is
  13142. * unchanged.
  13143. * @param {Object} [o] The object to generate an id for.
  13144. * @param {String} [prefix=ext-gen] (optional) The `id` prefix.
  13145. * @return {String} The generated `id`.
  13146. */
  13147. id: function(o, prefix) {
  13148. if (o && o.id) {
  13149. return o.id;
  13150. }
  13151. /* eslint-disable-next-line vars-on-top */
  13152. var id = (prefix || Ext.idPrefix) + (++Ext.idSeed);
  13153. if (o) {
  13154. o.id = id;
  13155. }
  13156. return id;
  13157. },
  13158. /**
  13159. * A reusable function which returns the value of `getId()` called upon a single passed
  13160. * parameter. Useful when creating a {@link Ext.util.MixedCollection} of objects keyed
  13161. * by an identifier returned from a `getId` method.
  13162. */
  13163. returnId: function(o) {
  13164. return o.getId();
  13165. },
  13166. /**
  13167. * A reusable function which returns `true`.
  13168. */
  13169. returnTrue: function() {
  13170. return true;
  13171. },
  13172. /**
  13173. * A zero length string which will pass a truth test. Useful for passing to methods
  13174. * which use a truth test to reject <i>falsy</i> values where a string value must be
  13175. * cleared.
  13176. */
  13177. emptyString: new String(),
  13178. /**
  13179. * An immutable empty array if Object.freeze is supported by the browser
  13180. * @since 6.5.0
  13181. * @private
  13182. */
  13183. emptyArray: Object.freeze ? Object.freeze([]) : [],
  13184. /**
  13185. * @property {String} [baseCSSPrefix='x-']
  13186. * The base prefix to use for all `Ext` components. To configure this property, you should
  13187. * use the Ext.buildSettings object before the framework is loaded:
  13188. *
  13189. * Ext.buildSettings = {
  13190. * baseCSSPrefix : 'abc-'
  13191. * };
  13192. *
  13193. * or you can change it before any components are rendered:
  13194. *
  13195. * Ext.baseCSSPrefix = Ext.buildSettings.baseCSSPrefix = 'abc-';
  13196. *
  13197. * This will change what CSS classes components will use and you should
  13198. * then recompile the SASS changing the `$prefix` SASS variable to match.
  13199. */
  13200. baseCSSPrefix: Ext.buildSettings.baseCSSPrefix,
  13201. /**
  13202. * @property {Object} $eventNameMap
  13203. * A map of event names which contained the lower-cased versions of any mixed
  13204. * case event names.
  13205. * @private
  13206. */
  13207. $eventNameMap: {},
  13208. // Vendor-specific events do not work if lower-cased. This regex specifies event
  13209. // prefixes for names that should NOT be lower-cased by Ext.canonicalEventName()
  13210. $vendorEventRe: /^(DOMMouse|Moz.+|MS.+|webkit.+)/,
  13211. // TODO: inlinable function - SDKTOOLS-686
  13212. /**
  13213. * @private
  13214. */
  13215. canonicalEventName: function(name) {
  13216. return Ext.$eventNameMap[name] || (Ext.$eventNameMap[name] = (Ext.$vendorEventRe.test(name) ? name : name.toLowerCase()));
  13217. },
  13218. /**
  13219. * Copies all the properties of config to object if they don't already exist.
  13220. * @param {Object} object The receiver of the properties
  13221. * @param {Object} config The source of the properties
  13222. * @return {Object} returns obj
  13223. */
  13224. applyIf: function(object, config) {
  13225. var property;
  13226. if (object && config && typeof config === 'object') {
  13227. for (property in config) {
  13228. if (object[property] === undefined) {
  13229. object[property] = config[property];
  13230. }
  13231. }
  13232. }
  13233. return object;
  13234. },
  13235. /**
  13236. * Destroys all of the given objects. If arrays are passed, the elements of these
  13237. * are destroyed recursively.
  13238. *
  13239. * What it means to "destroy" an object depends on the type of object.
  13240. *
  13241. * * `Array`: Each element of the array is destroyed recursively.
  13242. * * `Object`: Any object with a `destroy` method will have that method called.
  13243. *
  13244. * @param {Mixed...} args Any number of objects or arrays.
  13245. */
  13246. destroy: function() {
  13247. var ln = arguments.length,
  13248. i, arg;
  13249. for (i = 0; i < ln; i++) {
  13250. arg = arguments[i];
  13251. if (arg) {
  13252. if (Ext.isArray(arg)) {
  13253. this.destroy.apply(this, arg);
  13254. } else if (Ext.isFunction(arg.destroy) && !arg.destroyed) {
  13255. arg.destroy();
  13256. }
  13257. }
  13258. }
  13259. return null;
  13260. },
  13261. /**
  13262. * Destroys the specified named members of the given object using `Ext.destroy`. These
  13263. * properties will be set to `null`.
  13264. * @param {Object} object The object who's properties you wish to destroy.
  13265. * @param {String...} args One or more names of the properties to destroy and remove from
  13266. * the object.
  13267. */
  13268. destroyMembers: function(object) {
  13269. /* eslint-disable-next-line vars-on-top */
  13270. for (var ref, name,
  13271. i = 1,
  13272. a = arguments,
  13273. len = a.length; i < len; i++) {
  13274. ref = object[name = a[i]];
  13275. // Avoid adding the property if it does not already exist
  13276. if (ref != null) {
  13277. object[name] = Ext.destroy(ref);
  13278. }
  13279. }
  13280. },
  13281. /**
  13282. * Overrides members of the specified `target` with the given values.
  13283. *
  13284. * If the `target` is a class declared using {@link Ext#define Ext.define}, the
  13285. * `override` method of that class is called (see {@link Ext.Base#override}) given
  13286. * the `overrides`.
  13287. *
  13288. * If the `target` is a function, it is assumed to be a constructor and the contents
  13289. * of `overrides` are applied to its `prototype` using {@link Ext#apply Ext.apply}.
  13290. *
  13291. * If the `target` is an instance of a class declared using {@link Ext#define Ext.define},
  13292. * the `overrides` are applied to only that instance. In this case, methods are
  13293. * specially processed to allow them to use {@link Ext.Base#method!callParent}.
  13294. *
  13295. * var panel = new Ext.Panel({ ... });
  13296. *
  13297. * Ext.override(panel, {
  13298. * initComponent: function () {
  13299. * // extra processing...
  13300. *
  13301. * this.callParent();
  13302. * }
  13303. * });
  13304. *
  13305. * If the `target` is none of these, the `overrides` are applied to the `target`
  13306. * using {@link Ext#apply Ext.apply}.
  13307. *
  13308. * Please refer to {@link Ext#define Ext.define} and {@link Ext.Base#override} for
  13309. * further details.
  13310. *
  13311. * @param {Object} target The target to override.
  13312. * @param {Object} overrides The properties to add or replace on `target`.
  13313. * @method override
  13314. */
  13315. override: function(target, overrides) {
  13316. if (target.$isClass) {
  13317. target.override(overrides);
  13318. } else if (typeof target === 'function') {
  13319. Ext.apply(target.prototype, overrides);
  13320. } else {
  13321. /* eslint-disable-next-line vars-on-top */
  13322. var owner = target.self,
  13323. privates;
  13324. if (owner && owner.$isClass) {
  13325. // if (instance of Ext.define'd class)
  13326. privates = overrides.privates;
  13327. if (privates) {
  13328. overrides = Ext.apply({}, overrides);
  13329. delete overrides.privates;
  13330. addInstanceOverrides(target, owner, privates);
  13331. }
  13332. addInstanceOverrides(target, owner, overrides);
  13333. } else {
  13334. Ext.apply(target, overrides);
  13335. }
  13336. }
  13337. return target;
  13338. },
  13339. /**
  13340. * Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty};
  13341. * returns the default value (second argument) otherwise.
  13342. *
  13343. * @param {Object} value The value to test.
  13344. * @param {Object} defaultValue The value to return if the original value is empty.
  13345. * @param {Boolean} [allowBlank=false] `true` to allow zero length strings to qualify
  13346. * as non-empty.
  13347. * @return {Object} value, if non-empty, else defaultValue.
  13348. */
  13349. valueFrom: function(value, defaultValue, allowBlank) {
  13350. return Ext.isEmpty(value, allowBlank) ? defaultValue : value;
  13351. },
  13352. /**
  13353. * Returns true if the passed value is empty, false otherwise. The value is deemed to be
  13354. * empty if it is either:
  13355. *
  13356. * - `null`
  13357. * - `undefined`
  13358. * - a zero-length array
  13359. * - a zero-length string (Unless the `allowEmptyString` parameter is set to `true`)
  13360. *
  13361. * @param {Object} value The value to test.
  13362. * @param {Boolean} [allowEmptyString=false] `true` to allow empty strings.
  13363. * @return {Boolean}
  13364. */
  13365. isEmpty: function(value, allowEmptyString) {
  13366. return (value == null) || (!allowEmptyString ? value === '' : false) || (Ext.isArray(value) && value.length === 0);
  13367. },
  13368. /**
  13369. * Returns `true` if the passed value is a JavaScript Array, `false` otherwise.
  13370. *
  13371. * @param {Object} target The target to test.
  13372. * @return {Boolean}
  13373. * @method
  13374. */
  13375. isArray: ('isArray' in Array) ? Array.isArray : function(value) {
  13376. return toString.call(value) === '[object Array]';
  13377. },
  13378. /**
  13379. * Returns `true` if the passed value is a JavaScript Date object, `false` otherwise.
  13380. * @param {Object} obj The object to test.
  13381. * @return {Boolean}
  13382. */
  13383. isDate: function(obj) {
  13384. return toString.call(obj) === '[object Date]';
  13385. },
  13386. /**
  13387. * Returns 'true' if the passed value is a String that matches the MS Date JSON
  13388. * encoding format.
  13389. * @param {String} value The string to test.
  13390. * @return {Boolean}
  13391. */
  13392. isMSDate: function(value) {
  13393. if (!Ext.isString(value)) {
  13394. return false;
  13395. }
  13396. return MSDateRe.test(value);
  13397. },
  13398. /**
  13399. * Returns `true` if the passed value is a JavaScript Object, `false` otherwise.
  13400. * @param {Object} value The value to test.
  13401. * @return {Boolean}
  13402. * @method
  13403. */
  13404. isObject: (toString.call(null) === '[object Object]') ? function(value) {
  13405. // check ownerDocument here as well to exclude DOM nodes
  13406. return value != null && toString.call(value) === '[object Object]' && value.ownerDocument === undefined;
  13407. } : function(value) {
  13408. return toString.call(value) === '[object Object]';
  13409. },
  13410. /**
  13411. * @private
  13412. */
  13413. isSimpleObject: function(value) {
  13414. return value instanceof Object && value.constructor === Object;
  13415. },
  13416. /**
  13417. * Returns `true` if the passed value is a JavaScript 'primitive', a string, number
  13418. * or boolean.
  13419. * @param {Object} value The value to test.
  13420. * @return {Boolean}
  13421. */
  13422. isPrimitive: function(value) {
  13423. var type = typeof value;
  13424. return type === 'string' || type === 'number' || type === 'boolean';
  13425. },
  13426. /**
  13427. * Returns `true` if the passed value is a JavaScript Function, `false` otherwise.
  13428. * @param {Object} value The value to test.
  13429. * @return {Boolean}
  13430. * @method
  13431. */
  13432. isFunction: // Safari 3.x and 4.x returns 'function' for typeof <NodeList>, hence we need to fall back
  13433. // to using Object.prototype.toString (slower)
  13434. (typeof document !== 'undefined' && typeof document.getElementsByTagName('body') === 'function') ? function(value) {
  13435. return !!value && toString.call(value) === '[object Function]';
  13436. } : function(value) {
  13437. return !!value && typeof value === 'function';
  13438. },
  13439. /**
  13440. * Returns `true` if the passed value is a number. Returns `false` for non-finite numbers.
  13441. * @param {Object} value The value to test.
  13442. * @return {Boolean}
  13443. */
  13444. isNumber: function(value) {
  13445. return typeof value === 'number' && isFinite(value);
  13446. },
  13447. /**
  13448. * Validates that a value is numeric.
  13449. * @param {Object} value Examples: 1, '1', '2.34'
  13450. * @return {Boolean} True if numeric, false otherwise
  13451. */
  13452. isNumeric: function(value) {
  13453. return !isNaN(parseFloat(value)) && isFinite(value);
  13454. },
  13455. /**
  13456. * Returns `true `if the passed value is a string.
  13457. * @param {Object} value The value to test.
  13458. * @return {Boolean}
  13459. */
  13460. isString: function(value) {
  13461. return typeof value === 'string';
  13462. },
  13463. /**
  13464. * Returns `true` if the passed value is a boolean.
  13465. *
  13466. * @param {Object} value The value to test.
  13467. * @return {Boolean}
  13468. */
  13469. isBoolean: function(value) {
  13470. return typeof value === 'boolean';
  13471. },
  13472. /**
  13473. * Returns `true` if the passed value is an HTMLElement
  13474. * @param {Object} value The value to test.
  13475. * @return {Boolean}
  13476. */
  13477. isElement: function(value) {
  13478. return value ? value.nodeType === 1 : false;
  13479. },
  13480. /**
  13481. * Returns `true` if the passed value is a TextNode
  13482. * @param {Object} value The value to test.
  13483. * @return {Boolean}
  13484. */
  13485. isTextNode: function(value) {
  13486. return value ? value.nodeName === "#text" : false;
  13487. },
  13488. /**
  13489. * Returns `true` if the passed value is defined.
  13490. * @param {Object} value The value to test.
  13491. * @return {Boolean}
  13492. */
  13493. isDefined: function(value) {
  13494. return typeof value !== 'undefined';
  13495. },
  13496. /**
  13497. * Returns `true` if the passed value is iterable, that is, if elements of it are
  13498. * addressable using array notation with numeric indices, `false` otherwise.
  13499. *
  13500. * Arrays and function `arguments` objects are iterable. Also HTML collections such as
  13501. * `NodeList` and `HTMLCollection' are iterable.
  13502. *
  13503. * @param {Object} value The value to test
  13504. * @return {Boolean}
  13505. */
  13506. isIterable: function(value) {
  13507. // To be iterable, the object must have a numeric length property and must not be
  13508. // a string or function.
  13509. if (!value || typeof value.length !== 'number' || typeof value === 'string' || Ext.isFunction(value)) {
  13510. return false;
  13511. }
  13512. // Certain "standard" collections in IE (such as document.images) do not offer
  13513. // the correct Javascript Object interface; specifically, they lack the
  13514. // propertyIsEnumerable method.
  13515. // And the item property while it does exist is not typeof "function"
  13516. if (!value.propertyIsEnumerable) {
  13517. return !!value.item;
  13518. }
  13519. // If it is a regular, interrogatable JS object (not an IE ActiveX object), then...
  13520. // If it has its own property called "length", but not enumerable, it's iterable
  13521. if (value.hasOwnProperty('length') && !value.propertyIsEnumerable('length')) {
  13522. return true;
  13523. }
  13524. // Test against whitelist which includes known iterable collection types
  13525. return iterableRe.test(toString.call(value));
  13526. },
  13527. /**
  13528. * This method returns `true` if debug is enabled for the specified class. This is
  13529. * done by checking the `Ext.debugConfig.hooks` config for the closest match to the
  13530. * given `className`.
  13531. * @param {String} className The name of the class.
  13532. * @return {Boolean} `true` if debug is enabled for the specified class.
  13533. * @method
  13534. */
  13535. isDebugEnabled: function(className, defaultEnabled) {
  13536. var debugConfig = Ext.debugConfig.hooks;
  13537. if (debugConfig.hasOwnProperty(className)) {
  13538. return debugConfig[className];
  13539. }
  13540. /* eslint-disable-next-line vars-on-top */
  13541. var enabled = debugConfig['*'],
  13542. prefixLength = 0;
  13543. if (defaultEnabled !== undefined) {
  13544. enabled = defaultEnabled;
  13545. }
  13546. if (!className) {
  13547. return enabled;
  13548. }
  13549. /* eslint-disable-next-line vars-on-top */
  13550. for (var prefix in debugConfig) {
  13551. var value = debugConfig[prefix];
  13552. // eslint-disable-line vars-on-top
  13553. // if prefix=='Ext' match 'Ext.foo.Bar' but not 'Ext4.foo.Bar'
  13554. if (className.charAt(prefix.length) === '.') {
  13555. if (className.substring(0, prefix.length) === prefix) {
  13556. if (prefixLength < prefix.length) {
  13557. prefixLength = prefix.length;
  13558. enabled = value;
  13559. }
  13560. }
  13561. }
  13562. }
  13563. return enabled;
  13564. } || emptyFn,
  13565. /**
  13566. * Clone simple variables including array, {}-like objects, DOM nodes and Date without
  13567. * keeping the old reference. A reference for the object itself is returned if it's not
  13568. * a direct descendant of Object. For model cloning, see
  13569. * {@link Ext.data.Model#copy Model.copy}.
  13570. *
  13571. * @param {Object} item The variable to clone
  13572. * @param {Boolean} [cloneDom=true] `true` to clone DOM nodes.
  13573. * @return {Object} clone
  13574. */
  13575. clone: function(item, cloneDom) {
  13576. if (item == null) {
  13577. return item;
  13578. }
  13579. // DOM nodes
  13580. // TODO proxy this to Ext.Element.clone to handle automatic id attribute changing
  13581. // recursively
  13582. if (cloneDom !== false && item.nodeType && item.cloneNode) {
  13583. return item.cloneNode(true);
  13584. }
  13585. /* eslint-disable-next-line vars-on-top */
  13586. var type = toString.call(item),
  13587. i, j, k, clone, key;
  13588. // Date
  13589. if (type === '[object Date]') {
  13590. return new Date(item.getTime());
  13591. }
  13592. // Array
  13593. if (type === '[object Array]') {
  13594. i = item.length;
  13595. clone = [];
  13596. while (i--) {
  13597. clone[i] = Ext.clone(item[i], cloneDom);
  13598. }
  13599. }
  13600. // Object
  13601. else if (type === '[object Object]' && item.constructor === Object) {
  13602. clone = {};
  13603. for (key in item) {
  13604. clone[key] = Ext.clone(item[key], cloneDom);
  13605. }
  13606. if (enumerables) {
  13607. for (j = enumerables.length; j--; ) {
  13608. k = enumerables[j];
  13609. if (item.hasOwnProperty(k)) {
  13610. clone[k] = item[k];
  13611. }
  13612. }
  13613. }
  13614. }
  13615. return clone || item;
  13616. },
  13617. /**
  13618. * @private
  13619. * Generate a unique reference of Ext in the global scope, useful for sandboxing
  13620. */
  13621. getUniqueGlobalNamespace: function() {
  13622. var uniqueGlobalNamespace = this.uniqueGlobalNamespace,
  13623. i;
  13624. if (uniqueGlobalNamespace === undefined) {
  13625. i = 0;
  13626. do {
  13627. uniqueGlobalNamespace = 'ExtBox' + (++i);
  13628. } while (global[uniqueGlobalNamespace] !== undefined);
  13629. global[uniqueGlobalNamespace] = Ext;
  13630. this.uniqueGlobalNamespace = uniqueGlobalNamespace;
  13631. }
  13632. return uniqueGlobalNamespace;
  13633. },
  13634. /**
  13635. * @private
  13636. */
  13637. functionFactoryCache: {},
  13638. cacheableFunctionFactory: function() {
  13639. var me = this,
  13640. args = Array.prototype.slice.call(arguments),
  13641. cache = me.functionFactoryCache,
  13642. idx, fn, ln;
  13643. if (Ext.isSandboxed) {
  13644. ln = args.length;
  13645. if (ln > 0) {
  13646. ln--;
  13647. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13648. }
  13649. }
  13650. idx = args.join('');
  13651. fn = cache[idx];
  13652. if (!fn) {
  13653. fn = Function.prototype.constructor.apply(Function.prototype, args);
  13654. cache[idx] = fn;
  13655. }
  13656. return fn;
  13657. },
  13658. functionFactory: function() {
  13659. var args = Array.prototype.slice.call(arguments),
  13660. ln;
  13661. if (Ext.isSandboxed) {
  13662. ln = args.length;
  13663. if (ln > 0) {
  13664. ln--;
  13665. args[ln] = 'var Ext=window.' + Ext.name + ';' + args[ln];
  13666. }
  13667. }
  13668. return Function.prototype.constructor.apply(Function.prototype, args);
  13669. },
  13670. /**
  13671. * @private
  13672. */
  13673. Logger: {
  13674. log: function(message, priority) {
  13675. if (message && global.console) {
  13676. if (!priority || !(priority in global.console)) {
  13677. priority = 'log';
  13678. }
  13679. message = '[' + priority.toUpperCase() + '] ' + message;
  13680. global.console[priority](message);
  13681. }
  13682. },
  13683. verbose: function(message) {
  13684. this.log(message, 'verbose');
  13685. },
  13686. info: function(message) {
  13687. this.log(message, 'info');
  13688. },
  13689. warn: function(message) {
  13690. this.log(message, 'warn');
  13691. },
  13692. error: function(message) {
  13693. throw new Error(message);
  13694. },
  13695. deprecate: function(message) {
  13696. this.log(message, 'warn');
  13697. }
  13698. } || {
  13699. verbose: emptyFn,
  13700. log: emptyFn,
  13701. info: emptyFn,
  13702. warn: emptyFn,
  13703. error: function(message) {
  13704. throw new Error(message);
  13705. },
  13706. deprecate: emptyFn
  13707. },
  13708. ariaWarn: function(target, msg) {
  13709. // The checks still can be disabled by setting Ext.enableAria to false;
  13710. // this is for backwards compatibility. Also make sure we're not running
  13711. // under the slicer, warnings are pointless in that case.
  13712. if (Ext.enableAria && !Ext.slicer) {
  13713. if (!Ext.ariaWarn.first) {
  13714. Ext.ariaWarn.first = true;
  13715. Ext.log.warn("WAI-ARIA compatibility warnings can be suppressed " + "by adding the following to application startup code:");
  13716. Ext.log.warn(" Ext.ariaWarn = Ext.emptyFn;");
  13717. }
  13718. Ext.log.warn({
  13719. msg: msg,
  13720. dump: target
  13721. });
  13722. }
  13723. },
  13724. /**
  13725. * @private
  13726. */
  13727. getElementById: function(id) {
  13728. return document.getElementById(id);
  13729. },
  13730. /**
  13731. * @member Ext
  13732. * @private
  13733. */
  13734. splitAndUnescape: (function() {
  13735. var cache = {};
  13736. return function(origin, delimiter) {
  13737. if (!origin) {
  13738. return [];
  13739. } else if (!delimiter) {
  13740. return [
  13741. origin
  13742. ];
  13743. }
  13744. /* eslint-disable-next-line vars-on-top, max-len */
  13745. var replaceRe = cache[delimiter] || (cache[delimiter] = new RegExp('\\\\' + delimiter, 'g')),
  13746. result = [],
  13747. parts, part;
  13748. parts = origin.split(delimiter);
  13749. while ((part = parts.shift()) !== undefined) {
  13750. // If any of the parts ends with the delimiter that means
  13751. // the delimiter was escaped and the split was invalid. Roll back.
  13752. while (part.charAt(part.length - 1) === '\\' && parts.length > 0) {
  13753. part = part + delimiter + parts.shift();
  13754. }
  13755. // Now that we have split the parts, unescape the delimiter char
  13756. part = part.replace(replaceRe, delimiter);
  13757. result.push(part);
  13758. }
  13759. return result;
  13760. };
  13761. })(),
  13762. /**
  13763. * This is the target of the user-supplied `Ext.elevateFunction`. It wraps the
  13764. * call to a function and concludes by calling {@link Ext#fireIdle}.
  13765. * @since 6.5.1
  13766. * @private
  13767. */
  13768. doElevate: function() {
  13769. var fn = elevateFn,
  13770. args = elevateArgs,
  13771. scope = elevateScope;
  13772. // We really should never re-enter here, but we'll latch these vars just
  13773. // in case.
  13774. elevateFn = elevateArgs = elevateScope = null;
  13775. elevateRet = args ? fn.apply(scope, args) : fn.call(scope);
  13776. // Be sure to fire the idle event while elevated or its handlers will
  13777. // be running in an unprivileged context.
  13778. Ext.fireIdle();
  13779. },
  13780. /**
  13781. * Runs the given `fn` directly or using the user-provided `Ext.elevateFunction`
  13782. * (if present). After calling the `fn` the global `idle` event is fired using
  13783. * the {@link Ext#fireIdle} method.
  13784. *
  13785. * @param {Function} fn
  13786. * @param {Object} [scope]
  13787. * @param {Array} [args]
  13788. * @param {Object} [timer]
  13789. * @return {Mixed}
  13790. * @since 6.5.1
  13791. * @private
  13792. */
  13793. elevate: function(fn, scope, args, timer) // eslint-disable-line comma-style
  13794. {
  13795. var ret;
  13796. if (args && !args.length) {
  13797. args = null;
  13798. }
  13799. Ext._suppressIdle = false;
  13800. if (timer) {
  13801. timer.tick();
  13802. }
  13803. if (Ext.elevateFunction) {
  13804. elevateFn = fn;
  13805. elevateScope = scope;
  13806. elevateArgs = args;
  13807. // We reuse the same fn here to avoid GC pressure.
  13808. Ext.elevateFunction(Ext.doElevate);
  13809. ret = elevateRet;
  13810. elevateRet = null;
  13811. } else {
  13812. ret = args ? fn.apply(scope, args) : fn.call(scope);
  13813. Ext.fireIdle();
  13814. }
  13815. if (timer) {
  13816. timer.tock();
  13817. }
  13818. return ret;
  13819. },
  13820. Timer: {
  13821. all: {},
  13822. track: false,
  13823. captureStack: true,
  13824. created: function(kind, id, info) {
  13825. if (!Ext.Timer.track) {
  13826. return null;
  13827. }
  13828. /* eslint-disable-next-line vars-on-top */
  13829. var timer = Ext.apply({
  13830. kind: kind,
  13831. id: id,
  13832. done: false,
  13833. firing: false,
  13834. creator: Ext.Timer.captureStack ? new Error().stack : null,
  13835. tick: Ext.Timer.tick,
  13836. tock: Ext.Timer.tock
  13837. }, info);
  13838. /* eslint-disable-next-line vars-on-top, one-var */
  13839. var timers = Ext.Timer.all[kind] || (Ext.Timer.all[kind] = {});
  13840. timers[timer.id] = timer;
  13841. if (Ext.Timer.hook) {
  13842. Ext.Timer.hook(timer);
  13843. }
  13844. return timer;
  13845. },
  13846. get: function(id, kind) {
  13847. kind = kind || 'timeout';
  13848. /* eslint-disable-next-line vars-on-top */
  13849. var timers = Ext.Timer.all[kind];
  13850. return timers && timers[id] || null;
  13851. },
  13852. cancel: function(kind, id) {
  13853. var timers = Ext.Timer.all[kind],
  13854. timer = timers && timers[id];
  13855. if (timer) {
  13856. timer.cancelled = true;
  13857. timers[id] = null;
  13858. delete timers[id];
  13859. }
  13860. },
  13861. tick: function() {
  13862. if (Ext.Timer.firing) {
  13863. // One reason for Ext.Timer.firing to get stuck is exception thrown
  13864. // in timer handler. In that case the timer is never tock()ed
  13865. // and will be left hanging. Just clean it up.
  13866. Ext.log.error('Previous timer state not cleaned up properly: ' + Ext.Timer.firing.creator);
  13867. }
  13868. if (this.kind !== 'interval') {
  13869. this.done = true;
  13870. Ext.Timer.all[this.kind][this.id] = null;
  13871. delete Ext.Timer.all[this.kind][this.id];
  13872. }
  13873. this.firing = true;
  13874. Ext.Timer.firing = this;
  13875. },
  13876. tock: function() {
  13877. this.firing = false;
  13878. if (Ext.Timer.firing === this) {
  13879. Ext.Timer.firing = null;
  13880. }
  13881. }
  13882. },
  13883. /**
  13884. * @private
  13885. */
  13886. getExpando: function(target, id) {
  13887. var expandos = target.$expandos;
  13888. return expandos && expandos[id] || null;
  13889. },
  13890. /**
  13891. * @private
  13892. */
  13893. setExpando: function(target, id, value) {
  13894. var expandos = target.$expandos;
  13895. if (value !== undefined) {
  13896. (expandos || (target.$expandos = {}))[id] = value;
  13897. } else if (expandos) {
  13898. delete expandos[id];
  13899. }
  13900. return value;
  13901. }
  13902. });
  13903. Ext.returnTrue.$nullFn = Ext.returnId.$nullFn = true;
  13904. }());
  13905. // @override Ext
  13906. // This file is order extremely early (typically right after Ext.js) due to the
  13907. // above Cmd directive. This ensures that the "modern" and "classic" platform tags
  13908. // are properly set up as soon as possible.
  13909. Ext.platformTags.modern = !(Ext.platformTags.classic = Ext.isClassic = true);
  13910. /* eslint-disable max-len */
  13911. /**
  13912. * A helper class for the native JavaScript Error object that adds a few useful capabilities for handling
  13913. * errors in an application. When you use Ext.Error to {@link #raise} an error from within any class that
  13914. * uses the Class System, the Error class can automatically add the source class and method from which
  13915. * the error was raised. It also includes logic to automatically log the error to the console, if available,
  13916. * with additional metadata about the error. In all cases, the error will always be thrown at the end so that
  13917. * execution will halt.
  13918. *
  13919. * Ext.Error also offers a global error {@link #handle handling} method that can be overridden in order to
  13920. * handle application-wide errors in a single spot. You can optionally {@link #ignore} errors altogether,
  13921. * although in a real application it's usually a better idea to override the handling function and perform
  13922. * logging or some other method of reporting the errors in a way that is meaningful to the application.
  13923. *
  13924. * At its simplest you can simply raise an error as a simple string from within any code:
  13925. *
  13926. * Example usage:
  13927. *
  13928. * Ext.raise('Something bad happened!');
  13929. *
  13930. * If raised from plain JavaScript code, the error will be logged to the console (if available) and the message
  13931. * displayed. In most cases however you'll be raising errors from within a class, and it may often be useful to add
  13932. * additional metadata about the error being raised. The {@link #raise} method can also take a config object.
  13933. * In this form the `msg` attribute becomes the error description, and any other data added to the config gets
  13934. * added to the error object and, if the console is available, logged to the console for inspection.
  13935. *
  13936. * Example usage:
  13937. *
  13938. * Ext.define('Ext.Foo', {
  13939. * doSomething: function(option){
  13940. * if (someCondition === false) {
  13941. * Ext.raise({
  13942. * msg: 'You cannot do that!',
  13943. * option: option, // whatever was passed into the method
  13944. * 'error code': 100 // other arbitrary info
  13945. * });
  13946. * }
  13947. * }
  13948. * });
  13949. *
  13950. * If a console is available (that supports the `console.dir` function) you'll see console output like:
  13951. *
  13952. * An error was raised with the following data:
  13953. * option: Object { foo: "bar"}
  13954. * foo: "bar"
  13955. * error code: 100
  13956. * msg: "You cannot do that!"
  13957. * sourceClass: "Ext.Foo"
  13958. * sourceMethod: "doSomething"
  13959. *
  13960. * uncaught exception: You cannot do that!
  13961. *
  13962. * As you can see, the error will report exactly where it was raised and will include as much information as the
  13963. * raising code can usefully provide.
  13964. *
  13965. * If you want to handle all application errors globally you can simply override the static {@link #handle} method
  13966. * and provide whatever handling logic you need. If the method returns true then the error is considered handled
  13967. * and will not be thrown to the browser. If anything but true is returned then the error will be thrown normally.
  13968. *
  13969. * Example usage:
  13970. *
  13971. * Ext.Error.handle = function(err) {
  13972. * if (err.someProperty == 'NotReallyAnError') {
  13973. * // maybe log something to the application here if applicable
  13974. * return true;
  13975. * }
  13976. * // any non-true return value (including none) will cause the error to be thrown
  13977. * }
  13978. *
  13979. * @class Ext.Error
  13980. */
  13981. /* eslint-enable max-len */
  13982. /* eslint-disable indent */
  13983. (function() {
  13984. // @define Ext.lang.Error
  13985. // @define Ext.Error
  13986. // @require Ext
  13987. function toString() {
  13988. var me = this,
  13989. cls = me.sourceClass,
  13990. method = me.sourceMethod,
  13991. msg = me.msg;
  13992. if (method) {
  13993. if (msg) {
  13994. method += '(): ';
  13995. method += msg;
  13996. } else {
  13997. method += '()';
  13998. }
  13999. }
  14000. if (cls) {
  14001. method = method ? (cls + '.' + method) : cls;
  14002. }
  14003. return method || msg || '';
  14004. }
  14005. Ext.Error = function(config) {
  14006. var error = new Error();
  14007. if (Ext.isString(config)) {
  14008. config = {
  14009. msg: config
  14010. };
  14011. }
  14012. Ext.apply(error, config);
  14013. error.message = error.message || error.msg;
  14014. // 'message' is standard ('msg' is non-standard)
  14015. // note: the above does not work in old WebKit (me.message is readonly) (Safari 4)
  14016. error.toString = toString;
  14017. return error;
  14018. };
  14019. Ext.apply(Ext.Error, {
  14020. /**
  14021. * @property {Boolean} ignore
  14022. * Static flag that can be used to globally disable error reporting to the browser if set
  14023. * to true (defaults to false). Note that if you ignore Ext errors it's likely that some
  14024. * other code may fail and throw a native JavaScript error thereafter, so use with caution.
  14025. * In most cases it will probably be preferable to supply a custom error
  14026. * {@link #handle handling} function instead.
  14027. *
  14028. * Example usage:
  14029. *
  14030. * Ext.Error.ignore = true;
  14031. *
  14032. * @static
  14033. */
  14034. ignore: false,
  14035. /**
  14036. * This method is called internally by {@link Ext#raise}. Application code should
  14037. * call {@link Ext#raise} instead of calling this method directly.
  14038. *
  14039. * @static
  14040. * @deprecated 6.0.0 Use {@link Ext#raise} instead.
  14041. */
  14042. raise: function(err) {
  14043. var me = this,
  14044. method = me.raise.caller,
  14045. msg, name;
  14046. err = err || {};
  14047. if (Ext.isString(err)) {
  14048. err = {
  14049. msg: err
  14050. };
  14051. }
  14052. if (method === Ext.raise) {
  14053. method = method.caller;
  14054. }
  14055. if (method) {
  14056. if (!err.sourceMethod && (name = method.$name)) {
  14057. err.sourceMethod = name;
  14058. }
  14059. if (!err.sourceClass && (name = method.$owner) && (name = name.$className)) {
  14060. err.sourceClass = name;
  14061. }
  14062. }
  14063. if (me.handle(err) !== true) {
  14064. msg = toString.call(err);
  14065. Ext.log({
  14066. msg: msg,
  14067. level: 'error',
  14068. dump: err,
  14069. stack: true
  14070. });
  14071. throw new Ext.Error(err);
  14072. }
  14073. },
  14074. /**
  14075. * Globally handle any Ext errors that may be raised, optionally providing custom logic
  14076. * to handle different errors individually. Return true from the function to bypass
  14077. * throwing the error to the browser, otherwise the error will be thrown and execution
  14078. * will halt.
  14079. *
  14080. * Example usage:
  14081. *
  14082. * Ext.Error.handle = function(err) {
  14083. * if (err.someProperty == 'NotReallyAnError') {
  14084. * // maybe log something to the application here if applicable
  14085. * return true;
  14086. * }
  14087. * // any non-true return value (including none) will cause the error to be thrown
  14088. * }
  14089. *
  14090. * @param {Object} err The error being raised. It will contain any attributes that were
  14091. * originally raised with it, plus properties about the method and class from which
  14092. * the error originated (if raised from a class that uses the Class System).
  14093. * @static
  14094. */
  14095. handle: function() {
  14096. return this.ignore;
  14097. }
  14098. });
  14099. })();
  14100. /**
  14101. * Create a function that will throw an error if called (in debug mode) with a message that
  14102. * indicates the method has been removed.
  14103. * @param {String} suggestion Optional text to include in the message (a workaround perhaps).
  14104. * @return {Function} The generated function.
  14105. * @private
  14106. */
  14107. Ext.deprecated = function(suggestion) {
  14108. if (!suggestion) {
  14109. suggestion = '';
  14110. }
  14111. function fail() {
  14112. Ext.raise('The method "' + fail.$owner.$className + '.' + fail.$name + '" has been removed. ' + suggestion);
  14113. }
  14114. return fail;
  14115. return Ext.emptyFn;
  14116. };
  14117. // eslint-disable-line no-unreachable
  14118. /**
  14119. * Raise an error that can include additional data and supports automatic console logging
  14120. * if available. You can pass a string error message or an object with the `msg` attribute
  14121. * which will be used as the error message. The object can contain any other name-value
  14122. * attributes (or objects) to be logged along with the error.
  14123. *
  14124. * Note that after displaying the error message a JavaScript error will ultimately be
  14125. * thrown so that execution will halt.
  14126. *
  14127. * Example usage:
  14128. *
  14129. * Ext.raise('A simple string error message');
  14130. *
  14131. * // or...
  14132. *
  14133. * Ext.define('Ext.Foo', {
  14134. * doSomething: function(option){
  14135. * if (someCondition === false) {
  14136. * Ext.raise({
  14137. * msg: 'You cannot do that!',
  14138. * option: option, // whatever was passed into the method
  14139. * code: 100 // other arbitrary info
  14140. * });
  14141. * }
  14142. * }
  14143. * });
  14144. *
  14145. * @param {String/Object} err The error message string, or an object containing the
  14146. * attribute "msg" that will be used as the error message. Any other data included in the
  14147. * object will also be logged to the browser console, if available.
  14148. * @method raise
  14149. * @member Ext
  14150. */
  14151. Ext.raise = function() {
  14152. Ext.Error.raise.apply(Ext.Error, arguments);
  14153. };
  14154. /*
  14155. * This mechanism is used to notify the user of the first error encountered on the page. In
  14156. * most cases errors go unobserved especially on IE. This mechanism pushes this information
  14157. * to the status bar so that users don't miss it.
  14158. */
  14159. (function(skipNotify) {
  14160. if (skipNotify || typeof window === 'undefined') {
  14161. return;
  14162. }
  14163. // build system or some such environment...
  14164. // eslint-disable-next-line vars-on-top
  14165. var last = 0,
  14166. // This method is called to notify the user of the current error status.
  14167. notify = function() {
  14168. var cnt = Ext.log && Ext.log.counters,
  14169. n = cnt && (cnt.error + cnt.warn + cnt.info + cnt.log),
  14170. msg;
  14171. // Put log counters to the status bar (for most browsers):
  14172. if (n && last !== n) {
  14173. msg = [];
  14174. if (cnt.error) {
  14175. msg.push('Errors: ' + cnt.error);
  14176. }
  14177. if (cnt.warn) {
  14178. msg.push('Warnings: ' + cnt.warn);
  14179. }
  14180. if (cnt.info) {
  14181. msg.push('Info: ' + cnt.info);
  14182. }
  14183. if (cnt.log) {
  14184. msg.push('Log: ' + cnt.log);
  14185. }
  14186. window.status = '*** ' + msg.join(' -- ');
  14187. last = n;
  14188. }
  14189. };
  14190. // Allow unit tests to skip this when checking for dangling timers
  14191. notify.$skipTimerCheck = true;
  14192. // window.onerror sounds ideal but it prevents the built-in error dialog from doing
  14193. // its (better) thing. We deliberately use setInterval() here instead of going with
  14194. // Ext.interval() to keep it basic and simple.
  14195. setInterval(notify, 1000);
  14196. }(!!window.__UNIT_TESTING__));
  14197. /**
  14198. * @class Ext.Array
  14199. * @singleton
  14200. *
  14201. * A set of useful static methods to deal with arrays; provide missing methods for
  14202. * older browsers.
  14203. */
  14204. Ext.Array = (function() {
  14205. /* eslint-disable indent */
  14206. // @define Ext.lang.Array
  14207. // @define Ext.Array
  14208. // @require Ext
  14209. // @require Ext.lang.Error
  14210. var arrayPrototype = Array.prototype,
  14211. slice = arrayPrototype.slice,
  14212. supportsSplice = (function() {
  14213. var array = [],
  14214. lengthBefore,
  14215. j = 20;
  14216. if (!array.splice) {
  14217. return false;
  14218. }
  14219. // This detects a bug in IE8 splice method:
  14220. // see http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/
  14221. // 6e946d03-e09f-4b22-a4dd-cd5e276bf05a/
  14222. while (j--) {
  14223. array.push("A");
  14224. }
  14225. 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");
  14226. lengthBefore = array.length;
  14227. // 41
  14228. array.splice(13, 0, "XXX");
  14229. // add one element
  14230. if (lengthBefore + 1 !== array.length) {
  14231. return false;
  14232. }
  14233. // end IE8 bug
  14234. return true;
  14235. }()),
  14236. supportsIndexOf = 'indexOf' in arrayPrototype,
  14237. supportsSliceOnNodeList = true;
  14238. // Sort an array using the comparator, but if the comparator returns zero, use the objects'
  14239. // original indices to tiebreak This results in a stable sort.
  14240. function stableSort(array, userComparator) {
  14241. var len = array.length,
  14242. indices = new Array(len),
  14243. i;
  14244. // generate 0-n index map from original array
  14245. for (i = 0; i < len; i++) {
  14246. indices[i] = i;
  14247. }
  14248. // Sort indices array using a comparator which compares the original values at the two
  14249. // indices, and uses those indices as a tiebreaker
  14250. indices.sort(function(index1, index2) {
  14251. return userComparator(array[index1], array[index2]) || (index1 - index2);
  14252. });
  14253. // Reconsitute a sorted array using the array that the indices have been sorted into
  14254. for (i = 0; i < len; i++) {
  14255. indices[i] = array[indices[i]];
  14256. }
  14257. // Rebuild the original array
  14258. for (i = 0; i < len; i++) {
  14259. array[i] = indices[i];
  14260. }
  14261. return array;
  14262. }
  14263. try {
  14264. // IE 6 - 8 will throw an error when using Array.prototype.slice on NodeList
  14265. if (typeof document !== 'undefined') {
  14266. slice.call(document.getElementsByTagName('body'));
  14267. }
  14268. } catch (e) {
  14269. supportsSliceOnNodeList = false;
  14270. }
  14271. /* eslint-disable-next-line vars-on-top */
  14272. var fixArrayIndex = function(array, index) {
  14273. return (index < 0) ? Math.max(0, array.length + index) : Math.min(array.length, index);
  14274. },
  14275. /*
  14276. Does the same work as splice, but with a slightly more convenient signature. The splice
  14277. method has bugs in IE8, so this is the implementation we use on that platform.
  14278. The rippling of items in the array can be tricky. Consider two use cases:
  14279. index=2
  14280. removeCount=2
  14281. /=====\
  14282. +---+---+---+---+---+---+---+---+
  14283. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
  14284. +---+---+---+---+---+---+---+---+
  14285. / \/ \/ \/ \
  14286. / /\ /\ /\ \
  14287. / / \/ \/ \ +--------------------------+
  14288. / / /\ /\ +--------------------------+ \
  14289. / / / \/ +--------------------------+ \ \
  14290. / / / /+--------------------------+ \ \ \
  14291. / / / / \ \ \ \
  14292. v v v v v v v v
  14293. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14294. | 0 | 1 | 4 | 5 | 6 | 7 | | 0 | 1 | a | b | c | 4 | 5 | 6 | 7 |
  14295. +---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+---+
  14296. A B \=========/
  14297. insert=[a,b,c]
  14298. In case A, it is obvious that copying of [4,5,6,7] must be left-to-right so
  14299. that we don't end up with [0,1,6,7,6,7]. In case B, we have the opposite; we
  14300. must go right-to-left or else we would end up with [0,1,a,b,c,4,4,4,4].
  14301. */
  14302. replaceSim = function(array, index, removeCount, insert) {
  14303. var add = insert ? insert.length : 0,
  14304. length = array.length,
  14305. pos = fixArrayIndex(array, index);
  14306. // we try to use Array.push when we can for efficiency...
  14307. if (pos === length) {
  14308. if (add) {
  14309. array.push.apply(array, insert);
  14310. }
  14311. } else {
  14312. /* eslint-disable-next-line vars-on-top */
  14313. var remove = Math.min(removeCount, length - pos),
  14314. tailOldPos = pos + remove,
  14315. tailNewPos = tailOldPos + add - remove,
  14316. tailCount = length - tailOldPos,
  14317. lengthAfterRemove = length - remove,
  14318. i;
  14319. if (tailNewPos < tailOldPos) {
  14320. // case A
  14321. for (i = 0; i < tailCount; ++i) {
  14322. array[tailNewPos + i] = array[tailOldPos + i];
  14323. }
  14324. } else if (tailNewPos > tailOldPos) {
  14325. // case B
  14326. for (i = tailCount; i--; ) {
  14327. array[tailNewPos + i] = array[tailOldPos + i];
  14328. }
  14329. }
  14330. // else, add == remove (nothing to do)
  14331. if (add && pos === lengthAfterRemove) {
  14332. array.length = lengthAfterRemove;
  14333. // truncate array
  14334. array.push.apply(array, insert);
  14335. } else {
  14336. array.length = lengthAfterRemove + add;
  14337. // reserves space
  14338. for (i = 0; i < add; ++i) {
  14339. array[pos + i] = insert[i];
  14340. }
  14341. }
  14342. }
  14343. return array;
  14344. },
  14345. replaceNative = function(array, index, removeCount, insert) {
  14346. if (insert && insert.length) {
  14347. // Inserting at index zero with no removing: use unshift
  14348. if (index === 0 && !removeCount) {
  14349. array.unshift.apply(array, insert);
  14350. }
  14351. // Inserting/replacing in middle of array
  14352. else if (index < array.length) {
  14353. array.splice.apply(array, [
  14354. index,
  14355. removeCount
  14356. ].concat(insert));
  14357. } else // Appending to array
  14358. {
  14359. array.push.apply(array, insert);
  14360. }
  14361. } else {
  14362. array.splice(index, removeCount);
  14363. }
  14364. return array;
  14365. },
  14366. eraseSim = function(array, index, removeCount) {
  14367. return replaceSim(array, index, removeCount);
  14368. },
  14369. eraseNative = function(array, index, removeCount) {
  14370. array.splice(index, removeCount);
  14371. return array;
  14372. },
  14373. spliceSim = function(array, index, removeCount) {
  14374. var len = arguments.length,
  14375. pos = fixArrayIndex(array, index),
  14376. removed;
  14377. if (len < 3) {
  14378. removeCount = array.length - pos;
  14379. }
  14380. removed = array.slice(index, fixArrayIndex(array, pos + removeCount));
  14381. if (len < 4) {
  14382. replaceSim(array, pos, removeCount);
  14383. } else {
  14384. replaceSim(array, pos, removeCount, slice.call(arguments, 3));
  14385. }
  14386. return removed;
  14387. },
  14388. spliceNative = function(array) {
  14389. return array.splice.apply(array, slice.call(arguments, 1));
  14390. },
  14391. erase = supportsSplice ? eraseNative : eraseSim,
  14392. replace = supportsSplice ? replaceNative : replaceSim,
  14393. splice = supportsSplice ? spliceNative : spliceSim,
  14394. // NOTE: from here on, use erase, replace or splice (not native methods)...
  14395. ExtArray = {
  14396. /**
  14397. * This method returns the index that a given item would be inserted into the
  14398. * given (sorted) `array`. Note that the given `item` may or may not be in the
  14399. * array. This method will return the index of where the item *should* be.
  14400. *
  14401. * For example:
  14402. *
  14403. * var array = [ 'A', 'D', 'G', 'K', 'O', 'R', 'X' ];
  14404. * var index = Ext.Array.binarySearch(array, 'E');
  14405. *
  14406. * console.log('index: ' + index);
  14407. * // logs "index: 2"
  14408. *
  14409. * array.splice(index, 0, 'E');
  14410. *
  14411. * console.log('array : ' + array.join(''));
  14412. * // logs "array: ADEGKORX"
  14413. *
  14414. * @param {Object[]} array The array to search.
  14415. * @param {Object} item The item that you want to insert into the `array`.
  14416. * @param {Number} [begin=0] The first index in the `array` to consider.
  14417. * @param {Number} [end=array.length] The index that marks the end of the range
  14418. * to consider. The item at this index is *not* considered.
  14419. * @param {Function} [compareFn] The comparison function that matches the sort
  14420. * order of the `array`. The default `compareFn` compares items using less-than
  14421. * and greater-than operators.
  14422. * @return {Number} The index for the given item in the given array based on
  14423. * the current sorters.
  14424. */
  14425. binarySearch: function(array, item, begin, end, compareFn) {
  14426. var length = array.length,
  14427. middle, comparison;
  14428. if (begin instanceof Function) {
  14429. compareFn = begin;
  14430. begin = 0;
  14431. end = length;
  14432. } else if (end instanceof Function) {
  14433. compareFn = end;
  14434. end = length;
  14435. } else {
  14436. if (begin === undefined) {
  14437. begin = 0;
  14438. }
  14439. if (end === undefined) {
  14440. end = length;
  14441. }
  14442. compareFn = compareFn || ExtArray.lexicalCompare;
  14443. }
  14444. --end;
  14445. while (begin <= end) {
  14446. middle = (begin + end) >> 1;
  14447. comparison = compareFn(item, array[middle]);
  14448. if (comparison >= 0) {
  14449. begin = middle + 1;
  14450. } else if (comparison < 0) {
  14451. end = middle - 1;
  14452. }
  14453. }
  14454. return begin;
  14455. },
  14456. defaultCompare: function(lhs, rhs) {
  14457. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14458. },
  14459. // Default comparator to use when no comparator is specified for the sort method.
  14460. // Javascript sort does LEXICAL comparison.
  14461. lexicalCompare: function(lhs, rhs) {
  14462. lhs = String(lhs);
  14463. rhs = String(rhs);
  14464. return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
  14465. },
  14466. /**
  14467. * Iterates an array or an iterable value and invoke the given callback function for each
  14468. * item.
  14469. *
  14470. * var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
  14471. *
  14472. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14473. * console.log(name);
  14474. * });
  14475. *
  14476. * var sum = function() {
  14477. * var sum = 0;
  14478. *
  14479. * Ext.Array.each(arguments, function(value) {
  14480. * sum += value;
  14481. * });
  14482. *
  14483. * return sum;
  14484. * };
  14485. *
  14486. * sum(1, 2, 3); // returns 6
  14487. *
  14488. * The iteration can be stopped by returning `false` from the callback function.
  14489. * Returning `undefined` (i.e `return;`) will only exit the callback function and
  14490. * proceed with the next iteration of the loop.
  14491. *
  14492. * Ext.Array.each(countries, function(name, index, countriesItSelf) {
  14493. * if (name === 'Singapore') {
  14494. * return false; // break here
  14495. * }
  14496. * });
  14497. *
  14498. * {@link Ext#each Ext.each} is alias for {@link Ext.Array#each Ext.Array.each}
  14499. *
  14500. * @param {Array/NodeList/Object} array The value to be iterated. If this
  14501. * argument is not iterable, the callback function is called once.
  14502. * @param {Function} fn The callback function. If it returns `false`, the iteration
  14503. * stops and this method returns the current `index`. Returning `undefined` (i.e
  14504. * `return;`) will only exit the callback function and proceed with the next iteration
  14505. * in the loop.
  14506. * @param {Object} fn.item The item at the current `index` in the passed `array`
  14507. * @param {Number} fn.index The current `index` within the `array`
  14508. * @param {Array} fn.allItems The `array` itself which was passed as the first argument
  14509. * @param {Boolean} fn.return Return `false` to stop iteration.
  14510. * @param {Object} [scope] The scope (`this` reference) in which the specified function is
  14511. * executed.
  14512. * @param {Boolean} [reverse=false] Reverse the iteration order (loop from the end to the
  14513. * beginning).
  14514. * @return {Boolean/Number} If all array entries were iterated, this will be `true. If
  14515. * iteration was halted early because the passed fuction returned `false`, this will
  14516. * be the index at which iteration was halted.
  14517. */
  14518. each: function(array, fn, scope, reverse) {
  14519. var i, ln;
  14520. array = ExtArray.from(array);
  14521. ln = array.length;
  14522. if (reverse !== true) {
  14523. for (i = 0; i < ln; i++) {
  14524. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14525. return i;
  14526. }
  14527. }
  14528. } else {
  14529. for (i = ln - 1; i > -1; i--) {
  14530. if (fn.call(scope || array[i], array[i], i, array) === false) {
  14531. return i;
  14532. }
  14533. }
  14534. }
  14535. return true;
  14536. },
  14537. /*
  14538. * Calculates the the insertion index of a passed object into the passed Array according
  14539. * to the passed comparator function. Note that the passed Array *MUST* already be ordered.
  14540. * @param {Object} item The item to calculate the insertion index for.
  14541. * @param {Array} The array into which the item is to be inserted.
  14542. * @param {Function} comparatorFn The comparison function. Must return -1 or 0 or 1.
  14543. * @param {Object} comparatorFn.lhs The left object to compare.
  14544. * @param {Object} comparatorFn.rhs The right object to compare.
  14545. * @param {Number} index The possible correct index to try first before a binary
  14546. * search is instigated.
  14547. */
  14548. findInsertionIndex: function(item, items, comparatorFn, index) {
  14549. var len = items.length,
  14550. beforeCheck, afterCheck;
  14551. comparatorFn = comparatorFn || ExtArray.lexicalCompare;
  14552. if (0 <= index && index < len) {
  14553. beforeCheck = index > 0 ? comparatorFn(item, items[index - 1]) : 0;
  14554. afterCheck = (index < len) ? comparatorFn(item, items[index]) : 0;
  14555. if (0 <= beforeCheck && afterCheck < 1) {
  14556. return index;
  14557. }
  14558. }
  14559. return ExtArray.binarySearch(items, item, comparatorFn);
  14560. },
  14561. /**
  14562. * @method
  14563. * Iterates an array and invoke the given callback function for each item. Note that this
  14564. * will simply delegate to the native `Array.prototype.forEach` method if supported. It
  14565. * doesn't support stopping the iteration by returning `false` in the callback function
  14566. * like {@link Ext.Array#each}. However, performance could be much better in modern
  14567. * browsers comparing with {@link Ext.Array#each}
  14568. *
  14569. * @param {Array} array The array to iterate.
  14570. * @param {Function} fn The callback function.
  14571. * @param {Object} fn.item The item at the current `index` in the passed `array`.
  14572. * @param {Number} fn.index The current `index` within the `array`.
  14573. * @param {Array} fn.allItems The `array` itself which was passed as the first argument.
  14574. * @param {Object} scope (Optional) The execution scope (`this`) in which the
  14575. * specified function is executed.
  14576. */
  14577. forEach: ('forEach' in arrayPrototype) ? function(array, fn, scope) {
  14578. array.forEach(fn, scope);
  14579. } : function(array, fn, scope) {
  14580. var i, ln;
  14581. for (i = 0 , ln = array.length; i < ln; i++) {
  14582. fn.call(scope, array[i], i, array);
  14583. }
  14584. },
  14585. /**
  14586. * @method
  14587. * Get the index of the provided `item` in the given `array`, a supplement for the
  14588. * missing arrayPrototype.indexOf in Internet Explorer.
  14589. *
  14590. * @param {Array} array The array to check.
  14591. * @param {Object} item The item to find.
  14592. * @param {Number} from (Optional) The index at which to begin the search.
  14593. * @return {Number} The index of item in the array (or -1 if it is not found).
  14594. */
  14595. indexOf: supportsIndexOf ? function(array, item, from) {
  14596. // May be called with no array which causes an error.
  14597. return array ? arrayPrototype.indexOf.call(array, item, from) : -1;
  14598. } : function(array, item, from) {
  14599. var i,
  14600. length = array ? array.length : 0;
  14601. for (i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++) {
  14602. if (array[i] === item) {
  14603. return i;
  14604. }
  14605. }
  14606. return -1;
  14607. },
  14608. /**
  14609. * @method
  14610. * Checks whether or not the given `array` contains the specified `item`.
  14611. *
  14612. * @param {Array} array The array to check.
  14613. * @param {Object} item The item to find.
  14614. * @return {Boolean} `true` if the array contains the item, `false` otherwise.
  14615. */
  14616. contains: supportsIndexOf ? function(array, item) {
  14617. return arrayPrototype.indexOf.call(array, item) !== -1;
  14618. } : function(array, item) {
  14619. var i, ln;
  14620. for (i = 0 , ln = array.length; i < ln; i++) {
  14621. if (array[i] === item) {
  14622. return true;
  14623. }
  14624. }
  14625. return false;
  14626. },
  14627. /**
  14628. * Converts any iterable (numeric indices and a length property) into a true array.
  14629. *
  14630. * function test() {
  14631. * var args = Ext.Array.toArray(arguments),
  14632. * fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
  14633. *
  14634. * alert(args.join(' '));
  14635. * alert(fromSecondToLastArgs.join(' '));
  14636. * }
  14637. *
  14638. * test('just', 'testing', 'here'); // alerts 'just testing here';
  14639. * // alerts 'testing here';
  14640. *
  14641. * // will convert the NodeList into an array
  14642. * Ext.Array.toArray(document.getElementsByTagName('div'));
  14643. * Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
  14644. * Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
  14645. *
  14646. * {@link Ext#toArray Ext.toArray} is alias for {@link Ext.Array#toArray Ext.Array.toArray}
  14647. *
  14648. * @param {Object} iterable the iterable object to be turned into a true Array.
  14649. * @param {Number} [start=0] a zero-based index that specifies the start of extraction.
  14650. * @param {Number} [end=-1] a 1-based index that specifies the end of extraction.
  14651. * @return {Array}
  14652. */
  14653. toArray: function(iterable, start, end) {
  14654. var array = [],
  14655. i;
  14656. if (!iterable || !iterable.length) {
  14657. return array;
  14658. }
  14659. if (typeof iterable === 'string') {
  14660. iterable = iterable.split('');
  14661. }
  14662. if (supportsSliceOnNodeList) {
  14663. return slice.call(iterable, start || 0, end || iterable.length);
  14664. }
  14665. start = start || 0;
  14666. end = end ? ((end < 0) ? iterable.length + end : end) : iterable.length;
  14667. for (i = start; i < end; i++) {
  14668. array.push(iterable[i]);
  14669. }
  14670. return array;
  14671. },
  14672. /**
  14673. * Plucks the value of a property from each item in the Array. Example:
  14674. *
  14675. * // [el1.className, el2.className, ..., elN.className]
  14676. * Ext.Array.pluck(Ext.query("p"), "className");
  14677. *
  14678. * @param {Array/NodeList} array The Array of items to pluck the value from.
  14679. * @param {String} propertyName The property name to pluck from each element.
  14680. * @return {Array} The value from each item in the Array.
  14681. */
  14682. pluck: function(array, propertyName) {
  14683. var ret = [],
  14684. i, ln, item;
  14685. for (i = 0 , ln = array.length; i < ln; i++) {
  14686. item = array[i];
  14687. ret.push(item[propertyName]);
  14688. }
  14689. return ret;
  14690. },
  14691. /**
  14692. * @method
  14693. * Creates a new array with the results of calling a provided function on every element
  14694. * in this array.
  14695. *
  14696. * @param {Array} array
  14697. * @param {Function} fn Callback function for each item.
  14698. * @param {Mixed} fn.item Current item.
  14699. * @param {Number} fn.index Index of the item.
  14700. * @param {Array} fn.array The whole array that's being iterated.
  14701. * @param {Object} [scope] Callback function scope
  14702. * @return {Array} results
  14703. */
  14704. map: ('map' in arrayPrototype) ? function(array, fn, scope) {
  14705. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14706. return array.map(fn, scope);
  14707. } : function(array, fn, scope) {
  14708. Ext.Assert.isFunction(fn, 'Ext.Array.map must have a callback function passed as second argument.');
  14709. /* eslint-disable-next-line vars-on-top */
  14710. var len = array.length,
  14711. results = new Array(len),
  14712. i;
  14713. for (i = 0; i < len; i++) {
  14714. results[i] = fn.call(scope, array[i], i, array);
  14715. }
  14716. return results;
  14717. },
  14718. /**
  14719. * @method
  14720. * Executes the specified function for each array element until the function returns
  14721. * a falsy value. If such an item is found, the function will return `false` immediately.
  14722. * Otherwise, it will return `true`.
  14723. *
  14724. * @param {Array} array
  14725. * @param {Function} fn Callback function for each item.
  14726. * @param {Mixed} fn.item Current item.
  14727. * @param {Number} fn.index Index of the item.
  14728. * @param {Array} fn.array The whole array that's being iterated.
  14729. * @param {Object} scope Callback function scope.
  14730. * @return {Boolean} `true` if no false value is returned by the callback function.
  14731. */
  14732. every: ('every' in arrayPrototype) ? function(array, fn, scope) {
  14733. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14734. return array.every(fn, scope);
  14735. } : function(array, fn, scope) {
  14736. var i, ln;
  14737. Ext.Assert.isFunction(fn, 'Ext.Array.every must have a callback function passed as second argument.');
  14738. for (i = 0 , ln = array.length; i < ln; ++i) {
  14739. if (!fn.call(scope, array[i], i, array)) {
  14740. return false;
  14741. }
  14742. }
  14743. return true;
  14744. },
  14745. /**
  14746. * @method
  14747. * Executes the specified function for each array element until the function returns
  14748. * a truthy value. If such an item is found, the function will return `true` immediately.
  14749. * Otherwise, it will return `false`.
  14750. *
  14751. * @param {Array} array
  14752. * @param {Function} fn Callback function for each item.
  14753. * @param {Mixed} fn.item Current item.
  14754. * @param {Number} fn.index Index of the item.
  14755. * @param {Array} fn.array The whole array that's being iterated.
  14756. * @param {Object} scope Callback function scope.
  14757. * @return {Boolean} `true` if the callback function returns a truthy value.
  14758. */
  14759. some: ('some' in arrayPrototype) ? function(array, fn, scope) {
  14760. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14761. return array.some(fn, scope);
  14762. } : function(array, fn, scope) {
  14763. var i, ln;
  14764. Ext.Assert.isFunction(fn, 'Ext.Array.some must have a callback function passed as second argument.');
  14765. for (i = 0 , ln = array.length; i < ln; ++i) {
  14766. if (fn.call(scope, array[i], i, array)) {
  14767. return true;
  14768. }
  14769. }
  14770. return false;
  14771. },
  14772. /**
  14773. * Shallow compares the contents of 2 arrays using strict equality.
  14774. * @param {Array} array1
  14775. * @param {Array} array2
  14776. * @return {Boolean} `true` if the arrays are equal.
  14777. */
  14778. equals: function(array1, array2) {
  14779. var len1 = array1.length,
  14780. len2 = array2.length,
  14781. i;
  14782. // Short circuit if the same array is passed twice
  14783. if (array1 === array2) {
  14784. return true;
  14785. }
  14786. if (len1 !== len2) {
  14787. return false;
  14788. }
  14789. for (i = 0; i < len1; ++i) {
  14790. if (array1[i] !== array2[i]) {
  14791. return false;
  14792. }
  14793. }
  14794. return true;
  14795. },
  14796. /**
  14797. * Filter through an array and remove empty item as defined in
  14798. * {@link Ext#isEmpty Ext.isEmpty}.
  14799. *
  14800. * See {@link Ext.Array#filter}
  14801. *
  14802. * @param {Array} array
  14803. * @return {Array} results
  14804. */
  14805. clean: function(array) {
  14806. var results = [],
  14807. i, ln, item;
  14808. for (i = 0 , ln = array.length; i < ln; i++) {
  14809. item = array[i];
  14810. if (!Ext.isEmpty(item)) {
  14811. results.push(item);
  14812. }
  14813. }
  14814. return results;
  14815. },
  14816. /**
  14817. * Returns a new array with unique items.
  14818. *
  14819. * @param {Array} array
  14820. * @return {Array} results
  14821. */
  14822. unique: function(array) {
  14823. var clone = [],
  14824. i, ln, item;
  14825. for (i = 0 , ln = array.length; i < ln; i++) {
  14826. item = array[i];
  14827. if (ExtArray.indexOf(clone, item) === -1) {
  14828. clone.push(item);
  14829. }
  14830. }
  14831. return clone;
  14832. },
  14833. /**
  14834. * @method
  14835. * Creates a new array with all of the elements of this array for which
  14836. * the provided filtering function returns a truthy value.
  14837. *
  14838. * @param {Array} array
  14839. * @param {Function} fn Callback function for each item.
  14840. * @param {Mixed} fn.item Current item.
  14841. * @param {Number} fn.index Index of the item.
  14842. * @param {Array} fn.array The whole array that's being iterated.
  14843. * @param {Object} scope Callback function scope.
  14844. * @return {Array} results
  14845. */
  14846. filter: ('filter' in arrayPrototype) ? function(array, fn, scope) {
  14847. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14848. return array.filter(fn, scope);
  14849. } : function(array, fn, scope) {
  14850. var results = [],
  14851. i, ln;
  14852. Ext.Assert.isFunction(fn, 'Ext.Array.filter must have a filter function passed as second argument.');
  14853. for (i = 0 , ln = array.length; i < ln; i++) {
  14854. if (fn.call(scope, array[i], i, array)) {
  14855. results.push(array[i]);
  14856. }
  14857. }
  14858. return results;
  14859. },
  14860. /**
  14861. * Returns the first item in the array which elicits a truthy return value from the
  14862. * passed selection function.
  14863. * @param {Array} array The array to search
  14864. * @param {Function} fn The selection function to execute for each item.
  14865. * @param {Mixed} fn.item The array item.
  14866. * @param {Number} fn.index The index of the array item.
  14867. * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the
  14868. * function is executed. Defaults to the array
  14869. * @return {Object} The first item in the array which returned true from the selection
  14870. * function, or null if none was found.
  14871. */
  14872. findBy: function(array, fn, scope) {
  14873. var i, len;
  14874. for (i = 0 , len = array.length; i < len; i++) {
  14875. if (fn.call(scope || array, array[i], i)) {
  14876. return array[i];
  14877. }
  14878. }
  14879. return null;
  14880. },
  14881. /**
  14882. * Converts a value to an array if it's not already an array; returns:
  14883. *
  14884. * - An empty array if given value is `undefined` or `null`
  14885. * - Itself if given value is already an array
  14886. * - An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList
  14887. * and alike)
  14888. * - An array with one item which is the given value, otherwise
  14889. *
  14890. * @param {Object} value The value to convert to an array if it's not already is an array.
  14891. * @param {Boolean} [newReference] `true` to clone the given array and return a new
  14892. * reference if necessary.
  14893. * @return {Array} array
  14894. */
  14895. from: function(value, newReference) {
  14896. var type;
  14897. if (value === undefined || value === null) {
  14898. return [];
  14899. }
  14900. if (Ext.isArray(value)) {
  14901. return (newReference) ? slice.call(value) : value;
  14902. }
  14903. type = typeof value;
  14904. // Both strings and functions will have a length property. In phantomJS, NodeList
  14905. // instances report typeof=='function' but don't have an apply method...
  14906. if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
  14907. return ExtArray.toArray(value);
  14908. }
  14909. return [
  14910. value
  14911. ];
  14912. },
  14913. /**
  14914. * Removes the specified item from the array if it exists.
  14915. *
  14916. * @param {Array} array The array.
  14917. * @param {Object} item The item to remove.
  14918. * @return {Array} The passed array.
  14919. */
  14920. remove: function(array, item) {
  14921. var index = ExtArray.indexOf(array, item);
  14922. if (index !== -1) {
  14923. erase(array, index, 1);
  14924. }
  14925. return array;
  14926. },
  14927. /**
  14928. * Removes item/s at the specified index.
  14929. *
  14930. * @param {Array} array The array.
  14931. * @param {Number} index The index of the item to be removed.
  14932. * @param {Number} [count=1] The number of items to be removed.
  14933. * @return {Array} The passed array.
  14934. */
  14935. removeAt: function(array, index, count) {
  14936. var len = array.length;
  14937. if (index >= 0 && index < len) {
  14938. count = count || 1;
  14939. count = Math.min(count, len - index);
  14940. erase(array, index, count);
  14941. }
  14942. return array;
  14943. },
  14944. /**
  14945. * Push an item into the array only if the array doesn't contain it yet.
  14946. *
  14947. * @param {Array} array The array.
  14948. * @param {Object} item The item to include.
  14949. */
  14950. include: function(array, item) {
  14951. if (!ExtArray.contains(array, item)) {
  14952. array.push(item);
  14953. }
  14954. },
  14955. /**
  14956. * Clone a flat array without referencing the previous one. Note that this is different
  14957. * from `Ext.clone` since it doesn't handle recursive cloning. It's simply a convenient,
  14958. * easy-to-remember method for `Array.prototype.slice.call(array)`.
  14959. *
  14960. * @param {Array} array The array.
  14961. * @return {Array} The clone array.
  14962. */
  14963. clone: function(array) {
  14964. return slice.call(array);
  14965. },
  14966. /**
  14967. * Merge multiple arrays into one with unique items.
  14968. *
  14969. * {@link Ext.Array#union} is alias for {@link Ext.Array#merge}
  14970. *
  14971. * @param {Array} array1
  14972. * @param {Array} array2
  14973. * @param {Array} etc
  14974. * @return {Array} merged
  14975. */
  14976. merge: function() {
  14977. var args = slice.call(arguments),
  14978. array = [],
  14979. i, ln;
  14980. for (i = 0 , ln = args.length; i < ln; i++) {
  14981. array = array.concat(args[i]);
  14982. }
  14983. return ExtArray.unique(array);
  14984. },
  14985. /**
  14986. * Merge multiple arrays into one with unique items that exist in all of the arrays.
  14987. *
  14988. * @param {Array} array1
  14989. * @param {Array} array2
  14990. * @param {Array} etc
  14991. * @return {Array} intersect
  14992. */
  14993. intersect: function() {
  14994. var intersection = [],
  14995. arrays = slice.call(arguments),
  14996. arraysLength, array, arrayLength, minArray, minArrayIndex, minArrayCandidate, minArrayLength, element, elementCandidate, elementCount, i, j, k;
  14997. if (!arrays.length) {
  14998. return intersection;
  14999. }
  15000. // Find the smallest array
  15001. arraysLength = arrays.length;
  15002. for (i = minArrayIndex = 0; i < arraysLength; i++) {
  15003. minArrayCandidate = arrays[i];
  15004. if (!minArray || minArrayCandidate.length < minArray.length) {
  15005. minArray = minArrayCandidate;
  15006. minArrayIndex = i;
  15007. }
  15008. }
  15009. minArray = ExtArray.unique(minArray);
  15010. erase(arrays, minArrayIndex, 1);
  15011. // Use the smallest unique'd array as the anchor loop. If the other array(s) do contain
  15012. // an item in the small array, we're likely to find it before reaching the end
  15013. // of the inner loop and can terminate the search early.
  15014. minArrayLength = minArray.length;
  15015. arraysLength = arrays.length;
  15016. for (i = 0; i < minArrayLength; i++) {
  15017. element = minArray[i];
  15018. elementCount = 0;
  15019. for (j = 0; j < arraysLength; j++) {
  15020. array = arrays[j];
  15021. arrayLength = array.length;
  15022. for (k = 0; k < arrayLength; k++) {
  15023. elementCandidate = array[k];
  15024. if (element === elementCandidate) {
  15025. elementCount++;
  15026. break;
  15027. }
  15028. }
  15029. }
  15030. if (elementCount === arraysLength) {
  15031. intersection.push(element);
  15032. }
  15033. }
  15034. return intersection;
  15035. },
  15036. /**
  15037. * Perform a set difference A-B by subtracting all items in array B from array A.
  15038. *
  15039. * @param {Array} arrayA
  15040. * @param {Array} arrayB
  15041. * @return {Array} difference
  15042. */
  15043. difference: function(arrayA, arrayB) {
  15044. var clone = slice.call(arrayA),
  15045. ln = clone.length,
  15046. i, j, lnB;
  15047. for (i = 0 , lnB = arrayB.length; i < lnB; i++) {
  15048. for (j = 0; j < ln; j++) {
  15049. if (clone[j] === arrayB[i]) {
  15050. erase(clone, j, 1);
  15051. j--;
  15052. ln--;
  15053. }
  15054. }
  15055. }
  15056. return clone;
  15057. },
  15058. /**
  15059. * This method applies the `reduceFn` function against an accumulator and each
  15060. * value of the `array` (from left-to-right) to reduce it to a single value.
  15061. *
  15062. * If no `initialValue` is specified, the first element of the array is used as
  15063. * the initial value. For example:
  15064. *
  15065. * function reducer (previous, value, index) {
  15066. * console.log('[' + index + ']: (' + previous + ',' + value + '}');
  15067. * return previous * 10 + value;
  15068. * }
  15069. *
  15070. * v = Ext.Array.reduce([2, 3, 4], reducer);
  15071. * console.log('v = ' + v);
  15072. *
  15073. * > [1]: (2, 3)
  15074. * > [2]: (23, 4)
  15075. * > v = 234
  15076. *
  15077. * v = Ext.Array.reduce([2, 3, 4], reducer, 1);
  15078. * console.log('v = ' + v);
  15079. *
  15080. * > [0]: (1, 2)
  15081. * > [1]: (12, 3)
  15082. * > [2]: (123, 4)
  15083. * > v = 1234
  15084. *
  15085. * @param {Array} array The array to process.
  15086. * @param {Function} reduceFn The reducing callback function.
  15087. * @param {Mixed} reduceFn.previous The previous value.
  15088. * @param {Mixed} reduceFn.value The current value.
  15089. * @param {Number} reduceFn.index The index in the array of the current `value`.
  15090. * @param {Array} reduceFn.array The array to being processed.
  15091. * @param {Mixed} [initialValue] The starting value.
  15092. * @return {Mixed} The reduced value.
  15093. * @method reduce
  15094. * @since 6.0.0
  15095. */
  15096. reduce: Array.prototype.reduce ? function(array, reduceFn, initialValue) {
  15097. if (arguments.length === 3) {
  15098. return Array.prototype.reduce.call(array, reduceFn, initialValue);
  15099. }
  15100. return Array.prototype.reduce.call(array, reduceFn);
  15101. } : function(array, reduceFn, initialValue) {
  15102. array = Object(array);
  15103. if (!Ext.isFunction(reduceFn)) {
  15104. Ext.raise('Invalid parameter: expected a function.');
  15105. }
  15106. /* eslint-disable-next-line vars-on-top */
  15107. var index = 0,
  15108. length = array.length >>> 0,
  15109. reduced = initialValue;
  15110. if (arguments.length < 3) {
  15111. while (true) {
  15112. // eslint-disable-line no-constant-condition
  15113. if (index in array) {
  15114. reduced = array[index++];
  15115. break;
  15116. }
  15117. if (++index >= length) {
  15118. throw new TypeError('Reduce of empty array with no initial value');
  15119. }
  15120. }
  15121. }
  15122. for (; index < length; ++index) {
  15123. if (index in array) {
  15124. reduced = reduceFn(reduced, array[index], index, array);
  15125. }
  15126. }
  15127. return reduced;
  15128. },
  15129. /**
  15130. * Returns a shallow copy of a part of an array. This is equivalent to the native
  15131. * call `Array.prototype.slice.call(array, begin, end)`. This is often used when "array"
  15132. * is "arguments" since the arguments object does not supply a slice method but can
  15133. * be the context object to `Array.prototype.slice`.
  15134. *
  15135. * @param {Array} array The array (or arguments object).
  15136. * @param {Number} begin The index at which to begin. Negative values are offsets from
  15137. * the end of the array.
  15138. * @param {Number} end The index at which to end. The copied items do not include
  15139. * end. Negative values are offsets from the end of the array. If end is omitted,
  15140. * all items up to the end of the array are copied.
  15141. * @return {Array} The copied piece of the array.
  15142. * @method slice
  15143. */
  15144. // Note: IE8 will return [] on slice.call(x, undefined).
  15145. slice: ([
  15146. 1,
  15147. 2
  15148. ].slice(1, undefined).length ? function(array, begin, end) {
  15149. return slice.call(array, begin, end);
  15150. } : function(array, begin, end) {
  15151. // see http://jsperf.com/slice-fix
  15152. if (typeof begin === 'undefined') {
  15153. return slice.call(array);
  15154. }
  15155. if (typeof end === 'undefined') {
  15156. return slice.call(array, begin);
  15157. }
  15158. return slice.call(array, begin, end);
  15159. }),
  15160. /**
  15161. * Sorts the elements of an Array in a stable manner (equivalently keyed values do not move
  15162. * relative to each other). By default, this method sorts the elements alphabetically and
  15163. * ascending.
  15164. * **Note:** This method modifies the passed array, in the same manner as the
  15165. * native javascript Array.sort.
  15166. *
  15167. * @param {Array} array The array to sort.
  15168. * @param {Function} [sortFn] The comparison function.
  15169. * @param {Mixed} sortFn.a The first item to compare.
  15170. * @param {Mixed} sortFn.b The second item to compare.
  15171. * @param {Number} sortFn.return `-1` if a < b, `1` if a > b, otherwise `0`.
  15172. * @return {Array} The sorted array.
  15173. */
  15174. sort: function(array, sortFn) {
  15175. return stableSort(array, sortFn || ExtArray.lexicalCompare);
  15176. },
  15177. /**
  15178. * Recursively flattens into 1-d Array. Injects Arrays inline.
  15179. *
  15180. * @param {Array} array The array to flatten
  15181. * @return {Array} The 1-d array.
  15182. */
  15183. flatten: function(array) {
  15184. var worker = [];
  15185. function rFlatten(a) {
  15186. var i, ln, v;
  15187. for (i = 0 , ln = a.length; i < ln; i++) {
  15188. v = a[i];
  15189. if (Ext.isArray(v)) {
  15190. rFlatten(v);
  15191. } else {
  15192. worker.push(v);
  15193. }
  15194. }
  15195. return worker;
  15196. }
  15197. return rFlatten(array);
  15198. },
  15199. /**
  15200. * Returns the minimum value in the Array.
  15201. *
  15202. * @param {Array/NodeList} array The Array from which to select the minimum value.
  15203. * @param {Function} comparisonFn (optional) a function to perform the comparison which
  15204. * determines minimization.
  15205. * If omitted the "<" operator will be used.
  15206. * __Note:__ gt = 1; eq = 0; lt = -1
  15207. * @param {Mixed} comparisonFn.min Current minimum value.
  15208. * @param {Mixed} comparisonFn.item The value to compare with the current minimum.
  15209. * @return {Object} minValue The minimum value.
  15210. */
  15211. min: function(array, comparisonFn) {
  15212. var min = array[0],
  15213. i, ln, item;
  15214. for (i = 0 , ln = array.length; i < ln; i++) {
  15215. item = array[i];
  15216. if (comparisonFn) {
  15217. if (comparisonFn(min, item) === 1) {
  15218. min = item;
  15219. }
  15220. } else {
  15221. if (item < min) {
  15222. min = item;
  15223. }
  15224. }
  15225. }
  15226. return min;
  15227. },
  15228. /**
  15229. * Returns the maximum value in the Array.
  15230. *
  15231. * @param {Array/NodeList} array The Array from which to select the maximum value.
  15232. * @param {Function} comparisonFn (optional) a function to perform the comparison which
  15233. * determines maximization.
  15234. * If omitted the ">" operator will be used.
  15235. * __Note:__ gt = 1; eq = 0; lt = -1
  15236. * @param {Mixed} comparisonFn.max Current maximum value.
  15237. * @param {Mixed} comparisonFn.item The value to compare with the current maximum.
  15238. * @return {Object} maxValue The maximum value.
  15239. */
  15240. max: function(array, comparisonFn) {
  15241. var max = array[0],
  15242. i, ln, item;
  15243. for (i = 0 , ln = array.length; i < ln; i++) {
  15244. item = array[i];
  15245. if (comparisonFn) {
  15246. if (comparisonFn(max, item) === -1) {
  15247. max = item;
  15248. }
  15249. } else {
  15250. if (item > max) {
  15251. max = item;
  15252. }
  15253. }
  15254. }
  15255. return max;
  15256. },
  15257. /**
  15258. * Calculates the mean of all items in the array.
  15259. *
  15260. * @param {Array} array The Array to calculate the mean value of.
  15261. * @return {Number} The mean.
  15262. */
  15263. mean: function(array) {
  15264. return array.length > 0 ? ExtArray.sum(array) / array.length : undefined;
  15265. },
  15266. /**
  15267. * Calculates the sum of all items in the given array.
  15268. *
  15269. * @param {Array} array The Array to calculate the sum value of.
  15270. * @return {Number} The sum.
  15271. */
  15272. sum: function(array) {
  15273. var sum = 0,
  15274. i, ln, item;
  15275. for (i = 0 , ln = array.length; i < ln; i++) {
  15276. item = array[i];
  15277. sum += item;
  15278. }
  15279. return sum;
  15280. },
  15281. /**
  15282. * Creates a map (object) keyed by the elements of the given array. The values in
  15283. * the map are the index+1 of the array element. For example:
  15284. *
  15285. * var map = Ext.Array.toMap(['a','b','c']);
  15286. *
  15287. * // map = { a: 1, b: 2, c: 3 };
  15288. *
  15289. * Or a key property can be specified:
  15290. *
  15291. * var map = Ext.Array.toMap([
  15292. * { name: 'a' },
  15293. * { name: 'b' },
  15294. * { name: 'c' }
  15295. * ], 'name');
  15296. *
  15297. * // map = { a: 1, b: 2, c: 3 };
  15298. *
  15299. * Lastly, a key extractor can be provided:
  15300. *
  15301. * var map = Ext.Array.toMap([
  15302. * { name: 'a' },
  15303. * { name: 'b' },
  15304. * { name: 'c' }
  15305. * ], function(obj) { return obj.name.toUpperCase(); });
  15306. *
  15307. * // map = { A: 1, B: 2, C: 3 };
  15308. *
  15309. * @param {String/String[]} strings The strings from which to create the map.
  15310. * @param {String/Function} [getKey] Name of the object property to use
  15311. * as a key or a function to extract the key.
  15312. * @param {Object} [scope] Value of `this` inside callback specified for `getKey`.
  15313. * @return {Object} The resulting map.
  15314. */
  15315. toMap: function(strings, getKey, scope) {
  15316. var map, i;
  15317. if (!strings) {
  15318. return null;
  15319. }
  15320. map = {};
  15321. i = strings.length;
  15322. if (typeof strings === 'string') {
  15323. map[strings] = 1;
  15324. } else if (!getKey) {
  15325. while (i--) {
  15326. map[strings[i]] = i + 1;
  15327. }
  15328. } else if (typeof getKey === 'string') {
  15329. while (i--) {
  15330. map[strings[i][getKey]] = i + 1;
  15331. }
  15332. } else {
  15333. while (i--) {
  15334. map[getKey.call(scope, strings[i])] = i + 1;
  15335. }
  15336. }
  15337. return map;
  15338. },
  15339. /**
  15340. * Creates a map (object) keyed by a property of elements of the given array. The values in
  15341. * the map are the array element. For example:
  15342. *
  15343. * var map = Ext.Array.toValueMap(['a','b','c']);
  15344. *
  15345. * // map = { a: 'a', b: 'b', c: 'c' };
  15346. *
  15347. * Or a key property can be specified:
  15348. *
  15349. * var map = Ext.Array.toValueMap([
  15350. * { name: 'a' },
  15351. * { name: 'b' },
  15352. * { name: 'c' }
  15353. * ], 'name');
  15354. *
  15355. * // map = { a: {name: 'a'}, b: {name: 'b'}, c: {name: 'c'} };
  15356. *
  15357. * Lastly, a key extractor can be provided:
  15358. *
  15359. * var map = Ext.Array.toValueMap([
  15360. * { name: 'a' },
  15361. * { name: 'b' },
  15362. * { name: 'c' }
  15363. * ], function(obj) { return obj.name.toUpperCase(); });
  15364. *
  15365. * // map = { A: {name: 'a'}, B: {name: 'b'}, C: {name: 'c'} };
  15366. *
  15367. * @param {Array} array The Array to create the map from.
  15368. * @param {String/Function} [getKey] Name of the object property to use
  15369. * as a key or a function to extract the key.
  15370. * @param {Object} [scope] Value of this inside callback. This parameter is only
  15371. * passed when `getKey` is a function. If `getKey` is not a function, the 3rd
  15372. * argument is `arrayify`.
  15373. * @param {Number} [arrayify] Pass `1` to create arrays for all map entries
  15374. * or `2` to create arrays for map entries that have 2 or more items with the
  15375. * same key. This only applies when `getKey` is specified. By default the map will
  15376. * hold the last entry with a given key.
  15377. * @return {Object} The resulting map.
  15378. */
  15379. toValueMap: function(array, getKey, scope, arrayify) {
  15380. var map = {},
  15381. i = array.length,
  15382. autoArray, alwaysArray, entry, fn, key, value;
  15383. if (!getKey) {
  15384. while (i--) {
  15385. value = array[i];
  15386. map[value] = value;
  15387. }
  15388. } else {
  15389. if (!(fn = (typeof getKey !== 'string'))) {
  15390. arrayify = scope;
  15391. }
  15392. alwaysArray = arrayify === 1;
  15393. autoArray = arrayify === 2;
  15394. while (i--) {
  15395. value = array[i];
  15396. key = fn ? getKey.call(scope, value) : value[getKey];
  15397. if (alwaysArray) {
  15398. if (key in map) {
  15399. map[key].push(value);
  15400. } else {
  15401. map[key] = [
  15402. value
  15403. ];
  15404. }
  15405. } else if (autoArray && (key in map)) {
  15406. if ((entry = map[key]) instanceof Array) {
  15407. entry.push(value);
  15408. } else {
  15409. map[key] = [
  15410. entry,
  15411. value
  15412. ];
  15413. }
  15414. } else {
  15415. map[key] = value;
  15416. }
  15417. }
  15418. }
  15419. return map;
  15420. },
  15421. _replaceSim: replaceSim,
  15422. // for unit testing
  15423. _spliceSim: spliceSim,
  15424. /**
  15425. * Removes items from an array. This is functionally equivalent to the splice method
  15426. * of Array, but works around bugs in IE8's splice method and does not copy the
  15427. * removed elements in order to return them (because very often they are ignored).
  15428. *
  15429. * @param {Array} array The Array on which to replace.
  15430. * @param {Number} index The index in the array at which to operate.
  15431. * @param {Number} removeCount The number of items to remove at index.
  15432. * @return {Array} The array passed.
  15433. * @method
  15434. */
  15435. erase: erase,
  15436. /**
  15437. * Inserts items in to an array.
  15438. *
  15439. * @param {Array} array The Array in which to insert.
  15440. * @param {Number} index The index in the array at which to operate.
  15441. * @param {Array} items The array of items to insert at index.
  15442. * @return {Array} The array passed.
  15443. */
  15444. insert: function(array, index, items) {
  15445. return replace(array, index, 0, items);
  15446. },
  15447. move: function(array, fromIdx, toIdx) {
  15448. if (toIdx === fromIdx) {
  15449. return;
  15450. }
  15451. /* eslint-disable-next-line vars-on-top */
  15452. var item = array[fromIdx],
  15453. incr = toIdx > fromIdx ? 1 : -1,
  15454. i;
  15455. for (i = fromIdx; i !== toIdx; i += incr) {
  15456. array[i] = array[i + incr];
  15457. }
  15458. array[toIdx] = item;
  15459. },
  15460. /**
  15461. * Replaces items in an array. This is functionally equivalent to the splice method
  15462. * of Array, but works around bugs in IE8's splice method and is often more convenient
  15463. * to call because it accepts an array of items to insert rather than use a variadic
  15464. * argument list.
  15465. *
  15466. * @param {Array} array The Array on which to replace.
  15467. * @param {Number} index The index in the array at which to operate.
  15468. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15469. * @param {Array} insert (optional) An array of items to insert at index.
  15470. * @return {Array} The array passed.
  15471. * @method
  15472. */
  15473. replace: replace,
  15474. /**
  15475. * Replaces items in an array. This is equivalent to the splice method of Array, but
  15476. * works around bugs in IE8's splice method. The signature is exactly the same as the
  15477. * splice method except that the array is the first argument. All arguments following
  15478. * removeCount are inserted in the array at index.
  15479. *
  15480. * @param {Array} array The Array on which to replace.
  15481. * @param {Number} index The index in the array at which to operate.
  15482. * @param {Number} removeCount The number of items to remove at index (can be 0).
  15483. * @param {Object...} elements The elements to add to the array. If you don't specify
  15484. * any elements, splice simply removes elements from the array.
  15485. * @return {Array} An array containing the removed items.
  15486. * @method
  15487. */
  15488. splice: splice,
  15489. /**
  15490. * Pushes new items onto the end of an Array.
  15491. *
  15492. * Passed parameters may be single items, or arrays of items. If an Array is found in the
  15493. * argument list, all its elements are pushed into the end of the target Array.
  15494. *
  15495. * @param {Array} target The Array onto which to push new items
  15496. * @param {Object...} elements The elements to add to the array. Each parameter may
  15497. * be an Array, in which case all the elements of that Array will be pushed into the end
  15498. * of the destination Array.
  15499. * @return {Array} An array containing all the new items push onto the end.
  15500. */
  15501. push: function(target) {
  15502. var args = arguments,
  15503. len = args.length,
  15504. i, newItem;
  15505. if (target === undefined) {
  15506. target = [];
  15507. } else if (!Ext.isArray(target)) {
  15508. target = [
  15509. target
  15510. ];
  15511. }
  15512. for (i = 1; i < len; i++) {
  15513. newItem = args[i];
  15514. Array.prototype.push[Ext.isIterable(newItem) ? 'apply' : 'call'](target, newItem);
  15515. }
  15516. return target;
  15517. },
  15518. /**
  15519. * A function used to sort an array by numeric value. By default, javascript array values
  15520. * are coerced to strings when sorting, which can be problematic when using numeric values.
  15521. * To ensure that the values are sorted numerically, this method can be passed to the sort
  15522. * method:
  15523. *
  15524. * Ext.Array.sort(myArray, Ext.Array.numericSortFn);
  15525. */
  15526. numericSortFn: function(a, b) {
  15527. return a - b;
  15528. }
  15529. };
  15530. /**
  15531. * @method each
  15532. * @member Ext
  15533. * @inheritdoc Ext.Array#each
  15534. */
  15535. Ext.each = ExtArray.each;
  15536. /**
  15537. * @method union
  15538. * @member Ext.Array
  15539. * @inheritdoc Ext.Array#merge
  15540. */
  15541. ExtArray.union = ExtArray.merge;
  15542. /**
  15543. * Old alias to {@link Ext.Array#min}
  15544. * @deprecated 4.0.0 Use {@link Ext.Array#min} instead
  15545. * @method min
  15546. * @member Ext
  15547. * @inheritdoc Ext.Array#min
  15548. */
  15549. Ext.min = ExtArray.min;
  15550. /**
  15551. * Old alias to {@link Ext.Array#max}
  15552. * @deprecated 4.0.0 Use {@link Ext.Array#max} instead
  15553. * @method max
  15554. * @member Ext
  15555. * @inheritdoc Ext.Array#max
  15556. */
  15557. Ext.max = ExtArray.max;
  15558. /**
  15559. * Old alias to {@link Ext.Array#sum}
  15560. * @deprecated 4.0.0 Use {@link Ext.Array#sum} instead
  15561. * @method sum
  15562. * @member Ext
  15563. * @inheritdoc Ext.Array#sum
  15564. */
  15565. Ext.sum = ExtArray.sum;
  15566. /**
  15567. * Old alias to {@link Ext.Array#mean}
  15568. * @deprecated 4.0.0 Use {@link Ext.Array#mean} instead
  15569. * @method mean
  15570. * @member Ext
  15571. * @inheritdoc Ext.Array#mean
  15572. */
  15573. Ext.mean = ExtArray.mean;
  15574. /**
  15575. * Old alias to {@link Ext.Array#flatten}
  15576. * @deprecated 4.0.0 Use {@link Ext.Array#flatten} instead
  15577. * @method flatten
  15578. * @member Ext
  15579. * @inheritdoc Ext.Array#flatten
  15580. */
  15581. Ext.flatten = ExtArray.flatten;
  15582. /**
  15583. * Old alias to {@link Ext.Array#clean}
  15584. * @deprecated 4.0.0 Use {@link Ext.Array#clean} instead
  15585. * @method clean
  15586. * @member Ext
  15587. * @inheritdoc Ext.Array#clean
  15588. */
  15589. Ext.clean = ExtArray.clean;
  15590. /**
  15591. * Old alias to {@link Ext.Array#unique}
  15592. * @deprecated 4.0.0 Use {@link Ext.Array#unique} instead
  15593. * @method unique
  15594. * @member Ext
  15595. * @inheritdoc Ext.Array#unique
  15596. */
  15597. Ext.unique = ExtArray.unique;
  15598. /**
  15599. * Old alias to {@link Ext.Array#pluck Ext.Array.pluck}
  15600. * @deprecated 4.0.0 Use {@link Ext.Array#pluck Ext.Array.pluck} instead
  15601. * @method pluck
  15602. * @member Ext
  15603. * @inheritdoc Ext.Array#pluck
  15604. */
  15605. Ext.pluck = ExtArray.pluck;
  15606. /**
  15607. * @method toArray
  15608. * @member Ext
  15609. * @inheritdoc Ext.Array#toArray
  15610. */
  15611. Ext.toArray = function() {
  15612. return ExtArray.toArray.apply(ExtArray, arguments);
  15613. };
  15614. return ExtArray;
  15615. }());
  15616. // @define Ext.lang.Assert
  15617. // @define Ext.Assert
  15618. // @require Ext.lang.Error
  15619. /**
  15620. * @class Ext.Assert
  15621. * This class provides help value testing methods useful for diagnostics. These are often
  15622. * used in `debugHooks`:
  15623. *
  15624. * Ext.define('Foo.bar.Class', {
  15625. *
  15626. * debugHooks: {
  15627. * method: function (a) {
  15628. * Ext.Assert.truthy(a, 'Expected "a" to be truthy');
  15629. * },
  15630. *
  15631. * foo: function (object) {
  15632. * Ext.Assert.isFunctionProp(object, 'doSomething');
  15633. * }
  15634. * }
  15635. * });
  15636. *
  15637. * **NOTE:** This class is entirely removed in production builds so all uses of it should
  15638. * be either in `debug` conditional comments or `debugHooks`.
  15639. *
  15640. * The following type detection methods from the `Ext` object are wrapped as assertions
  15641. * by this class:
  15642. *
  15643. * * `isEmpty`
  15644. * * `isArray`
  15645. * * `isDate`
  15646. * * `isObject`
  15647. * * `isSimpleObject`
  15648. * * `isPrimitive`
  15649. * * `isFunction`
  15650. * * `isNumber`
  15651. * * `isNumeric`
  15652. * * `isString`
  15653. * * `isBoolean`
  15654. * * `isElement`
  15655. * * `isTextNode`
  15656. * * `isDefined`
  15657. * * `isIterable`
  15658. *
  15659. * These appear both their exact name and with a "Prop" suffix for checking a property on
  15660. * an object. For example, these are almost identical:
  15661. *
  15662. * Ext.Assert.isFunction(object.foo);
  15663. *
  15664. * Ext.Assert.isFunctionProp(object, 'foo');
  15665. *
  15666. * The difference is the default error message generated is better in the second use case
  15667. * than the first.
  15668. *
  15669. * The above list are also expanded for "Not" flavors (and "Not...Prop"):
  15670. *
  15671. * * `isNotEmpty`
  15672. * * `isNotArray`
  15673. * * `isNotDate`
  15674. * * `isNotObject`
  15675. * * `isNotSimpleObject`
  15676. * * `isNotPrimitive`
  15677. * * `isNotFunction`
  15678. * * `isNotNumber`
  15679. * * `isNotNumeric`
  15680. * * `isNotString`
  15681. * * `isNotBoolean`
  15682. * * `isNotElement`
  15683. * * `isNotTextNode`
  15684. * * `isNotDefined`
  15685. * * `isNotIterable`
  15686. */
  15687. Ext.Assert = {
  15688. /**
  15689. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15690. */
  15691. falsey: function(b, msg) {
  15692. if (b) {
  15693. Ext.raise(msg || ('Expected a falsey value but was ' + b));
  15694. }
  15695. },
  15696. /**
  15697. * Checks that the first argument is falsey and throws an `Error` if it is not.
  15698. */
  15699. falseyProp: function(object, property) {
  15700. var b;
  15701. Ext.Assert.truthy(object);
  15702. b = object[property];
  15703. if (b) {
  15704. if (object.$className) {
  15705. property = object.$className + '#' + property;
  15706. }
  15707. Ext.raise('Expected a falsey value for ' + property + ' but was ' + b);
  15708. }
  15709. },
  15710. /**
  15711. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15712. */
  15713. truthy: function(b, msg) {
  15714. if (!b) {
  15715. Ext.raise(msg || ('Expected a truthy value but was ' + typeof b));
  15716. }
  15717. },
  15718. /**
  15719. * Checks that the first argument is truthy and throws an `Error` if it is not.
  15720. */
  15721. truthyProp: function(object, property) {
  15722. var b;
  15723. Ext.Assert.truthy(object);
  15724. b = object[property];
  15725. if (!b) {
  15726. if (object.$className) {
  15727. property = object.$className + '#' + property;
  15728. }
  15729. Ext.raise('Expected a truthy value for ' + property + ' but was ' + typeof b);
  15730. }
  15731. }
  15732. };
  15733. /* eslint-disable indent */
  15734. (function() {
  15735. var name, kind;
  15736. function makeAssert(name, kind) {
  15737. var testFn = Ext[name],
  15738. def;
  15739. return function(value, msg) {
  15740. if (!testFn(value)) {
  15741. Ext.raise(msg || def || (def = 'Expected value to be ' + kind));
  15742. }
  15743. };
  15744. }
  15745. function makeAssertProp(name, kind) {
  15746. var testFn = Ext[name],
  15747. def;
  15748. return function(object, prop) {
  15749. Ext.Assert.truthy(object);
  15750. if (!testFn(object[prop])) {
  15751. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to be ' + kind));
  15752. }
  15753. };
  15754. }
  15755. function makeNotAssert(name, kind) {
  15756. var testFn = Ext[name],
  15757. def;
  15758. return function(value, msg) {
  15759. if (testFn(value)) {
  15760. Ext.raise(msg || def || (def = 'Expected value to NOT be ' + kind));
  15761. }
  15762. };
  15763. }
  15764. function makeNotAssertProp(name, kind) {
  15765. var testFn = Ext[name],
  15766. def;
  15767. return function(object, prop) {
  15768. Ext.Assert.truthy(object);
  15769. if (testFn(object[prop])) {
  15770. Ext.raise(def || (def = 'Expected ' + (object.$className ? object.$className + '#' : '') + prop + ' to NOT be ' + kind));
  15771. }
  15772. };
  15773. }
  15774. for (name in Ext) {
  15775. if (name.substring(0, 2) === "is" && Ext.isFunction(Ext[name])) {
  15776. kind = name.substring(2);
  15777. Ext.Assert[name] = makeAssert(name, kind);
  15778. Ext.Assert[name + 'Prop'] = makeAssertProp(name, kind);
  15779. Ext.Assert['isNot' + kind] = makeNotAssert(name, kind);
  15780. Ext.Assert['isNot' + kind + 'Prop'] = makeNotAssertProp(name, kind);
  15781. }
  15782. }
  15783. }());
  15784. /**
  15785. * @class Ext.String
  15786. *
  15787. * A collection of useful static methods to deal with strings.
  15788. * @singleton
  15789. */
  15790. /* eslint-disable indent */
  15791. Ext.String = (function() {
  15792. // @define Ext.lang.String
  15793. // @define Ext.String
  15794. // @require Ext
  15795. // @require Ext.lang.Array
  15796. // eslint-disable-next-line no-control-regex
  15797. 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,
  15798. escapeRe = /('|\\)/g,
  15799. // eslint-disable-next-line no-useless-escape
  15800. escapeRegexRe = /([-.*+?\^${}()|\[\]\/\\])/g,
  15801. basicTrimRe = /^\s+|\s+$/g,
  15802. whitespaceRe = /\s+/,
  15803. varReplace = /(^[^a-z]*|[^\w])/gi,
  15804. charToEntity, entityToChar, charToEntityRegex, entityToCharRegex,
  15805. htmlEncodeReplaceFn = function(match, capture) {
  15806. return charToEntity[capture];
  15807. },
  15808. htmlDecodeReplaceFn = function(match, capture) {
  15809. return (capture in entityToChar) ? entityToChar[capture] : String.fromCharCode(parseInt(capture.substr(2), 10));
  15810. },
  15811. boundsCheck = function(s, other) {
  15812. if (s === null || s === undefined || other === null || other === undefined) {
  15813. return false;
  15814. }
  15815. return other.length <= s.length;
  15816. },
  15817. fromCharCode = String.fromCharCode,
  15818. ExtString;
  15819. return ExtString = {
  15820. /**
  15821. * @method
  15822. * Creates a string created by using the specified sequence of code points.
  15823. * @param {Number...} codePoint Codepoints from which to build the string.
  15824. * @return {String} A string built from the sequence of code points passed.
  15825. */
  15826. fromCodePoint: String.fromCodePoint || function() {
  15827. var codePoint,
  15828. result = '',
  15829. codeUnits = [],
  15830. index = -1,
  15831. length = arguments.length;
  15832. while (++index < length) {
  15833. codePoint = Number(arguments[index]);
  15834. if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
  15835. codePoint < 0 || // not a valid Unicode code point
  15836. codePoint > 1114111 || // not a valid Unicode code point
  15837. Math.floor(codePoint) !== codePoint) // not an integer
  15838. {
  15839. Ext.raise('Invalid code point: ' + codePoint);
  15840. }
  15841. if (codePoint <= 65535) {
  15842. // BMP code point
  15843. codeUnits.push(codePoint);
  15844. } else {
  15845. // Astral code point; split in surrogate halves
  15846. // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  15847. codePoint -= 65536;
  15848. codeUnits.push((codePoint >> 10) + 55296, (codePoint % 1024) + 56320);
  15849. }
  15850. if (index + 1 === length) {
  15851. result += fromCharCode(codeUnits);
  15852. codeUnits.length = 0;
  15853. }
  15854. }
  15855. return result;
  15856. },
  15857. /**
  15858. * Inserts a substring into a string.
  15859. * @param {String} s The original string.
  15860. * @param {String} value The substring to insert.
  15861. * @param {Number} index The index to insert the substring. Negative indexes will insert
  15862. * from the end of the string. Example:
  15863. *
  15864. * Ext.String.insert("abcdefg", "h", -1); // abcdefhg
  15865. *
  15866. * @return {String} The value with the inserted substring
  15867. */
  15868. insert: function(s, value, index) {
  15869. var len;
  15870. if (!s) {
  15871. return value;
  15872. }
  15873. if (!value) {
  15874. return s;
  15875. }
  15876. len = s.length;
  15877. if (!index && index !== 0) {
  15878. index = len;
  15879. }
  15880. if (index < 0) {
  15881. index *= -1;
  15882. if (index >= len) {
  15883. // negative overflow, insert at start
  15884. index = 0;
  15885. } else {
  15886. index = len - index;
  15887. }
  15888. }
  15889. if (index === 0) {
  15890. s = value + s;
  15891. } else if (index >= s.length) {
  15892. s += value;
  15893. } else {
  15894. s = s.substr(0, index) + value + s.substr(index);
  15895. }
  15896. return s;
  15897. },
  15898. /**
  15899. * Checks if a string starts with a substring
  15900. * @param {String} s The original string
  15901. * @param {String} start The substring to check
  15902. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15903. */
  15904. startsWith: function(s, start, ignoreCase) {
  15905. var result = boundsCheck(s, start);
  15906. if (result) {
  15907. if (ignoreCase) {
  15908. s = s.toLowerCase();
  15909. start = start.toLowerCase();
  15910. }
  15911. result = s.lastIndexOf(start, 0) === 0;
  15912. }
  15913. return result;
  15914. },
  15915. /**
  15916. * Checks if a string ends with a substring
  15917. * @param {String} s The original string
  15918. * @param {String} end The substring to check
  15919. * @param {Boolean} [ignoreCase=false] True to ignore the case in the comparison
  15920. */
  15921. endsWith: function(s, end, ignoreCase) {
  15922. var result = boundsCheck(s, end);
  15923. if (result) {
  15924. if (ignoreCase) {
  15925. s = s.toLowerCase();
  15926. end = end.toLowerCase();
  15927. }
  15928. result = s.indexOf(end, s.length - end.length) !== -1;
  15929. }
  15930. return result;
  15931. },
  15932. /**
  15933. * Converts a string of characters into a legal, parse-able JavaScript `var` name
  15934. * as long as the passed string contains at least one alphabetic character.
  15935. * Non alphanumeric characters, and *leading* non alphabetic characters will be removed.
  15936. * @param {String} s A string to be converted into a `var` name.
  15937. * @return {String} A legal JavaScript `var` name.
  15938. */
  15939. createVarName: function(s) {
  15940. return s.replace(varReplace, '');
  15941. },
  15942. /**
  15943. * Convert certain characters (&, <, >, ', and ") to their HTML character equivalents
  15944. * for literal display in web pages.
  15945. * @param {String} value The string to encode.
  15946. * @return {String} The encoded text.
  15947. * @method
  15948. */
  15949. htmlEncode: function(value) {
  15950. return (!value) ? value : String(value).replace(charToEntityRegex, htmlEncodeReplaceFn);
  15951. },
  15952. /**
  15953. * Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.
  15954. * @param {String} value The string to decode.
  15955. * @return {String} The decoded text.
  15956. * @method
  15957. */
  15958. htmlDecode: function(value) {
  15959. return (!value) ? value : String(value).replace(entityToCharRegex, htmlDecodeReplaceFn);
  15960. },
  15961. /**
  15962. * Checks if a string has values needing to be html encoded.
  15963. * @private
  15964. * @param {String} s The string to test
  15965. * @return {Boolean} `true` if the string contains HTML characters
  15966. */
  15967. hasHtmlCharacters: function(s) {
  15968. return charToEntityRegex.test(s);
  15969. },
  15970. /**
  15971. * Adds a set of character entity definitions to the set used by
  15972. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode}.
  15973. *
  15974. * This object should be keyed by the entity name sequence,
  15975. * with the value being the textual representation of the entity.
  15976. *
  15977. * Ext.String.addCharacterEntities({
  15978. * '&amp;Uuml;':'Ü',
  15979. * '&amp;ccedil;':'ç',
  15980. * '&amp;ntilde;':'ñ',
  15981. * '&amp;egrave;':'è'
  15982. * });
  15983. * var s = Ext.String.htmlEncode("A string with entities: èÜçñ");
  15984. *
  15985. * __Note:__ the values of the character entities defined on this object are expected
  15986. * to be single character values. As such, the actual values represented by the
  15987. * characters are sensitive to the character encoding of the JavaScript source
  15988. * file when defined in string literal form. Script tags referencing server
  15989. * resources with character entities must ensure that the 'charset' attribute
  15990. * of the script node is consistent with the actual character encoding of the
  15991. * server resource.
  15992. *
  15993. * The set of character entities may be reset back to the default state by using
  15994. * the {@link Ext.String#resetCharacterEntities} method
  15995. *
  15996. * @param {Object} newEntities The set of character entities to add to the current
  15997. * definitions.
  15998. */
  15999. addCharacterEntities: function(newEntities) {
  16000. var charKeys = [],
  16001. entityKeys = [],
  16002. key, echar;
  16003. for (key in newEntities) {
  16004. echar = newEntities[key];
  16005. entityToChar[key] = echar;
  16006. charToEntity[echar] = key;
  16007. charKeys.push(echar);
  16008. entityKeys.push(key);
  16009. }
  16010. charToEntityRegex = new RegExp('(' + charKeys.join('|') + ')', 'g');
  16011. entityToCharRegex = new RegExp('(' + entityKeys.join('|') + '|&#[0-9]{1,5};' + ')', 'g');
  16012. },
  16013. /**
  16014. * Resets the set of character entity definitions used by
  16015. * {@link Ext.String#htmlEncode} and {@link Ext.String#htmlDecode} back to the
  16016. * default state.
  16017. */
  16018. resetCharacterEntities: function() {
  16019. charToEntity = {};
  16020. entityToChar = {};
  16021. // add the default set
  16022. this.addCharacterEntities({
  16023. '&amp;': '&',
  16024. '&gt;': '>',
  16025. '&lt;': '<',
  16026. '&quot;': '"',
  16027. '&#39;': "'"
  16028. });
  16029. },
  16030. /**
  16031. * Appends content to the query string of a URL, handling logic for whether to place
  16032. * a question mark or ampersand.
  16033. * @param {String} url The URL to append to.
  16034. * @param {String} string The content to append to the URL.
  16035. * @return {String} The resulting URL
  16036. */
  16037. urlAppend: function(url, string) {
  16038. if (!Ext.isEmpty(string)) {
  16039. return url + (url.indexOf('?') === -1 ? '?' : '&') + string;
  16040. }
  16041. return url;
  16042. },
  16043. /**
  16044. * Trims whitespace from either end of a string, leaving spaces within the string intact.
  16045. * Example:
  16046. *
  16047. * var s = ' foo bar ';
  16048. * alert('-' + s + '-'); //alerts "- foo bar -"
  16049. * alert('-' + Ext.String.trim(s) + '-'); //alerts "-foo bar-"
  16050. *
  16051. * @param {String} string The string to trim.
  16052. * @return {String} The trimmed string.
  16053. */
  16054. trim: function(string) {
  16055. if (string) {
  16056. string = string.replace(trimRegex, "");
  16057. }
  16058. return string || '';
  16059. },
  16060. /**
  16061. * Capitalize the first letter of the given string.
  16062. * @param {String} string
  16063. * @return {String}
  16064. */
  16065. capitalize: function(string) {
  16066. if (string) {
  16067. string = string.charAt(0).toUpperCase() + string.substr(1);
  16068. }
  16069. return string || '';
  16070. },
  16071. /**
  16072. * Uncapitalize the first letter of a given string.
  16073. * @param {String} string
  16074. * @return {String}
  16075. */
  16076. uncapitalize: function(string) {
  16077. if (string) {
  16078. string = string.charAt(0).toLowerCase() + string.substr(1);
  16079. }
  16080. return string || '';
  16081. },
  16082. /**
  16083. * Truncate a string and add an ellipsis ('...') to the end if it exceeds
  16084. * the specified length.
  16085. * @param {String} value The string to truncate.
  16086. * @param {Number} length The maximum length to allow before truncating.
  16087. * @param {Boolean} [word=false] `true` to try to find a common word break.
  16088. * @return {String} The converted text.
  16089. */
  16090. ellipsis: function(value, length, word) {
  16091. var vs, index;
  16092. if (value && value.length > length) {
  16093. if (word) {
  16094. vs = value.substr(0, length - 2);
  16095. index = Math.max(vs.lastIndexOf(' '), vs.lastIndexOf('.'), vs.lastIndexOf('!'), vs.lastIndexOf('?'));
  16096. if (index !== -1 && index >= (length - 15)) {
  16097. return vs.substr(0, index) + "...";
  16098. }
  16099. }
  16100. return value.substr(0, length - 3) + "...";
  16101. }
  16102. return value;
  16103. },
  16104. /**
  16105. * Escapes the passed string for use in a regular expression.
  16106. * @param {String} string The string to escape.
  16107. * @return {String} The escaped string.
  16108. */
  16109. escapeRegex: function(string) {
  16110. return string.replace(escapeRegexRe, "\\$1");
  16111. },
  16112. /**
  16113. * Creates a `RegExp` given a string `value` and optional flags. For example, the
  16114. * following two regular expressions are equivalent.
  16115. *
  16116. * var regex1 = Ext.String.createRegex('hello');
  16117. *
  16118. * var regex2 = /^hello$/i;
  16119. *
  16120. * The following two regular expressions are also equivalent:
  16121. *
  16122. * var regex1 = Ext.String.createRegex('world', false, false, false);
  16123. *
  16124. * var regex2 = /world/;
  16125. *
  16126. * @param {String/RegExp} value The String to convert to a `RegExp`.
  16127. * @param {Boolean} [startsWith=true] Pass `false` to allow a match to start
  16128. * anywhere in the string. By default the `value` will match only at the start
  16129. * of the string.
  16130. * @param {Boolean} [endsWith=true] Pass `false` to allow the match to end before
  16131. * the end of the string. By default the `value` will match only at the end of the
  16132. * string.
  16133. * @param {Boolean} [ignoreCase=true] Pass `false` to make the `RegExp` case
  16134. * sensitive (removes the 'i' flag).
  16135. * @since 5.0.0
  16136. * @return {RegExp}
  16137. */
  16138. createRegex: function(value, startsWith, endsWith, ignoreCase) {
  16139. var ret = value;
  16140. if (value != null && !value.exec) {
  16141. // not a regex
  16142. ret = ExtString.escapeRegex(String(value));
  16143. if (startsWith !== false) {
  16144. ret = '^' + ret;
  16145. }
  16146. if (endsWith !== false) {
  16147. ret += '$';
  16148. }
  16149. ret = new RegExp(ret, (ignoreCase !== false) ? 'i' : '');
  16150. }
  16151. return ret;
  16152. },
  16153. /**
  16154. * Escapes the passed string for ' and \.
  16155. * @param {String} string The string to escape.
  16156. * @return {String} The escaped string.
  16157. */
  16158. escape: function(string) {
  16159. return string.replace(escapeRe, "\\$1");
  16160. },
  16161. /**
  16162. * Utility function that allows you to easily switch a string between two alternating
  16163. * values. The passed value is compared to the current string, and if they are equal,
  16164. * the other value that was passed in is returned. If they are already different,
  16165. * the first value passed in is returned. Note that this method returns the new value
  16166. * but does not change the current string.
  16167. *
  16168. * // alternate sort directions
  16169. * sort = Ext.String.toggle(sort, 'ASC', 'DESC');
  16170. *
  16171. * // instead of conditional logic:
  16172. * sort = (sort === 'ASC' ? 'DESC' : 'ASC');
  16173. *
  16174. * @param {String} string The current string.
  16175. * @param {String} value The value to compare to the current string.
  16176. * @param {String} other The new value to use if the string already equals the first value
  16177. * passed in.
  16178. * @return {String} The new value.
  16179. */
  16180. toggle: function(string, value, other) {
  16181. return string === value ? other : value;
  16182. },
  16183. /**
  16184. * Pads the left side of a string with a specified character. This is especially useful
  16185. * for normalizing number and date strings. Example usage:
  16186. *
  16187. * var s = Ext.String.leftPad('123', 5, '0');
  16188. * // s now contains the string: '00123'
  16189. *
  16190. * @param {String} string The original string.
  16191. * @param {Number} size The total length of the output string.
  16192. * @param {String} [character=' '] (optional) The character with which to pad the original
  16193. * string.
  16194. * @return {String} The padded string.
  16195. */
  16196. leftPad: function(string, size, character) {
  16197. var result = String(string);
  16198. character = character || " ";
  16199. while (result.length < size) {
  16200. result = character + result;
  16201. }
  16202. return result;
  16203. },
  16204. /**
  16205. * Returns a string with a specified number of repetitions a given string pattern.
  16206. * The pattern be separated by a different string.
  16207. *
  16208. * var s = Ext.String.repeat('---', 4); // = '------------'
  16209. * var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'
  16210. *
  16211. * @param {String} pattern The pattern to repeat.
  16212. * @param {Number} count The number of times to repeat the pattern (may be 0).
  16213. * @param {String} sep An option string to separate each pattern.
  16214. */
  16215. repeat: function(pattern, count, sep) {
  16216. var buf = [],
  16217. i;
  16218. if (count < 1) {
  16219. count = 0;
  16220. }
  16221. for (i = count; i--; ) {
  16222. buf.push(pattern);
  16223. }
  16224. return buf.join(sep || '');
  16225. },
  16226. /**
  16227. * Splits a string of space separated words into an array, trimming as needed. If the
  16228. * words are already an array, it is returned.
  16229. *
  16230. * @param {String/Array} words
  16231. */
  16232. splitWords: function(words) {
  16233. if (words && typeof words === 'string') {
  16234. return words.replace(basicTrimRe, '').split(whitespaceRe);
  16235. }
  16236. return words || [];
  16237. }
  16238. };
  16239. }());
  16240. // initialize the default encode / decode entities
  16241. Ext.String.resetCharacterEntities();
  16242. /**
  16243. * @method htmlEncode
  16244. * @member Ext
  16245. * @inheritdoc Ext.String#htmlEncode
  16246. */
  16247. Ext.htmlEncode = Ext.String.htmlEncode;
  16248. /**
  16249. * @method htmlDecode
  16250. * @member Ext
  16251. * @inheritdoc Ext.String#htmlDecode
  16252. */
  16253. Ext.htmlDecode = Ext.String.htmlDecode;
  16254. /**
  16255. * @method urlAppend
  16256. * @member Ext
  16257. * @inheritdoc Ext.String#urlAppend
  16258. */
  16259. Ext.urlAppend = Ext.String.urlAppend;
  16260. /* eslint-disable max-len */
  16261. /**
  16262. * @class Ext.Date
  16263. * This class defines some basic methods for handling dates.
  16264. *
  16265. * The date parsing and formatting syntax contains a subset of
  16266. * [PHP's `date()` function](http://www.php.net/date), and the formats that are
  16267. * supported will provide results equivalent to their PHP versions.
  16268. *
  16269. * The following is a list of all currently supported formats:
  16270. *
  16271. * Format Description Example returned values
  16272. * ------ ----------------------------------------------------------------------- -----------------------
  16273. * d Day of the month, 2 digits with leading zeros 01 to 31
  16274. * D A short textual representation of the day of the week Mon to Sun
  16275. * j Day of the month without leading zeros 1 to 31
  16276. * l A full textual representation of the day of the week Sunday to Saturday
  16277. * N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
  16278. * S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
  16279. * w Numeric representation of the day of the week 0 (for Sunday) to 6 (for Saturday)
  16280. * z The day of the year (starting from 0) 0 to 364 (365 in leap years)
  16281. * W ISO-8601 week number of year, weeks starting on Monday 01 to 53
  16282. * F A full textual representation of a month, such as January or March January to December
  16283. * m Numeric representation of a month, with leading zeros 01 to 12
  16284. * M A short textual representation of a month Jan to Dec
  16285. * n Numeric representation of a month, without leading zeros 1 to 12
  16286. * t Number of days in the given month 28 to 31
  16287. * L Whether it&#39;s a leap year 1 if it is a leap year, 0 otherwise.
  16288. * o ISO-8601 year number (identical to (Y), but if the ISO week number (W) Examples: 1998 or 2004
  16289. * belongs to the previous or next year, that year is used instead)
  16290. * Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
  16291. * y A two digit representation of a year Examples: 99 or 03
  16292. * a Lowercase Ante meridiem and Post meridiem am or pm
  16293. * A Uppercase Ante meridiem and Post meridiem AM or PM
  16294. * g 12-hour format of an hour without leading zeros 1 to 12
  16295. * G 24-hour format of an hour without leading zeros 0 to 23
  16296. * h 12-hour format of an hour with leading zeros 01 to 12
  16297. * H 24-hour format of an hour with leading zeros 00 to 23
  16298. * i Minutes, with leading zeros 00 to 59
  16299. * s Seconds, with leading zeros 00 to 59
  16300. * u Decimal fraction of a second Examples:
  16301. * (minimum 1 digit, arbitrary number of digits allowed) 001 (i.e. 0.001s) or
  16302. * 100 (i.e. 0.100s) or
  16303. * 999 (i.e. 0.999s) or
  16304. * 999876543210 (i.e. 0.999876543210s)
  16305. * O Difference to Greenwich time (GMT) in hours and minutes Example: +1030
  16306. * P Difference to Greenwich time (GMT) with colon between hours and minutes Example: -08:00
  16307. * T Timezone abbreviation of the machine running the code Examples: EST, MDT, PDT ...
  16308. * Z Timezone offset in seconds (negative if west of UTC, positive if east) -43200 to 50400
  16309. * c ISO 8601 date represented as the local time with an offset to UTC appended.
  16310. * Notes: Examples:
  16311. * 1) If unspecified, the month / day defaults to the current month / day, 1991 or
  16312. * the time defaults to midnight, while the timezone defaults to the 1992-10 or
  16313. * browser's timezone. If a time is specified, it must include both hours 1993-09-20 or
  16314. * and minutes. The "T" delimiter, seconds, milliseconds and timezone 1994-08-19T16:20+01:00 or
  16315. * are optional. 1995-07-18T17:21:28-02:00 or
  16316. * 2) The decimal fraction of a second, if specified, must contain at 1996-06-17T18:22:29.98765+03:00 or
  16317. * least 1 digit (there is no limit to the maximum number 1997-05-16T19:23:30,12345-0400 or
  16318. * of digits allowed), and may be delimited by either a '.' or a ',' 1998-04-15T20:24:31.2468Z or
  16319. * Refer to the examples on the right for the various levels of 1999-03-14T20:24:32Z or
  16320. * date-time granularity which are supported, or see 2000-02-13T21:25:33
  16321. * http://www.w3.org/TR/NOTE-datetime for more info. 2001-01-12 22:26:34
  16322. * C An ISO date string as implemented by the native Date object's 1962-06-17T09:21:34.125Z
  16323. * [Date.toISOString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
  16324. * method. This outputs the numeric part with *UTC* hour and minute
  16325. * values, and indicates this by appending the `'Z'` timezone
  16326. * identifier.
  16327. * U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1193432466 or -2138434463
  16328. * MS Microsoft AJAX serialized dates \/Date(1238606590509)\/ (i.e. UTC milliseconds since epoch) or
  16329. * \/Date(1238606590509+0800)\/
  16330. * time A javascript millisecond timestamp 1350024476440
  16331. * timestamp A UNIX timestamp (same as U) 1350024866
  16332. *
  16333. * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
  16334. *
  16335. * // Sample date:
  16336. * // 'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
  16337. *
  16338. * var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
  16339. * console.log(Ext.Date.format(dt, 'Y-m-d')); // 2007-01-10
  16340. * console.log(Ext.Date.format(dt, 'F j, Y, g:i a')); // January 10, 2007, 3:05 pm
  16341. * 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
  16342. *
  16343. * Here are some standard date/time patterns that you might find helpful. They
  16344. * are not part of the source of Ext.Date, but to use them you can simply copy this
  16345. * block of code into any script that is included after Ext.Date and they will also become
  16346. * globally available on the Date object. Feel free to add or remove patterns as needed in your code.
  16347. *
  16348. * Ext.Date.patterns = {
  16349. * ISO8601Long:"Y-m-d H:i:s",
  16350. * ISO8601Short:"Y-m-d",
  16351. * ShortDate: "n/j/Y",
  16352. * LongDate: "l, F d, Y",
  16353. * FullDateTime: "l, F d, Y g:i:s A",
  16354. * MonthDay: "F d",
  16355. * ShortTime: "g:i A",
  16356. * LongTime: "g:i:s A",
  16357. * SortableDateTime: "Y-m-d\\TH:i:s",
  16358. * UniversalSortableDateTime: "Y-m-d H:i:sO",
  16359. * YearMonth: "F, Y"
  16360. * };
  16361. *
  16362. * Example usage:
  16363. *
  16364. * var dt = new Date();
  16365. * console.log(Ext.Date.format(dt, Ext.Date.patterns.ShortDate));
  16366. *
  16367. * Developer-written, custom formats may be used by supplying both a formatting and a parsing function
  16368. * which perform to specialized requirements. The functions are stored in {@link #parseFunctions} and {@link #formatFunctions}.
  16369. * @singleton
  16370. */
  16371. Ext.Date = (function() {
  16372. /* eslint-disable indent */
  16373. // @define Ext.lang.Date
  16374. // @define Ext.Date
  16375. // @require Ext
  16376. // @require Ext.lang.String
  16377. var utilDate,
  16378. nativeDate = Date,
  16379. stripEscapeRe = /(\\.)/g,
  16380. hourInfoRe = /([gGhHisucUOPZ]|MS)/,
  16381. dateInfoRe = /([djzmnYycU]|MS)/,
  16382. slashRe = /\\/gi,
  16383. numberTokenRe = /\{(\d+)\}/g,
  16384. MSFormatRe = new RegExp('\\/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\/'),
  16385. datePartsRe = /^(?:(\d{1,4})|(\w{3,}))[/\-.\\\s](?:(\d{1,2})|(\w{3,}))[/\-.\\\s](\d{1,4})$/,
  16386. pad = Ext.String.leftPad,
  16387. dayInfo = {
  16388. d: true,
  16389. j: true
  16390. },
  16391. monthInfo = {
  16392. F: true,
  16393. m: true,
  16394. M: true,
  16395. n: true
  16396. },
  16397. yearInfo = {
  16398. o: true,
  16399. Y: true,
  16400. y: true
  16401. },
  16402. // Most of the date-formatting functions below are the excellent work of Baron Schwartz.
  16403. // (see http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/)
  16404. // They generate precompiled functions from format patterns instead of parsing and
  16405. // processing each pattern every time a date is formatted.
  16406. code = [
  16407. // date calculations (note: the code below creates a dependency on Ext.Number.from())
  16408. "var me = this, dt, y, m, d, h, i, s, ms, o, O, z, zz, u, v, W, year, jan4, week1monday, daysInMonth, dayMatched,",
  16409. "def = me.defaults,",
  16410. "from = Ext.Number.from,",
  16411. "results = String(input).match(me.parseRegexes[{0}]);",
  16412. // either null, or an array of matched strings
  16413. "if(results){",
  16414. "{1}",
  16415. "if(u != null){",
  16416. // i.e. unix time is defined
  16417. "v = new Date(u * 1000);",
  16418. // give top priority to UNIX time
  16419. "}else{",
  16420. // create Date object representing midnight of the current day;
  16421. // this will provide us with our date defaults
  16422. // (note: clearTime() handles Daylight Saving Time automatically)
  16423. "dt = me.clearTime(new Date);",
  16424. "y = from(y, from(def.y, dt.getFullYear()));",
  16425. "m = from(m, from(def.m - 1, dt.getMonth()));",
  16426. "dayMatched = d !== undefined;",
  16427. "d = from(d, from(def.d, dt.getDate()));",
  16428. // Attempt to validate the day. Since it defaults to today, it may go out
  16429. // of range, for example parsing m/Y where the value is 02/2000 on the 31st of May.
  16430. // It will attempt to parse 2000/02/31, which will overflow to March and end up
  16431. // returning 03/2000. We only do this when we default the day. If an invalid day value
  16432. // was set to be parsed by the user, continue on and either let it overflow or return null
  16433. // depending on the strict value. This will be in line with the normal Date behaviour.
  16434. "if (!dayMatched) {",
  16435. "dt.setDate(1);",
  16436. "dt.setMonth(m);",
  16437. "dt.setFullYear(y);",
  16438. "daysInMonth = me.getDaysInMonth(dt);",
  16439. "if (d > daysInMonth) {",
  16440. "d = daysInMonth;",
  16441. "}",
  16442. "}",
  16443. "h = from(h, from(def.h, dt.getHours()));",
  16444. "i = from(i, from(def.i, dt.getMinutes()));",
  16445. "s = from(s, from(def.s, dt.getSeconds()));",
  16446. "ms = from(ms, from(def.ms, dt.getMilliseconds()));",
  16447. "if(z >= 0 && y >= 0){",
  16448. // both the year and zero-based day of year are defined and >= 0.
  16449. // these 2 values alone provide sufficient info to create a full date object
  16450. // create Date object representing January 1st for the given year
  16451. // handle years < 100 appropriately
  16452. "v = me.add(new Date(y < 100 ? 100 : y, 0, 1, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16453. // then add day of year, checking for Date "rollover" if necessary
  16454. "v = !strict? v : (strict === true && (z <= 364 || (me.isLeapYear(v) && z <= 365))? me.add(v, me.DAY, z) : null);",
  16455. "}else if(strict === true && !me.isValid(y, m + 1, d, h, i, s, ms)){",
  16456. // check for Date "rollover"
  16457. "v = null;",
  16458. // invalid date, so return null
  16459. "}else{",
  16460. "if (W) {",
  16461. // support ISO-8601
  16462. // http://en.wikipedia.org/wiki/ISO_week_date
  16463. //
  16464. // Mutually equivalent definitions for week 01 are:
  16465. // a. the week starting with the Monday which is nearest in time to 1 January
  16466. // b. the week with 4 January in it
  16467. // ... there are many others ...
  16468. //
  16469. // We'll use letter b above to determine the first week of the year.
  16470. //
  16471. // So, first get a Date object for January 4th of whatever calendar year is desired.
  16472. //
  16473. // Then, the first Monday of the year can easily be determined by (operating on this Date):
  16474. // 1. Getting the day of the week.
  16475. // 2. Subtracting that by one.
  16476. // 3. Multiplying that by 86400000 (one day in ms).
  16477. // 4. Subtracting this number of days (in ms) from the January 4 date (represented in ms).
  16478. //
  16479. // Example #1 ...
  16480. //
  16481. // January 2012
  16482. // Su Mo Tu We Th Fr Sa
  16483. // 1 2 3 4 5 6 7
  16484. // 8 9 10 11 12 13 14
  16485. // 15 16 17 18 19 20 21
  16486. // 22 23 24 25 26 27 28
  16487. // 29 30 31
  16488. //
  16489. // 1. January 4th is a Wednesday.
  16490. // 2. Its day number is 3.
  16491. // 3. Simply substract 2 days from Wednesday.
  16492. // 4. The first week of the year begins on Monday, January 2. Simple!
  16493. //
  16494. // Example #2 ...
  16495. // January 1992
  16496. // Su Mo Tu We Th Fr Sa
  16497. // 1 2 3 4
  16498. // 5 6 7 8 9 10 11
  16499. // 12 13 14 15 16 17 18
  16500. // 19 20 21 22 23 24 25
  16501. // 26 27 28 29 30 31
  16502. //
  16503. // 1. January 4th is a Saturday.
  16504. // 2. Its day number is 6.
  16505. // 3. Simply subtract 5 days from Saturday.
  16506. // 4. The first week of the year begins on Monday, December 30. Simple!
  16507. //
  16508. // v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));
  16509. // (This is essentially doing the same thing as above but for the week rather than the day)
  16510. "year = y || (new Date()).getFullYear();",
  16511. "jan4 = new Date(year, 0, 4, 0, 0, 0);",
  16512. "d = jan4.getDay();",
  16513. // If the 1st is a Thursday, then the 4th will be a Sunday, so we need the appropriate
  16514. // day number here, which is why we use the day === checks.
  16515. "week1monday = new Date(jan4.getTime() - ((d === 0 ? 6 : d - 1) * 86400000));",
  16516. // The reason for adding 43200000 (12 hours) is to avoid any complication with daylight saving
  16517. // switch overs. For example, if the clock is rolled back, an hour will repeat, so adding 7 days
  16518. // will leave us 1 hour short (Sun <date> 23:00:00). By setting is to 12:00, subtraction
  16519. // or addition of an hour won't make any difference.
  16520. "v = Ext.Date.clearTime(new Date(week1monday.getTime() + ((W - 1) * 604800000 + 43200000)));",
  16521. "} else {",
  16522. // plain old Date object
  16523. // handle years < 100 properly
  16524. "v = me.add(new Date(y < 100 ? 100 : y, m, d, h, i, s, ms), me.YEAR, y < 100 ? y - 100 : 0);",
  16525. "}",
  16526. "}",
  16527. "}",
  16528. "}",
  16529. "if(v){",
  16530. // favor UTC offset over GMT offset
  16531. "if(zz != null){",
  16532. // reset to UTC, then add offset
  16533. "v = me.add(v, me.SECOND, -v.getTimezoneOffset() * 60 - zz);",
  16534. "}else if(o){",
  16535. // reset to GMT, then add offset
  16536. "v = me.add(v, me.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn));",
  16537. "}",
  16538. "}",
  16539. "return (v != null) ? v : null;"
  16540. ].join('\n');
  16541. // Polyfill Date's toISOString instance method where not implemented.
  16542. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
  16543. // TODO: Remove this when IE8 retires.
  16544. if (!Date.prototype.toISOString) {
  16545. Date.prototype.toISOString = function() {
  16546. var me = this;
  16547. 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';
  16548. };
  16549. }
  16550. /**
  16551. * @method xf
  16552. * @private
  16553. * @param format
  16554. * Create private copy of Ext JS's `Ext.util.Format.format()` method
  16555. * + to remove unnecessary dependency
  16556. * + to resolve namespace conflict with MS-Ajax's implementation
  16557. */
  16558. function xf(format) {
  16559. var args = Array.prototype.slice.call(arguments, 1);
  16560. return format.replace(numberTokenRe, function(m, i) {
  16561. return args[i];
  16562. });
  16563. }
  16564. /* eslint-enable indent, max-len */
  16565. utilDate = {
  16566. /** @ignore */
  16567. now: nativeDate.now,
  16568. // always available due to polyfill in Ext.js
  16569. /**
  16570. * @private
  16571. */
  16572. toString: function(date) {
  16573. if (!date) {
  16574. date = new nativeDate();
  16575. }
  16576. 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');
  16577. },
  16578. /**
  16579. * Returns the number of milliseconds between two dates.
  16580. * @param {Date} dateA The first date.
  16581. * @param {Date} [dateB=new Date()] (optional) The second date.
  16582. * @return {Number} The difference in milliseconds
  16583. */
  16584. getElapsed: function(dateA, dateB) {
  16585. return Math.abs(dateA - (dateB || utilDate.now()));
  16586. },
  16587. /**
  16588. * Global flag which determines if strict date parsing should be used.
  16589. * Strict date parsing will not roll-over invalid dates, which is the
  16590. * default behavior of JavaScript Date objects.
  16591. * (see {@link #parse} for more information)
  16592. * @type Boolean
  16593. */
  16594. useStrict: false,
  16595. /**
  16596. * @private
  16597. */
  16598. formatCodeToRegex: function(character, currentGroup) {
  16599. // Note: currentGroup - position in regex result array (see notes for
  16600. // Ext.Date.parseCodes below)
  16601. var p = utilDate.parseCodes[character];
  16602. if (p) {
  16603. p = typeof p === 'function' ? p() : p;
  16604. // reassign function result to prevent repeated execution
  16605. utilDate.parseCodes[character] = p;
  16606. }
  16607. return p ? Ext.applyIf({
  16608. c: p.c ? xf(p.c, currentGroup || "{0}") : p.c
  16609. }, p) : {
  16610. g: 0,
  16611. c: null,
  16612. s: Ext.String.escapeRegex(character)
  16613. };
  16614. },
  16615. // treat unrecognized characters as literals
  16616. /**
  16617. * An object hash in which each property is a date parsing function. The property name is the
  16618. * format string which that function parses.
  16619. *
  16620. * This object is automatically populated with date parsing functions as
  16621. * date formats are requested for Ext standard formatting strings.
  16622. *
  16623. * Custom parsing functions may be inserted into this object, keyed by a name which from then on
  16624. * may be used as a format string to {@link #parse}.
  16625. *
  16626. * Example:
  16627. *
  16628. * Ext.Date.parseFunctions['x-date-format'] = myDateParser;
  16629. *
  16630. * A parsing function should return a Date object, and is passed the following parameters:
  16631. *
  16632. * - `date`: {@link String} - The date string to parse.
  16633. * - `strict`: {@link Boolean} - `true` to validate date strings while parsing
  16634. * (i.e. prevent JavaScript Date "rollover"). __The default must be `false`.__
  16635. * Invalid date strings should return `null` when parsed.
  16636. *
  16637. * To enable Dates to also be _formatted_ according to that format, a corresponding
  16638. * formatting function must be placed into the {@link #formatFunctions} property.
  16639. * @property parseFunctions
  16640. * @type Object
  16641. */
  16642. parseFunctions: {
  16643. "MS": function(input, strict) {
  16644. // note: the timezone offset is ignored since the MS Ajax server sends
  16645. // a UTC milliseconds-since-Unix-epoch value (negative values are allowed)
  16646. var r = (input || '').match(MSFormatRe);
  16647. return r ? new nativeDate(((r[1] || '') + r[2]) * 1) : null;
  16648. },
  16649. "time": function(input, strict) {
  16650. var num = parseInt(input, 10);
  16651. if (num || num === 0) {
  16652. return new nativeDate(num);
  16653. }
  16654. return null;
  16655. },
  16656. "timestamp": function(input, strict) {
  16657. var num = parseInt(input, 10);
  16658. if (num || num === 0) {
  16659. return new nativeDate(num * 1000);
  16660. }
  16661. return null;
  16662. }
  16663. },
  16664. parseRegexes: [],
  16665. /**
  16666. * An object hash in which each property is a date formatting function. The property name is the
  16667. * format string which corresponds to the produced formatted date string.
  16668. *
  16669. * This object is automatically populated with date formatting functions as
  16670. * date formats are requested for Ext standard formatting strings.
  16671. *
  16672. * Custom formatting functions may be inserted into this object, keyed by a name which
  16673. * from then on may be used as a format string to {@link #format}.
  16674. *
  16675. * Example:
  16676. *
  16677. * Ext.Date.formatFunctions['x-date-format'] = myDateFormatter;
  16678. *
  16679. * A formatting function should return a string representation of the Date object which
  16680. * is the scope (this) of the function.
  16681. *
  16682. * To enable date strings to also be _parsed_ according to that format, a corresponding
  16683. * parsing function must be placed into the {@link #parseFunctions} property.
  16684. * @property formatFunctions
  16685. * @type Object
  16686. */
  16687. formatFunctions: {
  16688. "MS": function() {
  16689. // UTC milliseconds since Unix epoch (MS-AJAX serialized date format (MRSF))
  16690. return '\\/Date(' + this.getTime() + ')\\/';
  16691. },
  16692. "time": function() {
  16693. return this.getTime().toString();
  16694. },
  16695. "timestamp": function() {
  16696. return utilDate.format(this, 'U');
  16697. }
  16698. },
  16699. y2kYear: 50,
  16700. /**
  16701. * Date interval constant.
  16702. * @type String
  16703. */
  16704. MILLI: "ms",
  16705. /**
  16706. * Date interval constant.
  16707. * @type String
  16708. */
  16709. SECOND: "s",
  16710. /**
  16711. * Date interval constant.
  16712. * @type String
  16713. */
  16714. MINUTE: "mi",
  16715. /**
  16716. * Date interval constant.
  16717. * @type String
  16718. */
  16719. HOUR: "h",
  16720. /**
  16721. * Date interval constant.
  16722. * @type String
  16723. */
  16724. DAY: "d",
  16725. /**
  16726. * Date interval constant.
  16727. * @type String
  16728. */
  16729. MONTH: "mo",
  16730. /**
  16731. * Date interval constant.
  16732. * @type String
  16733. */
  16734. YEAR: "y",
  16735. /**
  16736. * The number of days in a week.
  16737. * @type Number
  16738. */
  16739. DAYS_IN_WEEK: 7,
  16740. /**
  16741. * The number of months in a year.
  16742. * @type Number
  16743. */
  16744. MONTHS_IN_YEAR: 12,
  16745. /**
  16746. * The maximum number of days in a month.
  16747. * @type {Number}
  16748. */
  16749. MAX_DAYS_IN_MONTH: 31,
  16750. SUNDAY: 0,
  16751. MONDAY: 1,
  16752. TUESDAY: 2,
  16753. WEDNESDAY: 3,
  16754. THURSDAY: 4,
  16755. FRIDAY: 5,
  16756. SATURDAY: 6,
  16757. /**
  16758. * An object hash containing default date values used during date parsing.
  16759. *
  16760. * The following properties are available:
  16761. *
  16762. * - `y`: {@link Number} - The default year value. Defaults to `undefined`.
  16763. * - `m`: {@link Number} - The default 1-based month value. Defaults to `undefined`.
  16764. * - `d`: {@link Number} - The default day value. Defaults to `undefined`.
  16765. * - `h`: {@link Number} - The default hour value. Defaults to `undefined`.
  16766. * - `i`: {@link Number} - The default minute value. Defaults to `undefined`.
  16767. * - `s`: {@link Number} - The default second value. Defaults to `undefined`.
  16768. * - `ms`: {@link Number} - The default millisecond value. Defaults to `undefined`.
  16769. *
  16770. * Override these properties to customize the default date values used by the {@link #parse}
  16771. * method.
  16772. *
  16773. * __Note:__ In countries which experience Daylight Saving Time (i.e. DST), the `h`, `i`, `s`
  16774. * and `ms` properties may coincide with the exact time in which DST takes effect.
  16775. * It is the responsibility of the developer to account for this.
  16776. *
  16777. * Example Usage:
  16778. *
  16779. * // set default day value to the first day of the month
  16780. * Ext.Date.defaults.d = 1;
  16781. *
  16782. * // parse a February date string containing only year and month values.
  16783. * // setting the default day value to 1 prevents weird date rollover issues
  16784. * // when attempting to parse the following date string on, for example, March 31st 2009
  16785. * Ext.Date.parse('2009-02', 'Y-m'); // returns a Date object representing February 1st 2009
  16786. *
  16787. * @property defaults
  16788. * @type Object
  16789. */
  16790. defaults: {},
  16791. /**
  16792. * @property {String[]} dayNames
  16793. * An array of textual day names.
  16794. * Override these values for international dates.
  16795. *
  16796. * Example:
  16797. *
  16798. * Ext.Date.dayNames = [
  16799. * 'SundayInYourLang',
  16800. * 'MondayInYourLang'
  16801. * // ...
  16802. * ];
  16803. * @locale
  16804. */
  16805. dayNames: [
  16806. "Sunday",
  16807. "Monday",
  16808. "Tuesday",
  16809. "Wednesday",
  16810. "Thursday",
  16811. "Friday",
  16812. "Saturday"
  16813. ],
  16814. /**
  16815. * @property {String[]} monthNames
  16816. * An array of textual month names.
  16817. * Override these values for international dates.
  16818. *
  16819. * Example:
  16820. *
  16821. * Ext.Date.monthNames = [
  16822. * 'JanInYourLang',
  16823. * 'FebInYourLang'
  16824. * // ...
  16825. * ];
  16826. * @locale
  16827. */
  16828. monthNames: [
  16829. "January",
  16830. "February",
  16831. "March",
  16832. "April",
  16833. "May",
  16834. "June",
  16835. "July",
  16836. "August",
  16837. "September",
  16838. "October",
  16839. "November",
  16840. "December"
  16841. ],
  16842. /**
  16843. * @property {Object} monthNumbers
  16844. * An object hash of zero-based JavaScript month numbers (with short month names as keys).
  16845. *
  16846. * __Note:__ keys are case-sensitive.
  16847. *
  16848. * Override these values for international dates.
  16849. *
  16850. * Example:
  16851. *
  16852. * Ext.Date.monthNumbers = {
  16853. * 'LongJanNameInYourLang': 0,
  16854. * 'ShortJanNameInYourLang':0,
  16855. * 'LongFebNameInYourLang':1,
  16856. * 'ShortFebNameInYourLang':1
  16857. * // ...
  16858. * };
  16859. * @locale
  16860. */
  16861. monthNumbers: {
  16862. January: 0,
  16863. Jan: 0,
  16864. February: 1,
  16865. Feb: 1,
  16866. March: 2,
  16867. Mar: 2,
  16868. April: 3,
  16869. Apr: 3,
  16870. May: 4,
  16871. June: 5,
  16872. Jun: 5,
  16873. July: 6,
  16874. Jul: 6,
  16875. August: 7,
  16876. Aug: 7,
  16877. September: 8,
  16878. Sep: 8,
  16879. October: 9,
  16880. Oct: 9,
  16881. November: 10,
  16882. Nov: 10,
  16883. December: 11,
  16884. Dec: 11
  16885. },
  16886. /**
  16887. * @property {String} defaultFormat
  16888. * The date format string that the {@link Ext.util.Format#dateRenderer}
  16889. * and {@link Ext.util.Format#date} functions use. See {@link Ext.Date} for details.
  16890. *
  16891. * This is the format that {@link #method!flexParse} uses to disambiguate all-numeric
  16892. * input dates.
  16893. *
  16894. * This may be overridden in a locale file.
  16895. * @locale
  16896. */
  16897. defaultFormat: 'm/d/Y',
  16898. /**
  16899. * @property {String} defaultTimeFormat
  16900. * The default time format.
  16901. *
  16902. * This may be overridden in a locale file.
  16903. * @locale
  16904. */
  16905. defaultTimeFormat: 'h:i A',
  16906. /**
  16907. * @property {Number} firstDayOfWeek
  16908. * The day on which the week starts. `0` being Sunday, through `6` being Saturday.
  16909. *
  16910. * This may be overridden in a locale file.
  16911. * @locale
  16912. */
  16913. firstDayOfWeek: 0,
  16914. /**
  16915. * @property {Number[]} weekendDays
  16916. * The days on which weekend falls. `0` being Sunday, through `6` being Saturday.
  16917. *
  16918. * This may be overridden in a locale file.
  16919. * @locale
  16920. */
  16921. weekendDays: [
  16922. 0,
  16923. 6
  16924. ],
  16925. /**
  16926. * Get the short month name for the given month number.
  16927. * Override this function for international dates.
  16928. * @param {Number} month A zero-based JavaScript month number.
  16929. * @return {String} The short month name.
  16930. * @locale
  16931. */
  16932. getShortMonthName: function(month) {
  16933. return utilDate.monthNames[month].substring(0, 3);
  16934. },
  16935. /**
  16936. * Get the short day name for the given day number.
  16937. * Override this function for international dates.
  16938. * @param {Number} day A zero-based JavaScript day number.
  16939. * @return {String} The short day name.
  16940. * @locale
  16941. */
  16942. getShortDayName: function(day) {
  16943. return utilDate.dayNames[day].substring(0, 3);
  16944. },
  16945. /**
  16946. * Get the zero-based JavaScript month number for the given short/full month name.
  16947. * Override this function for international dates.
  16948. * @param {String} name The short/full month name.
  16949. * @return {Number} The zero-based JavaScript month number.
  16950. * @locale
  16951. */
  16952. getMonthNumber: function(name) {
  16953. // handle camel casing for English month names (since the keys for
  16954. // the Ext.Date.monthNumbers hash are case sensitive)
  16955. return utilDate.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
  16956. },
  16957. /**
  16958. * Checks if the specified format contains hour information
  16959. * @param {String} format The format to check
  16960. * @return {Boolean} True if the format contains hour information
  16961. * @method
  16962. */
  16963. formatContainsHourInfo: function(format) {
  16964. return hourInfoRe.test(format.replace(stripEscapeRe, ''));
  16965. },
  16966. /**
  16967. * Checks if the specified format contains information about
  16968. * anything other than the time.
  16969. * @param {String} format The format to check
  16970. * @return {Boolean} True if the format contains information about
  16971. * date/day information.
  16972. * @method
  16973. */
  16974. formatContainsDateInfo: function(format) {
  16975. return dateInfoRe.test(format.replace(stripEscapeRe, ''));
  16976. },
  16977. /**
  16978. * @private
  16979. * Checks if the specified format contains only month information.
  16980. *
  16981. * @param {String} format Format to check
  16982. *
  16983. * @return {Boolean}
  16984. */
  16985. isMonthFormat: function(format) {
  16986. return !!monthInfo[format];
  16987. },
  16988. /**
  16989. * @private
  16990. * Checks if the specified format contains only year information.
  16991. *
  16992. * @param {String} format Format to check.
  16993. *
  16994. * @return {Boolean}
  16995. */
  16996. isYearFormat: function(format) {
  16997. return !!yearInfo[format];
  16998. },
  16999. /**
  17000. * Removes all escaping for a date format string. In date formats,
  17001. * using a '\' can be used to escape special characters.
  17002. * @param {String} format The format to unescape
  17003. * @return {String} The unescaped format
  17004. * @method
  17005. */
  17006. unescapeFormat: function(format) {
  17007. // Escape the format, since \ can be used to escape special
  17008. // characters in a date format. For example, in a Spanish
  17009. // locale the format may be: 'd \\de F \\de Y'
  17010. return format.replace(slashRe, '');
  17011. },
  17012. /**
  17013. * The base format-code to formatting-function hashmap used by the {@link #format} method.
  17014. * Formatting functions are strings (or functions which return strings) which
  17015. * will return the appropriate value when evaluated in the context of the Date object
  17016. * from which the {@link #format} method is called.
  17017. * Add to / override these mappings for custom date formatting.
  17018. *
  17019. * __Note:__ `Ext.Date.format()` treats characters as literals if an appropriate mapping
  17020. * cannot be found.
  17021. *
  17022. * Example:
  17023. *
  17024. * Ext.Date.formatCodes.x = "Ext.util.Format.leftPad(this.getDate(), 2, '0')";
  17025. * console.log(Ext.Date.format(new Date(), 'X'); // returns the current day of the month
  17026. * @type Object
  17027. */
  17028. formatCodes: {
  17029. /* eslint-disable max-len */
  17030. d: "Ext.String.leftPad(m.getDate(), 2, '0')",
  17031. D: "Ext.Date.getShortDayName(m.getDay())",
  17032. // get localized short day name
  17033. j: "m.getDate()",
  17034. l: "Ext.Date.dayNames[m.getDay()]",
  17035. N: "(m.getDay() ? m.getDay() : 7)",
  17036. S: "Ext.Date.getSuffix(m)",
  17037. w: "m.getDay()",
  17038. z: "Ext.Date.getDayOfYear(m)",
  17039. W: "Ext.String.leftPad(Ext.Date.getWeekOfYear(m), 2, '0')",
  17040. F: "Ext.Date.monthNames[m.getMonth()]",
  17041. m: "Ext.String.leftPad(m.getMonth() + 1, 2, '0')",
  17042. M: "Ext.Date.getShortMonthName(m.getMonth())",
  17043. // get localized short month name
  17044. n: "(m.getMonth() + 1)",
  17045. t: "Ext.Date.getDaysInMonth(m)",
  17046. L: "(Ext.Date.isLeapYear(m) ? 1 : 0)",
  17047. o: "(m.getFullYear() + (Ext.Date.getWeekOfYear(m) == 1 && m.getMonth() > 0 ? +1 : (Ext.Date.getWeekOfYear(m) >= 52 && m.getMonth() < 11 ? -1 : 0)))",
  17048. Y: "Ext.String.leftPad(m.getFullYear(), 4, '0')",
  17049. y: "('' + m.getFullYear()).substring(2, 4)",
  17050. a: "(m.getHours() < 12 ? 'am' : 'pm')",
  17051. A: "(m.getHours() < 12 ? 'AM' : 'PM')",
  17052. g: "((m.getHours() % 12) ? m.getHours() % 12 : 12)",
  17053. G: "m.getHours()",
  17054. h: "Ext.String.leftPad((m.getHours() % 12) ? m.getHours() % 12 : 12, 2, '0')",
  17055. H: "Ext.String.leftPad(m.getHours(), 2, '0')",
  17056. i: "Ext.String.leftPad(m.getMinutes(), 2, '0')",
  17057. s: "Ext.String.leftPad(m.getSeconds(), 2, '0')",
  17058. u: "Ext.String.leftPad(m.getMilliseconds(), 3, '0')",
  17059. O: "Ext.Date.getGMTOffset(m)",
  17060. P: "Ext.Date.getGMTOffset(m, true)",
  17061. T: "Ext.Date.getTimezone(m)",
  17062. Z: "(m.getTimezoneOffset() * -60)",
  17063. /* eslint-enable max-len */
  17064. c: function() {
  17065. // ISO-8601 -- GMT format
  17066. var c = "Y-m-dTH:i:sP",
  17067. code = [],
  17068. l = c.length,
  17069. i, e;
  17070. for (i = 0; i < l; ++i) {
  17071. e = c.charAt(i);
  17072. // treat T as a character literal
  17073. code.push(e === "T" ? "'T'" : utilDate.getFormatCode(e));
  17074. }
  17075. return code.join(" + ");
  17076. },
  17077. C: function() {
  17078. // ISO-1601 -- browser format. UTC numerics with the 'Z' TZ id.
  17079. return 'm.toISOString()';
  17080. },
  17081. U: "Math.round(m.getTime() / 1000)"
  17082. },
  17083. /**
  17084. * Checks if the passed Date parameters will cause a JavaScript Date "rollover".
  17085. * @param {Number} year 4-digit year.
  17086. * @param {Number} month 1-based month-of-year.
  17087. * @param {Number} day Day of month.
  17088. * @param {Number} hour (optional) Hour.
  17089. * @param {Number} minute (optional) Minute.
  17090. * @param {Number} second (optional) Second.
  17091. * @param {Number} millisecond (optional) Millisecond.
  17092. * @return {Boolean} `true` if the passed parameters do not cause a Date "rollover",
  17093. * `false` otherwise.
  17094. */
  17095. isValid: function(year, month, day, hour, minute, second, millisecond) {
  17096. var dt;
  17097. // setup defaults
  17098. hour = hour || 0;
  17099. minute = minute || 0;
  17100. second = second || 0;
  17101. millisecond = millisecond || 0;
  17102. // Special handling for year < 100
  17103. /* eslint-disable-next-line max-len */
  17104. dt = utilDate.add(new nativeDate(year < 100 ? 100 : year, month - 1, day, hour, minute, second, millisecond), utilDate.YEAR, year < 100 ? year - 100 : 0);
  17105. return year === dt.getFullYear() && month === dt.getMonth() + 1 && day === dt.getDate() && hour === dt.getHours() && minute === dt.getMinutes() && second === dt.getSeconds() && millisecond === dt.getMilliseconds();
  17106. },
  17107. /**
  17108. * Parses the passed string using the specified date format.
  17109. * Note that this function expects normal calendar dates, meaning that months are 1-based
  17110. * (i.e. 1 = January). The {@link #defaults} hash will be used for any date value (i.e. year,
  17111. * month, day, hour, minute, second or millisecond) which cannot be found in the passed string.
  17112. * If a corresponding default date value has not been specified in the {@link #defaults} hash,
  17113. * the current date's year, month, day or DST-adjusted zero-hour time value will be used
  17114. * instead. Keep in mind that the input date string must precisely match the specified format
  17115. * string in order for the parse operation to be successful (failed parse operations return a
  17116. * `null` value).
  17117. *
  17118. * Example:
  17119. *
  17120. * //dt = Fri May 25 2007 (current date)
  17121. * var dt = new Date();
  17122. *
  17123. * //dt = Thu May 25 2006 (today&#39;s month/day in 2006)
  17124. * dt = Ext.Date.parse("2006", "Y");
  17125. *
  17126. * //dt = Sun Jan 15 2006 (all date parts specified)
  17127. * dt = Ext.Date.parse("2006-01-15", "Y-m-d");
  17128. *
  17129. * //dt = Sun Jan 15 2006 15:20:01
  17130. * dt = Ext.Date.parse("2006-01-15 3:20:01 PM", "Y-m-d g:i:s A");
  17131. *
  17132. * // attempt to parse Sun Feb 29 2006 03:20:01 in strict mode
  17133. * dt = Ext.Date.parse("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null
  17134. *
  17135. * ## Heuristic Parsing
  17136. * When no `format` is specified, this method parses the date in a flexible way allowing
  17137. * for different delimiters and textual month names to infer the position of the other
  17138. * parts.
  17139. *
  17140. * Supported inferred date orders when alphabetic month names are used are:
  17141. *
  17142. * - `D,M,Y`
  17143. * - `M,D,Y`
  17144. * - `Y,M,D`
  17145. *
  17146. * If the passed in date consists of all numeric tokens then the relative magnitude of
  17147. * the first two tokens is used to make an inference about the user's intention.
  17148. * If one token is less than 13 and the other is greater than 12, then the user's
  17149. * intention is known.
  17150. *
  17151. * Failing this, the {@link #defaultFormat} is used to determine the input order for
  17152. * the current locale.
  17153. *
  17154. * Part delimiters may be any of these:
  17155. *
  17156. * - `'/'`
  17157. * - `'-'`
  17158. * - `'.'`
  17159. * - `'\'`
  17160. * - `' '` (space)
  17161. *
  17162. * For example, the inputs `"Jun 1 62"` and `"1 Jun 62"` would be understood as the
  17163. * first of June, 1962 in all English locales regardless of the locale's default date
  17164. * ordering.
  17165. *
  17166. * If `"25/1/62"` was passed in, it's obvious that the user means the twenty fifth
  17167. * of January.
  17168. *
  17169. * If, however, `"1/6/62"` was passed in, the {@link #defaultFormat} would be consulted
  17170. * to disambiguate the meaning of those first two tokens.
  17171. *
  17172. * @param {String} input The date string to parse.
  17173. * @param {String} [format] The expected date string format. If not passed, the date
  17174. * string will be parsed heuristically as described above.
  17175. * @param {Boolean} [strict=false] Pass `true` to validate date strings while parsing
  17176. * (i.e. prevents JavaScript Date "rollover"). Invalid date strings will return `null`
  17177. * when parsed.
  17178. * @return {Date} The parsed Date, or `null` if an invalid date string.
  17179. */
  17180. parse: function(input, format, strict) {
  17181. var p;
  17182. if (!format) {
  17183. return utilDate.flexParse(input);
  17184. }
  17185. p = utilDate.parseFunctions;
  17186. if (p[format] == null) {
  17187. utilDate.createParser(format);
  17188. }
  17189. return p[format].call(utilDate, input, Ext.isDefined(strict) ? strict : utilDate.useStrict);
  17190. },
  17191. // Backwards compat
  17192. parseDate: function(input, format, strict) {
  17193. return utilDate.parse(input, format, strict);
  17194. },
  17195. /**
  17196. * @private
  17197. */
  17198. getFormatCode: function(character) {
  17199. var f = utilDate.formatCodes[character];
  17200. if (f) {
  17201. f = typeof f === 'function' ? f() : f;
  17202. // reassign function result to prevent repeated execution
  17203. utilDate.formatCodes[character] = f;
  17204. }
  17205. // note: unknown characters are treated as literals
  17206. return f || ("'" + Ext.String.escape(character) + "'");
  17207. },
  17208. /**
  17209. * @private
  17210. */
  17211. createFormat: function(format) {
  17212. var code = [],
  17213. special = false,
  17214. ch = '',
  17215. i;
  17216. for (i = 0; i < format.length; ++i) {
  17217. ch = format.charAt(i);
  17218. if (!special && ch === "\\") {
  17219. special = true;
  17220. } else if (special) {
  17221. special = false;
  17222. code.push("'" + Ext.String.escape(ch) + "'");
  17223. } else {
  17224. if (ch === '\n') {
  17225. code.push("'\\n'");
  17226. } else {
  17227. code.push(utilDate.getFormatCode(ch));
  17228. }
  17229. }
  17230. }
  17231. utilDate.formatFunctions[format] = Ext.functionFactory("var m = this; return " + code.join('+'));
  17232. },
  17233. /**
  17234. * @private
  17235. */
  17236. createParser: function(format) {
  17237. var regexNum = utilDate.parseRegexes.length,
  17238. currentGroup = 1,
  17239. calc = [],
  17240. regex = [],
  17241. special = false,
  17242. ch = "",
  17243. i = 0,
  17244. len = format.length,
  17245. atEnd = [],
  17246. obj;
  17247. for (; i < len; ++i) {
  17248. ch = format.charAt(i);
  17249. if (!special && ch === "\\") {
  17250. special = true;
  17251. } else if (special) {
  17252. special = false;
  17253. regex.push(Ext.String.escape(ch));
  17254. } else {
  17255. obj = utilDate.formatCodeToRegex(ch, currentGroup);
  17256. currentGroup += obj.g;
  17257. regex.push(obj.s);
  17258. if (obj.g && obj.c) {
  17259. if (obj.calcAtEnd) {
  17260. atEnd.push(obj.c);
  17261. } else {
  17262. calc.push(obj.c);
  17263. }
  17264. }
  17265. }
  17266. }
  17267. calc = calc.concat(atEnd);
  17268. utilDate.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
  17269. utilDate.parseFunctions[format] = Ext.functionFactory("input", "strict", xf(code, regexNum, calc.join('')));
  17270. },
  17271. /**
  17272. * @private
  17273. */
  17274. parseCodes: {
  17275. // Notes:
  17276. // g = {Number} calculation group (0 or 1. only group 1 contributes to
  17277. // date calculations.)
  17278. // c = {String} calculation method (required for group 1. null for group 0.
  17279. // {0} = currentGroup - position in regex result array)
  17280. // s = {String} regex pattern. all matches are stored in results[], and are
  17281. // accessible by the calculation mapped to 'c'
  17282. d: {
  17283. g: 1,
  17284. c: "d = parseInt(results[{0}], 10);\n",
  17285. s: "(3[0-1]|[1-2][0-9]|0[1-9])"
  17286. },
  17287. // day of month with leading zeroes (01 - 31)
  17288. j: {
  17289. g: 1,
  17290. c: "d = parseInt(results[{0}], 10);\n",
  17291. s: "(3[0-1]|[1-2][0-9]|[1-9])"
  17292. },
  17293. // day of month without leading zeroes (1 - 31)
  17294. D: function() {
  17295. var a = [],
  17296. i;
  17297. // get localised short day names
  17298. for (i = 0; i < 7; i++) {
  17299. a.push(utilDate.getShortDayName(i));
  17300. }
  17301. return {
  17302. g: 0,
  17303. c: null,
  17304. s: "(?:" + a.join("|") + ")"
  17305. };
  17306. },
  17307. l: function() {
  17308. return {
  17309. g: 0,
  17310. c: null,
  17311. s: "(?:" + utilDate.dayNames.join("|") + ")"
  17312. };
  17313. },
  17314. N: {
  17315. g: 0,
  17316. c: null,
  17317. s: "[1-7]"
  17318. },
  17319. // ISO-8601 day number (1 (monday) - 7 (sunday))
  17320. //<locale type="object" property="parseCodes">
  17321. S: {
  17322. g: 0,
  17323. c: null,
  17324. s: "(?:st|nd|rd|th)"
  17325. },
  17326. //</locale>
  17327. w: {
  17328. g: 0,
  17329. c: null,
  17330. s: "[0-6]"
  17331. },
  17332. // JavaScript day number (0 (sunday) - 6 (saturday))
  17333. z: {
  17334. g: 1,
  17335. c: "z = parseInt(results[{0}], 10);\n",
  17336. s: "(\\d{1,3})"
  17337. },
  17338. // day of the year (0 - 364 (365 in leap years))
  17339. W: {
  17340. g: 1,
  17341. c: "W = parseInt(results[{0}], 10);\n",
  17342. s: "(\\d{2})"
  17343. },
  17344. // ISO-8601 week number (with leading zero)
  17345. F: function() {
  17346. return {
  17347. g: 1,
  17348. c: "m = parseInt(me.getMonthNumber(results[{0}]), 10);\n",
  17349. s: "(" + utilDate.monthNames.join("|") + ")"
  17350. };
  17351. },
  17352. M: function() {
  17353. var a = [],
  17354. i;
  17355. // get localised short month names
  17356. for (i = 0; i < 12; i++) {
  17357. a.push(utilDate.getShortMonthName(i));
  17358. }
  17359. return Ext.applyIf({
  17360. s: "(" + a.join("|") + ")"
  17361. }, utilDate.formatCodeToRegex("F"));
  17362. },
  17363. m: {
  17364. g: 1,
  17365. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17366. s: "(1[0-2]|0[1-9])"
  17367. },
  17368. // month number with leading zeros (01 - 12)
  17369. n: {
  17370. g: 1,
  17371. c: "m = parseInt(results[{0}], 10) - 1;\n",
  17372. s: "(1[0-2]|[1-9])"
  17373. },
  17374. // month number without leading zeros (1 - 12)
  17375. t: {
  17376. g: 0,
  17377. c: null,
  17378. s: "(?:\\d{2})"
  17379. },
  17380. // no. of days in the month (28 - 31)
  17381. L: {
  17382. g: 0,
  17383. c: null,
  17384. s: "(?:1|0)"
  17385. },
  17386. o: {
  17387. g: 1,
  17388. c: "y = parseInt(results[{0}], 10);\n",
  17389. s: "(\\d{4})"
  17390. },
  17391. // ISO-8601 year number (with leading zero)
  17392. Y: {
  17393. g: 1,
  17394. c: "y = parseInt(results[{0}], 10);\n",
  17395. s: "(\\d{4})"
  17396. },
  17397. // 4-digit year
  17398. y: {
  17399. g: 1,
  17400. c: "var ty = parseInt(results[{0}], 10);\n" + "y = ty > me.y2kYear ? 1900 + ty : 2000 + ty;\n",
  17401. // 2-digit year
  17402. s: "(\\d{2})"
  17403. },
  17404. // In the am/pm parsing routines, we allow both upper and lower case
  17405. // even though it doesn't exactly match the spec. It gives much more flexibility
  17406. // in being able to specify case insensitive regexes.
  17407. /* eslint-disable indent */
  17408. //<locale type="object" property="parseCodes">
  17409. a: {
  17410. g: 1,
  17411. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17412. s: "(am|pm|AM|PM)",
  17413. calcAtEnd: true
  17414. },
  17415. //</locale>
  17416. //<locale type="object" property="parseCodes">
  17417. A: {
  17418. g: 1,
  17419. c: "if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n" + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
  17420. s: "(AM|PM|am|pm)",
  17421. calcAtEnd: true
  17422. },
  17423. //</locale>
  17424. g: {
  17425. g: 1,
  17426. c: "h = parseInt(results[{0}], 10);\n",
  17427. s: "(1[0-2]|[1-9])"
  17428. },
  17429. // 12-hr format of an hour without leading zeroes (1 - 12)
  17430. G: {
  17431. g: 1,
  17432. c: "h = parseInt(results[{0}], 10);\n",
  17433. s: "(2[0-3]|1[0-9]|[0-9])"
  17434. },
  17435. // 24-hr format of an hour without leading zeroes (0 - 23)
  17436. h: {
  17437. g: 1,
  17438. c: "h = parseInt(results[{0}], 10);\n",
  17439. s: "(1[0-2]|0[1-9])"
  17440. },
  17441. // 12-hr format of an hour with leading zeroes (01 - 12)
  17442. H: {
  17443. g: 1,
  17444. c: "h = parseInt(results[{0}], 10);\n",
  17445. s: "(2[0-3]|[0-1][0-9])"
  17446. },
  17447. // 24-hr format of an hour with leading zeroes (00 - 23)
  17448. i: {
  17449. g: 1,
  17450. c: "i = parseInt(results[{0}], 10);\n",
  17451. s: "([0-5][0-9])"
  17452. },
  17453. // minutes with leading zeros (00 - 59)
  17454. s: {
  17455. g: 1,
  17456. c: "s = parseInt(results[{0}], 10);\n",
  17457. s: "([0-5][0-9])"
  17458. },
  17459. // seconds with leading zeros (00 - 59)
  17460. u: {
  17461. g: 1,
  17462. c: "ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",
  17463. s: "(\\d+)"
  17464. },
  17465. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17466. /* eslint-disable max-len */
  17467. O: {
  17468. g: 1,
  17469. c: [
  17470. "o = results[{0}];",
  17471. "var sn = o.substring(0,1),",
  17472. // get + / - sign
  17473. "hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60),",
  17474. // get hours (performs minutes-to-hour conversion also, just in case)
  17475. "mn = o.substring(3,5) % 60;",
  17476. // get minutes
  17477. "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"
  17478. ].// -12hrs <= GMT offset <= 14hrs
  17479. join("\n"),
  17480. s: "([+-]\\d{4})"
  17481. },
  17482. // GMT offset in hrs and mins
  17483. P: {
  17484. g: 1,
  17485. c: [
  17486. "o = results[{0}];",
  17487. "var sn = o.substring(0,1),",
  17488. // get + / - sign
  17489. "hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60),",
  17490. // get hours (performs minutes-to-hour conversion also, just in case)
  17491. "mn = o.substring(4,6) % 60;",
  17492. // get minutes
  17493. "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"
  17494. ].// -12hrs <= GMT offset <= 14hrs
  17495. join("\n"),
  17496. s: "([+-]\\d{2}:\\d{2})"
  17497. },
  17498. // GMT offset in hrs and mins (with colon separator)
  17499. T: {
  17500. g: 0,
  17501. c: null,
  17502. s: "[A-Z]{1,5}"
  17503. },
  17504. // timezone abbrev. may be between 1 - 5 chars
  17505. Z: {
  17506. g: 1,
  17507. c: "zz = results[{0}] * 1;\n" + // -43200 <= UTC offset <= 50400
  17508. "zz = (-43200 <= zz && zz <= 50400)? zz : null;\n",
  17509. s: "([+-]?\\d{1,5})"
  17510. },
  17511. // leading '+' sign is optional for UTC offset
  17512. c: function() {
  17513. var calc = [],
  17514. arr = [
  17515. utilDate.formatCodeToRegex("Y", 1),
  17516. // year
  17517. utilDate.formatCodeToRegex("m", 2),
  17518. // month
  17519. utilDate.formatCodeToRegex("d", 3),
  17520. // day
  17521. utilDate.formatCodeToRegex("H", 4),
  17522. // hour
  17523. utilDate.formatCodeToRegex("i", 5),
  17524. // minute
  17525. utilDate.formatCodeToRegex("s", 6),
  17526. // second
  17527. {
  17528. c: "ms = results[7] || '0'; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"
  17529. },
  17530. // decimal fraction of a second (minimum = 1 digit, maximum = unlimited)
  17531. {
  17532. c: [
  17533. // 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
  17534. "if (results[8]) {",
  17535. // timezone specified
  17536. "if (results[8] == 'Z') {",
  17537. "zz = 0;",
  17538. // UTC
  17539. "}",
  17540. "else if (results[8].indexOf(':') > -1) {",
  17541. utilDate.formatCodeToRegex("P", 8).c,
  17542. // timezone offset with colon separator
  17543. "}",
  17544. "else {",
  17545. utilDate.formatCodeToRegex("O", 8).c,
  17546. // timezone offset without colon separator
  17547. "}",
  17548. "}"
  17549. ].join('\n')
  17550. }
  17551. ],
  17552. i, l;
  17553. for (i = 0 , l = arr.length; i < l; ++i) {
  17554. calc.push(arr[i].c);
  17555. }
  17556. return {
  17557. g: 1,
  17558. c: calc.join(""),
  17559. s: [
  17560. arr[0].s,
  17561. // year (required)
  17562. "(?:",
  17563. "-",
  17564. arr[1].s,
  17565. // month (optional)
  17566. "(?:",
  17567. "-",
  17568. arr[2].s,
  17569. // day (optional)
  17570. "(?:",
  17571. "(?:T| )?",
  17572. // time delimiter -- either a "T" or a single blank space
  17573. arr[3].s,
  17574. ":",
  17575. arr[4].s,
  17576. // hour AND minute, delimited by a single colon (optional). MUST be preceded by either a "T" or a single blank space
  17577. "(?::",
  17578. arr[5].s,
  17579. ")?",
  17580. // seconds (optional)
  17581. "(?:(?:\\.|,)(\\d+))?",
  17582. // decimal fraction of a second (e.g. ",12345" or ".98765") (optional)
  17583. "(Z|(?:[-+]\\d{2}(?::)?\\d{2}))?",
  17584. // "Z" (UTC) or "-0530" (UTC offset without colon delimiter) or "+08:00" (UTC offset with colon delimiter) (optional)
  17585. ")?",
  17586. ")?",
  17587. ")?"
  17588. ].join("")
  17589. };
  17590. },
  17591. U: {
  17592. g: 1,
  17593. c: "u = parseInt(results[{0}], 10);\n",
  17594. s: "(-?\\d+)"
  17595. }
  17596. },
  17597. // leading minus sign indicates seconds before UNIX epoch
  17598. /* eslint-enable indent, max-len */
  17599. compare: function(d1, d2, includeTime) {
  17600. var s1, s2;
  17601. if (typeof d1 === 'string') {
  17602. d1 = Ext.Date.parse(d1);
  17603. }
  17604. if (typeof d2 === 'string') {
  17605. d2 = Ext.Date.parse(d2);
  17606. }
  17607. s1 = Ext.Date.format(d1, 'C');
  17608. s2 = Ext.Date.format(d2, 'C');
  17609. if (!includeTime) {
  17610. s1 = s1.substr(0, 10);
  17611. // "YYYY-MM-DD".length === 10
  17612. s2 = s2.substr(0, 10);
  17613. }
  17614. return (s1 < s2) ? -1 : ((s2 < s1) ? 1 : 0);
  17615. },
  17616. // Old Ext.Date prototype methods.
  17617. /**
  17618. * @private
  17619. */
  17620. dateFormat: function(date, format) {
  17621. return utilDate.format(date, format);
  17622. },
  17623. /**
  17624. * Compares if two dates are equal by comparing their values.
  17625. * @param {Date} date1
  17626. * @param {Date} date2
  17627. * @return {Boolean} `true` if the date values are equal
  17628. */
  17629. isEqual: function(date1, date2) {
  17630. // check we have 2 date objects
  17631. if (date1 && date2) {
  17632. return +date1 === +date2;
  17633. }
  17634. // one or both isn't a date, only equal if both are falsy
  17635. return !(date1 || date2);
  17636. },
  17637. /**
  17638. * Formats a date given the supplied format string.
  17639. * @param {Date} date The date to format
  17640. * @param {String} format The format string
  17641. * @return {String} The formatted date or an empty string if date parameter is not
  17642. * a JavaScript Date object
  17643. */
  17644. format: function(date, format) {
  17645. var formatFunctions = utilDate.formatFunctions;
  17646. if (!Ext.isDate(date)) {
  17647. return '';
  17648. }
  17649. if (formatFunctions[format] == null) {
  17650. utilDate.createFormat(format);
  17651. }
  17652. return formatFunctions[format].call(date) + '';
  17653. },
  17654. /**
  17655. * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
  17656. *
  17657. * __Note:__ The date string returned by the JavaScript Date object's `toString()` method varies
  17658. * between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in
  17659. * America). For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula
  17660. * Standard Time)", `getTimezone()` first tries to get the timezone abbreviation from between
  17661. * a pair of parentheses (which may or may not be present), failing which it proceeds to get
  17662. * the timezone abbreviation from the GMT offset portion of the date string.
  17663. *
  17664. * var dt = new Date('9/17/2011');
  17665. * console.log(Ext.Date.getTimezone(dt));
  17666. *
  17667. * @param {Date} date The date
  17668. * @return {String} The abbreviated timezone name (e.g. 'CST', 'PDT', 'EDT', 'MPST' ...).
  17669. */
  17670. getTimezone: function(date) {
  17671. /* eslint-disable max-len, no-useless-escape, newline-per-chained-call */
  17672. // the following list shows the differences between date strings from different browsers on a WinXP SP2 machine from an Asian locale:
  17673. //
  17674. // Opera : "Thu, 25 Oct 2007 22:53:45 GMT+0800" -- shortest (weirdest) date string of the lot
  17675. // 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)
  17676. // FF : "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)" -- value in parentheses always gives the correct timezone
  17677. // IE : "Thu Oct 25 22:54:35 UTC+0800 2007" -- (Asian system setting) look for 3-4 letter timezone abbrev
  17678. // IE : "Thu Oct 25 17:06:37 PDT 2007" -- (American system setting) look for 3-4 letter timezone abbrev
  17679. //
  17680. // this crazy regex attempts to guess the correct timezone abbreviation despite these differences.
  17681. // step 1: (?:\((.*)\) -- find timezone in parentheses
  17682. // 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
  17683. // step 3: remove all non uppercase characters found in step 1 and 2
  17684. return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,5})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/, "$1$2").replace(/[^A-Z]/g, "");
  17685. },
  17686. /* eslint-enable max-len, no-useless-escape, newline-per-chained-call */
  17687. /**
  17688. * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
  17689. *
  17690. * var dt = new Date('9/17/2011');
  17691. * console.log(Ext.Date.getGMTOffset(dt));
  17692. *
  17693. * @param {Date} date The date
  17694. * @param {Boolean} [colon=false] `true` to separate the hours and minutes with a colon.
  17695. * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600').
  17696. */
  17697. getGMTOffset: function(date, colon) {
  17698. var offset = date.getTimezoneOffset();
  17699. return (offset > 0 ? "-" : "+") + Ext.String.leftPad(Math.floor(Math.abs(offset) / 60), 2, "0") + (colon ? ":" : "") + Ext.String.leftPad(Math.abs(offset % 60), 2, "0");
  17700. },
  17701. /**
  17702. * Get the numeric day number of the year, adjusted for leap year.
  17703. *
  17704. * var dt = new Date('9/17/2011');
  17705. * console.log(Ext.Date.getDayOfYear(dt)); // 259
  17706. *
  17707. * @param {Date} date The date
  17708. * @return {Number} 0 to 364 (365 in leap years).
  17709. */
  17710. getDayOfYear: function(date) {
  17711. var num = 0,
  17712. d = utilDate.clone(date),
  17713. m = date.getMonth(),
  17714. i;
  17715. for (i = 0 , d.setDate(1) , d.setMonth(0); i < m; d.setMonth(++i)) {
  17716. num += utilDate.getDaysInMonth(d);
  17717. }
  17718. return num + date.getDate() - 1;
  17719. },
  17720. /**
  17721. * Get the numeric ISO-8601 week number of the year.
  17722. * (equivalent to the format specifier 'W', but without a leading zero).
  17723. *
  17724. * var dt = new Date('9/17/2011');
  17725. * console.log(Ext.Date.getWeekOfYear(dt)); // 37
  17726. *
  17727. * @param {Date} date The date.
  17728. * @return {Number} 1 to 53.
  17729. * @method
  17730. */
  17731. getWeekOfYear: (function() {
  17732. // adapted from http://www.merlyn.demon.co.uk/weekcalc.htm
  17733. var ms1d = 86400000,
  17734. // milliseconds in a day
  17735. ms7d = 7 * ms1d;
  17736. // milliseconds in a week
  17737. return function(date) {
  17738. // return a closure so constants get calculated only once
  17739. /* eslint-disable-next-line max-len */
  17740. var DC3 = nativeDate.UTC(date.getFullYear(), date.getMonth(), date.getDate() + 3) / ms1d,
  17741. // an Absolute Day Number
  17742. AWN = Math.floor(DC3 / 7),
  17743. // an Absolute Week Number
  17744. Wyr = new nativeDate(AWN * ms7d).getUTCFullYear();
  17745. return AWN - Math.floor(nativeDate.UTC(Wyr, 0, 7) / ms7d) + 1;
  17746. };
  17747. }()),
  17748. /**
  17749. * Checks if the current date falls within a leap year.
  17750. *
  17751. * var dt = new Date('1/10/2011');
  17752. * console.log(Ext.Date.isLeapYear(dt)); // false
  17753. *
  17754. * @param {Date} date The date
  17755. * @return {Boolean} `true` if the current date falls within a leap year, `false` otherwise.
  17756. */
  17757. isLeapYear: function(date) {
  17758. var year = date.getFullYear();
  17759. return !!((year & 3) === 0 && (year % 100 || (year % 400 === 0 && year)));
  17760. },
  17761. /**
  17762. * Get the first day of the current month, adjusted for leap year. The returned value
  17763. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17764. * the {@link #monthNames} array to retrieve the textual day name.
  17765. *
  17766. * var dt = new Date('1/10/2007'),
  17767. * firstDay = Ext.Date.getFirstDayOfMonth(dt);
  17768. *
  17769. * console.log(Ext.Date.dayNames[firstDay]); // output: 'Monday'
  17770. *
  17771. * @param {Date} date The date
  17772. * @return {Number} The day number (0-6).
  17773. */
  17774. getFirstDayOfMonth: function(date) {
  17775. var day = (date.getDay() - (date.getDate() - 1)) % 7;
  17776. return (day < 0) ? (day + 7) : day;
  17777. },
  17778. /**
  17779. * Get the last day of the current month, adjusted for leap year. The returned value
  17780. * is the numeric day index within the week (0-6) which can be used in conjunction with
  17781. * the {@link #monthNames} array to retrieve the textual day name.
  17782. *
  17783. * var dt = new Date('1/10/2007'),
  17784. * lastDay = Ext.Date.getLastDayOfMonth(dt);
  17785. *
  17786. * console.log(Ext.Date.dayNames[lastDay]); // output: 'Wednesday'
  17787. *
  17788. * @param {Date} date The date
  17789. * @return {Number} The day number (0-6).
  17790. */
  17791. getLastDayOfMonth: function(date) {
  17792. return utilDate.getLastDateOfMonth(date).getDay();
  17793. },
  17794. /**
  17795. * Get the date of the first day of the month in which this date resides.
  17796. * @param {Date} date The date
  17797. * @return {Date}
  17798. */
  17799. getFirstDateOfMonth: function(date) {
  17800. return new nativeDate(date.getFullYear(), date.getMonth(), 1);
  17801. },
  17802. /**
  17803. * Get the date of the last day of the month in which this date resides.
  17804. * @param {Date} date The date
  17805. * @return {Date}
  17806. */
  17807. getLastDateOfMonth: function(date) {
  17808. return new nativeDate(date.getFullYear(), date.getMonth(), utilDate.getDaysInMonth(date));
  17809. },
  17810. /**
  17811. * Get the number of days in the current month, adjusted for leap year.
  17812. * @param {Date} date The date
  17813. * @return {Number} The number of days in the month.
  17814. * @method
  17815. */
  17816. getDaysInMonth: (function() {
  17817. var daysInMonth = [
  17818. 31,
  17819. 28,
  17820. 31,
  17821. 30,
  17822. 31,
  17823. 30,
  17824. 31,
  17825. 31,
  17826. 30,
  17827. 31,
  17828. 30,
  17829. 31
  17830. ];
  17831. return function(date) {
  17832. // return a closure for efficiency
  17833. var m = date.getMonth();
  17834. return m === 1 && utilDate.isLeapYear(date) ? 29 : daysInMonth[m];
  17835. };
  17836. }()),
  17837. /**
  17838. * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
  17839. * @param {Date} date The date
  17840. * @return {String} 'st, 'nd', 'rd' or 'th'.
  17841. * @locale
  17842. */
  17843. getSuffix: function(date) {
  17844. switch (date.getDate()) {
  17845. case 1:
  17846. case 21:
  17847. case 31:
  17848. return "st";
  17849. case 2:
  17850. case 22:
  17851. return "nd";
  17852. case 3:
  17853. case 23:
  17854. return "rd";
  17855. default:
  17856. return "th";
  17857. }
  17858. },
  17859. /**
  17860. * Creates and returns a new Date instance with the exact same date value as the called
  17861. * instance. Dates are copied and passed by reference, so if a copied date variable is modified
  17862. * later, the original variable will also be changed. When the intention is to create a new
  17863. * variable that will not modify the original instance, you should create a clone.
  17864. *
  17865. * Example of correctly cloning a date:
  17866. *
  17867. * //wrong way:
  17868. * var orig = new Date('10/1/2006');
  17869. * var copy = orig;
  17870. * copy.setDate(5);
  17871. * console.log(orig); // returns 'Thu Oct 05 2006'!
  17872. *
  17873. * //correct way:
  17874. * var orig = new Date('10/1/2006'),
  17875. * copy = Ext.Date.clone(orig);
  17876. * copy.setDate(5);
  17877. * console.log(orig); // returns 'Thu Oct 01 2006'
  17878. *
  17879. * @param {Date} date The date.
  17880. * @return {Date} The new Date instance.
  17881. */
  17882. clone: function(date) {
  17883. return new nativeDate(date.getTime());
  17884. },
  17885. /**
  17886. * Checks if the current date is affected by Daylight Saving Time (DST).
  17887. * @param {Date} date The date
  17888. * @return {Boolean} `true` if the current date is affected by DST.
  17889. */
  17890. isDST: function(date) {
  17891. // adapted from http://sencha.com/forum/showthread.php?p=247172#post247172
  17892. // courtesy of @geoffrey.mcgill
  17893. /* eslint-disable-next-line max-len */
  17894. return new nativeDate(date.getFullYear(), 0, 1).getTimezoneOffset() !== date.getTimezoneOffset();
  17895. },
  17896. /**
  17897. * Attempts to clear all time information from this Date by setting the time to midnight
  17898. * of the same day, automatically adjusting for Daylight Saving Time (DST) where applicable.
  17899. *
  17900. * __Note:__ DST timezone information for the browser's host operating system is assumed to be
  17901. * up-to-date.
  17902. * @param {Date} date The date
  17903. * @param {Boolean} [clone=false] `true` to create a clone of this date, clear the time and
  17904. * return it.
  17905. * @return {Date} this or the clone.
  17906. */
  17907. clearTime: function(date, clone) {
  17908. var d, hr, c;
  17909. // handles invalid dates preventing the browser from crashing.
  17910. if (isNaN(date.getTime())) {
  17911. return date;
  17912. }
  17913. if (clone) {
  17914. return utilDate.clearTime(utilDate.clone(date));
  17915. }
  17916. // get current date before clearing time
  17917. d = date.getDate();
  17918. // clear time
  17919. date.setHours(0);
  17920. date.setMinutes(0);
  17921. date.setSeconds(0);
  17922. date.setMilliseconds(0);
  17923. // account for DST (i.e. day of month changed when setting hour = 0)
  17924. if (date.getDate() !== d) {
  17925. // note: DST adjustments are assumed to occur in multiples of 1 hour
  17926. // (this is almost always the case)
  17927. // refer to http://www.timeanddate.com/time/aboutdst.html for the (rare) exceptions
  17928. // to this rule
  17929. // increment hour until cloned date == current date
  17930. /* eslint-disable-next-line max-len, curly, nonblock-statement-body-position */
  17931. for (hr = 1 , c = utilDate.add(date, utilDate.HOUR, hr); c.getDate() !== d; hr++ , c = utilDate.add(date, utilDate.HOUR, hr)){}
  17932. date.setDate(d);
  17933. date.setHours(c.getHours());
  17934. }
  17935. return date;
  17936. },
  17937. /**
  17938. * Provides a convenient method for performing basic date arithmetic. This method
  17939. * does not modify the Date instance being called - it creates and returns
  17940. * a new Date instance containing the resulting date value.
  17941. *
  17942. * Examples:
  17943. *
  17944. * // Basic usage:
  17945. * var dt = Ext.Date.add(new Date('10/29/2006'), Ext.Date.DAY, 5);
  17946. * console.log(dt); // returns 'Fri Nov 03 2006 00:00:00'
  17947. *
  17948. * // Negative values will be subtracted:
  17949. * var dt2 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, -5);
  17950. * console.log(dt2); // returns 'Tue Sep 26 2006 00:00:00'
  17951. *
  17952. * // Decimal values can be used:
  17953. * var dt3 = Ext.Date.add(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  17954. * console.log(dt3); // returns 'Mon Oct 02 2006 06:00:00'
  17955. *
  17956. * @param {Date} date The date to modify
  17957. * @param {String} interval A valid date interval enum value.
  17958. * @param {Number} value The amount to add to the current date.
  17959. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  17960. * daylight savings boundaries.
  17961. * @return {Date} The new Date instance.
  17962. */
  17963. add: function(date, interval, value, preventDstAdjust) {
  17964. var d = utilDate.clone(date),
  17965. base = 0,
  17966. day, decimalValue;
  17967. if (!interval || value === 0) {
  17968. return d;
  17969. }
  17970. decimalValue = value - parseInt(value, 10);
  17971. value = parseInt(value, 10);
  17972. if (value) {
  17973. switch (interval.toLowerCase()) {
  17974. // See EXTJSIV-7418. We use setTime() here to deal with issues related to
  17975. // the switchover that occurs when changing to daylight savings and vice
  17976. // versa. setTime() handles this correctly where setHour/Minute/Second/Millisecond
  17977. // do not. Let's assume the DST change occurs at 2am and we're incrementing using
  17978. // add for 15 minutes at time. When entering DST, we should see:
  17979. // 01:30am
  17980. // 01:45am
  17981. // 03:00am // skip 2am because the hour does not exist
  17982. // ...
  17983. // Similarly, leaving DST, we should see:
  17984. // 01:30am
  17985. // 01:45am
  17986. // 01:00am // repeat 1am because that's the change over
  17987. // 01:30am
  17988. // 01:45am
  17989. // 02:00am
  17990. // ....
  17991. //
  17992. case utilDate.MILLI:
  17993. if (preventDstAdjust) {
  17994. d.setMilliseconds(d.getMilliseconds() + value);
  17995. } else {
  17996. d.setTime(d.getTime() + value);
  17997. };
  17998. break;
  17999. case utilDate.SECOND:
  18000. if (preventDstAdjust) {
  18001. d.setSeconds(d.getSeconds() + value);
  18002. } else {
  18003. d.setTime(d.getTime() + value * 1000);
  18004. };
  18005. break;
  18006. case utilDate.MINUTE:
  18007. if (preventDstAdjust) {
  18008. d.setMinutes(d.getMinutes() + value);
  18009. } else {
  18010. d.setTime(d.getTime() + value * 60 * 1000);
  18011. };
  18012. break;
  18013. case utilDate.HOUR:
  18014. if (preventDstAdjust) {
  18015. d.setHours(d.getHours() + value);
  18016. } else {
  18017. d.setTime(d.getTime() + value * 60 * 60 * 1000);
  18018. };
  18019. break;
  18020. case utilDate.DAY:
  18021. if (preventDstAdjust === false) {
  18022. d.setTime(d.getTime() + value * 24 * 60 * 60 * 1000);
  18023. } else {
  18024. d.setDate(d.getDate() + value);
  18025. };
  18026. break;
  18027. case utilDate.MONTH:
  18028. day = date.getDate();
  18029. if (day > 28) {
  18030. /* eslint-disable-next-line max-len */
  18031. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.MONTH, value)).getDate());
  18032. };
  18033. d.setDate(day);
  18034. d.setMonth(date.getMonth() + value);
  18035. break;
  18036. case utilDate.YEAR:
  18037. day = date.getDate();
  18038. if (day > 28) {
  18039. /* eslint-disable-next-line max-len */
  18040. day = Math.min(day, utilDate.getLastDateOfMonth(utilDate.add(utilDate.getFirstDateOfMonth(date), utilDate.YEAR, value)).getDate());
  18041. };
  18042. d.setDate(day);
  18043. d.setFullYear(date.getFullYear() + value);
  18044. break;
  18045. }
  18046. }
  18047. if (decimalValue) {
  18048. switch (interval.toLowerCase()) {
  18049. /* eslint-disable no-multi-spaces */
  18050. case utilDate.MILLI:
  18051. base = 1;
  18052. break;
  18053. case utilDate.SECOND:
  18054. base = 1000;
  18055. break;
  18056. case utilDate.MINUTE:
  18057. base = 1000 * 60;
  18058. break;
  18059. case utilDate.HOUR:
  18060. base = 1000 * 60 * 60;
  18061. break;
  18062. case utilDate.DAY:
  18063. base = 1000 * 60 * 60 * 24;
  18064. break;
  18065. /* eslint-enable no-multi-spaces */
  18066. case utilDate.MONTH:
  18067. day = utilDate.getDaysInMonth(d);
  18068. base = 1000 * 60 * 60 * 24 * day;
  18069. break;
  18070. case utilDate.YEAR:
  18071. day = (utilDate.isLeapYear(d) ? 366 : 365);
  18072. base = 1000 * 60 * 60 * 24 * day;
  18073. break;
  18074. }
  18075. if (base) {
  18076. d.setTime(d.getTime() + base * decimalValue);
  18077. }
  18078. }
  18079. return d;
  18080. },
  18081. /**
  18082. * Provides a convenient method for performing basic date arithmetic. This method
  18083. * does not modify the Date instance being called - it creates and returns
  18084. * a new Date instance containing the resulting date value.
  18085. *
  18086. * Examples:
  18087. *
  18088. * // Basic usage:
  18089. * var dt = Ext.Date.subtract(new Date('10/29/2006'), Ext.Date.DAY, 5);
  18090. * console.log(dt); // returns 'Tue Oct 24 2006 00:00:00'
  18091. *
  18092. * // Negative values will be added:
  18093. * var dt2 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, -5);
  18094. * console.log(dt2); // returns 'Fri Oct 6 2006 00:00:00'
  18095. *
  18096. * // Decimal values can be used:
  18097. * var dt3 = Ext.Date.subtract(new Date('10/1/2006'), Ext.Date.DAY, 1.25);
  18098. * console.log(dt3); // returns 'Fri Sep 29 2006 06:00:00'
  18099. *
  18100. * @param {Date} date The date to modify
  18101. * @param {String} interval A valid date interval enum value.
  18102. * @param {Number} value The amount to subtract from the current date.
  18103. * @param {Boolean} [preventDstAdjust=false] `true` to prevent adjustments when crossing
  18104. * daylight savings boundaries.
  18105. * @return {Date} The new Date instance.
  18106. */
  18107. subtract: function(date, interval, value, preventDstAdjust) {
  18108. return utilDate.add(date, interval, -value, preventDstAdjust);
  18109. },
  18110. /**
  18111. * Checks if a date falls on or between the given start and end dates.
  18112. * @param {Date} date The date to check
  18113. * @param {Date} start Start date
  18114. * @param {Date} end End date
  18115. * @return {Boolean} `true` if this date falls on or between the given start and end dates.
  18116. */
  18117. between: function(date, start, end) {
  18118. var t = date.getTime();
  18119. return start.getTime() <= t && t <= end.getTime();
  18120. },
  18121. /**
  18122. * Checks if the date is a weekend day. Uses {@link #weekendDays}.
  18123. * @param {Date} date The date.
  18124. * @return {Boolean} `true` if the day falls on a weekend.
  18125. *
  18126. * @since 6.2.0
  18127. */
  18128. isWeekend: function(date) {
  18129. return Ext.Array.indexOf(this.weekendDays, date.getDay()) > -1;
  18130. },
  18131. /**
  18132. * Converts the passed UTC date into a local date.
  18133. * For example, if the passed date is:
  18134. * `Wed Jun 01 2016 00:10:00 GMT+1000 (AUS Eastern Standard Time)`, then
  18135. * the returned date will be `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  18136. * @param {Date} d The date to convert.
  18137. * @return {Date} The date as a local. Does not modify the passed date.
  18138. *
  18139. * @since 6.2.0
  18140. */
  18141. utcToLocal: function(d) {
  18142. return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
  18143. },
  18144. /**
  18145. * Converts the passed local date into a UTC date.
  18146. * For example, if the passed date is:
  18147. * `Wed Jun 01 2016 00:00:00 GMT+1000 (AUS Eastern Standard Time)`, then
  18148. * the returned date will be `Wed Jun 01 2016 10:00:00 GMT+1000 (AUS Eastern Standard Time)`.
  18149. * @param {Date} d The date to convert.
  18150. * @return {Date} The date as UTC. Does not modify the passed date.
  18151. *
  18152. * @since 6.2.0
  18153. */
  18154. localToUtc: function(d) {
  18155. return utilDate.utc(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
  18156. },
  18157. /**
  18158. * Create a UTC date.
  18159. * @param {Number} year The year.
  18160. * @param {Number} month The month.
  18161. * @param {Number} day The day.
  18162. * @param {Number} [hour=0] The hour.
  18163. * @param {Number} [min=0] The minutes.
  18164. * @param {Number} [s=0] The seconds.
  18165. * @param {Number} [ms=0] The milliseconds.
  18166. * @return {Date} The UTC date.
  18167. *
  18168. * @since 6.2.0
  18169. */
  18170. utc: function(year, month, day, hour, min, s, ms) {
  18171. return new Date(Date.UTC(year, month, day, hour || 0, min || 0, s || 0, ms || 0));
  18172. },
  18173. // Maintains compatibility with old static and prototype window.Date methods.
  18174. compat: function() {
  18175. var p,
  18176. /* eslint-disable max-len */
  18177. statics = [
  18178. 'useStrict',
  18179. 'formatCodeToRegex',
  18180. 'parseFunctions',
  18181. 'parseRegexes',
  18182. 'formatFunctions',
  18183. 'y2kYear',
  18184. 'MILLI',
  18185. 'SECOND',
  18186. 'MINUTE',
  18187. 'HOUR',
  18188. 'DAY',
  18189. 'MONTH',
  18190. 'YEAR',
  18191. 'defaults',
  18192. 'dayNames',
  18193. 'monthNames',
  18194. 'monthNumbers',
  18195. 'getShortMonthName',
  18196. 'getShortDayName',
  18197. 'getMonthNumber',
  18198. 'formatCodes',
  18199. 'isValid',
  18200. 'parseDate',
  18201. 'getFormatCode',
  18202. 'createFormat',
  18203. 'createParser',
  18204. 'parseCodes'
  18205. ],
  18206. proto = [
  18207. 'dateFormat',
  18208. 'format',
  18209. 'getTimezone',
  18210. 'getGMTOffset',
  18211. 'getDayOfYear',
  18212. 'getWeekOfYear',
  18213. 'isLeapYear',
  18214. 'getFirstDayOfMonth',
  18215. 'getLastDayOfMonth',
  18216. 'getDaysInMonth',
  18217. 'getSuffix',
  18218. 'clone',
  18219. 'isDST',
  18220. 'clearTime',
  18221. 'add',
  18222. 'between'
  18223. ],
  18224. /* eslint-enable max-len */
  18225. sLen = statics.length,
  18226. pLen = proto.length,
  18227. stat, prot, s;
  18228. // Append statics
  18229. for (s = 0; s < sLen; s++) {
  18230. stat = statics[s];
  18231. nativeDate[stat] = utilDate[stat];
  18232. }
  18233. // Append to prototype
  18234. for (p = 0; p < pLen; p++) {
  18235. prot = proto[p];
  18236. nativeDate.prototype[prot] = function() {
  18237. var args = Array.prototype.slice.call(arguments);
  18238. args.unshift(this);
  18239. return utilDate[prot].apply(utilDate, args);
  18240. };
  18241. }
  18242. },
  18243. /**
  18244. * Calculate how many units are there between two time.
  18245. * @param {Date} min The first time.
  18246. * @param {Date} max The second time.
  18247. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  18248. * @return {Number} The maximum number n of units that min + n * unit <= max.
  18249. */
  18250. diff: function(min, max, unit) {
  18251. var diff = +max - min,
  18252. est;
  18253. switch (unit) {
  18254. case utilDate.MILLI:
  18255. return diff;
  18256. case utilDate.SECOND:
  18257. return Math.floor(diff / 1000);
  18258. case utilDate.MINUTE:
  18259. return Math.floor(diff / 60000);
  18260. case utilDate.HOUR:
  18261. return Math.floor(diff / 3600000);
  18262. case utilDate.DAY:
  18263. return Math.floor(diff / 86400000);
  18264. case 'w':
  18265. return Math.floor(diff / 604800000);
  18266. case utilDate.MONTH:
  18267. est = (max.getFullYear() * 12 + max.getMonth()) - (min.getFullYear() * 12 + min.getMonth());
  18268. if (utilDate.add(min, unit, est) > max) {
  18269. return est - 1;
  18270. };
  18271. return est;
  18272. case utilDate.YEAR:
  18273. est = max.getFullYear() - min.getFullYear();
  18274. if (utilDate.add(min, unit, est) > max) {
  18275. return est - 1;
  18276. } else {
  18277. return est;
  18278. };
  18279. }
  18280. },
  18281. /**
  18282. * Align the date to `unit`.
  18283. * @param {Date} date The date to be aligned.
  18284. * @param {String} unit The unit. This unit is compatible with the date interval constants.
  18285. * @param {Number} step
  18286. * @return {Date} The aligned date.
  18287. */
  18288. align: function(date, unit, step) {
  18289. var num = new nativeDate(+date);
  18290. switch (unit.toLowerCase()) {
  18291. case utilDate.MILLI:
  18292. return num;
  18293. case utilDate.SECOND:
  18294. num.setUTCSeconds(num.getUTCSeconds() - num.getUTCSeconds() % step);
  18295. num.setUTCMilliseconds(0);
  18296. return num;
  18297. case utilDate.MINUTE:
  18298. num.setUTCMinutes(num.getUTCMinutes() - num.getUTCMinutes() % step);
  18299. num.setUTCSeconds(0);
  18300. num.setUTCMilliseconds(0);
  18301. return num;
  18302. case utilDate.HOUR:
  18303. num.setUTCHours(num.getUTCHours() - num.getUTCHours() % step);
  18304. num.setUTCMinutes(0);
  18305. num.setUTCSeconds(0);
  18306. num.setUTCMilliseconds(0);
  18307. return num;
  18308. case utilDate.DAY:
  18309. if (step === 7 || step === 14) {
  18310. num.setUTCDate(num.getUTCDate() - num.getUTCDay() + 1);
  18311. };
  18312. num.setUTCHours(0);
  18313. num.setUTCMinutes(0);
  18314. num.setUTCSeconds(0);
  18315. num.setUTCMilliseconds(0);
  18316. return num;
  18317. case utilDate.MONTH:
  18318. num.setUTCMonth(num.getUTCMonth() - (num.getUTCMonth() - 1) % step, 1);
  18319. num.setUTCHours(0);
  18320. num.setUTCMinutes(0);
  18321. num.setUTCSeconds(0);
  18322. num.setUTCMilliseconds(0);
  18323. return num;
  18324. case utilDate.YEAR:
  18325. num.setUTCFullYear(num.getUTCFullYear() - num.getUTCFullYear() % step, 1, 1);
  18326. num.setUTCHours(0);
  18327. num.setUTCMinutes(0);
  18328. num.setUTCSeconds(0);
  18329. num.setUTCMilliseconds(0);
  18330. return date;
  18331. }
  18332. },
  18333. flexParse: function(inDate, defaultFormat) {
  18334. var parts = datePartsRe.exec(inDate),
  18335. firstFormatToken, day, month, year, result;
  18336. // Regex couldn't parse; invalid date.
  18337. if (!parts) {
  18338. return Ext.Date.parse(inDate, 'C');
  18339. }
  18340. // handle "YYYY-MM-DDThh:mm:ssZ"
  18341. // Use this format string to work out what is the desired date order, d/m/y|m/d/y|y/m/d
  18342. if (!defaultFormat) {
  18343. defaultFormat = Ext.Date.defaultFormat;
  18344. }
  18345. // Now the parts array will be:
  18346. // [0] - the full string
  18347. // [1] - The first token if numeric
  18348. // [2] - The first token if alphabetic
  18349. // [3] - The second token if numeric
  18350. // [4] - The second token if alphabetic
  18351. // [5] - The third token.
  18352. // If they've used all numeric parts, we have to use locale order
  18353. // to decide what the parts are. We have three valid choices:
  18354. // d/m/y
  18355. // m/d/y
  18356. // y/m/d
  18357. if (!(parts[2] || parts[4])) {
  18358. firstFormatToken = defaultFormat[0];
  18359. // Not in a y/m/d locale and (first character is a day token, or first
  18360. // token is definitely a day) - it's d/m/y
  18361. // eslint-disable-next-line no-undef
  18362. if (!yearInfo[firstFormatToken] && (dayInfo[firstFormatToken] || (parts[1] > 12 && parts[3] < 13))) {
  18363. day = parseInt(parts[1]);
  18364. month = parseInt(parts[3]) - 1;
  18365. year = parseInt(parts[5]);
  18366. } else if (!yearInfo[firstFormatToken] && (monthInfo[firstFormatToken] || (parts[3] > 12 && parts[1] < 13))) {
  18367. // Not in a y/m/d locale and (first charecter is a month token, or
  18368. // first token is definitely a month) - it's m/d/y
  18369. month = parseInt(parts[1]) - 1;
  18370. day = parseInt(parts[3]);
  18371. year = parseInt(parts[5]);
  18372. } else {
  18373. // y/m/d is the only other valid format
  18374. year = parseInt(parts[1]);
  18375. month = parseInt(parts[3]) - 1;
  18376. day = parseInt(parts[5]);
  18377. }
  18378. } else {
  18379. // They've used an alphabetic month
  18380. // Two alphabetic tokens - not valid.
  18381. if (parts[2] && parts[4]) {
  18382. return null;
  18383. }
  18384. // m/d/y
  18385. if (parts[2]) {
  18386. month = utilDate.monthNumbers[Ext.String.capitalize(parts[2].substr(0, 3))];
  18387. day = parseInt(parts[3]);
  18388. year = parseInt(parts[5]);
  18389. } else {
  18390. // d/m/y
  18391. day = parseInt(parts[1]);
  18392. month = utilDate.monthNumbers[Ext.String.capitalize(parts[4].substr(0, 3))];
  18393. year = parseInt(parts[5]);
  18394. }
  18395. }
  18396. // Alphabetic month couldn't be found, or numeric one out of range.
  18397. if (isNaN(month) || (month < 0 || month > 11)) {
  18398. return null;
  18399. }
  18400. // Short years must be upgraded according to the y2kYear setting
  18401. if (year < utilDate.y2kYear) {
  18402. year += 2000;
  18403. }
  18404. // Create the first of the month so that we can check the validity of the day
  18405. result = new Date(year, month, 1, 0, 0, 0);
  18406. // Validate the day of month.
  18407. if (day < 1 || day > Ext.Date.getDaysInMonth(result)) {
  18408. return null;
  18409. }
  18410. result.setDate(day);
  18411. return result;
  18412. }
  18413. };
  18414. utilDate.parseCodes.C = utilDate.parseCodes.c;
  18415. return utilDate;
  18416. }());
  18417. /**
  18418. * @class Ext.Function
  18419. *
  18420. * A collection of useful static methods to deal with function callbacks.
  18421. * @singleton
  18422. */
  18423. /* eslint-disable indent */
  18424. Ext.Function = (function() {
  18425. // @define Ext.lang.Function
  18426. // @define Ext.Function
  18427. // @require Ext
  18428. // @require Ext.lang.Array
  18429. var lastTime = 0,
  18430. animFrameId,
  18431. animFrameHandlers = [],
  18432. animFrameNoArgs = [],
  18433. idSource = 0,
  18434. animFrameMap = {},
  18435. slice = Array.prototype.slice,
  18436. win = window,
  18437. global = Ext.global,
  18438. // We disable setImmediate in unit tests because it derails internal Jasmine queue
  18439. hasImmediate = !Ext.disableImmediate && !!(global.setImmediate && global.clearImmediate),
  18440. requestAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame || win.mozRequestAnimationFrame || win.oRequestAnimationFrame || function(callback) {
  18441. var currTime = Ext.now(),
  18442. timeToCall = Math.max(0, 16 - (currTime - lastTime)),
  18443. timerFn = function() {
  18444. callback(currTime + timeToCall);
  18445. },
  18446. id;
  18447. timerFn.$origFn = callback.$origFn || callback;
  18448. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18449. id = win.setTimeout(timerFn, timeToCall);
  18450. lastTime = currTime + timeToCall;
  18451. return id;
  18452. },
  18453. fireHandlers = function() {
  18454. var len = animFrameHandlers.length,
  18455. id, i, handler;
  18456. animFrameId = null;
  18457. var timer;
  18458. // eslint-disable-line vars-on-top
  18459. // Fire all animation frame handlers in one go
  18460. for (i = 0; i < len; i++) {
  18461. handler = animFrameHandlers[i];
  18462. id = handler[3];
  18463. // Check if this timer has been canceled; its map entry is going to be removed
  18464. if (animFrameMap[id]) {
  18465. delete animFrameMap[id];
  18466. timer = Ext.Timer.get(id, 'raf');
  18467. if (timer) {
  18468. timer.tick();
  18469. }
  18470. handler[0].apply(handler[1] || global, handler[2] || animFrameNoArgs);
  18471. if (timer) {
  18472. timer.tock();
  18473. }
  18474. }
  18475. }
  18476. // Clear all fired animation frame handlers, don't forget that new handlers
  18477. // could have been created in user handler functions called in the loop above
  18478. animFrameHandlers = animFrameHandlers.slice(len);
  18479. },
  18480. fireElevatedHandlers = function() {
  18481. Ext.elevate(fireHandlers);
  18482. },
  18483. ExtFunction = {
  18484. /**
  18485. * A very commonly used method throughout the framework. It acts as a wrapper around
  18486. * another method which originally accepts 2 arguments for `name` and `value`.
  18487. * The wrapped function then allows "flexible" value setting of either:
  18488. *
  18489. * - `name` and `value` as 2 arguments
  18490. * - one single object argument with multiple key - value pairs
  18491. *
  18492. * For example:
  18493. *
  18494. * var setValue = Ext.Function.flexSetter(function(name, value) {
  18495. * this[name] = value;
  18496. * });
  18497. *
  18498. * // Afterwards
  18499. * // Setting a single name - value
  18500. * setValue('name1', 'value1');
  18501. *
  18502. * // Settings multiple name - value pairs
  18503. * setValue({
  18504. * name1: 'value1',
  18505. * name2: 'value2',
  18506. * name3: 'value3'
  18507. * });
  18508. *
  18509. * @param {Function} setter The single value setter method.
  18510. * @param {String} setter.name The name of the value being set.
  18511. * @param {Object} setter.value The value being set.
  18512. * @return {Function}
  18513. */
  18514. flexSetter: function(setter) {
  18515. return function(name, value) {
  18516. var k, i;
  18517. if (name !== null) {
  18518. if (typeof name !== 'string') {
  18519. for (k in name) {
  18520. if (name.hasOwnProperty(k)) {
  18521. setter.call(this, k, name[k]);
  18522. }
  18523. }
  18524. if (Ext.enumerables) {
  18525. for (i = Ext.enumerables.length; i--; ) {
  18526. k = Ext.enumerables[i];
  18527. if (name.hasOwnProperty(k)) {
  18528. setter.call(this, k, name[k]);
  18529. }
  18530. }
  18531. }
  18532. } else {
  18533. setter.call(this, name, value);
  18534. }
  18535. }
  18536. return this;
  18537. };
  18538. },
  18539. /**
  18540. * Create a new function from the provided `fn`, change `this` to the provided scope,
  18541. * optionally overrides arguments for the call. Defaults to the arguments passed by
  18542. * the caller.
  18543. *
  18544. * {@link Ext#bind Ext.bind} is alias for {@link Ext.Function#bind Ext.Function.bind}
  18545. *
  18546. * **NOTE:** This method is similar to the native `bind()` method. The major difference
  18547. * is in the way the parameters are passed. This method expects an array of parameters,
  18548. * and if supplied, it does not automatically pass forward parameters from the bound
  18549. * function:
  18550. *
  18551. * function foo (a, b, c) {
  18552. * console.log(a, b, c);
  18553. * }
  18554. *
  18555. * var nativeFn = foo.bind(this, 1, 2);
  18556. * var extFn = Ext.Function.bind(foo, this, [1, 2]);
  18557. *
  18558. * nativeFn(3); // 1, 2, 3
  18559. * extFn(3); // 1, 2, undefined
  18560. *
  18561. * This method is unavailable natively on IE8 and IE/Quirks but Ext JS provides a
  18562. * "polyfill" to emulate the important features of the standard `bind` method. In
  18563. * particular, the polyfill only provides binding of "this" and optional arguments.
  18564. *
  18565. * @param {Function} fn The function to delegate.
  18566. * @param {Object} [scope] The scope (`this` reference) in which the function
  18567. * is executed.
  18568. * **If omitted, defaults to the global environment object (usually the browser `window`).**
  18569. * @param {Array} [args] Overrides arguments for the call. (Defaults to
  18570. * the arguments passed by the caller).
  18571. * @param {Boolean/Number} [appendArgs] if `true` the `args` are appended to the
  18572. * arguments passed to the returned wrapper (by default these arguments are ignored).
  18573. * If a number then the `args` are inserted at the specified position.
  18574. * @return {Function} The bound wrapper function.
  18575. */
  18576. bind: function(fn, scope, args, appendArgs) {
  18577. // Function.prototype.bind is polyfilled in IE8, otherwise native
  18578. if (arguments.length <= 2) {
  18579. return fn.bind(scope);
  18580. }
  18581. var method = fn;
  18582. // eslint-disable-line vars-on-top
  18583. return function() {
  18584. var callArgs = args || arguments;
  18585. if (appendArgs === true) {
  18586. callArgs = slice.call(arguments, 0);
  18587. callArgs = callArgs.concat(args);
  18588. } else if (typeof appendArgs === 'number') {
  18589. callArgs = slice.call(arguments, 0);
  18590. // copy arguments first
  18591. Ext.Array.insert(callArgs, appendArgs, args);
  18592. }
  18593. return method.apply(scope || global, callArgs);
  18594. };
  18595. },
  18596. /**
  18597. * Captures the given parameters for a later call to `Ext.callback`. This binding is
  18598. * most useful for resolving scopes for example to an `Ext.app.ViewController`.
  18599. *
  18600. * The arguments match that of `Ext.callback` except for the `args` which, if provided
  18601. * to this method, are prepended to any arguments supplied by the eventual caller of
  18602. * the returned function.
  18603. *
  18604. * @return {Function} A function that, when called, uses `Ext.callback` to call the
  18605. * captured `callback`.
  18606. * @since 5.0.0
  18607. */
  18608. bindCallback: function(callback, scope, args, delay, caller) {
  18609. return function() {
  18610. var a = slice.call(arguments);
  18611. return Ext.callback(callback, scope, args ? args.concat(a) : a, delay, caller);
  18612. };
  18613. },
  18614. /**
  18615. * Create a new function from the provided `fn`, the arguments of which are pre-set
  18616. * to `args`. New arguments passed to the newly created callback when it's invoked
  18617. * are appended after the pre-set ones.
  18618. * This is especially useful when creating callbacks.
  18619. *
  18620. * For example:
  18621. *
  18622. * var originalFunction = function(){
  18623. * alert(Ext.Array.from(arguments).join(' '));
  18624. * };
  18625. *
  18626. * var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
  18627. *
  18628. * callback(); // alerts 'Hello World'
  18629. * callback('by Me'); // alerts 'Hello World by Me'
  18630. *
  18631. * {@link Ext#pass Ext.pass} is alias for {@link Ext.Function#pass Ext.Function.pass}
  18632. *
  18633. * @param {Function} fn The original function.
  18634. * @param {Array} args The arguments to pass to new callback.
  18635. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  18636. * is executed.
  18637. * @return {Function} The new callback function.
  18638. */
  18639. pass: function(fn, args, scope) {
  18640. if (!Ext.isArray(args)) {
  18641. if (Ext.isIterable(args)) {
  18642. args = Ext.Array.clone(args);
  18643. } else {
  18644. args = args !== undefined ? [
  18645. args
  18646. ] : [];
  18647. }
  18648. }
  18649. return function() {
  18650. var fnArgs = args.slice();
  18651. fnArgs.push.apply(fnArgs, arguments);
  18652. return fn.apply(scope || this, fnArgs);
  18653. };
  18654. },
  18655. /**
  18656. * Create an alias to the provided method property with name `methodName` of `object`.
  18657. * Note that the execution scope will still be bound to the provided `object` itself.
  18658. *
  18659. * @param {Object/Function} object
  18660. * @param {String} methodName
  18661. * @return {Function} aliasFn
  18662. */
  18663. alias: function(object, methodName) {
  18664. return function() {
  18665. return object[methodName].apply(object, arguments);
  18666. };
  18667. },
  18668. /**
  18669. * Create a "clone" of the provided method. The returned method will call the given
  18670. * method passing along all arguments and the "this" pointer and return its result.
  18671. *
  18672. * @param {Function} method
  18673. * @return {Function} cloneFn
  18674. */
  18675. clone: function(method) {
  18676. var newMethod, prop;
  18677. newMethod = function() {
  18678. return method.apply(this, arguments);
  18679. };
  18680. for (prop in method) {
  18681. if (method.hasOwnProperty(prop)) {
  18682. newMethod[prop] = method[prop];
  18683. }
  18684. }
  18685. return newMethod;
  18686. },
  18687. /**
  18688. * Creates an interceptor function. The passed function is called before the original one.
  18689. * If it returns false, the original one is not called. The resulting function returns
  18690. * the results of the original function. The passed function is called with the parameters
  18691. * of the original function. Example usage:
  18692. *
  18693. * var sayHi = function(name){
  18694. * alert('Hi, ' + name);
  18695. * };
  18696. *
  18697. * sayHi('Fred'); // alerts "Hi, Fred"
  18698. *
  18699. * // create a new function that validates input without
  18700. * // directly modifying the original function:
  18701. * var sayHiToFriend = Ext.Function.createInterceptor(sayHi, function(name){
  18702. * return name === 'Brian';
  18703. * });
  18704. *
  18705. * sayHiToFriend('Fred'); // no alert
  18706. * sayHiToFriend('Brian'); // alerts "Hi, Brian"
  18707. *
  18708. * @param {Function} origFn The original function.
  18709. * @param {Function} newFn The function to call before the original.
  18710. * @param {Object} [scope] The scope (`this` reference) in which the passed function
  18711. * is executed. **If omitted, defaults to the scope in which the original function
  18712. * is called or the browser window.**
  18713. * @param {Object} [returnValue=null] The value to return if the passed function return
  18714. * `false`.
  18715. * @return {Function} The new function.
  18716. */
  18717. createInterceptor: function(origFn, newFn, scope, returnValue) {
  18718. if (!Ext.isFunction(newFn)) {
  18719. return origFn;
  18720. } else {
  18721. returnValue = Ext.isDefined(returnValue) ? returnValue : null;
  18722. return function() {
  18723. var me = this,
  18724. args = arguments;
  18725. return (newFn.apply(scope || me || global, args) !== false) ? origFn.apply(me || global, args) : returnValue;
  18726. };
  18727. }
  18728. },
  18729. /**
  18730. * Creates a delegate (callback) which, when called, executes after a specific delay.
  18731. *
  18732. * @param {Function} fn The function which will be called on a delay when the returned
  18733. * function is called. Optionally, a replacement (or additional) argument list
  18734. * may be specified.
  18735. * @param {Number} delay The number of milliseconds to defer execution by whenever called.
  18736. * @param {Object} scope (optional) The scope (`this` reference) used by the function
  18737. * at execution time.
  18738. * @param {Array} args (optional) Override arguments for the call.
  18739. * (Defaults to the arguments passed by the caller)
  18740. * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args
  18741. * instead of overriding, if a number the args are inserted at the specified position.
  18742. * @return {Function} A function which, when called, executes the original function
  18743. * after the specified delay.
  18744. */
  18745. createDelayed: function(fn, delay, scope, args, appendArgs) {
  18746. var boundFn = fn;
  18747. if (scope || args) {
  18748. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18749. }
  18750. return function() {
  18751. var me = this,
  18752. args = slice.call(arguments),
  18753. timerFn, timerId;
  18754. var timer;
  18755. // eslint-disable-line vars-on-top, one-var
  18756. timerFn = function() {
  18757. Ext.elevate(boundFn, me, args, timer);
  18758. };
  18759. // eslint-disable-line comma-style
  18760. timerId = setTimeout(timerFn, delay);
  18761. timerFn.$origFn = fn.$origFn || fn;
  18762. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18763. timer = Ext.Timer.created('timeout', timerId, {
  18764. type: 'createDelayed',
  18765. fn: fn,
  18766. timerFn: timerFn
  18767. });
  18768. };
  18769. },
  18770. /**
  18771. * Calls function `fn` after the number of milliseconds specified, optionally with
  18772. * a specific `scope` (`this` pointer).
  18773. *
  18774. * Example usage:
  18775. *
  18776. * var sayHi = function(name) {
  18777. * alert('Hi, ' + name);
  18778. * }
  18779. *
  18780. * // executes immediately:
  18781. * sayHi('Fred');
  18782. *
  18783. * // executes after 2 seconds:
  18784. * Ext.defer(sayHi, 2000, this, ['Fred']);
  18785. *
  18786. * The following syntax is useful for scheduling anonymous functions:
  18787. *
  18788. * Ext.defer(function() {
  18789. * alert('Anonymous');
  18790. * }, 100);
  18791. *
  18792. * NOTE: The `Ext.Function.defer()` method is an alias for `Ext.defer()`.
  18793. *
  18794. * @param {Function} fn The function to defer.
  18795. * @param {Number} millis The number of milliseconds for the `setTimeout` call
  18796. * (if less than or equal to 0 the function is executed immediately).
  18797. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  18798. * is executed. **If omitted, defaults to the browser window.**
  18799. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments passed
  18800. * by the caller.
  18801. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
  18802. * instead of overriding, or, if a number, then the args are inserted at the specified
  18803. * position.
  18804. * @return {Number} The timeout id that can be used with `Ext.undefer`.
  18805. */
  18806. defer: function(fn, millis, scope, args, appendArgs) {
  18807. var timerId = 0,
  18808. timerFn, boundFn;
  18809. var timer;
  18810. // eslint-disable-line vars-on-top, one-var
  18811. if (!scope && !args && !appendArgs) {
  18812. boundFn = fn;
  18813. } else {
  18814. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18815. }
  18816. if (millis > 0) {
  18817. timerFn = function() {
  18818. Ext.elevate(boundFn, null, null, timer);
  18819. };
  18820. // eslint-disable-line comma-style
  18821. timerId = setTimeout(timerFn, millis);
  18822. timerFn.$origFn = fn.$origFn || fn;
  18823. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18824. timer = Ext.Timer.created('timeout', timerId, {
  18825. type: 'defer',
  18826. fn: fn,
  18827. timerFn: timerFn
  18828. });
  18829. } else {
  18830. boundFn();
  18831. }
  18832. return timerId;
  18833. },
  18834. /**
  18835. * Calls the function `fn` repeatedly at a given interval, optionally with a
  18836. * specific `scope` (`this` pointer).
  18837. *
  18838. * var sayHi = function(name) {
  18839. * console.log('Hi, ' + name);
  18840. * }
  18841. *
  18842. * // executes every 2 seconds:
  18843. * var timerId = Ext.interval(sayHi, 2000, this, ['Fred']);
  18844. *
  18845. * The timer is stopped by:
  18846. *
  18847. * Ext.uninterval(timerId);
  18848. *
  18849. * NOTE: The `Ext.Function.interval()` method is an alias for `Ext.interval()`.
  18850. *
  18851. * @param {Function} fn The function to defer.
  18852. * @param {Number} millis The number of milliseconds for the `setInterval` call
  18853. * @param {Object} scope (optional) The scope (`this` reference) in which the function
  18854. * is executed. **If omitted, defaults to the browser window.**
  18855. * @param {Array} [args] Overrides arguments for the call. Defaults to the arguments
  18856. * passed by the caller.
  18857. * @param {Boolean/Number} [appendArgs=false] If `true` args are appended to call args
  18858. * instead of overriding, or, if a number, then the args are inserted at the specified
  18859. * position.
  18860. * @return {Number} The interval id that can be used with `Ext.uninterval`.
  18861. */
  18862. interval: function(fn, millis, scope, args, appendArgs) {
  18863. var timerFn, timerId, boundFn;
  18864. var timer;
  18865. // eslint-disable-line vars-on-top, one-var
  18866. boundFn = Ext.Function.bind(fn, scope, args, appendArgs);
  18867. timerFn = function() {
  18868. Ext.elevate(boundFn, null, null, timer);
  18869. };
  18870. // eslint-disable-line comma-style
  18871. timerId = setInterval(timerFn, millis);
  18872. timerFn.$origFn = boundFn.$origFn || fn;
  18873. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18874. timer = Ext.Timer.created('interval', timerId, {
  18875. type: 'interval',
  18876. fn: fn,
  18877. timerFn: timerFn
  18878. });
  18879. return timerId;
  18880. },
  18881. /**
  18882. * Create a combined function call sequence of the original function + the passed function.
  18883. * The resulting function returns the results of the original function.
  18884. * The passed function is called with the parameters of the original function.
  18885. * Example usage:
  18886. *
  18887. * var sayHi = function(name){
  18888. * alert('Hi, ' + name);
  18889. * };
  18890. *
  18891. * sayHi('Fred'); // alerts "Hi, Fred"
  18892. *
  18893. * var sayGoodbye = Ext.Function.createSequence(sayHi, function(name){
  18894. * alert('Bye, ' + name);
  18895. * });
  18896. *
  18897. * sayGoodbye('Fred'); // both alerts show
  18898. *
  18899. * @param {Function} originalFn The original function.
  18900. * @param {Function} newFn The function to sequence.
  18901. * @param {Object} [scope] The scope (`this` reference) in which the passed function
  18902. * is executed. If omitted, defaults to the scope in which the original function is called
  18903. * or the default global environment object (usually the browser window).
  18904. * @return {Function} The new function.
  18905. */
  18906. createSequence: function(originalFn, newFn, scope) {
  18907. if (!newFn) {
  18908. return originalFn;
  18909. } else {
  18910. return function() {
  18911. var result = originalFn.apply(this, arguments);
  18912. newFn.apply(scope || this, arguments);
  18913. return result;
  18914. };
  18915. }
  18916. },
  18917. /**
  18918. * Creates a delegate function, optionally with a bound scope which, when called, buffers
  18919. * the execution of the passed function for the configured number of milliseconds.
  18920. * If called again within that period, the impending invocation will be canceled, and the
  18921. * timeout period will begin again.
  18922. *
  18923. * @param {Function} fn The function to invoke on a buffered timer.
  18924. * @param {Number} buffer The number of milliseconds by which to buffer the invocation
  18925. * of the function.
  18926. * @param {Object} [scope] The scope (`this` reference) in which.
  18927. * the passed function is executed. If omitted, defaults to the scope specified
  18928. * by the caller.
  18929. * @param {Array} [args] Override arguments for the call. Defaults to the arguments
  18930. * passed by the caller.
  18931. * @return {Function} A function which invokes the passed function after buffering
  18932. * for the specified time.
  18933. */
  18934. createBuffered: function(fn, buffer, scope, args) {
  18935. var timerId,
  18936. result = function() {
  18937. var callArgs = args || slice.call(arguments, 0),
  18938. me = scope || this,
  18939. timerFn;
  18940. var timer;
  18941. // eslint-disable-line vars-on-top, one-var
  18942. if (timerId) {
  18943. Ext.undefer(timerId);
  18944. }
  18945. timerFn = function() {
  18946. Ext.elevate(fn, me, callArgs, timer);
  18947. };
  18948. // eslint-disable-line comma-style
  18949. result.timer = timerId = setTimeout(timerFn, buffer);
  18950. timerFn.$origFn = fn.$origFn || fn;
  18951. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18952. timer = Ext.Timer.created('timeout', timerId, {
  18953. type: 'createBuffered',
  18954. fn: fn,
  18955. timerFn: timerFn
  18956. });
  18957. };
  18958. return result;
  18959. },
  18960. /**
  18961. * Creates a wrapped function that, when invoked, defers execution until the next
  18962. * animation frame
  18963. * @private
  18964. * @param {Function} fn The function to call.
  18965. * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
  18966. * Defaults to the window object.
  18967. * @param {Array} [args] The argument list to pass to the function.
  18968. * @param {Number} [queueStrategy=3] A bit flag that indicates how multiple calls to
  18969. * the returned function within the same animation frame should be handled.
  18970. *
  18971. * - 1: All calls will be queued - FIFO order
  18972. * - 2: Only the first call will be queued
  18973. * - 3: The last call will replace all previous calls
  18974. *
  18975. * @return {Function}
  18976. */
  18977. createAnimationFrame: function(fn, scope, args, queueStrategy) {
  18978. var boundFn, timerId;
  18979. queueStrategy = queueStrategy || 3;
  18980. boundFn = function() {
  18981. var timerFn,
  18982. callArgs = args || slice.call(arguments, 0);
  18983. scope = scope || this;
  18984. if (queueStrategy === 3 && timerId) {
  18985. ExtFunction.cancelAnimationFrame(timerId);
  18986. }
  18987. if ((queueStrategy & 1) || !timerId) {
  18988. timerFn = function() {
  18989. timerId = boundFn.timerId = null;
  18990. fn.apply(scope, callArgs);
  18991. };
  18992. timerFn.$origFn = fn.$origFn || fn;
  18993. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  18994. timerId = boundFn.timerId = ExtFunction.requestAnimationFrame(timerFn);
  18995. }
  18996. };
  18997. return boundFn;
  18998. },
  18999. /**
  19000. * @private
  19001. * Schedules the passed function to be called on the next animation frame.
  19002. * @param {Function} fn The function to call.
  19003. * @param {Object} [scope] The scope (`this` reference) in which the function is executed.
  19004. * Defaults to the window object.
  19005. * @param {Mixed[]} [args] The argument list to pass to the function.
  19006. *
  19007. * @return {Number} Timer id for the new animation frame to use when canceling it.
  19008. */
  19009. requestAnimationFrame: function(fn, scope, args) {
  19010. var id = ++idSource,
  19011. // Ids start at 1
  19012. handler = slice.call(arguments, 0);
  19013. handler[3] = id;
  19014. animFrameMap[id] = 1;
  19015. // A flag to indicate that the timer exists
  19016. Ext.Timer.created('raf', id, {
  19017. type: 'raf',
  19018. fn: fn
  19019. });
  19020. // We might be in fireHandlers at this moment but this new entry will not
  19021. // be executed until the next frame
  19022. animFrameHandlers.push(handler);
  19023. if (!animFrameId) {
  19024. animFrameId = requestAnimFrame(fireElevatedHandlers);
  19025. }
  19026. return id;
  19027. },
  19028. cancelAnimationFrame: function(id) {
  19029. // Don't remove any handlers from animFrameHandlers array, because
  19030. // the might be in use at the moment (when cancelAnimationFrame is called).
  19031. // Just remove the handler id from the map so it will not be executed
  19032. delete animFrameMap[id];
  19033. Ext.Timer.cancel('raf', id);
  19034. },
  19035. /**
  19036. * Creates a throttled version of the passed function which, when called repeatedly and
  19037. * rapidly, invokes the passed function only after a certain interval has elapsed since the
  19038. * previous invocation.
  19039. *
  19040. * This is useful for wrapping functions which may be called repeatedly, such as
  19041. * a handler of a mouse move event when the processing is expensive.
  19042. *
  19043. * @param {Function} fn The function to execute at a regular time interval.
  19044. * @param {Number} interval The interval in milliseconds on which the passed function
  19045. * is executed.
  19046. * @param {Object} [scope] The scope (`this` reference) in which
  19047. * the passed function is executed. If omitted, defaults to the scope specified
  19048. * by the caller.
  19049. * @return {Function} A function which invokes the passed function at the specified
  19050. * interval.
  19051. */
  19052. createThrottled: function(fn, interval, scope) {
  19053. var lastCallTime = 0,
  19054. elapsed, lastArgs, timerId,
  19055. execute = function() {
  19056. fn.apply(scope, lastArgs);
  19057. lastCallTime = Ext.now();
  19058. lastArgs = timerId = null;
  19059. };
  19060. execute.$origFn = fn.$origFn || fn;
  19061. execute.$skipTimerCheck = execute.$origFn.$skipTimerCheck;
  19062. return function() {
  19063. // Use scope of last call unless the creator specified a scope
  19064. if (!scope) {
  19065. scope = this;
  19066. }
  19067. elapsed = Ext.now() - lastCallTime;
  19068. lastArgs = Ext.Array.slice(arguments);
  19069. // If this is the first invocation, or the throttle interval has been reached,
  19070. // clear any pending invocation, and call the target function now.
  19071. if (elapsed >= interval) {
  19072. Ext.undefer(timerId);
  19073. execute();
  19074. }
  19075. // Throttle interval has not yet been reached. Only set the timer to fire
  19076. // if not already set.
  19077. else if (!timerId) {
  19078. timerId = Ext.defer(execute, interval - elapsed);
  19079. }
  19080. };
  19081. },
  19082. /**
  19083. * Wraps the passed function in a barrier function which will call the passed function
  19084. * after the passed number of invocations.
  19085. * @param {Number} count The number of invocations which will result in the calling
  19086. * of the passed function.
  19087. * @param {Function} fn The function to call after the required number of invocations.
  19088. * @param {Object} scope The scope (`this` reference) in which the function will be called.
  19089. */
  19090. createBarrier: function(count, fn, scope) {
  19091. var barrierFn = function() {
  19092. if (!--count) {
  19093. fn.apply(scope, arguments);
  19094. }
  19095. };
  19096. barrierFn.$origFn = fn.$origFn || fn;
  19097. barrierFn.$skipTimerCheck = barrierFn.$origFn.$skipTimerCheck;
  19098. return barrierFn;
  19099. },
  19100. /**
  19101. * Adds behavior to an existing method that is executed before the
  19102. * original behavior of the function. For example:
  19103. *
  19104. * var soup = {
  19105. * contents: [],
  19106. * add: function(ingredient) {
  19107. * this.contents.push(ingredient);
  19108. * }
  19109. * };
  19110. * Ext.Function.interceptBefore(soup, "add", function(ingredient){
  19111. * if (!this.contents.length && ingredient !== "water") {
  19112. * // Always add water to start with
  19113. * this.contents.push("water");
  19114. * }
  19115. * });
  19116. * soup.add("onions");
  19117. * soup.add("salt");
  19118. * soup.contents; // will contain: water, onions, salt
  19119. *
  19120. * @param {Object} object The target object
  19121. * @param {String} methodName Name of the method to override
  19122. * @param {Function} fn Function with the new behavior. It will
  19123. * be called with the same arguments as the original method. The
  19124. * return value of this function will be the return value of the
  19125. * new method.
  19126. * @param {Object} [scope] The scope to execute the interceptor function.
  19127. * Defaults to the object.
  19128. * @return {Function} The new function just created.
  19129. */
  19130. interceptBefore: function(object, methodName, fn, scope) {
  19131. var method = object[methodName] || Ext.emptyFn;
  19132. return (object[methodName] = function() {
  19133. var ret = fn.apply(scope || this, arguments);
  19134. method.apply(this, arguments);
  19135. return ret;
  19136. });
  19137. },
  19138. /**
  19139. * Adds behavior to an existing method that is executed after the
  19140. * original behavior of the function. For example:
  19141. *
  19142. * var soup = {
  19143. * contents: [],
  19144. * add: function(ingredient) {
  19145. * this.contents.push(ingredient);
  19146. * }
  19147. * };
  19148. * Ext.Function.interceptAfter(soup, "add", function(ingredient){
  19149. * // Always add a bit of extra salt
  19150. * this.contents.push("salt");
  19151. * });
  19152. * soup.add("water");
  19153. * soup.add("onions");
  19154. * soup.contents; // will contain: water, salt, onions, salt
  19155. *
  19156. * @param {Object} object The target object
  19157. * @param {String} methodName Name of the method to override
  19158. * @param {Function} fn Function with the new behavior. It will
  19159. * be called with the same arguments as the original method. The
  19160. * return value of this function will be the return value of the
  19161. * new method.
  19162. * @param {Object} [scope] The scope to execute the interceptor function.
  19163. * Defaults to the object.
  19164. * @return {Function} The new function just created.
  19165. */
  19166. interceptAfter: function(object, methodName, fn, scope) {
  19167. var method = object[methodName] || Ext.emptyFn;
  19168. return (object[methodName] = function() {
  19169. method.apply(this, arguments);
  19170. return fn.apply(scope || this, arguments);
  19171. });
  19172. },
  19173. interceptAfterOnce: function(object, methodName, fn, scope) {
  19174. var origMethod = object[methodName],
  19175. newMethod;
  19176. newMethod = function() {
  19177. var ret;
  19178. if (origMethod) {
  19179. origMethod.apply(this, arguments);
  19180. }
  19181. ret = fn.apply(scope || this, arguments);
  19182. object[methodName] = origMethod;
  19183. object = methodName = fn = scope = origMethod = newMethod = null;
  19184. return ret;
  19185. };
  19186. object[methodName] = newMethod;
  19187. return newMethod;
  19188. },
  19189. makeCallback: function(callback, scope) {
  19190. if (!scope[callback]) {
  19191. if (scope.$className) {
  19192. Ext.raise('No method "' + callback + '" on ' + scope.$className);
  19193. }
  19194. Ext.raise('No method "' + callback + '"');
  19195. }
  19196. return function() {
  19197. return scope[callback].apply(scope, arguments);
  19198. };
  19199. },
  19200. /**
  19201. * Returns a wrapper function that caches the return value for previously
  19202. * processed function argument(s).
  19203. *
  19204. * For example:
  19205. *
  19206. * function factorial (value) {
  19207. * var ret = value;
  19208. *
  19209. * while (--value > 1) {
  19210. * ret *= value;
  19211. * }
  19212. *
  19213. * return ret;
  19214. * }
  19215. *
  19216. * Each call to `factorial` will loop and multiply to produce the answer. Using
  19217. * this function we can wrap the above and cache its answers:
  19218. *
  19219. * factorial = Ext.Function.memoize(factorial);
  19220. *
  19221. * The returned function operates in the same manner as before, but results are
  19222. * stored in a cache to avoid calling the wrapped function when given the same
  19223. * arguments.
  19224. *
  19225. * var x = factorial(20); // first time; call real factorial()
  19226. * var y = factorial(20); // second time; return value from first call
  19227. *
  19228. * To support multi-argument methods, you will need to provide a `hashFn`.
  19229. *
  19230. * function permutation (n, k) {
  19231. * return factorial(n) / factorial(n - k);
  19232. * }
  19233. *
  19234. * permutation = Ext.Function.memoize(permutation, null, function(n, k) {
  19235. * n + '-' + k;
  19236. * });
  19237. *
  19238. * In this case, the `memoize` of `factorial` is sufficient optimization, but the
  19239. * example is simply to illustrate how to generate a unique key for an expensive,
  19240. * multi-argument method.
  19241. *
  19242. * **IMPORTANT**: This cache is unbounded so be cautious of memory leaks if the
  19243. * `memoize`d function is kept indefinitely or is given an unbounded set of
  19244. * possible arguments.
  19245. *
  19246. * @param {Function} fn Function to wrap.
  19247. * @param {Object} scope Optional scope in which to execute the wrapped function.
  19248. * @param {Function} hashFn Optional function used to compute a hash key for
  19249. * storing the result, based on the arguments to the original function.
  19250. * @return {Function} The caching wrapper function.
  19251. * @since 6.0.0
  19252. */
  19253. memoize: function(fn, scope, hashFn) {
  19254. var memo = {},
  19255. isFunc = hashFn && Ext.isFunction(hashFn);
  19256. return function(value) {
  19257. var key = isFunc ? hashFn.apply(scope, arguments) : value;
  19258. if (!(key in memo)) {
  19259. memo[key] = fn.apply(scope, arguments);
  19260. }
  19261. return memo[key];
  19262. };
  19263. },
  19264. _stripCommentRe: /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g,
  19265. toCode: function(fn) {
  19266. var s = fn ? fn.toString() : '';
  19267. s = s.replace(ExtFunction._stripCommentRe, '');
  19268. return s;
  19269. },
  19270. // This is useful for unit testing so we can force handlers which have been deferred
  19271. // to the next animation frame to run immediately
  19272. fireElevatedHandlers: function() {
  19273. // eslint-disable-line comma-style
  19274. fireElevatedHandlers();
  19275. }
  19276. };
  19277. // ExtFunction
  19278. /**
  19279. * @member Ext
  19280. * @method asap
  19281. * Schedules the specified callback function to be executed on the next turn of the
  19282. * event loop. Where available, this method uses the browser's `setImmediate` API. If
  19283. * not available, this method substitutes `setTimeout(0)`. Though not a perfect
  19284. * replacement for `setImmediate` it is sufficient for many use cases.
  19285. *
  19286. * For more details see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate).
  19287. *
  19288. * @param {Function} fn Callback function.
  19289. * @param {Object} [scope] The scope for the callback (`this` pointer).
  19290. * @param {Mixed[]} [parameters] Additional parameters to pass to `fn`.
  19291. * @return {Number} A cancellation id for `{@link Ext#unasap}`.
  19292. */
  19293. Ext.asap = hasImmediate ? function(fn, scope, parameters) {
  19294. var boundFn = fn,
  19295. timerFn, timerId;
  19296. var timer;
  19297. // eslint-disable-line vars-on-top, one-var
  19298. if (scope != null || parameters != null) {
  19299. boundFn = ExtFunction.bind(fn, scope, parameters);
  19300. }
  19301. timerFn = function() {
  19302. Ext.elevate(boundFn, null, null, timer);
  19303. };
  19304. // eslint-disable-line comma-style
  19305. timerId = setImmediate(timerFn);
  19306. timerFn.$origFn = fn.$origFn || fn;
  19307. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19308. timer = Ext.Timer.created('asap', timerId, {
  19309. type: 'asap',
  19310. fn: fn,
  19311. timerFn: timerFn
  19312. });
  19313. return timerId;
  19314. } : function(fn, scope, parameters) {
  19315. var boundFn = fn,
  19316. timerFn, timerId;
  19317. var timer;
  19318. // eslint-disable-line vars-on-top, one-var
  19319. if (scope != null || parameters != null) {
  19320. boundFn = ExtFunction.bind(fn, scope, parameters);
  19321. }
  19322. timerFn = function() {
  19323. Ext.elevate(boundFn, null, null, timer);
  19324. };
  19325. // eslint-disable-line comma-style
  19326. timerId = setTimeout(timerFn, 0, true);
  19327. timerFn.$origFn = fn.$origFn || fn;
  19328. timerFn.$skipTimerCheck = timerFn.$origFn.$skipTimerCheck;
  19329. timer = Ext.Timer.created('timeout', timerId, {
  19330. type: 'asap',
  19331. fn: fn,
  19332. timerFn: timerFn
  19333. });
  19334. return timerId;
  19335. };
  19336. /**
  19337. * @member Ext
  19338. * @method unasap
  19339. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  19340. *
  19341. * var timerId = Ext.asap(me.method, me);
  19342. * ...
  19343. *
  19344. * if (nevermind) {
  19345. * Ext.unasap(timerId);
  19346. * }
  19347. *
  19348. * This method always returns `null` to enable simple cleanup:
  19349. *
  19350. * timerId = Ext.unasap(timerId); // safe even if !timerId
  19351. *
  19352. * @param {Number} id The id returned by `{@link Ext#asap}`.
  19353. * @return {Object} Always returns `null`.
  19354. */
  19355. Ext.unasap = hasImmediate ? function(id) {
  19356. if (id) {
  19357. clearImmediate(id);
  19358. Ext.Timer.cancel('asap', id);
  19359. }
  19360. return null;
  19361. } : function(id) {
  19362. return Ext.undefer(id);
  19363. };
  19364. /**
  19365. * @member Ext
  19366. * @method asapCancel
  19367. * Cancels a previously scheduled call to `{@link Ext#asap}`.
  19368. * @param {Number} id The id returned by `{@link Ext#asap}`.
  19369. * @deprecated 6.5.1 Use `Ext.unasap` instead.
  19370. */
  19371. Ext.asapCancel = function(id) {
  19372. return Ext.unasap(id);
  19373. };
  19374. /**
  19375. * @method defer
  19376. * @member Ext
  19377. * @inheritdoc Ext.Function#defer
  19378. */
  19379. Ext.defer = ExtFunction.defer;
  19380. /**
  19381. * @member Ext
  19382. * @method undefer
  19383. * Cancels a previously scheduled call to `{@link Ext#defer}`.
  19384. *
  19385. * var timerId = Ext.defer(me.method, me);
  19386. * ...
  19387. *
  19388. * if (nevermind) {
  19389. * Ext.undefer(timerId);
  19390. * }
  19391. *
  19392. * This method always returns `null` to enable simple cleanup:
  19393. *
  19394. * timerId = Ext.undefer(timerId); // safe even if !timerId
  19395. *
  19396. * @param {Number} id The id returned by `{@link Ext#defer}`.
  19397. */
  19398. Ext.undefer = function(id) {
  19399. if (id) {
  19400. clearTimeout(id);
  19401. Ext.Timer.cancel('timeout', id);
  19402. }
  19403. return null;
  19404. };
  19405. /**
  19406. * @method interval
  19407. * @member Ext
  19408. * @inheritdoc Ext.Function#interval
  19409. */
  19410. Ext.interval = ExtFunction.interval;
  19411. /**
  19412. * @member Ext
  19413. * @method uninterval
  19414. * Cancels a previously scheduled call to `{@link Ext#interval}`.
  19415. *
  19416. * var timerId = Ext.interval(me.method, me);
  19417. * ...
  19418. *
  19419. * if (nevermind) {
  19420. * Ext.uninterval(timerId);
  19421. * }
  19422. *
  19423. * This method always returns `null` to enable simple cleanup:
  19424. *
  19425. * timerId = Ext.uninterval(timerId); // safe even if !timerId
  19426. *
  19427. * @param {Number} id The id returned by `{@link Ext#interval}`.
  19428. */
  19429. Ext.uninterval = function(id) {
  19430. if (id) {
  19431. clearInterval(id);
  19432. Ext.Timer.cancel('interval', id);
  19433. }
  19434. return null;
  19435. };
  19436. /**
  19437. * @method pass
  19438. * @member Ext
  19439. * @inheritdoc Ext.Function#pass
  19440. */
  19441. Ext.pass = ExtFunction.pass;
  19442. /**
  19443. * @method bind
  19444. * @member Ext
  19445. * @inheritdoc Ext.Function#bind
  19446. */
  19447. Ext.bind = ExtFunction.bind;
  19448. Ext.raf = function() {
  19449. return ExtFunction.requestAnimationFrame.apply(ExtFunction, arguments);
  19450. };
  19451. Ext.unraf = function(id) {
  19452. ExtFunction.cancelAnimationFrame(id);
  19453. };
  19454. return ExtFunction;
  19455. })();
  19456. /**
  19457. * @class Ext.Number
  19458. *
  19459. * A collection of useful static methods to deal with numbers
  19460. * @singleton
  19461. */
  19462. Ext.Number = (new function() {
  19463. // jshint ignore:line
  19464. // @define Ext.lang.Number
  19465. // @define Ext.Number
  19466. // @require Ext
  19467. var ExtNumber = this,
  19468. isToFixedBroken = (0.9).toFixed() !== '1',
  19469. math = Math,
  19470. ClipDefault = {
  19471. count: false,
  19472. inclusive: false,
  19473. wrap: true
  19474. };
  19475. // polyfill
  19476. Number.MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(math.pow(2, 53) - 1);
  19477. Number.MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || math.pow(2, 53) - 1;
  19478. Ext.apply(ExtNumber, {
  19479. MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER,
  19480. MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER,
  19481. // No good way to allow "9." w/o allowing "." alone but we use isNaN to reject that
  19482. floatRe: /^[-+]?(?:\d+|\d*\.\d*)(?:[Ee][+-]?\d+)?$/,
  19483. intRe: /^[-+]?\d+(?:[Ee]\+?\d+)?$/,
  19484. Clip: {
  19485. DEFAULT: ClipDefault,
  19486. COUNT: Ext.applyIf({
  19487. count: true
  19488. }, ClipDefault),
  19489. INCLUSIVE: Ext.applyIf({
  19490. inclusive: true
  19491. }, ClipDefault),
  19492. NOWRAP: Ext.applyIf({
  19493. wrap: false
  19494. }, ClipDefault)
  19495. },
  19496. /**
  19497. * Strictly parses the given value and returns the value as a number or `null` if
  19498. * the value is not a number or contains non-numeric pieces.
  19499. * @param {String} value
  19500. * @return {Number}
  19501. * @since 6.5.1
  19502. */
  19503. parseFloat: function(value) {
  19504. if (value === undefined) {
  19505. value = null;
  19506. }
  19507. if (value !== null && typeof value !== 'number') {
  19508. value = String(value);
  19509. value = ExtNumber.floatRe.test(value) ? +value : null;
  19510. if (isNaN(value)) {
  19511. value = null;
  19512. }
  19513. }
  19514. return value;
  19515. },
  19516. /**
  19517. * Strictly parses the given value and returns the value as a number or `null` if
  19518. * the value is not an integer number or contains non-integer pieces.
  19519. * @param {String} value
  19520. * @return {Number}
  19521. * @since 6.5.1
  19522. */
  19523. parseInt: function(value) {
  19524. if (value === undefined) {
  19525. value = null;
  19526. }
  19527. if (typeof value === 'number') {
  19528. value = Math.floor(value);
  19529. } else if (value !== null) {
  19530. value = String(value);
  19531. value = ExtNumber.intRe.test(value) ? +value : null;
  19532. }
  19533. return value;
  19534. },
  19535. binarySearch: function(array, value, begin, end) {
  19536. var middle, midVal;
  19537. if (begin === undefined) {
  19538. begin = 0;
  19539. }
  19540. if (end === undefined) {
  19541. end = array.length;
  19542. }
  19543. --end;
  19544. while (begin <= end) {
  19545. middle = (begin + end) >>> 1;
  19546. // unsigned right shift = Math.floor(x/2)
  19547. midVal = array[middle];
  19548. if (value === midVal) {
  19549. return middle;
  19550. }
  19551. if (midVal < value) {
  19552. begin = middle + 1;
  19553. } else {
  19554. end = middle - 1;
  19555. }
  19556. }
  19557. return begin;
  19558. },
  19559. bisectTuples: function(array, value, index, begin, end) {
  19560. var middle, midVal;
  19561. if (begin === undefined) {
  19562. begin = 0;
  19563. }
  19564. if (end === undefined) {
  19565. end = array.length;
  19566. }
  19567. --end;
  19568. while (begin <= end) {
  19569. middle = (begin + end) >>> 1;
  19570. // unsigned right shift = Math.floor(x/2)
  19571. midVal = array[middle][index];
  19572. if (value === midVal) {
  19573. return middle;
  19574. }
  19575. if (midVal < value) {
  19576. begin = middle + 1;
  19577. } else {
  19578. end = middle - 1;
  19579. }
  19580. }
  19581. return begin;
  19582. },
  19583. /**
  19584. * Coerces a given index into a valid index given a `length`.
  19585. *
  19586. * Negative indexes are interpreted starting at the end of the collection. That is,
  19587. * a value of -1 indicates the last item, or equivalent to `length - 1`.
  19588. *
  19589. * When handling methods that take "begin" and "end" arguments like most array or
  19590. * string methods, this method can be used like so:
  19591. *
  19592. * function foo (array, begin, end) {
  19593. * var range = Ext.Number.clipIndices(array.length, [begin, end]);
  19594. *
  19595. * begin = range[0];
  19596. * end = range[1];
  19597. *
  19598. * // 0 <= begin <= end <= array.length
  19599. *
  19600. * var length = end - begin;
  19601. * }
  19602. *
  19603. * For example:
  19604. *
  19605. * +---+---+---+---+---+---+---+---+
  19606. * | | | | | | | | | length = 8
  19607. * +---+---+---+---+---+---+---+---+
  19608. * 0 1 2 3 4 5 6 7
  19609. * -8 -7 -6 -5 -4 -3 -2 -1
  19610. *
  19611. * console.log(Ext.Number.clipIndices(8, [3, 10]); // logs "[3, 8]"
  19612. * console.log(Ext.Number.clipIndices(8, [-5]); // logs "[3, 8]"
  19613. * console.log(Ext.Number.clipIndices(8, []);
  19614. * console.log(Ext.Number.clipIndices(8, []);
  19615. *
  19616. * @param {Number} length
  19617. * @param {Number[]} indices
  19618. * @param {Object} [options] An object with different option flags.
  19619. * @param {Boolean} [options.count=false] The second number in `indices` is the
  19620. * count not and an index.
  19621. * @param {Boolean} [options.inclusive=false] The second number in `indices` is
  19622. * "inclusive" meaning that the item should be considered in the range. Normally,
  19623. * the second number is considered the first item outside the range or as an
  19624. * "exclusive" bound.
  19625. * @param {Boolean} [options.wrap=true] Wraps negative numbers backwards from the
  19626. * end of the array. Passing `false` simply clips negative index values at 0.
  19627. * @return {Number[]} The normalized `[begin, end]` array where `end` is now
  19628. * exclusive such that `length = end - begin`. Both values are between 0 and the
  19629. * given `length` and `end` will not be less-than `begin`.
  19630. */
  19631. clipIndices: function(length, indices, options) {
  19632. var defaultValue = 0,
  19633. // default value for "begin"
  19634. wrap, begin, end, i;
  19635. options = options || ClipDefault;
  19636. wrap = options.wrap;
  19637. indices = indices || [];
  19638. for (i = 0; i < 2; ++i) {
  19639. // names are off on first pass but used this way so things make sense
  19640. // following the loop..
  19641. begin = end;
  19642. // pick up and keep the result from the first loop
  19643. end = indices[i];
  19644. if (end == null) {
  19645. end = defaultValue;
  19646. } else if (i && options.count) {
  19647. end += begin;
  19648. // this is the length not "end" so convert to "end"
  19649. end = (end > length) ? length : end;
  19650. } else {
  19651. if (wrap) {
  19652. end = (end < 0) ? (length + end) : end;
  19653. }
  19654. if (i && options.inclusive) {
  19655. ++end;
  19656. }
  19657. end = (end < 0) ? 0 : ((end > length) ? length : end);
  19658. }
  19659. defaultValue = length;
  19660. }
  19661. // default value for "end"
  19662. // after loop:
  19663. // 0 <= begin <= length (calculated from indices[0])
  19664. // 0 <= end <= length (calculated from indices[1])
  19665. indices[0] = begin;
  19666. indices[1] = (end < begin) ? begin : end;
  19667. return indices;
  19668. },
  19669. /**
  19670. * Checks whether or not the passed number is within a desired range. If the number is
  19671. * already within the range it is returned, otherwise the min or max value is returned
  19672. * depending on which side of the range is exceeded. Note that this method returns the
  19673. * constrained value but does not change the current number.
  19674. * @param {Number} number The number to check
  19675. * @param {Number} min The minimum number in the range
  19676. * @param {Number} max The maximum number in the range
  19677. * @return {Number} The constrained value if outside the range, otherwise the current value
  19678. */
  19679. constrain: function(number, min, max) {
  19680. var x = parseFloat(number);
  19681. // (x < Nan) || (x < undefined) == false
  19682. // same for (x > NaN) || (x > undefined)
  19683. // sadly this is not true of null - (1 > null)
  19684. if (min === null) {
  19685. min = number;
  19686. }
  19687. if (max === null) {
  19688. max = number;
  19689. }
  19690. // Watch out for NaN in Chrome 18
  19691. // V8bug: http://code.google.com/p/v8/issues/detail?id=2056
  19692. // Operators are faster than Math.min/max. See http://jsperf.com/number-constrain
  19693. return (x < min) ? min : ((x > max) ? max : x);
  19694. },
  19695. /**
  19696. * Snaps the passed number between stopping points based upon a passed increment value.
  19697. *
  19698. * The difference between this and {@link #snapInRange} is that {@link #snapInRange} uses
  19699. * the minValue when calculating snap points:
  19700. *
  19701. * // Returns 56 - snap points are zero based
  19702. * r = Ext.Number.snap(56, 2, 55, 65);
  19703. *
  19704. * // Returns 57 - snap points are based from minValue
  19705. * r = Ext.Number.snapInRange(56, 2, 55, 65);
  19706. *
  19707. * @param {Number} value The unsnapped value.
  19708. * @param {Number} increment The increment by which the value must move.
  19709. * @param {Number} minValue The minimum value to which the returned value must be
  19710. * constrained. Overrides the increment.
  19711. * @param {Number} maxValue The maximum value to which the returned value must be
  19712. * constrained. Overrides the increment.
  19713. * @return {Number} The value of the nearest snap target.
  19714. */
  19715. snap: function(value, increment, minValue, maxValue) {
  19716. var m;
  19717. // If no value passed, or minValue was passed and value is less than minValue
  19718. // (anything < undefined is false)
  19719. // Then use the minValue (or zero if the value was undefined)
  19720. if (value === undefined || value < minValue) {
  19721. return minValue || 0;
  19722. }
  19723. if (increment) {
  19724. m = value % increment;
  19725. if (m !== 0) {
  19726. value -= m;
  19727. if (m * 2 >= increment) {
  19728. value += increment;
  19729. } else if (m * 2 < -increment) {
  19730. value -= increment;
  19731. }
  19732. }
  19733. }
  19734. return ExtNumber.constrain(value, minValue, maxValue);
  19735. },
  19736. /**
  19737. * Snaps the passed number between stopping points based upon a passed increment value.
  19738. *
  19739. * The difference between this and {@link #snap} is that {@link #snap} does not use
  19740. * the minValue when calculating snap points:
  19741. *
  19742. * // Returns 56 - snap points are zero based
  19743. * r = Ext.Number.snap(56, 2, 55, 65);
  19744. *
  19745. * // Returns 57 - snap points are based from minValue
  19746. * r = Ext.Number.snapInRange(56, 2, 55, 65);
  19747. *
  19748. * @param {Number} value The unsnapped value.
  19749. * @param {Number} increment The increment by which the value must move.
  19750. * @param {Number} [minValue=0] The minimum value to which the returned value must be
  19751. * constrained.
  19752. * @param {Number} [maxValue=Infinity] The maximum value to which the returned value
  19753. * must be constrained.
  19754. * @return {Number} The value of the nearest snap target.
  19755. */
  19756. snapInRange: function(value, increment, minValue, maxValue) {
  19757. var tween;
  19758. // default minValue to zero
  19759. minValue = (minValue || 0);
  19760. // If value is undefined, or less than minValue, use minValue
  19761. if (value === undefined || value < minValue) {
  19762. return minValue;
  19763. }
  19764. // Calculate how many snap points from the minValue the passed value is.
  19765. if (increment && (tween = ((value - minValue) % increment))) {
  19766. value -= tween;
  19767. tween *= 2;
  19768. if (tween >= increment) {
  19769. value += increment;
  19770. }
  19771. }
  19772. // If constraining within a maximum, ensure the maximum is on a snap point
  19773. if (maxValue !== undefined) {
  19774. if (value > (maxValue = ExtNumber.snapInRange(maxValue, increment, minValue))) {
  19775. value = maxValue;
  19776. }
  19777. }
  19778. return value;
  19779. },
  19780. /**
  19781. * Round a number to the nearest interval.
  19782. * @param {Number} value The value to round.
  19783. * @param {Number} interval The interval to round to.
  19784. * @return {Number} The rounded value.
  19785. *
  19786. * @since 6.2.0
  19787. */
  19788. roundToNearest: function(value, interval) {
  19789. interval = interval || 1;
  19790. return interval * math.round(value / interval);
  19791. },
  19792. /**
  19793. * Rounds a number to the specified precision.
  19794. * @param value
  19795. * @param precision
  19796. * @return {number}
  19797. */
  19798. roundToPrecision: function(value, precision) {
  19799. var factor = math.pow(10, precision || 1);
  19800. return math.round(value * factor) / factor;
  19801. },
  19802. /**
  19803. * Truncates a number to the specified precision,
  19804. * without rounding.
  19805. * @param value
  19806. * @param precision
  19807. * @return {number}
  19808. * @since 6.5.1
  19809. */
  19810. truncateToPrecision: function(value, precision) {
  19811. var factor = math.pow(10, precision || 1);
  19812. return parseInt(value * factor, 10) / factor;
  19813. },
  19814. /**
  19815. * Returns the sign of the given number. See also MDN for Math.sign documentation
  19816. * for the standard method this method emulates.
  19817. * @param {Number} x The number.
  19818. * @return {Number} The sign of the number `x`, indicating whether the number is
  19819. * positive (1), negative (-1) or zero (0).
  19820. * @method sign
  19821. */
  19822. sign: math.sign || function(x) {
  19823. x = +x;
  19824. // force to a Number
  19825. if (x === 0 || isNaN(x)) {
  19826. return x;
  19827. }
  19828. return (x > 0) ? 1 : -1;
  19829. },
  19830. /**
  19831. * Returns the base 10 logarithm of a number.
  19832. * This will use Math.log10, if available (ES6).
  19833. * @param {Number} x The number.
  19834. * @return {Number} Base 10 logarithm of the number 'x'.
  19835. * @method log10
  19836. */
  19837. log10: math.log10 || function(x) {
  19838. return math.log(x) * math.LOG10E;
  19839. },
  19840. /**
  19841. * Determines if two numbers `n1` and `n2` are equal within a given
  19842. * margin of precision `epsilon`.
  19843. * @param {Number} n1 First number.
  19844. * @param {Number} n2 Second number.
  19845. * @param {Number} epsilon Margin of precision.
  19846. * @return {Boolean} `true`, if numbers are equal. `false` otherwise.
  19847. */
  19848. isEqual: function(n1, n2, epsilon) {
  19849. /* eslint-disable-next-line max-len */
  19850. if (!(typeof n1 === 'number' && typeof n2 === 'number' && typeof epsilon === 'number')) {
  19851. Ext.raise("All parameters should be valid numbers.");
  19852. }
  19853. return math.abs(n1 - n2) < epsilon;
  19854. },
  19855. /**
  19856. * Determines if the value passed is a number and also finite.
  19857. * This a Polyfill version of Number.isFinite(),differently than
  19858. * the isFinite() function, this method doesn't convert the parameter to a number.
  19859. * @param {Number} value Number to be tested.
  19860. * @return {Boolean} `true`, if the parameter is a number and finite, `false` otherwise.
  19861. * @since 6.2
  19862. */
  19863. isFinite: Number.isFinite || function(value) {
  19864. return typeof value === 'number' && isFinite(value);
  19865. },
  19866. isInteger: Number.isInteger || function(value) {
  19867. // Add zero get a valid result in a special case where the value is a number string.
  19868. // E.g. '10' + 0 is '100'.
  19869. return ~~(value + 0) === value;
  19870. },
  19871. /**
  19872. * @method
  19873. * Formats a number using fixed-point notation
  19874. * @param {Number} value The number to format
  19875. * @param {Number} precision The number of digits to show after the decimal point
  19876. */
  19877. toFixed: isToFixedBroken ? function(value, precision) {
  19878. var pow;
  19879. precision = precision || 0;
  19880. pow = math.pow(10, precision);
  19881. return (math.round(value * pow) / pow).toFixed(precision);
  19882. } : function(value, precision) {
  19883. return value.toFixed(precision);
  19884. },
  19885. /**
  19886. * Validate that a value is numeric and convert it to a number if necessary.
  19887. * Returns the specified default value if it is not.
  19888. *
  19889. * Ext.Number.from('1.23', 1); // returns 1.23
  19890. * Ext.Number.from('abc', 1); // returns 1
  19891. *
  19892. * @param {Object} value
  19893. * @param {Number} defaultValue The value to return if the original value is non-numeric
  19894. * @return {Number} value, if numeric, defaultValue otherwise
  19895. */
  19896. from: function(value, defaultValue) {
  19897. if (isFinite(value)) {
  19898. value = parseFloat(value);
  19899. }
  19900. return !isNaN(value) ? value : defaultValue;
  19901. },
  19902. /**
  19903. * Returns a random integer between the specified range (inclusive)
  19904. * @param {Number} from Lowest value to return.
  19905. * @param {Number} to Highest value to return.
  19906. * @return {Number} A random integer within the specified range.
  19907. */
  19908. randomInt: function(from, to) {
  19909. return math.floor(math.random() * (to - from + 1) + from);
  19910. },
  19911. /**
  19912. * Corrects floating point numbers that overflow to a non-precise
  19913. * value because of their floating nature, for example `0.1 + 0.2`
  19914. * @param {Number} n The number
  19915. * @return {Number} The correctly rounded number
  19916. */
  19917. correctFloat: function(n) {
  19918. // This is to correct the type of errors where 2 floats end with
  19919. // a long string of decimals, eg 0.1 + 0.2. When they overflow in this
  19920. // manner, they usually go to 15-16 decimals, so we cut it off at 14.
  19921. return parseFloat(n.toPrecision(14));
  19922. }
  19923. });
  19924. /**
  19925. * @deprecated 4.0.0 Please use {@link Ext.Number#from} instead.
  19926. * @member Ext
  19927. * @method num
  19928. * @inheritdoc Ext.Number#from
  19929. */
  19930. Ext.num = function() {
  19931. return ExtNumber.from.apply(this, arguments);
  19932. };
  19933. }());
  19934. /**
  19935. * @class Ext.Object
  19936. *
  19937. * A collection of useful static methods to deal with objects.
  19938. *
  19939. * @singleton
  19940. */
  19941. (function() {
  19942. // The "constructor" for chain:
  19943. var TemplateClass = function() {},
  19944. queryRe = /^\?/,
  19945. keyRe = /(\[):?([^\]]*)\]/g,
  19946. nameRe = /^([^\[]+)/,
  19947. // eslint-disable-line no-useless-escape
  19948. plusRe = /\+/g,
  19949. ExtObject;
  19950. // @define Ext.lang.Object
  19951. // @define Ext.Object
  19952. // @require Ext
  19953. // @require Ext.lang.Date
  19954. ExtObject = Ext.Object = {
  19955. /**
  19956. * @method
  19957. * Returns a new object with the given object as the prototype chain. This method is
  19958. * designed to mimic the ECMA standard `Object.create` method and is assigned to that
  19959. * function when it is available.
  19960. *
  19961. * **NOTE** This method does not support the property definitions capability of the
  19962. * `Object.create` method. Only the first argument is supported.
  19963. *
  19964. * @param {Object} object The prototype chain for the new object.
  19965. */
  19966. chain: Object.create || function(object) {
  19967. var result;
  19968. TemplateClass.prototype = object;
  19969. result = new TemplateClass();
  19970. TemplateClass.prototype = null;
  19971. return result;
  19972. },
  19973. /**
  19974. * This method removes all keys from the given object.
  19975. * @param {Object} object The object from which to remove all keys.
  19976. * @return {Object} The given object.
  19977. */
  19978. clear: function(object) {
  19979. var key;
  19980. // Safe to delete during iteration
  19981. for (key in object) {
  19982. delete object[key];
  19983. }
  19984. return object;
  19985. },
  19986. /**
  19987. * Freezes the given object making it immutable. This operation is by default shallow
  19988. * and does not effect objects referenced by the given object.
  19989. *
  19990. * @method
  19991. * @param {Object} obj The object to freeze.
  19992. * @param {Boolean} [deep=false] Pass `true` to freeze sub-objects recursively.
  19993. * @return {Object} The given object `obj`.
  19994. */
  19995. freeze: Object.freeze ? function(obj, deep) {
  19996. var name;
  19997. if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
  19998. Object.freeze(obj);
  19999. if (deep) {
  20000. for (name in obj) {
  20001. ExtObject.freeze(obj[name], deep);
  20002. }
  20003. }
  20004. }
  20005. return obj;
  20006. } : Ext.identityFn,
  20007. /**
  20008. * Converts a `name` - `value` pair to an array of objects with support for nested structures.
  20009. * Useful to construct query strings. For example:
  20010. *
  20011. * var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);
  20012. *
  20013. * // objects then equals:
  20014. * [
  20015. * { name: 'hobbies', value: 'reading' },
  20016. * { name: 'hobbies', value: 'cooking' },
  20017. * { name: 'hobbies', value: 'swimming' },
  20018. * ];
  20019. *
  20020. * var objects = Ext.Object.toQueryObjects('dateOfBirth', {
  20021. * day: 3,
  20022. * month: 8,
  20023. * year: 1987,
  20024. * extra: {
  20025. * hour: 4
  20026. * minute: 30
  20027. * }
  20028. * }, true); // Recursive
  20029. *
  20030. * // objects then equals:
  20031. * [
  20032. * { name: 'dateOfBirth[day]', value: 3 },
  20033. * { name: 'dateOfBirth[month]', value: 8 },
  20034. * { name: 'dateOfBirth[year]', value: 1987 },
  20035. * { name: 'dateOfBirth[extra][hour]', value: 4 },
  20036. * { name: 'dateOfBirth[extra][minute]', value: 30 },
  20037. * ];
  20038. *
  20039. * @param {String} name
  20040. * @param {Object/Array} value
  20041. * @param {Boolean} [recursive=false] True to traverse object recursively
  20042. * @return {Object[]}
  20043. */
  20044. toQueryObjects: function(name, value, recursive) {
  20045. var self = ExtObject.toQueryObjects,
  20046. objects = [],
  20047. i, ln;
  20048. if (Ext.isArray(value)) {
  20049. for (i = 0 , ln = value.length; i < ln; i++) {
  20050. if (recursive) {
  20051. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  20052. } else {
  20053. objects.push({
  20054. name: name,
  20055. value: value[i]
  20056. });
  20057. }
  20058. }
  20059. } else if (Ext.isObject(value)) {
  20060. for (i in value) {
  20061. if (value.hasOwnProperty(i)) {
  20062. if (recursive) {
  20063. objects = objects.concat(self(name + '[' + i + ']', value[i], true));
  20064. } else {
  20065. objects.push({
  20066. name: name,
  20067. value: value[i]
  20068. });
  20069. }
  20070. }
  20071. }
  20072. } else {
  20073. objects.push({
  20074. name: name,
  20075. value: value
  20076. });
  20077. }
  20078. return objects;
  20079. },
  20080. /* eslint-disable max-len */
  20081. /**
  20082. * Takes an object and converts it to an encoded query string.
  20083. *
  20084. * Non-recursive:
  20085. *
  20086. * Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
  20087. * Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
  20088. * Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
  20089. * Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
  20090. * Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
  20091. *
  20092. * Recursive:
  20093. *
  20094. * Ext.Object.toQueryString({
  20095. * username: 'Jacky',
  20096. * dateOfBirth: {
  20097. * day: 1,
  20098. * month: 2,
  20099. * year: 1911
  20100. * },
  20101. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  20102. * }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
  20103. * // username=Jacky
  20104. * // &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
  20105. * // &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
  20106. *
  20107. * @param {Object} object The object to encode
  20108. * @param {Boolean} [recursive=false] Whether or not to interpret the object in recursive format.
  20109. * (PHP / Ruby on Rails servers and similar).
  20110. * @return {String} queryString
  20111. */
  20112. toQueryString: function(object, recursive) {
  20113. var paramObjects = [],
  20114. params = [],
  20115. i, j, ln, paramObject, value;
  20116. for (i in object) {
  20117. if (object.hasOwnProperty(i)) {
  20118. paramObjects = paramObjects.concat(ExtObject.toQueryObjects(i, object[i], recursive));
  20119. }
  20120. }
  20121. for (j = 0 , ln = paramObjects.length; j < ln; j++) {
  20122. paramObject = paramObjects[j];
  20123. value = paramObject.value;
  20124. if (Ext.isEmpty(value)) {
  20125. value = '';
  20126. } else if (Ext.isDate(value)) {
  20127. value = Ext.Date.toString(value);
  20128. }
  20129. params.push(encodeURIComponent(paramObject.name) + '=' + encodeURIComponent(String(value)));
  20130. }
  20131. return params.join('&');
  20132. },
  20133. /**
  20134. * Converts a query string back into an object.
  20135. *
  20136. * Non-recursive:
  20137. *
  20138. * Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: '1', bar: '2'}
  20139. * Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: '', bar: '2'}
  20140. * Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
  20141. * Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
  20142. *
  20143. * Recursive:
  20144. *
  20145. * Ext.Object.fromQueryString(
  20146. * "username=Jacky&"+
  20147. * "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
  20148. * "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
  20149. * "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
  20150. *
  20151. * // returns
  20152. * {
  20153. * username: 'Jacky',
  20154. * dateOfBirth: {
  20155. * day: '1',
  20156. * month: '2',
  20157. * year: '1911'
  20158. * },
  20159. * hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
  20160. * }
  20161. *
  20162. * @param {String} queryString The query string to decode
  20163. * @param {Boolean} [recursive=false] Whether or not to recursively decode the string. This format is supported by
  20164. * PHP / Ruby on Rails servers and similar.
  20165. * @return {Object}
  20166. */
  20167. fromQueryString: function(queryString, recursive) {
  20168. var parts = queryString.replace(queryRe, '').split('&'),
  20169. object = {},
  20170. temp, components, name, value, i, ln, part, j, subLn, matchedKeys, matchedName, keys, key, nextKey;
  20171. for (i = 0 , ln = parts.length; i < ln; i++) {
  20172. part = parts[i];
  20173. if (part.length > 0) {
  20174. components = part.split('=');
  20175. name = components[0];
  20176. name = name.replace(plusRe, '%20');
  20177. name = decodeURIComponent(name);
  20178. value = components[1];
  20179. if (value !== undefined) {
  20180. value = value.replace(plusRe, '%20');
  20181. value = decodeURIComponent(value);
  20182. } else {
  20183. value = '';
  20184. }
  20185. if (!recursive) {
  20186. if (object.hasOwnProperty(name)) {
  20187. if (!Ext.isArray(object[name])) {
  20188. object[name] = [
  20189. object[name]
  20190. ];
  20191. }
  20192. object[name].push(value);
  20193. } else {
  20194. object[name] = value;
  20195. }
  20196. } else {
  20197. matchedKeys = name.match(keyRe);
  20198. matchedName = name.match(nameRe);
  20199. if (!matchedName) {
  20200. throw new Error('[Ext.Object.fromQueryString] Malformed query string given, failed parsing name from "' + part + '"');
  20201. }
  20202. name = matchedName[0];
  20203. keys = [];
  20204. if (matchedKeys === null) {
  20205. object[name] = value;
  20206. continue;
  20207. }
  20208. for (j = 0 , subLn = matchedKeys.length; j < subLn; j++) {
  20209. key = matchedKeys[j];
  20210. key = (key.length === 2) ? '' : key.substring(1, key.length - 1);
  20211. keys.push(key);
  20212. }
  20213. keys.unshift(name);
  20214. temp = object;
  20215. for (j = 0 , subLn = keys.length; j < subLn; j++) {
  20216. key = keys[j];
  20217. if (j === subLn - 1) {
  20218. if (Ext.isArray(temp) && key === '') {
  20219. temp.push(value);
  20220. } else {
  20221. temp[key] = value;
  20222. }
  20223. } else {
  20224. if (temp[key] === undefined || typeof temp[key] === 'string') {
  20225. nextKey = keys[j + 1];
  20226. temp[key] = (Ext.isNumeric(nextKey) || nextKey === '') ? [] : {};
  20227. }
  20228. temp = temp[key];
  20229. }
  20230. }
  20231. }
  20232. }
  20233. }
  20234. return object;
  20235. },
  20236. /* eslint-enable max-len */
  20237. /**
  20238. * Iterates through an object and invokes the given callback function for each iteration.
  20239. * The iteration can be stopped by returning `false` in the callback function. For example:
  20240. *
  20241. * var person = {
  20242. * name: 'Jacky'
  20243. * hairColor: 'black'
  20244. * loves: ['food', 'sleeping', 'wife']
  20245. * };
  20246. *
  20247. * Ext.Object.each(person, function(key, value, myself) {
  20248. * console.log(key + ":" + value);
  20249. *
  20250. * if (key === 'hairColor') {
  20251. * return false; // stop the iteration
  20252. * }
  20253. * });
  20254. *
  20255. * @param {Object} object The object to iterate
  20256. * @param {Function} fn The callback function.
  20257. * @param {String} fn.key
  20258. * @param {Object} fn.value
  20259. * @param {Object} fn.object The object itself
  20260. * @param {Object} [scope] The execution scope (`this`) of the callback function
  20261. */
  20262. each: function(object, fn, scope) {
  20263. var enumerables = Ext.enumerables,
  20264. i, property;
  20265. if (object) {
  20266. scope = scope || object;
  20267. for (property in object) {
  20268. if (object.hasOwnProperty(property)) {
  20269. if (fn.call(scope, property, object[property], object) === false) {
  20270. return;
  20271. }
  20272. }
  20273. }
  20274. if (enumerables) {
  20275. for (i = enumerables.length; i--; ) {
  20276. if (object.hasOwnProperty(property = enumerables[i])) {
  20277. if (fn.call(scope, property, object[property], object) === false) {
  20278. return;
  20279. }
  20280. }
  20281. }
  20282. }
  20283. }
  20284. },
  20285. /**
  20286. * Iterates through an object and invokes the given callback function for each iteration.
  20287. * The iteration can be stopped by returning `false` in the callback function. For example:
  20288. *
  20289. * var items = {
  20290. * 1: 'Hello',
  20291. * 2: 'World'
  20292. * };
  20293. *
  20294. * Ext.Object.eachValue(items, function(value) {
  20295. * console.log("Value: " + value);
  20296. * });
  20297. *
  20298. * This will log 'Hello' and 'World' in no particular order. This method is useful
  20299. * in cases where the keys are not important to the processing, just the values.
  20300. *
  20301. * @param {Object} object The object to iterate
  20302. * @param {Function} fn The callback function.
  20303. * @param {Object} fn.value The value of
  20304. * @param {Object} [scope] The execution scope (`this`) of the callback function
  20305. */
  20306. eachValue: function(object, fn, scope) {
  20307. var enumerables = Ext.enumerables,
  20308. i, property;
  20309. scope = scope || object;
  20310. for (property in object) {
  20311. if (object.hasOwnProperty(property)) {
  20312. if (fn.call(scope, object[property]) === false) {
  20313. return;
  20314. }
  20315. }
  20316. }
  20317. if (enumerables) {
  20318. for (i = enumerables.length; i--; ) {
  20319. if (object.hasOwnProperty(property = enumerables[i])) {
  20320. if (fn.call(scope, object[property]) === false) {
  20321. return;
  20322. }
  20323. }
  20324. }
  20325. }
  20326. },
  20327. /**
  20328. * Merges any number of objects recursively without referencing them or their children.
  20329. * Note: It will reference arrays if they are only present in one of the objects being merged.
  20330. *
  20331. * var extjs = {
  20332. * companyName: 'Ext JS',
  20333. * products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
  20334. * isSuperCool: true,
  20335. * office: {
  20336. * size: 2000,
  20337. * location: 'Palo Alto',
  20338. * isFun: true
  20339. * }
  20340. * };
  20341. *
  20342. * var newStuff = {
  20343. * companyName: 'Sencha Inc.',
  20344. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  20345. * office: {
  20346. * size: 40000,
  20347. * location: 'Redwood City'
  20348. * }
  20349. * };
  20350. *
  20351. * var sencha = Ext.Object.merge(extjs, newStuff);
  20352. *
  20353. * // extjs and sencha then equals to
  20354. * {
  20355. * companyName: 'Sencha Inc.',
  20356. * products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
  20357. * isSuperCool: true,
  20358. * office: {
  20359. * size: 40000,
  20360. * location: 'Redwood City',
  20361. * isFun: true
  20362. * }
  20363. * }
  20364. *
  20365. * @param {Object} destination The object into which all subsequent objects are merged.
  20366. * @param {Object...} object Any number of objects to merge into the destination.
  20367. * @return {Object} merged The destination object with all passed objects merged in.
  20368. */
  20369. merge: function(destination) {
  20370. var i = 1,
  20371. args = arguments,
  20372. ln = args.length,
  20373. mergeFn = ExtObject.merge,
  20374. cloneFn = Ext.clone,
  20375. object, key, value, sourceKey;
  20376. for (; i < ln; i++) {
  20377. object = args[i];
  20378. for (key in object) {
  20379. value = object[key];
  20380. if (value && value.constructor === Object) {
  20381. sourceKey = destination[key];
  20382. if (sourceKey && sourceKey.constructor === Object) {
  20383. mergeFn(sourceKey, value);
  20384. } else {
  20385. destination[key] = cloneFn(value);
  20386. }
  20387. } else {
  20388. destination[key] = value;
  20389. }
  20390. }
  20391. }
  20392. return destination;
  20393. },
  20394. /**
  20395. * @private
  20396. * @param destination
  20397. */
  20398. mergeIf: function(destination) {
  20399. var i = 1,
  20400. ln = arguments.length,
  20401. cloneFn = Ext.clone,
  20402. object, key, value;
  20403. for (; i < ln; i++) {
  20404. object = arguments[i];
  20405. for (key in object) {
  20406. if (!(key in destination)) {
  20407. value = object[key];
  20408. if (value && value.constructor === Object) {
  20409. destination[key] = cloneFn(value);
  20410. } else {
  20411. destination[key] = value;
  20412. }
  20413. }
  20414. }
  20415. }
  20416. return destination;
  20417. },
  20418. /**
  20419. * Returns all keys of the given object as an array.
  20420. *
  20421. * @param {Object} object
  20422. * @return {String[]} An array of keys from the object or any of its prototypes.
  20423. * @method
  20424. */
  20425. getAllKeys: function(object) {
  20426. var keys = [],
  20427. property;
  20428. for (property in object) {
  20429. keys.push(property);
  20430. }
  20431. return keys;
  20432. },
  20433. /**
  20434. * Returns the first matching key corresponding to the given value.
  20435. * If no matching value is found, null is returned.
  20436. *
  20437. * var person = {
  20438. * name: 'Jacky',
  20439. * loves: 'food'
  20440. * };
  20441. *
  20442. * alert(Ext.Object.getKey(person, 'food')); // alerts 'loves'
  20443. *
  20444. * @param {Object} object
  20445. * @param {Object} value The value to find
  20446. */
  20447. getKey: function(object, value) {
  20448. var property;
  20449. for (property in object) {
  20450. if (object.hasOwnProperty(property) && object[property] === value) {
  20451. return property;
  20452. }
  20453. }
  20454. return null;
  20455. },
  20456. /**
  20457. * Gets all values of the given object as an array.
  20458. *
  20459. * var values = Ext.Object.getValues({
  20460. * name: 'Jacky',
  20461. * loves: 'food'
  20462. * }); // ['Jacky', 'food']
  20463. *
  20464. * @param {Object} object
  20465. * @return {Array} An array of values from the object
  20466. */
  20467. getValues: function(object) {
  20468. var values = [],
  20469. property;
  20470. for (property in object) {
  20471. if (object.hasOwnProperty(property)) {
  20472. values.push(object[property]);
  20473. }
  20474. }
  20475. return values;
  20476. },
  20477. /**
  20478. * Returns the `hasOwnProperty` keys of the given object as an array.
  20479. *
  20480. * var values = Ext.Object.getKeys({
  20481. * name: 'Jacky',
  20482. * loves: 'food'
  20483. * }); // ['name', 'loves']
  20484. *
  20485. * @param {Object} object
  20486. * @return {String[]} An array of keys from the object
  20487. * @method
  20488. */
  20489. getKeys: (typeof Object.keys === 'function') ? function(object) {
  20490. if (!object) {
  20491. return [];
  20492. }
  20493. return Object.keys(object);
  20494. } : function(object) {
  20495. var keys = [],
  20496. property;
  20497. for (property in object) {
  20498. if (object.hasOwnProperty(property)) {
  20499. keys.push(property);
  20500. }
  20501. }
  20502. return keys;
  20503. },
  20504. /**
  20505. * Gets the total number of this object's own properties
  20506. *
  20507. * var size = Ext.Object.getSize({
  20508. * name: 'Jacky',
  20509. * loves: 'food'
  20510. * }); // size equals 2
  20511. *
  20512. * @param {Object} object
  20513. * @return {Number} size
  20514. */
  20515. getSize: function(object) {
  20516. var size = 0,
  20517. property;
  20518. for (property in object) {
  20519. if (object.hasOwnProperty(property)) {
  20520. size++;
  20521. }
  20522. }
  20523. return size;
  20524. },
  20525. /**
  20526. * Checks if there are any properties on this object.
  20527. * @param {Object} object
  20528. * @return {Boolean} `true` if there no properties on the object.
  20529. */
  20530. isEmpty: function(object) {
  20531. var key;
  20532. for (key in object) {
  20533. if (object.hasOwnProperty(key)) {
  20534. return false;
  20535. }
  20536. }
  20537. return true;
  20538. },
  20539. /**
  20540. * @method
  20541. * Shallow compares the contents of 2 objects using strict equality. Objects are
  20542. * considered equal if they both have the same set of properties and the
  20543. * value for those properties equals the other in the corresponding object.
  20544. *
  20545. * // Returns true
  20546. * Ext.Object.equals({
  20547. * foo: 1,
  20548. * bar: 2
  20549. * }, {
  20550. * foo: 1,
  20551. * bar: 2
  20552. * });
  20553. *
  20554. * @param {Object} object1
  20555. * @param {Object} object2
  20556. * @return {Boolean} `true` if the objects are equal.
  20557. */
  20558. equals: (function() {
  20559. var check = function(o1, o2) {
  20560. var key;
  20561. for (key in o1) {
  20562. if (o1.hasOwnProperty(key)) {
  20563. if (o1[key] !== o2[key]) {
  20564. return false;
  20565. }
  20566. }
  20567. }
  20568. return true;
  20569. };
  20570. return function(object1, object2) {
  20571. // Short circuit if the same object is passed twice
  20572. if (object1 === object2) {
  20573. return true;
  20574. }
  20575. if (object1 && object2) {
  20576. // Do the second check because we could have extra keys in
  20577. // object2 that don't exist in object1.
  20578. return check(object1, object2) && check(object2, object1);
  20579. } else if (!object1 && !object2) {
  20580. return object1 === object2;
  20581. } else {
  20582. return false;
  20583. }
  20584. };
  20585. })(),
  20586. /**
  20587. * @private
  20588. */
  20589. fork: function(obj) {
  20590. var ret, key, value;
  20591. if (obj && obj.constructor === Object) {
  20592. ret = ExtObject.chain(obj);
  20593. for (key in obj) {
  20594. value = obj[key];
  20595. if (value) {
  20596. if (value.constructor === Object) {
  20597. ret[key] = ExtObject.fork(value);
  20598. } else if (value instanceof Array) {
  20599. ret[key] = Ext.Array.clone(value);
  20600. }
  20601. }
  20602. }
  20603. } else {
  20604. ret = obj;
  20605. }
  20606. return ret;
  20607. },
  20608. defineProperty: ('defineProperty' in Object) ? Object.defineProperty : function(object, name, descriptor) {
  20609. if (!Object.prototype.__defineGetter__) {
  20610. return;
  20611. }
  20612. if (descriptor.get) {
  20613. object.__defineGetter__(name, descriptor.get);
  20614. }
  20615. if (descriptor.set) {
  20616. object.__defineSetter__(name, descriptor.set);
  20617. }
  20618. },
  20619. /**
  20620. * @private
  20621. */
  20622. classify: function(object) {
  20623. var prototype = object,
  20624. objectProperties = [],
  20625. propertyClassesMap = {},
  20626. objectClass, key, value;
  20627. objectClass = function() {
  20628. var property, i, ln;
  20629. for (i = 0 , ln = objectProperties.length; i < ln; i++) {
  20630. property = objectProperties[i];
  20631. this[property] = new propertyClassesMap[property]();
  20632. }
  20633. };
  20634. for (key in object) {
  20635. if (object.hasOwnProperty(key)) {
  20636. value = object[key];
  20637. if (value && value.constructor === Object) {
  20638. objectProperties.push(key);
  20639. propertyClassesMap[key] = ExtObject.classify(value);
  20640. }
  20641. }
  20642. }
  20643. objectClass.prototype = prototype;
  20644. return objectClass;
  20645. }
  20646. };
  20647. /**
  20648. * A convenient alias method for {@link Ext.Object#merge}.
  20649. *
  20650. * @member Ext
  20651. * @method merge
  20652. * @inheritdoc Ext.Object#merge
  20653. */
  20654. Ext.merge = Ext.Object.merge;
  20655. /**
  20656. * @private
  20657. * @member Ext
  20658. */
  20659. Ext.mergeIf = Ext.Object.mergeIf;
  20660. }());
  20661. /*
  20662. * This file contains miscellaneous utility methods that depends on various helper classes
  20663. * like `Ext.Array` and `Ext.Date`. Historically these methods were defined in Ext.js or
  20664. * Ext-more.js but that creates circular dependencies so they were consolidated here.
  20665. */
  20666. Ext.apply(Ext, {
  20667. // @define Ext.Util
  20668. // @require Ext
  20669. // @require Ext.lang.*
  20670. // shortcut for the special named scopes for listener scope resolution
  20671. _namedScopes: {
  20672. 'this': {
  20673. isThis: 1
  20674. },
  20675. controller: {
  20676. isController: 1
  20677. },
  20678. owner: {
  20679. isOwner: 1
  20680. },
  20681. // Uses helper Ext.lookUpFn to find the scope where fn is defined (skips the
  20682. // component at which things originate):
  20683. up: {
  20684. isUp: 1
  20685. },
  20686. // These two are private, used to indicate that listeners were declared on the
  20687. // class body with either an unspecified scope, or scope:'controller'
  20688. self: {
  20689. isSelf: 1
  20690. },
  20691. 'self.controller': {
  20692. isSelf: 1,
  20693. isController: 1
  20694. }
  20695. },
  20696. scrollbar: {
  20697. _size: null,
  20698. /**
  20699. * @member Ext.scrollbar
  20700. * Returns the size of the browser scrollbars. This can differ depending on
  20701. * operating system settings, such as the theme or font size.
  20702. * @param {Boolean} [force] Pass `true` to force a recalculation of scrollbar size.
  20703. * @return {Object} An object containing scrollbar sizes.
  20704. * @return {Number} return.width The width of the vertical scrollbar.
  20705. * @return {Number} return.height The height of the horizontal scrollbar.
  20706. */
  20707. size: function(force) {
  20708. var scrollbar = Ext.scrollbar,
  20709. size = scrollbar._size;
  20710. if (!Ext.isDomReady) {
  20711. Ext.raise("Ext.scrollbar.size() called before DomReady");
  20712. }
  20713. if (force || !size) {
  20714. /* eslint-disable-next-line vars-on-top */
  20715. var db = document.body,
  20716. div = document.createElement('div'),
  20717. h, w;
  20718. div.style.width = div.style.height = '100px';
  20719. div.style.overflow = 'scroll';
  20720. div.style.position = 'absolute';
  20721. db.appendChild(div);
  20722. // now we can measure the div...
  20723. // at least in iE9 the div is not 100px - the scrollbar size is removed!
  20724. scrollbar._size = size = {
  20725. width: w = div.offsetWidth - div.clientWidth,
  20726. height: h = div.offsetHeight - div.clientHeight
  20727. };
  20728. size.reservedWidth = w ? 'calc(100% - ' + w + 'px)' : '';
  20729. size.reservedHeight = h ? 'calc(100% - ' + h + 'px)' : '';
  20730. db.removeChild(div);
  20731. }
  20732. return size;
  20733. },
  20734. height: function(force) {
  20735. return Ext.scrollbar.size(force).height;
  20736. },
  20737. width: function(force) {
  20738. return Ext.scrollbar.size(force).width;
  20739. }
  20740. },
  20741. escapeId: (function() {
  20742. /* eslint-disable-next-line no-useless-escape */
  20743. var validIdRe = /^[a-zA-Z_][a-zA-Z0-9_\-]*$/i,
  20744. escapeRx = /([\W]{1})/g,
  20745. leadingNumRx = /^(\d)/g,
  20746. escapeFn = function(match, capture) {
  20747. return "\\" + capture;
  20748. },
  20749. numEscapeFn = function(match, capture) {
  20750. return '\\00' + capture.charCodeAt(0).toString(16) + ' ';
  20751. };
  20752. return function(id) {
  20753. return validIdRe.test(id) ? id : // replace the number portion last to keep the trailing ' '
  20754. // from being escaped
  20755. id.replace(escapeRx, escapeFn).replace(leadingNumRx, numEscapeFn);
  20756. };
  20757. }()),
  20758. lookUpFn: function(from, fn) {
  20759. if (!from || !Ext.isFunction(from.up)) {
  20760. Ext.raise('Callback "up" syntax requires a caller with "up" method');
  20761. }
  20762. // eslint-disable-next-line vars-on-top
  20763. var controller, scope;
  20764. for (scope = from.up(); scope && !scope[fn]; scope = scope.up()) {
  20765. controller = scope.controller;
  20766. if (controller && controller[fn]) {
  20767. scope = controller;
  20768. break;
  20769. }
  20770. }
  20771. if (!scope || !Ext.isFunction(scope[fn])) {
  20772. Ext.raise('No such method "' + fn + '" found up() from ' + (from.getId ? from.getId() : from.id));
  20773. }
  20774. return scope;
  20775. },
  20776. /**
  20777. * @method callback
  20778. * @member Ext
  20779. * Execute a callback function in a particular scope. If `callback` argument is a
  20780. * function reference, that is called. If it is a string, the string is assumed to
  20781. * be the name of a method on the given `scope`. If no function is passed the call
  20782. * is ignored.
  20783. *
  20784. * For example, these calls are equivalent:
  20785. *
  20786. * var myFunc = this.myFunc;
  20787. *
  20788. * Ext.callback('myFunc', this, [arg1, arg2]);
  20789. * Ext.callback(myFunc, this, [arg1, arg2]);
  20790. *
  20791. * Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
  20792. *
  20793. * @param {Function/String} callback The callback function to execute or the name of
  20794. * the callback method on the provided `scope`.
  20795. * @param {Object} [scope] The scope in which `callback` should be invoked. If `callback`
  20796. * is a string this object provides the method by that name. If this is `null` then
  20797. * the `caller` is used to resolve the scope to a `ViewController` or the proper
  20798. * `defaultListenerScope`.
  20799. * @param {Array} [args] The arguments to pass to the function.
  20800. * @param {Number} [delay] Pass a number to delay the call by a number of milliseconds.
  20801. * @param {Object} [caller] The object calling the callback. This is used to resolve
  20802. * named methods when no explicit `scope` is provided.
  20803. * @param {Object} [defaultScope=caller] The default scope to return if none is found.
  20804. * @return The value returned by the callback or `undefined` (if there is a `delay`
  20805. * or if the `callback` is not a function).
  20806. */
  20807. callback: function(callback, scope, args, delay, caller, defaultScope) {
  20808. if (!callback) {
  20809. return;
  20810. }
  20811. /* eslint-disable-next-line vars-on-top */
  20812. var namedScope = (scope in Ext._namedScopes),
  20813. ret;
  20814. if (callback.charAt) {
  20815. // if (isString(fn))
  20816. // Custom components cannot often use declarative method resolution when
  20817. // they need to allow the user to supply declarative method names that can
  20818. // reach the user's controller. The "up" callback syntax can help with that:
  20819. //
  20820. // xtype: 'button',
  20821. // handler: 'up.onFoo',
  20822. //
  20823. // When Ext.callback('up.onFoo',..., button) is called, we can perform a
  20824. // "button.up('[onFoo]')" search for the handler. Thus we have a declarative
  20825. // way to dispatch such handlers that will work even if the user can supply
  20826. // such handlers.
  20827. //
  20828. if (callback[2] === '.') {
  20829. // callback = 'up.foo'
  20830. if (callback.substr(0, 2) !== 'up') {
  20831. Ext.raise('Invalid callback method name "' + callback + '"');
  20832. }
  20833. if (scope) {
  20834. Ext.raise('Callback "up" syntax is incompatible with scopes');
  20835. }
  20836. scope = Ext.lookUpFn(caller, callback = callback.substr(3));
  20837. } else if (caller) {
  20838. if (namedScope && namedScope.isUp) {
  20839. scope = Ext.lookUpFn(caller, callback);
  20840. } else if (!scope || namedScope) {
  20841. scope = caller.resolveListenerScope(namedScope ? scope : defaultScope);
  20842. }
  20843. }
  20844. if (!scope || !Ext.isObject(scope)) {
  20845. Ext.raise('Named method "' + callback + '" requires a scope object');
  20846. }
  20847. if (!Ext.isFunction(scope[callback])) {
  20848. Ext.raise('No method named "' + callback + '" on ' + (scope.$className || 'scope object'));
  20849. }
  20850. callback = scope[callback];
  20851. } else if (namedScope) {
  20852. scope = defaultScope || caller;
  20853. } else if (!scope) {
  20854. scope = caller;
  20855. }
  20856. if (callback && Ext.isFunction(callback)) {
  20857. scope = scope || Ext.global;
  20858. if (delay) {
  20859. Ext.defer(callback, delay, scope, args);
  20860. } else {
  20861. ret = args ? callback.apply(scope, args) : callback.call(scope);
  20862. }
  20863. }
  20864. return ret;
  20865. },
  20866. /**
  20867. * @method coerce
  20868. * @member Ext
  20869. * Coerces the first value if possible so that it is comparable to the second value.
  20870. *
  20871. * Coercion only works between the basic atomic data types String, Boolean, Number, Date, null
  20872. * and undefined. Numbers and numeric strings are coerced to Dates using the value
  20873. * as the millisecond era value.
  20874. *
  20875. * Strings are coerced to Dates by parsing using the
  20876. * {@link Ext.Date#defaultFormat defaultFormat}.
  20877. *
  20878. * For example
  20879. *
  20880. * Ext.coerce('false', true);
  20881. *
  20882. * returns the boolean value `false` because the second parameter is of type `Boolean`.
  20883. *
  20884. * @param {Mixed} from The value to coerce
  20885. * @param {Mixed} to The value it must be compared against
  20886. * @return The coerced value.
  20887. */
  20888. coerce: function(from, to) {
  20889. var fromType = Ext.typeOf(from),
  20890. toType = Ext.typeOf(to),
  20891. isString = typeof from === 'string';
  20892. if (fromType !== toType) {
  20893. switch (toType) {
  20894. case 'string':
  20895. return String(from);
  20896. case 'number':
  20897. return Number(from);
  20898. case 'boolean':
  20899. // See http://ecma262-5.com/ELS5_HTML.htm#Section_11.9.3 as to why '0'.
  20900. // TL;DR => ('0' == 0), so if given string '0', we must return boolean false.
  20901. return isString && (!from || from === 'false' || from === '0') ? false : Boolean(from);
  20902. case 'null':
  20903. return isString && (!from || from === 'null') ? null : false;
  20904. case 'undefined':
  20905. return isString && (!from || from === 'undefined') ? undefined : false;
  20906. case 'date':
  20907. return isString && isNaN(from) ? Ext.Date.parse(from, Ext.Date.defaultFormat) : Date(Number(from));
  20908. }
  20909. }
  20910. return from;
  20911. },
  20912. /**
  20913. * @method copyTo
  20914. * @member Ext
  20915. * Copies a set of named properties fom the source object to the destination object.
  20916. *
  20917. * Example:
  20918. *
  20919. * var foo = { a: 1, b: 2, c: 3 };
  20920. *
  20921. * var bar = Ext.copyTo({}, foo, 'a,c');
  20922. * // bar = { a: 1, c: 3 };
  20923. *
  20924. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20925. *
  20926. * @param {Object} dest The destination object.
  20927. * @param {Object} source The source object.
  20928. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20929. * of property names to copy.
  20930. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20931. * prototype as well as the instance.
  20932. * @return {Object} The `dest` object.
  20933. * @deprecated 6.0.1 Use {@link Ext#copy Ext.copy} instead. This old method
  20934. * would copy the named preoperties even if they did not exist in the source which
  20935. * could produce `undefined` values in the destination.
  20936. */
  20937. copyTo: function(dest, source, names, usePrototypeKeys) {
  20938. var name, i, n;
  20939. if (typeof names === 'string') {
  20940. names = names.split(Ext.propertyNameSplitRe);
  20941. }
  20942. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  20943. name = names[i];
  20944. if (usePrototypeKeys || source.hasOwnProperty(name)) {
  20945. dest[name] = source[name];
  20946. }
  20947. }
  20948. return dest;
  20949. },
  20950. /**
  20951. * @method copy
  20952. * @member Ext
  20953. * Copies a set of named properties fom the source object to the destination object.
  20954. *
  20955. * Example:
  20956. *
  20957. * var foo = { a: 1, b: 2, c: 3 };
  20958. *
  20959. * var bar = Ext.copy({}, foo, 'a,c');
  20960. * // bar = { a: 1, c: 3 };
  20961. *
  20962. * Important note: To borrow class prototype methods, use {@link Ext.Base#borrow} instead.
  20963. *
  20964. * @param {Object} dest The destination object.
  20965. * @param {Object} source The source object.
  20966. * @param {String/String[]} names Either an Array of property names, or a comma-delimited list
  20967. * of property names to copy.
  20968. * @param {Boolean} [usePrototypeKeys=false] Pass `true` to copy keys off of the
  20969. * prototype as well as the instance.
  20970. * @return {Object} The `dest` object.
  20971. */
  20972. copy: function(dest, source, names, usePrototypeKeys) {
  20973. var name, i, n;
  20974. if (typeof names === 'string') {
  20975. names = names.split(Ext.propertyNameSplitRe);
  20976. }
  20977. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  20978. name = names[i];
  20979. // Only copy a property if the source actually *has* that property.
  20980. // If we are including prototype properties, then ensure that a property of
  20981. // that name can be found *somewhere* in the prototype chain (otherwise we'd be
  20982. // copying undefined in which may break things)
  20983. if (source.hasOwnProperty(name) || (usePrototypeKeys && name in source)) {
  20984. dest[name] = source[name];
  20985. }
  20986. }
  20987. return dest;
  20988. },
  20989. propertyNameSplitRe: /[,;\s]+/,
  20990. /**
  20991. * @method copyToIf
  20992. * @member Ext
  20993. * Copies a set of named properties fom the source object to the destination object
  20994. * if the destination object does not already have them.
  20995. *
  20996. * Example:
  20997. *
  20998. * var foo = { a: 1, b: 2, c: 3 };
  20999. *
  21000. * var bar = Ext.copyToIf({ a:42 }, foo, 'a,c');
  21001. * // bar = { a: 42, c: 3 };
  21002. *
  21003. * @param {Object} destination The destination object.
  21004. * @param {Object} source The source object.
  21005. * @param {String/String[]} names Either an Array of property names, or a single string
  21006. * with a list of property names separated by ",", ";" or spaces.
  21007. * @return {Object} The `dest` object.
  21008. * @deprecated 6.0.1 Use {@link Ext#copyIf Ext.copyIf} instead. This old method
  21009. * would copy the named preoperties even if they did not exist in the source which
  21010. * could produce `undefined` values in the destination.
  21011. */
  21012. copyToIf: function(destination, source, names) {
  21013. var name, i, n;
  21014. if (typeof names === 'string') {
  21015. names = names.split(Ext.propertyNameSplitRe);
  21016. }
  21017. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21018. name = names[i];
  21019. if (destination[name] === undefined) {
  21020. destination[name] = source[name];
  21021. }
  21022. }
  21023. return destination;
  21024. },
  21025. /**
  21026. * @method copyIf
  21027. * @member Ext
  21028. * Copies a set of named properties fom the source object to the destination object
  21029. * if the destination object does not already have them.
  21030. *
  21031. * Example:
  21032. *
  21033. * var foo = { a: 1, b: 2, c: 3 };
  21034. *
  21035. * var bar = Ext.copyIf({ a:42 }, foo, 'a,c');
  21036. * // bar = { a: 42, c: 3 };
  21037. *
  21038. * @param {Object} destination The destination object.
  21039. * @param {Object} source The source object.
  21040. * @param {String/String[]} names Either an Array of property names, or a single string
  21041. * with a list of property names separated by ",", ";" or spaces.
  21042. * @return {Object} The `dest` object.
  21043. */
  21044. copyIf: function(destination, source, names) {
  21045. var name, i, n;
  21046. if (typeof names === 'string') {
  21047. names = names.split(Ext.propertyNameSplitRe);
  21048. }
  21049. for (i = 0 , n = names ? names.length : 0; i < n; i++) {
  21050. name = names[i];
  21051. // Only copy a property if the destination has no property by that name
  21052. if (!(name in destination) && (name in source)) {
  21053. destination[name] = source[name];
  21054. }
  21055. }
  21056. return destination;
  21057. },
  21058. /**
  21059. * @method extend
  21060. * @member Ext
  21061. * This method deprecated. Use {@link Ext#define Ext.define} instead.
  21062. * @param {Function} superclass
  21063. * @param {Object} overrides
  21064. * @return {Function} The subclass constructor from the <tt>overrides</tt> parameter,
  21065. * or a generated one if not provided.
  21066. * @deprecated 4.0.0 Use {@link Ext#define Ext.define} instead
  21067. */
  21068. extend: (function() {
  21069. // inline overrides
  21070. var objectConstructor = Object.prototype.constructor,
  21071. inlineOverrides = function(o) {
  21072. var m;
  21073. for (m in o) {
  21074. if (!o.hasOwnProperty(m)) {
  21075. continue;
  21076. }
  21077. this[m] = o[m];
  21078. }
  21079. };
  21080. return function(subclass, superclass, overrides) {
  21081. // First we check if the user passed in just the superClass with overrides
  21082. if (Ext.isObject(superclass)) {
  21083. overrides = superclass;
  21084. superclass = subclass;
  21085. subclass = overrides.constructor !== objectConstructor ? overrides.constructor : function() {
  21086. superclass.apply(this, arguments);
  21087. };
  21088. }
  21089. if (!superclass) {
  21090. Ext.raise({
  21091. sourceClass: 'Ext',
  21092. sourceMethod: 'extend',
  21093. msg: 'Attempting to extend from a class which has not been loaded on the page.'
  21094. });
  21095. }
  21096. // We create a new temporary class
  21097. /* eslint-disable-next-line vars-on-top */
  21098. var F = function() {},
  21099. superclassProto = superclass.prototype,
  21100. subclassProto;
  21101. F.prototype = superclassProto;
  21102. subclassProto = subclass.prototype = new F();
  21103. subclassProto.constructor = subclass;
  21104. subclass.superclass = superclassProto;
  21105. if (superclassProto.constructor === objectConstructor) {
  21106. superclassProto.constructor = superclass;
  21107. }
  21108. subclass.override = function(overrides) {
  21109. Ext.override(subclass, overrides);
  21110. };
  21111. subclassProto.override = inlineOverrides;
  21112. subclassProto.proto = subclassProto;
  21113. subclass.override(overrides);
  21114. subclass.extend = function(o) {
  21115. return Ext.extend(subclass, o);
  21116. };
  21117. return subclass;
  21118. };
  21119. }()),
  21120. /**
  21121. * Indicates if the page is currently running in online or offline mode, according
  21122. * to the `navigator.onLine` property.
  21123. * @return {Boolean} `true` if the page is currently running in an online mode.
  21124. *
  21125. * @since 6.2.1
  21126. */
  21127. isOnline: function() {
  21128. return Ext.global.navigator.onLine;
  21129. },
  21130. /**
  21131. * @method iterate
  21132. * @member Ext
  21133. * Iterates either an array or an object. This method delegates to
  21134. * {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and
  21135. * {@link Ext.Object#each Ext.Object.each} otherwise.
  21136. *
  21137. * @param {Object/Array} object The object or array to be iterated.
  21138. * @param {Function} fn The function to be called for each iteration. See and
  21139. * {@link Ext.Array#each Ext.Array.each} and {@link Ext.Object#each Ext.Object.each}
  21140. * for detailed lists of arguments passed to this function depending on the given object
  21141. * type that is being iterated.
  21142. * @param {Object} [scope] The scope (`this` reference) in which the specified function
  21143. * is executed. Defaults to the object being iterated itself.
  21144. */
  21145. iterate: function(object, fn, scope) {
  21146. if (Ext.isEmpty(object)) {
  21147. return;
  21148. }
  21149. if (scope === undefined) {
  21150. scope = object;
  21151. }
  21152. if (Ext.isIterable(object)) {
  21153. Ext.Array.each.call(Ext.Array, object, fn, scope);
  21154. } else {
  21155. Ext.Object.each.call(Ext.Object, object, fn, scope);
  21156. }
  21157. },
  21158. _resourcePoolRe: /^[<]([^<>@:]*)(?:[@]([^<>@:]+))?[>](.+)$/,
  21159. /**
  21160. * Resolves a resource URL that may contain a resource pool identifier token at the
  21161. * front. The tokens are formatted as HTML tags "&lt;poolName@packageName&gt;" followed
  21162. * by a normal relative path. This token is only processed if present at the first
  21163. * character of the given string.
  21164. *
  21165. * These tokens are parsed and the pieces are then passed to the
  21166. * {@link Ext#getResourcePath} method.
  21167. *
  21168. * For example:
  21169. *
  21170. * [{
  21171. * xtype: 'image',
  21172. * src: '<shared>images/foo.png'
  21173. * },{
  21174. * xtype: 'image',
  21175. * src: '<@package>images/foo.png'
  21176. * },{
  21177. * xtype: 'image',
  21178. * src: '<shared@package>images/foo.png'
  21179. * }]
  21180. *
  21181. * In the above example, "shared" is the name of a Sencha Cmd resource pool and
  21182. * "package" is the name of a Sencha Cmd package.
  21183. * @member Ext
  21184. * @param {String} url The URL that may contain a resource pool token at the front.
  21185. * @return {String}
  21186. * @since 6.0.1
  21187. */
  21188. resolveResource: function(url) {
  21189. var ret = url,
  21190. m;
  21191. if (url && url.charAt(0) === '<') {
  21192. m = Ext._resourcePoolRe.exec(url);
  21193. if (m) {
  21194. ret = Ext.getResourcePath(m[3], m[1], m[2]);
  21195. }
  21196. }
  21197. return ret;
  21198. },
  21199. /**
  21200. *
  21201. * @member Ext
  21202. * @method urlEncode
  21203. * @inheritdoc Ext.Object#toQueryString
  21204. * @deprecated 4.0.0 Use {@link Ext.Object#toQueryString} instead
  21205. */
  21206. urlEncode: function() {
  21207. var args = Ext.Array.from(arguments),
  21208. prefix = '';
  21209. // Support for the old `pre` argument
  21210. if (Ext.isString(args[1])) {
  21211. prefix = args[1] + '&';
  21212. args[1] = false;
  21213. }
  21214. return prefix + Ext.Object.toQueryString.apply(Ext.Object, args);
  21215. },
  21216. /**
  21217. * Alias for {@link Ext.Object#fromQueryString}.
  21218. *
  21219. * @member Ext
  21220. * @method urlDecode
  21221. * @inheritdoc Ext.Object#fromQueryString
  21222. * @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString} instead
  21223. */
  21224. urlDecode: function() {
  21225. return Ext.Object.fromQueryString.apply(Ext.Object, arguments);
  21226. },
  21227. /**
  21228. * @method getScrollbarSize
  21229. * @member Ext
  21230. * Returns the size of the browser scrollbars. This can differ depending on
  21231. * operating system settings, such as the theme or font size.
  21232. * @param {Boolean} [force] true to force a recalculation of the value.
  21233. * @return {Object} An object containing scrollbar sizes.
  21234. * @return {Number} return.width The width of the vertical scrollbar.
  21235. * @return {Number} return.height The height of the horizontal scrollbar.
  21236. * @deprecated 7.0 Use `Ext.scrollbar.size` instead.
  21237. */
  21238. getScrollbarSize: function(force) {
  21239. return Ext.scrollbar.size(force);
  21240. },
  21241. /**
  21242. * @method typeOf
  21243. * @member Ext
  21244. * Returns the type of the given variable in string format. List of possible values are:
  21245. *
  21246. * - `undefined`: If the given value is `undefined`
  21247. * - `null`: If the given value is `null`
  21248. * - `string`: If the given value is a string
  21249. * - `number`: If the given value is a number
  21250. * - `boolean`: If the given value is a boolean value
  21251. * - `date`: If the given value is a `Date` object
  21252. * - `function`: If the given value is a function reference
  21253. * - `object`: If the given value is an object
  21254. * - `array`: If the given value is an array
  21255. * - `regexp`: If the given value is a regular expression
  21256. * - `element`: If the given value is a DOM Element
  21257. * - `textnode`: If the given value is a DOM text node and contains something other than
  21258. * whitespace
  21259. * - `whitespace`: If the given value is a DOM text node and contains only whitespace
  21260. *
  21261. * @param {Object} value
  21262. * @return {String}
  21263. */
  21264. typeOf: (function() {
  21265. var nonWhitespaceRe = /\S/,
  21266. toString = Object.prototype.toString,
  21267. typeofTypes = {
  21268. number: 1,
  21269. string: 1,
  21270. 'boolean': 1,
  21271. 'undefined': 1
  21272. },
  21273. toStringTypes = {
  21274. '[object Array]': 'array',
  21275. '[object Date]': 'date',
  21276. '[object Boolean]': 'boolean',
  21277. '[object Number]': 'number',
  21278. '[object RegExp]': 'regexp'
  21279. };
  21280. return function(value) {
  21281. if (value === null) {
  21282. return 'null';
  21283. }
  21284. /* eslint-disable-next-line vars-on-top */
  21285. var type = typeof value,
  21286. ret, typeToString;
  21287. if (typeofTypes[type]) {
  21288. return type;
  21289. }
  21290. ret = toStringTypes[typeToString = toString.call(value)];
  21291. if (ret) {
  21292. return ret;
  21293. }
  21294. if (type === 'function') {
  21295. return 'function';
  21296. }
  21297. if (type === 'object') {
  21298. if (value.nodeType !== undefined) {
  21299. if (value.nodeType === 3) {
  21300. return nonWhitespaceRe.test(value.nodeValue) ? 'textnode' : 'whitespace';
  21301. } else {
  21302. return 'element';
  21303. }
  21304. }
  21305. return 'object';
  21306. }
  21307. Ext.raise({
  21308. sourceClass: 'Ext',
  21309. sourceMethod: 'typeOf',
  21310. msg: 'Failed to determine the type of "' + value + '".'
  21311. });
  21312. return typeToString;
  21313. };
  21314. }()),
  21315. /**
  21316. * A global factory method to instantiate a class from a config object. For example,
  21317. * these two calls are equivalent:
  21318. *
  21319. * Ext.factory({ text: 'My Button' }, 'Ext.Button');
  21320. * Ext.create('Ext.Button', { text: 'My Button' });
  21321. *
  21322. * If an existing instance is also specified, it will be updated with the supplied config
  21323. * object. This is useful if you need to either create or update an object, depending on
  21324. * if an instance already exists. For example:
  21325. *
  21326. * var button;
  21327. * button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button); // Button created
  21328. * button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button); // Button updated
  21329. *
  21330. * @param {Object} config The config object to instantiate or update an instance with.
  21331. * @param {String} [classReference] The class to instantiate from (if there is a default).
  21332. * @param {Object} [instance] The instance to update.
  21333. * @param [aliasNamespace]
  21334. * @member Ext
  21335. * @deprecated 6.5.0 Use the {@link Ext.Factory#method!update update} method of the
  21336. * associated factory instead.
  21337. */
  21338. factory: function(config, classReference, instance, aliasNamespace) {
  21339. var manager = Ext.ClassManager,
  21340. newInstance;
  21341. // If config is falsy or a valid instance, destroy the current instance
  21342. // (if it exists) and replace with the new one
  21343. if (!config || config.isInstance) {
  21344. if (instance && instance !== config) {
  21345. instance.destroy();
  21346. }
  21347. return config;
  21348. }
  21349. if (aliasNamespace) {
  21350. // If config is a string value, treat it as an alias
  21351. if (typeof config === 'string') {
  21352. return manager.instantiateByAlias(aliasNamespace + '.' + config);
  21353. }
  21354. // Same if 'type' is given in config
  21355. else if (Ext.isObject(config) && 'type' in config) {
  21356. return manager.instantiateByAlias(aliasNamespace + '.' + config.type, config);
  21357. }
  21358. }
  21359. if (config === true) {
  21360. if (!instance && !classReference) {
  21361. Ext.raise('[Ext.factory] Cannot determine type of class to create');
  21362. }
  21363. return instance || Ext.create(classReference);
  21364. }
  21365. if (!Ext.isObject(config)) {
  21366. Ext.raise("Invalid config, must be a valid config object");
  21367. }
  21368. if ('xtype' in config) {
  21369. newInstance = manager.instantiateByAlias('widget.' + config.xtype, config);
  21370. } else if ('xclass' in config) {
  21371. newInstance = Ext.create(config.xclass, config);
  21372. }
  21373. if (newInstance) {
  21374. if (instance) {
  21375. instance.destroy();
  21376. }
  21377. return newInstance;
  21378. }
  21379. if (instance) {
  21380. return instance.setConfig(config);
  21381. }
  21382. return Ext.create(classReference, config);
  21383. },
  21384. /**
  21385. * This method converts an object containing config objects keyed by `itemId` into
  21386. * an array of config objects.
  21387. *
  21388. * @param {Object} items An object containing config objects keyed by `itemId`.
  21389. * @param {String} [defaultProperty="xtype"] The property to set for string items.
  21390. * @param functionProperty
  21391. * @return {Object[]}
  21392. * @member Ext
  21393. * @since 6.5.0
  21394. * @private
  21395. */
  21396. convertKeyedItems: function(items, defaultProperty, functionProperty) {
  21397. if (items && !items.isInstance && Ext.isObject(items)) {
  21398. /* eslint-disable-next-line vars-on-top */
  21399. var obj = items,
  21400. item, itemId, value;
  21401. items = [];
  21402. // See if obj looks like a single thing
  21403. if (obj.xtype || obj.xclass || obj.itemId || obj.id) {
  21404. items.push(obj);
  21405. } else {
  21406. for (itemId in obj) {
  21407. item = obj[itemId];
  21408. if (item) {
  21409. if (item === true) {
  21410. item = {};
  21411. } else if (typeof item === 'function') {
  21412. if (!functionProperty) {
  21413. Ext.raise('Function not expected here');
  21414. }
  21415. value = item;
  21416. item = {};
  21417. item[functionProperty] = value;
  21418. } else if (typeof item === 'string') {
  21419. value = item;
  21420. item = {};
  21421. item[defaultProperty || 'xtype'] = value;
  21422. } else {
  21423. item = Ext.apply({}, item);
  21424. }
  21425. item.itemId = itemId;
  21426. items.push(item);
  21427. }
  21428. }
  21429. }
  21430. }
  21431. return items;
  21432. },
  21433. sortByWeight: function(items) {
  21434. if (items) {
  21435. Ext.Array.sort(items, Ext.weightSortFn);
  21436. }
  21437. },
  21438. /**
  21439. * Comparison function for sorting an array of objects in ascending order of `weight`.
  21440. * @param {Object} lhs
  21441. * @param {Object} rhs
  21442. * @return {Number}
  21443. * @member Ext
  21444. * @private
  21445. * @since 6.5.0
  21446. */
  21447. weightSortFn: function(lhs, rhs) {
  21448. return (lhs.weight || 0) - (rhs.weight || 0);
  21449. },
  21450. /**
  21451. * Concatenate 2 arrays. If either argument is `null` or `undefined` then it's not
  21452. * concatenated.
  21453. *
  21454. * @param {Object/Object[]} a
  21455. * @param {Object/Object[]} b
  21456. * @return {Object[]}
  21457. * @member Ext
  21458. * @private
  21459. * @since 6.5.1
  21460. */
  21461. concat: function(a, b) {
  21462. var noB = b == null,
  21463. E = Ext.emptyArray;
  21464. return (a == null) ? (noB ? a : E.concat(b)) : (noB ? E.concat(a) : E.concat(a, b));
  21465. },
  21466. /**
  21467. * @method log
  21468. * @member Ext
  21469. * Logs a message. If a console is present it will be used. On Opera, the method
  21470. * "opera.postError" is called. In other cases, the message is logged to an array
  21471. * "Ext.log.out". An attached debugger can watch this array and view the log. The
  21472. * log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250).
  21473. *
  21474. * If additional parameters are passed, they are joined and appended to the message.
  21475. * A technique for tracing entry and exit of a function is this:
  21476. *
  21477. * function foo () {
  21478. * Ext.log({ indent: 1 }, '>> foo');
  21479. *
  21480. * // log statements in here or methods called from here will be indented
  21481. * // by one step
  21482. *
  21483. * Ext.log({ outdent: 1 }, '<< foo');
  21484. * }
  21485. *
  21486. * This method does nothing in a release build.
  21487. *
  21488. * @param {String/Object} [options] The message to log or an options object with any
  21489. * of the following properties:
  21490. *
  21491. * - `msg`: The message to log (required).
  21492. * - `level`: One of: "error", "warn", "info" or "log" (the default is "log").
  21493. * - `dump`: An object to dump to the log as part of the message.
  21494. * - `stack`: True to include a stack trace in the log.
  21495. * - `indent`: Cause subsequent log statements to be indented one step.
  21496. * - `outdent`: Cause this and following statements to be one step less indented.
  21497. *
  21498. * @param {String...} [message] The message to log (required unless specified in
  21499. * options object).
  21500. */
  21501. log: (function() {
  21502. /*
  21503. * Iterate through an object to dump its content into a string.
  21504. * For example:
  21505. * {
  21506. * style: {
  21507. * lineWidth: 1
  21508. * },
  21509. * label: {},
  21510. * marker: {
  21511. * strokeStyle: "#555",
  21512. * radius: 3,
  21513. * size: 3
  21514. * },
  21515. * subStyle: {
  21516. * fillStyle: [
  21517. * 0: "#133987",
  21518. * 1: "#1c55ca",
  21519. * 2: "#4d7fe6"
  21520. * ]
  21521. * },
  21522. * markerSubStyle: {}
  21523. * }
  21524. *
  21525. * @param {Object} object The object to iterate
  21526. * @param {Number} [level] Current level of identation (and recursion). Default is 0.
  21527. * @param {Number} [maxLevel] Maximum level of recursion. Default is 3.
  21528. * @param {Boolean} [withFunctions] Include functions in the output.
  21529. * @return {String} The string with the contents of the object
  21530. */
  21531. var primitiveRe = /string|number|boolean/;
  21532. function dumpObject(object, level, maxLevel, withFunctions) {
  21533. var member, type, value, name, prefix, suffix,
  21534. members = [];
  21535. if (Ext.isArray(object)) {
  21536. prefix = '[';
  21537. suffix = ']';
  21538. } else if (Ext.isObject(object)) {
  21539. prefix = '{';
  21540. suffix = '}';
  21541. }
  21542. if (!maxLevel) {
  21543. maxLevel = 3;
  21544. }
  21545. if (level > maxLevel) {
  21546. return prefix + '...' + suffix;
  21547. }
  21548. level = level || 1;
  21549. /* eslint-disable-next-line vars-on-top */
  21550. var spacer = (new Array(level)).join(' ');
  21551. // Cannot use Ext.encode since it can recurse endlessly
  21552. for (name in object) {
  21553. if (object.hasOwnProperty(name)) {
  21554. value = object[name];
  21555. type = typeof value;
  21556. if (type === 'function') {
  21557. if (!withFunctions) {
  21558. continue;
  21559. }
  21560. member = type;
  21561. } else if (type === 'undefined') {
  21562. member = type;
  21563. } else if (value === null || primitiveRe.test(type) || Ext.isDate(value)) {
  21564. member = Ext.encode(value);
  21565. } else if (Ext.isArray(value)) {
  21566. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21567. } else if (Ext.isObject(value)) {
  21568. member = dumpObject(value, level + 1, maxLevel, withFunctions);
  21569. } else {
  21570. member = type;
  21571. }
  21572. members.push(spacer + name + ': ' + member);
  21573. }
  21574. }
  21575. // or Ext.encode(name)
  21576. if (members.length) {
  21577. return prefix + '\n ' + members.join(',\n ') + '\n' + spacer + suffix;
  21578. }
  21579. return prefix + suffix;
  21580. }
  21581. function log(message) {
  21582. var options, dump,
  21583. con = Ext.global.console,
  21584. level = 'log',
  21585. indent = log.indent || 0,
  21586. prefix, stack, fn, out, max;
  21587. log.indent = indent;
  21588. if (typeof message !== 'string') {
  21589. options = message;
  21590. message = options.msg || '';
  21591. level = options.level || level;
  21592. dump = options.dump;
  21593. stack = options.stack;
  21594. prefix = options.prefix;
  21595. fn = options.fn;
  21596. if (options.indent) {
  21597. ++log.indent;
  21598. } else if (options.outdent) {
  21599. log.indent = indent = Math.max(indent - 1, 0);
  21600. }
  21601. if (dump && !(con && con.dir)) {
  21602. message += dumpObject(dump);
  21603. dump = null;
  21604. }
  21605. }
  21606. if (arguments.length > 1) {
  21607. message += Array.prototype.slice.call(arguments, 1).join('');
  21608. }
  21609. if (prefix) {
  21610. message = prefix + ' - ' + message;
  21611. }
  21612. message = indent ? Ext.String.repeat(' ', log.indentSize * indent) + message : message;
  21613. // w/o console, all messages are equal, so munge the level into the message:
  21614. if (level !== 'log') {
  21615. message = '[' + level.charAt(0).toUpperCase() + '] ' + message;
  21616. }
  21617. if (fn) {
  21618. message += '\nCaller: ' + fn.toString();
  21619. }
  21620. // Not obvious, but 'console' comes and goes when Firebug is turned on/off, so
  21621. // an early test may fail either direction if Firebug is toggled.
  21622. //
  21623. if (con) {
  21624. // if (Firebug-like console)
  21625. if (con[level]) {
  21626. con[level](message);
  21627. } else {
  21628. con.log(message);
  21629. }
  21630. if (dump) {
  21631. con.dir(dump);
  21632. }
  21633. if (stack && con.trace) {
  21634. // Firebug's console.error() includes a trace already...
  21635. if (!con.firebug || level !== 'error') {
  21636. con.trace();
  21637. }
  21638. }
  21639. } else if (Ext.isOpera) {
  21640. /* eslint-disable-next-line no-undef */
  21641. opera.postError(message);
  21642. } else {
  21643. out = log.out;
  21644. max = log.max;
  21645. if (out.length >= max) {
  21646. // this formula allows out.max to change (via debugger), where the
  21647. // more obvious "max/4" would not quite be the same
  21648. // keep newest 75%
  21649. Ext.Array.erase(out, 0, out.length - 3 * Math.floor(max / 4));
  21650. }
  21651. out.push(message);
  21652. }
  21653. // Mostly informational, but the Ext.Error notifier uses them:
  21654. ++log.count;
  21655. ++log.counters[level];
  21656. }
  21657. function logx(level, args) {
  21658. if (typeof args[0] === 'string') {
  21659. args.unshift({});
  21660. }
  21661. args[0].level = level;
  21662. log.apply(this, args);
  21663. }
  21664. log.error = function() {
  21665. logx('error', Array.prototype.slice.call(arguments));
  21666. };
  21667. log.info = function() {
  21668. logx('info', Array.prototype.slice.call(arguments));
  21669. };
  21670. log.warn = function() {
  21671. logx('warn', Array.prototype.slice.call(arguments));
  21672. };
  21673. log.count = 0;
  21674. log.counters = {
  21675. error: 0,
  21676. warn: 0,
  21677. info: 0,
  21678. log: 0
  21679. };
  21680. log.indentSize = 2;
  21681. log.out = [];
  21682. log.max = 750;
  21683. return log;
  21684. }()) || (function() {
  21685. var nullLog = function() {};
  21686. nullLog.info = nullLog.warn = nullLog.error = Ext.emptyFn;
  21687. return nullLog;
  21688. }())
  21689. });
  21690. /**
  21691. * @class Ext.Version
  21692. *
  21693. * A utility class that wraps around a version number string and provides convenient methods
  21694. * to perform comparisons. A version number is expressed in the following general format:
  21695. *
  21696. * major[.minor[.patch[.build[release]]]]
  21697. *
  21698. * The `Version` instance holds various readonly properties that contain the digested form
  21699. * of the version string. The numeric componnets of `major`, `minor`, `patch` and `build`
  21700. * as well as the textual suffix called `release`.
  21701. *
  21702. * Not depicted in the above syntax are three possible prefixes used to control partial
  21703. * matching. These are '^' (the default), '>' and '~'. These are discussed below.
  21704. *
  21705. * Examples:
  21706. *
  21707. * var version = new Ext.Version('1.0.2beta'); // or maybe "1.0" or "1.2.3.4RC"
  21708. * console.log("Version is " + version); // Version is 1.0.2beta
  21709. *
  21710. * console.log(version.getMajor()); // 1
  21711. * console.log(version.getMinor()); // 0
  21712. * console.log(version.getPatch()); // 2
  21713. * console.log(version.getBuild()); // 0
  21714. * console.log(version.getRelease()); // beta
  21715. *
  21716. * The understood values of `release` are assigned numberic equivalents for the sake of
  21717. * comparsion. The order of these from smallest to largest is as follows:
  21718. *
  21719. * * `"dev"`
  21720. * * `"alpha"` or `"a"`
  21721. * * `"beta"` or `"b"`
  21722. * * `"RC"` or `"rc"`
  21723. * * `"#"`
  21724. * * `"pl"` or `"p"`
  21725. *
  21726. * Any other (unrecognized) suffix is consider greater than any of these.
  21727. *
  21728. * ## Comparisons
  21729. * There are two forms of comparison that are commonly needed: full and partial. Full
  21730. * comparison is simpler and is also the default.
  21731. *
  21732. * Example:
  21733. *
  21734. * var version = new Ext.Version('1.0.2beta');
  21735. *
  21736. * console.log(version.isGreaterThan('1.0.1')); // True
  21737. * console.log(version.isGreaterThan('1.0.2alpha')); // True
  21738. * console.log(version.isGreaterThan('1.0.2RC')); // False
  21739. * console.log(version.isGreaterThan('1.0.2')); // False
  21740. * console.log(version.isLessThan('1.0.2')); // True
  21741. *
  21742. * console.log(version.match(1.0)); // True (using a Number)
  21743. * console.log(version.match('1.0.2')); // True (using a String)
  21744. *
  21745. * These comparisons are ultimately implemented by {@link Ext.Version#compareTo compareTo}
  21746. * which returns -1, 0 or 1 depending on whether the `Version' instance is less than, equal
  21747. * to, or greater than the given "other" version.
  21748. *
  21749. * For example:
  21750. *
  21751. * var n = version.compareTo('1.0.1'); // == 1 (because 1.0.2beta > 1.0.1)
  21752. *
  21753. * n = version.compareTo('1.1'); // == -1
  21754. * n = version.compareTo(version); // == 0
  21755. *
  21756. * ### Partial Comparisons
  21757. * By default, unspecified version number fields are filled with 0. In other words, the
  21758. * version number fields are 0-padded on the right or a "lower bound". This produces the
  21759. * most commonly used forms of comparsion:
  21760. *
  21761. * var ver = new Version('4.2');
  21762. *
  21763. * n = ver.compareTo('4.2.1'); // == -1 (4.2 promotes to 4.2.0 and is less than 4.2.1)
  21764. *
  21765. * There are two other ways to interpret comparisons of versions of different length. The
  21766. * first of these is to change the padding on the right to be a large number (scuh as
  21767. * Infinity) instead of 0. This has the effect of making the version an upper bound. For
  21768. * example:
  21769. *
  21770. * var ver = new Version('^4.2'); // NOTE: the '^' prefix used
  21771. *
  21772. * n = ver.compareTo('4.3'); // == -1 (less than 4.3)
  21773. *
  21774. * n = ver.compareTo('4.2'); // == 1 (greater than all 4.2's)
  21775. * n = ver.compareTo('4.2.1'); // == 1
  21776. * n = ver.compareTo('4.2.9'); // == 1
  21777. *
  21778. * The second way to interpret this comparison is to ignore the extra digits, making the
  21779. * match a prefix match. For example:
  21780. *
  21781. * var ver = new Version('~4.2'); // NOTE: the '~' prefix used
  21782. *
  21783. * n = ver.compareTo('4.3'); // == -1
  21784. *
  21785. * n = ver.compareTo('4.2'); // == 0
  21786. * n = ver.compareTo('4.2.1'); // == 0
  21787. *
  21788. * This final form can be useful when version numbers contain more components than are
  21789. * important for certain comparisons. For example, the full version of Ext JS 4.2.1 is
  21790. * "4.2.1.883" where 883 is the `build` number.
  21791. *
  21792. * This is how to create a "partial" `Version` and compare versions to it:
  21793. *
  21794. * var version421ish = new Version('~4.2.1');
  21795. *
  21796. * n = version421ish.compareTo('4.2.1.883'); // == 0
  21797. * n = version421ish.compareTo('4.2.1.2'); // == 0
  21798. * n = version421ish.compareTo('4.2.1'); // == 0
  21799. *
  21800. * n = version421ish.compareTo('4.2'); // == 1
  21801. *
  21802. * In the above example, '4.2.1.2' compares as equal to '4.2.1' because digits beyond the
  21803. * given "4.2.1" are ignored. However, '4.2' is less than the '4.2.1' prefix; its missing
  21804. * digit is filled with 0.
  21805. */
  21806. /* eslint-disable indent */
  21807. (function() {
  21808. // @define Ext.Version
  21809. // @require Ext.String
  21810. var // used by checkVersion to avoid temp arrays:
  21811. checkVerTemp = [
  21812. ''
  21813. ],
  21814. endOfVersionRe = /([^\d.])/,
  21815. notDigitsRe = /[^\d]/g,
  21816. plusMinusRe = /[-+]/g,
  21817. stripRe = /\s/g,
  21818. underscoreRe = /_/g,
  21819. toolkitNames = {
  21820. classic: 1,
  21821. modern: 1
  21822. },
  21823. Version;
  21824. Ext.Version = Version = function(version, defaultMode) {
  21825. var me = this,
  21826. padModes = me.padModes,
  21827. ch, i, pad, parts, release, releaseStartIndex, ver;
  21828. if (version.isVersion) {
  21829. version = version.version;
  21830. }
  21831. me.version = ver = String(version).toLowerCase().replace(underscoreRe, '.').replace(plusMinusRe, '');
  21832. ch = ver.charAt(0);
  21833. if (ch in padModes) {
  21834. ver = ver.substring(1);
  21835. pad = padModes[ch];
  21836. } else {
  21837. pad = defaultMode ? padModes[defaultMode] : 0;
  21838. }
  21839. // careful - NaN is falsey!
  21840. me.pad = pad;
  21841. releaseStartIndex = ver.search(endOfVersionRe);
  21842. me.shortVersion = ver;
  21843. if (releaseStartIndex !== -1) {
  21844. me.release = release = ver.substr(releaseStartIndex, version.length);
  21845. me.shortVersion = ver.substr(0, releaseStartIndex);
  21846. release = Version.releaseValueMap[release] || release;
  21847. }
  21848. me.releaseValue = release || pad;
  21849. me.shortVersion = me.shortVersion.replace(notDigitsRe, '');
  21850. /**
  21851. * @property {Number[]} parts
  21852. * The split array of version number components found in the version string.
  21853. * For example, for "1.2.3", this would be `[1, 2, 3]`.
  21854. * @readonly
  21855. * @private
  21856. */
  21857. me.parts = parts = ver.split('.');
  21858. for (i = parts.length; i--; ) {
  21859. parts[i] = parseInt(parts[i], 10);
  21860. }
  21861. if (pad === Infinity) {
  21862. // have to add this to the end to create an upper bound:
  21863. parts.push(pad);
  21864. }
  21865. /**
  21866. * @property {Number} major
  21867. * The first numeric part of the version number string.
  21868. * @readonly
  21869. */
  21870. me.major = parts[0] || pad;
  21871. /**
  21872. * @property {Number} [minor]
  21873. * The second numeric part of the version number string.
  21874. * @readonly
  21875. */
  21876. me.minor = parts[1] || pad;
  21877. /**
  21878. * @property {Number} [patch]
  21879. * The third numeric part of the version number string.
  21880. * @readonly
  21881. */
  21882. me.patch = parts[2] || pad;
  21883. /**
  21884. * @property {Number} [build]
  21885. * The fourth numeric part of the version number string.
  21886. * @readonly
  21887. */
  21888. me.build = parts[3] || pad;
  21889. return me;
  21890. };
  21891. Version.prototype = {
  21892. isVersion: true,
  21893. padModes: {
  21894. '~': NaN,
  21895. '^': Infinity
  21896. },
  21897. /**
  21898. * @property {String} [release=""]
  21899. * The release level. The following values are understood:
  21900. *
  21901. * * `"dev"`
  21902. * * `"alpha"` or `"a"`
  21903. * * `"beta"` or `"b"`
  21904. * * `"RC"` or `"rc"`
  21905. * * `"#"`
  21906. * * `"pl"` or `"p"`
  21907. * @readonly
  21908. */
  21909. release: '',
  21910. /**
  21911. * Compares this version instance to the specified `other` version.
  21912. *
  21913. * @param {String/Number/Ext.Version} other The other version to which to compare.
  21914. * @return {Number} -1 if this version is less than the target version, 1 if this
  21915. * version is greater, and 0 if they are equal.
  21916. */
  21917. compareTo: function(other) {
  21918. // "lhs" == "left-hand-side"
  21919. // "rhs" == "right-hand-side"
  21920. var me = this,
  21921. lhsPad = me.pad,
  21922. lhsParts = me.parts,
  21923. lhsLength = lhsParts.length,
  21924. rhsVersion = other.isVersion ? other : new Version(other),
  21925. rhsPad = rhsVersion.pad,
  21926. rhsParts = rhsVersion.parts,
  21927. rhsLength = rhsParts.length,
  21928. length = Math.max(lhsLength, rhsLength),
  21929. i, lhs, rhs;
  21930. for (i = 0; i < length; i++) {
  21931. lhs = (i < lhsLength) ? lhsParts[i] : lhsPad;
  21932. rhs = (i < rhsLength) ? rhsParts[i] : rhsPad;
  21933. // When one or both of the values are NaN these tests produce false
  21934. // and we end up treating NaN as equal to anything.
  21935. if (lhs < rhs) {
  21936. return -1;
  21937. }
  21938. if (lhs > rhs) {
  21939. return 1;
  21940. }
  21941. }
  21942. // same comments about NaN apply here...
  21943. lhs = me.releaseValue;
  21944. rhs = rhsVersion.releaseValue;
  21945. if (lhs < rhs) {
  21946. return -1;
  21947. }
  21948. if (lhs > rhs) {
  21949. return 1;
  21950. }
  21951. return 0;
  21952. },
  21953. /**
  21954. * Override the native `toString` method
  21955. * @private
  21956. * @return {String} version
  21957. */
  21958. toString: function() {
  21959. return this.version;
  21960. },
  21961. /**
  21962. * Override the native `valueOf` method
  21963. * @private
  21964. * @return {String} version
  21965. */
  21966. valueOf: function() {
  21967. return this.version;
  21968. },
  21969. /**
  21970. * Returns the major component value.
  21971. * @return {Number}
  21972. */
  21973. getMajor: function() {
  21974. return this.major;
  21975. },
  21976. /**
  21977. * Returns the minor component value.
  21978. * @return {Number}
  21979. */
  21980. getMinor: function() {
  21981. return this.minor;
  21982. },
  21983. /**
  21984. * Returns the patch component value.
  21985. * @return {Number}
  21986. */
  21987. getPatch: function() {
  21988. return this.patch;
  21989. },
  21990. /**
  21991. * Returns the build component value.
  21992. * @return {Number}
  21993. */
  21994. getBuild: function() {
  21995. return this.build;
  21996. },
  21997. /**
  21998. * Returns the release component text (e.g., "beta").
  21999. * @return {String}
  22000. */
  22001. getRelease: function() {
  22002. return this.release;
  22003. },
  22004. /**
  22005. * Returns the release component value for comparison purposes.
  22006. * @return {Number/String}
  22007. */
  22008. getReleaseValue: function() {
  22009. return this.releaseValue;
  22010. },
  22011. /**
  22012. * Returns whether this version if greater than the supplied argument
  22013. * @param {String/Number} target The version to compare with
  22014. * @return {Boolean} `true` if this version if greater than the target, `false` otherwise
  22015. */
  22016. isGreaterThan: function(target) {
  22017. return this.compareTo(target) > 0;
  22018. },
  22019. /**
  22020. * Returns whether this version if greater than or equal to the supplied argument
  22021. * @param {String/Number} target The version to compare with
  22022. * @return {Boolean} `true` if this version if greater than or equal to the target,
  22023. * `false` otherwise
  22024. */
  22025. isGreaterThanOrEqual: function(target) {
  22026. return this.compareTo(target) >= 0;
  22027. },
  22028. /**
  22029. * Returns whether this version if smaller than the supplied argument
  22030. * @param {String/Number} target The version to compare with
  22031. * @return {Boolean} `true` if this version if smaller than the target, `false` otherwise
  22032. */
  22033. isLessThan: function(target) {
  22034. return this.compareTo(target) < 0;
  22035. },
  22036. /**
  22037. * Returns whether this version if less than or equal to the supplied argument
  22038. * @param {String/Number} target The version to compare with
  22039. * @return {Boolean} `true` if this version if less than or equal to the target,
  22040. * `false` otherwise
  22041. */
  22042. isLessThanOrEqual: function(target) {
  22043. return this.compareTo(target) <= 0;
  22044. },
  22045. /**
  22046. * Returns whether this version equals to the supplied argument
  22047. * @param {String/Number} target The version to compare with
  22048. * @return {Boolean} `true` if this version equals to the target, `false` otherwise
  22049. */
  22050. equals: function(target) {
  22051. return this.compareTo(target) === 0;
  22052. },
  22053. /**
  22054. * Returns whether this version matches the supplied argument. Example:
  22055. *
  22056. * var version = new Ext.Version('1.0.2beta');
  22057. * console.log(version.match(1)); // true
  22058. * console.log(version.match(1.0)); // true
  22059. * console.log(version.match('1.0.2')); // true
  22060. * console.log(version.match('1.0.2RC')); // false
  22061. *
  22062. * @param {String/Number} target The version to compare with
  22063. * @return {Boolean} `true` if this version matches the target, `false` otherwise
  22064. */
  22065. match: function(target) {
  22066. target = String(target);
  22067. return this.version.substr(0, target.length) === target;
  22068. },
  22069. /**
  22070. * Returns this format: [major, minor, patch, build, release]. Useful for comparison.
  22071. * @return {Number[]}
  22072. */
  22073. toArray: function() {
  22074. var me = this;
  22075. return [
  22076. me.getMajor(),
  22077. me.getMinor(),
  22078. me.getPatch(),
  22079. me.getBuild(),
  22080. me.getRelease()
  22081. ];
  22082. },
  22083. /**
  22084. * Returns shortVersion version without dots and release
  22085. * @return {String}
  22086. */
  22087. getShortVersion: function() {
  22088. return this.shortVersion;
  22089. },
  22090. /**
  22091. * Convenient alias to {@link Ext.Version#isGreaterThan isGreaterThan}
  22092. * @param {String/Number/Ext.Version} target
  22093. * @return {Boolean}
  22094. */
  22095. gt: function(target) {
  22096. return this.compareTo(target) > 0;
  22097. },
  22098. /**
  22099. * Convenient alias to {@link Ext.Version#isLessThan isLessThan}
  22100. * @param {String/Number/Ext.Version} target
  22101. * @return {Boolean}
  22102. */
  22103. lt: function(target) {
  22104. return this.compareTo(target) < 0;
  22105. },
  22106. /**
  22107. * Convenient alias to {@link Ext.Version#isGreaterThanOrEqual isGreaterThanOrEqual}
  22108. * @param {String/Number/Ext.Version} target
  22109. * @return {Boolean}
  22110. */
  22111. gtEq: function(target) {
  22112. return this.compareTo(target) >= 0;
  22113. },
  22114. /**
  22115. * Convenient alias to {@link Ext.Version#isLessThanOrEqual isLessThanOrEqual}
  22116. * @param {String/Number/Ext.Version} target
  22117. * @return {Boolean}
  22118. */
  22119. ltEq: function(target) {
  22120. return this.compareTo(target) <= 0;
  22121. }
  22122. };
  22123. Ext.apply(Version, {
  22124. aliases: {
  22125. from: {
  22126. extjs: 'ext',
  22127. core: 'core',
  22128. touch: 'modern'
  22129. },
  22130. to: {
  22131. ext: [
  22132. 'extjs'
  22133. ],
  22134. 'core': [
  22135. 'core'
  22136. ],
  22137. modern: [
  22138. 'touch'
  22139. ]
  22140. }
  22141. },
  22142. /**
  22143. * @private
  22144. */
  22145. releaseValueMap: {
  22146. dev: -6,
  22147. alpha: -5,
  22148. a: -5,
  22149. beta: -4,
  22150. b: -4,
  22151. rc: -3,
  22152. '#': -2,
  22153. p: -1,
  22154. pl: -1
  22155. },
  22156. /**
  22157. * Converts a version component to a comparable value
  22158. *
  22159. * @static
  22160. * @param {Object} value The value to convert
  22161. * @return {Object}
  22162. */
  22163. getComponentValue: function(value) {
  22164. // eslint-disable-next-line max-len
  22165. return !value ? 0 : (isNaN(value) ? this.releaseValueMap[value] || value : parseInt(value, 10));
  22166. },
  22167. /**
  22168. * Compare 2 specified versions by ensuring the first parameter is a `Version`
  22169. * instance and then calling the `compareTo` method.
  22170. *
  22171. * @static
  22172. * @param {String} current The current version to compare to
  22173. * @param {String} target The target version to compare to
  22174. * @return {Number} Returns -1 if the current version is smaller than the target version,
  22175. * 1 if greater, and 0 if they're equivalent
  22176. */
  22177. compare: function(current, target) {
  22178. var ver = current.isVersion ? current : new Version(current);
  22179. return ver.compareTo(target);
  22180. },
  22181. set: function(collection, packageName, version) {
  22182. var aliases = Version.aliases.to[packageName],
  22183. ver = version.isVersion ? version : new Version(version),
  22184. i;
  22185. collection[packageName] = ver;
  22186. if (aliases) {
  22187. for (i = aliases.length; i-- > 0; ) {
  22188. collection[aliases[i]] = ver;
  22189. }
  22190. }
  22191. return ver;
  22192. }
  22193. });
  22194. /**
  22195. * @class Ext
  22196. */
  22197. Ext.apply(Ext, {
  22198. /**
  22199. * @private
  22200. */
  22201. compatVersions: {},
  22202. /**
  22203. * @private
  22204. *
  22205. * Object containing version information for all packages utilized by your
  22206. * application.
  22207. *
  22208. * For a public getter, please see `Ext.getVersion()`.
  22209. */
  22210. versions: {},
  22211. /**
  22212. * @private
  22213. */
  22214. lastRegisteredVersion: null,
  22215. /**
  22216. * Get the compatibility level (a version number) for the given package name. If
  22217. * none has been registered with `Ext.setCompatVersion` then `Ext.getVersion` is
  22218. * used to get the current version.
  22219. *
  22220. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22221. * @since 5.0.0
  22222. * @private
  22223. */
  22224. getCompatVersion: function(packageName) {
  22225. var versions = Ext.compatVersions,
  22226. compat;
  22227. if (!packageName) {
  22228. compat = versions.ext || versions.touch || versions.core;
  22229. } else {
  22230. compat = versions[Version.aliases.from[packageName] || packageName];
  22231. }
  22232. return compat || Ext.getVersion(packageName);
  22233. },
  22234. /**
  22235. * Set the compatibility level (a version number) for the given package name.
  22236. *
  22237. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22238. * @param {String/Ext.Version} version The version, e.g. '4.2'.
  22239. * @since 5.0.0
  22240. * @private
  22241. */
  22242. setCompatVersion: function(packageName, version) {
  22243. Version.set(Ext.compatVersions, packageName, version);
  22244. },
  22245. /**
  22246. * Set version number for the given package name.
  22247. *
  22248. * @param {String} packageName The package name, e.g. 'core', 'touch', 'ext'.
  22249. * @param {String/Ext.Version} version The version, e.g. '1.2.3alpha', '2.4.0-dev'.
  22250. * @return {Ext}
  22251. */
  22252. setVersion: function(packageName, version) {
  22253. if (packageName in toolkitNames) {
  22254. Ext.toolkit = packageName;
  22255. }
  22256. Ext.lastRegisteredVersion = Version.set(Ext.versions, packageName, version);
  22257. return this;
  22258. },
  22259. /**
  22260. * Get the version number of the supplied package name; will return the version of
  22261. * the framework.
  22262. *
  22263. * @param {String} [packageName] The package name, e.g., 'core', 'touch', 'ext'.
  22264. * @return {Ext.Version} The version.
  22265. */
  22266. getVersion: function(packageName) {
  22267. var versions = Ext.versions;
  22268. if (!packageName) {
  22269. return versions.ext || versions.touch || versions.core;
  22270. }
  22271. return versions[Version.aliases.from[packageName] || packageName];
  22272. },
  22273. /**
  22274. * This method checks the registered package versions against the provided version
  22275. * `specs`. A `spec` is either a string or an object indicating a boolean operator.
  22276. * This method accepts either form or an array of these as the first argument. The
  22277. * second argument applies only when the first is an array and indicates whether
  22278. * all `specs` must match or just one.
  22279. *
  22280. * ## Package Version Specifications
  22281. * The string form of a `spec` is used to indicate a version or range of versions
  22282. * for a particular package. This form of `spec` consists of three (3) parts:
  22283. *
  22284. * * Package name followed by "@". If not provided, the framework is assumed.
  22285. * * Minimum version.
  22286. * * Maximum version.
  22287. *
  22288. * At least one version number must be provided. If both minimum and maximum are
  22289. * provided, these must be separated by a "-".
  22290. *
  22291. * Some examples of package version specifications:
  22292. *
  22293. * 4.2.2 (exactly version 4.2.2 of the framework)
  22294. * 4.2.2+ (version 4.2.2 or higher of the framework)
  22295. * 4.2.2- (version 4.2.2 or higher of the framework)
  22296. * 4.2.1 - 4.2.3 (versions from 4.2.1 up to 4.2.3 of the framework)
  22297. * - 4.2.2 (any version up to version 4.2.1 of the framework)
  22298. *
  22299. * foo@1.0 (exactly version 1.0 of package "foo")
  22300. * foo@1.0-1.3 (versions 1.0 up to 1.3 of package "foo")
  22301. *
  22302. * **NOTE:** This syntax is the same as that used in Sencha Cmd's package
  22303. * requirements declarations.
  22304. *
  22305. * ## Boolean Operator Specifications
  22306. * Instead of a string, an object can be used to describe a boolean operation to
  22307. * perform on one or more `specs`. The operator is either **`and`** or **`or`**
  22308. * and can contain an optional **`not`**.
  22309. *
  22310. * For example:
  22311. *
  22312. * {
  22313. * not: true, // negates boolean result
  22314. * and: [
  22315. * '4.2.2',
  22316. * 'foo@1.0.1 - 2.0.1'
  22317. * ]
  22318. * }
  22319. *
  22320. * Each element of the array can in turn be a string or object spec. In other
  22321. * words, the value is passed to this method (recursively) as the first argument
  22322. * so these two calls are equivalent:
  22323. *
  22324. * Ext.checkVersion({
  22325. * not: true, // negates boolean result
  22326. * and: [
  22327. * '4.2.2',
  22328. * 'foo@1.0.1 - 2.0.1'
  22329. * ]
  22330. * });
  22331. *
  22332. * !Ext.checkVersion([
  22333. * '4.2.2',
  22334. * 'foo@1.0.1 - 2.0.1'
  22335. * ], true);
  22336. *
  22337. * ## Examples
  22338. *
  22339. * // A specific framework version
  22340. * Ext.checkVersion('4.2.2');
  22341. *
  22342. * // A range of framework versions:
  22343. * Ext.checkVersion('4.2.1-4.2.3');
  22344. *
  22345. * // A specific version of a package:
  22346. * Ext.checkVersion('foo@1.0.1');
  22347. *
  22348. * // A single spec that requires both a framework version and package
  22349. * // version range to match:
  22350. * Ext.checkVersion({
  22351. * and: [
  22352. * '4.2.2',
  22353. * 'foo@1.0.1-1.0.2'
  22354. * ]
  22355. * });
  22356. *
  22357. * // These checks can be nested:
  22358. * Ext.checkVersion({
  22359. * and: [
  22360. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  22361. * {
  22362. * // either (or both) of these package specs:
  22363. * or: [
  22364. * 'foo@1.0.1-1.0.2',
  22365. * 'bar@3.0+'
  22366. * ]
  22367. * }
  22368. * ]
  22369. * });
  22370. *
  22371. * ## Version Comparisons
  22372. * Version comparsions are assumed to be "prefix" based. That is to say, `"foo@1.2"`
  22373. * matches any version of "foo" that has a major version 1 and a minor version of 2.
  22374. *
  22375. * This also applies to ranges. For example `"foo@1.2-2.2"` matches all versions
  22376. * of "foo" from 1.2 up to 2.2 regardless of the specific patch and build.
  22377. *
  22378. * ## Use in Overrides
  22379. * This methods primary use is in support of conditional overrides on an
  22380. * `Ext.define` declaration.
  22381. *
  22382. * @param {String/Array/Object} specs A version specification string, an object
  22383. * containing `or` or `and` with a value that is equivalent to `specs` or an array
  22384. * of either of these.
  22385. * @param {Boolean} [matchAll=false] Pass `true` to require all specs to match.
  22386. * @return {Boolean} True if `specs` matches the registered package versions.
  22387. */
  22388. checkVersion: function(specs, matchAll) {
  22389. var isArray = Ext.isArray(specs),
  22390. aliases = Version.aliases.from,
  22391. compat = isArray ? specs : checkVerTemp,
  22392. length = compat.length,
  22393. versions = Ext.versions,
  22394. frameworkVer = versions.ext || versions.touch,
  22395. i, index, matches, minVer, maxVer, packageName, spec, range, ver;
  22396. if (!isArray) {
  22397. checkVerTemp[0] = specs;
  22398. }
  22399. for (i = 0; i < length; ++i) {
  22400. if (!Ext.isString(spec = compat[i])) {
  22401. matches = Ext.checkVersion(spec.and || spec.or, !spec.or);
  22402. if (spec.not) {
  22403. matches = !matches;
  22404. }
  22405. } else {
  22406. if (spec.indexOf(' ') >= 0) {
  22407. spec = spec.replace(stripRe, '');
  22408. }
  22409. // For "name@..." syntax, we need to find the package by the given name
  22410. // as a registered package.
  22411. index = spec.indexOf('@');
  22412. if (index < 0) {
  22413. range = spec;
  22414. ver = frameworkVer;
  22415. } else {
  22416. packageName = spec.substring(0, index);
  22417. if (!(ver = versions[aliases[packageName] || packageName])) {
  22418. // The package is not registered, so if we must matchAll then
  22419. // we are done - FAIL:
  22420. if (matchAll) {
  22421. return false;
  22422. }
  22423. // Otherwise this spec is not a match so we can move on to the
  22424. // next...
  22425. continue;
  22426. }
  22427. range = spec.substring(index + 1);
  22428. }
  22429. // Now look for a version, version range or partial range:
  22430. index = range.indexOf('-');
  22431. if (index < 0) {
  22432. // just a version or "1.0+"
  22433. if (range.charAt(index = range.length - 1) === '+') {
  22434. minVer = range.substring(0, index);
  22435. maxVer = null;
  22436. } else {
  22437. minVer = maxVer = range;
  22438. }
  22439. } else if (index > 0) {
  22440. // a range like "1.0-1.5" or "1.0-"
  22441. minVer = range.substring(0, index);
  22442. maxVer = range.substring(index + 1);
  22443. } else // may be empty
  22444. {
  22445. // an upper limit like "-1.5"
  22446. minVer = null;
  22447. maxVer = range.substring(index + 1);
  22448. }
  22449. matches = true;
  22450. if (minVer) {
  22451. minVer = new Version(minVer, '~');
  22452. // prefix matching
  22453. matches = minVer.ltEq(ver);
  22454. }
  22455. if (matches && maxVer) {
  22456. maxVer = new Version(maxVer, '~');
  22457. // prefix matching
  22458. matches = maxVer.gtEq(ver);
  22459. }
  22460. }
  22461. // string spec
  22462. if (matches) {
  22463. // spec matched and we are looking for any match, so we are GO!
  22464. if (!matchAll) {
  22465. return true;
  22466. }
  22467. } else if (matchAll) {
  22468. // spec does not match the registered package version
  22469. return false;
  22470. }
  22471. }
  22472. // In the loop above, for matchAll we return FALSE on mismatch, so getting
  22473. // here with matchAll means we had no mismatches. On the other hand, if we
  22474. // are !matchAll, we return TRUE on match and so we get here only if we found
  22475. // no matches.
  22476. return !!matchAll;
  22477. },
  22478. /**
  22479. * Create a closure for deprecated code.
  22480. *
  22481. * // This means Ext.oldMethod is only supported in 4.0.0beta and older.
  22482. * // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta',
  22483. * // for example '4.0.0RC', the closure will not be invoked
  22484. * Ext.deprecate('extjs', '4.0.0beta', function() {
  22485. * Ext.oldMethod = Ext.newMethod;
  22486. *
  22487. * ...
  22488. * });
  22489. *
  22490. * @param {String} packageName The package name
  22491. * @param {String} since The last version before it's deprecated
  22492. * @param {Function} closure The callback function to be executed with the specified
  22493. * version is less than the current version
  22494. * @param {Object} scope The execution scope (`this`) if the closure
  22495. * @private
  22496. */
  22497. deprecate: function(packageName, since, closure, scope) {
  22498. if (Version.compare(Ext.getVersion(packageName), since) < 1) {
  22499. closure.call(scope);
  22500. }
  22501. }
  22502. });
  22503. }());
  22504. // End Versioning
  22505. // load the cmd-5 style app manifest metadata now, if available...
  22506. (function(manifest) {
  22507. var packages = (manifest && manifest.packages) || {},
  22508. compat = manifest && manifest.compatibility,
  22509. name, pkg;
  22510. for (name in packages) {
  22511. pkg = packages[name];
  22512. if (pkg && pkg.version) {
  22513. Ext.setVersion(name, pkg.version);
  22514. }
  22515. }
  22516. if (compat) {
  22517. if (Ext.isString(compat)) {
  22518. Ext.setCompatVersion('core', compat);
  22519. } else {
  22520. for (name in compat) {
  22521. Ext.setCompatVersion(name, compat[name]);
  22522. }
  22523. }
  22524. }
  22525. if (!packages.ext && !packages.touch) {
  22526. Ext.setVersion('ext', '7.0.0.168');
  22527. Ext.setVersion('core', '7.0.0.168');
  22528. }
  22529. })(Ext.manifest);
  22530. /**
  22531. * @class Ext.Config
  22532. * This class manages a config property. Instances of this type are created and cached as
  22533. * classes declare their config properties. One instance of this class is created per
  22534. * config property name.
  22535. *
  22536. * Ext.define('MyClass', {
  22537. * config: {
  22538. * foo: 42
  22539. * }
  22540. * });
  22541. *
  22542. * This uses the cached `Ext.Config` instance for the "foo" property.
  22543. *
  22544. * When config properties apply options to config properties a prototype chained object is
  22545. * created from the cached instance. For example:
  22546. *
  22547. * Ext.define('MyClass', {
  22548. * config: {
  22549. * foo: {
  22550. * $value: 42,
  22551. * lazy: true
  22552. * }
  22553. * }
  22554. * });
  22555. *
  22556. * This creates a prototype chain to the cached "foo" instance of `Ext.Config` and applies
  22557. * the `lazy` option to that new instance. This chained instance is then kept by the
  22558. * `Ext.Configurator` for that class.
  22559. * @private
  22560. */
  22561. Ext.Config = function(name) {
  22562. // @define Ext.class.Config
  22563. // @define Ext.Config
  22564. var me = this,
  22565. capitalizedName = name.charAt(0).toUpperCase() + name.substr(1);
  22566. /**
  22567. * @property {String} name
  22568. * The name of this config property.
  22569. * @readonly
  22570. * @private
  22571. * @since 5.0.0
  22572. */
  22573. me.name = name;
  22574. /**
  22575. * @property {Object} names
  22576. * This object holds the cached names used to lookup properties or methods for this
  22577. * config property. The properties of this object are explained in the context of an
  22578. * example property named "foo".
  22579. *
  22580. * @property {String} names.internal The default backing property ("_foo").
  22581. *
  22582. * @property {String} names.initializing The property that is `true` when the config
  22583. * is being initialized ("isFooInitializing").
  22584. *
  22585. * @property {String} names.apply The name of the applier method ("applyFoo").
  22586. *
  22587. * @property {String} names.update The name of the updater method ("updateFoo").
  22588. *
  22589. * @property {String} names.get The name of the getter method ("getFoo").
  22590. *
  22591. * @property {String} names.set The name of the setter method ("setFoo").
  22592. *
  22593. * @property {String} names.initGet The name of the initializing getter ("initGetFoo").
  22594. *
  22595. * @property {String} names.changeEvent The name of the change event ("foochange").
  22596. *
  22597. * @readonly
  22598. * @private
  22599. * @since 5.0.0
  22600. */
  22601. me.names = {
  22602. internal: '_' + name,
  22603. initializing: 'is' + capitalizedName + 'Initializing',
  22604. apply: 'apply' + capitalizedName,
  22605. update: 'update' + capitalizedName,
  22606. get: 'get' + capitalizedName,
  22607. set: 'set' + capitalizedName,
  22608. initGet: 'initGet' + capitalizedName,
  22609. changeEvent: name.toLowerCase() + 'change'
  22610. };
  22611. // This allows folks to prototype chain on top of these objects and yet still cache
  22612. // generated methods at the bottom of the chain.
  22613. me.root = me;
  22614. };
  22615. Ext.Config.map = {};
  22616. Ext.Config.get = function(name) {
  22617. var map = Ext.Config.map,
  22618. ret = map[name] || (map[name] = new Ext.Config(name));
  22619. return ret;
  22620. };
  22621. Ext.Config.prototype = {
  22622. self: Ext.Config,
  22623. isConfig: true,
  22624. /**
  22625. * @cfg {Boolean} [cached=false]
  22626. * When set as `true` the config property will be stored on the class prototype once
  22627. * the first instance has had a chance to process the default value.
  22628. * @private
  22629. * @since 5.0.0
  22630. */
  22631. /**
  22632. * @cfg {Boolean} [lazy=false]
  22633. * When set as `true` the config property will not be immediately initialized during
  22634. * the `initConfig` call.
  22635. * @private
  22636. * @since 5.0.0
  22637. */
  22638. /**
  22639. * @cfg {Boolean} [evented=false]
  22640. * When set as `true` the config property will be treated as a
  22641. * {@link Ext.Evented Evented Config}.
  22642. * @private
  22643. * @since 6.0.0
  22644. */
  22645. /**
  22646. * @cfg {Function} [merge]
  22647. * This function if supplied will be called as classes or instances provide values
  22648. * that need to be combined with inherited values. The function should return the
  22649. * value that will be the config value. Further calls may receive such returned
  22650. * values as `oldValue`.
  22651. *
  22652. * @cfg {Mixed} merge.newValue The new value to merge with the old.
  22653. *
  22654. * @cfg {Mixed} merge.oldValue The current value prior to `newValue` being merged.
  22655. *
  22656. * @cfg {Mixed} merge.target The class or instance to which the merged config value
  22657. * will be applied.
  22658. *
  22659. * @cfg {Ext.Class} merge.mixinClass The mixin providing the `newValue` or `null` if
  22660. * the `newValue` is not being provided by a mixin.
  22661. */
  22662. combine: function(value, baseValue, instance, clone) {
  22663. var cfg = this;
  22664. if (cfg.merge) {
  22665. value = cfg.merge(clone ? Ext.clone(value) : value, baseValue, instance);
  22666. } else if (value && value.constructor === Object && baseValue && baseValue.constructor === Object) {
  22667. value = Ext.merge({}, baseValue, value);
  22668. } else if (clone && value) {
  22669. value = Ext.clone(value);
  22670. }
  22671. return value;
  22672. },
  22673. equals: function(value1, value2) {
  22674. return value1 === value2;
  22675. },
  22676. getGetter: function() {
  22677. return this.getter || (this.root.getter = this.makeGetter());
  22678. },
  22679. getInitGetter: function() {
  22680. return this.initGetter || (this.root.initGetter = this.makeInitGetter());
  22681. },
  22682. getSetter: function() {
  22683. return this.setter || (this.root.setter = this.makeSetter());
  22684. },
  22685. getEventedSetter: function() {
  22686. return this.eventedSetter || (this.root.eventedSetter = this.makeEventedSetter());
  22687. },
  22688. /**
  22689. * Returns the name of the property that stores this config on the given instance or
  22690. * class prototype.
  22691. * @param {Object} target
  22692. * @return {String}
  22693. */
  22694. getInternalName: function(target) {
  22695. return target.$configPrefixed ? this.names.internal : this.name;
  22696. },
  22697. mergeNew: function(newValue, oldValue, target, mixinClass) {
  22698. var ret, key;
  22699. if (!oldValue) {
  22700. ret = newValue;
  22701. } else if (!newValue) {
  22702. ret = oldValue;
  22703. } else {
  22704. ret = Ext.Object.chain(oldValue);
  22705. for (key in newValue) {
  22706. if (!mixinClass || !(key in ret)) {
  22707. ret[key] = newValue[key];
  22708. }
  22709. }
  22710. }
  22711. return ret;
  22712. },
  22713. /**
  22714. * Merges the `newValue` and the `oldValue` assuming that these are basically objects
  22715. * the represent sets. For example something like:
  22716. *
  22717. * {
  22718. * foo: true,
  22719. * bar: true
  22720. * }
  22721. *
  22722. * The merge process converts arrays like the following into the above:
  22723. *
  22724. * [ 'foo', 'bar' ]
  22725. *
  22726. * @param {String/String[]/Object} newValue
  22727. * @param {Object} oldValue
  22728. * @param {Boolean} [preserveExisting=false]
  22729. * @return {Object}
  22730. * @private
  22731. * @since 5.0.0
  22732. */
  22733. mergeSets: function(newValue, oldValue, preserveExisting) {
  22734. var ret = oldValue ? Ext.Object.chain(oldValue) : {},
  22735. i, val;
  22736. if (newValue instanceof Array) {
  22737. for (i = newValue.length; i--; ) {
  22738. val = newValue[i];
  22739. if (!preserveExisting || !(val in ret)) {
  22740. ret[val] = true;
  22741. }
  22742. }
  22743. } else if (newValue) {
  22744. if (newValue.constructor === Object) {
  22745. for (i in newValue) {
  22746. val = newValue[i];
  22747. if (!preserveExisting || !(i in ret)) {
  22748. ret[i] = val;
  22749. }
  22750. }
  22751. } else if (!preserveExisting || !(newValue in ret)) {
  22752. ret[newValue] = true;
  22753. }
  22754. }
  22755. return ret;
  22756. },
  22757. //--------------------------------------------------
  22758. // Factories
  22759. makeGetter: function() {
  22760. var name = this.name,
  22761. prefixedName = this.names.internal;
  22762. return function() {
  22763. var internalName = this.$configPrefixed ? prefixedName : name;
  22764. return this[internalName];
  22765. };
  22766. },
  22767. makeInitGetter: function() {
  22768. var name = this.name,
  22769. names = this.names,
  22770. setName = names.set,
  22771. getName = names.get,
  22772. initializingName = names.initializing;
  22773. return function() {
  22774. var me = this;
  22775. me[initializingName] = true;
  22776. // Remove the initGetter from the instance now that the value has been set.
  22777. delete me[getName];
  22778. me[setName](me.config[name]);
  22779. delete me[initializingName];
  22780. return me[getName].apply(me, arguments);
  22781. };
  22782. },
  22783. makeSetter: function() {
  22784. var name = this.name,
  22785. names = this.names,
  22786. prefixedName = names.internal,
  22787. getName = names.get,
  22788. applyName = names.apply,
  22789. updateName = names.update,
  22790. setter;
  22791. // http://jsperf.com/method-call-apply-or-direct
  22792. // http://jsperf.com/method-detect-invoke
  22793. setter = function(value) {
  22794. var me = this,
  22795. internalName = me.$configPrefixed ? prefixedName : name,
  22796. oldValue = me[internalName],
  22797. watch;
  22798. // Remove the initGetter from the instance now that the value has been set.
  22799. delete me[getName];
  22800. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22801. // The old value might have been changed at this point
  22802. // (after the apply call chain) so it should be read again
  22803. if (value !== (oldValue = me[internalName])) {
  22804. me[internalName] = value;
  22805. if (me[updateName]) {
  22806. me[updateName](value, oldValue);
  22807. }
  22808. watch = me.$configWatch;
  22809. if (watch && !me.isConfiguring) {
  22810. // Since the updater could have modified things (tho unlikely), just
  22811. // re-read the stored value:
  22812. watch.fire(name, [
  22813. me,
  22814. name,
  22815. me[internalName],
  22816. oldValue
  22817. ]);
  22818. }
  22819. }
  22820. }
  22821. return me;
  22822. };
  22823. setter.$isDefault = true;
  22824. return setter;
  22825. },
  22826. makeEventedSetter: function() {
  22827. var name = this.name,
  22828. names = this.names,
  22829. prefixedName = names.internal,
  22830. getName = names.get,
  22831. applyName = names.apply,
  22832. updateName = names.update,
  22833. changeEventName = names.changeEvent,
  22834. updateFn = function(me, value, oldValue, internalName) {
  22835. me[internalName] = value;
  22836. if (me[updateName]) {
  22837. me[updateName](value, oldValue);
  22838. }
  22839. // eslint-disable-next-line vars-on-top
  22840. var watch = me.$configWatch;
  22841. if (watch) {
  22842. // !me.isConfiguring is assured
  22843. watch.fire(name, [
  22844. me,
  22845. name,
  22846. value,
  22847. oldValue
  22848. ]);
  22849. }
  22850. },
  22851. setter;
  22852. // http://jsperf.com/method-call-apply-or-direct
  22853. // http://jsperf.com/method-detect-invoke
  22854. setter = function(value) {
  22855. var me = this,
  22856. internalName = me.$configPrefixed ? prefixedName : name,
  22857. oldValue = me[internalName];
  22858. // Remove the initGetter from the instance now that the value has been set.
  22859. delete me[getName];
  22860. if (!me[applyName] || (value = me[applyName](value, oldValue)) !== undefined) {
  22861. // The old value might have been changed at this point
  22862. // (after the apply call chain) so it should be read again
  22863. if (value !== (oldValue = me[internalName])) {
  22864. if (me.isConfiguring) {
  22865. me[internalName] = value;
  22866. if (me[updateName]) {
  22867. me[updateName](value, oldValue);
  22868. }
  22869. } else {
  22870. me.fireEventedAction(changeEventName, [
  22871. me,
  22872. value,
  22873. oldValue
  22874. ], updateFn, me, [
  22875. me,
  22876. value,
  22877. oldValue,
  22878. internalName
  22879. ]);
  22880. }
  22881. }
  22882. }
  22883. return me;
  22884. };
  22885. setter.$isDefault = true;
  22886. return setter;
  22887. }
  22888. };
  22889. /**
  22890. * @class Ext.Configurator
  22891. * This class manages the config properties for a class.
  22892. * @private
  22893. */
  22894. (function() {
  22895. // see end of file (and please don't indent the whole file)
  22896. var ExtConfig = Ext.Config,
  22897. configPropMap = ExtConfig.map,
  22898. ExtObject = Ext.Object;
  22899. Ext.Configurator = function(cls) {
  22900. // @define Ext.class.Configurator
  22901. // @define Ext.Configurator
  22902. // @require Ext.Config
  22903. var me = this,
  22904. prototype = cls.prototype,
  22905. superCfg = cls.superclass ? cls.superclass.self.$config : null;
  22906. /**
  22907. * @property {Ext.Class} cls The class to which this instance is associated.
  22908. * @private
  22909. * @readonly
  22910. */
  22911. me.cls = cls;
  22912. /**
  22913. * The super class `Configurator` instance or `null` if there is no super class.
  22914. *
  22915. * @property {Ext.Configurator} superCfg
  22916. * @private
  22917. * @readonly
  22918. */
  22919. me.superCfg = superCfg;
  22920. if (superCfg) {
  22921. /**
  22922. * This object holds an `Ext.Config` value for each config property keyed by name.
  22923. * This object has as its prototype object the `configs` of its super class.
  22924. *
  22925. * This map is maintained as each property is added via the `add` method.
  22926. *
  22927. * @property {Object} configs
  22928. * @private
  22929. * @readonly
  22930. */
  22931. me.configs = ExtObject.chain(superCfg.configs);
  22932. /**
  22933. * This object holds a bool value for each cachedConfig property keyed by name.
  22934. *
  22935. * This map is maintained as each property is added via the `add` method.
  22936. *
  22937. * @property {Object} cachedConfigs
  22938. * @private
  22939. * @readonly
  22940. */
  22941. me.cachedConfigs = ExtObject.chain(superCfg.cachedConfigs);
  22942. /**
  22943. * This object holds a `Number` for each config property keyed by name. This object has
  22944. * as its prototype object the `initMap` of its super class. The value of each property
  22945. * has the following meaning:
  22946. *
  22947. * * `0` - initial value is `null` and requires no processing.
  22948. * * `1` - initial value must be set on each instance.
  22949. * * `2` - initial value can be cached on the prototype by the first instance.
  22950. *
  22951. * Any `null` values will either never be added to this map or (if added by a base
  22952. * class and set to `null` by a derived class) will cause the entry to be 0.
  22953. *
  22954. * This map is maintained as each property is added via the `add` method.
  22955. *
  22956. * @property {Object} initMap
  22957. * @private
  22958. * @readonly
  22959. */
  22960. me.initMap = ExtObject.chain(superCfg.initMap);
  22961. /**
  22962. * This object holds the default value for each config property keyed by name. This
  22963. * object has as its prototype object the `values` of its super class.
  22964. *
  22965. * This map is maintained as each property is added via the `add` method.
  22966. *
  22967. * @property {Object} values
  22968. * @private
  22969. * @readonly
  22970. */
  22971. me.values = ExtObject.chain(superCfg.values);
  22972. me.needsFork = superCfg.needsFork;
  22973. // The reason this feature is debug only is that we would have to create this
  22974. // map for all classes because deprecations could be added to bases after the
  22975. // derived class had created its Configurator.
  22976. me.deprecations = ExtObject.chain(superCfg.deprecations);
  22977. } else {
  22978. me.configs = {};
  22979. me.cachedConfigs = {};
  22980. me.initMap = {};
  22981. me.values = {};
  22982. me.deprecations = {};
  22983. }
  22984. prototype.config = prototype.defaultConfig = me.values;
  22985. cls.$config = me;
  22986. };
  22987. Ext.Configurator.prototype = {
  22988. self: Ext.Configurator,
  22989. needsFork: false,
  22990. /**
  22991. * This array holds the properties that need to be set on new instances.
  22992. *
  22993. * This array is populated when the first instance is passed to `configure` (basically
  22994. * when the first instance is created). The entries in `initMap` are iterated to find
  22995. * those configs needing per-instance processing.
  22996. *
  22997. * @property {Ext.Config[]} initList
  22998. * @private
  22999. */
  23000. initList: null,
  23001. /**
  23002. * This method adds new config properties. This is called for classes when they are
  23003. * declared, then for any mixins that class may define and finally for any overrides
  23004. * defined that target the class.
  23005. *
  23006. * @param {Object} config The config object containing the new config properties.
  23007. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  23008. * @private
  23009. */
  23010. add: function(config, mixinClass) {
  23011. var me = this,
  23012. Cls = me.cls,
  23013. configs = me.configs,
  23014. cachedConfigs = me.cachedConfigs,
  23015. initMap = me.initMap,
  23016. prototype = Cls.prototype,
  23017. mixinConfigs = mixinClass && mixinClass.$config.configs,
  23018. values = me.values,
  23019. isObject, meta, isCached, merge, cfg, currentValue, name, names, s, value;
  23020. for (name in config) {
  23021. value = config[name];
  23022. isObject = value && value.constructor === Object;
  23023. meta = isObject && '$value' in value ? value : null;
  23024. isCached = false;
  23025. if (meta) {
  23026. isCached = !!meta.cached;
  23027. value = meta.$value;
  23028. isObject = value && value.constructor === Object;
  23029. }
  23030. merge = meta && meta.merge;
  23031. cfg = configs[name];
  23032. if (cfg) {
  23033. // Only proceed with a mixin if we have a custom merge.
  23034. if (mixinClass) {
  23035. merge = cfg.merge;
  23036. if (!merge) {
  23037. continue;
  23038. }
  23039. // Don't want the mixin meta modifying our own
  23040. meta = null;
  23041. } else {
  23042. merge = merge || cfg.merge;
  23043. }
  23044. // This means that we've already declared this as a config in a superclass
  23045. // Let's not allow us to change it here.
  23046. if (!mixinClass && isCached && !cachedConfigs[name]) {
  23047. Ext.raise('Redefining config as cached: ' + name + ' in class: ' + Cls.$className);
  23048. }
  23049. // There is already a value for this config and we are not allowed to
  23050. // modify it. So, if it is an object and the new value is also an object,
  23051. // the result is a merge so we have to merge both on to a new object.
  23052. currentValue = values[name];
  23053. if (merge) {
  23054. value = merge.call(cfg, value, currentValue, Cls, mixinClass);
  23055. } else if (isObject) {
  23056. if (currentValue && currentValue.constructor === Object) {
  23057. // We favor moving the cost of an "extra" copy here because this
  23058. // is likely to be a rare thing two object values for the same
  23059. // property. The alternative would be to clone the initial value
  23060. // to make it safely modifiable even though it is likely to never
  23061. // need to be modified.
  23062. value = Ext.merge({}, currentValue, value);
  23063. }
  23064. }
  23065. } else // else "currentValue" is a primitive so "value" can just replace it
  23066. // else "value" is a primitive and it can just replace currentValue
  23067. {
  23068. // This is a new property value, so add it to the various maps "as is".
  23069. // In the majority of cases this value will not be overridden or need to
  23070. // be forked.
  23071. if (mixinConfigs) {
  23072. // Since this is a config from a mixin, we don't want to apply its
  23073. // meta-ness because it already has. Instead we want to use its cfg
  23074. // instance:
  23075. cfg = mixinConfigs[name];
  23076. meta = null;
  23077. } else {
  23078. cfg = ExtConfig.get(name);
  23079. }
  23080. configs[name] = cfg;
  23081. if (cfg.cached || isCached) {
  23082. cachedConfigs[name] = true;
  23083. }
  23084. // Ensure that the new config has a getter and setter. Because this method
  23085. // is called during class creation as the "config" (or "cachedConfig") is
  23086. // being processed, the user's methods will not be on the prototype yet.
  23087. //
  23088. // This has the following trade-offs:
  23089. //
  23090. // - Custom getters are rare so there is minimal waste generated by them.
  23091. //
  23092. // - Custom setters are more common but, by putting the default setter on
  23093. // the prototype prior to addMembers, when the user methods are added
  23094. // callParent can be used to call the generated setter. This is almost
  23095. // certainly desirable as the setter has some very important semantics
  23096. // that a custom setter would probably want to preserve by just adding
  23097. // logic before and/or after the callParent.
  23098. //
  23099. // - By not adding these to the class body we avoid all the "is function"
  23100. // tests that get applied to each class member thereby streamlining the
  23101. // downstream class creation process.
  23102. //
  23103. // We still check for getter and/or setter but primarily for reasons of
  23104. // backwards compatibility and "just in case" someone relied on inherited
  23105. // getter/setter even though the base did not have the property listed as
  23106. // a "config" (obscure case certainly).
  23107. //
  23108. names = cfg.names;
  23109. if (!prototype[s = names.get]) {
  23110. prototype[s] = cfg.getter || cfg.getGetter();
  23111. }
  23112. if (!prototype[s = names.set]) {
  23113. prototype[s] = (meta && meta.evented) ? (cfg.eventedSetter || cfg.getEventedSetter()) : (cfg.setter || cfg.getSetter());
  23114. }
  23115. }
  23116. if (meta) {
  23117. if (cfg.owner !== Cls) {
  23118. configs[name] = cfg = Ext.Object.chain(cfg);
  23119. cfg.owner = Cls;
  23120. }
  23121. Ext.apply(cfg, meta);
  23122. delete cfg.$value;
  23123. }
  23124. // Fork checks all the default values to see if they are arrays or objects
  23125. // Do this to save us from doing it on each run
  23126. if (!me.needsFork && value && (value.constructor === Object || value instanceof Array)) {
  23127. me.needsFork = true;
  23128. }
  23129. // If the value is non-null, we need to initialize it.
  23130. if (value !== null) {
  23131. initMap[name] = true;
  23132. } else {
  23133. if (prototype.$configPrefixed) {
  23134. prototype[configs[name].names.internal] = null;
  23135. } else {
  23136. prototype[configs[name].name] = null;
  23137. }
  23138. if (name in initMap) {
  23139. // Only set this to false if we already have it in the map, otherwise,
  23140. // just leave it out!
  23141. initMap[name] = false;
  23142. }
  23143. }
  23144. values[name] = value;
  23145. }
  23146. },
  23147. addDeprecations: function(configs) {
  23148. var me = this,
  23149. deprecations = me.deprecations,
  23150. className = (me.cls.$className || '') + '#',
  23151. message, newName, oldName;
  23152. for (oldName in configs) {
  23153. newName = configs[oldName];
  23154. // configs: {
  23155. // dead: null,
  23156. //
  23157. // renamed: 'newName',
  23158. //
  23159. // removed: {
  23160. // message: 'This config was replaced by pixie dust'
  23161. // }
  23162. // }
  23163. if (!newName) {
  23164. message = 'This config has been removed.';
  23165. } else if (!(message = newName.message)) {
  23166. message = 'This config has been renamed to "' + newName + '"';
  23167. }
  23168. deprecations[oldName] = className + oldName + ': ' + message;
  23169. }
  23170. },
  23171. /**
  23172. * This method configures the given `instance` using the specified `instanceConfig`.
  23173. * The given `instance` should have been created by this object's `cls`.
  23174. *
  23175. * @param {Object} instance The instance to configure.
  23176. * @param {Object} instanceConfig The configuration properties to apply to `instance`.
  23177. * @private
  23178. */
  23179. configure: function(instance, instanceConfig) {
  23180. var me = this,
  23181. configs = me.configs,
  23182. deprecations = me.deprecations,
  23183. initMap = me.initMap,
  23184. initListMap = me.initListMap,
  23185. initList = me.initList,
  23186. prototype = me.cls.prototype,
  23187. values = me.values,
  23188. remaining = 0,
  23189. firstInstance = !initList,
  23190. cachedInitList, cfg, getter, i, internalName, ln, names, name, value, isCached, valuesKey, field, transforms;
  23191. values = me.needsFork ? ExtObject.fork(values) : ExtObject.chain(values);
  23192. // Let apply/update methods know that the initConfig is currently running.
  23193. instance.isConfiguring = true;
  23194. if (firstInstance) {
  23195. // When called to configure the first instance of the class to which we are
  23196. // bound we take a bit to plan for instance 2+.
  23197. me.initList = initList = [];
  23198. me.initListMap = initListMap = {};
  23199. instance.isFirstInstance = true;
  23200. for (name in initMap) {
  23201. cfg = configs[name];
  23202. isCached = cfg.cached;
  23203. if (initMap[name]) {
  23204. names = cfg.names;
  23205. value = values[name];
  23206. if (!prototype[names.set].$isDefault || prototype[names.apply] || prototype[names.update] || typeof value === 'object') {
  23207. if (isCached) {
  23208. // This is a cachedConfig, so it needs to be initialized with
  23209. // the default value and placed on the prototype... but the
  23210. // instanceConfig may have a different value so the value may
  23211. // need resetting. We have to defer the call to the setter so
  23212. // that all of the initGetters are set up first.
  23213. (cachedInitList || (cachedInitList = [])).push(cfg);
  23214. } else {
  23215. // Remember this config so that all instances (including this
  23216. // one) can invoke the setter to properly initialize it.
  23217. initList.push(cfg);
  23218. initListMap[name] = true;
  23219. }
  23220. // Point all getters to the initGetters. By doing this here we
  23221. // avoid creating initGetters for configs that don't need them
  23222. // and we can easily pick up the cached fn to save the call.
  23223. instance[names.get] = cfg.initGetter || cfg.getInitGetter();
  23224. } else {
  23225. // Non-object configs w/o custom setter, applier or updater can
  23226. // be simply stored on the prototype.
  23227. prototype[cfg.getInternalName(prototype)] = value;
  23228. }
  23229. } else if (isCached) {
  23230. prototype[cfg.getInternalName(prototype)] = undefined;
  23231. }
  23232. }
  23233. }
  23234. // TODO - we need to combine the cached loop with the instanceConfig loop to
  23235. // avoid duplication of init getter setups (for correctness if a cached cfg
  23236. // calls on a non-cached cfg)
  23237. ln = cachedInitList && cachedInitList.length;
  23238. if (ln) {
  23239. // This is only ever done on the first instance we configure. Any config in
  23240. // cachedInitList has to be set to the default value to allow any side-effects
  23241. // or transformations to occur. The resulting values can then be elevated to
  23242. // the prototype and this property need not be initialized on each instance.
  23243. for (i = 0; i < ln; ++i) {
  23244. internalName = cachedInitList[i].getInternalName(prototype);
  23245. // Since these are cached configs the base class will potentially have put
  23246. // its cached values on the prototype so we need to hide these while we
  23247. // run the inits for our cached configs.
  23248. instance[internalName] = null;
  23249. }
  23250. for (i = 0; i < ln; ++i) {
  23251. names = (cfg = cachedInitList[i]).names;
  23252. getter = names.get;
  23253. if (instance.hasOwnProperty(getter)) {
  23254. instance[names.set](values[cfg.name]);
  23255. delete instance[getter];
  23256. }
  23257. }
  23258. for (i = 0; i < ln; ++i) {
  23259. internalName = cachedInitList[i].getInternalName(prototype);
  23260. prototype[internalName] = instance[internalName];
  23261. delete instance[internalName];
  23262. }
  23263. }
  23264. // The cachedConfigs have all been set to the default values including any of
  23265. // those that may have been triggered by their getter.
  23266. // If the instanceConfig has a platformConfig in it, we need to merge the active
  23267. // rules of that object to make the actual instanceConfig.
  23268. if (instanceConfig && instanceConfig.platformConfig) {
  23269. instanceConfig = me.resolvePlatformConfig(instance, instanceConfig);
  23270. }
  23271. if (firstInstance) {
  23272. // Allow the class to do things once the cachedConfig has been processed.
  23273. // We need to call this method always when the first instance is configured
  23274. // whether or not it actually has cached configs
  23275. if (instance.afterCachedConfig && !instance.afterCachedConfig.$nullFn) {
  23276. instance.afterCachedConfig(instanceConfig);
  23277. }
  23278. }
  23279. // Now that the cachedConfigs have been processed we can apply the instanceConfig
  23280. // and hide the "configs" on the prototype. This will serve as the source for any
  23281. // configs that need to initialize from their initial getter call.
  23282. // IMPORTANT: "this.hasOwnProperty('config')" is how a config applier/updater can
  23283. // tell it is processing the cached config value vs an instance config value.
  23284. instance.config = values;
  23285. // There are 2 possibilities here:
  23286. // 1) If it's the first time in this function, we may have had cachedConfigs running.
  23287. // these configs may have called the getters for any of the normal getters, which
  23288. // means the initial getters have been clobbered on the instance and won't be able
  23289. // to be called below when we iterate over the initList. As such, we need to
  23290. // reinitialize them here, even though we've done it up above.
  23291. //
  23292. // 2) If this the second time in this function, the cachedConfigs won't be processed,
  23293. // so we don't need to worry about them clobbering config values. However, since
  23294. // we've already done all our setup, we won't enter into the block that sets the
  23295. // initGetter, so we need to do it here anyway.
  23296. //
  23297. // Also note, that lazy configs will appear in the initList because we need
  23298. // to spin up the initGetter.
  23299. for (i = 0 , ln = initList.length; i < ln; ++i) {
  23300. cfg = initList[i];
  23301. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23302. }
  23303. // Give the class a chance to transform the configs. These are stored on the class
  23304. // as a sorted array after the first instance is created. Prior to that, these are
  23305. // stored as a prototype chained object on the class prototype. This allows the
  23306. // transforms to be registered at any time during class load so long as they are
  23307. // all loaded before instances are created.
  23308. if (!(transforms = instance.self.$configTransforms)) {
  23309. instance.self.$configTransforms = transforms = [];
  23310. ln = instance.$configTransforms;
  23311. for (name in ln) {
  23312. transforms.push([
  23313. name,
  23314. ln[name]
  23315. ]);
  23316. }
  23317. ln = transforms.length;
  23318. if (ln > 1) {
  23319. transforms.sort(me.transformSorter);
  23320. for (i = 0; i < ln; ++i) {
  23321. transforms[i] = transforms[i][0];
  23322. }
  23323. } else if (ln) {
  23324. transforms[0] = transforms[0][0];
  23325. }
  23326. }
  23327. for (i = 0; i < transforms.length; ++i) {
  23328. name = transforms[i];
  23329. if (instance[name]) {
  23330. instanceConfig = instance[name](instanceConfig, me);
  23331. }
  23332. }
  23333. // Important: We are looping here twice on purpose. This first loop serves 2 purposes:
  23334. //
  23335. // 1) Ensure the values collection is fully populated before we call any setters. Since
  23336. // a setter may have an updater/applier, it could potentially call another getter() to grab
  23337. // the value for some other property, so this ensures they are all set on the config object.
  23338. //
  23339. // 2) Ensure that the initGetter is set as the getter for any config that doesn't appear in
  23340. // the initList. We need to ensure that the initGetter is pushed on for everything that
  23341. // we will be setting during init time.
  23342. //
  23343. // The merging in this loop cannot be completed by Ext.merge(), since we do NOT want
  23344. // to merge non-strict values, they should always just be assigned across without
  23345. // modification.
  23346. if (instanceConfig) {
  23347. for (name in instanceConfig) {
  23348. value = instanceConfig[name];
  23349. cfg = configs[name];
  23350. if (deprecations[name]) {
  23351. Ext.log.warn(deprecations[name]);
  23352. if (!cfg) {
  23353. // If there is a Config for this, perhaps the class is emulating
  23354. // the old config... If there is not a Config we don't want to
  23355. // proceed and put the property on the instance. That will likely
  23356. // hide the bug during development.
  23357. continue;
  23358. }
  23359. }
  23360. if (!cfg) {
  23361. field = instance.self.prototype[name];
  23362. if (instance.$configStrict && (typeof field === 'function') && !field.$nullFn) {
  23363. // In strict mode you cannot override functions
  23364. Ext.raise('Cannot override method ' + name + ' on ' + instance.$className + ' instance.');
  23365. }
  23366. // Not all "configs" use the config system so in this case simply put
  23367. // the value on the instance:
  23368. instance[name] = value;
  23369. } else {
  23370. // However we still need to create the initial value that needs
  23371. // to be used. We also need to spin up the initGetter.
  23372. if (!cfg.lazy) {
  23373. ++remaining;
  23374. }
  23375. if (!initListMap[name]) {
  23376. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23377. }
  23378. valuesKey = values[name];
  23379. if (cfg.merge) {
  23380. value = cfg.merge(value, valuesKey, instance);
  23381. } else if (value && value.constructor === Object) {
  23382. if (valuesKey && valuesKey.constructor === Object) {
  23383. value = Ext.merge(values[name], value);
  23384. } else {
  23385. value = Ext.clone(value, false);
  23386. }
  23387. }
  23388. }
  23389. values[name] = value;
  23390. }
  23391. }
  23392. // Give the class a chance to hook in prior to initializing the configs.
  23393. if (instance.beforeInitConfig && !instance.beforeInitConfig.$nullFn) {
  23394. if (instance.beforeInitConfig(instanceConfig) === false) {
  23395. return;
  23396. }
  23397. }
  23398. if (instanceConfig) {
  23399. for (name in instanceConfig) {
  23400. if (!remaining) {
  23401. // For classes that have few proper Config properties, this saves us
  23402. // from making the full 2 passes over the instanceConfig.
  23403. break;
  23404. }
  23405. // We can ignore deprecated configs here because we warned about them
  23406. // above. Further, since we only process proper Config's here we would
  23407. // not be skipping them anyway.
  23408. cfg = configs[name];
  23409. if (cfg && !cfg.lazy) {
  23410. --remaining;
  23411. // A proper "config" property so call the setter to set the value.
  23412. names = cfg.names;
  23413. getter = names.get;
  23414. // At this point the initGetter may have already been called and
  23415. // cleared if the getter was called from the applier or updater of a
  23416. // previously processed instance config. checking if the instance has
  23417. // its own getter ensures the setter does not get called twice.
  23418. if (instance.hasOwnProperty(getter)) {
  23419. instance[names.set](values[name]);
  23420. // The generated setter will remove the initGetter from the instance
  23421. // but the user may have provided their own setter so we have to do
  23422. // this here as well:
  23423. delete instance[names.get];
  23424. }
  23425. }
  23426. }
  23427. }
  23428. // Process configs declared on the class that need per-instance initialization.
  23429. for (i = 0 , ln = initList.length; i < ln; ++i) {
  23430. cfg = initList[i];
  23431. names = cfg.names;
  23432. getter = names.get;
  23433. if (!cfg.lazy && instance.hasOwnProperty(getter)) {
  23434. // Since the instance still hasOwn the getter, that means we've set an initGetter
  23435. // and it hasn't been cleared by calling any setter. Since we've never set the value
  23436. // because it wasn't passed in the instance, we go and set it here, taking the value
  23437. // from our definition config and passing it through finally clear off the getter.
  23438. instance[names.set](values[cfg.name]);
  23439. delete instance[getter];
  23440. }
  23441. }
  23442. // Expose the value from the prototype chain (false):
  23443. delete instance.isConfiguring;
  23444. },
  23445. getCurrentConfig: function(instance) {
  23446. var defaultConfig = instance.defaultConfig,
  23447. config = {},
  23448. name;
  23449. for (name in defaultConfig) {
  23450. config[name] = instance[configPropMap[name].names.get]();
  23451. }
  23452. return config;
  23453. },
  23454. /**
  23455. * This method is called to update the internal state of a given config when that
  23456. * config is needed in a config transform (such as responsive or stateful mixins).
  23457. *
  23458. * @param {Ext.Base} instance The instance to configure.
  23459. * @param {Object} instanceConfig The config for the instance.
  23460. * @param {String[]} names The name(s) of the config(s) to process.
  23461. * @private
  23462. * @since 6.7.0
  23463. */
  23464. hoistConfigs: function(instance, instanceConfig, names) {
  23465. var config = instance.config,
  23466. configs = this.configs,
  23467. initListMap = this.initListMap,
  23468. ret = false,
  23469. cfg, i, name;
  23470. for (i = 0; i < names.length; ++i) {
  23471. name = names[i];
  23472. if (instanceConfig && name in instanceConfig) {
  23473. cfg = configs[name];
  23474. // the Ext.Config instance
  23475. config[name] = cfg.combine(instanceConfig[name], config[name], instance);
  23476. if (!initListMap[name]) {
  23477. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23478. }
  23479. }
  23480. // The config could be defined on the class, so may be present even if
  23481. // not in instance config.
  23482. if (config[name] != null) {
  23483. ret = true;
  23484. }
  23485. }
  23486. return ret;
  23487. },
  23488. /**
  23489. * Merges the values of a config object onto a base config.
  23490. * @param {Ext.Base} instance
  23491. * @param {Object} baseConfig
  23492. * @param {Object} config
  23493. * @param {Boolean} [clone=false]
  23494. * @return {Object} the merged config
  23495. * @private
  23496. */
  23497. merge: function(instance, baseConfig, config, clone) {
  23498. // Although this is a "private" method. It is used by Sencha Architect and so
  23499. // its api should remain stable.
  23500. var configs = this.configs,
  23501. name, value, baseValue, cfg;
  23502. if (clone) {
  23503. baseConfig = Ext.clone(baseConfig, /* cloneDom= */
  23504. false);
  23505. }
  23506. for (name in config) {
  23507. value = config[name];
  23508. cfg = configs[name];
  23509. if (cfg) {
  23510. baseValue = baseConfig[name];
  23511. if (cfg.merge) {
  23512. value = cfg.merge(value, baseValue, instance);
  23513. } else if (value && value.constructor === Object) {
  23514. if (baseValue && baseValue.constructor === Object) {
  23515. value = Ext.merge(baseValue, value);
  23516. } else {
  23517. value = Ext.clone(value, false);
  23518. }
  23519. }
  23520. }
  23521. baseConfig[name] = value;
  23522. }
  23523. return baseConfig;
  23524. },
  23525. /**
  23526. * @private
  23527. */
  23528. reconfigure: function(instance, instanceConfig, options) {
  23529. var currentConfig = instance.config,
  23530. configList = [],
  23531. strict = instance.$configStrict && !(options && options.strict === false),
  23532. configs = this.configs,
  23533. defaults = options && options.defaults,
  23534. cfg, getter, i, len, name, names, prop;
  23535. for (name in instanceConfig) {
  23536. cfg = configs[name];
  23537. /* eslint-disable-next-line max-len */
  23538. if (defaults && instance.hasOwnProperty(cfg && instance.$configPrefixed ? cfg.names.internal : name)) {
  23539. continue;
  23540. }
  23541. currentConfig[name] = instanceConfig[name];
  23542. if (this.deprecations[name]) {
  23543. // See similar logic doc in configure() method.
  23544. Ext.log.warn(this.deprecations[name]);
  23545. if (!cfg) {
  23546. continue;
  23547. }
  23548. }
  23549. if (cfg) {
  23550. // To ensure that configs being set here get processed in the proper order
  23551. // we must give them init getters just in case they depend upon each other
  23552. instance[cfg.names.get] = cfg.initGetter || cfg.getInitGetter();
  23553. } else {
  23554. // Check for existence of the property on the prototype before proceeding.
  23555. // If present on the prototype, and if the property is a function we
  23556. // do not allow it to be overridden by a property in the config object
  23557. // in strict mode (unless the function on the prototype is a emptyFn or
  23558. // identityFn). Note that we always check the prototype, not the instance
  23559. // because calling setConfig a second time should have the same results -
  23560. // the first call may have set a function on the instance.
  23561. prop = instance.self.prototype[name];
  23562. if (strict) {
  23563. if ((typeof prop === 'function') && !prop.$nullFn) {
  23564. Ext.Error.raise("Cannot override method " + name + " on " + instance.$className + " instance.");
  23565. continue;
  23566. } else {
  23567. if (name !== 'type') {
  23568. Ext.log.warn('No such config "' + name + '" for class ' + instance.$className);
  23569. }
  23570. }
  23571. }
  23572. }
  23573. configList.push(name);
  23574. }
  23575. for (i = 0 , len = configList.length; i < len; i++) {
  23576. name = configList[i];
  23577. cfg = configs[name];
  23578. if (cfg) {
  23579. names = cfg.names;
  23580. getter = names.get;
  23581. if (instance.hasOwnProperty(getter)) {
  23582. // Since the instance still hasOwn the getter, that means we've set
  23583. // an initGetter and it hasn't been cleared by calling any setter.
  23584. // Since we've never set the value because it wasn't passed in the instance,
  23585. // we go and set it here, taking the value from our definition config
  23586. // and passing it through finally clear off the getter.
  23587. instance[names.set](instanceConfig[name]);
  23588. delete instance[getter];
  23589. }
  23590. } else {
  23591. cfg = configPropMap[name] || Ext.Config.get(name);
  23592. names = cfg.names;
  23593. if (instance[names.set]) {
  23594. instance[names.set](instanceConfig[name]);
  23595. } else {
  23596. // apply non-config props directly to the instance
  23597. instance[name] = instanceConfig[name];
  23598. }
  23599. }
  23600. }
  23601. },
  23602. /**
  23603. * This method accepts an instance config object containing a `platformConfig`
  23604. * property and merges the appropriate rules from that sub-object with the root object
  23605. * to create the final config object that should be used. This is method called by
  23606. * `{@link #configure}` when it receives an `instanceConfig` containing a
  23607. * `platformConfig` property.
  23608. *
  23609. * @param {Ext.Base} instance
  23610. * @param {Object} instanceConfig The instance config parameter.
  23611. * @return {Object} The new instance config object with platformConfig results applied.
  23612. * @private
  23613. * @since 5.1.0
  23614. */
  23615. resolvePlatformConfig: function(instance, instanceConfig) {
  23616. var platformConfig = instanceConfig && instanceConfig.platformConfig,
  23617. ret = instanceConfig,
  23618. i, keys, n;
  23619. if (platformConfig) {
  23620. keys = Ext.getPlatformConfigKeys(platformConfig);
  23621. n = keys.length;
  23622. if (n) {
  23623. ret = Ext.merge({}, ret);
  23624. // this deep copies sub-objects
  23625. for (i = 0 , n = keys.length; i < n; ++i) {
  23626. this.merge(instance, ret, platformConfig[keys[i]]);
  23627. }
  23628. }
  23629. }
  23630. return ret;
  23631. },
  23632. transformSorter: function(a, b) {
  23633. return a[1] - b[1];
  23634. }
  23635. };
  23636. }());
  23637. // prototype
  23638. // closure on whole file
  23639. // @tag class
  23640. /**
  23641. * @class Ext.Base
  23642. *
  23643. * The root of all classes created with {@link Ext#define}.
  23644. *
  23645. * Ext.Base is the building block of all Ext classes. All classes in Ext inherit from Ext.Base.
  23646. * All prototype and static members of this class are inherited by all other classes.
  23647. */
  23648. Ext.Base = (function(flexSetter) {
  23649. // @define Ext.Base
  23650. // @require Ext.Util
  23651. // @require Ext.Version
  23652. // @require Ext.Configurator
  23653. // @uses Ext.ClassManager
  23654. // @uses Ext.mixin.Watchable
  23655. /* eslint-disable indent */
  23656. var noArgs = [],
  23657. baseStaticMember,
  23658. baseStaticMembers = [],
  23659. makeDeprecatedMethod = function(oldName, newName, msg) {
  23660. var message = '"' + oldName + '" is deprecated.';
  23661. if (msg) {
  23662. message += ' ' + msg;
  23663. } else if (newName) {
  23664. message += ' Please use "' + newName + '" instead.';
  23665. }
  23666. return function() {
  23667. Ext.raise(message);
  23668. };
  23669. },
  23670. addDeprecatedProperty = function(object, oldName, newName, message) {
  23671. if (!message) {
  23672. message = '"' + oldName + '" is deprecated.';
  23673. }
  23674. if (newName) {
  23675. message += ' Please use "' + newName + '" instead.';
  23676. }
  23677. if (message) {
  23678. Ext.Object.defineProperty(object, oldName, {
  23679. get: function() {
  23680. // eslint-disable-line getter-return
  23681. Ext.raise(message);
  23682. },
  23683. set: function(value) {
  23684. Ext.raise(message);
  23685. },
  23686. configurable: true
  23687. });
  23688. }
  23689. },
  23690. getOwnObject = function(proto, name) {
  23691. if (!proto.hasOwnProperty(name)) {
  23692. proto[name] = Ext.Object.chain(getOwnObject(proto.superclass, name));
  23693. }
  23694. return proto[name];
  23695. },
  23696. makeAliasFn = function(name) {
  23697. return function() {
  23698. return this[name].apply(this, arguments);
  23699. };
  23700. },
  23701. Version = Ext.Version,
  23702. leadingDigitRe = /^\d/,
  23703. oneMember = {},
  23704. aliasOneMember = {},
  23705. Base = function() {},
  23706. BasePrototype = Base.prototype,
  23707. Reaper;
  23708. Ext.Reaper = Reaper = {
  23709. delay: 100,
  23710. queue: [],
  23711. timer: null,
  23712. add: function(obj) {
  23713. if (!Reaper.timer) {
  23714. Reaper.timer = Ext.defer(Reaper.tick, Reaper.delay);
  23715. }
  23716. Reaper.queue.push(obj);
  23717. },
  23718. flush: function() {
  23719. if (Reaper.timer) {
  23720. Ext.undefer(Reaper.timer);
  23721. Reaper.timer = null;
  23722. }
  23723. /* eslint-disable-next-line vars-on-top */
  23724. var queue = Reaper.queue,
  23725. n = queue.length,
  23726. i, obj;
  23727. Reaper.queue = [];
  23728. for (i = 0; i < n; ++i) {
  23729. obj = queue[i];
  23730. if (obj && obj.$reap) {
  23731. obj.$reap();
  23732. }
  23733. }
  23734. },
  23735. tick: function() {
  23736. Reaper.timer = null;
  23737. Reaper.flush();
  23738. }
  23739. };
  23740. // These static properties will be copied to every newly created class with {@link Ext#define}
  23741. Ext.apply(Base, {
  23742. $className: 'Ext.Base',
  23743. $isClass: true,
  23744. /**
  23745. * Create a new instance of this Class.
  23746. *
  23747. * Ext.define('My.cool.Class', {
  23748. * ...
  23749. * });
  23750. *
  23751. * My.cool.Class.create({
  23752. * someConfig: true
  23753. * });
  23754. *
  23755. * All parameters are passed to the constructor of the class.
  23756. *
  23757. * @return {Object} the created instance.
  23758. * @static
  23759. * @inheritable
  23760. */
  23761. create: function() {
  23762. return Ext.create.apply(Ext, [
  23763. this
  23764. ].concat(Array.prototype.slice.call(arguments, 0)));
  23765. },
  23766. addConfigTransform: function(methodName, priority) {
  23767. var transforms = getOwnObject(this.prototype, '$configTransforms');
  23768. if (this.$configTransforms) {
  23769. Ext.raise('Config transforms cannot be added after instances are created');
  23770. }
  23771. transforms[methodName] = priority;
  23772. },
  23773. /**
  23774. * This method applies a versioned, deprecation declaration to this class. This
  23775. * is typically called by the `deprecated` config.
  23776. * @private
  23777. */
  23778. addDeprecations: function(deprecations) {
  23779. var me = this,
  23780. all = [],
  23781. compatVersion = Ext.getCompatVersion(deprecations.name),
  23782. configurator = me.getConfigurator(),
  23783. displayName = (me.$className || '') + '#',
  23784. deprecate, versionSpec, index, message, target, enabled, existing, fn, names, oldName, newName, member, statics, version;
  23785. for (versionSpec in deprecations) {
  23786. if (leadingDigitRe.test(versionSpec)) {
  23787. version = new Ext.Version(versionSpec);
  23788. version.deprecations = deprecations[versionSpec];
  23789. all.push(version);
  23790. }
  23791. }
  23792. all.sort(Version.compare);
  23793. for (index = all.length; index--; ) {
  23794. deprecate = (version = all[index]).deprecations;
  23795. target = me.prototype;
  23796. statics = deprecate.statics;
  23797. // If user specifies, say 4.2 compatibility and we have a 5.0 deprecation
  23798. // then that block needs to be "enabled" to "revert" to behaviors prior
  23799. // to 5.0. By default, compatVersion === currentVersion, so there are no
  23800. // enabled blocks. In dev mode we still want to visit all the blocks and
  23801. // possibly add shims to detect use of deprecated methods, but in a build
  23802. // (if the deprecated block remains somehow) we just break the loop.
  23803. enabled = compatVersion && compatVersion.lt(version);
  23804. if (!enabled) {}
  23805. // eslint-disable-line no-empty, brace-style
  23806. else if (!enabled) {
  23807. // we won't get here in dev mode when !enabled
  23808. break;
  23809. }
  23810. while (deprecate) {
  23811. names = deprecate.methods;
  23812. if (names) {
  23813. for (oldName in names) {
  23814. member = names[oldName];
  23815. fn = null;
  23816. if (!member) {
  23817. /*
  23818. * Something like:
  23819. *
  23820. * '5.1': {
  23821. * methods: {
  23822. * removedMethod: null
  23823. * }
  23824. * }
  23825. *
  23826. * Since there is no recovering the method, we always put
  23827. * on a shim to catch abuse.
  23828. */
  23829. // The class should not already have a method by the oldName
  23830. Ext.Assert.isNotDefinedProp(target, oldName);
  23831. fn = makeDeprecatedMethod(displayName + oldName);
  23832. } else if (Ext.isString(member)) {
  23833. /*
  23834. * Something like:
  23835. *
  23836. * '5.1': {
  23837. * methods: {
  23838. * oldName: 'newName'
  23839. * }
  23840. * }
  23841. *
  23842. * If this block is enabled, we just put an alias in place.
  23843. * Otherwise we need to inject a
  23844. */
  23845. // The class should not already have a method by the oldName
  23846. Ext.Assert.isNotDefinedProp(target, oldName);
  23847. Ext.Assert.isDefinedProp(target, member);
  23848. if (enabled) {
  23849. // This call to the real method name must be late
  23850. // bound if it is to pick up overrides and such.
  23851. fn = makeAliasFn(member);
  23852. } else {
  23853. fn = makeDeprecatedMethod(displayName + oldName, member);
  23854. }
  23855. } else {
  23856. /*
  23857. * Something like:
  23858. *
  23859. * '5.1': {
  23860. * methods: {
  23861. * foo: function() { ... }
  23862. * }
  23863. * }
  23864. *
  23865. * Or this:
  23866. *
  23867. * '5.1': {
  23868. * methods: {
  23869. * foo: {
  23870. * fn: function() { ... },
  23871. * message: 'Please use "bar" instead.'
  23872. * }
  23873. * }
  23874. * }
  23875. *
  23876. * Or just this:
  23877. *
  23878. * '5.1': {
  23879. * methods: {
  23880. * foo: {
  23881. * message: 'Use something else instead.'
  23882. * }
  23883. * }
  23884. * }
  23885. *
  23886. * If this block is enabled, and "foo" is an existing
  23887. * method, than we apply the given method as an override.
  23888. * If "foo" is not existing, we simply add the method.
  23889. *
  23890. * If the block is not enabled and there is no existing
  23891. * method by that name, than we add a shim to prevent
  23892. * abuse.
  23893. */
  23894. message = '';
  23895. if (member.message || member.fn) {
  23896. message = member.message;
  23897. member = member.fn;
  23898. }
  23899. existing = target.hasOwnProperty(oldName) && target[oldName];
  23900. if (enabled && member) {
  23901. member.$owner = me;
  23902. member.$name = oldName;
  23903. member.name = displayName + oldName;
  23904. if (existing) {
  23905. member.$previous = existing;
  23906. }
  23907. fn = member;
  23908. } else if (!existing) {
  23909. fn = makeDeprecatedMethod(displayName + oldName, null, message);
  23910. }
  23911. }
  23912. if (fn) {
  23913. target[oldName] = fn;
  23914. }
  23915. }
  23916. }
  23917. // for oldName
  23918. //-------------------------------------
  23919. // Debug only
  23920. names = deprecate.configs;
  23921. if (names) {
  23922. //
  23923. // '6.0': {
  23924. // configs: {
  23925. // dead: null,
  23926. //
  23927. // renamed: 'newName',
  23928. //
  23929. // removed: {
  23930. // message: 'This config was replaced by pixie dust'
  23931. // }
  23932. // }
  23933. // }
  23934. //
  23935. configurator.addDeprecations(names);
  23936. }
  23937. names = deprecate.properties;
  23938. if (names && !enabled) {
  23939. // For properties about the only thing we can do is (on Good
  23940. // Browsers), add warning shims for accessing them. So if the
  23941. // block is enabled, we don't want those.
  23942. for (oldName in names) {
  23943. newName = names[oldName];
  23944. if (Ext.isString(newName)) {
  23945. addDeprecatedProperty(target, displayName + oldName, newName);
  23946. } else if (newName && newName.message) {
  23947. addDeprecatedProperty(target, displayName + oldName, null, newName.message);
  23948. } else {
  23949. addDeprecatedProperty(target, displayName + oldName);
  23950. }
  23951. }
  23952. }
  23953. //-------------------------------------
  23954. // reset to handle statics and apply them to the class
  23955. deprecate = statics;
  23956. statics = null;
  23957. target = me;
  23958. }
  23959. }
  23960. },
  23961. /**
  23962. * @private
  23963. * @static
  23964. * @inheritable
  23965. * @param parentClass
  23966. */
  23967. extend: function(parentClass) {
  23968. var me = this,
  23969. parentPrototype = parentClass.prototype,
  23970. prototype, name, statics;
  23971. prototype = me.prototype = Ext.Object.chain(parentPrototype);
  23972. prototype.self = me;
  23973. me.superclass = prototype.superclass = parentPrototype;
  23974. if (!parentClass.$isClass) {
  23975. for (name in BasePrototype) {
  23976. if (name in prototype) {
  23977. prototype[name] = BasePrototype[name];
  23978. }
  23979. }
  23980. }
  23981. // Statics inheritance
  23982. statics = parentPrototype.$inheritableStatics;
  23983. if (statics) {
  23984. for (name in statics) {
  23985. if (!me.hasOwnProperty(name)) {
  23986. me[name] = parentClass[name];
  23987. }
  23988. }
  23989. }
  23990. if (parentClass.$onExtended) {
  23991. me.$onExtended = parentClass.$onExtended.slice();
  23992. }
  23993. me.getConfigurator();
  23994. },
  23995. /**
  23996. * @private
  23997. * @static
  23998. * @inheritable
  23999. */
  24000. $onExtended: [],
  24001. /**
  24002. * @private
  24003. * @static
  24004. * @inheritable
  24005. */
  24006. triggerExtended: function() {
  24007. if (Ext.classSystemMonitor) {
  24008. Ext.classSystemMonitor(this, 'Ext.Base#triggerExtended', arguments);
  24009. }
  24010. /* eslint-disable-next-line vars-on-top */
  24011. var callbacks = this.$onExtended,
  24012. ln = callbacks.length,
  24013. i, callback;
  24014. if (ln > 0) {
  24015. for (i = 0; i < ln; i++) {
  24016. callback = callbacks[i];
  24017. callback.fn.apply(callback.scope || this, arguments);
  24018. }
  24019. }
  24020. },
  24021. /**
  24022. * @private
  24023. * @static
  24024. * @inheritable
  24025. */
  24026. onExtended: function(fn, scope) {
  24027. this.$onExtended.push({
  24028. fn: fn,
  24029. scope: scope
  24030. });
  24031. return this;
  24032. },
  24033. /**
  24034. * Add / override static properties of this class.
  24035. *
  24036. * Ext.define('My.cool.Class', {
  24037. * ...
  24038. * });
  24039. *
  24040. * My.cool.Class.addStatics({
  24041. * someProperty: 'someValue', // My.cool.Class.someProperty = 'someValue'
  24042. * method1: function() { ... }, // My.cool.Class.method1 = function() { ... };
  24043. * method2: function() { ... } // My.cool.Class.method2 = function() { ... };
  24044. * });
  24045. *
  24046. * @param {Object} members
  24047. * @return {Ext.Base} this
  24048. * @static
  24049. * @inheritable
  24050. */
  24051. addStatics: function(members) {
  24052. this.addMembers(members, true);
  24053. return this;
  24054. },
  24055. /**
  24056. * @private
  24057. * @static
  24058. * @inheritable
  24059. * @param {Object} members
  24060. */
  24061. addInheritableStatics: function(members) {
  24062. var me = this,
  24063. proto = me.prototype,
  24064. inheritableStatics = me.$inheritableStatics,
  24065. name, member, current;
  24066. if (!inheritableStatics) {
  24067. inheritableStatics = Ext.apply({}, proto.$inheritableStatics);
  24068. me.$inheritableStatics = proto.$inheritableStatics = inheritableStatics;
  24069. }
  24070. /* eslint-disable-next-line vars-on-top */
  24071. var className = Ext.getClassName(me) + '.';
  24072. for (name in members) {
  24073. if (members.hasOwnProperty(name)) {
  24074. member = members[name];
  24075. current = me[name];
  24076. if (typeof member === 'function') {
  24077. member.name = className + name;
  24078. }
  24079. if (typeof current === 'function' && !current.$isClass && !current.$nullFn) {
  24080. member.$previous = current;
  24081. }
  24082. me[name] = member;
  24083. inheritableStatics[name] = true;
  24084. }
  24085. }
  24086. return me;
  24087. },
  24088. /**
  24089. * Add methods / properties to the prototype of this class.
  24090. *
  24091. * Ext.define('My.awesome.Cat', {
  24092. * constructor: function() {
  24093. * ...
  24094. * }
  24095. * });
  24096. *
  24097. * My.awesome.Cat.addMembers({
  24098. * meow: function() {
  24099. * alert('Meowww...');
  24100. * }
  24101. * });
  24102. *
  24103. * var kitty = new My.awesome.Cat();
  24104. * kitty.meow();
  24105. *
  24106. * @param {Object} members The members to add to this class.
  24107. * @param {Boolean} [isStatic=false] Pass `true` if the members are static.
  24108. * @param {Boolean} [privacy=false] Pass `true` if the members are private. This
  24109. * only has meaning in debug mode and only for methods.
  24110. * @static
  24111. * @inheritable
  24112. */
  24113. addMembers: function(members, isStatic, privacy) {
  24114. var me = this,
  24115. // this class
  24116. cloneFunction = Ext.Function.clone,
  24117. target = isStatic ? me : me.prototype,
  24118. defaultConfig = !isStatic && target.defaultConfig,
  24119. enumerables = Ext.enumerables,
  24120. privates = members.privates,
  24121. configs, i, ln, member, name, subPrivacy, privateStatics;
  24122. /* eslint-disable-next-line vars-on-top, one-var */
  24123. var displayName = (me.$className || '') + '#';
  24124. if (privates) {
  24125. // This won't run for normal class private members but will pick up all
  24126. // others (statics, overrides, etc).
  24127. delete members.privates;
  24128. if (!isStatic) {
  24129. privateStatics = privates.statics;
  24130. delete privates.statics;
  24131. }
  24132. subPrivacy = privates.privacy || privacy || 'framework';
  24133. me.addMembers(privates, isStatic, subPrivacy);
  24134. if (privateStatics) {
  24135. me.addMembers(privateStatics, true, subPrivacy);
  24136. }
  24137. }
  24138. for (name in members) {
  24139. if (members.hasOwnProperty(name)) {
  24140. member = members[name];
  24141. if (privacy === true) {
  24142. privacy = 'framework';
  24143. }
  24144. if (member && member.$nullFn && privacy !== member.$privacy) {
  24145. Ext.raise('Cannot use stock function for private method ' + (me.$className ? me.$className + '#' : '') + name);
  24146. }
  24147. if (typeof member === 'function' && !member.$isClass && !member.$nullFn) {
  24148. if (member.$owner) {
  24149. member = cloneFunction(member);
  24150. }
  24151. if (target.hasOwnProperty(name)) {
  24152. member.$previous = target[name];
  24153. }
  24154. // This information is needed by callParent() and callSuper() as
  24155. // well as statics() and even Ext.fly().
  24156. member.$owner = me;
  24157. member.$name = name;
  24158. member.name = displayName + name;
  24159. /* eslint-disable-next-line vars-on-top */
  24160. var existing = target[name];
  24161. if (privacy) {
  24162. member.$privacy = privacy;
  24163. // The general idea here is that an existing, non-private
  24164. // method can be marked private. This is because the other
  24165. // way is strictly forbidden (private method going public)
  24166. // so if a method is in that gray area it can only be made
  24167. // private in doc form which allows a derived class to make
  24168. // it public.
  24169. if (existing && existing.$privacy && existing.$privacy !== privacy) {
  24170. Ext.privacyViolation(me, existing, member, isStatic);
  24171. }
  24172. } else if (existing && existing.$privacy) {
  24173. Ext.privacyViolation(me, existing, member, isStatic);
  24174. }
  24175. }
  24176. // The last part of the check here resolves a conflict if we have the same
  24177. // property declared as both a config and a member on the class so that
  24178. // the config wins.
  24179. else if (defaultConfig && (name in defaultConfig) && !target.config.hasOwnProperty(name)) {
  24180. // This is a config property so it must be added to the configs
  24181. // collection not just smashed on the prototype...
  24182. (configs || (configs = {}))[name] = member;
  24183. continue;
  24184. }
  24185. target[name] = member;
  24186. }
  24187. }
  24188. if (configs) {
  24189. // Add any configs found in the normal members arena:
  24190. me.addConfig(configs);
  24191. }
  24192. if (enumerables) {
  24193. for (i = 0 , ln = enumerables.length; i < ln; ++i) {
  24194. if (members.hasOwnProperty(name = enumerables[i])) {
  24195. member = members[name];
  24196. // The enumerables are all functions...
  24197. if (member && !member.$nullFn) {
  24198. if (member.$owner) {
  24199. member = cloneFunction(member);
  24200. }
  24201. member.$owner = me;
  24202. member.$name = name;
  24203. member.name = displayName + name;
  24204. if (target.hasOwnProperty(name)) {
  24205. member.$previous = target[name];
  24206. }
  24207. }
  24208. target[name] = member;
  24209. }
  24210. }
  24211. }
  24212. return this;
  24213. },
  24214. /**
  24215. * @private
  24216. * @static
  24217. * @inheritable
  24218. * @param name
  24219. * @param member
  24220. * @param privacy
  24221. */
  24222. addMember: function(name, member, privacy) {
  24223. oneMember[name] = member;
  24224. this.addMembers(oneMember, false, privacy);
  24225. delete oneMember[name];
  24226. return this;
  24227. },
  24228. hookMember: function(name, member) {
  24229. var existing = this.prototype[name];
  24230. return this.addMember(name, member, existing && existing.$privacy);
  24231. },
  24232. /**
  24233. * Borrow another class' members to the prototype of this class.
  24234. *
  24235. * Ext.define('Bank', {
  24236. * money: '$$$',
  24237. * printMoney: function() {
  24238. * alert('$$$$$$$');
  24239. * }
  24240. * });
  24241. *
  24242. * Ext.define('Thief', {
  24243. * ...
  24244. * });
  24245. *
  24246. * Thief.borrow(Bank, ['money', 'printMoney']);
  24247. *
  24248. * var steve = new Thief();
  24249. *
  24250. * alert(steve.money); // alerts '$$$'
  24251. * steve.printMoney(); // alerts '$$$$$$$'
  24252. *
  24253. * @param {Ext.Base} fromClass The class to borrow members from
  24254. * @param {Array/String} members The names of the members to borrow
  24255. * @return {Ext.Base} this
  24256. * @static
  24257. * @inheritable
  24258. * @private
  24259. */
  24260. borrow: function(fromClass, members) {
  24261. if (Ext.classSystemMonitor) {
  24262. Ext.classSystemMonitor(this, 'Ext.Base#borrow', arguments);
  24263. }
  24264. /* eslint-disable-next-line vars-on-top */
  24265. var prototype = fromClass.prototype,
  24266. membersObj = {},
  24267. i, ln, name;
  24268. members = Ext.Array.from(members);
  24269. for (i = 0 , ln = members.length; i < ln; i++) {
  24270. name = members[i];
  24271. membersObj[name] = prototype[name];
  24272. }
  24273. return this.addMembers(membersObj);
  24274. },
  24275. /**
  24276. * Override members of this class. Overridden methods can be invoked via
  24277. * {@link Ext.Base#method!callParent}.
  24278. *
  24279. * Ext.define('My.Cat', {
  24280. * constructor: function() {
  24281. * alert("I'm a cat!");
  24282. * }
  24283. * });
  24284. *
  24285. * My.Cat.override({
  24286. * constructor: function() {
  24287. * alert("I'm going to be a cat!");
  24288. *
  24289. * this.callParent(arguments);
  24290. *
  24291. * alert("Meeeeoooowwww");
  24292. * }
  24293. * });
  24294. *
  24295. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  24296. * // alerts "I'm a cat!"
  24297. * // alerts "Meeeeoooowwww"
  24298. *
  24299. * Direct use of this method should be rare. Use {@link Ext#define Ext.define}
  24300. * instead:
  24301. *
  24302. * Ext.define('My.CatOverride', {
  24303. * override: 'My.Cat',
  24304. * constructor: function() {
  24305. * alert("I'm going to be a cat!");
  24306. *
  24307. * this.callParent(arguments);
  24308. *
  24309. * alert("Meeeeoooowwww");
  24310. * }
  24311. * });
  24312. *
  24313. * The above accomplishes the same result but can be managed by the {@link Ext.Loader}
  24314. * which can properly order the override and its target class and the build process
  24315. * can determine whether the override is needed based on the required state of the
  24316. * target class (My.Cat).
  24317. *
  24318. * @param {Object} members The properties to add to this class. This should be
  24319. * specified as an object literal containing one or more properties.
  24320. * @return {Ext.Base} this class
  24321. * @static
  24322. * @inheritable
  24323. */
  24324. override: function(members) {
  24325. var me = this,
  24326. statics = members.statics,
  24327. inheritableStatics = members.inheritableStatics,
  24328. config = members.config,
  24329. mixins = members.mixins,
  24330. cachedConfig = members.cachedConfig;
  24331. if (statics || inheritableStatics || config) {
  24332. members = Ext.apply({}, members);
  24333. }
  24334. if (statics) {
  24335. me.addMembers(statics, true);
  24336. delete members.statics;
  24337. }
  24338. if (inheritableStatics) {
  24339. me.addInheritableStatics(inheritableStatics);
  24340. delete members.inheritableStatics;
  24341. }
  24342. if (members.platformConfig) {
  24343. me.addPlatformConfig(members);
  24344. }
  24345. if (config) {
  24346. me.addConfig(config);
  24347. delete members.config;
  24348. }
  24349. if (cachedConfig) {
  24350. me.addCachedConfig(cachedConfig);
  24351. delete members.cachedConfig;
  24352. }
  24353. delete members.mixins;
  24354. me.addMembers(members);
  24355. if (mixins) {
  24356. me.mixin(mixins);
  24357. }
  24358. return me;
  24359. },
  24360. addPlatformConfig: function(data) {
  24361. var me = this,
  24362. prototype = me.prototype,
  24363. platformConfigs = data.platformConfig,
  24364. added, classConfigs, configs, configurator, keys, name, value, i, ln;
  24365. delete prototype.platformConfig;
  24366. if (platformConfigs instanceof Array) {
  24367. throw new Error('platformConfigs must be specified as an object.');
  24368. }
  24369. configurator = me.getConfigurator();
  24370. classConfigs = configurator.configs;
  24371. // Get the keys shortest to longest (ish).
  24372. keys = Ext.getPlatformConfigKeys(platformConfigs);
  24373. // To leverage the Configurator#add method, we want to generate potentially
  24374. // two objects to pass in: "added" and "hoisted". For any properties in an
  24375. // active platformConfig rule that set proper Configs in the base class, we
  24376. // need to put them in "added". If instead of the proper Config coming from
  24377. // a base class, it comes from this class's config block, we still need to
  24378. // put that config in "added" but we also need move the class-level config
  24379. // out of "config" and into "hoisted".
  24380. //
  24381. // This will ensure that the config defined at the class level is added to
  24382. // the Configurator first.
  24383. for (i = 0 , ln = keys.length; i < ln; ++i) {
  24384. configs = platformConfigs[keys[i]];
  24385. added = null;
  24386. for (name in configs) {
  24387. value = configs[name];
  24388. // We have a few possibilities for each config name:
  24389. if (name in classConfigs) {
  24390. // It is a proper Config defined by a base class.
  24391. (added || (added = {}))[name] = value;
  24392. } else {
  24393. // It is just a property to put on the prototype.
  24394. prototype[name] = value;
  24395. }
  24396. }
  24397. if (added) {
  24398. configurator.add(added);
  24399. }
  24400. }
  24401. },
  24402. /**
  24403. * @protected
  24404. * @static
  24405. * @inheritable
  24406. */
  24407. callParent: function(args) {
  24408. var method;
  24409. // This code is intentionally inlined for the least amount of debugger stepping
  24410. return (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
  24411. },
  24412. /**
  24413. * @protected
  24414. * @static
  24415. * @inheritable
  24416. */
  24417. callSuper: function(args) {
  24418. var method;
  24419. // This code is intentionally inlined for the least amount of debugger stepping
  24420. return (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass.self[method.$name]).apply(this, args || noArgs);
  24421. },
  24422. /**
  24423. * Used internally by the mixins pre-processor
  24424. * @private
  24425. * @static
  24426. * @inheritable
  24427. */
  24428. mixin: function(name, mixinClass) {
  24429. var me = this,
  24430. mixin, prototype, key, statics, i, ln, mixinName, mixinValue, mixins, mixinStatics, staticName;
  24431. if (typeof name !== 'string') {
  24432. mixins = name;
  24433. if (mixins instanceof Array) {
  24434. for (i = 0 , ln = mixins.length; i < ln; i++) {
  24435. mixin = mixins[i];
  24436. me.mixin(mixin.prototype.mixinId || mixin.$className, mixin);
  24437. }
  24438. } else {
  24439. // Not a string or array - process the object form:
  24440. // mixins: {
  24441. // foo: ...
  24442. // }
  24443. for (mixinName in mixins) {
  24444. me.mixin(mixinName, mixins[mixinName]);
  24445. }
  24446. }
  24447. return;
  24448. }
  24449. mixin = mixinClass.prototype;
  24450. prototype = me.prototype;
  24451. if (mixin.onClassMixedIn) {
  24452. mixin.onClassMixedIn.call(mixinClass, me);
  24453. }
  24454. if (!prototype.hasOwnProperty('mixins')) {
  24455. if ('mixins' in prototype) {
  24456. prototype.mixins = Ext.Object.chain(prototype.mixins);
  24457. } else {
  24458. prototype.mixins = {};
  24459. }
  24460. }
  24461. for (key in mixin) {
  24462. mixinValue = mixin[key];
  24463. if (key === 'mixins') {
  24464. // if 2 superclasses (e.g. a base class and a mixin) of this class both
  24465. // have a mixin with the same id, the first one wins, that is to say,
  24466. // the first mixin's methods to be applied to the prototype will not
  24467. // be overwritten by the second one. Since this is the case we also
  24468. // want to make sure we use the first mixin's prototype as the mixin
  24469. // reference, hence the "applyIf" below. A real world example of this
  24470. // is Ext.Widget which mixes in Ext.mixin.Observable. Ext.Widget can
  24471. // be mixed into subclasses of Ext.Component, which mixes in
  24472. // Ext.util.Observable. In this example, since the first "observable"
  24473. // mixin's methods win, we also want its reference to be preserved.
  24474. Ext.applyIf(prototype.mixins, mixinValue);
  24475. }
  24476. /* eslint-disable-next-line max-len */
  24477. else if (!(key === 'mixinId' || key === 'config' || key === '$inheritableStatics') && (prototype[key] === undefined)) {
  24478. prototype[key] = mixinValue;
  24479. }
  24480. }
  24481. // Mixin statics inheritance
  24482. statics = mixin.$inheritableStatics;
  24483. if (statics) {
  24484. mixinStatics = {};
  24485. for (staticName in statics) {
  24486. if (!me.hasOwnProperty(staticName)) {
  24487. mixinStatics[staticName] = mixinClass[staticName];
  24488. }
  24489. }
  24490. me.addInheritableStatics(mixinStatics);
  24491. }
  24492. if ('config' in mixin) {
  24493. me.addConfig(mixin.config, mixinClass);
  24494. }
  24495. prototype.mixins[name] = mixin;
  24496. if (mixin.afterClassMixedIn) {
  24497. mixin.afterClassMixedIn.call(mixinClass, me);
  24498. }
  24499. return me;
  24500. },
  24501. /**
  24502. * Adds new config properties to this class. This is called for classes when they
  24503. * are declared, then for any mixins that class may define and finally for any
  24504. * overrides defined that target the class.
  24505. *
  24506. * @param {Object} config
  24507. * @param {Ext.Class} [mixinClass] The mixin class if the configs are from a mixin.
  24508. * @private
  24509. * @static
  24510. * @inheritable
  24511. */
  24512. addConfig: function(config, mixinClass) {
  24513. var cfg = this.$config || this.getConfigurator();
  24514. cfg.add(config, mixinClass);
  24515. },
  24516. addCachedConfig: function(config, isMixin) {
  24517. var cached = {},
  24518. key;
  24519. for (key in config) {
  24520. cached[key] = {
  24521. cached: true,
  24522. $value: config[key]
  24523. };
  24524. }
  24525. this.addConfig(cached, isMixin);
  24526. },
  24527. /**
  24528. * Returns the `Ext.Configurator` for this class.
  24529. *
  24530. * @return {Ext.Configurator}
  24531. * @private
  24532. * @static
  24533. * @inheritable
  24534. */
  24535. getConfigurator: function() {
  24536. // the Ext.Configurator ctor will set $config so micro-opt out fn call:
  24537. return this.$config || new Ext.Configurator(this);
  24538. },
  24539. /**
  24540. * Get the current class' name in string format.
  24541. *
  24542. * Ext.define('My.cool.Class', {
  24543. * constructor: function() {
  24544. * alert(this.self.getName()); // alerts 'My.cool.Class'
  24545. * }
  24546. * });
  24547. *
  24548. * My.cool.Class.getName(); // 'My.cool.Class'
  24549. *
  24550. * @return {String} className
  24551. * @static
  24552. * @inheritable
  24553. */
  24554. getName: function() {
  24555. return Ext.getClassName(this);
  24556. },
  24557. /**
  24558. * Create aliases for existing prototype methods. Example:
  24559. *
  24560. * Ext.define('My.cool.Class', {
  24561. * method1: function() { ... },
  24562. * method2: function() { ... }
  24563. * });
  24564. *
  24565. * var test = new My.cool.Class();
  24566. *
  24567. * My.cool.Class.createAlias({
  24568. * method3: 'method1',
  24569. * method4: 'method2'
  24570. * });
  24571. *
  24572. * test.method3(); // test.method1()
  24573. *
  24574. * My.cool.Class.createAlias('method5', 'method3');
  24575. *
  24576. * test.method5(); // test.method3() -> test.method1()
  24577. *
  24578. * @param {String/Object} alias The new method name, or an object to set multiple aliases.
  24579. * See {@link Ext.Function#flexSetter flexSetter}
  24580. * @param {String/Object} origin The original method name
  24581. * @static
  24582. * @inheritable
  24583. * @method
  24584. */
  24585. createAlias: flexSetter(function(alias, origin) {
  24586. aliasOneMember[alias] = function() {
  24587. return this[origin].apply(this, arguments);
  24588. };
  24589. this.override(aliasOneMember);
  24590. delete aliasOneMember[alias];
  24591. })
  24592. });
  24593. // Capture the set of static members on Ext.Base that we want to copy to all
  24594. // derived classes. This array is used by Ext.Class as well as the optimizer.
  24595. for (baseStaticMember in Base) {
  24596. if (Base.hasOwnProperty(baseStaticMember)) {
  24597. baseStaticMembers.push(baseStaticMember);
  24598. }
  24599. }
  24600. Base.$staticMembers = baseStaticMembers;
  24601. Base.getConfigurator();
  24602. // lazily create now so as not capture in $staticMembers
  24603. Base.addMembers({
  24604. /** @private */
  24605. $className: 'Ext.Base',
  24606. /**
  24607. * @property {Object/Array} $configTransforms
  24608. * A prototype-chained object storing transform method names and priorities stored
  24609. * on the class prototype. On first instantiation, this object is converted into
  24610. * an array that is sorted by priority and stored on the constructor.
  24611. * @private
  24612. */
  24613. $configTransforms: {},
  24614. /**
  24615. * @property {Boolean} isInstance
  24616. * This value is `true` and is used to identify plain objects from instances of
  24617. * a defined class.
  24618. * @protected
  24619. * @readonly
  24620. */
  24621. isInstance: true,
  24622. /**
  24623. * @property {Boolean} $configPrefixed
  24624. * The value `true` causes `config` values to be stored on instances using a
  24625. * property name prefixed with an underscore ("_") character. A value of `false`
  24626. * stores `config` values as properties using their exact name (no prefix).
  24627. * @private
  24628. * @since 5.0.0
  24629. */
  24630. $configPrefixed: true,
  24631. /**
  24632. * @property {Boolean} $configStrict
  24633. * The value `true` instructs the `initConfig` method to only honor values for
  24634. * properties declared in the `config` block of a class. When `false`, properties
  24635. * that are not declared in a `config` block will be placed on the instance.
  24636. * @private
  24637. * @since 5.0.0
  24638. */
  24639. $configStrict: true,
  24640. /**
  24641. * @property {Boolean} isConfiguring
  24642. * This property is set to `true` during the call to `initConfig`.
  24643. * @protected
  24644. * @readonly
  24645. * @since 5.0.0
  24646. */
  24647. isConfiguring: false,
  24648. /**
  24649. * @property {Boolean} isFirstInstance
  24650. * This property is set to `true` if this instance is the first of its class.
  24651. * @protected
  24652. * @readonly
  24653. * @since 5.0.0
  24654. */
  24655. isFirstInstance: false,
  24656. /**
  24657. * @property {Boolean} destroyed
  24658. * This property is set to `true` after the `destroy` method is called.
  24659. */
  24660. destroyed: false,
  24661. /**
  24662. * @property {Boolean/"async"} [clearPropertiesOnDestroy=true]
  24663. * Setting this property to `false` will prevent nulling object references
  24664. * on a Class instance after destruction. Setting this to `"async"` will delay
  24665. * the clearing for approx 50ms.
  24666. * @protected
  24667. * @since 6.2.0
  24668. */
  24669. clearPropertiesOnDestroy: true,
  24670. /**
  24671. * @property {Boolean} [clearPrototypeOnDestroy=false]
  24672. * Setting this property to `true` will result in setting the object's
  24673. * prototype to `null` after the destruction sequence is fully completed.
  24674. * After that, most attempts at calling methods on the object instance
  24675. * will result in "method not defined" exception. This can be very helpful
  24676. * with tracking down otherwise hard to find bugs like runaway Ajax requests,
  24677. * timed functions not cleared on destruction, etc.
  24678. *
  24679. * Note that this option can only work in browsers that support `Object.setPrototypeOf`
  24680. * method, and is only available in debugging mode.
  24681. * @private
  24682. * @since 6.2.0
  24683. */
  24684. clearPrototypeOnDestroy: false,
  24685. /**
  24686. * Get the reference to the class from which this object was instantiated. Note that unlike
  24687. * {@link Ext.Base#self}, `this.statics()` is scope-independent and it always returns
  24688. * the class from which it was called, regardless of what `this` points to during run-time
  24689. *
  24690. * Ext.define('My.Cat', {
  24691. * statics: {
  24692. * totalCreated: 0,
  24693. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24694. * },
  24695. *
  24696. * constructor: function() {
  24697. * var statics = this.statics();
  24698. *
  24699. * // always equals to 'Cat' no matter what 'this' refers to
  24700. * // equivalent to: My.Cat.speciesName
  24701. * alert(statics.speciesName);
  24702. *
  24703. *
  24704. * alert(this.self.speciesName); // dependent on 'this'
  24705. *
  24706. * statics.totalCreated++;
  24707. * },
  24708. *
  24709. * clone: function() {
  24710. * var cloned = new this.self(); // dependent on 'this'
  24711. *
  24712. * // equivalent to: My.Cat.speciesName
  24713. * cloned.groupName = this.statics().speciesName;
  24714. *
  24715. * return cloned;
  24716. * }
  24717. * });
  24718. *
  24719. *
  24720. * Ext.define('My.SnowLeopard', {
  24721. * extend: 'My.Cat',
  24722. *
  24723. * statics: {
  24724. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24725. * },
  24726. *
  24727. * constructor: function() {
  24728. * this.callParent();
  24729. * }
  24730. * });
  24731. *
  24732. * var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'
  24733. *
  24734. * var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'
  24735. *
  24736. * var clone = snowLeopard.clone();
  24737. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24738. * alert(clone.groupName); // alerts 'Cat'
  24739. *
  24740. * alert(My.Cat.totalCreated); // alerts 3
  24741. *
  24742. * @protected
  24743. * @return {Ext.Class}
  24744. */
  24745. statics: function() {
  24746. var method = this.statics.caller,
  24747. self = this.self;
  24748. if (!method) {
  24749. return self;
  24750. }
  24751. return method.$owner;
  24752. },
  24753. /**
  24754. * Call the "parent" method of the current method. That is the method previously
  24755. * overridden by derivation or by an override (see {@link Ext#define}).
  24756. *
  24757. * Ext.define('My.Base', {
  24758. * constructor: function(x) {
  24759. * this.x = x;
  24760. * },
  24761. *
  24762. * statics: {
  24763. * method: function(x) {
  24764. * return x;
  24765. * }
  24766. * }
  24767. * });
  24768. *
  24769. * Ext.define('My.Derived', {
  24770. * extend: 'My.Base',
  24771. *
  24772. * constructor: function() {
  24773. * this.callParent([21]);
  24774. * }
  24775. * });
  24776. *
  24777. * var obj = new My.Derived();
  24778. *
  24779. * alert(obj.x); // alerts 21
  24780. *
  24781. * This can be used with an override as follows:
  24782. *
  24783. * Ext.define('My.DerivedOverride', {
  24784. * override: 'My.Derived',
  24785. *
  24786. * constructor: function(x) {
  24787. * this.callParent([x*2]); // calls original My.Derived constructor
  24788. * }
  24789. * });
  24790. *
  24791. * var obj = new My.Derived();
  24792. *
  24793. * alert(obj.x); // now alerts 42
  24794. *
  24795. * This also works with static and private methods.
  24796. *
  24797. * Ext.define('My.Derived2', {
  24798. * extend: 'My.Base',
  24799. *
  24800. * // privates: {
  24801. * statics: {
  24802. * method: function(x) {
  24803. * return this.callParent([x*2]); // calls My.Base.method
  24804. * }
  24805. * }
  24806. * });
  24807. *
  24808. * alert(My.Base.method(10)); // alerts 10
  24809. * alert(My.Derived2.method(10)); // alerts 20
  24810. *
  24811. * Lastly, it also works with overridden static methods.
  24812. *
  24813. * Ext.define('My.Derived2Override', {
  24814. * override: 'My.Derived2',
  24815. *
  24816. * // privates: {
  24817. * statics: {
  24818. * method: function(x) {
  24819. * return this.callParent([x*2]); // calls My.Derived2.method
  24820. * }
  24821. * }
  24822. * });
  24823. *
  24824. * alert(My.Derived2.method(10); // now alerts 40
  24825. *
  24826. * To override a method and replace it and also call the superclass method, use
  24827. * {@link #method-callSuper}. This is often done to patch a method to fix a bug.
  24828. *
  24829. * @protected
  24830. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24831. * from the current method, for example: `this.callParent(arguments)`
  24832. * @return {Object} Returns the result of calling the parent method
  24833. */
  24834. callParent: function(args) {
  24835. // NOTE: this code is deliberately as few expressions (and no function calls)
  24836. // as possible so that a debugger can skip over this noise with the minimum number
  24837. // of steps. Basically, just hit Step Into until you are where you really wanted
  24838. // to be.
  24839. var method,
  24840. superMethod = (method = this.callParent.caller) && (method.$previous || ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]));
  24841. if (!superMethod) {
  24842. method = this.callParent.caller;
  24843. /* eslint-disable-next-line vars-on-top */
  24844. var parentClass, methodName;
  24845. if (!method.$owner) {
  24846. if (!method.caller) {
  24847. throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
  24848. }
  24849. method = method.caller;
  24850. }
  24851. parentClass = method.$owner.superclass;
  24852. methodName = method.$name;
  24853. if (!(methodName in parentClass)) {
  24854. throw new Error("this.callParent() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24855. }
  24856. }
  24857. return superMethod.apply(this, args || noArgs);
  24858. },
  24859. /**
  24860. * This method is used by an **override** to call the superclass method but
  24861. * bypass any overridden method. This is often done to "patch" a method that
  24862. * contains a bug but for whatever reason cannot be fixed directly.
  24863. *
  24864. * Consider:
  24865. *
  24866. * Ext.define('Ext.some.Class', {
  24867. * method: function() {
  24868. * console.log('Good');
  24869. * }
  24870. * });
  24871. *
  24872. * Ext.define('Ext.some.DerivedClass', {
  24873. * extend: 'Ext.some.Class',
  24874. *
  24875. * method: function() {
  24876. * console.log('Bad');
  24877. *
  24878. * // ... logic but with a bug ...
  24879. *
  24880. * this.callParent();
  24881. * }
  24882. * });
  24883. *
  24884. * To patch the bug in `Ext.some.DerivedClass.method`, the typical solution is to create an
  24885. * override:
  24886. *
  24887. * Ext.define('App.patches.DerivedClass', {
  24888. * override: 'Ext.some.DerivedClass',
  24889. *
  24890. * method: function() {
  24891. * console.log('Fixed');
  24892. *
  24893. * // ... logic but with bug fixed ...
  24894. *
  24895. * this.callSuper();
  24896. * }
  24897. * });
  24898. *
  24899. * The patch method cannot use {@link #method-callParent} to call the superclass
  24900. * `method` since that would call the overridden method containing the bug. In
  24901. * other words, the above patch would only produce "Fixed" then "Good" in the
  24902. * console log, whereas, using `callParent` would produce "Fixed" then "Bad"
  24903. * then "Good".
  24904. *
  24905. * @protected
  24906. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  24907. * from the current method, for example: `this.callSuper(arguments)`
  24908. * @return {Object} Returns the result of calling the superclass method
  24909. */
  24910. callSuper: function(args) {
  24911. // NOTE: this code is deliberately as few expressions (and no function calls)
  24912. // as possible so that a debugger can skip over this noise with the minimum number
  24913. // of steps. Basically, just hit Step Into until you are where you really wanted
  24914. // to be.
  24915. var method,
  24916. superMethod = (method = this.callSuper.caller) && ((method = method.$owner ? method : method.caller) && method.$owner.superclass[method.$name]);
  24917. if (!superMethod) {
  24918. method = this.callSuper.caller;
  24919. /* eslint-disable-next-line vars-on-top */
  24920. var parentClass, methodName;
  24921. if (!method.$owner) {
  24922. if (!method.caller) {
  24923. throw new Error("Attempting to call a protected method from the " + "public scope, which is not allowed");
  24924. }
  24925. method = method.caller;
  24926. }
  24927. parentClass = method.$owner.superclass;
  24928. methodName = method.$name;
  24929. if (!(methodName in parentClass)) {
  24930. throw new Error("this.callSuper() was called but there's no such method (" + methodName + ") found in the parent class (" + (Ext.getClassName(parentClass) || 'Object') + ")");
  24931. }
  24932. }
  24933. return superMethod.apply(this, args || noArgs);
  24934. },
  24935. /**
  24936. * @property {Ext.Class} self
  24937. *
  24938. * Get the reference to the current class from which this object was instantiated. Unlike
  24939. * {@link Ext.Base#statics}, `this.self` is scope-dependent and it's meant to be used
  24940. * for dynamic inheritance. See {@link Ext.Base#statics} for a detailed comparison
  24941. *
  24942. * Ext.define('My.Cat', {
  24943. * statics: {
  24944. * speciesName: 'Cat' // My.Cat.speciesName = 'Cat'
  24945. * },
  24946. *
  24947. * constructor: function() {
  24948. * alert(this.self.speciesName); // dependent on 'this'
  24949. * },
  24950. *
  24951. * clone: function() {
  24952. * return new this.self();
  24953. * }
  24954. * });
  24955. *
  24956. *
  24957. * Ext.define('My.SnowLeopard', {
  24958. * extend: 'My.Cat',
  24959. * statics: {
  24960. * speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'
  24961. * }
  24962. * });
  24963. *
  24964. * var cat = new My.Cat(); // alerts 'Cat'
  24965. * var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'
  24966. *
  24967. * var clone = snowLeopard.clone();
  24968. * alert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'
  24969. *
  24970. * @protected
  24971. */
  24972. self: Base,
  24973. // Default constructor, simply returns `this`
  24974. constructor: function() {
  24975. return this;
  24976. },
  24977. /**
  24978. * Initialize configuration for this class. a typical example:
  24979. *
  24980. * Ext.define('My.awesome.Class', {
  24981. * // The default config
  24982. * config: {
  24983. * name: 'Awesome',
  24984. * isAwesome: true
  24985. * },
  24986. *
  24987. * constructor: function(config) {
  24988. * this.initConfig(config);
  24989. * }
  24990. * });
  24991. *
  24992. * var awesome = new My.awesome.Class({
  24993. * name: 'Super Awesome'
  24994. * });
  24995. *
  24996. * alert(awesome.getName()); // 'Super Awesome'
  24997. *
  24998. * @protected
  24999. * @param {Object} instanceConfig
  25000. * @return {Ext.Base} this
  25001. * @chainable
  25002. */
  25003. initConfig: function(instanceConfig) {
  25004. var me = this,
  25005. cfg = me.self.getConfigurator();
  25006. me.initConfig = Ext.emptyFn;
  25007. // ignore subsequent calls to initConfig
  25008. me.initialConfig = instanceConfig || {};
  25009. cfg.configure(me, instanceConfig);
  25010. return me;
  25011. },
  25012. beforeInitConfig: Ext.emptyFn,
  25013. /**
  25014. * Returns a specified config property value. If the name parameter is not passed,
  25015. * all current configuration options will be returned as key value pairs.
  25016. * @param {String} [name] The name of the config property to get.
  25017. * @param {Boolean} [peek=false] `true` to peek at the raw value without calling the getter.
  25018. * @param {Boolean} [ifInitialized=false] `true` to only return the initialized property
  25019. * value, not the raw config value, and *not* to trigger initialization. Returns
  25020. * `undefined` if the property has not yet been initialized.
  25021. * @return {Object} The config property value.
  25022. */
  25023. getConfig: function(name, peek, ifInitialized) {
  25024. var me = this,
  25025. ret, cfg, propName;
  25026. if (name) {
  25027. cfg = me.self.$config.configs[name];
  25028. if (cfg) {
  25029. propName = me.$configPrefixed ? cfg.names.internal : name;
  25030. // They only want the fully initialized value, not the initial config,
  25031. // but only if it's already present on this instance.
  25032. // They don't want to trigger the initGetter.
  25033. // This form is used by Bindable#updatePublishes to initially publish
  25034. // the properties it's being asked make publishable.
  25035. if (ifInitialized) {
  25036. ret = me.hasOwnProperty(propName) ? me[propName] : null;
  25037. } else if (peek) {
  25038. // Attempt to return the instantiated property on this instance first.
  25039. // Only return the config object if it has not yet been pulled through
  25040. // the applier into the instance.
  25041. ret = me.hasOwnProperty(propName) ? me[propName] : me.config[name];
  25042. } else {
  25043. ret = me[cfg.names.get]();
  25044. }
  25045. } else {
  25046. ret = me[name];
  25047. }
  25048. } else {
  25049. ret = me.getCurrentConfig();
  25050. }
  25051. return ret;
  25052. },
  25053. /**
  25054. * Destroys member properties by name.
  25055. *
  25056. * If a property name is the name of a *config*, the getter is *not* invoked, so
  25057. * if the config has not been initialized, nothing will be done.
  25058. *
  25059. * The property will be destroyed, and the corrected name (if the property is a *config*
  25060. * and config names are prefixed) will set to `null` in this object's dictionary.
  25061. *
  25062. * @param {String...} args One or more names of the properties to destroy and remove from
  25063. * the object.
  25064. */
  25065. destroyMembers: function() {
  25066. var me = this,
  25067. configs = me.self.$config.configs,
  25068. len = arguments.length,
  25069. cfg, name, value, i;
  25070. for (i = 0; i < len; i++) {
  25071. name = arguments[i];
  25072. cfg = configs[name];
  25073. name = cfg && me.$configPrefixed ? cfg.names.internal : name;
  25074. value = me.hasOwnProperty(name) && me[name];
  25075. if (value) {
  25076. Ext.destroy(value);
  25077. me[name] = null;
  25078. }
  25079. }
  25080. },
  25081. freezeConfig: function(name) {
  25082. var me = this,
  25083. config = Ext.Config.get(name),
  25084. names = config.names,
  25085. value = me[names.get]();
  25086. me[names.set] = function(v) {
  25087. if (v !== value) {
  25088. Ext.raise('Cannot change frozen config "' + name + '"');
  25089. }
  25090. return me;
  25091. };
  25092. if (!Ext.isIE8) {
  25093. Object.defineProperty(me, me.$configPrefixed ? names.internal : name, {
  25094. get: function() {
  25095. return value;
  25096. },
  25097. set: function(v) {
  25098. if (v !== value) {
  25099. Ext.raise('Cannot change frozen config "' + name + '"');
  25100. }
  25101. }
  25102. });
  25103. }
  25104. },
  25105. /**
  25106. * Sets a single/multiple configuration options.
  25107. * @param {String/Object} name The name of the property to set, or a set of key value
  25108. * pairs to set.
  25109. * @param {Object} [value] The value to set for the name parameter.
  25110. * @param {Object} [options] (private)
  25111. * @return {Ext.Base} this
  25112. */
  25113. setConfig: function(name, value, options) {
  25114. // options can have the following properties:
  25115. // - defaults `true` to only set the config(s) that have not been already set on
  25116. // this instance.
  25117. // - strict `false` to apply properties to the instance that are not configs,
  25118. // and do not have setters.
  25119. var me = this,
  25120. configurator, config, prop;
  25121. if (name) {
  25122. configurator = me.self.getConfigurator();
  25123. if (typeof name === 'string') {
  25124. config = configurator.configs[name];
  25125. if (!config) {
  25126. if (me.$configStrict) {
  25127. prop = me.self.prototype[name];
  25128. if ((typeof prop === 'function') && !prop.$nullFn) {
  25129. Ext.Error.raise("Cannot override method " + name + " on " + me.$className + " instance.");
  25130. return me;
  25131. } else {
  25132. if (name !== 'type') {
  25133. Ext.log.warn('No such config "' + name + '" for class ' + me.$className);
  25134. }
  25135. }
  25136. }
  25137. config = Ext.Config.map[name] || Ext.Config.get(name);
  25138. }
  25139. if (me[config.names.set]) {
  25140. me[config.names.set](value);
  25141. } else {
  25142. // apply non-config props directly to the instance
  25143. me[name] = value;
  25144. }
  25145. } else {
  25146. // This should not have "options ||" except that it shipped in that
  25147. // broken state, so we use it if present for compat.
  25148. configurator.reconfigure(me, name, options || value);
  25149. }
  25150. }
  25151. return me;
  25152. },
  25153. getConfigWatcher: function() {
  25154. return this.$configWatch || (this.$configWatch = new Ext.mixin.Watchable());
  25155. },
  25156. /**
  25157. * Watches config properties.
  25158. *
  25159. * instance.watchConfig({
  25160. * title: 'onTitleChange',
  25161. * scope: me
  25162. * });
  25163. *
  25164. * @private
  25165. * @since 6.7.0
  25166. */
  25167. watchConfig: function(name, fn, scope) {
  25168. var watcher = this.getConfigWatcher();
  25169. return watcher.on.apply(watcher, arguments);
  25170. },
  25171. $configWatch: null,
  25172. /**
  25173. * @private
  25174. */
  25175. getCurrentConfig: function() {
  25176. var cfg = this.self.getConfigurator();
  25177. return cfg.getCurrentConfig(this);
  25178. },
  25179. /**
  25180. * @param {String} name
  25181. * @private
  25182. */
  25183. hasConfig: function(name) {
  25184. return name in this.defaultConfig;
  25185. },
  25186. /**
  25187. * Returns the initial configuration passed to the constructor when
  25188. * instantiating this class.
  25189. *
  25190. * Given this example Ext.button.Button definition and instance:
  25191. *
  25192. * Ext.define('MyApp.view.Button', {
  25193. * extend: 'Ext.button.Button',
  25194. * xtype: 'mybutton',
  25195. *
  25196. * scale: 'large',
  25197. * enableToggle: true
  25198. * });
  25199. *
  25200. * var btn = Ext.create({
  25201. * xtype: 'mybutton',
  25202. * renderTo: Ext.getBody(),
  25203. * text: 'Test Button'
  25204. * });
  25205. *
  25206. * Calling `btn.getInitialConfig()` would return an object including the config
  25207. * options passed to the `create` method:
  25208. *
  25209. * xtype: 'mybutton',
  25210. * renderTo: // The document body itself
  25211. * text: 'Test Button'
  25212. *
  25213. * Calling `btn.getInitialConfig('text')`returns **'Test Button'**.
  25214. *
  25215. * @param {String} [name] Name of the config option to return.
  25216. * @return {Object/Mixed} The full config object or a single config value
  25217. * when `name` parameter specified.
  25218. */
  25219. getInitialConfig: function(name) {
  25220. var config = this.config;
  25221. if (!name) {
  25222. return config;
  25223. }
  25224. return config[name];
  25225. },
  25226. $links: null,
  25227. /**
  25228. * Adds a "destroyable" object to an internal list of objects that will be destroyed
  25229. * when this instance is destroyed (via `{@link #method!destroy}`).
  25230. * @param {String} name
  25231. * @param {Object} value
  25232. * @return {Object} The `value` passed.
  25233. * @private
  25234. */
  25235. link: function(name, value) {
  25236. var me = this,
  25237. links = me.$links || (me.$links = {});
  25238. links[name] = true;
  25239. me[name] = value;
  25240. return value;
  25241. },
  25242. /**
  25243. * Destroys a given set of `{@link #link linked}` objects. This is only needed if
  25244. * the linked object is being destroyed before this instance.
  25245. * @param {String[]} names The names of the linked objects to destroy.
  25246. * @return {Ext.Base} this
  25247. * @private
  25248. */
  25249. unlink: function(names) {
  25250. var me = this,
  25251. i, ln, link, value;
  25252. if (!Ext.isArray(names)) {
  25253. Ext.raise('Invalid argument - expected array of strings');
  25254. }
  25255. for (i = 0 , ln = names.length; i < ln; i++) {
  25256. link = names[i];
  25257. value = me[link];
  25258. if (value) {
  25259. if (value.isInstance && !value.destroyed) {
  25260. value.destroy();
  25261. } else if (value.parentNode && 'nodeType' in value) {
  25262. value.parentNode.removeChild(value);
  25263. }
  25264. }
  25265. me[link] = null;
  25266. }
  25267. return me;
  25268. },
  25269. $reap: function() {
  25270. var me = this,
  25271. keepers = me.$noClearOnDestroy,
  25272. props, prop, val, t, i, len;
  25273. // This only returns own keys which is *much* faster than iterating
  25274. // over the whole prototype chain and calling hasOwnProperty()
  25275. props = Ext.Object.getKeys(me);
  25276. for (i = 0 , len = props.length; i < len; i++) {
  25277. prop = props[i];
  25278. val = me[prop];
  25279. // typeof null === 'object' :(
  25280. if (val && !(keepers && keepers[prop])) {
  25281. t = typeof val;
  25282. // Object may retain references to other objects. Functions can do too
  25283. // if they are closures, and most of the *own* function properties
  25284. // are closures indeed. We skip Ext.emptyFn and the like though,
  25285. // they're mostly harmless.
  25286. if (t === 'object' || (t === 'function' && !val.$noClearOnDestroy)) {
  25287. me[prop] = null;
  25288. }
  25289. }
  25290. }
  25291. me.$nulled = true;
  25292. // We also want to make sure no methods are called on the destroyed object,
  25293. // because that may lead to accessing nulled properties and resulting exceptions.
  25294. if (Object.setPrototypeOf) {
  25295. if (me.clearPrototypeOnDestroy && !me.$vetoClearingPrototypeOnDestroy) {
  25296. props = me.$preservePrototypeProperties;
  25297. if (props) {
  25298. for (i = 0 , len = props.length; i < len; i++) {
  25299. prop = props[i];
  25300. if (!me.hasOwnProperty(prop)) {
  25301. /* eslint-disable-next-line no-self-assign */
  25302. me[prop] = me[prop];
  25303. }
  25304. }
  25305. }
  25306. Object.setPrototypeOf(me, null);
  25307. }
  25308. }
  25309. },
  25310. /**
  25311. * This method is called to cleanup an object and its resources. After calling
  25312. * this method, the object should not be used any further in any way, including
  25313. * access to its methods and properties.
  25314. *
  25315. * To prevent potential memory leaks, all object references will be nulled
  25316. * at the end of destruction sequence, unless {@link #clearPropertiesOnDestroy}
  25317. * is set to `false`.
  25318. */
  25319. destroy: function() {
  25320. var me = this,
  25321. links = me.$links,
  25322. clearPropertiesOnDestroy = me.clearPropertiesOnDestroy;
  25323. if (links) {
  25324. me.$links = null;
  25325. me.unlink(Ext.Object.getKeys(links));
  25326. }
  25327. me.destroy = Ext.emptyFn;
  25328. // isDestroyed added for compat reasons
  25329. me.isDestroyed = me.destroyed = true;
  25330. // By this time the destruction is complete. Now we can make sure
  25331. // no objects are retained by the husk of this ex-Instance.
  25332. if (clearPropertiesOnDestroy === true) {
  25333. // Observable mixin will call destroyObservable that will reap the properties.
  25334. if (!me.isObservable) {
  25335. me.$reap();
  25336. }
  25337. } else if (clearPropertiesOnDestroy) {
  25338. if (clearPropertiesOnDestroy !== 'async') {
  25339. Ext.raise('Invalid value for clearPropertiesOnDestroy');
  25340. }
  25341. Reaper.add(me);
  25342. }
  25343. }
  25344. });
  25345. /**
  25346. * @method callOverridden
  25347. * Call the original method that was previously overridden with {@link Ext.Base#override}
  25348. *
  25349. * Ext.define('My.Cat', {
  25350. * constructor: function() {
  25351. * alert("I'm a cat!");
  25352. * }
  25353. * });
  25354. *
  25355. * My.Cat.override({
  25356. * constructor: function() {
  25357. * alert("I'm going to be a cat!");
  25358. *
  25359. * this.callOverridden();
  25360. *
  25361. * alert("Meeeeoooowwww");
  25362. * }
  25363. * });
  25364. *
  25365. * var kitty = new My.Cat(); // alerts "I'm going to be a cat!"
  25366. * // alerts "I'm a cat!"
  25367. * // alerts "Meeeeoooowwww"
  25368. *
  25369. * @param {Array/Arguments} args The arguments, either an array or the `arguments` object
  25370. * from the current method, for example: `this.callOverridden(arguments)`
  25371. * @return {Object} Returns the result of calling the overridden method
  25372. * @deprecated 4.1.0 Use {@link #method-callParent} instead.
  25373. * @protected
  25374. */
  25375. BasePrototype.callOverridden = BasePrototype.callParent;
  25376. Ext.privacyViolation = function(cls, existing, member, isStatic) {
  25377. var name = member.$name,
  25378. conflictCls = existing.$owner && existing.$owner.$className,
  25379. s = isStatic ? 'static ' : '',
  25380. msg = member.$privacy ? 'Private ' + s + member.$privacy + ' method "' + name + '"' : 'Public ' + s + 'method "' + name + '"';
  25381. if (cls.$className) {
  25382. msg = cls.$className + ': ' + msg;
  25383. }
  25384. if (!existing.$privacy) {
  25385. msg += conflictCls ? ' hides public method inherited from ' + conflictCls : ' hides inherited public method.';
  25386. } else {
  25387. msg += conflictCls ? ' conflicts with private ' + existing.$privacy + ' method declared by ' + conflictCls : ' conflicts with inherited private ' + existing.$privacy + ' method.';
  25388. }
  25389. /* eslint-disable-next-line vars-on-top */
  25390. var compat = Ext.getCompatVersion(),
  25391. ver = Ext.getVersion();
  25392. // When compatibility is enabled, log problems instead of throwing errors.
  25393. if (ver && compat && compat.lt(ver)) {
  25394. Ext.log.error(msg);
  25395. } else {
  25396. Ext.raise(msg);
  25397. }
  25398. };
  25399. Ext.Reaper.tick.$skipTimerCheck = true;
  25400. return Base;
  25401. }(Ext.Function.flexSetter));
  25402. /**
  25403. * This class manages a double-linked list. It provides an absolutely minimal container
  25404. * interface.
  25405. *
  25406. * @class Ext.util.LRU
  25407. * @private
  25408. * @since 6.5.0
  25409. */
  25410. /* eslint-disable indent */
  25411. (function(LRU, prototype) {
  25412. // @define Ext.util.LRU
  25413. // NOTE: We have to implement this class old-school because it is used by the
  25414. // platformConfig class processor (so Ext.define is not yet ready for action).
  25415. (Ext.util || (Ext.util = {})).LRU = LRU = function(config) {
  25416. var me = this,
  25417. head;
  25418. if (config) {
  25419. Ext.apply(me, config);
  25420. }
  25421. // Give all entries the same object shape.
  25422. me.head = head = {
  25423. id: (me.seed = 0),
  25424. key: null,
  25425. value: null
  25426. };
  25427. /**
  25428. * @property {Object} map
  25429. * The items in the list indexed by their `key`.
  25430. * @readonly
  25431. */
  25432. me.map = {};
  25433. head.next = head.prev = head;
  25434. };
  25435. LRU.prototype = prototype = {
  25436. /**
  25437. * @property {Number} count
  25438. * The number of items in this list.
  25439. * @readonly
  25440. */
  25441. count: 0,
  25442. /**
  25443. * Adds an item to the list with the specified `key`. Items are added at the
  25444. * front (MRU) of the list.
  25445. * @param {String} key
  25446. * @param {Object} value
  25447. */
  25448. add: function(key, value) {
  25449. var me = this,
  25450. map = me.map,
  25451. entry = map[key];
  25452. if (entry) {
  25453. me.unlink(entry);
  25454. --me.count;
  25455. }
  25456. map[key] = entry = {
  25457. id: ++me.seed,
  25458. key: key,
  25459. value: value
  25460. };
  25461. me.link(entry);
  25462. ++me.count;
  25463. return entry;
  25464. },
  25465. /**
  25466. * Removes all items from this list optionally calling a function for each
  25467. * remove item.
  25468. * @param {Function} [fn] A function to call for each removed item.
  25469. * @param {Object} fn.key The key of the removed item.
  25470. * @param {Object} fn.value The removed item.
  25471. * @param {Object} [scope] The `this` pointer for `fn`.
  25472. */
  25473. clear: function(fn, scope) {
  25474. var me = this,
  25475. head = me.head,
  25476. entry = head.next;
  25477. head.next = head.prev = head;
  25478. me.count = 0;
  25479. if (fn && !fn.$nullFn) {
  25480. for (; entry !== head; entry = entry.next) {
  25481. fn.call(scope || me, entry.key, entry.value);
  25482. }
  25483. }
  25484. },
  25485. /**
  25486. * Calls the given function `fn` for each item in the list. The items will be
  25487. * passed to `fn` from most-to-least recently added or touched.
  25488. * @param {Function} fn The function to call for each cache item.
  25489. * @param {String} fn.key The key for the item.
  25490. * @param {Object} fn.value The item.
  25491. * @param {Object} [scope] The `this` pointer to use for `fn`.
  25492. */
  25493. each: function(fn, scope) {
  25494. var head, ent;
  25495. scope = scope || this;
  25496. for (head = this.head , ent = head.next; ent !== head; ent = ent.next) {
  25497. if (fn.call(scope, ent.key, ent.value)) {
  25498. break;
  25499. }
  25500. }
  25501. },
  25502. /**
  25503. * Removes the item at the end (LRU) of the list. Optionally the item can be passed
  25504. * to a callback function. If the list is empty, no callback is made and this
  25505. * method will return `undefined`.
  25506. * @param {Function} fn The function to call for the removed item.
  25507. * @param {Object} fn.key The key of the removed item.
  25508. * @param {Object} fn.value The removed item.
  25509. * @param {Object} [scope] The `this` pointer to use for `fn`.
  25510. * @return {Object} The removed item.
  25511. */
  25512. prune: function(fn, scope) {
  25513. var me = this,
  25514. entry = me.head.prev,
  25515. ret;
  25516. if (me.count) {
  25517. ret = entry.value;
  25518. me.unlink(entry);
  25519. --me.count;
  25520. if (fn) {
  25521. fn.call(scope || me, entry.key, ret);
  25522. }
  25523. }
  25524. return ret;
  25525. },
  25526. /**
  25527. * Removes an item from the list given its key.
  25528. * @param {String} key The key of the item to remove.
  25529. * @return {Object} The removed item or `undefined` if the key was not found.
  25530. */
  25531. remove: function(key) {
  25532. var me = this,
  25533. map = me.map,
  25534. entry = map[key],
  25535. value;
  25536. if (entry) {
  25537. me.unlink(entry);
  25538. value = entry.value;
  25539. delete map[key];
  25540. --me.count;
  25541. }
  25542. return value;
  25543. },
  25544. /**
  25545. * Moves the item with the given key to the front (MRU) of the list.
  25546. * @param {String} key The key of the item to move to the front.
  25547. */
  25548. touch: function(key) {
  25549. var me = this,
  25550. head = me.head,
  25551. entry = me.map[key];
  25552. if (entry && entry.prev !== head) {
  25553. // The entry is not at the front, so remove it and insert it at the front
  25554. // (to make it the MRU - Most Recently Used).
  25555. me.unlink(entry);
  25556. me.link(entry);
  25557. }
  25558. },
  25559. /**
  25560. * Reduces the length of the list to be no more than the specified `size`, removing
  25561. * items from the end of the list as necessary. Optionally each removed item can
  25562. * be passed to a callback `fn`.
  25563. * @param {Number} size The number of items in the list
  25564. * @param {Function} [fn] A function to call for each removed item.
  25565. * @param {Object} fn.key The key of the removed item.
  25566. * @param {Object} fn.value The removed item.
  25567. * @param {Object} [scope] The `this` pointer for `fn`.
  25568. */
  25569. trim: function(size, fn, scope) {
  25570. while (this.count > size) {
  25571. this.prune(fn, scope);
  25572. }
  25573. },
  25574. //-------------------------------------------------------------------------
  25575. // Internals
  25576. /**
  25577. * Inserts the given entry at the front (MRU) end of the entry list.
  25578. * @param {Object} entry The cache item entry.
  25579. * @private
  25580. */
  25581. link: function(entry) {
  25582. var head = this.head,
  25583. first = head.next;
  25584. entry.next = first;
  25585. entry.prev = head;
  25586. head.next = entry;
  25587. first.prev = entry;
  25588. },
  25589. /**
  25590. * Removes the given entry from the entry list.
  25591. * @param {Object} entry The cache item entry.
  25592. * @private
  25593. */
  25594. unlink: function(entry) {
  25595. var next = entry.next,
  25596. prev = entry.prev;
  25597. prev.next = next;
  25598. next.prev = prev;
  25599. }
  25600. };
  25601. prototype.destroy = function() {
  25602. this.clear.apply(this, arguments);
  25603. };
  25604. }());
  25605. /**
  25606. * This class is used to manage simple, LRU caches. It provides an absolutely minimal
  25607. * container interface. It is created like this:
  25608. *
  25609. * this.itemCache = new Ext.util.Cache({
  25610. * miss: function (key) {
  25611. * return new CacheItem(key);
  25612. * }
  25613. * });
  25614. *
  25615. * The `{@link #miss}` abstract method must be implemented by either a derived class or
  25616. * at the instance level as shown above.
  25617. *
  25618. * Once the cache exists and it can handle cache misses, the cache is used like so:
  25619. *
  25620. * var item = this.itemCache.get(key);
  25621. *
  25622. * The `key` is some value that uniquely identifies the cached item.
  25623. *
  25624. * In some cases, creating the cache item may require more than just the lookup key. In
  25625. * that case, any extra arguments passed to `get` will be passed to `miss`.
  25626. *
  25627. * this.otherCache = new Ext.util.Cache({
  25628. * miss: function (key, extra) {
  25629. * return new CacheItem(key, extra);
  25630. * }
  25631. * });
  25632. *
  25633. * var item = this.otherCache.get(key, extra);
  25634. *
  25635. * To process items as they are removed, you can provide an `{@link #evict}` method. The
  25636. * stock method is `Ext.emptyFn` and so does nothing.
  25637. *
  25638. * For example:
  25639. *
  25640. * this.itemCache = new Ext.util.Cache({
  25641. * miss: function (key) {
  25642. * return new CacheItem(key);
  25643. * },
  25644. *
  25645. * evict: function (key, cacheItem) {
  25646. * cacheItem.destroy();
  25647. * }
  25648. * });
  25649. *
  25650. * @class Ext.util.Cache
  25651. * @private
  25652. * @since 5.1.0
  25653. */
  25654. /* eslint-disable indent */
  25655. (function(LRU, fn, Cache) {
  25656. // @require Ext.util.LRU
  25657. // @define Ext.util.Cache
  25658. // NOTE: We have to implement this class old-school because it is used by the
  25659. // platformConfig class processor (so Ext.define is not yet ready for action).
  25660. Ext.util.Cache = Cache = function(config) {
  25661. LRU.call(this, config);
  25662. };
  25663. fn.prototype = LRU.prototype;
  25664. Cache.prototype = Ext.apply(new fn(), {
  25665. /**
  25666. * @cfg {Number} maxSize The maximum size the cache is allowed to grow to before
  25667. * further additions cause removal of the least recently used entry.
  25668. */
  25669. maxSize: 100,
  25670. /**
  25671. * This method is called by `{@link #get}` when the key is not found in the cache.
  25672. * The implementation of this method should create the (expensive) value and return
  25673. * it. Whatever arguments were passed to `{@link #get}` will be passed on to this
  25674. * method.
  25675. *
  25676. * @param {String} key The cache lookup key for the item.
  25677. * @param {Object...} args Any other arguments originally passed to `{@link #get}`.
  25678. * @method miss
  25679. * @abstract
  25680. * @protected
  25681. */
  25682. /**
  25683. * Removes all items from this cache.
  25684. */
  25685. clear: function() {
  25686. LRU.prototype.clear.call(this, this.evict);
  25687. },
  25688. /**
  25689. * Finds an item in this cache and returns its value. If the item is present, it is
  25690. * shuffled into the MRU (most-recently-used) position as necessary. If the item is
  25691. * missing, the `{@link #miss}` method is called to create the item.
  25692. *
  25693. * @param {String} key The cache key of the item.
  25694. * @param {Object...} args Arguments for the `miss` method should it be needed.
  25695. * @return {Object} The cached object.
  25696. */
  25697. get: function(key) {
  25698. var me = this,
  25699. entry = me.map[key],
  25700. value;
  25701. if (entry) {
  25702. value = entry.value;
  25703. me.touch(key);
  25704. } else {
  25705. value = me.miss.apply(me, arguments);
  25706. me.add(key, value);
  25707. me.trim(me.maxSize, me.evict);
  25708. }
  25709. return value;
  25710. },
  25711. //-------------------------------------------------------------------------
  25712. // Internals
  25713. /**
  25714. * This method is called internally from `{@link #get}` when the cache is full and
  25715. * the least-recently-used (LRU) item has been removed.
  25716. *
  25717. * @param {String} key The cache lookup key for the item being removed.
  25718. * @param {Object} value The cache value (returned by `{@link #miss}`) for the item
  25719. * being removed.
  25720. * @method evict
  25721. * @template
  25722. * @protected
  25723. */
  25724. evict: Ext.emptyFn
  25725. });
  25726. }(Ext.util.LRU, function() {}));
  25727. /**
  25728. * @class Ext.Class
  25729. *
  25730. * This is a low level factory that is used by {@link Ext#define Ext.define} and should not be used
  25731. * directly in application code.
  25732. *
  25733. * The configs of this class are intended to be used in `Ext.define` calls to describe the class you
  25734. * are declaring. For example:
  25735. *
  25736. * Ext.define('App.util.Thing', {
  25737. * extend: 'App.util.Other',
  25738. *
  25739. * alias: 'util.thing',
  25740. *
  25741. * config: {
  25742. * foo: 42
  25743. * }
  25744. * });
  25745. *
  25746. * Ext.Class is the factory and **not** the superclass of everything. For the base class
  25747. * that **all** classes inherit from, see {@link Ext.Base}.
  25748. */
  25749. /* eslint-disable indent */
  25750. (function() {
  25751. // @tag class
  25752. // @define Ext.Class
  25753. // @require Ext.Base
  25754. // @require Ext.Util
  25755. // @require Ext.util.Cache
  25756. var ExtClass,
  25757. Base = Ext.Base,
  25758. baseStaticMembers = Base.$staticMembers,
  25759. ruleKeySortFn = function(a, b) {
  25760. // longest to shortest, by text if names are equal
  25761. return (a.length - b.length) || ((a < b) ? -1 : ((a > b) ? 1 : 0));
  25762. };
  25763. // Creates a constructor that has nothing extra in its scope chain.
  25764. function makeCtor(className) {
  25765. function constructor() {
  25766. // Opera has some problems returning from a constructor when Dragonfly isn't running.
  25767. // The || null seems to be sufficient to stop it misbehaving. Known to be required
  25768. // against 10.53, 11.51 and 11.61.
  25769. return this.constructor.apply(this, arguments) || null;
  25770. }
  25771. if (className) {
  25772. constructor.name = className;
  25773. }
  25774. return constructor;
  25775. }
  25776. /**
  25777. * @method constructor
  25778. * Create a new anonymous class.
  25779. *
  25780. * @param Class
  25781. * @param {Object} data An object represent the properties of this class
  25782. * @param {Function} onCreated Optional, the callback function to be executed when this class
  25783. * is fully created. Note that the creation process can be asynchronous depending
  25784. * on the pre-processors used.
  25785. *
  25786. * @return {Ext.Base} The newly created class
  25787. */
  25788. Ext.Class = ExtClass = function(Class, data, onCreated) {
  25789. if (typeof Class !== 'function') {
  25790. onCreated = data;
  25791. data = Class;
  25792. Class = null;
  25793. }
  25794. if (!data) {
  25795. data = {};
  25796. }
  25797. Class = ExtClass.create(Class, data);
  25798. ExtClass.process(Class, data, onCreated);
  25799. return Class;
  25800. };
  25801. Ext.apply(ExtClass, {
  25802. makeCtor: makeCtor,
  25803. /**
  25804. * @private
  25805. */
  25806. onBeforeCreated: function(Class, data, hooks) {
  25807. if (Ext.classSystemMonitor) {
  25808. Ext.classSystemMonitor(Class, '>> Ext.Class#onBeforeCreated', arguments);
  25809. }
  25810. Class.addMembers(data);
  25811. hooks.onCreated.call(Class, Class);
  25812. if (Ext.classSystemMonitor) {
  25813. Ext.classSystemMonitor(Class, '<< Ext.Class#onBeforeCreated', arguments);
  25814. }
  25815. },
  25816. /**
  25817. * @private
  25818. */
  25819. create: function(Class, data) {
  25820. var i = baseStaticMembers.length,
  25821. name;
  25822. if (!Class) {
  25823. Class = makeCtor(data.$className);
  25824. }
  25825. while (i--) {
  25826. name = baseStaticMembers[i];
  25827. Class[name] = Base[name];
  25828. }
  25829. return Class;
  25830. },
  25831. /**
  25832. * @private
  25833. */
  25834. process: function(Class, data, onCreated) {
  25835. var preprocessorStack = data.preprocessors || ExtClass.defaultPreprocessors,
  25836. registeredPreprocessors = this.preprocessors,
  25837. hooks = {
  25838. onBeforeCreated: this.onBeforeCreated
  25839. },
  25840. preprocessors = [],
  25841. preprocessor, preprocessorsProperties, i, ln, j, subLn, preprocessorProperty;
  25842. delete data.preprocessors;
  25843. Class._classHooks = hooks;
  25844. for (i = 0 , ln = preprocessorStack.length; i < ln; i++) {
  25845. preprocessor = preprocessorStack[i];
  25846. if (typeof preprocessor === 'string') {
  25847. preprocessor = registeredPreprocessors[preprocessor];
  25848. preprocessorsProperties = preprocessor.properties;
  25849. if (preprocessorsProperties === true) {
  25850. preprocessors.push(preprocessor.fn);
  25851. } else if (preprocessorsProperties) {
  25852. for (j = 0 , subLn = preprocessorsProperties.length; j < subLn; j++) {
  25853. preprocessorProperty = preprocessorsProperties[j];
  25854. if (data.hasOwnProperty(preprocessorProperty)) {
  25855. preprocessors.push(preprocessor.fn);
  25856. break;
  25857. }
  25858. }
  25859. }
  25860. } else {
  25861. preprocessors.push(preprocessor);
  25862. }
  25863. }
  25864. hooks.onCreated = onCreated ? onCreated : Ext.emptyFn;
  25865. hooks.preprocessors = preprocessors;
  25866. this.doProcess(Class, data, hooks);
  25867. },
  25868. doProcess: function(Class, data, hooks) {
  25869. var me = this,
  25870. preprocessors = hooks.preprocessors,
  25871. preprocessor = preprocessors.shift(),
  25872. doProcess = me.doProcess;
  25873. for (; preprocessor; preprocessor = preprocessors.shift()) {
  25874. // Returning false signifies an asynchronous preprocessor - it will call doProcess
  25875. // when we can continue
  25876. if (preprocessor.call(me, Class, data, hooks, doProcess) === false) {
  25877. return;
  25878. }
  25879. }
  25880. hooks.onBeforeCreated.apply(me, arguments);
  25881. },
  25882. /**
  25883. * @private
  25884. * */
  25885. preprocessors: {},
  25886. /**
  25887. * Register a new pre-processor to be used during the class creation process
  25888. *
  25889. * @param {String} name The pre-processor's name
  25890. * @param {Function} fn The callback function to be executed. Typical format:
  25891. *
  25892. * function(cls, data, fn) {
  25893. * // Your code here
  25894. *
  25895. * // Execute this when the processing is finished.
  25896. * // Asynchronous processing is perfectly ok
  25897. * if (fn) {
  25898. * fn.call(this, cls, data);
  25899. * }
  25900. * });
  25901. *
  25902. * @param {Function} fn.cls The created class
  25903. * @param {Object} fn.data The set of properties passed in {@link Ext.Class} constructor
  25904. * @param {Function} fn.fn The callback function that **must** to be executed when this
  25905. * pre-processor finishes, regardless of whether the processing is synchronous or
  25906. * asynchronous.
  25907. * @param properties
  25908. * @param position
  25909. * @param relativeTo
  25910. * @return {Ext.Class} this
  25911. * @private
  25912. * @static
  25913. */
  25914. registerPreprocessor: function(name, fn, properties, position, relativeTo) {
  25915. if (!position) {
  25916. position = 'last';
  25917. }
  25918. if (!properties) {
  25919. properties = [
  25920. name
  25921. ];
  25922. }
  25923. this.preprocessors[name] = {
  25924. name: name,
  25925. properties: properties || false,
  25926. fn: fn
  25927. };
  25928. this.setDefaultPreprocessorPosition(name, position, relativeTo);
  25929. return this;
  25930. },
  25931. /**
  25932. * Retrieve a pre-processor callback function by its name, which has been registered before
  25933. *
  25934. * @param {String} name
  25935. * @return {Function} preprocessor
  25936. * @private
  25937. * @static
  25938. */
  25939. getPreprocessor: function(name) {
  25940. return this.preprocessors[name];
  25941. },
  25942. /**
  25943. * @private
  25944. */
  25945. getPreprocessors: function() {
  25946. return this.preprocessors;
  25947. },
  25948. /**
  25949. * @private
  25950. */
  25951. defaultPreprocessors: [],
  25952. /**
  25953. * Retrieve the array stack of default pre-processors
  25954. * @return {Function[]} defaultPreprocessors
  25955. * @private
  25956. * @static
  25957. */
  25958. getDefaultPreprocessors: function() {
  25959. return this.defaultPreprocessors;
  25960. },
  25961. /**
  25962. * Set the default array stack of default pre-processors
  25963. *
  25964. * @private
  25965. * @param {Array} preprocessors
  25966. * @return {Ext.Class} this
  25967. * @static
  25968. */
  25969. setDefaultPreprocessors: function(preprocessors) {
  25970. this.defaultPreprocessors = Ext.Array.from(preprocessors);
  25971. return this;
  25972. },
  25973. /**
  25974. * Insert this pre-processor at a specific position in the stack, optionally relative to
  25975. * any existing pre-processor. For example:
  25976. *
  25977. * Ext.Class.registerPreprocessor('debug', function(cls, data, fn) {
  25978. * // Your code here
  25979. *
  25980. * if (fn) {
  25981. * fn.call(this, cls, data);
  25982. * }
  25983. * }).setDefaultPreprocessorPosition('debug', 'last');
  25984. *
  25985. * @private
  25986. * @param {String} name The pre-processor name. Note that it needs to be registered with
  25987. * {@link Ext.Class#registerPreprocessor registerPreprocessor} before this
  25988. * @param {String} offset The insertion position. Four possible values are:
  25989. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
  25990. * argument)
  25991. * @param {String} relativeName
  25992. * @return {Ext.Class} this
  25993. * @static
  25994. */
  25995. setDefaultPreprocessorPosition: function(name, offset, relativeName) {
  25996. var defaultPreprocessors = this.defaultPreprocessors,
  25997. index;
  25998. if (typeof offset === 'string') {
  25999. if (offset === 'first') {
  26000. defaultPreprocessors.unshift(name);
  26001. return this;
  26002. } else if (offset === 'last') {
  26003. defaultPreprocessors.push(name);
  26004. return this;
  26005. }
  26006. offset = (offset === 'after') ? 1 : -1;
  26007. }
  26008. index = Ext.Array.indexOf(defaultPreprocessors, relativeName);
  26009. if (index !== -1) {
  26010. Ext.Array.splice(defaultPreprocessors, Math.max(0, index + offset), 0, name);
  26011. }
  26012. return this;
  26013. }
  26014. });
  26015. /**
  26016. * @cfg {String} extend
  26017. * The parent class that this class extends. For example:
  26018. *
  26019. * Ext.define('Person', {
  26020. * say: function(text) { alert(text); }
  26021. * });
  26022. *
  26023. * Ext.define('Developer', {
  26024. * extend: 'Person',
  26025. * say: function(text) { this.callParent(["print "+text]); }
  26026. * });
  26027. */
  26028. ExtClass.registerPreprocessor('extend', function(Class, data, hooks) {
  26029. var Base = Ext.Base,
  26030. basePrototype = Base.prototype,
  26031. extend = data.extend,
  26032. Parent, parentPrototype, i;
  26033. if (Ext.classSystemMonitor) {
  26034. Ext.classSystemMonitor(Class, 'Ext.Class#extendPreProcessor', arguments);
  26035. }
  26036. delete data.extend;
  26037. if (extend && extend !== Object) {
  26038. Parent = extend;
  26039. } else {
  26040. Parent = Base;
  26041. }
  26042. parentPrototype = Parent.prototype;
  26043. if (!Parent.$isClass) {
  26044. for (i in basePrototype) {
  26045. if (!parentPrototype[i]) {
  26046. parentPrototype[i] = basePrototype[i];
  26047. }
  26048. }
  26049. }
  26050. Class.extend(Parent);
  26051. Class.triggerExtended.apply(Class, arguments);
  26052. /**
  26053. * @cfg {Object} eventedConfig
  26054. * Config options defined within `eventedConfig` will auto-generate the setter /
  26055. * getter methods (see {@link #cfg-config config} for more information on
  26056. * auto-generated getter / setter methods). Additionally, when an
  26057. * `eventedConfig` is set it will also fire a before{cfg}change and {cfg}change
  26058. * event when the value of the eventedConfig is changed from its originally
  26059. * defined value.
  26060. *
  26061. * **Note:** When creating a custom class you'll need to extend Ext.Evented
  26062. *
  26063. * Example custom class:
  26064. *
  26065. * Ext.define('MyApp.util.Test', {
  26066. * extend: 'Ext.Evented',
  26067. *
  26068. * eventedConfig: {
  26069. * foo: null
  26070. * }
  26071. * });
  26072. *
  26073. * In this example, the `foo` config will initially be null. Changing it via
  26074. * `setFoo` will fire the `beforefoochange` event. The call to the setter can be
  26075. * halted by returning `false` from a listener on the **before** event.
  26076. *
  26077. * var test = Ext.create('MyApp.util.Test', {
  26078. * listeners: {
  26079. * beforefoochange: function (instance, newValue, oldValue) {
  26080. * return newValue !== 'bar';
  26081. * },
  26082. * foochange: function (instance, newValue, oldValue) {
  26083. * console.log('foo changed to:', newValue);
  26084. * }
  26085. * }
  26086. * });
  26087. *
  26088. * test.setFoo('bar');
  26089. *
  26090. * The `before` event handler can be used to validate changes to `foo`.
  26091. * Returning `false` will prevent the setter from changing the value of the
  26092. * config. In the previous example the `beforefoochange` handler returns false
  26093. * so `foo` will not be updated and `foochange` will not be fired.
  26094. *
  26095. * test.setFoo('baz');
  26096. *
  26097. * Setting `foo` to 'baz' will not be prevented by the `before` handler. Foo
  26098. * will be set to the value: 'baz' and the `foochange` event will be fired.
  26099. */
  26100. if (data.onClassExtended) {
  26101. Class.onExtended(data.onClassExtended, Class);
  26102. delete data.onClassExtended;
  26103. }
  26104. }, true);
  26105. // true to always run this preprocessor even w/o "extend" keyword
  26106. /**
  26107. * @cfg {Object} privates
  26108. * The `privates` config is a list of methods intended to be used internally by the
  26109. * framework. Methods are placed in a `privates` block to prevent developers from
  26110. * accidentally overriding framework methods in custom classes.
  26111. *
  26112. * Ext.define('Computer', {
  26113. * privates: {
  26114. * runFactory: function(brand) {
  26115. * // internal only processing of brand passed to factory
  26116. * this.factory(brand);
  26117. * }
  26118. * },
  26119. *
  26120. * factory: function (brand) {}
  26121. * });
  26122. *
  26123. * In order to override a method from a `privates` block, the overridden method must
  26124. * also be placed in a `privates` block within the override class.
  26125. *
  26126. * Ext.define('Override.Computer', {
  26127. * override: 'Computer',
  26128. * privates: {
  26129. * runFactory: function() {
  26130. * // overriding logic
  26131. * }
  26132. * }
  26133. * });
  26134. */
  26135. ExtClass.registerPreprocessor('privates', function(Class, data) {
  26136. var privates = data.privates,
  26137. statics = privates.statics,
  26138. privacy = privates.privacy || true;
  26139. if (Ext.classSystemMonitor) {
  26140. Ext.classSystemMonitor(Class, 'Ext.Class#privatePreprocessor', arguments);
  26141. }
  26142. delete data.privates;
  26143. delete privates.statics;
  26144. // We have to add this preprocessor so that private getters/setters are picked up
  26145. // by the config system. This also catches duplication in the public part of the
  26146. // class since it is an error to override a private method with a public one.
  26147. Class.addMembers(privates, false, privacy);
  26148. if (statics) {
  26149. Class.addMembers(statics, true, privacy);
  26150. }
  26151. });
  26152. /**
  26153. * @cfg {Object} statics
  26154. * List of static methods for this class. For example:
  26155. *
  26156. * Ext.define('Computer', {
  26157. * statics: {
  26158. * factory: function(brand) {
  26159. * // 'this' in static methods refer to the class itself
  26160. * return new this(brand);
  26161. * }
  26162. * },
  26163. *
  26164. * constructor: function() { ... }
  26165. * });
  26166. *
  26167. * var dellComputer = Computer.factory('Dell');
  26168. */
  26169. ExtClass.registerPreprocessor('statics', function(Class, data) {
  26170. if (Ext.classSystemMonitor) {
  26171. Ext.classSystemMonitor(Class, 'Ext.Class#staticsPreprocessor', arguments);
  26172. }
  26173. Class.addStatics(data.statics);
  26174. delete data.statics;
  26175. });
  26176. /**
  26177. * @cfg {Object} inheritableStatics
  26178. * List of inheritable static methods for this class.
  26179. * Otherwise just like {@link #statics} but subclasses inherit these methods.
  26180. */
  26181. ExtClass.registerPreprocessor('inheritableStatics', function(Class, data) {
  26182. if (Ext.classSystemMonitor) {
  26183. Ext.classSystemMonitor(Class, 'Ext.Class#inheritableStaticsPreprocessor', arguments);
  26184. }
  26185. Class.addInheritableStatics(data.inheritableStatics);
  26186. delete data.inheritableStatics;
  26187. });
  26188. Ext.createRuleFn = function(code) {
  26189. return new Function('$c', 'with($c) { try { return (' + code + '); } catch(e) { return false;}}');
  26190. };
  26191. Ext.expressionCache = new Ext.util.Cache({
  26192. miss: Ext.createRuleFn
  26193. });
  26194. Ext.ruleKeySortFn = ruleKeySortFn;
  26195. Ext.getPlatformConfigKeys = function(platformConfig) {
  26196. var ret = [],
  26197. platform, rule;
  26198. for (platform in platformConfig) {
  26199. rule = Ext.expressionCache.get(platform);
  26200. if (rule(Ext.platformTags)) {
  26201. ret.push(platform);
  26202. }
  26203. }
  26204. ret.sort(ruleKeySortFn);
  26205. return ret;
  26206. };
  26207. /**
  26208. * @cfg {Object} config
  26209. *
  26210. * List of configuration options with their default values.
  26211. *
  26212. * __Note:__ You need to make sure {@link Ext.Base#initConfig} is called from your constructor
  26213. * if you are defining your own class or singleton, unless you are extending a Component.
  26214. * Otherwise the generated getter and setter methods will not be initialized.
  26215. *
  26216. * Each config item will have its own setter and getter method automatically generated inside
  26217. * the class prototype during class creation time, if the class does not have those methods
  26218. * explicitly defined.
  26219. *
  26220. * As an example, let's convert the name property of a Person class to be a config item, then
  26221. * add extra age and gender items.
  26222. *
  26223. * Ext.define('My.sample.Person', {
  26224. * config: {
  26225. * name: 'Mr. Unknown',
  26226. * age: 0,
  26227. * gender: 'Male'
  26228. * },
  26229. *
  26230. * constructor: function(config) {
  26231. * this.initConfig(config);
  26232. *
  26233. * return this;
  26234. * }
  26235. *
  26236. * // ...
  26237. * });
  26238. *
  26239. * Within the class, this.name still has the default value of "Mr. Unknown". However, it's now
  26240. * publicly accessible without sacrificing encapsulation, via setter and getter methods.
  26241. *
  26242. * var jacky = new My.sample.Person({
  26243. * name: "Jacky",
  26244. * age: 35
  26245. * });
  26246. *
  26247. * alert(jacky.getAge()); // alerts 35
  26248. * alert(jacky.getGender()); // alerts "Male"
  26249. *
  26250. * jacky.setName("Mr. Nguyen");
  26251. * alert(jacky.getName()); // alerts "Mr. Nguyen"
  26252. *
  26253. * Notice that we changed the class constructor to invoke this.initConfig() and pass in the
  26254. * provided config object. Two key things happened:
  26255. *
  26256. * - The provided config object when the class is instantiated is recursively merged with
  26257. * the default config object.
  26258. * - All corresponding setter methods are called with the merged values.
  26259. *
  26260. * Beside storing the given values, throughout the frameworks, setters generally have two key
  26261. * responsibilities:
  26262. *
  26263. * - Filtering / validation / transformation of the given value before it's actually stored
  26264. * within the instance.
  26265. * - Notification (such as firing events) / post-processing after the value has been set,
  26266. * or changed from a previous value.
  26267. *
  26268. * By standardize this common pattern, the default generated setters provide two extra template
  26269. * methods that you can put your own custom logic into, i.e: an "applyFoo" and "updateFoo"
  26270. * method for a "foo" config item, which are executed before and after the value is actually
  26271. * set, respectively. Back to the example class, let's validate that age must be a valid
  26272. * positive number, and fire an 'agechange' if the value is modified.
  26273. *
  26274. * Ext.define('My.sample.Person', {
  26275. * config: {
  26276. * // ...
  26277. * },
  26278. *
  26279. * constructor: {
  26280. * // ...
  26281. * },
  26282. *
  26283. * applyAge: function(age) {
  26284. * if (typeof age !== 'number' || age < 0) {
  26285. * console.warn("Invalid age, must be a positive number");
  26286. * return;
  26287. * }
  26288. *
  26289. * return age;
  26290. * },
  26291. *
  26292. * updateAge: function(newAge, oldAge) {
  26293. * // age has changed from "oldAge" to "newAge"
  26294. * this.fireEvent('agechange', this, newAge, oldAge);
  26295. * }
  26296. *
  26297. * // ...
  26298. * });
  26299. *
  26300. * var jacky = new My.sample.Person({
  26301. * name: "Jacky",
  26302. * age: 'invalid'
  26303. * });
  26304. *
  26305. * alert(jacky.getAge()); // alerts 0
  26306. *
  26307. * alert(jacky.setAge(-100)); // alerts 0
  26308. * alert(jacky.getAge()); // alerts 0
  26309. *
  26310. * alert(jacky.setAge(35)); // alerts 0
  26311. * alert(jacky.getAge()); // alerts 35
  26312. *
  26313. * In other words, when leveraging the config feature, you mostly never need to define setter
  26314. * and getter methods explicitly. Instead, "apply*" and "update*" methods should be implemented
  26315. * where necessary. Your code will be consistent throughout and only contain the minimal logic
  26316. * that you actually care about.
  26317. *
  26318. * When it comes to inheritance, the default config of the parent class is automatically,
  26319. * recursively merged with the child's default config. The same applies for mixins.
  26320. */
  26321. ExtClass.registerPreprocessor('config', function(Class, data) {
  26322. // Need to copy to the prototype here because that happens after preprocessors
  26323. if (data.hasOwnProperty('$configPrefixed')) {
  26324. Class.prototype.$configPrefixed = data.$configPrefixed;
  26325. }
  26326. Class.addConfig(data.config);
  26327. // We need to remove this or it will be applied by addMembers and smash the
  26328. // "config" placed on the prototype by Configurator (which includes *all* configs
  26329. // such as cachedConfigs).
  26330. delete data.config;
  26331. });
  26332. /**
  26333. * @cfg {Object} cachedConfig
  26334. *
  26335. * This configuration works in a very similar manner to the {@link #config} option.
  26336. * The difference is that the configurations are only ever processed when the first instance
  26337. * of that class is created. The processed value is then stored on the class prototype and
  26338. * will not be processed on subsequent instances of the class. Getters/setters will be generated
  26339. * in exactly the same way as {@link #config}.
  26340. *
  26341. * This option is useful for expensive objects that can be shared across class instances.
  26342. * The class itself ensures that the creation only occurs once.
  26343. */
  26344. ExtClass.registerPreprocessor('cachedConfig', function(Class, data) {
  26345. // Need to copy to the prototype here because that happens after preprocessors
  26346. if (data.hasOwnProperty('$configPrefixed')) {
  26347. Class.prototype.$configPrefixed = data.$configPrefixed;
  26348. }
  26349. Class.addCachedConfig(data.cachedConfig);
  26350. // Remove this so it won't be placed on the prototype.
  26351. delete data.cachedConfig;
  26352. });
  26353. /**
  26354. * @cfg {String[]/Object} mixins
  26355. * List of classes to mix into this class. For example:
  26356. *
  26357. * Ext.define('CanSing', {
  26358. * sing: function() {
  26359. * alert("For he's a jolly good fellow...")
  26360. * }
  26361. * });
  26362. *
  26363. * Ext.define('Musician', {
  26364. * mixins: ['CanSing']
  26365. * })
  26366. *
  26367. * In this case the Musician class will get a `sing` method from CanSing mixin.
  26368. *
  26369. * But what if the Musician already has a `sing` method? Or you want to mix
  26370. * in two classes, both of which define `sing`? In such a cases it's good
  26371. * to define mixins as an object, where you assign a name to each mixin:
  26372. *
  26373. * Ext.define('Musician', {
  26374. * mixins: {
  26375. * canSing: 'CanSing'
  26376. * },
  26377. *
  26378. * sing: function() {
  26379. * // delegate singing operation to mixin
  26380. * this.mixins.canSing.sing.call(this);
  26381. * }
  26382. * })
  26383. *
  26384. * In this case the `sing` method of Musician will overwrite the
  26385. * mixed in `sing` method. But you can access the original mixed in method
  26386. * through special `mixins` property.
  26387. */
  26388. ExtClass.registerPreprocessor('mixins', function(Class, data, hooks) {
  26389. var mixins = data.mixins,
  26390. onCreated = hooks.onCreated;
  26391. if (Ext.classSystemMonitor) {
  26392. Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor', arguments);
  26393. }
  26394. delete data.mixins;
  26395. hooks.onCreated = function() {
  26396. /* eslint-disable-next-line max-len */
  26397. if (Ext.classSystemMonitor) {
  26398. Ext.classSystemMonitor(Class, 'Ext.Class#mixinsPreprocessor#beforeCreated', arguments);
  26399. }
  26400. // Put back the original onCreated before processing mixins. This allows a
  26401. // mixin to hook onCreated by access Class._classHooks.
  26402. hooks.onCreated = onCreated;
  26403. Class.mixin(mixins);
  26404. // We must go back to hooks.onCreated here because it may have changed during
  26405. // calls to onClassMixedIn.
  26406. return hooks.onCreated.apply(this, arguments);
  26407. };
  26408. });
  26409. // Backwards compatible
  26410. Ext.extend = function(Class, Parent, members) {
  26411. var cls, m;
  26412. if (Ext.classSystemMonitor) {
  26413. Ext.classSystemMonitor(Class, 'Ext.Class#extend-backwards-compatible', arguments);
  26414. }
  26415. if (arguments.length === 2 && Ext.isObject(Parent)) {
  26416. members = Parent;
  26417. Parent = Class;
  26418. Class = null;
  26419. }
  26420. if (!Parent) {
  26421. throw new Error("[Ext.extend] Attempting to extend from a class which has not " + "been loaded on the page.");
  26422. }
  26423. members.extend = Parent;
  26424. /* eslint-disable comma-style */
  26425. members.preprocessors = [
  26426. 'extend',
  26427. 'statics',
  26428. 'inheritableStatics',
  26429. 'mixins',
  26430. 'config'
  26431. ];
  26432. /* eslint-enable comma-style */
  26433. if (Class) {
  26434. cls = new ExtClass(Class, members);
  26435. // The 'constructor' is given as 'Class' but also needs to be on prototype
  26436. cls.prototype.constructor = Class;
  26437. } else {
  26438. cls = new ExtClass(members);
  26439. }
  26440. cls.prototype.override = function(o) {
  26441. for (m in o) {
  26442. if (o.hasOwnProperty(m)) {
  26443. this[m] = o[m];
  26444. }
  26445. }
  26446. };
  26447. return cls;
  26448. };
  26449. }());
  26450. /**
  26451. * This object contains properties that describe the current device or platform. These
  26452. * values can be used in `{@link Ext.Class#platformConfig platformConfig}` as well as
  26453. * `{@link Ext.mixin.Responsive#responsiveConfig responsiveConfig}` statements.
  26454. *
  26455. * This object can be modified to include tags that are useful for the application. To
  26456. * add custom properties, it is advisable to use a sub-object. For example:
  26457. *
  26458. * Ext.platformTags.app = {
  26459. * mobile: true
  26460. * };
  26461. *
  26462. * @property {Object} platformTags
  26463. * @property {Boolean} platformTags.phone
  26464. * @property {Boolean} platformTags.tablet
  26465. * @property {Boolean} platformTags.desktop
  26466. * @property {Boolean} platformTags.touch Indicates touch inputs are available.
  26467. * @property {Boolean} platformTags.safari
  26468. * @property {Boolean} platformTags.chrome
  26469. * @property {Boolean} platformTags.windows
  26470. * @property {Boolean} platformTags.firefox
  26471. * @property {Boolean} platformTags.ios True for iPad, iPhone and iPod.
  26472. * @property {Boolean} platformTags.android
  26473. * @property {Boolean} platformTags.blackberry
  26474. * @property {Boolean} platformTags.tizen
  26475. * @member Ext
  26476. */
  26477. // @tag class
  26478. /**
  26479. * @class Ext.Inventory
  26480. * @private
  26481. */
  26482. Ext.Inventory = function() {
  26483. // @define Ext.Script
  26484. // @define Ext.Inventory
  26485. // @require Ext.Function
  26486. var me = this;
  26487. me.names = [];
  26488. me.paths = {};
  26489. me.alternateToName = {};
  26490. me.aliasToName = {};
  26491. me.nameToAliases = {};
  26492. me.nameToAlternates = {};
  26493. me.nameToPrefix = {};
  26494. };
  26495. Ext.Inventory.prototype = {
  26496. _array1: [
  26497. 0
  26498. ],
  26499. prefixes: null,
  26500. dotRe: /\./g,
  26501. wildcardRe: /\*/g,
  26502. addAlias: function(className, alias, update) {
  26503. return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, update);
  26504. },
  26505. addAlternate: function(className, alternate) {
  26506. return this.addMapping(className, alternate, this.alternateToName, this.nameToAlternates);
  26507. },
  26508. addMapping: function(className, alternate, toName, nameTo, update) {
  26509. var name = className.$className || className,
  26510. mappings = name,
  26511. array = this._array1,
  26512. a, aliases, cls, i, length, nameMapping;
  26513. if (Ext.isString(name)) {
  26514. mappings = {};
  26515. mappings[name] = alternate;
  26516. }
  26517. for (cls in mappings) {
  26518. aliases = mappings[cls];
  26519. if (Ext.isString(aliases)) {
  26520. array[0] = aliases;
  26521. aliases = array;
  26522. }
  26523. length = aliases.length;
  26524. nameMapping = nameTo[cls] || (nameTo[cls] = []);
  26525. for (i = 0; i < length; ++i) {
  26526. if (!(a = aliases[i])) {
  26527. continue;
  26528. }
  26529. if (toName[a] !== cls) {
  26530. if (!update && toName[a] && ('Ext.Gadget' !== a)) {
  26531. Ext.log.warn("Overriding existing mapping: '" + a + "' From '" + toName[a] + "' to '" + cls + "'. Is this intentional?");
  26532. }
  26533. toName[a] = cls;
  26534. nameMapping.push(a);
  26535. }
  26536. }
  26537. }
  26538. },
  26539. /**
  26540. * Get the aliases of a class by the class name
  26541. *
  26542. * @param {String} name
  26543. * @return {Array} aliases
  26544. */
  26545. getAliasesByName: function(name) {
  26546. return this.nameToAliases[name] || null;
  26547. },
  26548. getAlternatesByName: function(name) {
  26549. return this.nameToAlternates[name] || null;
  26550. },
  26551. /**
  26552. * Get the name of a class by its alias.
  26553. *
  26554. * @param {String} alias
  26555. * @return {String} className
  26556. */
  26557. getNameByAlias: function(alias) {
  26558. return this.aliasToName[alias] || '';
  26559. },
  26560. /**
  26561. * Get the name of a class by its alternate name.
  26562. *
  26563. * @param {String} alternate
  26564. * @return {String} className
  26565. */
  26566. getNameByAlternate: function(alternate) {
  26567. return this.alternateToName[alternate] || '';
  26568. },
  26569. /**
  26570. * Converts a string expression to an array of matching class names. An expression can
  26571. * either refers to class aliases or class names. Expressions support wildcards:
  26572. *
  26573. * // returns ['Ext.window.Window']
  26574. * var window = Ext.ClassManager.getNamesByExpression('widget.window');
  26575. *
  26576. * // returns ['widget.panel', 'widget.window', ...]
  26577. * var allWidgets = Ext.ClassManager.getNamesByExpression('widget.*');
  26578. *
  26579. * // returns ['Ext.data.Store', 'Ext.data.ArrayProxy', ...]
  26580. * var allData = Ext.ClassManager.getNamesByExpression('Ext.data.*');
  26581. *
  26582. * @param {String/String[]} expression
  26583. * @param {Object} [exclude=null] An object keyed by class name containing classes to
  26584. * exclude from the returned classes. This must be provided if `accumulate` is set to
  26585. * `true`.
  26586. * @param {Boolean} [accumulate=false] Pass `true` to add matching classes to the
  26587. * specified `exclude` object.
  26588. * @return {String[]} An array of class names.
  26589. */
  26590. getNamesByExpression: function(expression, exclude, accumulate) {
  26591. var me = this,
  26592. aliasToName = me.aliasToName,
  26593. alternateToName = me.alternateToName,
  26594. nameToAliases = me.nameToAliases,
  26595. nameToAlternates = me.nameToAlternates,
  26596. map = accumulate ? exclude : {},
  26597. names = [],
  26598. expressions = Ext.isString(expression) ? [
  26599. expression
  26600. ] : expression,
  26601. length = expressions.length,
  26602. wildcardRe = me.wildcardRe,
  26603. expr, i, list, match, n, name, regex;
  26604. for (i = 0; i < length; ++i) {
  26605. if ((expr = expressions[i]).indexOf('*') < 0) {
  26606. // No wildcard
  26607. if (!(name = aliasToName[expr])) {
  26608. if (!(name = alternateToName[expr])) {
  26609. name = expr;
  26610. }
  26611. }
  26612. if (!(name in map) && !(exclude && (name in exclude))) {
  26613. map[name] = 1;
  26614. names.push(name);
  26615. }
  26616. } else {
  26617. regex = new RegExp('^' + expr.replace(wildcardRe, '(.*?)') + '$');
  26618. for (name in nameToAliases) {
  26619. if (!(name in map) && !(exclude && (name in exclude))) {
  26620. if (!(match = regex.test(name))) {
  26621. n = (list = nameToAliases[name]).length;
  26622. while (!match && n-- > 0) {
  26623. match = regex.test(list[n]);
  26624. }
  26625. list = nameToAlternates[name];
  26626. if (list && !match) {
  26627. n = list.length;
  26628. while (!match && n-- > 0) {
  26629. match = regex.test(list[n]);
  26630. }
  26631. }
  26632. }
  26633. if (match) {
  26634. map[name] = 1;
  26635. names.push(name);
  26636. }
  26637. }
  26638. }
  26639. }
  26640. }
  26641. return names;
  26642. },
  26643. getPath: function(className) {
  26644. var me = this,
  26645. paths = me.paths,
  26646. ret = '',
  26647. prefix;
  26648. if (className in paths) {
  26649. ret = paths[className];
  26650. } else {
  26651. prefix = me.nameToPrefix[className] || (me.nameToPrefix[className] = me.getPrefix(className));
  26652. if (prefix) {
  26653. className = className.substring(prefix.length + 1);
  26654. ret = paths[prefix];
  26655. if (ret) {
  26656. ret += '/';
  26657. }
  26658. }
  26659. ret += className.replace(me.dotRe, '/') + '.js';
  26660. }
  26661. return ret;
  26662. },
  26663. getPrefix: function(className) {
  26664. if (className in this.paths) {
  26665. return className;
  26666. } else if (className in this.nameToPrefix) {
  26667. return this.nameToPrefix[className];
  26668. }
  26669. /* eslint-disable-next-line vars-on-top */
  26670. var prefixes = this.getPrefixes(),
  26671. length = className.length,
  26672. items, currChar, prefix, j, jlen;
  26673. // Walk the prefixes backwards so we consider the longest ones first.
  26674. // Prefixes are kept in a sparse array grouped by length so we don't have to
  26675. // iterate over all of them, just the ones we need.
  26676. while (length-- > 0) {
  26677. items = prefixes[length];
  26678. if (items) {
  26679. currChar = className.charAt(length);
  26680. if (currChar !== '.') {
  26681. continue;
  26682. }
  26683. for (j = 0 , jlen = items.length; j < jlen; j++) {
  26684. prefix = items[j];
  26685. if (prefix === className.substring(0, length)) {
  26686. return prefix;
  26687. }
  26688. }
  26689. }
  26690. }
  26691. return '';
  26692. },
  26693. getPrefixes: function() {
  26694. var me = this,
  26695. prefixes = me.prefixes,
  26696. names, name, nameLength, items, i, len;
  26697. if (!prefixes) {
  26698. names = me.names.slice(0);
  26699. me.prefixes = prefixes = [];
  26700. for (i = 0 , len = names.length; i < len; i++) {
  26701. name = names[i];
  26702. nameLength = name.length;
  26703. items = prefixes[nameLength] || (prefixes[nameLength] = []);
  26704. items.push(name);
  26705. }
  26706. }
  26707. return prefixes;
  26708. },
  26709. removeName: function(name) {
  26710. var me = this,
  26711. aliasToName = me.aliasToName,
  26712. alternateToName = me.alternateToName,
  26713. nameToAliases = me.nameToAliases,
  26714. nameToAlternates = me.nameToAlternates,
  26715. aliases = nameToAliases[name],
  26716. alternates = nameToAlternates[name],
  26717. i, a;
  26718. delete nameToAliases[name];
  26719. delete nameToAlternates[name];
  26720. delete me.nameToPrefix[name];
  26721. if (aliases) {
  26722. for (i = aliases.length; i--; ) {
  26723. // Aliases can be reassigned so if this class is the current mapping of
  26724. // the alias, remove it. Since there is no chain to restore what was
  26725. // removed this is not perfect.
  26726. if (name === aliasToName[a = aliases[i]]) {
  26727. delete aliasToName[a];
  26728. }
  26729. }
  26730. }
  26731. if (alternates) {
  26732. for (i = alternates.length; i--; ) {
  26733. // Like aliases, alternate class names can also be remapped.
  26734. if (name === alternateToName[a = alternates[i]]) {
  26735. delete alternateToName[a];
  26736. }
  26737. }
  26738. }
  26739. },
  26740. resolveName: function(name) {
  26741. var me = this,
  26742. trueName;
  26743. // If the name has a registered alias, it is a true className (not an alternate)
  26744. // so we can stop now.
  26745. if (!(name in me.nameToAliases)) {
  26746. // The name is not a known class name, so check to see if it is a known alias:
  26747. if (!(trueName = me.aliasToName[name])) {
  26748. // The name does not correspond to a known alias, so check if it is a known
  26749. // alternateClassName:
  26750. trueName = me.alternateToName[name];
  26751. }
  26752. }
  26753. return trueName || name;
  26754. },
  26755. /**
  26756. * This method returns a selector object that produces a selection of classes and
  26757. * delivers them to the desired `receiver`.
  26758. *
  26759. * The returned selector object has the same methods as the given `receiver` object
  26760. * but these methods on the selector accept a first argument that expects a pattern
  26761. * or array of patterns. The actual method on the `receiver` will be called with an
  26762. * array of classes that match these patterns but with any patterns passed to an
  26763. * `exclude` call removed.
  26764. *
  26765. * For example:
  26766. *
  26767. * var sel = inventory.select({
  26768. * require: function (classes) {
  26769. * console.log('Classes: ' + classes.join(','));
  26770. * }
  26771. * });
  26772. *
  26773. * sel.exclude('Ext.chart.*').exclude('Ext.draw.*').require('*');
  26774. *
  26775. * // Logs all classes except those in the Ext.chart and Ext.draw namespaces.
  26776. *
  26777. * @param {Object} receiver
  26778. * @param {Object} [scope] Optional scope to use when calling `receiver` methods.
  26779. * @return {Object} An object with the same methods as `receiver` plus `exclude`.
  26780. */
  26781. select: function(receiver, scope) {
  26782. var me = this,
  26783. excludes = {},
  26784. ret = {
  26785. excludes: excludes,
  26786. exclude: function() {
  26787. me.getNamesByExpression(arguments[0], excludes, true);
  26788. return this;
  26789. }
  26790. },
  26791. name;
  26792. for (name in receiver) {
  26793. ret[name] = me.selectMethod(excludes, receiver[name], scope || receiver);
  26794. }
  26795. return ret;
  26796. },
  26797. selectMethod: function(excludes, fn, scope) {
  26798. var me = this;
  26799. return function(include) {
  26800. var args = Ext.Array.slice(arguments, 1);
  26801. args.unshift(me.getNamesByExpression(include, excludes));
  26802. return fn.apply(scope, args);
  26803. };
  26804. },
  26805. /**
  26806. * Sets the path of a namespace.
  26807. * For Example:
  26808. *
  26809. * inventory.setPath('Ext', '.');
  26810. * inventory.setPath({
  26811. * Ext: '.'
  26812. * });
  26813. *
  26814. * @param {String/Object} name The name of a single mapping or an object of mappings.
  26815. * @param {String} [path] If `name` is a String, then this is the path for that name.
  26816. * Otherwise this parameter is ignored.
  26817. * @return {Ext.Inventory} this
  26818. * @method
  26819. */
  26820. setPath: Ext.Function.flexSetter(function(name, path) {
  26821. var me = this;
  26822. me.paths[name] = path;
  26823. me.names.push(name);
  26824. me.prefixes = null;
  26825. me.nameToPrefix = {};
  26826. return me;
  26827. })
  26828. };
  26829. // @tag class
  26830. /**
  26831. * @class Ext.ClassManager
  26832. *
  26833. * Ext.ClassManager manages all classes and handles mapping from string class name to
  26834. * actual class objects throughout the whole framework. It is not generally accessed directly,
  26835. * rather through these convenient shorthands:
  26836. *
  26837. * - {@link Ext#define Ext.define}
  26838. * - {@link Ext#method!create Ext.create}
  26839. * - {@link Ext#widget Ext.widget}
  26840. * - {@link Ext#getClass Ext.getClass}
  26841. * - {@link Ext#getClassName Ext.getClassName}
  26842. *
  26843. * # Basic syntax:
  26844. *
  26845. * Ext.define(className, properties);
  26846. *
  26847. * in which `properties` is an object represent a collection of properties that apply to the class.
  26848. * See {@link Ext.ClassManager#method!create} for more detailed instructions.
  26849. *
  26850. * Ext.define('Person', {
  26851. * name: 'Unknown',
  26852. *
  26853. * constructor: function(name) {
  26854. * if (name) {
  26855. * this.name = name;
  26856. * }
  26857. * },
  26858. *
  26859. * eat: function(foodType) {
  26860. * alert("I'm eating: " + foodType);
  26861. *
  26862. * return this;
  26863. * }
  26864. * });
  26865. *
  26866. * var aaron = new Person("Aaron");
  26867. * aaron.eat("Sandwich"); // alert("I'm eating: Sandwich");
  26868. *
  26869. * Ext.Class has a powerful set of extensible {@link Ext.Class#registerPreprocessor pre-processors}
  26870. * which takes care of everything related to class creation, including but not limited to
  26871. * inheritance, mixins, configuration, statics, etc.
  26872. *
  26873. * # Inheritance:
  26874. *
  26875. * Ext.define('Developer', {
  26876. * extend: 'Person',
  26877. *
  26878. * constructor: function(name, isGeek) {
  26879. * this.isGeek = isGeek;
  26880. *
  26881. * // Apply a method from the parent class' prototype
  26882. * this.callParent([name]);
  26883. * },
  26884. *
  26885. * code: function(language) {
  26886. * alert("I'm coding in: " + language);
  26887. *
  26888. * this.eat("Bugs");
  26889. *
  26890. * return this;
  26891. * }
  26892. * });
  26893. *
  26894. * var jacky = new Developer("Jacky", true);
  26895. * jacky.code("JavaScript"); // alert("I'm coding in: JavaScript");
  26896. * // alert("I'm eating: Bugs");
  26897. *
  26898. * See {@link Ext.Base#method!callParent} for more details on calling superclass' methods
  26899. *
  26900. * # Mixins:
  26901. *
  26902. * Ext.define('CanPlayGuitar', {
  26903. * playGuitar: function() {
  26904. * alert("F#...G...D...A");
  26905. * }
  26906. * });
  26907. *
  26908. * Ext.define('CanComposeSongs', {
  26909. * composeSongs: function() { ... }
  26910. * });
  26911. *
  26912. * Ext.define('CanSing', {
  26913. * sing: function() {
  26914. * alert("For he's a jolly good fellow...")
  26915. * }
  26916. * });
  26917. *
  26918. * Ext.define('Musician', {
  26919. * extend: 'Person',
  26920. *
  26921. * mixins: {
  26922. * canPlayGuitar: 'CanPlayGuitar',
  26923. * canComposeSongs: 'CanComposeSongs',
  26924. * canSing: 'CanSing'
  26925. * }
  26926. * })
  26927. *
  26928. * Ext.define('CoolPerson', {
  26929. * extend: 'Person',
  26930. *
  26931. * mixins: {
  26932. * canPlayGuitar: 'CanPlayGuitar',
  26933. * canSing: 'CanSing'
  26934. * },
  26935. *
  26936. * sing: function() {
  26937. * alert("Ahem....");
  26938. *
  26939. * this.mixins.canSing.sing.call(this);
  26940. *
  26941. * alert("[Playing guitar at the same time...]");
  26942. *
  26943. * this.playGuitar();
  26944. * }
  26945. * });
  26946. *
  26947. * var me = new CoolPerson("Jacky");
  26948. *
  26949. * me.sing(); // alert("Ahem...");
  26950. * // alert("For he's a jolly good fellow...");
  26951. * // alert("[Playing guitar at the same time...]");
  26952. * // alert("F#...G...D...A");
  26953. *
  26954. * # Config:
  26955. *
  26956. * Ext.define('SmartPhone', {
  26957. * config: {
  26958. * hasTouchScreen: false,
  26959. * operatingSystem: 'Other',
  26960. * price: 500
  26961. * },
  26962. *
  26963. * isExpensive: false,
  26964. *
  26965. * constructor: function(config) {
  26966. * this.initConfig(config);
  26967. * },
  26968. *
  26969. * applyPrice: function(price) {
  26970. * this.isExpensive = (price > 500);
  26971. *
  26972. * return price;
  26973. * },
  26974. *
  26975. * applyOperatingSystem: function(operatingSystem) {
  26976. * if (!(/^(iOS|Android|BlackBerry)$/i).test(operatingSystem)) {
  26977. * return 'Other';
  26978. * }
  26979. *
  26980. * return operatingSystem;
  26981. * }
  26982. * });
  26983. *
  26984. * var iPhone = new SmartPhone({
  26985. * hasTouchScreen: true,
  26986. * operatingSystem: 'iOS'
  26987. * });
  26988. *
  26989. * iPhone.getPrice(); // 500;
  26990. * iPhone.getOperatingSystem(); // 'iOS'
  26991. * iPhone.getHasTouchScreen(); // true;
  26992. *
  26993. * iPhone.isExpensive; // false;
  26994. * iPhone.setPrice(600);
  26995. * iPhone.getPrice(); // 600
  26996. * iPhone.isExpensive; // true;
  26997. *
  26998. * iPhone.setOperatingSystem('AlienOS');
  26999. * iPhone.getOperatingSystem(); // 'Other'
  27000. *
  27001. * # Statics:
  27002. *
  27003. * Ext.define('Computer', {
  27004. * statics: {
  27005. * factory: function(brand) {
  27006. * // 'this' in static methods refer to the class itself
  27007. * return new this(brand);
  27008. * }
  27009. * },
  27010. *
  27011. * constructor: function() { ... }
  27012. * });
  27013. *
  27014. * var dellComputer = Computer.factory('Dell');
  27015. *
  27016. * Also see {@link Ext.Base#statics} and {@link Ext.Base#self} for more details on accessing
  27017. * static properties within class methods
  27018. *
  27019. * @singleton
  27020. */
  27021. Ext.ClassManager = (function(Class, alias, arraySlice, arrayFrom, global) {
  27022. // @define Ext.ClassManager
  27023. // @require Ext.Inventory
  27024. // @require Ext.Class
  27025. // @require Ext.Function
  27026. // @require Ext.Array
  27027. var makeCtor = Ext.Class.makeCtor,
  27028. nameLookupStack = [],
  27029. namespaceCache = {
  27030. Ext: {
  27031. name: 'Ext',
  27032. value: Ext
  27033. }
  27034. },
  27035. // specially added for sandbox (Ext === global.Ext6)
  27036. /*
  27037. 'Ext.grid': {
  27038. name: 'grid',
  27039. parent: namespaceCache['Ext']
  27040. },
  27041. 'Ext.grid.Panel': {
  27042. name: 'Panel',
  27043. parent: namespaceCache['Ext.grid']
  27044. },
  27045. ...
  27046. Also,
  27047. 'MyApp': {
  27048. name: 'MyApp',
  27049. value: MyApp
  27050. }
  27051. */
  27052. Manager = Ext.apply(new Ext.Inventory(), {
  27053. /**
  27054. * @property {Object} classes
  27055. * All classes which were defined through the ClassManager. Keys are the
  27056. * name of the classes and the values are references to the classes.
  27057. * @private
  27058. */
  27059. classes: {},
  27060. classCount: 0,
  27061. classState: {},
  27062. /*
  27063. * 'Ext.foo.Bar': <state enum>
  27064. *
  27065. * 10 = Ext.define called
  27066. * 20 = Ext.define/override called
  27067. * 30 = Manager.existCache[<name>] == true for define
  27068. * 40 = Manager.existCache[<name>] == true for define/override
  27069. * 50 = Manager.isCreated(<name>) == true for define
  27070. * 60 = Manager.isCreated(<name>) == true for define/override
  27071. *
  27072. */
  27073. /**
  27074. * @private
  27075. */
  27076. existCache: {},
  27077. /** @private */
  27078. instantiators: [],
  27079. /**
  27080. * Checks if a class has already been created.
  27081. *
  27082. * @param {String} className
  27083. * @return {Boolean} exist
  27084. */
  27085. isCreated: function(className) {
  27086. if (typeof className !== 'string' || className.length < 1) {
  27087. throw new Error("[Ext.ClassManager] Invalid classname, must be a string and " + "must not be empty");
  27088. }
  27089. if (Manager.classes[className] || Manager.existCache[className]) {
  27090. return true;
  27091. }
  27092. if (!Manager.lookupName(className, false)) {
  27093. return false;
  27094. }
  27095. Manager.triggerCreated(className);
  27096. return true;
  27097. },
  27098. /**
  27099. * @private
  27100. */
  27101. createdListeners: [],
  27102. /**
  27103. * @private
  27104. */
  27105. nameCreatedListeners: {},
  27106. /**
  27107. * @private
  27108. */
  27109. existsListeners: [],
  27110. /**
  27111. * @private
  27112. */
  27113. nameExistsListeners: {},
  27114. /**
  27115. * @private
  27116. */
  27117. overrideMap: {},
  27118. /**
  27119. * @private
  27120. */
  27121. triggerCreated: function(className, state) {
  27122. Manager.existCache[className] = state || 1;
  27123. Manager.classState[className] += 40;
  27124. Manager.notify(className, Manager.createdListeners, Manager.nameCreatedListeners);
  27125. },
  27126. /**
  27127. * @private
  27128. */
  27129. onCreated: function(fn, scope, className) {
  27130. Manager.addListener(fn, scope, className, Manager.createdListeners, Manager.nameCreatedListeners);
  27131. },
  27132. /**
  27133. * @private
  27134. */
  27135. notify: function(className, listeners, nameListeners) {
  27136. var alternateNames = Manager.getAlternatesByName(className),
  27137. names = [
  27138. className
  27139. ],
  27140. i, ln, j, subLn, listener, name;
  27141. for (i = 0 , ln = listeners.length; i < ln; i++) {
  27142. listener = listeners[i];
  27143. listener.fn.call(listener.scope, className);
  27144. }
  27145. while (names) {
  27146. for (i = 0 , ln = names.length; i < ln; i++) {
  27147. name = names[i];
  27148. listeners = nameListeners[name];
  27149. if (listeners) {
  27150. for (j = 0 , subLn = listeners.length; j < subLn; j++) {
  27151. listener = listeners[j];
  27152. listener.fn.call(listener.scope, name);
  27153. }
  27154. delete nameListeners[name];
  27155. }
  27156. }
  27157. names = alternateNames;
  27158. // for 2nd pass (if needed)
  27159. alternateNames = null;
  27160. }
  27161. },
  27162. // no 3rd pass
  27163. /**
  27164. * @private
  27165. */
  27166. addListener: function(fn, scope, className, listeners, nameListeners) {
  27167. var i;
  27168. if (Ext.isArray(className)) {
  27169. fn = Ext.Function.createBarrier(className.length, fn, scope);
  27170. for (i = 0; i < className.length; i++) {
  27171. this.addListener(fn, null, className[i], listeners, nameListeners);
  27172. }
  27173. return;
  27174. }
  27175. /* eslint-disable-next-line vars-on-top */
  27176. var listener = {
  27177. fn: fn,
  27178. scope: scope
  27179. };
  27180. if (className) {
  27181. if (this.isCreated(className)) {
  27182. fn.call(scope, className);
  27183. return;
  27184. }
  27185. if (!nameListeners[className]) {
  27186. nameListeners[className] = [];
  27187. }
  27188. nameListeners[className].push(listener);
  27189. } else {
  27190. listeners.push(listener);
  27191. }
  27192. },
  27193. /**
  27194. * Supports namespace rewriting.
  27195. * @private
  27196. */
  27197. $namespaceCache: namespaceCache,
  27198. /**
  27199. * See `{@link Ext#addRootNamespaces Ext.addRootNamespaces}`.
  27200. * @since 6.0.0
  27201. * @private
  27202. */
  27203. addRootNamespaces: function(namespaces) {
  27204. var name;
  27205. for (name in namespaces) {
  27206. namespaceCache[name] = {
  27207. name: name,
  27208. value: namespaces[name]
  27209. };
  27210. }
  27211. },
  27212. /**
  27213. * Clears the namespace lookup cache. After application launch, this cache can
  27214. * often contain several hundred entries that are unlikely to be needed again.
  27215. * These will be rebuilt as needed, so it is harmless to clear this cache even
  27216. * if its results will be used again.
  27217. * @since 6.0.0
  27218. * @private
  27219. */
  27220. clearNamespaceCache: function() {
  27221. var name;
  27222. nameLookupStack.length = 0;
  27223. for (name in namespaceCache) {
  27224. if (!namespaceCache[name].value) {
  27225. delete namespaceCache[name];
  27226. }
  27227. }
  27228. },
  27229. /**
  27230. * Return the namespace cache entry for the given a class name or namespace (e.g.,
  27231. * "Ext.grid.Panel").
  27232. *
  27233. * @param {String} namespace The namespace or class name to lookup.
  27234. * @return {Object} The cache entry.
  27235. * @return {String} return.name The leaf name ("Panel" for "Ext.grid.Panel").
  27236. * @return {Object} return.parent The entry of the parent namespace (i.e., "Ext.grid").
  27237. * @return {Object} return.value The namespace object. This is only set for
  27238. * top-level namespace entries to support renaming them for sandboxing ("Ext6" vs
  27239. * "Ext").
  27240. * @since 6.0.0
  27241. * @private
  27242. */
  27243. getNamespaceEntry: function(namespace) {
  27244. var entry, i;
  27245. if (typeof namespace !== 'string') {
  27246. return namespace;
  27247. }
  27248. // assume we've been given an entry object
  27249. entry = namespaceCache[namespace];
  27250. if (!entry) {
  27251. i = namespace.lastIndexOf('.');
  27252. if (i < 0) {
  27253. entry = {
  27254. name: namespace
  27255. };
  27256. } else {
  27257. entry = {
  27258. name: namespace.substring(i + 1),
  27259. parent: Manager.getNamespaceEntry(namespace.substring(0, i))
  27260. };
  27261. }
  27262. namespaceCache[namespace] = entry;
  27263. }
  27264. return entry;
  27265. },
  27266. /**
  27267. * Return the value of the given "dot path" name. This supports remapping (for use
  27268. * in sandbox builds) as well as auto-creating of namespaces.
  27269. *
  27270. * @param {String} namespace The name of the namespace or class.
  27271. * @param {Boolean} [autoCreate] Pass `true` to create objects for undefined names.
  27272. * @return {Object} The object that is the namespace or class name.
  27273. * @since 6.0.0
  27274. * @private
  27275. */
  27276. lookupName: function(namespace, autoCreate) {
  27277. var entry = Manager.getNamespaceEntry(namespace),
  27278. scope = Ext.global,
  27279. i = 0,
  27280. e, parent;
  27281. // Put entries on the stack in reverse order: [ 'Panel', 'grid', 'Ext' ]
  27282. for (e = entry; e; e = e.parent) {
  27283. // since we process only what we add to the array, and that always
  27284. // starts at index=0, we don't need to clean up the array (that would
  27285. // just encourage the GC to do something pointless).
  27286. nameLookupStack[i++] = e;
  27287. }
  27288. while (scope && i-- > 0) {
  27289. // We'll process entries in top-down order ('Ext', 'grid' then 'Panel').
  27290. e = nameLookupStack[i];
  27291. parent = scope;
  27292. scope = e.value || scope[e.name];
  27293. if (!scope && autoCreate) {
  27294. parent[e.name] = scope = {};
  27295. }
  27296. }
  27297. return scope;
  27298. },
  27299. /**
  27300. * Creates a namespace and assign the `value` to the created object.
  27301. *
  27302. * Ext.ClassManager.setNamespace('MyCompany.pkg.Example', someObject);
  27303. *
  27304. * alert(MyCompany.pkg.Example === someObject); // alerts true
  27305. *
  27306. * @param {String} namespace
  27307. * @param {Object} value
  27308. */
  27309. setNamespace: function(namespace, value) {
  27310. var entry = Manager.getNamespaceEntry(namespace),
  27311. scope = Ext.global;
  27312. if (entry.parent) {
  27313. scope = Manager.lookupName(entry.parent, true);
  27314. }
  27315. scope[entry.name] = value;
  27316. return value;
  27317. },
  27318. /**
  27319. * Changes the mapping of an `xtype` to map to the specified component class.
  27320. * @param {String/Ext.Class} cls The class or class name to which `xtype` is mapped.
  27321. * @param {String} xtype The `xtype` to map or redefine as `cls`.
  27322. * @since 6.0.1
  27323. * @private
  27324. */
  27325. setXType: function(cls, xtype) {
  27326. var className = cls.$className,
  27327. C = className ? cls : Manager.get(className = cls),
  27328. proto = C.prototype,
  27329. xtypes = proto.xtypes,
  27330. xtypesChain = proto.xtypesChain,
  27331. xtypesMap = proto.xtypesMap;
  27332. if (!proto.hasOwnProperty('xtypes')) {
  27333. proto.xtypes = xtypes = [];
  27334. proto.xtypesChain = xtypesChain = xtypesChain ? xtypesChain.slice(0) : [];
  27335. proto.xtypesMap = xtypesMap = Ext.apply({}, xtypesMap);
  27336. }
  27337. Manager.addAlias(className, 'widget.' + xtype, true);
  27338. xtypes.push(xtype);
  27339. xtypesChain.push(xtype);
  27340. xtypesMap[xtype] = true;
  27341. },
  27342. // TODO consider updating derived class xtypesChain / xtypesMap
  27343. /**
  27344. * Sets a name reference to a class.
  27345. *
  27346. * @param {String} name
  27347. * @param {Object} value
  27348. * @return {Ext.ClassManager} this
  27349. */
  27350. set: function(name, value) {
  27351. var targetName = Manager.getName(value);
  27352. Manager.classes[name] = Manager.setNamespace(name, value);
  27353. Manager.classCount++;
  27354. if (targetName && targetName !== name) {
  27355. Manager.addAlternate(targetName, name);
  27356. }
  27357. return Manager;
  27358. },
  27359. /**
  27360. * Retrieve a class by its name.
  27361. *
  27362. * @param {String} name
  27363. * @return {Ext.Class} class
  27364. */
  27365. get: function(name) {
  27366. return Manager.classes[name] || Manager.lookupName(name, false);
  27367. },
  27368. /**
  27369. * Adds a batch of class name to alias mappings.
  27370. * @param {Object} aliases The set of mappings of the form.
  27371. * className : [values...]
  27372. */
  27373. addNameAliasMappings: function(aliases) {
  27374. Manager.addAlias(aliases);
  27375. },
  27376. /**
  27377. *
  27378. * @param {Object} alternates The set of mappings of the form
  27379. * className : [values...]
  27380. */
  27381. addNameAlternateMappings: function(alternates) {
  27382. Manager.addAlternate(alternates);
  27383. },
  27384. /**
  27385. * Get a reference to the class by its alias.
  27386. *
  27387. * @param {String} alias
  27388. * @return {Ext.Class} class
  27389. */
  27390. getByAlias: function(alias) {
  27391. return Manager.get(Manager.getNameByAlias(alias));
  27392. },
  27393. /**
  27394. * Get a component class name from a config object.
  27395. * @param {Object} config The config object.
  27396. * @param {String} [aliasPrefix] A prefix to use when getting
  27397. * a class name by alias.
  27398. * @return {Ext.Class} The class.
  27399. *
  27400. * @private
  27401. */
  27402. getByConfig: function(config, aliasPrefix) {
  27403. var xclass = config.xclass,
  27404. name;
  27405. if (xclass) {
  27406. name = xclass;
  27407. } else {
  27408. name = config.xtype;
  27409. if (name) {
  27410. aliasPrefix = 'widget.';
  27411. } else {
  27412. name = config.type;
  27413. }
  27414. name = Manager.getNameByAlias(aliasPrefix + name);
  27415. }
  27416. return Manager.get(name);
  27417. },
  27418. /**
  27419. * Get the name of the class by its reference or its instance. This is
  27420. * usually invoked by the shorthand {@link Ext#getClassName}.
  27421. *
  27422. * Ext.ClassManager.getName(Ext.Action); // returns "Ext.Action"
  27423. *
  27424. * @param {Ext.Class/Object} object
  27425. * @return {String} className
  27426. */
  27427. getName: function(object) {
  27428. return object && object.$className || '';
  27429. },
  27430. /**
  27431. * Get the class of the provided object; returns null if it's not an instance
  27432. * of any class created with Ext.define. This is usually invoked by the
  27433. * shorthand {@link Ext#getClass}.
  27434. *
  27435. * var component = new Ext.Component();
  27436. *
  27437. * Ext.getClass(component); // returns Ext.Component
  27438. *
  27439. * @param {Object} object
  27440. * @return {Ext.Class} class
  27441. */
  27442. getClass: function(object) {
  27443. return object && object.self || null;
  27444. },
  27445. /**
  27446. * Defines a class.
  27447. * @deprecated 4.1 Use {@link Ext#define} instead.
  27448. * @private
  27449. */
  27450. create: function(className, data, createdFn) {
  27451. var ctor;
  27452. if (className != null && typeof className !== 'string') {
  27453. throw new Error("[Ext.define] Invalid class name '" + className + "' specified, must be a non-empty string");
  27454. }
  27455. ctor = makeCtor(className);
  27456. if (typeof data === 'function') {
  27457. data = data(ctor);
  27458. }
  27459. if (className) {
  27460. if (Manager.classes[className]) {
  27461. Ext.log.warn("[Ext.define] Duplicate class name '" + className + "' specified, must be a non-empty string");
  27462. }
  27463. ctor.name = className;
  27464. }
  27465. data.$className = className;
  27466. return new Class(ctor, data, function() {
  27467. var postprocessorStack = data.postprocessors || Manager.defaultPostprocessors,
  27468. registeredPostprocessors = Manager.postprocessors,
  27469. postprocessors = [],
  27470. postprocessor, i, ln, j, subLn, postprocessorProperties, postprocessorProperty;
  27471. delete data.postprocessors;
  27472. for (i = 0 , ln = postprocessorStack.length; i < ln; i++) {
  27473. postprocessor = postprocessorStack[i];
  27474. if (typeof postprocessor === 'string') {
  27475. postprocessor = registeredPostprocessors[postprocessor];
  27476. postprocessorProperties = postprocessor.properties;
  27477. if (postprocessorProperties === true) {
  27478. postprocessors.push(postprocessor.fn);
  27479. } else if (postprocessorProperties) {
  27480. for (j = 0 , subLn = postprocessorProperties.length; j < subLn; j++) {
  27481. postprocessorProperty = postprocessorProperties[j];
  27482. if (data.hasOwnProperty(postprocessorProperty)) {
  27483. postprocessors.push(postprocessor.fn);
  27484. break;
  27485. }
  27486. }
  27487. }
  27488. } else {
  27489. postprocessors.push(postprocessor);
  27490. }
  27491. }
  27492. data.postprocessors = postprocessors;
  27493. data.createdFn = createdFn;
  27494. Manager.processCreate(className, this, data);
  27495. });
  27496. },
  27497. processCreate: function(className, cls, clsData) {
  27498. var me = this,
  27499. postprocessor = clsData.postprocessors.shift(),
  27500. createdFn = clsData.createdFn;
  27501. if (!postprocessor) {
  27502. if (Ext.classSystemMonitor) {
  27503. Ext.classSystemMonitor(className, 'Ext.ClassManager#classCreated', arguments);
  27504. }
  27505. if (className) {
  27506. me.set(className, cls);
  27507. }
  27508. delete cls._classHooks;
  27509. if (createdFn) {
  27510. createdFn.call(cls, cls);
  27511. }
  27512. if (className) {
  27513. me.triggerCreated(className);
  27514. }
  27515. return;
  27516. }
  27517. if (postprocessor.call(me, className, cls, clsData, me.processCreate) !== false) {
  27518. me.processCreate(className, cls, clsData);
  27519. }
  27520. },
  27521. createOverride: function(className, data, createdFn) {
  27522. var me = this,
  27523. overriddenClassName = data.override,
  27524. requires = data.requires,
  27525. uses = data.uses,
  27526. mixins = data.mixins,
  27527. mixinsIsArray,
  27528. compat = 1,
  27529. // default if 'compatibility' is not specified
  27530. dependenciesLoaded, classReady;
  27531. classReady = function() {
  27532. var cls, dependencies, i, key, temp;
  27533. if (!dependenciesLoaded) {
  27534. dependencies = requires ? requires.slice(0) : [];
  27535. if (mixins) {
  27536. if (!(mixinsIsArray = mixins instanceof Array)) {
  27537. for (key in mixins) {
  27538. if (Ext.isString(cls = mixins[key])) {
  27539. dependencies.push(cls);
  27540. }
  27541. }
  27542. } else {
  27543. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  27544. if (Ext.isString(cls = mixins[i])) {
  27545. dependencies.push(cls);
  27546. }
  27547. }
  27548. }
  27549. }
  27550. dependenciesLoaded = true;
  27551. if (dependencies.length) {
  27552. // Since the override is going to be used (its target class is
  27553. // now created), we need to fetch the required classes for the
  27554. // override and call us back once they are loaded:
  27555. Ext.require(dependencies, classReady);
  27556. return;
  27557. }
  27558. }
  27559. // else we have no dependencies, so proceed
  27560. // transform mixin class names into class references, This
  27561. // loop can handle both the array and object forms of
  27562. // mixin definitions
  27563. if (mixinsIsArray) {
  27564. for (i = 0 , temp = mixins.length; i < temp; ++i) {
  27565. if (Ext.isString(cls = mixins[i])) {
  27566. mixins[i] = Ext.ClassManager.get(cls);
  27567. }
  27568. }
  27569. } else if (mixins) {
  27570. for (key in mixins) {
  27571. if (Ext.isString(cls = mixins[key])) {
  27572. mixins[key] = Ext.ClassManager.get(cls);
  27573. }
  27574. }
  27575. }
  27576. // The target class and the required classes for this override are
  27577. // ready, so we can apply the override now:
  27578. cls = overriddenClassName.$isClass ? overriddenClassName : me.get(overriddenClassName);
  27579. // We don't want to apply these:
  27580. delete data.override;
  27581. delete data.compatibility;
  27582. delete data.requires;
  27583. delete data.uses;
  27584. Ext.override(cls, data);
  27585. // This pushes the overriding file itself into Ext.Loader.history
  27586. // Hence if the target class never exists, the overriding file will
  27587. // never be included in the build.
  27588. Ext.Loader.history.push(className);
  27589. if (uses) {
  27590. // This "hides" from the Cmd auto-dependency scanner since
  27591. // the reference is circular (Loader requires us).
  27592. /* eslint-disable-next-line dot-notation */
  27593. Ext['Loader'].addUsedClasses(uses);
  27594. }
  27595. // get these classes too!
  27596. if (createdFn) {
  27597. createdFn.call(cls, cls);
  27598. }
  27599. };
  27600. // last but not least!
  27601. if (className) {
  27602. Manager.overrideMap[className] = true;
  27603. }
  27604. // If specified, parse strings as versions, but otherwise treat as a
  27605. // boolean (maybe "compatibility: Ext.isIE8" or something).
  27606. //
  27607. if ('compatibility' in data) {
  27608. compat = data.compatibility;
  27609. if (!compat) {
  27610. // Cast '', null, undefined, 0 to false.
  27611. compat = false;
  27612. } else if (typeof compat === 'number') {
  27613. // By virtue of the condition above we must be a nonzero number.
  27614. compat = true;
  27615. } else if (typeof compat !== 'boolean') {
  27616. compat = Ext.checkVersion(compat);
  27617. }
  27618. }
  27619. if (compat) {
  27620. // override the target class right after it's created
  27621. if (overriddenClassName.$isClass) {
  27622. classReady();
  27623. } else {
  27624. me.onCreated(classReady, me, overriddenClassName);
  27625. }
  27626. }
  27627. me.triggerCreated(className, 2);
  27628. return me;
  27629. },
  27630. /**
  27631. * Instantiate a class by its alias. This is usually invoked by the
  27632. * shorthand {@link Ext#createByAlias}.
  27633. *
  27634. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class
  27635. * has not been defined yet, it will attempt to load the class via synchronous
  27636. * loading.
  27637. *
  27638. * var window = Ext.createByAlias('widget.window', { width: 600, height: 800 });
  27639. *
  27640. * @param {String} alias
  27641. * @param {Object...} args Additional arguments after the alias will be passed to the
  27642. * class constructor.
  27643. * @return {Object} instance
  27644. */
  27645. instantiateByAlias: function() {
  27646. var alias = arguments[0],
  27647. args = arraySlice.call(arguments),
  27648. className = this.getNameByAlias(alias);
  27649. if (!className) {
  27650. throw new Error("[Ext.createByAlias] Unrecognized alias: " + alias);
  27651. }
  27652. args[0] = className;
  27653. return Ext.create.apply(Ext, args);
  27654. },
  27655. /**
  27656. * Instantiate a class by either full name, alias or alternate name
  27657. * @param {String} name
  27658. * @param {Mixed} args Additional arguments after the name will be passed to the class'
  27659. * constructor.
  27660. * @return {Object} instance
  27661. * @deprecated 5.0 Use Ext.create() instead.
  27662. */
  27663. instantiate: function() {
  27664. Ext.log.warn('Ext.ClassManager.instantiate() is deprecated. Use Ext.create() instead.');
  27665. return Ext.create.apply(Ext, arguments);
  27666. },
  27667. /**
  27668. * @private
  27669. * @param name
  27670. * @param args
  27671. */
  27672. dynInstantiate: function(name, args) {
  27673. args = arrayFrom(args, true);
  27674. args.unshift(name);
  27675. return Ext.create.apply(Ext, args);
  27676. },
  27677. /**
  27678. * @private
  27679. * @param length
  27680. */
  27681. getInstantiator: function(length) {
  27682. var instantiators = this.instantiators,
  27683. instantiator, args, i;
  27684. instantiator = instantiators[length];
  27685. if (!instantiator) {
  27686. i = length;
  27687. args = [];
  27688. for (i = 0; i < length; i++) {
  27689. args.push('a[' + i + ']');
  27690. }
  27691. instantiator = instantiators[length] = new Function('c', 'a', 'return new c(' + args.join(',') + ')');
  27692. instantiator.name = "Ext.create" + length;
  27693. }
  27694. return instantiator;
  27695. },
  27696. /**
  27697. * @private
  27698. */
  27699. postprocessors: {},
  27700. /**
  27701. * @private
  27702. */
  27703. defaultPostprocessors: [],
  27704. /**
  27705. * Register a post-processor function.
  27706. *
  27707. * @param {String} name
  27708. * @param {Function} fn
  27709. * @param {String/String[]} properties
  27710. * @param {String} position
  27711. * @param {String} relativeTo
  27712. * @private
  27713. */
  27714. registerPostprocessor: function(name, fn, properties, position, relativeTo) {
  27715. if (!position) {
  27716. position = 'last';
  27717. }
  27718. if (!properties) {
  27719. properties = [
  27720. name
  27721. ];
  27722. }
  27723. this.postprocessors[name] = {
  27724. name: name,
  27725. properties: properties || false,
  27726. fn: fn
  27727. };
  27728. this.setDefaultPostprocessorPosition(name, position, relativeTo);
  27729. return this;
  27730. },
  27731. /**
  27732. * Set the default post processors array stack which are applied to every class.
  27733. *
  27734. * @private
  27735. * @param {String/Array} postprocessors The name of a registered post processor or an array
  27736. * of registered names.
  27737. * @return {Ext.ClassManager} this
  27738. */
  27739. setDefaultPostprocessors: function(postprocessors) {
  27740. this.defaultPostprocessors = arrayFrom(postprocessors);
  27741. return this;
  27742. },
  27743. /**
  27744. * Insert this post-processor at a specific position in the stack, optionally relative to
  27745. * any existing post-processor
  27746. *
  27747. * @private
  27748. * @param {String} name The post-processor name. Note that it needs to be registered with
  27749. * {@link Ext.ClassManager#registerPostprocessor} before this
  27750. * @param {String} offset The insertion position. Four possible values are:
  27751. * 'first', 'last', or: 'before', 'after' (relative to the name provided in the third
  27752. * argument)
  27753. * @param {String} relativeName
  27754. * @return {Ext.ClassManager} this
  27755. */
  27756. setDefaultPostprocessorPosition: function(name, offset, relativeName) {
  27757. var defaultPostprocessors = this.defaultPostprocessors,
  27758. index;
  27759. if (typeof offset === 'string') {
  27760. if (offset === 'first') {
  27761. defaultPostprocessors.unshift(name);
  27762. return this;
  27763. } else if (offset === 'last') {
  27764. defaultPostprocessors.push(name);
  27765. return this;
  27766. }
  27767. offset = (offset === 'after') ? 1 : -1;
  27768. }
  27769. index = Ext.Array.indexOf(defaultPostprocessors, relativeName);
  27770. if (index !== -1) {
  27771. Ext.Array.splice(defaultPostprocessors, Math.max(0, index + offset), 0, name);
  27772. }
  27773. return this;
  27774. }
  27775. });
  27776. /* eslint-disable indent */
  27777. /**
  27778. * @cfg xtype
  27779. * @member Ext.Class
  27780. * @inheritdoc Ext.Component#cfg-xtype
  27781. */
  27782. /**
  27783. * @cfg {String} override
  27784. * @member Ext.Class
  27785. * Overrides members of the specified `target` class.
  27786. *
  27787. * **NOTE:** the overridden class must have been defined using
  27788. * {@link Ext#define Ext.define} in order to use the `override` config.
  27789. *
  27790. * Methods defined on the overriding class will not automatically call the methods of
  27791. * the same name in the ancestor class chain. To call the parent's method of the
  27792. * same name you must call {@link Ext.Base#method!callParent callParent}. To skip the
  27793. * method of the overridden class and call its parent you will instead call
  27794. * {@link Ext.Base#method!callSuper callSuper}.
  27795. *
  27796. * See {@link Ext#define Ext.define} for additional usage examples.
  27797. */
  27798. /**
  27799. * @cfg {Object} platformConfig
  27800. * Allows setting config values for a class based on specific platforms. The value
  27801. * of this config is an object whose properties are "rules" and whose values are
  27802. * objects containing config values.
  27803. *
  27804. * For example:
  27805. *
  27806. * Ext.define('App.view.Foo', {
  27807. * extend: 'Ext.panel.Panel',
  27808. *
  27809. * platformConfig: {
  27810. * desktop: {
  27811. * title: 'Some Rather Descriptive Title'
  27812. * },
  27813. *
  27814. * '!desktop': {
  27815. * title: 'Short Title'
  27816. * }
  27817. * }
  27818. * });
  27819. *
  27820. * In the above, "desktop" and "!desktop" are (mutually exclusive) rules. Whichever
  27821. * evaluates to `true` will have its configs applied to the class. In this case, only
  27822. * the "title" property, but the object can contain any number of config properties.
  27823. * In this case, the `platformConfig` is evaluated as part of the class and there is
  27824. * no cost for each instance created.
  27825. *
  27826. * The rules are evaluated expressions in the context of the platform tags contained
  27827. * in `{@link Ext#platformTags Ext.platformTags}`. Any properties of that object are
  27828. * implicitly usable (as shown above).
  27829. *
  27830. * If a `platformConfig` specifies a config value, it will replace any values declared
  27831. * on the class itself.
  27832. *
  27833. * Use of `platformConfig` on instances is handled by the config system when classes
  27834. * call `{@link Ext.Base#initConfig initConfig}`. For example:
  27835. *
  27836. * Ext.create({
  27837. * xtype: 'panel',
  27838. *
  27839. * platformConfig: {
  27840. * desktop: {
  27841. * title: 'Some Rather Descriptive Title'
  27842. * },
  27843. *
  27844. * '!desktop': {
  27845. * title: 'Short Title'
  27846. * }
  27847. * }
  27848. * });
  27849. *
  27850. * The following is equivalent to the above:
  27851. *
  27852. * if (Ext.platformTags.desktop) {
  27853. * Ext.create({
  27854. * xtype: 'panel',
  27855. * title: 'Some Rather Descriptive Title'
  27856. * });
  27857. * } else {
  27858. * Ext.create({
  27859. * xtype: 'panel',
  27860. * title: 'Short Title'
  27861. * });
  27862. * }
  27863. *
  27864. * To adjust configs based on dynamic conditions, see `{@link Ext.mixin.Responsive}`.
  27865. */
  27866. Manager.registerPostprocessor('platformConfig', function(name, Class, data) {
  27867. Class.addPlatformConfig(data);
  27868. });
  27869. /**
  27870. * @cfg {String/String[]} alias
  27871. * @member Ext.Class
  27872. * List of short aliases for class names. An alias consists of a namespace and a name
  27873. * concatenated by a period as &#60;namespace&#62;.&#60;name&#62;
  27874. *
  27875. * - **namespace** - The namespace describes what kind of alias this is and must be
  27876. * all lowercase.
  27877. * - **name** - The name of the alias which allows the lazy-instantiation via the
  27878. * alias. The name shouldn't contain any periods.
  27879. *
  27880. * A list of namespaces and the usages are:
  27881. *
  27882. * - **feature** - {@link Ext.grid.Panel Grid} features
  27883. * - **plugin** - Plugins
  27884. * - **store** - {@link Ext.data.Store}
  27885. * - **widget** - Components
  27886. *
  27887. * Most useful for defining xtypes for widgets:
  27888. *
  27889. * Ext.define('MyApp.CoolPanel', {
  27890. * extend: 'Ext.panel.Panel',
  27891. * alias: ['widget.coolpanel'],
  27892. * title: 'Yeah!'
  27893. * });
  27894. *
  27895. * // Using Ext.create
  27896. * Ext.create('widget.coolpanel');
  27897. *
  27898. * // Using the shorthand for defining widgets by xtype
  27899. * Ext.widget('panel', {
  27900. * items: [
  27901. * {xtype: 'coolpanel', html: 'Foo'},
  27902. * {xtype: 'coolpanel', html: 'Bar'}
  27903. * ]
  27904. * });
  27905. */
  27906. Manager.registerPostprocessor('alias', function(name, cls, data) {
  27907. if (Ext.classSystemMonitor) {
  27908. Ext.classSystemMonitor(name, 'Ext.ClassManager#aliasPostProcessor', arguments);
  27909. }
  27910. /* eslint-disable-next-line vars-on-top */
  27911. var aliases = Ext.Array.from(data.alias),
  27912. i, ln;
  27913. for (i = 0 , ln = aliases.length; i < ln; i++) {
  27914. alias = aliases[i];
  27915. this.addAlias(cls, alias);
  27916. }
  27917. }, [
  27918. 'xtype',
  27919. 'alias'
  27920. ]);
  27921. /**
  27922. * @cfg {Boolean} singleton
  27923. * @member Ext.Class
  27924. * When set to true, the class will be instantiated as singleton. For example:
  27925. *
  27926. * Ext.define('Logger', {
  27927. * singleton: true,
  27928. * log: function(msg) {
  27929. * console.log(msg);
  27930. * }
  27931. * });
  27932. *
  27933. * Logger.log('Hello');
  27934. */
  27935. Manager.registerPostprocessor('singleton', function(name, cls, data, fn) {
  27936. if (Ext.classSystemMonitor) {
  27937. Ext.classSystemMonitor(name, 'Ext.ClassManager#singletonPostProcessor', arguments);
  27938. }
  27939. if (data.singleton) {
  27940. fn.call(this, name, new cls(), data);
  27941. } else {
  27942. return true;
  27943. }
  27944. return false;
  27945. });
  27946. /**
  27947. * @cfg {String/String[]} alternateClassName
  27948. * @member Ext.Class
  27949. * Defines alternate names for this class. For example:
  27950. *
  27951. * Ext.define('Developer', {
  27952. * alternateClassName: ['Coder', 'Hacker'],
  27953. * code: function(msg) {
  27954. * alert('Typing... ' + msg);
  27955. * }
  27956. * });
  27957. *
  27958. * var joe = Ext.create('Developer');
  27959. * joe.code('stackoverflow');
  27960. *
  27961. * var rms = Ext.create('Hacker');
  27962. * rms.code('hack hack');
  27963. */
  27964. Manager.registerPostprocessor('alternateClassName', function(name, cls, data) {
  27965. var alternates = data.alternateClassName,
  27966. i, ln, alternate;
  27967. if (Ext.classSystemMonitor) {
  27968. Ext.classSystemMonitor(name, 'Ext.ClassManager#alternateClassNamePostprocessor', arguments);
  27969. }
  27970. if (!(alternates instanceof Array)) {
  27971. alternates = [
  27972. alternates
  27973. ];
  27974. }
  27975. for (i = 0 , ln = alternates.length; i < ln; i++) {
  27976. alternate = alternates[i];
  27977. if (typeof alternate !== 'string') {
  27978. throw new Error("[Ext.define] Invalid alternate of: '" + alternate + "' for class: '" + name + "'; must be a valid string");
  27979. }
  27980. this.set(alternate, cls);
  27981. }
  27982. });
  27983. /**
  27984. * @cfg {Object} debugHooks
  27985. * A collection of diagnostic methods to decorate the real methods of the class. These
  27986. * methods are applied as an `override` if this class has debug enabled as defined by
  27987. * `Ext.isDebugEnabled`.
  27988. *
  27989. * These will be automatically removed by the Sencha Cmd compiler for production builds.
  27990. *
  27991. * Example usage:
  27992. *
  27993. * Ext.define('Foo.bar.Class', {
  27994. * foo: function(a, b, c) {
  27995. * ...
  27996. * },
  27997. *
  27998. * bar: function(a, b) {
  27999. * ...
  28000. * return 42;
  28001. * },
  28002. *
  28003. * debugHooks: {
  28004. * foo: function(a, b, c) {
  28005. * // check arguments...
  28006. * return this.callParent(arguments);
  28007. * }
  28008. * }
  28009. * });
  28010. *
  28011. * If you specify a `$enabled` property in the `debugHooks` object that will be used
  28012. * as the default enabled state for the hooks. If the `{@link Ext#manifest}` contains
  28013. * a `debug` object of if `{@link Ext#debugConfig}` is specified, the `$enabled` flag
  28014. * will override its "*" value.
  28015. */
  28016. Manager.registerPostprocessor('debugHooks', function(name, Class, data) {
  28017. var target;
  28018. if (Ext.classSystemMonitor) {
  28019. Ext.classSystemMonitor(Class, 'Ext.Class#debugHooks', arguments);
  28020. }
  28021. if (Ext.isDebugEnabled(Class.$className, data.debugHooks.$enabled)) {
  28022. delete data.debugHooks.$enabled;
  28023. Ext.override(Class, data.debugHooks);
  28024. }
  28025. // may already have an instance here in the case of singleton
  28026. target = Class.isInstance ? Class.self : Class;
  28027. delete target.prototype.debugHooks;
  28028. });
  28029. /**
  28030. * @cfg {Object} deprecated
  28031. * The object given has properties that describe the versions at which the deprecations
  28032. * apply.
  28033. *
  28034. * The purpose of the `deprecated` declaration is to enable development mode to give
  28035. * suitable error messages when deprecated methods or properties are used. Methods can
  28036. * always be injected to provide this feedback, but properties can only be handled on
  28037. * some browsers (those that support `Object.defineProperty`).
  28038. *
  28039. * In some cases, deprecated methods can be restored to their previous behavior or
  28040. * added back if they have been removed.
  28041. *
  28042. * The structure of a `deprecated` declaration is this:
  28043. *
  28044. * Ext.define('Foo.bar.Class', {
  28045. * ...
  28046. *
  28047. * deprecated: {
  28048. * // Optional package name - default is the framework (ext or touch)
  28049. * name: 'foobar',
  28050. *
  28051. * '5.0': {
  28052. * methods: {
  28053. * // Throws: '"removedMethod" is deprecated.'
  28054. * removedMethod: null,
  28055. *
  28056. * // Throws: '"oldMethod" is deprecated. Please use "newMethod" instead.'
  28057. * oldMethod: 'newMethod',
  28058. *
  28059. * // When this block is enabled, this method is applied as an
  28060. * // override. Otherwise you get same as "removeMethod".
  28061. * method: function() {
  28062. * // Do what v5 "method" did. If "method" exists in newer
  28063. * // versions callParent can call it. If 5.1 has "method"
  28064. * // then it would be next in line, otherwise 5.2 and last
  28065. * // would be the current class.
  28066. * },
  28067. *
  28068. * moreHelpful: {
  28069. * message: 'Something helpful to do instead.',
  28070. * fn: function() {
  28071. * // The v5 "moreHelpful" method to use when enabled.
  28072. * }
  28073. * }
  28074. * },
  28075. * properties: {
  28076. * // Throws: '"removedProp" is deprecated.'
  28077. * removedProp: null,
  28078. *
  28079. * // Throws: '"oldProp" is deprecated. Please use "newProp" instead.'
  28080. * oldProp: 'newProp',
  28081. *
  28082. * helpful: {
  28083. * message: 'Something helpful message about what to do.'
  28084. * }
  28085. * ...
  28086. * },
  28087. * statics: {
  28088. * methods: {
  28089. * ...
  28090. * },
  28091. * properties: {
  28092. * ...
  28093. * },
  28094. * }
  28095. * },
  28096. *
  28097. * '5.1': {
  28098. * ...
  28099. * },
  28100. *
  28101. * '5.2': {
  28102. * ...
  28103. * }
  28104. * }
  28105. * });
  28106. *
  28107. * The primary content of `deprecated` are the version number keys. These indicate
  28108. * a version number where methods or properties were deprecated. These versions are
  28109. * compared to the version reported by `Ext.getCompatVersion` to determine the action
  28110. * to take for each "block".
  28111. *
  28112. * When the compatibility version is set to a value less than a version number key,
  28113. * that block is said to be "enabled". For example, if a method was deprecated in
  28114. * version 5.0 but the desired compatibility level is 4.2 then the block is used to
  28115. * patch methods and (to some degree) restore pre-5.0 compatibility.
  28116. *
  28117. * When multiple active blocks have the same method name, each method is applied as
  28118. * an override in reverse order of version. In the above example, if a method appears
  28119. * in the "5.0", "5.1" and "5.2" blocks then the "5.2" method is applied as an override
  28120. * first, followed by the "5.1" method and finally the "5.0" method. This means that
  28121. * the `callParent` from the "5.0" method calls the "5.1" method which calls the
  28122. * "5.2" method which can (if applicable) call the current version.
  28123. */
  28124. Manager.registerPostprocessor('deprecated', function(name, Class, data) {
  28125. var target;
  28126. if (Ext.classSystemMonitor) {
  28127. Ext.classSystemMonitor(Class, 'Ext.Class#deprecated', arguments);
  28128. }
  28129. // may already have an instance here in the case of singleton
  28130. target = Class.isInstance ? Class.self : Class;
  28131. target.addDeprecations(data.deprecated);
  28132. delete target.prototype.deprecated;
  28133. });
  28134. Ext.apply(Ext, {
  28135. /**
  28136. * Instantiate a class by either full name, alias or alternate name.
  28137. *
  28138. * If {@link Ext.Loader} is {@link Ext.Loader#setConfig enabled} and the class has
  28139. * not been defined yet, it will attempt to load the class via synchronous loading.
  28140. *
  28141. * For example, all these three lines return the same result:
  28142. *
  28143. * // xtype
  28144. * var window = Ext.create({
  28145. * xtype: 'window',
  28146. * width: 600,
  28147. * height: 800,
  28148. * ...
  28149. * });
  28150. *
  28151. * // alias
  28152. * var window = Ext.create('widget.window', {
  28153. * width: 600,
  28154. * height: 800,
  28155. * ...
  28156. * });
  28157. *
  28158. * // alternate name
  28159. * var window = Ext.create('Ext.Window', {
  28160. * width: 600,
  28161. * height: 800,
  28162. * ...
  28163. * });
  28164. *
  28165. * // full class name
  28166. * var window = Ext.create('Ext.window.Window', {
  28167. * width: 600,
  28168. * height: 800,
  28169. * ...
  28170. * });
  28171. *
  28172. * // single object with xclass property:
  28173. * var window = Ext.create({
  28174. * xclass: 'Ext.window.Window', // any valid value for 'name' (above)
  28175. * width: 600,
  28176. * height: 800,
  28177. * ...
  28178. * });
  28179. *
  28180. * @param {String} [name] The class name or alias. Can be specified as `xclass`
  28181. * property if only one object parameter is specified.
  28182. * @param {Object...} [args] Additional arguments after the name will be passed to
  28183. * the class' constructor.
  28184. * @return {Object} instance
  28185. * @member Ext
  28186. * @method create
  28187. */
  28188. create: function() {
  28189. var name = arguments[0],
  28190. nameType = typeof name,
  28191. args = arraySlice.call(arguments, 1),
  28192. cls;
  28193. if (nameType === 'function') {
  28194. cls = name;
  28195. } else {
  28196. if (nameType !== 'string' && args.length === 0) {
  28197. args = [
  28198. name
  28199. ];
  28200. if (!(name = name.xclass)) {
  28201. name = args[0].xtype;
  28202. if (name) {
  28203. name = 'widget.' + name;
  28204. }
  28205. }
  28206. }
  28207. if (typeof name !== 'string' || name.length < 1) {
  28208. throw new Error("[Ext.create] Invalid class name or alias '" + name + "' specified, must be a non-empty string");
  28209. }
  28210. name = Manager.resolveName(name);
  28211. cls = Manager.get(name);
  28212. }
  28213. // Still not existing at this point, try to load it via synchronous mode as the last
  28214. // resort
  28215. if (!cls) {
  28216. Ext.syncRequire(name);
  28217. cls = Manager.get(name);
  28218. }
  28219. if (!cls) {
  28220. throw new Error("[Ext.create] Unrecognized class name / alias: " + name);
  28221. }
  28222. if (typeof cls !== 'function') {
  28223. throw new Error("[Ext.create] Singleton '" + name + "' cannot be instantiated.");
  28224. }
  28225. return Manager.getInstantiator(args.length)(cls, args);
  28226. },
  28227. /**
  28228. * Convenient shorthand to create a widget by its xtype or a config object.
  28229. *
  28230. * var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button');
  28231. *
  28232. * var panel = Ext.widget('panel', { // Equivalent to Ext.create('widget.panel')
  28233. * title: 'Panel'
  28234. * });
  28235. *
  28236. * var grid = Ext.widget({
  28237. * xtype: 'grid',
  28238. * ...
  28239. * });
  28240. *
  28241. * If a {@link Ext.Component component} instance is passed, it is simply returned.
  28242. *
  28243. * @member Ext
  28244. * @param {String} [name] The xtype of the widget to create.
  28245. * @param {Object} [config] The configuration object for the widget constructor.
  28246. * @return {Object} The widget instance
  28247. */
  28248. widget: function(name, config) {
  28249. // forms:
  28250. // 1: (xtype)
  28251. // 2: (xtype, config)
  28252. // 3: (config)
  28253. // 4: (xtype, component)
  28254. // 5: (component)
  28255. //
  28256. var xtype = name,
  28257. alias, className, T;
  28258. if (typeof xtype !== 'string') {
  28259. // if (form 3 or 5)
  28260. // first arg is config or component
  28261. config = name;
  28262. // arguments[0]
  28263. xtype = config.xtype;
  28264. className = config.xclass;
  28265. } else {
  28266. config = config || {};
  28267. }
  28268. if (config.isComponent) {
  28269. return config;
  28270. }
  28271. if (!className) {
  28272. alias = 'widget.' + xtype;
  28273. className = Manager.getNameByAlias(alias);
  28274. }
  28275. // this is needed to support demand loading of the class
  28276. if (className) {
  28277. T = Manager.get(className);
  28278. }
  28279. if (!T) {
  28280. return Ext.create(className || alias, config);
  28281. }
  28282. return new T(config);
  28283. },
  28284. /**
  28285. * @method createByAlias
  28286. * @inheritdoc Ext.ClassManager#method-instantiateByAlias
  28287. * @member Ext
  28288. */
  28289. createByAlias: alias(Manager, 'instantiateByAlias'),
  28290. /**
  28291. * Defines a class or override. A basic class is defined like this:
  28292. *
  28293. * Ext.define('My.awesome.Class', {
  28294. * someProperty: 'something',
  28295. *
  28296. * someMethod: function(s) {
  28297. * alert(s + this.someProperty);
  28298. * }
  28299. *
  28300. * ...
  28301. * });
  28302. *
  28303. * var obj = new My.awesome.Class();
  28304. *
  28305. * obj.someMethod('Say '); // alerts 'Say something'
  28306. *
  28307. * To create an anonymous class, pass `null` for the `className`:
  28308. *
  28309. * Ext.define(null, {
  28310. * constructor: function() {
  28311. * // ...
  28312. * }
  28313. * });
  28314. *
  28315. * In some cases, it is helpful to create a nested scope to contain some private
  28316. * properties. The best way to do this is to pass a function instead of an object
  28317. * as the second parameter. This function will be called to produce the class
  28318. * body:
  28319. *
  28320. * Ext.define('MyApp.foo.Bar', function() {
  28321. * var id = 0;
  28322. *
  28323. * return {
  28324. * nextId: function() {
  28325. * return ++id;
  28326. * }
  28327. * };
  28328. * });
  28329. *
  28330. * _Note_ that when using override, the above syntax will not override successfully,
  28331. * because the passed function would need to be executed first to determine whether or not
  28332. * the result is an override or defining a new object. As such, an alternative syntax that
  28333. * immediately invokes the function can be used:
  28334. *
  28335. * Ext.define('MyApp.override.BaseOverride', function() {
  28336. * var counter = 0;
  28337. *
  28338. * return {
  28339. * override: 'Ext.Component',
  28340. * logId: function() {
  28341. * console.log(++counter, this.id);
  28342. * }
  28343. * };
  28344. * }());
  28345. *
  28346. *
  28347. * When using this form of `Ext.define`, the function is passed a reference to its
  28348. * class. This can be used as an efficient way to access any static properties you
  28349. * may have:
  28350. *
  28351. * Ext.define('MyApp.foo.Bar', function(Bar) {
  28352. * return {
  28353. * statics: {
  28354. * staticMethod: function() {
  28355. * // ...
  28356. * }
  28357. * },
  28358. *
  28359. * method: function() {
  28360. * return Bar.staticMethod();
  28361. * }
  28362. * };
  28363. * });
  28364. *
  28365. * To define an override, include the `override` property. The content of an
  28366. * override is aggregated with the specified class in order to extend or modify
  28367. * that class. This can be as simple as setting default property values or it can
  28368. * extend and/or replace methods. This can also extend the statics of the class.
  28369. *
  28370. * One use for an override is to break a large class into manageable pieces.
  28371. *
  28372. * // File: /src/app/Panel.js
  28373. *
  28374. * Ext.define('My.app.Panel', {
  28375. * extend: 'Ext.panel.Panel',
  28376. * requires: [
  28377. * 'My.app.PanelPart2',
  28378. * 'My.app.PanelPart3'
  28379. * ]
  28380. *
  28381. * constructor: function(config) {
  28382. * this.callParent(arguments); // calls Ext.panel.Panel's constructor
  28383. * //...
  28384. * },
  28385. *
  28386. * statics: {
  28387. * method: function() {
  28388. * return 'abc';
  28389. * }
  28390. * }
  28391. * });
  28392. *
  28393. * // File: /src/app/PanelPart2.js
  28394. * Ext.define('My.app.PanelPart2', {
  28395. * override: 'My.app.Panel',
  28396. *
  28397. * constructor: function(config) {
  28398. * this.callParent(arguments); // calls My.app.Panel's constructor
  28399. * //...
  28400. * }
  28401. * });
  28402. *
  28403. * Another use of overrides is to provide optional parts of classes that can be
  28404. * independently required. In this case, the class may even be unaware of the
  28405. * override altogether.
  28406. *
  28407. * Ext.define('My.ux.CoolTip', {
  28408. * override: 'Ext.tip.ToolTip',
  28409. *
  28410. * constructor: function(config) {
  28411. * this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
  28412. * //...
  28413. * }
  28414. * });
  28415. *
  28416. * The above override can now be required as normal.
  28417. *
  28418. * Ext.define('My.app.App', {
  28419. * requires: [
  28420. * 'My.ux.CoolTip'
  28421. * ]
  28422. * });
  28423. *
  28424. * Overrides can also contain statics, inheritableStatics, or privates:
  28425. *
  28426. * Ext.define('My.app.BarMod', {
  28427. * override: 'Ext.foo.Bar',
  28428. *
  28429. * statics: {
  28430. * method: function(x) {
  28431. * return this.callParent([x * 2]); // call Ext.foo.Bar.method
  28432. * }
  28433. * }
  28434. * });
  28435. *
  28436. * Starting in version 4.2.2, overrides can declare their `compatibility` based
  28437. * on the framework version or on versions of other packages. For details on the
  28438. * syntax and options for these checks, see `Ext.checkVersion`.
  28439. *
  28440. * The simplest use case is to test framework version for compatibility:
  28441. *
  28442. * Ext.define('App.overrides.grid.Panel', {
  28443. * override: 'Ext.grid.Panel',
  28444. *
  28445. * compatibility: '4.2.2', // only if framework version is 4.2.2
  28446. *
  28447. * //...
  28448. * });
  28449. *
  28450. * An array is treated as an OR, so if any specs match, the override is
  28451. * compatible.
  28452. *
  28453. * Ext.define('App.overrides.some.Thing', {
  28454. * override: 'Foo.some.Thing',
  28455. *
  28456. * compatibility: [
  28457. * '4.2.2',
  28458. * 'foo@1.0.1-1.0.2'
  28459. * ],
  28460. *
  28461. * //...
  28462. * });
  28463. *
  28464. * To require that all specifications match, an object can be provided:
  28465. *
  28466. * Ext.define('App.overrides.some.Thing', {
  28467. * override: 'Foo.some.Thing',
  28468. *
  28469. * compatibility: {
  28470. * and: [
  28471. * '4.2.2',
  28472. * 'foo@1.0.1-1.0.2'
  28473. * ]
  28474. * },
  28475. *
  28476. * //...
  28477. * });
  28478. *
  28479. * Because the object form is just a recursive check, these can be nested:
  28480. *
  28481. * Ext.define('App.overrides.some.Thing', {
  28482. * override: 'Foo.some.Thing',
  28483. *
  28484. * compatibility: {
  28485. * and: [
  28486. * '4.2.2', // exactly version 4.2.2 of the framework *AND*
  28487. * {
  28488. * // either (or both) of these package specs:
  28489. * or: [
  28490. * 'foo@1.0.1-1.0.2',
  28491. * 'bar@3.0+'
  28492. * ]
  28493. * }
  28494. * ]
  28495. * },
  28496. *
  28497. * //...
  28498. * });
  28499. *
  28500. * IMPORTANT: An override is only included in a build if the class it overrides is
  28501. * required. Otherwise, the override, like the target class, is not included. In
  28502. * Sencha Cmd v4, the `compatibility` declaration can likewise be used to remove
  28503. * incompatible overrides from a build.
  28504. *
  28505. * @param {String} className The class name to create in string dot-namespaced format,
  28506. * for example: 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager'
  28507. *
  28508. * It is highly recommended to follow this simple convention:
  28509. * - The root and the class name are 'CamelCased'
  28510. * - Everything else is lower-cased
  28511. * Pass `null` to create an anonymous class.
  28512. * @param {Object} data The key - value pairs of properties to apply to this class.
  28513. * Property names can be of any valid strings, except those in the reserved listed below:
  28514. *
  28515. * - {@link Ext.Class#cfg-alias alias}
  28516. * - {@link Ext.Class#cfg-alternateClassName alternateClassName}
  28517. * - {@link Ext.Class#cfg-cachedConfig cachedConfig}
  28518. * - {@link Ext.Class#cfg-config config}
  28519. * - {@link Ext.Class#cfg-extend extend}
  28520. * - {@link Ext.Class#cfg-inheritableStatics inheritableStatics}
  28521. * - {@link Ext.Class#cfg-mixins mixins}
  28522. * - {@link Ext.Class#cfg-override override}
  28523. * - {@link Ext.Class#cfg-platformConfig platformConfig}
  28524. * - {@link Ext.Class#cfg-privates privates}
  28525. * - {@link Ext.Class#cfg-requires requires}
  28526. * - `self`
  28527. * - {@link Ext.Class#cfg-singleton singleton}
  28528. * - {@link Ext.Class#cfg-statics statics}
  28529. * - {@link Ext.Class#cfg-uses uses}
  28530. * - {@link Ext.Class#cfg-xtype xtype} (for {@link Ext.Component Components} only)
  28531. *
  28532. * @param {Function} [createdFn] Callback to execute after the class is created,
  28533. * the execution scope of which (`this`) will be the newly created class itself.
  28534. * @return {Ext.Base}
  28535. * @member Ext
  28536. */
  28537. define: function(className, data, createdFn) {
  28538. if (Ext.classSystemMonitor) {
  28539. Ext.classSystemMonitor(className, 'ClassManager#define', arguments);
  28540. }
  28541. if (data.override) {
  28542. Manager.classState[className] = 20;
  28543. return Manager.createOverride.apply(Manager, arguments);
  28544. }
  28545. Manager.classState[className] = 10;
  28546. return Manager.create.apply(Manager, arguments);
  28547. },
  28548. /**
  28549. * Undefines a class defined using the #define method. Typically used
  28550. * for unit testing where setting up and tearing down a class multiple
  28551. * times is required. For example:
  28552. *
  28553. * // define a class
  28554. * Ext.define('Foo', {
  28555. * ...
  28556. * });
  28557. *
  28558. * // run test
  28559. *
  28560. * // undefine the class
  28561. * Ext.undefine('Foo');
  28562. * @param {String} className The class name to undefine in string dot-namespaced format.
  28563. * @private
  28564. */
  28565. undefine: function(className) {
  28566. var classes = Manager.classes;
  28567. if (Ext.classSystemMonitor) {
  28568. Ext.classSystemMonitor(className, 'Ext.ClassManager#undefine', arguments);
  28569. }
  28570. if (classes[className]) {
  28571. Manager.classCount--;
  28572. }
  28573. delete classes[className];
  28574. delete Manager.existCache[className];
  28575. delete Manager.classState[className];
  28576. Manager.removeName(className);
  28577. // Indiscriminately clear all factory caches here. It might be slightly inefficient
  28578. // however undefine is typically only called during unit testing.
  28579. Ext.Factory.clearCaches();
  28580. /* eslint-disable-next-line vars-on-top */
  28581. var entry = Manager.getNamespaceEntry(className),
  28582. scope = entry.parent ? Manager.lookupName(entry.parent, false) : Ext.global,
  28583. entryName;
  28584. if (scope) {
  28585. entryName = entry.name;
  28586. // Old IE blows up on attempt to delete window property
  28587. try {
  28588. delete scope[entryName];
  28589. } catch (e) {
  28590. scope[entryName] = undefined;
  28591. }
  28592. }
  28593. // We need to know entry name in unit tests
  28594. return entryName;
  28595. },
  28596. /**
  28597. * @method getClassName
  28598. * @inheritdoc Ext.ClassManager#method-getName
  28599. * @member Ext
  28600. */
  28601. getClassName: alias(Manager, 'getName'),
  28602. /**
  28603. * Returns the displayName property or className or object. When all else fails,
  28604. * returns "Anonymous".
  28605. * @param {Object} object
  28606. * @return {String}
  28607. */
  28608. getDisplayName: function(object) {
  28609. if (object) {
  28610. if (object.displayName) {
  28611. return object.displayName;
  28612. }
  28613. if (object.$name && object.$class) {
  28614. return Ext.getClassName(object.$class) + '#' + object.$name;
  28615. }
  28616. if (object.$className) {
  28617. return object.$className;
  28618. }
  28619. }
  28620. return 'Anonymous';
  28621. },
  28622. /**
  28623. * @method getClass
  28624. * @inheritdoc Ext.ClassManager#method-getClass
  28625. * @member Ext
  28626. */
  28627. getClass: alias(Manager, 'getClass'),
  28628. /**
  28629. * Creates namespaces to be used for scoping variables and classes so that they are not
  28630. * global. Specifying the last node of a namespace implicitly creates all other nodes.
  28631. * Usage:
  28632. *
  28633. * Ext.namespace('Company', 'Company.data');
  28634. *
  28635. * // equivalent and preferable to the above syntax
  28636. * Ext.ns('Company.data');
  28637. *
  28638. * Company.Widget = function() { ... };
  28639. *
  28640. * Company.data.CustomStore = function(config) { ... };
  28641. *
  28642. * @param {String...} namespaces
  28643. * @return {Object} The (last) namespace object created.
  28644. * @member Ext
  28645. * @method namespace
  28646. */
  28647. namespace: function() {
  28648. var root = global,
  28649. i;
  28650. for (i = arguments.length; i-- > 0; ) {
  28651. root = Manager.lookupName(arguments[i], true);
  28652. }
  28653. return root;
  28654. }
  28655. });
  28656. /**
  28657. * This function registers top-level (root) namespaces. This is needed for "sandbox"
  28658. * builds.
  28659. *
  28660. * Ext.addRootNamespaces({
  28661. * MyApp: MyApp,
  28662. * Common: Common
  28663. * });
  28664. *
  28665. * In the above example, `MyApp` and `Common` are top-level namespaces that happen
  28666. * to also be included in the sandbox closure. Something like this:
  28667. *
  28668. * (function(Ext) {
  28669. *
  28670. * Ext.sandboxName = 'Ext6';
  28671. * Ext.isSandboxed = true;
  28672. * Ext.buildSettings = { baseCSSPrefix: "x6-", scopeResetCSS: true };
  28673. *
  28674. * var MyApp = MyApp || {};
  28675. * Ext.addRootNamespaces({ MyApp: MyApp );
  28676. *
  28677. * ... normal app.js goes here ...
  28678. *
  28679. * })(this.Ext6 || (this.Ext6 = {}));
  28680. *
  28681. * The sandbox wrapper around the normally built `app.js` content has to take care
  28682. * of introducing top-level namespaces as well as call this method.
  28683. *
  28684. * @param {Object} namespaces
  28685. * @method addRootNamespaces
  28686. * @member Ext
  28687. * @since 6.0.0
  28688. * @private
  28689. */
  28690. Ext.addRootNamespaces = Manager.addRootNamespaces;
  28691. /**
  28692. * Old name for {@link Ext#widget}.
  28693. * @deprecated 5.0 Use {@link Ext#widget} instead.
  28694. * @method createWidget
  28695. * @member Ext
  28696. * @private
  28697. */
  28698. Ext.createWidget = Ext.widget;
  28699. /**
  28700. * @method ns
  28701. * Convenient alias for {@link Ext#namespace Ext.namespace}.
  28702. * @inheritdoc Ext#method-namespace
  28703. * @member Ext
  28704. */
  28705. Ext.ns = Ext.namespace;
  28706. Class.registerPreprocessor('className', function(cls, data) {
  28707. if ('$className' in data) {
  28708. cls.$className = data.$className;
  28709. cls.displayName = cls.$className;
  28710. }
  28711. if (Ext.classSystemMonitor) {
  28712. Ext.classSystemMonitor(cls, 'Ext.ClassManager#classNamePreprocessor', arguments);
  28713. }
  28714. }, true, 'first');
  28715. Class.registerPreprocessor('alias', function(cls, data) {
  28716. if (Ext.classSystemMonitor) {
  28717. Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor', arguments);
  28718. }
  28719. /* eslint-disable-next-line vars-on-top */
  28720. var prototype = cls.prototype,
  28721. xtypes = arrayFrom(data.xtype),
  28722. aliases = arrayFrom(data.alias),
  28723. widgetPrefix = 'widget.',
  28724. widgetPrefixLength = widgetPrefix.length,
  28725. xtypesChain = Array.prototype.slice.call(prototype.xtypesChain || []),
  28726. xtypesMap = Ext.merge({}, prototype.xtypesMap || {}),
  28727. i, ln, alias, xtype;
  28728. for (i = 0 , ln = aliases.length; i < ln; i++) {
  28729. alias = aliases[i];
  28730. if (typeof alias !== 'string' || alias.length < 1) {
  28731. throw new Error("[Ext.define] Invalid alias of: '" + alias + "' for class: '" + name + "'; must be a valid string");
  28732. }
  28733. if (alias.substring(0, widgetPrefixLength) === widgetPrefix) {
  28734. xtype = alias.substring(widgetPrefixLength);
  28735. Ext.Array.include(xtypes, xtype);
  28736. }
  28737. }
  28738. cls.xtype = data.xtype = xtypes[0];
  28739. data.xtypes = xtypes;
  28740. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  28741. xtype = xtypes[i];
  28742. if (!xtypesMap[xtype]) {
  28743. xtypesMap[xtype] = true;
  28744. xtypesChain.push(xtype);
  28745. }
  28746. }
  28747. data.xtypesChain = xtypesChain;
  28748. data.xtypesMap = xtypesMap;
  28749. // Class is already extended at this point
  28750. Ext.Function.interceptAfterOnce(cls, 'onClassCreated', function() {
  28751. var cls = this,
  28752. prototype = cls.prototype,
  28753. mixins = prototype.mixins,
  28754. key, mixin;
  28755. if (Ext.classSystemMonitor) {
  28756. Ext.classSystemMonitor(cls, 'Ext.ClassManager#aliasPreprocessor#afterClassCreated', arguments);
  28757. }
  28758. for (key in mixins) {
  28759. if (mixins.hasOwnProperty(key)) {
  28760. mixin = mixins[key];
  28761. xtypes = mixin.xtypes;
  28762. if (xtypes) {
  28763. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  28764. xtype = xtypes[i];
  28765. if (!xtypesMap[xtype]) {
  28766. xtypesMap[xtype] = true;
  28767. xtypesChain.push(xtype);
  28768. }
  28769. }
  28770. }
  28771. }
  28772. }
  28773. });
  28774. for (i = 0 , ln = xtypes.length; i < ln; i++) {
  28775. xtype = xtypes[i];
  28776. if (typeof xtype !== 'string' || xtype.length < 1) {
  28777. throw new Error("[Ext.define] Invalid xtype of: '" + xtype + "' for class: '" + name + "'; must be a valid non-empty string");
  28778. }
  28779. Ext.Array.include(aliases, widgetPrefix + xtype);
  28780. }
  28781. data.alias = aliases;
  28782. }, [
  28783. 'xtype',
  28784. 'alias'
  28785. ]);
  28786. // load the cmd-5 style app manifest metadata now, if available...
  28787. if (Ext.manifest) {
  28788. /* eslint-disable-next-line vars-on-top */
  28789. var manifest = Ext.manifest,
  28790. classes = manifest.classes,
  28791. paths = manifest.paths,
  28792. aliases = {},
  28793. alternates = {},
  28794. className, obj, name, path, baseUrl;
  28795. if (paths) {
  28796. // if the manifest paths were calculated as relative to the
  28797. // bootstrap file, then we need to prepend Boot.baseUrl to the
  28798. // paths before processing
  28799. if (manifest.bootRelative) {
  28800. baseUrl = Ext.Boot.baseUrl;
  28801. for (path in paths) {
  28802. if (paths.hasOwnProperty(path)) {
  28803. paths[path] = baseUrl + paths[path];
  28804. }
  28805. }
  28806. }
  28807. Manager.setPath(paths);
  28808. }
  28809. if (classes) {
  28810. for (className in classes) {
  28811. alternates[className] = [];
  28812. aliases[className] = [];
  28813. obj = classes[className];
  28814. if (obj.alias) {
  28815. aliases[className] = obj.alias;
  28816. }
  28817. if (obj.alternates) {
  28818. alternates[className] = obj.alternates;
  28819. }
  28820. }
  28821. }
  28822. Manager.addAlias(aliases);
  28823. Manager.addAlternate(alternates);
  28824. }
  28825. return Manager;
  28826. }(Ext.Class, Ext.Function.alias, Array.prototype.slice, Ext.Array.from, Ext.global));
  28827. // @tag class
  28828. /**
  28829. *
  28830. * @since 6.7.0
  28831. * @private
  28832. */
  28833. Ext.define('Ext.mixin.Watchable', {
  28834. on: function(name, fn, scope) {
  28835. return this._watchUpdate(false, '_watchAdd', name, fn, scope);
  28836. },
  28837. fire: function(event, args) {
  28838. var me = this,
  28839. watching = me.watching,
  28840. watchers = watching && watching[event],
  28841. fn, i, r, scope;
  28842. if (watchers) {
  28843. ++watchers.$firing;
  28844. for (i = 0; i < watchers.length; ++i) {
  28845. scope = watchers[i][0];
  28846. fn = watchers[i][1];
  28847. if (fn.charAt) {
  28848. r = args ? scope[fn].apply(scope, args) : scope[fn]();
  28849. } else {
  28850. r = args ? fn.apply(scope, args) : fn.call(scope);
  28851. }
  28852. if (r === false) {
  28853. return r;
  28854. }
  28855. }
  28856. --watchers.$firing;
  28857. }
  28858. },
  28859. fireEvent: function() {
  28860. var args = Ext.Array.slice(arguments),
  28861. event = args.shift();
  28862. return this.fire(event, args);
  28863. },
  28864. un: function(name, fn, scope) {
  28865. return this._watchUpdate(true, '_watchRemove', name, fn, scope);
  28866. },
  28867. privates: {
  28868. watching: null,
  28869. $watchOptions: {
  28870. destroyable: 1,
  28871. scope: 1
  28872. },
  28873. _watchAdd: function(watching, name, fn, scope, destroyable) {
  28874. if (typeof fn === 'string' && !scope[fn]) {
  28875. Ext.raise('No such method "' + fn + '" on ' + scope.$className);
  28876. }
  28877. // eslint-disable-next-line vars-on-top
  28878. var watchers = watching[name],
  28879. entry = [
  28880. scope,
  28881. fn
  28882. ],
  28883. i, ent;
  28884. if (!watchers) {
  28885. watching[name] = watchers = [];
  28886. watchers.$firing = 0;
  28887. } else {
  28888. // If the scope/fn pair is already registered, don't duplicate it.
  28889. for (i = watchers.length; i-- > 0; ) /* empty */
  28890. {
  28891. ent = watchers[i];
  28892. if (fn === ent[1]) {
  28893. if (scope ? ent[0] === scope : !ent[0]) {
  28894. return;
  28895. }
  28896. }
  28897. }
  28898. if (watchers.$firing) {
  28899. watching[name] = watchers = watchers.slice();
  28900. watchers.$firing = 0;
  28901. }
  28902. }
  28903. watchers.push(entry);
  28904. if (destroyable) {
  28905. entry.push(name);
  28906. destroyable.items.push(entry);
  28907. }
  28908. },
  28909. _watchRemove: function(watching, name, fn, scope) {
  28910. var watchers = watching[name],
  28911. i;
  28912. if (watchers) {
  28913. if (watchers.$firing) {
  28914. watching[name] = watchers = watchers.slice();
  28915. watchers.$firing = 0;
  28916. }
  28917. for (i = watchers.length; i-- > 0; ) /* empty */
  28918. {
  28919. if (watchers[i][0] === scope && watchers[i][1] === fn) {
  28920. watchers.splice(i, 1);
  28921. }
  28922. }
  28923. }
  28924. },
  28925. _watchUpdate: function(remove, process, name, fn, scope) {
  28926. var me = this,
  28927. watch = name,
  28928. watching = me.watching,
  28929. destroyable;
  28930. if (!watching) {
  28931. if (remove) {
  28932. return;
  28933. }
  28934. me.watching = watching = {};
  28935. }
  28936. if (typeof name === 'string') {
  28937. me[process](watching, name, fn, scope);
  28938. } else {
  28939. destroyable = watch.destroyable ? {
  28940. owner: me,
  28941. items: [],
  28942. destroy: me._watcherDestroyer
  28943. } : null;
  28944. scope = watch.scope;
  28945. for (name in watch) {
  28946. if (!me.$watchOptions[name]) {
  28947. me[process](watching, name, watch[name], scope, destroyable);
  28948. }
  28949. }
  28950. }
  28951. return destroyable;
  28952. },
  28953. _watcherDestroyer: function() {
  28954. var me = this.owner,
  28955. watching = me.watching,
  28956. items = this.items,
  28957. entry, i;
  28958. for (i = 0; i < items.length; ++i) {
  28959. entry = items[i];
  28960. me._watchRemove(watching, entry[2], entry[1], entry[0]);
  28961. }
  28962. }
  28963. }
  28964. });
  28965. /**
  28966. * @class Ext.env.Browser
  28967. * Provides information about browser.
  28968. *
  28969. * Should not be manually instantiated unless for unit-testing.
  28970. * Access the global instance stored in {@link Ext.browser} instead.
  28971. * @private
  28972. */
  28973. (Ext.env || (Ext.env = {})).Browser = function(userAgent, publish) {
  28974. // @define Ext.env.Browser
  28975. // @define Ext.browser
  28976. // @require Ext.Object
  28977. // @require Ext.Version
  28978. var me = this,
  28979. browserPrefixes = Ext.Boot.browserPrefixes,
  28980. browserNames = Ext.Boot.browserNames,
  28981. enginePrefixes = me.enginePrefixes,
  28982. engineNames = me.engineNames,
  28983. browserMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(browserPrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28984. engineMatch = userAgent.match(new RegExp('((?:' + Ext.Object.getValues(enginePrefixes).join(')|(?:') + '))([\\w\\._]+)')),
  28985. browserName = browserNames.other,
  28986. engineName = engineNames.other,
  28987. browserVersion = '',
  28988. engineVersion = '',
  28989. majorVer = '',
  28990. isWebView = false,
  28991. edgeRE = /(Edge\/)([\w.]+)/,
  28992. ripple = '',
  28993. i, prefix, name;
  28994. /**
  28995. * @property {String}
  28996. * Browser User Agent string.
  28997. */
  28998. me.userAgent = userAgent;
  28999. /**
  29000. * A "hybrid" property, can be either accessed as a method call, for example:
  29001. *
  29002. * if (Ext.browser.is('IE')) {
  29003. * // ...
  29004. * }
  29005. *
  29006. * Or as an object with Boolean properties, for example:
  29007. *
  29008. * if (Ext.browser.is.IE) {
  29009. * // ...
  29010. * }
  29011. *
  29012. * Versions can be conveniently checked as well. For example:
  29013. *
  29014. * if (Ext.browser.is.IE10) {
  29015. * // Equivalent to (Ext.browser.is.IE && Ext.browser.version.equals(10))
  29016. * }
  29017. *
  29018. * __Note:__ Only {@link Ext.Version#getMajor major component} and
  29019. * {@link Ext.Version#getShortVersion simplified} value of the version are available via
  29020. * direct property checking.
  29021. *
  29022. * Supported values are:
  29023. *
  29024. * - IE
  29025. * - Firefox
  29026. * - Safari
  29027. * - Chrome
  29028. * - Opera
  29029. * - WebKit
  29030. * - Gecko
  29031. * - Presto
  29032. * - Trident
  29033. * - WebView
  29034. * - Other
  29035. *
  29036. * @param {String} name The OS name to check.
  29037. * @return {Boolean}
  29038. */
  29039. this.is = function(name) {
  29040. // Since this function reference also acts as a map, we do not want it to be
  29041. // shared between instances, so it is defined here, not on the prototype.
  29042. return !!this.is[name];
  29043. };
  29044. // Edge has a userAgent with All browsers so we manage it separately
  29045. // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
  29046. // Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240"
  29047. if (/Edge\//.test(userAgent)) {
  29048. browserMatch = userAgent.match(edgeRE);
  29049. engineMatch = userAgent.match(edgeRE);
  29050. }
  29051. if (browserMatch) {
  29052. browserName = browserNames[Ext.Object.getKey(browserPrefixes, browserMatch[1])];
  29053. if (browserName === 'Safari' && /^Opera/.test(userAgent)) {
  29054. // Prevent Opera 12 and earlier from being incorrectly reported as Safari
  29055. browserName = 'Opera';
  29056. }
  29057. browserVersion = new Ext.Version(browserMatch[2]);
  29058. }
  29059. if (engineMatch) {
  29060. engineName = engineNames[Ext.Object.getKey(enginePrefixes, engineMatch[1])];
  29061. engineVersion = new Ext.Version(engineMatch[2]);
  29062. }
  29063. if (engineName === 'Trident' && browserName !== 'IE') {
  29064. browserName = 'IE';
  29065. var version = userAgent.match(/.*rv:(\d+.\d+)/);
  29066. // eslint-disable-line vars-on-top
  29067. if (version && version.length) {
  29068. version = version[1];
  29069. browserVersion = new Ext.Version(version);
  29070. }
  29071. }
  29072. if (browserName && browserVersion) {
  29073. Ext.setVersion(browserName, browserVersion);
  29074. }
  29075. /**
  29076. * @property chromeVersion
  29077. * The current version of Chrome (0 if the browser is not Chrome).
  29078. * @readonly
  29079. * @type Number
  29080. * @member Ext
  29081. */
  29082. /**
  29083. * @property firefoxVersion
  29084. * The current version of Firefox (0 if the browser is not Firefox).
  29085. * @readonly
  29086. * @type Number
  29087. * @member Ext
  29088. */
  29089. /**
  29090. * @property ieVersion
  29091. * The current version of IE (0 if the browser is not IE). This does not account
  29092. * for the documentMode of the current page, which is factored into {@link #isIE8},
  29093. * and {@link #isIE9}. Thus this is not always true:
  29094. *
  29095. * Ext.isIE8 == (Ext.ieVersion == 8)
  29096. *
  29097. * @readonly
  29098. * @type Number
  29099. * @member Ext
  29100. */
  29101. /**
  29102. * @property isChrome
  29103. * True if the detected browser is Chrome.
  29104. * @readonly
  29105. * @type Boolean
  29106. * @member Ext
  29107. */
  29108. /**
  29109. * @property isGecko
  29110. * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
  29111. * @readonly
  29112. * @type Boolean
  29113. * @member Ext
  29114. */
  29115. /**
  29116. * @property isIE
  29117. * True if the detected browser is Internet Explorer.
  29118. * @readonly
  29119. * @type Boolean
  29120. * @member Ext
  29121. */
  29122. /**
  29123. * @property isIE8
  29124. * True if the detected browser is Internet Explorer 8.x.
  29125. * @readonly
  29126. * @type Boolean
  29127. * @member Ext
  29128. */
  29129. /**
  29130. * @property isIE8m
  29131. * True if the detected browser is Internet Explorer 8.x or lower.
  29132. * @readonly
  29133. * @type Boolean
  29134. * @member Ext
  29135. */
  29136. /**
  29137. * @property isIE8p
  29138. * True if the detected browser is Internet Explorer 8.x or higher.
  29139. * @readonly
  29140. * @type Boolean
  29141. * @member Ext
  29142. */
  29143. /**
  29144. * @property isIE9
  29145. * True if the detected browser is Internet Explorer 9.x.
  29146. * @readonly
  29147. * @type Boolean
  29148. * @member Ext
  29149. */
  29150. /**
  29151. * @property isIE9m
  29152. * True if the detected browser is Internet Explorer 9.x or lower.
  29153. * @readonly
  29154. * @type Boolean
  29155. * @member Ext
  29156. */
  29157. /**
  29158. * @property isIE9p
  29159. * True if the detected browser is Internet Explorer 9.x or higher.
  29160. * @readonly
  29161. * @type Boolean
  29162. * @member Ext
  29163. */
  29164. /**
  29165. * @property isIE10
  29166. * True if the detected browser is Internet Explorer 10.x.
  29167. * @readonly
  29168. * @type Boolean
  29169. * @member Ext
  29170. */
  29171. /**
  29172. * @property isIE10m
  29173. * True if the detected browser is Internet Explorer 10.x or lower.
  29174. * @readonly
  29175. * @type Boolean
  29176. * @member Ext
  29177. */
  29178. /**
  29179. * @property isIE10p
  29180. * True if the detected browser is Internet Explorer 10.x or higher.
  29181. * @readonly
  29182. * @type Boolean
  29183. * @member Ext
  29184. */
  29185. /**
  29186. * @property isIE11
  29187. * True if the detected browser is Internet Explorer 11.x.
  29188. * @readonly
  29189. * @type Boolean
  29190. * @member Ext
  29191. */
  29192. /**
  29193. * @property isIE11m
  29194. * True if the detected browser is Internet Explorer 11.x or lower.
  29195. * @readonly
  29196. * @type Boolean
  29197. * @member Ext
  29198. */
  29199. /**
  29200. * @property isIE11p
  29201. * True if the detected browser is Internet Explorer 11.x or higher.
  29202. * @readonly
  29203. * @type Boolean
  29204. * @member Ext
  29205. */
  29206. /**
  29207. * @property isEdge
  29208. * True if the detected browser is Edge.
  29209. * @readonly
  29210. * @type Boolean
  29211. * @member Ext
  29212. */
  29213. /**
  29214. * @property isLinux
  29215. * True if the detected platform is Linux.
  29216. * @readonly
  29217. * @type Boolean
  29218. * @member Ext
  29219. */
  29220. /**
  29221. * @property isMac
  29222. * True if the detected platform is Mac OS.
  29223. * @readonly
  29224. * @type Boolean
  29225. * @member Ext
  29226. */
  29227. /**
  29228. * @property isOpera
  29229. * True if the detected browser is Opera.
  29230. * @readonly
  29231. * @type Boolean
  29232. * @member Ext
  29233. */
  29234. /**
  29235. * @property isSafari
  29236. * True if the detected browser is Safari.
  29237. * @readonly
  29238. * @type Boolean
  29239. * @member Ext
  29240. */
  29241. /**
  29242. * @property isWebKit
  29243. * True if the detected browser uses WebKit.
  29244. * @readonly
  29245. * @type Boolean
  29246. * @member Ext
  29247. */
  29248. /**
  29249. * @property isWindows
  29250. * True if the detected platform is Windows.
  29251. * @readonly
  29252. * @type Boolean
  29253. * @member Ext
  29254. */
  29255. /**
  29256. * @property operaVersion
  29257. * The current version of Opera (0 if the browser is not Opera).
  29258. * @readonly
  29259. * @type Number
  29260. * @member Ext
  29261. */
  29262. /**
  29263. * @property safariVersion
  29264. * The current version of Safari (0 if the browser is not Safari).
  29265. * @readonly
  29266. * @type Number
  29267. * @member Ext
  29268. */
  29269. /**
  29270. * @property webKitVersion
  29271. * The current version of WebKit (0 if the browser does not use WebKit).
  29272. * @readonly
  29273. * @type Number
  29274. * @member Ext
  29275. */
  29276. // Facebook changes the userAgent when you view a website within their iOS app.
  29277. // For some reason, the strip out information about the browser, so we have to detect
  29278. // that and fake it...
  29279. if (userAgent.match(/FB/) && browserName === 'Other') {
  29280. browserName = browserNames.safari;
  29281. engineName = engineNames.webkit;
  29282. }
  29283. // Detect chrome first as Chrome in Android 8.0 introduced OPR in the user agent
  29284. else if (userAgent.match(/Android.*Chrome/g)) {
  29285. browserName = 'ChromeMobile';
  29286. } else {
  29287. browserMatch = userAgent.match(/OPR\/(\d+.\d+)/);
  29288. if (browserMatch) {
  29289. browserName = 'Opera';
  29290. browserVersion = new Ext.Version(browserMatch[1]);
  29291. }
  29292. }
  29293. Ext.apply(this, {
  29294. engineName: engineName,
  29295. engineVersion: engineVersion,
  29296. name: browserName,
  29297. version: browserVersion
  29298. });
  29299. this.setFlag(browserName, true, publish);
  29300. // e.g., Ext.isIE
  29301. if (browserVersion) {
  29302. majorVer = browserVersion.getMajor() || '';
  29303. if (me.is.IE) {
  29304. majorVer = document.documentMode || parseInt(majorVer, 10);
  29305. for (i = 7; i <= 11; ++i) {
  29306. prefix = 'isIE' + i;
  29307. Ext[prefix] = majorVer === i;
  29308. Ext[prefix + 'm'] = majorVer <= i;
  29309. Ext[prefix + 'p'] = majorVer >= i;
  29310. }
  29311. }
  29312. if (me.is.Opera && parseInt(majorVer, 10) <= 12) {
  29313. Ext.isOpera12m = true;
  29314. }
  29315. Ext.chromeVersion = Ext.isChrome ? majorVer : 0;
  29316. Ext.firefoxVersion = Ext.isFirefox ? majorVer : 0;
  29317. Ext.ieVersion = Ext.isIE ? majorVer : 0;
  29318. Ext.operaVersion = Ext.isOpera ? majorVer : 0;
  29319. Ext.safariVersion = Ext.isSafari ? majorVer : 0;
  29320. Ext.webKitVersion = Ext.isWebKit ? majorVer : 0;
  29321. this.setFlag(browserName + majorVer, true, publish);
  29322. // Ext.isIE10
  29323. this.setFlag(browserName + browserVersion.getShortVersion());
  29324. }
  29325. for (i in browserNames) {
  29326. if (browserNames.hasOwnProperty(i)) {
  29327. name = browserNames[i];
  29328. this.setFlag(name, browserName === name);
  29329. }
  29330. }
  29331. this.setFlag(name);
  29332. if (engineVersion) {
  29333. this.setFlag(engineName + (engineVersion.getMajor() || ''));
  29334. this.setFlag(engineName + engineVersion.getShortVersion());
  29335. }
  29336. for (i in engineNames) {
  29337. if (engineNames.hasOwnProperty(i)) {
  29338. name = engineNames[i];
  29339. this.setFlag(name, engineName === name, publish);
  29340. }
  29341. }
  29342. this.setFlag('Standalone', !!navigator.standalone);
  29343. // Cross domain access could throw an error
  29344. try {
  29345. ripple = window.top.ripple;
  29346. } catch (e) {}
  29347. // Do nothing, can't access cross frame so leave it empty
  29348. /* eslint-disable-next-line max-len */
  29349. this.setFlag('Ripple', !!document.getElementById("tinyhippos-injected") && !Ext.isEmpty(ripple));
  29350. this.setFlag('WebWorks', !!window.blackberry);
  29351. if (window.PhoneGap !== undefined || window.Cordova !== undefined || window.cordova !== undefined) {
  29352. isWebView = true;
  29353. this.setFlag('PhoneGap');
  29354. this.setFlag('Cordova');
  29355. }
  29356. // Check if running in UIWebView
  29357. if (/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)(?!.*FBAN)/i.test(userAgent)) {
  29358. isWebView = true;
  29359. }
  29360. // Flag to check if it we are in the WebView
  29361. this.setFlag('WebView', isWebView);
  29362. /**
  29363. * @property {Boolean}
  29364. * `true` if browser is using strict mode.
  29365. */
  29366. this.isStrict = Ext.isStrict = document.compatMode === "CSS1Compat";
  29367. /**
  29368. * @property {Boolean}
  29369. * `true` if page is running over SSL.
  29370. */
  29371. this.isSecure = Ext.isSecure;
  29372. // IE10Quirks, Chrome26Strict, etc.
  29373. this.identity = browserName + majorVer + (this.isStrict ? 'Strict' : 'Quirks');
  29374. };
  29375. Ext.env.Browser.prototype = {
  29376. constructor: Ext.env.Browser,
  29377. engineNames: {
  29378. edge: 'Edge',
  29379. webkit: 'WebKit',
  29380. gecko: 'Gecko',
  29381. presto: 'Presto',
  29382. trident: 'Trident',
  29383. other: 'Other'
  29384. },
  29385. enginePrefixes: {
  29386. edge: 'Edge/',
  29387. webkit: 'AppleWebKit/',
  29388. gecko: 'Gecko/',
  29389. presto: 'Presto/',
  29390. trident: 'Trident/'
  29391. },
  29392. styleDashPrefixes: {
  29393. WebKit: '-webkit-',
  29394. Gecko: '-moz-',
  29395. Trident: '-ms-',
  29396. Presto: '-o-',
  29397. Other: ''
  29398. },
  29399. stylePrefixes: {
  29400. WebKit: 'Webkit',
  29401. Gecko: 'Moz',
  29402. Trident: 'ms',
  29403. Presto: 'O',
  29404. Other: ''
  29405. },
  29406. propertyPrefixes: {
  29407. WebKit: 'webkit',
  29408. Gecko: 'moz',
  29409. Trident: 'ms',
  29410. Presto: 'o',
  29411. Other: ''
  29412. },
  29413. // scope: Ext.env.Browser.prototype
  29414. /**
  29415. * The full name of the current browser.
  29416. * Possible values are:
  29417. *
  29418. * - IE
  29419. * - Firefox
  29420. * - Safari
  29421. * - Chrome
  29422. * - Opera
  29423. * - Other
  29424. * @type String
  29425. * @readonly
  29426. */
  29427. name: null,
  29428. /**
  29429. * Refer to {@link Ext.Version}.
  29430. * @type Ext.Version
  29431. * @readonly
  29432. */
  29433. version: null,
  29434. /**
  29435. * The full name of the current browser's engine.
  29436. * Possible values are:
  29437. *
  29438. * - WebKit
  29439. * - Gecko
  29440. * - Presto
  29441. * - Trident
  29442. * - Other
  29443. * @type String
  29444. * @readonly
  29445. */
  29446. engineName: null,
  29447. /**
  29448. * Refer to {@link Ext.Version}.
  29449. * @type Ext.Version
  29450. * @readonly
  29451. */
  29452. engineVersion: null,
  29453. setFlag: function(name, value, publish) {
  29454. if (value === undefined) {
  29455. value = true;
  29456. }
  29457. this.is[name] = value;
  29458. this.is[name.toLowerCase()] = value;
  29459. if (publish) {
  29460. Ext['is' + name] = value;
  29461. }
  29462. return this;
  29463. },
  29464. getStyleDashPrefix: function() {
  29465. return this.styleDashPrefixes[this.engineName];
  29466. },
  29467. getStylePrefix: function() {
  29468. return this.stylePrefixes[this.engineName];
  29469. },
  29470. getVendorProperyName: function(name) {
  29471. var prefix = this.propertyPrefixes[this.engineName];
  29472. if (prefix.length > 0) {
  29473. return prefix + Ext.String.capitalize(name);
  29474. }
  29475. return name;
  29476. }
  29477. };
  29478. /**
  29479. * @class Ext.browser
  29480. * @extends Ext.env.Browser
  29481. * @singleton
  29482. * Provides useful information about the current browser.
  29483. *
  29484. * Example:
  29485. *
  29486. * if (Ext.browser.is.IE) {
  29487. * // IE specific code here
  29488. * }
  29489. *
  29490. * if (Ext.browser.is.WebKit) {
  29491. * // WebKit specific code here
  29492. * }
  29493. *
  29494. * console.log("Version " + Ext.browser.version);
  29495. *
  29496. * For a full list of supported values, refer to {@link #is} property/method.
  29497. *
  29498. */
  29499. (function(userAgent) {
  29500. Ext.browser = new Ext.env.Browser(userAgent, true);
  29501. Ext.userAgent = userAgent.toLowerCase();
  29502. /**
  29503. * @property {String} SSL_SECURE_URL
  29504. * URL to a blank file used by Ext when in secure mode for iframe src and onReady src
  29505. * to prevent the IE insecure content warning (`'about:blank'`, except for IE
  29506. * in secure mode, which is `'javascript:""'`).
  29507. * @member Ext
  29508. */
  29509. Ext.SSL_SECURE_URL = Ext.isSecure && Ext.isIE ? 'javascript:\'\'' : 'about:blank';
  29510. }(Ext.global.navigator.userAgent));
  29511. /**
  29512. * @class Ext.env.OS
  29513. *
  29514. * Provides information about operating system environment.
  29515. *
  29516. * Should not be manually instantiated unless for unit-testing.
  29517. * Access the global instance stored in {@link Ext.os} instead.
  29518. * @private
  29519. */
  29520. Ext.env.OS = function(userAgent, platform, browserScope) {
  29521. // @define Ext.env.OS
  29522. // @define Ext.os
  29523. // @require Ext.Version
  29524. // @require Ext.env.Browser
  29525. var me = this,
  29526. names = Ext.Boot.osNames,
  29527. prefixes = Ext.Boot.osPrefixes,
  29528. name,
  29529. version = '',
  29530. is = me.is,
  29531. i, prefix, match, item, match1;
  29532. browserScope = browserScope || Ext.browser;
  29533. for (i in prefixes) {
  29534. if (prefixes.hasOwnProperty(i)) {
  29535. prefix = prefixes[i];
  29536. match = userAgent.match(new RegExp('(?:' + prefix + ')([^\\s;]+)'));
  29537. if (match) {
  29538. name = names[i];
  29539. match1 = match[1];
  29540. // This is here because some HTC android devices show an OSX Snow Leopard
  29541. // userAgent by default.
  29542. // And the Kindle Fire doesn't have any indicator of Android as the OS in its
  29543. // User Agent
  29544. if (match1 && match1 === "HTC_") {
  29545. version = new Ext.Version("2.3");
  29546. } else if (match1 && match1 === "Silk/") {
  29547. version = new Ext.Version("2.3");
  29548. } else {
  29549. version = new Ext.Version(match[match.length - 1]);
  29550. }
  29551. break;
  29552. }
  29553. }
  29554. }
  29555. if (!name) {
  29556. name = names[(userAgent.toLowerCase().match(/mac|win|linux/) || [
  29557. 'other'
  29558. ])[0]];
  29559. version = new Ext.Version('');
  29560. }
  29561. this.name = name;
  29562. this.version = version;
  29563. // This is added as a workaround for Chrome iPad emulation mode
  29564. // it will report the platform of the machine (MacIntel, Win32, etc) instead
  29565. // of an emulated platform
  29566. if (userAgent.match(/ipad/i)) {
  29567. platform = 'iPad';
  29568. }
  29569. if (platform) {
  29570. this.setFlag(platform.replace(/ simulator$/i, ''));
  29571. }
  29572. this.setFlag(name);
  29573. if (version) {
  29574. this.setFlag(name + (version.getMajor() || ''));
  29575. this.setFlag(name + version.getShortVersion());
  29576. }
  29577. for (i in names) {
  29578. if (names.hasOwnProperty(i)) {
  29579. item = names[i];
  29580. if (!is.hasOwnProperty(name)) {
  29581. this.setFlag(item, (name === item));
  29582. }
  29583. }
  29584. }
  29585. // Detect if the device is the iPhone 5.
  29586. if (this.name === "iOS" && window.screen.height === 568) {
  29587. this.setFlag('iPhone5');
  29588. }
  29589. if (browserScope.is.Safari || browserScope.is.Silk) {
  29590. // Ext.browser.version.shortVersion == 501 is for debugging off device
  29591. if (this.is.Android2 || this.is.Android3 || browserScope.version.shortVersion === 501) {
  29592. browserScope.setFlag("AndroidStock");
  29593. }
  29594. if (this.is.Android4) {
  29595. browserScope.setFlag("AndroidStock");
  29596. browserScope.setFlag("AndroidStock4");
  29597. }
  29598. }
  29599. };
  29600. Ext.env.OS.prototype = {
  29601. constructor: Ext.env.OS,
  29602. /**
  29603. * A "hybrid" property, can be either accessed as a method call, i.e:
  29604. *
  29605. * if (Ext.os.is('Android')) {
  29606. * // ...
  29607. * }
  29608. *
  29609. * or as an object with boolean properties, i.e:
  29610. *
  29611. * if (Ext.os.is.Android) {
  29612. * // ...
  29613. * }
  29614. *
  29615. * Versions can be conveniently checked as well. For example:
  29616. *
  29617. * if (Ext.os.is.Android2) {
  29618. * // Equivalent to (Ext.os.is.Android && Ext.os.version.equals(2))
  29619. * }
  29620. *
  29621. * if (Ext.os.is.iOS32) {
  29622. * // Equivalent to (Ext.os.is.iOS && Ext.os.version.equals(3.2))
  29623. * }
  29624. *
  29625. * Note that only {@link Ext.Version#getMajor major component} and
  29626. * {@link Ext.Version#getShortVersion simplified} value of the version are available
  29627. * via direct property checking. Supported values are:
  29628. *
  29629. * - iOS
  29630. * - iPad
  29631. * - iPhone
  29632. * - iPhone5 (also true for 4in iPods).
  29633. * - iPod
  29634. * - Android
  29635. * - WebOS
  29636. * - BlackBerry
  29637. * - Bada
  29638. * - MacOS
  29639. * - Windows
  29640. * - Linux
  29641. * - Other
  29642. * @member Ext.os
  29643. * @param {String} name The OS name to check.
  29644. * @return {Boolean}
  29645. */
  29646. is: function(name) {
  29647. return !!this[name];
  29648. },
  29649. /**
  29650. * @property {String} [name=null]
  29651. * @readonly
  29652. * @member Ext.os
  29653. * The full name of the current operating system. Possible values are:
  29654. *
  29655. * - iOS
  29656. * - Android
  29657. * - WebOS
  29658. * - BlackBerry,
  29659. * - MacOS
  29660. * - Windows
  29661. * - Linux
  29662. * - Other
  29663. */
  29664. name: null,
  29665. /**
  29666. * @property {Ext.Version} [version=null]
  29667. * Refer to {@link Ext.Version}
  29668. * @member Ext.os
  29669. * @readonly
  29670. */
  29671. version: null,
  29672. setFlag: function(name, value) {
  29673. if (value === undefined) {
  29674. value = true;
  29675. }
  29676. if (this.flags) {
  29677. this.flags[name] = value;
  29678. }
  29679. this.is[name] = value;
  29680. this.is[name.toLowerCase()] = value;
  29681. return this;
  29682. }
  29683. };
  29684. (function() {
  29685. var navigation = Ext.global.navigator,
  29686. userAgent = navigation.userAgent,
  29687. OS = Ext.env.OS,
  29688. is = (Ext.is || (Ext.is = {})),
  29689. osEnv, osName, deviceType;
  29690. OS.prototype.flags = is;
  29691. /**
  29692. * @class Ext.os
  29693. * @extends Ext.env.OS
  29694. * @singleton
  29695. * Provides useful information about the current operating system environment.
  29696. *
  29697. * Example:
  29698. *
  29699. * if (Ext.os.is.Windows) {
  29700. * // Windows specific code here
  29701. * }
  29702. *
  29703. * if (Ext.os.is.iOS) {
  29704. * // iPad, iPod, iPhone, etc.
  29705. * }
  29706. *
  29707. * console.log("Version " + Ext.os.version);
  29708. *
  29709. * For a full list of supported values, refer to the {@link #is} property/method.
  29710. *
  29711. */
  29712. Ext.os = osEnv = new OS(userAgent, navigation.platform);
  29713. osName = osEnv.name;
  29714. // A couple compatible flavors:
  29715. Ext['is' + osName] = true;
  29716. // e.g., Ext.isWindows
  29717. Ext.isMac = is.Mac = is.MacOS;
  29718. Ext.isApple = Ext.isMac || Ext.isiOS;
  29719. // eslint-disable-next-line vars-on-top
  29720. var search = window.location.search.match(/deviceType=(Tablet|Phone)/),
  29721. nativeDeviceType = window.deviceType;
  29722. // Override deviceType by adding a get variable of deviceType. NEEDED FOR DOCS APP.
  29723. // E.g: example/kitchen-sink.html?deviceType=Phone
  29724. if (search && search[1]) {
  29725. deviceType = search[1];
  29726. } else if (nativeDeviceType === 'iPhone') {
  29727. deviceType = 'Phone';
  29728. } else if (nativeDeviceType === 'iPad') {
  29729. deviceType = 'Tablet';
  29730. } else {
  29731. if (!osEnv.is.Android && !osEnv.is.iOS && !osEnv.is.WindowsPhone && /Windows|Linux|MacOS|ChromeOS/.test(osName)) {
  29732. deviceType = 'Desktop';
  29733. // always set it to false when you are on a desktop not using Ripple Emulation
  29734. Ext.browser.is.WebView = !!Ext.browser.is.Ripple;
  29735. } else if (osEnv.is.iPad || osEnv.is.RIMTablet || osEnv.is.Android3 || Ext.browser.is.Silk || (osEnv.is.Android && userAgent.search(/mobile/i) === -1)) {
  29736. deviceType = 'Tablet';
  29737. } else {
  29738. deviceType = 'Phone';
  29739. }
  29740. }
  29741. /**
  29742. * @property {String} deviceType
  29743. * The generic type of the current device.
  29744. *
  29745. * Possible values:
  29746. *
  29747. * - Phone
  29748. * - Tablet
  29749. * - Desktop
  29750. *
  29751. * For testing purposes the deviceType can be overridden by adding
  29752. * a deviceType parameter to the URL of the page, like so:
  29753. *
  29754. * http://localhost/mypage.html?deviceType=Tablet
  29755. *
  29756. * @member Ext.os
  29757. */
  29758. osEnv.setFlag(deviceType, true);
  29759. osEnv.deviceType = deviceType;
  29760. delete OS.prototype.flags;
  29761. }());
  29762. /**
  29763. * @class Ext.feature
  29764. * @singleton
  29765. *
  29766. * A simple class to verify if a browser feature exists or not on the current device.
  29767. *
  29768. * if (Ext.feature.has.Canvas) {
  29769. * // do some cool things with canvas here
  29770. * }
  29771. *
  29772. * See the {@link #has} property/method for details of the features that can be detected.
  29773. *
  29774. */
  29775. /* eslint-disable vars-on-top */
  29776. Ext.feature = {
  29777. // @define Ext.env.Feature
  29778. // @define Ext.feature
  29779. // @define Ext.supports
  29780. // @require Ext.String
  29781. // @require Ext.env.Browser
  29782. // @require Ext.env.OS
  29783. /**
  29784. * @method has
  29785. * @member Ext.feature
  29786. * Verifies if a browser feature exists or not on the current device.
  29787. *
  29788. * A "hybrid" property, can be either accessed as a method call, i.e:
  29789. *
  29790. * if (Ext.feature.has('Canvas')) {
  29791. * // ...
  29792. * }
  29793. *
  29794. * or as an object with boolean properties, i.e:
  29795. *
  29796. * if (Ext.feature.has.Canvas) {
  29797. * // ...
  29798. * }
  29799. *
  29800. * For possible properties/parameter values see `Ext.supports`.
  29801. *
  29802. * @param {String} name The feature name to check.
  29803. * @return {Boolean}
  29804. */
  29805. has: function(name) {
  29806. return !!this.has[name];
  29807. },
  29808. testElements: {},
  29809. getTestElement: function(tag, createNew) {
  29810. if (tag === undefined) {
  29811. tag = 'div';
  29812. } else if (typeof tag !== 'string') {
  29813. return tag;
  29814. }
  29815. if (createNew) {
  29816. return document.createElement(tag);
  29817. }
  29818. if (!this.testElements[tag]) {
  29819. this.testElements[tag] = document.createElement(tag);
  29820. }
  29821. return this.testElements[tag];
  29822. },
  29823. isStyleSupported: function(name, tag) {
  29824. var elementStyle = this.getTestElement(tag).style,
  29825. cName = Ext.String.capitalize(name);
  29826. if (typeof elementStyle[name] !== 'undefined' || typeof elementStyle[Ext.browser.getStylePrefix(name) + cName] !== 'undefined') {
  29827. return true;
  29828. }
  29829. return false;
  29830. },
  29831. isStyleSupportedWithoutPrefix: function(name, tag) {
  29832. var elementStyle = this.getTestElement(tag).style;
  29833. if (typeof elementStyle[name] !== 'undefined') {
  29834. return true;
  29835. }
  29836. return false;
  29837. },
  29838. isEventSupported: function(name, tag) {
  29839. if (tag === undefined) {
  29840. tag = window;
  29841. }
  29842. var element = this.getTestElement(tag),
  29843. eventName = 'on' + name.toLowerCase(),
  29844. isSupported = (eventName in element);
  29845. if (!isSupported) {
  29846. if (element.setAttribute && element.removeAttribute) {
  29847. element.setAttribute(eventName, '');
  29848. isSupported = typeof element[eventName] === 'function';
  29849. if (typeof element[eventName] !== 'undefined') {
  29850. element[eventName] = undefined;
  29851. }
  29852. element.removeAttribute(eventName);
  29853. }
  29854. }
  29855. return isSupported;
  29856. },
  29857. // This is a local copy of certain logic from Element.getStyle
  29858. // to break a dependancy between the supports mechanism and Element
  29859. // use this instead of element references to check for styling info
  29860. getStyle: function(element, styleName) {
  29861. var view = element.ownerDocument.defaultView,
  29862. style = (view ? view.getComputedStyle(element, null) : element.currentStyle);
  29863. return (style || element.style)[styleName];
  29864. },
  29865. getSupportedPropertyName: function(object, name) {
  29866. var vendorName = Ext.browser.getVendorProperyName(name);
  29867. if (vendorName in object) {
  29868. return vendorName;
  29869. } else if (name in object) {
  29870. return name;
  29871. }
  29872. return null;
  29873. },
  29874. /**
  29875. * Runs feature detection routines and sets the various flags. This is called when
  29876. * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
  29877. * can be run immediately. Others that require the document body will not run until
  29878. * domready (these have the `ready` flag set).
  29879. *
  29880. * Each test is run only once, so calling this method from an onReady function is safe
  29881. * and ensures that all flags have been set.
  29882. * @private
  29883. */
  29884. detect: function(isReady) {
  29885. var me = this,
  29886. doc = document,
  29887. toRun = me.toRun || me.tests,
  29888. n = toRun.length,
  29889. div = doc.createElement('div'),
  29890. notRun = [],
  29891. supports = Ext.supports,
  29892. has = me.has,
  29893. name, names, test, vector, value;
  29894. // Only the legacy browser tests use this div so clip this out if we don't need
  29895. // to use it.
  29896. 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
  29897. '</div>' + '<div style="position: absolute; left: 10%; top: 10%;"></div>' + '<div style="float:left; background-color:transparent;"></div>';
  29898. if (isReady) {
  29899. doc.body.appendChild(div);
  29900. }
  29901. vector = me.preDetected[Ext.browser.identity] || [];
  29902. while (n--) {
  29903. test = toRun[n];
  29904. value = vector[n];
  29905. name = test.name;
  29906. names = test.names;
  29907. if (value === undefined) {
  29908. if (!isReady && test.ready) {
  29909. // test requires domready state
  29910. notRun.push(test);
  29911. continue;
  29912. }
  29913. value = test.fn.call(me, doc, div);
  29914. }
  29915. // Store test results on Ext.supports and Ext.feature.has
  29916. if (name) {
  29917. supports[name] = has[name] = value;
  29918. } else if (names) {
  29919. while (names.length) {
  29920. name = names.pop();
  29921. supports[name] = has[name] = value;
  29922. }
  29923. }
  29924. }
  29925. if (isReady) {
  29926. doc.body.removeChild(div);
  29927. }
  29928. me.toRun = notRun;
  29929. },
  29930. //</debug>
  29931. report: function() {
  29932. var values = [],
  29933. len = this.tests.length,
  29934. i;
  29935. for (i = 0; i < len; ++i) {
  29936. values.push(this.has[this.tests[i].name] ? 1 : 0);
  29937. }
  29938. Ext.log(Ext.browser.identity + ': [' + values.join(',') + ']');
  29939. },
  29940. //</debug>
  29941. preDetected: {},
  29942. // TODO
  29943. /**
  29944. * @class Ext.supports
  29945. *
  29946. * Contains information about features supported in the current environment as well
  29947. * as bugs detected.
  29948. *
  29949. * @singleton
  29950. */
  29951. tests: [
  29952. {
  29953. /**
  29954. * @property CloneNodeCopiesExpando `true` if the native DOM cloneNode method copies
  29955. * expando properties to the newly cloned node.
  29956. *
  29957. * This property is available at application boot time, before document ready.
  29958. * @type {Boolean}
  29959. */
  29960. name: 'CloneNodeCopiesExpando',
  29961. fn: function() {
  29962. var el = document.createElement('div');
  29963. el.expandoProp = {};
  29964. return el.cloneNode().expandoProp === el.expandoProp;
  29965. }
  29966. },
  29967. {
  29968. /**
  29969. * @property CSSPointerEvents `true` if document environment supports the CSS3
  29970. * pointer-events style.
  29971. *
  29972. * This property is available at application boot time, before document ready.
  29973. * @type {Boolean}
  29974. */
  29975. name: 'CSSPointerEvents',
  29976. fn: function(doc) {
  29977. return 'pointerEvents' in doc.documentElement.style;
  29978. }
  29979. },
  29980. {
  29981. /**
  29982. * @property CSS3BoxShadow `true` if document environment supports the CSS3
  29983. * box-shadow style.
  29984. *
  29985. * This property is available at application boot time, before document ready.
  29986. * @type {Boolean}
  29987. */
  29988. name: 'CSS3BoxShadow',
  29989. fn: function(doc) {
  29990. return 'boxShadow' in doc.documentElement.style || 'WebkitBoxShadow' in doc.documentElement.style || 'MozBoxShadow' in doc.documentElement.style;
  29991. }
  29992. },
  29993. {
  29994. name: 'CSS3NegationSelector',
  29995. fn: function(doc) {
  29996. try {
  29997. doc.querySelectorAll("foo:not(bar)");
  29998. } catch (e) {
  29999. return false;
  30000. }
  30001. return true;
  30002. }
  30003. },
  30004. {
  30005. /**
  30006. * @property ClassList `true` if document environment supports the HTML5
  30007. * classList API.
  30008. *
  30009. * This property is available at application boot time, before document ready.
  30010. * @type {Boolean}
  30011. */
  30012. name: 'ClassList',
  30013. fn: function(doc) {
  30014. return !!doc.documentElement.classList;
  30015. }
  30016. },
  30017. {
  30018. /**
  30019. * @property Canvas `true` if the device supports Canvas.
  30020. *
  30021. * This property is available at application boot time, before document ready.
  30022. * @type {Boolean}
  30023. */
  30024. name: 'Canvas',
  30025. fn: function() {
  30026. var element = this.getTestElement('canvas');
  30027. return !!(element && element.getContext && element.getContext('2d'));
  30028. }
  30029. },
  30030. {
  30031. /**
  30032. * @property Svg `true` if the device supports SVG.
  30033. *
  30034. * This property is available at application boot time, before document ready.
  30035. * @type {Boolean}
  30036. */
  30037. name: 'Svg',
  30038. fn: function(doc) {
  30039. /* eslint-disable-next-line max-len */
  30040. return !!(doc.createElementNS && !!doc.createElementNS("http:/" + "/www.w3.org/2000/svg", "svg").createSVGRect);
  30041. }
  30042. },
  30043. {
  30044. /**
  30045. * @property Vml `true` if the device supports VML.
  30046. * @type {Boolean}
  30047. *
  30048. * This property is available at application boot time, before document ready.
  30049. */
  30050. name: 'Vml',
  30051. fn: function() {
  30052. var element = this.getTestElement(),
  30053. ret = false;
  30054. element.innerHTML = "<!--[if vml]><br><![endif]-->";
  30055. ret = (element.childNodes.length === 1);
  30056. element.innerHTML = "";
  30057. return ret;
  30058. }
  30059. },
  30060. {
  30061. /**
  30062. * @property {Boolean} Touch `true` if the browser supports touch input.
  30063. *
  30064. * This property is available at application boot time, before document ready.
  30065. */
  30066. name: 'Touch',
  30067. fn: function() {
  30068. // IE10 uses a vendor-prefixed maxTouchPoints property
  30069. var maxTouchPoints = navigator.msMaxTouchPoints || navigator.maxTouchPoints;
  30070. // if the browser has touch events we can be reasonably sure the device has
  30071. // a touch screen
  30072. // browsers that use pointer event have maxTouchPoints > 1 if the
  30073. // device supports touch input
  30074. // Chrome Desktop < 39 reports maxTouchPoints === 1 even if there is no
  30075. // touch support on the device
  30076. // http://www.w3.org/TR/pointerevents/#widl-Navigator-maxTouchPoints
  30077. // Chrome Desktop > 39 properly reports maxTouchPoints === 0 and
  30078. // Chrome Desktop Device Emulation mode reports maxTouchPoints === 1
  30079. if (Ext.browser.is.Chrome && Ext.browser.version.isLessThanOrEqual(39)) {
  30080. return (Ext.supports.TouchEvents && maxTouchPoints !== 1) || maxTouchPoints > 1;
  30081. } else {
  30082. return Ext.supports.TouchEvents || maxTouchPoints > 0;
  30083. }
  30084. }
  30085. },
  30086. {
  30087. /**
  30088. * @property {Boolean} PointerEvents
  30089. * @type {Boolean}
  30090. * @private
  30091. *
  30092. * `true` If the event system should use [pointer events](https://www.w3.org/TR/pointerevents/).
  30093. * Currently only set to true if the browser supports pointer events and does not
  30094. * also support touch events. Touch events are preferred since they allow run-time
  30095. * cancellation of browser default behavior such as scrolling by invoking
  30096. * `e.preventDefault()` whereas pointer events require such intentions to be declared
  30097. * in advance via CSS [touch-action](https://www.w3.org/TR/pointerevents/#h3_the-touch-action-css-property).
  30098. * This means that when pointer events are used, certain interactions are not possible
  30099. * such as long-press to drag within a scrollable element.
  30100. */
  30101. name: 'PointerEvents',
  30102. fn: function() {
  30103. var pointerEvent = window.PointerEvent,
  30104. nav = window.navigator,
  30105. pointerEnabled = !!(pointerEvent && (nav.pointerEnabled || !Ext.isIE));
  30106. return pointerEnabled && !Ext.supports.TouchEvents;
  30107. }
  30108. },
  30109. {
  30110. /**
  30111. * @property {Boolean} MSPointerEvents
  30112. * @private
  30113. */
  30114. name: 'MSPointerEvents',
  30115. fn: function() {
  30116. return Ext.isIE10;
  30117. }
  30118. },
  30119. {
  30120. /**
  30121. * @property {Boolean} TouchEvents
  30122. *
  30123. * `true` if the device supports touch events (`touchstart`, `touchmove`, `touchend`).
  30124. *
  30125. * This property is available at application boot time, before document ready.
  30126. */
  30127. name: 'TouchEvents',
  30128. fn: function() {
  30129. return this.isEventSupported('touchend');
  30130. }
  30131. },
  30132. {
  30133. /**
  30134. * @property {Boolean} TouchAction
  30135. * @private
  30136. *
  30137. * A bit flag representing which property values the browser recognizes as valid
  30138. * values of the CSS `touch-action` property.
  30139. *
  30140. * panX 1 "00000001"
  30141. * panY 2 "00000010"
  30142. * pinchZoom 4 "00000100"
  30143. * doubleTapZoom 8 "00001000"
  30144. */
  30145. name: 'TouchAction',
  30146. ready: true,
  30147. fn: function(doc, div) {
  30148. if (!window.getComputedStyle) {
  30149. return 0;
  30150. }
  30151. var values = [
  30152. 'pan-x',
  30153. 'pan-y',
  30154. 'pinch-zoom',
  30155. 'double-tap-zoom'
  30156. ],
  30157. flags = [
  30158. 1,
  30159. 2,
  30160. 4,
  30161. 8
  30162. ],
  30163. ln = values.length,
  30164. flag = 0,
  30165. i, value;
  30166. for (i = 0; i < ln; i++) {
  30167. value = values[i];
  30168. div.style.touchAction = value;
  30169. if (getComputedStyle(div).touchAction === value) {
  30170. flag |= flags[i];
  30171. }
  30172. }
  30173. return flag;
  30174. }
  30175. },
  30176. {
  30177. /**
  30178. * @property Orientation `true` if the device supports different orientations.
  30179. * @type {Boolean}
  30180. *
  30181. * This property is available at application boot time, before document ready.
  30182. */
  30183. name: 'Orientation',
  30184. fn: function() {
  30185. return ('orientation' in window) && this.isEventSupported('orientationchange');
  30186. }
  30187. },
  30188. {
  30189. /**
  30190. * @property OrientationChange `true` if the device supports the `orientationchange`
  30191. * event.
  30192. *
  30193. * This property is available at application boot time, before document ready.
  30194. * @type {Boolean}
  30195. */
  30196. name: 'OrientationChange',
  30197. fn: function() {
  30198. return this.isEventSupported('orientationchange');
  30199. }
  30200. },
  30201. {
  30202. /**
  30203. * @property DeviceMotion `true` if the device supports device motion (acceleration
  30204. * and rotation rate).
  30205. *
  30206. * This property is available at application boot time, before document ready.
  30207. * @type {Boolean}
  30208. */
  30209. name: 'DeviceMotion',
  30210. fn: function() {
  30211. return this.isEventSupported('devicemotion');
  30212. }
  30213. },
  30214. {
  30215. /**
  30216. * @property Geolocation `true` if the device supports GeoLocation.
  30217. * @type {Boolean}
  30218. *
  30219. * This property is available at application boot time, before document ready.
  30220. */
  30221. /**
  30222. * @property GeoLocation `true` if the device supports Geo-location.
  30223. * @type {Boolean}
  30224. * @deprecated 5.0.0 Use `Geolocation` instead (notice the lower-casing of 'L').
  30225. */
  30226. names: [
  30227. 'Geolocation',
  30228. 'GeoLocation'
  30229. ],
  30230. fn: function() {
  30231. return 'geolocation' in window.navigator;
  30232. }
  30233. },
  30234. {
  30235. name: 'SqlDatabase',
  30236. fn: function() {
  30237. return 'openDatabase' in window;
  30238. }
  30239. },
  30240. {
  30241. name: 'WebSockets',
  30242. fn: function() {
  30243. return 'WebSocket' in window;
  30244. }
  30245. },
  30246. {
  30247. /**
  30248. * @property Range `true` if browser support document.createRange native method.
  30249. * See https://developer.mozilla.org/en/DOM/range.
  30250. *
  30251. * This property is available at application boot time, before document ready.
  30252. * @type {Boolean}
  30253. */
  30254. name: 'Range',
  30255. fn: function() {
  30256. return !!document.createRange;
  30257. }
  30258. },
  30259. {
  30260. /**
  30261. * @property CreateContextualFragment `true` if browser support CreateContextualFragment
  30262. * range native methods.
  30263. * See https://developer.mozilla.org/en/DOM/range.createContextualFragment
  30264. *
  30265. * This property is available at application boot time, before document ready.
  30266. * @type {Boolean}
  30267. */
  30268. name: 'CreateContextualFragment',
  30269. fn: function() {
  30270. var range = !!document.createRange ? document.createRange() : false;
  30271. return range && !!range.createContextualFragment;
  30272. }
  30273. },
  30274. {
  30275. /**
  30276. * @property History `true` if the device supports HTML5 history. See
  30277. * https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
  30278. *
  30279. * This property is available at application boot time, before document ready.
  30280. * @type {Boolean}
  30281. */
  30282. name: 'History',
  30283. fn: function() {
  30284. return ('history' in window && 'pushState' in window.history);
  30285. }
  30286. },
  30287. {
  30288. /**
  30289. * @property Css3DTransforms `true` if the device supports CSS3DTransform.
  30290. * @type {Boolean}
  30291. *
  30292. * This property is available at application boot time, before document ready.
  30293. */
  30294. name: 'Css3dTransforms',
  30295. fn: function() {
  30296. // See https://sencha.jira.com/browse/TOUCH-1544
  30297. return this.has('CssTransforms') && this.isStyleSupported('perspective');
  30298. }
  30299. },
  30300. // TODO - double check vs Ext JS flavor:
  30301. /* eslint-disable-next-line max-len */
  30302. // return (typeof WebKitCSSMatrix != 'undefined' && new WebKitCSSMatrix().hasOwnProperty('m41'));
  30303. {
  30304. // Important that this goes after Css3dTransforms, since tests are run in reverse order
  30305. name: 'CssTransforms',
  30306. fn: function() {
  30307. return this.isStyleSupported('transform');
  30308. }
  30309. },
  30310. {
  30311. name: 'CssTransformNoPrefix',
  30312. fn: function() {
  30313. return this.isStyleSupportedWithoutPrefix('transform');
  30314. }
  30315. },
  30316. {
  30317. name: 'CssAnimations',
  30318. fn: function() {
  30319. return this.isStyleSupported('animationName');
  30320. }
  30321. },
  30322. {
  30323. /**
  30324. * @property Transitions `true` if the device supports CSS3 Transitions.
  30325. *
  30326. * This property is available at application boot time, before document ready.
  30327. * @type {Boolean}
  30328. */
  30329. names: [
  30330. 'CssTransitions',
  30331. 'Transitions'
  30332. ],
  30333. fn: function() {
  30334. return this.isStyleSupported('transitionProperty');
  30335. }
  30336. },
  30337. {
  30338. /**
  30339. * @property Audio `true` if the device supports the HTML5 `audio` tag.
  30340. *
  30341. * This property is available at application boot time, before document ready.
  30342. * @type {Boolean}
  30343. */
  30344. /**
  30345. * @property AudioTag `true` if the device supports the HTML5 `audio` tag.
  30346. * @type {Boolean}
  30347. * @deprecated 5.0.0 Use `Audio` instead.
  30348. */
  30349. names: [
  30350. 'Audio',
  30351. 'AudioTag'
  30352. ],
  30353. fn: function() {
  30354. return !!this.getTestElement('audio').canPlayType;
  30355. }
  30356. },
  30357. {
  30358. /**
  30359. * @property Video `true` if the device supports the HTML5 `video` tag.
  30360. *
  30361. * This property is available at application boot time, before document ready.
  30362. * @type {Boolean}
  30363. */
  30364. name: 'Video',
  30365. fn: function() {
  30366. return !!this.getTestElement('video').canPlayType;
  30367. }
  30368. },
  30369. {
  30370. /**
  30371. * @property LocalStorage `true` if localStorage is supported.
  30372. *
  30373. * This property is available at application boot time, before document ready.
  30374. * @type {Boolean}
  30375. */
  30376. name: 'LocalStorage',
  30377. fn: function() {
  30378. try {
  30379. // IE10/Win8 throws "Access Denied" accessing window.localStorage, so
  30380. // this test needs to have a try/catch
  30381. /* eslint-disable-next-line dot-notation */
  30382. if ('localStorage' in window && window['localStorage'] !== null) {
  30383. // this should throw an error in private browsing mode in iOS as well
  30384. localStorage.setItem('sencha-localstorage-test', 'test success');
  30385. // clean up if setItem worked
  30386. localStorage.removeItem('sencha-localstorage-test');
  30387. return true;
  30388. }
  30389. } catch (e) {}
  30390. // ignore
  30391. return false;
  30392. }
  30393. },
  30394. {
  30395. /**
  30396. * @property {Boolean} XmlQuerySelector `true` if the browsers supports querySelector
  30397. * and querySelectorAll methods on XML nodes.
  30398. *
  30399. * This property is available at application boot time, before document ready.
  30400. */
  30401. name: 'XmlQuerySelector',
  30402. fn: function() {
  30403. var xmlString = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><root></root>',
  30404. xmlDoc;
  30405. // IE10 doesn't create IXMLDOMDocument via DOMParser
  30406. if (window.ActiveXObject) {
  30407. xmlDoc = new ActiveXObject("Microsoft.xmlDOM");
  30408. // eslint-disable-line no-undef
  30409. xmlDoc.async = false;
  30410. // eslint-disable-line id-blacklist
  30411. xmlDoc.loadXML(xmlString);
  30412. } else if (window.DOMParser) {
  30413. var parser = new DOMParser();
  30414. xmlDoc = parser.parseFromString(xmlString, 'text/xml');
  30415. }
  30416. return xmlDoc ? !!xmlDoc.lastChild.querySelector : false;
  30417. }
  30418. },
  30419. {
  30420. /**
  30421. * @property XHR2 `true` if the browser supports XMLHttpRequest
  30422. *
  30423. * This property is available at application boot time, before document ready.
  30424. * @type {Boolean}
  30425. */
  30426. name: 'XHR2',
  30427. fn: function() {
  30428. return window.ProgressEvent && window.FormData && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
  30429. }
  30430. },
  30431. {
  30432. /**
  30433. * @property XHRUploadProgress `true` if the browser supports XMLHttpRequest
  30434. * upload progress info
  30435. *
  30436. * This property is available at application boot time, before document ready.
  30437. * @type {Boolean}
  30438. */
  30439. name: 'XHRUploadProgress',
  30440. fn: function() {
  30441. var xhr;
  30442. if (window.XMLHttpRequest && !Ext.browser.is.AndroidStock) {
  30443. xhr = new XMLHttpRequest();
  30444. return xhr && ('upload' in xhr) && ('onprogress' in xhr.upload);
  30445. }
  30446. return false;
  30447. }
  30448. },
  30449. {
  30450. /**
  30451. * @property NumericInputPlaceHolder `true` if the browser supports placeholders
  30452. * on numeric input fields
  30453. *
  30454. * This property is available at application boot time, before document ready.
  30455. * @type {Boolean}
  30456. */
  30457. name: 'NumericInputPlaceHolder',
  30458. fn: function() {
  30459. return !(Ext.browser.is.AndroidStock4 && Ext.os.version.getMinor() < 2);
  30460. }
  30461. },
  30462. {
  30463. /**
  30464. * @property {String} matchesSelector
  30465. * The method name which matches an element against a selector if implemented in this
  30466. * environment.
  30467. *
  30468. * This property is available at application boot time, before document ready.
  30469. */
  30470. name: 'matchesSelector',
  30471. fn: function() {
  30472. var el = document.documentElement,
  30473. w3 = 'matches',
  30474. wk = 'webkitMatchesSelector',
  30475. ms = 'msMatchesSelector',
  30476. mz = 'mozMatchesSelector';
  30477. return el[w3] ? w3 : el[wk] ? wk : el[ms] ? ms : el[mz] ? mz : null;
  30478. }
  30479. },
  30480. {
  30481. /**
  30482. * @property RightMargin `true` if the device supports right margin.
  30483. * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
  30484. *
  30485. * This property is *NOT* available at application boot time. Only after the document
  30486. * ready event.
  30487. * @type {Boolean}
  30488. */
  30489. name: 'RightMargin',
  30490. ready: true,
  30491. fn: function(doc, div) {
  30492. var view = doc.defaultView;
  30493. /* eslint-disable-next-line max-len */
  30494. return !(view && view.getComputedStyle(div.firstChild.firstChild, null).marginRight !== '0px');
  30495. }
  30496. },
  30497. {
  30498. /**
  30499. * @property DisplayChangeInputSelectionBug `true` if INPUT elements lose their
  30500. * selection when their display style is changed. Essentially, if a text input
  30501. * has focus and its display style is changed, the I-beam disappears.
  30502. *
  30503. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  30504. * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
  30505. * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
  30506. * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
  30507. *
  30508. * This property is available at application boot time, before document ready.
  30509. */
  30510. name: 'DisplayChangeInputSelectionBug',
  30511. fn: function() {
  30512. var webKitVersion = Ext.webKitVersion;
  30513. // WebKit but older than Safari 5 or Chrome 6:
  30514. return 0 < webKitVersion && webKitVersion < 533;
  30515. }
  30516. },
  30517. {
  30518. /**
  30519. * @property DisplayChangeTextAreaSelectionBug `true` if TEXTAREA elements lose their
  30520. * selection when their display style is changed. Essentially, if a text area has
  30521. * focus and its display style is changed, the I-beam disappears.
  30522. *
  30523. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  30524. * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
  30525. * be fixed in Chrome 11.
  30526. *
  30527. * This property is available at application boot time, before document ready.
  30528. */
  30529. name: 'DisplayChangeTextAreaSelectionBug',
  30530. fn: function() {
  30531. var webKitVersion = Ext.webKitVersion;
  30532. /*
  30533. Has bug w/textarea:
  30534. (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
  30535. AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
  30536. Safari/534.16
  30537. (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  30538. AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
  30539. Safari/533.21.1
  30540. No bug:
  30541. (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
  30542. AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
  30543. Safari/534.24
  30544. */
  30545. return 0 < webKitVersion && webKitVersion < 534.24;
  30546. }
  30547. },
  30548. {
  30549. /**
  30550. * @property TransparentColor `true` if the device supports transparent color.
  30551. * @type {Boolean}
  30552. *
  30553. * This property is *NOT* available at application boot time. Only after the document
  30554. * ready event.
  30555. */
  30556. name: 'TransparentColor',
  30557. ready: true,
  30558. fn: function(doc, div, view) {
  30559. view = doc.defaultView;
  30560. /* eslint-disable-next-line max-len */
  30561. return !(view && view.getComputedStyle(div.lastChild, null).backgroundColor !== 'transparent');
  30562. }
  30563. },
  30564. {
  30565. /**
  30566. * @property ComputedStyle `true` if the browser supports
  30567. * document.defaultView.getComputedStyle().
  30568. * @type {Boolean}
  30569. *
  30570. * This property is *NOT* available at application boot time. Only after the document
  30571. * ready event.
  30572. */
  30573. name: 'ComputedStyle',
  30574. ready: true,
  30575. fn: function(doc, div, view) {
  30576. view = doc.defaultView;
  30577. return !!(view && view.getComputedStyle);
  30578. }
  30579. },
  30580. {
  30581. /**
  30582. * @property Float `true` if the device supports CSS float.
  30583. * @type {Boolean}
  30584. *
  30585. * This property is available at application boot time, before document ready.
  30586. */
  30587. name: 'Float',
  30588. fn: function(doc) {
  30589. return 'cssFloat' in doc.documentElement.style;
  30590. }
  30591. },
  30592. {
  30593. /**
  30594. * @property CSS3BorderRadius `true` if the device supports CSS3 border radius.
  30595. * @type {Boolean}
  30596. *
  30597. * This property is *NOT* available at application boot time. Only after the document
  30598. * ready event.
  30599. */
  30600. name: 'CSS3BorderRadius',
  30601. ready: true,
  30602. fn: function(doc) {
  30603. var domPrefixes = [
  30604. 'borderRadius',
  30605. 'BorderRadius',
  30606. 'MozBorderRadius',
  30607. 'WebkitBorderRadius',
  30608. 'OBorderRadius',
  30609. 'KhtmlBorderRadius'
  30610. ],
  30611. pass = false,
  30612. i;
  30613. for (i = 0; i < domPrefixes.length; i++) {
  30614. if (doc.documentElement.style[domPrefixes[i]] !== undefined) {
  30615. pass = true;
  30616. }
  30617. }
  30618. return pass && !Ext.isIE9;
  30619. }
  30620. },
  30621. {
  30622. /**
  30623. * @property CSS3LinearGradient `true` if the device supports CSS3 linear gradients.
  30624. * @type {Boolean}
  30625. *
  30626. * This property is available at application boot time, before document ready.
  30627. */
  30628. name: 'CSS3LinearGradient',
  30629. fn: function(doc, div) {
  30630. var property = 'background-image:',
  30631. webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
  30632. w3c = 'linear-gradient(left top, black, white)',
  30633. moz = '-moz-' + w3c,
  30634. ms = '-ms-' + w3c,
  30635. opera = '-o-' + w3c,
  30636. options = [
  30637. property + webkit,
  30638. property + w3c,
  30639. property + moz,
  30640. property + ms,
  30641. property + opera
  30642. ];
  30643. div.style.cssText = options.join(';');
  30644. return (("" + div.style.backgroundImage).indexOf('gradient') !== -1) && !Ext.isIE9;
  30645. }
  30646. },
  30647. {
  30648. /**
  30649. * @property MouseEnterLeave `true` if the browser supports mouseenter and mouseleave events
  30650. * @type {Boolean}
  30651. *
  30652. * This property is available at application boot time, before document ready.
  30653. */
  30654. name: 'MouseEnterLeave',
  30655. fn: function(doc) {
  30656. return ('onmouseenter' in doc.documentElement && 'onmouseleave' in doc.documentElement);
  30657. }
  30658. },
  30659. {
  30660. /**
  30661. * @property MouseWheel `true` if the browser supports the mousewheel event
  30662. * @type {Boolean}
  30663. *
  30664. * This property is available at application boot time, before document ready.
  30665. */
  30666. name: 'MouseWheel',
  30667. fn: function(doc) {
  30668. return ('onmousewheel' in doc.documentElement);
  30669. }
  30670. },
  30671. {
  30672. /**
  30673. * @property Opacity `true` if the browser supports normal css opacity
  30674. * @type {Boolean}
  30675. *
  30676. * This property is available at application boot time, before document ready.
  30677. */
  30678. name: 'Opacity',
  30679. fn: function(doc, div) {
  30680. // Not a strict equal comparison in case opacity can be converted to a number.
  30681. if (Ext.isIE8) {
  30682. return false;
  30683. }
  30684. div.firstChild.style.cssText = 'opacity:0.73';
  30685. return div.firstChild.style.opacity == '0.73';
  30686. }
  30687. },
  30688. // eslint-disable-line eqeqeq
  30689. {
  30690. /**
  30691. * @property Placeholder `true` if the browser supports the HTML5 placeholder attribute
  30692. * on inputs
  30693. * @type {Boolean}
  30694. *
  30695. * This property is available at application boot time, before document ready.
  30696. */
  30697. name: 'Placeholder',
  30698. fn: function(doc) {
  30699. return 'placeholder' in doc.createElement('input');
  30700. }
  30701. },
  30702. {
  30703. /**
  30704. * @property Direct2DBug `true` if when asking for an element's dimension via offsetWidth
  30705. * or offsetHeight, getBoundingClientRect, etc. the browser returns the subpixel width
  30706. * rounded to the nearest pixel.
  30707. *
  30708. * This property is available at application boot time, before document ready.
  30709. * @type {Boolean}
  30710. */
  30711. name: 'Direct2DBug',
  30712. fn: function(doc) {
  30713. return Ext.isString(doc.documentElement.style.msTransformOrigin) && Ext.isIE9m;
  30714. }
  30715. },
  30716. {
  30717. /**
  30718. * @property BoundingClientRect `true` if the browser supports the getBoundingClientRect
  30719. * method on elements
  30720. * @type {Boolean}
  30721. *
  30722. * This property is available at application boot time, before document ready.
  30723. */
  30724. name: 'BoundingClientRect',
  30725. fn: function(doc) {
  30726. return 'getBoundingClientRect' in doc.documentElement;
  30727. }
  30728. },
  30729. {
  30730. /**
  30731. * @property RotatedBoundingClientRect `true` if the BoundingClientRect is
  30732. * rotated when the element is rotated using a CSS transform.
  30733. * @type {Boolean}
  30734. *
  30735. * This property is *NOT* available at application boot time. Only after the document
  30736. * ready event.
  30737. */
  30738. name: 'RotatedBoundingClientRect',
  30739. ready: true,
  30740. fn: function(doc) {
  30741. var body = doc.body,
  30742. supports = false,
  30743. el = doc.createElement('div'),
  30744. style = el.style;
  30745. if (el.getBoundingClientRect) {
  30746. // If the document body already has child nodes (text nodes etc) we can end
  30747. // up with subpixel rounding errors in IE11 when measuring the height.
  30748. // Absolute positioning prevents this.
  30749. style.position = 'absolute';
  30750. style.top = "0";
  30751. style.WebkitTransform = style.MozTransform = style.msTransform = style.OTransform = style.transform = 'rotate(90deg)';
  30752. style.width = '100px';
  30753. style.height = '30px';
  30754. body.appendChild(el);
  30755. supports = el.getBoundingClientRect().height !== 100;
  30756. body.removeChild(el);
  30757. }
  30758. return supports;
  30759. }
  30760. },
  30761. {
  30762. /**
  30763. * @property ChildContentClearedWhenSettingInnerHTML `true` if created child elements
  30764. * lose their innerHTML when modifying the innerHTML of the parent element.
  30765. * @type {Boolean}
  30766. *
  30767. * This property is *NOT* available at application boot time. Only after the document
  30768. * ready event.
  30769. */
  30770. name: 'ChildContentClearedWhenSettingInnerHTML',
  30771. ready: true,
  30772. fn: function() {
  30773. var el = this.getTestElement(),
  30774. child;
  30775. el.innerHTML = '<div>a</div>';
  30776. child = el.firstChild;
  30777. el.innerHTML = '<div>b</div>';
  30778. return child.innerHTML !== 'a';
  30779. }
  30780. },
  30781. {
  30782. name: 'IncludePaddingInWidthCalculation',
  30783. ready: true,
  30784. fn: function(doc, div) {
  30785. return div.childNodes[1].firstChild.offsetWidth === 210;
  30786. }
  30787. },
  30788. {
  30789. name: 'IncludePaddingInHeightCalculation',
  30790. ready: true,
  30791. fn: function(doc, div) {
  30792. return div.childNodes[1].firstChild.offsetHeight === 210;
  30793. }
  30794. },
  30795. {
  30796. /**
  30797. * @property TextAreaMaxLength `true` if the browser supports maxlength on textareas.
  30798. * @type {Boolean}
  30799. *
  30800. * This property is available at application boot time, before document ready.
  30801. */
  30802. name: 'TextAreaMaxLength',
  30803. fn: function(doc) {
  30804. return ('maxlength' in doc.createElement('textarea'));
  30805. }
  30806. },
  30807. {
  30808. /**
  30809. * @property GetPositionPercentage `true` if the browser will return the
  30810. * left/top/right/bottom position as a percentage when explicitly set as a percentage value.
  30811. *
  30812. * This property is *NOT* available at application boot time. Only after the document
  30813. * ready event.
  30814. * @type {Boolean}
  30815. */
  30816. // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
  30817. name: 'GetPositionPercentage',
  30818. ready: true,
  30819. fn: function(doc, div) {
  30820. return Ext.feature.getStyle(div.childNodes[2], 'left') === '10%';
  30821. }
  30822. },
  30823. {
  30824. /**
  30825. * @property {Boolean} PercentageHeightOverflowBug
  30826. * In some browsers (IE quirks, IE6, IE7, IE9, chrome, safari and opera at the time
  30827. * of this writing) a percentage-height element ignores the horizontal scrollbar
  30828. * of its parent element. This method returns true if the browser is affected
  30829. * by this bug.
  30830. *
  30831. * This property is *NOT* available at application boot time. Only after the document
  30832. * ready event.
  30833. * @private
  30834. */
  30835. name: 'PercentageHeightOverflowBug',
  30836. ready: true,
  30837. fn: function(doc) {
  30838. var hasBug = false,
  30839. style, el;
  30840. if (Ext.getScrollbarSize().height) {
  30841. // must have space-consuming scrollbars for bug to be possible
  30842. el = this.getTestElement('div', true);
  30843. style = el.style;
  30844. style.height = '50px';
  30845. style.width = '50px';
  30846. style.overflow = 'auto';
  30847. style.position = 'absolute';
  30848. /* eslint-disable indent */
  30849. el.innerHTML = [
  30850. '<div style="display:table;height:100%;">',
  30851. // The element that causes the horizontal overflow must be
  30852. // a child of the element with the 100% height, otherwise
  30853. // horizontal overflow is not triggered in webkit quirks mode
  30854. '<div style="width:51px;"></div>',
  30855. '</div>'
  30856. ].join('');
  30857. /* eslint-enable indent */
  30858. doc.body.appendChild(el);
  30859. if (el.firstChild.offsetHeight === 50) {
  30860. hasBug = true;
  30861. }
  30862. doc.body.removeChild(el);
  30863. }
  30864. return hasBug;
  30865. }
  30866. },
  30867. {
  30868. /**
  30869. * @property {Boolean} xOriginBug
  30870. * In Chrome 24.0, an RTL element which has vertical overflow positions its right X origin
  30871. * incorrectly. It skips a non-existent scrollbar which has been moved to the left edge
  30872. * due to the RTL setting.
  30873. *
  30874. * http://code.google.com/p/chromium/issues/detail?id=174656
  30875. *
  30876. * This method returns true if the browser is affected by this bug.
  30877. *
  30878. * This property is *NOT* available at application boot time. Only after the document
  30879. * ready event.
  30880. * @private
  30881. */
  30882. name: 'xOriginBug',
  30883. ready: true,
  30884. fn: function(doc, div) {
  30885. /* eslint-disable max-len */
  30886. 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>';
  30887. /* eslint-enable max-len */
  30888. var outerBox = document.getElementById('b1').getBoundingClientRect(),
  30889. b2 = document.getElementById('b2').getBoundingClientRect(),
  30890. b3 = document.getElementById('b3').getBoundingClientRect();
  30891. return (b2.left !== outerBox.left && b3.right !== outerBox.right);
  30892. }
  30893. },
  30894. {
  30895. /**
  30896. * @property {Boolean} ScrollWidthInlinePaddingBug
  30897. * In some browsers the right padding of an overflowing element is not accounted
  30898. * for in its scrollWidth. The result can vary depending on whether or not
  30899. * The element contains block-level children. This method tests the effect
  30900. * of padding on scrollWidth when there are no block-level children inside the
  30901. * overflowing element.
  30902. *
  30903. * This method returns true if the browser is affected by this bug.
  30904. *
  30905. * This property is *NOT* available at application boot time. Only after the document
  30906. * ready event.
  30907. */
  30908. name: 'ScrollWidthInlinePaddingBug',
  30909. ready: true,
  30910. fn: function(doc) {
  30911. var hasBug = false,
  30912. style, el;
  30913. el = doc.createElement('div');
  30914. style = el.style;
  30915. style.height = '50px';
  30916. style.width = '50px';
  30917. style.padding = '10px';
  30918. style.overflow = 'hidden';
  30919. style.position = 'absolute';
  30920. el.innerHTML = '<span style="display:inline-block;zoom:1;height:60px;width:60px;"></span>';
  30921. doc.body.appendChild(el);
  30922. if (el.scrollWidth === 70) {
  30923. hasBug = true;
  30924. }
  30925. doc.body.removeChild(el);
  30926. return hasBug;
  30927. }
  30928. },
  30929. {
  30930. /**
  30931. * @property {Boolean} rtlVertScrollbarOnRight
  30932. * Safari, in RTL mode keeps the scrollbar at the right side.
  30933. * This means that when two elements must keep their left/right positions synched, if one
  30934. * has no vert scrollbar, it must have some extra padding.
  30935. * See https://sencha.jira.com/browse/EXTJSIV-11245
  30936. *
  30937. * This property is *NOT* available at application boot time. Only after the document
  30938. * ready event.
  30939. * @private
  30940. */
  30941. name: 'rtlVertScrollbarOnRight',
  30942. ready: true,
  30943. fn: function(doc, div) {
  30944. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:scroll">' + '<div style="width:20px;height:200px;"></div>' + '</div>';
  30945. var outerBox = div.firstChild,
  30946. innerBox = outerBox.firstChild;
  30947. /* eslint-disable-next-line max-len */
  30948. return (innerBox.offsetLeft + innerBox.offsetWidth !== outerBox.offsetLeft + outerBox.offsetWidth);
  30949. }
  30950. },
  30951. {
  30952. /**
  30953. * @property {Boolean} rtlVertScrollbarOverflowBug
  30954. * In Chrome, in RTL mode, horizontal overflow only into the vertical scrollbar does NOT
  30955. * trigger horizontal scrollability.
  30956. * See https://code.google.com/p/chromium/issues/detail?id=179332
  30957. * We need to detect this for when a grid header needs to have exactly the same horizontal
  30958. * scrolling range as its table view. See {@link Ext.grid.ColumnLayout#publishInnerCtSize}
  30959. * TODO: Remove this when all supported Chrome versions are fixed.
  30960. *
  30961. * This property is *NOT* available at application boot time. Only after the document
  30962. * ready event.
  30963. * @private
  30964. */
  30965. name: 'rtlVertScrollbarOverflowBug',
  30966. ready: true,
  30967. fn: function(doc, div) {
  30968. div.innerHTML = '<div style="height:100px;width:100px;direction:rtl;overflow:auto">' + '<div style="width:95px;height:200px;"></div>' + '</div>';
  30969. // If the bug is present, the 95 pixel wide inner div, encroaches into the
  30970. // vertical scrollbar, but does NOT trigger horizontal overflow, so the clientHeight
  30971. // remains equal to the offset height.
  30972. var outerBox = div.firstChild,
  30973. style = div.style,
  30974. pos = style.position;
  30975. // This issue seems to require a repaint to measure correctly
  30976. style.position = 'absolute';
  30977. // eslint-disable-next-line no-unused-expressions
  30978. outerBox.offsetHeight;
  30979. style.position = pos;
  30980. return outerBox.clientHeight === outerBox.offsetHeight;
  30981. }
  30982. },
  30983. {
  30984. identity: 'defineProperty',
  30985. fn: function() {
  30986. if (Ext.isIE8m) {
  30987. Ext.Object.defineProperty = Ext.emptyFn;
  30988. return false;
  30989. }
  30990. return true;
  30991. }
  30992. },
  30993. {
  30994. identify: 'nativeXhr',
  30995. fn: function() {
  30996. if (typeof XMLHttpRequest !== 'undefined') {
  30997. return true;
  30998. }
  30999. // Apply a polyfill:
  31000. XMLHttpRequest = function() {
  31001. // eslint-disable-line no-global-assign
  31002. try {
  31003. // eslint-disable-next-line no-undef
  31004. return new ActiveXObject('MSXML2.XMLHTTP.3.0');
  31005. } catch (ex) {
  31006. return null;
  31007. }
  31008. };
  31009. return false;
  31010. }
  31011. },
  31012. {
  31013. /**
  31014. * @property {Boolean} SpecialKeyDownRepeat
  31015. * True if the browser fires the keydown event on specialkey autorepeat
  31016. *
  31017. * note 1: IE fires ONLY the keydown event on specialkey autorepeat
  31018. * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on
  31019. * specialkey autorepeat (research done by Jan Wolter at
  31020. * http://unixpapa.com/js/key.html)
  31021. * note 3: Opera 12 behaves like other modern browsers so this workaround does not
  31022. * work anymore
  31023. *
  31024. * This property is available at application boot time, before document ready.
  31025. */
  31026. name: 'SpecialKeyDownRepeat',
  31027. fn: function() {
  31028. return Ext.isWebKit ? parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 : !(!(Ext.isGecko || Ext.isIE || Ext.isEdge) || (Ext.isOpera && Ext.operaVersion < 12));
  31029. }
  31030. },
  31031. // eslint-disable-line max-len
  31032. {
  31033. /**
  31034. * @property {Boolean} EmulatedMouseOver
  31035. * True if the browser emulates a mouseover event on tap (mobile safari)
  31036. *
  31037. * This property is available at application boot time, before document ready.
  31038. */
  31039. name: 'EmulatedMouseOver',
  31040. fn: function() {
  31041. // TODO: is it possible to feature detect this?
  31042. return Ext.os.is.iOS;
  31043. }
  31044. },
  31045. {
  31046. /**
  31047. * @property Hashchange True if the user agent supports the hashchange event
  31048. *
  31049. * This property is available at application boot time, before document ready.
  31050. * @type {Boolean}
  31051. */
  31052. // support Vector 12
  31053. name: 'Hashchange',
  31054. fn: function() {
  31055. // Note that IE8 in IE7 compatibility mode reports true for 'onhashchange' in window,
  31056. // so also test documentMode
  31057. var docMode = document.documentMode;
  31058. return 'onhashchange' in window && (docMode === undefined || docMode > 7);
  31059. }
  31060. },
  31061. {
  31062. /**
  31063. * @property FixedTableWidthBug
  31064. * @private
  31065. * @type {Boolean}
  31066. * `true` if the browser has this bug: https://bugs.webkit.org/show_bug.cgi?id=130239
  31067. *
  31068. * This property is *NOT* available at application boot time. Only after the document
  31069. * ready event.
  31070. */
  31071. name: 'FixedTableWidthBug',
  31072. ready: true,
  31073. fn: function() {
  31074. if (Ext.isIE8) {
  31075. // IE8 incorrectly detects that we have this bug.
  31076. return false;
  31077. }
  31078. var outer = document.createElement('div'),
  31079. inner = document.createElement('div'),
  31080. width;
  31081. outer.setAttribute('style', 'display:table;table-layout:fixed;');
  31082. inner.setAttribute('style', 'display:table-cell;min-width:50px;');
  31083. outer.appendChild(inner);
  31084. document.body.appendChild(outer);
  31085. // must poke offsetWidth to trigger a reflow before setting width
  31086. // eslint-disable-next-line no-unused-expressions
  31087. outer.offsetWidth;
  31088. outer.style.width = '25px';
  31089. width = outer.offsetWidth;
  31090. document.body.removeChild(outer);
  31091. return width === 50;
  31092. }
  31093. },
  31094. {
  31095. /**
  31096. * @property FocusinFocusoutEvents
  31097. * @private
  31098. * @type {Boolean}
  31099. * `true` if the browser supports focusin and focusout events:
  31100. * https://developer.mozilla.org/en-US/docs/Web/Events/focusin
  31101. * At this point, only Firefox does not, see this bug:
  31102. * https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  31103. *
  31104. * This property is available at application boot time, before document ready.
  31105. */
  31106. name: 'FocusinFocusoutEvents',
  31107. fn: function() {
  31108. // There is no reliable way to feature detect focusin/focusout event support.
  31109. // window.onfocusin will return undefined both in Chrome (where it is supported)
  31110. // and in Firefox (where it is not supported); adding an element and trying to
  31111. // focus it will fail when the browser window itself is not focused.
  31112. return !(Ext.isGecko && Ext.firefoxVersion < 52);
  31113. }
  31114. },
  31115. {
  31116. /**
  31117. * @property {Boolean} AsyncFocusEvents
  31118. * `true` if the browser fires focus events (focus, blur, focusin, focusout)
  31119. * asynchronously, i.e. in a separate event loop invocation. This is only true
  31120. * for all versions Internet Explorer; Microsoft Edge and other browsers fire
  31121. * focus events synchronously.
  31122. */
  31123. name: 'AsyncFocusEvents',
  31124. fn: function() {
  31125. // The sad part is that we can't feature detect this because the focus
  31126. // event won't be fired when the browser window itself is not focused.
  31127. // Private shortcut for brevity
  31128. return Ext.asyncFocus = !!Ext.isIE;
  31129. }
  31130. },
  31131. {
  31132. /**
  31133. * @property {Object} accessibility Accessibility features.
  31134. *
  31135. * @property {Boolean} accessibility.Images `true` if the browser is configured
  31136. * to display images.
  31137. *
  31138. * @property {Boolean} accessibility.BackgroundImages `true` if the browser
  31139. * is configured to display background images.
  31140. *
  31141. * @property {Boolean} accessibility.BorderColors `true` if the browser
  31142. * is configured to honor CSS styling for border colors.
  31143. *
  31144. * @property {Boolean} accessibility.LightOnDark `true` if the browser
  31145. * is currently using reverse colors in light-on-dark accessibility mode.
  31146. */
  31147. name: 'accessibility',
  31148. ready: true,
  31149. fn: function(doc) {
  31150. var body = doc.body,
  31151. div, img, style, supports, bgImg;
  31152. function getColor(colorTxt) {
  31153. var values = [],
  31154. colorValue = 0,
  31155. regex, match;
  31156. if (colorTxt.indexOf('rgb(') !== -1) {
  31157. values = colorTxt.replace('rgb(', '').replace(')', '').split(', ');
  31158. } else if (colorTxt.indexOf('#') !== -1) {
  31159. regex = colorTxt.length === 7 ? /^#(\S\S)(\S\S)(\S\S)$/ : /^#(\S)(\S)(\S)$/;
  31160. match = colorTxt.match(regex);
  31161. if (match) {
  31162. values = [
  31163. '0x' + match[1],
  31164. '0x' + match[2],
  31165. '0x' + match[3]
  31166. ];
  31167. }
  31168. }
  31169. for (var i = 0; i < values.length; i++) {
  31170. colorValue += parseInt(values[i]);
  31171. }
  31172. return colorValue;
  31173. }
  31174. div = doc.createElement('div');
  31175. img = doc.createElement('img');
  31176. style = div.style;
  31177. Ext.apply(style, {
  31178. width: '2px',
  31179. position: 'absolute',
  31180. clip: 'rect(1px,1px,1px,1px)',
  31181. borderWidth: '1px',
  31182. borderStyle: 'solid',
  31183. borderTopTolor: '#f00',
  31184. borderRightColor: '#ff0',
  31185. backgroundColor: '#fff',
  31186. backgroundImage: 'url(' + Ext.BLANK_IMAGE_URL + ')'
  31187. });
  31188. img.alt = '';
  31189. img.src = Ext.BLANK_IMAGE_URL;
  31190. div.appendChild(img);
  31191. body.appendChild(div);
  31192. // Now check if the styles were indeed honored
  31193. style = div.currentStyle || div.style;
  31194. bgImg = style.backgroundImage;
  31195. supports = {
  31196. // In IE it is possible to untick "Show pictures" option in Advanced
  31197. // settings; this will result in img element reporting its readyState
  31198. // as 'uninitialized'.
  31199. // See http://www.paciellogroup.com/blog/2011/10/detecting-if-images-are-disabled-in-browsers/
  31200. Images: img.offsetWidth === 1 && img.readyState !== 'uninitialized',
  31201. BackgroundImages: !(bgImg !== null && (bgImg === "none" || bgImg === "url(invalid-url:)")),
  31202. BorderColors: style.borderTopColor !== style.borderRightColor,
  31203. LightOnDark: getColor(style.color) - getColor(style.backgroundColor) > 0
  31204. };
  31205. Ext.supports.HighContrastMode = !supports.BackgroundImages;
  31206. body.removeChild(div);
  31207. div = img = null;
  31208. return supports;
  31209. }
  31210. },
  31211. {
  31212. /**
  31213. * @property ViewportUnits `true` if the device supports ViewportUnits.
  31214. * @type {Boolean}
  31215. *
  31216. */
  31217. name: 'ViewportUnits',
  31218. ready: true,
  31219. fn: function(doc) {
  31220. // Even attempting to detect the feature throws a fatal error on IE8
  31221. if (Ext.isIE8) {
  31222. return false;
  31223. }
  31224. var body = doc.body,
  31225. div = document.createElement('div'),
  31226. style = div.currentStyle || div.style,
  31227. width, divWidth;
  31228. body.appendChild(div);
  31229. Ext.apply(style, {
  31230. width: '50vw'
  31231. });
  31232. width = parseInt(window.innerWidth / 2, 10);
  31233. // eslint-disable-next-line max-len
  31234. divWidth = parseInt((window.getComputedStyle ? getComputedStyle(div, null) : div.currentStyle).width, 10);
  31235. body.removeChild(div);
  31236. div = null;
  31237. return width === divWidth;
  31238. }
  31239. },
  31240. {
  31241. name: 'CSSVariables',
  31242. ready: false,
  31243. fn: function() {
  31244. // Legacy browsers do not have this method.
  31245. if (!window.getComputedStyle) {
  31246. return false;
  31247. }
  31248. return window.CSS && window.CSS.supports && window.CSS.supports('--test-var', 0);
  31249. }
  31250. },
  31251. {
  31252. /**
  31253. * @property Selectors2 `true` if the browser supports the CSS selector API level 2.
  31254. * https://dev.w3.org/2006/webapi/selectors-api2/
  31255. * @type {Boolean}
  31256. *
  31257. */
  31258. name: 'Selectors2',
  31259. ready: false,
  31260. fn: function(doc) {
  31261. try {
  31262. return !!doc.querySelectorAll(':scope');
  31263. } catch (e) {
  31264. return false;
  31265. }
  31266. }
  31267. },
  31268. {
  31269. /**
  31270. * @property CSSScrollSnap
  31271. * @private
  31272. * @type {Boolean}
  31273. */
  31274. name: 'CSSScrollSnap',
  31275. ready: false,
  31276. fn: function(doc) {
  31277. var style = doc.documentElement.style;
  31278. return 'scrollSnapType' in style || 'webkitScrollSnapType' in style || 'msScrollSnapType' in style;
  31279. }
  31280. },
  31281. {
  31282. /**
  31283. * @property TranslateYCausesHorizontalScroll
  31284. * @private
  31285. * @type {Boolean}
  31286. *
  31287. * Bug for Edge logged here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9743268/
  31288. */
  31289. name: 'TranslateYCausesHorizontalScroll',
  31290. ready: true,
  31291. fn: function(doc, div) {
  31292. div.innerHTML = '<div style="position: relative; overflow: auto; height: 200px; width: 200px;">' + // eslint-disable-line max-len
  31293. '<div>' + '<div style="transform: translateY(260px); width: 50px;">a</div>' + '</div>' + '</div>';
  31294. return div.firstChild.scrollWidth > div.firstChild.clientWidth;
  31295. }
  31296. },
  31297. {
  31298. /**
  31299. * @property FlexBoxBasisBug
  31300. * @private
  31301. * @type {Boolean}
  31302. * Allows align: stretch to align items to the height of the tallest item
  31303. * in an auto-heighted hbox layout.
  31304. * can't use flex-basis: auto everywhere because it breaks percentage-sized children
  31305. * https://bugs.chromium.org/p/chromium/issues/detail?id=680484
  31306. */
  31307. name: 'FlexBoxBasisBug',
  31308. ready: true,
  31309. fn: function() {
  31310. 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))) {
  31311. return true;
  31312. }
  31313. return false;
  31314. }
  31315. },
  31316. {
  31317. /**
  31318. * @property PercentageSizeFlexBug
  31319. * @private
  31320. * @type {Boolean}
  31321. *
  31322. * Detects https://bugs.webkit.org/show_bug.cgi?id=137730
  31323. */
  31324. name: 'PercentageSizeFlexBug',
  31325. ready: true,
  31326. fn: function(doc, div) {
  31327. if (Ext.isIE9m) {
  31328. return false;
  31329. }
  31330. var style = div.style;
  31331. style.display = 'flex';
  31332. style.flexDirection = 'column';
  31333. style.height = style.width = '100px';
  31334. div.innerHTML = '<div style="flex: 1 1;"><div style="height:50%"></div></div>';
  31335. return div.firstChild.firstChild.offsetHeight !== 50;
  31336. }
  31337. },
  31338. {
  31339. /**
  31340. * @property CannotScrollExactHeight
  31341. * @type {Boolean}
  31342. *
  31343. * Feature detect the support of browsers that are unable to scroll elements that are
  31344. * the same height as the native scrollbar height.
  31345. */
  31346. name: 'CannotScrollExactHeight',
  31347. fn: function() {
  31348. return Ext.isIE10p;
  31349. }
  31350. },
  31351. {
  31352. /**
  31353. * @property WebKitTextInputMarginBug
  31354. * @private
  31355. * @type {Boolean}
  31356. *
  31357. * Detects the following bug:
  31358. * https://bugs.webkit.org/show_bug.cgi?id=137693
  31359. *
  31360. * Feb 22, 2017: This bug used to affect chrome as well, but appears to be fixed in
  31361. * Chrome 56. The issue still exists in safari 10
  31362. */
  31363. name: 'WebKitInputTableBoxModelBug',
  31364. ready: true,
  31365. fn: function(doc, div) {
  31366. var table = document.createElement('div'),
  31367. cell = document.createElement('div'),
  31368. input = document.createElement('input'),
  31369. tableStyle = table.style,
  31370. cellStyle = cell.style,
  31371. inputStyle = input.style,
  31372. body = doc.body,
  31373. hasBug;
  31374. input.type = 'text';
  31375. tableStyle.display = 'table';
  31376. tableStyle.height = '100px';
  31377. cellStyle.display = 'table-cell';
  31378. inputStyle.border = '0';
  31379. inputStyle.padding = '10px';
  31380. inputStyle.boxSizing = 'border-box';
  31381. inputStyle.height = '100%';
  31382. cell.appendChild(input);
  31383. table.appendChild(cell);
  31384. body.appendChild(table);
  31385. hasBug = input.offsetHeight === 80;
  31386. body.removeChild(table);
  31387. return hasBug;
  31388. }
  31389. },
  31390. {
  31391. /**
  31392. * @property PassiveEventListener
  31393. * @private
  31394. * @type {Boolean}
  31395. *
  31396. * Detects support for the "passive" event listener option
  31397. */
  31398. name: 'PassiveEventListener',
  31399. fn: function(doc, div) {
  31400. var supportsPassive = false,
  31401. options;
  31402. try {
  31403. options = Object.defineProperty({}, 'passive', {
  31404. get: function() {
  31405. // eslint-disable-line getter-return
  31406. supportsPassive = true;
  31407. }
  31408. });
  31409. window.addEventListener('e', null, options);
  31410. window.removeEventListener('e', null, options);
  31411. } catch (e) {}
  31412. // ignore
  31413. return supportsPassive;
  31414. }
  31415. },
  31416. {
  31417. /**
  31418. * @property MinContent
  31419. * @private
  31420. * @type {Boolean}
  31421. *
  31422. * Detects support for CSS "min-content"
  31423. */
  31424. name: 'CSSMinContent',
  31425. ready: true,
  31426. fn: function(doc, div) {
  31427. // As of 3/24/2017 IE/Edge have no min-content support, and firefox has
  31428. // partial/buggy support: https://bugzilla.mozilla.org/show_bug.cgi?id=135015
  31429. // This feature detector is designed to return false if there is not "full" support.
  31430. // eslint-disable-next-line max-len
  31431. 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>';
  31432. return div.firstChild.offsetHeight === 8;
  31433. }
  31434. },
  31435. {
  31436. name: 'ComputedSizeIncludesPadding',
  31437. ready: true,
  31438. fn: function(doc, div) {
  31439. var ret = false,
  31440. bd = document.body,
  31441. el, w;
  31442. if (window.getComputedStyle) {
  31443. el = document.createElement('div');
  31444. el.style.cssText = 'width:10px;padding:2px;' + '-webkit-box-sizing:border-box;box-sizing:border-box;';
  31445. bd.appendChild(el);
  31446. w = window.getComputedStyle(el, null).width;
  31447. ret = w === '10px';
  31448. bd.removeChild(el);
  31449. }
  31450. return ret;
  31451. }
  31452. },
  31453. {
  31454. name: 'inputEventData',
  31455. ready: false,
  31456. fn: function() {
  31457. return !!(window.InputEvent && 'data' in new InputEvent('input'));
  31458. }
  31459. },
  31460. /* eslint-disable indent */
  31461. // placeholder so legacy browser detectors can come/go cleanly
  31462. 0
  31463. ]
  31464. };
  31465. /* eslint-enable indent */
  31466. Ext.feature.tests.pop();
  31467. // remove the placeholder
  31468. Ext.supports = {};
  31469. Ext.feature.detect();
  31470. /**
  31471. * This class manages ready detection and handling. Direct use of this class is not
  31472. * recommended. Instead use `Ext.onReady`:
  31473. *
  31474. * Ext.onReady(function () {
  31475. * // DOM and Framework are ready...
  31476. * });
  31477. *
  31478. * ## DOM Ready
  31479. *
  31480. * The lowest-level of readiness is DOM readiness. This level implies only that the document
  31481. * body exists. Many things require the DOM to be ready for manipulation. If that is all
  31482. * that is required, the `Ext.onDocumentReady` method can be called to register a callback
  31483. * to be called as soon as the DOM is ready:
  31484. *
  31485. * Ext.onDocumentReady(function () {
  31486. * // the document body is ready
  31487. * });
  31488. *
  31489. * ## Framework Ready
  31490. *
  31491. * In production builds of applications it is common to have all of the code loaded before
  31492. * DOM ready, so the need to wait for "onReady" is often confused with only that concern.
  31493. * This is easy to understand, at least in part because historically `Ext.onReady` only
  31494. * waited for DOM ready.
  31495. *
  31496. * With the introduction of `Ext.Loader`, however, it became common for DOM ready to occur
  31497. * in the middle of dynamically loading code. If application code were executed at that
  31498. * time, any use of the yet-to-be-loaded classes would throw errors. As a consequence of
  31499. * this, the `Ext.onReady` mechanism was extended to wait for both DOM ready *and* all of
  31500. * the required classes to be loaded.
  31501. *
  31502. * When the framework enters or leaves a state where it is not ready (for example, the
  31503. * first dynamic load is requested or last load completes), `Ext.env.Ready` is informed.
  31504. * For example:
  31505. *
  31506. * Ext.env.Ready.block();
  31507. *
  31508. * //...
  31509. *
  31510. * Ext.env.Ready.unblock();
  31511. *
  31512. * When there are no blocks and the DOM is ready, the Framework is ready and the "onReady"
  31513. * callbacks are called.
  31514. *
  31515. * Priority can be used to control the ordering of onReady listeners, for example:
  31516. *
  31517. * Ext.onReady(function() {
  31518. *
  31519. * }, null, {
  31520. * priority: 100
  31521. * });
  31522. *
  31523. * Ready listeners with higher priorities will run sooner than those with lower priorities,
  31524. * the default priority being `0`. Internally the framework reserves priorities of 1000
  31525. * or greater, and -1000 or lesser for onReady handlers that must run before or after
  31526. * any application code. Applications should stick to using priorities in the -999 - 999
  31527. * range. The following priorities are currently in use by the framework:
  31528. *
  31529. * - Element_scroll rtl override: `1001`
  31530. * - Event system initialization: `2000`
  31531. * - Ext.dom.Element: `1500`
  31532. *
  31533. * @class Ext.env.Ready
  31534. * @singleton
  31535. * @private
  31536. * @since 5.0.0
  31537. */
  31538. Ext.env.Ready = {
  31539. // @define Ext.env.Ready
  31540. // @require Ext.env.Browser
  31541. // @require Ext.env.OS
  31542. // @require Ext.env.Feature
  31543. /**
  31544. * @property {Number} blocks The number of Framework readiness blocks.
  31545. * @private
  31546. */
  31547. blocks: (location.search || '').indexOf('ext-pauseReadyFire') > 0 ? 1 : 0,
  31548. /**
  31549. * @property {Number} bound This property stores the state of event listeners bound
  31550. * to the document or window to detect ready state.
  31551. * @private
  31552. */
  31553. bound: 0,
  31554. /**
  31555. * @property {Number} [delay=1]
  31556. * This allows the DOM listener thread to complete (usually desirable with mobWebkit,
  31557. * Gecko) before firing the entire onReady chain (high stack load on Loader). For mobile
  31558. * devices when running from Home Screen, the splash screen will not disappear until
  31559. * all external resource requests finish. This delay clears the splash screen.
  31560. * @private
  31561. */
  31562. delay: 1,
  31563. /**
  31564. * @property {Event[]} events An array of events that have triggered ready state. This
  31565. * is for diagnostic purposes only and is only available in debug builds.
  31566. * An array
  31567. * @private
  31568. */
  31569. events: [],
  31570. /**
  31571. * @property {Boolean} firing This property is `true` when we currently calling the
  31572. * listeners.
  31573. * @private
  31574. */
  31575. firing: false,
  31576. /**
  31577. * @property {Number} generation A counter of the number of mutations of `listeners`.
  31578. * @private
  31579. */
  31580. generation: 0,
  31581. /**
  31582. * @property {Object[]} listeners The set of listeners waiting for ready.
  31583. * @private
  31584. */
  31585. listeners: [],
  31586. /**
  31587. * @property {Number} nextId A counter so we can assign listeners an `id` to keep
  31588. * them in FIFO order.
  31589. * @private
  31590. */
  31591. nextId: 0,
  31592. /**
  31593. * @property {Number} sortGeneration A captured value of `generation` that indicates
  31594. * when the `listeners` were last sorted.
  31595. * @private
  31596. */
  31597. sortGeneration: 0,
  31598. /**
  31599. * @property {Number} state
  31600. * Holds the current ready state as managed by this class. The values possible are:
  31601. *
  31602. * * 0 - Not ready.
  31603. * * 1 - Ready detected but listeners are not yet notified.
  31604. * * 2 - Ready detected and listeners are notified. See also `firing`.
  31605. *
  31606. * @private
  31607. */
  31608. state: 0,
  31609. /**
  31610. * @property {Object} timer The handle from `setTimeout` for the delayed notification
  31611. * of ready.
  31612. * @private
  31613. */
  31614. timer: null,
  31615. /**
  31616. * Binds the appropriate browser event for checking if the DOM has loaded.
  31617. * @private
  31618. */
  31619. bind: function() {
  31620. var me = Ext.env.Ready,
  31621. doc = document;
  31622. if (!me.bound) {
  31623. // Test scenario where load is dynamic AFTER window.load
  31624. if (doc.readyState === 'complete') {
  31625. // Firefox4+ got support for this state, others already do.
  31626. me.onReadyEvent({
  31627. type: doc.readyState || 'body'
  31628. });
  31629. } else {
  31630. me.bound = 1;
  31631. if (Ext.browser.is.PhoneGap && !Ext.os.is.Desktop) {
  31632. me.bound = 2;
  31633. doc.addEventListener('deviceready', me.onReadyEvent, false);
  31634. }
  31635. doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false);
  31636. window.addEventListener('load', me.onReadyEvent, false);
  31637. }
  31638. }
  31639. },
  31640. block: function() {
  31641. ++this.blocks;
  31642. Ext.isReady = false;
  31643. },
  31644. /**
  31645. * This method starts the process of firing the ready event. This may be delayed based
  31646. * on the `delay` property.
  31647. * @private
  31648. */
  31649. fireReady: function() {
  31650. var me = Ext.env.Ready;
  31651. if (!me.state) {
  31652. Ext._readyTime = Ext.ticks();
  31653. Ext.isDomReady = true;
  31654. me.state = 1;
  31655. // As soon as we transition to domready, complete the feature detection:
  31656. Ext.feature.detect(true);
  31657. if (!me.delay) {
  31658. me.handleReady();
  31659. } else if (navigator.standalone) {
  31660. // When running from Home Screen, the splash screen will not disappear
  31661. // until all external resource requests finish.
  31662. // The first timeout clears the splash screen
  31663. // The second timeout allows inital HTML content to be displayed
  31664. me.timer = Ext.defer(function() {
  31665. me.timer = null;
  31666. me.handleReadySoon();
  31667. }, 1);
  31668. } else {
  31669. me.handleReadySoon();
  31670. }
  31671. }
  31672. },
  31673. /**
  31674. * This method iterates over the `listeners` and invokes them. This advances the
  31675. * `state` from 1 to 2 and ensure the proper subset of `listeners` are invoked.
  31676. * @private
  31677. */
  31678. handleReady: function() {
  31679. var me = this;
  31680. if (me.state === 1) {
  31681. me.state = 2;
  31682. Ext._beforeReadyTime = Ext.ticks();
  31683. me.invokeAll();
  31684. Ext._afterReadyTime = Ext.ticks();
  31685. }
  31686. },
  31687. /**
  31688. * This method is called to schedule a call to `handleReady` using a `setTimeout`. It
  31689. * ensures that only one timer is pending.
  31690. * @param {Number} [delay] If passed, this overrides the `delay` property.
  31691. * @private
  31692. */
  31693. handleReadySoon: function(delay) {
  31694. var me = this;
  31695. if (!me.timer) {
  31696. me.timer = Ext.defer(function() {
  31697. me.timer = null;
  31698. me.handleReady();
  31699. }, delay || me.delay);
  31700. }
  31701. },
  31702. /**
  31703. * This method invokes the given `listener` instance based on its options.
  31704. * @param {Object} listener
  31705. */
  31706. invoke: function(listener) {
  31707. var delay = listener.delay;
  31708. if (delay) {
  31709. Ext.defer(listener.fn, delay, listener.scope);
  31710. } else {
  31711. if (Ext.elevateFunction) {
  31712. Ext.elevateFunction(listener.fn, listener.scope);
  31713. } else {
  31714. listener.fn.call(listener.scope);
  31715. }
  31716. }
  31717. },
  31718. /**
  31719. * Invokes as many listeners as are appropriate given the current state. This should
  31720. * only be called when DOM ready is achieved. The remaining business of `blocks` is
  31721. * handled here.
  31722. */
  31723. invokeAll: function() {
  31724. if (Ext.elevateFunction) {
  31725. Ext.elevateFunction(this.doInvokeAll, this);
  31726. } else {
  31727. this.doInvokeAll();
  31728. }
  31729. },
  31730. doInvokeAll: function() {
  31731. var me = this,
  31732. listeners = me.listeners,
  31733. listener;
  31734. if (!me.blocks) {
  31735. // Since DOM is ready and we have no blocks, we mark the framework as ready.
  31736. Ext.isReady = true;
  31737. }
  31738. me.firing = true;
  31739. // NOTE: We cannot cache this length because each time through the loop a callback
  31740. // may have added new callbacks.
  31741. while (listeners.length) {
  31742. if (me.sortGeneration !== me.generation) {
  31743. me.sortGeneration = me.generation;
  31744. // This will happen just once on the first pass... if nothing is being
  31745. // added as we call the callbacks. This sorts the listeners such that the
  31746. // highest priority listener is at the *end* of the array ... so we can
  31747. // use pop (as opposed to shift) to extract it.
  31748. listeners.sort(me.sortFn);
  31749. }
  31750. listener = listeners.pop();
  31751. if (me.blocks && !listener.dom) {
  31752. // If we are blocked (i.e., only DOM ready) and this listener is not a
  31753. // DOM-ready listener we have reached the end of the line. The remaining
  31754. // listeners are Framework ready listeners.
  31755. listeners.push(listener);
  31756. break;
  31757. }
  31758. me.invoke(listener);
  31759. }
  31760. me.firing = false;
  31761. },
  31762. /**
  31763. * This method wraps the given listener pieces in a proper object for the `listeners`
  31764. * array and `invoke` methods.
  31765. * @param {Function} fn The method to call.
  31766. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  31767. * Defaults to the browser window.
  31768. * @param {Object} [options] An object with extra options.
  31769. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31770. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31771. * number will result in the callback being sorted before the others. Priorities
  31772. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31773. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  31774. * means full Framework and DOM readiness.
  31775. * @return {Object} The listener instance.
  31776. * @private
  31777. */
  31778. makeListener: function(fn, scope, options) {
  31779. var ret = {
  31780. fn: fn,
  31781. id: ++this.nextId,
  31782. // so sortFn can respect FIFO
  31783. scope: scope,
  31784. dom: false,
  31785. priority: 0
  31786. };
  31787. if (options) {
  31788. Ext.apply(ret, options);
  31789. }
  31790. ret.phase = ret.dom ? 0 : 1;
  31791. // to simplify the sortFn
  31792. return ret;
  31793. },
  31794. /**
  31795. * Adds a listener to be notified when the document is ready (before onload and before
  31796. * images are loaded).
  31797. *
  31798. * @param {Function} fn The method to call.
  31799. * @param {Object} [scope] The scope (`this` reference) in which the `fn` executes.
  31800. * Defaults to the browser window.
  31801. * @param {Object} [options] An object with extra options.
  31802. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  31803. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  31804. * number will result in the callback being sorted before the others. Priorities
  31805. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  31806. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  31807. * means full Framework and DOM readiness.
  31808. * @private
  31809. */
  31810. on: function(fn, scope, options) {
  31811. var me = Ext.env.Ready,
  31812. listener = me.makeListener(fn, scope, options);
  31813. if (me.state === 2 && !me.firing && (listener.dom || !me.blocks)) {
  31814. // If we are DOM ready (state === 2) and not currently in invokeAll (!firing)
  31815. // and this listener is ready to call (either a DOM ready listener or there
  31816. // are no blocks), then we need to invoke the listener now.
  31817. //
  31818. // Otherwise we can fall to the else block and push the listener. The eventual
  31819. // (or currently executing) call to handleReady or unblock will trigger its
  31820. // delivery in proper priority order.
  31821. me.invoke(listener);
  31822. } else {
  31823. me.listeners.push(listener);
  31824. ++me.generation;
  31825. if (!me.bound) {
  31826. // If we have never bound then bind the ready event now. If we have unbound
  31827. // the event then me.bound == -1 and we don't want to rebind it as the DOM
  31828. // is ready.
  31829. me.bind();
  31830. }
  31831. }
  31832. },
  31833. /**
  31834. * This is a generic event handler method attached to all of the various events that
  31835. * may indicate ready state. The first call to this method indicates ready state has
  31836. * been achieved.
  31837. * @param {Event} [ev] The event instance.
  31838. * @private
  31839. */
  31840. onReadyEvent: function(ev) {
  31841. var me = Ext.env.Ready;
  31842. if (Ext.elevateFunction) {
  31843. Ext.elevateFunction(me.doReadyEvent, me, arguments);
  31844. } else {
  31845. me.doReadyEvent(ev);
  31846. }
  31847. },
  31848. doReadyEvent: function(ev) {
  31849. var me = this;
  31850. if (ev && ev.type) {
  31851. me.events.push(ev);
  31852. }
  31853. if (me.bound > 0) {
  31854. me.unbind();
  31855. me.bound = -1;
  31856. }
  31857. // NOTE: *not* 0 or false - we never want to rebind!
  31858. if (!me.state) {
  31859. me.fireReady();
  31860. }
  31861. },
  31862. /**
  31863. * Sorts the `listeners` array by `phase` and `priority` such that the first listener
  31864. * to fire can be determined using `pop` on the `listeners` array.
  31865. * @private
  31866. */
  31867. sortFn: function(a, b) {
  31868. return -((a.phase - b.phase) || (b.priority - a.priority) || (a.id - b.id));
  31869. },
  31870. unblock: function() {
  31871. var me = this;
  31872. if (me.blocks) {
  31873. if (!--me.blocks) {
  31874. if (me.state === 2 && !me.firing) {
  31875. // We have already finished handleReady (the DOM ready handler) so
  31876. // this trigger just needs to dispatch all the remaining listeners.
  31877. me.invokeAll();
  31878. }
  31879. }
  31880. }
  31881. },
  31882. // if we are currently firing then invokeAll will pick up the Framework
  31883. // ready listeners automatically.
  31884. //
  31885. // If me.state < 2 then we are waiting for DOM ready so it will eventually
  31886. // call handleReady and invokeAll when everything is ready.
  31887. /**
  31888. * This method is called to remove all event listeners that may have been set up to
  31889. * detect ready state.
  31890. * @private
  31891. */
  31892. unbind: function() {
  31893. var me = this,
  31894. doc = document;
  31895. if (me.bound > 1) {
  31896. doc.removeEventListener('deviceready', me.onReadyEvent, false);
  31897. }
  31898. doc.removeEventListener('DOMContentLoaded', me.onReadyEvent, false);
  31899. window.removeEventListener('load', me.onReadyEvent, false);
  31900. }
  31901. };
  31902. (function() {
  31903. var Ready = Ext.env.Ready;
  31904. /*
  31905. * EXTJS-13522
  31906. * Although IE 9 has the DOMContentLoaded event available, usage of that causes
  31907. * timing issues when attempting to access document.namespaces (VmlCanvas.js).
  31908. * Consequently, even in IE 9 we need to use the legacy bind override for ready
  31909. * detection. This defers ready firing enough to allow access to the
  31910. * document.namespaces property.
  31911. *
  31912. * NOTE: this issue is very timing sensitive, and typically only displays itself
  31913. * when there is a large amount of latency between the browser and the server, and
  31914. * when testing against a built page (ext-all.js) and not a dev mode page.
  31915. */
  31916. if (Ext.isIE9m) {
  31917. /* Customized implementation for Legacy IE. The default implementation is
  31918. * configured for use with all other 'standards compliant' agents.
  31919. * References: http://javascript.nwbox.com/IEContentLoaded/
  31920. * licensed courtesy of http://developer.yahoo.com/yui/license.html
  31921. */
  31922. Ext.apply(Ready, {
  31923. /**
  31924. * Timer for doScroll polling
  31925. * @private
  31926. */
  31927. scrollTimer: null,
  31928. /**
  31929. * @private
  31930. */
  31931. readyStatesRe: /complete/i,
  31932. /**
  31933. * This strategy has minimal benefits for Sencha solutions that build
  31934. * themselves (ie. minimal initial page markup). However, progressively-enhanced
  31935. * pages (with image content and/or embedded frames) will benefit the most
  31936. * from it. Browser timer resolution is too poor to ensure a doScroll check
  31937. * more than once on a page loaded with minimal assets (the readystatechange
  31938. * event 'complete' usually beats the doScroll timer on a 'lightly-loaded'
  31939. * initial document).
  31940. * @private
  31941. */
  31942. pollScroll: function() {
  31943. var scrollable = true;
  31944. try {
  31945. document.documentElement.doScroll('left');
  31946. } catch (e) {
  31947. scrollable = false;
  31948. }
  31949. // on IE8, when running within an iFrame, document.body is not immediately
  31950. // available
  31951. if (scrollable && document.body) {
  31952. Ready.onReadyEvent({
  31953. type: 'doScroll'
  31954. });
  31955. } else {
  31956. // Minimize thrashing --
  31957. // adjusted for setTimeout's close-to-minimums (not too low),
  31958. // as this method SHOULD always be called once initially
  31959. Ready.scrollTimer = Ext.defer(Ready.pollScroll, 20);
  31960. }
  31961. return scrollable;
  31962. },
  31963. bind: function() {
  31964. var doc = document,
  31965. topContext;
  31966. if (Ready.bound) {
  31967. return;
  31968. }
  31969. // See if we are in an IFRAME? (doScroll ineffective here)
  31970. try {
  31971. topContext = window.frameElement === undefined;
  31972. } catch (e) {}
  31973. // If we throw an exception, it means we're probably getting access
  31974. // denied, which means we're in an iframe cross domain.
  31975. if (!topContext || !doc.documentElement.doScroll) {
  31976. Ready.pollScroll = Ext.emptyFn;
  31977. }
  31978. // then noop this test altogether
  31979. else if (Ready.pollScroll()) {
  31980. // starts scroll polling if necessary
  31981. return;
  31982. }
  31983. if (doc.readyState === 'complete') {
  31984. // Loaded AFTER initial document write/load...
  31985. Ready.onReadyEvent({
  31986. type: 'already ' + (doc.readyState || 'body')
  31987. });
  31988. } else {
  31989. doc.attachEvent('onreadystatechange', Ready.onReadyStateChange);
  31990. window.attachEvent('onload', Ready.onReadyEvent);
  31991. Ready.bound = 1;
  31992. }
  31993. },
  31994. unbind: function() {
  31995. document.detachEvent('onreadystatechange', Ready.onReadyStateChange);
  31996. window.detachEvent('onload', Ready.onReadyEvent);
  31997. if (Ext.isNumber(Ready.scrollTimer)) {
  31998. Ext.undefer(Ready.scrollTimer);
  31999. Ready.scrollTimer = null;
  32000. }
  32001. },
  32002. /**
  32003. * This event handler is called when the readyState changes.
  32004. * @private
  32005. */
  32006. onReadyStateChange: function() {
  32007. var state = document.readyState;
  32008. if (Ready.readyStatesRe.test(state)) {
  32009. Ready.onReadyEvent({
  32010. type: state
  32011. });
  32012. }
  32013. }
  32014. });
  32015. }
  32016. /**
  32017. * @property {Boolean} isDomReady
  32018. * `true` when the document body is ready for use.
  32019. * @member Ext
  32020. * @readonly
  32021. */
  32022. /**
  32023. * @property {Boolean} isReady
  32024. * `true` when `isDomReady` is true and the Framework is ready for use.
  32025. * @member Ext
  32026. * @readonly
  32027. */
  32028. /**
  32029. * @method onDocumentReady
  32030. * @member Ext
  32031. * Adds a listener to be notified when the document is ready (before onload and before
  32032. * images are loaded).
  32033. *
  32034. * @param {Function} fn The method to call.
  32035. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  32036. * executes. Defaults to the browser window.
  32037. * @param {Object} [options] An object with extra options.
  32038. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32039. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32040. * number will result in the callback being sorted before the others. Priorities
  32041. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32042. * @private
  32043. */
  32044. Ext.onDocumentReady = function(fn, scope, options) {
  32045. var opt = {
  32046. dom: true
  32047. };
  32048. if (options) {
  32049. Ext.apply(opt, options);
  32050. }
  32051. Ready.on(fn, scope, opt);
  32052. };
  32053. /**
  32054. * @method onReady
  32055. * @member Ext
  32056. * Adds a listener to be notified when the document is ready (before onload and before
  32057. * images are loaded).
  32058. *
  32059. * @param {Function} fn The method to call.
  32060. * @param {Object} [scope] The scope (`this` reference) in which the handler function
  32061. * executes. Defaults to the browser window.
  32062. * @param {Object} [options] An object with extra options.
  32063. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32064. * @param {Number} [options.priority=0] Relative priority of this callback. A larger
  32065. * number will result in the callback being sorted before the others. Priorities
  32066. * 1000 or greater and -1000 or lesser are reserved for internal framework use only.
  32067. * @param {Boolean} [options.dom=false] Pass `true` to only wait for DOM ready, `false`
  32068. * means full Framework and DOM readiness.
  32069. * numbers are reserved.
  32070. */
  32071. Ext.onReady = function(fn, scope, options) {
  32072. Ready.on(fn, scope, options);
  32073. };
  32074. // A shortcut method for onReady with a high priority
  32075. Ext.onInternalReady = function(fn, scope, options) {
  32076. Ready.on(fn, scope, Ext.apply({
  32077. priority: 1000
  32078. }, options));
  32079. };
  32080. Ready.bind();
  32081. }());
  32082. // @tag class
  32083. /**
  32084. * This class provides dynamic loading support for JavaScript classes. Application code
  32085. * does not typically need to call `Ext.Loader` except perhaps to configure path mappings
  32086. * when not using [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/).
  32087. *
  32088. * Ext.Loader.setPath('MyApp', 'app');
  32089. *
  32090. * When using Sencha Cmd, this is handled by the "bootstrap" provided by the application
  32091. * build script and such configuration is not necessary.
  32092. *
  32093. * # Typical Usage
  32094. *
  32095. * The `Ext.Loader` is most often used behind the scenes to satisfy class references in
  32096. * class declarations. Like so:
  32097. *
  32098. * Ext.define('MyApp.view.Main', {
  32099. * extend: 'Ext.panel.Panel',
  32100. *
  32101. * mixins: [
  32102. * 'MyApp.util.Mixin'
  32103. * ],
  32104. *
  32105. * requires: [
  32106. * 'Ext.grid.Panel'
  32107. * ],
  32108. *
  32109. * uses: [
  32110. * 'MyApp.util.Stuff'
  32111. * ]
  32112. * });
  32113. *
  32114. * In all of these cases, `Ext.Loader` is used internally to resolve these class names
  32115. * and ensure that the necessary class files are loaded.
  32116. *
  32117. * During development, these files are loaded individually for optimal debugging. For a
  32118. * production use, [Sencha Cmd](http://www.sencha.com/products/sencha-cmd/) will replace
  32119. * all of these strings with the actual resolved class references because it ensures that
  32120. * the classes are all contained in the build in the correct order. In development, these
  32121. * files will not be loaded until the `MyApp.view.Main` class indicates they are needed
  32122. * as shown above.
  32123. *
  32124. * # Loading Classes
  32125. *
  32126. * You can also use `Ext.Loader` directly to load classes or files. The simplest form of
  32127. * use is `{@link Ext#require}`.
  32128. *
  32129. * For example:
  32130. *
  32131. * Ext.require('MyApp.view.Main', function () {
  32132. * // On callback, the MyApp.view.Main class is now loaded
  32133. *
  32134. * var view = new MyApp.view.Main();
  32135. * });
  32136. *
  32137. * You can alternatively require classes by alias or wildcard.
  32138. *
  32139. * Ext.require('widget.window');
  32140. *
  32141. * Ext.require(['widget.window', 'layout.border', 'Ext.data.Connection']);
  32142. *
  32143. * Ext.require(['widget.*', 'layout.*', 'Ext.data.*']);
  32144. *
  32145. * The callback function is optional.
  32146. *
  32147. * **Note** Using `Ext.require` at global scope will cause `{@link Ext#onReady}` and
  32148. * `{@link Ext.app.Application#launch}` methods to be deferred until the required classes
  32149. * are loaded. It is these cases where the callback function is most often unnecessary.
  32150. *
  32151. * ## Using Excludes
  32152. *
  32153. * Alternatively, you can exclude what you don't need:
  32154. *
  32155. * // Include everything except Ext.tree.*
  32156. * Ext.exclude('Ext.tree.*').require('*');
  32157. *
  32158. * // Include all widgets except widget.checkbox* (this will exclude
  32159. * // widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.)
  32160. * Ext.exclude('widget.checkbox*').require('widget.*');
  32161. *
  32162. * # Dynamic Instantiation
  32163. *
  32164. * Another feature enabled by `Ext.Loader` is instantiation using class names or aliases.
  32165. *
  32166. * For example:
  32167. *
  32168. * var win = Ext.create({
  32169. * xtype: 'window',
  32170. *
  32171. * // or
  32172. * // xclass: 'Ext.window.Window'
  32173. *
  32174. * title: 'Hello'
  32175. * });
  32176. *
  32177. * This form of creation can be useful if the type to create (`window` in the above) is
  32178. * not known statically. Internally, `{@link Ext#method!create}` may need to *synchronously*
  32179. * load the desired class and its requirements. Doing this will generate a warning in
  32180. * the console:
  32181. *
  32182. * [Ext.Loader] Synchronously loading 'Ext.window.Window'...
  32183. *
  32184. * If you see these in your debug console, you should add the indicated class(es) to the
  32185. * appropriate `requires` array (as above) or make an `{@link Ext#require}` call.
  32186. *
  32187. *
  32188. * **Note** Using `{@link Ext#method!create}` has some performance overhead and is best reserved
  32189. * for cases where the target class is not known until run-time.
  32190. *
  32191. * @class Ext.Loader
  32192. * @singleton
  32193. */
  32194. Ext.Loader = (new function() {
  32195. // @define Ext.Loader
  32196. // @require Ext.Base
  32197. // @require Ext.Class
  32198. // @require Ext.ClassManager
  32199. // @require Ext.mixin.Watchable
  32200. // @require Ext.Function
  32201. // @require Ext.Array
  32202. // @require Ext.env.Ready
  32203. var Loader = this,
  32204. Manager = Ext.ClassManager,
  32205. // this is an instance of Ext.Inventory
  32206. Boot = Ext.Boot,
  32207. Class = Ext.Class,
  32208. Ready = Ext.env.Ready,
  32209. alias = Ext.Function.alias,
  32210. dependencyProperties = [
  32211. 'extend',
  32212. 'mixins',
  32213. 'requires'
  32214. ],
  32215. isInHistory = {},
  32216. history = [],
  32217. readyListeners = [],
  32218. usedClasses = [],
  32219. _requiresMap = {},
  32220. _config = {
  32221. /**
  32222. * @cfg {Boolean} [enabled=true]
  32223. * Whether or not to enable the dynamic dependency loading feature.
  32224. */
  32225. enabled: true,
  32226. /**
  32227. * @cfg {Boolean} [scriptChainDelay=false]
  32228. * millisecond delay between asynchronous script injection (prevents stack
  32229. * overflow on some user agents) 'false' disables delay but potentially
  32230. * increases stack load.
  32231. */
  32232. scriptChainDelay: false,
  32233. /**
  32234. * @cfg {Boolean} [disableCaching=true]
  32235. * Appends current timestamp to script files to prevent caching.
  32236. */
  32237. disableCaching: true,
  32238. /**
  32239. * @cfg {String} [disableCachingParam="_dc"]
  32240. * The get parameter name for the cache buster's timestamp.
  32241. */
  32242. disableCachingParam: '_dc',
  32243. /**
  32244. * @cfg {Object} paths
  32245. * The mapping from namespaces to file paths
  32246. *
  32247. * {
  32248. * 'Ext': '.', // This is set by default, Ext.layout.container.Container will be
  32249. * // loaded from ./layout/Container.js
  32250. *
  32251. * 'My': './src/my_own_folder' // My.layout.Container will be loaded from
  32252. * // ./src/my_own_folder/layout/Container.js
  32253. * }
  32254. *
  32255. * Note that all relative paths are relative to the current HTML document.
  32256. * If not being specified, for example, `Other.awesome.Class` will simply be
  32257. * loaded from `"./Other/awesome/Class.js"`.
  32258. */
  32259. paths: Manager.paths,
  32260. /**
  32261. * @cfg {Boolean} preserveScripts
  32262. * `false` to remove asynchronously loaded scripts, `true` to retain script
  32263. * element for browser debugger compatibility and improved load performance.
  32264. */
  32265. preserveScripts: true,
  32266. /**
  32267. * @cfg {String} scriptCharset
  32268. * Optional charset to specify encoding of dynamic script content.
  32269. */
  32270. scriptCharset: undefined
  32271. },
  32272. // These configs are delegated to Ext.Script and may need different names:
  32273. delegatedConfigs = {
  32274. disableCaching: true,
  32275. disableCachingParam: true,
  32276. preserveScripts: true,
  32277. scriptChainDelay: 'loadDelay'
  32278. };
  32279. Ext.apply(Loader, {
  32280. /**
  32281. * @private
  32282. */
  32283. isInHistory: isInHistory,
  32284. /**
  32285. * Flag indicating whether there are still files being loaded
  32286. * @private
  32287. */
  32288. isLoading: false,
  32289. /**
  32290. * An array of class names to keep track of the dependency loading order.
  32291. * This is not guaranteed to be the same everytime due to the asynchronous
  32292. * nature of the Loader.
  32293. *
  32294. * @property {Array} history
  32295. */
  32296. history: history,
  32297. /**
  32298. * Configuration
  32299. * @private
  32300. */
  32301. config: _config,
  32302. /**
  32303. * Maintain the list of listeners to execute when all required scripts are fully loaded
  32304. * @private
  32305. */
  32306. readyListeners: readyListeners,
  32307. /**
  32308. * Contains classes referenced in `uses` properties.
  32309. * @private
  32310. */
  32311. optionalRequires: usedClasses,
  32312. /**
  32313. * Map of fully qualified class names to an array of dependent classes.
  32314. * @private
  32315. */
  32316. requiresMap: _requiresMap,
  32317. /** @private */
  32318. hasFileLoadError: false,
  32319. /**
  32320. * The number of scripts loading via loadScript.
  32321. * @private
  32322. */
  32323. scriptsLoading: 0,
  32324. /**
  32325. * @private
  32326. */
  32327. classesLoading: {},
  32328. missingCount: 0,
  32329. missingQueue: {},
  32330. /**
  32331. * @private
  32332. */
  32333. syncModeEnabled: false,
  32334. init: function() {
  32335. // initalize the default path of the framework
  32336. var scripts = document.getElementsByTagName('script'),
  32337. src = scripts[scripts.length - 1].src,
  32338. path = src.substring(0, src.lastIndexOf('/') + 1),
  32339. meta = Ext._classPathMetadata,
  32340. microloader = Ext.Microloader,
  32341. manifest = Ext.manifest,
  32342. loadOrder, baseUrl, loadlen, l, loadItem;
  32343. if (src.indexOf("packages/core/src/") !== -1) {
  32344. path = path + "../../";
  32345. } else if (src.indexOf("/core/src/class/") !== -1) {
  32346. path = path + "../../../";
  32347. }
  32348. if (!Manager.getPath("Ext")) {
  32349. Manager.setPath('Ext', path + 'src');
  32350. }
  32351. // Pull in Cmd generated metadata if available.
  32352. if (meta) {
  32353. Ext._classPathMetadata = null;
  32354. Loader.addClassPathMappings(meta);
  32355. }
  32356. if (manifest) {
  32357. loadOrder = manifest.loadOrder;
  32358. // if the manifest paths were calculated as relative to the
  32359. // bootstrap file, then we need to prepend Boot.baseUrl to the
  32360. // paths before processing
  32361. baseUrl = Ext.Boot.baseUrl;
  32362. if (loadOrder && manifest.bootRelative) {
  32363. for (loadlen = loadOrder.length , l = 0; l < loadlen; l++) {
  32364. loadItem = loadOrder[l];
  32365. loadItem.path = baseUrl + loadItem.path;
  32366. loadItem.canonicalPath = true;
  32367. }
  32368. }
  32369. }
  32370. if (microloader) {
  32371. Ready.block();
  32372. microloader.onMicroloaderReady(function() {
  32373. Ready.unblock();
  32374. });
  32375. }
  32376. },
  32377. /**
  32378. * @method setConfig
  32379. * Set the configuration for the loader. This should be called right after ext-(debug).js
  32380. * is included in the page, and before Ext.onReady. i.e:
  32381. *
  32382. * <script type="text/javascript" src="ext-core-debug.js"></script>
  32383. * <script type="text/javascript">
  32384. * Ext.Loader.setConfig({
  32385. * enabled: true,
  32386. * paths: {
  32387. * 'My': 'my_own_path'
  32388. * }
  32389. * });
  32390. * </script>
  32391. * <script type="text/javascript">
  32392. * Ext.require(...);
  32393. *
  32394. * Ext.onReady(function() {
  32395. * // application code here
  32396. * });
  32397. * </script>
  32398. *
  32399. * Refer to config options of {@link Ext.Loader} for the list of possible properties
  32400. *
  32401. * @param {Object} config The config object to override the default values
  32402. * @return {Ext.Loader} this
  32403. */
  32404. setConfig: Ext.Function.flexSetter(function(name, value) {
  32405. var delegated = delegatedConfigs[name];
  32406. if (name === 'paths') {
  32407. Loader.setPath(value);
  32408. } else {
  32409. _config[name] = value;
  32410. if (delegated) {
  32411. Boot.setConfig((delegated === true) ? name : delegated, value);
  32412. }
  32413. }
  32414. return Loader;
  32415. }),
  32416. /**
  32417. * Get the config value corresponding to the specified name. If no name is given,
  32418. * will return the config object
  32419. *
  32420. * @param {String} name The config property name
  32421. * @return {Object}
  32422. */
  32423. getConfig: function(name) {
  32424. return name ? _config[name] : _config;
  32425. },
  32426. /**
  32427. * Sets the path of a namespace.
  32428. * For Example:
  32429. *
  32430. * Ext.Loader.setPath('Ext', '.');
  32431. *
  32432. * @param {String/Object} name See {@link Ext.Function#flexSetter flexSetter}
  32433. * @param {String} [path] See {@link Ext.Function#flexSetter flexSetter}
  32434. * @return {Ext.Loader} this
  32435. * @method
  32436. */
  32437. setPath: function() {
  32438. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  32439. Manager.setPath.apply(Manager, arguments);
  32440. return Loader;
  32441. },
  32442. /**
  32443. * Sets a batch of path entries
  32444. *
  32445. * @param {Object} paths a set of className: path mappings
  32446. * @return {Ext.Loader} this
  32447. */
  32448. addClassPathMappings: function(paths) {
  32449. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  32450. Manager.setPath(paths);
  32451. return Loader;
  32452. },
  32453. /**
  32454. * fixes up loader path configs by prepending Ext.Boot#baseUrl to the beginning
  32455. * of the path, then delegates to Ext.Loader#addClassPathMappings
  32456. * @param pathConfig
  32457. */
  32458. addBaseUrlClassPathMappings: function(pathConfig) {
  32459. var name;
  32460. for (name in pathConfig) {
  32461. pathConfig[name] = Boot.baseUrl + pathConfig[name];
  32462. }
  32463. Ext.Loader.addClassPathMappings(pathConfig);
  32464. },
  32465. /**
  32466. * Translates a className to a file path by adding the
  32467. * the proper prefix and converting the .'s to /'s. For example:
  32468. *
  32469. * Ext.Loader.setPath('My', '/path/to/My');
  32470. *
  32471. * // alerts '/path/to/My/awesome/Class.js'
  32472. * alert(Ext.Loader.getPath('My.awesome.Class'));
  32473. *
  32474. * Note that the deeper namespace levels, if explicitly set, are always resolved first.
  32475. * For example:
  32476. *
  32477. * Ext.Loader.setPath({
  32478. * 'My': '/path/to/lib',
  32479. * 'My.awesome': '/other/path/for/awesome/stuff',
  32480. * 'My.awesome.more': '/more/awesome/path'
  32481. * });
  32482. *
  32483. * // alerts '/other/path/for/awesome/stuff/Class.js'
  32484. * alert(Ext.Loader.getPath('My.awesome.Class'));
  32485. *
  32486. * // alerts '/more/awesome/path/Class.js'
  32487. * alert(Ext.Loader.getPath('My.awesome.more.Class'));
  32488. *
  32489. * // alerts '/path/to/lib/cool/Class.js'
  32490. * alert(Ext.Loader.getPath('My.cool.Class'));
  32491. *
  32492. * // alerts 'Unknown/strange/Stuff.js'
  32493. * alert(Ext.Loader.getPath('Unknown.strange.Stuff'));
  32494. *
  32495. * @param {String} className
  32496. * @return {String} path
  32497. */
  32498. getPath: function(className) {
  32499. // Paths are an Ext.Inventory thing and ClassManager is an instance of that:
  32500. return Manager.getPath(className);
  32501. },
  32502. require: function(expressions, fn, scope, excludes) {
  32503. var classNames;
  32504. if (excludes) {
  32505. return Loader.exclude(excludes).require(expressions, fn, scope);
  32506. }
  32507. classNames = Manager.getNamesByExpression(expressions);
  32508. return Loader.load(classNames, fn, scope);
  32509. },
  32510. syncRequire: function() {
  32511. var wasEnabled = Loader.syncModeEnabled,
  32512. ret;
  32513. Loader.syncModeEnabled = true;
  32514. ret = Loader.require.apply(Loader, arguments);
  32515. Loader.syncModeEnabled = wasEnabled;
  32516. return ret;
  32517. },
  32518. exclude: function(excludes) {
  32519. var selector = Manager.select({
  32520. require: function(classNames, fn, scope) {
  32521. return Loader.load(classNames, fn, scope);
  32522. },
  32523. syncRequire: function(classNames, fn, scope) {
  32524. var wasEnabled = Loader.syncModeEnabled,
  32525. ret;
  32526. Loader.syncModeEnabled = true;
  32527. ret = Loader.load(classNames, fn, scope);
  32528. Loader.syncModeEnabled = wasEnabled;
  32529. return ret;
  32530. }
  32531. });
  32532. selector.exclude(excludes);
  32533. return selector;
  32534. },
  32535. load: function(classNames, callback, scope) {
  32536. if (callback) {
  32537. if (callback.length) {
  32538. // If callback expects arguments, shim it with a function that will map
  32539. // the requires class(es) from the names we are given.
  32540. callback = Loader.makeLoadCallback(classNames, callback);
  32541. }
  32542. callback = callback.bind(scope || Ext.global);
  32543. }
  32544. /* eslint-disable-next-line vars-on-top */
  32545. var state = Manager.classState,
  32546. missingClassNames = [],
  32547. urls = [],
  32548. urlByClass = {},
  32549. numClasses = classNames.length,
  32550. className, i, numMissing;
  32551. for (i = 0; i < numClasses; ++i) {
  32552. className = Manager.resolveName(classNames[i]);
  32553. if (!Manager.isCreated(className)) {
  32554. missingClassNames.push(className);
  32555. if (!state[className]) {
  32556. urlByClass[className] = Loader.getPath(className);
  32557. urls.push(urlByClass[className]);
  32558. }
  32559. }
  32560. }
  32561. // If the dynamic dependency feature is not being used, throw an error
  32562. // if the dependencies are not defined
  32563. numMissing = missingClassNames.length;
  32564. if (numMissing) {
  32565. Loader.missingCount += numMissing;
  32566. Manager.onCreated(function() {
  32567. if (callback) {
  32568. Ext.callback(callback, scope, arguments);
  32569. }
  32570. Loader.checkReady();
  32571. }, Loader, missingClassNames);
  32572. if (!_config.enabled) {
  32573. Ext.raise("Ext.Loader is not enabled, so dependencies cannot be resolved " + "dynamically. Missing required class" + ((missingClassNames.length > 1) ? "es" : "") + ": " + missingClassNames.join(', '));
  32574. }
  32575. if (urls.length) {
  32576. Loader.loadScripts({
  32577. url: urls,
  32578. // scope will be this options object so we can pass these along:
  32579. _classNames: missingClassNames,
  32580. _urlByClass: urlByClass
  32581. });
  32582. } else {
  32583. // need to call checkReady here, as the _missingCoun
  32584. // may have transitioned from 0 to > 0, meaning we
  32585. // need to block ready
  32586. Loader.checkReady();
  32587. }
  32588. } else {
  32589. if (callback) {
  32590. callback.call(scope);
  32591. }
  32592. // need to call checkReady here, as the _missingCoun
  32593. // may have transitioned from 0 to > 0, meaning we
  32594. // need to block ready
  32595. Loader.checkReady();
  32596. }
  32597. if (Loader.syncModeEnabled) {
  32598. // Class may have been just loaded or was already loaded
  32599. if (numClasses === 1) {
  32600. return Manager.get(classNames[0]);
  32601. }
  32602. }
  32603. return Loader;
  32604. },
  32605. makeLoadCallback: function(classNames, callback) {
  32606. return function() {
  32607. var classes = [],
  32608. i = classNames.length;
  32609. while (i-- > 0) {
  32610. classes[i] = Manager.get(classNames[i]);
  32611. }
  32612. return callback.apply(this, classes);
  32613. };
  32614. },
  32615. onLoadFailure: function(request) {
  32616. var options = this,
  32617. entries = request.entries || [],
  32618. onError = options.onError,
  32619. error, entry, i;
  32620. Loader.hasFileLoadError = true;
  32621. --Loader.scriptsLoading;
  32622. if (onError) {
  32623. for (i = 0; i < entries.length; i++) {
  32624. entry = entries[i];
  32625. if (entry.error) {
  32626. error = new Error('Failed to load: ' + entry.url);
  32627. break;
  32628. }
  32629. }
  32630. error = error || new Error('Failed to load');
  32631. onError.call(options.userScope, options, error, request);
  32632. } else {
  32633. Ext.log.error("[Ext.Loader] Some requested files failed to load.");
  32634. }
  32635. Loader.checkReady();
  32636. },
  32637. onLoadSuccess: function() {
  32638. var options = this,
  32639. onLoad = options.onLoad,
  32640. classNames = options._classNames,
  32641. urlByClass = options._urlByClass,
  32642. state = Manager.classState,
  32643. missingQueue = Loader.missingQueue,
  32644. className, i, len;
  32645. --Loader.scriptsLoading;
  32646. if (onLoad) {
  32647. // TODO: need an adapter to convert to v4 onLoad signatures
  32648. onLoad.call(options.userScope, options);
  32649. }
  32650. // onLoad can cause more loads to start, so it must run first
  32651. // classNames is the array of *all* classes that load() was asked to load,
  32652. // including those that might have been already loaded but not yet created.
  32653. // urlByClass is a map of only those classes that we asked Boot to load.
  32654. for (i = 0 , len = classNames.length; i < len; i++) {
  32655. className = classNames[i];
  32656. // When a script is loaded and executed, we should have Ext.define() called
  32657. // for at least one of the classes in the list, which will set the state
  32658. // for that class. That by itself does not mean that the class is available
  32659. // *now* but it means that ClassManager is tracking it and will fire the
  32660. // onCreated callback that we set back in load().
  32661. // However if there is no state for the class, that may mean two things:
  32662. // either it is not a Ext class, or it is truly missing. In any case we need
  32663. // to watch for that thing ourselves, which we will do every checkReady().
  32664. if (!state[className]) {
  32665. missingQueue[className] = urlByClass[className];
  32666. }
  32667. }
  32668. Loader.checkReady();
  32669. },
  32670. // TODO: this timing of this needs to be deferred until all classes have had
  32671. // a chance to be created
  32672. reportMissingClasses: function() {
  32673. var missingQueue = Loader.missingQueue,
  32674. missingClasses = [],
  32675. missingPaths = [],
  32676. missingClassName;
  32677. if (!Loader.syncModeEnabled && !Loader.scriptsLoading && Loader.isLoading && !Loader.hasFileLoadError) {
  32678. for (missingClassName in missingQueue) {
  32679. missingClasses.push(missingClassName);
  32680. missingPaths.push(missingQueue[missingClassName]);
  32681. }
  32682. if (missingClasses.length) {
  32683. 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("', '"));
  32684. }
  32685. }
  32686. },
  32687. /**
  32688. * Add a new listener to be executed when all required scripts are fully loaded
  32689. *
  32690. * @param {Function} fn The function callback to be executed
  32691. * @param {Object} scope The execution scope (`this`) of the callback function.
  32692. * @param {Boolean} [withDomReady=true] Pass `false` to not also wait for document
  32693. * dom ready.
  32694. * @param {Object} [options] Additional callback options.
  32695. * @param {Number} [options.delay=0] A number of milliseconds to delay.
  32696. * @param {Number} [options.priority=0] Relative priority of this callback. Negative
  32697. * numbers are reserved.
  32698. */
  32699. onReady: function(fn, scope, withDomReady, options) {
  32700. var listener;
  32701. if (withDomReady) {
  32702. Ready.on(fn, scope, options);
  32703. } else {
  32704. listener = Ready.makeListener(fn, scope, options);
  32705. if (Loader.isLoading) {
  32706. readyListeners.push(listener);
  32707. } else {
  32708. Ready.invoke(listener);
  32709. }
  32710. }
  32711. },
  32712. /**
  32713. * @private
  32714. * Ensure that any classes referenced in the `uses` property are loaded.
  32715. */
  32716. addUsedClasses: function(classes) {
  32717. var cls, i, ln;
  32718. if (classes) {
  32719. classes = (typeof classes === 'string') ? [
  32720. classes
  32721. ] : classes;
  32722. for (i = 0 , ln = classes.length; i < ln; i++) {
  32723. cls = classes[i];
  32724. if (typeof cls === 'string' && !Ext.Array.contains(usedClasses, cls)) {
  32725. usedClasses.push(cls);
  32726. }
  32727. }
  32728. }
  32729. return Loader;
  32730. },
  32731. /**
  32732. * @private
  32733. */
  32734. triggerReady: function() {
  32735. var listener,
  32736. refClasses = usedClasses;
  32737. if (Loader.isLoading && refClasses.length) {
  32738. // Empty the array to eliminate potential recursive loop issue
  32739. usedClasses = [];
  32740. // this may immediately call us back if all 'uses' classes
  32741. // have been loaded
  32742. Loader.require(refClasses);
  32743. } else {
  32744. // Must clear this before calling callbacks. This will cause any new loads
  32745. // to call Ready.block() again. See below for more on this.
  32746. Loader.isLoading = false;
  32747. // These listeners are just those attached directly to Loader to wait for
  32748. // class loading only.
  32749. readyListeners.sort(Ready.sortFn);
  32750. // this method can be called with Loader.isLoading either true or false
  32751. // (can be called with false when all 'uses' classes are already loaded)
  32752. // this may bypass the above if condition
  32753. while (readyListeners.length && !Loader.isLoading) {
  32754. // we may re-enter triggerReady so we cannot necessarily iterate the
  32755. // readyListeners array
  32756. listener = readyListeners.pop();
  32757. Ready.invoke(listener);
  32758. }
  32759. // If the DOM is also ready, this will fire the normal onReady listeners.
  32760. // An astute observer would note that we may now be back to isLoading and
  32761. // so ask "Why you call unblock?". The reason is that we must match the
  32762. // calls to block and since we transitioned from isLoading to !isLoading
  32763. // here we must call unblock. If we have transitioned back to isLoading in
  32764. // the above loop it will have called block again so the counter will be
  32765. // increased and this call will not reduce the block count to 0. This is
  32766. // done by loadScripts.
  32767. Ready.unblock();
  32768. }
  32769. },
  32770. /**
  32771. * @private
  32772. * @param {String} className
  32773. */
  32774. historyPush: function(className) {
  32775. if (className && !isInHistory[className] && !Manager.overrideMap[className]) {
  32776. isInHistory[className] = true;
  32777. history.push(className);
  32778. }
  32779. return Loader;
  32780. },
  32781. /**
  32782. * This is an internal method that delegate content loading to the
  32783. * bootstrap layer.
  32784. * @private
  32785. * @param params
  32786. */
  32787. loadScripts: function(params) {
  32788. var manifest = Ext.manifest,
  32789. loadOrder = manifest && manifest.loadOrder,
  32790. loadOrderMap = manifest && manifest.loadOrderMap,
  32791. options;
  32792. ++Loader.scriptsLoading;
  32793. // if the load order map hasn't been created, create it now
  32794. // and cache on the manifest
  32795. if (loadOrder && !loadOrderMap) {
  32796. manifest.loadOrderMap = loadOrderMap = Boot.createLoadOrderMap(loadOrder);
  32797. }
  32798. // verify the loading state, as this may have transitioned us from
  32799. // not loading to loading
  32800. Loader.checkReady();
  32801. options = Ext.apply({
  32802. loadOrder: loadOrder,
  32803. loadOrderMap: loadOrderMap,
  32804. charset: _config.scriptCharset,
  32805. success: Loader.onLoadSuccess,
  32806. failure: Loader.onLoadFailure,
  32807. sync: Loader.syncModeEnabled,
  32808. _classNames: []
  32809. }, params);
  32810. options.userScope = options.scope;
  32811. options.scope = options;
  32812. Boot.load(options);
  32813. },
  32814. /**
  32815. * This method is provide for use by the bootstrap layer.
  32816. * @private
  32817. * @param {String[]} urls
  32818. */
  32819. loadScriptsSync: function(urls) {
  32820. var syncwas = Loader.syncModeEnabled;
  32821. Loader.syncModeEnabled = true;
  32822. Loader.loadScripts({
  32823. url: urls
  32824. });
  32825. Loader.syncModeEnabled = syncwas;
  32826. },
  32827. /**
  32828. * This method is provide for use by the bootstrap layer.
  32829. * @private
  32830. * @param {String[]} urls
  32831. */
  32832. loadScriptsSyncBasePrefix: function(urls) {
  32833. var syncwas = Loader.syncModeEnabled;
  32834. Loader.syncModeEnabled = true;
  32835. Loader.loadScripts({
  32836. url: urls,
  32837. prependBaseUrl: true
  32838. });
  32839. Loader.syncModeEnabled = syncwas;
  32840. },
  32841. /**
  32842. * Loads the specified script URL and calls the supplied callbacks. If this method
  32843. * is called before {@link Ext#isReady}, the script's load will delay the transition
  32844. * to ready. This can be used to load arbitrary scripts that may contain further
  32845. * {@link Ext#require Ext.require} calls.
  32846. *
  32847. * @param {Object/String/String[]} options The options object or simply the URL(s) to load.
  32848. * @param {String} options.url The URL from which to load the script.
  32849. * @param {Function} [options.onLoad] The callback to call on successful load.
  32850. * @param {Function} [options.onError] The callback to call on failure to load.
  32851. * @param {Object} [options.scope] The scope (`this`) for the supplied callbacks.
  32852. */
  32853. loadScript: function(options) {
  32854. var isString = typeof options === 'string',
  32855. isArray = options instanceof Array,
  32856. isObject = !isArray && !isString,
  32857. url = isObject ? options.url : options,
  32858. onError = isObject && options.onError,
  32859. onLoad = isObject && options.onLoad,
  32860. scope = isObject && options.scope,
  32861. request = {
  32862. url: url,
  32863. scope: scope,
  32864. onLoad: onLoad,
  32865. onError: onError,
  32866. _classNames: []
  32867. };
  32868. Loader.loadScripts(request);
  32869. },
  32870. /**
  32871. * @private
  32872. */
  32873. checkMissingQueue: function() {
  32874. var missingQueue = Loader.missingQueue,
  32875. newQueue = {},
  32876. missing = 0,
  32877. name;
  32878. for (name in missingQueue) {
  32879. // If class state is available for the name, that means ClassManager
  32880. // is tracking it and will fire callback when it is created.
  32881. // We only need to track non-class things in the Loader.
  32882. if (!(Manager.classState[name] || Manager.isCreated(name))) {
  32883. newQueue[name] = missingQueue[name];
  32884. missing++;
  32885. }
  32886. }
  32887. Loader.missingCount = missing;
  32888. Loader.missingQueue = newQueue;
  32889. },
  32890. /**
  32891. * @private
  32892. */
  32893. checkReady: function() {
  32894. var wasLoading = Loader.isLoading,
  32895. isLoading;
  32896. Loader.checkMissingQueue();
  32897. isLoading = Loader.missingCount + Loader.scriptsLoading;
  32898. if (isLoading && !wasLoading) {
  32899. Ready.block();
  32900. Loader.isLoading = !!isLoading;
  32901. } else if (!isLoading && wasLoading) {
  32902. Loader.triggerReady();
  32903. }
  32904. if (!Loader.scriptsLoading && Loader.missingCount) {
  32905. // Things look bad, but since load requests may come later, defer this
  32906. // for a bit then check if things are still stuck.
  32907. Ext.defer(function() {
  32908. var name;
  32909. if (!Loader.scriptsLoading && Loader.missingCount) {
  32910. Ext.log.error('[Loader] The following classes failed to load:');
  32911. for (name in Loader.missingQueue) {
  32912. Ext.log.error('[Loader] ' + name + ' from ' + Loader.missingQueue[name]);
  32913. }
  32914. }
  32915. }, 1000);
  32916. }
  32917. }
  32918. });
  32919. /**
  32920. * Loads all classes by the given names and all their direct dependencies; optionally
  32921. * executes the given callback function when finishes, within the optional scope.
  32922. *
  32923. * @param {String/String[]} expressions The class, classes or wildcards to load.
  32924. * @param {Function} [fn] The callback function.
  32925. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  32926. * @member Ext
  32927. * @method require
  32928. */
  32929. Ext.require = alias(Loader, 'require');
  32930. /**
  32931. * Synchronously loads all classes by the given names and all their direct dependencies;
  32932. * optionally executes the given callback function when finishes, within the optional scope.
  32933. *
  32934. * @param {String/String[]} expressions The class, classes or wildcards to load.
  32935. * @param {Function} [fn] The callback function.
  32936. * @param {Object} [scope] The execution scope (`this`) of the callback function.
  32937. * @member Ext
  32938. * @method syncRequire
  32939. */
  32940. Ext.syncRequire = alias(Loader, 'syncRequire');
  32941. /**
  32942. * Explicitly exclude files from being loaded. Useful when used in conjunction with a
  32943. * broad include expression. Can be chained with more `require` and `exclude` methods,
  32944. * for example:
  32945. *
  32946. * Ext.exclude('Ext.data.*').require('*');
  32947. *
  32948. * Ext.exclude('widget.button*').require('widget.*');
  32949. *
  32950. * @param {String/String[]} excludes
  32951. * @return {Object} Contains `exclude`, `require` and `syncRequire` methods for chaining.
  32952. * @member Ext
  32953. * @method exclude
  32954. */
  32955. Ext.exclude = alias(Loader, 'exclude');
  32956. /**
  32957. * @cfg {String[]} requires
  32958. * @member Ext.Class
  32959. * List of classes that have to be loaded before instantiating this class.
  32960. * For example:
  32961. *
  32962. * Ext.define('Mother', {
  32963. * requires: ['Child'],
  32964. * giveBirth: function() {
  32965. * // we can be sure that child class is available.
  32966. * return new Child();
  32967. * }
  32968. * });
  32969. */
  32970. Class.registerPreprocessor('loader', function(cls, data, hooks, continueFn) {
  32971. if (Ext.classSystemMonitor) {
  32972. Ext.classSystemMonitor(cls, 'Ext.Loader#loaderPreprocessor', arguments);
  32973. }
  32974. /* eslint-disable-next-line vars-on-top */
  32975. var me = this,
  32976. dependencies = [],
  32977. dependency,
  32978. className = Manager.getName(cls),
  32979. i, j, ln, subLn, value, propertyName, propertyValue, requiredMap;
  32980. /*
  32981. Loop through the dependencyProperties, look for string class names and push
  32982. them into a stack, regardless of whether the property's value is a string, array or object.
  32983. For example:
  32984. {
  32985. extend: 'Ext.MyClass',
  32986. requires: ['Ext.some.OtherClass'],
  32987. mixins: {
  32988. thing: 'Foo.bar.Thing';
  32989. }
  32990. }
  32991. which will later be transformed into:
  32992. {
  32993. extend: Ext.MyClass,
  32994. requires: [Ext.some.OtherClass],
  32995. mixins: {
  32996. thing: Foo.bar.Thing;
  32997. }
  32998. }
  32999. */
  33000. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  33001. propertyName = dependencyProperties[i];
  33002. if (data.hasOwnProperty(propertyName)) {
  33003. propertyValue = data[propertyName];
  33004. if (typeof propertyValue === 'string') {
  33005. dependencies.push(propertyValue);
  33006. } else if (propertyValue instanceof Array) {
  33007. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  33008. value = propertyValue[j];
  33009. if (typeof value === 'string') {
  33010. dependencies.push(value);
  33011. }
  33012. }
  33013. } else if (typeof propertyValue !== 'function') {
  33014. for (j in propertyValue) {
  33015. if (propertyValue.hasOwnProperty(j)) {
  33016. value = propertyValue[j];
  33017. if (typeof value === 'string') {
  33018. dependencies.push(value);
  33019. }
  33020. }
  33021. }
  33022. }
  33023. }
  33024. }
  33025. if (dependencies.length === 0) {
  33026. return;
  33027. }
  33028. if (className) {
  33029. _requiresMap[className] = dependencies;
  33030. }
  33031. /* eslint-disable-next-line vars-on-top */
  33032. var manifestClasses = Ext.manifest && Ext.manifest.classes,
  33033. deadlockPath = [],
  33034. detectDeadlock;
  33035. /*
  33036. * Automatically detect deadlocks before-hand,
  33037. * will throw an error with detailed path for ease of debugging. Examples
  33038. * of deadlock cases:
  33039. *
  33040. * - A extends B, then B extends A
  33041. * - A requires B, B requires C, then C requires A
  33042. *
  33043. * The detectDeadlock function will recursively transverse till the leaf, hence
  33044. * it can detect deadlocks no matter how deep the path is. However we don't need
  33045. * to run this check if the class name is in the manifest: that means Cmd has
  33046. * already resolved all dependencies for this class with no deadlocks.
  33047. */
  33048. if (className && (!manifestClasses || !manifestClasses[className])) {
  33049. requiredMap = Loader.requiredByMap || (Loader.requiredByMap = {});
  33050. for (i = 0 , ln = dependencies.length; i < ln; i++) {
  33051. dependency = dependencies[i];
  33052. (requiredMap[dependency] || (requiredMap[dependency] = [])).push(className);
  33053. }
  33054. detectDeadlock = function(cls) {
  33055. var requires = _requiresMap[cls],
  33056. dep, i, ln;
  33057. deadlockPath.push(cls);
  33058. if (requires) {
  33059. if (Ext.Array.contains(requires, className)) {
  33060. Ext.Error.raise("Circular requirement detected! '" + className + "' and '" + deadlockPath[1] + "' mutually require each other. " + "Path: " + deadlockPath.join(' -> ') + " -> " + deadlockPath[0]);
  33061. }
  33062. for (i = 0 , ln = requires.length; i < ln; i++) {
  33063. dep = requires[i];
  33064. if (!isInHistory[dep]) {
  33065. detectDeadlock(requires[i]);
  33066. }
  33067. }
  33068. }
  33069. };
  33070. detectDeadlock(className);
  33071. }
  33072. (className ? Loader.exclude(className) : Loader).require(dependencies, function() {
  33073. var i, ln, j, subLn, k;
  33074. for (i = 0 , ln = dependencyProperties.length; i < ln; i++) {
  33075. propertyName = dependencyProperties[i];
  33076. if (data.hasOwnProperty(propertyName)) {
  33077. propertyValue = data[propertyName];
  33078. if (typeof propertyValue === 'string') {
  33079. data[propertyName] = Manager.get(propertyValue);
  33080. } else if (propertyValue instanceof Array) {
  33081. for (j = 0 , subLn = propertyValue.length; j < subLn; j++) {
  33082. value = propertyValue[j];
  33083. if (typeof value === 'string') {
  33084. data[propertyName][j] = Manager.get(value);
  33085. }
  33086. }
  33087. } else if (typeof propertyValue !== 'function') {
  33088. for (k in propertyValue) {
  33089. if (propertyValue.hasOwnProperty(k)) {
  33090. value = propertyValue[k];
  33091. if (typeof value === 'string') {
  33092. data[propertyName][k] = Manager.get(value);
  33093. }
  33094. }
  33095. }
  33096. }
  33097. }
  33098. }
  33099. continueFn.call(me, cls, data, hooks);
  33100. });
  33101. return false;
  33102. }, true, 'after', 'className');
  33103. /**
  33104. * @cfg {String[]} uses
  33105. * @member Ext.Class
  33106. * List of optional classes to load together with this class. These aren't neccessarily loaded
  33107. * before this class is created, but are guaranteed to be available before Ext.onReady
  33108. * listeners are invoked. For example:
  33109. *
  33110. * Ext.define('Mother', {
  33111. * uses: ['Child'],
  33112. * giveBirth: function() {
  33113. * // This code might, or might not work:
  33114. * // return new Child();
  33115. *
  33116. * // Instead use Ext.create() to load the class at the spot if not loaded already:
  33117. * return Ext.create('Child');
  33118. * }
  33119. * });
  33120. */
  33121. Manager.registerPostprocessor('uses', function(name, cls, data) {
  33122. var uses = data.uses,
  33123. classNames;
  33124. if (Ext.classSystemMonitor) {
  33125. Ext.classSystemMonitor(cls, 'Ext.Loader#usesPostprocessor', arguments);
  33126. }
  33127. if (uses) {
  33128. classNames = Manager.getNamesByExpression(data.uses);
  33129. Loader.addUsedClasses(classNames);
  33130. }
  33131. });
  33132. Manager.onCreated(Loader.historyPush);
  33133. Loader.init();
  33134. }());
  33135. //-----------------------------------------------------------------------------
  33136. // Use performance.now when available to keep timestamps consistent.
  33137. Ext._endTime = Ext.ticks();
  33138. // This hook is to allow tools like DynaTrace to deterministically detect the availability
  33139. // of Ext.onReady. Since Loader takes over Ext.onReady this must be done here and not in
  33140. // Ext.env.Ready.
  33141. if (Ext._beforereadyhandler) {
  33142. Ext._beforereadyhandler();
  33143. }
  33144. /**
  33145. * @class Ext.util.Positionable
  33146. */
  33147. Ext.define('Ext.overrides.util.Positionable', {
  33148. override: 'Ext.util.Positionable',
  33149. /**
  33150. * @method alignTo
  33151. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  33152. * HTMLElement, or id of the element to align to.
  33153. * @param {String} [alignment="tl-bl?"] The position to align to
  33154. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  33155. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33156. * Element animation config object
  33157. * @return {Ext.util.Positionable} this
  33158. */
  33159. /**
  33160. * @method anchorTo
  33161. * Anchors an element to another element and realigns it when the window is resized.
  33162. * @param {Ext.util.Positionable/HTMLElement/String} anchorToEl The Positionable,
  33163. * HTMLElement, or id of the element to align to.
  33164. * @param {String} [alignment="tl-bl?"] The position to align to
  33165. * @param {Number[]} [offsets] Offset the positioning by [x, y]
  33166. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33167. * Element animation config object
  33168. * @param {Boolean/Number} [monitorScroll=50] True to monitor body scroll and
  33169. * reposition. If this parameter is a number, it is used as the buffer delay in
  33170. * milliseconds.
  33171. * @param {Function} [callback] The function to call after the animation finishes
  33172. * @return {Ext.util.Positionable} this
  33173. */
  33174. anchorTo: function(anchorToEl, alignment, offsets, animate, monitorScroll, callback) {
  33175. var me = this,
  33176. scroll = !Ext.isEmpty(monitorScroll),
  33177. action = function() {
  33178. me.mixins.positionable.alignTo.call(me, anchorToEl, alignment, offsets, animate);
  33179. Ext.callback(callback, me);
  33180. },
  33181. anchor = me.getAnchor();
  33182. // previous listener anchor, remove it
  33183. me.removeAnchor();
  33184. Ext.apply(anchor, {
  33185. fn: action,
  33186. scroll: scroll
  33187. });
  33188. Ext.on('resize', action, null);
  33189. if (scroll) {
  33190. Ext.getWin().on('scroll', action, null, {
  33191. buffer: !isNaN(monitorScroll) ? monitorScroll : 50
  33192. });
  33193. }
  33194. action();
  33195. // align immediately
  33196. return me;
  33197. },
  33198. getAnchor: function() {
  33199. var el = this.el,
  33200. data, anchor;
  33201. if (!el || !el.dom) {
  33202. return;
  33203. }
  33204. data = el.getData();
  33205. anchor = data._anchor;
  33206. if (!anchor) {
  33207. anchor = data._anchor = {};
  33208. }
  33209. return anchor;
  33210. },
  33211. alignTo: function(element, position, offsets, /* private (documented in ext) */
  33212. animate) {
  33213. var me = this,
  33214. el = me.el,
  33215. newMaxHeight, newRegion;
  33216. // Release any height constraint prior to aligning if we are shrinkwrap height.
  33217. if (me.isComponent && me.getSizeModel().height.shrinkWrap) {
  33218. if (me.maxHeight) {
  33219. me.setMaxHeight(null);
  33220. }
  33221. newMaxHeight = true;
  33222. }
  33223. newRegion = me.getAlignToRegion(element, position, offsets, me.minHeight || 150);
  33224. me.setXY([
  33225. newRegion.x,
  33226. newRegion.y
  33227. ], el.anim && !!animate ? el.anim(animate) : false);
  33228. // Impose calculated height constraint.
  33229. if (newMaxHeight && (newMaxHeight = newRegion.getHeight()) !== me.getHeight()) {
  33230. me.setMaxHeight(newMaxHeight);
  33231. }
  33232. return me;
  33233. },
  33234. /**
  33235. * @method move
  33236. * Move the element relative to its current position.
  33237. * @param {String} direction Possible values are:
  33238. *
  33239. * - `"l"` (or `"left"`)
  33240. * - `"r"` (or `"right"`)
  33241. * - `"t"` (or `"top"`, or `"up"`)
  33242. * - `"b"` (or `"bottom"`, or `"down"`)
  33243. *
  33244. * @param {Number} distance How far to move the element in pixels
  33245. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33246. * Element animation config object
  33247. */
  33248. /**
  33249. * Remove any anchor to this element. See {@link #anchorTo}.
  33250. * @return {Ext.util.Positionable} this
  33251. */
  33252. removeAnchor: function() {
  33253. var anchor = this.getAnchor();
  33254. if (anchor && anchor.fn) {
  33255. Ext.un('resize', anchor.fn);
  33256. if (anchor.scroll) {
  33257. Ext.getWin().on('scroll', anchor.fn);
  33258. }
  33259. delete anchor.fn;
  33260. }
  33261. return this;
  33262. },
  33263. /**
  33264. * @method setBox
  33265. * Sets the element's box. If animate is true then x, y, width, and height will be
  33266. * animated concurrently.
  33267. * @param {Object} box The box to fill {x, y, width, height}
  33268. * @param {Boolean/Object} [animate] true for the default animation or a standard
  33269. * Element animation config object
  33270. * @return {Ext.util.Positionable} this
  33271. */
  33272. setBox: function(box, animate) {
  33273. var me = this;
  33274. if (box.isRegion) {
  33275. box = {
  33276. x: box.left,
  33277. y: box.top,
  33278. width: box.right - box.left,
  33279. height: box.bottom - box.top
  33280. };
  33281. }
  33282. if (animate) {
  33283. me.constrainBox(box);
  33284. me.animate(Ext.applyIf({
  33285. to: box,
  33286. listeners: {
  33287. afteranimate: Ext.Function.bind(me.afterSetPosition, me, [
  33288. box.x,
  33289. box.y
  33290. ])
  33291. }
  33292. }, animate));
  33293. } else {
  33294. me.callParent([
  33295. box
  33296. ]);
  33297. }
  33298. return me;
  33299. }
  33300. });
  33301. /**
  33302. * @method setX
  33303. * Sets the X position of the DOM element based on page coordinates.
  33304. * @param {Number} x The X position
  33305. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33306. * Element animation config object
  33307. * @return {Ext.util.Positionable} this
  33308. */
  33309. /**
  33310. * @method setXY
  33311. * Sets the position of the DOM element in page coordinates.
  33312. * @param {Number[]} pos Contains X & Y [x, y] values for new position (coordinates
  33313. * are page-based)
  33314. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33315. * Element animation config object
  33316. * @return {Ext.util.Positionable} this
  33317. */
  33318. /**
  33319. * @method setY
  33320. * Sets the Y position of the DOM element based on page coordinates.
  33321. * @param {Number} y The Y position
  33322. * @param {Boolean/Object} [animate] True for the default animation, or a standard
  33323. * Element animation config object
  33324. * @return {Ext.util.Positionable} this
  33325. */
  33326. /**
  33327. * @class Ext.event.Event
  33328. */
  33329. Ext.define('Ext.overrides.event.Event', {
  33330. override: 'Ext.event.Event',
  33331. /**
  33332. * @method injectEvent
  33333. * @member Ext.event.Event
  33334. * Injects a DOM event using the data in this object and (optionally) a new target.
  33335. * This is a low-level technique and not likely to be used by application code. The
  33336. * currently supported event types are:
  33337. * <p><b>HTMLEvents</b></p>
  33338. * <ul>
  33339. * <li>load</li>
  33340. * <li>unload</li>
  33341. * <li>select</li>
  33342. * <li>change</li>
  33343. * <li>submit</li>
  33344. * <li>reset</li>
  33345. * <li>resize</li>
  33346. * <li>scroll</li>
  33347. * </ul>
  33348. * <p><b>MouseEvents</b></p>
  33349. * <ul>
  33350. * <li>click</li>
  33351. * <li>dblclick</li>
  33352. * <li>mousedown</li>
  33353. * <li>mouseup</li>
  33354. * <li>mouseover</li>
  33355. * <li>mousemove</li>
  33356. * <li>mouseout</li>
  33357. * </ul>
  33358. * <p><b>UIEvents</b></p>
  33359. * <ul>
  33360. * <li>focusin</li>
  33361. * <li>focusout</li>
  33362. * <li>activate</li>
  33363. * <li>focus</li>
  33364. * <li>blur</li>
  33365. * </ul>
  33366. * @param {Ext.Element/HTMLElement} target (optional) If specified, the target for the event.
  33367. * This is likely to be used when relaying a DOM event. If not specified, {@link #getTarget}
  33368. * is used to determine the target.
  33369. */
  33370. injectEvent: (function() {
  33371. var API,
  33372. dispatchers = {},
  33373. // keyed by event type (e.g., 'mousedown')
  33374. crazyIEButtons;
  33375. // Good reference: http://developer.yahoo.com/yui/docs/UserAction.js.html
  33376. // IE9 has createEvent, but this code causes major problems with htmleditor (it
  33377. // blocks all mouse events and maybe more). TODO
  33378. if (!Ext.isIE9m && document.createEvent) {
  33379. // if (DOM compliant)
  33380. API = {
  33381. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  33382. var event = doc.createEvent('HTMLEvents');
  33383. event.initEvent(type, bubbles, cancelable);
  33384. return event;
  33385. },
  33386. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  33387. var event = doc.createEvent('MouseEvents'),
  33388. view = doc.defaultView || window;
  33389. if (event.initMouseEvent) {
  33390. event.initMouseEvent(type, bubbles, cancelable, view, detail, clientX, clientY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);
  33391. } else {
  33392. // old Safari
  33393. event = doc.createEvent('UIEvents');
  33394. event.initEvent(type, bubbles, cancelable);
  33395. event.view = view;
  33396. event.detail = detail;
  33397. event.screenX = clientX;
  33398. event.screenY = clientY;
  33399. event.clientX = clientX;
  33400. event.clientY = clientY;
  33401. event.ctrlKey = ctrlKey;
  33402. event.altKey = altKey;
  33403. event.metaKey = metaKey;
  33404. event.shiftKey = shiftKey;
  33405. event.button = button;
  33406. event.relatedTarget = relatedTarget;
  33407. }
  33408. return event;
  33409. },
  33410. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  33411. var event = doc.createEvent('UIEvents'),
  33412. view = doc.defaultView || window;
  33413. event.initUIEvent(type, bubbles, cancelable, view, detail);
  33414. return event;
  33415. },
  33416. fireEvent: function(target, type, event) {
  33417. target.dispatchEvent(event);
  33418. }
  33419. };
  33420. } else if (document.createEventObject) {
  33421. // else if (IE)
  33422. crazyIEButtons = {
  33423. 0: 1,
  33424. 1: 4,
  33425. 2: 2
  33426. };
  33427. API = {
  33428. createHtmlEvent: function(doc, type, bubbles, cancelable) {
  33429. var event = doc.createEventObject();
  33430. event.bubbles = bubbles;
  33431. event.cancelable = cancelable;
  33432. return event;
  33433. },
  33434. createMouseEvent: function(doc, type, bubbles, cancelable, detail, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) {
  33435. var event = doc.createEventObject();
  33436. event.bubbles = bubbles;
  33437. event.cancelable = cancelable;
  33438. event.detail = detail;
  33439. event.screenX = clientX;
  33440. event.screenY = clientY;
  33441. event.clientX = clientX;
  33442. event.clientY = clientY;
  33443. event.ctrlKey = ctrlKey;
  33444. event.altKey = altKey;
  33445. event.shiftKey = shiftKey;
  33446. event.metaKey = metaKey;
  33447. event.button = crazyIEButtons[button] || button;
  33448. event.relatedTarget = relatedTarget;
  33449. // cannot assign to/fromElement
  33450. return event;
  33451. },
  33452. createUIEvent: function(doc, type, bubbles, cancelable, detail) {
  33453. var event = doc.createEventObject();
  33454. event.bubbles = bubbles;
  33455. event.cancelable = cancelable;
  33456. return event;
  33457. },
  33458. fireEvent: function(target, type, event) {
  33459. target.fireEvent('on' + type, event);
  33460. }
  33461. };
  33462. }
  33463. //----------------
  33464. // HTMLEvents
  33465. Ext.Object.each({
  33466. load: [
  33467. false,
  33468. false
  33469. ],
  33470. unload: [
  33471. false,
  33472. false
  33473. ],
  33474. select: [
  33475. true,
  33476. false
  33477. ],
  33478. change: [
  33479. true,
  33480. false
  33481. ],
  33482. submit: [
  33483. true,
  33484. true
  33485. ],
  33486. reset: [
  33487. true,
  33488. false
  33489. ],
  33490. resize: [
  33491. true,
  33492. false
  33493. ],
  33494. scroll: [
  33495. true,
  33496. false
  33497. ]
  33498. }, function(name, value) {
  33499. var bubbles = value[0],
  33500. cancelable = value[1];
  33501. dispatchers[name] = function(targetEl, srcEvent) {
  33502. var e = API.createHtmlEvent(name, bubbles, cancelable);
  33503. API.fireEvent(targetEl, name, e);
  33504. };
  33505. });
  33506. //----------------
  33507. // MouseEvents
  33508. function createMouseEventDispatcher(type, detail) {
  33509. var cancelable = (type !== 'mousemove');
  33510. return function(targetEl, srcEvent) {
  33511. var xy = srcEvent.getXY(),
  33512. e;
  33513. 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);
  33514. API.fireEvent(targetEl, type, e);
  33515. };
  33516. }
  33517. Ext.each([
  33518. 'click',
  33519. 'dblclick',
  33520. 'mousedown',
  33521. 'mouseup',
  33522. 'mouseover',
  33523. 'mousemove',
  33524. 'mouseout'
  33525. ], function(eventName) {
  33526. dispatchers[eventName] = createMouseEventDispatcher(eventName, 1);
  33527. });
  33528. //----------------
  33529. // UIEvents
  33530. Ext.Object.each({
  33531. focusin: [
  33532. true,
  33533. false
  33534. ],
  33535. focusout: [
  33536. true,
  33537. false
  33538. ],
  33539. activate: [
  33540. true,
  33541. true
  33542. ],
  33543. focus: [
  33544. false,
  33545. false
  33546. ],
  33547. blur: [
  33548. false,
  33549. false
  33550. ]
  33551. }, function(name, value) {
  33552. var bubbles = value[0],
  33553. cancelable = value[1];
  33554. dispatchers[name] = function(targetEl, srcEvent) {
  33555. var e = API.createUIEvent(targetEl.ownerDocument, name, bubbles, cancelable, 1);
  33556. API.fireEvent(targetEl, name, e);
  33557. };
  33558. });
  33559. //---------
  33560. if (!API) {
  33561. // not even sure what ancient browsers fall into this category...
  33562. dispatchers = {};
  33563. // never mind all those we just built :P
  33564. API = {};
  33565. }
  33566. function cannotInject(target, srcEvent) {}
  33567. // TODO log something
  33568. return function(target) {
  33569. var me = this,
  33570. dispatcher = dispatchers[me.type] || cannotInject,
  33571. t = target ? (target.dom || target) : me.getTarget();
  33572. dispatcher(t, me);
  33573. };
  33574. }()),
  33575. // call to produce method
  33576. preventDefault: function(browserOnly) {
  33577. var me = this,
  33578. event = me.browserEvent,
  33579. parentEvent = me.parentEvent,
  33580. unselectable, target, fn;
  33581. // This check is for IE8/9. The event object may have been
  33582. // invalidated, so we can't delve into the details of it. If so,
  33583. // just fall out gracefully and don't attempt to do anything.
  33584. // eslint-disable-next-line valid-typeof
  33585. if (typeof event.type !== 'unknown') {
  33586. // In some cases we want to prevent default on the browser event
  33587. // but keep propagating it through our event system. For example,
  33588. // in Checkbox selection where the cells with checkboxes should
  33589. // prevent focusing on mousedown but still fire the click event.
  33590. if (!browserOnly) {
  33591. me.defaultPrevented = true;
  33592. }
  33593. // if the event was created by prototype-chaining a new object to an existing event
  33594. // instance, we need to make sure the parent event is defaultPrevented as well.
  33595. if (parentEvent) {
  33596. parentEvent.defaultPrevented = true;
  33597. }
  33598. if (event.preventDefault) {
  33599. event.preventDefault();
  33600. } else {
  33601. // The purpose of the code below is for preventDefault to stop focus from
  33602. // occurring like it does in other modern browsers. This only happens in
  33603. // IE8/9 when using attachEvent. The use of unselectable seems the most reliable
  33604. // way to prevent this from happening. We need to use a timeout to restore the
  33605. // unselectable state because if we don't setting it has no effect. It's important
  33606. // to set the atrribute to 'on' as opposed to just setting the property on the
  33607. // DOM element. See the link below for a discussion on the issue:
  33608. // http://bugs.jquery.com/ticket/10345
  33609. if (event.type === 'mousedown') {
  33610. target = event.target;
  33611. unselectable = target.getAttribute('unselectable');
  33612. if (unselectable !== 'on') {
  33613. target.setAttribute('unselectable', 'on');
  33614. fn = function() {
  33615. target.setAttribute('unselectable', unselectable);
  33616. };
  33617. // This function is hard to track, with a potential to be called
  33618. // for any HtmlElement in the document. It may be a Fly, it may
  33619. // not belong to any Component, and it may even be created by
  33620. // 3rd party code that we have no control over and cannot intercept
  33621. // the element being destroyed.
  33622. // On the other hand, the function is pretty simple, cannot lead
  33623. // to memory leaks and is only fired once. So, no harm no foul.
  33624. fn.$skipTimerCheck = true;
  33625. Ext.defer(fn, 1);
  33626. }
  33627. }
  33628. // IE9 and earlier do not support preventDefault
  33629. event.returnValue = false;
  33630. // Some keys events require setting the keyCode to -1 to be prevented
  33631. // all ctrl + X and F1 -> F12
  33632. if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
  33633. event.keyCode = -1;
  33634. }
  33635. }
  33636. }
  33637. return me;
  33638. },
  33639. deprecated: {
  33640. '5.0': {
  33641. methods: {
  33642. /**
  33643. * @method clone
  33644. * @member Ext.event.Event
  33645. * Clones this event.
  33646. * @return {Ext.event.Event} The cloned copy
  33647. * @deprecated 5.0.0 This method is deprecated.
  33648. */
  33649. clone: function() {
  33650. return new this.self(this.browserEvent, this);
  33651. }
  33652. }
  33653. }
  33654. }
  33655. }, function() {
  33656. var Event = this,
  33657. btnMap;
  33658. if (Ext.isIE9m) {
  33659. btnMap = {
  33660. 0: 0,
  33661. 1: 0,
  33662. 4: 1,
  33663. 2: 2
  33664. };
  33665. Event.override({
  33666. statics: {
  33667. /**
  33668. * @member Ext.event.Event
  33669. * When events are attached using IE's attachEvent API instead of
  33670. * addEventListener accessing any members of an event object asynchronously
  33671. * results in "Member not found" error. To work around this we fabricate
  33672. * our own event object by copying all of its members to a new object.
  33673. * @param {Event} browserEvent The native browser event object
  33674. * @private
  33675. * @static
  33676. */
  33677. enableIEAsync: function(browserEvent) {
  33678. var name,
  33679. fakeEvent = {};
  33680. for (name in browserEvent) {
  33681. fakeEvent[name] = browserEvent[name];
  33682. }
  33683. return fakeEvent;
  33684. }
  33685. },
  33686. constructor: function(event, info, touchesMap, identifiers) {
  33687. var me = this;
  33688. me.callParent([
  33689. event,
  33690. info,
  33691. touchesMap,
  33692. identifiers
  33693. ]);
  33694. me.button = btnMap[event.button];
  33695. if (event.type === 'contextmenu') {
  33696. // IE8/9 reports click as 0, so we can at least attempt to infer here
  33697. me.button = 2;
  33698. }
  33699. // IE8 can throw an error when trying to access properties on a browserEvent
  33700. // object when the event has been buffered or delayed. Cache them here
  33701. // so we can access them later.
  33702. me.toElement = event.toElement;
  33703. me.fromElement = event.fromElement;
  33704. },
  33705. mouseLeaveRe: /(mouseout|mouseleave)/,
  33706. mouseEnterRe: /(mouseover|mouseenter)/,
  33707. /**
  33708. * @method enableIEAsync
  33709. * @member Ext.event.Event
  33710. * @inheritdoc Ext.event.Event#static-method-enableIEAsync
  33711. * @private
  33712. */
  33713. enableIEAsync: function(browserEvent) {
  33714. this.browserEvent = this.self.enableIEAsync(browserEvent);
  33715. },
  33716. getRelatedTarget: function(selector, maxDepth, returnEl) {
  33717. var me = this,
  33718. type, target;
  33719. if (!me.relatedTarget) {
  33720. type = me.type;
  33721. if (me.mouseLeaveRe.test(type)) {
  33722. target = me.toElement;
  33723. } else if (me.mouseEnterRe.test(type)) {
  33724. target = me.fromElement;
  33725. }
  33726. if (target) {
  33727. me.relatedTarget = me.self.resolveTextNode(target);
  33728. }
  33729. }
  33730. return me.callParent([
  33731. selector,
  33732. maxDepth,
  33733. returnEl
  33734. ]);
  33735. }
  33736. });
  33737. // We place these listeners to capture Tab and Shift-Tab key strokes
  33738. // and pass this information in the focus/blur event if it happens
  33739. // between keydown/keyup pair.
  33740. document.attachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  33741. document.attachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  33742. window.attachEvent('onunload', function() {
  33743. document.detachEvent('onkeydown', Ext.event.Event.globalTabKeyDown);
  33744. document.detachEvent('onkeyup', Ext.event.Event.globalTabKeyUp);
  33745. });
  33746. }
  33747. });
  33748. Ext.define('Ext.overrides.event.publisher.Dom', {
  33749. override: 'Ext.event.publisher.Dom'
  33750. }, function(DomPublisher) {
  33751. var focusEvents = {
  33752. focus: true,
  33753. focusin: true,
  33754. focusout: true,
  33755. blur: true
  33756. };
  33757. if (Ext.isIE10m) {
  33758. DomPublisher.override({
  33759. isEventBlocked: function(e) {
  33760. if (!focusEvents[e.type]) {
  33761. return this.callParent([
  33762. e
  33763. ]);
  33764. }
  33765. // eslint-disable-next-line vars-on-top
  33766. var body = document.body,
  33767. ev = e.browserEvent,
  33768. el = Ext.synchronouslyFocusing;
  33769. /* eslint-disable max-len, brace-style */
  33770. // This horrid hack is necessary to work around the issue with input elements
  33771. // in IE10m that can fail to focus under certain conditions. See comment in
  33772. // Ext.dom.Element override.
  33773. 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))) {
  33774. return true;
  33775. }
  33776. /* eslint-enable max-len, brace-style */
  33777. return false;
  33778. }
  33779. });
  33780. }
  33781. if (Ext.isIE9m) {
  33782. // eslint-disable-next-line vars-on-top
  33783. var docElement = document.documentElement,
  33784. docBody = document.body,
  33785. prototype = DomPublisher.prototype,
  33786. onDirectEvent, onDirectCaptureEvent;
  33787. // eslint-disable-line no-unused-vars
  33788. prototype.target = document;
  33789. prototype.directBoundListeners = {};
  33790. // This method gets bound to the element scope in addDirectListener so that
  33791. // the currentTarget can be captured using "this".
  33792. onDirectEvent = function(e, publisher, capture) {
  33793. e.target = e.srcElement || window;
  33794. e.currentTarget = this;
  33795. if (capture) {
  33796. // Although directly attached capture listeners are not supported in IE9m
  33797. // we still need to call the handler so at least the event fires.
  33798. publisher.onDirectCaptureEvent(e);
  33799. } else {
  33800. publisher.onDirectEvent(e);
  33801. }
  33802. };
  33803. onDirectCaptureEvent = function(e, publisher) {
  33804. e.target = e.srcElement || window;
  33805. e.currentTarget = this;
  33806. // this, not DomPublisher
  33807. publisher.onDirectCaptureEvent(e);
  33808. };
  33809. DomPublisher.override({
  33810. addDelegatedListener: function(eventName) {
  33811. this.delegatedListeners[eventName] = 1;
  33812. // Use attachEvent for IE9 and below. Even though IE9 strict supports
  33813. // addEventListener, it has issues with using synthetic events.
  33814. this.target.attachEvent('on' + eventName, this.onDelegatedEvent);
  33815. },
  33816. removeDelegatedListener: function(eventName) {
  33817. delete this.delegatedListeners[eventName];
  33818. this.target.detachEvent('on' + eventName, this.onDelegatedEvent);
  33819. },
  33820. addDirectListener: function(eventName, element, capture) {
  33821. var me = this,
  33822. dom = element.dom,
  33823. // binding the listener to the element allows us to capture the
  33824. // "currentTarget" (see onDirectEvent)
  33825. boundFn = Ext.Function.bind(onDirectEvent, dom, [
  33826. me,
  33827. capture
  33828. ], true),
  33829. directBoundListeners = me.directBoundListeners,
  33830. handlers = directBoundListeners[eventName] || (directBoundListeners[eventName] = {});
  33831. handlers[dom.id] = boundFn;
  33832. // may be called with an SVG element here, which
  33833. // does not have the attachEvent method on IE 9 strict
  33834. if (dom.attachEvent) {
  33835. dom.attachEvent('on' + eventName, boundFn);
  33836. } else {
  33837. me.callParent([
  33838. eventName,
  33839. element,
  33840. capture
  33841. ]);
  33842. }
  33843. },
  33844. removeDirectListener: function(eventName, element, capture) {
  33845. var dom = element.dom;
  33846. if (dom.detachEvent) {
  33847. dom.detachEvent('on' + eventName, this.directBoundListeners[eventName][dom.id]);
  33848. } else {
  33849. this.callParent([
  33850. eventName,
  33851. element,
  33852. capture
  33853. ]);
  33854. }
  33855. },
  33856. doDelegatedEvent: function(e) {
  33857. e.target = e.srcElement || window;
  33858. if (e.type === 'focusin') {
  33859. // IE8 sometimes happen to focus <html> element instead of the body
  33860. // eslint-disable-next-line max-len
  33861. e.relatedTarget = e.fromElement === docBody || e.fromElement === docElement ? null : e.fromElement;
  33862. } else if (e.type === 'focusout') {
  33863. // eslint-disable-next-line max-len
  33864. e.relatedTarget = e.toElement === docBody || e.toElement === docElement ? null : e.toElement;
  33865. }
  33866. return this.callParent([
  33867. e
  33868. ]);
  33869. }
  33870. });
  33871. // can't capture any events without addEventListener. Have to have direct
  33872. // listeners for every event that does not bubble.
  33873. Ext.apply(prototype.directEvents, prototype.captureEvents);
  33874. // These do not bubble in IE9m so have to attach direct listeners as well.
  33875. Ext.apply(prototype.directEvents, {
  33876. change: 1,
  33877. input: 1,
  33878. paste: 1
  33879. });
  33880. prototype.captureEvents = {};
  33881. }
  33882. });
  33883. Ext.define('Ext.overrides.event.publisher.Gesture', {
  33884. override: 'Ext.event.publisher.Gesture'
  33885. }, function() {
  33886. if (Ext.isIE9m) {
  33887. this.override({
  33888. updateTouches: function(e, isEnd) {
  33889. var browserEvent = e.browserEvent,
  33890. xy = e.getXY();
  33891. // I don't always set pageX and pageY on the event object, but when I do
  33892. // it's because the Gesture publisher expects an event object that has them.
  33893. browserEvent.pageX = xy[0];
  33894. browserEvent.pageY = xy[1];
  33895. this.callParent([
  33896. e,
  33897. isEnd
  33898. ]);
  33899. },
  33900. doDelegatedEvent: function(e) {
  33901. // Workaround IE's "Member not found" errors when accessing an event
  33902. // object asynchronously. Needed for all gesture handlers because
  33903. // they use requestAnimationFrame (see enableIEAsync for more details)
  33904. this.callParent([
  33905. Ext.event.Event.enableIEAsync(e)
  33906. ]);
  33907. }
  33908. });
  33909. }
  33910. });
  33911. /**
  33912. * @class Ext.dom.Element
  33913. * @override Ext.dom.Element
  33914. */
  33915. Ext.define('Ext.overrides.dom.Element', (function() {
  33916. var Element,
  33917. // we cannot do this yet "= Ext.dom.Element"
  33918. WIN = window,
  33919. DOC = document,
  33920. HIDDEN = 'hidden',
  33921. ISCLIPPED = 'isClipped',
  33922. OVERFLOW = 'overflow',
  33923. OVERFLOWX = 'overflow-x',
  33924. OVERFLOWY = 'overflow-y',
  33925. ORIGINALCLIP = 'originalClip',
  33926. HEIGHT = 'height',
  33927. WIDTH = 'width',
  33928. VISIBILITY = 'visibility',
  33929. DISPLAY = 'display',
  33930. NONE = 'none',
  33931. OFFSETS = 'offsets',
  33932. CLIP = 'clip',
  33933. ORIGINALDISPLAY = 'originalDisplay',
  33934. VISMODE = 'visibilityMode',
  33935. ISVISIBLE = 'isVisible',
  33936. OFFSETCLASS = Ext.baseCSSPrefix + 'hidden-offsets',
  33937. CLIPCLASS = Ext.baseCSSPrefix + 'hidden-clip',
  33938. /* eslint-disable indent */
  33939. boxMarkup = [
  33940. '<div class="{0}-tl" role="presentation">',
  33941. '<div class="{0}-tr" role="presentation">',
  33942. '<div class="{0}-tc" role="presentation"></div>',
  33943. '</div>',
  33944. '</div>',
  33945. '<div class="{0}-ml" role="presentation">',
  33946. '<div class="{0}-mr" role="presentation">',
  33947. '<div class="{0}-mc" role="presentation"></div>',
  33948. '</div>',
  33949. '</div>',
  33950. '<div class="{0}-bl" role="presentation">',
  33951. '<div class="{0}-br" role="presentation">',
  33952. '<div class="{0}-bc" role="presentation"></div>',
  33953. '</div>',
  33954. '</div>'
  33955. ].join(''),
  33956. /* eslint-enable indent */
  33957. scriptTagRe = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  33958. replaceScriptTagRe = /(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,
  33959. srcRe = /\ssrc=(['"])(.*?)\1/i,
  33960. nonSpaceRe = /\S/,
  33961. typeRe = /\stype=(['"])(.*?)\1/i,
  33962. adjustDirect2DTableRe = /table-row|table-.*-group/,
  33963. msRe = /^-ms-/,
  33964. camelRe = /(-[a-z])/gi,
  33965. camelReplaceFn = function(m, a) {
  33966. return a.charAt(1).toUpperCase();
  33967. },
  33968. XMASKED = Ext.baseCSSPrefix + "masked",
  33969. XMASKEDRELATIVE = Ext.baseCSSPrefix + "masked-relative",
  33970. EXTELMASKMSG = Ext.baseCSSPrefix + "mask-msg",
  33971. bodyRe = /^body/i,
  33972. propertyCache = {},
  33973. getVisMode = function(el) {
  33974. var data = el.getData(),
  33975. visMode = data[VISMODE];
  33976. if (visMode === undefined) {
  33977. data[VISMODE] = visMode = Element.VISIBILITY;
  33978. }
  33979. return visMode;
  33980. },
  33981. emptyRange = DOC.createRange ? DOC.createRange() : null,
  33982. syncContentFly;
  33983. if (Ext.isIE8) {
  33984. // eslint-disable-next-line vars-on-top
  33985. var garbageBin = DOC.createElement('div'),
  33986. destroyQueue = [],
  33987. // prevent memory leaks in IE8
  33988. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  33989. // This function is called to fully destroy an element on a timer so that code
  33990. // following the remove call can still access the element.
  33991. clearGarbage,
  33992. clearGarbageFn = function() {
  33993. var len = destroyQueue.length,
  33994. i;
  33995. for (i = 0; i < len; i++) {
  33996. garbageBin.appendChild(destroyQueue[i]);
  33997. }
  33998. garbageBin.innerHTML = '';
  33999. destroyQueue.length = 0;
  34000. };
  34001. clearGarbageFn.$skipTimerCheck = true;
  34002. clearGarbage = Ext.Function.createBuffered(clearGarbageFn, 10);
  34003. }
  34004. return {
  34005. override: 'Ext.dom.Element',
  34006. mixins: [
  34007. 'Ext.util.Animate'
  34008. ],
  34009. uses: [
  34010. 'Ext.dom.GarbageCollector',
  34011. 'Ext.dom.Fly',
  34012. 'Ext.event.publisher.MouseEnterLeave',
  34013. 'Ext.fx.Manager',
  34014. 'Ext.fx.Anim'
  34015. ],
  34016. skipGarbageCollection: false,
  34017. _init: function(E) {
  34018. Element = E;
  34019. // now we can poke this into closure scope
  34020. // We want to expose destroyQueue on the prototype for testing purposes
  34021. if (WIN.__UNIT_TESTING__) {
  34022. E.destroyQueue = destroyQueue;
  34023. }
  34024. },
  34025. statics: {
  34026. normalize: function(prop) {
  34027. if (prop === 'float') {
  34028. prop = Ext.supports.Float ? 'cssFloat' : 'styleFloat';
  34029. }
  34030. // For '-ms-foo' we need msFoo
  34031. return propertyCache[prop] || (propertyCache[prop] = prop.replace(msRe, 'ms-').replace(camelRe, camelReplaceFn));
  34032. }
  34033. },
  34034. /**
  34035. * Convenience method for constructing a KeyMap
  34036. * @param {String/Number/Number[]/Object} key Either a string with the keys to listen for,
  34037. * the numeric key code, array of key codes or an object with the following options:
  34038. * @param {Number/Array} key.key
  34039. * @param {Boolean} key.shift
  34040. * @param {Boolean} key.ctrl
  34041. * @param {Boolean} key.alt
  34042. * @param {Function} fn The function to call
  34043. * @param {Object} [scope] The scope (`this` reference) in which the specified function
  34044. * is executed. Defaults to this Element.
  34045. * @return {Ext.util.KeyMap} The KeyMap created
  34046. */
  34047. addKeyListener: function(key, fn, scope) {
  34048. var config;
  34049. if (typeof key !== 'object' || Ext.isArray(key)) {
  34050. config = {
  34051. target: this,
  34052. key: key,
  34053. fn: fn,
  34054. scope: scope
  34055. };
  34056. } else {
  34057. config = {
  34058. target: this,
  34059. key: key.key,
  34060. shift: key.shift,
  34061. ctrl: key.ctrl,
  34062. alt: key.alt,
  34063. fn: fn,
  34064. scope: scope
  34065. };
  34066. }
  34067. return new Ext.util.KeyMap(config);
  34068. },
  34069. /**
  34070. * Creates a KeyMap for this element
  34071. * @param {Object} config The KeyMap config. See {@link Ext.util.KeyMap} for more details
  34072. * @return {Ext.util.KeyMap} The KeyMap created
  34073. */
  34074. addKeyMap: function(config) {
  34075. return new Ext.util.KeyMap(Ext.apply({
  34076. target: this
  34077. }, config));
  34078. },
  34079. /**
  34080. * @private
  34081. * Returns the fractional portion of this element's measurement in the given dimension.
  34082. * (IE9+ only)
  34083. * @return {Number}
  34084. */
  34085. adjustDirect2DDimension: function(dimension) {
  34086. var me = this,
  34087. dom = me.dom,
  34088. display = me.getStyle('display'),
  34089. inlineDisplay = dom.style.display,
  34090. inlinePosition = dom.style.position,
  34091. originIndex = dimension === WIDTH ? 0 : 1,
  34092. currentStyle = dom.currentStyle,
  34093. floating;
  34094. if (display === 'inline') {
  34095. dom.style.display = 'inline-block';
  34096. }
  34097. dom.style.position = display.match(adjustDirect2DTableRe) ? 'absolute' : 'static';
  34098. // floating will contain digits that appears after the decimal point
  34099. // if height or width are set to auto we fallback to msTransformOrigin calculation
  34100. // Use currentStyle here instead of getStyle. In some difficult to reproduce
  34101. // instances it resets the scrollWidth of the element
  34102. floating = (parseFloat(currentStyle[dimension]) || parseFloat(currentStyle.msTransformOrigin.split(' ')[originIndex]) * 2) % 1;
  34103. dom.style.position = inlinePosition;
  34104. if (display === 'inline') {
  34105. dom.style.display = inlineDisplay;
  34106. }
  34107. return floating;
  34108. },
  34109. /**
  34110. * @private
  34111. */
  34112. afterAnimate: function() {
  34113. var shadow = this.shadow;
  34114. if (shadow && !shadow.disabled && !shadow.animate) {
  34115. shadow.show();
  34116. }
  34117. },
  34118. /**
  34119. * @private
  34120. */
  34121. anchorAnimX: function(anchor) {
  34122. var xName = (anchor === 'l') ? 'right' : 'left';
  34123. this.dom.style[xName] = '0px';
  34124. },
  34125. /**
  34126. * @private
  34127. * process the passed fx configuration.
  34128. */
  34129. anim: function(config) {
  34130. if (!Ext.isObject(config)) {
  34131. return (config) ? {} : false;
  34132. }
  34133. // eslint-disable-next-line vars-on-top
  34134. var me = this,
  34135. duration = config.duration || Ext.fx.Anim.prototype.duration,
  34136. easing = config.easing || 'ease',
  34137. animConfig;
  34138. if (config.stopAnimation) {
  34139. me.stopAnimation();
  34140. }
  34141. Ext.applyIf(config, Ext.fx.Manager.getFxDefaults(me.id));
  34142. // Clear any 'paused' defaults.
  34143. Ext.fx.Manager.setFxDefaults(me.id, {
  34144. delay: 0
  34145. });
  34146. animConfig = {
  34147. // Pass the DOM reference. That's tested first so will be converted
  34148. // to an Ext.fx.Target fastest.
  34149. target: me.dom,
  34150. remove: config.remove,
  34151. alternate: config.alternate || false,
  34152. duration: duration,
  34153. easing: easing,
  34154. callback: config.callback,
  34155. listeners: config.listeners,
  34156. iterations: config.iterations || 1,
  34157. scope: config.scope,
  34158. block: config.block,
  34159. concurrent: config.concurrent,
  34160. delay: config.delay || 0,
  34161. paused: true,
  34162. keyframes: config.keyframes,
  34163. from: config.from || {},
  34164. to: Ext.apply({}, config),
  34165. userConfig: config
  34166. };
  34167. Ext.apply(animConfig.to, config.to);
  34168. // Anim API properties - backward compat
  34169. delete animConfig.to.to;
  34170. delete animConfig.to.from;
  34171. delete animConfig.to.remove;
  34172. delete animConfig.to.alternate;
  34173. delete animConfig.to.keyframes;
  34174. delete animConfig.to.iterations;
  34175. delete animConfig.to.listeners;
  34176. delete animConfig.to.target;
  34177. delete animConfig.to.paused;
  34178. delete animConfig.to.callback;
  34179. delete animConfig.to.scope;
  34180. delete animConfig.to.duration;
  34181. delete animConfig.to.easing;
  34182. delete animConfig.to.concurrent;
  34183. delete animConfig.to.block;
  34184. delete animConfig.to.stopAnimation;
  34185. delete animConfig.to.delay;
  34186. return animConfig;
  34187. },
  34188. /**
  34189. * Calls `{@link #addAnimation}` and returns this Element (for call chaining). For
  34190. * details, see `{@link #addAnimation}`.
  34191. *
  34192. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  34193. * Note that the {@link Ext.fx.Anim#to to} config is required.
  34194. * @return {Ext.dom.Element} this
  34195. */
  34196. animate: function(config) {
  34197. this.addAnimation(config);
  34198. return this;
  34199. },
  34200. /**
  34201. * Starts a custom animation on this Element.
  34202. *
  34203. * The following properties may be specified in `from`, `to`, and `keyframe` objects:
  34204. *
  34205. * - `x` - The page X position in pixels.
  34206. * - `y` - The page Y position in pixels
  34207. * - `left` - The element's CSS `left` value. Units must be supplied.
  34208. * - `top` - The element's CSS `top` value. Units must be supplied.
  34209. * - `width` - The element's CSS `width` value. Units must be supplied.
  34210. * - `height` - The element's CSS `height` value. Units must be supplied.
  34211. * - `scrollLeft` - The element's `scrollLeft` value.
  34212. * - `scrollTop` - The element's `scrollTop` value.
  34213. * - `opacity` - The element's `opacity` value (between `0` and `1`).
  34214. *
  34215. * **Be aware** that animating an Element which is being used by an Ext Component
  34216. * without in some way informing the Component about the changed element state will
  34217. * result in incorrect Component behaviour. This is because the Component will be
  34218. * using the old state of the element. To avoid this problem, it is now possible
  34219. * to directly animate certain properties of Components.
  34220. *
  34221. * @param {Object} config Configuration for {@link Ext.fx.Anim}.
  34222. * Note that the {@link Ext.fx.Anim#to to} config is required.
  34223. * @return {Ext.fx.Anim} The new animation.
  34224. */
  34225. addAnimation: function(config) {
  34226. var me = this,
  34227. animId = me.dom.id || Ext.id(me.dom),
  34228. listeners, anim, end;
  34229. if (!Ext.fx.Manager.hasFxBlock(animId)) {
  34230. // Bit of gymnastics here to ensure our internal listeners get bound first
  34231. if (config.listeners) {
  34232. listeners = config.listeners;
  34233. delete config.listeners;
  34234. }
  34235. if (config.internalListeners) {
  34236. config.listeners = config.internalListeners;
  34237. delete config.internalListeners;
  34238. }
  34239. end = config.autoEnd;
  34240. delete config.autoEnd;
  34241. anim = new Ext.fx.Anim(me.anim(config));
  34242. anim.on({
  34243. afteranimate: 'afterAnimate',
  34244. beforeanimate: 'beforeAnimate',
  34245. scope: me,
  34246. single: true
  34247. });
  34248. if (listeners) {
  34249. anim.on(listeners);
  34250. }
  34251. Ext.fx.Manager.queueFx(anim);
  34252. if (end) {
  34253. anim.jumpToEnd();
  34254. }
  34255. }
  34256. return anim;
  34257. },
  34258. /**
  34259. * @private
  34260. */
  34261. beforeAnimate: function() {
  34262. var shadow = this.shadow;
  34263. if (shadow && !shadow.disabled && !shadow.animate) {
  34264. shadow.hide();
  34265. }
  34266. },
  34267. /**
  34268. * Wraps the specified element with a special 9 element markup/CSS block that renders
  34269. * by default as a gray container with a gradient background, rounded corners
  34270. * and a 4-way shadow.
  34271. *
  34272. * This special markup is used throughout Ext when box wrapping elements
  34273. * ({@link Ext.button.Button}, {@link Ext.panel.Panel} when
  34274. * {@link Ext.panel.Panel#frame frame=true}, {@link Ext.window.Window}).
  34275. * The markup is of this form:
  34276. *
  34277. * <div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div>
  34278. * <div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div>
  34279. * <div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>
  34280. *
  34281. * Example usage:
  34282. *
  34283. * // Basic box wrap
  34284. * Ext.get("foo").boxWrap();
  34285. *
  34286. * // You can also add a custom class and use CSS inheritance rules to customize
  34287. * // the box look.
  34288. * // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions
  34289. * // as an example for how to create a custom box wrap style.
  34290. * Ext.get("foo").boxWrap().addCls("x-box-blue");
  34291. *
  34292. * @param {String} [cls='x-box'] A base CSS class to apply to the containing wrapper
  34293. * element. Note that there are a number of CSS rules that are dependent on this name
  34294. * to make the overall effect work, so if you supply an alternate base class, make sure
  34295. * you also supply all of the necessary rules.
  34296. * @return {Ext.dom.Element} The outermost wrapping element of the created box structure.
  34297. */
  34298. boxWrap: function(cls) {
  34299. var el;
  34300. cls = cls || Ext.baseCSSPrefix + 'box';
  34301. el = Ext.get(this.insertHtml("beforeBegin", "<div class='" + cls + "' role='presentation'>" + Ext.String.format(boxMarkup, cls) + "</div>"));
  34302. el.selectNode('.' + cls + '-mc').appendChild(this.dom);
  34303. return el;
  34304. },
  34305. /**
  34306. * Removes Empty, or whitespace filled text nodes. Combines adjacent text nodes.
  34307. * @param {Boolean} [forceReclean=false] By default the element keeps track if it has been
  34308. * cleaned already so you can call this over and over. However, if you update the element
  34309. * and need to force a re-clean, you can pass true.
  34310. */
  34311. clean: function(forceReclean) {
  34312. var me = this,
  34313. dom = me.dom,
  34314. data = me.getData(),
  34315. n = dom.firstChild,
  34316. ni = -1,
  34317. nx;
  34318. if (data.isCleaned && forceReclean !== true) {
  34319. return me;
  34320. }
  34321. while (n) {
  34322. nx = n.nextSibling;
  34323. if (n.nodeType === 3) {
  34324. // Remove empty/whitespace text nodes
  34325. if (!(nonSpaceRe.test(n.nodeValue))) {
  34326. dom.removeChild(n);
  34327. }
  34328. // Combine adjacent text nodes
  34329. else if (nx && nx.nodeType === 3) {
  34330. n.appendData(Ext.String.trim(nx.data));
  34331. dom.removeChild(nx);
  34332. nx = n.nextSibling;
  34333. n.nodeIndex = ++ni;
  34334. }
  34335. } else {
  34336. // Recursively clean
  34337. Ext.fly(n, '_clean').clean();
  34338. n.nodeIndex = ++ni;
  34339. }
  34340. n = nx;
  34341. }
  34342. data.isCleaned = true;
  34343. return me;
  34344. },
  34345. /**
  34346. * @method
  34347. * Empties this element. Removes all child nodes.
  34348. */
  34349. empty: emptyRange ? function() {
  34350. var dom = this.dom;
  34351. if (dom.firstChild) {
  34352. emptyRange.setStartBefore(dom.firstChild);
  34353. emptyRange.setEndAfter(dom.lastChild);
  34354. emptyRange.deleteContents();
  34355. }
  34356. } : function() {
  34357. var dom = this.dom;
  34358. while (dom.lastChild) {
  34359. dom.removeChild(dom.lastChild);
  34360. }
  34361. },
  34362. clearListeners: function() {
  34363. this.removeAnchor();
  34364. this.callParent();
  34365. },
  34366. /**
  34367. * Clears positioning back to the default when the document was loaded.
  34368. * @param {String} [value=''] The value to use for the left, right, top, bottom.
  34369. * You could use 'auto'.
  34370. * @return {Ext.dom.Element} this
  34371. */
  34372. clearPositioning: function(value) {
  34373. value = value || '';
  34374. return this.setStyle({
  34375. left: value,
  34376. right: value,
  34377. top: value,
  34378. bottom: value,
  34379. 'z-index': '',
  34380. position: 'static'
  34381. });
  34382. },
  34383. /**
  34384. * Creates a proxy element of this element
  34385. * @param {String/Object} config The class name of the proxy element or a DomHelper config
  34386. * object
  34387. * @param {String/HTMLElement} [renderTo] The element or element id to render the proxy to.
  34388. * Defaults to: document.body.
  34389. * @param {Boolean} [matchBox=false] True to align and size the proxy to this element now.
  34390. * @return {Ext.dom.Element} The new proxy element
  34391. */
  34392. createProxy: function(config, renderTo, matchBox) {
  34393. config = (typeof config === 'object') ? config : {
  34394. tag: "div",
  34395. role: 'presentation',
  34396. cls: config
  34397. };
  34398. // eslint-disable-next-line vars-on-top
  34399. var me = this,
  34400. proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : Ext.DomHelper.insertBefore(me.dom, config, true);
  34401. proxy.setVisibilityMode(Element.DISPLAY);
  34402. proxy.hide();
  34403. // check to make sure Element_position.js is loaded
  34404. if (matchBox && me.setBox && me.getBox) {
  34405. proxy.setBox(me.getBox());
  34406. }
  34407. return proxy;
  34408. },
  34409. /**
  34410. * Clears any opacity settings from this element. Required in some cases for IE.
  34411. * @return {Ext.dom.Element} this
  34412. */
  34413. clearOpacity: function() {
  34414. return this.setOpacity('');
  34415. },
  34416. /**
  34417. * Store the current overflow setting and clip overflow on the element - use {@link #unclip}
  34418. * to remove
  34419. * @return {Ext.dom.Element} this
  34420. */
  34421. clip: function() {
  34422. var me = this,
  34423. data = me.getData(),
  34424. style;
  34425. if (!data[ISCLIPPED]) {
  34426. data[ISCLIPPED] = true;
  34427. style = me.getStyle([
  34428. OVERFLOW,
  34429. OVERFLOWX,
  34430. OVERFLOWY
  34431. ]);
  34432. data[ORIGINALCLIP] = {
  34433. o: style[OVERFLOW],
  34434. x: style[OVERFLOWX],
  34435. y: style[OVERFLOWY]
  34436. };
  34437. me.setStyle(OVERFLOW, HIDDEN);
  34438. me.setStyle(OVERFLOWX, HIDDEN);
  34439. me.setStyle(OVERFLOWY, HIDDEN);
  34440. }
  34441. return me;
  34442. },
  34443. destroy: function() {
  34444. var me = this,
  34445. dom = me.dom,
  34446. data = me.peekData(),
  34447. maskEl, maskMsg;
  34448. if (dom) {
  34449. if (me.isAnimate) {
  34450. me.stopAnimation(true);
  34451. }
  34452. me.removeAnchor();
  34453. }
  34454. if (me.deferredFocusTimer) {
  34455. Ext.undefer(me.deferredFocusTimer);
  34456. me.deferredFocusTimer = null;
  34457. }
  34458. me.callParent();
  34459. // prevent memory leaks in IE8
  34460. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  34461. // must not be document, documentElement, body or window object
  34462. // Have to use != instead of !== for IE8 or it will not recognize that the window
  34463. // objects are equal
  34464. // eslint-disable-next-line eqeqeq
  34465. if (dom && Ext.isIE8 && (dom.window != dom) && (dom.nodeType !== 9) && (dom.tagName !== 'BODY') && (dom.tagName !== 'HTML')) {
  34466. destroyQueue[destroyQueue.length] = dom;
  34467. // Will perform extra IE8 cleanup in 10 milliseconds
  34468. // see http://social.msdn.microsoft.com/Forums/ie/en-US/c76967f0-dcf8-47d0-8984-8fe1282a94f5/ie-appendchildremovechild-memory-problem?forum=iewebdevelopment
  34469. clearGarbage();
  34470. }
  34471. if (data) {
  34472. maskEl = data.maskEl;
  34473. maskMsg = data.maskMsg;
  34474. if (maskEl) {
  34475. maskEl.destroy();
  34476. }
  34477. if (maskMsg) {
  34478. maskMsg.destroy();
  34479. }
  34480. }
  34481. },
  34482. /**
  34483. * Convenience method for setVisibilityMode(Element.DISPLAY).
  34484. * @param {String} [display] What to set display to when visible
  34485. * @return {Ext.dom.Element} this
  34486. */
  34487. enableDisplayMode: function(display) {
  34488. var me = this;
  34489. me.setVisibilityMode(Element.DISPLAY);
  34490. if (display !== undefined) {
  34491. me.getData()[ORIGINALDISPLAY] = display;
  34492. }
  34493. return me;
  34494. },
  34495. /**
  34496. * Fade an element in (from transparent to opaque). The ending opacity can be specified
  34497. * using the `opacity` config option. Usage:
  34498. *
  34499. * // default: fade in from opacity 0 to 100%
  34500. * el.fadeIn();
  34501. *
  34502. * // custom: fade in from opacity 0 to 75% over 2 seconds
  34503. * el.fadeIn({ opacity: .75, duration: 2000});
  34504. *
  34505. * // common config options shown with default values
  34506. * el.fadeIn({
  34507. * opacity: 1, //can be any value between 0 and 1 (e.g. .5)
  34508. * easing: 'easeOut',
  34509. * duration: 500
  34510. * });
  34511. *
  34512. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  34513. * config options
  34514. * @return {Ext.dom.Element} The Element
  34515. */
  34516. fadeIn: function(options) {
  34517. var me = this,
  34518. dom = me.dom,
  34519. animFly = new Ext.dom.Fly();
  34520. me.animate(Ext.apply({}, options, {
  34521. opacity: 1,
  34522. internalListeners: {
  34523. beforeanimate: function(anim) {
  34524. // Reattach to the DOM in case the caller animated a Fly
  34525. // in which case the dom reference will have changed by now.
  34526. animFly.attach(dom);
  34527. // restore any visibility/display that may have
  34528. // been applied by a fadeout animation
  34529. if (animFly.isStyle('display', 'none')) {
  34530. animFly.setDisplayed('');
  34531. } else {
  34532. animFly.show();
  34533. }
  34534. }
  34535. }
  34536. }));
  34537. return this;
  34538. },
  34539. /**
  34540. * Fade an element out (from opaque to transparent). The ending opacity can be specified
  34541. * using the `opacity` config option. Note that IE may require `useDisplay: true` in order
  34542. * to redisplay correctly. Usage:
  34543. *
  34544. * // default: fade out from the element's current opacity to 0
  34545. * el.fadeOut();
  34546. *
  34547. * // custom: fade out from the element's current opacity to 25% over 2 seconds
  34548. * el.fadeOut({ opacity: .25, duration: 2000});
  34549. *
  34550. * // common config options shown with default values
  34551. * el.fadeOut({
  34552. * opacity: 0, //can be any value between 0 and 1 (e.g. .5)
  34553. * easing: 'easeOut',
  34554. * duration: 500,
  34555. * remove: false,
  34556. * useDisplay: false
  34557. * });
  34558. *
  34559. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  34560. * config options
  34561. * @return {Ext.dom.Element} The Element
  34562. */
  34563. fadeOut: function(options) {
  34564. var me = this,
  34565. dom = me.dom,
  34566. animFly = new Ext.dom.Fly();
  34567. options = Ext.apply({
  34568. opacity: 0,
  34569. internalListeners: {
  34570. afteranimate: function(anim) {
  34571. if (anim.to.opacity === 0) {
  34572. // Reattach to the DOM in case the caller animated a Fly
  34573. // in which case the dom reference will have changed by now.
  34574. animFly.attach(dom);
  34575. // Reattach to the DOM in case the caller animated a Fly
  34576. // in which case the dom reference will have changed by now.
  34577. animFly.attach(dom);
  34578. if (options.useDisplay) {
  34579. animFly.setDisplayed(false);
  34580. } else {
  34581. animFly.hide();
  34582. }
  34583. }
  34584. }
  34585. }
  34586. }, options);
  34587. me.animate(options);
  34588. return me;
  34589. },
  34590. /**
  34591. * @private
  34592. */
  34593. fixDisplay: function() {
  34594. var me = this;
  34595. if (me.isStyle(DISPLAY, NONE)) {
  34596. me.setStyle(VISIBILITY, HIDDEN);
  34597. me.setStyle(DISPLAY, me._getDisplay());
  34598. // first try reverting to default
  34599. if (me.isStyle(DISPLAY, NONE)) {
  34600. // if that fails, default to block
  34601. me.setStyle(DISPLAY, "block");
  34602. }
  34603. }
  34604. },
  34605. /**
  34606. * Shows a ripple of exploding, attenuating borders to draw attention to an Element. Usage:
  34607. *
  34608. * // default: a single light blue ripple
  34609. * el.frame();
  34610. *
  34611. * // custom: 3 red ripples lasting 3 seconds total
  34612. * el.frame("#ff0000", 3, { duration: 3000 });
  34613. *
  34614. * // common config options shown with default values
  34615. * el.frame("#C3DAF9", 1, {
  34616. * duration: 1000 // duration of each individual ripple.
  34617. * // Note: Easing is not configurable and will be ignored if included
  34618. * });
  34619. *
  34620. * @param {String} [color='#C3DAF9'] The hex color value for the border.
  34621. * @param {Number} [count=1] The number of ripples to display.
  34622. * @param {Object} [obj] Object literal with any of the {@link Ext.fx.Anim} config options
  34623. * @return {Ext.dom.Element} The Element
  34624. */
  34625. frame: function(color, count, obj) {
  34626. var me = this,
  34627. dom = me.dom,
  34628. animFly = new Ext.dom.Fly(),
  34629. beforeAnim;
  34630. color = color || '#C3DAF9';
  34631. count = count || 1;
  34632. obj = obj || {};
  34633. beforeAnim = function() {
  34634. var animScope = this,
  34635. box, proxy, proxyAnim;
  34636. // Reattach to the DOM in case the caller animated a Fly
  34637. // in which case the dom reference will have changed by now.
  34638. animFly.attach(dom);
  34639. animFly.show();
  34640. box = animFly.getBox();
  34641. proxy = Ext.getBody().createChild({
  34642. role: 'presentation',
  34643. id: animFly.dom.id + '-anim-proxy',
  34644. style: {
  34645. position: 'absolute',
  34646. 'pointer-events': 'none',
  34647. 'z-index': 35000,
  34648. border: '0px solid ' + color
  34649. }
  34650. });
  34651. proxyAnim = new Ext.fx.Anim({
  34652. target: proxy,
  34653. duration: obj.duration || 1000,
  34654. iterations: count,
  34655. from: {
  34656. top: box.y,
  34657. left: box.x,
  34658. borderWidth: 0,
  34659. opacity: 1,
  34660. height: box.height,
  34661. width: box.width
  34662. },
  34663. to: {
  34664. top: box.y - 20,
  34665. left: box.x - 20,
  34666. borderWidth: 10,
  34667. opacity: 0,
  34668. height: box.height + 40,
  34669. width: box.width + 40
  34670. }
  34671. });
  34672. proxyAnim.on('afteranimate', function() {
  34673. proxy.destroy();
  34674. // kill the no-op element animation created below
  34675. animScope.end();
  34676. });
  34677. };
  34678. me.animate({
  34679. // See "A Note About Wrapped Animations" at the top of this class:
  34680. duration: (Math.max(obj.duration, 500) * 2) || 2000,
  34681. listeners: {
  34682. beforeanimate: {
  34683. fn: beforeAnim
  34684. }
  34685. },
  34686. callback: obj.callback,
  34687. scope: obj.scope
  34688. });
  34689. return me;
  34690. },
  34691. /**
  34692. * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like `#fff`)
  34693. * and valid values are convert to standard 6 digit hex color.
  34694. * @param {String} attr The css attribute
  34695. * @param {String} defaultValue The default value to use when a valid color isn't found
  34696. * @param {String} [prefix] defaults to #. Use an empty string when working with
  34697. * color anims.
  34698. * @private
  34699. */
  34700. getColor: function(attr, defaultValue, prefix) {
  34701. var v = this.getStyle(attr),
  34702. color = prefix || prefix === '' ? prefix : '#',
  34703. h, len, i;
  34704. if (!v || (/transparent|inherit/.test(v))) {
  34705. return defaultValue;
  34706. }
  34707. if (/^r/.test(v)) {
  34708. v = v.slice(4, v.length - 1).split(',');
  34709. len = v.length;
  34710. for (i = 0; i < len; i++) {
  34711. h = parseInt(v[i], 10);
  34712. color += (h < 16 ? '0' : '') + h.toString(16);
  34713. }
  34714. } else {
  34715. v = v.replace('#', '');
  34716. color += v.length === 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
  34717. }
  34718. return (color.length > 5 ? color.toLowerCase() : defaultValue);
  34719. },
  34720. /**
  34721. * Gets this element's {@link Ext.ElementLoader ElementLoader}
  34722. * @return {Ext.ElementLoader} The loader
  34723. */
  34724. getLoader: function() {
  34725. var me = this,
  34726. data = me.getData(),
  34727. loader = data.loader;
  34728. if (!loader) {
  34729. data.loader = loader = new Ext.ElementLoader({
  34730. target: me
  34731. });
  34732. }
  34733. return loader;
  34734. },
  34735. /**
  34736. * Gets an object with all CSS positioning properties. Useful along with
  34737. * `setPositioning` to get snapshot before performing an update and then restoring
  34738. * the element.
  34739. * @param {Boolean} [autoPx=false] true to return pixel values for "auto" styles.
  34740. * @return {Object}
  34741. */
  34742. getPositioning: function(autoPx) {
  34743. var styles = this.getStyle([
  34744. 'left',
  34745. 'top',
  34746. 'position',
  34747. 'z-index'
  34748. ]),
  34749. dom = this.dom;
  34750. if (autoPx) {
  34751. if (styles.left === 'auto') {
  34752. styles.left = dom.offsetLeft + 'px';
  34753. }
  34754. if (styles.top === 'auto') {
  34755. styles.top = dom.offsetTop + 'px';
  34756. }
  34757. }
  34758. return styles;
  34759. },
  34760. /**
  34761. * Slides the element while fading it out of view. An anchor point can be optionally passed
  34762. * to set the ending point of the effect. Usage:
  34763. *
  34764. * // default: slide the element downward while fading out
  34765. * el.ghost();
  34766. *
  34767. * // custom: slide the element out to the right with a 2-second duration
  34768. * el.ghost('r', { duration: 2000 });
  34769. *
  34770. * // common config options shown with default values
  34771. * el.ghost('b', {
  34772. * easing: 'easeOut',
  34773. * duration: 500
  34774. * });
  34775. *
  34776. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
  34777. * (defaults to bottom: 'b')
  34778. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
  34779. * config options
  34780. * @return {Ext.dom.Element} The Element
  34781. */
  34782. ghost: function(anchor, options) {
  34783. var me = this,
  34784. dom = me.dom,
  34785. animFly = new Ext.dom.Fly(),
  34786. beforeAnim;
  34787. anchor = anchor || "b";
  34788. beforeAnim = function() {
  34789. // Reattach to the DOM in case the caller animated a Fly
  34790. // in which case the dom reference will have changed by now.
  34791. animFly.attach(dom);
  34792. // eslint-disable-next-line vars-on-top
  34793. var width = animFly.getWidth(),
  34794. height = animFly.getHeight(),
  34795. xy = animFly.getXY(),
  34796. position = animFly.getPositioning(),
  34797. to = {
  34798. opacity: 0
  34799. };
  34800. switch (anchor) {
  34801. case 't':
  34802. to.y = xy[1] - height;
  34803. break;
  34804. case 'l':
  34805. to.x = xy[0] - width;
  34806. break;
  34807. case 'r':
  34808. to.x = xy[0] + width;
  34809. break;
  34810. case 'b':
  34811. to.y = xy[1] + height;
  34812. break;
  34813. case 'tl':
  34814. to.x = xy[0] - width;
  34815. to.y = xy[1] - height;
  34816. break;
  34817. case 'bl':
  34818. to.x = xy[0] - width;
  34819. to.y = xy[1] + height;
  34820. break;
  34821. case 'br':
  34822. to.x = xy[0] + width;
  34823. to.y = xy[1] + height;
  34824. break;
  34825. case 'tr':
  34826. to.x = xy[0] + width;
  34827. to.y = xy[1] - height;
  34828. break;
  34829. }
  34830. this.to = to;
  34831. this.on('afteranimate', function() {
  34832. // Reattach to the DOM in case the caller animated a Fly
  34833. // in which case the dom reference will have changed by now.
  34834. animFly.attach(dom);
  34835. if (animFly) {
  34836. animFly.hide();
  34837. animFly.clearOpacity();
  34838. animFly.setPositioning(position);
  34839. }
  34840. });
  34841. };
  34842. me.animate(Ext.applyIf(options || {}, {
  34843. duration: 500,
  34844. easing: 'ease-out',
  34845. listeners: {
  34846. beforeanimate: beforeAnim
  34847. }
  34848. }));
  34849. return me;
  34850. },
  34851. getTextSelection: function() {
  34852. var ret, dom, doc, range, textRange;
  34853. ret = this.callParent();
  34854. if (typeof ret[0] !== 'number') {
  34855. dom = this.dom;
  34856. doc = dom.ownerDocument;
  34857. range = doc.selection.createRange();
  34858. textRange = dom.createTextRange();
  34859. textRange.setEndPoint('EndToStart', range);
  34860. ret[0] = textRange.text.length;
  34861. ret[1] = ret[0] + range.text.length;
  34862. }
  34863. return ret;
  34864. },
  34865. /**
  34866. * Hide this element - Uses display mode to determine whether to use "display",
  34867. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  34868. * @param {Boolean/Object} [animate] true for the default animation or a standard
  34869. * Element animation config object
  34870. * @return {Ext.dom.Element} this
  34871. */
  34872. hide: function(animate) {
  34873. // hideMode override
  34874. if (typeof animate === 'string') {
  34875. this.setVisible(false, animate);
  34876. return this;
  34877. }
  34878. this.setVisible(false, this.anim(animate));
  34879. return this;
  34880. },
  34881. /**
  34882. * Highlights the Element by setting a color (applies to the background-color by default,
  34883. * but can be changed using the "attr" config option) and then fading back to the original
  34884. * color. If no original color is available, you should provide the "endColor" config option
  34885. * which will be cleared after the animation. Usage:
  34886. *
  34887. * // default: highlight background to yellow
  34888. * el.highlight();
  34889. *
  34890. * // custom: highlight foreground text to blue for 2 seconds
  34891. * el.highlight("0000ff", { attr: 'color', duration: 2000 });
  34892. *
  34893. * // common config options shown with default values
  34894. * el.highlight("ffff9c", {
  34895. * // can be any valid CSS property (attribute) that supports a color value
  34896. * attr: "backgroundColor",
  34897. * endColor: (current color) or "ffffff",
  34898. * easing: 'easeIn',
  34899. * duration: 1000
  34900. * });
  34901. *
  34902. * @param {String} color (optional) The highlight color. Should be a 6 char hex color
  34903. * without the leading # (defaults to yellow: 'ffff9c')
  34904. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  34905. * config options
  34906. * @return {Ext.dom.Element} The Element
  34907. */
  34908. highlight: function(color, options) {
  34909. var me = this,
  34910. dom = me.dom,
  34911. from = {},
  34912. animFly = new Ext.dom.Fly(),
  34913. restore, to, attr, lns, event, fn;
  34914. options = options || {};
  34915. lns = options.listeners || {};
  34916. attr = options.attr || 'backgroundColor';
  34917. from[attr] = color || 'ffff9c';
  34918. if (!options.to) {
  34919. to = {};
  34920. to[attr] = options.endColor || me.getColor(attr, 'ffffff', '');
  34921. } else {
  34922. to = options.to;
  34923. }
  34924. // Don't apply directly on lns, since we reference it in our own callbacks below
  34925. options.listeners = Ext.apply(Ext.apply({}, lns), {
  34926. beforeanimate: function() {
  34927. // Reattach to the DOM in case the caller animated a Fly
  34928. // in which case the dom reference will have changed by now.
  34929. animFly.attach(dom);
  34930. restore = dom.style[attr];
  34931. animFly.clearOpacity();
  34932. animFly.show();
  34933. event = lns.beforeanimate;
  34934. if (event) {
  34935. fn = event.fn || event;
  34936. return fn.apply(event.scope || lns.scope || WIN, arguments);
  34937. }
  34938. },
  34939. afteranimate: function() {
  34940. if (dom) {
  34941. dom.style[attr] = restore;
  34942. }
  34943. event = lns.afteranimate;
  34944. if (event) {
  34945. fn = event.fn || event;
  34946. fn.apply(event.scope || lns.scope || WIN, arguments);
  34947. }
  34948. }
  34949. });
  34950. me.animate(Ext.apply({}, options, {
  34951. duration: 1000,
  34952. easing: 'ease-in',
  34953. from: from,
  34954. to: to
  34955. }));
  34956. return me;
  34957. },
  34958. /**
  34959. * Initializes a {@link Ext.dd.DD} drag drop object for this element.
  34960. * @param {String} group The group the DD object is member of
  34961. * @param {Object} config The DD config object
  34962. * @param {Object} overrides An object containing methods to override/implement
  34963. * on the DD object
  34964. * @return {Ext.dd.DD} The DD object
  34965. */
  34966. initDD: function(group, config, overrides) {
  34967. var dd = new Ext.dd.DD(Ext.id(this.dom), group, config);
  34968. return Ext.apply(dd, overrides);
  34969. },
  34970. /**
  34971. * Initializes a {@link Ext.dd.DDProxy} object for this element.
  34972. * @param {String} group The group the DDProxy object is member of
  34973. * @param {Object} config The DDProxy config object
  34974. * @param {Object} overrides An object containing methods to override/implement
  34975. * on the DDProxy object
  34976. * @return {Ext.dd.DDProxy} The DDProxy object
  34977. */
  34978. initDDProxy: function(group, config, overrides) {
  34979. var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config);
  34980. return Ext.apply(dd, overrides);
  34981. },
  34982. /**
  34983. * Initializes a {@link Ext.dd.DDTarget} object for this element.
  34984. * @param {String} group The group the DDTarget object is member of
  34985. * @param {Object} config The DDTarget config object
  34986. * @param {Object} overrides An object containing methods to override/implement
  34987. * on the DDTarget object
  34988. * @return {Ext.dd.DDTarget} The DDTarget object
  34989. */
  34990. initDDTarget: function(group, config, overrides) {
  34991. var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config);
  34992. return Ext.apply(dd, overrides);
  34993. },
  34994. /**
  34995. * Returns true if this element is masked. Also re-centers any displayed message
  34996. * within the mask.
  34997. *
  34998. * @param {Boolean} [deep] Go up the DOM hierarchy to determine if any parent
  34999. * element is masked.
  35000. *
  35001. * @return {Boolean}
  35002. */
  35003. isMasked: function(deep) {
  35004. var me = this,
  35005. data = me.getData(),
  35006. maskEl = data.maskEl,
  35007. maskMsg = data.maskMsg,
  35008. hasMask = false,
  35009. parent;
  35010. if (maskEl && maskEl.isVisible()) {
  35011. if (maskMsg) {
  35012. maskMsg.center(me);
  35013. }
  35014. hasMask = true;
  35015. } else if (deep) {
  35016. parent = me.findParentNode();
  35017. if (parent) {
  35018. return Ext.fly(parent).isMasked(deep);
  35019. }
  35020. }
  35021. return hasMask;
  35022. },
  35023. /**
  35024. * Direct access to the Ext.ElementLoader {@link Ext.ElementLoader#method-load} method.
  35025. * The method takes the same object parameter as {@link Ext.ElementLoader#method-load}
  35026. * @param {Object} options a options object for Ext.ElementLoader
  35027. * {@link Ext.ElementLoader#method-load}
  35028. * @return {Ext.dom.Element} this
  35029. */
  35030. load: function(options) {
  35031. this.getLoader().load(options);
  35032. return this;
  35033. },
  35034. /**
  35035. * Puts a mask over this element to disable user interaction.
  35036. * This method can only be applied to elements which accept child nodes. Use
  35037. * {@link #unmask} to remove the mask.
  35038. *
  35039. * @param {String} [msg] A message to display in the mask
  35040. * @param {String} [msgCls] A css class to apply to the msg element
  35041. * @param {Number} elHeight (private) Passed by AbstractComponent.mask to avoid the need
  35042. * to interrogate the DOM to get the height
  35043. * @return {Ext.dom.Element} The mask element
  35044. */
  35045. mask: function(msg, msgCls, elHeight) {
  35046. var me = this,
  35047. dom = me.dom,
  35048. data = me.getData(),
  35049. maskEl = data.maskEl,
  35050. maskMsg;
  35051. if (!(bodyRe.test(dom.tagName) && me.getStyle('position') === 'static')) {
  35052. me.addCls(XMASKEDRELATIVE);
  35053. }
  35054. // We always needs to recreate the mask since the DOM element may have been re-created
  35055. if (maskEl) {
  35056. maskEl.destroy();
  35057. }
  35058. maskEl = Ext.DomHelper.append(dom, {
  35059. role: 'presentation',
  35060. cls: Ext.baseCSSPrefix + "mask " + Ext.baseCSSPrefix + "border-box",
  35061. children: {
  35062. role: 'presentation',
  35063. cls: msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG,
  35064. cn: {
  35065. tag: 'div',
  35066. role: 'presentation',
  35067. cls: Ext.baseCSSPrefix + 'mask-msg-inner',
  35068. cn: {
  35069. tag: 'div',
  35070. role: 'presentation',
  35071. cls: Ext.baseCSSPrefix + 'mask-msg-text',
  35072. html: msg || ''
  35073. }
  35074. }
  35075. }
  35076. }, true);
  35077. maskMsg = Ext.fly(maskEl.dom.firstChild);
  35078. data.maskEl = maskEl;
  35079. me.addCls(XMASKED);
  35080. maskEl.setDisplayed(true);
  35081. if (typeof msg === 'string') {
  35082. maskMsg.setDisplayed(true);
  35083. maskMsg.center(me);
  35084. } else {
  35085. maskMsg.setDisplayed(false);
  35086. }
  35087. if (dom === DOC.body) {
  35088. maskEl.addCls(Ext.baseCSSPrefix + 'mask-fixed');
  35089. }
  35090. // When masking the body, don't touch its tabbable state
  35091. me.saveTabbableState({
  35092. skipSelf: dom === DOC.body
  35093. });
  35094. // ie will not expand full height automatically
  35095. if (Ext.isIE9m && dom !== DOC.body && me.isStyle('height', 'auto')) {
  35096. maskEl.setSize(undefined, elHeight || me.getHeight());
  35097. }
  35098. return maskEl;
  35099. },
  35100. /**
  35101. * Fades the element out while slowly expanding it in all directions. When the effect
  35102. * is completed, the element will be hidden (visibility = 'hidden') but block elements
  35103. * will still take up space in the document. Usage:
  35104. *
  35105. * // default
  35106. * el.puff();
  35107. *
  35108. * // common config options shown with default values
  35109. * el.puff({
  35110. * easing: 'easeOut',
  35111. * duration: 500,
  35112. * useDisplay: false
  35113. * });
  35114. *
  35115. * @param {Object} obj (optional) Object literal with any of the {@link Ext.fx.Anim}
  35116. * config options
  35117. * @return {Ext.dom.Element} The Element
  35118. */
  35119. puff: function(obj) {
  35120. var me = this,
  35121. dom = me.dom,
  35122. animFly = new Ext.dom.Fly(),
  35123. beforeAnim,
  35124. box = me.getBox(),
  35125. originalStyles;
  35126. originalStyles = me.getStyle([
  35127. 'width',
  35128. 'height',
  35129. 'left',
  35130. 'right',
  35131. 'top',
  35132. 'bottom',
  35133. 'position',
  35134. 'z-index',
  35135. 'font-size',
  35136. 'opacity'
  35137. ], true);
  35138. obj = Ext.applyIf(obj || {}, {
  35139. easing: 'ease-out',
  35140. duration: 500,
  35141. useDisplay: false
  35142. });
  35143. beforeAnim = function() {
  35144. // Reattach to the DOM in case the caller animated a Fly
  35145. // in which case the dom reference will have changed by now.
  35146. animFly.attach(dom);
  35147. animFly.clearOpacity();
  35148. animFly.show();
  35149. this.to = {
  35150. width: box.width * 2,
  35151. height: box.height * 2,
  35152. x: box.x - (box.width / 2),
  35153. y: box.y - (box.height / 2),
  35154. opacity: 0,
  35155. fontSize: '200%'
  35156. };
  35157. this.on('afteranimate', function() {
  35158. // Reattach to the DOM in case the caller animated a Fly
  35159. // in which case the dom reference will have changed by now.
  35160. animFly.attach(dom);
  35161. if (obj.useDisplay) {
  35162. animFly.setDisplayed(false);
  35163. } else {
  35164. animFly.hide();
  35165. }
  35166. animFly.setStyle(originalStyles);
  35167. Ext.callback(obj.callback, obj.scope);
  35168. });
  35169. };
  35170. me.animate({
  35171. duration: obj.duration,
  35172. easing: obj.easing,
  35173. listeners: {
  35174. beforeanimate: {
  35175. fn: beforeAnim
  35176. }
  35177. }
  35178. });
  35179. return me;
  35180. },
  35181. // private
  35182. // used to ensure the mouseup event is captured if it occurs outside of the
  35183. // window in IE9m. The only reason this method exists, (vs just calling
  35184. // el.dom.setCapture() directly) is so that we can override it to emptyFn
  35185. // during testing because setCapture() can wreak havoc on emulated mouse events
  35186. // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646262(v=vs.85).aspx
  35187. setCapture: function() {
  35188. var dom = this.dom;
  35189. if (Ext.isIE9m && dom.setCapture) {
  35190. dom.setCapture();
  35191. }
  35192. },
  35193. /**
  35194. * Set the height of this Element.
  35195. *
  35196. * // change the height to 200px and animate with default configuration
  35197. * Ext.fly('elementId').setHeight(200, true);
  35198. *
  35199. * // change the height to 150px and animate with a custom configuration
  35200. * Ext.fly('elId').setHeight(150, {
  35201. * duration : 500, // animation will have a duration of .5 seconds
  35202. * // will change the content to "finished"
  35203. * callback: function(){ this.setHtml("finished"); }
  35204. * });
  35205. *
  35206. * @param {Number/String} height The new height. This may be one of:
  35207. *
  35208. * - A Number specifying the new height in pixels.
  35209. * - A String used to set the CSS height style. Animation may **not** be used.
  35210. *
  35211. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35212. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35213. * @return {Ext.dom.Element} this
  35214. */
  35215. setHeight: function(height, animate) {
  35216. var me = this;
  35217. if (!animate || !me.anim) {
  35218. me.callParent(arguments);
  35219. } else {
  35220. if (!Ext.isObject(animate)) {
  35221. animate = {};
  35222. }
  35223. me.animate(Ext.applyIf({
  35224. to: {
  35225. height: height
  35226. }
  35227. }, animate));
  35228. }
  35229. return me;
  35230. },
  35231. /**
  35232. * Removes "vertical" state from this element (reverses everything done
  35233. * by {@link #setVertical}).
  35234. * @private
  35235. */
  35236. setHorizontal: function() {
  35237. var me = this,
  35238. cls = me.verticalCls;
  35239. delete me.vertical;
  35240. if (cls) {
  35241. delete me.verticalCls;
  35242. me.removeCls(cls);
  35243. }
  35244. // delete the inverted methods and revert to inheriting from the prototype
  35245. delete me.setWidth;
  35246. delete me.setHeight;
  35247. if (!Ext.isIE8) {
  35248. delete me.getWidth;
  35249. delete me.getHeight;
  35250. }
  35251. // revert to inheriting styleHooks from the prototype
  35252. delete me.styleHooks;
  35253. },
  35254. /**
  35255. * Updates the *text* value of this element.
  35256. * Replaces the content of this element with a *single text node* containing
  35257. * the passed text.
  35258. * @param {String} text The text to display in this Element.
  35259. */
  35260. updateText: function(text) {
  35261. var me = this,
  35262. dom, textNode;
  35263. if (dom) {
  35264. textNode = dom.firstChild;
  35265. if (!textNode || (textNode.nodeType !== 3 || textNode.nextSibling)) {
  35266. textNode = DOC.createTextNode();
  35267. me.empty();
  35268. dom.appendChild(textNode);
  35269. }
  35270. if (text) {
  35271. textNode.data = text;
  35272. }
  35273. }
  35274. },
  35275. /**
  35276. * Updates the innerHTML of this element, optionally searching for and processing scripts.
  35277. * @param {String} html The new HTML
  35278. * @param {Boolean} [loadScripts] Pass `true` to look for and process scripts.
  35279. * @param {Function} [callback] For async script loading you can be notified
  35280. * when the update completes.
  35281. * @param {Object} [scope=`this`] The scope (`this` reference) in which to execute
  35282. * the callback.
  35283. *
  35284. * Also used as the scope for any *inline* script source if the `loadScripts` parameter
  35285. * is `true`. Scripts with a `src` attribute cannot be executed in this scope.
  35286. *
  35287. * Defaults to this Element.
  35288. * @return {Ext.dom.Element} this
  35289. */
  35290. setHtml: function(html, loadScripts, callback, scope) {
  35291. var me = this,
  35292. id, dom, interval;
  35293. if (!me.dom) {
  35294. return me;
  35295. }
  35296. html = html || '';
  35297. dom = me.dom;
  35298. if (loadScripts !== true) {
  35299. // Setting innerHtml changes the DOM and replace all dom nodes
  35300. // with the new html. For IE specifically, all dom child nodes get
  35301. // destroyed when removed from DOM tree even if DOM is referenced
  35302. // within some JS file. Thus, before setting innerHTML, remove the
  35303. // children so that they are not destroyed/removed from DOM tree.
  35304. if (Ext.isIE) {
  35305. while (dom.firstChild) {
  35306. dom.removeChild(dom.firstChild);
  35307. }
  35308. }
  35309. dom.innerHTML = html;
  35310. Ext.callback(callback, me);
  35311. return me;
  35312. }
  35313. id = Ext.id();
  35314. html += '<span id="' + id + '" role="presentation"></span>';
  35315. interval = Ext.interval(function() {
  35316. var hd, match, attrs, srcMatch, typeMatch, el, s;
  35317. if (!(el = DOC.getElementById(id))) {
  35318. return false;
  35319. }
  35320. Ext.uninterval(interval);
  35321. Ext.removeNode(el);
  35322. hd = Ext.getHead().dom;
  35323. while ((match = scriptTagRe.exec(html))) {
  35324. attrs = match[1];
  35325. srcMatch = attrs ? attrs.match(srcRe) : false;
  35326. if (srcMatch && srcMatch[2]) {
  35327. s = DOC.createElement("script");
  35328. s.src = srcMatch[2];
  35329. typeMatch = attrs.match(typeRe);
  35330. if (typeMatch && typeMatch[2]) {
  35331. s.type = typeMatch[2];
  35332. }
  35333. hd.appendChild(s);
  35334. } else if (match[2] && match[2].length > 0) {
  35335. if (scope) {
  35336. Ext.functionFactory(match[2]).call(scope);
  35337. } else {
  35338. Ext.globalEval(match[2]);
  35339. }
  35340. }
  35341. }
  35342. Ext.callback(callback, scope || me);
  35343. }, 20);
  35344. dom.innerHTML = html.replace(replaceScriptTagRe, '');
  35345. return me;
  35346. },
  35347. /**
  35348. * Set the opacity of the element
  35349. * @param {Number} opacity The new opacity. 0 = transparent, .5 = 50% visible,
  35350. * 1 = fully visible, etc
  35351. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35352. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35353. * @return {Ext.dom.Element} this
  35354. */
  35355. setOpacity: function(opacity, animate) {
  35356. var me = this;
  35357. if (!me.dom) {
  35358. return me;
  35359. }
  35360. if (!animate || !me.anim) {
  35361. me.setStyle('opacity', opacity);
  35362. } else {
  35363. if (typeof animate !== 'object') {
  35364. animate = {
  35365. duration: 350,
  35366. easing: 'ease-in'
  35367. };
  35368. }
  35369. me.animate(Ext.applyIf({
  35370. to: {
  35371. opacity: opacity
  35372. }
  35373. }, animate));
  35374. }
  35375. return me;
  35376. },
  35377. /**
  35378. * Set positioning with an object returned by `getPositioning`.
  35379. * @param {Object} pc
  35380. * @return {Ext.dom.Element} this
  35381. */
  35382. setPositioning: function(pc) {
  35383. return this.setStyle(pc);
  35384. },
  35385. /**
  35386. * Changes this Element's state to "vertical" (rotated 90 or 270 degrees).
  35387. * This involves inverting the getters and setters for height and width,
  35388. * and applying hooks for rotating getters and setters for border/margin/padding.
  35389. * (getWidth becomes getHeight and vice versa), setStyle and getStyle will
  35390. * also return the inverse when height or width are being operated on.
  35391. *
  35392. * @param {Number} angle the angle of rotation - either 90 or 270
  35393. * @param {String} cls an optional css class that contains the required
  35394. * styles for switching the element to vertical orientation. Omit this if
  35395. * the element already contains vertical styling. If cls is provided,
  35396. * it will be removed from the element when {@link #setHorizontal} is called.
  35397. * @private
  35398. */
  35399. setVertical: function(angle, cls) {
  35400. var me = this,
  35401. proto = Element.prototype;
  35402. me.vertical = true;
  35403. if (cls) {
  35404. me.addCls(me.verticalCls = cls);
  35405. }
  35406. me.setWidth = proto.setHeight;
  35407. me.setHeight = proto.setWidth;
  35408. if (!Ext.isIE8) {
  35409. // In browsers that use CSS3 transforms we must invert getHeight and
  35410. // get Width. In IE8 no adjustment is needed because we use
  35411. // a BasicImage filter to rotate the element and the element's
  35412. // offsetWidth and offsetHeight are automatically inverted.
  35413. me.getWidth = proto.getHeight;
  35414. me.getHeight = proto.getWidth;
  35415. }
  35416. // Switch to using the appropriate vertical style hooks
  35417. me.styleHooks = (angle === 270) ? proto.verticalStyleHooks270 : proto.verticalStyleHooks90;
  35418. },
  35419. /**
  35420. * Set the size of this Element. If animation is true, both width and height will be
  35421. * animated concurrently.
  35422. * @param {Number/String} width The new width. This may be one of:
  35423. *
  35424. * - A Number specifying the new width in pixels.
  35425. * - A String used to set the CSS width style. Animation may **not** be used.
  35426. * - A size object in the format `{width: widthValue, height: heightValue}`.
  35427. *
  35428. * @param {Number/String} height The new height. This may be one of:
  35429. *
  35430. * - A Number specifying the new height in pixels.
  35431. * - A String used to set the CSS height style. Animation may **not** be used.
  35432. *
  35433. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35434. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35435. *
  35436. * @return {Ext.dom.Element} this
  35437. */
  35438. setSize: function(width, height, animate) {
  35439. var me = this;
  35440. if (Ext.isObject(width)) {
  35441. // in case of object from getSize()
  35442. animate = height;
  35443. height = width.height;
  35444. width = width.width;
  35445. }
  35446. if (!animate || !me.anim) {
  35447. me.dom.style.width = Element.addUnits(width);
  35448. me.dom.style.height = Element.addUnits(height);
  35449. if (me.shadow || me.shim) {
  35450. me.syncUnderlays();
  35451. }
  35452. } else {
  35453. if (animate === true) {
  35454. animate = {};
  35455. }
  35456. me.animate(Ext.applyIf({
  35457. to: {
  35458. width: width,
  35459. height: height
  35460. }
  35461. }, animate));
  35462. }
  35463. return me;
  35464. },
  35465. /**
  35466. * Sets the visibility of the element (see details). If the visibilityMode is set
  35467. * to Element.DISPLAY, it will use the display property to hide the element,
  35468. * otherwise it uses visibility. The default is to hide and show using the
  35469. * visibility property.
  35470. *
  35471. * @param {Boolean} visible Whether the element is visible
  35472. * @param {Boolean/Object} [animate] True for the default animation,
  35473. * or a standard Element animation config object.
  35474. *
  35475. * @return {Ext.dom.Element} this
  35476. */
  35477. setVisible: function(visible, animate) {
  35478. var me = this,
  35479. dom = me.dom,
  35480. animFly,
  35481. visMode = getVisMode(me);
  35482. // hideMode string override
  35483. if (typeof animate === 'string') {
  35484. switch (animate) {
  35485. case DISPLAY:
  35486. visMode = Element.DISPLAY;
  35487. break;
  35488. case VISIBILITY:
  35489. visMode = Element.VISIBILITY;
  35490. break;
  35491. case OFFSETS:
  35492. visMode = Element.OFFSETS;
  35493. break;
  35494. case CLIP:
  35495. visMode = Element.CLIP;
  35496. break;
  35497. }
  35498. me.setVisibilityMode(visMode);
  35499. animate = false;
  35500. }
  35501. if (!animate || !me.anim) {
  35502. if (visMode === Element.DISPLAY) {
  35503. return me.setDisplayed(visible);
  35504. } else if (visMode === Element.OFFSETS) {
  35505. me[visible ? 'removeCls' : 'addCls'](OFFSETCLASS);
  35506. } else if (visMode === Element.CLIP) {
  35507. me[visible ? 'removeCls' : 'addCls'](CLIPCLASS);
  35508. } else if (visMode === Element.VISIBILITY) {
  35509. me.fixDisplay();
  35510. // Show by clearing visibility style.
  35511. // Explicitly setting to "visible" overrides parent visibility setting
  35512. dom.style.visibility = visible ? '' : HIDDEN;
  35513. }
  35514. } else {
  35515. // closure for composites
  35516. if (visible) {
  35517. me.setOpacity(0.01);
  35518. me.setVisible(true);
  35519. }
  35520. if (!Ext.isObject(animate)) {
  35521. animate = {
  35522. duration: 350,
  35523. easing: 'ease-in'
  35524. };
  35525. }
  35526. animFly = new Ext.dom.Fly();
  35527. me.animate(Ext.applyIf({
  35528. callback: function() {
  35529. if (!visible) {
  35530. // Grab the dom again, since the reference may have changed
  35531. // if we use fly
  35532. animFly.attach(dom).setVisible(false).setOpacity(1);
  35533. }
  35534. },
  35535. to: {
  35536. opacity: (visible) ? 1 : 0
  35537. }
  35538. }, animate));
  35539. }
  35540. me.getData()[ISVISIBLE] = visible;
  35541. if (me.shadow || me.shim) {
  35542. me.setUnderlaysVisible(visible);
  35543. }
  35544. return me;
  35545. },
  35546. /**
  35547. * Set the width of this Element.
  35548. *
  35549. * // change the width to 200px and animate with default configuration
  35550. * Ext.fly('elementId').setWidth(200, true);
  35551. *
  35552. * // change the width to 150px and animate with a custom configuration
  35553. * Ext.fly('elId').setWidth(150, {
  35554. * duration : 500, // animation will have a duration of .5 seconds
  35555. * // will change the content to "finished"
  35556. * callback: function(){ this.setHtml("finished"); }
  35557. * });
  35558. *
  35559. * @param {Number/String} width The new width. This may be one of:
  35560. *
  35561. * - A Number specifying the new width in pixels.
  35562. * - A String used to set the CSS width style. Animation may **not** be used.
  35563. *
  35564. * @param {Boolean/Object} [animate] a standard Element animation config object or `true`
  35565. * for the default animation (`{duration: 350, easing: 'ease-in'}`)
  35566. * @return {Ext.dom.Element} this
  35567. */
  35568. setWidth: function(width, animate) {
  35569. var me = this;
  35570. if (!animate || !me.anim) {
  35571. me.callParent(arguments);
  35572. } else {
  35573. if (!Ext.isObject(animate)) {
  35574. animate = {};
  35575. }
  35576. me.animate(Ext.applyIf({
  35577. to: {
  35578. width: width
  35579. }
  35580. }, animate));
  35581. }
  35582. return me;
  35583. },
  35584. setX: function(x, animate) {
  35585. return this.setXY([
  35586. x,
  35587. this.getY()
  35588. ], animate);
  35589. },
  35590. setXY: function(xy, animate) {
  35591. var me = this;
  35592. if (!animate || !me.anim) {
  35593. me.callParent([
  35594. xy
  35595. ]);
  35596. } else {
  35597. if (!Ext.isObject(animate)) {
  35598. animate = {};
  35599. }
  35600. me.animate(Ext.applyIf({
  35601. to: {
  35602. x: xy[0],
  35603. y: xy[1]
  35604. }
  35605. }, animate));
  35606. }
  35607. return this;
  35608. },
  35609. setY: function(y, animate) {
  35610. return this.setXY([
  35611. this.getX(),
  35612. y
  35613. ], animate);
  35614. },
  35615. /**
  35616. * Show this element - Uses display mode to determine whether to use "display",
  35617. * "visibility", "offsets", or "clip". See {@link #setVisible}.
  35618. *
  35619. * @param {Boolean/Object} [animate] true for the default animation or a standard
  35620. * Element animation config object.
  35621. *
  35622. * @return {Ext.dom.Element} this
  35623. */
  35624. show: function(animate) {
  35625. // hideMode override
  35626. if (typeof animate === 'string') {
  35627. this.setVisible(true, animate);
  35628. return this;
  35629. }
  35630. this.setVisible(true, this.anim(animate));
  35631. return this;
  35632. },
  35633. /**
  35634. * Slides the element into view. An anchor point can be optionally passed to set the point
  35635. * of origin for the slide effect. This function automatically handles wrapping the element
  35636. * with a fixed-size container if needed. See the {@link Ext.fx.Anim} class overview
  35637. * for valid anchor point options. Usage:
  35638. *
  35639. * // default: slide the element in from the top
  35640. * el.slideIn();
  35641. *
  35642. * // custom: slide the element in from the right with a 2-second duration
  35643. * el.slideIn('r', { duration: 2000 });
  35644. *
  35645. * // common config options shown with default values
  35646. * el.slideIn('t', {
  35647. * easing: 'easeOut',
  35648. * duration: 500
  35649. * });
  35650. *
  35651. * @param {String} [anchor] One of the valid {@link Ext.fx.Anim} anchor positions
  35652. * (defaults to top: 't')
  35653. * @param {Object} [options] Object literal with any of the {@link Ext.fx.Anim}
  35654. * config options
  35655. * @param {Boolean} options.preserveScroll Set to true if preservation of any descendant
  35656. * elements' `scrollTop` values is required. By default the DOM wrapping operation
  35657. * performed by `slideIn` and `slideOut` causes the browser to lose all scroll positions.
  35658. * @param {Boolean} slideOut
  35659. * @return {Ext.dom.Element} The Element
  35660. */
  35661. slideIn: function(anchor, options, slideOut) {
  35662. var me = this,
  35663. dom = me.dom,
  35664. elStyle = dom.style,
  35665. animFly = new Ext.dom.Fly(),
  35666. beforeAnim, wrapAnim, restoreScroll, wrapDomParentNode;
  35667. anchor = anchor || "t";
  35668. options = options || {};
  35669. beforeAnim = function() {
  35670. var animScope = this,
  35671. listeners = options.listeners,
  35672. box, originalStyles, anim, wrap;
  35673. // Reattach to the DOM in case the caller animated a Fly
  35674. // in which case the dom reference will have changed by now.
  35675. animFly.attach(dom);
  35676. if (!slideOut) {
  35677. animFly.fixDisplay();
  35678. }
  35679. box = animFly.getBox();
  35680. if ((anchor === 't' || anchor === 'b') && box.height === 0) {
  35681. box.height = dom.scrollHeight;
  35682. } else if ((anchor === 'l' || anchor === 'r') && box.width === 0) {
  35683. box.width = dom.scrollWidth;
  35684. }
  35685. originalStyles = animFly.getStyle([
  35686. 'width',
  35687. 'height',
  35688. 'left',
  35689. 'right',
  35690. 'top',
  35691. 'bottom',
  35692. 'position',
  35693. 'z-index'
  35694. ], true);
  35695. animFly.setSize(box.width, box.height);
  35696. // Cache all descendants' scrollTop & scrollLeft values
  35697. // if configured to preserve scroll.
  35698. if (options.preserveScroll) {
  35699. restoreScroll = animFly.cacheScrollValues();
  35700. }
  35701. wrap = animFly.wrap({
  35702. role: 'presentation',
  35703. id: Ext.id() + '-anim-wrap-for-' + dom.id,
  35704. style: {
  35705. visibility: slideOut ? 'visible' : 'hidden'
  35706. }
  35707. });
  35708. wrapDomParentNode = wrap.dom.parentNode;
  35709. wrap.setPositioning(animFly.getPositioning());
  35710. if (wrap.isStyle('position', 'static')) {
  35711. wrap.position('relative');
  35712. }
  35713. animFly.clearPositioning('auto');
  35714. wrap.clip();
  35715. // The wrap will have reset all descendant scrollTops.
  35716. // Restore them if we cached them.
  35717. if (restoreScroll) {
  35718. restoreScroll();
  35719. }
  35720. // This element is temporarily positioned absolute within its wrapper.
  35721. // Restore to its default, CSS-inherited visibility setting.
  35722. // We cannot explicitly poke visibility:visible into its style
  35723. // because that overrides the visibility of the wrap.
  35724. animFly.setStyle({
  35725. visibility: '',
  35726. position: 'absolute'
  35727. });
  35728. if (slideOut) {
  35729. wrap.setSize(box.width, box.height);
  35730. }
  35731. switch (anchor) {
  35732. case 't':
  35733. anim = {
  35734. from: {
  35735. width: box.width + 'px',
  35736. height: '0px'
  35737. },
  35738. to: {
  35739. width: box.width + 'px',
  35740. height: box.height + 'px'
  35741. }
  35742. };
  35743. elStyle.bottom = '0px';
  35744. break;
  35745. case 'l':
  35746. anim = {
  35747. from: {
  35748. width: '0px',
  35749. height: box.height + 'px'
  35750. },
  35751. to: {
  35752. width: box.width + 'px',
  35753. height: box.height + 'px'
  35754. }
  35755. };
  35756. me.anchorAnimX(anchor);
  35757. break;
  35758. case 'r':
  35759. anim = {
  35760. from: {
  35761. x: box.x + box.width,
  35762. width: '0px',
  35763. height: box.height + 'px'
  35764. },
  35765. to: {
  35766. x: box.x,
  35767. width: box.width + 'px',
  35768. height: box.height + 'px'
  35769. }
  35770. };
  35771. me.anchorAnimX(anchor);
  35772. break;
  35773. case 'b':
  35774. anim = {
  35775. from: {
  35776. y: box.y + box.height,
  35777. width: box.width + 'px',
  35778. height: '0px'
  35779. },
  35780. to: {
  35781. y: box.y,
  35782. width: box.width + 'px',
  35783. height: box.height + 'px'
  35784. }
  35785. };
  35786. break;
  35787. case 'tl':
  35788. anim = {
  35789. from: {
  35790. x: box.x,
  35791. y: box.y,
  35792. width: '0px',
  35793. height: '0px'
  35794. },
  35795. to: {
  35796. width: box.width + 'px',
  35797. height: box.height + 'px'
  35798. }
  35799. };
  35800. elStyle.bottom = '0px';
  35801. me.anchorAnimX('l');
  35802. break;
  35803. case 'bl':
  35804. anim = {
  35805. from: {
  35806. y: box.y + box.height,
  35807. width: '0px',
  35808. height: '0px'
  35809. },
  35810. to: {
  35811. y: box.y,
  35812. width: box.width + 'px',
  35813. height: box.height + 'px'
  35814. }
  35815. };
  35816. me.anchorAnimX('l');
  35817. break;
  35818. case 'br':
  35819. anim = {
  35820. from: {
  35821. x: box.x + box.width,
  35822. y: box.y + box.height,
  35823. width: '0px',
  35824. height: '0px'
  35825. },
  35826. to: {
  35827. x: box.x,
  35828. y: box.y,
  35829. width: box.width + 'px',
  35830. height: box.height + 'px'
  35831. }
  35832. };
  35833. me.anchorAnimX('r');
  35834. break;
  35835. case 'tr':
  35836. anim = {
  35837. from: {
  35838. x: box.x + box.width,
  35839. width: '0px',
  35840. height: '0px'
  35841. },
  35842. to: {
  35843. x: box.x,
  35844. width: box.width + 'px',
  35845. height: box.height + 'px'
  35846. }
  35847. };
  35848. elStyle.bottom = '0px';
  35849. me.anchorAnimX('r');
  35850. break;
  35851. }
  35852. wrap.show();
  35853. wrapAnim = Ext.apply({}, options);
  35854. delete wrapAnim.listeners;
  35855. wrapAnim = new Ext.fx.Anim(Ext.applyIf(wrapAnim, {
  35856. target: wrap,
  35857. duration: 500,
  35858. easing: 'ease-out',
  35859. from: slideOut ? anim.to : anim.from,
  35860. to: slideOut ? anim.from : anim.to
  35861. }));
  35862. // In the absence of a callback, this listener MUST be added first
  35863. wrapAnim.on('afteranimate', function() {
  35864. // Reattach to the DOM in case the caller animated a Fly
  35865. // in which case the dom reference will have changed by now.
  35866. animFly.attach(dom);
  35867. animFly.setStyle(originalStyles);
  35868. if (slideOut) {
  35869. if (options.useDisplay) {
  35870. animFly.setDisplayed(false);
  35871. } else {
  35872. animFly.hide();
  35873. }
  35874. }
  35875. if (wrap.dom) {
  35876. if (wrap.dom.parentNode) {
  35877. wrap.dom.parentNode.insertBefore(dom, wrap.dom);
  35878. } else {
  35879. wrapDomParentNode.appendChild(dom);
  35880. }
  35881. wrap.destroy();
  35882. }
  35883. // The unwrap will have reset all descendant scrollTops.
  35884. // Restore them if we cached them.
  35885. if (restoreScroll) {
  35886. restoreScroll();
  35887. }
  35888. // kill the no-op element animation created below
  35889. animScope.end();
  35890. });
  35891. // Add configured listeners after
  35892. if (listeners) {
  35893. wrapAnim.on(listeners);
  35894. }
  35895. };
  35896. me.animate({
  35897. // See "A Note About Wrapped Animations" at the top of this class:
  35898. duration: options.duration ? Math.max(options.duration, 500) * 2 : 1000,
  35899. listeners: {
  35900. beforeanimate: beforeAnim
  35901. }
  35902. });
  35903. // kick off the wrap animation
  35904. return me;
  35905. },
  35906. /**
  35907. * Slides the element out of view. An anchor point can be optionally passed to set the end
  35908. * point for the slide effect. When the effect is completed, the element will be hidden
  35909. * (visibility = 'hidden') but block elements will still take up space in the document.
  35910. * The element must be removed from the DOM using the 'remove' config option if
  35911. * desired. This function automatically handles wrapping the element with a fixed-size
  35912. * container if needed. See the {@link Ext.fx.Anim} class overview for valid anchor point
  35913. * options. Usage:
  35914. *
  35915. * // default: slide the element out to the top
  35916. * el.slideOut();
  35917. *
  35918. * // custom: slide the element out to the right with a 2-second duration
  35919. * el.slideOut('r', { duration: 2000 });
  35920. *
  35921. * // common config options shown with default values
  35922. * el.slideOut('t', {
  35923. * easing: 'easeOut',
  35924. * duration: 500,
  35925. * remove: false,
  35926. * useDisplay: false
  35927. * });
  35928. *
  35929. * @param {String} anchor (optional) One of the valid {@link Ext.fx.Anim} anchor positions
  35930. * (defaults to top: 't')
  35931. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  35932. * config options
  35933. * @return {Ext.dom.Element} The Element
  35934. */
  35935. slideOut: function(anchor, options) {
  35936. return this.slideIn(anchor, options, true);
  35937. },
  35938. /**
  35939. * Blinks the element as if it was clicked and then collapses on its center (similar to
  35940. * switching off a television). When the effect is completed, the element will be hidden
  35941. * (visibility = 'hidden') but block elements will still take up space in the document.
  35942. * The element must be removed from the DOM using the 'remove' config option if desired.
  35943. * Usage:
  35944. *
  35945. * // default
  35946. * el.switchOff();
  35947. *
  35948. * // all config options shown with default values
  35949. * el.switchOff({
  35950. * easing: 'easeIn',
  35951. * duration: .3,
  35952. * remove: false,
  35953. * useDisplay: false
  35954. * });
  35955. *
  35956. * @param {Object} options (optional) Object literal with any of the {@link Ext.fx.Anim}
  35957. * config options
  35958. * @return {Ext.dom.Element} The Element
  35959. */
  35960. switchOff: function(options) {
  35961. var me = this,
  35962. dom = me.dom,
  35963. animFly = new Ext.dom.Fly(),
  35964. beforeAnim;
  35965. options = Ext.applyIf(options || {}, {
  35966. easing: 'ease-in',
  35967. duration: 500,
  35968. remove: false,
  35969. useDisplay: false
  35970. });
  35971. beforeAnim = function() {
  35972. // Reattach to the DOM in case the caller animated a Fly
  35973. // in which case the dom reference will have changed by now.
  35974. animFly.attach(dom);
  35975. // eslint-disable-next-line vars-on-top
  35976. var animScope = this,
  35977. size = animFly.getSize(),
  35978. xy = animFly.getXY(),
  35979. keyframe, position;
  35980. animFly.clearOpacity();
  35981. animFly.clip();
  35982. position = animFly.getPositioning();
  35983. keyframe = new Ext.fx.Animator({
  35984. target: dom,
  35985. duration: options.duration,
  35986. easing: options.easing,
  35987. keyframes: {
  35988. 33: {
  35989. opacity: 0.3
  35990. },
  35991. 66: {
  35992. height: 1,
  35993. y: xy[1] + size.height / 2
  35994. },
  35995. 100: {
  35996. width: 1,
  35997. x: xy[0] + size.width / 2
  35998. }
  35999. }
  36000. });
  36001. keyframe.on('afteranimate', function() {
  36002. // Reattach to the DOM in case the caller animated a Fly
  36003. // in which case the dom reference will have changed by now.
  36004. animFly.attach(dom);
  36005. if (options.useDisplay) {
  36006. animFly.setDisplayed(false);
  36007. } else {
  36008. animFly.hide();
  36009. }
  36010. animFly.clearOpacity();
  36011. animFly.setPositioning(position);
  36012. animFly.setSize(size);
  36013. // kill the no-op element animation created below
  36014. animScope.end();
  36015. });
  36016. };
  36017. me.animate({
  36018. // See "A Note About Wrapped Animations" at the top of this class:
  36019. duration: (Math.max(options.duration, 500) * 2),
  36020. listeners: {
  36021. beforeanimate: {
  36022. fn: beforeAnim
  36023. }
  36024. },
  36025. callback: options.callback,
  36026. scope: options.scope
  36027. });
  36028. return me;
  36029. },
  36030. /**
  36031. * @private
  36032. * Currently used for updating grid cells without modifying DOM structure
  36033. *
  36034. * Synchronizes content of this Element with the content of the passed element.
  36035. *
  36036. * Style and CSS class are copied from source into this Element, and contents are synced
  36037. * recursively. If a child node is a text node, the textual data is copied.
  36038. */
  36039. syncContent: function(source) {
  36040. source = Ext.getDom(source);
  36041. // eslint-disable-next-line vars-on-top
  36042. var sourceNodes = source.childNodes,
  36043. sourceLen = sourceNodes.length,
  36044. dest = this.dom,
  36045. destNodes = dest.childNodes,
  36046. destLen = destNodes.length,
  36047. i, destNode, sourceNode, sourceStyle, nodeType, newAttrs, attLen, attName, value,
  36048. elData = dest._extData;
  36049. if (!syncContentFly) {
  36050. syncContentFly = new Ext.dom.Fly();
  36051. }
  36052. // Update any attributes who's values have changed..
  36053. newAttrs = source.attributes;
  36054. attLen = newAttrs.length;
  36055. for (i = 0; i < attLen; i++) {
  36056. attName = newAttrs[i].name;
  36057. value = newAttrs[i].value;
  36058. if (attName !== 'id' && dest.getAttribute(attName) !== value) {
  36059. dest.setAttribute(attName, newAttrs[i].value);
  36060. }
  36061. }
  36062. // The element's data is no longer synchronized. We just overwrite it in the DOM
  36063. if (elData) {
  36064. elData.isSynchronized = false;
  36065. }
  36066. // If the number of child nodes does not match, fall back to replacing innerHTML
  36067. if (sourceLen !== destLen) {
  36068. dest.innerHTML = source.innerHTML;
  36069. return;
  36070. }
  36071. // Loop through source nodes.
  36072. // If there are fewer, we must remove excess
  36073. for (i = 0; i < sourceLen; i++) {
  36074. sourceNode = sourceNodes[i];
  36075. destNode = destNodes[i];
  36076. nodeType = sourceNode.nodeType;
  36077. sourceStyle = sourceNode.style;
  36078. // If node structure is out of sync, just drop innerHTML in and return
  36079. if (nodeType !== destNode.nodeType || (nodeType === 1 && sourceNode.tagName !== destNode.tagName)) {
  36080. dest.innerHTML = source.innerHTML;
  36081. return;
  36082. }
  36083. // Update non-Element node (text, comment)
  36084. if (!sourceStyle) {
  36085. destNode.data = sourceNode.data;
  36086. } else // Sync element content
  36087. {
  36088. if (sourceNode.id && destNode.id !== sourceNode.id) {
  36089. destNode.id = sourceNode.id;
  36090. }
  36091. destNode.style.cssText = sourceStyle.cssText;
  36092. destNode.className = sourceNode.className;
  36093. syncContentFly.attach(destNode).syncContent(sourceNode);
  36094. }
  36095. }
  36096. },
  36097. /**
  36098. * Toggles the element's visibility, depending on visibility mode.
  36099. * @param {Boolean/Object} [animate] True for the default animation, or a standard Element
  36100. * animation config object
  36101. * @return {Ext.dom.Element} this
  36102. */
  36103. toggle: function(animate) {
  36104. var me = this;
  36105. me.setVisible(!me.isVisible(), me.anim(animate));
  36106. return me;
  36107. },
  36108. /**
  36109. * Hides a previously applied mask.
  36110. */
  36111. unmask: function() {
  36112. var me = this,
  36113. data = me.getData(),
  36114. maskEl = data.maskEl,
  36115. style;
  36116. if (maskEl) {
  36117. style = maskEl.dom.style;
  36118. // Remove resource-intensive CSS expressions as soon as they are not required.
  36119. if (style.clearExpression) {
  36120. style.clearExpression('width');
  36121. style.clearExpression('height');
  36122. }
  36123. if (maskEl) {
  36124. maskEl.destroy();
  36125. delete data.maskEl;
  36126. }
  36127. me.removeCls([
  36128. XMASKED,
  36129. XMASKEDRELATIVE
  36130. ]);
  36131. }
  36132. me.restoreTabbableState(me.dom === DOC.body);
  36133. },
  36134. /**
  36135. * Return clipping (overflow) to original clipping before {@link #clip} was called
  36136. * @return {Ext.dom.Element} this
  36137. */
  36138. unclip: function() {
  36139. var me = this,
  36140. data = me.getData(),
  36141. clip;
  36142. if (data[ISCLIPPED]) {
  36143. data[ISCLIPPED] = false;
  36144. clip = data[ORIGINALCLIP];
  36145. if (clip.o) {
  36146. me.setStyle(OVERFLOW, clip.o);
  36147. }
  36148. if (clip.x) {
  36149. me.setStyle(OVERFLOWX, clip.x);
  36150. }
  36151. if (clip.y) {
  36152. me.setStyle(OVERFLOWY, clip.y);
  36153. }
  36154. }
  36155. return me;
  36156. },
  36157. translate: function(x, y, z) {
  36158. if (Ext.supports.CssTransforms && !Ext.isIE9m) {
  36159. this.callParent(arguments);
  36160. } else {
  36161. if (x != null) {
  36162. this.dom.style.left = x + 'px';
  36163. }
  36164. if (y != null) {
  36165. this.dom.style.top = y + 'px';
  36166. }
  36167. }
  36168. },
  36169. deprecated: {
  36170. '4.0': {
  36171. methods: {
  36172. /**
  36173. * @method pause
  36174. * Creates a pause before any subsequent queued effects begin. If there are
  36175. * no effects queued after the pause it will have no effect. Usage:
  36176. *
  36177. * el.pause(1);
  36178. *
  36179. * @deprecated 4.0 Use the `delay` config to {@link #animate} instead.
  36180. * @param {Number} ms The length of time to pause (in milliseconds)
  36181. * @return {Ext.dom.Element} The Element
  36182. */
  36183. pause: function(ms) {
  36184. var me = this;
  36185. Ext.fx.Manager.setFxDefaults(me.id, {
  36186. delay: ms
  36187. });
  36188. return me;
  36189. },
  36190. /**
  36191. * @method scale
  36192. * Animates the transition of an element's dimensions from a starting
  36193. * height/width to an ending height/width. This method is a convenience
  36194. * implementation of {@link #shift}. Usage:
  36195. *
  36196. * // change height and width to 100x100 pixels
  36197. * el.scale(100, 100);
  36198. *
  36199. * // common config options shown with default values.
  36200. * // The height and width will default to the element's existing values
  36201. * // if passed as null.
  36202. * el.scale(
  36203. * [element's width],
  36204. * [element's height], {
  36205. * easing: 'easeOut',
  36206. * duration: 350
  36207. * }
  36208. * );
  36209. *
  36210. * @deprecated 4.0 Just use {@link #animate} instead.
  36211. * @param {Number} width The new width (pass undefined to keep the original
  36212. * width)
  36213. * @param {Number} height The new height (pass undefined to keep the original
  36214. * height)
  36215. * @param {Object} options (optional) Object literal with any of the
  36216. * {@link Ext.fx.Anim} config options
  36217. * @return {Ext.dom.Element} The Element
  36218. */
  36219. scale: function(width, height, options) {
  36220. this.animate(Ext.apply({}, options, {
  36221. width: width,
  36222. height: height
  36223. }));
  36224. return this;
  36225. },
  36226. /**
  36227. * @method shift
  36228. * Animates the transition of any combination of an element's dimensions,
  36229. * xy position and/or opacity. Any of these properties not specified in the
  36230. * config object will not be changed. This effect requires that at least one new
  36231. * dimension, position or opacity setting must be passed in on the config object
  36232. * in order for the function to have any effect. Usage:
  36233. *
  36234. * // slide the element horizontally to x position 200
  36235. * // while changing the height and opacity
  36236. * el.shift({ x: 200, height: 50, opacity: .8 });
  36237. *
  36238. * // common config options shown with default values.
  36239. * el.shift({
  36240. * width: [element's width],
  36241. * height: [element's height],
  36242. * x: [element's x position],
  36243. * y: [element's y position],
  36244. * opacity: [element's opacity],
  36245. * easing: 'easeOut',
  36246. * duration: 350
  36247. * });
  36248. *
  36249. * @deprecated 4.0 Just use {@link #animate} instead.
  36250. * @param {Object} options Object literal with any of the {@link Ext.fx.Anim}
  36251. * config options
  36252. * @return {Ext.dom.Element} The Element
  36253. */
  36254. shift: function(options) {
  36255. this.animate(options);
  36256. return this;
  36257. }
  36258. }
  36259. },
  36260. '4.2': {
  36261. methods: {
  36262. /**
  36263. * @method moveTo
  36264. * Sets the position of the element in page coordinates.
  36265. * @param {Number} x X value for new position (coordinates are page-based)
  36266. * @param {Number} y Y value for new position (coordinates are page-based)
  36267. * @param {Boolean/Object} [animate] True for the default animation,
  36268. * or a standard Element animation config object
  36269. * @return {Ext.dom.Element} this
  36270. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  36271. */
  36272. moveTo: function(x, y, animate) {
  36273. return this.setXY([
  36274. x,
  36275. y
  36276. ], animate);
  36277. },
  36278. /**
  36279. * @method setBounds
  36280. * Sets the element's position and size in one shot. If animation is true then
  36281. * width, height, x and y will be animated concurrently.
  36282. *
  36283. * @param {Number} x X value for new position (coordinates are page-based)
  36284. * @param {Number} y Y value for new position (coordinates are page-based)
  36285. * @param {Number/String} width The new width. This may be one of:
  36286. *
  36287. * - A Number specifying the new width in pixels
  36288. * - A String used to set the CSS width style. Animation may **not** be used.
  36289. *
  36290. * @param {Number/String} height The new height. This may be one of:
  36291. *
  36292. * - A Number specifying the new height in pixels
  36293. * - A String used to set the CSS height style. Animation may **not** be used.
  36294. *
  36295. * @param {Boolean/Object} [animate] true for the default animation or
  36296. * a standard Element animation config object
  36297. *
  36298. * @return {Ext.dom.Element} this
  36299. * @deprecated 4.2.0 Use {@link Ext.util.Positionable#setBox} instead.
  36300. */
  36301. setBounds: function(x, y, width, height, animate) {
  36302. return this.setBox({
  36303. x: x,
  36304. y: y,
  36305. width: width,
  36306. height: height
  36307. }, animate);
  36308. },
  36309. /**
  36310. * @method setLeftTop
  36311. * Sets the element's left and top positions directly using CSS style
  36312. * @param {Number/String} left Number of pixels or CSS string value to
  36313. * set as the left CSS property value
  36314. * @param {Number/String} top Number of pixels or CSS string value to
  36315. * set as the top CSS property value
  36316. * @return {Ext.dom.Element} this
  36317. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setLocalXY} instead
  36318. */
  36319. setLeftTop: function(left, top) {
  36320. var me = this,
  36321. style = me.dom.style;
  36322. style.left = Element.addUnits(left);
  36323. style.top = Element.addUnits(top);
  36324. if (me.shadow || me.shim) {
  36325. me.syncUnderlays();
  36326. }
  36327. return me;
  36328. },
  36329. /**
  36330. * @method setLocation
  36331. * Sets the position of the element in page coordinates.
  36332. * @param {Number} x X value for new position
  36333. * @param {Number} y Y value for new position
  36334. * @param {Boolean/Object} [animate] True for the default animation,
  36335. * or a standard Element animation config object
  36336. * @return {Ext.dom.Element} this
  36337. * @deprecated 4.2.0 Use {@link Ext.dom.Element#setXY} instead.
  36338. */
  36339. setLocation: function(x, y, animate) {
  36340. return this.setXY([
  36341. x,
  36342. y
  36343. ], animate);
  36344. }
  36345. }
  36346. },
  36347. '5.0': {
  36348. methods: {
  36349. /**
  36350. * @method getAttributeNS
  36351. * Returns the value of a namespaced attribute from the element's underlying
  36352. * DOM node.
  36353. * @param {String} namespace The namespace in which to look for the attribute
  36354. * @param {String} name The attribute name
  36355. * @return {String} The attribute value
  36356. * @deprecated 5.0.0 Please use {@link Ext.dom.Element#getAttribute} instead.
  36357. */
  36358. getAttributeNS: function(namespace, name) {
  36359. return this.getAttribute(name, namespace);
  36360. },
  36361. /**
  36362. * @method getCenterXY
  36363. * Calculates the x, y to center this element on the screen
  36364. * @return {Number[]} The x, y values [x, y]
  36365. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getAlignToXY} instead.
  36366. * el.getAlignToXY(document, 'c-c');
  36367. */
  36368. getCenterXY: function() {
  36369. return this.getAlignToXY(DOC, 'c-c');
  36370. },
  36371. /**
  36372. * @method getComputedHeight
  36373. * Returns either the offsetHeight or the height of this element based on CSS
  36374. * height adjusted by padding or borders when needed to simulate offsetHeight
  36375. * when offsets aren't available. This may not work on display:none elements
  36376. * if a height has not been set using CSS.
  36377. * @return {Number}
  36378. * @deprecated 5.0.0 use {@link Ext.dom.Element#getHeight} instead
  36379. */
  36380. getComputedHeight: function() {
  36381. return Math.max(this.dom.offsetHeight, this.dom.clientHeight) || parseFloat(this.getStyle(HEIGHT)) || 0;
  36382. },
  36383. /**
  36384. * @method getComputedWidth
  36385. * Returns either the offsetWidth or the width of this element based on CSS
  36386. * width adjusted by padding or borders when needed to simulate offsetWidth
  36387. * when offsets aren't available. This may not work on display:none elements
  36388. * if a width has not been set using CSS.
  36389. * @return {Number}
  36390. * @deprecated 5.0.0 use {@link Ext.dom.Element#getWidth} instead.
  36391. */
  36392. getComputedWidth: function() {
  36393. return Math.max(this.dom.offsetWidth, this.dom.clientWidth) || parseFloat(this.getStyle(WIDTH)) || 0;
  36394. },
  36395. /**
  36396. * @method getStyleSize
  36397. * Returns the dimensions of the element available to lay content out in.
  36398. *
  36399. * getStyleSize utilizes prefers style sizing if present, otherwise it chooses
  36400. * the larger of offsetHeight/clientHeight and offsetWidth/clientWidth.
  36401. * To obtain the size excluding scrollbars, use getViewSize.
  36402. *
  36403. * Sizing of the document body is handled at the adapter level which handles
  36404. * special cases for IE and strict modes, etc.
  36405. *
  36406. * @return {Object} Object describing width and height.
  36407. * @return {Number} return.width
  36408. * @return {Number} return.height
  36409. * @deprecated 5.0.0 Use {@link Ext.dom.Element#getSize} instead.
  36410. */
  36411. getStyleSize: function() {
  36412. var me = this,
  36413. d = this.dom,
  36414. isDoc = (d === DOC || d === DOC.body),
  36415. s, w, h;
  36416. // If the body, use static methods
  36417. if (isDoc) {
  36418. return {
  36419. width: Element.getViewportWidth(),
  36420. height: Element.getViewportHeight()
  36421. };
  36422. }
  36423. s = me.getStyle([
  36424. 'height',
  36425. 'width'
  36426. ], true);
  36427. // seek inline
  36428. // Use Styles if they are set
  36429. if (s.width && s.width !== 'auto') {
  36430. w = parseFloat(s.width);
  36431. }
  36432. // Use Styles if they are set
  36433. if (s.height && s.height !== 'auto') {
  36434. h = parseFloat(s.height);
  36435. }
  36436. // Use getWidth/getHeight if style not set.
  36437. return {
  36438. width: w || me.getWidth(true),
  36439. height: h || me.getHeight(true)
  36440. };
  36441. },
  36442. /**
  36443. * @method isBorderBox
  36444. * Returns true if this element uses the border-box-sizing model.
  36445. * This method is deprecated as of version 5.0 because border-box sizing
  36446. * is forced upon all elements via a style sheet rule, and the browsers
  36447. * that do not support border-box (IE6/7 strict mode) are no longer supported.
  36448. * @deprecated 5.0.0 This method is deprecated. Browsers that do not
  36449. * support border-box (IE6/7 strict mode) are no longer supported.
  36450. * @return {Boolean}
  36451. */
  36452. isBorderBox: function() {
  36453. return true;
  36454. },
  36455. /**
  36456. * @method isDisplayed
  36457. * Returns true if display is not "none"
  36458. * @return {Boolean}
  36459. * @deprecated 5.0.0 use element.isStyle('display', 'none');
  36460. */
  36461. isDisplayed: function() {
  36462. return !this.isStyle('display', 'none');
  36463. },
  36464. /**
  36465. * @method focusable
  36466. * Checks whether this element can be focused.
  36467. * @return {Boolean} True if the element is focusable
  36468. * @deprecated 5.0.0 use {@link #isFocusable} instead
  36469. */
  36470. focusable: 'isFocusable'
  36471. }
  36472. }
  36473. }
  36474. };
  36475. })(), function() {
  36476. var Element = Ext.dom.Element,
  36477. proto = Element.prototype,
  36478. useDocForId = !Ext.isIE8,
  36479. DOC = document,
  36480. view = DOC.defaultView,
  36481. opacityRe = /alpha\(opacity=(.*)\)/i,
  36482. trimRe = /^\s+|\s+$/g,
  36483. styleHooks = proto.styleHooks,
  36484. supports = Ext.supports,
  36485. verticalStyleHooks90, verticalStyleHooks270, edges, k, edge, borderWidth, getBorderWidth;
  36486. proto._init(Element);
  36487. delete proto._init;
  36488. Ext.plainTableCls = Ext.baseCSSPrefix + 'table-plain';
  36489. Ext.plainListCls = Ext.baseCSSPrefix + 'list-plain';
  36490. // ensure that any methods added by this override are also added to Ext.CompositeElementLite
  36491. if (Ext.CompositeElementLite) {
  36492. Ext.CompositeElementLite.importElementMethods();
  36493. }
  36494. if (!supports.Opacity && Ext.isIE) {
  36495. Ext.apply(styleHooks.opacity, {
  36496. get: function(dom) {
  36497. var filter = dom.style.filter,
  36498. match, opacity;
  36499. if (filter.match) {
  36500. match = filter.match(opacityRe);
  36501. if (match) {
  36502. opacity = parseFloat(match[1]);
  36503. if (!isNaN(opacity)) {
  36504. return opacity ? opacity / 100 : 0;
  36505. }
  36506. }
  36507. }
  36508. return 1;
  36509. },
  36510. set: function(dom, value) {
  36511. var style = dom.style,
  36512. val = style.filter.replace(opacityRe, '').replace(trimRe, '');
  36513. style.zoom = 1;
  36514. // ensure dom.hasLayout
  36515. // value can be a number or '' or null... so treat falsey as no opacity
  36516. if (typeof (value) === 'number' && value >= 0 && value < 1) {
  36517. value *= 100;
  36518. style.filter = val + (val.length ? ' ' : '') + 'alpha(opacity=' + value + ')';
  36519. } else {
  36520. style.filter = val;
  36521. }
  36522. }
  36523. });
  36524. }
  36525. if (!supports.matchesSelector) {
  36526. // Match basic tagName.ClassName selector syntax for is implementation
  36527. // eslint-disable-next-line vars-on-top
  36528. var simpleSelectorRe = /^([a-z]+|\*)?(?:\.([a-z][a-z\-_0-9]*))?$/i,
  36529. dashRe = /-/g,
  36530. fragment,
  36531. classMatcher = function(tag, cls) {
  36532. var classRe = new RegExp('(?:^|\\s+)' + cls.replace(dashRe, '\\-') + '(?:\\s+|$)');
  36533. if (tag && tag !== '*') {
  36534. tag = tag.toUpperCase();
  36535. return function(el) {
  36536. return el.tagName === tag && classRe.test(el.className);
  36537. };
  36538. }
  36539. return function(el) {
  36540. return classRe.test(el.className);
  36541. };
  36542. },
  36543. tagMatcher = function(tag) {
  36544. tag = tag.toUpperCase();
  36545. return function(el) {
  36546. return el.tagName === tag;
  36547. };
  36548. },
  36549. cache = {};
  36550. proto.matcherCache = cache;
  36551. proto.is = function(selector) {
  36552. var dom = this.dom,
  36553. cls, match, testFn, root, isOrphan, is, tag;
  36554. // Empty selector always matches
  36555. if (!selector) {
  36556. return true;
  36557. }
  36558. // Only Element node types can be matched.
  36559. if (dom.nodeType !== 1) {
  36560. return false;
  36561. }
  36562. // eslint-disable-next-line no-cond-assign
  36563. if (!(testFn = Ext.isFunction(selector) ? selector : cache[selector])) {
  36564. // eslint-disable-next-line no-cond-assign
  36565. if (!(match = selector.match(simpleSelectorRe))) {
  36566. // Not a simple tagName.className selector, do it the hard way
  36567. root = dom.parentNode;
  36568. if (!root) {
  36569. isOrphan = true;
  36570. root = fragment || (fragment = DOC.createDocumentFragment());
  36571. fragment.appendChild(dom);
  36572. }
  36573. is = Ext.Array.indexOf(Ext.fly(root, '_is').query(selector), dom) !== -1;
  36574. if (isOrphan) {
  36575. fragment.removeChild(dom);
  36576. }
  36577. return is;
  36578. }
  36579. tag = match[1];
  36580. cls = match[2];
  36581. cache[selector] = testFn = cls ? classMatcher(tag, cls) : tagMatcher(tag);
  36582. }
  36583. return testFn(dom);
  36584. };
  36585. }
  36586. // IE8 needs its own implementation of getStyle because it doesn't support getComputedStyle
  36587. if (!view || !view.getComputedStyle) {
  36588. proto.getStyle = function(property, inline) {
  36589. var me = this,
  36590. dom = me.dom,
  36591. multiple = typeof property !== 'string',
  36592. prop = property,
  36593. props = prop,
  36594. len = 1,
  36595. isInline = inline,
  36596. styleHooks = me.styleHooks,
  36597. camel, domStyle, values, hook, out, style, i;
  36598. if (multiple) {
  36599. values = {};
  36600. prop = props[0];
  36601. i = 0;
  36602. if (!(len = props.length)) {
  36603. return values;
  36604. }
  36605. }
  36606. if (!dom || dom.documentElement) {
  36607. return values || '';
  36608. }
  36609. domStyle = dom.style;
  36610. if (inline) {
  36611. style = domStyle;
  36612. } else {
  36613. style = dom.currentStyle;
  36614. // fallback to inline style if rendering context not available
  36615. if (!style) {
  36616. isInline = true;
  36617. style = domStyle;
  36618. }
  36619. }
  36620. do {
  36621. hook = styleHooks[prop];
  36622. if (!hook) {
  36623. styleHooks[prop] = hook = {
  36624. name: Element.normalize(prop)
  36625. };
  36626. }
  36627. if (hook.get) {
  36628. out = hook.get(dom, me, isInline, style);
  36629. } else {
  36630. camel = hook.name;
  36631. out = style[camel];
  36632. }
  36633. if (!multiple) {
  36634. return out;
  36635. }
  36636. values[prop] = out;
  36637. prop = props[++i];
  36638. } while (i < len);
  36639. return values;
  36640. };
  36641. }
  36642. // override getStyle for border-*-width
  36643. if (Ext.isIE8) {
  36644. getBorderWidth = function(dom, el, inline, style) {
  36645. if (style[this.styleName] === 'none') {
  36646. return '0px';
  36647. }
  36648. return style[this.name];
  36649. };
  36650. edges = [
  36651. 'Top',
  36652. 'Right',
  36653. 'Bottom',
  36654. 'Left'
  36655. ];
  36656. k = edges.length;
  36657. while (k--) {
  36658. edge = edges[k];
  36659. borderWidth = 'border' + edge + 'Width';
  36660. styleHooks['border-' + edge.toLowerCase() + '-width'] = styleHooks[borderWidth] = {
  36661. name: borderWidth,
  36662. styleName: 'border' + edge + 'Style',
  36663. get: getBorderWidth
  36664. };
  36665. }
  36666. // IE8 has an odd bug with handling font icons in pseudo elements;
  36667. // it will render the icon once and not update it when something
  36668. // like text color is changed via style addition or removal.
  36669. // We have to force icon repaint by adding a style with forced empty
  36670. // pseudo element content, (x-sync-repaint) and removing it back to work
  36671. // around this issue.
  36672. // See this: https://github.com/FortAwesome/Font-Awesome/issues/954
  36673. // and this: https://github.com/twbs/bootstrap/issues/13863
  36674. // eslint-disable-next-line vars-on-top
  36675. var syncRepaintCls = Ext.baseCSSPrefix + 'sync-repaint';
  36676. proto.syncRepaint = function() {
  36677. this.addCls(syncRepaintCls);
  36678. // Measuring element width will make the browser to repaint it
  36679. this.getWidth();
  36680. // Removing empty content makes the icon to appear again and be redrawn
  36681. this.removeCls(syncRepaintCls);
  36682. };
  36683. }
  36684. if (Ext.isIE10m) {
  36685. Ext.override(Element, {
  36686. focus: function(defer, dom) {
  36687. var me = this,
  36688. ex;
  36689. dom = dom || me.dom;
  36690. if (me.deferredFocusTimer) {
  36691. Ext.undefer(me.deferredFocusTimer);
  36692. }
  36693. me.deferredFocusTimer = null;
  36694. if (Number(defer)) {
  36695. me.deferredFocusTimer = Ext.defer(me.focus, defer, me, [
  36696. null,
  36697. dom
  36698. ]);
  36699. } else {
  36700. Ext.GlobalEvents.fireEvent('beforefocus', dom);
  36701. // IE10m has an acute problem with focusing input elements;
  36702. // when the element was just shown and did not have enough
  36703. // time to initialize, focusing it might fail. The problem
  36704. // is somewhat random in nature; most of the time focusing
  36705. // an input element will succeed, failing only occasionally.
  36706. // When it fails, the focus will be thrown to the document
  36707. // body element, with subsequent focusout/focusin event pair
  36708. // on the body, which throws off our focusenter/focusleave
  36709. // processing.
  36710. // Fortunately for us, when this focus failure happens, the
  36711. // resulting focusout event will happen *synchronously*
  36712. // unlike the normal focusing events which IE will fire
  36713. // asynchronously. Also fortunately for us, in most cases
  36714. // trying to focus the given element the second time
  36715. // immediately after it failed to focus the first time
  36716. // seems to do the trick; however when second focus attempt
  36717. // succeeds, it will result in focusout on the body and
  36718. // focusin on the given element, which again wreaks havoc
  36719. // on our focusenter/focusleave handling.
  36720. // The only workable solution we have is to pretend that
  36721. // focus never went to the document body and ignore the
  36722. // focusout and focusin caused by failed first focus attempt.
  36723. // To this end, we fudge the event stream in Focus publisher
  36724. // override.
  36725. if (dom && (dom.tagName === 'INPUT' || dom.tagname === 'TEXTAREA')) {
  36726. Ext.synchronouslyFocusing = document.activeElement;
  36727. }
  36728. // Also note that trying to focus an unfocusable element
  36729. // might throw an exception in IE8. What a cute idea, MS. :(
  36730. try {
  36731. dom.focus();
  36732. } catch (xcpt) {
  36733. ex = xcpt;
  36734. }
  36735. // Ok so now we have this situation when we tried to focus
  36736. // the first time but did not succeed. Let's try again but
  36737. // not if there was an exception the first time - when the
  36738. // "focus failure" happens it does so silently. :(
  36739. if (Ext.synchronouslyFocusing && document.activeElement !== dom && !ex) {
  36740. dom.focus();
  36741. }
  36742. Ext.synchronouslyFocusing = null;
  36743. }
  36744. return me;
  36745. }
  36746. });
  36747. }
  36748. Ext.apply(Ext, {
  36749. /**
  36750. * `true` to automatically uncache orphaned Ext.Elements periodically. If set to
  36751. * `false`, the application will be required to clean up orphaned Ext.Elements and
  36752. * it's listeners as to not cause memory leakage.
  36753. * @member Ext
  36754. */
  36755. enableGarbageCollector: true,
  36756. // In sencha v5 isBorderBox is no longer needed since all supported browsers
  36757. // support border-box, but it is hard coded to true for backward compatibility
  36758. isBorderBox: true,
  36759. /**
  36760. * @property {Boolean} useShims
  36761. * @member Ext
  36762. * Set to `true` to use a {@link Ext.util.Floating#shim shim} on all floating Components
  36763. * and {@link Ext.LoadMask LoadMasks}
  36764. */
  36765. useShims: false,
  36766. getElementById: function(id) {
  36767. var el = DOC.getElementById(id),
  36768. detachedBodyEl;
  36769. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  36770. el = detachedBodyEl.dom.querySelector(Ext.makeIdSelector(id));
  36771. }
  36772. return el;
  36773. },
  36774. /**
  36775. * Applies event listeners to elements by selectors when the document is ready.
  36776. * The event name is specified with an `@` suffix.
  36777. *
  36778. * Ext.addBehaviors({
  36779. * // add a listener for click on all anchors in element with id foo
  36780. * '#foo a@click': function(e, t){
  36781. * // do something
  36782. * },
  36783. *
  36784. * // add the same listener to multiple selectors (separated by comma BEFORE the @)
  36785. * '#foo a, #bar span.some-class@mouseover': function(){
  36786. * // do something
  36787. * }
  36788. * });
  36789. *
  36790. * @param {Object} obj The list of behaviors to apply
  36791. * @member Ext
  36792. */
  36793. addBehaviors: function(obj) {
  36794. // simple cache for applying multiple behaviors to same selector
  36795. // does query multiple times
  36796. var cache = {},
  36797. parts, b, s;
  36798. if (!Ext.isReady) {
  36799. Ext.onInternalReady(function() {
  36800. Ext.addBehaviors(obj);
  36801. });
  36802. } else {
  36803. for (b in obj) {
  36804. if ((parts = b.split('@'))[1]) {
  36805. // for Object prototype breakers
  36806. s = parts[0];
  36807. if (!cache[s]) {
  36808. cache[s] = Ext.fly(document).select(s, true);
  36809. }
  36810. cache[s].on(parts[1], obj[b]);
  36811. }
  36812. }
  36813. cache = null;
  36814. }
  36815. }
  36816. });
  36817. if (Ext.isIE9m) {
  36818. Ext.getElementById = function(id) {
  36819. var el = DOC.getElementById(id),
  36820. detachedBodyEl;
  36821. if (!el && (detachedBodyEl = Ext.detachedBodyEl)) {
  36822. el = detachedBodyEl.dom.all[id];
  36823. }
  36824. return el;
  36825. };
  36826. proto.getById = function(id, asDom) {
  36827. var dom = this.dom,
  36828. ret = null,
  36829. entry, el;
  36830. if (dom) {
  36831. // for normal elements getElementById is the best solution, but if the el is
  36832. // not part of the document.body, we need to use all[]
  36833. el = (useDocForId && DOC.getElementById(id)) || dom.all[id];
  36834. if (el) {
  36835. if (asDom) {
  36836. ret = el;
  36837. } else {
  36838. // calling Element.get here is a real hit (2x slower) because it has to
  36839. // redetermine that we are giving it a dom el.
  36840. entry = Ext.cache[id];
  36841. if (entry) {
  36842. if (entry.skipGarbageCollection || !Ext.isGarbage(entry.dom)) {
  36843. ret = entry;
  36844. } else {
  36845. Ext.raise("Stale Element with id '" + el.id + "' found in Element cache. " + "Make sure to clean up Element instances using destroy()");
  36846. entry.destroy();
  36847. }
  36848. }
  36849. ret = ret || new Ext.Element(el);
  36850. }
  36851. }
  36852. }
  36853. return ret;
  36854. };
  36855. } else if (!DOC.querySelector) {
  36856. Ext.getDetachedBody = Ext.getBody;
  36857. Ext.getElementById = function(id) {
  36858. return DOC.getElementById(id);
  36859. };
  36860. proto.getById = function(id, asDom) {
  36861. var dom = DOC.getElementById(id);
  36862. return asDom ? dom : (dom ? Ext.get(dom) : null);
  36863. };
  36864. }
  36865. if (Ext.isIE && !(Ext.isIE9p && DOC.documentMode >= 9)) {
  36866. // Essentially all web browsers (Firefox, Internet Explorer, recent versions of Opera,
  36867. // Safari, Konqueror, and iCab, as a non-exhaustive list) return null when the specified
  36868. // attribute does not exist on the specified element.
  36869. // The DOM specification says that the correct return value in this case is actually
  36870. // the empty string, and some DOM implementations implement this behavior.
  36871. // The implementation of getAttribute in XUL (Gecko) actually follows the specification
  36872. // and returns an empty string. Consequently, you should use hasAttribute to check
  36873. // for an attribute's existence prior to calling getAttribute() if it is possible that
  36874. // the requested attribute does not exist on the specified element.
  36875. //
  36876. // https://developer.mozilla.org/en-US/docs/DOM/element.getAttribute
  36877. // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614
  36878. proto.getAttribute = function(name, ns) {
  36879. var d = this.dom,
  36880. type;
  36881. if (ns) {
  36882. type = typeof d[ns + ":" + name];
  36883. if (type !== 'undefined' && type !== 'unknown') {
  36884. return d[ns + ":" + name] || null;
  36885. }
  36886. return null;
  36887. }
  36888. if (name === "for") {
  36889. name = "htmlFor";
  36890. }
  36891. return d[name] || null;
  36892. };
  36893. }
  36894. Ext.onInternalReady(function() {
  36895. var transparentRe = /^(?:transparent|(?:rgba[(](?:\s*\d+\s*[,]){3}\s*0\s*[)]))$/i,
  36896. origSetWidth = proto.setWidth,
  36897. origSetHeight = proto.setHeight,
  36898. origSetSize = proto.setSize,
  36899. origUnselectable = proto.unselectable,
  36900. pxRe = /^\d+(?:\.\d*)?px$/i,
  36901. colorStyles, i, name, camel;
  36902. if (supports.FixedTableWidthBug) {
  36903. // EXTJSIV-12665
  36904. // https://bugs.webkit.org/show_bug.cgi?id=130239
  36905. // Webkit browsers fail to layout correctly when a form field's width is less
  36906. // than the min-width of the body element. The only way to fix it seems to be
  36907. // to toggle the display style of the field's element before and after setting
  36908. // the width. Note: once the bug has been corrected by toggling the element's
  36909. // display, successive calls to setWidth will work without the hack. It's only
  36910. // when going from naturally widthed to having an explicit width that the bug
  36911. // occurs.
  36912. styleHooks.width = {
  36913. name: 'width',
  36914. set: function(dom, value, el) {
  36915. var style = dom.style,
  36916. needsFix = el._needsTableWidthFix,
  36917. origDisplay = style.display;
  36918. if (needsFix) {
  36919. style.display = 'none';
  36920. }
  36921. style.width = value;
  36922. if (needsFix) {
  36923. // repaint
  36924. // eslint-disable-next-line no-unused-expressions
  36925. dom.scrollWidth;
  36926. style.display = origDisplay;
  36927. }
  36928. }
  36929. };
  36930. proto.setWidth = function(width, animate) {
  36931. var me = this,
  36932. dom = me.dom,
  36933. style = dom.style,
  36934. needsFix = me._needsTableWidthFix,
  36935. origDisplay = style.display;
  36936. if (needsFix && !animate) {
  36937. style.display = 'none';
  36938. }
  36939. origSetWidth.call(me, width, animate);
  36940. if (needsFix && !animate) {
  36941. // repaint
  36942. // eslint-disable-next-line no-unused-expressions
  36943. dom.scrollWidth;
  36944. style.display = origDisplay;
  36945. }
  36946. return me;
  36947. };
  36948. proto.setSize = function(width, height, animate) {
  36949. var me = this,
  36950. dom = me.dom,
  36951. style = dom.style,
  36952. needsFix = me._needsTableWidthFix,
  36953. origDisplay = style.display;
  36954. if (needsFix && !animate) {
  36955. style.display = 'none';
  36956. }
  36957. origSetSize.call(me, width, height, animate);
  36958. if (needsFix && !animate) {
  36959. // repaint
  36960. // eslint-disable-next-line no-unused-expressions
  36961. dom.scrollWidth;
  36962. style.display = origDisplay;
  36963. }
  36964. return me;
  36965. };
  36966. }
  36967. if (Ext.isIE8) {
  36968. styleHooks.height = {
  36969. name: 'height',
  36970. set: function(dom, value, el) {
  36971. var component = el.component,
  36972. frameInfo, frameBodyStyle;
  36973. if (component && component._syncFrameHeight && el === component.el) {
  36974. frameBodyStyle = component.frameBody.dom.style;
  36975. if (pxRe.test(value)) {
  36976. frameInfo = component.getFrameInfo();
  36977. if (frameInfo) {
  36978. frameBodyStyle.height = (parseInt(value, 10) - frameInfo.height) + 'px';
  36979. }
  36980. } else if (!value || value === 'auto') {
  36981. frameBodyStyle.height = '';
  36982. }
  36983. }
  36984. dom.style.height = value;
  36985. }
  36986. };
  36987. proto.setHeight = function(height, animate) {
  36988. var component = this.component,
  36989. frameInfo, frameBodyStyle;
  36990. if (component && component._syncFrameHeight && this === component.el) {
  36991. frameBodyStyle = component.frameBody.dom.style;
  36992. if (!height || height === 'auto') {
  36993. frameBodyStyle.height = '';
  36994. } else {
  36995. frameInfo = component.getFrameInfo();
  36996. if (frameInfo) {
  36997. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  36998. }
  36999. }
  37000. }
  37001. return origSetHeight.call(this, height, animate);
  37002. };
  37003. proto.setSize = function(width, height, animate) {
  37004. var component = this.component,
  37005. frameInfo, frameBodyStyle;
  37006. if (component && component._syncFrameHeight && this === component.el) {
  37007. frameBodyStyle = component.frameBody.dom.style;
  37008. if (!height || height === 'auto') {
  37009. frameBodyStyle.height = '';
  37010. } else {
  37011. frameInfo = component.getFrameInfo();
  37012. if (frameInfo) {
  37013. frameBodyStyle.height = (height - frameInfo.height) + 'px';
  37014. }
  37015. }
  37016. }
  37017. return origSetSize.call(this, width, height, animate);
  37018. };
  37019. // Override for IE8 which throws an error setting innerHTML when inside
  37020. // an event handler invoked from that element.
  37021. proto.setText = function(text) {
  37022. var dom = this.dom;
  37023. // Remove all child nodes, leave only a single textNode
  37024. if (!(dom.childNodes.length === 1 && dom.firstChild.nodeType === 3)) {
  37025. while (dom.lastChild && dom.lastChild.nodeType !== 3) {
  37026. dom.removeChild(dom.lastChild);
  37027. }
  37028. dom.appendChild(document.createTextNode());
  37029. }
  37030. // Set the data of the textNode
  37031. dom.firstChild.data = text;
  37032. };
  37033. proto.unselectable = function() {
  37034. origUnselectable.call(this);
  37035. this.dom.onselectstart = function() {
  37036. return false;
  37037. };
  37038. };
  37039. }
  37040. function fixTransparent(dom, el, inline, style) {
  37041. var value = style[this.name] || '';
  37042. return transparentRe.test(value) ? 'transparent' : value;
  37043. }
  37044. /*
  37045. * Helper function to create the function that will restore the selection.
  37046. */
  37047. function makeSelectionRestoreFn(activeEl, start, end) {
  37048. return function() {
  37049. activeEl.selectionStart = start;
  37050. activeEl.selectionEnd = end;
  37051. };
  37052. }
  37053. /*
  37054. * Creates a function to call to clean up problems with the work-around for the
  37055. * WebKit RightMargin bug. The work-around is to add "display: 'inline-block'" to
  37056. * the element before calling getComputedStyle and then to restore its original
  37057. * display value. The problem with this is that it corrupts the selection of an
  37058. * INPUT or TEXTAREA element (as in the "I-beam" goes away but the focus remains).
  37059. * To cleanup after this, we need to capture the selection of any such element and
  37060. * then restore it after we have restored the display style.
  37061. *
  37062. * @param {HTMLElement} target The top-most element being adjusted.
  37063. * @private
  37064. */
  37065. function getRightMarginFixCleaner(target) {
  37066. var hasInputBug = supports.DisplayChangeInputSelectionBug,
  37067. hasTextAreaBug = supports.DisplayChangeTextAreaSelectionBug,
  37068. activeEl, tag, start, end;
  37069. if (hasInputBug || hasTextAreaBug) {
  37070. activeEl = Element.getActiveElement();
  37071. tag = activeEl && activeEl.tagName;
  37072. if ((hasTextAreaBug && tag === 'TEXTAREA') || (hasInputBug && tag === 'INPUT' && activeEl.type === 'text')) {
  37073. if (Ext.fly(target).isAncestor(activeEl)) {
  37074. start = activeEl.selectionStart;
  37075. end = activeEl.selectionEnd;
  37076. if (Ext.isNumber(start) && Ext.isNumber(end)) {
  37077. // to be safe...
  37078. // We don't create the raw closure here inline because that
  37079. // will be costly even if we don't want to return it (nested
  37080. // function decls and exprs are often instantiated on entry
  37081. // regardless of whether execution ever reaches them):
  37082. return makeSelectionRestoreFn(activeEl, start, end);
  37083. }
  37084. }
  37085. }
  37086. }
  37087. return Ext.emptyFn;
  37088. }
  37089. // avoid special cases, just return a nop
  37090. function fixRightMargin(dom, el, inline, style) {
  37091. var result = style.marginRight,
  37092. domStyle, display;
  37093. // Ignore cases when the margin is correctly reported as 0, the bug only shows
  37094. // numbers larger.
  37095. if (result !== '0px') {
  37096. domStyle = dom.style;
  37097. display = domStyle.display;
  37098. domStyle.display = 'inline-block';
  37099. // eslint-disable-next-line max-len
  37100. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, null)).marginRight;
  37101. domStyle.display = display;
  37102. }
  37103. return result;
  37104. }
  37105. function fixRightMarginAndInputFocus(dom, el, inline, style) {
  37106. var result = style.marginRight,
  37107. domStyle, cleaner, display;
  37108. if (result !== '0px') {
  37109. domStyle = dom.style;
  37110. cleaner = getRightMarginFixCleaner(dom);
  37111. display = domStyle.display;
  37112. domStyle.display = 'inline-block';
  37113. // eslint-disable-next-line max-len
  37114. result = (inline ? style : dom.ownerDocument.defaultView.getComputedStyle(dom, '')).marginRight;
  37115. domStyle.display = display;
  37116. cleaner();
  37117. }
  37118. return result;
  37119. }
  37120. // TODO - this was fixed in Safari 3 - verify if this is still an issue
  37121. // Fix bug caused by this: https://bugs.webkit.org/show_bug.cgi?id=13343
  37122. if (!supports.RightMargin) {
  37123. styleHooks.marginRight = styleHooks['margin-right'] = {
  37124. name: 'marginRight',
  37125. // TODO - Touch should use conditional compilation here or ensure that the
  37126. // underlying Ext.supports flags are set correctly...
  37127. // eslint-disable-next-line max-len
  37128. get: (supports.DisplayChangeInputSelectionBug || supports.DisplayChangeTextAreaSelectionBug) ? fixRightMarginAndInputFocus : fixRightMargin
  37129. };
  37130. }
  37131. if (!supports.TransparentColor) {
  37132. colorStyles = [
  37133. 'background-color',
  37134. 'border-color',
  37135. 'color',
  37136. 'outline-color'
  37137. ];
  37138. for (i = colorStyles.length; i--; ) {
  37139. name = colorStyles[i];
  37140. camel = Element.normalize(name);
  37141. styleHooks[name] = styleHooks[camel] = {
  37142. name: camel,
  37143. get: fixTransparent
  37144. };
  37145. }
  37146. }
  37147. // When elements are rotated 80 or 270 degrees, their border, margin and padding hooks
  37148. // need to be rotated as well.
  37149. proto.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(styleHooks);
  37150. proto.verticalStyleHooks270 = verticalStyleHooks270 = Ext.Object.chain(styleHooks);
  37151. verticalStyleHooks90.width = styleHooks.height || {
  37152. name: 'height'
  37153. };
  37154. verticalStyleHooks90.height = styleHooks.width || {
  37155. name: 'width'
  37156. };
  37157. verticalStyleHooks90['margin-top'] = {
  37158. name: 'marginLeft'
  37159. };
  37160. verticalStyleHooks90['margin-right'] = {
  37161. name: 'marginTop'
  37162. };
  37163. verticalStyleHooks90['margin-bottom'] = {
  37164. name: 'marginRight'
  37165. };
  37166. verticalStyleHooks90['margin-left'] = {
  37167. name: 'marginBottom'
  37168. };
  37169. verticalStyleHooks90['padding-top'] = {
  37170. name: 'paddingLeft'
  37171. };
  37172. verticalStyleHooks90['padding-right'] = {
  37173. name: 'paddingTop'
  37174. };
  37175. verticalStyleHooks90['padding-bottom'] = {
  37176. name: 'paddingRight'
  37177. };
  37178. verticalStyleHooks90['padding-left'] = {
  37179. name: 'paddingBottom'
  37180. };
  37181. verticalStyleHooks90['border-top'] = {
  37182. name: 'borderLeft'
  37183. };
  37184. verticalStyleHooks90['border-right'] = {
  37185. name: 'borderTop'
  37186. };
  37187. verticalStyleHooks90['border-bottom'] = {
  37188. name: 'borderRight'
  37189. };
  37190. verticalStyleHooks90['border-left'] = {
  37191. name: 'borderBottom'
  37192. };
  37193. verticalStyleHooks270.width = styleHooks.height || {
  37194. name: 'height'
  37195. };
  37196. verticalStyleHooks270.height = styleHooks.width || {
  37197. name: 'width'
  37198. };
  37199. verticalStyleHooks270['margin-top'] = {
  37200. name: 'marginRight'
  37201. };
  37202. verticalStyleHooks270['margin-right'] = {
  37203. name: 'marginBottom'
  37204. };
  37205. verticalStyleHooks270['margin-bottom'] = {
  37206. name: 'marginLeft'
  37207. };
  37208. verticalStyleHooks270['margin-left'] = {
  37209. name: 'marginTop'
  37210. };
  37211. verticalStyleHooks270['padding-top'] = {
  37212. name: 'paddingRight'
  37213. };
  37214. verticalStyleHooks270['padding-right'] = {
  37215. name: 'paddingBottom'
  37216. };
  37217. verticalStyleHooks270['padding-bottom'] = {
  37218. name: 'paddingLeft'
  37219. };
  37220. verticalStyleHooks270['padding-left'] = {
  37221. name: 'paddingTop'
  37222. };
  37223. verticalStyleHooks270['border-top'] = {
  37224. name: 'borderRight'
  37225. };
  37226. verticalStyleHooks270['border-right'] = {
  37227. name: 'borderBottom'
  37228. };
  37229. verticalStyleHooks270['border-bottom'] = {
  37230. name: 'borderLeft'
  37231. };
  37232. verticalStyleHooks270['border-left'] = {
  37233. name: 'borderTop'
  37234. };
  37235. /**
  37236. * @property {Boolean} scopeCss
  37237. * @member Ext
  37238. * Set this to true before onReady to prevent any styling from being added to
  37239. * the body element. By default a few styles such as font-family, and color
  37240. * are added to the body element via a "x-body" class. When this is set to
  37241. * `true` the "x-body" class is not added to the body element, but is added
  37242. * to the elements of root-level containers instead.
  37243. */
  37244. if (!Ext.scopeCss) {
  37245. Ext.getBody().addCls(Ext.baseCSSPrefix + 'body');
  37246. }
  37247. }, null, {
  37248. priority: 1500
  37249. });
  37250. });
  37251. // onReady
  37252. // @tag core
  37253. /**
  37254. * @class Ext.GlobalEvents
  37255. */
  37256. Ext.define('Ext.overrides.GlobalEvents', {
  37257. override: 'Ext.GlobalEvents',
  37258. /**
  37259. * @event resumelayouts
  37260. * Fires after global layout processing has been resumed in {@link
  37261. * Ext.Component#resumeLayouts}.
  37262. */
  37263. attachListeners: function() {
  37264. var me = this,
  37265. docElement, bufferedFn;
  37266. // In IE9- when using legacy onresize event via attachEvent or onresize property,
  37267. // the event may fire for *content size changes* as well as actual document view
  37268. // size changes. See this: https://msdn.microsoft.com/en-us/library/ms536959(v=vs.85).aspx
  37269. // and this: http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer
  37270. // The amount of these events firing all at once can be entirely staggering, and they
  37271. // often happen during layouts so we have to be über careful to execute as few JavaScript
  37272. // statements as possible to improve overall framework performance.
  37273. if (Ext.isIE8) {
  37274. docElement = Ext.getDoc().dom.documentElement;
  37275. bufferedFn = Ext.Function.createBuffered(me.fireResize, me.resizeBuffer, me);
  37276. Ext.getWin().dom.attachEvent('onresize', function() {
  37277. if (docElement.clientWidth !== Ext.GlobalEvents.curWidth || docElement.clientHeight !== Ext.GlobalEvents.curHeight) {
  37278. bufferedFn();
  37279. }
  37280. });
  37281. }
  37282. me.callParent();
  37283. },
  37284. deprecated: {
  37285. 5: {
  37286. methods: {
  37287. addListener: function(ename, fn, scope, options, order, caller, eventOptions) {
  37288. var name, readyFn;
  37289. // The "ready" event was removed from Ext.globalEvents in 5.0 in favor of
  37290. // Ext.onReady(). This function adds compatibility for the ready event
  37291. if (ename === 'ready') {
  37292. readyFn = fn;
  37293. } else if (typeof ename !== 'string') {
  37294. for (name in ename) {
  37295. if (name === 'ready') {
  37296. readyFn = ename[name];
  37297. }
  37298. }
  37299. }
  37300. if (readyFn) {
  37301. Ext.log.warn("Ext.on('ready', fn) is deprecated. " + "Please use Ext.onReady(fn) instead.");
  37302. Ext.onReady(readyFn);
  37303. }
  37304. this.callParent([
  37305. ename,
  37306. fn,
  37307. scope,
  37308. options,
  37309. order,
  37310. caller,
  37311. eventOptions
  37312. ]);
  37313. }
  37314. }
  37315. }
  37316. }
  37317. });
  37318. /**
  37319. * @class Ext.plugin.Abstract
  37320. */
  37321. Ext.define('Ext.overrides.plugin.Abstract', {
  37322. override: 'Ext.plugin.Abstract',
  37323. $configStrict: false,
  37324. $configPrefixed: false,
  37325. disabled: false,
  37326. /**
  37327. * @cfg {String|Array} stateEvents
  37328. * The configured list of stateEvents used to (optionally) participate in Owner Component's
  37329. * state management.
  37330. * @member Ext.plugin.Abstract
  37331. */
  37332. /**
  37333. * @method
  37334. * The getState method is invoked by the client Component's State mixin when one or more of the
  37335. * specified {@link #stateEvents} are raised.
  37336. *
  37337. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
  37338. * in the client Component's state management, implementers should provide a suitable method
  37339. * which returns a state object.
  37340. * @return {Object} state
  37341. * @member Ext.plugin.Abstract
  37342. */
  37343. getState: null,
  37344. /**
  37345. * @method
  37346. * The applyState method is invoked by the client Component's State mixin after initComponent
  37347. * method has been run for the client.
  37348. *
  37349. * The supplied implementation is empty. If plugin Subclasses are to (optionally) participate
  37350. * in the client Component's state management, implementers should provide a suitable method
  37351. * to utilize it.
  37352. * @param {Object} state The current plugin state object to be applied.
  37353. * @param {Object} allState The current aggregate state of the Component and all plugins.
  37354. * @member Ext.plugin.Abstract
  37355. */
  37356. applyState: null,
  37357. /**
  37358. * The base implementation just sets the plugin's `disabled` flag to `false`
  37359. *
  37360. * Plugin subclasses which need more complex processing may implement an overriding
  37361. * implementation.
  37362. * @member Ext.plugin.Abstract
  37363. */
  37364. enable: function() {
  37365. this.disabled = false;
  37366. },
  37367. /**
  37368. * The base implementation just sets the plugin's `disabled` flag to `true`
  37369. *
  37370. * Plugin subclasses which need more complex processing may implement an overriding
  37371. * implementation.
  37372. * @member Ext.plugin.Abstract
  37373. */
  37374. disable: function() {
  37375. this.disabled = true;
  37376. }
  37377. });
  37378. /**
  37379. * @class Ext.Widget
  37380. */
  37381. Ext.define('Ext.overrides.Widget', {
  37382. override: 'Ext.Widget',
  37383. uses: [
  37384. 'Ext.Component',
  37385. 'Ext.layout.component.Auto'
  37386. ],
  37387. $configStrict: false,
  37388. isComponent: true,
  37389. liquidLayout: true,
  37390. // in Ext JS the rendered flag is set as soon as a component has its element. Since
  37391. // widgets always have an element when constructed, they are always considered to be
  37392. // "rendered"
  37393. rendered: true,
  37394. rendering: true,
  37395. config: {
  37396. renderTo: null
  37397. },
  37398. constructor: function(config) {
  37399. var me = this,
  37400. renderTo;
  37401. me.callParent([
  37402. config
  37403. ]);
  37404. // initialize the component layout
  37405. me.getComponentLayout();
  37406. renderTo = me.getRenderTo();
  37407. if (renderTo) {
  37408. me.render(renderTo);
  37409. }
  37410. },
  37411. addClsWithUI: function(cls) {
  37412. this.el.addCls(cls);
  37413. },
  37414. afterComponentLayout: Ext.emptyFn,
  37415. updateLayout: function() {
  37416. var owner = this.getRefOwner();
  37417. if (owner) {
  37418. owner.updateLayout();
  37419. }
  37420. },
  37421. destroy: function() {
  37422. var me = this,
  37423. ownerCt = me.ownerCt;
  37424. if (ownerCt && ownerCt.remove) {
  37425. ownerCt.remove(me, false);
  37426. }
  37427. me.callParent();
  37428. },
  37429. finishRender: function() {
  37430. this.rendering = false;
  37431. this.initBindable();
  37432. this.initKeyMap();
  37433. },
  37434. getAnimationProps: function() {
  37435. // see Ext.util.Animate mixin
  37436. return {};
  37437. },
  37438. getComponentLayout: function() {
  37439. var me = this,
  37440. layout = me.componentLayout;
  37441. if (!layout) {
  37442. layout = me.componentLayout = new Ext.layout.component.Auto();
  37443. layout.setOwner(me);
  37444. }
  37445. return layout;
  37446. },
  37447. getEl: function() {
  37448. return this.element;
  37449. },
  37450. /**
  37451. * @private
  37452. * Needed for when widget is rendered into a grid cell. The class to add to the cell element.
  37453. * @member Ext.Widget
  37454. */
  37455. getTdCls: function() {
  37456. return Ext.baseCSSPrefix + this.getTdType() + '-' + (this.ui || 'default') + '-cell';
  37457. },
  37458. /**
  37459. * @private
  37460. * Partner method to {@link #getTdCls}.
  37461. *
  37462. * Returns the base type for the component. Defaults to return `this.xtype`, but
  37463. * All derived classes of {@link Ext.form.field.Text TextField} can return the type 'textfield',
  37464. * and all derived classes of {@link Ext.button.Button Button} can return the type 'button'
  37465. * @member Ext.Widget
  37466. */
  37467. getTdType: function() {
  37468. return this.xtype;
  37469. },
  37470. getItemId: function() {
  37471. // needed by ComponentQuery
  37472. return this.itemId || this.id;
  37473. },
  37474. getSizeModel: function() {
  37475. return Ext.Component.prototype.getSizeModel.apply(this, arguments);
  37476. },
  37477. onAdded: function(container, pos, instanced) {
  37478. var me = this;
  37479. me.ownerCt = container;
  37480. me.onInheritedAdd(me, instanced);
  37481. // this component is no longer detached from the body
  37482. me.isDetached = false;
  37483. },
  37484. onRemoved: function(destroying) {
  37485. this.onInheritedRemove(destroying);
  37486. this.ownerCt = this.ownerLayout = null;
  37487. },
  37488. parseBox: function(box) {
  37489. return Ext.Element.parseBox(box);
  37490. },
  37491. removeClsWithUI: function(cls) {
  37492. this.el.removeCls(cls);
  37493. },
  37494. render: function(container, position) {
  37495. var me = this,
  37496. element = me.element,
  37497. proto = Ext.Component.prototype,
  37498. nextSibling;
  37499. if (!me.ownerCt || me.floating) {
  37500. if (Ext.scopeCss) {
  37501. element.addCls(proto.rootCls);
  37502. }
  37503. element.addCls(proto.borderBoxCls);
  37504. }
  37505. if (position) {
  37506. nextSibling = container.childNodes[position];
  37507. if (nextSibling) {
  37508. Ext.fly(container).insertBefore(element, nextSibling);
  37509. return;
  37510. }
  37511. }
  37512. Ext.fly(container).appendChild(element);
  37513. me.finishRender();
  37514. },
  37515. setPosition: function(x, y) {
  37516. this.el.setLocalXY(x, y);
  37517. },
  37518. up: function() {
  37519. return Ext.Component.prototype.up.apply(this, arguments);
  37520. },
  37521. isAncestor: function() {
  37522. return Ext.Component.prototype.isAncestor.apply(this, arguments);
  37523. },
  37524. onFocusEnter: function() {
  37525. return Ext.Component.prototype.onFocusEnter.apply(this, arguments);
  37526. },
  37527. onFocusLeave: function() {
  37528. return Ext.Component.prototype.onFocusLeave.apply(this, arguments);
  37529. },
  37530. isLayoutChild: function(candidate) {
  37531. var ownerCt = this.ownerCt;
  37532. return ownerCt ? (ownerCt === candidate || ownerCt.isLayoutChild(candidate)) : false;
  37533. },
  37534. privates: {
  37535. doAddListener: function(name, fn, scope, options, order, caller, manager) {
  37536. if (name === 'painted' || name === 'resize') {
  37537. this.element.doAddListener(name, fn, scope || this, options, order);
  37538. }
  37539. this.callParent([
  37540. name,
  37541. fn,
  37542. scope,
  37543. options,
  37544. order,
  37545. caller,
  37546. manager
  37547. ]);
  37548. },
  37549. doRemoveListener: function(name, fn, scope) {
  37550. if (name === 'painted' || name === 'resize') {
  37551. this.element.doRemoveListener(name, fn, scope);
  37552. }
  37553. this.callParent([
  37554. name,
  37555. fn,
  37556. scope
  37557. ]);
  37558. }
  37559. }
  37560. }, function(Cls) {
  37561. var prototype = Cls.prototype;
  37562. if (Ext.isIE9m) {
  37563. // Since IE8/9 don't not support Object.defineProperty correctly we can't add the reference
  37564. // nodes on demand, so we just fall back to adding all references up front.
  37565. prototype.addElementReferenceOnDemand = prototype.addElementReference;
  37566. }
  37567. });
  37568. /**
  37569. * @class Ext.Progress
  37570. *
  37571. * @example
  37572. * Ext.create({
  37573. * xtype: 'grid',
  37574. * title: 'Simpsons',
  37575. * store: {
  37576. * data: [
  37577. * { name: 'Lisa', progress: .159 },
  37578. * { name: 'Bart', progress: .216 },
  37579. * { name: 'Homer', progress: .55 },
  37580. * { name: 'Maggie', progress: .167 },
  37581. * { name: 'Marge', progress: .145 }
  37582. * ]
  37583. * },
  37584. * columns: [
  37585. * { text: 'Name', dataIndex: 'name' },
  37586. * {
  37587. * text: 'Progress',
  37588. * xtype: 'widgetcolumn',
  37589. * width: 120,
  37590. * dataIndex: 'progress',
  37591. * widget: {
  37592. * xtype: 'progress'
  37593. * }
  37594. * }
  37595. * ],
  37596. * height: 200,
  37597. * width: 400,
  37598. * renderTo: Ext.getBody()
  37599. * });
  37600. */
  37601. Ext.define('Ext.overrides.Progress', {
  37602. override: 'Ext.Progress',
  37603. config: {
  37604. ui: 'default'
  37605. },
  37606. updateWidth: function(width, oldWidth) {
  37607. var me = this;
  37608. me.callParent([
  37609. width,
  37610. oldWidth
  37611. ]);
  37612. width -= me.element.getBorderWidth('lr');
  37613. me.backgroundEl.setWidth(width);
  37614. me.textEl.setWidth(width);
  37615. },
  37616. privates: {
  37617. startBarAnimation: function(o) {
  37618. this.barEl.animate(o);
  37619. },
  37620. stopBarAnimation: function() {
  37621. this.barEl.stopAnimation();
  37622. }
  37623. }
  37624. });
  37625. /**
  37626. * @class Ext.mixin.Focusable
  37627. */
  37628. Ext.define('Ext.overrides.mixin.Focusable', {
  37629. override: 'Ext.Component',
  37630. /**
  37631. * @cfg {String} [focusCls='focus'] CSS class suffix that will be used to
  37632. * compose the CSS class name that will be added to Component's {@link #focusClsEl},
  37633. * and removed when Component blurs.
  37634. *
  37635. * **Note** that this is not a full CSS class name; this suffix will be combined
  37636. * with component's UI class via {@link #addClsWithUI} and {@link #removeClsWithUI} methods.
  37637. */
  37638. focusCls: 'focus',
  37639. /**
  37640. * Try to focus this component.
  37641. *
  37642. * If this component is disabled, a close relation will be targeted for focus instead
  37643. * to keep focus localized for keyboard users.
  37644. * @param {Mixed} [selectText] If applicable, `true` to also select all the text in this
  37645. * component, or an array consisting of start and end (defaults to start) position of selection.
  37646. * @param {Boolean/Number} [delay] Delay the focus this number of milliseconds (true for
  37647. * 10 milliseconds).
  37648. * @param {Function} [callback] Only needed if the `delay` parameter is used. A function to call
  37649. * upon focus.
  37650. * @param {Function} [scope] Only needed if the `delay` parameter is used. The scope (`this`
  37651. * reference) in which to execute the callback.
  37652. * @return {Ext.Component} The focused Component. Usually `this` Component. Some Containers may
  37653. * delegate focus to a descendant Component ({@link Ext.window.Window Window}s can do this
  37654. * through their {@link Ext.window.Window#defaultFocus defaultFocus} config option. If this
  37655. * component is disabled, a closely related component will be focused and that will be returned.
  37656. */
  37657. focus: function(selectText, delay, callback, scope) {
  37658. var me = this,
  37659. containerScrollTop;
  37660. if ((!me.focusable && !me.isContainer) || me.destroyed || me.destroying) {
  37661. return me;
  37662. }
  37663. // If delay is wanted, queue a call to this function.
  37664. if (delay) {
  37665. me.getFocusTask().delay(Ext.isNumber(delay) ? delay : 10, me.focus, me, [
  37666. selectText,
  37667. false,
  37668. callback,
  37669. scope
  37670. ]);
  37671. return me;
  37672. }
  37673. // An immediate focus call must cancel any outstanding delayed focus calls.
  37674. me.cancelFocus();
  37675. if (me.floating && me.container && me.container.dom) {
  37676. containerScrollTop = me.container.dom.scrollTop;
  37677. }
  37678. // Core Focusable method will return true if focusing was attempted
  37679. if (me.mixins.focusable.focus.apply(me, arguments) !== false) {
  37680. if (callback) {
  37681. Ext.callback(callback, scope);
  37682. }
  37683. // Focusing a floating Component brings it to the front of its stack.
  37684. // this is performed by its zIndexManager. Pass preventFocus true to avoid recursion.
  37685. if (me.floating && containerScrollTop !== undefined) {
  37686. me.container.dom.scrollTop = containerScrollTop;
  37687. }
  37688. }
  37689. return me;
  37690. },
  37691. /**
  37692. * Cancel any deferred focus on this component
  37693. * @protected
  37694. */
  37695. cancelFocus: function() {
  37696. var me = this,
  37697. task = me.getFocusTask();
  37698. if (task) {
  37699. task.cancel();
  37700. }
  37701. },
  37702. /**
  37703. * @method
  37704. * Template method to do any pre-blur processing.
  37705. * @protected
  37706. * @param {Ext.event.Event} e The event object
  37707. */
  37708. beforeBlur: Ext.emptyFn,
  37709. /**
  37710. * @method
  37711. * Template method to do any post-blur processing.
  37712. * @protected
  37713. * @param {Ext.event.Event} e The event object
  37714. */
  37715. postBlur: Ext.emptyFn,
  37716. /**
  37717. * @method
  37718. * Template method to do any pre-focus processing.
  37719. * @protected
  37720. * @param {Ext.event.Event} e The event object
  37721. */
  37722. beforeFocus: Ext.emptyFn,
  37723. /**
  37724. * @method
  37725. * Template method to do any post-focus processing.
  37726. * @protected
  37727. * @param {Ext.event.Event} e The event object
  37728. */
  37729. postFocus: Ext.emptyFn,
  37730. onFocusEnter: function(e) {
  37731. var me = this;
  37732. if (me.destroying || me.destroyed) {
  37733. return;
  37734. }
  37735. // Focusing must being a floating component to the front.
  37736. // Only bring to front if this component is not the manager's
  37737. // topmost component (may be a result of focusOnToFront).
  37738. if (me.floating && me !== me.zIndexManager.getActive()) {
  37739. me.toFront(true);
  37740. }
  37741. me.callParent([
  37742. e
  37743. ]);
  37744. },
  37745. destroyFocusable: function() {
  37746. var me = this;
  37747. // Calling cancelFocus() will assign focusTask property,
  37748. // which we don't want during destruction
  37749. if (me.focusTask) {
  37750. me.focusTask.stop(me.focus, me);
  37751. }
  37752. me.callParent();
  37753. },
  37754. privates: {
  37755. addFocusCls: function(e) {
  37756. var me = this,
  37757. focusCls = me.focusCls,
  37758. el;
  37759. if (focusCls) {
  37760. el = me.getFocusClsEl(e);
  37761. if (el) {
  37762. el.addCls(me.addClsWithUI(focusCls, true));
  37763. }
  37764. }
  37765. },
  37766. removeFocusCls: function(e) {
  37767. var me = this,
  37768. focusCls = me.focusCls,
  37769. el;
  37770. if (focusCls) {
  37771. el = me.getFocusClsEl(e);
  37772. if (el) {
  37773. el.removeCls(me.removeClsWithUI(focusCls, true));
  37774. }
  37775. }
  37776. },
  37777. /**
  37778. * @private
  37779. */
  37780. getFocusTask: function() {
  37781. if (!this.focusTask) {
  37782. this.focusTask = Ext.focusTask;
  37783. }
  37784. return this.focusTask;
  37785. },
  37786. updateMaskState: function(state, mask) {
  37787. var me = this,
  37788. ariaEl = me.ariaEl.dom,
  37789. skipMask = me.getInherited().disabled && me.getInherited().disableMask,
  37790. value;
  37791. if (state) {
  37792. me.disableTabbing();
  37793. if (!skipMask) {
  37794. me.setMasked(true);
  37795. }
  37796. if (ariaEl) {
  37797. ariaEl.setAttribute('aria-busy', 'true');
  37798. // It is possible that ariaEl already has aria-describedby attribute;
  37799. // in that case we need to save it to restore later.
  37800. value = ariaEl.getAttribute('aria-describedby');
  37801. if (value) {
  37802. me._savedAriaDescribedBy = value;
  37803. }
  37804. ariaEl.setAttribute('aria-describedby', mask.ariaEl.id);
  37805. }
  37806. } else {
  37807. me.enableTabbing();
  37808. if (!skipMask) {
  37809. me.setMasked(false);
  37810. }
  37811. if (ariaEl) {
  37812. ariaEl.removeAttribute('aria-busy');
  37813. value = ariaEl.getAttribute('aria-describedby');
  37814. ariaEl.removeAttribute('aria-describedby');
  37815. if (value === mask.ariaEl.id && me._savedAriaDescribedBy) {
  37816. ariaEl.setAttribute('aria-describedby', me._savedAriaDescribedBy);
  37817. delete me._savedAriaDescribedBy;
  37818. }
  37819. }
  37820. }
  37821. }
  37822. }
  37823. }, function() {
  37824. // One global DelayedTask to assign focus
  37825. // So that the last focus call wins.
  37826. if (!Ext.focusTask) {
  37827. Ext.focusTask = new Ext.util.DelayedTask();
  37828. }
  37829. });
  37830. Ext.define('Ext.overrides.app.domain.Component', {
  37831. override: 'Ext.app.domain.Component',
  37832. requires: [
  37833. 'Ext.Component'
  37834. ]
  37835. }, function(ComponentDomain) {
  37836. // The core Component domain monitors events on the Ext.Widget class
  37837. // in Ext Components are not widgets so we need to monitor Ext.Component as well.
  37838. ComponentDomain.monitor(Ext.Component);
  37839. });
  37840. // This is an override because it must be loaded very early, possibly before Ext.app.Application
  37841. // in dev mode so that Ext.application() can be called.
  37842. // Being an override also ensures that it is only included in a built app if Ext.app.Application
  37843. // is present.
  37844. //
  37845. // @override Ext.app.Application
  37846. /**
  37847. * @method application
  37848. * @member Ext
  37849. * Loads Ext.app.Application class and starts it up with given configuration after the
  37850. * page is ready.
  37851. *
  37852. * See `Ext.app.Application` for details.
  37853. *
  37854. * @param {Object/String} config Application config object or name of a class derived
  37855. * from Ext.app.Application.
  37856. */
  37857. Ext.application = function(config) {
  37858. var createApp = function(App) {
  37859. // This won't be called until App class has been created.
  37860. Ext.onReady(function() {
  37861. var Viewport = Ext.viewport;
  37862. // eslint-disable-next-line dot-notation
  37863. Viewport = Viewport && Viewport['Viewport'];
  37864. if (Viewport && Viewport.setup) {
  37865. Viewport.setup(App.prototype.config.viewport);
  37866. }
  37867. Ext.app.Application.instance = new App();
  37868. });
  37869. };
  37870. if (typeof config === "string") {
  37871. Ext.require(config, function() {
  37872. createApp(Ext.ClassManager.get(config));
  37873. });
  37874. } else {
  37875. config = Ext.apply({
  37876. extend: 'Ext.app.Application'
  37877. }, // can be replaced by config!
  37878. config);
  37879. // We have to process "paths" before creating Application class,
  37880. // or `requires` won't work.
  37881. Ext.app.setupPaths(config.name, config.appFolder, config.paths);
  37882. config['paths processed'] = true;
  37883. // Let Ext.define do the hard work but don't assign a class name.
  37884. Ext.define(config.name + ".$application", config, function() {
  37885. createApp(this);
  37886. });
  37887. }
  37888. };
  37889. /**
  37890. * @class Ext.app.Application
  37891. */
  37892. Ext.define('Ext.overrides.app.Application', {
  37893. override: 'Ext.app.Application',
  37894. uses: [
  37895. 'Ext.tip.QuickTipManager'
  37896. ],
  37897. // @cmd-auto-dependency {aliasPrefix: "view.", mvc: true, requires: ["Ext.plugin.Viewport"]}
  37898. /**
  37899. * @cfg {Boolean/String} [autoCreateViewport=false]
  37900. * @deprecated 5.1 Instead use {@link #mainView}
  37901. * @member Ext.app.Application
  37902. */
  37903. autoCreateViewport: false,
  37904. config: {
  37905. /**
  37906. * @cfg {Boolean} enableQuickTips
  37907. * @deprecated 6.2.0 Use {@link #quickTips}.
  37908. */
  37909. enableQuickTips: null
  37910. },
  37911. /**
  37912. * @cfg {Boolean} quickTips
  37913. * True to automatically set up Ext.tip.QuickTip support.
  37914. *
  37915. * @since 6.2.0
  37916. */
  37917. quickTips: true,
  37918. updateEnableQuickTips: function(enableQuickTips) {
  37919. this.setQuickTips(enableQuickTips);
  37920. },
  37921. applyMainView: function(mainView) {
  37922. var view, proto, config, protoPlugins, configPlugins;
  37923. if (typeof mainView === 'string') {
  37924. view = this.getView(mainView);
  37925. config = {};
  37926. } else {
  37927. config = mainView;
  37928. view = Ext.ClassManager.getByConfig(mainView);
  37929. }
  37930. proto = view.prototype;
  37931. if (!proto.isViewport) {
  37932. // Need to copy over any plugins defined on the prototype and on the config.
  37933. protoPlugins = Ext.Array.from(proto.plugins);
  37934. configPlugins = Ext.Array.from(config.plugins);
  37935. config = Ext.apply({}, config);
  37936. config.plugins = [
  37937. 'viewport'
  37938. ].concat(protoPlugins, configPlugins);
  37939. }
  37940. return view.create(config);
  37941. },
  37942. getDependencies: function(cls, data, requires) {
  37943. var Controller = Ext.app.Controller,
  37944. proto = cls.prototype,
  37945. namespace = data.$namespace,
  37946. viewportClass = data.autoCreateViewport;
  37947. if (viewportClass) {
  37948. if (!namespace) {
  37949. Ext.raise("[Ext.app.Application] Can't resolve namespace for " + data.$className + ", did you forget to specify 'name' property?");
  37950. }
  37951. if (viewportClass === true) {
  37952. viewportClass = 'Viewport';
  37953. } else {
  37954. requires.push('Ext.plugin.Viewport');
  37955. }
  37956. Controller.processDependencies(proto, requires, namespace, 'view', viewportClass);
  37957. }
  37958. },
  37959. onBeforeLaunch: function() {
  37960. var me = this,
  37961. autoCreateViewport = me.autoCreateViewport;
  37962. if (me.getQuickTips()) {
  37963. me.initQuickTips();
  37964. }
  37965. if (autoCreateViewport) {
  37966. me.initViewport();
  37967. }
  37968. this.callParent(arguments);
  37969. },
  37970. getViewportName: function() {
  37971. var name = null,
  37972. autoCreate = this.autoCreateViewport;
  37973. if (autoCreate) {
  37974. name = (autoCreate === true) ? 'Viewport' : autoCreate;
  37975. }
  37976. return name;
  37977. },
  37978. initViewport: function() {
  37979. this.setMainView(this.getViewportName());
  37980. },
  37981. initQuickTips: function() {
  37982. Ext.tip.QuickTipManager.init();
  37983. }
  37984. });
  37985. Ext.define('Ext.overrides.app.domain.View', {
  37986. override: 'Ext.app.domain.View',
  37987. requires: [
  37988. 'Ext.Component'
  37989. ],
  37990. constructor: function(controller) {
  37991. this.callParent([
  37992. controller
  37993. ]);
  37994. // The base class handles Ext.Widget, which encompasses
  37995. // component for modern, so we only need the override here.
  37996. this.monitoredClasses.push(Ext.Component);
  37997. }
  37998. });
  37999. /**
  38000. * @class Ext.dom.Helper
  38001. */
  38002. Ext.define('Ext.overrides.dom.Helper', (function() {
  38003. var tableRe = /^(?:table|thead|tbody|tr|td)$/i,
  38004. tableElRe = /td|tr|tbody|thead/i,
  38005. ts = '<table>',
  38006. te = '</table>',
  38007. tbs = ts + '<tbody>',
  38008. tbe = '</tbody>' + te,
  38009. trs = tbs + '<tr>',
  38010. tre = '</tr>' + tbe;
  38011. return {
  38012. override: 'Ext.dom.Helper',
  38013. ieInsertHtml: function(where, el, html) {
  38014. var frag = null;
  38015. // IE's incomplete table implementation: http://www.ericvasilik.com/2006/07/code-karma.html
  38016. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  38017. frag = this.insertIntoTable(el.tagName.toLowerCase(), where, el, html);
  38018. }
  38019. return frag;
  38020. },
  38021. ieOverwrite: function(el, html) {
  38022. // IE Inserting HTML into a table/tbody/tr requires extra processing:
  38023. // http://www.ericvasilik.com/2006/07/code-karma.html
  38024. if (Ext.isIE9m && tableRe.test(el.tagName)) {
  38025. // Clearing table elements requires removal of all elements.
  38026. while (el.firstChild) {
  38027. el.removeChild(el.firstChild);
  38028. }
  38029. if (html) {
  38030. return this.insertHtml('afterbegin', el, html);
  38031. }
  38032. }
  38033. },
  38034. ieTable: function(depth, openingTags, htmlContent, closingTags) {
  38035. var i = -1,
  38036. el = this.detachedDiv,
  38037. ns, nx;
  38038. el.innerHTML = [
  38039. openingTags,
  38040. htmlContent,
  38041. closingTags
  38042. ].join('');
  38043. while (++i < depth) {
  38044. el = el.firstChild;
  38045. }
  38046. // If the result is multiple siblings, then encapsulate them into one fragment.
  38047. ns = el.nextSibling;
  38048. if (ns) {
  38049. ns = el;
  38050. el = document.createDocumentFragment();
  38051. while (ns) {
  38052. nx = ns.nextSibling;
  38053. el.appendChild(ns);
  38054. ns = nx;
  38055. }
  38056. }
  38057. return el;
  38058. },
  38059. /**
  38060. * @private
  38061. * @method insertIntoTable
  38062. * @member Ext.dom.Helper
  38063. * workaround for broken table implementation in IE9m
  38064. * http://www.ericvasilik.com/2006/07/code-karma.html
  38065. */
  38066. insertIntoTable: function(tag, where, destinationEl, html) {
  38067. var node, before,
  38068. bb = where === 'beforebegin',
  38069. ab = where === 'afterbegin',
  38070. be = where === 'beforeend',
  38071. ae = where === 'afterend';
  38072. if (tag === 'td' && (ab || be) || !tableElRe.test(tag) && (bb || ae)) {
  38073. return null;
  38074. }
  38075. /* eslint-disable indent, multiline-ternary, no-multi-spaces */
  38076. before = bb ? destinationEl : ae ? destinationEl.nextSibling : ab ? destinationEl.firstChild : null;
  38077. /* eslint-enable indent, multiline-ternary, no-multi-spaces */
  38078. if (bb || ae) {
  38079. destinationEl = destinationEl.parentNode;
  38080. }
  38081. if (tag === 'td' || (tag === 'tr' && (be || ab))) {
  38082. node = this.ieTable(4, trs, html, tre);
  38083. } else if (((tag === 'tbody' || tag === 'thead') && (be || ab)) || (tag === 'tr' && (bb || ae))) {
  38084. node = this.ieTable(3, tbs, html, tbe);
  38085. } else {
  38086. node = this.ieTable(2, ts, html, te);
  38087. }
  38088. destinationEl.insertBefore(node, before);
  38089. return node;
  38090. }
  38091. };
  38092. })());
  38093. /**
  38094. * @class Ext.list.AbstractTreeItem
  38095. */
  38096. Ext.define('Ext.overrides.list.AbstractTreeItem', {
  38097. override: 'Ext.list.AbstractTreeItem',
  38098. // This config is used by TreeIten, however to support the generic API (RootItem),
  38099. // we need this up here.
  38100. config: {
  38101. floated: null
  38102. }
  38103. });
  38104. /**
  38105. * @class Ext.list.TreeItem
  38106. */
  38107. Ext.define('Ext.overrides.list.TreeItem', {
  38108. override: 'Ext.list.TreeItem',
  38109. // Implement a setter.
  38110. // There *is* no "floated" config in Classic.
  38111. // We're still an inner item, we just get put inside a Container.
  38112. setFloated: function(floated) {
  38113. var me = this,
  38114. el = me.element,
  38115. placeholder = me.placeholder,
  38116. node, wasExpanded;
  38117. if (me.treeItemFloated !== floated) {
  38118. if (floated) {
  38119. placeholder = el.clone(false, true);
  38120. // shallow, asDom
  38121. placeholder.id += '-placeholder';
  38122. // avoid duplicate id
  38123. me.placeholder = Ext.get(placeholder);
  38124. me.wasExpanded = me.getExpanded();
  38125. me.setExpanded(true);
  38126. el.addCls(me.floatedCls);
  38127. el.dom.parentNode.insertBefore(placeholder, el.dom);
  38128. me.floater = me.createFloater();
  38129. }
  38130. // toolkit-specific
  38131. else if (placeholder) {
  38132. wasExpanded = me.wasExpanded;
  38133. node = me.getNode();
  38134. me.setExpanded(wasExpanded);
  38135. if (!wasExpanded && node.isExpanded()) {
  38136. // If we have been floating and expanded a child, we may have been
  38137. // expanded as part of the ancestors. Attempt to restore state.
  38138. me.preventAnimation = true;
  38139. node.collapse();
  38140. me.preventAnimation = false;
  38141. }
  38142. me.floater.remove(me, false);
  38143. // don't destroy
  38144. el.removeCls(me.floatedCls);
  38145. placeholder.dom.parentNode.insertBefore(el.dom, placeholder.dom);
  38146. placeholder.destroy();
  38147. me.floater.destroy();
  38148. me.placeholder = me.floater = null;
  38149. }
  38150. // Use an internal property name. We are NOT really floated
  38151. me.treeItemFloated = floated;
  38152. }
  38153. },
  38154. getFloated: function() {
  38155. return this.treeItemFloated;
  38156. },
  38157. runAnimation: function(animation) {
  38158. return this.itemContainer.addAnimation(animation);
  38159. },
  38160. stopAnimation: function(animation) {
  38161. animation.jumpToEnd();
  38162. },
  38163. privates: {
  38164. createFloater: function() {
  38165. var me = this,
  38166. owner = me.getOwner(),
  38167. ownerTree = me.up('treelist'),
  38168. floater,
  38169. toolElement = me.getToolElement(),
  38170. expandedWidth = ownerTree.expandedWidth,
  38171. defaultListWidth = ownerTree.defaultListWidth;
  38172. if (expandedWidth === null) {
  38173. expandedWidth = defaultListWidth;
  38174. }
  38175. me.floater = floater = new Ext.container.Container({
  38176. cls: ownerTree.self.prototype.element.cls + ' ' + ownerTree.uiPrefix + ownerTree.getUi() + ' ' + Ext.baseCSSPrefix + 'treelist-floater',
  38177. floating: true,
  38178. // We do not get element resize events on IE8
  38179. // so fall back to 6.0.1 sizing to 200 wide.
  38180. width: Ext.isIE8 ? defaultListWidth : (expandedWidth - toolElement.getWidth()),
  38181. shadow: false,
  38182. hidden: true,
  38183. renderTo: Ext.getBody(),
  38184. listeners: {
  38185. element: 'el',
  38186. click: function(e) {
  38187. return owner.onClick(e);
  38188. }
  38189. }
  38190. });
  38191. floater.add(me);
  38192. floater.show();
  38193. floater.el.alignTo(toolElement, 'tr?');
  38194. return floater;
  38195. }
  38196. }
  38197. });
  38198. /**
  38199. * @class Ext.list.Tree
  38200. */
  38201. Ext.define('Ext.overrides.list.Tree', {
  38202. override: 'Ext.list.Tree',
  38203. canMeasure: true,
  38204. constructor: function(config) {
  38205. this.callParent([
  38206. config
  38207. ]);
  38208. // Track size so that we can track the expanded size
  38209. // for use by the floated state of items when in micro mode.
  38210. // Browsers where this event is not supported, fall back to a width
  38211. // of 200px for floated tree items.
  38212. if (!Ext.isIE8) {
  38213. this.element.on('resize', 'onElResize', this);
  38214. }
  38215. },
  38216. beforeLayout: function() {
  38217. this.syncIconSize();
  38218. },
  38219. onElResize: function(el, details) {
  38220. if (!this.getMicro() && this.canMeasure) {
  38221. this.expandedWidth = details.width;
  38222. }
  38223. },
  38224. privates: {
  38225. defaultListWidth: 200,
  38226. expandedWidth: null
  38227. }
  38228. });
  38229. /**
  38230. * @class Ext.sparkline.Base
  38231. */
  38232. Ext.define('Ext.override.sparkline.Base', {
  38233. override: 'Ext.sparkline.Base',
  38234. statics: {
  38235. constructTip: function() {
  38236. // eslint-disable-next-line dot-notation
  38237. return new Ext.tip['ToolTip']({
  38238. id: 'sparklines-tooltip',
  38239. showDelay: 0,
  38240. dismissDelay: 0,
  38241. hideDelay: 400
  38242. });
  38243. }
  38244. },
  38245. onMouseMove: function(e) {
  38246. this.getSharedTooltip().triggerEvent = e;
  38247. this.callParent([
  38248. e
  38249. ]);
  38250. },
  38251. onMouseLeave: function(e) {
  38252. this.callParent([
  38253. e
  38254. ]);
  38255. this.getSharedTooltip().target = null;
  38256. },
  38257. privates: {
  38258. hideTip: function() {
  38259. var tip = this.getSharedTooltip();
  38260. tip.target = null;
  38261. tip.hide();
  38262. },
  38263. showTip: function() {
  38264. var tip = this.getSharedTooltip();
  38265. tip.target = this.el;
  38266. tip.onTargetOver(tip.triggerEvent);
  38267. }
  38268. }
  38269. }, function(Cls) {
  38270. // If we are on a VML platform (IE8 - TODO: remove this when that retires)...
  38271. if (!Ext.supports.Canvas) {
  38272. Cls.prototype.element = {
  38273. tag: 'span',
  38274. reference: 'element',
  38275. listeners: {
  38276. mouseenter: 'onMouseEnter',
  38277. mouseleave: 'onMouseLeave',
  38278. mousemove: 'onMouseMove'
  38279. },
  38280. style: {
  38281. display: 'inline-block',
  38282. position: 'relative',
  38283. overflow: 'hidden',
  38284. margin: '0px',
  38285. padding: '0px',
  38286. verticalAlign: 'top',
  38287. cursor: 'default'
  38288. },
  38289. children: [
  38290. {
  38291. tag: 'svml:group',
  38292. reference: 'groupEl',
  38293. coordorigin: '0 0',
  38294. coordsize: '0 0',
  38295. style: 'position:absolute;width:0;height:0;pointer-events:none'
  38296. }
  38297. ]
  38298. };
  38299. }
  38300. });
  38301. /**
  38302. * @class Ext.app.ViewController
  38303. */
  38304. /**
  38305. * @method beforeRender
  38306. * @template
  38307. * Template method called by the owning component's
  38308. * {@link Ext.Component#method-beforeRender beforeRender} method.
  38309. * @param {Ext.Component} component The owner component attached to the
  38310. * ViewController
  38311. */
  38312. /**
  38313. * @method afterRender
  38314. * @template
  38315. * Template method called by the owning component's
  38316. * {@link Ext.Component#method-afterRender afterRender} method.
  38317. * @param {Ext.Component} component The owner component attached to the
  38318. * ViewController
  38319. */
  38320. /**
  38321. * @method boxReady
  38322. * @template
  38323. * Template method called by the owning component's
  38324. * {@link Ext.Component#method-onBoxReady onBoxReady} method.
  38325. * @param {Ext.Component} component The owner component attached to the
  38326. * ViewController
  38327. */
  38328. /**
  38329. * @class Ext.form.field.Checkbox
  38330. */
  38331. Ext.define(null, {
  38332. override: 'Ext.form.field.Checkbox',
  38333. compatibility: Ext.isIE8,
  38334. // IE8 does not support change event but it has propertychange which is even better
  38335. changeEventName: 'propertychange',
  38336. onChangeEvent: function(e) {
  38337. // IE8 propertychange fires for *any* property change but we're only interested in checked
  38338. // We also don't want to react to propertychange fired as the result of assigning
  38339. // checked property in setRawValue().
  38340. if (this.duringSetRawValue || e.browserEvent.propertyName !== 'checked') {
  38341. return;
  38342. }
  38343. this.callParent([
  38344. e
  38345. ]);
  38346. },
  38347. updateCheckedCls: function(checked) {
  38348. var me = this,
  38349. displayEl = me.displayEl;
  38350. me.callParent([
  38351. checked
  38352. ]);
  38353. // IE8 has a bug with font icons and pseudo-elements
  38354. if (displayEl && checked !== me.lastValue) {
  38355. displayEl.repaint();
  38356. }
  38357. }
  38358. });
  38359. /**
  38360. * @class Ext.form.field.Radio
  38361. */
  38362. Ext.define(null, {
  38363. override: 'Ext.form.field.Radio',
  38364. compatibility: Ext.isIE8,
  38365. getSubTplData: function(fieldData) {
  38366. var data = this.callParent([
  38367. fieldData
  38368. ]);
  38369. // Rendering a radio button with checked attribute
  38370. // will have a curious side effect in IE8: the DOM
  38371. // node will have checked property set to `true` but
  38372. // radio group (radios with the same name attribute)
  38373. // will behave as if no radio is checked in the group;
  38374. // tabbing into the group will select first or last
  38375. // button instead of the checked one.
  38376. // So instead of rendering the attribute we will set
  38377. // checked value in the DOM after rendering. Apparently
  38378. // such a tiny nudge is enough for the browser to behave.
  38379. delete data.checked;
  38380. return data;
  38381. },
  38382. afterRender: function() {
  38383. this.callParent();
  38384. if (this.checked) {
  38385. this.inputEl.dom.checked = true;
  38386. }
  38387. },
  38388. onChange: function(newValue, oldValue) {
  38389. // We don't need to bother updating other radio buttons in IE8
  38390. // since it will fire propertychange event on any change, not only false -> true.
  38391. // This is unlike standard compliant browsers, see main class.
  38392. this.callSuper([
  38393. newValue,
  38394. oldValue
  38395. ]);
  38396. }
  38397. });
  38398. /**
  38399. * @class Ext.scroll.Scroller
  38400. */
  38401. Ext.define(null, {
  38402. override: 'Ext.scroll.Scroller',
  38403. compatibility: Ext.isIE8,
  38404. privates: {
  38405. // Important note: this code had to be copied as a whole
  38406. // because the scrollLeft assignment trickery only works
  38407. // reliably when it is done within the same function context.
  38408. doScrollTo: function(x, y, animate) {
  38409. var me = this,
  38410. element = me.getScrollElement(),
  38411. maxPosition, dom, to, xInf, yInf, ret, deferred, callback;
  38412. if (element && !element.destroyed) {
  38413. dom = element.dom;
  38414. xInf = (x === Infinity);
  38415. yInf = (y === Infinity);
  38416. if (xInf || yInf) {
  38417. maxPosition = me.getMaxPosition();
  38418. if (xInf) {
  38419. x = maxPosition.x;
  38420. }
  38421. if (yInf) {
  38422. y = maxPosition.y;
  38423. }
  38424. }
  38425. if (x !== null) {
  38426. x = me.convertX(x);
  38427. }
  38428. if (animate) {
  38429. to = {};
  38430. if (y != null) {
  38431. to.scrollTop = y;
  38432. }
  38433. if (x != null) {
  38434. to.scrollLeft = x;
  38435. }
  38436. animate = Ext.mergeIf({
  38437. to: {
  38438. scrollTop: y,
  38439. scrollLeft: x
  38440. }
  38441. }, animate);
  38442. deferred = new Ext.Deferred();
  38443. callback = animate.callback;
  38444. animate.callback = function() {
  38445. if (callback) {
  38446. callback.call(animate.scope || Ext.global, arguments);
  38447. }
  38448. // The callback will be called if the element is destroyed
  38449. if (me.destroyed) {
  38450. deferred.reject();
  38451. } else {
  38452. deferred.resolve();
  38453. }
  38454. };
  38455. element.animate(animate);
  38456. ret = deferred.promise;
  38457. } else {
  38458. // When we need to assign both scrollTop and scrollLeft,
  38459. // IE8 might fire scroll event on the first assignment
  38460. // but not on the second; that behavior is unlike the other
  38461. // browsers which will wait for the second assignment
  38462. // to happen before firing the event. This leads to our
  38463. // scrollstart event firing prematurely, when the scrolling
  38464. // has not actually finished yet.
  38465. // To work around that, we ignore the first event and then
  38466. // force another one by assigning scrollLeft the second time.
  38467. if ((x != null && x !== 0) && y != null) {
  38468. me.deferDomScroll = true;
  38469. }
  38470. if (y != null) {
  38471. dom.scrollTop = y;
  38472. }
  38473. if (x != null) {
  38474. dom.scrollLeft = x;
  38475. }
  38476. if (me.deferDomScroll) {
  38477. me.deferDomScroll = false;
  38478. // Reading the DOM makes sure the second assignment will fire the event.
  38479. // eslint-disable-next-line no-unused-expressions
  38480. +dom.scrollLeft;
  38481. dom.scrollLeft = x;
  38482. // eslint-disable-next-line no-unused-expressions
  38483. +dom.scrollTop;
  38484. dom.scrollTop = y;
  38485. }
  38486. ret = Ext.Deferred.getCachedResolved();
  38487. }
  38488. // Our position object will need refreshing before returning.
  38489. me.positionDirty = true;
  38490. } else {
  38491. ret = Ext.Deferred.getCachedRejected();
  38492. }
  38493. return ret;
  38494. },
  38495. onDomScroll: function() {
  38496. var me = this;
  38497. if (me.deferDomScroll) {
  38498. return;
  38499. }
  38500. me.callParent();
  38501. }
  38502. }
  38503. });