2 lines
8.2 KiB
JavaScript
2 lines
8.2 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.organizationchart=function(e,t,n){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(t);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function l(e){if(Array.isArray(e))return i(e)}function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function f(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function y(e){return y="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},y(e)}function g(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=S();return function(){var n,o=v(e);if(t){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return g(this,n)}}function S(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var E=function(e){m(o,e);var t=N(o);function o(e){var n;return p(this,o),(n=t.call(this,e)).node=n.props.node,n.state={expanded:n.node.expanded},n}return f(o,[{key:"getLeaf",value:function(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)}},{key:"getColspan",value:function(){return this.node.children&&this.node.children.length?2*this.node.children.length:null}},{key:"onNodeClick",value:function(e,t){this.props.onNodeClick(e,t)}},{key:"toggleNode",value:function(e,t){this.setState((function(e){return{expanded:!e.expanded}})),e.preventDefault()}},{key:"isSelected",value:function(){return this.props.isSelected(this.node)}},{key:"render",value:function(){var e=this;this.node=this.props.node;var t=this.getColspan(),i=n.classNames("p-organizationchart-node-content",this.node.className,{"p-organizationchart-selectable-node":this.props.selectionMode&&!1!==this.node.selectable,"p-highlight":this.isSelected()}),l=this.props.nodeTemplate&&this.props.nodeTemplate(this.node)?r.default.createElement("div",null,this.props.nodeTemplate(this.node)):r.default.createElement("div",null,this.node.label),a=n.classNames("p-node-toggler-icon",{"pi pi-chevron-down":this.state.expanded,"pi pi-chevron-up":!this.state.expanded
|