YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/TreeModal.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"TreeModal.min.js","sources":["TreeModal.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\n'use strict';\n\n$.Class(\n\t'Base_TreeModal_JS',\n\t{},\n\t{\n\t\t/**\n\t\t * Event for select row\n\t\t */\n\t\tselectEvent: false,\n\t\t/**\n\t\t * Modal container\n\t\t */\n\t\tcontainer: false,\n\t\t/**\n\t\t * Jstree element\n\t\t */\n\t\ttree: false,\n\t\t/**\n\t\t * Multiple selection\n\t\t */\n\t\tmultiple: false,\n\t\t/**\n\t\t * Set event for select row\n\t\t * @param {function} cb\n\t\t */\n\t\tsetSelectEvent: function (cb) {\n\t\t\tthis.selectEvent = cb;\n\t\t},\n\t\t/**\n\t\t * Generate tree\n\t\t */\n\t\tgenerateTree: function () {\n\t\t\tlet plugins = [];\n\t\t\tif (this.multiple) {\n\t\t\t\tplugins.push('category');\n\t\t\t\tplugins.push('checkbox');\n\t\t\t}\n\t\t\tplugins.push('search');\n\t\t\tthis.tree.jstree(\n\t\t\t\t$.extend(\n\t\t\t\t\ttrue,\n\t\t\t\t\t{\n\t\t\t\t\t\tcore: {\n\t\t\t\t\t\t\tdata: JSON.parse(this.container.find('.js-tree-value').val()),\n\t\t\t\t\t\t\tthemes: {\n\t\t\t\t\t\t\t\tname: 'proton',\n\t\t\t\t\t\t\t\tresponsive: true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcheckbox: {\n\t\t\t\t\t\t\tthree_state: false\n\t\t\t\t\t\t},\n\t\t\t\t\t\tplugins: plugins\n\t\t\t\t\t},\n\t\t\t\t\tthis.tree.data('params')\n\t\t\t\t)\n\t\t\t);\n\t\t},\n\t\t/**\n\t\t * Register select events\n\t\t */\n\t\tregisterSelectEvent: function () {\n\t\t\tif (this.multiple) {\n\t\t\t\tthis.container.find('[name=\"saveButton\"]').on('click', () => {\n\t\t\t\t\tlet id = [],\n\t\t\t\t\t\tname = [];\n\t\t\t\t\t$.each(this.tree.jstree('getCategory', true), function (index, value) {\n\t\t\t\t\t\tid.push('T' + value.id);\n\t\t\t\t\t\tname.push(value.text);\n\t\t\t\t\t});\n\t\t\t\t\tthis.selectEvent({ id: id.join(), name: name.join(', ') });\n\t\t\t\t\tapp.hideModalWindow(false, this.container.parent().attr('id'));\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.tree.on('select_node.jstree', (event, data) => {\n\t\t\t\t\tthis.selectEvent({ id: 'T' + data.node.id, name: data.node.text });\n\t\t\t\t\tapp.hideModalWindow(false, this.container.parent().attr('id'));\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tregisterSearchEvent: function () {\n\t\t\tconst thisInstance = this;\n\t\t\tlet valueSearch = this.container.find('#valueSearchTree');\n\t\t\tvalueSearch.on('keypress', function (e) {\n\t\t\t\tif (e.which == 13) {\n\t\t\t\t\tthisInstance.searchingInTree(valueSearch.val());\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.container.find('#btnSearchTree').on('click', function () {\n\t\t\t\tthisInstance.searchingInTree(valueSearch.val());\n\t\t\t});\n\t\t},\n\t\tsearchingInTree: function (text) {\n\t\t\tthis.tree.jstree(true).search(text);\n\t\t},\n\t\t/**\n\t\t * Register base events\n\t\t * @param {jQuery} modalContainer\n\t\t */\n\t\tregisterEvents: function (modalContainer) {\n\t\t\tthis.container = modalContainer;\n\t\t\tthis.tree = this.container.find('.js-tree-contents');\n\t\t\tthis.multiple = this.container.find('.js-multiple').val() == 1 ? true : false;\n\t\t\tthis.generateTree();\n\t\t\tthis.registerSearchEvent();\n\t\t\tthis.registerSelectEvent();\n\t\t}\n\t}\n);\n"],"names":["$","Class","selectEvent","container","tree","multiple","setSelectEvent","cb","generateTree","plugins","push","jstree","extend","core","data","JSON","parse","find","val","themes","name","responsive","checkbox","three_state","registerSelectEvent","_this","on","id","each","index","value","text","join","app","hideModalWindow","parent","attr","event","node","registerSearchEvent","thisInstance","valueSearch","e","which","searchingInTree","search","registerEvents","modalContainer"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,CAAC,CAACC,KAAK,CACN,mBAAmB,CACnB,EAAE,CACF;AAED;AACA,KACEC,WAAW,GAAO;AAEpB;AACA,KACEC,SAAS,GAAO;AAElB;AACA,KACEC,IAAI,GAAO;AAEb;AACA,KACEC,QAAQ,GAAO;AAEjB;AACA;AACA,KACEC,cAAc,CAAE,SAAAA,cAAAA,CAAUC,EAAE,CAAE,CAC7B,IAAI,CAACL,WAAW,CAAGK,GACpB,CAAC;AAEH;AACA,KACEC,YAAY,CAAE,SAAAA,YAAAA,EAAY,CACzB,IAAIC,OAAO,CAAG,EAAE,CACZ,IAAI,CAACJ,QAAQ,GAChBI,OAAO,CAACC,IAAI,CAAC,UAAU,CAAC,CACxBD,OAAO,CAACC,IAAI,CAAC,UAAU,CAAC,CAAA,CAEzBD,OAAO,CAACC,IAAI,CAAC,QAAQ,CAAC,CACtB,IAAI,CAACN,IAAI,CAACO,MAAM,CACfX,CAAC,CAACY,MAAM,IAEP,CACCC,IAAI,CAAE,CACLC,IAAI,CAAEC,IAAI,CAACC,KAAK,CAAC,IAAI,CAACb,SAAS,CAACc,IAAI,CAAC,gBAAgB,CAAC,CAACC,GAAG,EAAE,CAAC,CAC7DC,MAAM,CAAE,CACPC,IAAI,CAAE,QAAQ,CACdC,UAAU,CAAA,CAAA,CACX,CACD,CAAC,CACDC,QAAQ,CAAE,CACTC,WAAW,GACZ,CAAC,CACDd,OAAO,CAAEA,OACV,CAAC,CACD,IAAI,CAACL,IAAI,CAACU,IAAI,CAAC,QAAQ,CACxB,CACD,EACD,CAAC;AAEH;AACA,KACEU,mBAAmB,CAAE,SAAAA,mBAAAA,EAAY,CAAA,IAAAC,KAAA,CAAA,IAAA,CAC5B,IAAI,CAACpB,QAAQ,C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