vue-treeselect.umd.js 148 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007
  1. /*!
  2. * vue-treeselect v0.4.0 | (c) 2017-2019 Riophae Lee
  3. * Released under the MIT License.
  4. * https://vue-treeselect.js.org/
  5. */
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory(require("Vue"));
  9. else if(typeof define === 'function' && define.amd)
  10. define(["Vue"], factory);
  11. else if(typeof exports === 'object')
  12. exports["VueTreeselect"] = factory(require("Vue"));
  13. else
  14. root["VueTreeselect"] = factory(root["Vue"]);
  15. })(window, function(__WEBPACK_EXTERNAL_MODULE__34__) {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  55. /******/ }
  56. /******/ };
  57. /******/
  58. /******/ // define __esModule on exports
  59. /******/ __webpack_require__.r = function(exports) {
  60. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  61. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  62. /******/ }
  63. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  64. /******/ };
  65. /******/
  66. /******/ // create a fake namespace object
  67. /******/ // mode & 1: value is a module id, require it
  68. /******/ // mode & 2: merge all properties of value into the ns
  69. /******/ // mode & 4: return value when already ns object
  70. /******/ // mode & 8|1: behave like require
  71. /******/ __webpack_require__.t = function(value, mode) {
  72. /******/ if(mode & 1) value = __webpack_require__(value);
  73. /******/ if(mode & 8) return value;
  74. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  75. /******/ var ns = Object.create(null);
  76. /******/ __webpack_require__.r(ns);
  77. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  78. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  79. /******/ return ns;
  80. /******/ };
  81. /******/
  82. /******/ // getDefaultExport function for compatibility with non-harmony modules
  83. /******/ __webpack_require__.n = function(module) {
  84. /******/ var getter = module && module.__esModule ?
  85. /******/ function getDefault() { return module['default']; } :
  86. /******/ function getModuleExports() { return module; };
  87. /******/ __webpack_require__.d(getter, 'a', getter);
  88. /******/ return getter;
  89. /******/ };
  90. /******/
  91. /******/ // Object.prototype.hasOwnProperty.call
  92. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  93. /******/
  94. /******/ // __webpack_public_path__
  95. /******/ __webpack_require__.p = "/";
  96. /******/
  97. /******/
  98. /******/ // Load entry module and return exports
  99. /******/ return __webpack_require__(__webpack_require__.s = 36);
  100. /******/ })
  101. /************************************************************************/
  102. /******/ ([
  103. /* 0 */
  104. /***/ (function(module, exports, __webpack_require__) {
  105. var arrayWithHoles = __webpack_require__(1);
  106. var iterableToArrayLimit = __webpack_require__(2);
  107. var nonIterableRest = __webpack_require__(3);
  108. function _slicedToArray(arr, i) {
  109. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();
  110. }
  111. module.exports = _slicedToArray;
  112. /***/ }),
  113. /* 1 */
  114. /***/ (function(module, exports) {
  115. function _arrayWithHoles(arr) {
  116. if (Array.isArray(arr)) return arr;
  117. }
  118. module.exports = _arrayWithHoles;
  119. /***/ }),
  120. /* 2 */
  121. /***/ (function(module, exports) {
  122. function _iterableToArrayLimit(arr, i) {
  123. if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
  124. return;
  125. }
  126. var _arr = [];
  127. var _n = true;
  128. var _d = false;
  129. var _e = undefined;
  130. try {
  131. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  132. _arr.push(_s.value);
  133. if (i && _arr.length === i) break;
  134. }
  135. } catch (err) {
  136. _d = true;
  137. _e = err;
  138. } finally {
  139. try {
  140. if (!_n && _i["return"] != null) _i["return"]();
  141. } finally {
  142. if (_d) throw _e;
  143. }
  144. }
  145. return _arr;
  146. }
  147. module.exports = _iterableToArrayLimit;
  148. /***/ }),
  149. /* 3 */
  150. /***/ (function(module, exports) {
  151. function _nonIterableRest() {
  152. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  153. }
  154. module.exports = _nonIterableRest;
  155. /***/ }),
  156. /* 4 */
  157. /***/ (function(module, exports, __webpack_require__) {
  158. var arrayWithoutHoles = __webpack_require__(5);
  159. var iterableToArray = __webpack_require__(6);
  160. var nonIterableSpread = __webpack_require__(7);
  161. function _toConsumableArray(arr) {
  162. return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();
  163. }
  164. module.exports = _toConsumableArray;
  165. /***/ }),
  166. /* 5 */
  167. /***/ (function(module, exports) {
  168. function _arrayWithoutHoles(arr) {
  169. if (Array.isArray(arr)) {
  170. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {
  171. arr2[i] = arr[i];
  172. }
  173. return arr2;
  174. }
  175. }
  176. module.exports = _arrayWithoutHoles;
  177. /***/ }),
  178. /* 6 */
  179. /***/ (function(module, exports) {
  180. function _iterableToArray(iter) {
  181. if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  182. }
  183. module.exports = _iterableToArray;
  184. /***/ }),
  185. /* 7 */
  186. /***/ (function(module, exports) {
  187. function _nonIterableSpread() {
  188. throw new TypeError("Invalid attempt to spread non-iterable instance");
  189. }
  190. module.exports = _nonIterableSpread;
  191. /***/ }),
  192. /* 8 */
  193. /***/ (function(module, exports) {
  194. function _defineProperty(obj, key, value) {
  195. if (key in obj) {
  196. Object.defineProperty(obj, key, {
  197. value: value,
  198. enumerable: true,
  199. configurable: true,
  200. writable: true
  201. });
  202. } else {
  203. obj[key] = value;
  204. }
  205. return obj;
  206. }
  207. module.exports = _defineProperty;
  208. /***/ }),
  209. /* 9 */
  210. /***/ (function(module, exports, __webpack_require__) {
  211. "use strict";
  212. function fuzzysearch (needle, haystack) {
  213. var tlen = haystack.length;
  214. var qlen = needle.length;
  215. if (qlen > tlen) {
  216. return false;
  217. }
  218. if (qlen === tlen) {
  219. return needle === haystack;
  220. }
  221. outer: for (var i = 0, j = 0; i < qlen; i++) {
  222. var nch = needle.charCodeAt(i);
  223. while (j < tlen) {
  224. if (haystack.charCodeAt(j++) === nch) {
  225. continue outer;
  226. }
  227. }
  228. return false;
  229. }
  230. return true;
  231. }
  232. module.exports = fuzzysearch;
  233. /***/ }),
  234. /* 10 */
  235. /***/ (function(module, exports) {
  236. /**
  237. * This method returns `undefined`.
  238. *
  239. * @static
  240. * @memberOf _
  241. * @since 2.3.0
  242. * @category Util
  243. * @example
  244. *
  245. * _.times(2, _.noop);
  246. * // => [undefined, undefined]
  247. */
  248. function noop() {
  249. // No operation performed.
  250. }
  251. module.exports = noop;
  252. /***/ }),
  253. /* 11 */
  254. /***/ (function(module, exports, __webpack_require__) {
  255. var isObject = __webpack_require__(12),
  256. now = __webpack_require__(13),
  257. toNumber = __webpack_require__(17);
  258. /** Error message constants. */
  259. var FUNC_ERROR_TEXT = 'Expected a function';
  260. /* Built-in method references for those with the same name as other `lodash` methods. */
  261. var nativeMax = Math.max,
  262. nativeMin = Math.min;
  263. /**
  264. * Creates a debounced function that delays invoking `func` until after `wait`
  265. * milliseconds have elapsed since the last time the debounced function was
  266. * invoked. The debounced function comes with a `cancel` method to cancel
  267. * delayed `func` invocations and a `flush` method to immediately invoke them.
  268. * Provide `options` to indicate whether `func` should be invoked on the
  269. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  270. * with the last arguments provided to the debounced function. Subsequent
  271. * calls to the debounced function return the result of the last `func`
  272. * invocation.
  273. *
  274. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  275. * invoked on the trailing edge of the timeout only if the debounced function
  276. * is invoked more than once during the `wait` timeout.
  277. *
  278. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  279. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  280. *
  281. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  282. * for details over the differences between `_.debounce` and `_.throttle`.
  283. *
  284. * @static
  285. * @memberOf _
  286. * @since 0.1.0
  287. * @category Function
  288. * @param {Function} func The function to debounce.
  289. * @param {number} [wait=0] The number of milliseconds to delay.
  290. * @param {Object} [options={}] The options object.
  291. * @param {boolean} [options.leading=false]
  292. * Specify invoking on the leading edge of the timeout.
  293. * @param {number} [options.maxWait]
  294. * The maximum time `func` is allowed to be delayed before it's invoked.
  295. * @param {boolean} [options.trailing=true]
  296. * Specify invoking on the trailing edge of the timeout.
  297. * @returns {Function} Returns the new debounced function.
  298. * @example
  299. *
  300. * // Avoid costly calculations while the window size is in flux.
  301. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  302. *
  303. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  304. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  305. * 'leading': true,
  306. * 'trailing': false
  307. * }));
  308. *
  309. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  310. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  311. * var source = new EventSource('/stream');
  312. * jQuery(source).on('message', debounced);
  313. *
  314. * // Cancel the trailing debounced invocation.
  315. * jQuery(window).on('popstate', debounced.cancel);
  316. */
  317. function debounce(func, wait, options) {
  318. var lastArgs,
  319. lastThis,
  320. maxWait,
  321. result,
  322. timerId,
  323. lastCallTime,
  324. lastInvokeTime = 0,
  325. leading = false,
  326. maxing = false,
  327. trailing = true;
  328. if (typeof func != 'function') {
  329. throw new TypeError(FUNC_ERROR_TEXT);
  330. }
  331. wait = toNumber(wait) || 0;
  332. if (isObject(options)) {
  333. leading = !!options.leading;
  334. maxing = 'maxWait' in options;
  335. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  336. trailing = 'trailing' in options ? !!options.trailing : trailing;
  337. }
  338. function invokeFunc(time) {
  339. var args = lastArgs,
  340. thisArg = lastThis;
  341. lastArgs = lastThis = undefined;
  342. lastInvokeTime = time;
  343. result = func.apply(thisArg, args);
  344. return result;
  345. }
  346. function leadingEdge(time) {
  347. // Reset any `maxWait` timer.
  348. lastInvokeTime = time;
  349. // Start the timer for the trailing edge.
  350. timerId = setTimeout(timerExpired, wait);
  351. // Invoke the leading edge.
  352. return leading ? invokeFunc(time) : result;
  353. }
  354. function remainingWait(time) {
  355. var timeSinceLastCall = time - lastCallTime,
  356. timeSinceLastInvoke = time - lastInvokeTime,
  357. timeWaiting = wait - timeSinceLastCall;
  358. return maxing
  359. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  360. : timeWaiting;
  361. }
  362. function shouldInvoke(time) {
  363. var timeSinceLastCall = time - lastCallTime,
  364. timeSinceLastInvoke = time - lastInvokeTime;
  365. // Either this is the first call, activity has stopped and we're at the
  366. // trailing edge, the system time has gone backwards and we're treating
  367. // it as the trailing edge, or we've hit the `maxWait` limit.
  368. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  369. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  370. }
  371. function timerExpired() {
  372. var time = now();
  373. if (shouldInvoke(time)) {
  374. return trailingEdge(time);
  375. }
  376. // Restart the timer.
  377. timerId = setTimeout(timerExpired, remainingWait(time));
  378. }
  379. function trailingEdge(time) {
  380. timerId = undefined;
  381. // Only invoke if we have `lastArgs` which means `func` has been
  382. // debounced at least once.
  383. if (trailing && lastArgs) {
  384. return invokeFunc(time);
  385. }
  386. lastArgs = lastThis = undefined;
  387. return result;
  388. }
  389. function cancel() {
  390. if (timerId !== undefined) {
  391. clearTimeout(timerId);
  392. }
  393. lastInvokeTime = 0;
  394. lastArgs = lastCallTime = lastThis = timerId = undefined;
  395. }
  396. function flush() {
  397. return timerId === undefined ? result : trailingEdge(now());
  398. }
  399. function debounced() {
  400. var time = now(),
  401. isInvoking = shouldInvoke(time);
  402. lastArgs = arguments;
  403. lastThis = this;
  404. lastCallTime = time;
  405. if (isInvoking) {
  406. if (timerId === undefined) {
  407. return leadingEdge(lastCallTime);
  408. }
  409. if (maxing) {
  410. // Handle invocations in a tight loop.
  411. clearTimeout(timerId);
  412. timerId = setTimeout(timerExpired, wait);
  413. return invokeFunc(lastCallTime);
  414. }
  415. }
  416. if (timerId === undefined) {
  417. timerId = setTimeout(timerExpired, wait);
  418. }
  419. return result;
  420. }
  421. debounced.cancel = cancel;
  422. debounced.flush = flush;
  423. return debounced;
  424. }
  425. module.exports = debounce;
  426. /***/ }),
  427. /* 12 */
  428. /***/ (function(module, exports) {
  429. /**
  430. * Checks if `value` is the
  431. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  432. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  433. *
  434. * @static
  435. * @memberOf _
  436. * @since 0.1.0
  437. * @category Lang
  438. * @param {*} value The value to check.
  439. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  440. * @example
  441. *
  442. * _.isObject({});
  443. * // => true
  444. *
  445. * _.isObject([1, 2, 3]);
  446. * // => true
  447. *
  448. * _.isObject(_.noop);
  449. * // => true
  450. *
  451. * _.isObject(null);
  452. * // => false
  453. */
  454. function isObject(value) {
  455. var type = typeof value;
  456. return value != null && (type == 'object' || type == 'function');
  457. }
  458. module.exports = isObject;
  459. /***/ }),
  460. /* 13 */
  461. /***/ (function(module, exports, __webpack_require__) {
  462. var root = __webpack_require__(14);
  463. /**
  464. * Gets the timestamp of the number of milliseconds that have elapsed since
  465. * the Unix epoch (1 January 1970 00:00:00 UTC).
  466. *
  467. * @static
  468. * @memberOf _
  469. * @since 2.4.0
  470. * @category Date
  471. * @returns {number} Returns the timestamp.
  472. * @example
  473. *
  474. * _.defer(function(stamp) {
  475. * console.log(_.now() - stamp);
  476. * }, _.now());
  477. * // => Logs the number of milliseconds it took for the deferred invocation.
  478. */
  479. var now = function() {
  480. return root.Date.now();
  481. };
  482. module.exports = now;
  483. /***/ }),
  484. /* 14 */
  485. /***/ (function(module, exports, __webpack_require__) {
  486. var freeGlobal = __webpack_require__(15);
  487. /** Detect free variable `self`. */
  488. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  489. /** Used as a reference to the global object. */
  490. var root = freeGlobal || freeSelf || Function('return this')();
  491. module.exports = root;
  492. /***/ }),
  493. /* 15 */
  494. /***/ (function(module, exports, __webpack_require__) {
  495. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  496. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  497. module.exports = freeGlobal;
  498. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(16)))
  499. /***/ }),
  500. /* 16 */
  501. /***/ (function(module, exports) {
  502. var g;
  503. // This works in non-strict mode
  504. g = (function() {
  505. return this;
  506. })();
  507. try {
  508. // This works if eval is allowed (see CSP)
  509. g = g || new Function("return this")();
  510. } catch (e) {
  511. // This works if the window reference is available
  512. if (typeof window === "object") g = window;
  513. }
  514. // g can still be undefined, but nothing to do about it...
  515. // We return undefined, instead of nothing here, so it's
  516. // easier to handle this case. if(!global) { ...}
  517. module.exports = g;
  518. /***/ }),
  519. /* 17 */
  520. /***/ (function(module, exports, __webpack_require__) {
  521. var isObject = __webpack_require__(12),
  522. isSymbol = __webpack_require__(18);
  523. /** Used as references for various `Number` constants. */
  524. var NAN = 0 / 0;
  525. /** Used to match leading and trailing whitespace. */
  526. var reTrim = /^\s+|\s+$/g;
  527. /** Used to detect bad signed hexadecimal string values. */
  528. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  529. /** Used to detect binary string values. */
  530. var reIsBinary = /^0b[01]+$/i;
  531. /** Used to detect octal string values. */
  532. var reIsOctal = /^0o[0-7]+$/i;
  533. /** Built-in method references without a dependency on `root`. */
  534. var freeParseInt = parseInt;
  535. /**
  536. * Converts `value` to a number.
  537. *
  538. * @static
  539. * @memberOf _
  540. * @since 4.0.0
  541. * @category Lang
  542. * @param {*} value The value to process.
  543. * @returns {number} Returns the number.
  544. * @example
  545. *
  546. * _.toNumber(3.2);
  547. * // => 3.2
  548. *
  549. * _.toNumber(Number.MIN_VALUE);
  550. * // => 5e-324
  551. *
  552. * _.toNumber(Infinity);
  553. * // => Infinity
  554. *
  555. * _.toNumber('3.2');
  556. * // => 3.2
  557. */
  558. function toNumber(value) {
  559. if (typeof value == 'number') {
  560. return value;
  561. }
  562. if (isSymbol(value)) {
  563. return NAN;
  564. }
  565. if (isObject(value)) {
  566. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  567. value = isObject(other) ? (other + '') : other;
  568. }
  569. if (typeof value != 'string') {
  570. return value === 0 ? value : +value;
  571. }
  572. value = value.replace(reTrim, '');
  573. var isBinary = reIsBinary.test(value);
  574. return (isBinary || reIsOctal.test(value))
  575. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  576. : (reIsBadHex.test(value) ? NAN : +value);
  577. }
  578. module.exports = toNumber;
  579. /***/ }),
  580. /* 18 */
  581. /***/ (function(module, exports, __webpack_require__) {
  582. var baseGetTag = __webpack_require__(19),
  583. isObjectLike = __webpack_require__(23);
  584. /** `Object#toString` result references. */
  585. var symbolTag = '[object Symbol]';
  586. /**
  587. * Checks if `value` is classified as a `Symbol` primitive or object.
  588. *
  589. * @static
  590. * @memberOf _
  591. * @since 4.0.0
  592. * @category Lang
  593. * @param {*} value The value to check.
  594. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  595. * @example
  596. *
  597. * _.isSymbol(Symbol.iterator);
  598. * // => true
  599. *
  600. * _.isSymbol('abc');
  601. * // => false
  602. */
  603. function isSymbol(value) {
  604. return typeof value == 'symbol' ||
  605. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  606. }
  607. module.exports = isSymbol;
  608. /***/ }),
  609. /* 19 */
  610. /***/ (function(module, exports, __webpack_require__) {
  611. var Symbol = __webpack_require__(20),
  612. getRawTag = __webpack_require__(21),
  613. objectToString = __webpack_require__(22);
  614. /** `Object#toString` result references. */
  615. var nullTag = '[object Null]',
  616. undefinedTag = '[object Undefined]';
  617. /** Built-in value references. */
  618. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  619. /**
  620. * The base implementation of `getTag` without fallbacks for buggy environments.
  621. *
  622. * @private
  623. * @param {*} value The value to query.
  624. * @returns {string} Returns the `toStringTag`.
  625. */
  626. function baseGetTag(value) {
  627. if (value == null) {
  628. return value === undefined ? undefinedTag : nullTag;
  629. }
  630. return (symToStringTag && symToStringTag in Object(value))
  631. ? getRawTag(value)
  632. : objectToString(value);
  633. }
  634. module.exports = baseGetTag;
  635. /***/ }),
  636. /* 20 */
  637. /***/ (function(module, exports, __webpack_require__) {
  638. var root = __webpack_require__(14);
  639. /** Built-in value references. */
  640. var Symbol = root.Symbol;
  641. module.exports = Symbol;
  642. /***/ }),
  643. /* 21 */
  644. /***/ (function(module, exports, __webpack_require__) {
  645. var Symbol = __webpack_require__(20);
  646. /** Used for built-in method references. */
  647. var objectProto = Object.prototype;
  648. /** Used to check objects for own properties. */
  649. var hasOwnProperty = objectProto.hasOwnProperty;
  650. /**
  651. * Used to resolve the
  652. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  653. * of values.
  654. */
  655. var nativeObjectToString = objectProto.toString;
  656. /** Built-in value references. */
  657. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  658. /**
  659. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  660. *
  661. * @private
  662. * @param {*} value The value to query.
  663. * @returns {string} Returns the raw `toStringTag`.
  664. */
  665. function getRawTag(value) {
  666. var isOwn = hasOwnProperty.call(value, symToStringTag),
  667. tag = value[symToStringTag];
  668. try {
  669. value[symToStringTag] = undefined;
  670. var unmasked = true;
  671. } catch (e) {}
  672. var result = nativeObjectToString.call(value);
  673. if (unmasked) {
  674. if (isOwn) {
  675. value[symToStringTag] = tag;
  676. } else {
  677. delete value[symToStringTag];
  678. }
  679. }
  680. return result;
  681. }
  682. module.exports = getRawTag;
  683. /***/ }),
  684. /* 22 */
  685. /***/ (function(module, exports) {
  686. /** Used for built-in method references. */
  687. var objectProto = Object.prototype;
  688. /**
  689. * Used to resolve the
  690. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  691. * of values.
  692. */
  693. var nativeObjectToString = objectProto.toString;
  694. /**
  695. * Converts `value` to a string using `Object.prototype.toString`.
  696. *
  697. * @private
  698. * @param {*} value The value to convert.
  699. * @returns {string} Returns the converted string.
  700. */
  701. function objectToString(value) {
  702. return nativeObjectToString.call(value);
  703. }
  704. module.exports = objectToString;
  705. /***/ }),
  706. /* 23 */
  707. /***/ (function(module, exports) {
  708. /**
  709. * Checks if `value` is object-like. A value is object-like if it's not `null`
  710. * and has a `typeof` result of "object".
  711. *
  712. * @static
  713. * @memberOf _
  714. * @since 4.0.0
  715. * @category Lang
  716. * @param {*} value The value to check.
  717. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  718. * @example
  719. *
  720. * _.isObjectLike({});
  721. * // => true
  722. *
  723. * _.isObjectLike([1, 2, 3]);
  724. * // => true
  725. *
  726. * _.isObjectLike(_.noop);
  727. * // => false
  728. *
  729. * _.isObjectLike(null);
  730. * // => false
  731. */
  732. function isObjectLike(value) {
  733. return value != null && typeof value == 'object';
  734. }
  735. module.exports = isObjectLike;
  736. /***/ }),
  737. /* 24 */
  738. /***/ (function(module, exports) {
  739. module.exports = isPromise;
  740. function isPromise(obj) {
  741. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  742. }
  743. /***/ }),
  744. /* 25 */
  745. /***/ (function(module, exports, __webpack_require__) {
  746. var before = __webpack_require__(26);
  747. /**
  748. * Creates a function that is restricted to invoking `func` once. Repeat calls
  749. * to the function return the value of the first invocation. The `func` is
  750. * invoked with the `this` binding and arguments of the created function.
  751. *
  752. * @static
  753. * @memberOf _
  754. * @since 0.1.0
  755. * @category Function
  756. * @param {Function} func The function to restrict.
  757. * @returns {Function} Returns the new restricted function.
  758. * @example
  759. *
  760. * var initialize = _.once(createApplication);
  761. * initialize();
  762. * initialize();
  763. * // => `createApplication` is invoked once
  764. */
  765. function once(func) {
  766. return before(2, func);
  767. }
  768. module.exports = once;
  769. /***/ }),
  770. /* 26 */
  771. /***/ (function(module, exports, __webpack_require__) {
  772. var toInteger = __webpack_require__(27);
  773. /** Error message constants. */
  774. var FUNC_ERROR_TEXT = 'Expected a function';
  775. /**
  776. * Creates a function that invokes `func`, with the `this` binding and arguments
  777. * of the created function, while it's called less than `n` times. Subsequent
  778. * calls to the created function return the result of the last `func` invocation.
  779. *
  780. * @static
  781. * @memberOf _
  782. * @since 3.0.0
  783. * @category Function
  784. * @param {number} n The number of calls at which `func` is no longer invoked.
  785. * @param {Function} func The function to restrict.
  786. * @returns {Function} Returns the new restricted function.
  787. * @example
  788. *
  789. * jQuery(element).on('click', _.before(5, addContactToList));
  790. * // => Allows adding up to 4 contacts to the list.
  791. */
  792. function before(n, func) {
  793. var result;
  794. if (typeof func != 'function') {
  795. throw new TypeError(FUNC_ERROR_TEXT);
  796. }
  797. n = toInteger(n);
  798. return function() {
  799. if (--n > 0) {
  800. result = func.apply(this, arguments);
  801. }
  802. if (n <= 1) {
  803. func = undefined;
  804. }
  805. return result;
  806. };
  807. }
  808. module.exports = before;
  809. /***/ }),
  810. /* 27 */
  811. /***/ (function(module, exports, __webpack_require__) {
  812. var toFinite = __webpack_require__(28);
  813. /**
  814. * Converts `value` to an integer.
  815. *
  816. * **Note:** This method is loosely based on
  817. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  818. *
  819. * @static
  820. * @memberOf _
  821. * @since 4.0.0
  822. * @category Lang
  823. * @param {*} value The value to convert.
  824. * @returns {number} Returns the converted integer.
  825. * @example
  826. *
  827. * _.toInteger(3.2);
  828. * // => 3
  829. *
  830. * _.toInteger(Number.MIN_VALUE);
  831. * // => 0
  832. *
  833. * _.toInteger(Infinity);
  834. * // => 1.7976931348623157e+308
  835. *
  836. * _.toInteger('3.2');
  837. * // => 3
  838. */
  839. function toInteger(value) {
  840. var result = toFinite(value),
  841. remainder = result % 1;
  842. return result === result ? (remainder ? result - remainder : result) : 0;
  843. }
  844. module.exports = toInteger;
  845. /***/ }),
  846. /* 28 */
  847. /***/ (function(module, exports, __webpack_require__) {
  848. var toNumber = __webpack_require__(17);
  849. /** Used as references for various `Number` constants. */
  850. var INFINITY = 1 / 0,
  851. MAX_INTEGER = 1.7976931348623157e+308;
  852. /**
  853. * Converts `value` to a finite number.
  854. *
  855. * @static
  856. * @memberOf _
  857. * @since 4.12.0
  858. * @category Lang
  859. * @param {*} value The value to convert.
  860. * @returns {number} Returns the converted number.
  861. * @example
  862. *
  863. * _.toFinite(3.2);
  864. * // => 3.2
  865. *
  866. * _.toFinite(Number.MIN_VALUE);
  867. * // => 5e-324
  868. *
  869. * _.toFinite(Infinity);
  870. * // => 1.7976931348623157e+308
  871. *
  872. * _.toFinite('3.2');
  873. * // => 3.2
  874. */
  875. function toFinite(value) {
  876. if (!value) {
  877. return value === 0 ? value : 0;
  878. }
  879. value = toNumber(value);
  880. if (value === INFINITY || value === -INFINITY) {
  881. var sign = (value < 0 ? -1 : 1);
  882. return sign * MAX_INTEGER;
  883. }
  884. return value === value ? value : 0;
  885. }
  886. module.exports = toFinite;
  887. /***/ }),
  888. /* 29 */
  889. /***/ (function(module, exports) {
  890. /**
  891. * This method returns the first argument it receives.
  892. *
  893. * @static
  894. * @since 0.1.0
  895. * @memberOf _
  896. * @category Util
  897. * @param {*} value Any value.
  898. * @returns {*} Returns `value`.
  899. * @example
  900. *
  901. * var object = { 'a': 1 };
  902. *
  903. * console.log(_.identity(object) === object);
  904. * // => true
  905. */
  906. function identity(value) {
  907. return value;
  908. }
  909. module.exports = identity;
  910. /***/ }),
  911. /* 30 */
  912. /***/ (function(module, exports) {
  913. /**
  914. * Creates a function that returns `value`.
  915. *
  916. * @static
  917. * @memberOf _
  918. * @since 2.4.0
  919. * @category Util
  920. * @param {*} value The value to return from the new function.
  921. * @returns {Function} Returns the new constant function.
  922. * @example
  923. *
  924. * var objects = _.times(2, _.constant({ 'a': 1 }));
  925. *
  926. * console.log(objects);
  927. * // => [{ 'a': 1 }, { 'a': 1 }]
  928. *
  929. * console.log(objects[0] === objects[1]);
  930. * // => true
  931. */
  932. function constant(value) {
  933. return function() {
  934. return value;
  935. };
  936. }
  937. module.exports = constant;
  938. /***/ }),
  939. /* 31 */
  940. /***/ (function(module, exports) {
  941. function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
  942. function _typeof(obj) {
  943. if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
  944. module.exports = _typeof = function _typeof(obj) {
  945. return _typeof2(obj);
  946. };
  947. } else {
  948. module.exports = _typeof = function _typeof(obj) {
  949. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
  950. };
  951. }
  952. return _typeof(obj);
  953. }
  954. module.exports = _typeof;
  955. /***/ }),
  956. /* 32 */
  957. /***/ (function(module, exports) {
  958. /**
  959. * Gets the last element of `array`.
  960. *
  961. * @static
  962. * @memberOf _
  963. * @since 0.1.0
  964. * @category Array
  965. * @param {Array} array The array to query.
  966. * @returns {*} Returns the last element of `array`.
  967. * @example
  968. *
  969. * _.last([1, 2, 3]);
  970. * // => 3
  971. */
  972. function last(array) {
  973. var length = array == null ? 0 : array.length;
  974. return length ? array[length - 1] : undefined;
  975. }
  976. module.exports = last;
  977. /***/ }),
  978. /* 33 */
  979. /***/ (function(module, exports) {
  980. var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
  981. module.exports = function mergeJSXProps (objs) {
  982. return objs.reduce(function (a, b) {
  983. var aa, bb, key, nestedKey, temp
  984. for (key in b) {
  985. aa = a[key]
  986. bb = b[key]
  987. if (aa && nestRE.test(key)) {
  988. // normalize class
  989. if (key === 'class') {
  990. if (typeof aa === 'string') {
  991. temp = aa
  992. a[key] = aa = {}
  993. aa[temp] = true
  994. }
  995. if (typeof bb === 'string') {
  996. temp = bb
  997. b[key] = bb = {}
  998. bb[temp] = true
  999. }
  1000. }
  1001. if (key === 'on' || key === 'nativeOn' || key === 'hook') {
  1002. // merge functions
  1003. for (nestedKey in bb) {
  1004. aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
  1005. }
  1006. } else if (Array.isArray(aa)) {
  1007. a[key] = aa.concat(bb)
  1008. } else if (Array.isArray(bb)) {
  1009. a[key] = [aa].concat(bb)
  1010. } else {
  1011. for (nestedKey in bb) {
  1012. aa[nestedKey] = bb[nestedKey]
  1013. }
  1014. }
  1015. } else {
  1016. a[key] = b[key]
  1017. }
  1018. }
  1019. return a
  1020. }, {})
  1021. }
  1022. function mergeFn (a, b) {
  1023. return function () {
  1024. a && a.apply(this, arguments)
  1025. b && b.apply(this, arguments)
  1026. }
  1027. }
  1028. /***/ }),
  1029. /* 34 */
  1030. /***/ (function(module, exports) {
  1031. module.exports = __WEBPACK_EXTERNAL_MODULE__34__;
  1032. /***/ }),
  1033. /* 35 */
  1034. /***/ (function(module, exports, __webpack_require__) {
  1035. // extracted by mini-css-extract-plugin
  1036. /***/ }),
  1037. /* 36 */
  1038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1039. "use strict";
  1040. __webpack_require__.r(__webpack_exports__);
  1041. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
  1042. var slicedToArray = __webpack_require__(0);
  1043. var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
  1044. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
  1045. var toConsumableArray = __webpack_require__(4);
  1046. var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
  1047. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
  1048. var defineProperty = __webpack_require__(8);
  1049. var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
  1050. // EXTERNAL MODULE: ./node_modules/fuzzysearch/index.js
  1051. var fuzzysearch = __webpack_require__(9);
  1052. var fuzzysearch_default = /*#__PURE__*/__webpack_require__.n(fuzzysearch);
  1053. // EXTERNAL MODULE: ./node_modules/lodash/noop.js
  1054. var noop = __webpack_require__(10);
  1055. // CONCATENATED MODULE: ./src/utils/noop.js
  1056. // CONCATENATED MODULE: ./src/utils/warning.js
  1057. var warning_warning = false ? undefined : function warning(checker, complainer) {
  1058. if (!checker()) {
  1059. var _console;
  1060. var message = ['[Vue-Treeselect Warning]'].concat(complainer());
  1061. (_console = console).error.apply(_console, toConsumableArray_default()(message));
  1062. }
  1063. };
  1064. // CONCATENATED MODULE: ./src/utils/onLeftClick.js
  1065. function onLeftClick(mouseDownHandler) {
  1066. return function onMouseDown(evt) {
  1067. if (evt.type === 'mousedown' && evt.button === 0) {
  1068. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1069. args[_key - 1] = arguments[_key];
  1070. }
  1071. mouseDownHandler.call.apply(mouseDownHandler, [this, evt].concat(args));
  1072. }
  1073. };
  1074. }
  1075. // CONCATENATED MODULE: ./src/utils/scrollIntoView.js
  1076. function scrollIntoView($scrollingEl, $focusedEl) {
  1077. var scrollingReact = $scrollingEl.getBoundingClientRect();
  1078. var focusedRect = $focusedEl.getBoundingClientRect();
  1079. var overScroll = $focusedEl.offsetHeight / 3;
  1080. if (focusedRect.bottom + overScroll > scrollingReact.bottom) {
  1081. $scrollingEl.scrollTop = Math.min($focusedEl.offsetTop + $focusedEl.clientHeight - $scrollingEl.offsetHeight + overScroll, $scrollingEl.scrollHeight);
  1082. } else if (focusedRect.top - overScroll < scrollingReact.top) {
  1083. $scrollingEl.scrollTop = Math.max($focusedEl.offsetTop - overScroll, 0);
  1084. }
  1085. }
  1086. // EXTERNAL MODULE: ./node_modules/lodash/debounce.js
  1087. var debounce = __webpack_require__(11);
  1088. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
  1089. // CONCATENATED MODULE: ./src/utils/debounce.js
  1090. // CONCATENATED MODULE: ./node_modules/watch-size/index.es.mjs
  1091. var index_es_index = (function (element, listener) {
  1092. var expand = document.createElement('_');
  1093. var shrink = expand.appendChild(document.createElement('_'));
  1094. var expandChild = expand.appendChild(document.createElement('_'));
  1095. var shrinkChild = shrink.appendChild(document.createElement('_'));
  1096. var lastWidth = void 0,
  1097. lastHeight = void 0;
  1098. shrink.style.cssText = expand.style.cssText = 'height:100%;left:0;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:0s;width:100%;z-index:-1';
  1099. shrinkChild.style.cssText = expandChild.style.cssText = 'display:block;height:100%;transition:0s;width:100%';
  1100. shrinkChild.style.width = shrinkChild.style.height = '200%';
  1101. element.appendChild(expand);
  1102. test();
  1103. return stop;
  1104. function test() {
  1105. unbind();
  1106. var width = element.offsetWidth;
  1107. var height = element.offsetHeight;
  1108. if (width !== lastWidth || height !== lastHeight) {
  1109. lastWidth = width;
  1110. lastHeight = height;
  1111. expandChild.style.width = width * 2 + 'px';
  1112. expandChild.style.height = height * 2 + 'px';
  1113. expand.scrollLeft = expand.scrollWidth;
  1114. expand.scrollTop = expand.scrollHeight;
  1115. shrink.scrollLeft = shrink.scrollWidth;
  1116. shrink.scrollTop = shrink.scrollHeight;
  1117. listener({ width: width, height: height });
  1118. }
  1119. shrink.addEventListener('scroll', test);
  1120. expand.addEventListener('scroll', test);
  1121. }
  1122. function unbind() {
  1123. shrink.removeEventListener('scroll', test);
  1124. expand.removeEventListener('scroll', test);
  1125. }
  1126. function stop() {
  1127. unbind();
  1128. element.removeChild(expand);
  1129. }
  1130. });
  1131. /* harmony default export */ var index_es = (index_es_index);
  1132. // CONCATENATED MODULE: ./src/utils/removeFromArray.js
  1133. function removeFromArray(arr, elem) {
  1134. var idx = arr.indexOf(elem);
  1135. if (idx !== -1) arr.splice(idx, 1);
  1136. }
  1137. // CONCATENATED MODULE: ./src/utils/watchSize.js
  1138. var intervalId;
  1139. var registered = [];
  1140. var INTERVAL_DURATION = 100;
  1141. function run() {
  1142. intervalId = setInterval(function () {
  1143. registered.forEach(test);
  1144. }, INTERVAL_DURATION);
  1145. }
  1146. function stop() {
  1147. clearInterval(intervalId);
  1148. intervalId = null;
  1149. }
  1150. function test(item) {
  1151. var $el = item.$el,
  1152. listener = item.listener,
  1153. lastWidth = item.lastWidth,
  1154. lastHeight = item.lastHeight;
  1155. var width = $el.offsetWidth;
  1156. var height = $el.offsetHeight;
  1157. if (lastWidth !== width || lastHeight !== height) {
  1158. item.lastWidth = width;
  1159. item.lastHeight = height;
  1160. listener({
  1161. width: width,
  1162. height: height
  1163. });
  1164. }
  1165. }
  1166. function watchSizeForIE9($el, listener) {
  1167. var item = {
  1168. $el: $el,
  1169. listener: listener,
  1170. lastWidth: null,
  1171. lastHeight: null
  1172. };
  1173. var unwatch = function unwatch() {
  1174. removeFromArray(registered, item);
  1175. if (!registered.length) stop();
  1176. };
  1177. registered.push(item);
  1178. test(item);
  1179. run();
  1180. return unwatch;
  1181. }
  1182. function watchSize($el, listener) {
  1183. var isIE9 = document.documentMode === 9;
  1184. var locked = true;
  1185. var wrappedListener = function wrappedListener() {
  1186. return locked || listener.apply(void 0, arguments);
  1187. };
  1188. var implementation = isIE9 ? watchSizeForIE9 : index_es;
  1189. var removeSizeWatcher = implementation($el, wrappedListener);
  1190. locked = false;
  1191. return removeSizeWatcher;
  1192. }
  1193. // CONCATENATED MODULE: ./src/utils/setupResizeAndScrollEventListeners.js
  1194. function findScrollParents($el) {
  1195. var $scrollParents = [];
  1196. var $parent = $el.parentNode;
  1197. while ($parent && $parent.nodeName !== 'BODY' && $parent.nodeType === document.ELEMENT_NODE) {
  1198. if (isScrollElment($parent)) $scrollParents.push($parent);
  1199. $parent = $parent.parentNode;
  1200. }
  1201. $scrollParents.push(window);
  1202. return $scrollParents;
  1203. }
  1204. function isScrollElment($el) {
  1205. var _getComputedStyle = getComputedStyle($el),
  1206. overflow = _getComputedStyle.overflow,
  1207. overflowX = _getComputedStyle.overflowX,
  1208. overflowY = _getComputedStyle.overflowY;
  1209. return /(auto|scroll|overlay)/.test(overflow + overflowY + overflowX);
  1210. }
  1211. function setupResizeAndScrollEventListeners($el, listener) {
  1212. var $scrollParents = findScrollParents($el);
  1213. window.addEventListener('resize', listener, {
  1214. passive: true
  1215. });
  1216. $scrollParents.forEach(function (scrollParent) {
  1217. scrollParent.addEventListener('scroll', listener, {
  1218. passive: true
  1219. });
  1220. });
  1221. return function removeEventListeners() {
  1222. window.removeEventListener('resize', listener, {
  1223. passive: true
  1224. });
  1225. $scrollParents.forEach(function ($scrollParent) {
  1226. $scrollParent.removeEventListener('scroll', listener, {
  1227. passive: true
  1228. });
  1229. });
  1230. };
  1231. }
  1232. // CONCATENATED MODULE: ./src/utils/isNaN.js
  1233. function isNaN_isNaN(x) {
  1234. return x !== x;
  1235. }
  1236. // EXTERNAL MODULE: ./node_modules/is-promise/index.js
  1237. var is_promise = __webpack_require__(24);
  1238. var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
  1239. // CONCATENATED MODULE: ./src/utils/isPromise.js
  1240. // EXTERNAL MODULE: ./node_modules/lodash/once.js
  1241. var once = __webpack_require__(25);
  1242. var once_default = /*#__PURE__*/__webpack_require__.n(once);
  1243. // CONCATENATED MODULE: ./src/utils/once.js
  1244. // EXTERNAL MODULE: ./node_modules/lodash/identity.js
  1245. var identity = __webpack_require__(29);
  1246. var identity_default = /*#__PURE__*/__webpack_require__.n(identity);
  1247. // CONCATENATED MODULE: ./src/utils/identity.js
  1248. // EXTERNAL MODULE: ./node_modules/lodash/constant.js
  1249. var constant = __webpack_require__(30);
  1250. var constant_default = /*#__PURE__*/__webpack_require__.n(constant);
  1251. // CONCATENATED MODULE: ./src/utils/constant.js
  1252. // CONCATENATED MODULE: ./src/utils/createMap.js
  1253. var createMap = function createMap() {
  1254. return Object.create(null);
  1255. };
  1256. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
  1257. var helpers_typeof = __webpack_require__(31);
  1258. var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
  1259. // CONCATENATED MODULE: ./src/utils/deepExtend.js
  1260. function isPlainObject(value) {
  1261. if (value == null || typeof_default()(value) !== 'object') return false;
  1262. return Object.getPrototypeOf(value) === Object.prototype;
  1263. }
  1264. function copy(obj, key, value) {
  1265. if (isPlainObject(value)) {
  1266. obj[key] || (obj[key] = {});
  1267. deepExtend(obj[key], value);
  1268. } else {
  1269. obj[key] = value;
  1270. }
  1271. }
  1272. function deepExtend(target, source) {
  1273. if (isPlainObject(source)) {
  1274. var keys = Object.keys(source);
  1275. for (var i = 0, len = keys.length; i < len; i++) {
  1276. copy(target, keys[i], source[keys[i]]);
  1277. }
  1278. }
  1279. return target;
  1280. }
  1281. // EXTERNAL MODULE: ./node_modules/lodash/last.js
  1282. var lodash_last = __webpack_require__(32);
  1283. var last_default = /*#__PURE__*/__webpack_require__.n(lodash_last);
  1284. // CONCATENATED MODULE: ./src/utils/last.js
  1285. // CONCATENATED MODULE: ./src/utils/includes.js
  1286. function includes(arrOrStr, elem) {
  1287. return arrOrStr.indexOf(elem) !== -1;
  1288. }
  1289. // CONCATENATED MODULE: ./src/utils/find.js
  1290. function find(arr, predicate, ctx) {
  1291. for (var i = 0, len = arr.length; i < len; i++) {
  1292. if (predicate.call(ctx, arr[i], i, arr)) return arr[i];
  1293. }
  1294. return undefined;
  1295. }
  1296. // CONCATENATED MODULE: ./src/utils/quickDiff.js
  1297. function quickDiff(arrA, arrB) {
  1298. if (arrA.length !== arrB.length) return true;
  1299. for (var i = 0; i < arrA.length; i++) {
  1300. if (arrA[i] !== arrB[i]) return true;
  1301. }
  1302. return false;
  1303. }
  1304. // CONCATENATED MODULE: ./src/utils/index.js
  1305. // CONCATENATED MODULE: ./src/constants.js
  1306. var NO_PARENT_NODE = null;
  1307. var UNCHECKED = 0;
  1308. var INDETERMINATE = 1;
  1309. var CHECKED = 2;
  1310. var ALL_CHILDREN = 'ALL_CHILDREN';
  1311. var ALL_DESCENDANTS = 'ALL_DESCENDANTS';
  1312. var LEAF_CHILDREN = 'LEAF_CHILDREN';
  1313. var LEAF_DESCENDANTS = 'LEAF_DESCENDANTS';
  1314. var LOAD_ROOT_OPTIONS = 'LOAD_ROOT_OPTIONS';
  1315. var LOAD_CHILDREN_OPTIONS = 'LOAD_CHILDREN_OPTIONS';
  1316. var ASYNC_SEARCH = 'ASYNC_SEARCH';
  1317. var ALL = 'ALL';
  1318. var BRANCH_PRIORITY = 'BRANCH_PRIORITY';
  1319. var LEAF_PRIORITY = 'LEAF_PRIORITY';
  1320. var ALL_WITH_INDETERMINATE = 'ALL_WITH_INDETERMINATE';
  1321. var ORDER_SELECTED = 'ORDER_SELECTED';
  1322. var LEVEL = 'LEVEL';
  1323. var INDEX = 'INDEX';
  1324. var KEY_CODES = {
  1325. BACKSPACE: 8,
  1326. ENTER: 13,
  1327. ESCAPE: 27,
  1328. END: 35,
  1329. HOME: 36,
  1330. ARROW_LEFT: 37,
  1331. ARROW_UP: 38,
  1332. ARROW_RIGHT: 39,
  1333. ARROW_DOWN: 40,
  1334. DELETE: 46
  1335. };
  1336. var INPUT_DEBOUNCE_DELAY = false ? undefined : 200;
  1337. var MIN_INPUT_WIDTH = 5;
  1338. var MENU_BUFFER = 40;
  1339. // CONCATENATED MODULE: ./src/mixins/treeselectMixin.js
  1340. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  1341. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  1342. function sortValueByIndex(a, b) {
  1343. var i = 0;
  1344. do {
  1345. if (a.level < i) return -1;
  1346. if (b.level < i) return 1;
  1347. if (a.index[i] !== b.index[i]) return a.index[i] - b.index[i];
  1348. i++;
  1349. } while (true);
  1350. }
  1351. function sortValueByLevel(a, b) {
  1352. return a.level === b.level ? sortValueByIndex(a, b) : a.level - b.level;
  1353. }
  1354. function createAsyncOptionsStates() {
  1355. return {
  1356. isLoaded: false,
  1357. isLoading: false,
  1358. loadingError: ''
  1359. };
  1360. }
  1361. function stringifyOptionPropValue(value) {
  1362. if (typeof value === 'string') return value;
  1363. if (typeof value === 'number' && !isNaN_isNaN(value)) return value + '';
  1364. return '';
  1365. }
  1366. function match(enableFuzzyMatch, needle, haystack) {
  1367. return enableFuzzyMatch ? fuzzysearch_default()(needle, haystack) : includes(haystack, needle);
  1368. }
  1369. function getErrorMessage(err) {
  1370. return err.message || String(err);
  1371. }
  1372. var instanceId = 0;
  1373. /* harmony default export */ var treeselectMixin = ({
  1374. provide: function provide() {
  1375. return {
  1376. instance: this
  1377. };
  1378. },
  1379. props: {
  1380. allowClearingDisabled: {
  1381. type: Boolean,
  1382. default: false
  1383. },
  1384. allowSelectingDisabledDescendants: {
  1385. type: Boolean,
  1386. default: false
  1387. },
  1388. alwaysOpen: {
  1389. type: Boolean,
  1390. default: false
  1391. },
  1392. appendToBody: {
  1393. type: Boolean,
  1394. default: false
  1395. },
  1396. async: {
  1397. type: Boolean,
  1398. default: false
  1399. },
  1400. autoFocus: {
  1401. type: Boolean,
  1402. default: false
  1403. },
  1404. autoLoadRootOptions: {
  1405. type: Boolean,
  1406. default: true
  1407. },
  1408. autoDeselectAncestors: {
  1409. type: Boolean,
  1410. default: false
  1411. },
  1412. autoDeselectDescendants: {
  1413. type: Boolean,
  1414. default: false
  1415. },
  1416. autoSelectAncestors: {
  1417. type: Boolean,
  1418. default: false
  1419. },
  1420. autoSelectDescendants: {
  1421. type: Boolean,
  1422. default: false
  1423. },
  1424. backspaceRemoves: {
  1425. type: Boolean,
  1426. default: true
  1427. },
  1428. beforeClearAll: {
  1429. type: Function,
  1430. default: constant_default()(true)
  1431. },
  1432. branchNodesFirst: {
  1433. type: Boolean,
  1434. default: false
  1435. },
  1436. cacheOptions: {
  1437. type: Boolean,
  1438. default: true
  1439. },
  1440. clearable: {
  1441. type: Boolean,
  1442. default: true
  1443. },
  1444. clearAllText: {
  1445. type: String,
  1446. default: 'Clear all'
  1447. },
  1448. clearOnSelect: {
  1449. type: Boolean,
  1450. default: false
  1451. },
  1452. clearValueText: {
  1453. type: String,
  1454. default: 'Clear value'
  1455. },
  1456. closeOnSelect: {
  1457. type: Boolean,
  1458. default: true
  1459. },
  1460. defaultExpandLevel: {
  1461. type: Number,
  1462. default: 0
  1463. },
  1464. defaultOptions: {
  1465. default: false
  1466. },
  1467. deleteRemoves: {
  1468. type: Boolean,
  1469. default: true
  1470. },
  1471. delimiter: {
  1472. type: String,
  1473. default: ','
  1474. },
  1475. flattenSearchResults: {
  1476. type: Boolean,
  1477. default: false
  1478. },
  1479. disableBranchNodes: {
  1480. type: Boolean,
  1481. default: false
  1482. },
  1483. disabled: {
  1484. type: Boolean,
  1485. default: false
  1486. },
  1487. disableFuzzyMatching: {
  1488. type: Boolean,
  1489. default: false
  1490. },
  1491. flat: {
  1492. type: Boolean,
  1493. default: false
  1494. },
  1495. instanceId: {
  1496. default: function _default() {
  1497. return "".concat(instanceId++, "$$");
  1498. },
  1499. type: [String, Number]
  1500. },
  1501. joinValues: {
  1502. type: Boolean,
  1503. default: false
  1504. },
  1505. limit: {
  1506. type: Number,
  1507. default: Infinity
  1508. },
  1509. limitText: {
  1510. type: Function,
  1511. default: function limitTextDefault(count) {
  1512. return "and ".concat(count, " more");
  1513. }
  1514. },
  1515. loadingText: {
  1516. type: String,
  1517. default: 'Loading...'
  1518. },
  1519. loadOptions: {
  1520. type: Function
  1521. },
  1522. matchKeys: {
  1523. type: Array,
  1524. default: constant_default()(['label'])
  1525. },
  1526. maxHeight: {
  1527. type: Number,
  1528. default: 300
  1529. },
  1530. multiple: {
  1531. type: Boolean,
  1532. default: false
  1533. },
  1534. name: {
  1535. type: String
  1536. },
  1537. noChildrenText: {
  1538. type: String,
  1539. default: 'No sub-options.'
  1540. },
  1541. noOptionsText: {
  1542. type: String,
  1543. default: 'No options available.'
  1544. },
  1545. noResultsText: {
  1546. type: String,
  1547. default: 'No results found...'
  1548. },
  1549. normalizer: {
  1550. type: Function,
  1551. default: identity_default.a
  1552. },
  1553. openDirection: {
  1554. type: String,
  1555. default: 'auto',
  1556. validator: function validator(value) {
  1557. var acceptableValues = ['auto', 'top', 'bottom', 'above', 'below'];
  1558. return includes(acceptableValues, value);
  1559. }
  1560. },
  1561. openOnClick: {
  1562. type: Boolean,
  1563. default: true
  1564. },
  1565. openOnFocus: {
  1566. type: Boolean,
  1567. default: false
  1568. },
  1569. options: {
  1570. type: Array
  1571. },
  1572. placeholder: {
  1573. type: String,
  1574. default: 'Select...'
  1575. },
  1576. required: {
  1577. type: Boolean,
  1578. default: false
  1579. },
  1580. retryText: {
  1581. type: String,
  1582. default: 'Retry?'
  1583. },
  1584. retryTitle: {
  1585. type: String,
  1586. default: 'Click to retry'
  1587. },
  1588. searchable: {
  1589. type: Boolean,
  1590. default: true
  1591. },
  1592. searchNested: {
  1593. type: Boolean,
  1594. default: false
  1595. },
  1596. searchPromptText: {
  1597. type: String,
  1598. default: 'Type to search...'
  1599. },
  1600. showCount: {
  1601. type: Boolean,
  1602. default: false
  1603. },
  1604. showCountOf: {
  1605. type: String,
  1606. default: ALL_CHILDREN,
  1607. validator: function validator(value) {
  1608. var acceptableValues = [ALL_CHILDREN, ALL_DESCENDANTS, LEAF_CHILDREN, LEAF_DESCENDANTS];
  1609. return includes(acceptableValues, value);
  1610. }
  1611. },
  1612. showCountOnSearch: null,
  1613. sortValueBy: {
  1614. type: String,
  1615. default: ORDER_SELECTED,
  1616. validator: function validator(value) {
  1617. var acceptableValues = [ORDER_SELECTED, LEVEL, INDEX];
  1618. return includes(acceptableValues, value);
  1619. }
  1620. },
  1621. tabIndex: {
  1622. type: Number,
  1623. default: 0
  1624. },
  1625. value: null,
  1626. valueConsistsOf: {
  1627. type: String,
  1628. default: BRANCH_PRIORITY,
  1629. validator: function validator(value) {
  1630. var acceptableValues = [ALL, BRANCH_PRIORITY, LEAF_PRIORITY, ALL_WITH_INDETERMINATE];
  1631. return includes(acceptableValues, value);
  1632. }
  1633. },
  1634. valueFormat: {
  1635. type: String,
  1636. default: 'id'
  1637. },
  1638. zIndex: {
  1639. type: [Number, String],
  1640. default: 999
  1641. }
  1642. },
  1643. data: function data() {
  1644. return {
  1645. trigger: {
  1646. isFocused: false,
  1647. searchQuery: ''
  1648. },
  1649. menu: {
  1650. isOpen: false,
  1651. current: null,
  1652. lastScrollPosition: 0,
  1653. placement: 'bottom'
  1654. },
  1655. forest: {
  1656. normalizedOptions: [],
  1657. nodeMap: createMap(),
  1658. checkedStateMap: createMap(),
  1659. selectedNodeIds: this.extractCheckedNodeIdsFromValue(),
  1660. selectedNodeMap: createMap()
  1661. },
  1662. rootOptionsStates: createAsyncOptionsStates(),
  1663. localSearch: {
  1664. active: false,
  1665. noResults: true,
  1666. countMap: createMap()
  1667. },
  1668. remoteSearch: createMap()
  1669. };
  1670. },
  1671. computed: {
  1672. selectedNodes: function selectedNodes() {
  1673. return this.forest.selectedNodeIds.map(this.getNode);
  1674. },
  1675. internalValue: function internalValue() {
  1676. var _this = this;
  1677. var internalValue;
  1678. if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
  1679. internalValue = this.forest.selectedNodeIds.slice();
  1680. } else if (this.valueConsistsOf === BRANCH_PRIORITY) {
  1681. internalValue = this.forest.selectedNodeIds.filter(function (id) {
  1682. var node = _this.getNode(id);
  1683. if (node.isRootNode) return true;
  1684. return !_this.isSelected(node.parentNode);
  1685. });
  1686. } else if (this.valueConsistsOf === LEAF_PRIORITY) {
  1687. internalValue = this.forest.selectedNodeIds.filter(function (id) {
  1688. var node = _this.getNode(id);
  1689. if (node.isLeaf) return true;
  1690. return node.children.length === 0;
  1691. });
  1692. } else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
  1693. var _internalValue;
  1694. var indeterminateNodeIds = [];
  1695. internalValue = this.forest.selectedNodeIds.slice();
  1696. this.selectedNodes.forEach(function (selectedNode) {
  1697. selectedNode.ancestors.forEach(function (ancestor) {
  1698. if (includes(indeterminateNodeIds, ancestor.id)) return;
  1699. if (includes(internalValue, ancestor.id)) return;
  1700. indeterminateNodeIds.push(ancestor.id);
  1701. });
  1702. });
  1703. (_internalValue = internalValue).push.apply(_internalValue, indeterminateNodeIds);
  1704. }
  1705. if (this.sortValueBy === LEVEL) {
  1706. internalValue.sort(function (a, b) {
  1707. return sortValueByLevel(_this.getNode(a), _this.getNode(b));
  1708. });
  1709. } else if (this.sortValueBy === INDEX) {
  1710. internalValue.sort(function (a, b) {
  1711. return sortValueByIndex(_this.getNode(a), _this.getNode(b));
  1712. });
  1713. }
  1714. return internalValue;
  1715. },
  1716. hasValue: function hasValue() {
  1717. return this.internalValue.length > 0;
  1718. },
  1719. single: function single() {
  1720. return !this.multiple;
  1721. },
  1722. visibleOptionIds: function visibleOptionIds() {
  1723. var _this2 = this;
  1724. var visibleOptionIds = [];
  1725. this.traverseAllNodesByIndex(function (node) {
  1726. if (!_this2.localSearch.active || _this2.shouldOptionBeIncludedInSearchResult(node)) {
  1727. visibleOptionIds.push(node.id);
  1728. }
  1729. if (node.isBranch && !_this2.shouldExpand(node)) {
  1730. return false;
  1731. }
  1732. });
  1733. return visibleOptionIds;
  1734. },
  1735. hasVisibleOptions: function hasVisibleOptions() {
  1736. return this.visibleOptionIds.length !== 0;
  1737. },
  1738. showCountOnSearchComputed: function showCountOnSearchComputed() {
  1739. return typeof this.showCountOnSearch === 'boolean' ? this.showCountOnSearch : this.showCount;
  1740. },
  1741. hasBranchNodes: function hasBranchNodes() {
  1742. return this.forest.normalizedOptions.some(function (rootNode) {
  1743. return rootNode.isBranch;
  1744. });
  1745. },
  1746. shouldFlattenOptions: function shouldFlattenOptions() {
  1747. return this.localSearch.active && this.flattenSearchResults;
  1748. }
  1749. },
  1750. watch: {
  1751. alwaysOpen: function alwaysOpen(newValue) {
  1752. if (newValue) this.openMenu();else this.closeMenu();
  1753. },
  1754. branchNodesFirst: function branchNodesFirst() {
  1755. this.initialize();
  1756. },
  1757. disabled: function disabled(newValue) {
  1758. if (newValue && this.menu.isOpen) this.closeMenu();else if (!newValue && !this.menu.isOpen && this.alwaysOpen) this.openMenu();
  1759. },
  1760. flat: function flat() {
  1761. this.initialize();
  1762. },
  1763. internalValue: function internalValue(newValue, oldValue) {
  1764. var hasChanged = quickDiff(newValue, oldValue);
  1765. if (hasChanged) this.$emit('input', this.getValue(), this.getInstanceId());
  1766. },
  1767. matchKeys: function matchKeys() {
  1768. this.initialize();
  1769. },
  1770. multiple: function multiple(newValue) {
  1771. if (newValue) this.buildForestState();
  1772. },
  1773. options: {
  1774. handler: function handler() {
  1775. if (this.async) return;
  1776. this.initialize();
  1777. this.rootOptionsStates.isLoaded = Array.isArray(this.options);
  1778. },
  1779. deep: true,
  1780. immediate: true
  1781. },
  1782. 'trigger.searchQuery': function triggerSearchQuery() {
  1783. if (this.async) {
  1784. this.handleRemoteSearch();
  1785. } else {
  1786. this.handleLocalSearch();
  1787. }
  1788. this.$emit('search-change', this.trigger.searchQuery, this.getInstanceId());
  1789. },
  1790. value: function value() {
  1791. var nodeIdsFromValue = this.extractCheckedNodeIdsFromValue();
  1792. var hasChanged = quickDiff(nodeIdsFromValue, this.internalValue);
  1793. if (hasChanged) this.fixSelectedNodeIds(nodeIdsFromValue);
  1794. }
  1795. },
  1796. methods: {
  1797. verifyProps: function verifyProps() {
  1798. var _this3 = this;
  1799. warning_warning(function () {
  1800. return _this3.async ? _this3.searchable : true;
  1801. }, function () {
  1802. return 'For async search mode, the value of "searchable" prop must be true.';
  1803. });
  1804. if (this.options == null && !this.loadOptions) {
  1805. warning_warning(function () {
  1806. return false;
  1807. }, function () {
  1808. return 'Are you meant to dynamically load options? You need to use "loadOptions" prop.';
  1809. });
  1810. }
  1811. if (this.flat) {
  1812. warning_warning(function () {
  1813. return _this3.multiple;
  1814. }, function () {
  1815. return 'You are using flat mode. But you forgot to add "multiple=true"?';
  1816. });
  1817. }
  1818. if (!this.flat) {
  1819. var propNames = ['autoSelectAncestors', 'autoSelectDescendants', 'autoDeselectAncestors', 'autoDeselectDescendants'];
  1820. propNames.forEach(function (propName) {
  1821. warning_warning(function () {
  1822. return !_this3[propName];
  1823. }, function () {
  1824. return "\"".concat(propName, "\" only applies to flat mode.");
  1825. });
  1826. });
  1827. }
  1828. },
  1829. resetFlags: function resetFlags() {
  1830. this._blurOnSelect = false;
  1831. },
  1832. initialize: function initialize() {
  1833. var options = this.async ? this.getRemoteSearchEntry().options : this.options;
  1834. if (Array.isArray(options)) {
  1835. var prevNodeMap = this.forest.nodeMap;
  1836. this.forest.nodeMap = createMap();
  1837. this.keepDataOfSelectedNodes(prevNodeMap);
  1838. this.forest.normalizedOptions = this.normalize(NO_PARENT_NODE, options, prevNodeMap);
  1839. this.fixSelectedNodeIds(this.internalValue);
  1840. } else {
  1841. this.forest.normalizedOptions = [];
  1842. }
  1843. },
  1844. getInstanceId: function getInstanceId() {
  1845. return this.instanceId == null ? this.id : this.instanceId;
  1846. },
  1847. getValue: function getValue() {
  1848. var _this4 = this;
  1849. if (this.valueFormat === 'id') {
  1850. return this.multiple ? this.internalValue.slice() : this.internalValue[0];
  1851. }
  1852. var rawNodes = this.internalValue.map(function (id) {
  1853. return _this4.getNode(id).raw;
  1854. });
  1855. return this.multiple ? rawNodes : rawNodes[0];
  1856. },
  1857. getNode: function getNode(nodeId) {
  1858. warning_warning(function () {
  1859. return nodeId != null;
  1860. }, function () {
  1861. return "Invalid node id: ".concat(nodeId);
  1862. });
  1863. if (nodeId == null) return null;
  1864. return nodeId in this.forest.nodeMap ? this.forest.nodeMap[nodeId] : this.createFallbackNode(nodeId);
  1865. },
  1866. createFallbackNode: function createFallbackNode(id) {
  1867. var raw = this.extractNodeFromValue(id);
  1868. var label = this.enhancedNormalizer(raw).label || "".concat(id, " (unknown)");
  1869. var fallbackNode = {
  1870. id: id,
  1871. label: label,
  1872. ancestors: [],
  1873. parentNode: NO_PARENT_NODE,
  1874. isFallbackNode: true,
  1875. isRootNode: true,
  1876. isLeaf: true,
  1877. isBranch: false,
  1878. isDisabled: false,
  1879. isNew: false,
  1880. index: [-1],
  1881. level: 0,
  1882. raw: raw
  1883. };
  1884. return this.$set(this.forest.nodeMap, id, fallbackNode);
  1885. },
  1886. extractCheckedNodeIdsFromValue: function extractCheckedNodeIdsFromValue() {
  1887. var _this5 = this;
  1888. if (this.value == null) return [];
  1889. if (this.valueFormat === 'id') {
  1890. return this.multiple ? this.value.slice() : [this.value];
  1891. }
  1892. return (this.multiple ? this.value : [this.value]).map(function (node) {
  1893. return _this5.enhancedNormalizer(node);
  1894. }).map(function (node) {
  1895. return node.id;
  1896. });
  1897. },
  1898. extractNodeFromValue: function extractNodeFromValue(id) {
  1899. var _this6 = this;
  1900. var defaultNode = {
  1901. id: id
  1902. };
  1903. if (this.valueFormat === 'id') {
  1904. return defaultNode;
  1905. }
  1906. var valueArray = this.multiple ? Array.isArray(this.value) ? this.value : [] : this.value ? [this.value] : [];
  1907. var matched = find(valueArray, function (node) {
  1908. return node && _this6.enhancedNormalizer(node).id === id;
  1909. });
  1910. return matched || defaultNode;
  1911. },
  1912. fixSelectedNodeIds: function fixSelectedNodeIds(nodeIdListOfPrevValue) {
  1913. var _this7 = this;
  1914. var nextSelectedNodeIds = [];
  1915. if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
  1916. nextSelectedNodeIds = nodeIdListOfPrevValue;
  1917. } else if (this.valueConsistsOf === BRANCH_PRIORITY) {
  1918. nodeIdListOfPrevValue.forEach(function (nodeId) {
  1919. nextSelectedNodeIds.push(nodeId);
  1920. var node = _this7.getNode(nodeId);
  1921. if (node.isBranch) _this7.traverseDescendantsBFS(node, function (descendant) {
  1922. nextSelectedNodeIds.push(descendant.id);
  1923. });
  1924. });
  1925. } else if (this.valueConsistsOf === LEAF_PRIORITY) {
  1926. var map = createMap();
  1927. var queue = nodeIdListOfPrevValue.slice();
  1928. while (queue.length) {
  1929. var nodeId = queue.shift();
  1930. var node = this.getNode(nodeId);
  1931. nextSelectedNodeIds.push(nodeId);
  1932. if (node.isRootNode) continue;
  1933. if (!(node.parentNode.id in map)) map[node.parentNode.id] = node.parentNode.children.length;
  1934. if (--map[node.parentNode.id] === 0) queue.push(node.parentNode.id);
  1935. }
  1936. } else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
  1937. var _map = createMap();
  1938. var _queue = nodeIdListOfPrevValue.filter(function (nodeId) {
  1939. var node = _this7.getNode(nodeId);
  1940. return node.isLeaf || node.children.length === 0;
  1941. });
  1942. while (_queue.length) {
  1943. var _nodeId = _queue.shift();
  1944. var _node = this.getNode(_nodeId);
  1945. nextSelectedNodeIds.push(_nodeId);
  1946. if (_node.isRootNode) continue;
  1947. if (!(_node.parentNode.id in _map)) _map[_node.parentNode.id] = _node.parentNode.children.length;
  1948. if (--_map[_node.parentNode.id] === 0) _queue.push(_node.parentNode.id);
  1949. }
  1950. }
  1951. var hasChanged = quickDiff(this.forest.selectedNodeIds, nextSelectedNodeIds);
  1952. if (hasChanged) this.forest.selectedNodeIds = nextSelectedNodeIds;
  1953. this.buildForestState();
  1954. },
  1955. keepDataOfSelectedNodes: function keepDataOfSelectedNodes(prevNodeMap) {
  1956. var _this8 = this;
  1957. this.forest.selectedNodeIds.forEach(function (id) {
  1958. if (!prevNodeMap[id]) return;
  1959. var node = _objectSpread({}, prevNodeMap[id], {
  1960. isFallbackNode: true
  1961. });
  1962. _this8.$set(_this8.forest.nodeMap, id, node);
  1963. });
  1964. },
  1965. isSelected: function isSelected(node) {
  1966. return this.forest.selectedNodeMap[node.id] === true;
  1967. },
  1968. traverseDescendantsBFS: function traverseDescendantsBFS(parentNode, callback) {
  1969. if (!parentNode.isBranch) return;
  1970. var queue = parentNode.children.slice();
  1971. while (queue.length) {
  1972. var currNode = queue[0];
  1973. if (currNode.isBranch) queue.push.apply(queue, toConsumableArray_default()(currNode.children));
  1974. callback(currNode);
  1975. queue.shift();
  1976. }
  1977. },
  1978. traverseDescendantsDFS: function traverseDescendantsDFS(parentNode, callback) {
  1979. var _this9 = this;
  1980. if (!parentNode.isBranch) return;
  1981. parentNode.children.forEach(function (child) {
  1982. _this9.traverseDescendantsDFS(child, callback);
  1983. callback(child);
  1984. });
  1985. },
  1986. traverseAllNodesDFS: function traverseAllNodesDFS(callback) {
  1987. var _this10 = this;
  1988. this.forest.normalizedOptions.forEach(function (rootNode) {
  1989. _this10.traverseDescendantsDFS(rootNode, callback);
  1990. callback(rootNode);
  1991. });
  1992. },
  1993. traverseAllNodesByIndex: function traverseAllNodesByIndex(callback) {
  1994. var walk = function walk(parentNode) {
  1995. parentNode.children.forEach(function (child) {
  1996. if (callback(child) !== false && child.isBranch) {
  1997. walk(child);
  1998. }
  1999. });
  2000. };
  2001. walk({
  2002. children: this.forest.normalizedOptions
  2003. });
  2004. },
  2005. toggleClickOutsideEvent: function toggleClickOutsideEvent(enabled) {
  2006. if (enabled) {
  2007. document.addEventListener('mousedown', this.handleClickOutside, false);
  2008. } else {
  2009. document.removeEventListener('mousedown', this.handleClickOutside, false);
  2010. }
  2011. },
  2012. getValueContainer: function getValueContainer() {
  2013. return this.$refs.control.$refs['value-container'];
  2014. },
  2015. getInput: function getInput() {
  2016. return this.getValueContainer().$refs.input;
  2017. },
  2018. focusInput: function focusInput() {
  2019. this.getInput().focus();
  2020. },
  2021. blurInput: function blurInput() {
  2022. this.getInput().blur();
  2023. },
  2024. handleMouseDown: onLeftClick(function handleMouseDown(evt) {
  2025. evt.preventDefault();
  2026. evt.stopPropagation();
  2027. if (this.disabled) return;
  2028. var isClickedOnValueContainer = this.getValueContainer().$el.contains(evt.target);
  2029. if (isClickedOnValueContainer && !this.menu.isOpen && (this.openOnClick || this.trigger.isFocused)) {
  2030. this.openMenu();
  2031. }
  2032. if (this._blurOnSelect) {
  2033. this.blurInput();
  2034. } else {
  2035. this.focusInput();
  2036. }
  2037. this.resetFlags();
  2038. }),
  2039. handleClickOutside: function handleClickOutside(evt) {
  2040. if (this.$refs.wrapper && !this.$refs.wrapper.contains(evt.target)) {
  2041. this.blurInput();
  2042. this.closeMenu();
  2043. }
  2044. },
  2045. handleLocalSearch: function handleLocalSearch() {
  2046. var _this11 = this;
  2047. var searchQuery = this.trigger.searchQuery;
  2048. var done = function done() {
  2049. return _this11.resetHighlightedOptionWhenNecessary(true);
  2050. };
  2051. if (!searchQuery) {
  2052. this.localSearch.active = false;
  2053. return done();
  2054. }
  2055. this.localSearch.active = true;
  2056. this.localSearch.noResults = true;
  2057. this.traverseAllNodesDFS(function (node) {
  2058. if (node.isBranch) {
  2059. var _this11$$set;
  2060. node.isExpandedOnSearch = false;
  2061. node.showAllChildrenOnSearch = false;
  2062. node.isMatched = false;
  2063. node.hasMatchedDescendants = false;
  2064. _this11.$set(_this11.localSearch.countMap, node.id, (_this11$$set = {}, defineProperty_default()(_this11$$set, ALL_CHILDREN, 0), defineProperty_default()(_this11$$set, ALL_DESCENDANTS, 0), defineProperty_default()(_this11$$set, LEAF_CHILDREN, 0), defineProperty_default()(_this11$$set, LEAF_DESCENDANTS, 0), _this11$$set));
  2065. }
  2066. });
  2067. var lowerCasedSearchQuery = searchQuery.trim().toLocaleLowerCase();
  2068. var splitSearchQuery = lowerCasedSearchQuery.replace(/\s+/g, ' ').split(' ');
  2069. this.traverseAllNodesDFS(function (node) {
  2070. if (_this11.searchNested && splitSearchQuery.length > 1) {
  2071. node.isMatched = splitSearchQuery.every(function (filterValue) {
  2072. return match(false, filterValue, node.nestedSearchLabel);
  2073. });
  2074. } else {
  2075. node.isMatched = _this11.matchKeys.some(function (matchKey) {
  2076. return match(!_this11.disableFuzzyMatching, lowerCasedSearchQuery, node.lowerCased[matchKey]);
  2077. });
  2078. }
  2079. if (node.isMatched) {
  2080. _this11.localSearch.noResults = false;
  2081. node.ancestors.forEach(function (ancestor) {
  2082. return _this11.localSearch.countMap[ancestor.id][ALL_DESCENDANTS]++;
  2083. });
  2084. if (node.isLeaf) node.ancestors.forEach(function (ancestor) {
  2085. return _this11.localSearch.countMap[ancestor.id][LEAF_DESCENDANTS]++;
  2086. });
  2087. if (node.parentNode !== NO_PARENT_NODE) {
  2088. _this11.localSearch.countMap[node.parentNode.id][ALL_CHILDREN] += 1;
  2089. if (node.isLeaf) _this11.localSearch.countMap[node.parentNode.id][LEAF_CHILDREN] += 1;
  2090. }
  2091. }
  2092. if ((node.isMatched || node.isBranch && node.isExpandedOnSearch) && node.parentNode !== NO_PARENT_NODE) {
  2093. node.parentNode.isExpandedOnSearch = true;
  2094. node.parentNode.hasMatchedDescendants = true;
  2095. }
  2096. });
  2097. done();
  2098. },
  2099. handleRemoteSearch: function handleRemoteSearch() {
  2100. var _this12 = this;
  2101. var searchQuery = this.trigger.searchQuery;
  2102. var entry = this.getRemoteSearchEntry();
  2103. var done = function done() {
  2104. _this12.initialize();
  2105. _this12.resetHighlightedOptionWhenNecessary(true);
  2106. };
  2107. if ((searchQuery === '' || this.cacheOptions) && entry.isLoaded) {
  2108. return done();
  2109. }
  2110. this.callLoadOptionsProp({
  2111. action: ASYNC_SEARCH,
  2112. args: {
  2113. searchQuery: searchQuery
  2114. },
  2115. isPending: function isPending() {
  2116. return entry.isLoading;
  2117. },
  2118. start: function start() {
  2119. entry.isLoading = true;
  2120. entry.isLoaded = false;
  2121. entry.loadingError = '';
  2122. },
  2123. succeed: function succeed(options) {
  2124. entry.isLoaded = true;
  2125. entry.options = options;
  2126. if (_this12.trigger.searchQuery === searchQuery) done();
  2127. },
  2128. fail: function fail(err) {
  2129. entry.loadingError = getErrorMessage(err);
  2130. },
  2131. end: function end() {
  2132. entry.isLoading = false;
  2133. }
  2134. });
  2135. },
  2136. getRemoteSearchEntry: function getRemoteSearchEntry() {
  2137. var _this13 = this;
  2138. var searchQuery = this.trigger.searchQuery;
  2139. var entry = this.remoteSearch[searchQuery] || _objectSpread({}, createAsyncOptionsStates(), {
  2140. options: []
  2141. });
  2142. this.$watch(function () {
  2143. return entry.options;
  2144. }, function () {
  2145. if (_this13.trigger.searchQuery === searchQuery) _this13.initialize();
  2146. }, {
  2147. deep: true
  2148. });
  2149. if (searchQuery === '') {
  2150. if (Array.isArray(this.defaultOptions)) {
  2151. entry.options = this.defaultOptions;
  2152. entry.isLoaded = true;
  2153. return entry;
  2154. } else if (this.defaultOptions !== true) {
  2155. entry.isLoaded = true;
  2156. return entry;
  2157. }
  2158. }
  2159. if (!this.remoteSearch[searchQuery]) {
  2160. this.$set(this.remoteSearch, searchQuery, entry);
  2161. }
  2162. return entry;
  2163. },
  2164. shouldExpand: function shouldExpand(node) {
  2165. return this.localSearch.active ? node.isExpandedOnSearch : node.isExpanded;
  2166. },
  2167. shouldOptionBeIncludedInSearchResult: function shouldOptionBeIncludedInSearchResult(node) {
  2168. if (node.isMatched) return true;
  2169. if (node.isBranch && node.hasMatchedDescendants && !this.flattenSearchResults) return true;
  2170. if (!node.isRootNode && node.parentNode.showAllChildrenOnSearch) return true;
  2171. return false;
  2172. },
  2173. shouldShowOptionInMenu: function shouldShowOptionInMenu(node) {
  2174. if (this.localSearch.active && !this.shouldOptionBeIncludedInSearchResult(node)) {
  2175. return false;
  2176. }
  2177. return true;
  2178. },
  2179. getControl: function getControl() {
  2180. return this.$refs.control.$el;
  2181. },
  2182. getMenu: function getMenu() {
  2183. var ref = this.appendToBody ? this.$refs.portal.portalTarget : this;
  2184. var $menu = ref.$refs.menu.$refs.menu;
  2185. return $menu && $menu.nodeName !== '#comment' ? $menu : null;
  2186. },
  2187. setCurrentHighlightedOption: function setCurrentHighlightedOption(node) {
  2188. var _this14 = this;
  2189. var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  2190. var prev = this.menu.current;
  2191. if (prev != null && prev in this.forest.nodeMap) {
  2192. this.forest.nodeMap[prev].isHighlighted = false;
  2193. }
  2194. this.menu.current = node.id;
  2195. node.isHighlighted = true;
  2196. if (this.menu.isOpen && scroll) {
  2197. var scrollToOption = function scrollToOption() {
  2198. var $menu = _this14.getMenu();
  2199. var $option = $menu.querySelector(".vue-treeselect__option[data-id=\"".concat(node.id, "\"]"));
  2200. if ($option) scrollIntoView($menu, $option);
  2201. };
  2202. if (this.getMenu()) {
  2203. scrollToOption();
  2204. } else {
  2205. this.$nextTick(scrollToOption);
  2206. }
  2207. }
  2208. },
  2209. resetHighlightedOptionWhenNecessary: function resetHighlightedOptionWhenNecessary() {
  2210. var forceReset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  2211. var current = this.menu.current;
  2212. if (forceReset || current == null || !(current in this.forest.nodeMap) || !this.shouldShowOptionInMenu(this.getNode(current))) {
  2213. this.highlightFirstOption();
  2214. }
  2215. },
  2216. highlightFirstOption: function highlightFirstOption() {
  2217. if (!this.hasVisibleOptions) return;
  2218. var first = this.visibleOptionIds[0];
  2219. this.setCurrentHighlightedOption(this.getNode(first));
  2220. },
  2221. highlightPrevOption: function highlightPrevOption() {
  2222. if (!this.hasVisibleOptions) return;
  2223. var prev = this.visibleOptionIds.indexOf(this.menu.current) - 1;
  2224. if (prev === -1) return this.highlightLastOption();
  2225. this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[prev]));
  2226. },
  2227. highlightNextOption: function highlightNextOption() {
  2228. if (!this.hasVisibleOptions) return;
  2229. var next = this.visibleOptionIds.indexOf(this.menu.current) + 1;
  2230. if (next === this.visibleOptionIds.length) return this.highlightFirstOption();
  2231. this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[next]));
  2232. },
  2233. highlightLastOption: function highlightLastOption() {
  2234. if (!this.hasVisibleOptions) return;
  2235. var last = last_default()(this.visibleOptionIds);
  2236. this.setCurrentHighlightedOption(this.getNode(last));
  2237. },
  2238. resetSearchQuery: function resetSearchQuery() {
  2239. this.trigger.searchQuery = '';
  2240. },
  2241. closeMenu: function closeMenu() {
  2242. if (!this.menu.isOpen || !this.disabled && this.alwaysOpen) return;
  2243. this.saveMenuScrollPosition();
  2244. this.menu.isOpen = false;
  2245. this.toggleClickOutsideEvent(false);
  2246. this.resetSearchQuery();
  2247. this.$emit('close', this.getValue(), this.getInstanceId());
  2248. },
  2249. openMenu: function openMenu() {
  2250. if (this.disabled || this.menu.isOpen) return;
  2251. this.menu.isOpen = true;
  2252. this.$nextTick(this.resetHighlightedOptionWhenNecessary);
  2253. this.$nextTick(this.restoreMenuScrollPosition);
  2254. if (!this.options && !this.async) this.loadRootOptions();
  2255. this.toggleClickOutsideEvent(true);
  2256. this.$emit('open', this.getInstanceId());
  2257. },
  2258. toggleMenu: function toggleMenu() {
  2259. if (this.menu.isOpen) {
  2260. this.closeMenu();
  2261. } else {
  2262. this.openMenu();
  2263. }
  2264. },
  2265. toggleExpanded: function toggleExpanded(node) {
  2266. var nextState;
  2267. if (this.localSearch.active) {
  2268. nextState = node.isExpandedOnSearch = !node.isExpandedOnSearch;
  2269. if (nextState) node.showAllChildrenOnSearch = true;
  2270. } else {
  2271. nextState = node.isExpanded = !node.isExpanded;
  2272. }
  2273. if (nextState && !node.childrenStates.isLoaded) {
  2274. this.loadChildrenOptions(node);
  2275. }
  2276. },
  2277. buildForestState: function buildForestState() {
  2278. var _this15 = this;
  2279. var selectedNodeMap = createMap();
  2280. this.forest.selectedNodeIds.forEach(function (selectedNodeId) {
  2281. selectedNodeMap[selectedNodeId] = true;
  2282. });
  2283. this.forest.selectedNodeMap = selectedNodeMap;
  2284. var checkedStateMap = createMap();
  2285. if (this.multiple) {
  2286. this.traverseAllNodesByIndex(function (node) {
  2287. checkedStateMap[node.id] = UNCHECKED;
  2288. });
  2289. this.selectedNodes.forEach(function (selectedNode) {
  2290. checkedStateMap[selectedNode.id] = CHECKED;
  2291. if (!_this15.flat && !_this15.disableBranchNodes) {
  2292. selectedNode.ancestors.forEach(function (ancestorNode) {
  2293. if (!_this15.isSelected(ancestorNode)) {
  2294. checkedStateMap[ancestorNode.id] = INDETERMINATE;
  2295. }
  2296. });
  2297. }
  2298. });
  2299. }
  2300. this.forest.checkedStateMap = checkedStateMap;
  2301. },
  2302. enhancedNormalizer: function enhancedNormalizer(raw) {
  2303. return _objectSpread({}, raw, {}, this.normalizer(raw, this.getInstanceId()));
  2304. },
  2305. normalize: function normalize(parentNode, nodes, prevNodeMap) {
  2306. var _this16 = this;
  2307. var normalizedOptions = nodes.map(function (node) {
  2308. return [_this16.enhancedNormalizer(node), node];
  2309. }).map(function (_ref, index) {
  2310. var _ref2 = slicedToArray_default()(_ref, 2),
  2311. node = _ref2[0],
  2312. raw = _ref2[1];
  2313. _this16.checkDuplication(node);
  2314. _this16.verifyNodeShape(node);
  2315. var id = node.id,
  2316. label = node.label,
  2317. children = node.children,
  2318. isDefaultExpanded = node.isDefaultExpanded;
  2319. var isRootNode = parentNode === NO_PARENT_NODE;
  2320. var level = isRootNode ? 0 : parentNode.level + 1;
  2321. var isBranch = Array.isArray(children) || children === null;
  2322. var isLeaf = !isBranch;
  2323. var isDisabled = !!node.isDisabled || !_this16.flat && !isRootNode && parentNode.isDisabled;
  2324. var isNew = !!node.isNew;
  2325. var lowerCased = _this16.matchKeys.reduce(function (prev, key) {
  2326. return _objectSpread({}, prev, defineProperty_default()({}, key, stringifyOptionPropValue(node[key]).toLocaleLowerCase()));
  2327. }, {});
  2328. var nestedSearchLabel = isRootNode ? lowerCased.label : parentNode.nestedSearchLabel + ' ' + lowerCased.label;
  2329. var normalized = _this16.$set(_this16.forest.nodeMap, id, createMap());
  2330. _this16.$set(normalized, 'id', id);
  2331. _this16.$set(normalized, 'label', label);
  2332. _this16.$set(normalized, 'level', level);
  2333. _this16.$set(normalized, 'ancestors', isRootNode ? [] : [parentNode].concat(parentNode.ancestors));
  2334. _this16.$set(normalized, 'index', (isRootNode ? [] : parentNode.index).concat(index));
  2335. _this16.$set(normalized, 'parentNode', parentNode);
  2336. _this16.$set(normalized, 'lowerCased', lowerCased);
  2337. _this16.$set(normalized, 'nestedSearchLabel', nestedSearchLabel);
  2338. _this16.$set(normalized, 'isDisabled', isDisabled);
  2339. _this16.$set(normalized, 'isNew', isNew);
  2340. _this16.$set(normalized, 'isMatched', false);
  2341. _this16.$set(normalized, 'isHighlighted', false);
  2342. _this16.$set(normalized, 'isBranch', isBranch);
  2343. _this16.$set(normalized, 'isLeaf', isLeaf);
  2344. _this16.$set(normalized, 'isRootNode', isRootNode);
  2345. _this16.$set(normalized, 'raw', raw);
  2346. if (isBranch) {
  2347. var _this16$$set;
  2348. var isLoaded = Array.isArray(children);
  2349. _this16.$set(normalized, 'childrenStates', _objectSpread({}, createAsyncOptionsStates(), {
  2350. isLoaded: isLoaded
  2351. }));
  2352. _this16.$set(normalized, 'isExpanded', typeof isDefaultExpanded === 'boolean' ? isDefaultExpanded : level < _this16.defaultExpandLevel);
  2353. _this16.$set(normalized, 'hasMatchedDescendants', false);
  2354. _this16.$set(normalized, 'hasDisabledDescendants', false);
  2355. _this16.$set(normalized, 'isExpandedOnSearch', false);
  2356. _this16.$set(normalized, 'showAllChildrenOnSearch', false);
  2357. _this16.$set(normalized, 'count', (_this16$$set = {}, defineProperty_default()(_this16$$set, ALL_CHILDREN, 0), defineProperty_default()(_this16$$set, ALL_DESCENDANTS, 0), defineProperty_default()(_this16$$set, LEAF_CHILDREN, 0), defineProperty_default()(_this16$$set, LEAF_DESCENDANTS, 0), _this16$$set));
  2358. _this16.$set(normalized, 'children', isLoaded ? _this16.normalize(normalized, children, prevNodeMap) : []);
  2359. if (isDefaultExpanded === true) normalized.ancestors.forEach(function (ancestor) {
  2360. ancestor.isExpanded = true;
  2361. });
  2362. if (!isLoaded && typeof _this16.loadOptions !== 'function') {
  2363. warning_warning(function () {
  2364. return false;
  2365. }, function () {
  2366. return 'Unloaded branch node detected. "loadOptions" prop is required to load its children.';
  2367. });
  2368. } else if (!isLoaded && normalized.isExpanded) {
  2369. _this16.loadChildrenOptions(normalized);
  2370. }
  2371. }
  2372. normalized.ancestors.forEach(function (ancestor) {
  2373. return ancestor.count[ALL_DESCENDANTS]++;
  2374. });
  2375. if (isLeaf) normalized.ancestors.forEach(function (ancestor) {
  2376. return ancestor.count[LEAF_DESCENDANTS]++;
  2377. });
  2378. if (!isRootNode) {
  2379. parentNode.count[ALL_CHILDREN] += 1;
  2380. if (isLeaf) parentNode.count[LEAF_CHILDREN] += 1;
  2381. if (isDisabled) parentNode.hasDisabledDescendants = true;
  2382. }
  2383. if (prevNodeMap && prevNodeMap[id]) {
  2384. var prev = prevNodeMap[id];
  2385. normalized.isMatched = prev.isMatched;
  2386. normalized.showAllChildrenOnSearch = prev.showAllChildrenOnSearch;
  2387. normalized.isHighlighted = prev.isHighlighted;
  2388. if (prev.isBranch && normalized.isBranch) {
  2389. normalized.isExpanded = prev.isExpanded;
  2390. normalized.isExpandedOnSearch = prev.isExpandedOnSearch;
  2391. if (prev.childrenStates.isLoaded && !normalized.childrenStates.isLoaded) {
  2392. normalized.isExpanded = false;
  2393. } else {
  2394. normalized.childrenStates = _objectSpread({}, prev.childrenStates);
  2395. }
  2396. }
  2397. }
  2398. return normalized;
  2399. });
  2400. if (this.branchNodesFirst) {
  2401. var branchNodes = normalizedOptions.filter(function (option) {
  2402. return option.isBranch;
  2403. });
  2404. var leafNodes = normalizedOptions.filter(function (option) {
  2405. return option.isLeaf;
  2406. });
  2407. normalizedOptions = branchNodes.concat(leafNodes);
  2408. }
  2409. return normalizedOptions;
  2410. },
  2411. loadRootOptions: function loadRootOptions() {
  2412. var _this17 = this;
  2413. this.callLoadOptionsProp({
  2414. action: LOAD_ROOT_OPTIONS,
  2415. isPending: function isPending() {
  2416. return _this17.rootOptionsStates.isLoading;
  2417. },
  2418. start: function start() {
  2419. _this17.rootOptionsStates.isLoading = true;
  2420. _this17.rootOptionsStates.loadingError = '';
  2421. },
  2422. succeed: function succeed() {
  2423. _this17.rootOptionsStates.isLoaded = true;
  2424. _this17.$nextTick(function () {
  2425. _this17.resetHighlightedOptionWhenNecessary(true);
  2426. });
  2427. },
  2428. fail: function fail(err) {
  2429. _this17.rootOptionsStates.loadingError = getErrorMessage(err);
  2430. },
  2431. end: function end() {
  2432. _this17.rootOptionsStates.isLoading = false;
  2433. }
  2434. });
  2435. },
  2436. loadChildrenOptions: function loadChildrenOptions(parentNode) {
  2437. var _this18 = this;
  2438. var id = parentNode.id,
  2439. raw = parentNode.raw;
  2440. this.callLoadOptionsProp({
  2441. action: LOAD_CHILDREN_OPTIONS,
  2442. args: {
  2443. parentNode: raw
  2444. },
  2445. isPending: function isPending() {
  2446. return _this18.getNode(id).childrenStates.isLoading;
  2447. },
  2448. start: function start() {
  2449. _this18.getNode(id).childrenStates.isLoading = true;
  2450. _this18.getNode(id).childrenStates.loadingError = '';
  2451. },
  2452. succeed: function succeed() {
  2453. _this18.getNode(id).childrenStates.isLoaded = true;
  2454. },
  2455. fail: function fail(err) {
  2456. _this18.getNode(id).childrenStates.loadingError = getErrorMessage(err);
  2457. },
  2458. end: function end() {
  2459. _this18.getNode(id).childrenStates.isLoading = false;
  2460. }
  2461. });
  2462. },
  2463. callLoadOptionsProp: function callLoadOptionsProp(_ref3) {
  2464. var action = _ref3.action,
  2465. args = _ref3.args,
  2466. isPending = _ref3.isPending,
  2467. start = _ref3.start,
  2468. succeed = _ref3.succeed,
  2469. fail = _ref3.fail,
  2470. end = _ref3.end;
  2471. if (!this.loadOptions || isPending()) {
  2472. return;
  2473. }
  2474. start();
  2475. var callback = once_default()(function (err, result) {
  2476. if (err) {
  2477. fail(err);
  2478. } else {
  2479. succeed(result);
  2480. }
  2481. end();
  2482. });
  2483. var result = this.loadOptions(_objectSpread({
  2484. id: this.getInstanceId(),
  2485. instanceId: this.getInstanceId(),
  2486. action: action
  2487. }, args, {
  2488. callback: callback
  2489. }));
  2490. if (is_promise_default()(result)) {
  2491. result.then(function () {
  2492. callback();
  2493. }, function (err) {
  2494. callback(err);
  2495. }).catch(function (err) {
  2496. console.error(err);
  2497. });
  2498. }
  2499. },
  2500. checkDuplication: function checkDuplication(node) {
  2501. var _this19 = this;
  2502. warning_warning(function () {
  2503. return !(node.id in _this19.forest.nodeMap && !_this19.forest.nodeMap[node.id].isFallbackNode);
  2504. }, function () {
  2505. return "Detected duplicate presence of node id ".concat(JSON.stringify(node.id), ". ") + "Their labels are \"".concat(_this19.forest.nodeMap[node.id].label, "\" and \"").concat(node.label, "\" respectively.");
  2506. });
  2507. },
  2508. verifyNodeShape: function verifyNodeShape(node) {
  2509. warning_warning(function () {
  2510. return !(node.children === undefined && node.isBranch === true);
  2511. }, function () {
  2512. return 'Are you meant to declare an unloaded branch node? ' + '`isBranch: true` is no longer supported, please use `children: null` instead.';
  2513. });
  2514. },
  2515. select: function select(node) {
  2516. if (this.disabled || node.isDisabled) {
  2517. return;
  2518. }
  2519. if (this.single) {
  2520. this.clear();
  2521. }
  2522. var nextState = this.multiple && !this.flat ? this.forest.checkedStateMap[node.id] === UNCHECKED : !this.isSelected(node);
  2523. if (nextState) {
  2524. this._selectNode(node);
  2525. } else {
  2526. this._deselectNode(node);
  2527. }
  2528. this.buildForestState();
  2529. if (nextState) {
  2530. this.$emit('select', node.raw, this.getInstanceId());
  2531. } else {
  2532. this.$emit('deselect', node.raw, this.getInstanceId());
  2533. }
  2534. if (this.localSearch.active && nextState && (this.single || this.clearOnSelect)) {
  2535. this.resetSearchQuery();
  2536. }
  2537. if (this.single && this.closeOnSelect) {
  2538. this.closeMenu();
  2539. if (this.searchable) {
  2540. this._blurOnSelect = true;
  2541. }
  2542. }
  2543. },
  2544. clear: function clear() {
  2545. var _this20 = this;
  2546. if (this.hasValue) {
  2547. if (this.single || this.allowClearingDisabled) {
  2548. this.forest.selectedNodeIds = [];
  2549. } else {
  2550. this.forest.selectedNodeIds = this.forest.selectedNodeIds.filter(function (nodeId) {
  2551. return _this20.getNode(nodeId).isDisabled;
  2552. });
  2553. }
  2554. this.buildForestState();
  2555. }
  2556. },
  2557. _selectNode: function _selectNode(node) {
  2558. var _this21 = this;
  2559. if (this.single || this.disableBranchNodes) {
  2560. return this.addValue(node);
  2561. }
  2562. if (this.flat) {
  2563. this.addValue(node);
  2564. if (this.autoSelectAncestors) {
  2565. node.ancestors.forEach(function (ancestor) {
  2566. if (!_this21.isSelected(ancestor) && !ancestor.isDisabled) _this21.addValue(ancestor);
  2567. });
  2568. } else if (this.autoSelectDescendants) {
  2569. this.traverseDescendantsBFS(node, function (descendant) {
  2570. if (!_this21.isSelected(descendant) && !descendant.isDisabled) _this21.addValue(descendant);
  2571. });
  2572. }
  2573. return;
  2574. }
  2575. var isFullyChecked = node.isLeaf || !node.hasDisabledDescendants || this.allowSelectingDisabledDescendants;
  2576. if (isFullyChecked) {
  2577. this.addValue(node);
  2578. }
  2579. if (node.isBranch) {
  2580. this.traverseDescendantsBFS(node, function (descendant) {
  2581. if (!descendant.isDisabled || _this21.allowSelectingDisabledDescendants) {
  2582. _this21.addValue(descendant);
  2583. }
  2584. });
  2585. }
  2586. if (isFullyChecked) {
  2587. var curr = node;
  2588. while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
  2589. if (curr.children.every(this.isSelected)) this.addValue(curr);else break;
  2590. }
  2591. }
  2592. },
  2593. _deselectNode: function _deselectNode(node) {
  2594. var _this22 = this;
  2595. if (this.disableBranchNodes) {
  2596. return this.removeValue(node);
  2597. }
  2598. if (this.flat) {
  2599. this.removeValue(node);
  2600. if (this.autoDeselectAncestors) {
  2601. node.ancestors.forEach(function (ancestor) {
  2602. if (_this22.isSelected(ancestor) && !ancestor.isDisabled) _this22.removeValue(ancestor);
  2603. });
  2604. } else if (this.autoDeselectDescendants) {
  2605. this.traverseDescendantsBFS(node, function (descendant) {
  2606. if (_this22.isSelected(descendant) && !descendant.isDisabled) _this22.removeValue(descendant);
  2607. });
  2608. }
  2609. return;
  2610. }
  2611. var hasUncheckedSomeDescendants = false;
  2612. if (node.isBranch) {
  2613. this.traverseDescendantsDFS(node, function (descendant) {
  2614. if (!descendant.isDisabled || _this22.allowSelectingDisabledDescendants) {
  2615. _this22.removeValue(descendant);
  2616. hasUncheckedSomeDescendants = true;
  2617. }
  2618. });
  2619. }
  2620. if (node.isLeaf || hasUncheckedSomeDescendants || node.children.length === 0) {
  2621. this.removeValue(node);
  2622. var curr = node;
  2623. while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
  2624. if (this.isSelected(curr)) this.removeValue(curr);else break;
  2625. }
  2626. }
  2627. },
  2628. addValue: function addValue(node) {
  2629. this.forest.selectedNodeIds.push(node.id);
  2630. this.forest.selectedNodeMap[node.id] = true;
  2631. },
  2632. removeValue: function removeValue(node) {
  2633. removeFromArray(this.forest.selectedNodeIds, node.id);
  2634. delete this.forest.selectedNodeMap[node.id];
  2635. },
  2636. removeLastValue: function removeLastValue() {
  2637. if (!this.hasValue) return;
  2638. if (this.single) return this.clear();
  2639. var lastValue = last_default()(this.internalValue);
  2640. var lastSelectedNode = this.getNode(lastValue);
  2641. this.select(lastSelectedNode);
  2642. },
  2643. saveMenuScrollPosition: function saveMenuScrollPosition() {
  2644. var $menu = this.getMenu();
  2645. if ($menu) this.menu.lastScrollPosition = $menu.scrollTop;
  2646. },
  2647. restoreMenuScrollPosition: function restoreMenuScrollPosition() {
  2648. var $menu = this.getMenu();
  2649. if ($menu) $menu.scrollTop = this.menu.lastScrollPosition;
  2650. }
  2651. },
  2652. created: function created() {
  2653. this.verifyProps();
  2654. this.resetFlags();
  2655. },
  2656. mounted: function mounted() {
  2657. if (this.autoFocus) this.focusInput();
  2658. if (!this.options && !this.async && this.autoLoadRootOptions) this.loadRootOptions();
  2659. if (this.alwaysOpen) this.openMenu();
  2660. if (this.async && this.defaultOptions) this.handleRemoteSearch();
  2661. },
  2662. destroyed: function destroyed() {
  2663. this.toggleClickOutsideEvent(false);
  2664. }
  2665. });
  2666. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HiddenFields.vue?vue&type=script&lang=js&
  2667. function stringifyValue(value) {
  2668. if (typeof value === 'string') return value;
  2669. if (value != null && !isNaN_isNaN(value)) return JSON.stringify(value);
  2670. return '';
  2671. }
  2672. /* harmony default export */ var HiddenFieldsvue_type_script_lang_js_ = ({
  2673. name: 'vue-treeselect--hidden-fields',
  2674. inject: ['instance'],
  2675. functional: true,
  2676. render: function render(_, context) {
  2677. var h = arguments[0];
  2678. var instance = context.injections.instance;
  2679. if (!instance.name || instance.disabled || !instance.hasValue) return null;
  2680. var stringifiedValues = instance.internalValue.map(stringifyValue);
  2681. if (instance.multiple && instance.joinValues) stringifiedValues = [stringifiedValues.join(instance.delimiter)];
  2682. return stringifiedValues.map(function (stringifiedValue, i) {
  2683. return h("input", {
  2684. attrs: {
  2685. type: "hidden",
  2686. name: instance.name
  2687. },
  2688. domProps: {
  2689. "value": stringifiedValue
  2690. },
  2691. key: 'hidden-field-' + i
  2692. });
  2693. });
  2694. }
  2695. });
  2696. // CONCATENATED MODULE: ./src/components/HiddenFields.vue?vue&type=script&lang=js&
  2697. /* harmony default export */ var components_HiddenFieldsvue_type_script_lang_js_ = (HiddenFieldsvue_type_script_lang_js_);
  2698. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2699. /* globals __VUE_SSR_CONTEXT__ */
  2700. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2701. // This module is a runtime utility for cleaner component module output and will
  2702. // be included in the final webpack user bundle.
  2703. function normalizeComponent (
  2704. scriptExports,
  2705. render,
  2706. staticRenderFns,
  2707. functionalTemplate,
  2708. injectStyles,
  2709. scopeId,
  2710. moduleIdentifier, /* server only */
  2711. shadowMode /* vue-cli only */
  2712. ) {
  2713. // Vue.extend constructor export interop
  2714. var options = typeof scriptExports === 'function'
  2715. ? scriptExports.options
  2716. : scriptExports
  2717. // render functions
  2718. if (render) {
  2719. options.render = render
  2720. options.staticRenderFns = staticRenderFns
  2721. options._compiled = true
  2722. }
  2723. // functional template
  2724. if (functionalTemplate) {
  2725. options.functional = true
  2726. }
  2727. // scopedId
  2728. if (scopeId) {
  2729. options._scopeId = 'data-v-' + scopeId
  2730. }
  2731. var hook
  2732. if (moduleIdentifier) { // server build
  2733. hook = function (context) {
  2734. // 2.3 injection
  2735. context =
  2736. context || // cached call
  2737. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2738. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2739. // 2.2 with runInNewContext: true
  2740. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2741. context = __VUE_SSR_CONTEXT__
  2742. }
  2743. // inject component styles
  2744. if (injectStyles) {
  2745. injectStyles.call(this, context)
  2746. }
  2747. // register component module identifier for async chunk inferrence
  2748. if (context && context._registeredComponents) {
  2749. context._registeredComponents.add(moduleIdentifier)
  2750. }
  2751. }
  2752. // used by ssr in case component is cached and beforeCreate
  2753. // never gets called
  2754. options._ssrRegister = hook
  2755. } else if (injectStyles) {
  2756. hook = shadowMode
  2757. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2758. : injectStyles
  2759. }
  2760. if (hook) {
  2761. if (options.functional) {
  2762. // for template-only hot-reload because in that case the render fn doesn't
  2763. // go through the normalizer
  2764. options._injectStyles = hook
  2765. // register for functioal component in vue file
  2766. var originalRender = options.render
  2767. options.render = function renderWithStyleInjection (h, context) {
  2768. hook.call(context)
  2769. return originalRender(h, context)
  2770. }
  2771. } else {
  2772. // inject component registration as beforeCreate hook
  2773. var existing = options.beforeCreate
  2774. options.beforeCreate = existing
  2775. ? [].concat(existing, hook)
  2776. : [hook]
  2777. }
  2778. }
  2779. return {
  2780. exports: scriptExports,
  2781. options: options
  2782. }
  2783. }
  2784. // CONCATENATED MODULE: ./src/components/HiddenFields.vue
  2785. var HiddenFields_render, staticRenderFns
  2786. /* normalize component */
  2787. var component = normalizeComponent(
  2788. components_HiddenFieldsvue_type_script_lang_js_,
  2789. HiddenFields_render,
  2790. staticRenderFns,
  2791. false,
  2792. null,
  2793. null,
  2794. null
  2795. )
  2796. /* hot reload */
  2797. if (false) { var api; }
  2798. component.options.__file = "src/components/HiddenFields.vue"
  2799. /* harmony default export */ var HiddenFields = (component.exports);
  2800. // EXTERNAL MODULE: ./node_modules/babel-helper-vue-jsx-merge-props/index.js
  2801. var babel_helper_vue_jsx_merge_props = __webpack_require__(33);
  2802. var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props);
  2803. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Input.vue?vue&type=script&lang=js&
  2804. var keysThatRequireMenuBeingOpen = [KEY_CODES.ENTER, KEY_CODES.END, KEY_CODES.HOME, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN];
  2805. /* harmony default export */ var Inputvue_type_script_lang_js_ = ({
  2806. name: 'vue-treeselect--input',
  2807. inject: ['instance'],
  2808. data: function data() {
  2809. return {
  2810. inputWidth: MIN_INPUT_WIDTH,
  2811. value: ''
  2812. };
  2813. },
  2814. computed: {
  2815. needAutoSize: function needAutoSize() {
  2816. var instance = this.instance;
  2817. return instance.searchable && !instance.disabled && instance.multiple;
  2818. },
  2819. inputStyle: function inputStyle() {
  2820. return {
  2821. width: this.needAutoSize ? "".concat(this.inputWidth, "px") : null
  2822. };
  2823. }
  2824. },
  2825. watch: {
  2826. 'instance.trigger.searchQuery': function instanceTriggerSearchQuery(newValue) {
  2827. this.value = newValue;
  2828. },
  2829. value: function value() {
  2830. if (this.needAutoSize) this.$nextTick(this.updateInputWidth);
  2831. }
  2832. },
  2833. created: function created() {
  2834. this.debouncedCallback = debounce_default()(this.updateSearchQuery, INPUT_DEBOUNCE_DELAY, {
  2835. leading: true,
  2836. trailing: true
  2837. });
  2838. },
  2839. methods: {
  2840. clear: function clear() {
  2841. this.onInput({
  2842. target: {
  2843. value: ''
  2844. }
  2845. });
  2846. },
  2847. focus: function focus() {
  2848. var instance = this.instance;
  2849. if (!instance.disabled) {
  2850. this.$refs.input && this.$refs.input.focus();
  2851. }
  2852. },
  2853. blur: function blur() {
  2854. this.$refs.input && this.$refs.input.blur();
  2855. },
  2856. onFocus: function onFocus() {
  2857. var instance = this.instance;
  2858. instance.trigger.isFocused = true;
  2859. if (instance.openOnFocus) instance.openMenu();
  2860. },
  2861. onBlur: function onBlur() {
  2862. var instance = this.instance;
  2863. var menu = instance.getMenu();
  2864. if (menu && document.activeElement === menu) {
  2865. return this.focus();
  2866. }
  2867. instance.trigger.isFocused = false;
  2868. instance.closeMenu();
  2869. },
  2870. onInput: function onInput(evt) {
  2871. var value = evt.target.value;
  2872. this.value = value;
  2873. if (value) {
  2874. this.debouncedCallback();
  2875. } else {
  2876. this.debouncedCallback.cancel();
  2877. this.updateSearchQuery();
  2878. }
  2879. },
  2880. onKeyDown: function onKeyDown(evt) {
  2881. var instance = this.instance;
  2882. var key = 'which' in evt ? evt.which : evt.keyCode;
  2883. if (evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) return;
  2884. if (!instance.menu.isOpen && includes(keysThatRequireMenuBeingOpen, key)) {
  2885. evt.preventDefault();
  2886. return instance.openMenu();
  2887. }
  2888. switch (key) {
  2889. case KEY_CODES.BACKSPACE:
  2890. {
  2891. if (instance.backspaceRemoves && !this.value.length) {
  2892. instance.removeLastValue();
  2893. }
  2894. break;
  2895. }
  2896. case KEY_CODES.ENTER:
  2897. {
  2898. evt.preventDefault();
  2899. if (instance.menu.current === null) return;
  2900. var current = instance.getNode(instance.menu.current);
  2901. if (current.isBranch && instance.disableBranchNodes) return;
  2902. instance.select(current);
  2903. break;
  2904. }
  2905. case KEY_CODES.ESCAPE:
  2906. {
  2907. if (this.value.length) {
  2908. this.clear();
  2909. } else if (instance.menu.isOpen) {
  2910. instance.closeMenu();
  2911. }
  2912. break;
  2913. }
  2914. case KEY_CODES.END:
  2915. {
  2916. evt.preventDefault();
  2917. instance.highlightLastOption();
  2918. break;
  2919. }
  2920. case KEY_CODES.HOME:
  2921. {
  2922. evt.preventDefault();
  2923. instance.highlightFirstOption();
  2924. break;
  2925. }
  2926. case KEY_CODES.ARROW_LEFT:
  2927. {
  2928. var _current = instance.getNode(instance.menu.current);
  2929. if (_current.isBranch && instance.shouldExpand(_current)) {
  2930. evt.preventDefault();
  2931. instance.toggleExpanded(_current);
  2932. } else if (!_current.isRootNode && (_current.isLeaf || _current.isBranch && !instance.shouldExpand(_current))) {
  2933. evt.preventDefault();
  2934. instance.setCurrentHighlightedOption(_current.parentNode);
  2935. }
  2936. break;
  2937. }
  2938. case KEY_CODES.ARROW_UP:
  2939. {
  2940. evt.preventDefault();
  2941. instance.highlightPrevOption();
  2942. break;
  2943. }
  2944. case KEY_CODES.ARROW_RIGHT:
  2945. {
  2946. var _current2 = instance.getNode(instance.menu.current);
  2947. if (_current2.isBranch && !instance.shouldExpand(_current2)) {
  2948. evt.preventDefault();
  2949. instance.toggleExpanded(_current2);
  2950. }
  2951. break;
  2952. }
  2953. case KEY_CODES.ARROW_DOWN:
  2954. {
  2955. evt.preventDefault();
  2956. instance.highlightNextOption();
  2957. break;
  2958. }
  2959. case KEY_CODES.DELETE:
  2960. {
  2961. if (instance.deleteRemoves && !this.value.length) {
  2962. instance.removeLastValue();
  2963. }
  2964. break;
  2965. }
  2966. default:
  2967. {
  2968. instance.openMenu();
  2969. }
  2970. }
  2971. },
  2972. onMouseDown: function onMouseDown(evt) {
  2973. if (this.value.length) {
  2974. evt.stopPropagation();
  2975. }
  2976. },
  2977. renderInputContainer: function renderInputContainer() {
  2978. var h = this.$createElement;
  2979. var instance = this.instance;
  2980. var props = {};
  2981. var children = [];
  2982. if (instance.searchable && !instance.disabled) {
  2983. children.push(this.renderInput());
  2984. if (this.needAutoSize) children.push(this.renderSizer());
  2985. }
  2986. if (!instance.searchable) {
  2987. deepExtend(props, {
  2988. on: {
  2989. focus: this.onFocus,
  2990. blur: this.onBlur,
  2991. keydown: this.onKeyDown
  2992. },
  2993. ref: 'input'
  2994. });
  2995. }
  2996. if (!instance.searchable && !instance.disabled) {
  2997. deepExtend(props, {
  2998. attrs: {
  2999. tabIndex: instance.tabIndex
  3000. }
  3001. });
  3002. }
  3003. return h("div", babel_helper_vue_jsx_merge_props_default()([{
  3004. "class": "vue-treeselect__input-container"
  3005. }, props]), [children]);
  3006. },
  3007. renderInput: function renderInput() {
  3008. var h = this.$createElement;
  3009. var instance = this.instance;
  3010. return h("input", {
  3011. ref: "input",
  3012. "class": "vue-treeselect__input",
  3013. attrs: {
  3014. type: "text",
  3015. autocomplete: "off",
  3016. tabIndex: instance.tabIndex,
  3017. required: instance.required && !instance.hasValue
  3018. },
  3019. domProps: {
  3020. "value": this.value
  3021. },
  3022. style: this.inputStyle,
  3023. on: {
  3024. "focus": this.onFocus,
  3025. "input": this.onInput,
  3026. "blur": this.onBlur,
  3027. "keydown": this.onKeyDown,
  3028. "mousedown": this.onMouseDown
  3029. }
  3030. });
  3031. },
  3032. renderSizer: function renderSizer() {
  3033. var h = this.$createElement;
  3034. return h("div", {
  3035. ref: "sizer",
  3036. "class": "vue-treeselect__sizer"
  3037. }, [this.value]);
  3038. },
  3039. updateInputWidth: function updateInputWidth() {
  3040. this.inputWidth = Math.max(MIN_INPUT_WIDTH, this.$refs.sizer.scrollWidth + 15);
  3041. },
  3042. updateSearchQuery: function updateSearchQuery() {
  3043. var instance = this.instance;
  3044. instance.trigger.searchQuery = this.value;
  3045. }
  3046. },
  3047. render: function render() {
  3048. return this.renderInputContainer();
  3049. }
  3050. });
  3051. // CONCATENATED MODULE: ./src/components/Input.vue?vue&type=script&lang=js&
  3052. /* harmony default export */ var components_Inputvue_type_script_lang_js_ = (Inputvue_type_script_lang_js_);
  3053. // CONCATENATED MODULE: ./src/components/Input.vue
  3054. var Input_render, Input_staticRenderFns
  3055. /* normalize component */
  3056. var Input_component = normalizeComponent(
  3057. components_Inputvue_type_script_lang_js_,
  3058. Input_render,
  3059. Input_staticRenderFns,
  3060. false,
  3061. null,
  3062. null,
  3063. null
  3064. )
  3065. /* hot reload */
  3066. if (false) { var Input_api; }
  3067. Input_component.options.__file = "src/components/Input.vue"
  3068. /* harmony default export */ var Input = (Input_component.exports);
  3069. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Placeholder.vue?vue&type=script&lang=js&
  3070. /* harmony default export */ var Placeholdervue_type_script_lang_js_ = ({
  3071. name: 'vue-treeselect--placeholder',
  3072. inject: ['instance'],
  3073. render: function render() {
  3074. var h = arguments[0];
  3075. var instance = this.instance;
  3076. var placeholderClass = {
  3077. 'vue-treeselect__placeholder': true,
  3078. 'vue-treeselect-helper-zoom-effect-off': true,
  3079. 'vue-treeselect-helper-hide': instance.hasValue || instance.trigger.searchQuery
  3080. };
  3081. return h("div", {
  3082. "class": placeholderClass
  3083. }, [instance.placeholder]);
  3084. }
  3085. });
  3086. // CONCATENATED MODULE: ./src/components/Placeholder.vue?vue&type=script&lang=js&
  3087. /* harmony default export */ var components_Placeholdervue_type_script_lang_js_ = (Placeholdervue_type_script_lang_js_);
  3088. // CONCATENATED MODULE: ./src/components/Placeholder.vue
  3089. var Placeholder_render, Placeholder_staticRenderFns
  3090. /* normalize component */
  3091. var Placeholder_component = normalizeComponent(
  3092. components_Placeholdervue_type_script_lang_js_,
  3093. Placeholder_render,
  3094. Placeholder_staticRenderFns,
  3095. false,
  3096. null,
  3097. null,
  3098. null
  3099. )
  3100. /* hot reload */
  3101. if (false) { var Placeholder_api; }
  3102. Placeholder_component.options.__file = "src/components/Placeholder.vue"
  3103. /* harmony default export */ var Placeholder = (Placeholder_component.exports);
  3104. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SingleValue.vue?vue&type=script&lang=js&
  3105. /* harmony default export */ var SingleValuevue_type_script_lang_js_ = ({
  3106. name: 'vue-treeselect--single-value',
  3107. inject: ['instance'],
  3108. methods: {
  3109. renderSingleValueLabel: function renderSingleValueLabel() {
  3110. var instance = this.instance;
  3111. var node = instance.selectedNodes[0];
  3112. var customValueLabelRenderer = instance.$scopedSlots['value-label'];
  3113. return customValueLabelRenderer ? customValueLabelRenderer({
  3114. node: node
  3115. }) : node.label;
  3116. }
  3117. },
  3118. render: function render() {
  3119. var h = arguments[0];
  3120. var instance = this.instance,
  3121. renderValueContainer = this.$parent.renderValueContainer;
  3122. var shouldShowValue = instance.hasValue && !instance.trigger.searchQuery;
  3123. return renderValueContainer([shouldShowValue && h("div", {
  3124. "class": "vue-treeselect__single-value"
  3125. }, [this.renderSingleValueLabel()]), h(Placeholder), h(Input, {
  3126. ref: "input"
  3127. })]);
  3128. }
  3129. });
  3130. // CONCATENATED MODULE: ./src/components/SingleValue.vue?vue&type=script&lang=js&
  3131. /* harmony default export */ var components_SingleValuevue_type_script_lang_js_ = (SingleValuevue_type_script_lang_js_);
  3132. // CONCATENATED MODULE: ./src/components/SingleValue.vue
  3133. var SingleValue_render, SingleValue_staticRenderFns
  3134. /* normalize component */
  3135. var SingleValue_component = normalizeComponent(
  3136. components_SingleValuevue_type_script_lang_js_,
  3137. SingleValue_render,
  3138. SingleValue_staticRenderFns,
  3139. false,
  3140. null,
  3141. null,
  3142. null
  3143. )
  3144. /* hot reload */
  3145. if (false) { var SingleValue_api; }
  3146. SingleValue_component.options.__file = "src/components/SingleValue.vue"
  3147. /* harmony default export */ var SingleValue = (SingleValue_component.exports);
  3148. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Delete.vue?vue&type=template&id=364b6320&
  3149. var Deletevue_type_template_id_364b6320_render = function() {
  3150. var _vm = this
  3151. var _h = _vm.$createElement
  3152. var _c = _vm._self._c || _h
  3153. return _c(
  3154. "svg",
  3155. {
  3156. attrs: {
  3157. xmlns: "http://www.w3.org/2000/svg",
  3158. viewBox: "0 0 348.333 348.333"
  3159. }
  3160. },
  3161. [
  3162. _c("path", {
  3163. attrs: {
  3164. d:
  3165. "M336.559 68.611L231.016 174.165l105.543 105.549c15.699 15.705 15.699 41.145 0 56.85-7.844 7.844-18.128 11.769-28.407 11.769-10.296 0-20.581-3.919-28.419-11.769L174.167 231.003 68.609 336.563c-7.843 7.844-18.128 11.769-28.416 11.769-10.285 0-20.563-3.919-28.413-11.769-15.699-15.698-15.699-41.139 0-56.85l105.54-105.549L11.774 68.611c-15.699-15.699-15.699-41.145 0-56.844 15.696-15.687 41.127-15.687 56.829 0l105.563 105.554L279.721 11.767c15.705-15.687 41.139-15.687 56.832 0 15.705 15.699 15.705 41.145.006 56.844z"
  3166. }
  3167. })
  3168. ]
  3169. )
  3170. }
  3171. var Deletevue_type_template_id_364b6320_staticRenderFns = []
  3172. Deletevue_type_template_id_364b6320_render._withStripped = true
  3173. // CONCATENATED MODULE: ./src/components/icons/Delete.vue?vue&type=template&id=364b6320&
  3174. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Delete.vue?vue&type=script&lang=js&
  3175. /* harmony default export */ var Deletevue_type_script_lang_js_ = ({
  3176. name: 'vue-treeselect--x'
  3177. });
  3178. // CONCATENATED MODULE: ./src/components/icons/Delete.vue?vue&type=script&lang=js&
  3179. /* harmony default export */ var icons_Deletevue_type_script_lang_js_ = (Deletevue_type_script_lang_js_);
  3180. // CONCATENATED MODULE: ./src/components/icons/Delete.vue
  3181. /* normalize component */
  3182. var Delete_component = normalizeComponent(
  3183. icons_Deletevue_type_script_lang_js_,
  3184. Deletevue_type_template_id_364b6320_render,
  3185. Deletevue_type_template_id_364b6320_staticRenderFns,
  3186. false,
  3187. null,
  3188. null,
  3189. null
  3190. )
  3191. /* hot reload */
  3192. if (false) { var Delete_api; }
  3193. Delete_component.options.__file = "src/components/icons/Delete.vue"
  3194. /* harmony default export */ var Delete = (Delete_component.exports);
  3195. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiValueItem.vue?vue&type=script&lang=js&
  3196. /* harmony default export */ var MultiValueItemvue_type_script_lang_js_ = ({
  3197. name: 'vue-treeselect--multi-value-item',
  3198. inject: ['instance'],
  3199. props: {
  3200. node: {
  3201. type: Object,
  3202. required: true
  3203. }
  3204. },
  3205. methods: {
  3206. handleMouseDown: onLeftClick(function handleMouseDown() {
  3207. var instance = this.instance,
  3208. node = this.node;
  3209. instance.select(node);
  3210. })
  3211. },
  3212. render: function render() {
  3213. var h = arguments[0];
  3214. var instance = this.instance,
  3215. node = this.node;
  3216. var itemClass = {
  3217. 'vue-treeselect__multi-value-item': true,
  3218. 'vue-treeselect__multi-value-item-disabled': node.isDisabled,
  3219. 'vue-treeselect__multi-value-item-new': node.isNew
  3220. };
  3221. var customValueLabelRenderer = instance.$scopedSlots['value-label'];
  3222. var labelRenderer = customValueLabelRenderer ? customValueLabelRenderer({
  3223. node: node
  3224. }) : node.label;
  3225. return h("div", {
  3226. "class": "vue-treeselect__multi-value-item-container"
  3227. }, [h("div", {
  3228. "class": itemClass,
  3229. on: {
  3230. "mousedown": this.handleMouseDown
  3231. }
  3232. }, [h("span", {
  3233. "class": "vue-treeselect__multi-value-label"
  3234. }, [labelRenderer]), h("span", {
  3235. "class": "vue-treeselect__icon vue-treeselect__value-remove"
  3236. }, [h(Delete)])])]);
  3237. }
  3238. });
  3239. // CONCATENATED MODULE: ./src/components/MultiValueItem.vue?vue&type=script&lang=js&
  3240. /* harmony default export */ var components_MultiValueItemvue_type_script_lang_js_ = (MultiValueItemvue_type_script_lang_js_);
  3241. // CONCATENATED MODULE: ./src/components/MultiValueItem.vue
  3242. var MultiValueItem_render, MultiValueItem_staticRenderFns
  3243. /* normalize component */
  3244. var MultiValueItem_component = normalizeComponent(
  3245. components_MultiValueItemvue_type_script_lang_js_,
  3246. MultiValueItem_render,
  3247. MultiValueItem_staticRenderFns,
  3248. false,
  3249. null,
  3250. null,
  3251. null
  3252. )
  3253. /* hot reload */
  3254. if (false) { var MultiValueItem_api; }
  3255. MultiValueItem_component.options.__file = "src/components/MultiValueItem.vue"
  3256. /* harmony default export */ var MultiValueItem = (MultiValueItem_component.exports);
  3257. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiValue.vue?vue&type=script&lang=js&
  3258. /* harmony default export */ var MultiValuevue_type_script_lang_js_ = ({
  3259. name: 'vue-treeselect--multi-value',
  3260. inject: ['instance'],
  3261. methods: {
  3262. renderMultiValueItems: function renderMultiValueItems() {
  3263. var h = this.$createElement;
  3264. var instance = this.instance;
  3265. return instance.internalValue.slice(0, instance.limit).map(instance.getNode).map(function (node) {
  3266. return h(MultiValueItem, {
  3267. key: "multi-value-item-".concat(node.id),
  3268. attrs: {
  3269. node: node
  3270. }
  3271. });
  3272. });
  3273. },
  3274. renderExceedLimitTip: function renderExceedLimitTip() {
  3275. var h = this.$createElement;
  3276. var instance = this.instance;
  3277. var count = instance.internalValue.length - instance.limit;
  3278. if (count <= 0) return null;
  3279. return h("div", {
  3280. "class": "vue-treeselect__limit-tip vue-treeselect-helper-zoom-effect-off",
  3281. key: "exceed-limit-tip"
  3282. }, [h("span", {
  3283. "class": "vue-treeselect__limit-tip-text"
  3284. }, [instance.limitText(count)])]);
  3285. }
  3286. },
  3287. render: function render() {
  3288. var h = arguments[0];
  3289. var renderValueContainer = this.$parent.renderValueContainer;
  3290. var transitionGroupProps = {
  3291. props: {
  3292. tag: 'div',
  3293. name: 'vue-treeselect__multi-value-item--transition',
  3294. appear: true
  3295. }
  3296. };
  3297. return renderValueContainer(h("transition-group", babel_helper_vue_jsx_merge_props_default()([{
  3298. "class": "vue-treeselect__multi-value"
  3299. }, transitionGroupProps]), [this.renderMultiValueItems(), this.renderExceedLimitTip(), h(Placeholder, {
  3300. key: "placeholder"
  3301. }), h(Input, {
  3302. ref: "input",
  3303. key: "input"
  3304. })]));
  3305. }
  3306. });
  3307. // CONCATENATED MODULE: ./src/components/MultiValue.vue?vue&type=script&lang=js&
  3308. /* harmony default export */ var components_MultiValuevue_type_script_lang_js_ = (MultiValuevue_type_script_lang_js_);
  3309. // CONCATENATED MODULE: ./src/components/MultiValue.vue
  3310. var MultiValue_render, MultiValue_staticRenderFns
  3311. /* normalize component */
  3312. var MultiValue_component = normalizeComponent(
  3313. components_MultiValuevue_type_script_lang_js_,
  3314. MultiValue_render,
  3315. MultiValue_staticRenderFns,
  3316. false,
  3317. null,
  3318. null,
  3319. null
  3320. )
  3321. /* hot reload */
  3322. if (false) { var MultiValue_api; }
  3323. MultiValue_component.options.__file = "src/components/MultiValue.vue"
  3324. /* harmony default export */ var MultiValue = (MultiValue_component.exports);
  3325. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Arrow.vue?vue&type=template&id=11186cd4&
  3326. var Arrowvue_type_template_id_11186cd4_render = function() {
  3327. var _vm = this
  3328. var _h = _vm.$createElement
  3329. var _c = _vm._self._c || _h
  3330. return _c(
  3331. "svg",
  3332. {
  3333. attrs: {
  3334. xmlns: "http://www.w3.org/2000/svg",
  3335. viewBox: "0 0 292.362 292.362"
  3336. }
  3337. },
  3338. [
  3339. _c("path", {
  3340. attrs: {
  3341. d:
  3342. "M286.935 69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952 0-9.233 1.807-12.85 5.424C1.807 72.998 0 77.279 0 82.228c0 4.948 1.807 9.229 5.424 12.847l127.907 127.907c3.621 3.617 7.902 5.428 12.85 5.428s9.233-1.811 12.847-5.428L286.935 95.074c3.613-3.617 5.427-7.898 5.427-12.847 0-4.948-1.814-9.229-5.427-12.85z"
  3343. }
  3344. })
  3345. ]
  3346. )
  3347. }
  3348. var Arrowvue_type_template_id_11186cd4_staticRenderFns = []
  3349. Arrowvue_type_template_id_11186cd4_render._withStripped = true
  3350. // CONCATENATED MODULE: ./src/components/icons/Arrow.vue?vue&type=template&id=11186cd4&
  3351. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Arrow.vue?vue&type=script&lang=js&
  3352. /* harmony default export */ var Arrowvue_type_script_lang_js_ = ({
  3353. name: 'vue-treeselect--arrow'
  3354. });
  3355. // CONCATENATED MODULE: ./src/components/icons/Arrow.vue?vue&type=script&lang=js&
  3356. /* harmony default export */ var icons_Arrowvue_type_script_lang_js_ = (Arrowvue_type_script_lang_js_);
  3357. // CONCATENATED MODULE: ./src/components/icons/Arrow.vue
  3358. /* normalize component */
  3359. var Arrow_component = normalizeComponent(
  3360. icons_Arrowvue_type_script_lang_js_,
  3361. Arrowvue_type_template_id_11186cd4_render,
  3362. Arrowvue_type_template_id_11186cd4_staticRenderFns,
  3363. false,
  3364. null,
  3365. null,
  3366. null
  3367. )
  3368. /* hot reload */
  3369. if (false) { var Arrow_api; }
  3370. Arrow_component.options.__file = "src/components/icons/Arrow.vue"
  3371. /* harmony default export */ var Arrow = (Arrow_component.exports);
  3372. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Control.vue?vue&type=script&lang=js&
  3373. /* harmony default export */ var Controlvue_type_script_lang_js_ = ({
  3374. name: 'vue-treeselect--control',
  3375. inject: ['instance'],
  3376. computed: {
  3377. shouldShowX: function shouldShowX() {
  3378. var instance = this.instance;
  3379. return instance.clearable && !instance.disabled && instance.hasValue && (this.hasUndisabledValue || instance.allowClearingDisabled);
  3380. },
  3381. shouldShowArrow: function shouldShowArrow() {
  3382. var instance = this.instance;
  3383. if (!instance.alwaysOpen) return true;
  3384. return !instance.menu.isOpen;
  3385. },
  3386. hasUndisabledValue: function hasUndisabledValue() {
  3387. var instance = this.instance;
  3388. return instance.hasValue && instance.internalValue.some(function (id) {
  3389. return !instance.getNode(id).isDisabled;
  3390. });
  3391. }
  3392. },
  3393. methods: {
  3394. renderX: function renderX() {
  3395. var h = this.$createElement;
  3396. var instance = this.instance;
  3397. var title = instance.multiple ? instance.clearAllText : instance.clearValueText;
  3398. if (!this.shouldShowX) return null;
  3399. return h("div", {
  3400. "class": "vue-treeselect__x-container",
  3401. attrs: {
  3402. title: title
  3403. },
  3404. on: {
  3405. "mousedown": this.handleMouseDownOnX
  3406. }
  3407. }, [h(Delete, {
  3408. "class": "vue-treeselect__x"
  3409. })]);
  3410. },
  3411. renderArrow: function renderArrow() {
  3412. var h = this.$createElement;
  3413. var instance = this.instance;
  3414. var arrowClass = {
  3415. 'vue-treeselect__control-arrow': true,
  3416. 'vue-treeselect__control-arrow--rotated': instance.menu.isOpen
  3417. };
  3418. if (!this.shouldShowArrow) return null;
  3419. return h("div", {
  3420. "class": "vue-treeselect__control-arrow-container",
  3421. on: {
  3422. "mousedown": this.handleMouseDownOnArrow
  3423. }
  3424. }, [h(Arrow, {
  3425. "class": arrowClass
  3426. })]);
  3427. },
  3428. handleMouseDownOnX: onLeftClick(function handleMouseDownOnX(evt) {
  3429. evt.stopPropagation();
  3430. evt.preventDefault();
  3431. var instance = this.instance;
  3432. var result = instance.beforeClearAll();
  3433. var handler = function handler(shouldClear) {
  3434. if (shouldClear) instance.clear();
  3435. };
  3436. if (is_promise_default()(result)) {
  3437. result.then(handler);
  3438. } else {
  3439. setTimeout(function () {
  3440. return handler(result);
  3441. }, 0);
  3442. }
  3443. }),
  3444. handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnArrow(evt) {
  3445. evt.preventDefault();
  3446. evt.stopPropagation();
  3447. var instance = this.instance;
  3448. instance.focusInput();
  3449. instance.toggleMenu();
  3450. }),
  3451. renderValueContainer: function renderValueContainer(children) {
  3452. var h = this.$createElement;
  3453. return h("div", {
  3454. "class": "vue-treeselect__value-container"
  3455. }, [children]);
  3456. }
  3457. },
  3458. render: function render() {
  3459. var h = arguments[0];
  3460. var instance = this.instance;
  3461. var ValueContainer = instance.single ? SingleValue : MultiValue;
  3462. return h("div", {
  3463. "class": "vue-treeselect__control",
  3464. on: {
  3465. "mousedown": instance.handleMouseDown
  3466. }
  3467. }, [h(ValueContainer, {
  3468. ref: "value-container"
  3469. }), this.renderX(), this.renderArrow()]);
  3470. }
  3471. });
  3472. // CONCATENATED MODULE: ./src/components/Control.vue?vue&type=script&lang=js&
  3473. /* harmony default export */ var components_Controlvue_type_script_lang_js_ = (Controlvue_type_script_lang_js_);
  3474. // CONCATENATED MODULE: ./src/components/Control.vue
  3475. var Control_render, Control_staticRenderFns
  3476. /* normalize component */
  3477. var Control_component = normalizeComponent(
  3478. components_Controlvue_type_script_lang_js_,
  3479. Control_render,
  3480. Control_staticRenderFns,
  3481. false,
  3482. null,
  3483. null,
  3484. null
  3485. )
  3486. /* hot reload */
  3487. if (false) { var Control_api; }
  3488. Control_component.options.__file = "src/components/Control.vue"
  3489. /* harmony default export */ var Control = (Control_component.exports);
  3490. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tip.vue?vue&type=script&lang=js&
  3491. /* harmony default export */ var Tipvue_type_script_lang_js_ = ({
  3492. name: 'vue-treeselect--tip',
  3493. functional: true,
  3494. props: {
  3495. type: {
  3496. type: String,
  3497. required: true
  3498. },
  3499. icon: {
  3500. type: String,
  3501. required: true
  3502. }
  3503. },
  3504. render: function render(_, context) {
  3505. var h = arguments[0];
  3506. var props = context.props,
  3507. children = context.children;
  3508. return h("div", {
  3509. "class": "vue-treeselect__tip vue-treeselect__".concat(props.type, "-tip")
  3510. }, [h("div", {
  3511. "class": "vue-treeselect__icon-container"
  3512. }, [h("span", {
  3513. "class": "vue-treeselect__icon-".concat(props.icon)
  3514. })]), h("span", {
  3515. "class": "vue-treeselect__tip-text vue-treeselect__".concat(props.type, "-tip-text")
  3516. }, [children])]);
  3517. }
  3518. });
  3519. // CONCATENATED MODULE: ./src/components/Tip.vue?vue&type=script&lang=js&
  3520. /* harmony default export */ var components_Tipvue_type_script_lang_js_ = (Tipvue_type_script_lang_js_);
  3521. // CONCATENATED MODULE: ./src/components/Tip.vue
  3522. var Tip_render, Tip_staticRenderFns
  3523. /* normalize component */
  3524. var Tip_component = normalizeComponent(
  3525. components_Tipvue_type_script_lang_js_,
  3526. Tip_render,
  3527. Tip_staticRenderFns,
  3528. false,
  3529. null,
  3530. null,
  3531. null
  3532. )
  3533. /* hot reload */
  3534. if (false) { var Tip_api; }
  3535. Tip_component.options.__file = "src/components/Tip.vue"
  3536. /* harmony default export */ var Tip = (Tip_component.exports);
  3537. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Option.vue?vue&type=script&lang=js&
  3538. var arrowPlaceholder, checkMark, minusMark;
  3539. var Option = {
  3540. name: 'vue-treeselect--option',
  3541. inject: ['instance'],
  3542. props: {
  3543. node: {
  3544. type: Object,
  3545. required: true
  3546. }
  3547. },
  3548. computed: {
  3549. shouldExpand: function shouldExpand() {
  3550. var instance = this.instance,
  3551. node = this.node;
  3552. return node.isBranch && instance.shouldExpand(node);
  3553. },
  3554. shouldShow: function shouldShow() {
  3555. var instance = this.instance,
  3556. node = this.node;
  3557. return instance.shouldShowOptionInMenu(node);
  3558. }
  3559. },
  3560. methods: {
  3561. renderOption: function renderOption() {
  3562. var h = this.$createElement;
  3563. var instance = this.instance,
  3564. node = this.node;
  3565. var optionClass = {
  3566. 'vue-treeselect__option': true,
  3567. 'vue-treeselect__option--disabled': node.isDisabled,
  3568. 'vue-treeselect__option--selected': instance.isSelected(node),
  3569. 'vue-treeselect__option--highlight': node.isHighlighted,
  3570. 'vue-treeselect__option--matched': instance.localSearch.active && node.isMatched,
  3571. 'vue-treeselect__option--hide': !this.shouldShow
  3572. };
  3573. return h("div", {
  3574. "class": optionClass,
  3575. on: {
  3576. "mouseenter": this.handleMouseEnterOption
  3577. },
  3578. attrs: {
  3579. "data-id": node.id
  3580. }
  3581. }, [this.renderArrow(), this.renderLabelContainer([this.renderCheckboxContainer([this.renderCheckbox()]), this.renderLabel()])]);
  3582. },
  3583. renderSubOptionsList: function renderSubOptionsList() {
  3584. var h = this.$createElement;
  3585. if (!this.shouldExpand) return null;
  3586. return h("div", {
  3587. "class": "vue-treeselect__list"
  3588. }, [this.renderSubOptions(), this.renderNoChildrenTip(), this.renderLoadingChildrenTip(), this.renderLoadingChildrenErrorTip()]);
  3589. },
  3590. renderArrow: function renderArrow() {
  3591. var h = this.$createElement;
  3592. var instance = this.instance,
  3593. node = this.node;
  3594. if (instance.shouldFlattenOptions && this.shouldShow) return null;
  3595. if (node.isBranch) {
  3596. var transitionProps = {
  3597. props: {
  3598. name: 'vue-treeselect__option-arrow--prepare',
  3599. appear: true
  3600. }
  3601. };
  3602. var arrowClass = {
  3603. 'vue-treeselect__option-arrow': true,
  3604. 'vue-treeselect__option-arrow--rotated': this.shouldExpand
  3605. };
  3606. return h("div", {
  3607. "class": "vue-treeselect__option-arrow-container",
  3608. on: {
  3609. "mousedown": this.handleMouseDownOnArrow
  3610. }
  3611. }, [h("transition", transitionProps, [h(Arrow, {
  3612. "class": arrowClass
  3613. })])]);
  3614. }
  3615. if (instance.hasBranchNodes) {
  3616. if (!arrowPlaceholder) arrowPlaceholder = h("div", {
  3617. "class": "vue-treeselect__option-arrow-placeholder"
  3618. }, ["\xA0"]);
  3619. return arrowPlaceholder;
  3620. }
  3621. return null;
  3622. },
  3623. renderLabelContainer: function renderLabelContainer(children) {
  3624. var h = this.$createElement;
  3625. return h("div", {
  3626. "class": "vue-treeselect__label-container",
  3627. on: {
  3628. "mousedown": this.handleMouseDownOnLabelContainer
  3629. }
  3630. }, [children]);
  3631. },
  3632. renderCheckboxContainer: function renderCheckboxContainer(children) {
  3633. var h = this.$createElement;
  3634. var instance = this.instance,
  3635. node = this.node;
  3636. if (instance.single) return null;
  3637. if (instance.disableBranchNodes && node.isBranch) return null;
  3638. return h("div", {
  3639. "class": "vue-treeselect__checkbox-container"
  3640. }, [children]);
  3641. },
  3642. renderCheckbox: function renderCheckbox() {
  3643. var h = this.$createElement;
  3644. var instance = this.instance,
  3645. node = this.node;
  3646. var checkedState = instance.forest.checkedStateMap[node.id];
  3647. var checkboxClass = {
  3648. 'vue-treeselect__checkbox': true,
  3649. 'vue-treeselect__checkbox--checked': checkedState === CHECKED,
  3650. 'vue-treeselect__checkbox--indeterminate': checkedState === INDETERMINATE,
  3651. 'vue-treeselect__checkbox--unchecked': checkedState === UNCHECKED,
  3652. 'vue-treeselect__checkbox--disabled': node.isDisabled
  3653. };
  3654. if (!checkMark) checkMark = h("span", {
  3655. "class": "vue-treeselect__check-mark"
  3656. });
  3657. if (!minusMark) minusMark = h("span", {
  3658. "class": "vue-treeselect__minus-mark"
  3659. });
  3660. return h("span", {
  3661. "class": checkboxClass
  3662. }, [checkMark, minusMark]);
  3663. },
  3664. renderLabel: function renderLabel() {
  3665. var h = this.$createElement;
  3666. var instance = this.instance,
  3667. node = this.node;
  3668. var shouldShowCount = node.isBranch && (instance.localSearch.active ? instance.showCountOnSearchComputed : instance.showCount);
  3669. var count = shouldShowCount ? instance.localSearch.active ? instance.localSearch.countMap[node.id][instance.showCountOf] : node.count[instance.showCountOf] : NaN;
  3670. var labelClassName = 'vue-treeselect__label';
  3671. var countClassName = 'vue-treeselect__count';
  3672. var customLabelRenderer = instance.$scopedSlots['option-label'];
  3673. if (customLabelRenderer) return customLabelRenderer({
  3674. node: node,
  3675. shouldShowCount: shouldShowCount,
  3676. count: count,
  3677. labelClassName: labelClassName,
  3678. countClassName: countClassName
  3679. });
  3680. return h("label", {
  3681. "class": labelClassName
  3682. }, [node.label, shouldShowCount && h("span", {
  3683. "class": countClassName
  3684. }, ["(", count, ")"])]);
  3685. },
  3686. renderSubOptions: function renderSubOptions() {
  3687. var h = this.$createElement;
  3688. var node = this.node;
  3689. if (!node.childrenStates.isLoaded) return null;
  3690. return node.children.map(function (childNode) {
  3691. return h(Option, {
  3692. attrs: {
  3693. node: childNode
  3694. },
  3695. key: childNode.id
  3696. });
  3697. });
  3698. },
  3699. renderNoChildrenTip: function renderNoChildrenTip() {
  3700. var h = this.$createElement;
  3701. var instance = this.instance,
  3702. node = this.node;
  3703. if (!node.childrenStates.isLoaded || node.children.length) return null;
  3704. return h(Tip, {
  3705. attrs: {
  3706. type: "no-children",
  3707. icon: "warning"
  3708. }
  3709. }, [instance.noChildrenText]);
  3710. },
  3711. renderLoadingChildrenTip: function renderLoadingChildrenTip() {
  3712. var h = this.$createElement;
  3713. var instance = this.instance,
  3714. node = this.node;
  3715. if (!node.childrenStates.isLoading) return null;
  3716. return h(Tip, {
  3717. attrs: {
  3718. type: "loading",
  3719. icon: "loader"
  3720. }
  3721. }, [instance.loadingText]);
  3722. },
  3723. renderLoadingChildrenErrorTip: function renderLoadingChildrenErrorTip() {
  3724. var h = this.$createElement;
  3725. var instance = this.instance,
  3726. node = this.node;
  3727. if (!node.childrenStates.loadingError) return null;
  3728. return h(Tip, {
  3729. attrs: {
  3730. type: "error",
  3731. icon: "error"
  3732. }
  3733. }, [node.childrenStates.loadingError, h("a", {
  3734. "class": "vue-treeselect__retry",
  3735. attrs: {
  3736. title: instance.retryTitle
  3737. },
  3738. on: {
  3739. "mousedown": this.handleMouseDownOnRetry
  3740. }
  3741. }, [instance.retryText])]);
  3742. },
  3743. handleMouseEnterOption: function handleMouseEnterOption(evt) {
  3744. var instance = this.instance,
  3745. node = this.node;
  3746. if (evt.target !== evt.currentTarget) return;
  3747. instance.setCurrentHighlightedOption(node, false);
  3748. },
  3749. handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnOptionArrow() {
  3750. var instance = this.instance,
  3751. node = this.node;
  3752. instance.toggleExpanded(node);
  3753. }),
  3754. handleMouseDownOnLabelContainer: onLeftClick(function handleMouseDownOnLabelContainer() {
  3755. var instance = this.instance,
  3756. node = this.node;
  3757. if (node.isBranch && instance.disableBranchNodes) {
  3758. instance.toggleExpanded(node);
  3759. } else {
  3760. instance.select(node);
  3761. }
  3762. }),
  3763. handleMouseDownOnRetry: onLeftClick(function handleMouseDownOnRetry() {
  3764. var instance = this.instance,
  3765. node = this.node;
  3766. instance.loadChildrenOptions(node);
  3767. })
  3768. },
  3769. render: function render() {
  3770. var h = arguments[0];
  3771. var node = this.node;
  3772. var indentLevel = this.instance.shouldFlattenOptions ? 0 : node.level;
  3773. var listItemClass = defineProperty_default()({
  3774. 'vue-treeselect__list-item': true
  3775. }, "vue-treeselect__indent-level-".concat(indentLevel), true);
  3776. var transitionProps = {
  3777. props: {
  3778. name: 'vue-treeselect__list--transition'
  3779. }
  3780. };
  3781. return h("div", {
  3782. "class": listItemClass
  3783. }, [this.renderOption(), node.isBranch && h("transition", transitionProps, [this.renderSubOptionsList()])]);
  3784. }
  3785. };
  3786. /* harmony default export */ var Optionvue_type_script_lang_js_ = (Option);
  3787. // CONCATENATED MODULE: ./src/components/Option.vue?vue&type=script&lang=js&
  3788. /* harmony default export */ var components_Optionvue_type_script_lang_js_ = (Optionvue_type_script_lang_js_);
  3789. // CONCATENATED MODULE: ./src/components/Option.vue
  3790. var Option_render, Option_staticRenderFns
  3791. /* normalize component */
  3792. var Option_component = normalizeComponent(
  3793. components_Optionvue_type_script_lang_js_,
  3794. Option_render,
  3795. Option_staticRenderFns,
  3796. false,
  3797. null,
  3798. null,
  3799. null
  3800. )
  3801. /* hot reload */
  3802. if (false) { var Option_api; }
  3803. Option_component.options.__file = "src/components/Option.vue"
  3804. /* harmony default export */ var components_Option = (Option_component.exports);
  3805. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Menu.vue?vue&type=script&lang=js&
  3806. var directionMap = {
  3807. top: 'top',
  3808. bottom: 'bottom',
  3809. above: 'top',
  3810. below: 'bottom'
  3811. };
  3812. /* harmony default export */ var Menuvue_type_script_lang_js_ = ({
  3813. name: 'vue-treeselect--menu',
  3814. inject: ['instance'],
  3815. computed: {
  3816. menuStyle: function menuStyle() {
  3817. var instance = this.instance;
  3818. return {
  3819. maxHeight: instance.maxHeight + 'px'
  3820. };
  3821. },
  3822. menuContainerStyle: function menuContainerStyle() {
  3823. var instance = this.instance;
  3824. return {
  3825. zIndex: instance.appendToBody ? null : instance.zIndex
  3826. };
  3827. }
  3828. },
  3829. watch: {
  3830. 'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
  3831. if (newValue) {
  3832. this.$nextTick(this.onMenuOpen);
  3833. } else {
  3834. this.onMenuClose();
  3835. }
  3836. }
  3837. },
  3838. created: function created() {
  3839. this.menuSizeWatcher = null;
  3840. this.menuResizeAndScrollEventListeners = null;
  3841. },
  3842. mounted: function mounted() {
  3843. var instance = this.instance;
  3844. if (instance.menu.isOpen) this.$nextTick(this.onMenuOpen);
  3845. },
  3846. destroyed: function destroyed() {
  3847. this.onMenuClose();
  3848. },
  3849. methods: {
  3850. renderMenu: function renderMenu() {
  3851. var h = this.$createElement;
  3852. var instance = this.instance;
  3853. if (!instance.menu.isOpen) return null;
  3854. return h("div", {
  3855. ref: "menu",
  3856. "class": "vue-treeselect__menu",
  3857. on: {
  3858. "mousedown": instance.handleMouseDown
  3859. },
  3860. style: this.menuStyle
  3861. }, [this.renderBeforeList(), instance.async ? this.renderAsyncSearchMenuInner() : instance.localSearch.active ? this.renderLocalSearchMenuInner() : this.renderNormalMenuInner(), this.renderAfterList()]);
  3862. },
  3863. renderBeforeList: function renderBeforeList() {
  3864. var instance = this.instance;
  3865. var beforeListRenderer = instance.$scopedSlots['before-list'];
  3866. return beforeListRenderer ? beforeListRenderer() : null;
  3867. },
  3868. renderAfterList: function renderAfterList() {
  3869. var instance = this.instance;
  3870. var afterListRenderer = instance.$scopedSlots['after-list'];
  3871. return afterListRenderer ? afterListRenderer() : null;
  3872. },
  3873. renderNormalMenuInner: function renderNormalMenuInner() {
  3874. var instance = this.instance;
  3875. if (instance.rootOptionsStates.isLoading) {
  3876. return this.renderLoadingOptionsTip();
  3877. } else if (instance.rootOptionsStates.loadingError) {
  3878. return this.renderLoadingRootOptionsErrorTip();
  3879. } else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
  3880. return this.renderNoAvailableOptionsTip();
  3881. } else {
  3882. return this.renderOptionList();
  3883. }
  3884. },
  3885. renderLocalSearchMenuInner: function renderLocalSearchMenuInner() {
  3886. var instance = this.instance;
  3887. if (instance.rootOptionsStates.isLoading) {
  3888. return this.renderLoadingOptionsTip();
  3889. } else if (instance.rootOptionsStates.loadingError) {
  3890. return this.renderLoadingRootOptionsErrorTip();
  3891. } else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
  3892. return this.renderNoAvailableOptionsTip();
  3893. } else if (instance.localSearch.noResults) {
  3894. return this.renderNoResultsTip();
  3895. } else {
  3896. return this.renderOptionList();
  3897. }
  3898. },
  3899. renderAsyncSearchMenuInner: function renderAsyncSearchMenuInner() {
  3900. var instance = this.instance;
  3901. var entry = instance.getRemoteSearchEntry();
  3902. var shouldShowSearchPromptTip = instance.trigger.searchQuery === '' && !instance.defaultOptions;
  3903. var shouldShowNoResultsTip = shouldShowSearchPromptTip ? false : entry.isLoaded && entry.options.length === 0;
  3904. if (shouldShowSearchPromptTip) {
  3905. return this.renderSearchPromptTip();
  3906. } else if (entry.isLoading) {
  3907. return this.renderLoadingOptionsTip();
  3908. } else if (entry.loadingError) {
  3909. return this.renderAsyncSearchLoadingErrorTip();
  3910. } else if (shouldShowNoResultsTip) {
  3911. return this.renderNoResultsTip();
  3912. } else {
  3913. return this.renderOptionList();
  3914. }
  3915. },
  3916. renderOptionList: function renderOptionList() {
  3917. var h = this.$createElement;
  3918. var instance = this.instance;
  3919. return h("div", {
  3920. "class": "vue-treeselect__list"
  3921. }, [instance.forest.normalizedOptions.map(function (rootNode) {
  3922. return h(components_Option, {
  3923. attrs: {
  3924. node: rootNode
  3925. },
  3926. key: rootNode.id
  3927. });
  3928. })]);
  3929. },
  3930. renderSearchPromptTip: function renderSearchPromptTip() {
  3931. var h = this.$createElement;
  3932. var instance = this.instance;
  3933. return h(Tip, {
  3934. attrs: {
  3935. type: "search-prompt",
  3936. icon: "warning"
  3937. }
  3938. }, [instance.searchPromptText]);
  3939. },
  3940. renderLoadingOptionsTip: function renderLoadingOptionsTip() {
  3941. var h = this.$createElement;
  3942. var instance = this.instance;
  3943. return h(Tip, {
  3944. attrs: {
  3945. type: "loading",
  3946. icon: "loader"
  3947. }
  3948. }, [instance.loadingText]);
  3949. },
  3950. renderLoadingRootOptionsErrorTip: function renderLoadingRootOptionsErrorTip() {
  3951. var h = this.$createElement;
  3952. var instance = this.instance;
  3953. return h(Tip, {
  3954. attrs: {
  3955. type: "error",
  3956. icon: "error"
  3957. }
  3958. }, [instance.rootOptionsStates.loadingError, h("a", {
  3959. "class": "vue-treeselect__retry",
  3960. on: {
  3961. "click": instance.loadRootOptions
  3962. },
  3963. attrs: {
  3964. title: instance.retryTitle
  3965. }
  3966. }, [instance.retryText])]);
  3967. },
  3968. renderAsyncSearchLoadingErrorTip: function renderAsyncSearchLoadingErrorTip() {
  3969. var h = this.$createElement;
  3970. var instance = this.instance;
  3971. var entry = instance.getRemoteSearchEntry();
  3972. return h(Tip, {
  3973. attrs: {
  3974. type: "error",
  3975. icon: "error"
  3976. }
  3977. }, [entry.loadingError, h("a", {
  3978. "class": "vue-treeselect__retry",
  3979. on: {
  3980. "click": instance.handleRemoteSearch
  3981. },
  3982. attrs: {
  3983. title: instance.retryTitle
  3984. }
  3985. }, [instance.retryText])]);
  3986. },
  3987. renderNoAvailableOptionsTip: function renderNoAvailableOptionsTip() {
  3988. var h = this.$createElement;
  3989. var instance = this.instance;
  3990. return h(Tip, {
  3991. attrs: {
  3992. type: "no-options",
  3993. icon: "warning"
  3994. }
  3995. }, [instance.noOptionsText]);
  3996. },
  3997. renderNoResultsTip: function renderNoResultsTip() {
  3998. var h = this.$createElement;
  3999. var instance = this.instance;
  4000. return h(Tip, {
  4001. attrs: {
  4002. type: "no-results",
  4003. icon: "warning"
  4004. }
  4005. }, [instance.noResultsText]);
  4006. },
  4007. onMenuOpen: function onMenuOpen() {
  4008. this.adjustMenuOpenDirection();
  4009. this.setupMenuSizeWatcher();
  4010. this.setupMenuResizeAndScrollEventListeners();
  4011. },
  4012. onMenuClose: function onMenuClose() {
  4013. this.removeMenuSizeWatcher();
  4014. this.removeMenuResizeAndScrollEventListeners();
  4015. },
  4016. adjustMenuOpenDirection: function adjustMenuOpenDirection() {
  4017. var instance = this.instance;
  4018. if (!instance.menu.isOpen) return;
  4019. var $menu = instance.getMenu();
  4020. var $control = instance.getControl();
  4021. var menuRect = $menu.getBoundingClientRect();
  4022. var controlRect = $control.getBoundingClientRect();
  4023. var menuHeight = menuRect.height;
  4024. var viewportHeight = window.innerHeight;
  4025. var spaceAbove = controlRect.top;
  4026. var spaceBelow = window.innerHeight - controlRect.bottom;
  4027. var isControlInViewport = controlRect.top >= 0 && controlRect.top <= viewportHeight || controlRect.top < 0 && controlRect.bottom > 0;
  4028. var hasEnoughSpaceBelow = spaceBelow > menuHeight + MENU_BUFFER;
  4029. var hasEnoughSpaceAbove = spaceAbove > menuHeight + MENU_BUFFER;
  4030. if (!isControlInViewport) {
  4031. instance.closeMenu();
  4032. } else if (instance.openDirection !== 'auto') {
  4033. instance.menu.placement = directionMap[instance.openDirection];
  4034. } else if (hasEnoughSpaceBelow || !hasEnoughSpaceAbove) {
  4035. instance.menu.placement = 'bottom';
  4036. } else {
  4037. instance.menu.placement = 'top';
  4038. }
  4039. },
  4040. setupMenuSizeWatcher: function setupMenuSizeWatcher() {
  4041. var instance = this.instance;
  4042. var $menu = instance.getMenu();
  4043. if (this.menuSizeWatcher) return;
  4044. this.menuSizeWatcher = {
  4045. remove: watchSize($menu, this.adjustMenuOpenDirection)
  4046. };
  4047. },
  4048. setupMenuResizeAndScrollEventListeners: function setupMenuResizeAndScrollEventListeners() {
  4049. var instance = this.instance;
  4050. var $control = instance.getControl();
  4051. if (this.menuResizeAndScrollEventListeners) return;
  4052. this.menuResizeAndScrollEventListeners = {
  4053. remove: setupResizeAndScrollEventListeners($control, this.adjustMenuOpenDirection)
  4054. };
  4055. },
  4056. removeMenuSizeWatcher: function removeMenuSizeWatcher() {
  4057. if (!this.menuSizeWatcher) return;
  4058. this.menuSizeWatcher.remove();
  4059. this.menuSizeWatcher = null;
  4060. },
  4061. removeMenuResizeAndScrollEventListeners: function removeMenuResizeAndScrollEventListeners() {
  4062. if (!this.menuResizeAndScrollEventListeners) return;
  4063. this.menuResizeAndScrollEventListeners.remove();
  4064. this.menuResizeAndScrollEventListeners = null;
  4065. }
  4066. },
  4067. render: function render() {
  4068. var h = arguments[0];
  4069. return h("div", {
  4070. ref: "menu-container",
  4071. "class": "vue-treeselect__menu-container",
  4072. style: this.menuContainerStyle
  4073. }, [h("transition", {
  4074. attrs: {
  4075. name: "vue-treeselect__menu--transition"
  4076. }
  4077. }, [this.renderMenu()])]);
  4078. }
  4079. });
  4080. // CONCATENATED MODULE: ./src/components/Menu.vue?vue&type=script&lang=js&
  4081. /* harmony default export */ var components_Menuvue_type_script_lang_js_ = (Menuvue_type_script_lang_js_);
  4082. // CONCATENATED MODULE: ./src/components/Menu.vue
  4083. var Menu_render, Menu_staticRenderFns
  4084. /* normalize component */
  4085. var Menu_component = normalizeComponent(
  4086. components_Menuvue_type_script_lang_js_,
  4087. Menu_render,
  4088. Menu_staticRenderFns,
  4089. false,
  4090. null,
  4091. null,
  4092. null
  4093. )
  4094. /* hot reload */
  4095. if (false) { var Menu_api; }
  4096. Menu_component.options.__file = "src/components/Menu.vue"
  4097. /* harmony default export */ var Menu = (Menu_component.exports);
  4098. // EXTERNAL MODULE: external "Vue"
  4099. var external_Vue_ = __webpack_require__(34);
  4100. var external_Vue_default = /*#__PURE__*/__webpack_require__.n(external_Vue_);
  4101. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MenuPortal.vue?vue&type=script&lang=js&
  4102. function MenuPortalvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  4103. function MenuPortalvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { MenuPortalvue_type_script_lang_js_ownKeys(source, true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { MenuPortalvue_type_script_lang_js_ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  4104. var PortalTarget = {
  4105. name: 'vue-treeselect--portal-target',
  4106. inject: ['instance'],
  4107. watch: {
  4108. 'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
  4109. if (newValue) {
  4110. this.setupHandlers();
  4111. } else {
  4112. this.removeHandlers();
  4113. }
  4114. },
  4115. 'instance.menu.placement': function instanceMenuPlacement() {
  4116. this.updateMenuContainerOffset();
  4117. }
  4118. },
  4119. created: function created() {
  4120. this.controlResizeAndScrollEventListeners = null;
  4121. this.controlSizeWatcher = null;
  4122. },
  4123. mounted: function mounted() {
  4124. var instance = this.instance;
  4125. if (instance.menu.isOpen) this.setupHandlers();
  4126. },
  4127. methods: {
  4128. setupHandlers: function setupHandlers() {
  4129. this.updateWidth();
  4130. this.updateMenuContainerOffset();
  4131. this.setupControlResizeAndScrollEventListeners();
  4132. this.setupControlSizeWatcher();
  4133. },
  4134. removeHandlers: function removeHandlers() {
  4135. this.removeControlResizeAndScrollEventListeners();
  4136. this.removeControlSizeWatcher();
  4137. },
  4138. setupControlResizeAndScrollEventListeners: function setupControlResizeAndScrollEventListeners() {
  4139. var instance = this.instance;
  4140. var $control = instance.getControl();
  4141. if (this.controlResizeAndScrollEventListeners) return;
  4142. this.controlResizeAndScrollEventListeners = {
  4143. remove: setupResizeAndScrollEventListeners($control, this.updateMenuContainerOffset)
  4144. };
  4145. },
  4146. setupControlSizeWatcher: function setupControlSizeWatcher() {
  4147. var _this = this;
  4148. var instance = this.instance;
  4149. var $control = instance.getControl();
  4150. if (this.controlSizeWatcher) return;
  4151. this.controlSizeWatcher = {
  4152. remove: watchSize($control, function () {
  4153. _this.updateWidth();
  4154. _this.updateMenuContainerOffset();
  4155. })
  4156. };
  4157. },
  4158. removeControlResizeAndScrollEventListeners: function removeControlResizeAndScrollEventListeners() {
  4159. if (!this.controlResizeAndScrollEventListeners) return;
  4160. this.controlResizeAndScrollEventListeners.remove();
  4161. this.controlResizeAndScrollEventListeners = null;
  4162. },
  4163. removeControlSizeWatcher: function removeControlSizeWatcher() {
  4164. if (!this.controlSizeWatcher) return;
  4165. this.controlSizeWatcher.remove();
  4166. this.controlSizeWatcher = null;
  4167. },
  4168. updateWidth: function updateWidth() {
  4169. var instance = this.instance;
  4170. var $portalTarget = this.$el;
  4171. var $control = instance.getControl();
  4172. var controlRect = $control.getBoundingClientRect();
  4173. $portalTarget.style.width = controlRect.width + 'px';
  4174. },
  4175. updateMenuContainerOffset: function updateMenuContainerOffset() {
  4176. var instance = this.instance;
  4177. var $control = instance.getControl();
  4178. var $portalTarget = this.$el;
  4179. var controlRect = $control.getBoundingClientRect();
  4180. var portalTargetRect = $portalTarget.getBoundingClientRect();
  4181. var offsetY = instance.menu.placement === 'bottom' ? controlRect.height : 0;
  4182. var left = Math.round(controlRect.left - portalTargetRect.left) + 'px';
  4183. var top = Math.round(controlRect.top - portalTargetRect.top + offsetY) + 'px';
  4184. var menuContainerStyle = this.$refs.menu.$refs['menu-container'].style;
  4185. var transformVariations = ['transform', 'webkitTransform', 'MozTransform', 'msTransform'];
  4186. var transform = find(transformVariations, function (t) {
  4187. return t in document.body.style;
  4188. });
  4189. menuContainerStyle[transform] = "translate(".concat(left, ", ").concat(top, ")");
  4190. }
  4191. },
  4192. render: function render() {
  4193. var h = arguments[0];
  4194. var instance = this.instance;
  4195. var portalTargetClass = ['vue-treeselect__portal-target', instance.wrapperClass];
  4196. var portalTargetStyle = {
  4197. zIndex: instance.zIndex
  4198. };
  4199. return h("div", {
  4200. "class": portalTargetClass,
  4201. style: portalTargetStyle,
  4202. attrs: {
  4203. "data-instance-id": instance.getInstanceId()
  4204. }
  4205. }, [h(Menu, {
  4206. ref: "menu"
  4207. })]);
  4208. },
  4209. destroyed: function destroyed() {
  4210. this.removeHandlers();
  4211. }
  4212. };
  4213. var placeholder;
  4214. /* harmony default export */ var MenuPortalvue_type_script_lang_js_ = ({
  4215. name: 'vue-treeselect--menu-portal',
  4216. created: function created() {
  4217. this.portalTarget = null;
  4218. },
  4219. mounted: function mounted() {
  4220. this.setup();
  4221. },
  4222. destroyed: function destroyed() {
  4223. this.teardown();
  4224. },
  4225. methods: {
  4226. setup: function setup() {
  4227. var el = document.createElement('div');
  4228. document.body.appendChild(el);
  4229. this.portalTarget = new external_Vue_default.a(MenuPortalvue_type_script_lang_js_objectSpread({
  4230. el: el,
  4231. parent: this
  4232. }, PortalTarget));
  4233. },
  4234. teardown: function teardown() {
  4235. document.body.removeChild(this.portalTarget.$el);
  4236. this.portalTarget.$el.innerHTML = '';
  4237. this.portalTarget.$destroy();
  4238. this.portalTarget = null;
  4239. }
  4240. },
  4241. render: function render() {
  4242. var h = arguments[0];
  4243. if (!placeholder) placeholder = h("div", {
  4244. "class": "vue-treeselect__menu-placeholder"
  4245. });
  4246. return placeholder;
  4247. }
  4248. });
  4249. // CONCATENATED MODULE: ./src/components/MenuPortal.vue?vue&type=script&lang=js&
  4250. /* harmony default export */ var components_MenuPortalvue_type_script_lang_js_ = (MenuPortalvue_type_script_lang_js_);
  4251. // CONCATENATED MODULE: ./src/components/MenuPortal.vue
  4252. var MenuPortal_render, MenuPortal_staticRenderFns
  4253. /* normalize component */
  4254. var MenuPortal_component = normalizeComponent(
  4255. components_MenuPortalvue_type_script_lang_js_,
  4256. MenuPortal_render,
  4257. MenuPortal_staticRenderFns,
  4258. false,
  4259. null,
  4260. null,
  4261. null
  4262. )
  4263. /* hot reload */
  4264. if (false) { var MenuPortal_api; }
  4265. MenuPortal_component.options.__file = "src/components/MenuPortal.vue"
  4266. /* harmony default export */ var MenuPortal = (MenuPortal_component.exports);
  4267. // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Treeselect.vue?vue&type=script&lang=js&
  4268. /* harmony default export */ var Treeselectvue_type_script_lang_js_ = ({
  4269. name: 'vue-treeselect',
  4270. mixins: [treeselectMixin],
  4271. computed: {
  4272. wrapperClass: function wrapperClass() {
  4273. return {
  4274. 'vue-treeselect': true,
  4275. 'vue-treeselect--single': this.single,
  4276. 'vue-treeselect--multi': this.multiple,
  4277. 'vue-treeselect--searchable': this.searchable,
  4278. 'vue-treeselect--disabled': this.disabled,
  4279. 'vue-treeselect--focused': this.trigger.isFocused,
  4280. 'vue-treeselect--has-value': this.hasValue,
  4281. 'vue-treeselect--open': this.menu.isOpen,
  4282. 'vue-treeselect--open-above': this.menu.placement === 'top',
  4283. 'vue-treeselect--open-below': this.menu.placement === 'bottom',
  4284. 'vue-treeselect--branch-nodes-disabled': this.disableBranchNodes,
  4285. 'vue-treeselect--append-to-body': this.appendToBody
  4286. };
  4287. }
  4288. },
  4289. render: function render() {
  4290. var h = arguments[0];
  4291. return h("div", {
  4292. ref: "wrapper",
  4293. "class": this.wrapperClass
  4294. }, [h(HiddenFields), h(Control, {
  4295. ref: "control"
  4296. }), this.appendToBody ? h(MenuPortal, {
  4297. ref: "portal"
  4298. }) : h(Menu, {
  4299. ref: "menu"
  4300. })]);
  4301. }
  4302. });
  4303. // CONCATENATED MODULE: ./src/components/Treeselect.vue?vue&type=script&lang=js&
  4304. /* harmony default export */ var components_Treeselectvue_type_script_lang_js_ = (Treeselectvue_type_script_lang_js_);
  4305. // CONCATENATED MODULE: ./src/components/Treeselect.vue
  4306. var Treeselect_render, Treeselect_staticRenderFns
  4307. /* normalize component */
  4308. var Treeselect_component = normalizeComponent(
  4309. components_Treeselectvue_type_script_lang_js_,
  4310. Treeselect_render,
  4311. Treeselect_staticRenderFns,
  4312. false,
  4313. null,
  4314. null,
  4315. null
  4316. )
  4317. /* hot reload */
  4318. if (false) { var Treeselect_api; }
  4319. Treeselect_component.options.__file = "src/components/Treeselect.vue"
  4320. /* harmony default export */ var Treeselect = (Treeselect_component.exports);
  4321. // EXTERNAL MODULE: ./src/style.less
  4322. var style = __webpack_require__(35);
  4323. // CONCATENATED MODULE: ./src/index.js
  4324. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; });
  4325. /* concated harmony reexport Treeselect */__webpack_require__.d(__webpack_exports__, "Treeselect", function() { return Treeselect; });
  4326. /* concated harmony reexport treeselectMixin */__webpack_require__.d(__webpack_exports__, "treeselectMixin", function() { return treeselectMixin; });
  4327. /* concated harmony reexport LOAD_ROOT_OPTIONS */__webpack_require__.d(__webpack_exports__, "LOAD_ROOT_OPTIONS", function() { return LOAD_ROOT_OPTIONS; });
  4328. /* concated harmony reexport LOAD_CHILDREN_OPTIONS */__webpack_require__.d(__webpack_exports__, "LOAD_CHILDREN_OPTIONS", function() { return LOAD_CHILDREN_OPTIONS; });
  4329. /* concated harmony reexport ASYNC_SEARCH */__webpack_require__.d(__webpack_exports__, "ASYNC_SEARCH", function() { return ASYNC_SEARCH; });
  4330. /* harmony default export */ var src = __webpack_exports__["default"] = (Treeselect);
  4331. var VERSION = "0.4.0";
  4332. /***/ })
  4333. /******/ ]);
  4334. });
  4335. //# sourceMappingURL=vue-treeselect.umd.js.map