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__SelectBoxItem.js
/*** module: node_modules/absol-acomp/js/SelectBoxItem.js ***/
"use strict";

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

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

var _OOP = _interopRequireDefault(require("absol/src/HTML5/OOP"));

var _AElement = _interopRequireDefault(require("absol/src/HTML5/AElement"));

var _EventEmitter = _interopRequireDefault(require("absol/src/HTML5/EventEmitter"));


var _ = _ACore.default._;
var $ = _ACore.default.$;
/***
 * @extends AElement
 * @constructor
 */

function SelectBoxItem() {
  this._themeClassName = null;
  this.$text = $('.absol-selectbox-item-text', this);
  this.$close = $('.absol-selectbox-item-close', this);
  this.$close.on('click', this.eventHandler.clickClose);
  this.on('click', this.eventHandler.click);
}

;
SelectBoxItem.tag = 'SelectBoxItem'.toLowerCase();

SelectBoxItem.render = function () {
  return _({
    class: ['absol-selectbox-item'],
    extendEvent: ['close', 'press'],
    child: ['.absol-selectbox-item-text', {
      class: 'absol-selectbox-item-close',
      child: '<span class="mdi mdi-close"></span>'
    }]
  });
};

SelectBoxItem.eventHandler = {};

SelectBoxItem.eventHandler.clickClose = function (event) {
  this.emit('close', event);
};

SelectBoxItem.eventHandler.click = function (event) {
  if (!_EventEmitter.default.hitElement(this.$close, event)) {
    this.emit('press', event, this);
  }
};

SelectBoxItem.property = {};
SelectBoxItem.property.data = {
  set: function (value) {
    this._data = value;
    this.$text.clearChild();
    this.$text.addChild(_('<span>' + this.text + '</span>'));

    if (value && value.desc) {
      this.attr('title', value.desc);
    } else {
      this.attr('title', undefined);
    }

    if (this._themeClassName) this.removeClass(this._themeClassName);
    this._themeClassName = null;

    if (this.theme) {
      this._themeClassName = 'as-theme-' + this.theme;
      this.addClass(this._themeClassName);
    }
  },
  get: function () {
    return this._data;
  }
};
SelectBoxItem.property.text = {
  get: function () {
    if (typeof this._data == 'string') return this._data;else return this._data.text;
  }
};
SelectBoxItem.property.value = {
  get: function () {
    if (typeof this._data == 'string') return this._data;else return this._data.value;
  }
};
SelectBoxItem.property.theme = {
  get: function () {
    return this._data.theme || null;
  }
};
SelectBoxItem.property.active = {
  set: function (value) {
    if (value) {
      this.addClass('as-active');
    } else {
      this.removeClass('as-active');
    }
  },
  get: function () {
    return this.hasClass('as-active');
  }
};

_ACore.default.install(SelectBoxItem);

var _default = SelectBoxItem;
exports.default = _default;

VaKeR 2022