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__dom__LineStyleSelectMenu.js
/*** module: node_modules/absol-form/js/dom/LineStyleSelectMenu.js ***/
"use strict";

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

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

var _FollowerToggler = _interopRequireDefault(require("absol-acomp/js/FollowerToggler"));

var _ACore = _interopRequireDefault(require("absol-acomp/ACore"));




/**
 * @extends FollowerToggler
 * @constructor
 */
function LineStyleSelectMenu() {
  this._value = 'solid';
  this.$styleListBox = (0, _FCore._)({
    tag: 'follower',
    props: {
      anchor: [1, 6]
    },
    class: ['as-line-style-select-menu-list-box', 'as-dropdown-box-common-style'],
    child: ['solid', 'double', 'dotted', 'dashed', 'wavy'].map(value => {
      return {
        class: ['as-line-style-select-menu-item'].concat(value === this._value ? ['as-selected'] : []),
        attr: {
          'data-value': value
        },
        style: {
          textDecoration: 'line-through ' + value
        },
        child: {
          text: ' '.repeat(32)
        },
        on: {
          click: event => {
            this._value = value;

            this._updateSelectedItem();

            this.close();
            this.addStyle('textDecoration', 'line-through ' + value);
            this.emit('change', {
              type: 'change',
              value: value,
              target: this,
              originalEvent: event
            }, this);
          }
        }
      };
    })
  });
  this.bindFollower(this.$styleListBox);
  this.$items = (0, _FCore.$$)('.as-line-style-select-menu-item', this.$styleListBox);
  this.on('preopen', () => {
    this.$styleListBox.addTo(document.body);
    var cur = this;
    var zIndex = 0;

    while (cur) {
      zIndex = Math.max(parseInt(getComputedStyle(cur).zIndex) || 0, zIndex);
      cur = cur.parentElement;
    }

    this.$styleListBox.addStyle('zIndex', zIndex + 2);
    console.log(zIndex);
  }).on('close', () => {
    this.$styleListBox.remove();
  });
}

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

LineStyleSelectMenu.render = function () {
  return (0, _FCore._)({
    tag: _FollowerToggler.default,
    extendEvent: 'change',
    class: 'as-line-style-select-menu',
    style: {
      textDecorationLine: 'line-through',
      textDecorationStyle: 'solid'
    },
    child: [{
      text: ' '.repeat(32)
    }, {
      tag: 'button',
      class: 'absol-selectmenu-btn',
      child: _ACore.default._('dropdown-ico')
    }]
  });
};

LineStyleSelectMenu.prototype._updateSelectedItem = function () {
  var value = this._value;
  this.$items.forEach(itemElt => {
    var itemValue = itemElt.attr('data-value');

    if (value === itemValue) {
      itemElt.addClass('as-selected');
    } else {
      itemElt.removeClass('as-selected');
    }
  });
};

LineStyleSelectMenu.property = {};
LineStyleSelectMenu.property.value = {
  set: function (value) {
    if (!['solid', 'double', 'dotted', 'dashed', 'wavy'].includes(value)) value = 'solid';
    this._value = value;

    this._updateSelectedItem();
  },
  get: function () {
    return this._value;
  }
};

_FCore.default.install(LineStyleSelectMenu);

var _default = LineStyleSelectMenu;
exports.default = _default;

VaKeR 2022