VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol-acomp__js__selecttreeleafbox__MSTBItemHolder.js
/*** module: node_modules/absol-acomp/js/selecttreeleafbox/MSTBItemHolder.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _ACore = require("../../ACore");

var _SelectTreeLeafItem = _interopRequireDefault(require("./SelectTreeLeafItem"));

var _MCheckTreeBox = require("../checktreebox/MCheckTreeBox");


function MSTBItemHolder(boxElt, parent, data) {
  this.ref = null;
  this.$list = boxElt.$list;
  this.level = parent.level + 1;
  this.status = 'none';
  this.boxElt = boxElt;
  this.parent = parent;
  this.data = data;
  this._elt = null;
  this.hasDesc = !!data.desc;
  this.hasIcon = !!data.icon;
  this.selected = false;

  if (data.items && data.items.length > 0) {
    this.children = data.items.map(item => new MSTBItemHolder(boxElt, this, item));
    this.hasDesc = this.hasDesc || this.children.some(child => child.hasDesc);
    this.hasIcon = this.hasIcon || this.children.some(child => child.hasIcon);
    this.status = 'close';
  }
}

MSTBItemHolder.prototype.ev_statusChange = _MCheckTreeBox.MCTBItemHolder.prototype.ev_statusChange;
MSTBItemHolder.prototype.getViewElements = _MCheckTreeBox.MCTBItemHolder.prototype.getViewElements;

MSTBItemHolder.prototype.select = function (flag) {
  this.selected = flag;

  if (this._elt) {
    this._elt.selected = flag;
  }
};

MSTBItemHolder.prototype.ev_click = function (event) {
  if (this.ref) {
    this.ref.ev_click(event);
  } else {
    this.boxElt.modes.normal.setValue(this.data.value);

    if (this.boxElt.mode !== this.boxElt.modes.normal) {
      this.boxElt.mode.updateSelectedFromRef();
    }

    this.boxElt.notifyPressItem({
      item: this.data
    });
  }
};

Object.defineProperty(MSTBItemHolder.prototype, 'elt', {
  get: function () {
    if (!this._elt) {
      this._elt = (0, _ACore._)({
        tag: _SelectTreeLeafItem.default,
        props: {
          data: this.data,
          level: this.level,
          status: this.status,
          selected: this.selected
        },
        on: {
          statuschange: this.ev_statusChange.bind(this),
          click: this.ev_click.bind(this)
        }
      });
    }

    return this._elt;
  }
});
var _default = MSTBItemHolder;
exports.default = _default;

VaKeR 2022