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__anchors__ChainAnchor.js
/*** module: node_modules/absol-form/js/anchors/ChainAnchor.js ***/
"use strict";

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

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

var _FViewable = _interopRequireDefault(require("../core/FViewable"));

var _LinearAnchor = _interopRequireDefault(require("./LinearAnchor"));

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

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

var _makeMapStyleHandler = _interopRequireDefault(require("./makeMapStyleHandler"));


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

function ChainAnchor() {
  _FViewable.default.call(this);

  this.style.left = 0;
  this.style.right = 0;
  this.style.top = 0;
  this.style.bottom = 0;
  this.style.vAlign = 'top';
  this.childNode = null; //for quick binding render

  this.viewBinding = {};
  this.onCreate();
  this.domElt = this.render();
  this.onCreated();
}

(0, _inheritComponentClass.default)(ChainAnchor, _LinearAnchor.default);
ChainAnchor.prototype.TOP_CLASS_NAME = 'as-chain-anchor-box';
ChainAnchor.prototype.VALIGN_CLASS_NAMES = {
  top: 'as-valign-top',
  center: 'as-valign-center',
  bottom: 'as-valign-bottom'
};
ChainAnchor.prototype.VALIGN_ACCEPTS_VALUES = ['top', 'center', 'bottom'];
['left', 'right', 'top', 'bottom', 'width', 'height', 'vAlign', 'hidden'].forEach(function (name) {
  ChainAnchor.prototype.styleHandlers[name] = (0, _makeMapStyleHandler.default)(name);
});
ChainAnchor.prototype.compStyleHandlers.vAlign = {
  set: function (value) {
    var currentValue = arguments[arguments.length - 1].get();
    if (this.anchor.VALIGN_ACCEPTS_VALUES.indexOf(value) < 0) value = this.anchor.VALIGN_ACCEPTS_VALUES[0];

    if (this.anchor.VALIGN_CLASS_NAMES[currentValue]) {
      this.anchor.domElt.removeClass(this.anchor.VALIGN_CLASS_NAMES[currentValue]);
    }

    this.anchor.domElt.addClass(this.anchor.VALIGN_CLASS_NAMES[value]);
    return value;
  },
  descriptor: function () {
    return {
      type: 'enum',
      values: this.anchor.VALIGN_ACCEPTS_VALUES,
      disabled: false,
      sign: 'ChainAnchor_VAlign',
      independence: true
    };
  }
};

ChainAnchor.prototype.render = function () {
  var layout = {
    class: ['as-anchor-box', this.TOP_CLASS_NAME]
  };
  return _(layout);
};
/**
 * @param {BaseComponent} child
 */


ChainAnchor.prototype.attachChild = function (child) {
  if (this.childNode) {
    this.childNode.view.remove();
    this.childNode = null;
    this.childNode.anchor = null;
  }

  if (child.anchor) throw new Error("Detach anchorBox first");
  this.childNode = child;
  child.anchor = this;
  this.childNode.style.width = this.childNode.style.width || 0;
  this.childNode.style.height = this.childNode.style.height || 0;
  this.childNode.style.left = this.childNode.style.left || 0;
  this.childNode.style.right = this.childNode.style.right || 0;
  this.childNode.style.top = this.childNode.style.top || 0;
  this.childNode.style.bottom = this.childNode.style.bottom || 0;
  this.childNode.style.vAlign = this.childNode.style.vAlign || 'top';
  this.style.left = this.childNode.style.left;
  this.style.right = this.childNode.style.right;
  this.style.top = this.childNode.style.top;
  this.style.bottom = this.childNode.style.bottom;
  this.style.vAlign = this.childNode.style.vAlign;
  this.view.addChild(child.view);
  this.view.attr('data-anchor-of', child.tag);
  this.style.loadAttributeHandlers(this.styleHandlers);
  child.style.loadAttributeHandlers(Object.assign({}, child.styleHandlers, this.compStyleHandlers));
  child.onAnchorAttached();
};

var _default = ChainAnchor;
exports.default = _default;

VaKeR 2022