Files
DzzOffice/static/js/jstree.min.js

1 line
136 KiB
JavaScript
Raw Normal View History

2024-07-27 10:41:59 +08:00
/*! jsTree - v3.3.9 - 2020-02-11 - (MIT) */!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(e,t){"use strict";if(!e.jstree){var r=0,i=!1,s=!1,a=!1,n=[],o=e("script:last").attr("src"),d=window.document,c=window.setImmediate,l=window.Promise;!c&&l&&(c=function(e,t){l.resolve(t).then(e)}),e.jstree={version:"3.3.9",defaults:{plugins:[]},plugins:{},path:o&&-1!==o.indexOf("/")?o.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},e.jstree.create=function(t,i){var s=new e.jstree.core(++r),a=i;return i=e.extend(!0,{},e.jstree.defaults,i),a&&a.plugins&&(i.plugins=a.plugins),e.each(i.plugins,function(e,t){"core"!==e&&(s=s.plugin(t,i[t]))}),e(t).data("jstree",s),s.init(t,i),s},e.jstree.destroy=function(){e(".jstree:jstree").jstree("destroy"),e(d).off(".jstree")},e.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}}},e.jstree.reference=function(t){var r=null,i=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!i||!i.length)try{i=e(t)}catch(e){}if(!i||!i.length)try{i=e("#"+t.replace(e.jstree.idregex,"\\$&"))}catch(e){}return i&&i.length&&(i=i.closest(".jstree")).length&&(i=i.data("jstree"))?r=i:e(".jstree").each(function(){var i=e(this).data("jstree");return i&&i._model.data[t]?(r=i,!1):void 0}),r},e.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 n=e.jstree.reference(this),o=i&&n?n[r]:null;return a=i&&o?o.apply(n,s):null,n||i||r!==t&&!e.isPlainObject(r)||e.jstree.create(this,r),(n&&!i||!0===r)&&(a=n||!1),(null===a||a===t)&&void 0}),null!==a&&a!==t?a:this)},e.expr.pseudos.jstree=e.expr.createPseudo(function(r){return function(r){return e(r).hasClass("jstree")&&e(r).data("jstree")!==t}}),e.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:e.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(t){t.type="click",e(t.currentTarget).trigger(t)},enter:function(t){t.type="click",e(t.currentTarget).trigger(t)},left:function(t){if(t.preventDefault(),this.is_open(t.currentTarget))this.close_node(t.currentTarget);else{var r=this.get_parent(t.currentTarget);r&&r.id!==e.jstree.root&&this.get_node(r,!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(t){if(t.preventDefault(),this.is_closed(t.currentTarget))this.open_node(t.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()});else if(this.is_open(t.currentTarget)){var r=this.get_node(t.currentTarget,!0).children(".jstree-children")[0];r&&e(this._firstChild(r)).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(e){this.open_all()},home:function(t){t.preventDefault();var r=this._firstChild(this.get_container_ul()[0]);r&&e(r).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)}}},e.jstree.core.prototype={plugin:function(t,r){var i=e.jstree.plugins[t];return i?(this._data[t]={},i.prototype=this,new i(r,this)):this},init:function(t,r){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[e.jstree.root]={id:e.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this.element=e(t).addClass("jstree jstree-"+t