![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-full/dist/js/ |
Upload File : |
/*** module: node_modules/absol-acomp/js/VerticalTreeDiagram.js ***/ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VerticalTreeDiagramNode = VerticalTreeDiagramNode; exports.default = void 0; require("../css/verticaltreediagram.css"); var _ACore = _interopRequireWildcard(require("../ACore")); var _OOP = _interopRequireDefault(require("absol/src/HTML5/OOP")); function VerticalTreeDiagramNode() { this.$childCtn = (0, _ACore.$)('.as-vertical-tree-diagram-child-ctn', this); this.$name = (0, _ACore.$)('.as-vertical-tree-diagram-node-name', this); _OOP.default.drillProperty(this, this.$name.firstChild, 'name', 'data'); this.name = "UndefinedNodeName"; } VerticalTreeDiagramNode.tag = 'VerticalTreeDiagramNode'.toLowerCase(); VerticalTreeDiagramNode.render = function () { return (0, _ACore._)({ class: 'as-vertical-tree-diagram-node', child: [{ class: 'as-vertical-tree-diagram-node-name-ctn', child: { class: 'as-vertical-tree-diagram-node-name', child: { text: "" } } }, { class: 'as-vertical-tree-diagram-child-ctn' }] }); }; ['addChild', 'removeChild', 'clearChild', 'addChildBefore', 'addChildAfter', 'findChildBefore', 'findChildAfter'].forEach(function (name) { VerticalTreeDiagramNode.prototype[name] = function () { this.$childCtn[name].apply(this.$childCtn, arguments); if (this.$childCtn.childNodes.length > 0) { this.addClass('as-has-child'); if (this.$childCtn.childNodes.length === 1) { this.addClass('as-has-1-child'); } else { this.removeClass('as-has-1-child'); } } else { this.removeClass('as-has-child'); this.removeClass('as-has-1-child'); } }; }); function VerticalTreeDiagram(data) { this.data = data || {}; } VerticalTreeDiagram.tag = 'VerticalTreeDiagram'.toLowerCase(); VerticalTreeDiagram.render = function () { return (0, _ACore._)(VerticalTreeDiagramNode.tag, true); }; VerticalTreeDiagram.property = {}; VerticalTreeDiagram.property.data = { set: function (data) { data = data || {}; this._data = data; function makeNode(nodeData) { return (0, _ACore._)({ tag: VerticalTreeDiagramNode.tag, props: { name: nodeData.name }, child: nodeData.child && nodeData.child.length > 0 && nodeData.child.map(makeNode) || [] }); } this.name = data.name + ''; this.clearChild(); if (data.child) this.addChild(data.child.map(makeNode)); }, get: function () { return this._data; } }; _ACore.default.install(VerticalTreeDiagramNode); _ACore.default.install(VerticalTreeDiagram); var _default = VerticalTreeDiagram; exports.default = _default;