XWWitPark/witpark_jzzs/xw_jzzs_web/public/lib/jstree/jstree.min.js

2 lines
135 KiB
JavaScript
Raw Normal View History

2024-09-12 00:10:00 +00:00
/* 2020-9-22 15:23:19 | 版权所有 军懋国兴 */
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(S,E){"use strict";if(!S.jstree){var s=0,a=!1,n=!1,o=!1,r=[],e=S("script:last").attr("src"),y=window.document;S.jstree={version:"3.3.7",defaults:{plugins:[]},plugins:{},path:e&&-1!==e.indexOf("/")?e.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},S.jstree.create=function(e,r){var i=new S.jstree.core(++s),t=r;return r=S.extend(!0,{},S.jstree.defaults,r),t&&t.plugins&&(r.plugins=t.plugins),S.each(r.plugins,function(e,t){"core"!==e&&(i=i.plugin(t,r[t]))}),S(e).data("jstree",i),i.init(e,r),i},S.jstree.destroy=function(){S(".jstree:jstree").jstree("destroy"),S(y).off(".jstree")},S.jstree.core=function(e){this._id=e,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},S.jstree.reference=function(t){var r=null,e=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!e||!e.length)try{e=S(t)}catch(e){}if(!e||!e.length)try{e=S("#"+t.replace(S.jstree.idregex,"\\$&"))}catch(e){}return e&&e.length&&(e=e.closest(".jstree")).length&&(e=e.data("jstree"))?r=e:S(".jstree").each(function(){var e=S(this).data("jstree");return e&&e._model.data[t]?(r=e,!1):void 0}),r},S.fn.jstree=function(r){var i="string"==typeof r,s=Array.prototype.slice.call(arguments,1),a=null;return!(!0===r&&!this.length)&&(this.each(function(){var e=S.jstree.reference(this),t=i&&e?e[r]:null;return a=i&&t?t.apply(e,s):null,e||i||r!==E&&!S.isPlainObject(r)||S.jstree.create(this,r),(e&&!i||!0===r)&&(a=e||!1),(null===a||a===E)&&void 0}),null!==a&&a!==E?a:this)},S.expr.pseudos.jstree=S.expr.createPseudo(function(e){return function(e){return S(e).hasClass("jstree")&&S(e).data("jstree")!==E}}),S.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:S.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0,loaded_state:!1,restore_focus:!0,keyboard:{"ctrl-space":function(e){e.type="click",S(e.currentTarget).trigger(e)},enter:function(e){e.type="click",S(e.currentTarget).trigger(e)},left:function(e){var t;e.preventDefault(),this.is_open(e.currentTarget)?this.close_node(e.currentTarget):(t=this.get_parent(e.currentTarget))&&t.id!==S.jstree.root&&this.get_node(t,!0).children(".jstree-anchor").focus()},up:function(e){e.preventDefault();var t=this.get_prev_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},right:function(e){var t;e.preventDefault(),this.is_closed(e.currentTarget)?this.open_node(e.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()}):!this.is_open(e.currentTarget)||(t=this.get_node(e.currentTarget,!0).children(".jstree-children")[0])&&S(this._firstChild(t)).children(".jstree-anchor").focus()},down:function(e){e.preventDefault();var t=this.get_next_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},"*":function(){this.open_all()},home:function(e){e.preventDefault();var t=this._firstChild(this.get_container_ul()[0]);t&&S(t).children(".jstree-anchor").filter(":visible").focus()},end:function(e){e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()},f2:function(e){e.preventDefault(),this.edit(e.currentTarget)}}},S.jstree.core.prototype={plugin:function(e,t){var r=S.jstree.plugins[e];return r?(this._data[e]={},r.prototype=this,new r(t,this)):this},init:function(e,t){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[S.jstree.root]={id:S.jstree.root,parent:null,parent