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

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

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

var _ScalableComponent = _interopRequireDefault(require("../core/ScalableComponent"));

var _Dom = _interopRequireDefault(require("absol/src/HTML5/Dom"));

var _stringGenerate = require("absol/src/String/stringGenerate");


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

function Table() {
  _ScalableComponent.default.call(this);
}

Object.defineProperties(Table.prototype, Object.getOwnPropertyDescriptors(_ScalableComponent.default.prototype));
Table.prototype.constructor = Table;
Table.prototype.tag = "Table";
Table.prototype.menuIcon = "span.mdi.mdi-table-large";

Table.prototype.onCreate = function () {
  _ScalableComponent.default.prototype.onCreate.call(this);

  this.attributes.header = this.attributes.header || [(0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10)];
  this.attributes.body = this.attributes.body || [[(0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10)], [(0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10)], [(0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10), (0, _stringGenerate.randomPhrase)(10)]];
  this.style.height = 100;
  this.style.width = 300;
}; // Table.prototype.onCreated = function () {
//     ScalableComponent.prototype.onCreate.call(this);
// }


Table.prototype.render = function () {
  this.$table = _({
    tag: 'table',
    class: 'as-inner-table',
    child: ['thead', 'tbody']
  });
  return _({
    tag: 'tablescroller',
    child: this.$table,
    props: {
      fixedCol: 0
    }
  });
};

Table.prototype.setStyle = function () {
  var res = _ScalableComponent.default.prototype.setStyle.apply(this, arguments);

  return res;
};

Table.prototype.getAttributeHeaderDescriptor = function () {
  return {
    type: "array"
  };
};

Table.prototype.getAttributeBodyDescriptor = function () {
  return {
    type: "array2d"
  };
};

Table.prototype.getAttributeFixedColDescriptor = function () {
  return {
    type: "number",
    min: 0,
    max: Infinity
  };
};

Table.prototype.setAttributeHeader = function (header) {
  if (!(header.length > 0)) {
    header = ["Data Error"];
  }

  var headerElt = $('thead', this.$table).clearChild();
  headerElt.clearChild();

  var rowElt = _('tr');

  var cellElt;

  for (var i = 0; i < header.length; ++i) {
    cellElt = _({
      tag: 'th',
      child: {
        text: header[i] + ''
      }
    });
    rowElt.addChild(cellElt);
  }

  headerElt.addChild(rowElt);

  this.view._updateContent();

  return header;
};

Table.prototype.setAttributeBody = function (body) {
  if (!(body.length > 0)) {
    body = [["Data Error"]];
  }

  var bodyElt = $('tbody', this.$table).clearChild();
  var rowElt; // var cellElt;

  var row, cell;

  for (var i = 0; i < body.length; ++i) {
    row = body[i];
    rowElt = _('tr').addTo(bodyElt);

    for (var j = 0; j < row.length; ++j) {
      cell = row[j];

      _({
        tag: 'td',
        child: {
          text: cell + ''
        }
      }).addTo(rowElt);
    }
  }

  this.view._updateContent();

  return body;
};

Table.prototype.setAttributeFixedCol = function (value) {
  if (value >= 0) {} else {
    value = 0;
  }

  this.view.fixedCol = value;
  return value;
};

var _default = Table;
exports.default = _default;

VaKeR 2022