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__editor__ComponentPropertiesEditor.js
/*** module: node_modules/absol-form/js/editor/ComponentPropertiesEditor.js ***/
"use strict";

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

var _BaseEditor = _interopRequireDefault(require("../core/BaseEditor"));

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

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

var _AttributeEditor = _interopRequireDefault(require("./AttributeEditor"));

var _R = _interopRequireDefault(require("../R"));

var _StyleEditor = _interopRequireDefault(require("./StyleEditor"));

var _AllPropertyEditor = _interopRequireDefault(require("./AllPropertyEditor"));

var _QuickMenu = _interopRequireDefault(require("absol-acomp/js/QuickMenu"));

var _ResizeSystem = _interopRequireDefault(require("absol/src/HTML5/ResizeSystem"));


var _ = _FCore.default._;
var $ = _FCore.default.$;

function ComponentPropertiesEditor(editor) {
  _BaseEditor.default.call(this);

  this.editor = editor;
  var self = this;
  var repeatEvents = {
    change: function (event) {
      self.emit('change', Object.assign({
        componentPropertiesEditor: self
      }, event), self);
    },
    stopchange: function (event) {
      self.emit('stopchange', Object.assign({
        componentPropertiesEditor: self
      }, event), self);
    }
  };
  this.attributeEditor = new _AttributeEditor.default().on(repeatEvents).on('stopchange', function (event) {
    self.allPropertyEditor.updatePropertyRecursive(event.name);
  });
  this.styleEditor = new _StyleEditor.default().on(repeatEvents).on('stopchange', function (event) {
    self.allPropertyEditor.updatePropertyRecursive(event.name);
  });
  this.allPropertyEditor = new _AllPropertyEditor.default().on(repeatEvents).on('stopchange', function (event) {
    self.attributeEditor.updatePropertyRecursive(event.name);
    self.styleEditor.updatePropertyRecursive(event.name);
  });
  this.$dockElt = null;
  this.component = undefined;
}

Object.defineProperties(ComponentPropertiesEditor.prototype, Object.getOwnPropertyDescriptors(_BaseEditor.default.prototype));
ComponentPropertiesEditor.prototype.constructor = ComponentPropertiesEditor;
ComponentPropertiesEditor.prototype.CONFIG_STORE_KEY = "AS_ComponentPropertiesEditor_config";
ComponentPropertiesEditor.prototype.config = {};

ComponentPropertiesEditor.prototype.getView = function () {
  if (this.$view) return this.$view;
  var thisEditor = this;
  this.$attachhook = _('attachhook');
  this.$view = _({
    tag: 'tabview',
    class: ["as-form-component-properties-editor", 'xp-tiny'],
    child: [{
      tag: 'tabframe',
      class: 'absol-bscroller',
      attr: {
        name: 'Attribute'
      },
      child: this.attributeEditor.getView()
    }, {
      tag: 'tabframe',
      attr: {
        name: 'Style'
      },
      child: this.styleEditor.getView()
    }, {
      tag: 'tabframe',
      class: 'absol-bscroller',
      attr: {
        name: 'All'
      },
      child: this.allPropertyEditor.getView()
    }]
  });
  this.$view.appendChild(this.$attachhook);
  this.$attachhook.requestUpdateSize = this.updateSize.bind(this);

  _ResizeSystem.default.add(this.$attachhook);

  this.$quickmenuBtn = _({
    tag: 'button',
    class: ['as-form-component-properties-editor-quickmenu-button', 'as-from-tool-button'],
    child: 'span.mdi.mdi-dots-horizontal'
  });

  _QuickMenu.default.toggleWhenClick(this.$quickmenuBtn, {
    getMenuProps: function () {
      return {
        extendStyle: {
          'font-size': '12px'
        },
        items: [{
          text: 'Undock',
          icon: 'span.mdi.mdi-dock-window',
          cmd: 'undock'
        }, {
          text: 'Help',
          icon: 'span.mdi.mdi-help'
        }]
      };
    },
    onSelect: function (item) {
      switch (item.cmd) {
        case 'undock':
          break;
      }
    }
  });

  this.$view.appendChild(this.$quickmenuBtn);
  return this.$view;
};

ComponentPropertiesEditor.prototype.onAttached = function () {
  this.setContext(_R.default.ATTRIBUTE_EDITOR, this.attributeEditor);
  this.setContext(_R.default.STYLE_EDITOR, this.styleEditor);
  this.setContext(_R.default.ALL_PROPERTY_EDITOR, this.allPropertyEditor);
  this.attributeEditor.attach(this);
  this.styleEditor.attach(this);
  this.allPropertyEditor.attach(this);
};

ComponentPropertiesEditor.prototype.onStart = function () {
  this.getView();
  this.attributeEditor.start();
  this.styleEditor.start();
  this.allPropertyEditor.start();
};

ComponentPropertiesEditor.prototype.onDestroy = function () {
  this.attributeEditor.destroy();
  this.styleEditor.destroy();
  this.allPropertyEditor.destroy();
};

ComponentPropertiesEditor.prototype.onPause = function () {
  this.attributeEditor.pause();
  this.styleEditor.pause();
  this.allPropertyEditor.pause();
};

ComponentPropertiesEditor.prototype.onResume = function () {
  this.attributeEditor.resume();
  this.styleEditor.resume();
  this.allPropertyEditor.resume();
};

ComponentPropertiesEditor.prototype.edit = function () {
  this.component = arguments[0];
  this.components = Array.prototype.slice.call(arguments);
  this.styleEditor.edit.apply(this.styleEditor, arguments);
  this.attributeEditor.edit.apply(this.attributeEditor, arguments);
  this.allPropertyEditor.edit.apply(this.allPropertyEditor, arguments);
};

ComponentPropertiesEditor.prototype.updateSize = function () {
  var ateB = this.attributeEditor.getBound();
  var steB = this.styleEditor.getBound();
  var aleB = this.allPropertyEditor.getBound();
  var width = Math.max(ateB.width, steB.width, aleB.width);
  var height = Math.max(ateB.height, steB.height, aleB.height);

  if (width > 0 && height > 0) {
    this.$view.addStyle('min-width', Math.max(200, width) + 'px').addStyle('height', height + 'px');
  }

  this.$view.addStyle('max-height', '100%');
};

var _default = ComponentPropertiesEditor;
exports.default = _default;

VaKeR 2022